From 6be1c75d8f147fd0d987de0e138234f23613baea Mon Sep 17 00:00:00 2001 From: "renovate[bot]" Date: Thu, 17 Oct 2024 08:38:50 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20ahochste?= =?UTF-8?q?ger/gmail-processor@f1b5b696959b61484e2d5aa315688ead4d0e27d3=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 404.html | 2 +- assets/js/{392.1d599ed1.js => 392.3c5c3de4.js} | 4 ++-- ...92.1d599ed1.js.LICENSE.txt => 392.3c5c3de4.js.LICENSE.txt} | 0 .../js/{runtime~main.063c6f45.js => runtime~main.08fae093.js} | 2 +- blog/authors/index.html | 2 +- docs/community/changelog/index.html | 2 +- docs/community/code-of-conduct/index.html | 2 +- docs/community/contributing/index.html | 2 +- docs/community/index.html | 2 +- docs/development/devbox/index.html | 2 +- docs/development/index.html | 2 +- docs/examples/actions/actionAttachmentExtractText/index.html | 2 +- docs/examples/actions/actionExport/index.html | 2 +- docs/examples/actions/actionThreadRemoveLabel/index.html | 2 +- docs/examples/actions/index.html | 2 +- docs/examples/advanced/customActions/index.html | 2 +- docs/examples/advanced/index.html | 2 +- docs/examples/advanced/logSheetLogging/index.html | 2 +- docs/examples/advanced/regularExpressions/index.html | 2 +- docs/examples/basics/index.html | 2 +- docs/examples/basics/simple/index.html | 2 +- docs/examples/features/convertToGoogle/index.html | 2 +- docs/examples/features/index.html | 2 +- docs/examples/index.html | 2 +- docs/examples/migrations/index.html | 2 +- docs/examples/migrations/migrationAdvanced/index.html | 2 +- docs/examples/migrations/migrationMin/index.html | 2 +- docs/examples/regressions/index.html | 2 +- docs/examples/regressions/issue301/index.html | 2 +- docs/faqs/index.html | 2 +- docs/getting-started/index.html | 2 +- docs/index.html | 2 +- docs/migrating/index.html | 2 +- docs/reference/actions/index.html | 2 +- docs/reference/config-schema/index.html | 2 +- docs/reference/enum-types/index.html | 2 +- docs/reference/index.html | 2 +- docs/reference/logging/index.html | 2 +- docs/reference/placeholder/index.html | 2 +- index.html | 2 +- playground/index.html | 2 +- search/index.html | 2 +- 42 files changed, 42 insertions(+), 42 deletions(-) rename assets/js/{392.1d599ed1.js => 392.3c5c3de4.js} (99%) rename assets/js/{392.1d599ed1.js.LICENSE.txt => 392.3c5c3de4.js.LICENSE.txt} (100%) rename assets/js/{runtime~main.063c6f45.js => runtime~main.08fae093.js} (98%) diff --git a/404.html b/404.html index 44775fd6..3c7d6e5d 100644 --- a/404.html +++ b/404.html @@ -4,7 +4,7 @@ Page Not Found | Gmail Processor - + diff --git a/assets/js/392.1d599ed1.js b/assets/js/392.3c5c3de4.js similarity index 99% rename from assets/js/392.1d599ed1.js rename to assets/js/392.3c5c3de4.js index d20e6df2..92a95210 100644 --- a/assets/js/392.1d599ed1.js +++ b/assets/js/392.3c5c3de4.js @@ -1,2 +1,2 @@ -/*! For license information please see 392.1d599ed1.js.LICENSE.txt */ -"use strict";(self.webpackChunkgmail_processor_docs=self.webpackChunkgmail_processor_docs||[]).push([[392],{8478:(e,t,i)=>{i.r(t),i.d(t,{default:()=>o});i(6540);var n=i(2303),s=i(4848);function o(e){let{children:t,fallback:i}=e;return(0,n.A)()?(0,s.jsx)(s.Fragment,{children:t?.()}):i??null}},760:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return s.default.createElement(r.default,{fallback:s.default.createElement(l.LoadingLabel,null)},(()=>s.default.createElement(s.default.Fragment,null,s.default.createElement(a.default,{fallback:e=>s.default.createElement(h,{...e})},s.default.createElement(c,{...e})))))};const s=n(i(6540)),o=n(i(1569)),r=n(i(8478)),a=n(i(7489)),l=i(9659);function h(e){let{error:t,tryAgain:i}=e;return s.default.createElement("div",null,s.default.createElement("p",null,s.default.createElement(l.ErrorOccurredLabel,{error:t})),s.default.createElement("button",{onClick:i},"Try Again!"))}function d(e,t){let i=e;return"boolean"==typeof i||void 0===i.$id?`https://docusaurus.io/json-viewer/schema_${t}.json`:i.$id}function c(e){const{schema:t,diagnosticsOptions:i,...n}=e;return s.default.createElement(o.default,{height:"90vh",language:"json",editorWillMount:e=>{const n=(Array.isArray(t)?t:[t]).map(((e,i)=>({uri:d(t,i),fileMatch:["*"],schema:e})));e.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,schemas:n,...i})},...n})}},2113:()=>{},8047:(e,t,i)=>{i.r(t),i.d(t,{CancellationTokenSource:()=>ore,Emitter:()=>rre,KeyCode:()=>are,KeyMod:()=>lre,MarkerSeverity:()=>gre,MarkerTag:()=>pre,Position:()=>hre,Range:()=>dre,Selection:()=>cre,SelectionDirection:()=>ure,Token:()=>fre,Uri:()=>mre,default:()=>Ire,editor:()=>_re,languages:()=>vre});var n={};i.r(n),i.d(n,{CancellationTokenSource:()=>ore,Emitter:()=>rre,KeyCode:()=>are,KeyMod:()=>lre,MarkerSeverity:()=>gre,MarkerTag:()=>pre,Position:()=>hre,Range:()=>dre,Selection:()=>cre,SelectionDirection:()=>ure,Token:()=>fre,Uri:()=>mre,editor:()=>_re,languages:()=>vre});var s={};i.r(s),i.d(s,{CancellationTokenSource:()=>ore,Emitter:()=>rre,KeyCode:()=>are,KeyMod:()=>lre,MarkerSeverity:()=>gre,MarkerTag:()=>pre,Position:()=>hre,Range:()=>dre,Selection:()=>cre,SelectionDirection:()=>ure,Token:()=>fre,Uri:()=>mre,default:()=>Ire,editor:()=>_re,languages:()=>vre});const o=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout((()=>{if(e.stack){if(m.isErrorNoTelemetry(e))throw new m(e.message+"\n\n"+e.stack);throw new Error(e.message+"\n\n"+e.stack)}throw e}),0)}}emit(e){this.listeners.forEach((t=>{t(e)}))}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function r(e){d(e)||o.onUnexpectedError(e)}function a(e){d(e)||o.onUnexpectedExternalError(e)}function l(e){if(e instanceof Error){const{name:t,message:i}=e;return{$isError:!0,name:t,message:i,stack:e.stacktrace||e.stack,noTelemetry:m.isErrorNoTelemetry(e)}}return e}const h="Canceled";function d(e){return e instanceof c||e instanceof Error&&e.name===h&&e.message===h}class c extends Error{constructor(){super(h),this.name=this.message}}function u(e){return e?new Error(`Illegal argument: ${e}`):new Error("Illegal argument")}function g(e){return e?new Error(`Illegal state: ${e}`):new Error("Illegal state")}class p extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class m extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof m)return e;const t=new m;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return"CodeExpectedError"===e.name}}class f extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,f.prototype)}}function _(e){const t=this;let i,n=!1;return function(){return n||(n=!0,i=e.apply(t,arguments)),i}}var v;!function(e){function t(e){return e&&"object"==typeof e&&"function"==typeof e[Symbol.iterator]}e.is=t;const i=Object.freeze([]);function*n(e){yield e}e.empty=function(){return i},e.single=n,e.wrap=function(e){return t(e)?e:n(e)},e.from=function(e){return e||i},e.reverse=function*(e){for(let t=e.length-1;t>=0;t--)yield e[t]},e.isEmpty=function(e){return!e||!0===e[Symbol.iterator]().next().done},e.first=function(e){return e[Symbol.iterator]().next().value},e.some=function(e,t){for(const i of e)if(t(i))return!0;return!1},e.find=function(e,t){for(const i of e)if(t(i))return i},e.filter=function*(e,t){for(const i of e)t(i)&&(yield i)},e.map=function*(e,t){let i=0;for(const n of e)yield t(n,i++)},e.concat=function*(...e){for(const t of e)for(const e of t)yield e},e.reduce=function(e,t,i){let n=i;for(const s of e)n=t(n,s);return n},e.slice=function*(e,t,i=e.length){for(t<0&&(t+=e.length),i<0?i+=e.length:i>e.length&&(i=e.length);ts}]}}(v||(v={}));let b=null;function C(e){return null==b||b.trackDisposable(e),e}function w(e){null==b||b.markAsDisposed(e)}function y(e,t){null==b||b.setParent(e,t)}function S(e){return null==b||b.markAsSingleton(e),e}function L(e){return"function"==typeof e.dispose&&0===e.dispose.length}function k(e){if(v.is(e)){const i=[];for(const n of e)if(n)try{n.dispose()}catch(t){i.push(t)}if(1===i.length)throw i[0];if(i.length>1)throw new AggregateError(i,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function D(...e){const t=x((()=>k(e)));return function(e,t){if(b)for(const i of e)b.setParent(i,t)}(e,t),t}function x(e){const t=C({dispose:_((()=>{w(t),e()}))});return t}class N{constructor(){this._toDispose=new Set,this._isDisposed=!1,C(this)}dispose(){this._isDisposed||(w(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(0!==this._toDispose.size)try{k(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return y(e,this),this._isDisposed?N.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),y(e,null))}}N.DISABLE_DISPOSED_WARNING=!1;class E{constructor(){this._store=new N,C(this),y(this._store,this)}dispose(){w(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}E.None=Object.freeze({dispose(){}});class I{constructor(){this._isDisposed=!1,C(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||(null===(t=this._value)||void 0===t||t.dispose(),e&&y(e,this),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,w(this),null===(e=this._value)||void 0===e||e.dispose(),this._value=void 0}}class M{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return 0==--this._counter&&this._disposable.dispose(),this}}class T{constructor(e){this.object=e}dispose(){}}class R{constructor(){this._store=new Map,this._isDisposed=!1,C(this)}dispose(){w(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{k(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){var n;this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||null===(n=this._store.get(e))||void 0===n||n.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;null===(t=this._store.get(e))||void 0===t||t.dispose(),this._store.delete(e)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}class A{constructor(e){this.element=e,this.next=A.Undefined,this.prev=A.Undefined}}A.Undefined=new A(void 0);class O{constructor(){this._first=A.Undefined,this._last=A.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===A.Undefined}clear(){let e=this._first;for(;e!==A.Undefined;){const t=e.next;e.prev=A.Undefined,e.next=A.Undefined,e=t}this._first=A.Undefined,this._last=A.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new A(e);if(this._first===A.Undefined)this._first=i,this._last=i;else if(t){const e=this._last;this._last=i,i.prev=e,e.next=i}else{const e=this._first;this._first=i,i.next=e,e.prev=i}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(i))}}shift(){if(this._first!==A.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==A.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==A.Undefined&&e.next!==A.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===A.Undefined&&e.next===A.Undefined?(this._first=A.Undefined,this._last=A.Undefined):e.next===A.Undefined?(this._last=this._last.prev,this._last.next=A.Undefined):e.prev===A.Undefined&&(this._first=this._first.next,this._first.prev=A.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==A.Undefined;)yield e.element,e=e.next}}const P=globalThis.performance&&"function"==typeof globalThis.performance.now;class F{static create(e){return new F(e)}constructor(e){this._now=P&&!1===e?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}elapsed(){return-1!==this._stopTime?this._stopTime-this._startTime:this._now()-this._startTime}}var B;!function(e){function t(e){false}function i(e){return(t,i=null,n)=>{let s,o=!1;return s=e((e=>{if(!o)return s?s.dispose():o=!0,t.call(i,e)}),null,n),o&&s.dispose(),s}}function n(e,t,i){return o(((i,n=null,s)=>e((e=>i.call(n,t(e))),null,s)),i)}function s(e,t,i){return o(((i,n=null,s)=>e((e=>t(e)&&i.call(n,e)),null,s)),i)}function o(e,i){let n;const s={onWillAddFirstListener(){n=e(o.fire,o)},onDidRemoveLastListener(){null==n||n.dispose()}};i||t();const o=new U(s);return null==i||i.add(o),o.event}function r(e,i,n=100,s=!1,o=!1,r,a){let l,h,d,c,u=0;const g={leakWarningThreshold:r,onWillAddFirstListener(){l=e((e=>{u++,h=i(h,e),s&&!d&&(p.fire(h),h=void 0),c=()=>{const e=h;h=void 0,d=void 0,(!s||u>1)&&p.fire(e),u=0},"number"==typeof n?(clearTimeout(d),d=setTimeout(c,n)):void 0===d&&(d=0,queueMicrotask(c))}))},onWillRemoveListener(){o&&u>0&&(null==c||c())},onDidRemoveLastListener(){c=void 0,l.dispose()}};a||t();const p=new U(g);return null==a||a.add(p),p.event}e.None=()=>E.None,e.defer=function(e,t){return r(e,(()=>{}),0,void 0,!0,void 0,t)},e.once=i,e.map=n,e.forEach=function(e,t,i){return o(((i,n=null,s)=>e((e=>{t(e),i.call(n,e)}),null,s)),i)},e.filter=s,e.signal=function(e){return e},e.any=function(...e){return(t,i=null,n)=>function(e,t){t instanceof Array?t.push(e):t&&t.add(e);return e}(D(...e.map((e=>e((e=>t.call(i,e)))))),n)},e.reduce=function(e,t,i,s){let o=i;return n(e,(e=>(o=t(o,e),o)),s)},e.debounce=r,e.accumulate=function(t,i=0,n){return e.debounce(t,((e,t)=>e?(e.push(t),e):[t]),i,void 0,!0,void 0,n)},e.latch=function(e,t=(e,t)=>e===t,i){let n,o=!0;return s(e,(e=>{const i=o||!t(e,n);return o=!1,n=e,i}),i)},e.split=function(t,i,n){return[e.filter(t,i,n),e.filter(t,(e=>!i(e)),n)]},e.buffer=function(e,t=!1,i=[],n){let s=i.slice(),o=e((e=>{s?s.push(e):a.fire(e)}));n&&n.add(o);const r=()=>{null==s||s.forEach((e=>a.fire(e))),s=null},a=new U({onWillAddFirstListener(){o||(o=e((e=>a.fire(e))),n&&n.add(o))},onDidAddFirstListener(){s&&(t?setTimeout(r):r())},onDidRemoveLastListener(){o&&o.dispose(),o=null}});return n&&n.add(a),a.event},e.chain=function(e,t){return(i,n,s)=>{const o=t(new l);return e((function(e){const t=o.evaluate(e);t!==a&&i.call(n,t)}),void 0,s)}};const a=Symbol("HaltChainable");class l{constructor(){this.steps=[]}map(e){return this.steps.push(e),this}forEach(e){return this.steps.push((t=>(e(t),t))),this}filter(e){return this.steps.push((t=>e(t)?t:a)),this}reduce(e,t){let i=t;return this.steps.push((t=>(i=e(i,t),i))),this}latch(e=(e,t)=>e===t){let t,i=!0;return this.steps.push((n=>{const s=i||!e(n,t);return i=!1,t=n,s?n:a})),this}evaluate(e){for(const t of this.steps)if((e=t(e))===a)break;return e}}e.fromNodeEventEmitter=function(e,t,i=e=>e){const n=(...e)=>s.fire(i(...e)),s=new U({onWillAddFirstListener:()=>e.on(t,n),onDidRemoveLastListener:()=>e.removeListener(t,n)});return s.event},e.fromDOMEventEmitter=function(e,t,i=e=>e){const n=(...e)=>s.fire(i(...e)),s=new U({onWillAddFirstListener:()=>e.addEventListener(t,n),onDidRemoveLastListener:()=>e.removeEventListener(t,n)});return s.event},e.toPromise=function(e){return new Promise((t=>i(e)(t)))},e.fromPromise=function(e){const t=new U;return e.then((e=>{t.fire(e)}),(()=>{t.fire(void 0)})).finally((()=>{t.dispose()})),t.event},e.runAndSubscribe=function(e,t){return t(void 0),e((e=>t(e)))},e.runAndSubscribeWithStore=function(e,t){let i=null;function n(e){null==i||i.dispose(),i=new N,t(e,i)}n(void 0);const s=e((e=>n(e)));return x((()=>{s.dispose(),null==i||i.dispose()}))};class h{constructor(e,i){this._observable=e,this._counter=0,this._hasChanged=!1;const n={onWillAddFirstListener:()=>{e.addObserver(this)},onDidRemoveLastListener:()=>{e.removeObserver(this)}};i||t(),this.emitter=new U(n),i&&i.add(this.emitter)}beginUpdate(e){this._counter++}handlePossibleChange(e){}handleChange(e,t){this._hasChanged=!0}endUpdate(e){this._counter--,0===this._counter&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}e.fromObservable=function(e,t){return new h(e,t).emitter.event},e.fromObservableLight=function(e){return t=>{let i=0,n=!1;const s={beginUpdate(){i++},endUpdate(){i--,0===i&&(e.reportChanges(),n&&(n=!1,t()))},handlePossibleChange(){},handleChange(){n=!0}};return e.addObserver(s),e.reportChanges(),{dispose(){e.removeObserver(s)}}}}}(B||(B={}));class W{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${W._idPool++}`,W.all.add(this)}start(e){this._stopWatch=new F,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}}W.all=new Set,W._idPool=0;class V{constructor(e,t=Math.random().toString(18).slice(2,5)){this.threshold=e,this.name=t,this._warnCountdown=0}dispose(){var e;null===(e=this._stacks)||void 0===e||e.clear()}check(e,t){const i=this.threshold;if(i<=0||t{const t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}}class H{static create(){var e;return new H(null!==(e=(new Error).stack)&&void 0!==e?e:"")}constructor(e){this.value=e}print(){console.warn(this.value.split("\n").slice(2).join("\n"))}}class z{constructor(e){this.value=e}}class U{constructor(e){var t,i,n,s,o;this._size=0,this._options=e,this._leakageMon=(null===(t=this._options)||void 0===t?void 0:t.leakWarningThreshold)?new V(null!==(n=null===(i=this._options)||void 0===i?void 0:i.leakWarningThreshold)&&void 0!==n?n:-1):void 0,this._perfMon=(null===(s=this._options)||void 0===s?void 0:s._profName)?new W(this._options._profName):void 0,this._deliveryQueue=null===(o=this._options)||void 0===o?void 0:o.deliveryQueue}dispose(){var e,t,i,n;this._disposed||(this._disposed=!0,(null===(e=this._deliveryQueue)||void 0===e?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),null===(i=null===(t=this._options)||void 0===t?void 0:t.onDidRemoveLastListener)||void 0===i||i.call(t),null===(n=this._leakageMon)||void 0===n||n.dispose())}get event(){var e;return null!==(e=this._event)&&void 0!==e||(this._event=(e,t,i)=>{var n,s,o,r,a;if(this._leakageMon&&this._size>3*this._leakageMon.threshold)return console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`),E.None;if(this._disposed)return E.None;t&&(e=e.bind(t));const l=new z(e);let h;this._leakageMon&&this._size>=Math.ceil(.2*this._leakageMon.threshold)&&(l.stack=H.create(),h=this._leakageMon.check(l.stack,this._size+1)),this._listeners?this._listeners instanceof z?(null!==(a=this._deliveryQueue)&&void 0!==a||(this._deliveryQueue=new K),this._listeners=[this._listeners,l]):this._listeners.push(l):(null===(s=null===(n=this._options)||void 0===n?void 0:n.onWillAddFirstListener)||void 0===s||s.call(n,this),this._listeners=l,null===(r=null===(o=this._options)||void 0===o?void 0:o.onDidAddFirstListener)||void 0===r||r.call(o,this)),this._size++;const d=x((()=>{null==h||h(),this._removeListener(l)}));return i instanceof N?i.add(d):Array.isArray(i)&&i.push(d),d}),this._event}_removeListener(e){var t,i,n,s;if(null===(i=null===(t=this._options)||void 0===t?void 0:t.onWillRemoveListener)||void 0===i||i.call(t,this),!this._listeners)return;if(1===this._size)return this._listeners=void 0,null===(s=null===(n=this._options)||void 0===n?void 0:n.onDidRemoveLastListener)||void 0===s||s.call(n,this),void(this._size=0);const o=this._listeners,r=o.indexOf(e);if(-1===r)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,o[r]=void 0;const a=this._deliveryQueue.current===this;if(2*this._size<=o.length){let e=0;for(let t=0;t0}}class K{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class j extends U{constructor(e){super(e),this._isPaused=0,this._eventQueue=new O,this._mergeFn=null==e?void 0:e.merge}pause(){this._isPaused++}resume(){if(0!==this._isPaused&&0==--this._isPaused)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&0!==this._eventQueue.size;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(0!==this._isPaused?this._eventQueue.push(e):super.fire(e))}}class q extends j{constructor(e){var t;super(e),this._delay=null!==(t=e.delay)&&void 0!==t?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout((()=>{this._handle=void 0,this.resume()}),this._delay)),super.fire(e)}}class $ extends U{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=null==e?void 0:e.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),1===this._queuedEvents.length&&queueMicrotask((()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach((e=>super.fire(e))),this._queuedEvents=[]})))}}class G{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new U({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};this.events.push(t),this.hasListeners&&this.hook(t);return x(_((()=>{this.hasListeners&&this.unhook(t);const e=this.events.indexOf(t);this.events.splice(e,1)})))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach((e=>this.hook(e)))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach((e=>this.unhook(e)))}hook(e){e.listener=e.event((e=>this.emitter.fire(e)))}unhook(e){e.listener&&e.listener.dispose(),e.listener=null}dispose(){this.emitter.dispose()}}class Z{constructor(){this.buffers=[]}wrapEvent(e){return(t,i,n)=>e((e=>{const n=this.buffers[this.buffers.length-1];n?n.push((()=>t.call(i,e))):t.call(i,e)}),void 0,n)}bufferEvents(e){const t=[];this.buffers.push(t);const i=e();return this.buffers.pop(),t.forEach((e=>e())),i}}class Y{constructor(){this.listening=!1,this.inputEvent=B.None,this.inputEventListener=E.None,this.emitter=new U({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}class X{constructor(){this._zoomFactor=1}getZoomFactor(){return this._zoomFactor}}X.INSTANCE=new X;class Q extends E{constructor(){super(),this._onDidChange=this._register(new U),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(!0),this._mediaQueryList=null,this._handleChange(!1)}_handleChange(e){var t;null===(t=this._mediaQueryList)||void 0===t||t.removeEventListener("change",this._listener),this._mediaQueryList=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),e&&this._onDidChange.fire()}}class J extends E{get value(){return this._value}constructor(){super(),this._onDidChange=this._register(new U),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio();const e=this._register(new Q);this._register(e.onDidChange((()=>{this._value=this._getPixelRatio(),this._onDidChange.fire(this._value)})))}_getPixelRatio(){const e=document.createElement("canvas").getContext("2d");return(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}}function ee(e,t){"string"==typeof e&&(e=window.matchMedia(e)),e.addEventListener("change",t)}const te=new class{constructor(){this._pixelRatioMonitor=null}_getOrCreatePixelRatioMonitor(){return this._pixelRatioMonitor||(this._pixelRatioMonitor=S(new J)),this._pixelRatioMonitor}get value(){return this._getOrCreatePixelRatioMonitor().value}get onDidChange(){return this._getOrCreatePixelRatioMonitor().onDidChange}};const ie=navigator.userAgent,ne=ie.indexOf("Firefox")>=0,se=ie.indexOf("AppleWebKit")>=0,oe=ie.indexOf("Chrome")>=0,re=!oe&&ie.indexOf("Safari")>=0,ae=!oe&&!re&&se,le=(ie.indexOf("Electron/"),ie.indexOf("Android")>=0);let he=!1;if(window.matchMedia){const e=window.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=window.matchMedia("(display-mode: fullscreen)");he=e.matches,ee(e,(({matches:e})=>{he&&t.matches||(he=e)}))}let de="undefined"!=typeof document&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function ce(e,t){let i;return i=0===t.length?e:e.replace(/\{(\d+)\}/g,((e,i)=>{const n=i[0],s=t[n];let o=e;return"string"==typeof s?o=s:"number"!=typeof s&&"boolean"!=typeof s&&null!=s||(o=String(s)),o})),de&&(i="\uff3b"+i.replace(/[aouei]/g,"$&$&")+"\uff3d"),i}function ue(e,t,...i){return ce(t,i)}var ge;const pe="en";let me,fe,_e=!1,ve=!1,be=!1,Ce=!1,we=!1,ye=!1,Se=!1,Le=!1,ke=!1,De=!1,xe=pe,Ne=null,Ee=null;const Ie="object"==typeof self?self:"object"==typeof i.g?i.g:{};let Me;void 0!==Ie.vscode&&void 0!==Ie.vscode.process?Me=Ie.vscode.process:"undefined"!=typeof process&&(Me=process);const Te="string"==typeof(null===(ge=null==Me?void 0:Me.versions)||void 0===ge?void 0:ge.electron),Re=Te&&"renderer"===(null==Me?void 0:Me.type);if("object"!=typeof navigator||Re)if("object"==typeof Me){_e="win32"===Me.platform,ve="darwin"===Me.platform,be="linux"===Me.platform,Ce=be&&!!Me.env.SNAP&&!!Me.env.SNAP_REVISION,Se=Te,ke=!!Me.env.CI||!!Me.env.BUILD_ARTIFACTSTAGINGDIRECTORY,me=pe,xe=pe;const e=Me.env.VSCODE_NLS_CONFIG;if(e)try{const t=JSON.parse(e),i=t.availableLanguages["*"];me=t.locale,Ne=t.osLocale,xe=i||pe,Ee=t._translationsConfigFile}catch(Mre){}we=!0}else console.error("Unable to resolve platform.");else{fe=navigator.userAgent,_e=fe.indexOf("Windows")>=0,ve=fe.indexOf("Macintosh")>=0,Le=(fe.indexOf("Macintosh")>=0||fe.indexOf("iPad")>=0||fe.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,be=fe.indexOf("Linux")>=0,De=(null==fe?void 0:fe.indexOf("Mobi"))>=0,ye=!0;me=void ue(0,"_")||pe,xe=me,Ne=navigator.language}let Ae=0;ve?Ae=1:_e?Ae=3:be&&(Ae=2);const Oe=_e,Pe=ve,Fe=be,Be=we,We=ye,Ve=ye&&"function"==typeof Ie.importScripts,He=Le,ze=De,Ue=fe,Ke=xe,je="function"==typeof Ie.postMessage&&!Ie.importScripts,qe=(()=>{if(je){const e=[];Ie.addEventListener("message",(t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,n=e.length;i{const n=++t;e.push({id:n,callback:i}),Ie.postMessage({vscodeScheduleAsyncWork:n},"*")}}return e=>setTimeout(e)})(),$e=ve||Le?2:_e?1:3;let Ge=!0,Ze=!1;function Ye(){if(!Ze){Ze=!0;const e=new Uint8Array(2);e[0]=1,e[1]=2;const t=new Uint16Array(e.buffer);Ge=513===t[0]}return Ge}const Xe=!!(Ue&&Ue.indexOf("Chrome")>=0),Qe=!!(Ue&&Ue.indexOf("Firefox")>=0),Je=!!(!Xe&&Ue&&Ue.indexOf("Safari")>=0),et=!!(Ue&&Ue.indexOf("Edg/")>=0),tt=(Ue&&Ue.indexOf("Android"),Be||document.queryCommandSupported&&document.queryCommandSupported("copy")||navigator&&navigator.clipboard&&navigator.clipboard.writeText,Be||navigator&&navigator.clipboard&&navigator.clipboard.readText,Be||he||navigator.keyboard,"ontouchstart"in window||navigator.maxTouchPoints,window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0));class it{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()]||0}}const nt=new it,st=new it,ot=new it,rt=new Array(230),at={},lt=[],ht=Object.create(null),dt=Object.create(null),ct=[],ut=[];for(let Tre=0;Tre<=193;Tre++)ct[Tre]=-1;for(let Tre=0;Tre<=132;Tre++)ut[Tre]=-1;var gt;function pt(e,t){return(e|(65535&t)<<16>>>0)>>>0}function mt(e,t){if("number"==typeof e){if(0===e)return null;const i=(65535&e)>>>0,n=(4294901760&e)>>>16;return new vt(0!==n?[ft(i,t),ft(n,t)]:[ft(i,t)])}{const i=[];for(let n=0;n=98&&e<=113)return null;switch(e){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return nt.keyCodeToStr(e)}}(gt||(gt={}));class _t{constructor(e,t,i,n,s){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyCode=s}equals(e){return e instanceof _t&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}isModifierKey(){return 0===this.keyCode||5===this.keyCode||57===this.keyCode||6===this.keyCode||4===this.keyCode}isDuplicateModifierCase(){return this.ctrlKey&&5===this.keyCode||this.shiftKey&&4===this.keyCode||this.altKey&&6===this.keyCode||this.metaKey&&57===this.keyCode}}class vt{constructor(e){if(0===e.length)throw u("chords");this.chords=e}}class bt{constructor(e,t,i,n,s,o){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyLabel=s,this.keyAriaLabel=o}}class Ct{}const wt=Pe?256:2048,yt=Pe?2048:256;class St{constructor(e){this._standardKeyboardEventBrand=!0;const t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState("AltGraph"),this.keyCode=function(e){if(e.charCode){const t=String.fromCharCode(e.charCode).toUpperCase();return gt.fromString(t)}const t=e.keyCode;if(3===t)return 7;if(ne)switch(t){case 59:return 85;case 60:if(Fe)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Pe)return 57}else if(se){if(Pe&&93===t)return 57;if(!Pe&&92===t)return 57}return rt[t]||0}(t),this.code=t.code,this.ctrlKey=this.ctrlKey||5===this.keyCode,this.altKey=this.altKey||6===this.keyCode,this.shiftKey=this.shiftKey||4===this.keyCode,this.metaKey=this.metaKey||57===this.keyCode,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=wt),this.altKey&&(t|=512),this.shiftKey&&(t|=1024),this.metaKey&&(t|=yt),t|=e,t}_computeKeyCodeChord(){let e=0;return 5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(e=this.keyCode),new _t(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let Lt=!1,kt=null;function Dt(e){if(!e.parent||e.parent===e)return null;try{const t=e.location,i=e.parent.location;if("null"!==t.origin&&"null"!==i.origin&&t.origin!==i.origin)return Lt=!0,null}catch(Mre){return Lt=!0,null}return e.parent}class xt{static getSameOriginWindowChain(){if(!kt){kt=[];let e,t=window;do{e=Dt(t),e?kt.push({window:t,iframeElement:t.frameElement||null}):kt.push({window:t,iframeElement:null}),t=e}while(t)}return kt.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,n=0;const s=this.getSameOriginWindowChain();for(const o of s){if(i+=o.window.scrollY,n+=o.window.scrollX,o.window===t)break;if(!o.iframeElement)break;const e=o.iframeElement.getBoundingClientRect();i+=e.top,n+=e.left}return{top:i,left:n}}}class Nt{constructor(e){this.timestamp=Date.now(),this.browserEvent=e,this.leftButton=0===e.button,this.middleButton=1===e.button,this.rightButton=2===e.button,this.buttons=e.buttons,this.target=e.target,this.detail=e.detail||1,"dblclick"===e.type&&(this.detail=2),this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,"number"==typeof e.pageX?(this.posx=e.pageX,this.posy=e.pageY):(this.posx=e.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=e.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);const t=xt.getPositionOfChildWindowRelativeToAncestorWindow(window,e.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class Et{constructor(e,t=0,i=0){if(this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t,e){const t=e,i=e;if(void 0!==t.wheelDeltaY)this.deltaY=t.wheelDeltaY/120;else if(void 0!==i.VERTICAL_AXIS&&i.axis===i.VERTICAL_AXIS)this.deltaY=-i.detail/3;else if("wheel"===e.type){const t=e;t.deltaMode===t.DOM_DELTA_LINE?this.deltaY=ne&&!Pe?-e.deltaY/3:-e.deltaY:this.deltaY=-e.deltaY/40}if(void 0!==t.wheelDeltaX)this.deltaX=re&&Oe?-t.wheelDeltaX/120:t.wheelDeltaX/120;else if(void 0!==i.HORIZONTAL_AXIS&&i.axis===i.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if("wheel"===e.type){const t=e;t.deltaMode===t.DOM_DELTA_LINE?this.deltaX=ne&&!Pe?-e.deltaX/3:-e.deltaX:this.deltaX=-e.deltaX/40}0===this.deltaY&&0===this.deltaX&&e.wheelDelta&&(this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;null===(e=this.browserEvent)||void 0===e||e.preventDefault()}stopPropagation(){var e;null===(e=this.browserEvent)||void 0===e||e.stopPropagation()}}const{entries:It,setPrototypeOf:Mt,isFrozen:Tt,getPrototypeOf:Rt,getOwnPropertyDescriptor:At}=Object;let{freeze:Ot,seal:Pt,create:Ft}=Object,{apply:Bt,construct:Wt}="undefined"!=typeof Reflect&&Reflect;Bt||(Bt=function(e,t,i){return e.apply(t,i)}),Ot||(Ot=function(e){return e}),Pt||(Pt=function(e){return e}),Wt||(Wt=function(e,t){return new e(...t)});const Vt=Qt(Array.prototype.forEach),Ht=Qt(Array.prototype.pop),zt=Qt(Array.prototype.push),Ut=Qt(String.prototype.toLowerCase),Kt=Qt(String.prototype.toString),jt=Qt(String.prototype.match),qt=Qt(String.prototype.replace),$t=Qt(String.prototype.indexOf),Gt=Qt(String.prototype.trim),Zt=Qt(RegExp.prototype.test),Yt=(Xt=TypeError,function(){for(var e=arguments.length,t=new Array(e),i=0;i1?i-1:0),s=1;s/gm),mi=Pt(/\${[\w\W]*}/gm),fi=Pt(/^data-[\-\w.\u00B7-\uFFFF]/),_i=Pt(/^aria-[\-\w]+$/),vi=Pt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),bi=Pt(/^(?:\w+script|data):/i),Ci=Pt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),wi=Pt(/^html$/i);var yi=Object.freeze({__proto__:null,MUSTACHE_EXPR:gi,ERB_EXPR:pi,TMPLIT_EXPR:mi,DATA_ATTR:fi,ARIA_ATTR:_i,IS_ALLOWED_URI:vi,IS_SCRIPT_OR_DATA:bi,ATTR_WHITESPACE:Ci,DOCTYPE_NAME:wi});const Si=()=>"undefined"==typeof window?null:window;var Li=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Si();const i=t=>e(t);if(i.version="3.0.5",i.removed=[],!t||!t.document||9!==t.document.nodeType)return i.isSupported=!1,i;const n=t.document,s=n.currentScript;let{document:o}=t;const{DocumentFragment:r,HTMLTemplateElement:a,Node:l,Element:h,NodeFilter:d,NamedNodeMap:c=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:u,DOMParser:g,trustedTypes:p}=t,m=h.prototype,f=ti(m,"cloneNode"),_=ti(m,"nextSibling"),v=ti(m,"childNodes"),b=ti(m,"parentNode");if("function"==typeof a){const e=o.createElement("template");e.content&&e.content.ownerDocument&&(o=e.content.ownerDocument)}let C,w="";const{implementation:y,createNodeIterator:S,createDocumentFragment:L,getElementsByTagName:k}=o,{importNode:D}=n;let x={};i.isSupported="function"==typeof It&&"function"==typeof b&&y&&void 0!==y.createHTMLDocument;const{MUSTACHE_EXPR:N,ERB_EXPR:E,TMPLIT_EXPR:I,DATA_ATTR:M,ARIA_ATTR:T,IS_SCRIPT_OR_DATA:R,ATTR_WHITESPACE:A}=yi;let{IS_ALLOWED_URI:O}=yi,P=null;const F=Jt({},[...ii,...ni,...si,...ri,...li]);let B=null;const W=Jt({},[...hi,...di,...ci,...ui]);let V=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}})),H=null,z=null,U=!0,K=!0,j=!1,q=!0,$=!1,G=!1,Z=!1,Y=!1,X=!1,Q=!1,J=!1,ee=!0,te=!1,ie=!0,ne=!1,se={},oe=null;const re=Jt({},["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 ae=null;const le=Jt({},["audio","video","img","source","image","track"]);let he=null;const de=Jt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ce="http://www.w3.org/1998/Math/MathML",ue="http://www.w3.org/2000/svg",ge="http://www.w3.org/1999/xhtml";let pe=ge,me=!1,fe=null;const _e=Jt({},[ce,ue,ge],Kt);let ve;const be=["application/xhtml+xml","text/html"];let Ce,we=null;const ye=o.createElement("form"),Se=function(e){return e instanceof RegExp||e instanceof Function},Le=function(e){if(!we||we!==e){if(e&&"object"==typeof e||(e={}),e=ei(e),ve=ve=-1===be.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ce="application/xhtml+xml"===ve?Kt:Ut,P="ALLOWED_TAGS"in e?Jt({},e.ALLOWED_TAGS,Ce):F,B="ALLOWED_ATTR"in e?Jt({},e.ALLOWED_ATTR,Ce):W,fe="ALLOWED_NAMESPACES"in e?Jt({},e.ALLOWED_NAMESPACES,Kt):_e,he="ADD_URI_SAFE_ATTR"in e?Jt(ei(de),e.ADD_URI_SAFE_ATTR,Ce):de,ae="ADD_DATA_URI_TAGS"in e?Jt(ei(le),e.ADD_DATA_URI_TAGS,Ce):le,oe="FORBID_CONTENTS"in e?Jt({},e.FORBID_CONTENTS,Ce):re,H="FORBID_TAGS"in e?Jt({},e.FORBID_TAGS,Ce):{},z="FORBID_ATTR"in e?Jt({},e.FORBID_ATTR,Ce):{},se="USE_PROFILES"in e&&e.USE_PROFILES,U=!1!==e.ALLOW_ARIA_ATTR,K=!1!==e.ALLOW_DATA_ATTR,j=e.ALLOW_UNKNOWN_PROTOCOLS||!1,q=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,$=e.SAFE_FOR_TEMPLATES||!1,G=e.WHOLE_DOCUMENT||!1,X=e.RETURN_DOM||!1,Q=e.RETURN_DOM_FRAGMENT||!1,J=e.RETURN_TRUSTED_TYPE||!1,Y=e.FORCE_BODY||!1,ee=!1!==e.SANITIZE_DOM,te=e.SANITIZE_NAMED_PROPS||!1,ie=!1!==e.KEEP_CONTENT,ne=e.IN_PLACE||!1,O=e.ALLOWED_URI_REGEXP||vi,pe=e.NAMESPACE||ge,V=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Se(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(V.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Se(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(V.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(V.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),$&&(K=!1),Q&&(X=!0),se&&(P=Jt({},[...li]),B=[],!0===se.html&&(Jt(P,ii),Jt(B,hi)),!0===se.svg&&(Jt(P,ni),Jt(B,di),Jt(B,ui)),!0===se.svgFilters&&(Jt(P,si),Jt(B,di),Jt(B,ui)),!0===se.mathMl&&(Jt(P,ri),Jt(B,ci),Jt(B,ui))),e.ADD_TAGS&&(P===F&&(P=ei(P)),Jt(P,e.ADD_TAGS,Ce)),e.ADD_ATTR&&(B===W&&(B=ei(B)),Jt(B,e.ADD_ATTR,Ce)),e.ADD_URI_SAFE_ATTR&&Jt(he,e.ADD_URI_SAFE_ATTR,Ce),e.FORBID_CONTENTS&&(oe===re&&(oe=ei(oe)),Jt(oe,e.FORBID_CONTENTS,Ce)),ie&&(P["#text"]=!0),G&&Jt(P,["html","head","body"]),P.table&&(Jt(P,["tbody"]),delete H.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw Yt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw Yt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=e.TRUSTED_TYPES_POLICY,w=C.createHTML("")}else void 0===C&&(C=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let i=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(i=t.getAttribute(n));const s="dompurify"+(i?"#"+i:"");try{return e.createPolicy(s,{createHTML:e=>e,createScriptURL:e=>e})}catch(o){return console.warn("TrustedTypes policy "+s+" could not be created."),null}}(p,s)),null!==C&&"string"==typeof w&&(w=C.createHTML(""));Ot&&Ot(e),we=e}},ke=Jt({},["mi","mo","mn","ms","mtext"]),De=Jt({},["foreignobject","desc","title","annotation-xml"]),xe=Jt({},["title","style","font","a","script"]),Ne=Jt({},ni);Jt(Ne,si),Jt(Ne,oi);const Ee=Jt({},ri);Jt(Ee,ai);const Ie=function(e){zt(i.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},Me=function(e,t){try{zt(i.removed,{attribute:t.getAttributeNode(e),from:t})}catch(n){zt(i.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!B[e])if(X||Q)try{Ie(t)}catch(n){}else try{t.setAttribute(e,"")}catch(n){}},Te=function(e){let t,i;if(Y)e=""+e;else{const t=jt(e,/^[\r\n\t ]+/);i=t&&t[0]}"application/xhtml+xml"===ve&&pe===ge&&(e=''+e+"");const n=C?C.createHTML(e):e;if(pe===ge)try{t=(new g).parseFromString(n,ve)}catch(r){}if(!t||!t.documentElement){t=y.createDocument(pe,"template",null);try{t.documentElement.innerHTML=me?w:n}catch(r){}}const s=t.body||t.documentElement;return e&&i&&s.insertBefore(o.createTextNode(i),s.childNodes[0]||null),pe===ge?k.call(t,G?"html":"body")[0]:G?t.documentElement:s},Re=function(e){return S.call(e.ownerDocument||e,e,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT,null,!1)},Ae=function(e){return"object"==typeof l?e instanceof l:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Oe=function(e,t,n){x[e]&&Vt(x[e],(e=>{e.call(i,t,n,we)}))},Pe=function(e){let t;if(Oe("beforeSanitizeElements",e,null),(n=e)instanceof u&&("string"!=typeof n.nodeName||"string"!=typeof n.textContent||"function"!=typeof n.removeChild||!(n.attributes instanceof c)||"function"!=typeof n.removeAttribute||"function"!=typeof n.setAttribute||"string"!=typeof n.namespaceURI||"function"!=typeof n.insertBefore||"function"!=typeof n.hasChildNodes))return Ie(e),!0;var n;const s=Ce(e.nodeName);if(Oe("uponSanitizeElement",e,{tagName:s,allowedTags:P}),e.hasChildNodes()&&!Ae(e.firstElementChild)&&(!Ae(e.content)||!Ae(e.content.firstElementChild))&&Zt(/<[/\w]/g,e.innerHTML)&&Zt(/<[/\w]/g,e.textContent))return Ie(e),!0;if(!P[s]||H[s]){if(!H[s]&&Be(s)){if(V.tagNameCheck instanceof RegExp&&Zt(V.tagNameCheck,s))return!1;if(V.tagNameCheck instanceof Function&&V.tagNameCheck(s))return!1}if(ie&&!oe[s]){const t=b(e)||e.parentNode,i=v(e)||e.childNodes;if(i&&t){for(let n=i.length-1;n>=0;--n)t.insertBefore(f(i[n],!0),_(e))}}return Ie(e),!0}return e instanceof h&&!function(e){let t=b(e);t&&t.tagName||(t={namespaceURI:pe,tagName:"template"});const i=Ut(e.tagName),n=Ut(t.tagName);return!!fe[e.namespaceURI]&&(e.namespaceURI===ue?t.namespaceURI===ge?"svg"===i:t.namespaceURI===ce?"svg"===i&&("annotation-xml"===n||ke[n]):Boolean(Ne[i]):e.namespaceURI===ce?t.namespaceURI===ge?"math"===i:t.namespaceURI===ue?"math"===i&&De[n]:Boolean(Ee[i]):e.namespaceURI===ge?!(t.namespaceURI===ue&&!De[n])&&!(t.namespaceURI===ce&&!ke[n])&&!Ee[i]&&(xe[i]||!Ne[i]):!("application/xhtml+xml"!==ve||!fe[e.namespaceURI]))}(e)?(Ie(e),!0):"noscript"!==s&&"noembed"!==s&&"noframes"!==s||!Zt(/<\/no(script|embed|frames)/i,e.innerHTML)?($&&3===e.nodeType&&(t=e.textContent,t=qt(t,N," "),t=qt(t,E," "),t=qt(t,I," "),e.textContent!==t&&(zt(i.removed,{element:e.cloneNode()}),e.textContent=t)),Oe("afterSanitizeElements",e,null),!1):(Ie(e),!0)},Fe=function(e,t,i){if(ee&&("id"===t||"name"===t)&&(i in o||i in ye))return!1;if(K&&!z[t]&&Zt(M,t));else if(U&&Zt(T,t));else if(!B[t]||z[t]){if(!(Be(e)&&(V.tagNameCheck instanceof RegExp&&Zt(V.tagNameCheck,e)||V.tagNameCheck instanceof Function&&V.tagNameCheck(e))&&(V.attributeNameCheck instanceof RegExp&&Zt(V.attributeNameCheck,t)||V.attributeNameCheck instanceof Function&&V.attributeNameCheck(t))||"is"===t&&V.allowCustomizedBuiltInElements&&(V.tagNameCheck instanceof RegExp&&Zt(V.tagNameCheck,i)||V.tagNameCheck instanceof Function&&V.tagNameCheck(i))))return!1}else if(he[t]);else if(Zt(O,qt(i,A,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==$t(i,"data:")||!ae[e]){if(j&&!Zt(R,qt(i,A,"")));else if(i)return!1}else;return!0},Be=function(e){return e.indexOf("-")>0},We=function(e){let t,n,s,o;Oe("beforeSanitizeAttributes",e,null);const{attributes:r}=e;if(!r)return;const a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:B};for(o=r.length;o--;){t=r[o];const{name:h,namespaceURI:d}=t;if(n="value"===h?t.value:Gt(t.value),s=Ce(h),a.attrName=s,a.attrValue=n,a.keepAttr=!0,a.forceKeepAttr=void 0,Oe("uponSanitizeAttribute",e,a),n=a.attrValue,a.forceKeepAttr)continue;if(Me(h,e),!a.keepAttr)continue;if(!q&&Zt(/\/>/i,n)){Me(h,e);continue}$&&(n=qt(n,N," "),n=qt(n,E," "),n=qt(n,I," "));const c=Ce(e.nodeName);if(Fe(c,s,n)){if(!te||"id"!==s&&"name"!==s||(Me(h,e),n="user-content-"+n),C&&"object"==typeof p&&"function"==typeof p.getAttributeType)if(d);else switch(p.getAttributeType(c,s)){case"TrustedHTML":n=C.createHTML(n);break;case"TrustedScriptURL":n=C.createScriptURL(n)}try{d?e.setAttributeNS(d,h,n):e.setAttribute(h,n),Ht(i.removed)}catch(l){}}}Oe("afterSanitizeAttributes",e,null)},Ve=function e(t){let i;const n=Re(t);for(Oe("beforeSanitizeShadowDOM",t,null);i=n.nextNode();)Oe("uponSanitizeShadowNode",i,null),Pe(i)||(i.content instanceof r&&e(i.content),We(i));Oe("afterSanitizeShadowDOM",t,null)};return i.sanitize=function(e){let t,s,o,a,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(me=!e,me&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ae(e)){if("function"!=typeof e.toString)throw Yt("toString is not a function");if("string"!=typeof(e=e.toString()))throw Yt("dirty is not a string, aborting")}if(!i.isSupported)return e;if(Z||Le(h),i.removed=[],"string"==typeof e&&(ne=!1),ne){if(e.nodeName){const t=Ce(e.nodeName);if(!P[t]||H[t])throw Yt("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)t=Te("\x3c!----\x3e"),s=t.ownerDocument.importNode(e,!0),1===s.nodeType&&"BODY"===s.nodeName||"HTML"===s.nodeName?t=s:t.appendChild(s);else{if(!X&&!$&&!G&&-1===e.indexOf("<"))return C&&J?C.createHTML(e):e;if(t=Te(e),!t)return X?null:J?w:""}t&&Y&&Ie(t.firstChild);const d=Re(ne?e:t);for(;o=d.nextNode();)Pe(o)||(o.content instanceof r&&Ve(o.content),We(o));if(ne)return e;if(X){if(Q)for(a=L.call(t.ownerDocument);t.firstChild;)a.appendChild(t.firstChild);else a=t;return(B.shadowroot||B.shadowrootmode)&&(a=D.call(n,a,!0)),a}let c=G?t.outerHTML:t.innerHTML;return G&&P["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&Zt(wi,t.ownerDocument.doctype.name)&&(c="\n"+c),$&&(c=qt(c,N," "),c=qt(c,E," "),c=qt(c,I," ")),C&&J?C.createHTML(c):c},i.setConfig=function(e){Le(e),Z=!0},i.clearConfig=function(){we=null,Z=!1},i.isValidAttribute=function(e,t,i){we||Le({});const n=Ce(e),s=Ce(t);return Fe(n,s,i)},i.addHook=function(e,t){"function"==typeof t&&(x[e]=x[e]||[],zt(x[e],t))},i.removeHook=function(e){if(x[e])return Ht(x[e])},i.removeHooks=function(e){x[e]&&(x[e]=[])},i.removeAllHooks=function(){x={}},i}();Li.version,Li.isSupported;const ki=Li.sanitize,Di=(Li.setConfig,Li.clearConfig,Li.isValidAttribute,Li.addHook),xi=Li.removeHook;Li.removeHooks,Li.removeAllHooks;let Ni;if(void 0!==Ie.vscode&&void 0!==Ie.vscode.process){const e=Ie.vscode.process;Ni={get platform(){return e.platform},get arch(){return e.arch},get env(){return e.env},cwd:()=>e.cwd()}}else Ni="undefined"!=typeof process?{get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd:()=>process.env.VSCODE_CWD||process.cwd()}:{get platform(){return Oe?"win32":Pe?"darwin":"linux"},get arch(){},get env(){return{}},cwd:()=>"/"};const Ei=Ni.cwd,Ii=Ni.env,Mi=Ni.platform,Ti=46,Ri=47,Ai=92,Oi=58;class Pi extends Error{constructor(e,t,i){let n;"string"==typeof t&&0===t.indexOf("not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";const s=-1!==e.indexOf(".")?"property":"argument";let o=`The "${e}" ${s} ${n} of type ${t}`;o+=". Received type "+typeof i,super(o),this.code="ERR_INVALID_ARG_TYPE"}}function Fi(e,t){if("string"!=typeof e)throw new Pi(t,"string",e)}const Bi="win32"===Mi;function Wi(e){return e===Ri||e===Ai}function Vi(e){return e===Ri}function Hi(e){return e>=65&&e<=90||e>=97&&e<=122}function zi(e,t,i,n){let s="",o=0,r=-1,a=0,l=0;for(let h=0;h<=e.length;++h){if(h2){const e=s.lastIndexOf(i);-1===e?(s="",o=0):(s=s.slice(0,e),o=s.length-1-s.lastIndexOf(i)),r=h,a=0;continue}if(0!==s.length){s="",o=0,r=h,a=0;continue}}t&&(s+=s.length>0?`${i}..`:"..",o=2)}else s.length>0?s+=`${i}${e.slice(r+1,h)}`:s=e.slice(r+1,h),o=h-r-1;r=h,a=0}else l===Ti&&-1!==a?++a:a=-1}return s}function Ui(e,t){!function(e,t){if(null===e||"object"!=typeof e)throw new Pi(t,"Object",e)}(t,"pathObject");const i=t.dir||t.root,n=t.base||`${t.name||""}${t.ext||""}`;return i?i===t.root?`${i}${n}`:`${i}${e}${n}`:n}const Ki={resolve(...e){let t="",i="",n=!1;for(let s=e.length-1;s>=-1;s--){let o;if(s>=0){if(o=e[s],Fi(o,"path"),0===o.length)continue}else 0===t.length?o=Ei():(o=Ii[`=${t}`]||Ei(),(void 0===o||o.slice(0,2).toLowerCase()!==t.toLowerCase()&&o.charCodeAt(2)===Ai)&&(o=`${t}\\`));const r=o.length;let a=0,l="",h=!1;const d=o.charCodeAt(0);if(1===r)Wi(d)&&(a=1,h=!0);else if(Wi(d))if(h=!0,Wi(o.charCodeAt(1))){let e=2,t=e;for(;e2&&Wi(o.charCodeAt(2))&&(h=!0,a=3));if(l.length>0)if(t.length>0){if(l.toLowerCase()!==t.toLowerCase())continue}else t=l;if(n){if(t.length>0)break}else if(i=`${o.slice(a)}\\${i}`,n=h,h&&t.length>0)break}return i=zi(i,!n,"\\",Wi),n?`${t}\\${i}`:`${t}${i}`||"."},normalize(e){Fi(e,"path");const t=e.length;if(0===t)return".";let i,n=0,s=!1;const o=e.charCodeAt(0);if(1===t)return Vi(o)?"\\":e;if(Wi(o))if(s=!0,Wi(e.charCodeAt(1))){let s=2,o=s;for(;s2&&Wi(e.charCodeAt(2))&&(s=!0,n=3));let r=n0&&Wi(e.charCodeAt(t-1))&&(r+="\\"),void 0===i?s?`\\${r}`:r:s?`${i}\\${r}`:`${i}${r}`},isAbsolute(e){Fi(e,"path");const t=e.length;if(0===t)return!1;const i=e.charCodeAt(0);return Wi(i)||t>2&&Hi(i)&&e.charCodeAt(1)===Oi&&Wi(e.charCodeAt(2))},join(...e){if(0===e.length)return".";let t,i;for(let o=0;o0&&(void 0===t?t=i=n:t+=`\\${n}`)}if(void 0===t)return".";let n=!0,s=0;if("string"==typeof i&&Wi(i.charCodeAt(0))){++s;const e=i.length;e>1&&Wi(i.charCodeAt(1))&&(++s,e>2&&(Wi(i.charCodeAt(2))?++s:n=!1))}if(n){for(;s=2&&(t=`\\${t.slice(s)}`)}return Ki.normalize(t)},relative(e,t){if(Fi(e,"from"),Fi(t,"to"),e===t)return"";const i=Ki.resolve(e),n=Ki.resolve(t);if(i===n)return"";if((e=i.toLowerCase())===(t=n.toLowerCase()))return"";let s=0;for(;ss&&e.charCodeAt(o-1)===Ai;)o--;const r=o-s;let a=0;for(;aa&&t.charCodeAt(l-1)===Ai;)l--;const h=l-a,d=rd){if(t.charCodeAt(a+u)===Ai)return n.slice(a+u+1);if(2===u)return n.slice(a+u)}r>d&&(e.charCodeAt(s+u)===Ai?c=u:2===u&&(c=3)),-1===c&&(c=0)}let g="";for(u=s+c+1;u<=o;++u)u!==o&&e.charCodeAt(u)!==Ai||(g+=0===g.length?"..":"\\..");return a+=c,g.length>0?`${g}${n.slice(a,l)}`:(n.charCodeAt(a)===Ai&&++a,n.slice(a,l))},toNamespacedPath(e){if("string"!=typeof e||0===e.length)return e;const t=Ki.resolve(e);if(t.length<=2)return e;if(t.charCodeAt(0)===Ai){if(t.charCodeAt(1)===Ai){const e=t.charCodeAt(2);if(63!==e&&e!==Ti)return`\\\\?\\UNC\\${t.slice(2)}`}}else if(Hi(t.charCodeAt(0))&&t.charCodeAt(1)===Oi&&t.charCodeAt(2)===Ai)return`\\\\?\\${t}`;return e},dirname(e){Fi(e,"path");const t=e.length;if(0===t)return".";let i=-1,n=0;const s=e.charCodeAt(0);if(1===t)return Wi(s)?e:".";if(Wi(s)){if(i=n=1,Wi(e.charCodeAt(1))){let s=2,o=s;for(;s2&&Wi(e.charCodeAt(2))?3:2,n=i);let o=-1,r=!0;for(let a=t-1;a>=n;--a)if(Wi(e.charCodeAt(a))){if(!r){o=a;break}}else r=!1;if(-1===o){if(-1===i)return".";o=i}return e.slice(0,o)},basename(e,t){void 0!==t&&Fi(t,"ext"),Fi(e,"path");let i,n=0,s=-1,o=!0;if(e.length>=2&&Hi(e.charCodeAt(0))&&e.charCodeAt(1)===Oi&&(n=2),void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let r=t.length-1,a=-1;for(i=e.length-1;i>=n;--i){const l=e.charCodeAt(i);if(Wi(l)){if(!o){n=i+1;break}}else-1===a&&(o=!1,a=i+1),r>=0&&(l===t.charCodeAt(r)?-1==--r&&(s=i):(r=-1,s=a))}return n===s?s=a:-1===s&&(s=e.length),e.slice(n,s)}for(i=e.length-1;i>=n;--i)if(Wi(e.charCodeAt(i))){if(!o){n=i+1;break}}else-1===s&&(o=!1,s=i+1);return-1===s?"":e.slice(n,s)},extname(e){Fi(e,"path");let t=0,i=-1,n=0,s=-1,o=!0,r=0;e.length>=2&&e.charCodeAt(1)===Oi&&Hi(e.charCodeAt(0))&&(t=n=2);for(let a=e.length-1;a>=t;--a){const t=e.charCodeAt(a);if(Wi(t)){if(!o){n=a+1;break}}else-1===s&&(o=!1,s=a+1),t===Ti?-1===i?i=a:1!==r&&(r=1):-1!==i&&(r=-1)}return-1===i||-1===s||0===r||1===r&&i===s-1&&i===n+1?"":e.slice(i,s)},format:Ui.bind(null,"\\"),parse(e){Fi(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const i=e.length;let n=0,s=e.charCodeAt(0);if(1===i)return Wi(s)?(t.root=t.dir=e,t):(t.base=t.name=e,t);if(Wi(s)){if(n=1,Wi(e.charCodeAt(1))){let t=2,s=t;for(;t0&&(t.root=e.slice(0,n));let o=-1,r=n,a=-1,l=!0,h=e.length-1,d=0;for(;h>=n;--h)if(s=e.charCodeAt(h),Wi(s)){if(!l){r=h+1;break}}else-1===a&&(l=!1,a=h+1),s===Ti?-1===o?o=h:1!==d&&(d=1):-1!==o&&(d=-1);return-1!==a&&(-1===o||0===d||1===d&&o===a-1&&o===r+1?t.base=t.name=e.slice(r,a):(t.name=e.slice(r,o),t.base=e.slice(r,a),t.ext=e.slice(o,a))),t.dir=r>0&&r!==n?e.slice(0,r-1):t.root,t},sep:"\\",delimiter:";",win32:null,posix:null},ji=(()=>{if(Bi){const e=/\\/g;return()=>{const t=Ei().replace(e,"/");return t.slice(t.indexOf("/"))}}return()=>Ei()})(),qi={resolve(...e){let t="",i=!1;for(let n=e.length-1;n>=-1&&!i;n--){const s=n>=0?e[n]:ji();Fi(s,"path"),0!==s.length&&(t=`${s}/${t}`,i=s.charCodeAt(0)===Ri)}return t=zi(t,!i,"/",Vi),i?`/${t}`:t.length>0?t:"."},normalize(e){if(Fi(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===Ri,i=e.charCodeAt(e.length-1)===Ri;return 0===(e=zi(e,!t,"/",Vi)).length?t?"/":i?"./":".":(i&&(e+="/"),t?`/${e}`:e)},isAbsolute:e=>(Fi(e,"path"),e.length>0&&e.charCodeAt(0)===Ri),join(...e){if(0===e.length)return".";let t;for(let i=0;i0&&(void 0===t?t=n:t+=`/${n}`)}return void 0===t?".":qi.normalize(t)},relative(e,t){if(Fi(e,"from"),Fi(t,"to"),e===t)return"";if((e=qi.resolve(e))===(t=qi.resolve(t)))return"";const i=e.length,n=i-1,s=t.length-1,o=no){if(t.charCodeAt(1+a)===Ri)return t.slice(1+a+1);if(0===a)return t.slice(1+a)}else n>o&&(e.charCodeAt(1+a)===Ri?r=a:0===a&&(r=0));let l="";for(a=1+r+1;a<=i;++a)a!==i&&e.charCodeAt(a)!==Ri||(l+=0===l.length?"..":"/..");return`${l}${t.slice(1+r)}`},toNamespacedPath:e=>e,dirname(e){if(Fi(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===Ri;let i=-1,n=!0;for(let s=e.length-1;s>=1;--s)if(e.charCodeAt(s)===Ri){if(!n){i=s;break}}else n=!1;return-1===i?t?"/":".":t&&1===i?"//":e.slice(0,i)},basename(e,t){void 0!==t&&Fi(t,"ext"),Fi(e,"path");let i,n=0,s=-1,o=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let r=t.length-1,a=-1;for(i=e.length-1;i>=0;--i){const l=e.charCodeAt(i);if(l===Ri){if(!o){n=i+1;break}}else-1===a&&(o=!1,a=i+1),r>=0&&(l===t.charCodeAt(r)?-1==--r&&(s=i):(r=-1,s=a))}return n===s?s=a:-1===s&&(s=e.length),e.slice(n,s)}for(i=e.length-1;i>=0;--i)if(e.charCodeAt(i)===Ri){if(!o){n=i+1;break}}else-1===s&&(o=!1,s=i+1);return-1===s?"":e.slice(n,s)},extname(e){Fi(e,"path");let t=-1,i=0,n=-1,s=!0,o=0;for(let r=e.length-1;r>=0;--r){const a=e.charCodeAt(r);if(a!==Ri)-1===n&&(s=!1,n=r+1),a===Ti?-1===t?t=r:1!==o&&(o=1):-1!==t&&(o=-1);else if(!s){i=r+1;break}}return-1===t||-1===n||0===o||1===o&&t===n-1&&t===i+1?"":e.slice(t,n)},format:Ui.bind(null,"/"),parse(e){Fi(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const i=e.charCodeAt(0)===Ri;let n;i?(t.root="/",n=1):n=0;let s=-1,o=0,r=-1,a=!0,l=e.length-1,h=0;for(;l>=n;--l){const t=e.charCodeAt(l);if(t!==Ri)-1===r&&(a=!1,r=l+1),t===Ti?-1===s?s=l:1!==h&&(h=1):-1!==s&&(h=-1);else if(!a){o=l+1;break}}if(-1!==r){const n=0===o&&i?1:o;-1===s||0===h||1===h&&s===r-1&&s===o+1?t.base=t.name=e.slice(n,r):(t.name=e.slice(n,s),t.base=e.slice(n,r),t.ext=e.slice(s,r))}return o>0?t.dir=e.slice(0,o-1):i&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};qi.win32=Ki.win32=Ki,qi.posix=Ki.posix=qi;const $i=Bi?Ki.normalize:qi.normalize,Gi=Bi?Ki.resolve:qi.resolve,Zi=Bi?Ki.relative:qi.relative,Yi=Bi?Ki.dirname:qi.dirname,Xi=Bi?Ki.basename:qi.basename,Qi=Bi?Ki.extname:qi.extname,Ji=Bi?Ki.sep:qi.sep,en=/^\w[\w\d+.-]*$/,tn=/^\//,nn=/^\/\//;const sn="",on="/",rn=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class an{static isUri(e){return e instanceof an||!!e&&("string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"string"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString)}constructor(e,t,i,n,s,o=!1){"object"==typeof e?(this.scheme=e.scheme||sn,this.authority=e.authority||sn,this.path=e.path||sn,this.query=e.query||sn,this.fragment=e.fragment||sn):(this.scheme=function(e,t){return e||t?e:"file"}(e,o),this.authority=t||sn,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==on&&(t=on+t):t=on}return t}(this.scheme,i||sn),this.query=n||sn,this.fragment=s||sn,function(e,t){if(!e.scheme&&t)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!en.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!tn.test(e.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(nn.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}(this,o))}get fsPath(){return gn(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:n,query:s,fragment:o}=e;return void 0===t?t=this.scheme:null===t&&(t=sn),void 0===i?i=this.authority:null===i&&(i=sn),void 0===n?n=this.path:null===n&&(n=sn),void 0===s?s=this.query:null===s&&(s=sn),void 0===o?o=this.fragment:null===o&&(o=sn),t===this.scheme&&i===this.authority&&n===this.path&&s===this.query&&o===this.fragment?this:new hn(t,i,n,s,o)}static parse(e,t=!1){const i=rn.exec(e);return i?new hn(i[2]||sn,_n(i[4]||sn),_n(i[5]||sn),_n(i[7]||sn),_n(i[9]||sn),t):new hn(sn,sn,sn,sn,sn)}static file(e){let t=sn;if(Oe&&(e=e.replace(/\\/g,on)),e[0]===on&&e[1]===on){const i=e.indexOf(on,2);-1===i?(t=e.substring(2),e=on):(t=e.substring(2,i),e=e.substring(i)||on)}return new hn("file",t,e,sn,sn)}static from(e,t){return new hn(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 i=Oe&&"file"===e.scheme?an.file(Ki.join(gn(e,!0),...t)).path:qi.join(e.path,...t),e.with({path:i})}toString(e=!1){return pn(this,e)}toJSON(){return this}static revive(e){var t,i;if(e){if(e instanceof an)return e;{const n=new hn(e);return n._formatted=null!==(t=e.external)&&void 0!==t?t:null,n._fsPath=e._sep===ln&&null!==(i=e.fsPath)&&void 0!==i?i:null,n}}return e}}const ln=Oe?1:void 0;class hn extends an{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=gn(this,!1)),this._fsPath}toString(e=!1){return e?pn(this,!0):(this._formatted||(this._formatted=pn(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=ln),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 dn={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function cn(e,t,i){let n,s=-1;for(let o=0;o=97&&r<=122||r>=65&&r<=90||r>=48&&r<=57||45===r||46===r||95===r||126===r||t&&47===r||i&&91===r||i&&93===r||i&&58===r)-1!==s&&(n+=encodeURIComponent(e.substring(s,o)),s=-1),void 0!==n&&(n+=e.charAt(o));else{void 0===n&&(n=e.substr(0,o));const t=dn[r];void 0!==t?(-1!==s&&(n+=encodeURIComponent(e.substring(s,o)),s=-1),n+=t):-1===s&&(s=o)}}return-1!==s&&(n+=encodeURIComponent(e.substring(s))),void 0!==n?n:e}function un(e){let t;for(let i=0;i1&&"file"===e.scheme?`//${e.authority}${e.path}`:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,Oe&&(i=i.replace(/\//g,"\\")),i}function pn(e,t){const i=t?un:cn;let n="",{scheme:s,authority:o,path:r,query:a,fragment:l}=e;if(s&&(n+=s,n+=":"),(o||"file"===s)&&(n+=on,n+=on),o){let e=o.indexOf("@");if(-1!==e){const t=o.substr(0,e);o=o.substr(e+1),e=t.lastIndexOf(":"),-1===e?n+=i(t,!1,!1):(n+=i(t.substr(0,e),!1,!1),n+=":",n+=i(t.substr(e+1),!1,!0)),n+="@"}o=o.toLowerCase(),e=o.lastIndexOf(":"),-1===e?n+=i(o,!1,!0):(n+=i(o.substr(0,e),!1,!0),n+=o.substr(e))}if(r){if(r.length>=3&&47===r.charCodeAt(0)&&58===r.charCodeAt(2)){const e=r.charCodeAt(1);e>=65&&e<=90&&(r=`/${String.fromCharCode(e+32)}:${r.substr(3)}`)}else if(r.length>=2&&58===r.charCodeAt(1)){const e=r.charCodeAt(0);e>=65&&e<=90&&(r=`${String.fromCharCode(e+32)}:${r.substr(2)}`)}n+=i(r,!0,!1)}return a&&(n+="?",n+=i(a,!1,!1)),l&&(n+="#",n+=t?l:cn(l,!1,!1)),n}function mn(e){try{return decodeURIComponent(e)}catch(ge){return e.length>3?e.substr(0,3)+mn(e.substr(3)):e}}const fn=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function _n(e){return e.match(fn)?e.replace(fn,(e=>mn(e))):e}var vn;!function(e){e.inMemory="inmemory",e.vscode="vscode",e.internal="private",e.walkThrough="walkThrough",e.walkThroughSnippet="walkThroughSnippet",e.http="http",e.https="https",e.file="file",e.mailto="mailto",e.untitled="untitled",e.data="data",e.command="command",e.vscodeRemote="vscode-remote",e.vscodeRemoteResource="vscode-remote-resource",e.vscodeManagedRemoteResource="vscode-managed-remote-resource",e.vscodeUserData="vscode-userdata",e.vscodeCustomEditor="vscode-custom-editor",e.vscodeNotebookCell="vscode-notebook-cell",e.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",e.vscodeNotebookCellOutput="vscode-notebook-cell-output",e.vscodeInteractiveInput="vscode-interactive-input",e.vscodeSettings="vscode-settings",e.vscodeWorkspaceTrust="vscode-workspace-trust",e.vscodeTerminal="vscode-terminal",e.vscodeChatSesssion="vscode-chat-editor",e.webviewPanel="webview-panel",e.vscodeWebview="vscode-webview",e.extension="extension",e.vscodeFileResource="vscode-file",e.tmp="tmp",e.vsls="vsls",e.vscodeSourceControl="vscode-scm"}(vn||(vn={}));const bn=new class{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath=`/${vn.vscodeRemoteResource}`}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return r(a),e}const t=e.authority;let i=this._hosts[t];i&&-1!==i.indexOf(":")&&-1===i.indexOf("[")&&(i=`[${i}]`);const n=this._ports[t],s=this._connectionTokens[t];let o=`path=${encodeURIComponent(e.path)}`;return"string"==typeof s&&(o+=`&tkn=${encodeURIComponent(s)}`),an.from({scheme:We?this._preferredWebSchema:vn.vscodeRemoteResource,authority:`${i}:${n}`,path:this._remoteResourcesPath,query:o})}};class Cn{uriToBrowserUri(e){return e.scheme===vn.vscodeRemote?bn.rewrite(e):e.scheme===vn.file&&(Be||Ve&&Ie.origin===`${vn.vscodeFileResource}://${Cn.FALLBACK_AUTHORITY}`)?e.with({scheme:vn.vscodeFileResource,authority:e.authority||Cn.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}Cn.FALLBACK_AUTHORITY="vscode-app";const wn=new Cn;var yn;!function(e){const t=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"}]]);e.CoopAndCoep=Object.freeze(t.get("3"));const i="vscode-coi";e.getHeadersFromQuery=function(e){let n;"string"==typeof e?n=new URL(e).searchParams:e instanceof URL?n=e.searchParams:an.isUri(e)&&(n=new URL(e.toString(!0)).searchParams);const s=null==n?void 0:n.get(i);if(s)return t.get(s)},e.addSearchParam=function(e,t,n){if(!globalThis.crossOriginIsolated)return;const s=t&&n?"3":n?"2":"1";e instanceof URLSearchParams?e.set(i,s):e[i]=s}}(yn||(yn={}));const{registerWindow:Sn,getWindows:Ln,onDidCreateWindow:kn}=function(){const e=[],t=new U;return{onDidCreateWindow:t.event,registerWindow(i){e.push(i);const n=new N;return n.add(x((()=>{const t=e.indexOf(i);-1!==t&&e.splice(t,1)}))),t.fire({window:i,disposableStore:n}),n},getWindows:()=>e}}();function Dn(e){for(;e.firstChild;)e.firstChild.remove()}function xn(e){var t;return null!==(t=null==e?void 0:e.isConnected)&&void 0!==t&&t}class Nn{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 En(e,t,i,n){return new Nn(e,t,i,n)}function In(e){return function(t){return e(new Nt(t))}}const Mn=function(e,t,i,n){let s=i;return"click"===t||"mousedown"===t?s=In(i):"keydown"!==t&&"keypress"!==t&&"keyup"!==t||(s=function(e){return function(t){return e(new St(t))}}(i)),En(e,t,s,n)},Tn=function(e,t,i){return function(e,t,i){return En(e,He&&tt?os.POINTER_DOWN:os.MOUSE_DOWN,t,i)}(e,In(t),i)};let Rn,An;class On{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(Mre){r(Mre)}}static sort(e,t){return t.priority-e.priority}}function Pn(e){return e.ownerDocument.defaultView.getComputedStyle(e,null)}function Fn(e){var t;const i=e.ownerDocument,n=null===(t=i.defaultView)||void 0===t?void 0:t.window;if(e!==i.body)return new Wn(e.clientWidth,e.clientHeight);if(He&&(null==n?void 0:n.visualViewport))return new Wn(n.visualViewport.width,n.visualViewport.height);if((null==n?void 0:n.innerWidth)&&n.innerHeight)return new Wn(n.innerWidth,n.innerHeight);if(i.body&&i.body.clientWidth&&i.body.clientHeight)return new Wn(i.body.clientWidth,i.body.clientHeight);if(i.documentElement&&i.documentElement.clientWidth&&i.documentElement.clientHeight)return new Wn(i.documentElement.clientWidth,i.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}!function(){let e=[],t=null,i=!1,n=!1;const s=()=>{for(i=!1,t=e,e=[],n=!0;t.length>0;){t.sort(On.sort);t.shift().execute()}n=!1};An=(t,n=0)=>{const o=new On(t,n);return e.push(o),i||(i=!0,requestAnimationFrame(s)),o},Rn=(e,i)=>{if(n){const n=new On(e,i);return t.push(n),n}return An(e,i)}}();class Bn{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const n=Pn(e),s=n?n.getPropertyValue(t):"0";return Bn.convertToPixels(e,s)}static getBorderLeftWidth(e){return Bn.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return Bn.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return Bn.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return Bn.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return Bn.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return Bn.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return Bn.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return Bn.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return Bn.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return Bn.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return Bn.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return Bn.getDimension(e,"margin-bottom","marginBottom")}}class Wn{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new Wn(e,t):this}static is(e){return"object"==typeof e&&"number"==typeof e.height&&"number"==typeof e.width}static lift(e){return e instanceof Wn?e:new Wn(e.width,e.height)}static equals(e,t){return e===t||!(!e||!t)&&(e.width===t.width&&e.height===t.height)}}function Vn(e){let t=e.offsetParent,i=e.offsetTop,n=e.offsetLeft;for(;null!==(e=e.parentNode)&&e!==e.ownerDocument.body&&e!==e.ownerDocument.documentElement;){i-=e.scrollTop;const s=Gn(e)?null:Pn(e);s&&(n-="rtl"!==s.direction?e.scrollLeft:-e.scrollLeft),e===t&&(n+=Bn.getBorderLeftWidth(e),i+=Bn.getBorderTopWidth(e),i+=e.offsetTop,n+=e.offsetLeft,t=e.offsetParent)}return{left:n,top:i}}function Hn(e){var t,i,n,s;const o=e.getBoundingClientRect();return{left:o.left+(null!==(i=null===(t=e.ownerDocument.defaultView)||void 0===t?void 0:t.scrollX)&&void 0!==i?i:0),top:o.top+(null!==(s=null===(n=e.ownerDocument.defaultView)||void 0===n?void 0:n.scrollY)&&void 0!==s?s:0),width:o.width,height:o.height}}function zn(e){const t=Bn.getMarginLeft(e)+Bn.getMarginRight(e);return e.offsetWidth+t}function Un(e){const t=Bn.getBorderLeftWidth(e)+Bn.getBorderRightWidth(e),i=Bn.getPaddingLeft(e)+Bn.getPaddingRight(e);return e.offsetWidth-t-i}function Kn(e){const t=Bn.getBorderTopWidth(e)+Bn.getBorderBottomWidth(e),i=Bn.getPaddingTop(e)+Bn.getPaddingBottom(e);return e.offsetHeight-t-i}function jn(e){const t=Bn.getMarginTop(e)+Bn.getMarginBottom(e);return e.offsetHeight+t}function qn(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function $n(e,t,i){return!!function(e,t,i){for(;e&&e.nodeType===e.ELEMENT_NODE;){if(e.classList.contains(t))return e;if(i)if("string"==typeof i){if(e.classList.contains(i))return null}else if(e===i)return null;e=e.parentNode}return null}(e,t,i)}function Gn(e){return e&&!!e.host&&!!e.mode}function Zn(e){return!!Yn(e)}function Yn(e){for(var t;e.parentNode;){if(e===(null===(t=e.ownerDocument)||void 0===t?void 0:t.body))return null;e=e.parentNode}return Gn(e)?e:null}function Xn(){let e=Qn().activeElement;for(;null==e?void 0:e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Qn(){var e;return null!==(e=[document,...Ln().map((e=>e.document))].find((e=>e.hasFocus())))&&void 0!==e?e:document}function Jn(e=document.getElementsByTagName("head")[0],t){const i=document.createElement("style");return i.type="text/css",i.media="screen",null==t||t(i),e.appendChild(i),i}Wn.None=new Wn(0,0);let es=null;function ts(){return es||(es=Jn()),es}function is(e,t,i=ts()){i&&t&&i.sheet.insertRule(e+"{"+t+"}",0)}function ns(e,t=ts()){if(!t)return;const i=function(e){var t,i;return(null===(t=null==e?void 0:e.sheet)||void 0===t?void 0:t.rules)?e.sheet.rules:(null===(i=null==e?void 0:e.sheet)||void 0===i?void 0:i.cssRules)?e.sheet.cssRules:[]}(t),n=[];for(let s=0;s=0;s--)t.sheet.deleteRule(n[s])}function ss(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName}const os={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",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:se?"webkitAnimationStart":"animationstart",ANIMATION_END:se?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:se?"webkitAnimationIteration":"animationiteration"};function rs(e){const t=e;return!(!t||"function"!=typeof t.preventDefault||"function"!=typeof t.stopPropagation)}const as=(e,t)=>(e.preventDefault(),t&&e.stopPropagation(),e);class ls extends E{static hasFocusWithin(e){if(ss(e)){const t=Yn(e);return qn(t?t.activeElement:e.ownerDocument.activeElement,e)}return qn(window.document.activeElement,window.document)}constructor(e){super(),this._onDidFocus=this._register(new U),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new U),this.onDidBlur=this._onDidBlur.event;let t=ls.hasFocusWithin(e),i=!1;const n=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},s=()=>{t&&(i=!0,window.setTimeout((()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())}),0))};this._refreshStateHandler=()=>{ls.hasFocusWithin(e)!==t&&(t?s():n())},this._register(En(e,os.FOCUS,n,!0)),this._register(En(e,os.BLUR,s,!0)),e instanceof HTMLElement&&(this._register(En(e,os.FOCUS_IN,(()=>this._refreshStateHandler()))),this._register(En(e,os.FOCUS_OUT,(()=>this._refreshStateHandler()))))}}function hs(e){return new ls(e)}function ds(e,...t){if(e.append(...t),1===t.length&&"string"!=typeof t[0])return t[0]}function cs(e,t){return e.insertBefore(t,e.firstChild),t}function us(e,...t){e.innerText="",ds(e,...t)}const gs=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var ps;function ms(e,t,i,...n){const s=gs.exec(t);if(!s)throw new Error("Bad use of emmet");const o=s[1]||"div";let r;return r=e!==ps.HTML?document.createElementNS(e,o):document.createElement(o),s[3]&&(r.id=s[3]),s[4]&&(r.className=s[4].replace(/\./g," ").trim()),i&&Object.entries(i).forEach((([e,t])=>{void 0!==t&&(/^on\w+$/.test(e)?r[e]=t:"selected"===e?t&&r.setAttribute(e,"true"):r.setAttribute(e,t))})),r.append(...n),r}function fs(e,t,...i){return ms(ps.HTML,e,t,...i)}function _s(...e){for(const t of e)t.style.display="",t.removeAttribute("aria-hidden")}function vs(...e){for(const t of e)t.style.display="none",t.setAttribute("aria-hidden","true")}function bs(e){const t=window.devicePixelRatio*e;return Math.max(1,Math.floor(t))/window.devicePixelRatio}function Cs(e){window.open(e,"_blank","noopener")}function ws(e){return e?`url('${wn.uriToBrowserUri(e).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function ys(e){return`'${e.replace(/'/g,"%27")}'`}function Ss(e,t){if(void 0!==e){const i=e.match(/^\s*var\((.+)\)$/);if(i){const e=i[1].split(",",2);return 2===e.length&&(t=Ss(e[1].trim(),t)),`var(${e[0]}, ${t})`}return e}return t}!function(e){e.HTML="http://www.w3.org/1999/xhtml",e.SVG="http://www.w3.org/2000/svg"}(ps||(ps={})),fs.SVG=function(e,t,...i){return ms(ps.SVG,e,t,...i)},bn.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");const Ls=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","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"]);Object.freeze({ALLOWED_TAGS:["a","button","blockquote","code","div","h1","h2","h3","h4","h5","h6","hr","input","label","li","p","pre","select","small","span","strong","textarea","ul","ol"],ALLOWED_ATTR:["href","data-href","data-command","target","title","name","src","alt","class","id","role","tabindex","style","data-code","width","height","align","x-dispatch","required","checked","placeholder","type","start"],RETURN_DOM:!1,RETURN_DOM_FRAGMENT:!1,RETURN_TRUSTED_TYPE:!0});class ks extends U{constructor(){super(),this._subscriptions=new N,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(En(window,"keydown",(e=>{if(e.defaultPrevented)return;const t=new St(e);if(6!==t.keyCode||!e.repeat){if(e.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(e.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(e.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(e.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else{if(6===t.keyCode)return;this._keyStatus.lastKeyPressed=void 0}this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=e,this.fire(this._keyStatus))}}),!0)),this._subscriptions.add(En(window,"keyup",(e=>{e.defaultPrevented||(!e.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!e.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!e.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!e.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=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=e,this.fire(this._keyStatus)))}),!0)),this._subscriptions.add(En(document.body,"mousedown",(()=>{this._keyStatus.lastKeyPressed=void 0}),!0)),this._subscriptions.add(En(document.body,"mouseup",(()=>{this._keyStatus.lastKeyPressed=void 0}),!0)),this._subscriptions.add(En(document.body,"mousemove",(e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)}),!0)),this._subscriptions.add(En(window,"blur",(()=>{this.resetKeyStatus()})))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return ks.instance||(ks.instance=new ks),ks.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class Ds extends E{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this._register(En(this.element,os.DRAG_ENTER,(e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter(e)}))),this._register(En(this.element,os.DRAG_OVER,(e=>{var t,i;e.preventDefault(),null===(i=(t=this.callbacks).onDragOver)||void 0===i||i.call(t,e,e.timeStamp-this.dragStartTime)}))),this._register(En(this.element,os.DRAG_LEAVE,(e=>{this.counter--,0===this.counter&&(this.dragStartTime=0,this.callbacks.onDragLeave(e))}))),this._register(En(this.element,os.DRAG_END,(e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd(e)}))),this._register(En(this.element,os.DROP,(e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop(e)})))}}const xs=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function Ns(e,...t){let i,n;Array.isArray(t[0])?(i={},n=t[0]):(i=t[0]||{},n=t[1]);const s=xs.exec(e);if(!s||!s.groups)throw new Error("Bad use of h");const o=s.groups.tag||"div",r=document.createElement(o);s.groups.id&&(r.id=s.groups.id);const a=[];if(s.groups.class)for(const h of s.groups.class.split("."))""!==h&&a.push(h);if(void 0!==i.className)for(const h of i.className.split("."))""!==h&&a.push(h);a.length>0&&(r.className=a.join(" "));const l={};if(s.groups.name&&(l[s.groups.name]=r),n)for(const h of n)h instanceof HTMLElement?r.appendChild(h):"string"==typeof h?r.append(h):"root"in h&&(Object.assign(l,h),r.appendChild(h.root));for(const[h,d]of Object.entries(i))if("className"!==h)if("style"===h)for(const[e,t]of Object.entries(d))r.style.setProperty(Es(e),"number"==typeof t?t+"px":""+t);else"tabIndex"===h?r.tabIndex=d:r.setAttribute(Es(h),d.toString());return l.root=r,l}function Es(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}const Is=2e4;let Ms,Ts,Rs,As,Os;function Ps(e){Ms&&(Ts.textContent!==e?(Dn(Rs),Bs(Ts,e)):(Dn(Ts),Bs(Rs,e)))}function Fs(e){Ms&&(As.textContent!==e?(Dn(Os),Bs(As,e)):(Dn(As),Bs(Os,e)))}function Bs(e,t){Dn(e),t.length>Is&&(t=t.substr(0,Is)),e.textContent=t,e.style.visibility="hidden",e.style.visibility="visible"}var Ws,Vs,Hs;class zs{constructor(e,t){this.uri=e,this.value=t}}class Us{constructor(e,t){if(this[Ws]="ResourceMap",e instanceof Us)this.map=new Map(e.map),this.toKey=null!=t?t:Us.defaultToKey;else if(function(e){return Array.isArray(e)}(e)){this.map=new Map,this.toKey=null!=t?t:Us.defaultToKey;for(const[t,i]of e)this.set(t,i)}else this.map=new Map,this.toKey=null!=e?e:Us.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new zs(e,t)),this}get(e){var t;return null===(t=this.map.get(this.toKey(e)))||void 0===t?void 0:t.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){void 0!==t&&(e=e.bind(t));for(const[i,n]of this.map)e(n.value,n.uri,this)}*values(){for(const e of this.map.values())yield e.value}*keys(){for(const e of this.map.values())yield e.uri}*entries(){for(const e of this.map.values())yield[e.uri,e.value]}*[(Ws=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}Us.defaultToKey=e=>e.toString();class Ks{constructor(){this[Vs]="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(){var e;return null===(e=this._head)||void 0===e?void 0:e.value}get last(){var e;return null===(e=this._tail)||void 0===e?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const i=this._map.get(e);if(i)return 0!==t&&this.touch(i,t),i.value}set(e,t,i=0){let n=this._map.get(e);if(n)n.value=t,0!==i&&this.touch(n,i);else{switch(n={key:e,value:t,next:void 0,previous:void 0},i){case 0:case 2:default:this.addItemLast(n);break;case 1:this.addItemFirst(n)}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,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:i.key,done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}values(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:i.value,done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}entries(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:[i.key,i.value],done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}[(Vs=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(0===e)return void this.clear();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){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e,this._state++}addItemLast(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;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(1===t||2===t)if(1===t){if(e===this._head)return;const t=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(t.previous=i,i.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(2===t){if(e===this._tail)return;const t=e.next,i=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=i,i.next=t),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)}}class js extends Ks{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(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}class qs{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[t,i]of e)this.set(t,i)}clear(){this._m1.clear(),this._m2.clear()}set(e,t){this._m1.set(e,t),this._m2.set(t,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){const t=this._m1.get(e);return void 0!==t&&(this._m1.delete(e),this._m2.delete(t),!0)}keys(){return this._m1.keys()}values(){return this._m1.values()}}class $s{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){const i=this.map.get(e);i&&(i.delete(t),0===i.size&&this.map.delete(e))}forEach(e,t){const i=this.map.get(e);i&&i.forEach(t)}get(e){const t=this.map.get(e);return t||new Set}}class Gs{get cachedValues(){return this._map}constructor(e){this.fn=e,this._map=new Map}get(e){if(this._map.has(e))return this._map.get(e);const t=this.fn(e);return this._map.set(e,t),t}}class Zs{constructor(e){this.executor=e,this._didRun=!1}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}function Ys(e){return!e||"string"!=typeof e||0===e.trim().length}const Xs=/{(\d+)}/g;function Qs(e,...t){return 0===t.length?e:e.replace(Xs,(function(e,i){const n=parseInt(i,10);return isNaN(n)||n<0||n>=t.length?e:t[n]}))}function Js(e){return e.replace(/[<>&]/g,(function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}}))}function eo(e){return e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function to(e,t=" "){return no(io(e,t),t)}function io(e,t){if(!e||!t)return e;const i=t.length;if(0===i||0===e.length)return e;let n=0;for(;e.indexOf(t,n)===n;)n+=i;return e.substring(n)}function no(e,t){if(!e||!t)return e;const i=t.length,n=e.length;if(0===i||0===n)return e;let s=n,o=-1;for(;o=e.lastIndexOf(t,s-1),-1!==o&&o+i===s;){if(0===o)return"";s=o}return e.substring(0,s)}function so(e,t,i={}){if(!e)throw new Error("Cannot create regex from empty string");t||(e=eo(e)),i.wholeWord&&(/\B/.test(e.charAt(0))||(e="\\b"+e),/\B/.test(e.charAt(e.length-1))||(e+="\\b"));let n="";return i.global&&(n+="g"),i.matchCase||(n+="i"),i.multiline&&(n+="m"),i.unicode&&(n+="u"),new RegExp(e,n)}function oo(e){return e.split(/\r\n|\r|\n/)}function ro(e){for(let t=0,i=e.length;t=0;i--){const t=e.charCodeAt(i);if(32!==t&&9!==t)return i}return-1}function ho(e,t){return et?1:0}function co(e,t,i=0,n=e.length,s=0,o=t.length){for(;io)return 1}const r=n-i,a=o-s;return ra?1:0}function uo(e,t){return go(e,t,0,e.length,0,t.length)}function go(e,t,i=0,n=e.length,s=0,o=t.length){for(;i=128||a>=128)return co(e.toLowerCase(),t.toLowerCase(),i,n,s,o);mo(r)&&(r-=32),mo(a)&&(a-=32);const l=r-a;if(0!==l)return l}const r=n-i,a=o-s;return ra?1:0}function po(e){return e>=48&&e<=57}function mo(e){return e>=97&&e<=122}function fo(e){return e>=65&&e<=90}function _o(e,t){return e.length===t.length&&0===go(e,t)}function vo(e,t){const i=t.length;return!(t.length>e.length)&&0===go(e,t,0,i)}function bo(e,t){const i=Math.min(e.length,t.length);let n;for(n=0;n1){const n=e.charCodeAt(t-2);if(wo(n))return So(n,i)}return i}(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=Lo(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class Do{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new ko(e,t)}nextGraphemeLength(){const e=Ho.getInstance(),t=this._iterator,i=t.offset;let n=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const i=t.offset,s=e.getGraphemeBreakType(t.nextCodePoint());if(Vo(n,s)){t.setOffset(i);break}n=s}return t.offset-i}prevGraphemeLength(){const e=Ho.getInstance(),t=this._iterator,i=t.offset;let n=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const i=t.offset,s=e.getGraphemeBreakType(t.prevCodePoint());if(Vo(s,n)){t.setOffset(i);break}n=s}return i-t.offset}eol(){return this._iterator.eol()}}function xo(e,t){return new Do(e,t).nextGraphemeLength()}function No(e,t){return new Do(e,t).prevGraphemeLength()}let Eo;function Io(e){return Eo||(Eo=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/),Eo.test(e)}const Mo=/^[\t\n\r\x20-\x7E]*$/;function To(e){return Mo.test(e)}const Ro=/[\u2028\u2029]/;function Ao(e){return Ro.test(e)}function Oo(e){return e>=11904&&e<=55215||e>=63744&&e<=64255||e>=65281&&e<=65374}function Po(e){return e>=127462&&e<=127487||8986===e||8987===e||9200===e||9203===e||e>=9728&&e<=10175||11088===e||11093===e||e>=127744&&e<=128591||e>=128640&&e<=128764||e>=128992&&e<=129008||e>=129280&&e<=129535||e>=129648&&e<=129782}const Fo=String.fromCharCode(65279);function Bo(e){return!!(e&&e.length>0&&65279===e.charCodeAt(0))}function Wo(e){return(e%=52)<26?String.fromCharCode(97+e):String.fromCharCode(65+e-26)}function Vo(e,t){return 0===e?5!==t&&7!==t:(2!==e||3!==t)&&(4===e||2===e||3===e||(4===t||2===t||3===t||(8!==e||8!==t&&9!==t&&11!==t&&12!==t)&&((11!==e&&9!==e||9!==t&&10!==t)&&((12!==e&&10!==e||10!==t)&&(5!==t&&13!==t&&(7!==t&&(1!==e&&((13!==e||14!==t)&&(6!==e||6!==t)))))))))}class Ho{static getInstance(){return Ho._INSTANCE||(Ho._INSTANCE=new Ho),Ho._INSTANCE}constructor(){this._data=JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}getGraphemeBreakType(e){if(e<32)return 10===e?3:13===e?2:4;if(e<127)return 0;const t=this._data,i=t.length/3;let n=1;for(;n<=i;)if(et[3*n+1]))return t[3*n+2];n=2*n+1}return 0}}function zo(e,t){if(0===e)return 0;const i=function(e,t){const i=new ko(t,e);let n=i.prevCodePoint();for(;Uo(n)||65039===n||8419===n;){if(0===i.offset)return;n=i.prevCodePoint()}if(!Po(n))return;let s=i.offset;if(s>0){8205===i.prevCodePoint()&&(s=i.offset)}return s}(e,t);if(void 0!==i)return i;const n=new ko(t,e);return n.prevCodePoint(),n.offset}function Uo(e){return 127995<=e&&e<=127999}Ho._INSTANCE=null;class Ko{static getInstance(e){return Hs.cache.get(Array.from(e))}static getLocales(){return Hs._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}Hs=Ko,Ko.ambiguousCharacterData=new Zs((()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'))),Ko.cache=new class{constructor(e){this.fn=e,this.lastCache=void 0,this.lastArgKey=void 0}get(e){const t=JSON.stringify(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this.fn(e)),this.lastCache}}((e=>{function t(e){const t=new Map;for(let i=0;i!e.startsWith("_")&&e in n));0===o.length&&(o=["_default"]);for(const a of o){s=i(s,t(n[a]))}const r=function(e,t){const i=new Map(e);for(const[n,s]of t)i.set(n,s);return i}(t(n._common),s);return new Hs(r)})),Ko._locales=new Zs((()=>Object.keys(Hs.ambiguousCharacterData.value).filter((e=>!e.startsWith("_")))));class jo{static getRawData(){return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]")}static getData(){return this._data||(this._data=new Set(jo.getRawData())),this._data}static isInvisibleCharacter(e){return jo.getData().has(e)}static get codePoints(){return jo.getData()}}function qo(...e){return function(t,i){for(let n=0,s=e.length;n0?[{start:0,end:t.length}]:[]:null}function Zo(e,t){const i=t.toLowerCase().indexOf(e.toLowerCase());return-1===i?null:[{start:i,end:i+e.length}]}function Yo(e,t){return Xo(e.toLowerCase(),t.toLowerCase(),0,0)}function Xo(e,t,i,n){if(i===e.length)return[];if(n===t.length)return null;if(e[i]===t[n]){let s=null;return(s=Xo(e,t,i+1,n+1))?or({start:n,end:n+1},s):null}return Xo(e,t,i,n+1)}function Qo(e){return 97<=e&&e<=122}function Jo(e){return 65<=e&&e<=90}function er(e){return 48<=e&&e<=57}function tr(e){return 32===e||9===e||10===e||13===e}const ir=new Set;function nr(e){return tr(e)||ir.has(e)}function sr(e){return Qo(e)||Jo(e)||er(e)}function or(e,t){return 0===t.length?t=[e]:e.end===t[0].start?t[0].start=e.start:t.unshift(e),t}function rr(e,t){for(let i=t;i0&&!sr(e.charCodeAt(i-1)))return i}return e.length}function ar(e,t,i,n){if(i===e.length)return[];if(n===t.length)return null;if(e[i]!==t[n].toLowerCase())return null;{let s=null,o=n+1;for(s=ar(e,t,i+1,n+1);!s&&(o=rr(t,o))60)return null;const i=function(e){let t=0,i=0,n=0,s=0,o=0;for(let r=0;r.2&&t<.8&&n>.6&&s<.2}(i)){if(!function(e){const{upperPercent:t,lowerPercent:i}=e;return 0===i&&t>.6}(i))return null;t=t.toLowerCase()}let n=null,s=0;for(e=e.toLowerCase();s0&&nr(e.charCodeAt(i-1)))return i;return e.length}"()[]{}<>`'\"-/;:,.?!".split("").forEach((e=>ir.add(e.charCodeAt(0))));const cr=qo($o,lr,Zo),ur=qo($o,lr,Yo),gr=new js(1e4);function pr(e,t,i=!1){if("string"!=typeof e||"string"!=typeof t)return null;let n=gr.get(e);n||(n=new RegExp(e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*"),"i"),gr.set(e,n));const s=n.exec(t);return s?[{start:s.index,end:s.index+s[0].length}]:i?ur(e,t):cr(e,t)}function mr(e,t){const i=Rr(e,e.toLowerCase(),0,t,t.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return i?_r(i):null}function fr(e,t,i,n,s,o){const r=Math.min(13,e.length);for(;i1;n--){const s=e[n]+i,o=t[t.length-1];o&&o.end===s?o.end=s+1:t.push({start:s,end:s+1})}return t}const vr=128;function br(){const e=[],t=[];for(let i=0;i<=vr;i++)t[i]=0;for(let i=0;i<=vr;i++)e.push(t.slice(0));return e}function Cr(e){const t=[];for(let i=0;i<=e;i++)t[i]=0;return t}const wr=Cr(2*vr),yr=Cr(2*vr),Sr=br(),Lr=br(),kr=br(),Dr=!1;function xr(e,t,i,n,s){function o(e,t,i=" "){for(;e.lengtho(e,3))).join("|")}\n`;for(let a=0;a<=i;a++)r+=0===a?" |":`${t[a-1]}|`,r+=e[a].slice(0,s+1).map((e=>o(e.toString(),3))).join("|")+"\n";return r}function Nr(e,t){if(t<0||t>=e.length)return!1;const i=e.codePointAt(t);switch(i){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!Po(i)}}function Er(e,t){if(t<0||t>=e.length)return!1;switch(e.charCodeAt(t)){case 32:case 9:return!0;default:return!1}}function Ir(e,t,i){return t[e]!==i[e]}var Mr;!function(e){e.Default=[-100,0],e.isDefault=function(e){return!e||2===e.length&&-100===e[0]&&0===e[1]}}(Mr||(Mr={}));class Tr{constructor(e,t){this.firstMatchCanBeWeak=e,this.boostFullMatch=t}}function Rr(e,t,i,n,s,o,r=Tr.default){const a=e.length>vr?vr:e.length,l=n.length>vr?vr:n.length;if(i>=a||o>=l||a-i>l-o)return;if(!function(e,t,i,n,s,o,r=!1){for(;t=i&&a>=n;)s[r]===o[a]&&(yr[r]=a,r--),a--}(a,l,i,o,t,s);let h=1,d=1,c=i,u=o;const g=[!1];for(h=1,c=i;cr,v=_?Lr[h][d-1]+(Sr[h][d-1]>0?-5:0):0,b=u>r+1&&Sr[h][d-1]>0,C=b?Lr[h][d-2]+(Sr[h][d-2]>0?-5:0):0;if(b&&(!_||C>=v)&&(!m||C>=f))Lr[h][d]=C,kr[h][d]=3,Sr[h][d]=0;else if(_&&(!m||v>=f))Lr[h][d]=v,kr[h][d]=2,Sr[h][d]=0;else{if(!m)throw new Error("not possible");Lr[h][d]=f,kr[h][d]=1,Sr[h][d]=Sr[h-1][d-1]+1}}}if(Dr&&function(e,t,i,n){e=e.substr(t),i=i.substr(n),console.log(xr(Lr,e,e.length,i,i.length)),console.log(xr(kr,e,e.length,i,i.length)),console.log(xr(Sr,e,e.length,i,i.length))}(e,i,n,o),!g[0]&&!r.firstMatchCanBeWeak)return;h--,d--;const p=[Lr[h][d],o];let m=0,f=0;for(;h>=1;){let e=d;do{const t=kr[h][e];if(3===t)e-=2;else{if(2!==t)break;e-=1}}while(e>=1);m>1&&t[i+h-1]===s[o+d-1]&&!Ir(e+o-1,n,s)&&m+1>Sr[h][e]&&(e=d),e===d?m++:m=1,f||(f=e),h--,d=e-1,p.push(d)}l===a&&r.boostFullMatch&&(p[0]+=2);const _=f-a;return p[0]-=_,p}function Ar(e,t,i,n,s,o,r,a,l,h,d){if(t[i]!==o[r])return Number.MIN_SAFE_INTEGER;let c=1,u=!1;return r===i-n?c=e[i]===s[r]?7:5:!Ir(r,s,o)||0!==r&&Ir(r-1,s,o)?!Nr(o,r)||0!==r&&Nr(o,r-1)?(Nr(o,r-1)||Er(o,r-1))&&(c=5,u=!0):c=5:(c=e[i]===s[r]?7:5,u=!0),c>1&&i===n&&(d[0]=!0),u||(u=Ir(r,s,o)||Nr(o,r-1)||Er(o,r-1)),i===n?r>l&&(c-=u?3:5):c+=h?u?2:0:u?0:1,r+1===a&&(c-=u?3:5),c}function Or(e,t,i,n,s,o,r){return function(e,t,i,n,s,o,r,a){let l=Rr(e,t,i,n,s,o,a);if(l&&!r)return l;if(e.length>=3){const t=Math.min(7,e.length-1);for(let r=i+1;rl[0])&&(l=e))}}}return l}(e,t,i,n,s,o,!0,r)}function Pr(e,t){if(t+1>=e.length)return;const i=e[t],n=e[t+1];return i!==n?e.slice(0,t)+n+i+e.slice(t+2):void 0}function Fr(e){return"string"==typeof e}function Br(e){return!("object"!=typeof e||null===e||Array.isArray(e)||e instanceof RegExp||e instanceof Date)}function Wr(e){const t=Object.getPrototypeOf(Uint8Array);return"object"==typeof e&&e instanceof t}function Vr(e){return"number"==typeof e&&!isNaN(e)}function Hr(e){return!!e&&"function"==typeof e[Symbol.iterator]}function zr(e){return!0===e||!1===e}function Ur(e){return void 0===e}function Kr(e){return!jr(e)}function jr(e){return Ur(e)||null===e}function qr(e,t){if(!e)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function $r(e){if(jr(e))throw new Error("Assertion Failed: argument is undefined or null");return e}function Gr(e){return"function"==typeof e}function Zr(e,t){if(Fr(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Gr(t)){try{if(e instanceof t)return}catch(ge){}if(!jr(e)&&e.constructor===t)return;if(1===t.length&&!0===t.call(void 0,e))return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}Tr.default={boostFullMatch:!0,firstMatchCanBeWeak:!1};const Yr=Object.create(null);function Xr(e,t){if(Fr(t)){const i=Yr[t];if(void 0===i)throw new Error(`${e} references an unknown codicon: ${t}`);t=i}return Yr[e]=t,{id:e}}function Qr(){return Yr}const Jr={add:Xr("add",6e4),plus:Xr("plus",6e4),gistNew:Xr("gist-new",6e4),repoCreate:Xr("repo-create",6e4),lightbulb:Xr("lightbulb",60001),lightBulb:Xr("light-bulb",60001),repo:Xr("repo",60002),repoDelete:Xr("repo-delete",60002),gistFork:Xr("gist-fork",60003),repoForked:Xr("repo-forked",60003),gitPullRequest:Xr("git-pull-request",60004),gitPullRequestAbandoned:Xr("git-pull-request-abandoned",60004),recordKeys:Xr("record-keys",60005),keyboard:Xr("keyboard",60005),tag:Xr("tag",60006),tagAdd:Xr("tag-add",60006),tagRemove:Xr("tag-remove",60006),gitPullRequestLabel:Xr("git-pull-request-label",60006),person:Xr("person",60007),personFollow:Xr("person-follow",60007),personOutline:Xr("person-outline",60007),personFilled:Xr("person-filled",60007),gitBranch:Xr("git-branch",60008),gitBranchCreate:Xr("git-branch-create",60008),gitBranchDelete:Xr("git-branch-delete",60008),sourceControl:Xr("source-control",60008),mirror:Xr("mirror",60009),mirrorPublic:Xr("mirror-public",60009),star:Xr("star",60010),starAdd:Xr("star-add",60010),starDelete:Xr("star-delete",60010),starEmpty:Xr("star-empty",60010),comment:Xr("comment",60011),commentAdd:Xr("comment-add",60011),alert:Xr("alert",60012),warning:Xr("warning",60012),search:Xr("search",60013),searchSave:Xr("search-save",60013),logOut:Xr("log-out",60014),signOut:Xr("sign-out",60014),logIn:Xr("log-in",60015),signIn:Xr("sign-in",60015),eye:Xr("eye",60016),eyeUnwatch:Xr("eye-unwatch",60016),eyeWatch:Xr("eye-watch",60016),circleFilled:Xr("circle-filled",60017),primitiveDot:Xr("primitive-dot",60017),closeDirty:Xr("close-dirty",60017),debugBreakpoint:Xr("debug-breakpoint",60017),debugBreakpointDisabled:Xr("debug-breakpoint-disabled",60017),debugHint:Xr("debug-hint",60017),primitiveSquare:Xr("primitive-square",60018),edit:Xr("edit",60019),pencil:Xr("pencil",60019),info:Xr("info",60020),issueOpened:Xr("issue-opened",60020),gistPrivate:Xr("gist-private",60021),gitForkPrivate:Xr("git-fork-private",60021),lock:Xr("lock",60021),mirrorPrivate:Xr("mirror-private",60021),close:Xr("close",60022),removeClose:Xr("remove-close",60022),x:Xr("x",60022),repoSync:Xr("repo-sync",60023),sync:Xr("sync",60023),clone:Xr("clone",60024),desktopDownload:Xr("desktop-download",60024),beaker:Xr("beaker",60025),microscope:Xr("microscope",60025),vm:Xr("vm",60026),deviceDesktop:Xr("device-desktop",60026),file:Xr("file",60027),fileText:Xr("file-text",60027),more:Xr("more",60028),ellipsis:Xr("ellipsis",60028),kebabHorizontal:Xr("kebab-horizontal",60028),mailReply:Xr("mail-reply",60029),reply:Xr("reply",60029),organization:Xr("organization",60030),organizationFilled:Xr("organization-filled",60030),organizationOutline:Xr("organization-outline",60030),newFile:Xr("new-file",60031),fileAdd:Xr("file-add",60031),newFolder:Xr("new-folder",60032),fileDirectoryCreate:Xr("file-directory-create",60032),trash:Xr("trash",60033),trashcan:Xr("trashcan",60033),history:Xr("history",60034),clock:Xr("clock",60034),folder:Xr("folder",60035),fileDirectory:Xr("file-directory",60035),symbolFolder:Xr("symbol-folder",60035),logoGithub:Xr("logo-github",60036),markGithub:Xr("mark-github",60036),github:Xr("github",60036),terminal:Xr("terminal",60037),console:Xr("console",60037),repl:Xr("repl",60037),zap:Xr("zap",60038),symbolEvent:Xr("symbol-event",60038),error:Xr("error",60039),stop:Xr("stop",60039),variable:Xr("variable",60040),symbolVariable:Xr("symbol-variable",60040),array:Xr("array",60042),symbolArray:Xr("symbol-array",60042),symbolModule:Xr("symbol-module",60043),symbolPackage:Xr("symbol-package",60043),symbolNamespace:Xr("symbol-namespace",60043),symbolObject:Xr("symbol-object",60043),symbolMethod:Xr("symbol-method",60044),symbolFunction:Xr("symbol-function",60044),symbolConstructor:Xr("symbol-constructor",60044),symbolBoolean:Xr("symbol-boolean",60047),symbolNull:Xr("symbol-null",60047),symbolNumeric:Xr("symbol-numeric",60048),symbolNumber:Xr("symbol-number",60048),symbolStructure:Xr("symbol-structure",60049),symbolStruct:Xr("symbol-struct",60049),symbolParameter:Xr("symbol-parameter",60050),symbolTypeParameter:Xr("symbol-type-parameter",60050),symbolKey:Xr("symbol-key",60051),symbolText:Xr("symbol-text",60051),symbolReference:Xr("symbol-reference",60052),goToFile:Xr("go-to-file",60052),symbolEnum:Xr("symbol-enum",60053),symbolValue:Xr("symbol-value",60053),symbolRuler:Xr("symbol-ruler",60054),symbolUnit:Xr("symbol-unit",60054),activateBreakpoints:Xr("activate-breakpoints",60055),archive:Xr("archive",60056),arrowBoth:Xr("arrow-both",60057),arrowDown:Xr("arrow-down",60058),arrowLeft:Xr("arrow-left",60059),arrowRight:Xr("arrow-right",60060),arrowSmallDown:Xr("arrow-small-down",60061),arrowSmallLeft:Xr("arrow-small-left",60062),arrowSmallRight:Xr("arrow-small-right",60063),arrowSmallUp:Xr("arrow-small-up",60064),arrowUp:Xr("arrow-up",60065),bell:Xr("bell",60066),bold:Xr("bold",60067),book:Xr("book",60068),bookmark:Xr("bookmark",60069),debugBreakpointConditionalUnverified:Xr("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:Xr("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:Xr("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:Xr("debug-breakpoint-data-unverified",60072),debugBreakpointData:Xr("debug-breakpoint-data",60073),debugBreakpointDataDisabled:Xr("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:Xr("debug-breakpoint-log-unverified",60074),debugBreakpointLog:Xr("debug-breakpoint-log",60075),debugBreakpointLogDisabled:Xr("debug-breakpoint-log-disabled",60075),briefcase:Xr("briefcase",60076),broadcast:Xr("broadcast",60077),browser:Xr("browser",60078),bug:Xr("bug",60079),calendar:Xr("calendar",60080),caseSensitive:Xr("case-sensitive",60081),check:Xr("check",60082),checklist:Xr("checklist",60083),chevronDown:Xr("chevron-down",60084),dropDownButton:Xr("drop-down-button",60084),chevronLeft:Xr("chevron-left",60085),chevronRight:Xr("chevron-right",60086),chevronUp:Xr("chevron-up",60087),chromeClose:Xr("chrome-close",60088),chromeMaximize:Xr("chrome-maximize",60089),chromeMinimize:Xr("chrome-minimize",60090),chromeRestore:Xr("chrome-restore",60091),circle:Xr("circle",60092),circleOutline:Xr("circle-outline",60092),debugBreakpointUnverified:Xr("debug-breakpoint-unverified",60092),circleSlash:Xr("circle-slash",60093),circuitBoard:Xr("circuit-board",60094),clearAll:Xr("clear-all",60095),clippy:Xr("clippy",60096),closeAll:Xr("close-all",60097),cloudDownload:Xr("cloud-download",60098),cloudUpload:Xr("cloud-upload",60099),code:Xr("code",60100),collapseAll:Xr("collapse-all",60101),colorMode:Xr("color-mode",60102),commentDiscussion:Xr("comment-discussion",60103),compareChanges:Xr("compare-changes",60157),creditCard:Xr("credit-card",60105),dash:Xr("dash",60108),dashboard:Xr("dashboard",60109),database:Xr("database",60110),debugContinue:Xr("debug-continue",60111),debugDisconnect:Xr("debug-disconnect",60112),debugPause:Xr("debug-pause",60113),debugRestart:Xr("debug-restart",60114),debugStart:Xr("debug-start",60115),debugStepInto:Xr("debug-step-into",60116),debugStepOut:Xr("debug-step-out",60117),debugStepOver:Xr("debug-step-over",60118),debugStop:Xr("debug-stop",60119),debug:Xr("debug",60120),deviceCameraVideo:Xr("device-camera-video",60121),deviceCamera:Xr("device-camera",60122),deviceMobile:Xr("device-mobile",60123),diffAdded:Xr("diff-added",60124),diffIgnored:Xr("diff-ignored",60125),diffModified:Xr("diff-modified",60126),diffRemoved:Xr("diff-removed",60127),diffRenamed:Xr("diff-renamed",60128),diff:Xr("diff",60129),discard:Xr("discard",60130),editorLayout:Xr("editor-layout",60131),emptyWindow:Xr("empty-window",60132),exclude:Xr("exclude",60133),extensions:Xr("extensions",60134),eyeClosed:Xr("eye-closed",60135),fileBinary:Xr("file-binary",60136),fileCode:Xr("file-code",60137),fileMedia:Xr("file-media",60138),filePdf:Xr("file-pdf",60139),fileSubmodule:Xr("file-submodule",60140),fileSymlinkDirectory:Xr("file-symlink-directory",60141),fileSymlinkFile:Xr("file-symlink-file",60142),fileZip:Xr("file-zip",60143),files:Xr("files",60144),filter:Xr("filter",60145),flame:Xr("flame",60146),foldDown:Xr("fold-down",60147),foldUp:Xr("fold-up",60148),fold:Xr("fold",60149),folderActive:Xr("folder-active",60150),folderOpened:Xr("folder-opened",60151),gear:Xr("gear",60152),gift:Xr("gift",60153),gistSecret:Xr("gist-secret",60154),gist:Xr("gist",60155),gitCommit:Xr("git-commit",60156),gitCompare:Xr("git-compare",60157),gitMerge:Xr("git-merge",60158),githubAction:Xr("github-action",60159),githubAlt:Xr("github-alt",60160),globe:Xr("globe",60161),grabber:Xr("grabber",60162),graph:Xr("graph",60163),gripper:Xr("gripper",60164),heart:Xr("heart",60165),home:Xr("home",60166),horizontalRule:Xr("horizontal-rule",60167),hubot:Xr("hubot",60168),inbox:Xr("inbox",60169),issueClosed:Xr("issue-closed",60324),issueReopened:Xr("issue-reopened",60171),issues:Xr("issues",60172),italic:Xr("italic",60173),jersey:Xr("jersey",60174),json:Xr("json",60175),bracket:Xr("bracket",60175),kebabVertical:Xr("kebab-vertical",60176),key:Xr("key",60177),law:Xr("law",60178),lightbulbAutofix:Xr("lightbulb-autofix",60179),linkExternal:Xr("link-external",60180),link:Xr("link",60181),listOrdered:Xr("list-ordered",60182),listUnordered:Xr("list-unordered",60183),liveShare:Xr("live-share",60184),loading:Xr("loading",60185),location:Xr("location",60186),mailRead:Xr("mail-read",60187),mail:Xr("mail",60188),markdown:Xr("markdown",60189),megaphone:Xr("megaphone",60190),mention:Xr("mention",60191),milestone:Xr("milestone",60192),gitPullRequestMilestone:Xr("git-pull-request-milestone",60192),mortarBoard:Xr("mortar-board",60193),move:Xr("move",60194),multipleWindows:Xr("multiple-windows",60195),mute:Xr("mute",60196),noNewline:Xr("no-newline",60197),note:Xr("note",60198),octoface:Xr("octoface",60199),openPreview:Xr("open-preview",60200),package:Xr("package",60201),paintcan:Xr("paintcan",60202),pin:Xr("pin",60203),play:Xr("play",60204),run:Xr("run",60204),plug:Xr("plug",60205),preserveCase:Xr("preserve-case",60206),preview:Xr("preview",60207),project:Xr("project",60208),pulse:Xr("pulse",60209),question:Xr("question",60210),quote:Xr("quote",60211),radioTower:Xr("radio-tower",60212),reactions:Xr("reactions",60213),references:Xr("references",60214),refresh:Xr("refresh",60215),regex:Xr("regex",60216),remoteExplorer:Xr("remote-explorer",60217),remote:Xr("remote",60218),remove:Xr("remove",60219),replaceAll:Xr("replace-all",60220),replace:Xr("replace",60221),repoClone:Xr("repo-clone",60222),repoForcePush:Xr("repo-force-push",60223),repoPull:Xr("repo-pull",60224),repoPush:Xr("repo-push",60225),report:Xr("report",60226),requestChanges:Xr("request-changes",60227),rocket:Xr("rocket",60228),rootFolderOpened:Xr("root-folder-opened",60229),rootFolder:Xr("root-folder",60230),rss:Xr("rss",60231),ruby:Xr("ruby",60232),saveAll:Xr("save-all",60233),saveAs:Xr("save-as",60234),save:Xr("save",60235),screenFull:Xr("screen-full",60236),screenNormal:Xr("screen-normal",60237),searchStop:Xr("search-stop",60238),server:Xr("server",60240),settingsGear:Xr("settings-gear",60241),settings:Xr("settings",60242),shield:Xr("shield",60243),smiley:Xr("smiley",60244),sortPrecedence:Xr("sort-precedence",60245),splitHorizontal:Xr("split-horizontal",60246),splitVertical:Xr("split-vertical",60247),squirrel:Xr("squirrel",60248),starFull:Xr("star-full",60249),starHalf:Xr("star-half",60250),symbolClass:Xr("symbol-class",60251),symbolColor:Xr("symbol-color",60252),symbolCustomColor:Xr("symbol-customcolor",60252),symbolConstant:Xr("symbol-constant",60253),symbolEnumMember:Xr("symbol-enum-member",60254),symbolField:Xr("symbol-field",60255),symbolFile:Xr("symbol-file",60256),symbolInterface:Xr("symbol-interface",60257),symbolKeyword:Xr("symbol-keyword",60258),symbolMisc:Xr("symbol-misc",60259),symbolOperator:Xr("symbol-operator",60260),symbolProperty:Xr("symbol-property",60261),wrench:Xr("wrench",60261),wrenchSubaction:Xr("wrench-subaction",60261),symbolSnippet:Xr("symbol-snippet",60262),tasklist:Xr("tasklist",60263),telescope:Xr("telescope",60264),textSize:Xr("text-size",60265),threeBars:Xr("three-bars",60266),thumbsdown:Xr("thumbsdown",60267),thumbsup:Xr("thumbsup",60268),tools:Xr("tools",60269),triangleDown:Xr("triangle-down",60270),triangleLeft:Xr("triangle-left",60271),triangleRight:Xr("triangle-right",60272),triangleUp:Xr("triangle-up",60273),twitter:Xr("twitter",60274),unfold:Xr("unfold",60275),unlock:Xr("unlock",60276),unmute:Xr("unmute",60277),unverified:Xr("unverified",60278),verified:Xr("verified",60279),versions:Xr("versions",60280),vmActive:Xr("vm-active",60281),vmOutline:Xr("vm-outline",60282),vmRunning:Xr("vm-running",60283),watch:Xr("watch",60284),whitespace:Xr("whitespace",60285),wholeWord:Xr("whole-word",60286),window:Xr("window",60287),wordWrap:Xr("word-wrap",60288),zoomIn:Xr("zoom-in",60289),zoomOut:Xr("zoom-out",60290),listFilter:Xr("list-filter",60291),listFlat:Xr("list-flat",60292),listSelection:Xr("list-selection",60293),selection:Xr("selection",60293),listTree:Xr("list-tree",60294),debugBreakpointFunctionUnverified:Xr("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:Xr("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:Xr("debug-breakpoint-function-disabled",60296),debugStackframeActive:Xr("debug-stackframe-active",60297),circleSmallFilled:Xr("circle-small-filled",60298),debugStackframeDot:Xr("debug-stackframe-dot",60298),debugStackframe:Xr("debug-stackframe",60299),debugStackframeFocused:Xr("debug-stackframe-focused",60299),debugBreakpointUnsupported:Xr("debug-breakpoint-unsupported",60300),symbolString:Xr("symbol-string",60301),debugReverseContinue:Xr("debug-reverse-continue",60302),debugStepBack:Xr("debug-step-back",60303),debugRestartFrame:Xr("debug-restart-frame",60304),callIncoming:Xr("call-incoming",60306),callOutgoing:Xr("call-outgoing",60307),menu:Xr("menu",60308),expandAll:Xr("expand-all",60309),feedback:Xr("feedback",60310),gitPullRequestReviewer:Xr("git-pull-request-reviewer",60310),groupByRefType:Xr("group-by-ref-type",60311),ungroupByRefType:Xr("ungroup-by-ref-type",60312),account:Xr("account",60313),gitPullRequestAssignee:Xr("git-pull-request-assignee",60313),bellDot:Xr("bell-dot",60314),debugConsole:Xr("debug-console",60315),library:Xr("library",60316),output:Xr("output",60317),runAll:Xr("run-all",60318),syncIgnored:Xr("sync-ignored",60319),pinned:Xr("pinned",60320),githubInverted:Xr("github-inverted",60321),debugAlt:Xr("debug-alt",60305),serverProcess:Xr("server-process",60322),serverEnvironment:Xr("server-environment",60323),pass:Xr("pass",60324),stopCircle:Xr("stop-circle",60325),playCircle:Xr("play-circle",60326),record:Xr("record",60327),debugAltSmall:Xr("debug-alt-small",60328),vmConnect:Xr("vm-connect",60329),cloud:Xr("cloud",60330),merge:Xr("merge",60331),exportIcon:Xr("export",60332),graphLeft:Xr("graph-left",60333),magnet:Xr("magnet",60334),notebook:Xr("notebook",60335),redo:Xr("redo",60336),checkAll:Xr("check-all",60337),pinnedDirty:Xr("pinned-dirty",60338),passFilled:Xr("pass-filled",60339),circleLargeFilled:Xr("circle-large-filled",60340),circleLarge:Xr("circle-large",60341),circleLargeOutline:Xr("circle-large-outline",60341),combine:Xr("combine",60342),gather:Xr("gather",60342),table:Xr("table",60343),variableGroup:Xr("variable-group",60344),typeHierarchy:Xr("type-hierarchy",60345),typeHierarchySub:Xr("type-hierarchy-sub",60346),typeHierarchySuper:Xr("type-hierarchy-super",60347),gitPullRequestCreate:Xr("git-pull-request-create",60348),runAbove:Xr("run-above",60349),runBelow:Xr("run-below",60350),notebookTemplate:Xr("notebook-template",60351),debugRerun:Xr("debug-rerun",60352),workspaceTrusted:Xr("workspace-trusted",60353),workspaceUntrusted:Xr("workspace-untrusted",60354),workspaceUnspecified:Xr("workspace-unspecified",60355),terminalCmd:Xr("terminal-cmd",60356),terminalDebian:Xr("terminal-debian",60357),terminalLinux:Xr("terminal-linux",60358),terminalPowershell:Xr("terminal-powershell",60359),terminalTmux:Xr("terminal-tmux",60360),terminalUbuntu:Xr("terminal-ubuntu",60361),terminalBash:Xr("terminal-bash",60362),arrowSwap:Xr("arrow-swap",60363),copy:Xr("copy",60364),personAdd:Xr("person-add",60365),filterFilled:Xr("filter-filled",60366),wand:Xr("wand",60367),debugLineByLine:Xr("debug-line-by-line",60368),inspect:Xr("inspect",60369),layers:Xr("layers",60370),layersDot:Xr("layers-dot",60371),layersActive:Xr("layers-active",60372),compass:Xr("compass",60373),compassDot:Xr("compass-dot",60374),compassActive:Xr("compass-active",60375),azure:Xr("azure",60376),issueDraft:Xr("issue-draft",60377),gitPullRequestClosed:Xr("git-pull-request-closed",60378),gitPullRequestDraft:Xr("git-pull-request-draft",60379),debugAll:Xr("debug-all",60380),debugCoverage:Xr("debug-coverage",60381),runErrors:Xr("run-errors",60382),folderLibrary:Xr("folder-library",60383),debugContinueSmall:Xr("debug-continue-small",60384),beakerStop:Xr("beaker-stop",60385),graphLine:Xr("graph-line",60386),graphScatter:Xr("graph-scatter",60387),pieChart:Xr("pie-chart",60388),bracketDot:Xr("bracket-dot",60389),bracketError:Xr("bracket-error",60390),lockSmall:Xr("lock-small",60391),azureDevops:Xr("azure-devops",60392),verifiedFilled:Xr("verified-filled",60393),newLine:Xr("newline",60394),layout:Xr("layout",60395),layoutActivitybarLeft:Xr("layout-activitybar-left",60396),layoutActivitybarRight:Xr("layout-activitybar-right",60397),layoutPanelLeft:Xr("layout-panel-left",60398),layoutPanelCenter:Xr("layout-panel-center",60399),layoutPanelJustify:Xr("layout-panel-justify",60400),layoutPanelRight:Xr("layout-panel-right",60401),layoutPanel:Xr("layout-panel",60402),layoutSidebarLeft:Xr("layout-sidebar-left",60403),layoutSidebarRight:Xr("layout-sidebar-right",60404),layoutStatusbar:Xr("layout-statusbar",60405),layoutMenubar:Xr("layout-menubar",60406),layoutCentered:Xr("layout-centered",60407),layoutSidebarRightOff:Xr("layout-sidebar-right-off",60416),layoutPanelOff:Xr("layout-panel-off",60417),layoutSidebarLeftOff:Xr("layout-sidebar-left-off",60418),target:Xr("target",60408),indent:Xr("indent",60409),recordSmall:Xr("record-small",60410),errorSmall:Xr("error-small",60411),arrowCircleDown:Xr("arrow-circle-down",60412),arrowCircleLeft:Xr("arrow-circle-left",60413),arrowCircleRight:Xr("arrow-circle-right",60414),arrowCircleUp:Xr("arrow-circle-up",60415),heartFilled:Xr("heart-filled",60420),map:Xr("map",60421),mapFilled:Xr("map-filled",60422),circleSmall:Xr("circle-small",60423),bellSlash:Xr("bell-slash",60424),bellSlashDot:Xr("bell-slash-dot",60425),commentUnresolved:Xr("comment-unresolved",60426),gitPullRequestGoToChanges:Xr("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:Xr("git-pull-request-new-changes",60428),searchFuzzy:Xr("search-fuzzy",60429),commentDraft:Xr("comment-draft",60430),send:Xr("send",60431),sparkle:Xr("sparkle",60432),insert:Xr("insert",60433),mic:Xr("mic",60434),dialogError:Xr("dialog-error","error"),dialogWarning:Xr("dialog-warning","warning"),dialogInfo:Xr("dialog-info","info"),dialogClose:Xr("dialog-close","close"),treeItemExpanded:Xr("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:Xr("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:Xr("tree-filter-on-type-off","list-selection"),treeFilterClear:Xr("tree-filter-clear","close"),treeItemLoading:Xr("tree-item-loading","loading"),menuSelection:Xr("menu-selection","check"),menuSubmenu:Xr("menu-submenu","chevron-right"),menuBarMore:Xr("menubar-more","more"),scrollbarButtonLeft:Xr("scrollbar-button-left","triangle-left"),scrollbarButtonRight:Xr("scrollbar-button-right","triangle-right"),scrollbarButtonUp:Xr("scrollbar-button-up","triangle-up"),scrollbarButtonDown:Xr("scrollbar-button-down","triangle-down"),toolBarMore:Xr("toolbar-more","more"),quickInputBack:Xr("quick-input-back","arrow-left")};var ea,ta;!function(e){e.isThemeColor=function(e){return e&&"object"==typeof e&&"string"==typeof e.id}}(ea||(ea={})),function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9-]+",e.iconModifierExpression="~[A-Za-z]+",e.iconNameCharacter="[A-Za-z0-9~-]";const t=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function i(e){const n=t.exec(e.id);if(!n)return i(Jr.error);const[,s,o]=n,r=["codicon","codicon-"+s];return o&&r.push("codicon-modifier-"+o.substring(1)),r}e.asClassNameArray=i,e.asClassName=function(e){return i(e).join(" ")},e.asCSSSelector=function(e){return"."+i(e).join(".")},e.isThemeIcon=function(e){return e&&"object"==typeof e&&"string"==typeof e.id&&(void 0===e.color||ea.isThemeColor(e.color))};const n=new RegExp(`^\\$\\((${e.iconNameExpression}(?:${e.iconModifierExpression})?)\\)$`);e.fromString=function(e){const t=n.exec(e);if(!t)return;const[,i]=t;return{id:i}},e.fromId=function(e){return{id:e}},e.modify=function(e,t){let i=e.id;const n=i.lastIndexOf("~");return-1!==n&&(i=i.substring(0,n)),t&&(i=`${i}~${t}`),{id:i}},e.getModifier=function(e){const t=e.id.lastIndexOf("~");if(-1!==t)return e.id.substring(t+1)},e.isEqual=function(e,t){var i,n;return e.id===t.id&&(null===(i=e.color)||void 0===i?void 0:i.id)===(null===(n=t.color)||void 0===n?void 0:n.id)}}(ta||(ta={}));const ia="$(",na=new RegExp(`\\$\\(${ta.iconNameExpression}(?:${ta.iconModifierExpression})?\\)`,"g"),sa=new RegExp(`(\\\\)?${na.source}`,"g");const oa=new RegExp(`\\\\${na.source}`,"g");const ra=new RegExp(`(\\s)?(\\\\)?${na.source}(\\s)?`,"g");function aa(e){return-1===e.indexOf(ia)?e:e.replace(ra,((e,t,i,n)=>i?e:t||n||""))}const la=new RegExp(`\\$\\(${ta.iconNameCharacter}+\\)`,"g");function ha(e){la.lastIndex=0;let t="";const i=[];let n=0;for(;;){const s=la.lastIndex,o=la.exec(e),r=e.substring(s,null==o?void 0:o.index);if(r.length>0){t+=r;for(let e=0;ee.length)return!1;if(i){if(!vo(e,t))return!1;if(t.length===e.length)return!0;let i=t.length;return t.charAt(t.length-1)===n&&i--,e.charAt(i)===n}return t.charAt(t.length-1)!==n&&(t+=n),0===e.indexOf(t)}function ma(e){return e>=65&&e<=90||e>=97&&e<=122}function fa(e){return gn(e,!0)}class _a{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:ho(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t||!(!e||!t)&&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()}isEqualOrParent(e,t,i=!1){if(e.scheme===t.scheme){if(e.scheme===vn.file)return pa(fa(e),fa(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(Na(e.authority,t.authority))return pa(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return an.joinPath(e,...t)}basenameOrAuthority(e){return wa(e)||e.authority}basename(e){return qi.basename(e.path)}extname(e){return qi.extname(e.path)}dirname(e){if(0===e.path.length)return e;let t;return e.scheme===vn.file?t=an.file(Yi(fa(e))).path:(t=qi.dirname(e.path),e.authority&&t.length&&47!==t.charCodeAt(0)&&(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 t=e.scheme===vn.file?an.file($i(fa(e))).path:qi.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!Na(e.authority,t.authority))return;if(e.scheme===vn.file){const i=Zi(fa(e),fa(t));return Oe?ua(i):i}let i=e.path||"/";const n=t.path||"/";if(this._ignorePathCasing(e)){let e=0;for(const t=Math.min(i.length,n.length);ega(i).length&&i[i.length-1]===t}{const t=e.path;return t.length>1&&47===t.charCodeAt(t.length-1)&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=Ji){return Ea(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=Ji){let i=!1;if(e.scheme===vn.file){const n=fa(e);i=void 0!==n&&n.length===ga(n).length&&n[n.length-1]===t}else{t="/";const n=e.path;i=1===n.length&&47===n.charCodeAt(n.length-1)}return i||Ea(e,t)?e:e.with({path:e.path+"/"})}}const va=new _a((()=>!1)),ba=(new _a((e=>e.scheme!==vn.file||!Fe)),new _a((e=>!0)),va.isEqual.bind(va)),Ca=(va.isEqualOrParent.bind(va),va.getComparisonKey.bind(va),va.basenameOrAuthority.bind(va)),wa=va.basename.bind(va),ya=va.extname.bind(va),Sa=va.dirname.bind(va),La=va.joinPath.bind(va),ka=va.normalizePath.bind(va),Da=va.relativePath.bind(va),xa=va.resolvePath.bind(va),Na=(va.isAbsolutePath.bind(va),va.isEqualAuthority.bind(va)),Ea=va.hasTrailingPathSeparator.bind(va);va.removeTrailingPathSeparator.bind(va),va.addTrailingPathSeparator.bind(va);var Ia,Ma;!function(e){e.META_DATA_LABEL="label",e.META_DATA_DESCRIPTION="description",e.META_DATA_SIZE="size",e.META_DATA_MIME="mime",e.parseMetaData=function(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach((e=>{const[t,n]=e.split(":");t&&n&&i.set(t,n)}));const n=t.path.substring(0,t.path.indexOf(";"));return n&&i.set(e.META_DATA_MIME,n),i}}(Ia||(Ia={}));class Ta{constructor(e="",t=!1){var i,n,s;if(this.value=e,"string"!=typeof this.value)throw u("value");"boolean"==typeof t?(this.isTrusted=t,this.supportThemeIcons=!1,this.supportHtml=!1):(this.isTrusted=null!==(i=t.isTrusted)&&void 0!==i?i:void 0,this.supportThemeIcons=null!==(n=t.supportThemeIcons)&&void 0!==n&&n,this.supportHtml=null!==(s=t.supportHtml)&&void 0!==s&&s)}appendText(e,t=0){var i;return this.value+=function(e){return e.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}(this.supportThemeIcons?(i=e,i.replace(sa,((e,t)=>t?e:`\\${e}`))):e).replace(/([ \t]+)/g,((e,t)=>" ".repeat(t.length))).replace(/\>/gm,"\\>").replace(/\n/g,1===t?"\\\n":"\n\n"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+="\n",this.value+=t,this.value+="\n```\n",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(eo(t),"g");return e.replace(i,((t,i)=>"\\"!==e.charAt(i-1)?`\\${t}`:t))}}function Ra(e){return Aa(e)?!e.value:!Array.isArray(e)||e.every(Ra)}function Aa(e){return e instanceof Ta||!(!e||"object"!=typeof e)&&!("string"!=typeof e.value||"boolean"!=typeof e.isTrusted&&"object"!=typeof e.isTrusted&&void 0!==e.isTrusted||"boolean"!=typeof e.supportThemeIcons&&void 0!==e.supportThemeIcons)}function Oa(e){return e.replace(/"/g,""")}function Pa(e){return e?e.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1"):e}!function(e){e.serviceIds=new Map,e.DI_TARGET="$di$target",e.DI_DEPENDENCIES="$di$dependencies",e.getServiceDependencies=function(t){return t[e.DI_DEPENDENCIES]||[]}}(Ma||(Ma={}));const Fa=Ba("instantiationService");function Ba(e){if(Ma.serviceIds.has(e))return Ma.serviceIds.get(e);const t=function(e,i,n){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");!function(e,t,i){t[Ma.DI_TARGET]===t?t[Ma.DI_DEPENDENCIES].push({id:e,index:i}):(t[Ma.DI_DEPENDENCIES]=[{id:e,index:i}],t[Ma.DI_TARGET]=t)}(t,e,n)};return t.toString=()=>e,Ma.serviceIds.set(e,t),t}const Wa=Ba("codeEditorService");class Va{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 Va(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return Va.equals(this,e)}static equals(e,t){return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return Va.isBefore(this,e)}static isBefore(e,t){return e.lineNumberUa(this,void 0,void 0,(function*(){return e.run(...t)})),tooltip:e.label}}Ga.ID="vs.actions.empty";const Ya=Ba("commandService"),Xa=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new U,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,t){if(!e)throw new Error("invalid command");if("string"==typeof e){if(!t)throw new Error("invalid command");return this.registerCommand({id:e,handler:t})}if(e.description){const t=[];for(const n of e.description.args)t.push(n.constraint);const i=e.handler;e.handler=function(e,...n){return function(e,t){const i=Math.min(e.length,t.length);for(let n=0;n{s();const e=this._commands.get(i);(null==e?void 0:e.isEmpty())&&this._commands.delete(i)}));return this._onDidRegisterCommand.fire(i),o}registerCommandAlias(e,t){return Xa.registerCommand(e,((e,...i)=>e.get(Ya).executeCommand(t,...i)))}getCommand(e){const t=this._commands.get(e);if(t&&!t.isEmpty())return v.first(t)}getCommands(){const e=new Map;for(const t of this._commands.keys()){const i=this.getCommand(t);i&&e.set(t,i)}return e}};function Qa(...e){switch(e.length){case 1:return ue(0,"Did you mean {0}?",e[0]);case 2:return ue(0,"Did you mean {0} or {1}?",e[0],e[1]);case 3:return ue(0,"Did you mean {0}, {1} or {2}?",e[0],e[1],e[2]);default:return}}Xa.registerCommand("noop",(()=>{}));const Ja=ue(0,"Did you forget to open or close the quote?"),el=ue(0,"Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");class tl{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:case 8:return">=";case 9:return"=~";case 10:case 17:case 18:case 19:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 20:return"EOF";default:throw g(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();){this._start=this._current;switch(this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const e=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:e})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const e=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:e})}else this._match(126)?this._addToken(9):this._error(Qa("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(Qa("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(Qa("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return!this._isAtEnd()&&(this._input.charCodeAt(this._current)===e&&(this._current++,!0))}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){const t=this._start,i=this._input.substring(this._start,this._current),n={type:19,offset:this._start,lexeme:i};this._errors.push({offset:t,lexeme:i,additionalInfo:e}),this._tokens.push(n)}_string(){this.stringRe.lastIndex=this._start;const e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;const t=this._input.substring(this._start,this._current),i=tl._keywords.get(t);i?this._addToken(i):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;39!==this._peek()&&!this._isAtEnd();)this._advance();this._isAtEnd()?this._error(Ja):(this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1}))}_regex(){let e=this._current,t=!1,i=!1;for(;;){if(e>=this._input.length)return this._current=e,void this._error(el);const n=this._input.charCodeAt(e);if(t)t=!1;else{if(47===n&&!i){e++;break}91===n?i=!0:92===n?t=!0:93===n&&(i=!1)}e++}for(;e=this._input.length}}tl._regexFlags=new Set(["i","g","s","m","y","u"].map((e=>e.charCodeAt(0)))),tl._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]);const il=new Map;il.set("false",!1),il.set("true",!0),il.set("isMac",Pe),il.set("isLinux",Fe),il.set("isWindows",Oe),il.set("isWeb",We),il.set("isMacNative",Pe&&!We),il.set("isEdge",et),il.set("isFirefox",Qe),il.set("isChrome",Xe),il.set("isSafari",Je);const nl=Object.prototype.hasOwnProperty,sl={regexParsingWithErrorRecovery:!0},ol=ue(0,"Empty context key expression"),rl=ue(0,"Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),al=ue(0,"'in' after 'not'."),ll=ue(0,"closing parenthesis ')'"),hl=ue(0,"Unexpected token"),dl=ue(0,"Did you forget to put && or || before the token?"),cl=ue(0,"Unexpected end of expression"),ul=ue(0,"Did you forget to put a context key?");class gl{constructor(e=sl){this._config=e,this._scanner=new tl,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(""!==e){this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const e=this._expr();if(!this._isAtEnd()){const e=this._peek(),t=17===e.type?dl:void 0;throw this._parsingErrors.push({message:hl,offset:e.offset,lexeme:tl.getLexeme(e),additionalInfo:t}),gl._parseError}return e}catch(Mre){if(Mre!==gl._parseError)throw Mre;return}}else this._parsingErrors.push({message:ol,offset:0,lexeme:"",additionalInfo:rl})}_expr(){return this._or()}_or(){const e=[this._and()];for(;this._matchOne(16);){const t=this._and();e.push(t)}return 1===e.length?e[0]:pl.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return 1===e.length?e[0]:pl.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),fl.INSTANCE;case 12:return this._advance(),_l.INSTANCE;case 0:{this._advance();const e=this._expr();return this._consume(1,ll),null==e?void 0:e.negate()}case 17:return this._advance(),Sl.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){const e=this._peek();switch(e.type){case 11:return this._advance(),pl.true();case 12:return this._advance(),pl.false();case 0:{this._advance();const e=this._expr();return this._consume(1,ll),e}case 17:{const t=e.lexeme;if(this._advance(),this._matchOne(9)){const e=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),10!==e.type)throw this._errExpectedButGot("REGEX",e);const i=e.lexeme,n=i.lastIndexOf("/"),s=n===i.length-1?void 0:this._removeFlagsGY(i.substring(n+1));let o;try{o=new RegExp(i.substring(1,n),s)}catch(Mre){throw this._errExpectedButGot("REGEX",e)}return El.create(t,o)}switch(e.type){case 10:case 19:{const i=[e.lexeme];this._advance();let n=this._peek(),s=0;for(let t=0;t=0){const o=i.slice(t+1,s),r="i"===i[s+1]?"i":"";try{n=new RegExp(o,r)}catch(VU){throw this._errExpectedButGot("REGEX",e)}}}if(null===n)throw this._errExpectedButGot("REGEX",e);return El.create(t,n)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,al);const e=this._value();return pl.notIn(t,e)}switch(this._peek().type){case 3:{this._advance();const e=this._value();if(18===this._previous().type)return pl.equals(t,e);switch(e){case"true":return pl.has(t);case"false":return pl.not(t);default:return pl.equals(t,e)}}case 4:{this._advance();const e=this._value();if(18===this._previous().type)return pl.notEquals(t,e);switch(e){case"true":return pl.not(t);case"false":return pl.has(t);default:return pl.notEquals(t,e)}}case 5:return this._advance(),xl.create(t,this._value());case 6:return this._advance(),Nl.create(t,this._value());case 7:return this._advance(),kl.create(t,this._value());case 8:return this._advance(),Dl.create(t,this._value());case 13:return this._advance(),pl.in(t,this._value());default:return pl.has(t)}}case 20:throw this._parsingErrors.push({message:cl,offset:e.offset,lexeme:"",additionalInfo:ul}),gl._parseError;default:throw this._errExpectedButGot("true | false | KEY \n\t| KEY '=~' REGEX \n\t| KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value",this._peek())}}_value(){const e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return!!this._check(e)&&(this._advance(),!0)}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(e,t,i){const n=ue(0,"Expected: {0}\nReceived: '{1}'.",e,tl.getLexeme(t)),s=t.offset,o=tl.getLexeme(t);return this._parsingErrors.push({message:n,offset:s,lexeme:o,additionalInfo:i}),gl._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return 20===this._peek().type}}gl._parseError=new Error;class pl{static false(){return fl.INSTANCE}static true(){return _l.INSTANCE}static has(e){return vl.create(e)}static equals(e,t){return bl.create(e,t)}static notEquals(e,t){return yl.create(e,t)}static regex(e,t){return El.create(e,t)}static in(e,t){return Cl.create(e,t)}static notIn(e,t){return wl.create(e,t)}static not(e){return Sl.create(e)}static and(...e){return Tl.create(e,null,!0)}static or(...e){return Rl.create(e,null,!0)}static deserialize(e){if(null==e)return;return this._parser.parse(e)}}function ml(e,t){return e.cmp(t)}pl._parser=new gl({regexParsingWithErrorRecovery:!1});class fl{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return _l.INSTANCE}}fl.INSTANCE=new fl;class _l{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return fl.INSTANCE}}_l.INSTANCE=new _l;class vl{static create(e,t=null){const i=il.get(e);return"boolean"==typeof i?i?_l.INSTANCE:fl.INSTANCE:new vl(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:Pl(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=il.get(this.key);return"boolean"==typeof e?e?_l.INSTANCE:fl.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=Sl.create(this.key,this)),this.negated}}class bl{static create(e,t,i=null){if("boolean"==typeof t)return t?vl.create(e,i):Sl.create(e,i);const n=il.get(e);if("boolean"==typeof n){return t===(n?"true":"false")?_l.INSTANCE:fl.INSTANCE}return new bl(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:Fl(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){const e=il.get(this.key);if("boolean"==typeof e){const t=e?"true":"false";return this.value===t?_l.INSTANCE:fl.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=yl.create(this.key,this.value,this)),this.negated}}class Cl{static create(e,t){return new Cl(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:Fl(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type&&(this.key===e.key&&this.valueKey===e.valueKey)}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.includes(i):"string"==typeof i&&"object"==typeof t&&null!==t&&nl.call(t,i)}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=wl.create(this.key,this.valueKey)),this.negated}}class wl{static create(e,t){return new wl(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=Cl.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type&&this._negated.equals(e._negated)}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}}class yl{static create(e,t,i=null){if("boolean"==typeof t)return t?Sl.create(e,i):vl.create(e,i);const n=il.get(e);if("boolean"==typeof n){return t===(n?"true":"false")?fl.INSTANCE:_l.INSTANCE}return new yl(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:Fl(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){const e=il.get(this.key);if("boolean"==typeof e){const t=e?"true":"false";return this.value===t?fl.INSTANCE:_l.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=bl.create(this.key,this.value,this)),this.negated}}class Sl{static create(e,t=null){const i=il.get(e);return"boolean"==typeof i?i?fl.INSTANCE:_l.INSTANCE:new Sl(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=3}cmp(e){return e.type!==this.type?this.type-e.type:Pl(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=il.get(this.key);return"boolean"==typeof e?e?fl.INSTANCE:_l.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=vl.create(this.key,this)),this.negated}}function Ll(e,t){if("string"==typeof e){const t=parseFloat(e);isNaN(t)||(e=t)}return"string"==typeof e||"number"==typeof e?t(e):fl.INSTANCE}class kl{static create(e,t,i=null){return Ll(t,(t=>new kl(e,t,i)))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:Fl(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Nl.create(this.key,this.value,this)),this.negated}}class Dl{static create(e,t,i=null){return Ll(t,(t=>new Dl(e,t,i)))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:Fl(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=xl.create(this.key,this.value,this)),this.negated}}class xl{static create(e,t,i=null){return Ll(t,(t=>new xl(e,t,i)))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:Fl(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))new Nl(e,t,i)))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:Fl(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=kl.create(this.key,this.value,this)),this.negated}}class El{static create(e,t){return new El(e,t)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.keye.key)return 1;const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return ti?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&t===i}return!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.key);return!!this.regexp&&this.regexp.test(t)}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Il.create(this)),this.negated}}class Il{static create(e){return new Il(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type&&this._actual.equals(e._actual)}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}}function Ml(e){let t=null;for(let i=0,n=e.length;ie.expr.length)return 1;for(let t=0,i=this.expr.length;t1;){const e=n[n.length-1];if(9!==e.type)break;n.pop();const t=n.pop(),s=0===n.length,o=Rl.create(e.expr.map((e=>Tl.create([e,t],null,i))),null,s);o&&(n.push(o),n.sort(ml))}if(1===n.length)return n[0];if(i){for(let e=0;ee.serialize())).join(" && ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());this.negated=Rl.create(e,this,!0)}return this.negated}}class Rl{static create(e,t,i){return Rl._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=9}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.lengthe.expr.length)return 1;for(let t=0,i=this.expr.length;te.serialize())).join(" || ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),i=e.shift(),n=[];for(const e of Vl(t))for(const t of Vl(i))n.push(Tl.create([e,t],null,!1));e.unshift(Rl.create(n,null,!1))}this.negated=Rl.create(e,this,!0)}return this.negated}}class Al extends vl{static all(){return Al._info.values()}constructor(e,t,i){super(e,null),this._defaultValue=t,"object"==typeof i?Al._info.push(Object.assign(Object.assign({},i),{key:e})):!0!==i&&Al._info.push({key:e,description:i,type:null!=t?typeof t:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return bl.create(this.key,e)}}Al._info=[];const Ol=Ba("contextKeyService");function Pl(e,t){return et?1:0}function Fl(e,t,i,n){return ei?1:tn?1:0}function Bl(e,t){if(0===e.type||1===t.type)return!0;if(9===e.type)return 9===t.type&&Wl(e.expr,t.expr);if(9===t.type){for(const i of t.expr)if(Bl(e,i))return!0;return!1}if(6===e.type){if(6===t.type)return Wl(t.expr,e.expr);for(const i of e.expr)if(Bl(i,t))return!0;return!1}return e.equals(t)}function Wl(e,t){let i=0,n=0;for(;i{r(),this._cachedMergedKeybindings=null}))}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(Gl)),this._cachedMergedKeybindings.slice(0)}}const $l=new ql;function Gl(e,t){if(e.weight1!==t.weight1)return e.weight1-t.weight1;if(e.command&&t.command){if(e.commandt.command)return 1}return e.weight2-t.weight2}jl.add("platform.keybindingsRegistry",$l);var Zl,Yl=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Xl=function(e,t){return function(i,n){t(i,n,e)}},Ql=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);st===e}}ih._all=new Map;const nh=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new $({merge:ih.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(e){return this._commands.set(e.id,e),this._onDidChangeMenu.fire(ih.for(eh.CommandPalette)),x((()=>{this._commands.delete(e.id)&&this._onDidChangeMenu.fire(ih.for(eh.CommandPalette))}))}getCommand(e){return this._commands.get(e)}getCommands(){const e=new Map;return this._commands.forEach(((t,i)=>e.set(i,t))),e}appendMenuItem(e,t){let i=this._menuItems.get(e);i||(i=new O,this._menuItems.set(e,i));const n=i.push(t);return this._onDidChangeMenu.fire(ih.for(e)),x((()=>{n(),this._onDidChangeMenu.fire(ih.for(e))}))}appendMenuItems(e){const t=new N;for(const{id:i,item:n}of e)t.add(this.appendMenuItem(i,n));return t}getMenuItems(e){let t;return t=this._menuItems.has(e)?[...this._menuItems.get(e)]:[],e===eh.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(e){const t=new Set;for(const i of e)Jl(i)&&(t.add(i.command.id),i.alt&&t.add(i.alt.id));this._commands.forEach(((i,n)=>{t.has(n)||e.push({command:i})}))}};class sh extends $a{constructor(e,t,i){super(`submenuitem.${e.submenu.id}`,"string"==typeof e.title?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}}let oh=Zl=class{static label(e,t){return(null==t?void 0:t.renderShortTitle)&&e.shortTitle?"string"==typeof e.shortTitle?e.shortTitle:e.shortTitle.value:"string"==typeof e.title?e.title:e.title.value}constructor(e,t,i,n,s,o){var r,a;let l;if(this.hideActions=n,this._commandService=o,this.id=e.id,this.label=Zl.label(e,i),this.tooltip=null!==(a="string"==typeof e.tooltip?e.tooltip:null===(r=e.tooltip)||void 0===r?void 0:r.value)&&void 0!==a?a:"",this.enabled=!e.precondition||s.contextMatchesRules(e.precondition),this.checked=void 0,e.toggled){const t=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=s.contextMatchesRules(t.condition),this.checked&&t.tooltip&&(this.tooltip="string"==typeof t.tooltip?t.tooltip:t.tooltip.value),this.checked&&ta.isThemeIcon(t.icon)&&(l=t.icon),this.checked&&t.title&&(this.label="string"==typeof t.title?t.title:t.title.value)}l||(l=ta.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new Zl(t,void 0,i,n,s,o):void 0,this._options=i,this.class=l&&ta.asClassName(l)}run(...e){var t,i;let n=[];return(null===(t=this._options)||void 0===t?void 0:t.arg)&&(n=[...n,this._options.arg]),(null===(i=this._options)||void 0===i?void 0:i.shouldForwardArgs)&&(n=[...n,...e]),this._commandService.executeCommand(this.id,...n)}};oh=Zl=Yl([Xl(4,Ol),Xl(5,Ya)],oh);class rh{constructor(e){this.desc=e}}function ah(e){const t=new N,i=new e,n=i.desc,{f1:s,menu:o,keybinding:r,description:a}=n,l=Ql(n,["f1","menu","keybinding","description"]);if(t.add(Xa.registerCommand({id:l.id,handler:(e,...t)=>i.run(e,...t),description:a})),Array.isArray(o))for(const h of o)t.add(nh.appendMenuItem(h.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:null===h.precondition?void 0:l.precondition})},h)));else o&&t.add(nh.appendMenuItem(o.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:null===o.precondition?void 0:l.precondition})},o)));if(s&&(t.add(nh.appendMenuItem(eh.CommandPalette,{command:l,when:l.precondition})),t.add(nh.addCommand(l))),Array.isArray(r))for(const h of r)t.add($l.registerKeybindingRule(Object.assign(Object.assign({},h),{id:l.id,when:l.precondition?pl.and(l.precondition,h.when):h.when})));else r&&t.add($l.registerKeybindingRule(Object.assign(Object.assign({},r),{id:l.id,when:l.precondition?pl.and(l.precondition,r.when):r.when})));return t}const lh=Ba("telemetryService"),hh=Ba("logService");var dh;!function(e){e[e.Off=0]="Off",e[e.Trace=1]="Trace",e[e.Debug=2]="Debug",e[e.Info=3]="Info",e[e.Warning=4]="Warning",e[e.Error=5]="Error"}(dh||(dh={}));const ch=dh.Info;class uh extends E{constructor(){super(...arguments),this.level=ch,this._onDidChangeLogLevel=this._register(new U),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!==dh.Off&&this.level<=e}}class gh extends uh{constructor(e=ch,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(dh.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(dh.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(dh.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(dh.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(dh.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}dispose(){}}class ph extends uh{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)}dispose(){for(const e of this.loggers)e.dispose()}}new Al("logLevel",function(e){switch(e){case dh.Trace:return"trace";case dh.Debug:return"debug";case dh.Info:return"info";case dh.Warning:return"warn";case dh.Error:return"error";case dh.Off:return"off"}}(dh.Info));class mh{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this._description=e.description}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 e=t.kbExpr;this.precondition&&(e=e?pl.and(e,this.precondition):this.precondition);const i={id:this.id,weight:t.weight,args:t.args,when:e,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};$l.registerKeybindingRule(i)}}Xa.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){nh.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 fh extends mh{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(((e,t)=>t.priority-e.priority)),{dispose:()=>{for(let e=0;e{if(e.get(Ol).contextMatchesRules(null!=i?i:void 0))return n(e,o,t)}))}runCommand(e,t){return vh.runEditorCommand(e,t,this.precondition,((e,t,i)=>this.runEditorCommand(e,t,i)))}}class bh extends vh{static convertOptions(e){let t;function i(t){return t.menuId||(t.menuId=eh.EditorContext),t.title||(t.title=e.label),t.when=pl.and(e.precondition,t.when),t}return t=Array.isArray(e.menuOpts)?e.menuOpts:e.menuOpts?[e.menuOpts]:[],Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(bh.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(lh).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class Ch extends bh{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort(((e,t)=>t[0]-e[0])),{dispose:()=>{for(let e=0;e{var i,s;const o=e.get(Ol),r=e.get(hh);if(o.contextMatchesRules(null!==(i=this.desc.precondition)&&void 0!==i?i:void 0))return this.runEditorCommand(e,n,...t);r.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,null===(s=this.desc.precondition)||void 0===s?void 0:s.serialize())}))}}function yh(e,t){Xa.registerCommand(e,(function(e,...i){const n=e.get(Fa),[s,o]=i;qr(an.isUri(s)),qr(Va.isIPosition(o));const r=e.get(Ha).getModel(s);if(r){const e=Va.lift(o);return n.invokeFunction(t,r,e,...i.slice(2))}return e.get(za).createModelReference(s).then((e=>new Promise(((s,r)=>{try{s(n.invokeFunction(t,e.object.textEditorModel,Va.lift(o),i.slice(2)))}catch(a){r(a)}})).finally((()=>{e.dispose()}))))}))}function Sh(e){return Nh.INSTANCE.registerEditorCommand(e),e}function Lh(e){const t=new e;return Nh.INSTANCE.registerEditorAction(t),t}function kh(e){return Nh.INSTANCE.registerEditorAction(e),e}function Dh(e,t,i){Nh.INSTANCE.registerEditorContribution(e,t,i)}var xh;!function(e){e.getEditorCommand=function(e){return Nh.INSTANCE.getEditorCommand(e)},e.getEditorActions=function(){return Nh.INSTANCE.getEditorActions()},e.getEditorContributions=function(){return Nh.INSTANCE.getEditorContributions()},e.getSomeEditorContributions=function(e){return Nh.INSTANCE.getEditorContributions().filter((t=>e.indexOf(t.id)>=0))},e.getDiffEditorContributions=function(){return Nh.INSTANCE.getDiffEditorContributions()}}(xh||(xh={}));class Nh{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)}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}}function Eh(e){return e.register(),e}Nh.INSTANCE=new Nh,jl.add("editor.contributions",Nh.INSTANCE);const Ih=Eh(new fh({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:eh.MenubarEditMenu,group:"1_do",title:ue(0,"&&Undo"),order:1},{menuId:eh.CommandPalette,group:"",title:ue(0,"Undo"),order:1}]}));Eh(new _h(Ih,{id:"default:undo",precondition:void 0}));const Mh=Eh(new fh({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:eh.MenubarEditMenu,group:"1_do",title:ue(0,"&&Redo"),order:2},{menuId:eh.CommandPalette,group:"",title:ue(0,"Redo"),order:1}]}));Eh(new _h(Mh,{id:"default:redo",precondition:void 0}));const Th=Eh(new fh({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:eh.MenubarSelectionMenu,group:"1_basic",title:ue(0,"&&Select All"),order:1},{menuId:eh.CommandPalette,group:"",title:ue(0,"Select All"),order:1}]}));class Rh{constructor(e,t,i,n){e>i||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 Rh.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return Rh.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 Rh.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 Rh.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 Rh.plusRange(this,e)}static plusRange(e,t){let i,n,s,o;return t.startLineNumbere.endLineNumber?(s=t.endLineNumber,o=t.endColumn):t.endLineNumber===e.endLineNumber?(s=t.endLineNumber,o=Math.max(t.endColumn,e.endColumn)):(s=e.endLineNumber,o=e.endColumn),new Rh(i,n,s,o)}intersectRanges(e){return Rh.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,o=e.endColumn;const r=t.startLineNumber,a=t.startColumn,l=t.endLineNumber,h=t.endColumn;return il?(s=l,o=h):s===l&&(o=Math.min(o,h)),i>s||i===s&&n>o?null:new Rh(i,n,s,o)}equalsRange(e){return Rh.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t||!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return Rh.getEndPosition(this)}static getEndPosition(e){return new Va(e.endLineNumber,e.endColumn)}getStartPosition(){return Rh.getStartPosition(this)}static getStartPosition(e){return new Va(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new Rh(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new Rh(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return Rh.collapseToStart(this)}static collapseToStart(e){return new Rh(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return Rh.collapseToEnd(this)}static collapseToEnd(e){return new Rh(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new Rh(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new Rh(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new Rh(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&"number"==typeof e.startLineNumber&&"number"==typeof e.startColumn&&"number"==typeof e.endLineNumber&&"number"==typeof e.endColumn}static areIntersectingOrTouching(e,t){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}}class Ah extends Rh{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 Ah.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?0:1}setEndPosition(e,t){return 0===this.getDirection()?new Ah(this.startLineNumber,this.startColumn,e,t):new Ah(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new Va(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new Va(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return 0===this.getDirection()?new Ah(e,t,this.endLineNumber,this.endColumn):new Ah(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new Ah(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return 0===t?new Ah(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new Ah(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new Ah(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=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Bh=function(e,t){return function(i,n){t(i,n,e)}},Wh=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Vh=new Al("selectionAnchorSet",!1);let Hh=Ph=class{static get(e){return e.getContribution(Ph.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=Vh.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(Ah.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:(new Ta).appendText(ue(0,"Selection Anchor")),className:"selection-anchor"})})),this.selectionAnchorSetContextKey.set(!!this.decorationId),Ps(ue(0,"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(Ah.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()}};Hh.ID="editor.contrib.selectionAnchorController",Hh=Ph=Fh([Bh(1,Ol)],Hh);Dh(Hh.ID,Hh,4),Lh(class extends bh{constructor(){super({id:"editor.action.setSelectionAnchor",label:ue(0,"Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2080),weight:100}})}run(e,t){var i;return Wh(this,void 0,void 0,(function*(){null===(i=Hh.get(t))||void 0===i||i.setSelectionAnchor()}))}}),Lh(class extends bh{constructor(){super({id:"editor.action.goToSelectionAnchor",label:ue(0,"Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:Vh})}run(e,t){var i;return Wh(this,void 0,void 0,(function*(){null===(i=Hh.get(t))||void 0===i||i.goToSelectionAnchor()}))}}),Lh(class extends bh{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:ue(0,"Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:Vh,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2089),weight:100}})}run(e,t){var i;return Wh(this,void 0,void 0,(function*(){null===(i=Hh.get(t))||void 0===i||i.selectFromAnchorToCursor()}))}}),Lh(class extends bh{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:ue(0,"Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:Vh,kbOpts:{kbExpr:Oh.editorTextFocus,primary:9,weight:100}})}run(e,t){var i;return Wh(this,void 0,void 0,(function*(){null===(i=Hh.get(t))||void 0===i||i.cancelSelectionAnchor()}))}});const zh=Object.freeze((function(e,t){const i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}));var Uh;!function(e){e.isCancellationToken=function(t){return t===e.None||t===e.Cancelled||(t instanceof Kh||!(!t||"object"!=typeof t)&&("boolean"==typeof t.isCancellationRequested&&"function"==typeof t.onCancellationRequested))},e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:B.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:zh})}(Uh||(Uh={}));class Kh{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?zh:(this._emitter||(this._emitter=new U),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class jh{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new Kh),this._token}cancel(){this._token?this._token instanceof Kh&&this._token.cancel():this._token=Uh.Cancelled}dispose(e=!1){var t;e&&this.cancel(),null===(t=this._parentListener)||void 0===t||t.dispose(),this._token?this._token instanceof Kh&&this._token.dispose():this._token=Uh.None}}const qh=Symbol("MicrotaskDelay");var $h=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))},Gh=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=e[i]&&function(t){return new Promise((function(n,s){(function(e,t,i,n){Promise.resolve(n).then((function(t){e({value:t,done:i})}),t)})(n,s,(t=e[i](t)).done,t.value)}))}}};function Zh(e){return!!e&&"function"==typeof e.then}function Yh(e){const t=new jh,i=e(t.token),n=new Promise(((e,n)=>{const s=t.token.onCancellationRequested((()=>{s.dispose(),t.dispose(),n(new c)}));Promise.resolve(i).then((i=>{s.dispose(),t.dispose(),e(i)}),(e=>{s.dispose(),t.dispose(),n(e)}))}));return new class{cancel(){t.cancel()}then(e,t){return n.then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return n.finally(e)}}}function Xh(e,t,i){return new Promise(((n,s)=>{const o=t.onCancellationRequested((()=>{o.dispose(),n(i)}));e.then(n,s).finally((()=>o.dispose()))}))}class Qh{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 e=()=>{if(this.queuedPromise=null,this.isDisposed)return;const e=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,e};this.queuedPromise=new Promise((t=>{this.activePromise.then(e,e).then(t)}))}return new Promise(((e,t)=>{this.queuedPromise.then(e,t)}))}return this.activePromise=e(),new Promise(((e,t)=>{this.activePromise.then((t=>{this.activePromise=null,e(t)}),(e=>{this.activePromise=null,t(e)}))}))}dispose(){this.isDisposed=!0}}class Jh{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(((e,t)=>{this.doResolve=e,this.doReject=t})).then((()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const e=this.task;return this.task=null,e()}})));const i=()=>{var e;this.deferred=null,null===(e=this.doResolve)||void 0===e||e.call(this,null)};return this.deferred=t===qh?(e=>{let t=!0;return queueMicrotask((()=>{t&&(t=!1,e())})),{isTriggered:()=>t,dispose:()=>{t=!1}}})(i):((e,t)=>{let i=!0;const n=setTimeout((()=>{i=!1,t()}),e);return{isTriggered:()=>i,dispose:()=>{clearTimeout(n),i=!1}}})(t,i),this.completionPromise}isTriggered(){var e;return!!(null===(e=this.deferred)||void 0===e?void 0:e.isTriggered())}cancel(){var e;this.cancelTimeout(),this.completionPromise&&(null===(e=this.doReject)||void 0===e||e.call(this,new c),this.completionPromise=null)}cancelTimeout(){var e;null===(e=this.deferred)||void 0===e||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class ed{constructor(e){this.delayer=new Jh(e),this.throttler=new Qh}trigger(e,t){return this.delayer.trigger((()=>this.throttler.queue(e)),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function td(e,t){return t?new Promise(((i,n)=>{const s=setTimeout((()=>{o.dispose(),i()}),e),o=t.onCancellationRequested((()=>{clearTimeout(s),o.dispose(),n(new c)}))})):Yh((t=>td(e,t)))}function id(e,t=0,i){const n=setTimeout((()=>{e(),i&&s.dispose()}),t),s=x((()=>{clearTimeout(n),null==i||i.deleteAndLeak(s)}));return null==i||i.add(s),s}function nd(e,t=e=>!!e,i=null){let n=0;const s=e.length,o=()=>{if(n>=s)return Promise.resolve(i);const r=e[n++];return Promise.resolve(r()).then((e=>t(e)?Promise.resolve(e):o()))};return o()}class sd{constructor(e,t){this._token=-1,"function"==typeof e&&"number"==typeof t&&this.setIfNotSet(e,t)}dispose(){this.cancel()}cancel(){-1!==this._token&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout((()=>{this._token=-1,e()}),t)}setIfNotSet(e,t){-1===this._token&&(this._token=setTimeout((()=>{this._token=-1,e()}),t))}}class od{constructor(){this._token=-1}dispose(){this.cancel()}cancel(){-1!==this._token&&(clearInterval(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setInterval((()=>{e()}),t)}}class rd{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-1!==this.timeoutToken}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){var e;null===(e=this.runner)||void 0===e||e.call(this)}}let ad;ad="function"!=typeof requestIdleCallback||"function"!=typeof cancelIdleCallback?e=>{qe((()=>{if(t)return;const i=Date.now()+15;e(Object.freeze({didTimeout:!0,timeRemaining:()=>Math.max(0,i-Date.now())}))}));let t=!1;return{dispose(){t||(t=!0)}}}:(e,t)=>{const i=requestIdleCallback(e,"number"==typeof t?{timeout:t}:void 0);let n=!1;return{dispose(){n||(n=!0,cancelIdleCallback(i))}}};class ld{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(t){this._error=t}finally{this._didRun=!0}},this._handle=ad((()=>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 hd{get isRejected(){var e;return 1===(null===(e=this.outcome)||void 0===e?void 0:e.outcome)}get isSettled(){return!!this.outcome}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:0,value:e},t()}))}error(e){return new Promise((t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()}))}cancel(){return this.error(new c)}}var dd;!function(e){e.settled=function(e){return $h(this,void 0,void 0,(function*(){let t;const i=yield Promise.all(e.map((e=>e.then((e=>e),(e=>{t||(t=e)})))));if(void 0!==t)throw t;return i}))},e.withAsyncBody=function(e){return new Promise(((t,i)=>$h(this,void 0,void 0,(function*(){try{yield e(t,i)}catch(n){i(n)}}))))}}(dd||(dd={}));class cd{static fromArray(e){return new cd((t=>{t.emitMany(e)}))}static fromPromise(e){return new cd((t=>$h(this,void 0,void 0,(function*(){t.emitMany(yield e)}))))}static fromPromises(e){return new cd((t=>$h(this,void 0,void 0,(function*(){yield Promise.all(e.map((e=>$h(this,void 0,void 0,(function*(){return t.emitOne(yield e)})))))}))))}static merge(e){return new cd((t=>$h(this,void 0,void 0,(function*(){yield Promise.all(e.map((e=>{var i,n,s;return $h(this,void 0,void 0,(function*(){var o,r,a,l;try{for(i=!0,n=Gh(e);!(o=(s=yield n.next()).done);i=!0){l=s.value,i=!1;const e=l;t.emitOne(e)}}catch(h){r={error:h}}finally{try{i||o||!(a=n.return)||(yield a.call(n))}finally{if(r)throw r.error}}}))})))}))))}constructor(e){this._state=0,this._results=[],this._error=null,this._onStateChanged=new U,queueMicrotask((()=>$h(this,void 0,void 0,(function*(){const t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{yield Promise.resolve(e(t)),this.resolve()}catch(i){this.reject(i)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}}))))}[Symbol.asyncIterator](){let e=0;return{next:()=>$h(this,void 0,void 0,(function*(){for(;;){if(2===this._state)throw this._error;if(e$h(this,void 0,void 0,(function*(){var n,s,o,r;try{for(var a,l=!0,h=Gh(e);!(n=(a=yield h.next()).done);l=!0){r=a.value,l=!1;const e=r;i.emitOne(t(e))}}catch(d){s={error:d}}finally{try{l||n||!(o=h.return)||(yield o.call(h))}finally{if(s)throw s.error}}}))))}map(e){return cd.map(this,e)}static filter(e,t){return new cd((i=>$h(this,void 0,void 0,(function*(){var n,s,o,r;try{for(var a,l=!0,h=Gh(e);!(n=(a=yield h.next()).done);l=!0){r=a.value,l=!1;const e=r;t(e)&&i.emitOne(e)}}catch(d){s={error:d}}finally{try{l||n||!(o=h.return)||(yield o.call(h))}finally{if(s)throw s.error}}}))))}filter(e){return cd.filter(this,e)}static coalesce(e){return cd.filter(e,(e=>!!e))}coalesce(){return cd.coalesce(this)}static toPromise(e){var t,i,n,s,o,r,a;return $h(this,void 0,void 0,(function*(){const l=[];try{for(t=!0,i=Gh(e);n=yield i.next(),!(s=n.done);t=!0){a=n.value,t=!1;const e=a;l.push(e)}}catch(h){o={error:h}}finally{try{t||s||!(r=i.return)||(yield r.call(i))}finally{if(o)throw o.error}}return l}))}toPromise(){return cd.toPromise(this)}emitOne(e){0===this._state&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){0===this._state&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){0===this._state&&(this._state=1,this._onStateChanged.fire())}reject(e){0===this._state&&(this._state=2,this._error=e,this._onStateChanged.fire())}}cd.EMPTY=cd.fromArray([]);class ud extends cd{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function gd(e){if(!e||"object"!=typeof e)return e;if(e instanceof RegExp)return e;const t=Array.isArray(e)?[]:{};return Object.entries(e).forEach((([e,i])=>{t[e]=i&&"object"==typeof i?gd(i):i})),t}const pd=Object.prototype.hasOwnProperty;function md(e,t){return fd(e,t,new Set)}function fd(e,t,i){if(jr(e))return e;const n=t(e);if(void 0!==n)return n;if(Array.isArray(e)){const n=[];for(const s of e)n.push(fd(s,t,i));return n}if(Br(e)){if(i.has(e))throw new Error("Cannot clone recursive data-structure");i.add(e);const n={};for(const s in e)pd.call(e,s)&&(n[s]=fd(e[s],t,i));return i.delete(e),n}return e}function _d(e,t,i=!0){return Br(e)?(Br(t)&&Object.keys(t).forEach((n=>{n in e?i&&(Br(e[n])&&Br(t[n])?_d(e[n],t[n],i):e[n]=t[n]):e[n]=t[n]})),e):t}function vd(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;let i,n;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(i=0;ie===t){if(e===t)return!0;if(!e||!t)return!1;if(e.length!==t.length)return!1;for(let n=0,s=e.length;n0))return e;n=e-1}}return-(i+1)}(e.length,(n=>i(e[n],t)))}function Ad(e,t,i){if((e|=0)>=t.length)throw new TypeError("invalid index");const n=t[Math.floor(t.length*Math.random())],s=[],o=[],r=[];for(const a of t){const e=i(a,n);e<0?s.push(a):e>0?o.push(a):r.push(a)}return e!!e))}function Wd(e){let t=0;for(let i=0;i0}function zd(e,t=e=>e){const i=new Set;return e.filter((e=>{const n=t(e);return!i.has(n)&&(i.add(n),!0)}))}function Ud(e,t){return e.length>0?e[0]:t}function Kd(e,t){let i="number"==typeof t?e:0;"number"==typeof t?i=e:(i=0,t=e);const n=[];if(i<=t)for(let s=i;st;s--)n.push(s);return n}function jd(e,t,i){const n=e.slice(0,t),s=e.slice(t);return n.concat(i,s)}function qd(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.unshift(t))}function $d(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.push(t))}function Gd(e,t){for(const i of t)e.push(i)}function Zd(e){return Array.isArray(e)?e:[e]}function Yd(e,t,i,n){const s=Xd(e,t);let o=e.splice(s,i);return void 0===o&&(o=[]),function(e,t,i){const n=Xd(e,t),s=e.length,o=i.length;e.length=s+o;for(let r=s-1;r>=n;r--)e[r+o]=e[r];for(let r=0;rt(e(i),e(n))}!function(e){e.isLessThan=function(e){return e<0},e.isLessThanOrEqual=function(e){return e<=0},e.isGreaterThan=function(e){return e>0},e.isNeitherLessOrGreaterThan=function(e){return 0===e},e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0}(Ld||(Ld={}));const Jd=(e,t)=>e-t,ec=(e,t)=>Jd(e?1:0,t?1:0);function tc(e){return(t,i)=>-e(t,i)}class ic{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(0!==this.length)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}class nc{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate((t=>(e.push(t),!0))),e}filter(e){return new nc((t=>this.iterate((i=>!e(i)||t(i)))))}map(e){return new nc((t=>this.iterate((i=>t(e(i))))))}findLast(e){let t;return this.iterate((i=>(e(i)&&(t=i),!0))),t}findLastMaxBy(e){let t,i=!0;return this.iterate((n=>((i||Ld.isGreaterThan(e(n,t)))&&(i=!1,t=n),!0))),t}}function sc(e,t){const i=Math.pow(10,t);return Math.round(e*i)/i}nc.empty=new nc((e=>{}));class oc{constructor(e,t,i,n=1){this._rgbaBrand=void 0,this.r=0|Math.min(255,Math.max(0,e)),this.g=0|Math.min(255,Math.max(0,t)),this.b=0|Math.min(255,Math.max(0,i)),this.a=sc(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 rc{constructor(e,t,i,n){this._hslaBrand=void 0,this.h=0|Math.max(Math.min(360,e),0),this.s=sc(Math.max(Math.min(1,t),0),3),this.l=sc(Math.max(Math.min(1,i),0),3),this.a=sc(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,s=e.a,o=Math.max(t,i,n),r=Math.min(t,i,n);let a=0,l=0;const h=(r+o)/2,d=o-r;if(d>0){switch(l=Math.min(h<=.5?d/(2*h):d/(2-2*h),1),o){case t:a=(i-n)/d+(i1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?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:s}=e;let o,r,a;if(0===i)o=r=a=n;else{const e=n<.5?n*(1+i):n+i-n*i,s=2*n-e;o=rc._hue2rgb(s,e,t+1/3),r=rc._hue2rgb(s,e,t),a=rc._hue2rgb(s,e,t-1/3)}return new oc(Math.round(255*o),Math.round(255*r),Math.round(255*a),s)}}class ac{constructor(e,t,i,n){this._hsvaBrand=void 0,this.h=0|Math.max(Math.min(360,e),0),this.s=sc(Math.max(Math.min(1,t),0),3),this.v=sc(Math.max(Math.min(1,i),0),3),this.a=sc(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,s=Math.max(t,i,n),o=s-Math.min(t,i,n),r=0===s?0:o/s;let a;return a=0===o?0:s===t?((i-n)/o%6+6)%6:s===i?(n-t)/o+2:(t-i)/o+4,new ac(Math.round(60*a),r,s,e.a)}static toRGBA(e){const{h:t,s:i,v:n,a:s}=e,o=n*i,r=o*(1-Math.abs(t/60%2-1)),a=n-o;let[l,h,d]=[0,0,0];return t<60?(l=o,h=r):t<120?(l=r,h=o):t<180?(h=o,d=r):t<240?(h=r,d=o):t<300?(l=r,d=o):t<=360&&(l=o,d=r),l=Math.round(255*(l+a)),h=Math.round(255*(h+a)),d=Math.round(255*(d+a)),new oc(l,h,d,s)}}class lc{static fromHex(e){return lc.Format.CSS.parseHex(e)||lc.red}static equals(e,t){return!e&&!t||!(!e||!t)&&e.equals(t)}get hsla(){return this._hsla?this._hsla:rc.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:ac.fromRGBA(this.rgba)}constructor(e){if(!e)throw new Error("Color needs a value");if(e instanceof oc)this.rgba=e;else if(e instanceof rc)this._hsla=e,this.rgba=rc.toRGBA(e);else{if(!(e instanceof ac))throw new Error("Invalid color ctor argument");this._hsva=e,this.rgba=ac.toRGBA(e)}}equals(e){return!!e&&oc.equals(this.rgba,e.rgba)&&rc.equals(this.hsla,e.hsla)&&ac.equals(this.hsva,e.hsva)}getRelativeLuminance(){return sc(.2126*lc._relativeLuminanceForComponent(this.rgba.r)+.7152*lc._relativeLuminanceForComponent(this.rgba.g)+.0722*lc._relativeLuminanceForComponent(this.rgba.b),4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3>=128}isLighterThan(e){return this.getRelativeLuminance()>e.getRelativeLuminance()}isDarkerThan(e){return this.getRelativeLuminance()=t){return l-tt))return new uc(e,t)}static ofLength(e){return new uc(0,e)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new f(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new uc(this.start+e,this.endExclusive+e)}deltaStart(e){return new uc(this.start+e,this.endExclusive)}deltaEnd(e){return new uc(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=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;te.toString())).join(", ")}intersectsStrict(e){let t=0;for(;te+t.length),0)}}function pc(e,t,i){const n=function(e,t,i=e.length-1){for(let n=i;n>=0;n--){if(t(e[n]))return n}return-1}(e,t);if(-1!==n)return e[n]}function mc(e,t){const i=fc(e,t);return-1===i?void 0:e[i]}function fc(e,t,i=0,n=e.length){let s=i,o=n;for(;s0&&(i=s)}return i}function Cc(e,t){if(0===e.length)return-1;let i=0;for(let n=1;n0&&(i=n)}return i}vc.assertInvariants=!1;class wc{static fromRange(e){return new wc(e.startLineNumber,e.endLineNumber)}static joinMany(e){if(0===e.length)return[];let t=new yc(e[0].slice());for(let i=1;it)throw new f(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&et.endLineNumberExclusive>=e.startLineNumber)),i=fc(this._normalizedRanges,(t=>t.startLineNumber<=e.endLineNumberExclusive))+1;if(t===i)this._normalizedRanges.splice(t,0,e);else if(t===i-1){const i=this._normalizedRanges[t];this._normalizedRanges[t]=i.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=mc(this._normalizedRanges,(t=>t.startLineNumber<=e));return!!t&&t.endLineNumberExclusive>e}getUnion(e){if(0===this._normalizedRanges.length)return e;if(0===e._normalizedRanges.length)return this;const t=[];let i=0,n=0,s=null;for(;i=o.startLineNumber?s=new wc(s.startLineNumber,Math.max(s.endLineNumberExclusive,o.endLineNumberExclusive)):(t.push(s),s=o)}return null!==s&&t.push(s),new yc(t)}subtractFrom(e){const t=_c(this._normalizedRanges,(t=>t.endLineNumberExclusive>=e.startLineNumber)),i=fc(this._normalizedRanges,(t=>t.startLineNumber<=e.endLineNumberExclusive))+1;if(t===i)return new yc([e]);const n=[];let s=e.startLineNumber;for(let o=t;os&&n.push(new wc(s,e.startLineNumber)),s=e.endLineNumberExclusive}return se.toString())).join(", ")}getIntersection(e){const t=[];let i=0,n=0;for(;it.delta(e))))}}const Sc={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}},Lc=Ba("languageService"),kc="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";const Dc=function(e=""){let t="(-?\\d*\\.\\d\\w*)|([^";for(const i of kc)e.indexOf(i)>=0||(t+="\\"+i);return t+="\\s]+)",new RegExp(t,"g")}();function xc(e){let t=Dc;if(e&&e instanceof RegExp)if(e.global)t=e;else{let i="g";e.ignoreCase&&(i+="i"),e.multiline&&(i+="m"),e.unicode&&(i+="u"),t=new RegExp(e.source,i)}return t.lastIndex=0,t}const Nc=new O;function Ec(e,t,i,n,s){if(s||(s=v.first(Nc)),i.length>s.maxLen){let o=e-s.maxLen/2;return o<0?o=0:n+=o,Ec(e,t,i=i.substring(o,e+s.maxLen/2),n,s)}const o=Date.now(),r=e-1-n;let a=-1,l=null;for(let h=1;!(Date.now()-o>=s.timeBudget);h++){const e=r-s.windowSize*h;t.lastIndex=Math.max(0,e);const n=Ic(t,i,r,a);if(!n&&l)break;if(l=n,e<=0)break;a=e}if(l){const e={word:l[0],startColumn:n+1+l.index,endColumn:n+1+l.index+l[0].length};return t.lastIndex=0,e}return null}function Ic(e,t,i,n){let s;for(;s=e.exec(t);){const t=s.index||0;if(t<=i&&e.lastIndex>=i)return s;if(n>0&&t>n)return null}return null}var Mc;Nc.unshift({maxLen:1e3,windowSize:15,timeBudget:150}),function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"}(Mc||(Mc={}));class Tc{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;t0&&e.getLanguageId(r-1)===s;)r--;return new Pc(e,s,r,o+1,e.getStartOffset(r),e.getEndOffset(o))}class Pc{constructor(e,t,i,n,s,o){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,this.firstCharOffset=s,this._lastCharOffset=o}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}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)}}function Fc(e){return!!(3&e)}class Bc{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map((e=>new Tc(e))):e.brackets?this._autoClosingPairs=e.brackets.map((e=>new Tc({open:e[0],close:e[1]}))):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new Tc({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes="string"==typeof e.autoCloseBefore?e.autoCloseBefore:Bc.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets="string"==typeof e.autoCloseBefore?e.autoCloseBefore:Bc.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}}Bc.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=";:.,=}])> \n\t",Bc.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS="'\"`;:.,=}])> \n\t";const Wc="undefined"!=typeof Buffer;new Zs((()=>new Uint8Array(256)));let Vc,Hc,zc,Uc;class Kc{static wrap(e){return Wc&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new Kc(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return Wc?this.buffer.toString():(Vc||(Vc=new TextDecoder),Vc.decode(this.buffer))}}function jc(e,t){return(e[t+0]|0)>>>0|e[t+1]<<8>>>0}function qc(e,t,i){e[i+0]=255&t,t>>>=8,e[i+1]=255&t}function $c(e,t){return e[t]*Math.pow(2,24)+e[t+1]*Math.pow(2,16)+e[t+2]*Math.pow(2,8)+e[t+3]}function Gc(e,t,i){e[i+3]=t,t>>>=8,e[i+2]=t,t>>>=8,e[i+1]=t,t>>>=8,e[i]=t}function Zc(e,t){return e[t]}function Yc(e,t,i){e[i]=t}function Xc(){return Hc||(Hc=new TextDecoder("UTF-16LE")),Hc}function Qc(){return Uc||(Uc=Ye()?Xc():(zc||(zc=new TextDecoder("UTF-16BE")),zc)),Uc}function Jc(e,t,i){const n=new Uint16Array(e.buffer,t,i);return i>0&&(65279===n[0]||65534===n[0])?function(e,t,i){const n=[];let s=0;for(let o=0;o=this._capacity)return this._flushBuffer(),void(this._completedStrings[this._completedStrings.length]=e);for(let i=0;i[e[0].toLowerCase(),e[1].toLowerCase()]));const i=[];for(let r=0;r{const[i,n]=e,[s,o]=t;return i===s||i===o||n===s||n===o},s=(e,n)=>{const s=Math.min(e,n),o=Math.max(e,n);for(let r=0;r0&&o.push({open:n,close:s})}return o}(t);this.brackets=i.map(((t,n)=>new tu(e,n,t.open,t.close,function(e,t,i,n){let s=[];s=s.concat(e),s=s.concat(t);for(let o=0,r=s.length;o=0&&n.push(t);for(const t of o.close)t.indexOf(e)>=0&&n.push(t)}}function su(e,t){return e.length-t.length}function ou(e){if(e.length<=1)return e;const t=[],i=new Set;for(const n of e)i.has(n)||(t.push(n),i.add(n));return t}function ru(e){const t=/^[\w ]+$/.test(e);return e=eo(e),t?`\\b${e}\\b`:e}function au(e){return so(`(${e.map(ru).join(")|(")})`,!0)}const lu=function(){let e=null,t=null;return function(i){return e!==i&&(e=i,t=function(e){const t=new Uint16Array(e.length);let i=0;for(let n=e.length-1;n>=0;n--)t[i++]=e.charCodeAt(n);return Qc().decode(t)}(e)),t}}();class hu{static _findPrevBracketInText(e,t,i,n){const s=i.match(e);if(!s)return null;const o=i.length-(s.index||0),r=s[0].length,a=n+o;return new Rh(t,a-r+1,t,a+1)}static findPrevBracketInRange(e,t,i,n,s){const o=lu(i).substring(i.length-s,i.length-n);return this._findPrevBracketInText(e,t,o,n)}static findNextBracketInText(e,t,i,n){const s=i.match(e);if(!s)return null;const o=s.index||0,r=s[0].length;if(0===r)return null;const a=n+o;return new Rh(t,a+1,t,a+1+r)}static findNextBracketInRange(e,t,i,n,s){const o=i.substring(n,s);return this.findNextBracketInText(e,t,o,n)}}class du{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 t=i.charAt(i.length-1);e.push(t)}return zd(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||0===this._richEditBrackets.brackets.length)return null;const n=t.findTokenIndexAtOffset(i-1);if(Fc(t.getStandardTokenType(n)))return null;const s=this._richEditBrackets.reversedRegex,o=t.getLineContent().substring(0,i-1)+e,r=hu.findPrevBracketInRange(s,1,o,0,o.length);if(!r)return null;const a=o.substring(r.startColumn-1,r.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[a])return null;const l=t.getActualLineContentBefore(r.startColumn-1);return/^\s*$/.test(l)?{matchOpenBracket:a}:null}}function cu(e){return e.global&&(e.lastIndex=0),!0}class uu{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&cu(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&cu(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&cu(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&cu(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}}class gu{constructor(e){(e=e||{}).brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach((e=>{const t=gu._createOpenBracketRegExp(e[0]),i=gu._createCloseBracketRegExp(e[1]);t&&i&&this._brackets.push({open:e[0],openRegExp:t,close:e[1],closeRegExp:i})})),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,n){if(e>=3)for(let s=0,o=this._regExpRules.length;s!e.reg||(e.reg.lastIndex=0,e.reg.test(e.text)))))return e.action}if(e>=2&&i.length>0&&n.length>0)for(let s=0,o=this._brackets.length;s=2&&i.length>0)for(let s=0,o=this._brackets.length;s0&&"#"===i.charAt(i.length-1)?i.substring(0,i.length-1):i)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}};jl.add(ku,Du);const xu="base.contributions.configuration",Nu={properties:{},patternProperties:{}},Eu={properties:{},patternProperties:{}},Iu={properties:{},patternProperties:{}},Mu={properties:{},patternProperties:{}},Tu={properties:{},patternProperties:{}},Ru={properties:{},patternProperties:{}},Au="vscode://schemas/settings/resourceLanguage",Ou=jl.as(ku);const Pu="\\[([^\\]]+)\\]",Fu=new RegExp(Pu,"g"),Bu=`^(${Pu})+$`,Wu=new RegExp(Bu);function Vu(e){const t=[];if(Wu.test(e)){let i=Fu.exec(e);for(;null==i?void 0:i.length;){const n=i[1].trim();n&&t.push(n),i=Fu.exec(e)}}return zd(t)}const Hu=new class{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new U,this._onDidUpdateConfiguration=new U,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:ue(0,"Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},Ou.registerSchema(Au,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),Ou.registerSchema(Au,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){var i;const n=[];for(const{overrides:s,source:o}of e)for(const e in s)if(t.add(e),Wu.test(e)){const t=this.configurationDefaultsOverrides.get(e),r=null!==(i=null==t?void 0:t.valuesSources)&&void 0!==i?i:new Map;if(o)for(const i of Object.keys(s[e]))r.set(i,o);const a=Object.assign(Object.assign({},(null==t?void 0:t.value)||{}),s[e]);this.configurationDefaultsOverrides.set(e,{source:o,value:a,valuesSources:r});const l={type:"object",default:a,description:ue(0,"Configure settings to be overridden for the {0} language.",e.replace(/[\[\]]/g,"")),$ref:Au,defaultDefaultValue:a,source:Fr(o)?void 0:o,defaultValueSource:o};n.push(...Vu(e)),this.configurationProperties[e]=l,this.defaultLanguageConfigurationOverridesNode.properties[e]=l}else{this.configurationDefaultsOverrides.set(e,{value:s[e],source:o});const t=this.configurationProperties[e];t&&(this.updatePropertyDefaultValue(e,t),this.updateSchema(e,t))}this.doRegisterOverrideIdentifiers(n)}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((e=>{this.validateAndRegisterProperties(e,t,e.extensionInfo,e.restrictedProperties,void 0,i),this.configurationContributors.push(e),this.registerJSONConfiguration(e)}))}validateAndRegisterProperties(e,t=!0,i,n,s=3,o){var r;s=jr(e.scope)?s:e.scope;const a=e.properties;if(a)for(const h in a){const e=a[h];t&&zu(h,e)?delete a[h]:(e.source=i,e.defaultDefaultValue=a[h].default,this.updatePropertyDefaultValue(h,e),Wu.test(h)?e.scope=void 0:(e.scope=jr(e.scope)?s:e.scope,e.restricted=jr(e.restricted)?!!(null==n?void 0:n.includes(h)):e.restricted),!a[h].hasOwnProperty("included")||a[h].included?(this.configurationProperties[h]=a[h],(null===(r=a[h].policy)||void 0===r?void 0:r.name)&&this.policyConfigurations.set(a[h].policy.name,h),!a[h].deprecationMessage&&a[h].markdownDeprecationMessage&&(a[h].deprecationMessage=a[h].markdownDeprecationMessage),o.add(h)):(this.excludedConfigurationProperties[h]=a[h],delete a[h]))}const l=e.allOf;if(l)for(const h of l)this.validateAndRegisterProperties(h,t,i,n,s,o)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){const t=e=>{const i=e.properties;if(i)for(const t in i)this.updateSchema(t,i[t]);const n=e.allOf;null==n||n.forEach(t)};t(e)}updateSchema(e,t){switch(Nu.properties[e]=t,t.scope){case 1:Eu.properties[e]=t;break;case 2:Iu.properties[e]=t;break;case 6:Mu.properties[e]=t;break;case 3:Tu.properties[e]=t;break;case 4:Ru.properties[e]=t;break;case 5:Ru.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:ue(0,"Configure editor settings to be overridden for a language."),errorMessage:ue(0,"This setting does not support per-language configuration."),$ref:Au};this.updatePropertyDefaultValue(t,i),Nu.properties[t]=i,Eu.properties[t]=i,Iu.properties[t]=i,Mu.properties[t]=i,Tu.properties[t]=i,Ru.properties[t]=i}}registerOverridePropertyPatternKey(){const e={type:"object",description:ue(0,"Configure editor settings to be overridden for a language."),errorMessage:ue(0,"This setting does not support per-language configuration."),$ref:Au};Nu.patternProperties[Bu]=e,Eu.patternProperties[Bu]=e,Iu.patternProperties[Bu]=e,Mu.patternProperties[Bu]=e,Tu.patternProperties[Bu]=e,Ru.patternProperties[Bu]=e,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e);let n=null==i?void 0:i.value,s=null==i?void 0:i.source;Ur(n)&&(n=t.defaultDefaultValue,s=void 0),Ur(n)&&(n=function(e){switch(Array.isArray(e)?e[0]:e){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}(t.type)),t.default=n,t.defaultValueSource=s}};function zu(e,t){var i,n,s,o;return e.trim()?Wu.test(e)?ue(0,"Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",e):void 0!==Hu.getConfigurationProperties()[e]?ue(0,"Cannot register '{0}'. This property is already registered.",e):(null===(i=t.policy)||void 0===i?void 0:i.name)&&void 0!==Hu.getPolicyConfigurations().get(null===(n=t.policy)||void 0===n?void 0:n.name)?ue(0,"Cannot register '{0}'. The associated policy {1} is already registered with {2}.",e,null===(s=t.policy)||void 0===s?void 0:s.name,Hu.getPolicyConfigurations().get(null===(o=t.policy)||void 0===o?void 0:o.name)):null:ue(0,"Cannot register an empty property")}jl.add(xu,Hu);const Uu=new class{constructor(){this._onDidChangeLanguages=new U,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 t=new Set;return{info:new Gu(this,e,t),closing:t}})),s=new Gs((e=>{const t=new Set,i=new Set;return{info:new Zu(this,e,t,i),opening:t,openingColorized:i}}));for(const[r,a]of i){const e=n.get(r),t=s.get(a);e.closing.add(t.info),t.opening.add(e.info)}const o=t.colorizedBracketPairs?qu(t.colorizedBracketPairs):i.filter((e=>!("<"===e[0]&&">"===e[1])));for(const[r,a]of o){const e=n.get(r),t=s.get(a);e.closing.add(t.info),t.openingColorized.add(e.info),t.opening.add(e.info)}this._openingBrackets=new Map([...n.cachedValues].map((([e,t])=>[e,t.info]))),this._closingBrackets=new Map([...s.cachedValues].map((([e,t])=>[e,t.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)}}function qu(e){return e.filter((([e,t])=>""!==e&&""!==t))}class $u{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class Gu extends $u{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class Zu extends $u{constructor(e,t,i,n){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=n,this.isOpeningBracket=!1}closes(e){return e.config===this.config&&this.openingBrackets.has(e)}closesColorized(e){return e.config===this.config&&this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}var Yu=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Xu=function(e,t){return function(i,n){t(i,n,e)}};class Qu{constructor(e){this.languageId=e}affects(e){return!this.languageId||this.languageId===e}}const Ju=Ba("languageConfigurationService");let eg=class extends E{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new hg),this.onDidChangeEmitter=this._register(new U),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(tg));this._register(this.configurationService.onDidChangeConfiguration((e=>{const t=e.change.keys.some((e=>i.has(e))),n=e.change.overrides.filter((([e,t])=>t.some((e=>i.has(e))))).map((([e])=>e));if(t)this.configurations.clear(),this.onDidChangeEmitter.fire(new Qu(void 0));else for(const i of n)this.languageService.isRegisteredLanguageId(i)&&(this.configurations.delete(i),this.onDidChangeEmitter.fire(new Qu(i)))}))),this._register(this._registry.onDidChange((e=>{this.configurations.delete(e.languageId),this.onDidChangeEmitter.fire(new Qu(e.languageId))})))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=function(e,t,i,n){let s=t.getLanguageConfiguration(e);if(!s){if(!n.isRegisteredLanguageId(e))return new dg(e,{});s=new dg(e,{})}const o=function(e,t){const i=t.getValue(tg.brackets,{overrideIdentifier:e}),n=t.getValue(tg.colorizedBracketPairs,{overrideIdentifier:e});return{brackets:ig(i),colorizedBracketPairs:ig(n)}}(s.languageId,i),r=rg([s.underlyingConfig,o]);return new dg(s.languageId,r)}(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};eg=Yu([Xu(0,pu),Xu(1,Lc)],eg);const tg={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function ig(e){if(Array.isArray(e))return e.map((e=>{if(Array.isArray(e)&&2===e.length)return[e[0],e[1]]})).filter((e=>!!e))}function ng(e,t,i){let n=ao(e.getLineContent(t));return n.length>i-1&&(n=n.substring(0,i-1)),n}function sg(e,t,i){e.tokenization.forceTokenization(t);return Oc(e.tokenization.getLineTokens(t),void 0===i?e.getLineMaxColumn(t)-1:i-1)}class og{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new ag(e,t,++this._order);return this._entries.push(i),this._resolved=null,x((()=>{for(let e=0;ee.configuration))))}}function rg(e){let t={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 i of e)t={comments:i.comments||t.comments,brackets:i.brackets||t.brackets,wordPattern:i.wordPattern||t.wordPattern,indentationRules:i.indentationRules||t.indentationRules,onEnterRules:i.onEnterRules||t.onEnterRules,autoClosingPairs:i.autoClosingPairs||t.autoClosingPairs,surroundingPairs:i.surroundingPairs||t.surroundingPairs,autoCloseBefore:i.autoCloseBefore||t.autoCloseBefore,folding:i.folding||t.folding,colorizedBracketPairs:i.colorizedBracketPairs||t.colorizedBracketPairs,__electricCharacterSupport:i.__electricCharacterSupport||t.__electricCharacterSupport};return t}class ag{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 lg{constructor(e){this.languageId=e}}class hg extends E{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new U),this.onDidChange=this._onDidChange.event,this._register(this.register(Ku,{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 og(e),this._entries.set(e,n));const s=n.register(t,i);return this._onDidChange.fire(new lg(e)),x((()=>{s.dispose(),this._onDidChange.fire(new lg(e))}))}getLanguageConfiguration(e){const t=this._entries.get(e);return(null==t?void 0:t.getResolvedConfiguration())||null}}class dg{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 gu(this.underlyingConfig):null,this.comments=dg._handleComments(this.underlyingConfig),this.characterPair=new Bc(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||Dc,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new uu(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new ju(e,this.underlyingConfig)}getWordDefinition(){return xc(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new iu(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new du(this.brackets)),this._electricCharacter}onEnter(e,t,i,n){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,n):null}getAutoClosingPairs(){return new Rc(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[e,n]=t.blockComment;i.blockCommentStartToken=e,i.blockCommentEndToken=n}return i}}yu(Ju,eg,1);class cg{constructor(e,t,i,n){this.range=e,this.nestingLevel=t,this.nestingLevelOfEqualBracketType=i,this.isInvalid=n}}class ug{constructor(e,t,i,n,s,o){this.range=e,this.openingBracketRange=t,this.closingBracketRange=i,this.nestingLevel=n,this.nestingLevelOfEqualBracketType=s,this.bracketPairNode=o}get openingBracketInfo(){return this.bracketPairNode.openingBracket.bracketInfo}}class gg extends ug{constructor(e,t,i,n,s,o,r){super(e,t,i,n,s,o),this.minVisibleColumnIndentation=r}}class pg{constructor(e,t){this.lineCount=e,this.columnCount=t}toString(){return`${this.lineCount},${this.columnCount}`}}pg.zero=new pg(0,0);const mg=0;function fg(e){return 0===e}const _g=Math.pow(2,26);function vg(e,t){return e*_g+t}function bg(e){const t=e,i=Math.floor(t/_g);return new pg(i,t-i*_g)}function Cg(e,t){let i=e+t;return t>=_g&&(i-=e%_g),i}function wg(e,t){return e.reduce(((e,i)=>Cg(e,t(i))),mg)}function yg(e,t){return e===t}function Sg(e,t){const i=e,n=t;if(n-i<=0)return mg;const s=Math.floor(i/_g),o=Math.floor(n/_g),r=n-o*_g;if(s===o){return vg(0,r-(i-s*_g))}return vg(o-s,r)}function Lg(e,t){return e=t}function xg(e){return vg(e.lineNumber-1,e.column-1)}function Ng(e,t){const i=e,n=Math.floor(i/_g),s=i-n*_g,o=t,r=Math.floor(o/_g);return new Rh(n+1,s+1,r+1,o-r*_g+1)}class Eg{static fromModelContentChanges(e){const t=e.map((e=>{const t=Rh.lift(e.range);return new Eg(xg(t.getStartPosition()),xg(t.getEndPosition()),function(e){const t=oo(e);return vg(t.length-1,t[t.length-1].length)}(e.text))})).reverse();return t}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${bg(this.startOffset)}...${bg(this.endOffset)}) -> ${bg(this.newLength)}`}}class Ig{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map((e=>Mg.from(e)))}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 null===i?null:Sg(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?vg(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):vg(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=bg(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?vg(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):vg(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx>5;if(0===n){const e=1<e};class Og{constructor(){this.items=new Map}getKey(e){let t=this.items.get(e);return void 0===t&&(t=this.items.size,this.items.set(e,t)),t}}class Pg{get length(){return this._length}constructor(e){this._length=e}}class Fg extends Pg{static create(e,t,i){let n=e.length;return t&&(n=Cg(n,t.length)),i&&(n=Cg(n,i.length)),new Fg(n,e,t,i,t?t.missingOpeningBracketIds:Rg.getEmpty())}get kind(){return 2}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,s){super(e),this.openingBracket=t,this.child=i,this.closingBracket=n,this.missingOpeningBracketIds=s}canBeReused(e){return null!==this.closingBracket&&!e.intersects(this.missingOpeningBracketIds)}deepClone(){return new Fg(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(Cg(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class Bg extends Pg{static create23(e,t,i,n=!1){let s=e.length,o=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(s=Cg(s,t.length),o=o.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");s=Cg(s,i.length),o=o.merge(i.missingOpeningBracketIds)}return n?new Vg(s,e.listHeight+1,e,t,i,o):new Wg(s,e.listHeight+1,e,t,i,o)}static getEmpty(){return new zg(mg,0,[],Rg.getEmpty())}get kind(){return 4}get missingOpeningBracketIds(){return this._missingOpeningBracketIds}constructor(e,t,i){super(e),this.listHeight=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}throwIfImmutable(){}makeLastElementMutable(){this.throwIfImmutable();const e=this.childrenLength;if(0===e)return;const t=this.getChild(e-1),i=4===t.kind?t.toMutable():t;return t!==i&&this.setChild(e-1,i),i}makeFirstElementMutable(){this.throwIfImmutable();if(0===this.childrenLength)return;const e=this.getChild(0),t=4===e.kind?e.toMutable():e;return e!==t&&this.setChild(0,t),t}canBeReused(e){if(e.intersects(this.missingOpeningBracketIds))return!1;if(0===this.childrenLength)return!1;let t=this;for(;4===t.kind;){const e=t.childrenLength;if(0===e)throw new f;t=t.getChild(e-1)}return t.canBeReused(e)}handleChildrenChanged(){this.throwIfImmutable();const e=this.childrenLength;let t=this.getChild(0).length,i=this.getChild(0).missingOpeningBracketIds;for(let n=1;n>>0}static getTokenType(e){return(768&e)>>>8}static containsBalancedBrackets(e){return!!(1024&e)}static getFontStyle(e){return(30720&e)>>>11}static getForeground(e){return(16744448&e)>>>15}static getBackground(e){return(4278190080&e)>>>24}static getClassNameFromMetadata(e){let t="mtk"+this.getForeground(e);const i=this.getFontStyle(e);return 1&i&&(t+=" mtki"),2&i&&(t+=" mtkb"),4&i&&(t+=" mtku"),8&i&&(t+=" mtks"),t}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),n=this.getFontStyle(e);let s=`color: ${t[i]};`;1&n&&(s+="font-style: italic;"),2&n&&(s+="font-weight: bold;");let o="";return 4&n&&(o+=" underline"),8&n&&(o+=" line-through"),o&&(s+=`text-decoration:${o};`),s}static getPresentationFromMetadata(e){const t=this.getForeground(e),i=this.getFontStyle(e);return{foreground:t,italic:Boolean(1&i),bold:Boolean(2&i),underline:Boolean(4&i),strikethrough:Boolean(8&i)}}}class Zg{constructor(e,t,i,n,s){this.length=e,this.kind=t,this.bracketId=i,this.bracketIds=n,this.astNode=s}}class Yg{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.reader=new Xg(this.textModel,this.bracketTokens),this._offset=mg,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return vg(this.textBufferLineCount-1,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=Cg(this._offset,e);const t=bg(this._offset);this.reader.setPosition(t.lineCount,t.columnCount)}read(){let e;return this.peeked?(this.didPeek=!1,e=this.peeked):e=this.reader.read(),e&&(this._offset=Cg(this._offset,e.length)),e}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}}class Xg{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.lineIdx=0,this.line=null,this.lineCharOffset=0,this.lineTokens=null,this.lineTokenOffset=0,this.peekedToken=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}setPosition(e,t){e===this.lineIdx?(this.lineCharOffset=t,null!==this.line&&(this.lineTokenOffset=0===this.lineCharOffset?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset))):(this.lineIdx=e,this.lineCharOffset=t,this.line=null),this.peekedToken=null}read(){if(this.peekedToken){const e=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=e.length,e}if(this.lineIdx>this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;null===this.line&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=0===this.lineCharOffset?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const n=this.lineTokens,s=n.getCount();let o=null;if(this.lineTokenOffset1e3)break}if(i>1500)break}const n=(s=e,o=t,r=this.lineIdx,a=this.lineCharOffset,s!==r?vg(r-s,a):vg(0,a-o));var s,o,r,a;return new Zg(n,0,-1,Rg.getEmpty(),new jg(n))}}class Qg{constructor(e,t){this.text=e,this._offset=mg,this.idx=0;const i=t.getRegExpStr(),n=i?new RegExp(i+"|\n","gi"):null,s=[];let o,r=0,a=0,l=0,h=0;const d=[];for(let g=0;g<60;g++)d.push(new Zg(vg(0,g),0,-1,Rg.getEmpty(),new jg(vg(0,g))));const c=[];for(let g=0;g<60;g++)c.push(new Zg(vg(1,g),0,-1,Rg.getEmpty(),new jg(vg(1,g))));if(n)for(n.lastIndex=0;null!==(o=n.exec(e));){const e=o.index,i=o[0];if("\n"===i)r++,a=e+1;else{if(l!==e){let t;if(h===r){const i=e-l;if(ifunction(e){let t=eo(e);/^[\w ]+/.test(e)&&(t=`\\b${t}`);/[\w ]+$/.test(e)&&(t=`${t}\\b`);return t}(e))).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(2===i.kind&&i.bracketIds.intersects(e))return t}get isEmpty(){return 0===this.map.size}}class ep{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=Jg.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function tp(e,t=!1){if(0===e.length)return null;if(1===e.length)return e[0];let i=e.length;for(;i>3;){const n=i>>1;for(let s=0;s=3?e[2]:null,t)}function ip(e,t){return Math.abs(e.listHeight-t.listHeight)}function np(e,t){return e.listHeight===t.listHeight?Bg.create23(e,t,null,!1):e.listHeight>t.listHeight?function(e,t){let i=e=e.toMutable();const n=[];let s;for(;;){if(t.listHeight===i.listHeight){s=t;break}if(4!==i.kind)throw new Error("unexpected");n.push(i),i=i.makeLastElementMutable()}for(let o=n.length-1;o>=0;o--){const e=n[o];s?e.childrenLength>=3?s=Bg.create23(e.unappendChild(),s,null,!1):(e.appendChildOfSameHeight(s),s=void 0):e.handleChildrenChanged()}return s?Bg.create23(e,s,null,!1):e}(e,t):function(e,t){let i=e=e.toMutable();const n=[];for(;t.listHeight!==i.listHeight;){if(4!==i.kind)throw new Error("unexpected");n.push(i),i=i.makeFirstElementMutable()}let s=t;for(let o=n.length-1;o>=0;o--){const e=n[o];s?e.childrenLength>=3?s=Bg.create23(s,e.unprependChild(),null,!1):(e.prependChildOfSameHeight(s),s=void 0):e.handleChildrenChanged()}return s?Bg.create23(s,e,null,!1):e}(t,e)}class sp{constructor(e){this.lastOffset=mg,this.nextNodes=[e],this.offsets=[mg],this.idxs=[]}readLongestNodeAt(e,t){if(Lg(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=rp(this.nextNodes);if(!i)return;const n=rp(this.offsets);if(Lg(e,n))return;if(Lg(n,e))if(Cg(n,i.length)<=e)this.nextNodeAfterCurrent();else{const e=op(i);-1!==e?(this.nextNodes.push(i.getChild(e)),this.offsets.push(n),this.idxs.push(e)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const e=op(i);if(-1===e)return void this.nextNodeAfterCurrent();this.nextNodes.push(i.getChild(e)),this.offsets.push(n),this.idxs.push(e)}}}}nextNodeAfterCurrent(){for(;;){const e=rp(this.offsets),t=rp(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),0===this.idxs.length)break;const i=rp(this.nextNodes),n=op(i,this.idxs[this.idxs.length-1]);if(-1!==n){this.nextNodes.push(i.getChild(n)),this.offsets.push(Cg(e,t.length)),this.idxs[this.idxs.length-1]=n;break}this.idxs.pop()}}}function op(e,t=-1){for(;;){if(++t>=e.childrenLength)return-1;if(e.getChild(t))return t}}function rp(e){return e.length>0?e[e.length-1]:void 0}function ap(e,t,i,n){return new lp(e,t,i,n).parseDocument()}class lp{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 sp(i):void 0,this.positionMapper=new Ig(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(Rg.getEmpty(),0);return e||(e=Bg.getEmpty()),e}parseList(e,t){const i=[];for(;;){let n=this.tryReadChildFromCache(e);if(!n){const i=this.tokenizer.peek();if(!i||2===i.kind&&i.bracketIds.intersects(e))break;n=this.parseChild(e,t+1)}4===n.kind&&0===n.childrenLength||i.push(n)}const n=this.oldNodeReader?function(e){if(0===e.length)return null;if(1===e.length)return e[0];let t=0;function i(){if(t>=e.length)return null;const i=t,n=e[i].listHeight;for(t++;t=2?tp(0===i&&t===e.length?e:e.slice(i,t),!1):e[i]}let n=i(),s=i();if(!s)return n;for(let o=i();o;o=i())ip(n,s)<=ip(s,o)?(n=np(n,s),s=o):s=np(s,o);return np(n,s)}(i):tp(i,this.createImmutableLists);return n}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(null===t||!fg(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),(i=>{if(null!==t&&!Lg(i.length,t))return!1;return i.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 2:return new $g(i.bracketIds,i.length);case 0:return i.astNode;case 1:{if(t>300)return new jg(i.length);const n=e.merge(i.bracketIds),s=this.parseList(n,t+1),o=this.tokenizer.peek();return o&&2===o.kind&&(o.bracketId===i.bracketId||o.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),Fg.create(i.astNode,s,o.astNode)):Fg.create(i.astNode,s,null)}default:throw new Error("unexpected")}}}function hp(e,t){if(0===e.length)return t;if(0===t.length)return e;const i=new ic(cp(e)),n=cp(t);n.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let s=i.dequeue();function o(e){if(void 0===e){const e=i.takeWhile((e=>!0))||[];return s&&e.unshift(s),e}const t=[];for(;s&&!fg(e);){const[n,o]=s.splitAt(e);t.push(n),e=Sg(n.lengthAfter,e),s=null!=o?o:i.dequeue()}return fg(e)||t.push(new dp(!1,e,e)),t}const r=[];function a(e,t,i){if(r.length>0&&yg(r[r.length-1].endOffset,e)){const e=r[r.length-1];r[r.length-1]=new Eg(e.startOffset,t,Cg(e.newLength,i))}else r.push({startOffset:e,endOffset:t,newLength:i})}let l=mg;for(const h of n){const e=o(h.lengthBefore);if(h.modified){const t=Cg(l,wg(e,(e=>e.lengthBefore)));a(l,t,h.lengthAfter),l=t}else for(const t of e){const e=l;l=Cg(l,t.lengthBefore),t.modified&&a(e,l,t.lengthAfter)}}return r}class dp{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=Sg(e,this.lengthAfter);return yg(t,mg)?[this,void 0]:this.modified?[new dp(this.modified,this.lengthBefore,e),new dp(this.modified,mg,t)]:[new dp(this.modified,e,e),new dp(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${bg(this.lengthBefore)} -> ${bg(this.lengthAfter)}`}}function cp(e){const t=[];let i=mg;for(const n of e){const e=Sg(i,n.startOffset);fg(e)||t.push(new dp(!1,e,e));const s=Sg(n.startOffset,n.endOffset);t.push(new dp(!0,s,n.newLength)),i=n.endOffset}return t}class up extends E{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new U,this.denseKeyProvider=new Og,this.brackets=new ep(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)2===e.tokenization.backgroundTokenizationState?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const e=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),t=new Qg(this.textModel.getValue(),e);this.initialAstWithoutTokens=ap(t,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(2===this.textModel.tokenization.backgroundTokenizationState){const e=void 0===this.initialAstWithoutTokens;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map((e=>new Eg(vg(e.fromLineNumber-1,0),vg(e.toLineNumber,0),vg(e.toLineNumber-e.fromLineNumber+1,0))));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=Eg.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=hp(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=hp(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;return ap(new Yg(this.textModel,this.brackets),e,n,i)}getBracketsInRange(e,t){this.flushQueue();const i=vg(e.startLineNumber-1,e.startColumn-1),n=vg(e.endLineNumber-1,e.endColumn-1);return new nc((e=>{const s=this.initialAstWithoutTokens||this.astWithTokens;mp(s,mg,s.length,i,n,e,0,0,new Map,t)}))}getBracketPairsInRange(e,t){this.flushQueue();const i=xg(e.getStartPosition()),n=xg(e.getEndPosition());return new nc((e=>{const s=this.initialAstWithoutTokens||this.astWithTokens,o=new fp(e,t,this.textModel);_p(s,mg,s.length,i,n,o,0,new Map)}))}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return pp(t,mg,t.length,xg(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return gp(t,mg,t.length,xg(e))}}function gp(e,t,i,n){if(4===e.kind||2===e.kind){const s=[];for(const n of e.children)i=Cg(t,n.length),s.push({nodeOffsetStart:t,nodeOffsetEnd:i}),t=i;for(let t=s.length-1;t>=0;t--){const{nodeOffsetStart:i,nodeOffsetEnd:o}=s[t];if(Lg(i,n)){const s=gp(e.children[t],i,o,n);if(s)return s}}return null}if(3===e.kind)return null;if(1===e.kind){const n=Ng(t,i);return{bracketInfo:e.bracketInfo,range:n}}return null}function pp(e,t,i,n){if(4===e.kind||2===e.kind){for(const s of e.children){if(Lg(n,i=Cg(t,s.length))){const e=pp(s,t,i,n);if(e)return e}t=i}return null}if(3===e.kind)return null;if(1===e.kind){const n=Ng(t,i);return{bracketInfo:e.bracketInfo,range:n}}return null}function mp(e,t,i,n,s,o,r,a,l,h,d=!1){if(r>200)return!0;e:for(;;)switch(e.kind){case 4:{const a=e.childrenLength;for(let d=0;d200)return!0;let h=!0;if(2===e.kind){let d=0;if(a){let t=a.get(e.openingBracket.text);void 0===t&&(t=0),d=t,t++,a.set(e.openingBracket.text,t)}const c=Cg(t,e.openingBracket.length);let u=-1;if(o.includeMinIndentation&&(u=e.computeMinIndentation(t,o.textModel)),h=o.push(new gg(Ng(t,i),Ng(t,c),e.closingBracket?Ng(Cg(c,(null===(l=e.child)||void 0===l?void 0:l.length)||mg),i):void 0,r,d,e,u)),t=c,h&&e.child){const l=e.child;if(i=Cg(t,l.length),kg(t,s)&&Dg(i,n)&&(h=_p(l,t,i,n,s,o,r+1,a),!h))return!1}null==a||a.set(e.openingBracket.text,d)}else{let i=t;for(const t of e.children){const e=i;if(i=Cg(i,t.length),kg(e,s)&&kg(n,i)&&(h=_p(t,e,i,n,s,o,r,a),!h))return!1}}return h}class vp extends E{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new I),this.onDidChangeEmitter=new U,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange((e=>{var t;e.languageId&&!(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.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){var t;null===(t=this.bracketPairsTree.value)||void 0===t||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;null===(e=this.bracketPairsTree.value)||void 0===e||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;null===(t=this.bracketPairsTree.value)||void 0===t||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const i=new N;this.bracketPairsTree.value=(e=i.add(new up(this.textModel,(e=>this.languageConfigurationService.getLanguageConfiguration(e)))),t=i,{object:e,dispose:()=>null==t?void 0:t.dispose()}),i.add(this.bracketPairsTree.value.object.onDidChange((e=>this.onDidChangeEmitter.fire(e)))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire());var e,t}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getBracketPairsInRange(e,!1))||nc.empty}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getBracketPairsInRange(e,!0))||nc.empty}getBracketsInRange(e,t=!1){var i;return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(i=this.bracketPairsTree.value)||void 0===i?void 0:i.object.getBracketsInRange(e,t))||nc.empty}findMatchingBracketUp(e,t,i){const n=this.textModel.validatePosition(t),s=this.textModel.getLanguageIdAtPosition(n.lineNumber,n.column);if(this.canBuildAST){const i=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew.getClosingBracketInfo(e);if(!i)return null;const n=this.getBracketPairsInRange(Rh.fromPositions(t,t)).findLast((e=>i.closes(e.openingBracketInfo)));return n?n.openingBracketRange:null}{const t=e.toLowerCase(),o=this.languageConfigurationService.getLanguageConfiguration(s).brackets;if(!o)return null;const r=o.textIsBracket[t];return r?wp(this._findMatchingBracketUp(r,n,bp(i))):null}}matchBracket(e,t){if(this.canBuildAST){const t=this.getBracketPairsInRange(Rh.fromPositions(e,e)).filter((t=>void 0!==t.closingBracketRange&&(t.openingBracketRange.containsPosition(e)||t.closingBracketRange.containsPosition(e)))).findLastMaxBy(Qd((t=>t.openingBracketRange.containsPosition(e)?t.openingBracketRange:t.closingBracketRange),Rh.compareRangesUsingStarts));return t?[t.openingBracketRange,t.closingBracketRange]:null}{const i=bp(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,n){const s=t.getCount(),o=t.getLanguageId(n);let r=Math.max(0,e.column-1-i.maxBracketLength);for(let l=n-1;l>=0;l--){const e=t.getEndOffset(l);if(e<=r)break;if(Fc(t.getStandardTokenType(l))||t.getLanguageId(l)!==o){r=e;break}}let a=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let l=n+1;l=a)break;if(Fc(t.getStandardTokenType(l))||t.getLanguageId(l)!==o){a=e;break}}return{searchStartOffset:r,searchEndOffset:a}}_matchBracket(e,t){const i=e.lineNumber,n=this.textModel.tokenization.getLineTokens(i),s=this.textModel.getLineContent(i),o=n.findTokenIndexAtOffset(e.column-1);if(o<0)return null;const r=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(o)).brackets;if(r&&!Fc(n.getStandardTokenType(o))){let{searchStartOffset:a,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,r,o),h=null;for(;;){const n=hu.findNextBracketInRange(r.forwardRegex,i,s,a,l);if(!n)break;if(n.startColumn<=e.column&&e.column<=n.endColumn){const e=s.substring(n.startColumn-1,n.endColumn-1).toLowerCase(),i=this._matchFoundBracket(n,r.textIsBracket[e],r.textIsOpenBracket[e],t);if(i){if(i instanceof Cp)return null;h=i}}a=n.endColumn-1}if(h)return h}if(o>0&&n.getStartOffset(o)===e.column-1){const r=o-1,a=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(r)).brackets;if(a&&!Fc(n.getStandardTokenType(r))){const{searchStartOffset:o,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,a,r),h=hu.findPrevBracketInRange(a.reversedRegex,i,s,o,l);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){const e=s.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),i=this._matchFoundBracket(h,a.textIsBracket[e],a.textIsOpenBracket[e],t);if(i)return i instanceof Cp?null:i}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;const s=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return s?s instanceof Cp?s:[e,s]:null}_findMatchingBracketUp(e,t,i){const n=e.languageId,s=e.reversedRegex;let o=-1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return Cp.INSTANCE;const h=hu.findPrevBracketInRange(s,t,n,a,l);if(!h)break;const d=n.substring(h.startColumn-1,h.endColumn-1).toLowerCase();if(e.isOpen(d)?o++:e.isClose(d)&&o--,0===o)return h;l=h.startColumn-1}return null};for(let l=t.lineNumber;l>=1;l--){const e=this.textModel.tokenization.getLineTokens(l),i=e.getCount(),s=this.textModel.getLineContent(l);let o=i-1,r=s.length,h=s.length;l===t.lineNumber&&(o=e.findTokenIndexAtOffset(t.column-1),r=t.column-1,h=t.column-1);let d=!0;for(;o>=0;o--){const t=e.getLanguageId(o)===n&&!Fc(e.getStandardTokenType(o));if(t)d?r=e.getStartOffset(o):(r=e.getStartOffset(o),h=e.getEndOffset(o));else if(d&&r!==h){const e=a(l,s,r,h);if(e)return e}d=t}if(d&&r!==h){const e=a(l,s,r,h);if(e)return e}}return null}_findMatchingBracketDown(e,t,i){const n=e.languageId,s=e.forwardRegex;let o=1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return Cp.INSTANCE;const h=hu.findNextBracketInRange(s,t,n,a,l);if(!h)break;const d=n.substring(h.startColumn-1,h.endColumn-1).toLowerCase();if(e.isOpen(d)?o++:e.isClose(d)&&o--,0===o)return h;a=h.endColumn-1}return null},l=this.textModel.getLineCount();for(let h=t.lineNumber;h<=l;h++){const e=this.textModel.tokenization.getLineTokens(h),i=e.getCount(),s=this.textModel.getLineContent(h);let o=0,r=0,l=0;h===t.lineNumber&&(o=e.findTokenIndexAtOffset(t.column-1),r=t.column-1,l=t.column-1);let d=!0;for(;o=1;r--){const e=this.textModel.tokenization.getLineTokens(r),t=e.getCount(),a=this.textModel.getLineContent(r);let l=t-1,h=a.length,d=a.length;if(r===i.lineNumber){l=e.findTokenIndexAtOffset(i.column-1),h=i.column-1,d=i.column-1;const t=e.getLanguageId(l);n!==t&&(n=t,s=this.languageConfigurationService.getLanguageConfiguration(n).brackets,o=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew)}let c=!0;for(;l>=0;l--){const t=e.getLanguageId(l);if(n!==t){if(s&&o&&c&&h!==d){const e=hu.findPrevBracketInRange(s.reversedRegex,r,a,h,d);if(e)return this._toFoundBracket(o,e);c=!1}n=t,s=this.languageConfigurationService.getLanguageConfiguration(n).brackets,o=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew}const i=!!s&&!Fc(e.getStandardTokenType(l));if(i)c?h=e.getStartOffset(l):(h=e.getStartOffset(l),d=e.getEndOffset(l));else if(o&&s&&c&&h!==d){const e=hu.findPrevBracketInRange(s.reversedRegex,r,a,h,d);if(e)return this._toFoundBracket(o,e)}c=i}if(o&&s&&c&&h!==d){const e=hu.findPrevBracketInRange(s.reversedRegex,r,a,h,d);if(e)return this._toFoundBracket(o,e)}}return null}findNextBracket(e){var t;const i=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getFirstBracketAfter(i))||null;const n=this.textModel.getLineCount();let s=null,o=null,r=null;for(let a=i.lineNumber;a<=n;a++){const e=this.textModel.tokenization.getLineTokens(a),t=e.getCount(),n=this.textModel.getLineContent(a);let l=0,h=0,d=0;if(a===i.lineNumber){l=e.findTokenIndexAtOffset(i.column-1),h=i.column-1,d=i.column-1;const t=e.getLanguageId(l);s!==t&&(s=t,o=this.languageConfigurationService.getLanguageConfiguration(s).brackets,r=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew)}let c=!0;for(;lvoid 0!==t.closingBracketRange&&t.range.strictContainsRange(e)));return t?[t.openingBracketRange,t.closingBracketRange]:null}const n=bp(t),s=this.textModel.getLineCount(),o=new Map;let r=[];const a=(e,t)=>{if(!o.has(e)){const i=[];for(let e=0,n=t?t.brackets.length:0;e{for(;;){if(n&&++l%100==0&&!n())return Cp.INSTANCE;const a=hu.findNextBracketInRange(e.forwardRegex,t,i,s,o);if(!a)break;const h=i.substring(a.startColumn-1,a.endColumn-1).toLowerCase(),d=e.textIsBracket[h];if(d&&(d.isOpen(h)?r[d.index]++:d.isClose(h)&&r[d.index]--,-1===r[d.index]))return this._matchFoundBracket(a,d,!1,n);s=a.endColumn-1}return null};let d=null,c=null;for(let u=i.lineNumber;u<=s;u++){const e=this.textModel.tokenization.getLineTokens(u),t=e.getCount(),n=this.textModel.getLineContent(u);let s=0,o=0,r=0;if(u===i.lineNumber){s=e.findTokenIndexAtOffset(i.column-1),o=i.column-1,r=i.column-1;const t=e.getLanguageId(s);d!==t&&(d=t,c=this.languageConfigurationService.getLanguageConfiguration(d).brackets,a(d,c))}let l=!0;for(;s!0;{const t=Date.now();return()=>Date.now()-t<=e}}class Cp{constructor(){this._searchCanceledBrand=void 0}}function wp(e){return e instanceof Cp?null:e}function yp(e){return`--vscode-${e.replace(/\./g,"-")}`}function Sp(e){return`var(${yp(e)})`}Cp.INSTANCE=new Cp;const Lp="base.contributions.colors";const kp=new class{constructor(){this._onDidChangeSchema=new U,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,n=!1,s){const o={id:e,description:i,defaults:t,needsTransparency:n,deprecationMessage:s};this.colorsById[e]=o;const r={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return s&&(r.deprecationMessage=s),this.colorSchema.properties[e]=r,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map((e=>this.colorsById[e]))}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i&&i.defaults){return E_(i.defaults[t.type],t)}}getColorSchema(){return this.colorSchema}toString(){return Object.keys(this.colorsById).sort(((e,t)=>{const i=-1===e.indexOf(".")?0:1,n=-1===t.indexOf(".")?0:1;return i!==n?i-n:e.localeCompare(t)})).map((e=>`- \`${e}\`: ${this.colorsById[e].description}`)).join("\n")}};function Dp(e,t,i,n,s){return kp.registerColor(e,t,i,n,s)}jl.add(Lp,kp);const xp=Dp("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},ue(0,"Overall foreground color. This color is only used if not overridden by a component.")),Np=(Dp("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},ue(0,"Overall foreground for disabled elements. This color is only used if not overridden by a component.")),Dp("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},ue(0,"Overall foreground color for error messages. This color is only used if not overridden by a component."))),Ep=(Dp("descriptionForeground",{light:"#717171",dark:D_(xp,.7),hcDark:D_(xp,.7),hcLight:D_(xp,.7)},ue(0,"Foreground color for description text providing additional information, for example for a label.")),Dp("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},ue(0,"The default color for icons in the workbench."))),Ip=Dp("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},ue(0,"Overall border color for focused elements. This color is only used if not overridden by a component.")),Mp=Dp("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},ue(0,"An extra border around elements to separate them from others for greater contrast.")),Tp=Dp("contrastActiveBorder",{light:null,dark:null,hcDark:Ip,hcLight:Ip},ue(0,"An extra border around active elements to separate them from others for greater contrast.")),Rp=(Dp("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},ue(0,"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.")),Dp("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:lc.black,hcLight:"#292929"},ue(0,"Color for text separators.")),Dp("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},ue(0,"Foreground color for links in text."))),Ap=(Dp("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},ue(0,"Foreground color for links in text when clicked on and on mouse hover.")),Dp("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#D7BA7D",hcLight:"#292929"},ue(0,"Foreground color for preformatted text segments.")),Dp("textBlockQuote.background",{light:"#7f7f7f1a",dark:"#7f7f7f1a",hcDark:null,hcLight:"#F2F2F2"},ue(0,"Background color for block quotes in text.")),Dp("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:lc.white,hcLight:"#292929"},ue(0,"Border color for block quotes in text.")),Dp("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:lc.black,hcLight:"#F2F2F2"},ue(0,"Background color for code blocks in text.")),Dp("widget.shadow",{dark:D_(lc.black,.36),light:D_(lc.black,.16),hcDark:null,hcLight:null},ue(0,"Shadow color of widgets such as find/replace inside the editor."))),Op=Dp("widget.border",{dark:null,light:null,hcDark:Mp,hcLight:Mp},ue(0,"Border color of widgets such as find/replace inside the editor.")),Pp=Dp("input.background",{dark:"#3C3C3C",light:lc.white,hcDark:lc.black,hcLight:lc.white},ue(0,"Input box background.")),Fp=Dp("input.foreground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"Input box foreground.")),Bp=Dp("input.border",{dark:null,light:null,hcDark:Mp,hcLight:Mp},ue(0,"Input box border.")),Wp=Dp("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:Mp,hcLight:Mp},ue(0,"Border color of activated options in input fields.")),Vp=(Dp("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},ue(0,"Background color of activated options in input fields.")),Dp("inputOption.activeBackground",{dark:D_(Ip,.4),light:D_(Ip,.2),hcDark:lc.transparent,hcLight:lc.transparent},ue(0,"Background hover color of options in input fields."))),Hp=Dp("inputOption.activeForeground",{dark:lc.white,light:lc.black,hcDark:xp,hcLight:xp},ue(0,"Foreground color of activated options in input fields.")),zp=(Dp("input.placeholderForeground",{light:D_(xp,.5),dark:D_(xp,.5),hcDark:D_(xp,.7),hcLight:D_(xp,.7)},ue(0,"Input box foreground color for placeholder text.")),Dp("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:lc.black,hcLight:lc.white},ue(0,"Input validation background color for information severity."))),Up=Dp("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:xp},ue(0,"Input validation foreground color for information severity.")),Kp=Dp("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:Mp,hcLight:Mp},ue(0,"Input validation border color for information severity.")),jp=Dp("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:lc.black,hcLight:lc.white},ue(0,"Input validation background color for warning severity.")),qp=Dp("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:xp},ue(0,"Input validation foreground color for warning severity.")),$p=Dp("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:Mp,hcLight:Mp},ue(0,"Input validation border color for warning severity.")),Gp=Dp("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:lc.black,hcLight:lc.white},ue(0,"Input validation background color for error severity.")),Zp=Dp("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:xp},ue(0,"Input validation foreground color for error severity.")),Yp=Dp("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:Mp,hcLight:Mp},ue(0,"Input validation border color for error severity.")),Xp=Dp("dropdown.background",{dark:"#3C3C3C",light:lc.white,hcDark:lc.black,hcLight:lc.white},ue(0,"Dropdown background.")),Qp=Dp("dropdown.listBackground",{dark:null,light:null,hcDark:lc.black,hcLight:lc.white},ue(0,"Dropdown list background.")),Jp=Dp("dropdown.foreground",{dark:"#F0F0F0",light:xp,hcDark:lc.white,hcLight:xp},ue(0,"Dropdown foreground.")),em=Dp("dropdown.border",{dark:Xp,light:"#CECECE",hcDark:Mp,hcLight:Mp},ue(0,"Dropdown border.")),tm=Dp("button.foreground",{dark:lc.white,light:lc.white,hcDark:lc.white,hcLight:lc.white},ue(0,"Button foreground color.")),im=Dp("button.separator",{dark:D_(tm,.4),light:D_(tm,.4),hcDark:D_(tm,.4),hcLight:D_(tm,.4)},ue(0,"Button separator color.")),nm=Dp("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},ue(0,"Button background color.")),sm=Dp("button.hoverBackground",{dark:k_(nm,.2),light:L_(nm,.2),hcDark:nm,hcLight:nm},ue(0,"Button background color when hovering.")),om=Dp("button.border",{dark:Mp,light:Mp,hcDark:Mp,hcLight:Mp},ue(0,"Button border color.")),rm=Dp("button.secondaryForeground",{dark:lc.white,light:lc.white,hcDark:lc.white,hcLight:xp},ue(0,"Secondary button foreground color.")),am=Dp("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:lc.white},ue(0,"Secondary button background color.")),lm=Dp("button.secondaryHoverBackground",{dark:k_(am,.2),light:L_(am,.2),hcDark:null,hcLight:null},ue(0,"Secondary button background color when hovering.")),hm=Dp("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:lc.black,hcLight:"#0F4A85"},ue(0,"Badge background color. Badges are small information labels, e.g. for search results count.")),dm=Dp("badge.foreground",{dark:lc.white,light:"#333",hcDark:lc.white,hcLight:lc.white},ue(0,"Badge foreground color. Badges are small information labels, e.g. for search results count.")),cm=Dp("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},ue(0,"Scrollbar shadow to indicate that the view is scrolled.")),um=Dp("scrollbarSlider.background",{dark:lc.fromHex("#797979").transparent(.4),light:lc.fromHex("#646464").transparent(.4),hcDark:D_(Mp,.6),hcLight:D_(Mp,.4)},ue(0,"Scrollbar slider background color.")),gm=Dp("scrollbarSlider.hoverBackground",{dark:lc.fromHex("#646464").transparent(.7),light:lc.fromHex("#646464").transparent(.7),hcDark:D_(Mp,.8),hcLight:D_(Mp,.8)},ue(0,"Scrollbar slider background color when hovering.")),pm=Dp("scrollbarSlider.activeBackground",{dark:lc.fromHex("#BFBFBF").transparent(.4),light:lc.fromHex("#000000").transparent(.6),hcDark:Mp,hcLight:Mp},ue(0,"Scrollbar slider background color when clicked on.")),mm=Dp("progressBar.background",{dark:lc.fromHex("#0E70C0"),light:lc.fromHex("#0E70C0"),hcDark:Mp,hcLight:Mp},ue(0,"Background color of the progress bar that can show for long running operations.")),fm=(Dp("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Dp("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},ue(0,"Foreground color of error squigglies in the editor."))),_m=Dp("editorError.border",{dark:null,light:null,hcDark:lc.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},ue(0,"If set, color of double underlines for errors in the editor.")),vm=(Dp("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Dp("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},ue(0,"Foreground color of warning squigglies in the editor."))),bm=Dp("editorWarning.border",{dark:null,light:null,hcDark:lc.fromHex("#FFCC00").transparent(.8),hcLight:lc.fromHex("#FFCC00").transparent(.8)},ue(0,"If set, color of double underlines for warnings in the editor.")),Cm=(Dp("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Dp("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},ue(0,"Foreground color of info squigglies in the editor."))),wm=Dp("editorInfo.border",{dark:null,light:null,hcDark:lc.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},ue(0,"If set, color of double underlines for infos in the editor.")),ym=Dp("editorHint.foreground",{dark:lc.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},ue(0,"Foreground color of hint squigglies in the editor.")),Sm=(Dp("editorHint.border",{dark:null,light:null,hcDark:lc.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},ue(0,"If set, color of double underlines for hints in the editor.")),Dp("sash.hoverBorder",{dark:Ip,light:Ip,hcDark:Ip,hcLight:Ip},ue(0,"Border color of active sashes.")),Dp("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:lc.black,hcLight:lc.white},ue(0,"Editor background color."))),Lm=Dp("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:lc.white,hcLight:xp},ue(0,"Editor default foreground color.")),km=(Dp("editorStickyScroll.background",{light:Sm,dark:Sm,hcDark:Sm,hcLight:Sm},ue(0,"Sticky scroll background color for the editor")),Dp("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:lc.fromHex("#0F4A85").transparent(.1)},ue(0,"Sticky scroll on hover background color for the editor")),Dp("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:lc.white},ue(0,"Background color of editor widgets, such as find/replace."))),Dm=Dp("editorWidget.foreground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"Foreground color of editor widgets, such as find/replace.")),xm=Dp("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:Mp,hcLight:Mp},ue(0,"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.")),Nm=Dp("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},ue(0,"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.")),Em=Dp("quickInput.background",{dark:km,light:km,hcDark:km,hcLight:km},ue(0,"Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),Im=Dp("quickInput.foreground",{dark:Dm,light:Dm,hcDark:Dm,hcLight:Dm},ue(0,"Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),Mm=Dp("quickInputTitle.background",{dark:new lc(new oc(255,255,255,.105)),light:new lc(new oc(0,0,0,.06)),hcDark:"#000000",hcLight:lc.white},ue(0,"Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),Tm=Dp("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:lc.white,hcLight:"#0F4A85"},ue(0,"Quick picker color for grouping labels.")),Rm=Dp("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:lc.white,hcLight:"#0F4A85"},ue(0,"Quick picker color for grouping borders.")),Am=Dp("keybindingLabel.background",{dark:new lc(new oc(128,128,128,.17)),light:new lc(new oc(221,221,221,.4)),hcDark:lc.transparent,hcLight:lc.transparent},ue(0,"Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),Om=Dp("keybindingLabel.foreground",{dark:lc.fromHex("#CCCCCC"),light:lc.fromHex("#555555"),hcDark:lc.white,hcLight:xp},ue(0,"Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),Pm=Dp("keybindingLabel.border",{dark:new lc(new oc(51,51,51,.6)),light:new lc(new oc(204,204,204,.4)),hcDark:new lc(new oc(111,195,223)),hcLight:Mp},ue(0,"Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),Fm=Dp("keybindingLabel.bottomBorder",{dark:new lc(new oc(68,68,68,.6)),light:new lc(new oc(187,187,187,.4)),hcDark:new lc(new oc(111,195,223)),hcLight:xp},ue(0,"Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),Bm=Dp("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},ue(0,"Color of the editor selection.")),Wm=Dp("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:lc.white},ue(0,"Color of the selected text for high contrast.")),Vm=Dp("editor.inactiveSelectionBackground",{light:D_(Bm,.5),dark:D_(Bm,.5),hcDark:D_(Bm,.7),hcLight:D_(Bm,.5)},ue(0,"Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),Hm=Dp("editor.selectionHighlightBackground",{light:N_(Bm,Sm,.3,.6),dark:N_(Bm,Sm,.3,.6),hcDark:null,hcLight:null},ue(0,"Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0),zm=(Dp("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:Tp,hcLight:Tp},ue(0,"Border color for regions with the same content as the selection.")),Dp("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},ue(0,"Color of the current search match."))),Um=Dp("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},ue(0,"Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),Km=Dp("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},ue(0,"Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),jm=Dp("editor.findMatchBorder",{light:null,dark:null,hcDark:Tp,hcLight:Tp},ue(0,"Border color of the current search match.")),qm=Dp("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:Tp,hcLight:Tp},ue(0,"Border color of the other search matches.")),$m=Dp("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:D_(Tp,.4),hcLight:D_(Tp,.4)},ue(0,"Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),Gm=(Dp("searchEditor.findMatchBackground",{light:D_(Um,.66),dark:D_(Um,.66),hcDark:Um,hcLight:Um},ue(0,"Color of the Search Editor query matches.")),Dp("searchEditor.findMatchBorder",{light:D_(qm,.66),dark:D_(qm,.66),hcDark:qm,hcLight:qm},ue(0,"Border color of the Search Editor query matches.")),Dp("search.resultsInfoForeground",{light:xp,dark:D_(xp,.65),hcDark:xp,hcLight:xp},ue(0,"Color of the text in the search viewlet's completion message.")),Dp("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},ue(0,"Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0),Dp("editorHoverWidget.background",{light:km,dark:km,hcDark:km,hcLight:km},ue(0,"Background color of the editor hover."))),Zm=(Dp("editorHoverWidget.foreground",{light:Dm,dark:Dm,hcDark:Dm,hcLight:Dm},ue(0,"Foreground color of the editor hover.")),Dp("editorHoverWidget.border",{light:xm,dark:xm,hcDark:xm,hcLight:xm},ue(0,"Border color of the editor hover."))),Ym=(Dp("editorHoverWidget.statusBarBackground",{dark:k_(Gm,.2),light:L_(Gm,.05),hcDark:km,hcLight:km},ue(0,"Background color of the editor hover status bar.")),Dp("editorLink.activeForeground",{dark:"#4E94CE",light:lc.blue,hcDark:lc.cyan,hcLight:"#292929"},ue(0,"Color of active links."))),Xm=Dp("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:lc.white,hcLight:lc.black},ue(0,"Foreground color of inline hints")),Qm=Dp("editorInlayHint.background",{dark:D_(hm,.1),light:D_(hm,.1),hcDark:D_(lc.white,.1),hcLight:D_(hm,.1)},ue(0,"Background color of inline hints")),Jm=Dp("editorInlayHint.typeForeground",{dark:Xm,light:Xm,hcDark:Xm,hcLight:Xm},ue(0,"Foreground color of inline hints for types")),ef=Dp("editorInlayHint.typeBackground",{dark:Qm,light:Qm,hcDark:Qm,hcLight:Qm},ue(0,"Background color of inline hints for types")),tf=Dp("editorInlayHint.parameterForeground",{dark:Xm,light:Xm,hcDark:Xm,hcLight:Xm},ue(0,"Foreground color of inline hints for parameters")),nf=Dp("editorInlayHint.parameterBackground",{dark:Qm,light:Qm,hcDark:Qm,hcLight:Qm},ue(0,"Background color of inline hints for parameters")),sf=(Dp("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},ue(0,"The color used for the lightbulb actions icon.")),Dp("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},ue(0,"The color used for the lightbulb auto fix actions icon.")),new lc(new oc(155,185,85,.2))),of=new lc(new oc(255,0,0,.2)),rf=Dp("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},ue(0,"Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),af=Dp("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},ue(0,"Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),lf=(Dp("diffEditor.insertedLineBackground",{dark:sf,light:sf,hcDark:null,hcLight:null},ue(0,"Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),Dp("diffEditor.removedLineBackground",{dark:of,light:of,hcDark:null,hcLight:null},ue(0,"Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),Dp("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Background color for the margin where lines got inserted.")),Dp("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Background color for the margin where lines got removed.")),Dp("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Diff overview ruler foreground for inserted content."))),hf=Dp("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Diff overview ruler foreground for removed content.")),df=(Dp("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},ue(0,"Outline color for the text that got inserted.")),Dp("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},ue(0,"Outline color for text that got removed.")),Dp("diffEditor.border",{dark:null,light:null,hcDark:Mp,hcLight:Mp},ue(0,"Border color between the two text editors.")),Dp("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},ue(0,"Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views.")),Dp("diffEditor.unchangedRegionBackground",{dark:"#3e3e3e",light:"#e4e4e4",hcDark:null,hcLight:null},ue(0,"The background color of unchanged blocks in the diff editor.")),Dp("diffEditor.unchangedRegionForeground",{dark:"#a3a2a2",light:"#4d4c4c",hcDark:null,hcLight:null},ue(0,"The foreground color of unchanged blocks in the diff editor.")),Dp("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},ue(0,"The background color of unchanged code in the diff editor.")),Dp("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not."))),cf=Dp("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"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.")),uf=Dp("list.focusOutline",{dark:Ip,light:Ip,hcDark:Tp,hcLight:Tp},ue(0,"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.")),gf=Dp("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"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.")),pf=Dp("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:lc.fromHex("#0F4A85").transparent(.1)},ue(0,"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.")),mf=Dp("list.activeSelectionForeground",{dark:lc.white,light:lc.white,hcDark:null,hcLight:null},ue(0,"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.")),ff=Dp("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"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.")),_f=Dp("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:lc.fromHex("#0F4A85").transparent(.1)},ue(0,"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.")),vf=Dp("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"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.")),bf=Dp("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"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.")),Cf=Dp("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"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.")),wf=Dp("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"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.")),yf=Dp("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:lc.white.transparent(.1),hcLight:lc.fromHex("#0F4A85").transparent(.1)},ue(0,"List/Tree background when hovering over items using the mouse.")),Sf=Dp("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"List/Tree foreground when hovering over items using the mouse.")),Lf=Dp("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},ue(0,"List/Tree drag and drop background when moving items around using the mouse.")),kf=Dp("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Ip,hcLight:Ip},ue(0,"List/Tree foreground color of the match highlights when searching inside the list/tree.")),Df=Dp("list.focusHighlightForeground",{dark:kf,light:(xf=pf,Nf=kf,Ef="#BBE7FF",{op:6,if:xf,then:Nf,else:Ef}),hcDark:kf,hcLight:kf},ue(0,"List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));var xf,Nf,Ef;Dp("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},ue(0,"List/Tree foreground color for invalid items, for example an unresolved root in explorer.")),Dp("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},ue(0,"Foreground color of list items containing errors.")),Dp("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},ue(0,"Foreground color of list items containing warnings."));const If=Dp("listFilterWidget.background",{light:L_(km,0),dark:k_(km,0),hcDark:km,hcLight:km},ue(0,"Background color of the type filter widget in lists and trees.")),Mf=Dp("listFilterWidget.outline",{dark:lc.transparent,light:lc.transparent,hcDark:"#f38518",hcLight:"#007ACC"},ue(0,"Outline color of the type filter widget in lists and trees.")),Tf=Dp("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:Mp,hcLight:Mp},ue(0,"Outline color of the type filter widget in lists and trees, when there are no matches.")),Rf=Dp("listFilterWidget.shadow",{dark:Ap,light:Ap,hcDark:Ap,hcLight:Ap},ue(0,"Shadow color of the type filter widget in lists and trees.")),Af=(Dp("list.filterMatchBackground",{dark:Um,light:Um,hcDark:null,hcLight:null},ue(0,"Background color of the filtered match.")),Dp("list.filterMatchBorder",{dark:qm,light:qm,hcDark:Mp,hcLight:Tp},ue(0,"Border color of the filtered match.")),Dp("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},ue(0,"Tree stroke color for the indentation guides."))),Of=Dp("tree.inactiveIndentGuidesStroke",{dark:D_(Af,.4),light:D_(Af,.4),hcDark:D_(Af,.4),hcLight:D_(Af,.4)},ue(0,"Tree stroke color for the indentation guides that are not active.")),Pf=Dp("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},ue(0,"Table border color between columns.")),Ff=Dp("tree.tableOddRowsBackground",{dark:D_(xp,.04),light:D_(xp,.04),hcDark:null,hcLight:null},ue(0,"Background color for odd table rows.")),Bf=(Dp("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},ue(0,"List/Tree foreground color for items that are deemphasized. ")),Dp("checkbox.background",{dark:Xp,light:Xp,hcDark:Xp,hcLight:Xp},ue(0,"Background color of checkbox widget."))),Wf=(Dp("checkbox.selectBackground",{dark:km,light:km,hcDark:km,hcLight:km},ue(0,"Background color of checkbox widget when the element it's in is selected.")),Dp("checkbox.foreground",{dark:Jp,light:Jp,hcDark:Jp,hcLight:Jp},ue(0,"Foreground color of checkbox widget."))),Vf=Dp("checkbox.border",{dark:em,light:em,hcDark:em,hcLight:em},ue(0,"Border color of checkbox widget.")),Hf=(Dp("checkbox.selectBorder",{dark:Ep,light:Ep,hcDark:Ep,hcLight:Ep},ue(0,"Border color of checkbox widget when the element it's in is selected.")),Dp("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,ue(0,"Please use quickInputList.focusBackground instead"))),zf=Dp("quickInputList.focusForeground",{dark:mf,light:mf,hcDark:mf,hcLight:mf},ue(0,"Quick picker foreground color for the focused item.")),Uf=Dp("quickInputList.focusIconForeground",{dark:ff,light:ff,hcDark:ff,hcLight:ff},ue(0,"Quick picker icon foreground color for the focused item.")),Kf=Dp("quickInputList.focusBackground",{dark:x_(Hf,pf),light:x_(Hf,pf),hcDark:null,hcLight:null},ue(0,"Quick picker background color for the focused item.")),jf=Dp("menu.border",{dark:null,light:null,hcDark:Mp,hcLight:Mp},ue(0,"Border color of menus.")),qf=Dp("menu.foreground",{dark:Jp,light:Jp,hcDark:Jp,hcLight:Jp},ue(0,"Foreground color of menu items.")),$f=Dp("menu.background",{dark:Xp,light:Xp,hcDark:Xp,hcLight:Xp},ue(0,"Background color of menu items.")),Gf=Dp("menu.selectionForeground",{dark:mf,light:mf,hcDark:mf,hcLight:mf},ue(0,"Foreground color of the selected menu item in menus.")),Zf=Dp("menu.selectionBackground",{dark:pf,light:pf,hcDark:pf,hcLight:pf},ue(0,"Background color of the selected menu item in menus.")),Yf=Dp("menu.selectionBorder",{dark:null,light:null,hcDark:Tp,hcLight:Tp},ue(0,"Border color of the selected menu item in menus.")),Xf=Dp("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:Mp,hcLight:Mp},ue(0,"Color of a separator menu item in menus.")),Qf=Dp("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},ue(0,"Toolbar background when hovering over actions using the mouse")),Jf=(Dp("toolbar.hoverOutline",{dark:null,light:null,hcDark:Tp,hcLight:Tp},ue(0,"Toolbar outline when hovering over actions using the mouse")),Dp("toolbar.activeBackground",{dark:k_(Qf,.1),light:L_(Qf,.1),hcDark:null,hcLight:null},ue(0,"Toolbar background when holding the mouse over actions")),Dp("editor.snippetTabstopHighlightBackground",{dark:new lc(new oc(124,124,124,.3)),light:new lc(new oc(10,50,100,.2)),hcDark:new lc(new oc(124,124,124,.3)),hcLight:new lc(new oc(10,50,100,.2))},ue(0,"Highlight background color of a snippet tabstop.")),Dp("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Highlight border color of a snippet tabstop.")),Dp("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Highlight background color of the final tabstop of a snippet.")),Dp("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new lc(new oc(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},ue(0,"Highlight border color of the final tabstop of a snippet.")),Dp("breadcrumb.foreground",{light:D_(xp,.8),dark:D_(xp,.8),hcDark:D_(xp,.8),hcLight:D_(xp,.8)},ue(0,"Color of focused breadcrumb items."))),e_=Dp("breadcrumb.background",{light:Sm,dark:Sm,hcDark:Sm,hcLight:Sm},ue(0,"Background color of breadcrumb items.")),t_=Dp("breadcrumb.focusForeground",{light:L_(xp,.2),dark:k_(xp,.1),hcDark:k_(xp,.1),hcLight:k_(xp,.1)},ue(0,"Color of focused breadcrumb items.")),i_=Dp("breadcrumb.activeSelectionForeground",{light:L_(xp,.2),dark:k_(xp,.1),hcDark:k_(xp,.1),hcLight:k_(xp,.1)},ue(0,"Color of selected breadcrumb items.")),n_=(Dp("breadcrumbPicker.background",{light:km,dark:km,hcDark:km,hcLight:km},ue(0,"Background color of breadcrumb item picker.")),lc.fromHex("#40C8AE").transparent(.5)),s_=lc.fromHex("#40A6FF").transparent(.5),o_=lc.fromHex("#606060").transparent(.4),r_=.4,a_=Dp("merge.currentHeaderBackground",{dark:n_,light:n_,hcDark:null,hcLight:null},ue(0,"Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),l_=(Dp("merge.currentContentBackground",{dark:D_(a_,r_),light:D_(a_,r_),hcDark:D_(a_,r_),hcLight:D_(a_,r_)},ue(0,"Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),Dp("merge.incomingHeaderBackground",{dark:s_,light:s_,hcDark:null,hcLight:null},ue(0,"Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0)),h_=(Dp("merge.incomingContentBackground",{dark:D_(l_,r_),light:D_(l_,r_),hcDark:D_(l_,r_),hcLight:D_(l_,r_)},ue(0,"Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),Dp("merge.commonHeaderBackground",{dark:o_,light:o_,hcDark:null,hcLight:null},ue(0,"Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0)),d_=(Dp("merge.commonContentBackground",{dark:D_(h_,r_),light:D_(h_,r_),hcDark:D_(h_,r_),hcLight:D_(h_,r_)},ue(0,"Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),Dp("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},ue(0,"Border color on headers and the splitter in inline merge-conflicts."))),c_=(Dp("editorOverviewRuler.currentContentForeground",{dark:D_(a_,1),light:D_(a_,1),hcDark:d_,hcLight:d_},ue(0,"Current overview ruler foreground for inline merge-conflicts.")),Dp("editorOverviewRuler.incomingContentForeground",{dark:D_(l_,1),light:D_(l_,1),hcDark:d_,hcLight:d_},ue(0,"Incoming overview ruler foreground for inline merge-conflicts.")),Dp("editorOverviewRuler.commonContentForeground",{dark:D_(h_,1),light:D_(h_,1),hcDark:d_,hcLight:d_},ue(0,"Common ancestor overview ruler foreground for inline merge-conflicts.")),Dp("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},ue(0,"Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0)),u_=Dp("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},ue(0,"Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),g_=Dp("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},ue(0,"Minimap marker color for find matches."),!0),p_=Dp("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},ue(0,"Minimap marker color for repeating editor selections."),!0),m_=Dp("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},ue(0,"Minimap marker color for the editor selection."),!0),f_=Dp("minimap.infoHighlight",{dark:Cm,light:Cm,hcDark:wm,hcLight:wm},ue(0,"Minimap marker color for infos.")),__=Dp("minimap.warningHighlight",{dark:vm,light:vm,hcDark:bm,hcLight:bm},ue(0,"Minimap marker color for warnings.")),v_=Dp("minimap.errorHighlight",{dark:new lc(new oc(255,18,18,.7)),light:new lc(new oc(255,18,18,.7)),hcDark:new lc(new oc(255,50,50,1)),hcLight:"#B5200D"},ue(0,"Minimap marker color for errors.")),b_=Dp("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Minimap background color.")),C_=Dp("minimap.foregroundOpacity",{dark:lc.fromHex("#000f"),light:lc.fromHex("#000f"),hcDark:lc.fromHex("#000f"),hcLight:lc.fromHex("#000f")},ue(0,'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.')),w_=(Dp("minimapSlider.background",{light:D_(um,.5),dark:D_(um,.5),hcDark:D_(um,.5),hcLight:D_(um,.5)},ue(0,"Minimap slider background color.")),Dp("minimapSlider.hoverBackground",{light:D_(gm,.5),dark:D_(gm,.5),hcDark:D_(gm,.5),hcLight:D_(gm,.5)},ue(0,"Minimap slider background color when hovering.")),Dp("minimapSlider.activeBackground",{light:D_(pm,.5),dark:D_(pm,.5),hcDark:D_(pm,.5),hcLight:D_(pm,.5)},ue(0,"Minimap slider background color when clicked on.")),Dp("problemsErrorIcon.foreground",{dark:fm,light:fm,hcDark:fm,hcLight:fm},ue(0,"The color used for the problems error icon."))),y_=Dp("problemsWarningIcon.foreground",{dark:vm,light:vm,hcDark:vm,hcLight:vm},ue(0,"The color used for the problems warning icon.")),S_=Dp("problemsInfoIcon.foreground",{dark:Cm,light:Cm,hcDark:Cm,hcLight:Cm},ue(0,"The color used for the problems info icon."));Dp("charts.foreground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color used in charts.")),Dp("charts.lines",{dark:D_(xp,.5),light:D_(xp,.5),hcDark:D_(xp,.5),hcLight:D_(xp,.5)},ue(0,"The color used for horizontal lines in charts.")),Dp("charts.red",{dark:fm,light:fm,hcDark:fm,hcLight:fm},ue(0,"The red color used in chart visualizations.")),Dp("charts.blue",{dark:Cm,light:Cm,hcDark:Cm,hcLight:Cm},ue(0,"The blue color used in chart visualizations.")),Dp("charts.yellow",{dark:vm,light:vm,hcDark:vm,hcLight:vm},ue(0,"The yellow color used in chart visualizations.")),Dp("charts.orange",{dark:g_,light:g_,hcDark:g_,hcLight:g_},ue(0,"The orange color used in chart visualizations.")),Dp("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},ue(0,"The green color used in chart visualizations.")),Dp("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},ue(0,"The purple color used in chart visualizations."));function L_(e,t){return{op:0,value:e,factor:t}}function k_(e,t){return{op:1,value:e,factor:t}}function D_(e,t){return{op:2,value:e,factor:t}}function x_(...e){return{op:4,values:e}}function N_(e,t,i,n){return{op:5,value:e,background:t,factor:i,transparency:n}}function E_(e,t){if(null!==e)return"string"==typeof e?"#"===e[0]?lc.fromHex(e):t.getColor(e):e instanceof lc?e:"object"==typeof e?function(e,t){var i,n,s,o;switch(e.op){case 0:return null===(i=E_(e.value,t))||void 0===i?void 0:i.darken(e.factor);case 1:return null===(n=E_(e.value,t))||void 0===n?void 0:n.lighten(e.factor);case 2:return null===(s=E_(e.value,t))||void 0===s?void 0:s.transparent(e.factor);case 3:{const i=E_(e.background,t);return i?null===(o=E_(e.value,t))||void 0===o?void 0:o.makeOpaque(i):E_(e.value,t)}case 4:for(const i of e.values){const e=E_(i,t);if(e)return e}return;case 6:return E_(t.defines(e.if)?e.then:e.else,t);case 5:{const i=E_(e.value,t);if(!i)return;const n=E_(e.background,t);return n?i.isDarkerThan(n)?lc.getLighterColor(i,n,e.factor).transparent(e.transparency):lc.getDarkerColor(i,n,e.factor).transparent(e.transparency):i.transparent(e.factor*e.transparency)}default:throw zl()}}(e,t):void 0}const I_="vscode://schemas/workbench-colors",M_=jl.as(ku);M_.registerSchema(I_,kp.getColorSchema());const T_=new rd((()=>M_.notifySchemaChanged(I_)),200);var R_;function A_(e){return e===R_.HIGH_CONTRAST_DARK||e===R_.HIGH_CONTRAST_LIGHT}function O_(e){return e===R_.DARK||e===R_.HIGH_CONTRAST_DARK}kp.onDidChangeSchema((()=>{T_.isScheduled()||T_.schedule()})),function(e){e.DARK="dark",e.LIGHT="light",e.HIGH_CONTRAST_DARK="hcDark",e.HIGH_CONTRAST_LIGHT="hcLight"}(R_||(R_={}));const P_=Ba("themeService");function F_(e){return{id:e}}function B_(e){switch(e){case R_.DARK:return"vs-dark";case R_.HIGH_CONTRAST_DARK:return"hc-black";case R_.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const W_="base.contributions.theming";const V_=new class{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new U}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),x((()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)}))}getThemingParticipants(){return this.themingParticipants}};function H_(e){return V_.onColorThemeChange(e)}jl.add(W_,V_);class z_ extends E{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange((e=>this.onThemeChange(e))))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}const U_=Dp("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Background color for the highlight of line at the cursor position.")),K_=Dp("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:Mp},ue(0,"Background color for the border around the line at the cursor position.")),j_=(Dp("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},ue(0,"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),Dp("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:Tp,hcLight:Tp},ue(0,"Background color of the border around highlighted ranges."),!0),Dp("editor.symbolHighlightBackground",{dark:Um,light:Um,hcDark:null,hcLight:null},ue(0,"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),Dp("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:Tp,hcLight:Tp},ue(0,"Background color of the border around highlighted symbols."),!0),Dp("editorCursor.foreground",{dark:"#AEAFAD",light:lc.black,hcDark:lc.white,hcLight:"#0F4A85"},ue(0,"Color of the editor cursor."))),q_=Dp("editorCursor.background",null,ue(0,"The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),$_=Dp("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},ue(0,"Color of whitespace characters in the editor.")),G_=Dp("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:lc.white,hcLight:"#292929"},ue(0,"Color of editor line numbers.")),Z_=Dp("editorIndentGuide.background",{dark:$_,light:$_,hcDark:$_,hcLight:$_},ue(0,"Color of the editor indentation guides."),!1,ue(0,"'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),Y_=Dp("editorIndentGuide.activeBackground",{dark:$_,light:$_,hcDark:$_,hcLight:$_},ue(0,"Color of the active editor indentation guides."),!1,ue(0,"'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),X_=Dp("editorIndentGuide.background1",{dark:Z_,light:Z_,hcDark:Z_,hcLight:Z_},ue(0,"Color of the editor indentation guides (1).")),Q_=Dp("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Color of the editor indentation guides (2).")),J_=Dp("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Color of the editor indentation guides (3).")),ev=Dp("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Color of the editor indentation guides (4).")),tv=Dp("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Color of the editor indentation guides (5).")),iv=Dp("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Color of the editor indentation guides (6).")),nv=Dp("editorIndentGuide.activeBackground1",{dark:Y_,light:Y_,hcDark:Y_,hcLight:Y_},ue(0,"Color of the active editor indentation guides (1).")),sv=Dp("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Color of the active editor indentation guides (2).")),ov=Dp("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Color of the active editor indentation guides (3).")),rv=Dp("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Color of the active editor indentation guides (4).")),av=Dp("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Color of the active editor indentation guides (5).")),lv=Dp("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Color of the active editor indentation guides (6).")),hv=Dp("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:Tp,hcLight:Tp},ue(0,"Color of editor active line number"),!1,ue(0,"Id is deprecated. Use 'editorLineNumber.activeForeground' instead.")),dv=(Dp("editorLineNumber.activeForeground",{dark:hv,light:hv,hcDark:hv,hcLight:hv},ue(0,"Color of editor active line number")),Dp("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Color of the final editor line when editor.renderFinalNewline is set to dimmed."))),cv=(Dp("editorRuler.foreground",{dark:"#5A5A5A",light:lc.lightgrey,hcDark:lc.white,hcLight:"#292929"},ue(0,"Color of the editor rulers.")),Dp("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},ue(0,"Foreground color of editor CodeLens")),Dp("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},ue(0,"Background color behind matching brackets")),Dp("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:Mp,hcLight:Mp},ue(0,"Color for matching brackets boxes")),Dp("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},ue(0,"Color of the overview ruler border."))),uv=Dp("editorOverviewRuler.background",null,ue(0,"Background color of the editor overview ruler.")),gv=(Dp("editorGutter.background",{dark:Sm,light:Sm,hcDark:Sm,hcLight:Sm},ue(0,"Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.")),Dp("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:lc.fromHex("#fff").transparent(.8),hcLight:Mp},ue(0,"Border color of unnecessary (unused) source code in the editor.")),Dp("editorUnnecessaryCode.opacity",{dark:lc.fromHex("#000a"),light:lc.fromHex("#0007"),hcDark:null,hcLight:null},ue(0,"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."))),pv=(Dp("editorGhostText.border",{dark:null,light:null,hcDark:lc.fromHex("#fff").transparent(.8),hcLight:lc.fromHex("#292929").transparent(.8)},ue(0,"Border color of ghost text in the editor.")),Dp("editorGhostText.foreground",{dark:lc.fromHex("#ffffff56"),light:lc.fromHex("#0007"),hcDark:null,hcLight:null},ue(0,"Foreground color of the ghost text in the editor.")),Dp("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Background color of the ghost text in the editor.")),new lc(new oc(0,122,204,.6))),mv=Dp("editorOverviewRuler.rangeHighlightForeground",{dark:pv,light:pv,hcDark:pv,hcLight:pv},ue(0,"Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),fv=Dp("editorOverviewRuler.errorForeground",{dark:new lc(new oc(255,18,18,.7)),light:new lc(new oc(255,18,18,.7)),hcDark:new lc(new oc(255,50,50,1)),hcLight:"#B5200D"},ue(0,"Overview ruler marker color for errors.")),_v=Dp("editorOverviewRuler.warningForeground",{dark:vm,light:vm,hcDark:bm,hcLight:bm},ue(0,"Overview ruler marker color for warnings.")),vv=Dp("editorOverviewRuler.infoForeground",{dark:Cm,light:Cm,hcDark:wm,hcLight:wm},ue(0,"Overview ruler marker color for infos.")),bv=Dp("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},ue(0,"Foreground color of brackets (1). Requires enabling bracket pair colorization.")),Cv=Dp("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},ue(0,"Foreground color of brackets (2). Requires enabling bracket pair colorization.")),wv=Dp("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},ue(0,"Foreground color of brackets (3). Requires enabling bracket pair colorization.")),yv=Dp("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Foreground color of brackets (4). Requires enabling bracket pair colorization.")),Sv=Dp("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Foreground color of brackets (5). Requires enabling bracket pair colorization.")),Lv=Dp("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Foreground color of brackets (6). Requires enabling bracket pair colorization.")),kv=Dp("editorBracketHighlight.unexpectedBracket.foreground",{dark:new lc(new oc(255,18,18,.8)),light:new lc(new oc(255,18,18,.8)),hcDark:new lc(new oc(255,50,50,1)),hcLight:""},ue(0,"Foreground color of unexpected brackets.")),Dv=Dp("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),xv=Dp("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),Nv=Dp("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),Ev=Dp("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),Iv=Dp("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),Mv=Dp("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),Tv=Dp("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),Rv=Dp("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),Av=Dp("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),Ov=Dp("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),Pv=Dp("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),Fv=Dp("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));Dp("editorUnicodeHighlight.border",{dark:"#BD9B03",light:"#CEA33D",hcDark:"#ff0000",hcLight:"#CEA33D"},ue(0,"Border color used to highlight unicode characters.")),Dp("editorUnicodeHighlight.background",{dark:"#bd9b0326",light:"#cea33d14",hcDark:"#00000000",hcLight:"#cea33d14"},ue(0,"Background color used to highlight unicode characters."));H_(((e,t)=>{const i=e.getColor(Sm),n=e.getColor(U_),s=n&&!n.isTransparent()?n:i;s&&t.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${s}; }`)}));class Bv extends E{constructor(e){super(),this.textModel=e,this.colorProvider=new Wv,this.onDidChangeEmitter=new U,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange((e=>{this.onDidChangeEmitter.fire()})))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i,n){if(n)return[];if(void 0===t)return[];if(!this.colorizationOptions.enabled)return[];return this.textModel.bracketPairs.getBracketsInRange(e,!0).map((e=>({id:`bracket${e.range.toString()}-${e.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(e,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:e.range}))).toArray()}getAllDecorations(e,t){return void 0===e?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new Rh(1,1,this.textModel.getLineCount(),1),e,t):[]}}class Wv{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}}function Vv(e){return e.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}H_(((e,t)=>{const i=[bv,Cv,wv,yv,Sv,Lv],n=new Wv;t.addRule(`.monaco-editor .${n.unexpectedClosingBracketClassName} { color: ${e.getColor(kv)}; }`);const s=i.map((t=>e.getColor(t))).filter((e=>!!e)).filter((e=>!e.isTransparent()));for(let o=0;o<30;o++){const e=s[o%s.length];t.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(o)} { color: ${e}; }`)}}));class Hv{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 0===this.oldText.length?`(insert@${this.oldPosition} "${Vv(this.newText)}")`:0===this.newText.length?`(delete@${this.oldPosition} "${Vv(this.oldText)}")`:`(replace@${this.oldPosition} "${Vv(this.oldText)}" with "${Vv(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const n=t.length;Gc(e,n,i),i+=4;for(let s=0;s0&&(this.changes=(o=this.changes,r=t,null===o||0===o.length?r:new zv(o,r).compress())),this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=s}static _writeSelectionsSize(e){return 4+16*(e?e.length:0)}static _writeSelections(e,t,i){if(Gc(e,t?t.length:0,i),i+=4,t)for(const n of t)Gc(e,n.selectionStartLineNumber,i),i+=4,Gc(e,n.selectionStartColumn,i),i+=4,Gc(e,n.positionLineNumber,i),i+=4,Gc(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=$c(e,t);t+=4;for(let s=0;se.toString())).join(", ")}matchesResource(e){return(an.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 Kv}append(e,t,i,n,s){this._data instanceof Kv&&this._data.append(e,t,i,n,s)}close(){this._data instanceof Kv&&(this._data=this._data.serialize())}open(){this._data instanceof Kv||(this._data=Kv.deserialize(this._data))}undo(){if(an.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Kv&&(this._data=this._data.serialize());const e=Kv.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(an.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Kv&&(this._data=this._data.serialize());const e=Kv.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof Kv&&(this._data=this._data.serialize()),this._data.byteLength+168}}class qv{get resources(){return this._editStackElementsArr.map((e=>e.resource))}constructor(e,t,i){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const n of this._editStackElementsArr){const e=Uv(n.resource);this._editStackElementsMap.set(e,n)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=Uv(e);return this._editStackElementsMap.has(t)}setModel(e){const t=Uv(an.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=Uv(e.uri);if(this._editStackElementsMap.has(t)){return this._editStackElementsMap.get(t).canAppend(e)}return!1}append(e,t,i,n,s){const o=Uv(e.uri);this._editStackElementsMap.get(o).append(e,t,i,n,s)}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=Uv(e);if(this._editStackElementsMap.has(t)){return this._editStackElementsMap.get(t).heapSize()}return 0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${wa(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function $v(e){return"\n"===e.getEOL()?0:1}function Gv(e){return!!e&&(e instanceof jv||e instanceof qv)}class Zv{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Gv(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Gv(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(Gv(i)&&i.canAppend(this._model))return i;const n=new jv(ue(0,"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,[],$v(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,n){const s=this._getOrCreateEditStackElement(e,n),o=this._model.applyEdits(t,!0),r=Zv._computeCursorState(i,o),a=o.map(((e,t)=>({index:t,textChange:e.textChange})));return a.sort(((e,t)=>e.textChange.oldPosition===t.textChange.oldPosition?e.index-t.index:e.textChange.oldPosition-t.textChange.oldPosition)),s.append(this._model,a.map((e=>e.textChange)),$v(this._model),this._model.getAlternativeVersionId(),r),r}static _computeCursorState(e,t){try{return e?e(t):null}catch(Mre){return r(Mre),null}}}class Yv extends E{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function Xv(e,t){let i=0,n=0;const s=e.length;for(;nn)throw new f("Illegal value for lineNumber");const s=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,o=Boolean(s&&s.offSide);let r=-2,a=-1,l=-2,h=-1;const d=e=>{if(-1!==r&&(-2===r||r>e-1)){r=-1,a=-1;for(let t=e-2;t>=0;t--){const e=this._computeIndentLevel(t);if(e>=0){r=t,a=e;break}}}if(-2===l){l=-1,h=-1;for(let t=e;t=0){l=t,h=e;break}}}};let c=-2,u=-1,g=-2,p=-1;const m=e=>{if(-2===c){c=-1,u=-1;for(let t=e-2;t>=0;t--){const e=this._computeIndentLevel(t);if(e>=0){c=t,u=e;break}}}if(-1!==g&&(-2===g||g=0){g=t,p=e;break}}}};let _=0,v=!0,b=0,C=!0,w=0,y=0;for(let f=0;v||C;f++){const s=e-f,r=e+f;f>1&&(s<1||s1&&(r>n||r>i)&&(C=!1),f>5e4&&(v=!1,C=!1);let g=-1;if(v&&s>=1){const e=this._computeIndentLevel(s-1);e>=0?(l=s-1,h=e,g=Math.ceil(e/this.textModel.getOptions().indentSize)):(d(s),g=this._getIndentLevelForWhitespaceLine(o,a,h))}let S=-1;if(C&&r<=n){const e=this._computeIndentLevel(r-1);e>=0?(c=r-1,u=e,S=Math.ceil(e/this.textModel.getOptions().indentSize)):(m(r),S=this._getIndentLevelForWhitespaceLine(o,u,p))}if(0!==f){if(1===f){if(r<=n&&S>=0&&y+1===S){v=!1,_=r,b=r,w=S;continue}if(s>=1&&g>=0&&g-1===y){C=!1,_=s,b=s,w=g;continue}if(_=e,b=e,w=y,0===w)return{startLineNumber:_,endLineNumber:b,indent:w}}v&&(g>=w?_=s:v=!1),C&&(S>=w?b=r:C=!1)}else y=g}return{startLineNumber:_,endLineNumber:b,indent:w}}getLinesBracketGuides(e,t,i,n){var s;const o=[];for(let c=e;c<=t;c++)o.push([]);const r=!0,a=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new Rh(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let l;if(i&&a.length>0){l=null===(s=pc((e<=i.lineNumber&&i.lineNumber<=t?a:this.textModel.bracketPairs.getBracketPairsInRange(Rh.fromPositions(i)).toArray()).filter((e=>Rh.strictContainsPosition(e.range,i))),(e=>r)))||void 0===s?void 0:s.range}const h=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,d=new ib;for(const c of a){if(!c.closingBracketRange)continue;const i=l&&c.range.equalsRange(l);if(!i&&!n.includeInactive)continue;const s=d.getInlineClassName(c.nestingLevel,c.nestingLevelOfEqualBracketType,h)+(n.highlightActive&&i?" "+d.activeClassName:""),r=c.openingBracketRange.getStartPosition(),a=c.closingBracketRange.getStartPosition(),u=n.horizontalGuides===Qv.Enabled||n.horizontalGuides===Qv.EnabledForActive&&i;if(c.range.startLineNumber===c.range.endLineNumber){u&&o[c.range.startLineNumber-e].push(new Jv(-1,c.openingBracketRange.getEndPosition().column,s,new eb(!1,a.column),-1,-1));continue}const g=this.getVisibleColumnFromPosition(a),p=this.getVisibleColumnFromPosition(c.openingBracketRange.getStartPosition()),m=Math.min(p,g,c.minVisibleColumnIndentation+1);let f=!1;ro(this.textModel.getLineContent(c.closingBracketRange.startLineNumber))=e&&p>m&&o[r.lineNumber-e].push(new Jv(m,-1,s,new eb(!1,r.column),-1,-1)),a.lineNumber<=t&&g>m&&o[a.lineNumber-e].push(new Jv(m,-1,s,new eb(!f,a.column),-1,-1)))}for(const c of o)c.sort(((e,t)=>e.visibleColumn-t.visibleColumn));return o}getVisibleColumnFromPosition(e){return dc.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(),s=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,o=Boolean(s&&s.offSide),r=new Array(t-e+1);let a=-2,l=-1,h=-2,d=-1;for(let c=e;c<=t;c++){const t=c-e,s=this._computeIndentLevel(c-1);if(s>=0)a=c-1,l=s,r[t]=Math.ceil(s/n.indentSize);else{if(-2===a){a=-1,l=-1;for(let e=c-2;e>=0;e--){const t=this._computeIndentLevel(e);if(t>=0){a=e,l=t;break}}}if(-1!==h&&(-2===h||h=0){h=e,d=t;break}}}r[t]=this._getIndentLevelForWhitespaceLine(o,l,d)}}return r}_getIndentLevelForWhitespaceLine(e,t,i){const n=this.textModel.getOptions();return-1===t||-1===i?0:t0&&a>0)return;if(l>0&&h>0)return;const d=Math.abs(a-h),c=Math.abs(r-l);if(0===d)return s.spacesDiff=c,void(c>0&&0<=l-1&&l-10?s++:m>1&&o++,sb(r,a,l,p,d),d.looksLikeAlignment&&(!i||t!==d.spacesDiff))continue;const _=d.spacesDiff;_<=8&&h[_]++,r=l,a=p}let c=i;s!==o&&(c=s{const i=h[t];i>e&&(e=i,u=t)})),4===u&&h[4]>0&&h[2]>0&&h[2]>=h[4]/2&&(u=2)}return{insertSpaces:c,tabSize:u}}function rb(e){return(1&e.metadata)>>>0}function ab(e,t){e.metadata=254&e.metadata|t}function lb(e){return(2&e.metadata)>>>1==1}function hb(e,t){e.metadata=253&e.metadata|(t?1:0)<<1}function db(e){return(4&e.metadata)>>>2==1}function cb(e,t){e.metadata=251&e.metadata|(t?1:0)<<2}function ub(e){return(64&e.metadata)>>>6==1}function gb(e,t){e.metadata=191&e.metadata|(t?1:0)<<6}function pb(e,t){e.metadata=231&e.metadata|t<<3}function mb(e,t){e.metadata=223&e.metadata|(t?1:0)<<5}class fb{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,ab(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,cb(this,!1),gb(this,!1),pb(this,1),mb(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,hb(this,!1)}reset(e,t,i,n){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=n}setOptions(e){this.options=e;const t=this.options.className;cb(this,"squiggly-error"===t||"squiggly-warning"===t||"squiggly-info"===t),gb(this,null!==this.options.glyphMarginClassName),pb(this,this.options.stickiness),mb(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const _b=new fb(null,0,0);_b.parent=_b,_b.left=_b,_b.right=_b,ab(_b,0);class vb{constructor(){this.root=_b,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,n,s,o){return this.root===_b?[]:function(e,t,i,n,s,o,r){let a=e.root,l=0,h=0,d=0,c=0;const u=[];let g=0;for(;a!==_b;)if(lb(a))hb(a.left,!1),hb(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;else{if(!lb(a.left)){if(h=l+a.maxEnd,hi)hb(a,!0);else{if(c=l+a.end,c>=t){a.setCachedOffsets(d,c,o);let e=!0;n&&a.ownerId&&a.ownerId!==n&&(e=!1),s&&db(a)&&(e=!1),r&&!ub(a)&&(e=!1),e&&(u[g++]=a)}hb(a,!0),a.right===_b||lb(a.right)||(l+=a.delta,a=a.right)}}return hb(e.root,!1),u}(this,e,t,i,n,s,o)}search(e,t,i,n){return this.root===_b?[]:function(e,t,i,n,s){let o=e.root,r=0,a=0,l=0;const h=[];let d=0;for(;o!==_b;){if(lb(o)){hb(o.left,!1),hb(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),o=o.parent;continue}if(o.left!==_b&&!lb(o.left)){o=o.left;continue}a=r+o.start,l=r+o.end,o.setCachedOffsets(a,l,n);let e=!0;t&&o.ownerId&&o.ownerId!==t&&(e=!1),i&&db(o)&&(e=!1),s&&!ub(o)&&(e=!1),e&&(h[d++]=o),hb(o,!0),o.right===_b||lb(o.right)||(r+=o.delta,o=o.right)}return hb(e.root,!1),h}(this,e,t,i,n)}collectNodesFromOwner(e){return function(e,t){let i=e.root;const n=[];let s=0;for(;i!==_b;)lb(i)?(hb(i.left,!1),hb(i.right,!1),i=i.parent):i.left===_b||lb(i.left)?(i.ownerId===t&&(n[s++]=i),hb(i,!0),i.right===_b||lb(i.right)||(i=i.right)):i=i.left;return hb(e.root,!1),n}(this,e)}collectNodesPostOrder(){return function(e){let t=e.root;const i=[];let n=0;for(;t!==_b;)lb(t)?(hb(t.left,!1),hb(t.right,!1),t=t.parent):t.left===_b||lb(t.left)?t.right===_b||lb(t.right)?(i[n++]=t,hb(t,!0)):t=t.right:t=t.left;return hb(e.root,!1),i}(this)}insert(e){wb(this,e),this._normalizeDeltaIfNecessary()}delete(e){yb(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let n=0;for(;e!==this.root;)e===e.parent.right&&(n+=e.parent.delta),e=e.parent;const s=i.start+n,o=i.end+n;i.setCachedOffsets(s,o,t)}acceptReplace(e,t,i,n){const s=function(e,t,i){let n=e.root,s=0,o=0,r=0,a=0;const l=[];let h=0;for(;n!==_b;)if(lb(n))hb(n.left,!1),hb(n.right,!1),n===n.parent.right&&(s-=n.parent.delta),n=n.parent;else{if(!lb(n.left)){if(o=s+n.maxEnd,oi?hb(n,!0):(a=s+n.end,a>=t&&(n.setCachedOffsets(r,a,0),l[h++]=n),hb(n,!0),n.right===_b||lb(n.right)||(s+=n.delta,n=n.right))}return hb(e.root,!1),l}(this,e,e+t);for(let o=0,r=s.length;oi?(s.start+=l,s.end+=l,s.delta+=l,(s.delta<-1073741824||s.delta>1073741824)&&(e.requestNormalizeDelta=!0),hb(s,!0)):(hb(s,!0),s.right===_b||lb(s.right)||(o+=s.delta,s=s.right))}hb(e.root,!1)}(this,e,e+t,i),this._normalizeDeltaIfNecessary();for(let o=0,r=s.length;oi)&&(1!==n&&(2===n||t))}function Cb(e,t,i,n,s){const o=function(e){return(24&e.metadata)>>>3}(e),r=0===o||2===o,a=1===o||2===o,l=i-t,h=n,d=Math.min(l,h),c=e.start;let u=!1;const g=e.end;let p=!1;t<=c&&g<=i&&function(e){return(32&e.metadata)>>>5==1}(e)&&(e.start=t,u=!0,e.end=t,p=!0);{const e=s?1:l>0?2:0;!u&&bb(c,r,t,e)&&(u=!0),!p&&bb(g,a,t,e)&&(p=!0)}if(d>0&&!s){const e=l>h?2:0;!u&&bb(c,r,t+d,e)&&(u=!0),!p&&bb(g,a,t+d,e)&&(p=!0)}{const n=s?1:0;!u&&bb(c,r,i,n)&&(e.start=t+h,u=!0),!p&&bb(g,a,i,n)&&(e.end=t+h,p=!0)}const m=h-l;u||(e.start=Math.max(0,c+m)),p||(e.end=Math.max(0,g+m)),e.start>e.end&&(e.end=e.start)}function wb(e,t){if(e.root===_b)return t.parent=_b,t.left=_b,t.right=_b,ab(t,0),e.root=t,e.root;!function(e,t){let i=0,n=e.root;const s=t.start,o=t.end;for(;;){if(Eb(s,o,n.start+i,n.end+i)<0){if(n.left===_b){t.start-=i,t.end-=i,t.maxEnd-=i,n.left=t;break}n=n.left}else{if(n.right===_b){t.start-=i+n.delta,t.end-=i+n.delta,t.maxEnd-=i+n.delta,n.right=t;break}i+=n.delta,n=n.right}}t.parent=n,t.left=_b,t.right=_b,ab(t,1)}(e,t),Nb(t.parent);let i=t;for(;i!==e.root&&1===rb(i.parent);)if(i.parent===i.parent.parent.left){const t=i.parent.parent.right;1===rb(t)?(ab(i.parent,0),ab(t,0),ab(i.parent.parent,1),i=i.parent.parent):(i===i.parent.right&&(i=i.parent,Lb(e,i)),ab(i.parent,0),ab(i.parent.parent,1),kb(e,i.parent.parent))}else{const t=i.parent.parent.left;1===rb(t)?(ab(i.parent,0),ab(t,0),ab(i.parent.parent,1),i=i.parent.parent):(i===i.parent.left&&(i=i.parent,kb(e,i)),ab(i.parent,0),ab(i.parent.parent,1),Lb(e,i.parent.parent))}return ab(e.root,0),t}function yb(e,t){let i,n;if(t.left===_b?(i=t.right,n=t,i.delta+=t.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start+=t.delta,i.end+=t.delta):t.right===_b?(i=t.left,n=t):(n=function(e){for(;e.left!==_b;)e=e.left;return e}(t.right),i=n.right,i.start+=n.delta,i.end+=n.delta,i.delta+=n.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),n.start+=t.delta,n.end+=t.delta,n.delta=t.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0)),n===e.root)return e.root=i,ab(i,0),t.detach(),Sb(),xb(i),void(e.root.parent=_b);const s=1===rb(n);if(n===n.parent.left?n.parent.left=i:n.parent.right=i,n===t?i.parent=n.parent:(n.parent===t?i.parent=n:i.parent=n.parent,n.left=t.left,n.right=t.right,n.parent=t.parent,ab(n,rb(t)),t===e.root?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left!==_b&&(n.left.parent=n),n.right!==_b&&(n.right.parent=n)),t.detach(),s)return Nb(i.parent),n!==t&&(Nb(n),Nb(n.parent)),void Sb();let o;for(Nb(i),Nb(i.parent),n!==t&&(Nb(n),Nb(n.parent));i!==e.root&&0===rb(i);)i===i.parent.left?(o=i.parent.right,1===rb(o)&&(ab(o,0),ab(i.parent,1),Lb(e,i.parent),o=i.parent.right),0===rb(o.left)&&0===rb(o.right)?(ab(o,1),i=i.parent):(0===rb(o.right)&&(ab(o.left,0),ab(o,1),kb(e,o),o=i.parent.right),ab(o,rb(i.parent)),ab(i.parent,0),ab(o.right,0),Lb(e,i.parent),i=e.root)):(o=i.parent.left,1===rb(o)&&(ab(o,0),ab(i.parent,1),kb(e,i.parent),o=i.parent.left),0===rb(o.left)&&0===rb(o.right)?(ab(o,1),i=i.parent):(0===rb(o.left)&&(ab(o.right,0),ab(o,1),Lb(e,o),o=i.parent.left),ab(o,rb(i.parent)),ab(i.parent,0),ab(o.left,0),kb(e,i.parent),i=e.root));ab(i,0),Sb()}function Sb(){_b.parent=_b,_b.delta=0,_b.start=0,_b.end=0}function Lb(e,t){const i=t.right;i.delta+=t.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start+=t.delta,i.end+=t.delta,t.right=i.left,i.left!==_b&&(i.left.parent=t),i.parent=t.parent,t.parent===_b?e.root=i:t===t.parent.left?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i,xb(t),xb(i)}function kb(e,t){const i=t.left;t.delta-=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(e.requestNormalizeDelta=!0),t.start-=i.delta,t.end-=i.delta,t.left=i.right,i.right!==_b&&(i.right.parent=t),i.parent=t.parent,t.parent===_b?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i,xb(t),xb(i)}function Db(e){let t=e.end;if(e.left!==_b){const i=e.left.maxEnd;i>t&&(t=i)}if(e.right!==_b){const i=e.right.maxEnd+e.delta;i>t&&(t=i)}return t}function xb(e){e.maxEnd=Db(e)}function Nb(e){for(;e!==_b;){const t=Db(e);if(e.maxEnd===t)return;e.maxEnd=t,e=e.parent}}function Eb(e,t,i,n){return e===i?t-n:e-i}class Ib{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!==Mb)return Tb(this.right);let e=this;for(;e.parent!==Mb&&e.parent.left!==e;)e=e.parent;return e.parent===Mb?Mb:e.parent}prev(){if(this.left!==Mb)return Rb(this.left);let e=this;for(;e.parent!==Mb&&e.parent.right!==e;)e=e.parent;return e.parent===Mb?Mb:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const Mb=new Ib(null,0);function Tb(e){for(;e.left!==Mb;)e=e.left;return e}function Rb(e){for(;e.right!==Mb;)e=e.right;return e}function Ab(e){return e===Mb?0:e.size_left+e.piece.length+Ab(e.right)}function Ob(e){return e===Mb?0:e.lf_left+e.piece.lineFeedCnt+Ob(e.right)}function Pb(){Mb.parent=Mb}function Fb(e,t){const i=t.right;i.size_left+=t.size_left+(t.piece?t.piece.length:0),i.lf_left+=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),t.right=i.left,i.left!==Mb&&(i.left.parent=t),i.parent=t.parent,t.parent===Mb?e.root=i:t.parent.left===t?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i}function Bb(e,t){const i=t.left;t.left=i.right,i.right!==Mb&&(i.right.parent=t),i.parent=t.parent,t.size_left-=i.size_left+(i.piece?i.piece.length:0),t.lf_left-=i.lf_left+(i.piece?i.piece.lineFeedCnt:0),t.parent===Mb?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i}function Wb(e,t){let i,n;if(t.left===Mb?(n=t,i=n.right):t.right===Mb?(n=t,i=n.left):(n=Tb(t.right),i=n.right),n===e.root)return e.root=i,i.color=0,t.detach(),Pb(),void(e.root.parent=Mb);const s=1===n.color;if(n===n.parent.left?n.parent.left=i:n.parent.right=i,n===t?(i.parent=n.parent,zb(e,i)):(n.parent===t?i.parent=n:i.parent=n.parent,zb(e,i),n.left=t.left,n.right=t.right,n.parent=t.parent,n.color=t.color,t===e.root?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left!==Mb&&(n.left.parent=n),n.right!==Mb&&(n.right.parent=n),n.size_left=t.size_left,n.lf_left=t.lf_left,zb(e,n)),t.detach(),i.parent.left===i){const t=Ab(i),n=Ob(i);if(t!==i.parent.size_left||n!==i.parent.lf_left){const s=t-i.parent.size_left,o=n-i.parent.lf_left;i.parent.size_left=t,i.parent.lf_left=n,Hb(e,i.parent,s,o)}}if(zb(e,i.parent),s)return void Pb();let o;for(;i!==e.root&&0===i.color;)i===i.parent.left?(o=i.parent.right,1===o.color&&(o.color=0,i.parent.color=1,Fb(e,i.parent),o=i.parent.right),0===o.left.color&&0===o.right.color?(o.color=1,i=i.parent):(0===o.right.color&&(o.left.color=0,o.color=1,Bb(e,o),o=i.parent.right),o.color=i.parent.color,i.parent.color=0,o.right.color=0,Fb(e,i.parent),i=e.root)):(o=i.parent.left,1===o.color&&(o.color=0,i.parent.color=1,Bb(e,i.parent),o=i.parent.left),0===o.left.color&&0===o.right.color?(o.color=1,i=i.parent):(0===o.left.color&&(o.right.color=0,o.color=1,Fb(e,o),o=i.parent.left),o.color=i.parent.color,i.parent.color=0,o.left.color=0,Bb(e,i.parent),i=e.root));i.color=0,Pb()}function Vb(e,t){for(zb(e,t);t!==e.root&&1===t.parent.color;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;1===i.color?(t.parent.color=0,i.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.right&&Fb(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,Bb(e,t.parent.parent))}else{const i=t.parent.parent.left;1===i.color?(t.parent.color=0,i.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.left&&Bb(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,Fb(e,t.parent.parent))}e.root.color=0}function Hb(e,t,i,n){for(;t!==e.root&&t!==Mb;)t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}function zb(e,t){let i=0,n=0;if(t!==e.root){for(;t!==e.root&&t===t.parent.right;)t=t.parent;if(t!==e.root)for(i=Ab((t=t.parent).left)-t.size_left,n=Ob(t.left)-t.lf_left,t.size_left+=i,t.lf_left+=n;t!==e.root&&(0!==i||0!==n);)t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}}function Ub(e){return e<0?0:e>255?255:0|e}function Kb(e){return e<0?0:e>4294967295?4294967295:0|e}Mb.parent=Mb,Mb.left=Mb,Mb.right=Mb,Mb.color=0;class jb{constructor(e){const t=Ub(e);this._defaultValue=t,this._asciiMap=jb._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){const t=new Uint8Array(256);return t.fill(e),t}set(e,t){const i=Ub(t);e>=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()}}class qb{constructor(){this._actual=new jb(0)}add(e){this._actual.set(e,1)}has(e){return 1===this._actual.get(e)}clear(){return this._actual.clear()}}class $b extends jb{constructor(e){super(0);for(let t=0,i=e.length;t(t.hasOwnProperty(i)||(t[i]=e(i)),t[i])}((e=>new $b(e)));class Zb{constructor(e,t,i,n){this.searchString=e,this.isRegex=t,this.matchCase=i,this.wordSeparators=n}parseSearchRequest(){if(""===this.searchString)return null;let e;e=this.isRegex?function(e){if(!e||0===e.length)return!1;for(let t=0,i=e.length;t=i)break;const n=e.charCodeAt(t);if(110===n||114===n||87===n)return!0}}return!1}(this.searchString):this.searchString.indexOf("\n")>=0;let t=null;try{t=so(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch(n){return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new Nd(t,this.wordSeparators?Gb(this.wordSeparators):null,i?this.searchString:null)}}function Yb(e,t,i){if(!i)return new Dd(e,null);const n=[];for(let s=0,o=t.length;s=e?n=s-1:t[s+1]>=e?(i=s,n=s):i=s+1}return i+1}}class Qb{static findMatches(e,t,i,n,s){const o=t.parseSearchRequest();return o?o.regex.multiline?this._doFindMatchesMultiline(e,i,new eC(o.wordSeparators,o.regex),n,s):this._doFindMatchesLineByLine(e,i,o,n,s):[]}static _getMultilineMatchRange(e,t,i,n,s,o){let r,a,l=0;if(n?(l=n.findLineFeedCountBeforeOffset(s),r=t+s+l):r=t+s,n){const e=n.findLineFeedCountBeforeOffset(s+o.length)-l;a=r+o.length+e}else a=r+o.length;const h=e.getPositionAt(r),d=e.getPositionAt(a);return new Rh(h.lineNumber,h.column,d.lineNumber,d.column)}static _doFindMatchesMultiline(e,t,i,n,s){const o=e.getOffsetAt(t.getStartPosition()),r=e.getValueInRange(t,1),a="\r\n"===e.getEOL()?new Xb(r):null,l=[];let h,d=0;for(i.reset(0);h=i.next(r);)if(l[d++]=Yb(this._getMultilineMatchRange(e,o,r,a,h.index,h[0]),h,n),d>=s)return l;return l}static _doFindMatchesLineByLine(e,t,i,n,s){const o=[];let r=0;if(t.startLineNumber===t.endLineNumber){const a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return r=this._findMatchesInLine(i,a,t.startLineNumber,t.startColumn-1,r,o,n,s),o}const a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);r=this._findMatchesInLine(i,a,t.startLineNumber,t.startColumn-1,r,o,n,s);for(let l=t.startLineNumber+1;l=a))return s;return s}const h=new eC(e.wordSeparators,e.regex);let d;h.reset(0);do{if(d=h.next(t),d&&(o[s++]=Yb(new Rh(i,d.index+1+n,i,d.index+1+d[0].length+n),d,r),s>=a))return s}while(d);return s}static findNextMatch(e,t,i,n){const s=t.parseSearchRequest();if(!s)return null;const o=new eC(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindNextMatchMultiline(e,i,o,n):this._doFindNextMatchLineByLine(e,i,o,n)}static _doFindNextMatchMultiline(e,t,i,n){const s=new Va(t.lineNumber,1),o=e.getOffsetAt(s),r=e.getLineCount(),a=e.getValueInRange(new Rh(s.lineNumber,s.column,r,e.getLineMaxColumn(r)),1),l="\r\n"===e.getEOL()?new Xb(a):null;i.reset(t.column-1);const h=i.next(a);return h?Yb(this._getMultilineMatchRange(e,o,a,l,h.index,h[0]),h,n):1!==t.lineNumber||1!==t.column?this._doFindNextMatchMultiline(e,new Va(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const s=e.getLineCount(),o=t.lineNumber,r=e.getLineContent(o),a=this._findFirstMatchInLine(i,r,o,t.column,n);if(a)return a;for(let l=1;l<=s;l++){const t=(o+l-1)%s,r=e.getLineContent(t+1),a=this._findFirstMatchInLine(i,r,t+1,1,n);if(a)return a}return null}static _findFirstMatchInLine(e,t,i,n,s){e.reset(n-1);const o=e.next(t);return o?Yb(new Rh(i,o.index+1,i,o.index+1+o[0].length),o,s):null}static findPreviousMatch(e,t,i,n){const s=t.parseSearchRequest();if(!s)return null;const o=new eC(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindPreviousMatchMultiline(e,i,o,n):this._doFindPreviousMatchLineByLine(e,i,o,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const s=this._doFindMatchesMultiline(e,new Rh(1,1,t.lineNumber,t.column),i,n,9990);if(s.length>0)return s[s.length-1];const o=e.getLineCount();return t.lineNumber!==o||t.column!==e.getLineMaxColumn(o)?this._doFindPreviousMatchMultiline(e,new Va(o,e.getLineMaxColumn(o)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const s=e.getLineCount(),o=t.lineNumber,r=e.getLineContent(o).substring(0,t.column-1),a=this._findLastMatchInLine(i,r,o,n);if(a)return a;for(let l=1;l<=s;l++){const t=(s+o-l-1)%s,r=e.getLineContent(t+1),a=this._findLastMatchInLine(i,r,t+1,n);if(a)return a}return null}static _findLastMatchInLine(e,t,i,n){let s,o=null;for(e.reset(0);s=e.next(t);)o=Yb(new Rh(i,s.index+1,i,s.index+1+s[0].length),s,n);return o}}function Jb(e,t,i,n,s){return function(e,t,i,n,s){if(0===n)return!0;const o=t.charCodeAt(n-1);if(0!==e.get(o))return!0;if(13===o||10===o)return!0;if(s>0){const i=t.charCodeAt(n);if(0!==e.get(i))return!0}return!1}(e,t,0,n,s)&&function(e,t,i,n,s){if(n+s===i)return!0;const o=t.charCodeAt(n+s);if(0!==e.get(o))return!0;if(13===o||10===o)return!0;if(s>0){const i=t.charCodeAt(n+s-1);if(0!==e.get(i))return!0}return!1}(e,t,i,n,s)}class eC{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)return null;if(i=this._searchRegex.exec(e),!i)return null;const n=i.index,s=i[0].length;if(n===this._prevMatchStartIndex&&s===this._prevMatchLength){if(0===s){Lo(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=n,this._prevMatchLength=s,!this._wordSeparators||Jb(this._wordSeparators,e,t,n,s))return i}while(i);return null}}const tC=65535;function iC(e){let t;return t=e[e.length-1]<65536?new Uint16Array(e.length):new Uint32Array(e.length),t.set(e,0),t}class nC{constructor(e,t,i,n,s){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=s}}function sC(e,t=!0){const i=[0];let n=1;for(let s=0,o=e.length;s(e!==Mb&&this._pieces.push(e.piece),!0)))}read(){return 0===this._pieces.length?0===this._index?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:0===this._index?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class lC{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)}if(t){const e=[];for(const t of i)null!==t&&e.push(t);this._cache=e}}}class hC{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new rC("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Mb,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let s=0,o=e.length;s0){e[s].lineStarts||(e[s].lineStarts=sC(e[s].buffer));const t=new oC(s+1,{line:0,column:0},{line:e[s].lineStarts.length-1,column:e[s].buffer.length-e[s].lineStarts[e[s].lineStarts.length-1]},e[s].lineStarts.length-1,e[s].buffer.length);this._buffers.push(e[s]),n=this.rbInsertRight(n,t)}this._searchCache=new lC(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=tC,i=t-Math.floor(21845),n=2*i;let s="",o=0;const r=[];if(this.iterate(this.root,(t=>{const a=this.getNodeContent(t),l=a.length;if(o<=i||o+l0){const t=s.replace(/\r\n|\r|\n/g,e);r.push(new rC(t,sC(t)))}this.create(r,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new aC(this,e)}getOffsetAt(e,t){let i=0,n=this.root;for(;n!==Mb;)if(n.left!==Mb&&n.lf_left+1>=e)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt+1>=e){i+=n.size_left;return i+(this.getAccumulatedValue(n,e-n.lf_left-2)+t-1)}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!==Mb;)if(0!==t.size_left&&t.size_left>=e)t=t.left;else{if(t.size_left+t.piece.length>=e){const s=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+s.index,0===s.index){const e=this.getOffsetAt(i+1,1);return new Va(i+1,n-e+1)}return new Va(i+1,s.remainder+1)}if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===Mb){const t=this.getOffsetAt(i+1,1);return new Va(i+1,n-e-t+1)}t=t.right}return new Va(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),s=this.getValueInRange2(i,n);return t?t===this._EOL&&this._EOLNormalized&&t===this.getEOL()&&this._EOLNormalized?s:s.replace(/\r\n|\r|\n/g,t):s}getValueInRange2(e,t){if(e.node===t.node){const i=e.node,n=this._buffers[i.piece.bufferIndex].buffer,s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n.substring(s+e.remainder,s+t.remainder)}let i=e.node;const n=this._buffers[i.piece.bufferIndex].buffer,s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let o=n.substring(s+e.remainder,s+i.piece.length);for(i=i.next();i!==Mb;){const e=this._buffers[i.piece.bufferIndex].buffer,n=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){o+=e.substring(n,n+t.remainder);break}o+=e.substr(n,i.piece.length),i=i.next()}return o}getLinesContent(){const e=[];let t=0,i="",n=!1;return this.iterate(this.root,(s=>{if(s===Mb)return!0;const o=s.piece;let r=o.length;if(0===r)return!0;const a=this._buffers[o.bufferIndex].buffer,l=this._buffers[o.bufferIndex].lineStarts,h=o.start.line,d=o.end.line;let c=l[h]+o.start.column;if(n&&(10===a.charCodeAt(c)&&(c++,r--),e[t++]=i,i="",n=!1,0===r))return!0;if(h===d)return this._EOLNormalized||13!==a.charCodeAt(c+r-1)?i+=a.substr(c,r):(n=!0,i+=a.substr(c,r-1)),!0;i+=this._EOLNormalized?a.substring(c,Math.max(c,l[h+1]-this._EOLLength)):a.substring(c,l[h+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let n=h+1;ne+g,t.reset(0)):(_=c.buffer,v=e=>e,t.reset(g));do{if(m=t.next(_),m){if(v(m.index)>=p)return h;this.positionInBuffer(e,v(m.index)-u,f);const t=this.getLineFeedCnt(e.piece.bufferIndex,s,f),o=f.line===s.line?f.column-s.column+n:f.column+1,r=o+m[0].length;if(d[h++]=Yb(new Rh(i+t,o,i+t,r),m,a),v(m.index)+m[0].length>=p)return h;if(h>=l)return h}}while(m);return h}findMatchesLineByLine(e,t,i,n){const s=[];let o=0;const r=new eC(t.wordSeparators,t.regex);let a=this.nodeAt2(e.startLineNumber,e.startColumn);if(null===a)return[];const l=this.nodeAt2(e.endLineNumber,e.endColumn);if(null===l)return[];let h=this.positionInBuffer(a.node,a.remainder);const d=this.positionInBuffer(l.node,l.remainder);if(a.node===l.node)return this.findMatchesInNode(a.node,r,e.startLineNumber,e.startColumn,h,d,t,i,n,o,s),s;let c=e.startLineNumber,u=a.node;for(;u!==l.node;){const l=this.getLineFeedCnt(u.piece.bufferIndex,h,u.piece.end);if(l>=1){const a=this._buffers[u.piece.bufferIndex].lineStarts,d=this.offsetInBuffer(u.piece.bufferIndex,u.piece.start),g=a[h.line+l],p=c===e.startLineNumber?e.startColumn:1;if(o=this.findMatchesInNode(u,r,c,p,h,this.positionInBuffer(u,g-d),t,i,n,o,s),o>=n)return s;c+=l}const d=c===e.startLineNumber?e.startColumn-1:0;if(c===e.endLineNumber){const a=this.getLineContent(c).substring(d,e.endColumn-1);return o=this._findMatchesInLine(t,r,a,e.endLineNumber,d,o,s,i,n),s}if(o=this._findMatchesInLine(t,r,this.getLineContent(c).substr(d),c,d,o,s,i,n),o>=n)return s;c++,a=this.nodeAt2(c,1),u=a.node,h=this.positionInBuffer(a.node,a.remainder)}if(c===e.endLineNumber){const a=c===e.startLineNumber?e.startColumn-1:0,l=this.getLineContent(c).substring(a,e.endColumn-1);return o=this._findMatchesInLine(t,r,l,e.endLineNumber,a,o,s,i,n),s}const g=c===e.startLineNumber?e.startColumn:1;return o=this.findMatchesInNode(l.node,r,c,g,h,d,t,i,n,o,s),s}_findMatchesInLine(e,t,i,n,s,o,r,a,l){const h=e.wordSeparators;if(!a&&e.simpleSearch){const t=e.simpleSearch,a=t.length,d=i.length;let c=-a;for(;-1!==(c=i.indexOf(t,c+a));)if((!h||Jb(h,i,d,c,a))&&(r[o++]=new Dd(new Rh(n,c+1+s,n,c+1+a+s),null),o>=l))return o;return o}let d;t.reset(0);do{if(d=t.next(i),d&&(r[o++]=Yb(new Rh(n,d.index+1+s,n,d.index+1+d[0].length+s),d,a),o>=l))return o}while(d);return o}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==Mb){const{node:i,remainder:n,nodeStartOffset:s}=this.nodeAt(e),o=i.piece,r=o.bufferIndex,a=this.positionInBuffer(i,n);if(0===i.piece.bufferIndex&&o.end.line===this._lastChangeBufferPos.line&&o.end.column===this._lastChangeBufferPos.column&&s+o.length===e&&t.lengthe){const e=[];let s=new oC(o.bufferIndex,a,o.end,this.getLineFeedCnt(o.bufferIndex,a,o.end),this.offsetInBuffer(r,o.end)-this.offsetInBuffer(r,a));if(this.shouldCheckCRLF()&&this.endWithCR(t)){if(10===this.nodeCharCodeAt(i,n)){const e={line:s.start.line+1,column:0};s=new oC(s.bufferIndex,e,s.end,this.getLineFeedCnt(s.bufferIndex,e,s.end),s.length-1),t+="\n"}}if(this.shouldCheckCRLF()&&this.startWithLF(t)){if(13===this.nodeCharCodeAt(i,n-1)){const s=this.positionInBuffer(i,n-1);this.deleteNodeTail(i,s),t="\r"+t,0===i.piece.length&&e.push(i)}else this.deleteNodeTail(i,a)}else this.deleteNodeTail(i,a);const l=this.createNewPieces(t);s.length>0&&this.rbInsertRight(i,s);let h=i;for(let t=0;t=0;o--)s=this.rbInsertLeft(s,n[o]);this.validateCRLFWithPrevNode(s),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+="\n");const i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]);let s=n;for(let o=1;o=d))break;a=h+1}return i?(i.line=h,i.column=r-c,null):{line:h,column:r-c}}getLineFeedCnt(e,t,i){if(0===i.column)return i.line-t.line;const n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;const s=n[i.line+1],o=n[i.line]+i.column;if(s>o+1)return i.line-t.line;const r=o-1;return 13===this._buffers[e].buffer.charCodeAt(r)?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;ttC){const t=[];for(;e.length>tC;){const i=e.charCodeAt(65534);let n;13===i||i>=55296&&i<=56319?(n=e.substring(0,65534),e=e.substring(65534)):(n=e.substring(0,tC),e=e.substring(tC));const s=sC(n);t.push(new oC(this._buffers.length,{line:0,column:0},{line:s.length-1,column:n.length-s[s.length-1]},s.length-1,n.length)),this._buffers.push(new rC(n,s))}const i=sC(e);return t.push(new oC(this._buffers.length,{line:0,column:0},{line:i.length-1,column:e.length-i[i.length-1]},i.length-1,e.length)),this._buffers.push(new rC(e,i)),t}let t=this._buffers[0].buffer.length;const i=sC(e,!1);let n=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&0!==t&&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 e=0;e=e-1)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt>e-1){const n=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1),a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return s+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:s,nodeStartLineNumber:o-(e-1-i.lf_left)}),a.substring(l+n,l+r-t)}if(i.lf_left+i.piece.lineFeedCnt===e-1){const t=this.getAccumulatedValue(i,e-i.lf_left-2),s=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=s.substring(o+t,o+i.piece.length);break}e-=i.lf_left+i.piece.lineFeedCnt,s+=i.size_left+i.piece.length,i=i.right}}for(i=i.next();i!==Mb;){const e=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const s=this.getAccumulatedValue(i,0),o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n+=e.substring(o,o+s-t),n}{const t=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=e.substr(t,i.piece.length)}i=i.next()}return n}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==Mb;)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),s=n.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){const t=this.getLineFeedCnt(e.piece.bufferIndex,i.start,n);if(t!==s)return{index:t,remainder:0}}return{index:s,remainder:n.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,n=this._buffers[i.bufferIndex].lineStarts,s=i.start.line+t+1;return s>i.end.line?n[i.end.line]+i.end.column-n[i.start.line]-i.start.column:n[s]-n[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,n=i.lineFeedCnt,s=this.offsetInBuffer(i.bufferIndex,i.end),o=t,r=this.offsetInBuffer(i.bufferIndex,o),a=this.getLineFeedCnt(i.bufferIndex,i.start,o),l=a-n,h=r-s,d=i.length+h;e.piece=new oC(i.bufferIndex,i.start,o,a,d),Hb(this,e,h,l)}deleteNodeHead(e,t){const i=e.piece,n=i.lineFeedCnt,s=this.offsetInBuffer(i.bufferIndex,i.start),o=t,r=this.getLineFeedCnt(i.bufferIndex,o,i.end),a=r-n,l=s-this.offsetInBuffer(i.bufferIndex,o),h=i.length+l;e.piece=new oC(i.bufferIndex,o,i.end,r,h),Hb(this,e,l,a)}shrinkNode(e,t,i){const n=e.piece,s=n.start,o=n.end,r=n.length,a=n.lineFeedCnt,l=t,h=this.getLineFeedCnt(n.bufferIndex,n.start,l),d=this.offsetInBuffer(n.bufferIndex,t)-this.offsetInBuffer(n.bufferIndex,s);e.piece=new oC(n.bufferIndex,n.start,l,h,d),Hb(this,e,d-r,h-a);const c=new oC(n.bufferIndex,i,o,this.getLineFeedCnt(n.bufferIndex,i,o),this.offsetInBuffer(n.bufferIndex,o)-this.offsetInBuffer(n.bufferIndex,i)),u=this.rbInsertRight(e,c);this.validateCRLFWithPrevNode(u)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+="\n");const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const s=sC(t,!1);for(let c=0;ce)t=t.left;else{if(t.size_left+t.piece.length>=e){n+=t.size_left;const i={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(i),i}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!==Mb;)if(i.left!==Mb&&i.lf_left>=e-1)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt>e-1){const s=this.getAccumulatedValue(i,e-i.lf_left-2),o=this.getAccumulatedValue(i,e-i.lf_left-1);return n+=i.size_left,{node:i,remainder:Math.min(s+t-1,o),nodeStartOffset:n}}if(i.lf_left+i.piece.lineFeedCnt===e-1){const s=this.getAccumulatedValue(i,e-i.lf_left-2);if(s+t-1<=i.piece.length)return{node:i,remainder:s+t-1,nodeStartOffset:n};t-=i.piece.length-s;break}e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==Mb;){if(i.piece.lineFeedCnt>0){const e=this.getAccumulatedValue(i,0),n=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,e),nodeStartOffset:n}}if(i.piece.length>=t-1){return{node:i,remainder:t-1,nodeStartOffset:this.offsetOfNode(i)}}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&&"\n"===this._EOL)}startWithLF(e){if("string"==typeof e)return 10===e.charCodeAt(0);if(e===Mb||0===e.piece.lineFeedCnt)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,s=i[n]+t.start.column;if(n===i.length-1)return!1;return!(i[n+1]>s+1)&&10===this._buffers[t.bufferIndex].buffer.charCodeAt(s)}endWithCR(e){return"string"==typeof e?13===e.charCodeAt(e.length-1):e!==Mb&&0!==e.piece.lineFeedCnt&&13===this.nodeCharCodeAt(e,e.piece.length-1)}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 s;s=0===e.piece.end.column?{line:e.piece.end.line-1,column:n[e.piece.end.line]-n[e.piece.end.line-1]-1}:{line:e.piece.end.line,column:e.piece.end.column-1};const o=e.piece.length-1,r=e.piece.lineFeedCnt-1;e.piece=new oC(e.piece.bufferIndex,e.piece.start,s,r,o),Hb(this,e,-1,-1),0===e.piece.length&&i.push(e);const a={line:t.piece.start.line+1,column:0},l=t.piece.length-1,h=this.getLineFeedCnt(t.piece.bufferIndex,a,t.piece.end);t.piece=new oC(t.piece.bufferIndex,a,t.piece.end,h,l),Hb(this,t,-1,-1),0===t.piece.length&&i.push(t);const d=this.createNewPieces("\r\n");this.rbInsertRight(e,d[0]);for(let c=0;ce.sortIndex-t.sortIndex))}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=s,this._mightContainNonBasicASCII=o;const u=this._doApplyEdits(a);let g=null;if(t&&d.length>0){d.sort(((e,t)=>t.lineNumber-e.lineNumber)),g=[];for(let e=0,t=d.length;e0&&d[e-1].lineNumber===t)continue;const i=d[e].oldContent,n=this.getLineContent(t);0!==n.length&&n!==i&&-1===ro(n)&&g.push(t)}}return this._onDidChangeContent.fire(),new Ed(c,u,g)}_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,s=new Rh(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let o=i.startLineNumber,r=i.startColumn;const a=[];for(let u=0,g=e.length;u0&&a.push(i.text),o=n.endLineNumber,r=n.endColumn}const l=a.join(""),[h,d,c]=hc(l);return{sortIndex:0,identifier:e[0].identifier,range:s,rangeOffset:this.getOffsetAt(s.startLineNumber,s.startColumn),rangeLength:this.getValueLengthInRange(s,0),text:l,eolCount:h,firstLineLength:d,lastLineLength:c,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(dC._sortOpsDescending);const t=[];for(let i=0;i0){const e=r.eolCount+1;h=1===e?new Rh(a,l,a,l+r.firstLineLength):new Rh(a,l,a+e-1,r.lastLineLength+1)}else h=new Rh(a,l,a,l);i=h.endLineNumber,n=h.endColumn,t.push(h),s=r}return t}static _sortOpsAscending(e,t){const i=Rh.compareRangesUsingEnds(e.range,t.range);return 0===i?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=Rh.compareRangesUsingEnds(e.range,t.range);return 0===i?t.sortIndex-e.sortIndex:-i}}class cC{constructor(e,t,i,n,s,o,r,a,l){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=s,this._containsRTL=o,this._containsUnusualLineTerminators=r,this._isBasicASCII=a,this._normalizeEOL=l}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return 0===t?1===e?"\n":"\r\n":i>t/2?"\r\n":"\n"}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&("\r\n"===t&&(this._cr>0||this._lf>0)||"\n"===t&&(this._cr>0||this._crlf>0)))for(let s=0,o=i.length;s=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||0!==e.length)&&(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=function(e,t){e.length=0,e[0]=0;let i=1,n=0,s=0,o=0,r=!0;for(let l=0,h=t.length;l126)&&(r=!1)}const a=new nC(iC(e),n,s,o,r);return e.length=0,a}(this._tmpLineStarts,e);this.chunks.push(new rC(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=Io(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=Ao(e)))}finish(e=!0){return this._finish(),new cC(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(0===this.chunks.length&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=sC(e.buffer);e.lineStarts=t,13===this._previousChar&&this.cr++}}}var gC,pC,mC,fC,_C=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class vC extends E{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()}resolve(){return _C(this,void 0,void 0,(function*(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}))}_create(){return _C(this,void 0,void 0,(function*(){const e=yield this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}))}}class bC{constructor(e,t,i){this.offset=e,this.type=t,this.language=i,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}}class CC{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class wC{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}!function(e){const t=new Map;t.set(0,Jr.symbolMethod),t.set(1,Jr.symbolFunction),t.set(2,Jr.symbolConstructor),t.set(3,Jr.symbolField),t.set(4,Jr.symbolVariable),t.set(5,Jr.symbolClass),t.set(6,Jr.symbolStruct),t.set(7,Jr.symbolInterface),t.set(8,Jr.symbolModule),t.set(9,Jr.symbolProperty),t.set(10,Jr.symbolEvent),t.set(11,Jr.symbolOperator),t.set(12,Jr.symbolUnit),t.set(13,Jr.symbolValue),t.set(15,Jr.symbolEnum),t.set(14,Jr.symbolConstant),t.set(15,Jr.symbolEnum),t.set(16,Jr.symbolEnumMember),t.set(17,Jr.symbolKeyword),t.set(27,Jr.symbolSnippet),t.set(18,Jr.symbolText),t.set(19,Jr.symbolColor),t.set(20,Jr.symbolFile),t.set(21,Jr.symbolReference),t.set(22,Jr.symbolCustomColor),t.set(23,Jr.symbolFolder),t.set(24,Jr.symbolTypeParameter),t.set(25,Jr.account),t.set(26,Jr.issues),e.toIcon=function(e){let i=t.get(e);return i||(console.info("No codicon found for CompletionItemKind "+e),i=Jr.symbolProperty),i};const i=new Map;i.set("method",0),i.set("function",1),i.set("constructor",2),i.set("field",3),i.set("variable",4),i.set("class",5),i.set("struct",6),i.set("interface",7),i.set("module",8),i.set("property",9),i.set("event",10),i.set("operator",11),i.set("unit",12),i.set("value",13),i.set("constant",14),i.set("enum",15),i.set("enum-member",16),i.set("enumMember",16),i.set("keyword",17),i.set("snippet",27),i.set("text",18),i.set("color",19),i.set("file",20),i.set("reference",21),i.set("customcolor",22),i.set("folder",23),i.set("type-parameter",24),i.set("typeParameter",24),i.set("account",25),i.set("issue",26),e.fromString=function(e,t){let n=i.get(e);return void 0!==n||t||(n=9),n}}(gC||(gC={})),function(e){e[e.Automatic=0]="Automatic",e[e.Explicit=1]="Explicit"}(pC||(pC={}));class yC{constructor(e,t,i,n){this.range=e,this.text=t,this.completionKind=i,this.isSnippetText=n}equals(e){return Rh.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}!function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(mC||(mC={})),function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}(fC||(fC={}));const SC={17:ue(0,"array"),16:ue(0,"boolean"),4:ue(0,"class"),13:ue(0,"constant"),8:ue(0,"constructor"),9:ue(0,"enumeration"),21:ue(0,"enumeration member"),23:ue(0,"event"),7:ue(0,"field"),0:ue(0,"file"),11:ue(0,"function"),10:ue(0,"interface"),19:ue(0,"key"),5:ue(0,"method"),1:ue(0,"module"),2:ue(0,"namespace"),20:ue(0,"null"),15:ue(0,"number"),18:ue(0,"object"),24:ue(0,"operator"),3:ue(0,"package"),6:ue(0,"property"),14:ue(0,"string"),22:ue(0,"struct"),25:ue(0,"type parameter"),12:ue(0,"variable")};var LC,kC,DC;!function(e){const t=new Map;t.set(0,Jr.symbolFile),t.set(1,Jr.symbolModule),t.set(2,Jr.symbolNamespace),t.set(3,Jr.symbolPackage),t.set(4,Jr.symbolClass),t.set(5,Jr.symbolMethod),t.set(6,Jr.symbolProperty),t.set(7,Jr.symbolField),t.set(8,Jr.symbolConstructor),t.set(9,Jr.symbolEnum),t.set(10,Jr.symbolInterface),t.set(11,Jr.symbolFunction),t.set(12,Jr.symbolVariable),t.set(13,Jr.symbolConstant),t.set(14,Jr.symbolString),t.set(15,Jr.symbolNumber),t.set(16,Jr.symbolBoolean),t.set(17,Jr.symbolArray),t.set(18,Jr.symbolObject),t.set(19,Jr.symbolKey),t.set(20,Jr.symbolNull),t.set(21,Jr.symbolEnumMember),t.set(22,Jr.symbolStruct),t.set(23,Jr.symbolEvent),t.set(24,Jr.symbolOperator),t.set(25,Jr.symbolTypeParameter),e.toIcon=function(e){let i=t.get(e);return i||(console.info("No codicon found for SymbolKind "+e),i=Jr.symbolProperty),i}}(LC||(LC={}));class xC{static fromValue(e){switch(e){case"comment":return xC.Comment;case"imports":return xC.Imports;case"region":return xC.Region}return new xC(e)}constructor(e){this.value=e}}xC.Comment=new xC("comment"),xC.Imports=new xC("imports"),xC.Region=new xC("region"),function(e){e.is=function(e){return!(!e||"object"!=typeof e)&&("string"==typeof e.id&&"string"==typeof e.title)}}(kC||(kC={})),function(e){e[e.Type=1]="Type",e[e.Parameter=2]="Parameter"}(DC||(DC={}));class NC{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 EC=new class{constructor(){this._tokenizationSupports=new Map,this._factories=new Map,this._onDidChange=new U,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]),x((()=>{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))}))}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){var i;null===(i=this._factories.get(e))||void 0===i||i.dispose();const n=new vC(this,e,t);return this._factories.set(e,n),x((()=>{const t=this._factories.get(e);t&&t===n&&(this._factories.delete(e),t.dispose())}))}getOrCreate(e){return _C(this,void 0,void 0,(function*(){const t=this.get(e);if(t)return t;const i=this._factories.get(e);return!i||i.isResolved?null:(yield i.resolve(),this.get(e))}))}isResolved(e){if(this.get(e))return!0;const t=this._factories.get(e);return!(t&&!t.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>2?this._colorMap[2]:null}},IC=new class{clone(){return this}equals(e){return this===e}};function MC(e,t){return new CC([new bC(0,"",e)],t)}function TC(e,t){const i=new Uint32Array(2);return i[0]=0,i[1]=(32768|e|2<<24)>>>0,new wC(i,null===t?IC:t)}class RC{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(0===t)return void this.insert(e,i);if(0===i)return void this.delete(e,t);const n=this._store.slice(0,e),s=this._store.slice(e+t),o=function(e,t){const i=[];for(let n=0;n=this._store.length||this._store.splice(e,t)}insert(e,t){if(0===t||e>=this._store.length)return;const i=[];for(let n=0;n0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e)return void i.appendLineTokens(t)}this._tokens.push(new AC(e,[t]))}finalize(){return this._tokens}}class PC{static createEmpty(e,t){const i=PC.defaultTokenMetadata,n=new Uint32Array(2);return n[0]=e.length,n[1]=i,new PC(n,e,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 PC&&this.slicedEquals(e,0,this._tokensCount)}slicedEquals(e,t,i){if(this._text!==e._text)return!1;if(this._tokensCount!==e._tokensCount)return!1;const n=t<<1,s=n+(i<<1);for(let o=n;o0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[1+(e<<1)]}getLanguageId(e){const t=this._tokens[1+(e<<1)],i=Gg.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[1+(e<<1)];return Gg.getTokenType(t)}getForeground(e){const t=this._tokens[1+(e<<1)];return Gg.getForeground(t)}getClassName(e){const t=this._tokens[1+(e<<1)];return Gg.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[1+(e<<1)];return Gg.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[1+(e<<1)];return Gg.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return PC.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new FC(this,e,t,i)}static convertToEndOffset(e,t){const i=(e.length>>>1)-1;for(let n=0;n>>1)-1;for(;it&&(n=s)}return i}withInserted(e){if(0===e.length)return this;let t=0,i=0,n="";const s=new Array;let o=0;for(;;){const r=to){n+=this._text.substring(o,a.offset);const e=this._tokens[1+(t<<1)];s.push(n.length,e),o=a.offset}n+=a.text,s.push(n.length,a.tokenMetadata),i++}}return new PC(new Uint32Array(s),n,this._languageIdCodec)}}PC.defaultTokenMetadata=33587200;class FC{constructor(e,t,i,n){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=n,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let s=this._firstTokenIndex,o=e.getCount();s=i)break;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 FC&&(this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount))}getCount(){return this._tokensCount}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}}class BC{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new VC(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class WC extends BC{constructor(e,t,i,n){super(e,t),this._textModel=i,this._languageIdCodec=n}updateTokensUntilLine(e,t){const i=this._textModel.getLanguageId();for(;;){const n=this.getFirstInvalidLine();if(!n||n.lineNumber>t)break;const s=this._textModel.getLineContent(n.lineNumber),o=UC(this._languageIdCodec,i,this.tokenizationSupport,s,!0,n.startState);e.add(n.lineNumber,o.tokens),this.store.setEndState(n.lineNumber,o.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return 0;const n=this._textModel.getLanguageId(),s=this._textModel.getLineContent(e.lineNumber),o=s.substring(0,e.column-1)+t+s.substring(e.column-1),r=UC(this._languageIdCodec,n,this.tokenizationSupport,o,!0,i),a=new PC(r.tokens,o,this._languageIdCodec);if(0===a.getCount())return 0;const l=a.findTokenIndexAtOffset(e.column-1);return a.getStandardTokenType(l)}tokenizeLineWithEdit(e,t,i){const n=e.lineNumber,s=e.column,o=this.getStartState(n);if(!o)return null;const r=this._textModel.getLineContent(n),a=r.substring(0,s-1)+i+r.substring(s-1+t),l=this._textModel.getLanguageIdAtPosition(n,0),h=UC(this._languageIdCodec,l,this.tokenizationSupport,a,!0,o);return new PC(h.tokens,a,this._languageIdCodec)}isCheapToTokenize(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e1&&r>=1;r--){const e=this._textModel.getLineFirstNonWhitespaceColumn(r);if(0!==e&&(e0&&i>0&&(i--,t--),this._lineEndStates.replace(e.startLineNumber,i,t)}}class zC{constructor(){this._ranges=[]}get min(){return 0===this._ranges.length?null:this._ranges[0].start}delete(e){const t=this._ranges.findIndex((t=>t.contains(e)));if(-1!==t){const i=this._ranges[t];i.start===e?i.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new uc(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new uc(i.start,e):this._ranges.splice(t,1,new uc(i.start,e),new uc(e+1,i.endExclusive))}}addRange(e){uc.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 UC(e,t,i,n,s,o){let a=null;if(i)try{a=i.tokenizeEncoded(n,s,o.clone())}catch(Mre){r(Mre)}return a||(a=TC(e.encodeLanguageId(t),o)),PC.convertToEndOffset(a.tokens,n.length),a}class KC{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,ad((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)break;if(this._tokenizeOneInvalidLine(t)>=e)break}while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return!!this._tokenizerWithStateStore&&!this._tokenizerWithStateStore.store.allStatesValid()}_tokenizeOneInvalidLine(e){var t;const i=null===(t=this._tokenizerWithStateStore)||void 0===t?void 0:t.getFirstInvalidLine();return i?(this._tokenizerWithStateStore.updateTokensUntilLine(e,i.lineNumber),i.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new wc(e,t))}}const jC=new Uint32Array(0).buffer;class qC{static deleteBeginning(e,t){return null===e||e===jC?e:qC.delete(e,0,t)}static deleteEnding(e,t){if(null===e||e===jC)return e;const i=$C(e),n=i[i.length-2];return qC.delete(e,t,n)}static delete(e,t,i){if(null===e||e===jC||t===i)return e;const n=$C(e),s=n.length>>>1;if(0===t&&n[n.length-2]===i)return jC;const o=PC.findIndexInTokensArray(n,t),r=o>0?n[o-1<<1]:0;if(il&&(n[a++]=e,n[a++]=n[1+(c<<1)],l=e)}if(a===n.length)return e;const d=new Uint32Array(a);return d.set(n.subarray(0,a),0),d.buffer}static append(e,t){if(t===jC)return e;if(e===jC)return t;if(null===e)return e;if(null===t)return null;const i=$C(e),n=$C(t),s=n.length>>>1,o=new Uint32Array(i.length+n.length);o.set(i,0);let r=i.length;const a=i[i.length-2];for(let l=0;l>>1;let o=PC.findIndexInTokensArray(n,t);if(o>0){n[o-1<<1]===t&&o--}for(let r=o;r0}getTokens(e,t,i){let n=null;if(t1&&(t=Gg.getLanguageId(n[1])!==e),!t)return jC}if(!n||0===n.length){const i=new Uint32Array(2);return i[0]=t,i[1]=ZC(e),i.buffer}return n[n.length-2]=t,0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){0!==t&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(0===t)return;const i=[];for(let n=0;n=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;return void(this._lineTokens[t]=qC.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1))}this._lineTokens[t]=qC.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i=this._len||(0!==t?(this._lineTokens[n]=qC.deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=qC.insert(this._lineTokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)):this._lineTokens[n]=qC.insert(this._lineTokens[n],e.column-1,i))}setMultilineTokens(e,t){if(0===e.length)return{changes:[]};const i=[];for(let n=0,s=e.length;n>>0}class YC{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return 0===this._pieces.length}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let i=e;if(t.length>0){const n=t[0].getRange(),s=t[t.length-1].getRange();if(!n||!s)return e;i=e.plusRange(n).plusRange(s)}let n=null;for(let s=0,o=this._pieces.length;si.endLineNumber){n=n||{index:s};break}if(e.removeTokens(i),e.isEmpty()){this._pieces.splice(s,1),s--,o--;continue}if(e.endLineNumberi.endLineNumber){n=n||{index:s};continue}const[t,r]=e.split(i);t.isEmpty()?n=n||{index:s}:r.isEmpty()||(this._pieces.splice(s,1,t,r),s++,o++,n=n||{index:s})}return n=n||{index:this._pieces.length},t.length>0&&(this._pieces=jd(this._pieces,n.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(e,t){if(0===t.getLineContent().length)return t;const i=this._pieces;if(0===i.length)return t;const n=i[YC._findFirstPieceWithLine(i,e)].getLineTokens(e);if(!n)return t;const s=t.getCount(),o=n.getCount();let r=0;const a=[];let l=0,h=0;const d=(e,t)=>{e!==h&&(h=e,a[l++]=e,a[l++]=t)};for(let c=0;c>>0,l=~a>>>0;for(;rt)){for(;s>i&&e[s-1].startLineNumber<=t&&t<=e[s-1].endLineNumber;)s--;return s}n=s-1}}return i}acceptEdit(e,t,i,n,s){for(const o of this._pieces)o.acceptEdit(e,t,i,n,s)}}class XC extends Yv{constructor(e,t,i,n,s,o){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=i,this._bracketPairsTextModelPart=n,this._languageId=s,this._attachedViews=o,this._semanticTokens=new YC(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new U),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new U),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new U),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new QC(this._languageService.languageIdCodec,this._textModel,(()=>this._languageId),this._attachedViews)),this._register(this._languageConfigurationService.onDidChange((e=>{e.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})}))),this._register(this.grammarTokens.onDidChangeTokens((e=>{this._emitModelTokensChangedEvent(e)}))),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState((e=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()})))}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[e,i,n]=hc(t.text);this._semanticTokens.acceptEdit(t.range,e,i,n,t.text.length>0?t.text.charCodeAt(0):0)}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 f("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)}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:null!==e,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),s=n.findTokenIndexAtOffset(t.column-1),[o,r]=XC._findLanguageBoundaries(n,s),a=Ec(t.column,this.getLanguageConfiguration(n.getLanguageId(s)).getWordDefinition(),i.substring(o,r),o);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a;if(s>0&&o===t.column-1){const[o,r]=XC._findLanguageBoundaries(n,s-1),a=Ec(t.column,this.getLanguageConfiguration(n.getLanguageId(s-1)).getWordDefinition(),i.substring(o,r),o);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let n=0;for(let o=t;o>=0&&e.getLanguageId(o)===i;o--)n=e.getStartOffset(o);let s=e.getLineContent().length;for(let o=t,r=e.getCount();o{const t=this.getLanguageId();-1!==e.changedLanguages.indexOf(t)&&this.resetTokenization()}))),this.resetTokenization(),this._register(n.onDidChangeVisibleRanges((({view:e,state:t})=>{if(t){let i=this._attachedViewStates.get(e);i||(i=new JC((()=>this.refreshRanges(i.lineRanges))),this._attachedViewStates.set(e,i)),i.handleStateChange(t)}else this._attachedViewStates.deleteAndDispose(e)})))}resetTokenization(e=!0){var t;this._tokens.flush(),null===(t=this._debugBackgroundTokens)||void 0===t||t.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new VC(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const[i,n]=(()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const e=EC.get(this.getLanguageId());if(!e)return[null,null];let t;try{t=e.getInitialState()}catch(Mre){return r(Mre),[null,null]}return[e,t]})();if(this._tokenizer=i&&n?new WC(this._textModel.getLineCount(),i,this._textModel,this._languageIdCodec):null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const e={setTokens:e=>{this.setTokens(e)},backgroundTokenizationFinished:()=>{if(2===this._backgroundTokenizationState)return;this._backgroundTokenizationState=2,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(e,t)=>{var i;if(!this._tokenizer)return;const n=this._tokenizer.store.getFirstInvalidEndStateLineNumber();null!==n&&e>=n&&(null===(i=this._tokenizer)||void 0===i||i.store.setEndState(e,t))}};i&&i.createBackgroundTokenizer&&!i.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,e)),this._backgroundTokenizer.value||(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new KC(this._tokenizer,e),this._defaultBackgroundTokenizer.handleChanges()),(null==i?void 0:i.backgroundTokenizerShouldOnlyVerifyTokens)&&i.createBackgroundTokenizer?(this._debugBackgroundTokens=new GC(this._languageIdCodec),this._debugBackgroundStates=new VC(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,{setTokens:e=>{var t;null===(t=this._debugBackgroundTokens)||void 0===t||t.setMultilineTokens(e,this._textModel)},backgroundTokenizationFinished(){},setEndState:(e,t)=>{var i;null===(i=this._debugBackgroundStates)||void 0===i||i.setEndState(e,t)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){var e;null===(e=this._defaultBackgroundTokenizer)||void 0===e||e.handleChanges()}handleDidChangeContent(e){var t,i,n;if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const i of e.changes){const[e,n]=hc(i.text);this._tokens.acceptEdit(i.range,e,n),null===(t=this._debugBackgroundTokens)||void 0===t||t.acceptEdit(i.range,e,n)}null===(i=this._debugBackgroundStates)||void 0===i||i.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),null===(n=this._defaultBackgroundTokenizer)||void 0===n||n.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=wc.joinMany([...this._attachedViewStates].map((([e,t])=>t.lineRanges)));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){var i,n;if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const s=new OC,{heuristicTokens:o}=this._tokenizer.tokenizeHeuristically(s,e,t),r=this.setTokens(s.finalize());if(o)for(const a of r.changes)null===(i=this._backgroundTokenizer.value)||void 0===i||i.requestTokens(a.fromLineNumber,a.toLineNumber+1);null===(n=this._defaultBackgroundTokenizer)||void 0===n||n.checkFinished()}forceTokenization(e){var t,i;const n=new OC;null===(t=this._tokenizer)||void 0===t||t.updateTokensUntilLine(n,e),this.setTokens(n.finalize()),null===(i=this._defaultBackgroundTokenizer)||void 0===i||i.checkFinished()}isCheapToTokenize(e){return!this._tokenizer||this._tokenizer.isCheapToTokenize(e)}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){var t;const i=this._textModel.getLineContent(e),n=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,i);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const s=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,i);!n.equals(s)&&(null===(t=this._debugBackgroundTokenizer.value)||void 0===t?void 0:t.reportMismatchingTokens)&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return n}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return 0;const n=this._textModel.validatePosition(new Va(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 JC extends E{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new rd((()=>this.update()),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){Td(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()}}class ew{constructor(){this.changeType=1}}class tw{static applyInjectedText(e,t){if(!t||0===t.length)return e;let i="",n=0;for(const s of t)i+=e.substring(n,s.column-1),n=s.column-1,i+=s.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 tw(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new tw(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort(((e,t)=>e.lineNumber===t.lineNumber?e.column===t.column?e.order-t.order:e.column-t.column:e.lineNumber-t.lineNumber)),t}constructor(e,t,i,n,s){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=n,this.order=s}}class iw{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class nw{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class sw{constructor(e,t,i,n){this.changeType=4,this.injectedTexts=n,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class ow{constructor(){this.changeType=5}}class rw{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;t=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},mw=function(e,t){return function(i,n){t(i,n,e)}};function fw(e,t){let i;var n;return"string"==typeof e?i=function(e){const t=new uC;return t.acceptChunk(e),t.finish()}(e):i=(n=e)&&"function"==typeof n.read?function(e){const t=new uC;let i;for(;"string"==typeof(i=e.read());)t.acceptChunk(i);return t.finish()}(e):e,i.create(t)}let _w=0;class vw{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,i=0;for(;;){const n=this._source.read();if(null===n)return this._eos=!0,0===t?null:e.join("");if(n.length>0&&(e[t++]=n,i+=n.length),i>=65536)return e.join("")}}}const bw=()=>{throw new Error("Invalid change accessor")};let Cw=gw=class extends E{static resolveOptions(e,t){if(t.detectIndentation){const i=ob(e,t.tabSize,t.insertSpaces);return new kd({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new kd(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 D(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,s,o,r){super(),this._undoRedoService=s,this._languageService=o,this._languageConfigurationService=r,this._onWillDispose=this._register(new U),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new Rw((e=>this.handleBeforeFireDecorationsChangedEvent(e)))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new U),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new U),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new U),this._eventEmitter=this._register(new Aw),this._languageSelectionListener=this._register(new I),this._deltaDecorationCallCnt=0,this._attachedViews=new Ow,_w++,this.id="$model"+_w,this.isForSimpleWidget=i.isForSimpleWidget,this._associatedResource=null==n?an.parse("inmemory://model/"+_w):n,this._attachedEditorCount=0;const{textBuffer:a,disposable:l}=fw(e,i.defaultEOL);this._buffer=a,this._bufferDisposable=l,this._options=gw.resolveOptions(this._buffer,i);const h="string"==typeof t?t:t.languageId;"string"!=typeof t&&(this._languageSelectionListener.value=t.onDidChange((()=>this._setLanguage(t.languageId)))),this._bracketPairs=this._register(new vp(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new tb(this,this._languageConfigurationService)),this._decorationProvider=this._register(new Bv(this)),this._tokenizationTextModelPart=new XC(this._languageService,this._languageConfigurationService,this,this._bracketPairs,h,this._attachedViews);const d=this._buffer.getLineCount(),c=this._buffer.getValueLengthInRange(new Rh(1,1,d,this._buffer.getLineLength(d)+1),0);i.largeFileOptimizations?(this._isTooLargeForTokenization=c>gw.LARGE_FILE_SIZE_THRESHOLD||d>gw.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=c>gw.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=c>gw._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=Wo(_w),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new Sw,this._commandManager=new Zv(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(h)}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new dC([],"","\n",!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=E.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new lw(e,t)))}setValue(e){if(this._assertNotDisposed(),null==e)throw u();const{textBuffer:t,disposable:i}=fw(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,n,s,o,r,a){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),isEolChange:a,versionId:this.getVersionId(),isUndoing:s,isRedoing:o,isFlush:r}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),s=this.getLineCount(),o=this.getLineMaxColumn(s);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new Sw,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new rw([new ew],this._versionId,!1,!1),this._createContentChanged2(new Rh(1,1,s,o),0,n,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=1===e?"\r\n":"\n";if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),s=this.getLineCount(),o=this.getLineMaxColumn(s);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new rw([new ow],this._versionId,!1,!1),this._createContentChanged2(new Rh(1,1,s,o),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 i=this._buffer.getLineLength(n);i>=1e4?t+=i:e+=i}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=void 0!==e.tabSize?e.tabSize:this._options.tabSize,i=void 0!==e.indentSize?e.indentSize:this._options.originalIndentSize,n=void 0!==e.insertSpaces?e.insertSpaces:this._options.insertSpaces,s=void 0!==e.trimAutoWhitespace?e.trimAutoWhitespace:this._options.trimAutoWhitespace,o=void 0!==e.bracketColorizationOptions?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,r=new kd({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:s,bracketPairColorizationOptions:o});if(this._options.equals(r))return;const a=this._options.createChangeEvent(r);this._options=r,this._bracketPairs.handleDidChangeOptions(a),this._decorationProvider.handleDidChangeOptions(a),this._onDidChangeOptions.fire(a)}detectIndentation(e,t){this._assertNotDisposed();const i=ob(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),cc(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(Ro.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map((e=>({range:e.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,0);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 f("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 vw(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=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){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 f("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new f("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new f("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),"\n"===this._buffer.getEOL()?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new f("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new f("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new f("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let s=Math.floor("number"!=typeof i||isNaN(i)?1:i),o=Math.floor("number"!=typeof n||isNaN(n)?1:n);if(s<1)s=1,o=1;else if(s>t)s=t,o=this.getLineMaxColumn(s);else if(o<=1)o=1;else{const e=this.getLineMaxColumn(s);o>=e&&(o=e)}const r=e.endLineNumber,a=e.endColumn;let l=Math.floor("number"!=typeof r||isNaN(r)?1:r),h=Math.floor("number"!=typeof a||isNaN(a)?1:a);if(l<1)l=1,h=1;else if(l>t)l=t,h=this.getLineMaxColumn(l);else if(h<=1)h=1;else{const e=this.getLineMaxColumn(l);h>=e&&(h=e)}return i===s&&n===o&&r===l&&a===h&&e instanceof Rh&&!(e instanceof Ah)?e:new Rh(s,o,l,h)}_isValidPosition(e,t,i){if("number"!=typeof e||"number"!=typeof t)return!1;if(isNaN(e)||isNaN(t))return!1;if(e<1||t<1)return!1;if((0|e)!==e||(0|t)!==t)return!1;if(e>this._buffer.getLineCount())return!1;if(1===t)return!0;if(t>this.getLineMaxColumn(e))return!1;if(1===i){if(wo(this._buffer.getLineCharCode(e,t-2)))return!1}return!0}_validatePosition(e,t,i){const n=Math.floor("number"!=typeof e||isNaN(e)?1:e),s=Math.floor("number"!=typeof t||isNaN(t)?1:t),o=this._buffer.getLineCount();if(n<1)return new Va(1,1);if(n>o)return new Va(o,this.getLineMaxColumn(o));if(s<=1)return new Va(n,1);const r=this.getLineMaxColumn(n);if(s>=r)return new Va(n,r);if(1===i){if(wo(this._buffer.getLineCharCode(n,s-2)))return new Va(n,s-1)}return new Va(n,s)}validatePosition(e){return this._assertNotDisposed(),e instanceof Va&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,o=e.endColumn;if(!this._isValidPosition(i,n,0))return!1;if(!this._isValidPosition(s,o,0))return!1;if(1===t){const e=n>1?this._buffer.getLineCharCode(i,n-2):0,t=o>1&&o<=this._buffer.getLineLength(s)?this._buffer.getLineCharCode(s,o-2):0,r=wo(e),a=wo(t);return!r&&!a}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof Rh&&!(e instanceof Ah)&&this._isValidRange(e,1))return e;const t=this._validatePosition(e.startLineNumber,e.startColumn,0),i=this._validatePosition(e.endLineNumber,e.endColumn,0),n=t.lineNumber,s=t.column,o=i.lineNumber,r=i.column;{const e=s>1?this._buffer.getLineCharCode(n,s-2):0,t=r>1&&r<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,r-2):0,i=wo(e),a=wo(t);return i||a?n===o&&s===r?new Rh(n,s-1,o,r-1):i&&a?new Rh(n,s-1,o,r+1):i?new Rh(n,s-1,o,r):new Rh(n,s,o,r+1):new Rh(n,s,o,r)}}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 Rh(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,s,o,r=999){this._assertNotDisposed();let a=null;null!==t&&(Array.isArray(t)||(t=[t]),t.every((e=>Rh.isIRange(e)))&&(a=t.map((e=>this.validateRange(e))))),null===a&&(a=[this.getFullModelRange()]),a=a.sort(((e,t)=>e.startLineNumber-t.startLineNumber||e.startColumn-t.startColumn));const l=[];let h;if(l.push(a.reduce(((e,t)=>Rh.areIntersecting(e,t)?e.plusRange(t):(l.push(e),t)))),!i&&e.indexOf("\n")<0){const t=new Zb(e,i,n,s).parseSearchRequest();if(!t)return[];h=e=>this.findMatchesLineByLine(e,t,o,r)}else h=t=>Qb.findMatches(this,new Zb(e,i,n,s),t,o,r);return l.map(h).reduce(((e,t)=>e.concat(t)),[])}findNextMatch(e,t,i,n,s,o){this._assertNotDisposed();const r=this.validatePosition(t);if(!i&&e.indexOf("\n")<0){const t=new Zb(e,i,n,s).parseSearchRequest();if(!t)return null;const a=this.getLineCount();let l=new Rh(r.lineNumber,r.column,a,this.getLineMaxColumn(a)),h=this.findMatchesLineByLine(l,t,o,1);return Qb.findNextMatch(this,new Zb(e,i,n,s),r,o),h.length>0?h[0]:(l=new Rh(1,1,r.lineNumber,this.getLineMaxColumn(r.lineNumber)),h=this.findMatchesLineByLine(l,t,o,1),h.length>0?h[0]:null)}return Qb.findNextMatch(this,new Zb(e,i,n,s),r,o)}findPreviousMatch(e,t,i,n,s,o){this._assertNotDisposed();const r=this.validatePosition(t);return Qb.findPreviousMatch(this,new Zb(e,i,n,s),r,o)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if(("\n"===this.getEOL()?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof xd?e:new xd(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(e.range),text:e.text})));let n=!0;if(e)for(let t=0,s=e.length;ts.endLineNumber,r=s.startLineNumber>t.endLineNumber;if(!n&&!r){o=!0;break}}if(!o){n=!1;break}}if(n)for(let e=0,s=this._trimAutoWhitespaceLines.length;et.endLineNumber)&&!(n===t.startLineNumber&&t.startColumn===s&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(0)||n===t.startLineNumber&&1===t.startColumn&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(r.length-1))){o=!1;break}}if(o){const e=new Rh(n,1,n,s);t.push(new xd(null,e,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,n)}_applyUndo(e,t,i,n){const s=e.map((e=>{const t=this.getPositionAt(e.newPosition),i=this.getPositionAt(e.newEnd);return{range:new Rh(t.lineNumber,t.column,i.lineNumber,i.column),text:e.oldText}}));this._applyUndoRedoEdits(s,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const s=e.map((e=>{const t=this.getPositionAt(e.oldPosition),i=this.getPositionAt(e.oldEnd);return{range:new Rh(t.lineNumber,t.column,i.lineNumber,i.column),text:e.newText}}));this._applyUndoRedoEdits(s,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,s,o){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(s)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(o),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),s=this._buffer.getLineCount(),o=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,0!==o.length){for(let i=0,n=o.length;i=0;t--){const i=a+t,n=g+t;v.takeFromEndWhile((e=>e.lineNumber>n));const s=v.takeFromEndWhile((e=>e.lineNumber===n));e.push(new iw(i,this.getLineContent(n),s))}if(ce.lineNumbere.lineNumber===t))}e.push(new sw(n+1,a+d,h,l))}t+=u}this._emitContentChangedEvent(new rw(e,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:o,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return null===n.reverseEdits?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(null===e||0===e.size)return;const t=Array.from(e).map((e=>new iw(e,this.getLineContent(e),this._getInjectedTextInLine(e))));this._onDidChangeInjectedText.fire(new aw(t))}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:(t,i)=>this._deltaDecorationsImpl(e,[],[{range:t,options:i}])[0],changeDecoration:(e,t)=>{this._changeDecorationImpl(e,t)},changeDecorationOptions:(e,t)=>{this._changeDecorationOptionsImpl(e,Tw(t))},removeDecoration:t=>{this._deltaDecorationsImpl(e,[t],[])},deltaDecorations:(t,i)=>0===t.length&&0===i.length?[]:this._deltaDecorationsImpl(e,t,i)};let n=null;try{n=t(i)}catch(Mre){r(Mre)}return i.addDecoration=bw,i.changeDecoration=bw,i.changeDecorationOptions=bw,i.removeDecoration=bw,i.deltaDecorations=bw,n}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),0===e.length&&0===t.length)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),r(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:Mw[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(n),delete this._decorations[n.id],null;const s=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),r=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);return this._decorationsTree.delete(n),n.reset(this.getVersionId(),o,r,s),n.setOptions(Mw[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,s=!1){const o=this.getLineCount(),r=Math.min(o,Math.max(1,e)),a=Math.min(o,Math.max(1,t)),l=this.getLineMaxColumn(a),h=new Rh(r,1,a,l),d=this._getDecorationsInRange(h,i,n,s);return Gd(d,this._decorationProvider.getDecorationsInRange(h,i,n)),d}getDecorationsInRange(e,t=0,i=!1,n=!1,s=!1){const o=this.validateRange(e),r=this._getDecorationsInRange(o,t,i,s);return Gd(r,this._decorationProvider.getDecorationsInRange(o,t,i,n)),r}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 tw.fromDecorations(n).filter((t=>t.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 s=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),o=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,s,o,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 t=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(t.endLineNumber)}if(i.options.before){const t=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(t.startLineNumber)}const n=this._validateRangeRelaxedNoAllocations(t),s=this._buffer.getOffsetAt(n.startLineNumber,n.startColumn),o=this._buffer.getOffsetAt(n.endLineNumber,n.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),s,o,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),s=!(!t.overviewRuler||!t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(i.options),this._onDidChangeDecorations.checkAffectedAndFire(t),i.options.after||t.after){const e=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber)}if(i.options.before||t.before){const e=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber)}n!==s?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i,n=!1){const s=this.getVersionId(),o=t.length;let r=0;const a=i.length;let l=0;this._onDidChangeDecorations.beginDeferredEmit();try{const h=new Array(a);for(;rthis._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 function(e){let t=0;for(const i of e){if(" "!==i&&"\t"!==i)break;t++}return t}(this.getLineContent(e))+1}};function ww(e){return!(!e.options.overviewRuler||!e.options.overviewRuler.color)}function yw(e){return!!e.options.after||!!e.options.before}Cw._MODEL_SYNC_LIMIT=52428800,Cw.LARGE_FILE_SIZE_THRESHOLD=20971520,Cw.LARGE_FILE_LINE_COUNT_THRESHOLD=3e5,Cw.LARGE_FILE_HEAP_OPERATION_THRESHOLD=268435456,Cw.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:Sc.tabSize,indentSize:Sc.indentSize,insertSpaces:Sc.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:Sc.trimAutoWhitespace,largeFileOptimizations:Sc.largeFileOptimizations,bracketPairColorizationOptions:Sc.bracketPairColorizationOptions},Cw=gw=pw([mw(4,hw),mw(5,Lc),mw(6,Ju)],Cw);class Sw{constructor(){this._decorationsTree0=new vb,this._decorationsTree1=new vb,this._injectedTextDecorationsTree=new vb}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const i of t)null===i.range&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,n,s,o){const r=e.getVersionId(),a=this._intervalSearch(t,i,n,s,r,o);return this._ensureNodesHaveRanges(e,a)}_intervalSearch(e,t,i,n,s,o){const r=this._decorationsTree0.intervalSearch(e,t,i,n,s,o),a=this._decorationsTree1.intervalSearch(e,t,i,n,s,o),l=this._injectedTextDecorationsTree.intervalSearch(e,t,i,n,s,o);return r.concat(a).concat(l)}getInjectedTextInInterval(e,t,i,n){const s=e.getVersionId(),o=this._injectedTextDecorationsTree.intervalSearch(t,i,n,!1,s,!1);return this._ensureNodesHaveRanges(e,o).filter((e=>e.options.showIfCollapsed||!e.range.isEmpty()))}getAllInjectedText(e,t){const i=e.getVersionId(),n=this._injectedTextDecorationsTree.search(t,!1,i,!1);return this._ensureNodesHaveRanges(e,n).filter((e=>e.options.showIfCollapsed||!e.range.isEmpty()))}getAll(e,t,i,n,s){const o=e.getVersionId(),r=this._search(t,i,n,o,s);return this._ensureNodesHaveRanges(e,r)}_search(e,t,i,n,s){if(i)return this._decorationsTree1.search(e,t,n,s);{const i=this._decorationsTree0.search(e,t,n,s),o=this._decorationsTree1.search(e,t,n,s),r=this._injectedTextDecorationsTree.search(e,t,n,s);return i.concat(o).concat(r)}}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){yw(e)?this._injectedTextDecorationsTree.insert(e):ww(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){yw(e)?this._injectedTextDecorationsTree.delete(e):ww(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),null===t.range&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){yw(e)?this._injectedTextDecorationsTree.resolveNode(e,t):ww(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 Lw(e){return e.replace(/[^a-z0-9\-_]/gi," ")}class kw{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class Dw extends kw{constructor(e){super(e),this._resolvedColor=null,this.position="number"==typeof e.position?e.position:Cd.Center}getColor(e){return this._resolvedColor||("light"!==e.type&&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("string"==typeof e)return e;const i=e?t.getColor(e.id):null;return i?i.toString():""}}class xw{constructor(e){var t;this.position=null!==(t=null==e?void 0:e.position)&&void 0!==t?t:wd.Left}}class Nw extends kw{constructor(e){super(e),this.position=e.position}getColor(e){return this._resolvedColor||("light"!==e.type&&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"string"==typeof e?lc.fromHex(e):t.getColor(e.id)}}class Ew{static from(e){return e instanceof Ew?e:new Ew(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 Iw{static register(e){return new Iw(e)}static createDynamic(e){return new Iw(e)}constructor(e){var t,i,n,s,o,r;this.description=e.description,this.blockClassName=e.blockClassName?Lw(e.blockClassName):null,this.blockDoesNotCollapse=null!==(t=e.blockDoesNotCollapse)&&void 0!==t?t:null,this.blockIsAfterEnd=null!==(i=e.blockIsAfterEnd)&&void 0!==i?i:null,this.blockPadding=null!==(n=e.blockPadding)&&void 0!==n?n:null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?Lw(e.className):null,this.shouldFillLineOnLineBreak=null!==(s=e.shouldFillLineOnLineBreak)&&void 0!==s?s:null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new Dw(e.overviewRuler):null,this.minimap=e.minimap?new Nw(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new xw(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?Lw(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?Lw(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?Lw(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?Lw(e.marginClassName):null,this.inlineClassName=e.inlineClassName?Lw(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?Lw(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?Lw(e.afterContentClassName):null,this.after=e.after?Ew.from(e.after):null,this.before=e.before?Ew.from(e.before):null,this.hideInCommentTokens=null!==(o=e.hideInCommentTokens)&&void 0!==o&&o,this.hideInStringTokens=null!==(r=e.hideInStringTokens)&&void 0!==r&&r}}Iw.EMPTY=Iw.register({description:"empty"});const Mw=[Iw.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),Iw.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),Iw.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),Iw.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function Tw(e){return e instanceof Iw?e:Iw.createDynamic(e)}class Rw extends E{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new U),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;this._deferredCnt--,0===this._deferredCnt&&(this._shouldFireDeferred&&this.doFire(),null===(e=this._affectedInjectedTextLines)||void 0===e||e.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){this._affectsMinimap||(this._affectsMinimap=!(!e.minimap||!e.minimap.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!(!e.overviewRuler||!e.overviewRuler.color)),this._affectsGlyphMargin||(this._affectsGlyphMargin=!!e.glyphMarginClassName),this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){0===this._deferredCnt?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class Aw extends E{constructor(){super(),this._fastEmitter=this._register(new U),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new U),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,0===this._deferredCnt&&null!==this._deferredEvent){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){this._deferredCnt>0?this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e:(this._fastEmitter.fire(e),this._slowEmitter.fire(e))}}class Ow{constructor(){this._onDidChangeVisibleRanges=new U,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new Pw((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 Pw{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const i=e.map((e=>new wc(e.startLineNumber,e.endLineNumber+1)));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}const Fw=Dp("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},ue(0,"Overview ruler marker color for matching brackets."));class Bw{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class Ww extends E{static get(e){return e.getContribution(Ww.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new rd((()=>this._updateBrackets()),50)),this._matchBrackets=this._editor.getOption(71),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition((e=>{"never"!==this._matchBrackets&&this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeModelContent((e=>{this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeModel((e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeModelLanguageConfiguration((e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeConfiguration((e=>{e.hasChanged(71)&&(this._matchBrackets=this._editor.getOption(71),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((t=>{const i=t.getStartPosition(),n=e.bracketPairs.matchBracket(i);let s=null;if(n)n[0].containsPosition(i)&&!n[1].containsPosition(i)?s=n[1].getStartPosition():n[1].containsPosition(i)&&(s=n[0].getStartPosition());else{const t=e.bracketPairs.findEnclosingBrackets(i);if(t)s=t[1].getStartPosition();else{const t=e.bracketPairs.findNextBracket(i);t&&t.range&&(s=t.range.getStartPosition())}}return s?new Ah(s.lineNumber,s.column,s.lineNumber,s.column):new Ah(i.lineNumber,i.column,i.lineNumber,i.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 s=n.getStartPosition();let o=t.bracketPairs.matchBracket(s);if(!o&&(o=t.bracketPairs.findEnclosingBrackets(s),!o)){const e=t.bracketPairs.findNextBracket(s);e&&e.range&&(o=t.bracketPairs.matchBracket(e.range.getStartPosition()))}let r=null,a=null;if(o){o.sort(Rh.compareRangesUsingStarts);const[t,i]=o;if(r=e?t.getStartPosition():t.getEndPosition(),a=e?i.getEndPosition():i.getStartPosition(),i.containsPosition(s)){const e=r;r=a,a=e}}r&&a&&i.push(new Ah(r.lineNumber,r.column,a.lineNumber,a.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 s=t.bracketPairs.matchBracket(n);s||(s=t.bracketPairs.findEnclosingBrackets(n)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[1],text:""}]),this._editor.pushUndoStop())}))}_updateBrackets(){if("never"===this._matchBrackets)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())return this._lastBracketsData=[],void(this._lastVersionId=0);const e=this._editor.getSelections();if(e.length>100)return this._lastBracketsData=[],void(this._lastVersionId=0);const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const s=[];let o=0;for(let d=0,c=e.length;d1&&s.sort(Va.compare);const r=[];let a=0,l=0;const h=n.length;for(let d=0,c=s.length;d!0,Hw=()=>!1,zw=e=>" "===e||"\t"===e;class Uw{static shouldRecreate(e){return e.hasChanged(143)||e.hasChanged(129)||e.hasChanged(37)||e.hasChanged(76)||e.hasChanged(78)||e.hasChanged(79)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(9)||e.hasChanged(10)||e.hasChanged(14)||e.hasChanged(127)||e.hasChanged(50)||e.hasChanged(90)}constructor(e,t,i,n){var s;this.languageConfigurationService=n,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const o=i.options,r=o.get(143),a=o.get(50);this.readOnly=o.get(90),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=o.get(115),this.lineHeight=a.lineHeight,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(r.height/this.lineHeight)-2),this.useTabStops=o.get(127),this.wordSeparators=o.get(129),this.emptySelectionClipboard=o.get(37),this.copyWithSyntaxHighlighting=o.get(25),this.multiCursorMergeOverlapping=o.get(76),this.multiCursorPaste=o.get(78),this.multiCursorLimit=o.get(79),this.autoClosingBrackets=o.get(6),this.autoClosingComments=o.get(7),this.autoClosingQuotes=o.get(11),this.autoClosingDelete=o.get(9),this.autoClosingOvertype=o.get(10),this.autoSurround=o.get(14),this.autoIndent=o.get(12),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 l=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(l)for(const d of l)this.surroundingPairs[d.open]=d.close;const h=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=null!==(s=null==h?void 0:h.blockCommentStartToken)&&void 0!==s?s:null}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=null===(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)||void 0===e?void 0:e.getElectricCharacters();if(t)for(const e of t)this._electricChars[e]=!0}return this._electricChars}onElectricCharacter(e,t,i){const n=Oc(t,i-1),s=this.languageConfigurationService.getLanguageConfiguration(n.languageId).electricCharacter;return s?s.onElectricCharacter(e,n,i-n.firstCharOffset):null}normalizeIndentation(e){return cc(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return zw;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return Vw;case"never":return Hw}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return e=>-1!==i.indexOf(e)}visibleColumnFromColumn(e,t){return dc.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const n=dc.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),s=e.getLineMinColumn(t);if(no?o:n}}class Kw{static fromModelState(e){return new jw(e)}static fromViewState(e){return new qw(e)}static fromModelSelection(e){const t=Ah.liftSelection(e),i=new $w(Rh.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return Kw.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,n=e.length;is,l=n>o,h=no)continue;if(pn)continue;if(g0&&n--,Yw.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,n)}static columnSelectRight(e,t,i){let n=0;const s=Math.min(i.fromViewLineNumber,i.toViewLineNumber),o=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let a=s;a<=o;a++){const i=t.getLineMaxColumn(a),s=e.visibleColumnFromColumn(t,new Va(a,i));n=Math.max(n,s)}let r=i.toViewVisualColumn;return re.getLineMinColumn(t.lineNumber))return t.delta(void 0,-No(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new Va(i,e.getLineMaxColumn(i))}return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const n=e.getLineMinColumn(t.lineNumber),s=e.getLineContent(t.lineNumber),o=iy.atomicPosition(s,t.column-1,i,0);if(-1!==o&&o+1>=n)return new Va(t.lineNumber,o+1)}return this.leftPosition(e,t)}static left(e,t,i){const n=e.stickyTabStops?sy.leftPositionAtomicSoftTabs(t,i,e.tabSize):sy.leftPosition(t,i);return new ny(n.lineNumber,n.column,0)}static moveLeft(e,t,i,n,s){let o,r;if(i.hasSelection()&&!n)o=i.selection.startLineNumber,r=i.selection.startColumn;else{const n=i.position.delta(void 0,-(s-1)),a=t.normalizePosition(sy.clipPositionColumn(n,t),0),l=sy.left(e,t,a);o=l.lineNumber,r=l.column}return i.move(n,o,r,0)}static clipPositionColumn(e,t){return new Va(e.lineNumber,sy.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 ih?(i=h,n=r?t.getLineMaxColumn(i):Math.min(t.getLineMaxColumn(i),n)):n=e.columnFromVisibleColumn(t,i,l),s=u?0:l-dc.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),void 0!==a){const e=new Va(i,n),o=t.normalizePosition(e,a);s+=n-o.column,i=o.lineNumber,n=o.column}return new ny(i,n,s)}static down(e,t,i,n,s,o,r){return this.vertical(e,t,i,n,s,i+o,r,4)}static moveDown(e,t,i,n,s){let o,r;i.hasSelection()&&!n?(o=i.selection.endLineNumber,r=i.selection.endColumn):(o=i.position.lineNumber,r=i.position.column);let a,l=0;do{a=sy.down(e,t,o+l,r,i.leftoverVisibleColumns,s,!0);if(t.normalizePosition(new Va(a.lineNumber,a.column),2).lineNumber>o)break}while(l++<10&&o+l1&&this._isBlankLine(t,s);)s--;for(;s>1&&!this._isBlankLine(t,s);)s--;return i.move(n,s,t.getLineMinColumn(s),0)}static moveToNextBlankLine(e,t,i,n){const s=t.getLineCount();let o=i.position.lineNumber;for(;o=d.length+1)return!1;const c=d.charAt(h.column-2),u=n.get(c);if(!u)return!1;if(Zw(c)){if("never"===i)return!1}else if("never"===t)return!1;const g=d.charAt(h.column-1);let p=!1;for(const e of u)e.open===c&&e.close===g&&(p=!0);if(!p)return!1;if("auto"===e){let e=!1;for(let t=0,i=r.length;t1){const e=t.getLineContent(n.lineNumber),s=ro(e),o=-1===s?e.length+1:s+1;if(n.column<=o){const e=i.visibleColumnFromColumn(t,n),s=dc.prevIndentTabStop(e,i.indentSize),o=i.columnFromVisibleColumn(t,n.lineNumber,s);return new Rh(n.lineNumber,o,n.lineNumber,n.column)}}return Rh.fromPositions(oy.getPositionAfterDeleteLeft(n,t),n)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=zo(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}if(e.lineNumber>1){const i=e.lineNumber-1;return new Va(i,t.getLineMaxColumn(i))}return e}static cut(e,t,i){const n=[];let s=null;i.sort(((e,t)=>Va.compare(e.getStartPosition(),t.getEndPosition())));for(let o=0,r=i.length;o1&&(null==s?void 0:s.endLineNumber)!==e.lineNumber?(i=e.lineNumber-1,a=t.getLineMaxColumn(e.lineNumber-1),l=e.lineNumber,h=t.getLineMaxColumn(e.lineNumber)):(i=e.lineNumber,a=1,l=e.lineNumber,h=t.getLineMaxColumn(e.lineNumber));const d=new Rh(i,a,l,h);s=d,d.isEmpty()?n[o]=null:n[o]=new Xw(d,"")}else n[o]=null;else n[o]=new Xw(r,"")}return new Gw(0,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class ry{static _createWord(e,t,i,n,s){return{start:n,end:s,wordType:t,nextCharClass:i}}static _findPreviousWordOnLine(e,t,i){const n=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(n,e,i)}static _doFindPreviousWordOnLine(e,t,i){let n=0;for(let s=i.column-2;s>=0;s--){const i=e.charCodeAt(s),o=t.get(i);if(0===o){if(2===n)return this._createWord(e,n,o,s+1,this._findEndOfWord(e,t,n,s+1));n=1}else if(2===o){if(1===n)return this._createWord(e,n,o,s+1,this._findEndOfWord(e,t,n,s+1));n=2}else if(1===o&&0!==n)return this._createWord(e,n,o,s+1,this._findEndOfWord(e,t,n,s+1))}return 0!==n?this._createWord(e,n,1,0,this._findEndOfWord(e,t,n,0)):null}static _findEndOfWord(e,t,i,n){const s=e.length;for(let o=n;o=0;s--){const n=e.charCodeAt(s),o=t.get(n);if(1===o)return s+1;if(1===i&&2===o)return s+1;if(2===i&&0===o)return s+1}return 0}static moveWordLeft(e,t,i,n){let s=i.lineNumber,o=i.column;1===o&&s>1&&(s-=1,o=t.getLineMaxColumn(s));let r=ry._findPreviousWordOnLine(e,t,new Va(s,o));if(0===n)return new Va(s,r?r.start+1:1);if(1===n)return r&&2===r.wordType&&r.end-r.start==1&&0===r.nextCharClass&&(r=ry._findPreviousWordOnLine(e,t,new Va(s,r.start+1))),new Va(s,r?r.start+1:1);if(3===n){for(;r&&2===r.wordType;)r=ry._findPreviousWordOnLine(e,t,new Va(s,r.start+1));return new Va(s,r?r.start+1:1)}return r&&o<=r.end+1&&(r=ry._findPreviousWordOnLine(e,t,new Va(s,r.start+1))),new Va(s,r?r.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(1===t.column)return i>1?new Va(i-1,e.getLineMaxColumn(i-1)):t;const s=e.getLineContent(i);for(let o=t.column-1;o>1;o--){const e=s.charCodeAt(o-2),t=s.charCodeAt(o-1);if(95===e&&95!==t)return new Va(i,o);if(45===e&&45!==t)return new Va(i,o);if((mo(e)||po(e))&&fo(t))return new Va(i,o);if(fo(e)&&fo(t)&&o+1=a.start+1&&(a=ry._findNextWordOnLine(e,t,new Va(s,a.end+1))),o=a?a.start+1:t.getLineMaxColumn(s);return new Va(s,o)}static _moveWordPartRight(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===n)return i1?l=1:(a--,l=n.getLineMaxColumn(a)):(h&&l<=h.end+1&&(h=ry._findPreviousWordOnLine(i,n,new Va(a,h.start+1))),h?l=h.end+1:l>1?l=1:(a--,l=n.getLineMaxColumn(a))),new Rh(a,l,r.lineNumber,r.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const n=new Va(i.positionLineNumber,i.positionColumn),s=this._deleteInsideWordWhitespace(t,n);return s||this._deleteInsideWordDetermineDeleteRange(e,t,n)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return 32===i||9===i}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=i.length;if(0===n)return null;let s=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,s))return null;let o=Math.min(t.column-1,n-1);if(!this._charAtIsWhitespace(i,o))return null;for(;s>0&&this._charAtIsWhitespace(i,s-1);)s--;for(;o+11?new Rh(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumbere.start+1<=i.column&&i.column<=e.end+1,r=(e,t)=>(e=Math.min(e,i.column),t=Math.max(t,i.column),new Rh(i.lineNumber,e,i.lineNumber,t)),a=e=>{let t=e.start+1,i=e.end+1,o=!1;for(;i-11&&this._charAtIsWhitespace(n,t-2);)t--;return r(t,i)},l=ry._findPreviousWordOnLine(e,t,i);if(l&&o(l))return a(l);const h=ry._findNextWordOnLine(e,t,i);return h&&o(h)?a(h):l&&h?r(l.end+1,h.start+1):l?r(l.start+1,l.end+1):h?r(h.start+1,h.end+1):r(1,s+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=ry._moveWordPartLeft(e,i);return new Rh(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let n=t;n=c.start+1&&(c=ry._findNextWordOnLine(i,n,new Va(a,c.end+1))),c?l=c.start+1:lBoolean(e)))}class hy{static addCursorDown(e,t,i){const n=[];let s=0;for(let o=0,r=t.length;ot&&(i=t,n=e.model.getLineMaxColumn(i)),Kw.fromModelState(new $w(new Rh(o.lineNumber,1,i,n),2,0,new Va(i,n),0))}const a=t.modelState.selectionStart.getStartPosition().lineNumber;if(o.lineNumbera){const i=e.getLineCount();let n=r.lineNumber+1,s=1;return n>i&&(n=i,s=e.getLineMaxColumn(n)),Kw.fromViewState(t.viewState.move(!0,n,s,0))}{const e=t.modelState.selectionStart.getEndPosition();return Kw.fromModelState(t.modelState.move(!0,e.lineNumber,e.column,0))}}static word(e,t,i,n){const s=e.model.validatePosition(n);return Kw.fromModelState(ry.word(e.cursorConfig,e.model,t.modelState,i,s))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new Kw(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,n=t.viewState.position.column;return Kw.fromViewState(new $w(new Rh(i,n,i,n),0,0,new Va(i,n),0))}static moveTo(e,t,i,n,s){if(i){if(1===t.modelState.selectionStartKind)return this.word(e,t,i,n);if(2===t.modelState.selectionStartKind)return this.line(e,t,i,n,s)}const o=e.model.validatePosition(n),r=s?e.coordinatesConverter.validateViewPosition(new Va(s.lineNumber,s.column),o):e.coordinatesConverter.convertModelPositionToViewPosition(o);return Kw.fromViewState(t.viewState.move(i,r.lineNumber,r.column,0))}static simpleMove(e,t,i,n,s,o){switch(i){case 0:return 4===o?this._moveHalfLineLeft(e,t,n):this._moveLeft(e,t,n,s);case 1:return 4===o?this._moveHalfLineRight(e,t,n):this._moveRight(e,t,n,s);case 2:return 2===o?this._moveUpByViewLines(e,t,n,s):this._moveUpByModelLines(e,t,n,s);case 3:return 2===o?this._moveDownByViewLines(e,t,n,s):this._moveDownByModelLines(e,t,n,s);case 4:return 2===o?t.map((t=>Kw.fromViewState(sy.moveToPrevBlankLine(e.cursorConfig,e,t.viewState,n)))):t.map((t=>Kw.fromModelState(sy.moveToPrevBlankLine(e.cursorConfig,e.model,t.modelState,n))));case 5:return 2===o?t.map((t=>Kw.fromViewState(sy.moveToNextBlankLine(e.cursorConfig,e,t.viewState,n)))):t.map((t=>Kw.fromModelState(sy.moveToNextBlankLine(e.cursorConfig,e.model,t.modelState,n))));case 6:return this._moveToViewMinColumn(e,t,n);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,n);case 8:return this._moveToViewCenterColumn(e,t,n);case 9:return this._moveToViewMaxColumn(e,t,n);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,n);default:return null}}static viewportMove(e,t,i,n,s){const o=e.getCompletelyVisibleViewRange(),r=e.coordinatesConverter.convertViewRangeToModelRange(o);switch(i){case 11:{const i=this._firstLineNumberInRange(e.model,r,s),o=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,o)]}case 13:{const i=this._lastLineNumberInRange(e.model,r,s),o=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,o)]}case 12:{const i=Math.round((r.startLineNumber+r.endLineNumber)/2),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 14:{const i=[];for(let s=0,r=t.length;si.endLineNumber-1?i.endLineNumber-1:sKw.fromViewState(sy.moveLeft(e.cursorConfig,e,t.viewState,i,n))))}static _moveHalfLineLeft(e,t,i){const n=[];for(let s=0,o=t.length;sKw.fromViewState(sy.moveRight(e.cursorConfig,e,t.viewState,i,n))))}static _moveHalfLineRight(e,t,i){const n=[];for(let s=0,o=t.length;s1&&0===s.firstCharOffset){const e=sg(t,i.startLineNumber-1);e.languageId===s.languageId&&(h=e.getLineContent())}const d=o.onEnter(e,h,a,l);if(!d)return null;const c=d.indentAction;let u=d.appendText;const g=d.removeText||0;u?c===Mc.Indent&&(u="\t"+u):u=c===Mc.Indent||c===Mc.IndentOutdent?"\t":"";let p=ng(t,i.startLineNumber,i.startColumn);return g&&(p=p.substring(0,p.length-g)),{indentAction:c,appendText:u,removeText:g,indentation:p}}!function(e){e.description={description:"Move cursor to a logical position in the view",args:[{name:"Cursor move argument object",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'to': A mandatory logical position value providing where to move the cursor.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',\n\t\t\t\t\t\t'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'\n\t\t\t\t\t\t'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'\n\t\t\t\t\t\t'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'by': Unit to move. Default is computed based on 'to' value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'line', 'wrappedLine', 'character', 'halfLine'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'value': Number of units to move. Default is '1'.\n\t\t\t\t\t* 'select': If 'true' makes the selection. Default is 'false'.\n\t\t\t\t",constraint:function(e){if(!Br(e))return!1;const t=e;return!!Fr(t.to)&&(!(!Ur(t.select)&&!zr(t.select))&&(!(!Ur(t.by)&&!Fr(t.by))&&!(!Ur(t.value)&&!Vr(t.value))))},schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1}}}}]},e.RawDirection={Left:"left",Right:"right",Up:"up",Down:"down",PrevBlankLine:"prevBlankLine",NextBlankLine:"nextBlankLine",WrappedLineStart:"wrappedLineStart",WrappedLineFirstNonWhitespaceCharacter:"wrappedLineFirstNonWhitespaceCharacter",WrappedLineColumnCenter:"wrappedLineColumnCenter",WrappedLineEnd:"wrappedLineEnd",WrappedLineLastNonWhitespaceCharacter:"wrappedLineLastNonWhitespaceCharacter",ViewPortTop:"viewPortTop",ViewPortCenter:"viewPortCenter",ViewPortBottom:"viewPortBottom",ViewPortIfOutside:"viewPortIfOutside"},e.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"},e.parse=function(t){if(!t.to)return null;let i;switch(t.to){case e.RawDirection.Left:i=0;break;case e.RawDirection.Right:i=1;break;case e.RawDirection.Up:i=2;break;case e.RawDirection.Down:i=3;break;case e.RawDirection.PrevBlankLine:i=4;break;case e.RawDirection.NextBlankLine:i=5;break;case e.RawDirection.WrappedLineStart:i=6;break;case e.RawDirection.WrappedLineFirstNonWhitespaceCharacter:i=7;break;case e.RawDirection.WrappedLineColumnCenter:i=8;break;case e.RawDirection.WrappedLineEnd:i=9;break;case e.RawDirection.WrappedLineLastNonWhitespaceCharacter:i=10;break;case e.RawDirection.ViewPortTop:i=11;break;case e.RawDirection.ViewPortBottom:i=13;break;case e.RawDirection.ViewPortCenter:i=12;break;case e.RawDirection.ViewPortIfOutside:i=14;break;default:return null}let n=0;switch(t.by){case e.RawUnit.Line:n=1;break;case e.RawUnit.WrappedLine:n=2;break;case e.RawUnit.Character:n=3;break;case e.RawUnit.HalfLine:n=4}return{direction:i,unit:n,select:!!t.select,value:t.value||1}}}(dy||(dy={}));var uy,gy=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},py=function(e,t){return function(i,n){t(i,n,e)}};const my=Object.create(null);function fy(e,t){if(t<=0)return"";my[e]||(my[e]=["",e]);const i=my[e];for(let n=i.length;n<=t;n++)i[n]=i[n-1]+e;return i[t]}let _y=uy=class{static unshiftIndent(e,t,i,n,s){const o=dc.visibleColumnFromColumn(e,t,i);if(s){const e=fy(" ",n);return fy(e,dc.prevIndentTabStop(o,n)/n)}return fy("\t",dc.prevRenderTabStop(o,i)/i)}static shiftIndent(e,t,i,n,s){const o=dc.visibleColumnFromColumn(e,t,i);if(s){const e=fy(" ",n);return fy(e,dc.nextIndentTabStop(o,n)/n)}return fy("\t",dc.nextRenderTabStop(o,i)/i)}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;1===this._selection.endColumn&&i!==n&&(n-=1);const{tabSize:s,indentSize:o,insertSpaces:r}=this._opts,a=i===n;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let l=0,h=0;for(let d=i;d<=n;d++,l=h){h=0;const n=e.getLineContent(d);let c,u=ro(n);if((!this._opts.isUnshift||0!==n.length&&0!==u)&&(a||this._opts.isUnshift||0!==n.length)){if(-1===u&&(u=n.length),d>1){if(dc.visibleColumnFromColumn(n,u+1,s)%o!=0&&e.tokenization.isCheapToTokenize(d-1)){const t=cy(this._opts.autoIndent,e,new Rh(d-1,e.getLineMaxColumn(d-1),d-1,e.getLineMaxColumn(d-1)),this._languageConfigurationService);if(t){if(h=l,t.appendText)for(let e=0,i=t.appendText.length;e0&&""===t.getLineContent(l);l--)if(1===l)return{indentation:"",action:null};const r=function(e,t,i){const n=e.tokenization.getLanguageIdAtPosition(t,0);if(t>1){let s,o=-1;for(s=t-1;s>=1;s--){if(e.tokenization.getLanguageIdAtPosition(s,0)!==n)return o;const t=e.getLineContent(s);if(!i.shouldIgnore(t)&&!/^\s+$/.test(t)&&""!==t)return s;o=s}}return-1}(t,i,o);if(r<0)return null;if(r<1)return{indentation:"",action:null};const a=t.getLineContent(r);if(o.shouldIncrease(a)||o.shouldIndentNextLine(a))return{indentation:ao(a),action:Mc.Indent,line:r};if(o.shouldDecrease(a))return{indentation:ao(a),action:null,line:r};{if(1===r)return{indentation:ao(t.getLineContent(r)),action:null,line:r};const e=r-1,i=o.getIndentMetadata(t.getLineContent(e));if(!(3&i)&&4&i){let i=0;for(let n=e-1;n>0;n--)if(!o.shouldIndentNextLine(t.getLineContent(n))){i=n;break}return{indentation:ao(t.getLineContent(i+1)),action:null,line:i+1}}if(n)return{indentation:ao(t.getLineContent(r)),action:null,line:r};for(let n=r;n>0;n--){const e=t.getLineContent(n);if(o.shouldIncrease(e))return{indentation:ao(e),action:Mc.Indent,line:n};if(o.shouldIndentNextLine(e)){let e=0;for(let i=n-1;i>0;i--)if(!o.shouldIndentNextLine(t.getLineContent(n))){e=i;break}return{indentation:ao(t.getLineContent(e+1)),action:null,line:e+1}}if(o.shouldDecrease(e))return{indentation:ao(e),action:null,line:n}}return{indentation:ao(t.getLineContent(1)),action:null,line:1}}}function wy(e,t,i,n,s,o){if(e<4)return null;const r=o.getLanguageConfiguration(i);if(!r)return null;const a=o.getLanguageConfiguration(i).indentRulesSupport;if(!a)return null;const l=Cy(e,t,n,void 0,o),h=t.getLineContent(n);if(l){const i=l.line;if(void 0!==i){let o=!0;for(let e=i;ee.getLineCount()?null:n.getIndentMetadata(e.getLineContent(t)):null}class Sy{static indent(e,t,i){if(null===t||null===i)return[];const n=[];for(let s=0,o=i.length;s1){let n;for(n=i-1;n>=1;n--){if(lo(t.getLineContent(n))>=0)break}if(n<1)return null;const o=t.getLineMaxColumn(n),r=cy(e.autoIndent,t,new Rh(n,o,n,o),e.languageConfigurationService);r&&(s=r.indentation+r.appendText)}return n&&(n===Mc.Indent&&(s=Sy.shiftIndent(e,s)),n===Mc.Outdent&&(s=Sy.unshiftIndent(e,s)),s=e.normalizeIndentation(s)),s||null}static _replaceJumpToNextIndent(e,t,i,n){let s="";const o=i.getStartPosition();if(e.insertSpaces){const i=e.visibleColumnFromColumn(t,o),n=e.indentSize,r=n-i%n;for(let e=0;ethis._compositionType(i,e,s,o,r,a)));return new Gw(4,l,{shouldPushStackElementBefore:xy(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,s,o){if(!t.isEmpty())return null;const r=t.getPosition(),a=Math.max(1,r.column-n),l=Math.min(e.getLineMaxColumn(r.lineNumber),r.column+s),h=new Rh(r.lineNumber,a,r.lineNumber,l);return e.getValueInRange(h)===i&&0===o?null:new ey(h,i,0,o)}static _typeCommand(e,t,i){return i?new Jw(e,t,!0):new Xw(e,t,!0)}static _enter(e,t,i,n){if(0===e.autoIndent)return Sy._typeCommand(n,"\n",i);if(!t.tokenization.isCheapToTokenize(n.getStartPosition().lineNumber)||1===e.autoIndent){const s=ao(t.getLineContent(n.startLineNumber)).substring(0,n.startColumn-1);return Sy._typeCommand(n,"\n"+e.normalizeIndentation(s),i)}const s=cy(e.autoIndent,t,n,e.languageConfigurationService);if(s){if(s.indentAction===Mc.None)return Sy._typeCommand(n,"\n"+e.normalizeIndentation(s.indentation+s.appendText),i);if(s.indentAction===Mc.Indent)return Sy._typeCommand(n,"\n"+e.normalizeIndentation(s.indentation+s.appendText),i);if(s.indentAction===Mc.IndentOutdent){const t=e.normalizeIndentation(s.indentation),o=e.normalizeIndentation(s.indentation+s.appendText),r="\n"+o+"\n"+t;return i?new Jw(n,r,!0):new ey(n,r,-1,o.length-t.length,!0)}if(s.indentAction===Mc.Outdent){const t=Sy.unshiftIndent(e,s.indentation);return Sy._typeCommand(n,"\n"+e.normalizeIndentation(t+s.appendText),i)}}const o=ao(t.getLineContent(n.startLineNumber)).substring(0,n.startColumn-1);if(e.autoIndent>=4){const s=function(e,t,i,n,s){if(e<4)return null;t.tokenization.forceTokenization(i.startLineNumber);const o=t.tokenization.getLineTokens(i.startLineNumber),r=Oc(o,i.startColumn-1),a=r.getLineContent();let l,h,d=!1;r.firstCharOffset>0&&o.getLanguageId(0)!==r.languageId?(d=!0,l=a.substr(0,i.startColumn-1-r.firstCharOffset)):l=o.getLineContent().substring(0,i.startColumn-1),h=i.isEmpty()?a.substr(i.startColumn-1-r.firstCharOffset):sg(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-r.firstCharOffset);const c=s.getLanguageConfiguration(r.languageId).indentRulesSupport;if(!c)return null;const u=l,g=ao(l),p={tokenization:{getLineTokens:e=>t.tokenization.getLineTokens(e),getLanguageId:()=>t.getLanguageId(),getLanguageIdAtPosition:(e,i)=>t.getLanguageIdAtPosition(e,i)},getLineContent:e=>e===i.startLineNumber?u:t.getLineContent(e)},m=ao(o.getLineContent()),f=Cy(e,p,i.startLineNumber+1,void 0,s);if(!f){const e=d?m:g;return{beforeEnter:e,afterEnter:e}}let _=d?m:f.indentation;return f.action===Mc.Indent&&(_=n.shiftIndent(_)),c.shouldDecrease(h)&&(_=n.unshiftIndent(_)),{beforeEnter:d?m:g,afterEnter:_}}(e.autoIndent,t,n,{unshiftIndent:t=>Sy.unshiftIndent(e,t),shiftIndent:t=>Sy.shiftIndent(e,t),normalizeIndentation:t=>e.normalizeIndentation(t)},e.languageConfigurationService);if(s){let o=e.visibleColumnFromColumn(t,n.getEndPosition());const r=n.endColumn,a=ro(t.getLineContent(n.endLineNumber));if(n=a>=0?n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,a+1)):n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new Jw(n,"\n"+e.normalizeIndentation(s.afterEnter),!0);{let t=0;return r<=a+1&&(e.insertSpaces||(o=Math.ceil(o/e.indentSize)),t=Math.min(o+1-e.normalizeIndentation(s.afterEnter).length-1,0)),new ey(n,"\n"+e.normalizeIndentation(s.afterEnter),0,t,!0)}}}return Sy._typeCommand(n,"\n"+e.normalizeIndentation(o),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let n=0,s=i.length;nSy.shiftIndent(e,t),unshiftIndent:t=>Sy.unshiftIndent(e,t)},e.languageConfigurationService);if(null===o)return null;if(o!==e.normalizeIndentation(s)){const s=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return 0===s?Sy._typeCommand(new Rh(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(o)+n,!1):Sy._typeCommand(new Rh(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(o)+t.getLineContent(i.startLineNumber).substring(s-1,i.startColumn-1)+n,!1)}return null}static _isAutoClosingOvertype(e,t,i,n,s){if("never"===e.autoClosingOvertype)return!1;if(!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(s))return!1;for(let o=0,r=i.length;o2?l.charCodeAt(a.column-2):0)&&h)return!1;if("auto"===e.autoClosingOvertype){let e=!1;for(let t=0,i=n.length;tt.startsWith(e.open))),r=s.some((e=>t.startsWith(e.close)));return!o&&r}static _findAutoClosingPairOpen(e,t,i,n){const s=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!s)return null;let o=null;for(const r of s)if(null===o||r.open.length>o.open.length){let e=!0;for(const s of i){if(t.getValueInRange(new Rh(s.lineNumber,s.column-r.open.length+1,s.lineNumber,s.column))+n!==r.open){e=!1;break}}e&&(o=r)}return o}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 s=null;for(const o of n)o.open!==t.open&&t.open.includes(o.open)&&t.close.endsWith(o.close)&&(!s||o.open.length>s.open.length)&&(s=o);return s}static _getAutoClosingPairClose(e,t,i,n,s){for(const u of i)if(!u.isEmpty())return null;const o=i.map((e=>{const t=e.getPosition();return s?{lineNumber:t.lineNumber,beforeColumn:t.column-n.length,afterColumn:t.column}:{lineNumber:t.lineNumber,beforeColumn:t.column,afterColumn:t.column}})),r=this._findAutoClosingPairOpen(e,t,o.map((e=>new Va(e.lineNumber,e.beforeColumn))),n);if(!r)return null;let a,l;if(Zw(n))a=e.autoClosingQuotes,l=e.shouldAutoCloseBefore.quote;else{!!e.blockCommentStartToken&&r.open.includes(e.blockCommentStartToken)?(a=e.autoClosingComments,l=e.shouldAutoCloseBefore.comment):(a=e.autoClosingBrackets,l=e.shouldAutoCloseBefore.bracket)}if("never"===a)return null;const h=this._findContainedAutoClosingPair(e,r),d=h?h.close:"";let c=!0;for(const u of o){const{lineNumber:i,beforeColumn:s,afterColumn:o}=u,h=t.getLineContent(i),g=h.substring(0,s-1),p=h.substring(o-1);if(p.startsWith(d)||(c=!1),p.length>0){const t=p.charAt(0);if(!Sy._isBeforeClosingBrace(e,p)&&!l(t))return null}if(1===r.open.length&&("'"===n||'"'===n)&&"always"!==a){const t=Gb(e.wordSeparators);if(g.length>0){const e=g.charCodeAt(g.length-1);if(0===t.get(e))return null}}if(!t.tokenization.isCheapToTokenize(i))return null;t.tokenization.forceTokenization(i);const m=Oc(t.tokenization.getLineTokens(i),s-1);if(!r.shouldAutoClose(m,s-m.firstCharOffset))return null;const f=r.findNeutralCharacter();if(f){const e=t.tokenization.getTokenTypeIfInsertingCharacter(i,s,f);if(!r.isOK(e))return null}}return c?r.close.substring(0,r.close.length-d.length):r.close}static _runAutoClosingOpenCharType(e,t,i,n,s,o,r){const a=[];for(let l=0,h=n.length;lnew Xw(new Rh(e.positionLineNumber,e.positionColumn,e.positionLineNumber,e.positionColumn+1),"",!1)));return new Gw(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const h=this._getAutoClosingPairClose(t,i,s,a,!0);return null!==h?this._runAutoClosingOpenCharType(e,t,i,s,a,!0,h):null}static typeWithInterceptors(e,t,i,n,s,o,r){if(!e&&"\n"===r){const e=[];for(let t=0,o=s.length;t{const i=e.get(Wa).getFocusedCodeEditor();return!(!i||!i.hasTextFocus())&&this._runEditorCommand(e,i,t)})),e.addImplementation(1e3,"generic-dom-input-textarea",((e,t)=>{const i=Xn();return!!(i&&["input","textarea"].indexOf(i.tagName.toLowerCase())>=0)&&(this.runDOMCommand(i),!0)})),e.addImplementation(0,"generic-dom",((e,t)=>{const i=e.get(Wa).getActiveCodeEditor();return!!i&&(i.focus(),this._runEditorCommand(e,i,t))}))}_runEditorCommand(e,t,i){const n=this.runEditorCommand(e,t,i);return n||!0}}!function(e){class t extends Iy{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){if(!t.position)return;e.model.pushStackElement();e.setCursorStates(t.source,3,[hy.moveTo(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)])&&2!==t.revealType&&e.revealPrimaryCursor(t.source,!0,!0)}}e.MoveTo=Sh(new t({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),e.MoveToSelect=Sh(new t({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class i extends Iy{runCoreEditorCommand(e,t){e.model.pushStackElement();const i=this._getColumnSelectResult(e,e.getPrimaryCursorState(),e.getCursorColumnSelectData(),t);null!==i&&(e.setCursorStates(t.source,3,i.viewStates.map((e=>Kw.fromViewState(e)))),e.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:i.fromLineNumber,fromViewVisualColumn:i.fromVisualColumn,toViewLineNumber:i.toLineNumber,toViewVisualColumn:i.toVisualColumn}),i.reversed?e.revealTopMostCursor(t.source):e.revealBottomMostCursor(t.source))}}e.ColumnSelect=Sh(new class extends i{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(e,t,i,n){if(void 0===n.position||void 0===n.viewPosition||void 0===n.mouseColumn)return null;const s=e.model.validatePosition(n.position),o=e.coordinatesConverter.validateViewPosition(new Va(n.viewPosition.lineNumber,n.viewPosition.column),s),r=n.doColumnSelect?i.fromViewLineNumber:o.lineNumber,a=n.doColumnSelect?i.fromViewVisualColumn:n.mouseColumn-1;return Yw.columnSelect(e.cursorConfig,e,r,a,o.lineNumber,n.mouseColumn-1)}}),e.CursorColumnSelectLeft=Sh(new class extends i{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return Yw.columnSelectLeft(e.cursorConfig,e,i)}}),e.CursorColumnSelectRight=Sh(new class extends i{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return Yw.columnSelectRight(e.cursorConfig,e,i)}});class n extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return Yw.columnSelectUp(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectUp=Sh(new n({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:3600,linux:{primary:0}}})),e.CursorColumnSelectPageUp=Sh(new n({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:3595,linux:{primary:0}}}));class s extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return Yw.columnSelectDown(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectDown=Sh(new s({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:3602,linux:{primary:0}}})),e.CursorColumnSelectPageDown=Sh(new s({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:3596,linux:{primary:0}}}));class o extends Iy{constructor(){super({id:"cursorMove",precondition:void 0,description:dy.description})}runCoreEditorCommand(e,t){const i=dy.parse(t);i&&this._runCursorMove(e,t.source,i)}_runCursorMove(e,t,i){e.model.pushStackElement(),e.setCursorStates(t,3,o._move(e,e.getCursorStates(),i)),e.revealPrimaryCursor(t,!0)}static _move(e,t,i){const n=i.select,s=i.value;switch(i.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return hy.simpleMove(e,t,i.direction,n,s,i.unit);case 11:case 13:case 12:case 14:return hy.viewportMove(e,t,i.direction,n,s);default:return null}}}e.CursorMoveImpl=o,e.CursorMove=Sh(new o);class r extends Iy{constructor(e){super(e),this._staticArgs=e.args}runCoreEditorCommand(e,t){let i=this._staticArgs;-1===this._staticArgs.value&&(i={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:t.pageSize||e.cursorConfig.pageSize}),e.model.pushStackElement(),e.setCursorStates(t.source,3,hy.simpleMove(e,e.getCursorStates(),i.direction,i.select,i.value,i.unit)),e.revealPrimaryCursor(t.source,!0)}}e.CursorLeft=Sh(new r({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),e.CursorLeftSelect=Sh(new r({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:1039}})),e.CursorRight=Sh(new r({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),e.CursorRightSelect=Sh(new r({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:1041}})),e.CursorUp=Sh(new r({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),e.CursorUpSelect=Sh(new r({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),e.CursorPageUp=Sh(new r({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:11}})),e.CursorPageUpSelect=Sh(new r({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:1035}})),e.CursorDown=Sh(new r({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),e.CursorDownSelect=Sh(new r({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),e.CursorPageDown=Sh(new r({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:12}})),e.CursorPageDownSelect=Sh(new r({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:1036}})),e.CreateCursor=Sh(new class extends Iy{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;let i;i=t.wholeLine?hy.line(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition):hy.moveTo(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition);const n=e.getCursorStates();if(n.length>1){const s=i.modelState?i.modelState.position:null,o=i.viewState?i.viewState.position:null;for(let i=0,r=n.length;io&&(s=o);const r=new Rh(s,1,s,e.model.getLineMaxColumn(s));let a=0;if(i.at)switch(i.at){case Ty.RawAtArgument.Top:a=3;break;case Ty.RawAtArgument.Center:a=1;break;case Ty.RawAtArgument.Bottom:a=4}const l=e.coordinatesConverter.convertModelRangeToViewRange(r);e.revealRange(t.source,!1,l,a,0)}}),e.SelectAll=new class extends Ay{constructor(){super(Th)}runDOMCommand(e){ne&&(e.focus(),e.select()),e.ownerDocument.execCommand("selectAll")}runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditorCommand(n,i)}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates("keyboard",3,[hy.selectAll(e,e.getPrimaryCursorState())])}},e.SetSelection=Sh(new class extends Iy{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(e,t){t.selection&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[Kw.fromModelSelection(t.selection)]))}})}(Ry||(Ry={}));const Oy=pl.and(Oh.textInputFocus,Oh.columnSelection);function Py(e,t){$l.registerKeybindingRule({id:e,primary:t,when:Oy,weight:1})}function Fy(e){return e.register(),e}var By,Wy;Py(Ry.CursorColumnSelectLeft.id,1039),Py(Ry.CursorColumnSelectRight.id,1041),Py(Ry.CursorColumnSelectUp.id,1040),Py(Ry.CursorColumnSelectPageUp.id,1035),Py(Ry.CursorColumnSelectDown.id,1042),Py(Ry.CursorColumnSelectPageDown.id,1036),function(e){class t extends vh{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditingCommand(t,n,i||{})}}e.CoreEditingCommand=t,e.LineBreakInsert=Sh(new class extends t{constructor(){super({id:"lineBreakInsert",precondition:Oh.writable,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,Sy.lineBreakInsert(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection))))}}),e.Outdent=Sh(new class extends t{constructor(){super({id:"outdent",precondition:Oh.writable,kbOpts:{weight:0,kbExpr:pl.and(Oh.editorTextFocus,Oh.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,Sy.outdent(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)))),e.pushUndoStop()}}),e.Tab=Sh(new class extends t{constructor(){super({id:"tab",precondition:Oh.writable,kbOpts:{weight:0,kbExpr:pl.and(Oh.editorTextFocus,Oh.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,Sy.tab(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)))),e.pushUndoStop()}}),e.DeleteLeft=Sh(new class extends t{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(e,t,i){const[n,s]=oy.deleteLeft(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)),t.getCursorAutoClosedCharacters());n&&e.pushUndoStop(),e.executeCommands(this.id,s),t.setPrevEditOperationType(2)}}),e.DeleteRight=Sh(new class extends t{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(e,t,i){const[n,s]=oy.deleteRight(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)));n&&e.pushUndoStop(),e.executeCommands(this.id,s),t.setPrevEditOperationType(3)}}),e.Undo=new class extends Ay{constructor(){super(Ih)}runDOMCommand(e){e.ownerDocument.execCommand("undo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(90))return t.getModel().undo()}},e.Redo=new class extends Ay{constructor(){super(Mh)}runDOMCommand(e){e.ownerDocument.execCommand("redo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(90))return t.getModel().redo()}}}(By||(By={}));class Vy extends mh{constructor(e,t,i){super({id:e,precondition:void 0,description:i}),this._handlerId=t}runCommand(e,t){const i=e.get(Wa).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function Hy(e,t){Fy(new Vy("default:"+e,e)),Fy(new Vy(e,e,t))}Hy("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]}),Hy("replacePreviousChar"),Hy("compositionType"),Hy("compositionStart"),Hy("compositionEnd"),Hy("paste"),Hy("cut");class zy{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,s=this._selection.endColumn;if((!this._isMovingLeft||1!==n)&&(this._isMovingLeft||s!==e.getLineMaxColumn(i)))if(this._isMovingLeft){const o=new Rh(i,n-1,i,n),r=e.getValueInRange(o);t.addEditOperation(o,null),t.addEditOperation(new Rh(i,s,i,s),r)}else{const o=new Rh(i,s,i,s+1),r=e.getValueInRange(o);t.addEditOperation(o,null),t.addEditOperation(new Rh(i,n,i,n),r)}}computeCursorState(e,t){return this._isMovingLeft?new Ah(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new Ah(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class Uy extends bh{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const s of n)i.push(new zy(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}Lh(class extends Uy{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:ue(0,"Move Selected Text Left"),alias:"Move Selected Text Left",precondition:Oh.writable})}}),Lh(class extends Uy{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:ue(0,"Move Selected Text Right"),alias:"Move Selected Text Right",precondition:Oh.writable})}});Lh(class extends bh{constructor(){super({id:"editor.action.transposeLetters",label:ue(0,"Transpose Letters"),alias:"Transpose Letters",precondition:Oh.writable,kbOpts:{kbExpr:Oh.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],s=t.getSelections();for(const o of s){if(!o.isEmpty())continue;const e=o.startLineNumber,t=o.startColumn,s=i.getLineMaxColumn(e);if(1===e&&(1===t||2===t&&2===s))continue;const r=t===s?o.getPosition():sy.rightPosition(i,o.getPosition().lineNumber,o.getPosition().column),a=sy.leftPosition(i,r),l=sy.leftPosition(i,a),h=i.getValueInRange(Rh.fromPositions(l,a)),d=i.getValueInRange(Rh.fromPositions(a,r)),c=Rh.fromPositions(l,r);n.push(new Xw(c,d+h))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}});class Ky{get event(){return this.emitter.event}constructor(e,t,i){const n=e=>this.emitter.fire(e);this.emitter=new U({onWillAddFirstListener:()=>e.addEventListener(t,n,i),onDidRemoveLastListener:()=>e.removeEventListener(t,n,i)})}dispose(){this.emitter.dispose()}}!function(e){const t={total:0,min:Number.MAX_VALUE,max:0},i=Object.assign({},t),n=Object.assign({},t),s=Object.assign({},t);let o=0;const r={keydown:0,input:0,render:0};function a(){1===r.keydown&&(performance.mark("keydown/end"),r.keydown=2)}function l(){performance.mark("input/start"),r.input=1,c()}function h(){1===r.input&&(performance.mark("input/end"),r.input=2)}function d(){1===r.render&&(performance.mark("render/end"),r.render=2)}function c(){setTimeout(u)}function u(){2===r.keydown&&2===r.input&&2===r.render&&(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"),g("keydown",t),g("input",i),g("render",n),g("inputlatency",s),o++,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"),r.keydown=0,r.input=0,r.render=0)}function g(e,t){const i=performance.getEntriesByName(e)[0].duration;t.total+=i,t.min=Math.min(t.min,i),t.max=Math.max(t.max,i)}function p(e){return{average:e.total/o,max:e.max,min:e.min}}function m(e){e.total=0,e.min=Number.MAX_VALUE,e.max=0}e.onKeyDown=function(){u(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),r.keydown=1,queueMicrotask(a)},e.onBeforeInput=l,e.onInput=function(){0===r.input&&l(),queueMicrotask(h)},e.onKeyUp=function(){u()},e.onSelectionChange=function(){u()},e.onRenderStart=function(){2===r.keydown&&2===r.input&&0===r.render&&(performance.mark("render/start"),r.render=1,queueMicrotask(d),c())},e.getAndClearMeasurements=function(){if(0===o)return;const e={keydown:p(t),input:p(i),render:p(n),total:p(s),sampleCount:o};return m(t),m(i),m(n),m(s),o=0,e}}(Wy||(Wy={}));class jy{constructor(e,t,i,n,s){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=n,this.newlineCountBeforeSelection=s}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),n=e.getSelectionStart(),s=e.getSelectionEnd();let o;if(t){i.substring(0,n)===t.value.substring(0,t.selectionStart)&&(o=t.newlineCountBeforeSelection)}return new jy(i,n,s,null,o)}collapseSelection(){return this.selectionStart===this.value.length?this:new jy(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){var t,i,n,s,o,r,a,l;if(e<=this.selectionStart){const n=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(null!==(i=null===(t=this.selection)||void 0===t?void 0:t.getStartPosition())&&void 0!==i?i:null,n,-1)}if(e>=this.selectionEnd){const t=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(null!==(s=null===(n=this.selection)||void 0===n?void 0:n.getEndPosition())&&void 0!==s?s:null,t,1)}const h=this.value.substring(this.selectionStart,e);if(-1===h.indexOf(String.fromCharCode(8230)))return this._finishDeduceEditorPosition(null!==(r=null===(o=this.selection)||void 0===o?void 0:o.getStartPosition())&&void 0!==r?r:null,h,1);const d=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(null!==(l=null===(a=this.selection)||void 0===a?void 0:a.getEndPosition())&&void 0!==l?l:null,d,-1)}_finishDeduceEditorPosition(e,t,i){let n=0,s=-1;for(;-1!==(s=t.indexOf("\n",s+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(bo(e.value,t.value),e.selectionStart,t.selectionStart),s=Math.min(Co(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd),o=(e.value.substring(n,e.value.length-s),t.value.substring(n,t.value.length-s)),r=e.selectionStart-n,a=e.selectionEnd-n,l=t.selectionStart-n,h=t.selectionEnd-n;if(l===h){const t=e.selectionStart-n;return{text:o,replacePrevCharCnt:t,replaceNextCharCnt:0,positionDelta:0}}return{text:o,replacePrevCharCnt:a-r,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(bo(e.value,t.value),e.selectionEnd),n=Math.min(Co(e.value,t.value),e.value.length-e.selectionEnd),s=e.value.substring(i,e.value.length-n),o=t.value.substring(i,t.value.length-n),r=(e.selectionStart,e.selectionEnd-i),a=(t.selectionStart,t.selectionEnd-i);return{text:o,replacePrevCharCnt:r,replaceNextCharCnt:s.length-r,positionDelta:a-o.length}}}jy.EMPTY=new jy("",0,0,null,void 0);class qy{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t;return new Rh(i+1,1,i+t+1,1)}static fromEditorSelection(e,t,i,n){const s=500,o=qy._getPageOfLine(t.startLineNumber,i),r=qy._getRangeForPage(o,i),a=qy._getPageOfLine(t.endLineNumber,i),l=qy._getRangeForPage(a,i);let h=r.intersectRanges(new Rh(1,1,t.startLineNumber,t.startColumn));if(n&&e.getValueLengthInRange(h,1)>s){const t=e.modifyPosition(h.getEndPosition(),-500);h=Rh.fromPositions(t,h.getEndPosition())}const d=e.getValueInRange(h,1),c=e.getLineCount(),u=e.getLineMaxColumn(c);let g=l.intersectRanges(new Rh(t.endLineNumber,t.endColumn,c,u));if(n&&e.getValueLengthInRange(g,1)>s){const t=e.modifyPosition(g.getStartPosition(),s);g=Rh.fromPositions(g.getStartPosition(),t)}const p=e.getValueInRange(g,1);let m;if(o===a||o+1===a)m=e.getValueInRange(t,1);else{const i=r.intersectRanges(t),n=l.intersectRanges(t);m=e.getValueInRange(i,1)+String.fromCharCode(8230)+e.getValueInRange(n,1)}return n&&m.length>1e3&&(m=m.substring(0,s)+String.fromCharCode(8230)+m.substring(m.length-s,m.length)),new jy(d+m+p,d.length,d.length+m.length,t,h.endLineNumber-h.startLineNumber)}}var $y;!function(e){e.Tap="-monaco-textarea-synthetic-tap"}($y||($y={}));const Gy={forceCopyWithSyntaxHighlighting:!1};class Zy{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)}}Zy.INSTANCE=new Zy;class Yy{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){const t={text:e=e||"",replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}class Xy extends E{get textAreaState(){return this._textAreaState}constructor(e,t,i,n){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._onFocus=this._register(new U),this.onFocus=this._onFocus.event,this._onBlur=this._register(new U),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new U),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new U),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new U),this.onCut=this._onCut.event,this._onPaste=this._register(new U),this.onPaste=this._onPaste.event,this._onType=this._register(new U),this.onType=this._onType.event,this._onCompositionStart=this._register(new U),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new U),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new U),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new U),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncTriggerCut=this._register(new rd((()=>this._onCut.fire()),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new rd((()=>this.writeScreenReaderContent("asyncFocusGain")),0)),this._textAreaState=jy.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._currentComposition=null;let s=null;this._register(this._textArea.onKeyDown((e=>{const t=new St(e);(114===t.keyCode||this._currentComposition&&1===t.keyCode)&&t.stopPropagation(),t.equals(9)&&t.preventDefault(),s=t,this._onKeyDown.fire(t)}))),this._register(this._textArea.onKeyUp((e=>{const t=new St(e);this._onKeyUp.fire(t)}))),this._register(this._textArea.onCompositionStart((e=>{const t=new Yy;if(this._currentComposition)this._currentComposition=t;else{if(this._currentComposition=t,2===this._OS&&s&&s.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===e.data&&("ArrowRight"===s.code||"ArrowLeft"===s.code))return t.handleCompositionUpdate("x"),void this._onCompositionStart.fire({data:e.data});this._browser.isAndroid,this._onCompositionStart.fire({data:e.data})}}))),this._register(this._textArea.onCompositionUpdate((e=>{const t=this._currentComposition;if(!t)return;if(this._browser.isAndroid){const t=jy.readFromTextArea(this._textArea,this._textAreaState),i=jy.deduceAndroidCompositionInput(this._textAreaState,t);return this._textAreaState=t,this._onType.fire(i),void this._onCompositionUpdate.fire(e)}const i=t.handleCompositionUpdate(e.data);this._textAreaState=jy.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(i),this._onCompositionUpdate.fire(e)}))),this._register(this._textArea.onCompositionEnd((e=>{const t=this._currentComposition;if(!t)return;if(this._currentComposition=null,this._browser.isAndroid){const e=jy.readFromTextArea(this._textArea,this._textAreaState),t=jy.deduceAndroidCompositionInput(this._textAreaState,e);return this._textAreaState=e,this._onType.fire(t),void this._onCompositionEnd.fire()}const i=t.handleCompositionUpdate(e.data);this._textAreaState=jy.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(i),this._onCompositionEnd.fire()}))),this._register(this._textArea.onInput((e=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const t=jy.readFromTextArea(this._textArea,this._textAreaState),i=jy.deduceInput(this._textAreaState,t,2===this._OS);(0!==i.replacePrevCharCnt||1!==i.text.length||!wo(i.text.charCodeAt(0))&&127!==i.text.charCodeAt(0))&&(this._textAreaState=t,""===i.text&&0===i.replacePrevCharCnt&&0===i.replaceNextCharCnt&&0===i.positionDelta||this._onType.fire(i))}))),this._register(this._textArea.onCut((e=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(e),this._asyncTriggerCut.schedule()}))),this._register(this._textArea.onCopy((e=>{this._ensureClipboardGetsEditorSelection(e)}))),this._register(this._textArea.onPaste((e=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),e.preventDefault(),!e.clipboardData)return;let[t,i]=Qy.getTextData(e.clipboardData);t&&(i=i||Zy.INSTANCE.get(t),this._onPaste.fire({text:t,metadata:i}))}))),this._register(this._textArea.onFocus((()=>{const e=this._hasFocus;this._setHasFocus(!0),this._browser.isSafari&&!e&&this._hasFocus&&this._asyncFocusGainWriteScreenReaderContent.schedule()}))),this._register(this._textArea.onBlur((()=>{this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)}))),this._register(this._textArea.onSyntheticTap((()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())})))}_installSelectionChangeListener(){let e=0;return En(this._textArea.ownerDocument,"selectionchange",(t=>{if(Wy.onSelectionChange(),!this._hasFocus)return;if(this._currentComposition)return;if(!this._browser.isChrome)return;const i=Date.now(),n=i-e;if(e=i,n<5)return;const s=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),s<100)return;if(!this._textAreaState.selection)return;const o=this._textArea.getValue();if(this._textAreaState.value!==o)return;const r=this._textArea.getSelectionStart(),a=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===r&&this._textAreaState.selectionEnd===a)return;const l=this._textAreaState.deduceEditorPosition(r),h=this._host.deduceModelPosition(l[0],l[1],l[2]),d=this._textAreaState.deduceEditorPosition(a),c=this._host.deduceModelPosition(d[0],d[1],d[2]),u=new Ah(h.lineNumber,h.column,c.lineNumber,c.column);this._onSelectionChangeRequest.fire(u)}))}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.writeScreenReaderContent("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}writeScreenReaderContent(e){this._currentComposition||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};Zy.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,"\n"):t.text,i),e.preventDefault(),e.clipboardData&&Qy.setTextData(e.clipboardData,t.text,t.html,i)}}const Qy={getTextData(e){const t=e.getData(Lu.text);let i=null;const n=e.getData("vscode-editor-data");if("string"==typeof n)try{i=JSON.parse(n),1!==i.version&&(i=null)}catch(s){}if(0===t.length&&null===i&&e.files.length>0){return[Array.prototype.slice.call(e.files,0).map((e=>e.name)).join("\n"),null]}return[t,i]},setTextData(e,t,i,n){e.setData(Lu.text,t),"string"==typeof i&&e.setData("text/html",i),e.setData("vscode-editor-data",JSON.stringify(n))}};class Jy extends E{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new Ky(this._actual,"keydown")).event,this.onKeyUp=this._register(new Ky(this._actual,"keyup")).event,this.onCompositionStart=this._register(new Ky(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new Ky(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new Ky(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new Ky(this._actual,"beforeinput")).event,this.onInput=this._register(new Ky(this._actual,"input")).event,this.onCut=this._register(new Ky(this._actual,"cut")).event,this.onCopy=this._register(new Ky(this._actual,"copy")).event,this.onPaste=this._register(new Ky(this._actual,"paste")).event,this.onFocus=this._register(new Ky(this._actual,"focus")).event,this.onBlur=this._register(new Ky(this._actual,"blur")).event,this._onSyntheticTap=this._register(new U),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown((()=>Wy.onKeyDown()))),this._register(this.onBeforeInput((()=>Wy.onBeforeInput()))),this._register(this.onInput((()=>Wy.onInput()))),this._register(this.onKeyUp((()=>Wy.onKeyUp()))),this._register(En(this._actual,$y.Tap,(()=>this._onSyntheticTap.fire())))}hasFocus(){const e=Yn(this._actual);return e?e.activeElement===this._actual:!!xn(this._actual)&&this._actual.ownerDocument.activeElement===this._actual}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"backward"===this._actual.selectionDirection?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return"backward"===this._actual.selectionDirection?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const n=this._actual;let s=null;const o=Yn(n);s=o?o.activeElement:n.ownerDocument.activeElement;const r=s===n,a=n.selectionStart,l=n.selectionEnd;if(r&&a===t&&l===i)ne&&window.parent!==window&&n.focus();else{if(r)return this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),void(ne&&window.parent!==window&&n.focus());try{const e=function(e){const t=[];for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)t[i]=e.scrollTop,e=e.parentNode;return t}(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),function(e,t){for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)e.scrollTop!==t[i]&&(e.scrollTop=t[i]),e=e.parentNode}(n,e)}catch(Mre){}}}}const eS=Ba("clipboardService");var tS=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const iS="9_cutcopypaste",nS=Be||document.queryCommandSupported("cut"),sS=Be||document.queryCommandSupported("copy"),oS=void 0!==navigator.clipboard&&!ne||document.queryCommandSupported("paste");function rS(e){return e.register(),e}const aS=nS?rS(new fh({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Be?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:eh.MenubarEditMenu,group:"2_ccp",title:ue(0,"Cu&&t"),order:1},{menuId:eh.EditorContext,group:iS,title:ue(0,"Cut"),when:Oh.writable,order:1},{menuId:eh.CommandPalette,group:"",title:ue(0,"Cut"),order:1},{menuId:eh.SimpleEditorContext,group:iS,title:ue(0,"Cut"),when:Oh.writable,order:1}]})):void 0,lS=sS?rS(new fh({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Be?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:eh.MenubarEditMenu,group:"2_ccp",title:ue(0,"&&Copy"),order:2},{menuId:eh.EditorContext,group:iS,title:ue(0,"Copy"),order:2},{menuId:eh.CommandPalette,group:"",title:ue(0,"Copy"),order:1},{menuId:eh.SimpleEditorContext,group:iS,title:ue(0,"Copy"),order:2}]})):void 0;nh.appendMenuItem(eh.MenubarEditMenu,{submenu:eh.MenubarCopy,title:{value:ue(0,"Copy As"),original:"Copy As"},group:"2_ccp",order:3}),nh.appendMenuItem(eh.EditorContext,{submenu:eh.EditorContextCopy,title:{value:ue(0,"Copy As"),original:"Copy As"},group:iS,order:3}),nh.appendMenuItem(eh.EditorContext,{submenu:eh.EditorContextShare,title:{value:ue(0,"Share"),original:"Share"},group:"11_share",order:-1,when:pl.and(pl.notEquals("resourceScheme","output"),Oh.editorTextFocus)}),nh.appendMenuItem(eh.EditorTitleContext,{submenu:eh.EditorTitleContextShare,title:{value:ue(0,"Share"),original:"Share"},group:"11_share",order:-1}),nh.appendMenuItem(eh.ExplorerContext,{submenu:eh.ExplorerContextShare,title:{value:ue(0,"Share"),original:"Share"},group:"11_share",order:-1});const hS=oS?rS(new fh({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Be?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:eh.MenubarEditMenu,group:"2_ccp",title:ue(0,"&&Paste"),order:4},{menuId:eh.EditorContext,group:iS,title:ue(0,"Paste"),when:Oh.writable,order:4},{menuId:eh.CommandPalette,group:"",title:ue(0,"Paste"),order:1},{menuId:eh.SimpleEditorContext,group:iS,title:ue(0,"Paste"),when:Oh.writable,order:4}]})):void 0;class dS extends bh{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:ue(0,"Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:Oh.textInputFocus,primary:0,weight:100}})}run(e,t){if(!t.hasModel())return;!t.getOption(37)&&t.getSelection().isEmpty()||(Gy.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),Gy.forceCopyWithSyntaxHighlighting=!1)}}function cS(e,t){e&&(e.addImplementation(1e4,"code-editor",((e,i)=>{const n=e.get(Wa).getFocusedCodeEditor();if(n&&n.hasTextFocus()){const e=n.getOption(37),i=n.getSelection();return i&&i.isEmpty()&&!e||n.getContainerDomNode().ownerDocument.execCommand(t),!0}return!1})),e.addImplementation(0,"generic-dom",((e,i)=>(Qn().execCommand(t),!0))))}cS(aS,"cut"),cS(lS,"copy"),hS&&(hS.addImplementation(1e4,"code-editor",((e,t)=>{const i=e.get(Wa),n=e.get(eS),s=i.getFocusedCodeEditor();if(s&&s.hasTextFocus()){return!(!s.getContainerDomNode().ownerDocument.execCommand("paste")&&We)||tS(void 0,void 0,void 0,(function*(){const e=yield n.readText();if(""!==e){const t=Zy.INSTANCE.get(e);let i=!1,n=null,o=null;t&&(i=s.getOption(37)&&!!t.isFromEmptySelection,n=void 0!==t.multicursorText?t.multicursorText:null,o=t.mode),s.trigger("keyboard","paste",{text:e,pasteOnNewLine:i,multicursorText:n,mode:o})}}))}return!1})),hS.addImplementation(0,"generic-dom",((e,t)=>(Qn().execCommand("paste"),!0)))),sS&&Lh(dS);const uS={enableSplitViewResizing:!0,splitViewDefaultRatio:.5,renderSideBySide:!0,renderMarginRevertIcon:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0};class gS{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class pS{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class mS{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return _S(e,t)}compute(e,t,i){return i}}class fS{constructor(e,t){this.newValue=e,this.didChange=t}}function _S(e,t){if("object"!=typeof e||"object"!=typeof t||!e||!t)return new fS(t,e!==t);if(Array.isArray(e)||Array.isArray(t)){const i=Array.isArray(e)&&Array.isArray(t)&&Td(e,t);return new fS(t,!i)}let i=!1;for(const n in t)if(t.hasOwnProperty(n)){const s=_S(e[n],t[n]);s.didChange&&(e[n]=s.newValue,i=!0)}return new fS(e,i)}class vS{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return _S(e,t)}validate(e){return this.defaultValue}}class bS{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return _S(e,t)}validate(e){return void 0===e?this.defaultValue:e}compute(e,t,i){return i}}function CS(e,t){return void 0===e?t:"false"!==e&&Boolean(e)}class wS extends bS{constructor(e,t,i,n=void 0){void 0!==n&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return CS(e,this.defaultValue)}}function yS(e,t,i,n){if(void 0===e)return t;let s=parseInt(e,10);return isNaN(s)?t:(s=Math.max(i,s),s=Math.min(n,s),0|s)}class SS extends bS{static clampedInt(e,t,i,n){return yS(e,t,i,n)}constructor(e,t,i,n,s,o=void 0){void 0!==o&&(o.type="integer",o.default=i,o.minimum=n,o.maximum=s),super(e,t,i,o),this.minimum=n,this.maximum=s}validate(e){return SS.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function LS(e,t,i,n){if(void 0===e)return t;const s=kS.float(e,t);return kS.clamp(s,i,n)}class kS extends bS{static clamp(e,t,i){return ei?i:e}static float(e,t){if("number"==typeof e)return e;if(void 0===e)return t;const i=parseFloat(e);return isNaN(i)?t:i}constructor(e,t,i,n,s){void 0!==s&&(s.type="number",s.default=i),super(e,t,i,s),this.validationFn=n}validate(e){return this.validationFn(kS.float(e,this.defaultValue))}}class DS extends bS{static string(e,t){return"string"!=typeof e?t:e}constructor(e,t,i,n=void 0){void 0!==n&&(n.type="string",n.default=i),super(e,t,i,n)}validate(e){return DS.string(e,this.defaultValue)}}function xS(e,t,i,n){return"string"!=typeof e?t:n&&e in n?n[e]:-1===i.indexOf(e)?t:e}class NS extends bS{constructor(e,t,i,n,s=void 0){void 0!==s&&(s.type="string",s.enum=n,s.default=i),super(e,t,i,s),this._allowedValues=n}validate(e){return xS(e,this.defaultValue,this._allowedValues)}}class ES extends mS{constructor(e,t,i,n,s,o,r=void 0){void 0!==r&&(r.type="string",r.enum=s,r.default=n),super(e,t,i,r),this._allowedValues=s,this._convert=o}validate(e){return"string"!=typeof e||-1===this._allowedValues.indexOf(e)?this.defaultValue:this._convert(e)}}var IS;!function(e){e[e.Line=1]="Line",e[e.Block=2]="Block",e[e.Underline=3]="Underline",e[e.LineThin=4]="LineThin",e[e.BlockOutline=5]="BlockOutline",e[e.UnderlineThin=6]="UnderlineThin"}(IS||(IS={}));class MS extends mS{constructor(){super(51,"fontLigatures",MS.OFF,{anyOf:[{type:"boolean",description:ue(0,"Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:ue(0,"Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:ue(0,"Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return void 0===e?this.defaultValue:"string"==typeof e?"false"===e?MS.OFF:"true"===e?MS.ON:e:Boolean(e)?MS.ON:MS.OFF}}MS.OFF='"liga" off, "calt" off',MS.ON='"liga" on, "calt" on';class TS extends mS{constructor(){super(54,"fontVariations",TS.OFF,{anyOf:[{type:"boolean",description:ue(0,"Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:ue(0,"Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:ue(0,"Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return void 0===e?this.defaultValue:"string"==typeof e?"false"===e?TS.OFF:"true"===e?TS.TRANSLATE:e:Boolean(e)?TS.TRANSLATE:TS.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}}TS.OFF="normal",TS.TRANSLATE="translate";class RS extends mS{constructor(){super(53,"fontWeight",qS.fontWeight,{anyOf:[{type:"number",minimum:RS.MINIMUM_VALUE,maximum:RS.MAXIMUM_VALUE,errorMessage:ue(0,'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:RS.SUGGESTION_VALUES}],default:qS.fontWeight,description:ue(0,'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return"normal"===e||"bold"===e?e:String(SS.clampedInt(e,qS.fontWeight,RS.MINIMUM_VALUE,RS.MAXIMUM_VALUE))}}RS.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],RS.MINIMUM_VALUE=1,RS.MAXIMUM_VALUE=1e3;class AS extends vS{constructor(){super(143)}compute(e,t,i){return AS.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let n=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(n=Math.max(n,t-1));const s=(i+e.viewLineCount+n)/(e.pixelRatio*e.height);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:n,desiredRatio:s,minimapLineCount:Math.floor(e.viewLineCount/s)}}static _computeMinimapLayout(e,t){const i=e.outerWidth,n=e.outerHeight,s=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(s*n),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:n};const o=t.stableMinimapLayoutInput,r=o&&e.outerHeight===o.outerHeight&&e.lineHeight===o.lineHeight&&e.typicalHalfwidthCharacterWidth===o.typicalHalfwidthCharacterWidth&&e.pixelRatio===o.pixelRatio&&e.scrollBeyondLastLine===o.scrollBeyondLastLine&&e.paddingTop===o.paddingTop&&e.paddingBottom===o.paddingBottom&&e.minimap.enabled===o.minimap.enabled&&e.minimap.side===o.minimap.side&&e.minimap.size===o.minimap.size&&e.minimap.showSlider===o.minimap.showSlider&&e.minimap.renderCharacters===o.minimap.renderCharacters&&e.minimap.maxColumn===o.minimap.maxColumn&&e.minimap.scale===o.minimap.scale&&e.verticalScrollbarWidth===o.verticalScrollbarWidth&&e.isViewportWrapping===o.isViewportWrapping,a=e.lineHeight,l=e.typicalHalfwidthCharacterWidth,h=e.scrollBeyondLastLine,d=e.minimap.renderCharacters;let c=s>=2?Math.round(2*e.minimap.scale):e.minimap.scale;const u=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,m=e.verticalScrollbarWidth,f=e.viewLineCount,_=e.remainingWidth,v=e.isViewportWrapping,b=d?2:3;let C=Math.floor(s*n);const w=C/s;let y=!1,S=!1,L=b*c,k=c/s,D=1;if("fill"===g||"fit"===g){const{typicalViewportLineCount:i,extraLinesBeforeFirstLine:o,extraLinesBeyondLastLine:l,desiredRatio:d,minimapLineCount:u}=AS.computeContainedMinimapLineCount({viewLineCount:f,scrollBeyondLastLine:h,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:n,lineHeight:a,pixelRatio:s});if(f/u>1)y=!0,S=!0,c=1,L=1,k=c/s;else{let n=!1,h=c+1;if("fit"===g){const e=Math.ceil((o+f+l)*L);v&&r&&_<=t.stableFitRemainingWidth?(n=!0,h=t.stableFitMaxMinimapScale):n=e>C}if("fill"===g||n){y=!0;const n=c;L=Math.min(a*s,Math.max(1,Math.floor(1/d))),v&&r&&_<=t.stableFitRemainingWidth&&(h=t.stableFitMaxMinimapScale),c=Math.min(h,Math.max(1,Math.floor(L/b))),c>n&&(D=Math.min(2,c/n)),k=c/s/D,C=Math.ceil(Math.max(i,o+f+l)*L),v?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=_,t.stableFitMaxMinimapScale=c):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const x=Math.floor(u*k),N=Math.min(x,Math.max(0,Math.floor((_-m-2)*k/(l+k)))+8);let E=Math.floor(s*N);const I=E/s;E=Math.floor(E*D);return{renderMinimap:d?1:2,minimapLeft:"left"===p?0:i-N-m,minimapWidth:N,minimapHeightIsEditorHeight:y,minimapIsSampling:S,minimapScale:c,minimapLineHeight:L,minimapCanvasInnerWidth:E,minimapCanvasInnerHeight:C,minimapCanvasOuterWidth:I,minimapCanvasOuterHeight:w}}static computeLayout(e,t){const i=0|t.outerWidth,n=0|t.outerHeight,s=0|t.lineHeight,o=0|t.lineNumbersDigitCount,r=t.typicalHalfwidthCharacterWidth,a=t.maxDigitWidth,l=t.pixelRatio,h=t.viewLineCount,d=e.get(135),c="inherit"===d?e.get(134):d,u="inherit"===c?e.get(130):c,g=e.get(133),p=t.isDominatedByLongLines,m=e.get(57),f=0!==e.get(67).renderType,_=e.get(68),v=e.get(104),b=e.get(83),C=e.get(72),w=e.get(102),y=w.verticalScrollbarSize,S=w.verticalHasArrows,L=w.arrowSize,k=w.horizontalScrollbarSize,D=e.get(43),x="never"!==e.get(109);let N=e.get(65);D&&x&&(N+=16);let E=0;if(f){const e=Math.max(o,_);E=Math.round(e*a)}let I=0;m&&(I=s*t.glyphMarginDecorationLaneCount);let M=0,T=M+I,R=T+E,A=R+N;const O=i-I-E-N;let P=!1,F=!1,B=-1;"inherit"===c&&p?(P=!0,F=!0):"on"===u||"bounded"===u?F=!0:"wordWrapColumn"===u&&(B=g);const W=AS._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:s,typicalHalfwidthCharacterWidth:r,pixelRatio:l,scrollBeyondLastLine:v,paddingTop:b.top,paddingBottom:b.bottom,minimap:C,verticalScrollbarWidth:y,viewLineCount:h,remainingWidth:O,isViewportWrapping:F},t.memory||new pS);0!==W.renderMinimap&&0===W.minimapLeft&&(M+=W.minimapWidth,T+=W.minimapWidth,R+=W.minimapWidth,A+=W.minimapWidth);const V=O-W.minimapWidth,H=Math.max(1,Math.floor((V-y-2)/r)),z=S?L:0;return F&&(B=Math.max(1,H),"bounded"===u&&(B=Math.min(B,g))),{width:i,height:n,glyphMarginLeft:M,glyphMarginWidth:I,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:T,lineNumbersWidth:E,decorationsLeft:R,decorationsWidth:N,contentLeft:A,contentWidth:V,minimap:W,viewportColumn:H,isWordWrapMinified:P,isViewportWrapping:F,wrappingColumn:B,verticalScrollbarWidth:y,horizontalScrollbarHeight:k,overviewRuler:{top:z,width:y,height:n-2*z,right:0}}}}function OS(e){const t=e.get(97);return"editable"===t?e.get(90):"on"!==t}function PS(e,t){if("string"!=typeof e)return t;switch(e){case"hidden":return 2;case"visible":return 3;default:return 1}}const FS="inUntrustedWorkspace",BS="editor.unicodeHighlight.allowedCharacters",WS="editor.unicodeHighlight.invisibleCharacters",VS="editor.unicodeHighlight.nonBasicASCII",HS="editor.unicodeHighlight.ambiguousCharacters",zS="editor.unicodeHighlight.includeComments",US="editor.unicodeHighlight.includeStrings",KS="editor.unicodeHighlight.allowedLocales";function jS(e,t,i){const n=i.indexOf(e);return-1===n?t:i[n]}const qS={fontFamily:Pe?"Menlo, Monaco, 'Courier New', monospace":Fe?"'Droid Sans Mono', 'monospace', monospace":"Consolas, 'Courier New', monospace",fontWeight:"normal",fontSize:Pe?12:14,lineHeight:0,letterSpacing:0},$S=[];function GS(e){return $S[e.id]=e,e}const ZS={acceptSuggestionOnCommitCharacter:GS(new wS(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:ue(0,"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:GS(new NS(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",ue(0,"Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:ue(0,"Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:GS(new class extends mS{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[ue(0,"Use platform APIs to detect when a Screen Reader is attached"),ue(0,"Optimize for usage with a Screen Reader"),ue(0,"Assume a screen reader is not attached")],default:"auto",tags:["accessibility"],description:ue(0,"Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return 0===i?e.accessibilitySupport:i}}),accessibilityPageSize:GS(new SS(3,"accessibilityPageSize",10,1,1073741824,{description:ue(0,"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:GS(new DS(4,"ariaLabel",ue(0,"Editor content"))),ariaRequired:GS(new wS(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:GS(new wS(8,"screenReaderAnnounceInlineSuggestion",!0,{description:ue(0,"Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:GS(new NS(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",ue(0,"Use language configurations to determine when to autoclose brackets."),ue(0,"Autoclose brackets only when the cursor is to the left of whitespace."),""],description:ue(0,"Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:GS(new NS(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",ue(0,"Use language configurations to determine when to autoclose comments."),ue(0,"Autoclose comments only when the cursor is to the left of whitespace."),""],description:ue(0,"Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:GS(new NS(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",ue(0,"Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:ue(0,"Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:GS(new NS(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",ue(0,"Type over closing quotes or brackets only if they were automatically inserted."),""],description:ue(0,"Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:GS(new NS(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",ue(0,"Use language configurations to determine when to autoclose quotes."),ue(0,"Autoclose quotes only when the cursor is to the left of whitespace."),""],description:ue(0,"Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:GS(new ES(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],(function(e){switch(e){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}),{enumDescriptions:[ue(0,"The editor will not insert indentation automatically."),ue(0,"The editor will keep the current line's indentation."),ue(0,"The editor will keep the current line's indentation and honor language defined brackets."),ue(0,"The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),ue(0,"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:ue(0,"Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:GS(new wS(13,"automaticLayout",!1)),autoSurround:GS(new NS(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[ue(0,"Use language configurations to determine when to automatically surround selections."),ue(0,"Surround with quotes but not brackets."),ue(0,"Surround with brackets but not quotes."),""],description:ue(0,"Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:GS(new class extends mS{constructor(){const e={enabled:Sc.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:Sc.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:ue(0,"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:ue(0,"Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:CS(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:CS(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}),bracketPairGuides:GS(new class extends mS{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(16,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[ue(0,"Enables bracket pair guides."),ue(0,"Enables bracket pair guides only for the active bracket pair."),ue(0,"Disables bracket pair guides.")],default:e.bracketPairs,description:ue(0,"Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[ue(0,"Enables horizontal guides as addition to vertical bracket pair guides."),ue(0,"Enables horizontal guides only for the active bracket pair."),ue(0,"Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:ue(0,"Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:ue(0,"Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:ue(0,"Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[ue(0,"Highlights the active indent guide."),ue(0,"Highlights the active indent guide even if bracket guides are highlighted."),ue(0,"Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:ue(0,"Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{bracketPairs:jS(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:jS(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:CS(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:CS(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:jS(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}),stickyTabStops:GS(new wS(115,"stickyTabStops",!1,{description:ue(0,"Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:GS(new wS(17,"codeLens",!0,{description:ue(0,"Controls whether the editor shows CodeLens.")})),codeLensFontFamily:GS(new DS(18,"codeLensFontFamily","",{description:ue(0,"Controls the font family for CodeLens.")})),codeLensFontSize:GS(new SS(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:ue(0,"Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:GS(new wS(20,"colorDecorators",!0,{description:ue(0,"Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:GS(new NS(146,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[ue(0,"Make the color picker appear both on click and hover of the color decorator"),ue(0,"Make the color picker appear on hover of the color decorator"),ue(0,"Make the color picker appear on click of the color decorator")],description:ue(0,"Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:GS(new SS(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:ue(0,"Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:GS(new wS(22,"columnSelection",!1,{description:ue(0,"Enable that the selection with the mouse and keys is doing column selection.")})),comments:GS(new class extends mS{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:ue(0,"Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:ue(0,"Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{insertSpace:CS(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:CS(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}),contextmenu:GS(new wS(24,"contextmenu",!0)),copyWithSyntaxHighlighting:GS(new wS(25,"copyWithSyntaxHighlighting",!0,{description:ue(0,"Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:GS(new ES(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],(function(e){switch(e){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}),{description:ue(0,"Control the cursor animation style.")})),cursorSmoothCaretAnimation:GS(new NS(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[ue(0,"Smooth caret animation is disabled."),ue(0,"Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),ue(0,"Smooth caret animation is always enabled.")],description:ue(0,"Controls whether the smooth caret animation should be enabled.")})),cursorStyle:GS(new ES(28,"cursorStyle",IS.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],(function(e){switch(e){case"line":return IS.Line;case"block":return IS.Block;case"underline":return IS.Underline;case"line-thin":return IS.LineThin;case"block-outline":return IS.BlockOutline;case"underline-thin":return IS.UnderlineThin}}),{description:ue(0,"Controls the cursor style.")})),cursorSurroundingLines:GS(new SS(29,"cursorSurroundingLines",0,0,1073741824,{description:ue(0,"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:GS(new NS(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[ue(0,"`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),ue(0,"`cursorSurroundingLines` is enforced always.")],markdownDescription:ue(0,"Controls when `#cursorSurroundingLines#` should be enforced.")})),cursorWidth:GS(new SS(31,"cursorWidth",0,0,1073741824,{markdownDescription:ue(0,"Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:GS(new wS(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:GS(new wS(33,"disableMonospaceOptimizations",!1)),domReadOnly:GS(new wS(34,"domReadOnly",!1)),dragAndDrop:GS(new wS(35,"dragAndDrop",!0,{description:ue(0,"Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:GS(new class extends wS{constructor(){super(37,"emptySelectionClipboard",!0,{description:ue(0,"Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}),dropIntoEditor:GS(new class extends mS{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:ue(0,"Controls whether you can drag and drop a file into a text editor by holding down `shift` (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:ue(0,"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:[ue(0,"Show the drop selector widget after a file is dropped into the editor."),ue(0,"Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:CS(t.enabled,this.defaultValue.enabled),showDropSelector:xS(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}),stickyScroll:GS(new class extends mS{constructor(){const e={enabled:!1,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(114,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:ue(0,"Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:10,description:ue(0,"Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:ue(0,"Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:ue(0,"Enable scrolling of the sticky scroll widget with the editor's horizontal scrollbar.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:CS(t.enabled,this.defaultValue.enabled),maxLineCount:SS.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,10),defaultModel:xS(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:CS(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}),experimentalWhitespaceRendering:GS(new NS(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[ue(0,"Use a new rendering method with svgs."),ue(0,"Use a new rendering method with font characters."),ue(0,"Use the stable rendering method.")],description:ue(0,"Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:GS(new DS(39,"extraEditorClassName","")),fastScrollSensitivity:GS(new kS(40,"fastScrollSensitivity",5,(e=>e<=0?5:e),{markdownDescription:ue(0,"Scrolling speed multiplier when pressing `Alt`.")})),find:GS(new class extends mS{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(41,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:ue(0,"Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[ue(0,"Never seed search string from the editor selection."),ue(0,"Always seed search string from the editor selection, including word at cursor position."),ue(0,"Only seed search string from the editor selection.")],description:ue(0,"Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[ue(0,"Never turn on Find in Selection automatically (default)."),ue(0,"Always turn on Find in Selection automatically."),ue(0,"Turn on Find in Selection automatically when multiple lines of content are selected.")],description:ue(0,"Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:ue(0,"Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:Pe},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:ue(0,"Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:ue(0,"Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{cursorMoveOnType:CS(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:"boolean"==typeof e.seedSearchStringFromSelection?e.seedSearchStringFromSelection?"always":"never":xS(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:"boolean"==typeof e.autoFindInSelection?e.autoFindInSelection?"always":"never":xS(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:CS(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:CS(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:CS(t.loop,this.defaultValue.loop)}}}),fixedOverflowWidgets:GS(new wS(42,"fixedOverflowWidgets",!1)),folding:GS(new wS(43,"folding",!0,{description:ue(0,"Controls whether the editor has code folding enabled.")})),foldingStrategy:GS(new NS(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[ue(0,"Use a language-specific folding strategy if available, else the indentation-based one."),ue(0,"Use the indentation-based folding strategy.")],description:ue(0,"Controls the strategy for computing folding ranges.")})),foldingHighlight:GS(new wS(45,"foldingHighlight",!0,{description:ue(0,"Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:GS(new wS(46,"foldingImportsByDefault",!1,{description:ue(0,"Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:GS(new SS(47,"foldingMaximumRegions",5e3,10,65e3,{description:ue(0,"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:GS(new wS(48,"unfoldOnClickAfterEndOfLine",!1,{description:ue(0,"Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:GS(new DS(49,"fontFamily",qS.fontFamily,{description:ue(0,"Controls the font family.")})),fontInfo:GS(new class extends vS{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}),fontLigatures2:GS(new MS),fontSize:GS(new class extends bS{constructor(){super(52,"fontSize",qS.fontSize,{type:"number",minimum:6,maximum:100,default:qS.fontSize,description:ue(0,"Controls the font size in pixels.")})}validate(e){const t=kS.float(e,this.defaultValue);return 0===t?qS.fontSize:kS.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}),fontWeight:GS(new RS),fontVariations:GS(new TS),formatOnPaste:GS(new wS(55,"formatOnPaste",!1,{description:ue(0,"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:GS(new wS(56,"formatOnType",!1,{description:ue(0,"Controls whether the editor should automatically format the line after typing.")})),glyphMargin:GS(new wS(57,"glyphMargin",!0,{description:ue(0,"Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:GS(new class extends mS{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[ue(0,"Show Peek view of the results (default)"),ue(0,"Go to the primary result and show a Peek view"),ue(0,"Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:ue(0,"This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":Object.assign({description:ue(0,"Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:ue(0,"Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleDeclarations":Object.assign({description:ue(0,"Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:ue(0,"Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:ue(0,"Controls the behavior the 'Go to References'-command when multiple target locations exist.")},t),"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:ue(0,"Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:ue(0,"Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:ue(0,"Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:ue(0,"Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:ue(0,"Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,i,n,s,o;if(!e||"object"!=typeof e)return this.defaultValue;const r=e;return{multiple:xS(r.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:null!==(t=r.multipleDefinitions)&&void 0!==t?t:xS(r.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:null!==(i=r.multipleTypeDefinitions)&&void 0!==i?i:xS(r.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:null!==(n=r.multipleDeclarations)&&void 0!==n?n:xS(r.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:null!==(s=r.multipleImplementations)&&void 0!==s?s:xS(r.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:null!==(o=r.multipleReferences)&&void 0!==o?o:xS(r.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:DS.string(r.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:DS.string(r.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:DS.string(r.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:DS.string(r.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:DS.string(r.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}),hideCursorInOverviewRuler:GS(new wS(59,"hideCursorInOverviewRuler",!1,{description:ue(0,"Controls whether the cursor should be hidden in the overview ruler.")})),hover:GS(new class extends mS{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(60,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:ue(0,"Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:ue(0,"Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:ue(0,"Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,description:ue(0,"Controls the delay in milliseconds after thich the hover is hidden. Requires `editor.hover.sticky` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:ue(0,"Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:CS(t.enabled,this.defaultValue.enabled),delay:SS.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:CS(t.sticky,this.defaultValue.sticky),hidingDelay:SS.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:CS(t.above,this.defaultValue.above)}}}),inDiffEditor:GS(new wS(61,"inDiffEditor",!1)),letterSpacing:GS(new kS(63,"letterSpacing",qS.letterSpacing,(e=>kS.clamp(e,-5,20)),{description:ue(0,"Controls the letter spacing in pixels.")})),lightbulb:GS(new class extends mS{constructor(){const e={enabled:!0};super(64,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:ue(0,"Enables the Code Action lightbulb in the editor.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;return{enabled:CS(e.enabled,this.defaultValue.enabled)}}}),lineDecorationsWidth:GS(new class extends mS{constructor(){super(65,"lineDecorationsWidth",10)}validate(e){if("string"==typeof e&&/^\d+(\.\d+)?ch$/.test(e)){return-parseFloat(e.substring(0,e.length-2))}return SS.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?SS.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}),lineHeight:GS(new class extends kS{constructor(){super(66,"lineHeight",qS.lineHeight,(e=>kS.clamp(e,0,150)),{markdownDescription:ue(0,"Controls the line height. \n - Use 0 to automatically compute the line height from the font size.\n - Values between 0 and 8 will be used as a multiplier with the font size.\n - Values greater than or equal to 8 will be used as effective values.")})}compute(e,t,i){return e.fontInfo.lineHeight}}),lineNumbers:GS(new class extends mS{constructor(){super(67,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[ue(0,"Line numbers are not rendered."),ue(0,"Line numbers are rendered as absolute number."),ue(0,"Line numbers are rendered as distance in lines to cursor position."),ue(0,"Line numbers are rendered every 10 lines.")],default:"on",description:ue(0,"Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return void 0!==e&&("function"==typeof e?(t=4,i=e):t="interval"===e?3:"relative"===e?2:"on"===e?1:0),{renderType:t,renderFn:i}}}),lineNumbersMinChars:GS(new SS(68,"lineNumbersMinChars",5,1,300)),linkedEditing:GS(new wS(69,"linkedEditing",!1,{description:ue(0,"Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:GS(new wS(70,"links",!0,{description:ue(0,"Controls whether the editor should detect links and make them clickable.")})),matchBrackets:GS(new NS(71,"matchBrackets","always",["always","near","never"],{description:ue(0,"Highlight matching brackets.")})),minimap:GS(new class extends mS{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1};super(72,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:ue(0,"Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:ue(0,"Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[ue(0,"The minimap has the same size as the editor contents (and might scroll)."),ue(0,"The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),ue(0,"The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:ue(0,"Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:ue(0,"Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:ue(0,"Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:ue(0,"Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:ue(0,"Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:ue(0,"Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:CS(t.enabled,this.defaultValue.enabled),autohide:CS(t.autohide,this.defaultValue.autohide),size:xS(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:xS(t.side,this.defaultValue.side,["right","left"]),showSlider:xS(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:CS(t.renderCharacters,this.defaultValue.renderCharacters),scale:SS.clampedInt(t.scale,1,1,3),maxColumn:SS.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}),mouseStyle:GS(new NS(73,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:GS(new kS(74,"mouseWheelScrollSensitivity",1,(e=>0===e?1:e),{markdownDescription:ue(0,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:GS(new wS(75,"mouseWheelZoom",!1,{markdownDescription:ue(0,"Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:GS(new wS(76,"multiCursorMergeOverlapping",!0,{description:ue(0,"Merge multiple cursors when they are overlapping.")})),multiCursorModifier:GS(new ES(77,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],(function(e){return"ctrlCmd"===e?Pe?"metaKey":"ctrlKey":"altKey"}),{markdownEnumDescriptions:[ue(0,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),ue(0,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:ue(0,"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:GS(new NS(78,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[ue(0,"Each cursor pastes a single line of the text."),ue(0,"Each cursor pastes the full text.")],markdownDescription:ue(0,"Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:GS(new SS(79,"multiCursorLimit",1e4,1,1e5,{markdownDescription:ue(0,"Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:GS(new wS(80,"occurrencesHighlight",!0,{description:ue(0,"Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:GS(new wS(81,"overviewRulerBorder",!0,{description:ue(0,"Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:GS(new SS(82,"overviewRulerLanes",3,0,3)),padding:GS(new class extends mS{constructor(){super(83,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:ue(0,"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:ue(0,"Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{top:SS.clampedInt(t.top,0,0,1e3),bottom:SS.clampedInt(t.bottom,0,0,1e3)}}}),pasteAs:GS(new class extends mS{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(84,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:ue(0,"Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:ue(0,"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:[ue(0,"Show the paste selector widget after content is pasted into the editor."),ue(0,"Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:CS(t.enabled,this.defaultValue.enabled),showPasteSelector:xS(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}),parameterHints:GS(new class extends mS{constructor(){const e={enabled:!0,cycle:!0};super(85,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:ue(0,"Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:ue(0,"Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:CS(t.enabled,this.defaultValue.enabled),cycle:CS(t.cycle,this.defaultValue.cycle)}}}),peekWidgetDefaultFocus:GS(new NS(86,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[ue(0,"Focus the tree when opening peek"),ue(0,"Focus the editor when opening peek")],description:ue(0,"Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:GS(new wS(87,"definitionLinkOpensInPeek",!1,{description:ue(0,"Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:GS(new class extends mS{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[ue(0,"Quick suggestions show inside the suggest widget"),ue(0,"Quick suggestions show as ghost text"),ue(0,"Quick suggestions are disabled")]}];super(88,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:ue(0,"Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:ue(0,"Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:ue(0,"Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:ue(0,"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("boolean"==typeof e){const t=e?"on":"off";return{comments:t,strings:t,other:t}}if(!e||"object"!=typeof e)return this.defaultValue;const{other:t,comments:i,strings:n}=e,s=["on","inline","off"];let o,r,a;return o="boolean"==typeof t?t?"on":"off":xS(t,this.defaultValue.other,s),r="boolean"==typeof i?i?"on":"off":xS(i,this.defaultValue.comments,s),a="boolean"==typeof n?n?"on":"off":xS(n,this.defaultValue.strings,s),{other:o,comments:r,strings:a}}}),quickSuggestionsDelay:GS(new SS(89,"quickSuggestionsDelay",10,0,1073741824,{description:ue(0,"Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:GS(new wS(90,"readOnly",!1)),readOnlyMessage:GS(new class extends mS{constructor(){super(91,"readOnlyMessage",undefined)}validate(e){return e&&"object"==typeof e?e:this.defaultValue}}),renameOnType:GS(new wS(92,"renameOnType",!1,{description:ue(0,"Controls whether the editor auto renames on type."),markdownDeprecationMessage:ue(0,"Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:GS(new wS(93,"renderControlCharacters",!0,{description:ue(0,"Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:GS(new NS(94,"renderFinalNewline",Fe?"dimmed":"on",["off","on","dimmed"],{description:ue(0,"Render last line number when the file ends with a newline.")})),renderLineHighlight:GS(new NS(95,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",ue(0,"Highlights both the gutter and the current line.")],description:ue(0,"Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:GS(new wS(96,"renderLineHighlightOnlyWhenFocus",!1,{description:ue(0,"Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:GS(new NS(97,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:GS(new NS(98,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",ue(0,"Render whitespace characters except for single spaces between words."),ue(0,"Render whitespace characters only on selected text."),ue(0,"Render only trailing whitespace characters."),""],description:ue(0,"Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:GS(new SS(99,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:GS(new wS(100,"roundedSelection",!0,{description:ue(0,"Controls whether selections should have rounded corners.")})),rulers:GS(new class extends mS{constructor(){const e=[],t={type:"number",description:ue(0,"Number of monospace characters at which this editor ruler will render.")};super(101,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:ue(0,"Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:ue(0,"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("number"==typeof i)t.push({column:SS.clampedInt(i,0,0,1e4),color:null});else if(i&&"object"==typeof i){const e=i;t.push({column:SS.clampedInt(e.column,0,0,1e4),color:e.color})}return t.sort(((e,t)=>e.column-t.column)),t}return this.defaultValue}}),scrollbar:GS(new class extends mS{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1};super(102,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[ue(0,"The vertical scrollbar will be visible only when necessary."),ue(0,"The vertical scrollbar will always be visible."),ue(0,"The vertical scrollbar will always be hidden.")],default:"auto",description:ue(0,"Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[ue(0,"The horizontal scrollbar will be visible only when necessary."),ue(0,"The horizontal scrollbar will always be visible."),ue(0,"The horizontal scrollbar will always be hidden.")],default:"auto",description:ue(0,"Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:ue(0,"The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:ue(0,"The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:ue(0,"Controls whether clicks scroll by page or jump to click position.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e,i=SS.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),n=SS.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:SS.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:PS(t.vertical,this.defaultValue.vertical),horizontal:PS(t.horizontal,this.defaultValue.horizontal),useShadows:CS(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:CS(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:CS(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:CS(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:CS(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:SS.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:n,verticalSliderSize:SS.clampedInt(t.verticalSliderSize,n,0,1e3),scrollByPage:CS(t.scrollByPage,this.defaultValue.scrollByPage)}}}),scrollBeyondLastColumn:GS(new SS(103,"scrollBeyondLastColumn",4,0,1073741824,{description:ue(0,"Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:GS(new wS(104,"scrollBeyondLastLine",!0,{description:ue(0,"Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:GS(new wS(105,"scrollPredominantAxis",!0,{description:ue(0,"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:GS(new wS(106,"selectionClipboard",!0,{description:ue(0,"Controls whether the Linux primary clipboard should be supported."),included:Fe})),selectionHighlight:GS(new wS(107,"selectionHighlight",!0,{description:ue(0,"Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:GS(new wS(108,"selectOnLineNumbers",!0)),showFoldingControls:GS(new NS(109,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[ue(0,"Always show the folding controls."),ue(0,"Never show the folding controls and reduce the gutter size."),ue(0,"Only show the folding controls when the mouse is over the gutter.")],description:ue(0,"Controls when the folding controls on the gutter are shown.")})),showUnused:GS(new wS(110,"showUnused",!0,{description:ue(0,"Controls fading out of unused code.")})),showDeprecated:GS(new wS(138,"showDeprecated",!0,{description:ue(0,"Controls strikethrough deprecated variables.")})),inlayHints:GS(new class extends mS{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(139,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:ue(0,"Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[ue(0,"Inlay hints are enabled"),ue(0,"Inlay hints are showing by default and hide when holding {0}",Pe?"Ctrl+Option":"Ctrl+Alt"),ue(0,"Inlay hints are hidden by default and show when holding {0}",Pe?"Ctrl+Option":"Ctrl+Alt"),ue(0,"Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:ue(0,"Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:ue(0,"Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:ue(0,"Enables the padding around the inlay hints in the editor.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return"boolean"==typeof t.enabled&&(t.enabled=t.enabled?"on":"off"),{enabled:xS(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:SS.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:DS.string(t.fontFamily,this.defaultValue.fontFamily),padding:CS(t.padding,this.defaultValue.padding)}}}),snippetSuggestions:GS(new NS(111,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[ue(0,"Show snippet suggestions on top of other suggestions."),ue(0,"Show snippet suggestions below other suggestions."),ue(0,"Show snippets suggestions with other suggestions."),ue(0,"Do not show snippet suggestions.")],description:ue(0,"Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:GS(new class extends mS{constructor(){super(112,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:ue(0,"Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:ue(0,"Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return e&&"object"==typeof e?{selectLeadingAndTrailingWhitespace:CS(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:CS(e.selectSubwords,this.defaultValue.selectSubwords)}:this.defaultValue}}),smoothScrolling:GS(new wS(113,"smoothScrolling",!1,{description:ue(0,"Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:GS(new SS(116,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:GS(new class extends mS{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(117,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[ue(0,"Insert suggestion without overwriting text right of the cursor."),ue(0,"Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:ue(0,"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:ue(0,"Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:ue(0,"Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:ue(0,"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:[ue(0,"Always select a suggestion when automatically triggering IntelliSense."),ue(0,"Never select a suggestion when automatically triggering IntelliSense."),ue(0,"Select a suggestion only when triggering IntelliSense from a trigger character."),ue(0,"Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:ue(0,"Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions (`#editor.quickSuggestions#` and `#editor.suggestOnTriggerCharacters#`) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:ue(0,"Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:ue(0,"Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:ue(0,"Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:ue(0,"Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:ue(0,"Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:ue(0,"This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:ue(0,"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:ue(0,"When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:ue(0,"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:ue(0,"When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{insertMode:xS(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:CS(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:CS(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:CS(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:CS(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:xS(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:CS(t.showIcons,this.defaultValue.showIcons),showStatusBar:CS(t.showStatusBar,this.defaultValue.showStatusBar),preview:CS(t.preview,this.defaultValue.preview),previewMode:xS(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:CS(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:CS(t.showMethods,this.defaultValue.showMethods),showFunctions:CS(t.showFunctions,this.defaultValue.showFunctions),showConstructors:CS(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:CS(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:CS(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:CS(t.showFields,this.defaultValue.showFields),showVariables:CS(t.showVariables,this.defaultValue.showVariables),showClasses:CS(t.showClasses,this.defaultValue.showClasses),showStructs:CS(t.showStructs,this.defaultValue.showStructs),showInterfaces:CS(t.showInterfaces,this.defaultValue.showInterfaces),showModules:CS(t.showModules,this.defaultValue.showModules),showProperties:CS(t.showProperties,this.defaultValue.showProperties),showEvents:CS(t.showEvents,this.defaultValue.showEvents),showOperators:CS(t.showOperators,this.defaultValue.showOperators),showUnits:CS(t.showUnits,this.defaultValue.showUnits),showValues:CS(t.showValues,this.defaultValue.showValues),showConstants:CS(t.showConstants,this.defaultValue.showConstants),showEnums:CS(t.showEnums,this.defaultValue.showEnums),showEnumMembers:CS(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:CS(t.showKeywords,this.defaultValue.showKeywords),showWords:CS(t.showWords,this.defaultValue.showWords),showColors:CS(t.showColors,this.defaultValue.showColors),showFiles:CS(t.showFiles,this.defaultValue.showFiles),showReferences:CS(t.showReferences,this.defaultValue.showReferences),showFolders:CS(t.showFolders,this.defaultValue.showFolders),showTypeParameters:CS(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:CS(t.showSnippets,this.defaultValue.showSnippets),showUsers:CS(t.showUsers,this.defaultValue.showUsers),showIssues:CS(t.showIssues,this.defaultValue.showIssues)}}}),inlineSuggest:GS(new class extends mS{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1};super(62,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:ue(0,"Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover"],enumDescriptions:[ue(0,"Show the inline suggestion toolbar whenever an inline suggestion is shown."),ue(0,"Show the inline suggestion toolbar when hovering over an inline suggestion.")],description:ue(0,"Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:ue(0,"Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:CS(t.enabled,this.defaultValue.enabled),mode:xS(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:xS(t.showToolbar,this.defaultValue.showToolbar,["always","onHover"]),suppressSuggestions:CS(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:CS(t.keepOnBlur,this.defaultValue.keepOnBlur)}}}),inlineCompletionsAccessibilityVerbose:GS(new wS(147,"inlineCompletionsAccessibilityVerbose",!1,{description:ue(0,"Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:GS(new SS(118,"suggestFontSize",0,0,1e3,{markdownDescription:ue(0,"Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:GS(new SS(119,"suggestLineHeight",0,0,1e3,{markdownDescription:ue(0,"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:GS(new wS(120,"suggestOnTriggerCharacters",!0,{description:ue(0,"Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:GS(new NS(121,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[ue(0,"Always select the first suggestion."),ue(0,"Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),ue(0,"Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:ue(0,"Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:GS(new NS(122,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[ue(0,"Tab complete will insert the best matching suggestion when pressing tab."),ue(0,"Disable tab completions."),ue(0,"Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:ue(0,"Enables tab completions.")})),tabIndex:GS(new SS(123,"tabIndex",0,-1,1073741824)),unicodeHighlight:GS(new class extends mS{constructor(){const e={nonBasicASCII:FS,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:FS,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(124,"unicodeHighlight",e,{[VS]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,FS],default:e.nonBasicASCII,description:ue(0,"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.")},[WS]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:ue(0,"Controls whether characters that just reserve space or have no width at all are highlighted.")},[HS]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:ue(0,"Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[zS]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,FS],default:e.includeComments,description:ue(0,"Controls whether characters in comments should also be subject to Unicode highlighting.")},[US]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,FS],default:e.includeStrings,description:ue(0,"Controls whether characters in strings should also be subject to Unicode highlighting.")},[BS]:{restricted:!0,type:"object",default:e.allowedCharacters,description:ue(0,"Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[KS]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:ue(0,"Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(vd(e.allowedCharacters,t.allowedCharacters)||(e=Object.assign(Object.assign({},e),{allowedCharacters:t.allowedCharacters}),i=!0)),t.allowedLocales&&e&&(vd(e.allowedLocales,t.allowedLocales)||(e=Object.assign(Object.assign({},e),{allowedLocales:t.allowedLocales}),i=!0));const n=super.applyUpdate(e,t);return i?new fS(n.newValue,!0):n}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{nonBasicASCII:jS(t.nonBasicASCII,FS,[!0,!1,FS]),invisibleCharacters:CS(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:CS(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:jS(t.includeComments,FS,[!0,!1,FS]),includeStrings:jS(t.includeStrings,FS,[!0,!1,FS]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if("object"!=typeof e||!e)return t;const i={};for(const[n,s]of Object.entries(e))!0===s&&(i[n]=!0);return i}}),unusualLineTerminators:GS(new NS(125,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[ue(0,"Unusual line terminators are automatically removed."),ue(0,"Unusual line terminators are ignored."),ue(0,"Unusual line terminators prompt to be removed.")],description:ue(0,"Remove unusual line terminators that might cause problems.")})),useShadowDOM:GS(new wS(126,"useShadowDOM",!0)),useTabStops:GS(new wS(127,"useTabStops",!0,{description:ue(0,"Inserting and deleting whitespace follows tab stops.")})),wordBreak:GS(new NS(128,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[ue(0,"Use the default line break rule."),ue(0,"Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:ue(0,"Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSeparators:GS(new DS(129,"wordSeparators",kc,{description:ue(0,"Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:GS(new NS(130,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[ue(0,"Lines will never wrap."),ue(0,"Lines will wrap at the viewport width."),ue(0,"Lines will wrap at `#editor.wordWrapColumn#`."),ue(0,"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:ue(0,"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:GS(new DS(131,"wordWrapBreakAfterCharacters"," \t})]?|/&.,;\xa2\xb0\u2032\u2033\u2030\u2103\u3001\u3002\uff61\uff64\uffe0\uff0c\uff0e\uff1a\uff1b\uff1f\uff01\uff05\u30fb\uff65\u309d\u309e\u30fd\u30fe\u30fc\u30a1\u30a3\u30a5\u30a7\u30a9\u30c3\u30e3\u30e5\u30e7\u30ee\u30f5\u30f6\u3041\u3043\u3045\u3047\u3049\u3063\u3083\u3085\u3087\u308e\u3095\u3096\u31f0\u31f1\u31f2\u31f3\u31f4\u31f5\u31f6\u31f7\u31f8\u31f9\u31fa\u31fb\u31fc\u31fd\u31fe\u31ff\u3005\u303b\uff67\uff68\uff69\uff6a\uff6b\uff6c\uff6d\uff6e\uff6f\uff70\u201d\u3009\u300b\u300d\u300f\u3011\u3015\uff09\uff3d\uff5d\uff63")),wordWrapBreakBeforeCharacters:GS(new DS(132,"wordWrapBreakBeforeCharacters","([{\u2018\u201c\u3008\u300a\u300c\u300e\u3010\u3014\uff08\uff3b\uff5b\uff62\xa3\xa5\uff04\uffe1\uffe5+\uff0b")),wordWrapColumn:GS(new SS(133,"wordWrapColumn",80,1,1073741824,{markdownDescription:ue(0,"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:GS(new NS(134,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:GS(new NS(135,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:GS(new class extends vS{constructor(){super(140)}compute(e,t,i){const n=["monaco-editor"];return t.get(39)&&n.push(t.get(39)),e.extraEditorClassName&&n.push(e.extraEditorClassName),"default"===t.get(73)?n.push("mouse-default"):"copy"===t.get(73)&&n.push("mouse-copy"),t.get(110)&&n.push("showUnused"),t.get(138)&&n.push("showDeprecated"),n.join(" ")}}),defaultColorDecorators:GS(new wS(145,"defaultColorDecorators",!1,{markdownDescription:ue(0,"Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:GS(new class extends vS{constructor(){super(141)}compute(e,t,i){return e.pixelRatio}}),tabFocusMode:GS(new wS(142,"tabFocusMode",!1,{markdownDescription:ue(0,"Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:GS(new AS),wrappingInfo:GS(new class extends vS{constructor(){super(144)}compute(e,t,i){const n=t.get(143);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:n.isWordWrapMinified,isViewportWrapping:n.isViewportWrapping,wrappingColumn:n.wrappingColumn}}}),wrappingIndent:GS(new class extends mS{constructor(){super(136,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[ue(0,"No indentation. Wrapped lines begin at column 1."),ue(0,"Wrapped lines get the same indentation as the parent."),ue(0,"Wrapped lines get +1 indentation toward the parent."),ue(0,"Wrapped lines get +2 indentation toward the parent.")],description:ue(0,"Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,i){return 2===t.get(2)?0:i}}),wrappingStrategy:GS(new class extends mS{constructor(){super(137,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[ue(0,"Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),ue(0,"Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:ue(0,"Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return xS(e,"simple",["simple","advanced"])}compute(e,t,i){return 2===t.get(2)?"advanced":i}})},YS=Object.freeze({id:"editor",order:5,type:"object",title:ue(0,"Editor"),scope:5}),XS=Object.assign(Object.assign({},YS),{properties:{"editor.tabSize":{type:"number",default:Sc.tabSize,minimum:1,markdownDescription:ue(0,"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:ue(0,'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:Sc.insertSpaces,markdownDescription:ue(0,"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:Sc.detectIndentation,markdownDescription:ue(0,"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:Sc.trimAutoWhitespace,description:ue(0,"Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:Sc.largeFileOptimizations,description:ue(0,"Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:ue(0,"Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[ue(0,"Only suggest words from the active document."),ue(0,"Suggest words from all open documents of the same language."),ue(0,"Suggest words from all open documents.")],description:ue(0,"Controls from which documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[ue(0,"Semantic highlighting enabled for all color themes."),ue(0,"Semantic highlighting disabled for all color themes."),ue(0,"Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:ue(0,"Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:ue(0,"Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:ue(0,"Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:ue(0,"Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:ue(0,"Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:ue(0,"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:ue(0,"Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:ue(0,"The opening bracket character or string sequence.")},{type:"string",description:ue(0,"The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:ue(0,"Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:ue(0,"The opening bracket character or string sequence.")},{type:"string",description:ue(0,"The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:uS.maxComputationTime,description:ue(0,"Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:uS.maxFileSize,description:ue(0,"Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:uS.renderSideBySide,description:ue(0,"Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:uS.renderSideBySideInlineBreakpoint,description:ue(0,"If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:uS.useInlineViewWhenSpaceIsLimited,description:ue(0,"If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:uS.renderMarginRevertIcon,description:ue(0,"When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:uS.ignoreTrimWhitespace,description:ue(0,"When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:uS.renderIndicators,description:ue(0,"Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:uS.diffCodeLens,description:ue(0,"Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:uS.diffWordWrap,markdownEnumDescriptions:[ue(0,"Lines will never wrap."),ue(0,"Lines will wrap at the viewport width."),ue(0,"Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:uS.diffAlgorithm,markdownEnumDescriptions:[ue(0,"Uses the legacy diffing algorithm."),ue(0,"Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:uS.hideUnchangedRegions.enabled,markdownDescription:ue(0,"Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:uS.hideUnchangedRegions.revealLineCount,markdownDescription:ue(0,"Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:uS.hideUnchangedRegions.minimumLineCount,markdownDescription:ue(0,"Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:uS.hideUnchangedRegions.contextLineCount,markdownDescription:ue(0,"Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:uS.experimental.showMoves,markdownDescription:ue(0,"Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:uS.experimental.showEmptyDecorations,description:ue(0,"Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}});for(const Tre of $S){const e=Tre.schema;if(void 0!==e)if(void 0!==(QS=e).type||void 0!==QS.anyOf)XS.properties[`editor.${Tre.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(XS.properties[t]=e[t])}var QS;let JS=null;function eL(){return null===JS&&(JS=Object.create(null),Object.keys(XS.properties).forEach((e=>{JS[e]=!0}))),JS}jl.as(xu).registerConfiguration(XS);const tL=Ba("IWorkspaceEditService");class iL{constructor(e){this.metadata=e}static convert(e){return e.edits.map((e=>{if(nL.is(e))return nL.lift(e);if(sL.is(e))return sL.lift(e);throw new Error("Unsupported edit")}))}}class nL extends iL{static is(e){return e instanceof nL||Br(e)&&an.isUri(e.resource)&&Br(e.textEdit)}static lift(e){return e instanceof nL?e:new nL(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 sL extends iL{static is(e){return e instanceof sL||Br(e)&&(Boolean(e.newResource)||Boolean(e.oldResource))}static lift(e){return e instanceof sL?e:new sL(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=Ba("ILanguageFeaturesService"),rL=Ba("IEditorCancelService"),aL=new Al("cancellableOperation",!1,ue(0,"Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));yu(rL,class{constructor(){this._tokens=new WeakMap}add(e,t){let i,n=this._tokens.get(e);return n||(n=e.invokeWithinContext((e=>({key:aL.bindTo(e.get(Ol)),tokens:new O}))),this._tokens.set(e,n)),n.key.set(!0),i=n.tokens.push(t),()=>{i&&(i(),n.key.set(!n.tokens.isEmpty()),i=void 0)}}cancel(e){const t=this._tokens.get(e);if(!t)return;const i=t.tokens.pop();i&&(i.cancel(),t.key.set(!t.tokens.isEmpty()))}},1);class lL extends jh{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext((t=>t.get(rL).add(e,this)))}dispose(){this._unregister(),super.dispose()}}Sh(new class extends vh{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:aL})}runEditorCommand(e,t){e.get(rL).cancel(t)}});class hL{constructor(e,t){if(this.flags=t,1&this.flags){const t=e.getModel();this.modelVersionId=t?Qs("{0}#{1}",t.uri.toString(),t.getVersionId()):null}else this.modelVersionId=null;4&this.flags?this.position=e.getPosition():this.position=null,2&this.flags?this.selection=e.getSelection():this.selection=null,8&this.flags?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof hL))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 hL(e,this.flags))}}class dL extends lL{constructor(e,t,i,n){super(e,n),this._listener=new N,4&t&&this._listener.add(e.onDidChangeCursorPosition((e=>{i&&Rh.containsPosition(i,e.position)||this.cancel()}))),2&t&&this._listener.add(e.onDidChangeCursorSelection((e=>{i&&Rh.containsRange(i,e.selection)||this.cancel()}))),8&t&&this._listener.add(e.onDidScrollChange((e=>this.cancel()))),1&t&&(this._listener.add(e.onDidChangeModel((e=>this.cancel()))),this._listener.add(e.onDidChangeModelContent((e=>this.cancel()))))}dispose(){this._listener.dispose(),super.dispose()}}class cL extends jh{constructor(e,t){super(t),this._listener=e.onDidChangeContent((()=>this.cancel()))}dispose(){this._listener.dispose(),super.dispose()}}var uL;!function(e){e[e.Ignore=0]="Ignore",e[e.Info=1]="Info",e[e.Warning=2]="Warning",e[e.Error=3]="Error"}(uL||(uL={})),function(e){const t="error",i="warning",n="info";e.fromValue=function(s){return s?_o(t,s)?e.Error:_o(i,s)||_o("warn",s)?e.Warning:_o(n,s)?e.Info:e.Ignore:e.Ignore},e.toString=function(s){switch(s){case e.Error:return t;case e.Warning:return i;case e.Info:return n;default:return"ignore"}}}(uL||(uL={}));const gL=uL;var pL=gL;const mL=Ba("notificationService");const fL=Ba("progressService");Object.freeze({total(){},worked(){},done(){}});class _L{constructor(e,t){this.callback=e,this.report=(null==t?void 0:t.async)?this._reportAsync.bind(this):this._reportSync.bind(this)}_reportSync(e){this._value=e,this.callback(this._value)}_reportAsync(e){Promise.resolve(this._lastTask).finally((()=>{this._value=e;const t=this.callback(this._value);this._lastTask=Promise.resolve(t).finally((()=>this._lastTask=void 0))}))}}_L.None=Object.freeze({report(){}});const vL=Ba("editorProgressService");var bL,CL=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class wL{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+wL.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new wL(this.value+wL.sep+e)}}function yL(e,t,i){return!!t.contains(e)&&(!i||!t.contains(i))}wL.sep=".",wL.None=new wL("@@none@@"),wL.Empty=new wL(""),wL.QuickFix=new wL("quickfix"),wL.Refactor=new wL("refactor"),wL.RefactorExtract=wL.Refactor.append("extract"),wL.RefactorInline=wL.Refactor.append("inline"),wL.RefactorMove=wL.Refactor.append("move"),wL.RefactorRewrite=wL.Refactor.append("rewrite"),wL.Notebook=new wL("notebook"),wL.Source=new wL("source"),wL.SourceOrganizeImports=wL.Source.append("organizeImports"),wL.SourceFixAll=wL.Source.append("fixAll"),wL.SurroundWith=wL.Refactor.append("surround"),function(e){e.Refactor="refactor",e.RefactorPreview="refactor preview",e.Lightbulb="lightbulb",e.Default="other (default)",e.SourceAction="source action",e.QuickFix="quick fix action",e.FixAll="fix all",e.OrganizeImports="organize imports",e.AutoFix="auto fix",e.QuickFixHover="quick fix hover window",e.OnSave="save participants",e.ProblemsView="problems view"}(bL||(bL={}));class SL{static fromUser(e,t){return e&&"object"==typeof e?new SL(SL.getKindFromUser(e,t.kind),SL.getApplyFromUser(e,t.apply),SL.getPreferredUser(e)):new SL(t.kind,t.apply,!1)}static getApplyFromUser(e,t){switch("string"==typeof e.apply?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return"string"==typeof e.kind?new wL(e.kind):t}static getPreferredUser(e){return"boolean"==typeof e.preferred&&e.preferred}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class LL{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}resolve(e){var t;return CL(this,void 0,void 0,(function*(){if((null===(t=this.provider)||void 0===t?void 0:t.resolveCodeAction)&&!this.action.edit){let t;try{t=yield this.provider.resolveCodeAction(this.action,e)}catch(i){a(i)}t&&(this.action.edit=t.edit)}return this}))}}var kL=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const DL="editor.action.codeAction",xL="editor.action.quickFix",NL="editor.action.autoFix",EL="editor.action.refactor",IL="editor.action.sourceAction",ML="editor.action.organizeImports",TL="editor.action.fixAll";class RL extends E{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return Hd(e.diagnostics)?Hd(t.diagnostics)?RL.codeActionsPreferredComparator(e,t):-1:Hd(t.diagnostics)?1:RL.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(RL.codeActionsComparator),this.validActions=this.allActions.filter((({action:e})=>!e.disabled))}get hasAutoFix(){return this.validActions.some((({action:e})=>!!e.kind&&wL.QuickFix.contains(new wL(e.kind))&&!!e.isPreferred))}}const AL={actions:[],documentation:void 0};function OL(e,t,i,n,s,o){var r;return kL(this,void 0,void 0,(function*(){const l=n.filter||{},h=Object.assign(Object.assign({},l),{excludes:[...l.excludes||[],wL.Notebook]}),c={only:null===(r=l.include)||void 0===r?void 0:r.value,trigger:n.type},u=new cL(t,o),g=2===n.type,p=function(e,t,i){return e.all(t).filter((e=>!e.providedCodeActionKinds||e.providedCodeActionKinds.some((e=>function(e,t){return!(e.include&&!e.include.intersects(t)||e.excludes&&e.excludes.some((i=>yL(t,i,e.include)))||!e.includeSourceActions&&wL.Source.contains(t))}(i,new wL(e))))))}(e,t,g?h:l),m=new N,f=p.map((e=>kL(this,void 0,void 0,(function*(){try{s.report(e);const n=yield e.provideCodeActions(t,i,c,u.token);if(n&&m.add(n),u.token.isCancellationRequested)return AL;const o=((null==n?void 0:n.actions)||[]).filter((e=>e&&function(e,t){const i=t.kind?new wL(t.kind):void 0;return!(!(!e.include||i&&e.include.contains(i))||e.excludes&&i&&e.excludes.some((t=>yL(i,t,e.include)))||!e.includeSourceActions&&i&&wL.Source.contains(i)||e.onlyIncludePreferredActions&&!t.isPreferred)}(l,e))),r=function(e,t,i){if(!e.documentation)return;const n=e.documentation.map((e=>({kind:new wL(e.kind),command:e.command})));if(i){let e;for(const t of n)t.kind.contains(i)&&(e?e.kind.contains(t.kind)&&(e=t):e=t);if(e)return null==e?void 0:e.command}for(const s of t)if(s.kind)for(const e of n)if(e.kind.contains(new wL(s.kind)))return e.command;return}(e,o,l.include);return{actions:o.map((t=>new LL(t,e))),documentation:r}}catch(n){if(d(n))throw n;return a(n),AL}})))),_=e.onDidChange((()=>{Td(e.all(t),p)||u.cancel()}));try{const i=yield Promise.all(f),s=i.map((e=>e.actions)).flat(),o=[...Bd(i.map((e=>e.documentation))),...PL(e,t,n,s)];return new RL(s,o,m)}finally{_.dispose(),u.dispose()}}))}function*PL(e,t,i,n){var s,o,r;if(t&&n.length)for(const a of e.all(t))a._getAdditionalMenuItems&&(yield*null===(s=a._getAdditionalMenuItems)||void 0===s?void 0:s.call(a,{trigger:i.type,only:null===(r=null===(o=i.filter)||void 0===o?void 0:o.include)||void 0===r?void 0:r.value},n.map((e=>e.action))))}var FL;function BL(e,t,i,n,s=Uh.None){var o;return kL(this,void 0,void 0,(function*(){const r=e.get(tL),a=e.get(Ya),l=e.get(lh),h=e.get(mL);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:t.action.title,codeActionKind:t.action.kind,codeActionIsPreferred:!!t.action.isPreferred,reason:i}),yield t.resolve(s),!s.isCancellationRequested){if(null===(o=t.action.edit)||void 0===o?void 0:o.edits.length){if(!(yield r.apply(t.action.edit,{editor:null==n?void 0:n.editor,label:t.action.title,quotableLabel:t.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:i!==FL.OnSave,showPreview:null==n?void 0:n.preview})).isApplied)return}if(t.action.command)try{yield a.executeCommand(t.action.command.id,...t.action.command.arguments||[])}catch(d){const e=function(e){return"string"==typeof e?e:e instanceof Error&&"string"==typeof e.message?e.message:void 0}(d);h.error("string"==typeof e?e:ue(0,"An unknown error occurred while applying the code action"))}}}))}!function(e){e.OnSave="onSave",e.FromProblemsView="fromProblemsView",e.FromCodeActions="fromCodeActions"}(FL||(FL={})),Xa.registerCommand("_executeCodeActionProvider",(function(e,t,i,n,s){return kL(this,void 0,void 0,(function*(){if(!(t instanceof an))throw u();const{codeActionProvider:o}=e.get(oL),r=e.get(Ha).getModel(t);if(!r)throw u();const a=Ah.isISelection(i)?Ah.liftSelection(i):Rh.isIRange(i)?r.validateRange(i):void 0;if(!a)throw u();const l="string"==typeof n?new wL(n):void 0,h=yield OL(o,r,a,{type:1,triggerAction:bL.Default,filter:{includeSourceActions:!0,include:l}},_L.None,Uh.None),d=[],c=Math.min(h.validActions.length,"number"==typeof s?s:0);for(let e=0;ee.action))}finally{setTimeout((()=>h.dispose()),100)}}))}));const WL=Ba("keybindingService");var VL,HL=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},zL=function(e,t){return function(i,n){t(i,n,e)}};let UL=VL=class{constructor(e){this.keybindingService=e}getResolver(){const e=new Zs((()=>this.keybindingService.getKeybindings().filter((e=>VL.codeActionCommands.indexOf(e.command)>=0)).filter((e=>e.resolvedKeybinding)).map((e=>{let t=e.commandArgs;return e.command===ML?t={kind:wL.SourceOrganizeImports.value}:e.command===TL&&(t={kind:wL.SourceFixAll.value}),Object.assign({resolvedKeybinding:e.resolvedKeybinding},SL.fromUser(t,{kind:wL.None,apply:"never"}))}))));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.value);return null==i?void 0:i.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new wL(e.kind);return t.filter((e=>e.kind.contains(i))).filter((t=>!t.preferred||e.isPreferred)).reduceRight(((e,t)=>e?e.kind.contains(t.kind)?t:e:t),void 0)}};UL.codeActionCommands=[EL,DL,IL,ML,TL],UL=VL=HL([zL(0,WL)],UL);Dp("symbolIcon.arrayForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.booleanForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},ue(0,"The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.colorForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.constantForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},ue(0,"The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},ue(0,"The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},ue(0,"The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},ue(0,"The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},ue(0,"The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.fileForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.folderForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},ue(0,"The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},ue(0,"The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.keyForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.keywordForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},ue(0,"The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.moduleForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.namespaceForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.nullForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.numberForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.objectForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.operatorForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.packageForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.propertyForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.referenceForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.snippetForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.stringForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.structForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.textForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.typeParameterForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.unitForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},ue(0,"The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const KL=Object.freeze({kind:wL.Empty,title:ue(0,"More Actions...")}),jL=Object.freeze([{kind:wL.QuickFix,title:ue(0,"Quick Fix")},{kind:wL.RefactorExtract,title:ue(0,"Extract"),icon:Jr.wrench},{kind:wL.RefactorInline,title:ue(0,"Inline"),icon:Jr.wrench},{kind:wL.RefactorRewrite,title:ue(0,"Rewrite"),icon:Jr.wrench},{kind:wL.RefactorMove,title:ue(0,"Move"),icon:Jr.wrench},{kind:wL.SurroundWith,title:ue(0,"Surround With"),icon:Jr.symbolSnippet},{kind:wL.Source,title:ue(0,"Source Action"),icon:Jr.symbolFile},KL]);function qL(e,t,i){let n=null,s=null;if("function"==typeof i.value?(n="value",s=i.value,0!==s.length&&console.warn("Memoize should only be used in functions with zero parameters")):"function"==typeof i.get&&(n="get",s=i.get),!s)throw new Error("not supported");const o=`$memoize$${t}`;i[n]=function(...e){return this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,e)}),this[o]}}var $L,GL=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};!function(e){e.Tap="-monaco-gesturetap",e.Change="-monaco-gesturechange",e.Start="-monaco-gesturestart",e.End="-monaco-gesturesend",e.Contextmenu="-monaco-gesturecontextmenu"}($L||($L={}));class ZL extends E{constructor(){super(),this.dispatched=!1,this.targets=new O,this.ignoreTargets=new O,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(En(document,"touchstart",(e=>this.onTouchStart(e)),{passive:!1})),this._register(En(document,"touchend",(e=>this.onTouchEnd(e)))),this._register(En(document,"touchmove",(e=>this.onTouchMove(e)),{passive:!1}))}static addTarget(e){if(!ZL.isTouchDevice())return E.None;ZL.INSTANCE||(ZL.INSTANCE=S(new ZL));return x(ZL.INSTANCE.targets.push(e))}static ignoreTarget(e){if(!ZL.isTouchDevice())return E.None;ZL.INSTANCE||(ZL.INSTANCE=S(new ZL));return x(ZL.INSTANCE.ignoreTargets.push(e))}static isTouchDevice(){return"ontouchstart"in window||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(o.initialPageX-Md(o.rollingPageX))<30&&Math.abs(o.initialPageY-Md(o.rollingPageY))<30){const e=this.newGestureEvent($L.Contextmenu,o.initialTarget);e.pageX=Md(o.rollingPageX),e.pageY=Md(o.rollingPageY),this.dispatchEvent(e)}else if(1===i){const e=Md(o.rollingPageX),i=Md(o.rollingPageY),n=Md(o.rollingTimestamps)-o.rollingTimestamps[0],s=e-o.rollingPageX[0],r=i-o.rollingPageY[0],a=[...this.targets].filter((e=>o.initialTarget instanceof Node&&e.contains(o.initialTarget)));this.inertia(a,t,Math.abs(s)/n,s>0?1:-1,e,Math.abs(r)/n,r>0?1:-1,i)}this.dispatchEvent(this.newGestureEvent($L.End,o.initialTarget)),delete this.activeTouches[s.identifier]}this.dispatched&&(e.preventDefault(),e.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===$L.Tap){const t=(new Date).getTime();let i=0;i=t-this._lastSetTapCountTime>ZL.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=t,e.tapCount=i}else e.type!==$L.Change&&e.type!==$L.Contextmenu||(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const t of this.ignoreTargets)if(t.contains(e.initialTarget))return;for(const t of this.targets)t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)}}inertia(e,t,i,n,s,o,r,a){this.handle=An((()=>{const l=Date.now(),h=l-t;let d=0,c=0,u=!0;i+=ZL.SCROLL_FRICTION*h,o+=ZL.SCROLL_FRICTION*h,i>0&&(u=!1,d=n*i*h),o>0&&(u=!1,c=r*o*h);const g=this.newGestureEvent($L.Change);g.translationX=d,g.translationY=c,e.forEach((e=>e.dispatchEvent(g))),u||this.inertia(e,l,i,n,s+d,o,r,a+c)}))}onTouchMove(e){const t=Date.now();for(let i=0,n=e.changedTouches.length;i3&&(s.rollingPageX.shift(),s.rollingPageY.shift(),s.rollingTimestamps.shift()),s.rollingPageX.push(n.pageX),s.rollingPageY.push(n.pageY),s.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,GL([qL],ZL,"isTouchDevice",null);var YL,XL,QL=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},JL=function(e,t){return function(i,n){t(i,n,e)}};!function(e){e.Hidden={type:0};e.Showing=class{constructor(e,t,i,n){this.actions=e,this.trigger=t,this.editorPosition=i,this.widgetPosition=n,this.type=1}}}(XL||(XL={}));let ek=YL=class extends E{constructor(e,t){super(),this._editor=e,this._onClick=this._register(new U),this.onClick=this._onClick.event,this._state=XL.Hidden,this._domNode=fs("div.lightBulbWidget"),this._register(ZL.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent((e=>{const t=this._editor.getModel();(1!==this.state.type||!t||this.state.editorPosition.lineNumber>=t.getLineCount())&&this.hide()}))),this._register(Tn(this._domNode,(e=>{if(1!==this.state.type)return;this._editor.focus(),e.preventDefault();const{top:t,height:i}=Hn(this._domNode),n=this._editor.getOption(66);let s=Math.floor(n/3);null!==this.state.widgetPosition.position&&this.state.widgetPosition.position.lineNumber{1&~e.buttons||this.hide()}))),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(64)&&!this._editor.getOption(64).enabled&&this.hide()}))),this._register(B.runAndSubscribe(t.onDidUpdateKeybindings,(()=>{var e,i,n,s;this._preferredKbLabel=null!==(i=null===(e=t.lookupKeybinding(NL))||void 0===e?void 0:e.getLabel())&&void 0!==i?i:void 0,this._quickFixKbLabel=null!==(s=null===(n=t.lookupKeybinding(xL))||void 0===n?void 0:n.getLabel())&&void 0!==s?s:void 0,this._updateLightBulbTitleAndIcon()})))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return 1===this._state.type?this._state.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.hide();const n=this._editor.getOptions();if(!n.get(64).enabled)return this.hide();const s=this._editor.getModel();if(!s)return this.hide();const{lineNumber:o,column:r}=s.validatePosition(i),a=s.getOptions().tabSize,l=n.get(50),h=Xv(s.getLineContent(o),a),d=e=>e>2&&this._editor.getTopForLineNumber(e)===this._editor.getTopForLineNumber(e-1);let c=o;if(!(l.spaceWidth*h>22))if(o>1&&!d(o-1))c-=1;else if(d(o+1)){if(r*l.spaceWidth<22)return this.hide()}else c+=1;this.state=new XL.Showing(e,t,i,{position:{lineNumber:c,column:1},preference:YL._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==XL.Hidden&&(this.state=XL.Hidden,this._editor.layoutContentWidget(this))}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){1===this.state.type&&this.state.actions.hasAutoFix&&(this._domNode.classList.remove(...ta.asClassNameArray(Jr.lightBulb)),this._domNode.classList.add(...ta.asClassNameArray(Jr.lightbulbAutofix)),this._preferredKbLabel)?this.title=ue(0,"Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel):(this._domNode.classList.remove(...ta.asClassNameArray(Jr.lightbulbAutofix)),this._domNode.classList.add(...ta.asClassNameArray(Jr.lightBulb)),this._quickFixKbLabel?this.title=ue(0,"Show Code Actions ({0})",this._quickFixKbLabel):this.title=ue(0,"Show Code Actions"))}set title(e){this._domNode.title=e}};function tk(e,t={}){const i=ik(t);return sk(i,function(e,t){const i={type:1,children:[]};let n=0,s=i;const o=[],r=new nk(e);for(;!r.eos();){let e=r.next();const i="\\"===e&&0!==rk(r.peek(),t);if(i&&(e=r.next()),!i&&ok(e,t)&&e===r.peek()){r.advance(),2===s.type&&(s=o.pop());const i=rk(e,t);if(s.type===i||5===s.type&&6===i)s=o.pop();else{const e={type:i,children:[]};5===i&&(e.index=n,n++),s.children.push(e),o.push(s),s=e}}else if("\n"===e)2===s.type&&(s=o.pop()),s.children.push({type:8});else if(2!==s.type){const t={type:2,content:e};s.children.push(t),o.push(s),s=t}else s.content+=e}2===s.type&&(s=o.pop());o.length;return i}(e,!!t.renderCodeSegments),t.actionHandler,t.renderCodeSegments),i}function ik(e){const t=e.inline?"span":"div",i=document.createElement(t);return e.className&&(i.className=e.className),i}ek.ID="editor.contrib.lightbulbWidget",ek._posPref=[0],ek=YL=QL([JL(1,WL)],ek);class nk{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++}}function sk(e,t,i,n){let s;if(2===t.type)s=document.createTextNode(t.content||"");else if(3===t.type)s=document.createElement("b");else if(4===t.type)s=document.createElement("i");else if(7===t.type&&n)s=document.createElement("code");else if(5===t.type&&i){const e=document.createElement("a");i.disposables.add(Mn(e,"click",(e=>{i.callback(String(t.index),e)}))),s=e}else 8===t.type?s=document.createElement("br"):1===t.type&&(s=e);s&&e!==s&&e.appendChild(s),s&&Array.isArray(t.children)&&t.children.forEach((e=>{sk(s,e,i,n)}))}function ok(e,t){return 0!==rk(e,t)}function rk(e,t){switch(e){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return t?7:0;default:return 0}}const ak=new RegExp(`(\\\\)?\\$\\((${ta.iconNameExpression}(?:${ta.iconModifierExpression})?)\\)`,"g");function lk(e){const t=new Array;let i,n=0,s=0;for(;null!==(i=ak.exec(e));){s=i.index||0,ne.length)&&(t=e.length);for(var i=0,n=new Array(t);i=e.length?{done:!0}:{done:!1,value:e[s++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(){return{async:!1,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}}e.defaults={async:!1,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};var o=/[&<>"']/,r=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,h={"&":"&","<":"<",">":">",'"':""","'":"'"},d=function(e){return h[e]};function c(e,t){if(t){if(o.test(e))return e.replace(r,d)}else if(a.test(e))return e.replace(l,d);return e}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function g(e){return e.replace(u,(function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))}var p=/(^|[^\[])\^/g;function m(e,t){e="string"==typeof e?e:e.source,t=t||"";var i={replace:function(t,n){return n=(n=n.source||n).replace(p,"$1"),e=e.replace(t,n),i},getRegex:function(){return new RegExp(e,t)}};return i}var f=/[^\w:]/g,_=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function v(e,t,i){if(e){var n;try{n=decodeURIComponent(g(i)).replace(f,"").toLowerCase()}catch(Mre){return null}if(0===n.indexOf("javascript:")||0===n.indexOf("vbscript:")||0===n.indexOf("data:"))return null}t&&!_.test(i)&&(i=function(e,t){b[" "+e]||(C.test(e)?b[" "+e]=e+"/":b[" "+e]=D(e,"/",!0));var i=-1===(e=b[" "+e]).indexOf(":");return"//"===t.substring(0,2)?i?t:e.replace(w,"$1")+t:"/"===t.charAt(0)?i?t:e.replace(y,"$1")+t:e+t}(t,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(Mre){return null}return i}var b={},C=/^[^:]+:\/*[^/]*$/,w=/^([^:]+:)[\s\S]*$/,y=/^([^:]+:\/*[^/]*)[\s\S]*$/,S={exec:function(){}};function L(e){for(var t,i,n=1;n=0&&"\\"===i[s];)n=!n;return n?"|":" |"})).split(/ \|/),n=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.length1;)1&t&&(i+=e),t>>=1,e+=e;return i+e}function E(e,t,i,n){var s=t.href,o=t.title?c(t.title):null,r=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){n.state.inLink=!0;var a={type:"link",raw:i,href:s,title:o,text:r,tokens:n.inlineTokens(r)};return n.state.inLink=!1,a}return{type:"image",raw:i,href:s,title:o,text:c(r)}}var I=function(){function t(t){this.options=t||e.defaults}var i=t.prototype;return i.space=function(e){var t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}},i.code=function(e){var t=this.rules.block.code.exec(e);if(t){var i=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?i:D(i,"\n")}}},i.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var i=t[0],n=function(e,t){var i=e.match(/^(\s+)(?:```)/);if(null===i)return t;var n=i[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:t[0].length>=n.length?e.slice(n.length):e})).join("\n")}(i,t[3]||"");return{type:"code",raw:i,lang:t[2]?t[2].trim():t[2],text:n}}},i.heading=function(e){var t=this.rules.block.heading.exec(e);if(t){var i=t[2].trim();if(/#$/.test(i)){var n=D(i,"#");this.options.pedantic?i=n.trim():n&&!/ $/.test(n)||(i=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:i,tokens:this.lexer.inline(i)}}},i.hr=function(e){var t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}},i.blockquote=function(e){var t=this.rules.block.blockquote.exec(e);if(t){var i=t[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(i,[]),text:i}}},i.list=function(e){var t=this.rules.block.list.exec(e);if(t){var i,s,o,r,a,l,h,d,c,u,g,p,m=t[1].trim(),f=m.length>1,_={type:"list",raw:"",ordered:f,start:f?+m.slice(0,-1):"",loose:!1,items:[]};m=f?"\\d{1,9}\\"+m.slice(-1):"\\"+m,this.options.pedantic&&(m=f?m:"[*+-]");for(var v=new RegExp("^( {0,3}"+m+")((?:[\t ][^\\n]*)?(?:\\n|$))");e&&(p=!1,t=v.exec(e))&&!this.rules.block.hr.test(e);){if(i=t[0],e=e.substring(i.length),d=t[2].split("\n",1)[0],c=e.split("\n",1)[0],this.options.pedantic?(r=2,g=d.trimLeft()):(r=(r=t[2].search(/[^ ]/))>4?1:r,g=d.slice(r),r+=t[1].length),l=!1,!d&&/^ *$/.test(c)&&(i+=c+"\n",e=e.substring(c.length+1),p=!0),!p)for(var b=new RegExp("^ {0,"+Math.min(3,r-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),C=new RegExp("^ {0,"+Math.min(3,r-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),w=new RegExp("^ {0,"+Math.min(3,r-1)+"}(?:```|~~~)"),y=new RegExp("^ {0,"+Math.min(3,r-1)+"}#");e&&(d=u=e.split("\n",1)[0],this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!w.test(d))&&!y.test(d)&&!b.test(d)&&!C.test(e);){if(d.search(/[^ ]/)>=r||!d.trim())g+="\n"+d.slice(r);else{if(l)break;g+="\n"+d}l||d.trim()||(l=!0),i+=u+"\n",e=e.substring(u.length+1)}_.loose||(h?_.loose=!0:/\n *\n *$/.test(i)&&(h=!0)),this.options.gfm&&(s=/^\[[ xX]\] /.exec(g))&&(o="[ ] "!==s[0],g=g.replace(/^\[[ xX]\] +/,"")),_.items.push({type:"list_item",raw:i,task:!!s,checked:o,loose:!1,text:g}),_.raw+=i}_.items[_.items.length-1].raw=i.trimRight(),_.items[_.items.length-1].text=g.trimRight(),_.raw=_.raw.trimRight();var S=_.items.length;for(a=0;a1)return!0;return!1}));!_.loose&&L.length&&k&&(_.loose=!0,_.items[a].loose=!0)}return _}},i.html=function(e){var t=this.rules.block.html.exec(e);if(t){var i={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};if(this.options.sanitize){var n=this.options.sanitizer?this.options.sanitizer(t[0]):c(t[0]);i.type="paragraph",i.text=n,i.tokens=this.lexer.inline(n)}return i}},i.def=function(e){var 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]}},i.table=function(e){var t=this.rules.block.table.exec(e);if(t){var i={type:"table",header:k(t[1]).map((function(e){return{text:e}})),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(i.header.length===i.align.length){i.raw=t[0];var n,s,o,r,a=i.align.length;for(n=0;n/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]):c(t[0]):t[0]}},i.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var i=t[2].trim();if(!this.options.pedantic&&/^$/.test(i))return;var n=D(i.slice(0,-1),"\\");if((i.length-n.length)%2==0)return}else{var s=function(e,t){if(-1===e.indexOf(t[1]))return-1;for(var i=e.length,n=0,s=0;s-1){var o=(0===t[0].indexOf("!")?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,o).trim(),t[3]=""}}var r=t[2],a="";if(this.options.pedantic){var l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);l&&(r=l[1],a=l[3])}else a=t[3]?t[3].slice(1,-1):"";return r=r.trim(),/^$/.test(i)?r.slice(1):r.slice(1,-1)),E(t,{href:r?r.replace(this.rules.inline._escapes,"$1"):r,title:a?a.replace(this.rules.inline._escapes,"$1"):a},t[0],this.lexer)}},i.reflink=function(e,t){var i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){var n=(i[2]||i[1]).replace(/\s+/g," ");if(!(n=t[n.toLowerCase()])||!n.href){var s=i[0].charAt(0);return{type:"text",raw:s,text:s}}return E(i,n,i[0],this.lexer)}},i.emStrong=function(e,t,i){void 0===i&&(i="");var n=this.rules.inline.emStrong.lDelim.exec(e);if(n&&(!n[3]||!i.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var s=n[1]||n[2]||"";if(!s||s&&(""===i||this.rules.inline.punctuation.exec(i))){var o,r,a=n[0].length-1,l=a,h=0,d="*"===n[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+a);null!=(n=d.exec(t));)if(o=n[1]||n[2]||n[3]||n[4]||n[5]||n[6])if(r=o.length,n[3]||n[4])l+=r;else if(!((n[5]||n[6])&&a%3)||(a+r)%3){if(!((l-=r)>0)){if(r=Math.min(r,r+l+h),Math.min(a,r)%2){var c=e.slice(1,a+n.index+r);return{type:"em",raw:e.slice(0,a+n.index+r+1),text:c,tokens:this.lexer.inlineTokens(c)}}var u=e.slice(2,a+n.index+r-1);return{type:"strong",raw:e.slice(0,a+n.index+r+1),text:u,tokens:this.lexer.inlineTokens(u)}}}else h+=r}}},i.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var i=t[2].replace(/\n/g," "),n=/[^ ]/.test(i),s=/^ /.test(i)&&/ $/.test(i);return n&&s&&(i=i.substring(1,i.length-1)),i=c(i,!0),{type:"codespan",raw:t[0],text:i}}},i.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}},i.del=function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}},i.autolink=function(e,t){var i,n,s=this.rules.inline.autolink.exec(e);if(s)return n="@"===s[2]?"mailto:"+(i=c(this.options.mangle?t(s[1]):s[1])):i=c(s[1]),{type:"link",raw:s[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}},i.url=function(e,t){var i;if(i=this.rules.inline.url.exec(e)){var n,s;if("@"===i[2])s="mailto:"+(n=c(this.options.mangle?t(i[0]):i[0]));else{var o;do{o=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0]}while(o!==i[0]);n=c(i[0]),s="www."===i[1]?"http://"+n:n}return{type:"link",raw:i[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}},i.inlineText=function(e,t){var i,n=this.rules.inline.text.exec(e);if(n)return i=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):c(n[0]):n[0]:c(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:i}},t}(),M={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}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\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:S,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};M.def=m(M.def).replace("label",M._label).replace("title",M._title).getRegex(),M.bullet=/(?:[*+-]|\d{1,9}[.)])/,M.listItemStart=m(/^( *)(bull) */).replace("bull",M.bullet).getRegex(),M.list=m(M.list).replace(/bull/g,M.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+M.def.source+")").getRegex(),M._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",M._comment=/|$)/,M.html=m(M.html,"i").replace("comment",M._comment).replace("tag",M._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),M.paragraph=m(M._paragraph).replace("hr",M.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",M._tag).getRegex(),M.blockquote=m(M.blockquote).replace("paragraph",M.paragraph).getRegex(),M.normal=L({},M),M.gfm=L({},M.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),M.gfm.table=m(M.gfm.table).replace("hr",M.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",M._tag).getRegex(),M.gfm.paragraph=m(M._paragraph).replace("hr",M.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",M.gfm.table).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",M._tag).getRegex(),M.pedantic=L({},M.normal,{html:m("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",M._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:S,paragraph:m(M.normal._paragraph).replace("hr",M.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",M.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var T={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:S,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,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:S,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\.5&&(i="x"+i.toString(16)),n+="&#"+i+";";return n}T._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",T.punctuation=m(T.punctuation).replace(/punctuation/g,T._punctuation).getRegex(),T.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,T.escapedEmSt=/\\\*|\\_/g,T._comment=m(M._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),T.emStrong.lDelim=m(T.emStrong.lDelim).replace(/punct/g,T._punctuation).getRegex(),T.emStrong.rDelimAst=m(T.emStrong.rDelimAst,"g").replace(/punct/g,T._punctuation).getRegex(),T.emStrong.rDelimUnd=m(T.emStrong.rDelimUnd,"g").replace(/punct/g,T._punctuation).getRegex(),T._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,T._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,T._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])?)+(?![-_])/,T.autolink=m(T.autolink).replace("scheme",T._scheme).replace("email",T._email).getRegex(),T._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,T.tag=m(T.tag).replace("comment",T._comment).replace("attribute",T._attribute).getRegex(),T._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,T._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,T._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,T.link=m(T.link).replace("label",T._label).replace("href",T._href).replace("title",T._title).getRegex(),T.reflink=m(T.reflink).replace("label",T._label).replace("ref",M._label).getRegex(),T.nolink=m(T.nolink).replace("ref",M._label).getRegex(),T.reflinkSearch=m(T.reflinkSearch,"g").replace("reflink",T.reflink).replace("nolink",T.nolink).getRegex(),T.normal=L({},T),T.pedantic=L({},T.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:m(/^!?\[(label)\]\((.*?)\)/).replace("label",T._label).getRegex(),reflink:m(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",T._label).getRegex()}),T.gfm=L({},T.normal,{escape:m(T.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]*?(?:(?=[\\0?t[t.length-1].raw+="\n":t.push(i);else if(i=this.tokenizer.code(e))e=e.substring(i.raw.length),!(n=t[t.length-1])||"paragraph"!==n.type&&"text"!==n.type?t.push(i):(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(i=this.tokenizer.fences(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.heading(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.hr(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.blockquote(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.list(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.html(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.def(e))e=e.substring(i.raw.length),!(n=t[t.length-1])||"paragraph"!==n.type&&"text"!==n.type?this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title}):(n.raw+="\n"+i.raw,n.text+="\n"+i.raw,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(i=this.tokenizer.table(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.lheading(e))e=e.substring(i.raw.length),t.push(i);else if(s=e,this.options.extensions&&this.options.extensions.startBlock&&function(){var t=1/0,i=e.slice(1),n=void 0;r.options.extensions.startBlock.forEach((function(e){"number"==typeof(n=e.call({lexer:this},i))&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}(),this.state.top&&(i=this.tokenizer.paragraph(s)))n=t[t.length-1],o&&"paragraph"===n.type?(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i),o=s.length!==e.length,e=e.substring(i.raw.length);else if(i=this.tokenizer.text(e))e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===n.type?(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i);else if(e){var a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}throw new Error(a)}return this.state.top=!0,t},r.inline=function(e,t){return void 0===t&&(t=[]),this.inlineQueue.push({src:e,tokens:t}),t},r.inlineTokens=function(e,t){var i,n,s,o=this;void 0===t&&(t=[]);var r,a,l,h=e;if(this.tokens.links){var d=Object.keys(this.tokens.links);if(d.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(h));)d.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(h=h.slice(0,r.index)+"["+N("a",r[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(h));)h=h.slice(0,r.index)+"["+N("a",r[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.escapedEmSt.exec(h));)h=h.slice(0,r.index)+"++"+h.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(a||(l=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((function(n){return!!(i=n.call({lexer:o},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)}))))if(i=this.tokenizer.escape(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.tag(e))e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(i=this.tokenizer.link(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(i=this.tokenizer.emStrong(e,h,l))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.codespan(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.br(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.del(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.autolink(e,A))e=e.substring(i.raw.length),t.push(i);else if(this.state.inLink||!(i=this.tokenizer.url(e,A))){if(s=e,this.options.extensions&&this.options.extensions.startInline&&function(){var t=1/0,i=e.slice(1),n=void 0;o.options.extensions.startInline.forEach((function(e){"number"==typeof(n=e.call({lexer:this},i))&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}(),i=this.tokenizer.inlineText(s,R))e=e.substring(i.raw.length),"_"!==i.raw.slice(-1)&&(l=i.raw.slice(-1)),a=!0,(n=t[t.length-1])&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(e){var c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}}else e=e.substring(i.raw.length),t.push(i);return t},n=i,o=[{key:"rules",get:function(){return{block:M,inline:T}}}],(s=null)&&t(n.prototype,s),o&&t(n,o),Object.defineProperty(n,"prototype",{writable:!1}),i}(),P=function(){function t(t){this.options=t||e.defaults}var i=t.prototype;return i.code=function(e,t,i){var n=(t||"").match(/\S*/)[0];if(this.options.highlight){var s=this.options.highlight(e,n);null!=s&&s!==e&&(i=!0,e=s)}return e=e.replace(/\n$/,"")+"\n",n?'
'+(i?e:c(e,!0))+"
\n":"
"+(i?e:c(e,!0))+"
\n"},i.blockquote=function(e){return"
\n"+e+"
\n"},i.html=function(e){return e},i.heading=function(e,t,i,n){return this.options.headerIds?"'+e+"\n":""+e+"\n"},i.hr=function(){return this.options.xhtml?"
\n":"
\n"},i.list=function(e,t,i){var n=t?"ol":"ul";return"<"+n+(t&&1!==i?' start="'+i+'"':"")+">\n"+e+"\n"},i.listitem=function(e){return"
  • "+e+"
  • \n"},i.checkbox=function(e){return" "},i.paragraph=function(e){return"

    "+e+"

    \n"},i.table=function(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"},i.tablerow=function(e){return"\n"+e+"\n"},i.tablecell=function(e,t){var i=t.header?"th":"td";return(t.align?"<"+i+' align="'+t.align+'">':"<"+i+">")+e+"\n"},i.strong=function(e){return""+e+""},i.em=function(e){return""+e+""},i.codespan=function(e){return""+e+""},i.br=function(){return this.options.xhtml?"
    ":"
    "},i.del=function(e){return""+e+""},i.link=function(e,t,i){if(null===(e=v(this.options.sanitize,this.options.baseUrl,e)))return i;var n='"},i.image=function(e,t,i){if(null===(e=v(this.options.sanitize,this.options.baseUrl,e)))return i;var n=''+i+'":">"},i.text=function(e){return e},t}(),F=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,i){return""+i},t.image=function(e,t,i){return""+i},t.br=function(){return""},e}(),B=function(){function e(){this.seen={}}var t=e.prototype;return t.serialize=function(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},t.getNextSafeSlug=function(e,t){var i=e,n=0;if(this.seen.hasOwnProperty(i)){n=this.seen[e];do{i=e+"-"+ ++n}while(this.seen.hasOwnProperty(i))}return t||(this.seen[e]=n,this.seen[i]=0),i},t.slug=function(e,t){void 0===t&&(t={});var i=this.serialize(e);return this.getNextSafeSlug(i,t.dryrun)},e}(),W=function(){function t(t){this.options=t||e.defaults,this.options.renderer=this.options.renderer||new P,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new F,this.slugger=new B}t.parse=function(e,i){return new t(i).parse(e)},t.parseInline=function(e,i){return new t(i).parseInline(e)};var i=t.prototype;return i.parse=function(e,t){void 0===t&&(t=!0);var i,n,s,o,r,a,l,h,d,c,u,p,m,f,_,v,b,C,w,y="",S=e.length;for(i=0;i0&&"paragraph"===_.tokens[0].type?(_.tokens[0].text=C+" "+_.tokens[0].text,_.tokens[0].tokens&&_.tokens[0].tokens.length>0&&"text"===_.tokens[0].tokens[0].type&&(_.tokens[0].tokens[0].text=C+" "+_.tokens[0].tokens[0].text)):_.tokens.unshift({type:"text",text:C}):f+=C),f+=this.parse(_.tokens,m),d+=this.renderer.listitem(f,b,v);y+=this.renderer.list(d,u,p);continue;case"html":y+=this.renderer.html(c.text);continue;case"paragraph":y+=this.renderer.paragraph(this.parseInline(c.tokens));continue;case"text":for(d=c.tokens?this.parseInline(c.tokens):c.text;i+1An error occurred:

    "+c(e.message+"",!0)+"
    ";throw e}try{var l=O.lex(e,t);if(t.walkTokens){if(t.async)return Promise.all(V.walkTokens(l,t.walkTokens)).then((function(){return W.parse(l,t)})).catch(a);V.walkTokens(l,t.walkTokens)}return W.parse(l,t)}catch(Mre){a(Mre)}}V.options=V.setOptions=function(t){var i;return L(V.defaults,t),i=V.defaults,e.defaults=i,V},V.getDefaults=s,V.defaults=e.defaults,V.use=function(){for(var e=arguments.length,t=new Array(e),i=0;iAn error occurred:

    "+c(Mre.message+"",!0)+"
    ";throw Mre}},V.Parser=W,V.parser=W.parse,V.Renderer=P,V.TextRenderer=F,V.Lexer=O,V.lexer=O.lex,V.Tokenizer=I,V.Slugger=B,V.parse=V;var H=V.options,z=V.setOptions,U=V.use,K=V.walkTokens,j=V.parseInline,q=V,$=W.parse,G=O.lex;e.Lexer=O,e.Parser=W,e.Renderer=P,e.Slugger=B,e.TextRenderer=F,e.Tokenizer=I,e.getDefaults=s,e.lexer=G,e.marked=V,e.options=H,e.parse=q,e.parseInline=j,e.parser=$,e.setOptions=z,e.use=U,e.walkTokens=K,Object.defineProperty(e,"__esModule",{value:!0})},e.amd?e(0,i):"object"==typeof exports?i(exports):i((t="undefined"!=typeof globalThis?globalThis:t||self).marked={})}();uk.Lexer||exports.Lexer,uk.Parser||exports.Parser,uk.Renderer||exports.Renderer,uk.Slugger||exports.Slugger,uk.TextRenderer||exports.TextRenderer,uk.Tokenizer||exports.Tokenizer,uk.getDefaults||exports.getDefaults,uk.lexer||exports.lexer;var gk=uk.marked||exports.marked;uk.options||exports.options,uk.parse||exports.parse,uk.parseInline||exports.parseInline,uk.parser||exports.parser,uk.setOptions||exports.setOptions,uk.use||exports.use,uk.walkTokens||exports.walkTokens;function pk(e){let t=JSON.parse(e);return t=fk(t),t}function mk(e,t){return t instanceof RegExp?{$mid:2,source:t.source,flags:t.flags}:t}function fk(e,t=0){if(!e||t>200)return e;if("object"==typeof e){switch(e.$mid){case 1:return an.revive(e);case 2:return new RegExp(e.source,e.flags);case 17:return new Date(e.source)}if(e instanceof Kc||e instanceof Uint8Array)return e;if(Array.isArray(e))for(let i=0;i{let n=[],s=[];return e&&(({href:e,dimensions:n}=function(e){const t=[],i=e.split("|").map((e=>e.trim()));e=i[0];const n=i[1];if(n){const e=/height=(\d+)/.exec(n),i=/width=(\d+)/.exec(n),s=e?e[1]:"",o=i?i[1]:"",r=isFinite(parseInt(o)),a=isFinite(parseInt(s));r&&t.push(`width="${o}"`),a&&t.push(`height="${s}"`)}return{href:e,dimensions:t}}(e)),s.push(`src="${Oa(e)}"`)),i&&s.push(`alt="${Oa(i)}"`),t&&s.push(`title="${Oa(t)}"`),n.length&&(s=s.concat(n)),""},paragraph:e=>`

    ${e}

    `,link:(e,t,i)=>"string"!=typeof e?"":(e===i&&(i=Pa(i)),t="string"==typeof t?Oa(Pa(t)):"",`
    /g,">").replace(/"/g,""").replace(/'/g,"'")}" title="${t||e}">${i}`)});function vk(e,t={},i={}){var n,s;const o=new N;let a=!1;const l=ik(t),h=function(t){let i;try{i=pk(decodeURIComponent(t))}catch(Mre){}return i?(i=md(i,(t=>e.uris&&e.uris[t]?an.revive(e.uris[t]):void 0)),encodeURIComponent(JSON.stringify(i))):t},d=function(t,i){const n=e.uris&&e.uris[t];let s=an.revive(n);return i?t.startsWith(vn.data+":")?t:(s||(s=an.parse(t)),wn.uriToBrowserUri(s).toString(!0)):s?an.parse(t).toString()===s.toString()?t:(s.query&&(s=s.with({query:h(s.query)})),s.toString()):t},c=new gk.Renderer;c.image=_k.image,c.link=_k.link,c.paragraph=_k.paragraph;const u=[],g=[];if(t.codeBlockRendererSync?c.code=(e,i)=>{const n=ck.nextId(),s=t.codeBlockRendererSync(bk(i),e);return g.push([n,s]),`
    ${Js(e)}
    `}:t.codeBlockRenderer&&(c.code=(e,i)=>{const n=ck.nextId(),s=t.codeBlockRenderer(bk(i),e);return u.push(s.then((e=>[n,e]))),`
    ${Js(e)}
    `}),t.actionHandler){const i=function(i){let n=i.target;if("A"===n.tagName||(n=n.parentElement,n&&"A"===n.tagName))try{let s=n.dataset.href;s&&(e.baseUri&&(s=Ck(an.from(e.baseUri),s)),t.actionHandler.callback(s,i))}catch(s){r(s)}finally{i.preventDefault()}},n=t.actionHandler.disposables.add(new Ky(l,"click")),s=t.actionHandler.disposables.add(new Ky(l,"auxclick"));t.actionHandler.disposables.add(B.any(n.event,s.event)((e=>{const t=new Nt(e);(t.leftButton||t.middleButton)&&i(t)}))),t.actionHandler.disposables.add(En(l,"keydown",(e=>{const t=new St(e);(t.equals(10)||t.equals(3))&&i(t)})))}e.supportHtml||(i.sanitizer=t=>(e.isTrusted?t.match(/^(]+>)|(<\/\s*span>)$/):void 0)?t:"",i.sanitize=!0,i.silent=!0),i.renderer=c;let p=null!==(n=e.value)&&void 0!==n?n:"";let m;if(p.length>1e5&&(p=`${p.substr(0,1e5)}\u2026`),e.supportThemeIcons&&(p=p.replace(oa,(e=>`\\${e}`))),t.fillInIncompleteTokens){const e=Object.assign(Object.assign({},gk.defaults),i),t=function(e){let t,i;for(t=0;t"string"==typeof e?e:e.outerHTML)).join("")}const f=(new DOMParser).parseFromString(wk(e,m),"text/html");if(f.body.querySelectorAll("img").forEach((t=>{const i=t.getAttribute("src");if(i){let s=i;try{e.baseUri&&(s=Ck(an.from(e.baseUri),s))}catch(n){}t.src=d(s,!0)}})),f.body.querySelectorAll("a").forEach((t=>{const i=t.getAttribute("href");if(t.setAttribute("href",""),!i||/^data:|javascript:/i.test(i)||/^command:/i.test(i)&&!e.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(i))t.replaceWith(...t.childNodes);else{let n=d(i,!1);e.baseUri&&(n=Ck(an.from(e.baseUri),i)),t.dataset.href=n}})),l.innerHTML=wk(e,f.body.innerHTML),u.length>0)Promise.all(u).then((e=>{var i,n;if(a)return;const s=new Map(e),o=l.querySelectorAll("div[data-code]");for(const t of o){const e=s.get(null!==(i=t.dataset.code)&&void 0!==i?i:"");e&&us(t,e)}null===(n=t.asyncRenderCallback)||void 0===n||n.call(t)}));else if(g.length>0){const e=new Map(g),t=l.querySelectorAll("div[data-code]");for(const i of t){const t=e.get(null!==(s=i.dataset.code)&&void 0!==s?s:"");t&&us(i,t)}}if(t.asyncRenderCallback)for(const r of l.getElementsByTagName("img")){const e=o.add(En(r,"load",(()=>{e.dispose(),t.asyncRenderCallback()})))}return{element:l,dispose:()=>{a=!0,o.dispose()}}}function bk(e){if(!e)return"";const t=e.split(/[\s+|:|,|\{|\?]/,1);return t.length?t[0]:e}function Ck(e,t){return/^\w[\w\d+.-]*:/.test(t)?t:e.path.endsWith("/")?xa(e,t).toString():xa(Sa(e),t).toString()}function wk(e,t){const{config:i,allowedSchemes:n}=function(e){const t=[vn.http,vn.https,vn.mailto,vn.data,vn.file,vn.vscodeFileResource,vn.vscodeRemote,vn.vscodeRemoteResource];e.isTrusted&&t.push(vn.command);return{config:{ALLOWED_TAGS:[...Ls],ALLOWED_ATTR:yk,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:t}}(e);Di("uponSanitizeAttribute",((e,t)=>{if("style"!==t.attrName&&"class"!==t.attrName);else{if("SPAN"===e.tagName){if("style"===t.attrName)return void(t.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?$/.test(t.attrValue));if("class"===t.attrName)return void(t.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(t.attrValue))}t.keepAttr=!1}}));const s=function(e,t=!1){const i=document.createElement("a");return Di("afterSanitizeAttributes",(n=>{for(const s of["href","src"])if(n.hasAttribute(s)){const o=n.getAttribute(s);if("href"===s&&o.startsWith("#"))continue;if(i.href=o,!e.includes(i.protocol.replace(/:$/,""))){if(t&&"src"===s&&i.href.startsWith("data:"))continue;n.removeAttribute(s)}}})),x((()=>{xi("afterSanitizeAttributes")}))}(n);try{return ki(t,Object.assign(Object.assign({},i),{RETURN_TRUSTED_TYPE:!0}))}finally{xi("uponSanitizeAttribute"),s.dispose()}}const yk=["align","autoplay","alt","class","controls","data-code","data-href","height","href","loop","muted","playsinline","poster","src","style","target","title","width","start"];function Sk(e){return"string"==typeof e?e:function(e){var t;let i=null!==(t=e.value)&&void 0!==t?t:"";i.length>1e5&&(i=`${i.substr(0,1e5)}\u2026`);const n=gk.parse(i,{renderer:kk.value}).replace(/&(#\d+|[a-zA-Z]+);/g,(e=>{var t;return null!==(t=Lk.get(e))&&void 0!==t?t:e}));return wk({isTrusted:!1},n).toString()}(e)}const Lk=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]),kk=new Zs((()=>{const e=new gk.Renderer;return e.code=e=>e,e.blockquote=e=>e,e.html=e=>"",e.heading=(e,t,i)=>e+"\n",e.hr=()=>"",e.list=(e,t)=>e,e.listitem=e=>e+"\n",e.paragraph=e=>e+"\n",e.table=(e,t)=>e+t+"\n",e.tablerow=e=>e,e.tablecell=(e,t)=>e+" ",e.strong=e=>e,e.em=e=>e,e.codespan=e=>e,e.br=()=>"\n",e.del=e=>e,e.image=(e,t,i)=>"",e.text=e=>e,e.link=(e,t,i)=>i,e}));function Dk(e){let t="";return e.forEach((e=>{t+=e.raw})),t}function xk(e){for(const t of e.tokens)if("text"===t.type){const i=t.raw.split("\n"),n=i[i.length-1];if(n.includes("`"))return Ek(e);if(n.includes("**"))return Ok(e,"**");if(n.match(/\*\w/))return Ik(e);if(n.match(/(^|\s)__\w/))return Ak(e);if(n.match(/(^|\s)_\w/))return Mk(e);if(n.match(/(^|\s)\[.*\]\(\w*/))return Tk(e);if(n.match(/(^|\s)\[\w/))return Rk(e)}}function Nk(e){const t=Dk(e);return gk.lexer(t+"\n```")}function Ek(e){return Ok(e,"`")}function Ik(e){return Ok(e,"*")}function Mk(e){return Ok(e,"_")}function Tk(e){return Ok(e,")")}function Rk(e){return Ok(e,"](about:blank)")}function Ak(e){return Ok(e,"__")}function Ok(e,t){const i=Dk(Array.isArray(e)?e:[e]);return gk.lexer(i+t)[0]}function Pk(e){const t=Dk(e),i=t.split("\n");let n,s=!1;for(let o=0;o0){const e=s?i.slice(0,-1).join("\n"):t,o=!!e.match(/\|\s*$/),r=e+(o?"":"|")+`\n|${" --- |".repeat(n)}`;return gk.lexer(r)}}function Fk(e,t){var i;const n=globalThis.MonacoEnvironment;if(null==n?void 0:n.createTrustedTypesPolicy)try{return n.createTrustedTypesPolicy(e,t)}catch(s){return void r(s)}try{return null===(i=window.trustedTypes)||void 0===i?void 0:i.createPolicy(e,t)}catch(s){return void r(s)}}class Bk{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",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=Wk(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=Wk(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=Wk(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=Wk(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=Wk(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=Wk(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=Wk(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=Wk(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}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=Wk(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=Wk(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=Wk(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 Wk(e){return"number"==typeof e?`${e}px`:e}function Vk(e){return new Bk(e)}function Hk(e,t){e instanceof Bk?(e.setFontFamily(t.getMassagedFontFamily()),e.setFontWeight(t.fontWeight),e.setFontSize(t.fontSize),e.setFontFeatureSettings(t.fontFeatureSettings),e.setFontVariationSettings(t.fontVariationSettings),e.setLineHeight(t.lineHeight),e.setLetterSpacing(t.letterSpacing)):(e.style.fontFamily=t.getMassagedFontFamily(),e.style.fontWeight=t.fontWeight,e.style.fontSize=t.fontSize+"px",e.style.fontFeatureSettings=t.fontFeatureSettings,e.style.fontVariationSettings=t.fontVariationSettings,e.style.lineHeight=t.lineHeight+"px",e.style.letterSpacing=t.letterSpacing+"px")}var zk=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Uk={getInitialState:()=>IC,tokenizeEncoded:(e,t,i)=>TC(0,i)};function Kk(e,t,i,n,s,o,r){let a="
    ",l=n,h=0,d=!0;for(let c=0,u=t.getCount();c0;)r&&d?(g+=" ",d=!1):(g+=" ",d=!0),e--;break}case 60:g+="<",d=!1;break;case 62:g+=">",d=!1;break;case 38:g+="&",d=!1;break;case 0:g+="�",d=!1;break;case 65279:case 8232:case 8233:case 133:g+="\ufffd",d=!1;break;case 13:g+="​",d=!1;break;case 32:r&&d?(g+=" ",d=!1):(g+=" ",d=!0);break;default:g+=String.fromCharCode(t),d=!1}}if(a+=`${g}`,u>s||l>=s)break}return a+="
    ",a}function jk(e,t,i){let n='
    ';const s=oo(e);let o=i.getInitialState();for(let r=0,a=s.length;r0&&(n+="
    ");const a=i.tokenizeEncoded(e,!0,o);PC.convertToEndOffset(a.tokens,e.length);const l=new PC(a.tokens,e,t).inflate();let h=0;for(let t=0,i=l.getCount();t${Js(e.substring(h,s))}`,h=s}o=a.endState}return n+="
    ",n}const qk=Ba("openerService");function $k(e,t){return an.isUri(e)?_o(e.scheme,t):vo(e,t+":")}function Gk(e,...t){return t.some((t=>$k(e,t)))}var Zk,Yk=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Xk=function(e,t){return function(i,n){t(i,n,e)}},Qk=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let Jk=Zk=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new U,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e){return{element:document.createElement("span"),dispose:()=>{}}}const n=new N,s=n.add(vk(e,Object.assign(Object.assign({},this._getRenderOptions(e,n)),t),i));return s.element.classList.add("rendered-markdown"),{element:s.element,dispose:()=>n.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:(e,t)=>Qk(this,void 0,void 0,(function*(){var i,n,s;let o;e?o=this._languageService.getLanguageIdByLanguageName(e):this._options.editor&&(o=null===(i=this._options.editor.getModel())||void 0===i?void 0:i.getLanguageId()),o||(o=Ku);const r=yield function(e,t,i){return zk(this,void 0,void 0,(function*(){if(!i)return jk(t,e.languageIdCodec,Uk);const n=yield EC.getOrCreate(i);return jk(t,e.languageIdCodec,n||Uk)}))}(this._languageService,t,o),a=document.createElement("span");if(a.innerHTML=null!==(s=null===(n=Zk._ttpTokenizer)||void 0===n?void 0:n.createHTML(r))&&void 0!==s?s:r,this._options.editor){Hk(a,this._options.editor.getOption(50))}else this._options.codeBlockFontFamily&&(a.style.fontFamily=this._options.codeBlockFontFamily);return void 0!==this._options.codeBlockFontSize&&(a.style.fontSize=this._options.codeBlockFontSize),a})),asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:t=>eD(this._openerService,t,e.isTrusted),disposables:t}}}};function eD(e,t,i){return Qk(this,void 0,void 0,(function*(){try{return yield e.open(t,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:tD(i)})}catch(Mre){return r(Mre),!1}}))}function tD(e){return!0===e||!(!e||!Array.isArray(e.enabledCommands))&&e.enabledCommands}Jk._ttpTokenizer=Fk("tokenizeToString",{createHTML:e=>e}),Jk=Zk=Yk([Xk(1,Lc),Xk(2,qk)],Jk);var iD,nD=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},sD=function(e,t){return function(i,n){t(i,n,e)}};let oD=iD=class{static get(e){return e.getContribution(iD.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new I,this._messageListeners=new N,this._mouseOverMessage=!1,this._editor=e,this._visible=iD.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;null===(e=this._message)||void 0===e||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){let i;Ps(Aa(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Aa(e)?vk(e,{actionHandler:{callback:t=>eD(this._openerService,t,Aa(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new rD(this._editor,t,"string"==typeof e?e:this._message.element),this._messageListeners.add(B.debounce(this._editor.onDidBlurEditorText,((e,t)=>t),0)((()=>{this._mouseOverMessage||this._messageWidget.value&&qn(Xn(),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(En(this._messageWidget.value.getDomNode(),os.MOUSE_ENTER,(()=>this._mouseOverMessage=!0),!0)),this._messageListeners.add(En(this._messageWidget.value.getDomNode(),os.MOUSE_LEAVE,(()=>this._mouseOverMessage=!1),!0)),this._messageListeners.add(this._editor.onMouseMove((e=>{e.target.position&&(i?i.containsPosition(e.target.position)||this.closeMessage():i=new Rh(t.lineNumber-3,1,e.target.position.lineNumber+3,1))})))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(rD.fadeOut(this._messageWidget.value))}};oD.ID="editor.contrib.messageController",oD.MESSAGE_VISIBLE=new Al("messageVisible",!1,ue(0,"Whether the editor is currently showing an inline message")),oD=iD=nD([sD(1,Ol),sD(2,qk)],oD);Sh(new(vh.bindToContribution(oD.get))({id:"leaveEditorMessage",precondition:oD.MESSAGE_VISIBLE,handler:e=>e.closeMessage(),kbOpts:{weight:130,primary:9}}));class rD{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,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const s=document.createElement("div");s.classList.add("anchor","top"),this._domNode.appendChild(s);const o=document.createElement("div");"string"==typeof n?(o.classList.add("message"),o.textContent=n):(n.classList.add("message"),o.appendChild(n)),this._domNode.appendChild(o);const r=document.createElement("div");r.classList.add("anchor","below"),this._domNode.appendChild(r),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:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",2===e)}}Dh(oD.ID,oD,4);const aD={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:Lu.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"};var lD=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class hD{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}update(e,t,i){var n;return lD(this,void 0,void 0,(function*(){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let s;if(void 0===e||Fr(e)||e instanceof HTMLElement)s=e;else if(Gr(e.markdown)){this._hoverWidget||this.show(ue(0,"Loading..."),t),this._cancellationTokenSource=new jh;const i=this._cancellationTokenSource.token;if(s=yield e.markdown(i),void 0===s&&(s=e.markdownNotSupportedFallback),this.isDisposed||i.isCancellationRequested)return}else s=null!==(n=e.markdown)&&void 0!==n?n:e.markdownNotSupportedFallback;this.show(s,t,i)}))}show(e,t,i){const n=this._hoverWidget;if(this.hasContent(e)){const s=Object.assign({content:e,target:this.target,showPointer:"element"===this.hoverDelegate.placement,hoverPosition:2,skipFadeInAnimation:!this.fadeInAnimation||!!n},i);this._hoverWidget=this.hoverDelegate.showHover(s,t)}null==n||n.dispose()}hasContent(e){return!!e&&(!Aa(e)||!!e.value)}get isDisposed(){var e;return null===(e=this._hoverWidget)||void 0===e?void 0:e.isDisposed}dispose(){var e,t;null===(e=this._hoverWidget)||void 0===e||e.dispose(),null===(t=this._cancellationTokenSource)||void 0===t||t.dispose(!0),this._cancellationTokenSource=void 0}}function dD(e,t,i,n){let s,o;const r=(t,i)=>{var n;const r=void 0!==o;t&&(null==o||o.dispose(),o=void 0),i&&(null==s||s.dispose(),s=void 0),r&&(null===(n=e.onDidHideHover)||void 0===n||n.call(e))},a=(s,r,a)=>new sd((()=>lD(this,void 0,void 0,(function*(){o&&!o.isDisposed||(o=new hD(e,a||t,s>0),yield o.update(i,r,n))}))),s),l=En(t,os.MOUSE_OVER,(()=>{if(s)return;const i=new N;i.add(En(t,os.MOUSE_LEAVE,(e=>r(!1,e.fromElement===t)),!0));i.add(En(t,os.MOUSE_DOWN,(()=>r(!0,!0)),!0));const n={targetElements:[t],dispose:()=>{}};if(void 0===e.placement||"mouse"===e.placement){const e=e=>{n.x=e.x+10,e.target instanceof HTMLElement&&e.target.classList.contains("action-label")&&r(!0,!0)};i.add(En(t,os.MOUSE_MOVE,e,!0))}i.add(a(e.delay,!1,n)),s=i}),!0);return{show:e=>{r(!1,!0),a(0,e)},hide:()=>{r(!0,!0)},update:(e,t)=>lD(this,void 0,void 0,(function*(){i=e,yield null==o?void 0:o.update(i,void 0,t)})),dispose:()=>{l.dispose(),r(!0,!0)}}}class cD{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach((n=>n.splice(e,t,i)))}}function uD(e,t,i){return Math.min(Math.max(e,t),i)}class gD{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 pD{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{try{e.releasePointerCapture(t)}catch(i){}})))}catch(r){o=window}this._hooks.add(En(o,os.POINTER_MOVE,(e=>{e.buttons===i?(e.preventDefault(),this._pointerMoveCallback(e)):this.stopMonitoring(!0)}))),this._hooks.add(En(o,os.POINTER_UP,(e=>this.stopMonitoring(!0))))}}class _D extends E{onclick(e,t){this._register(En(e,os.CLICK,(e=>t(new Nt(e)))))}onmousedown(e,t){this._register(En(e,os.MOUSE_DOWN,(e=>t(new Nt(e)))))}onmouseover(e,t){this._register(En(e,os.MOUSE_OVER,(e=>t(new Nt(e)))))}onmouseleave(e,t){this._register(En(e,os.MOUSE_LEAVE,(e=>t(new Nt(e)))))}onkeydown(e,t){this._register(En(e,os.KEY_DOWN,(e=>t(new St(e)))))}onkeyup(e,t){this._register(En(e,os.KEY_UP,(e=>t(new St(e)))))}oninput(e,t){this._register(En(e,os.INPUT,t))}onblur(e,t){this._register(En(e,os.BLUR,t))}onfocus(e,t){this._register(En(e,os.FOCUS,t))}ignoreGesture(e){return ZL.ignoreTarget(e)}}const vD=11;class bD extends _D{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",void 0!==e.top&&(this.bgDomNode.style.top="0px"),void 0!==e.left&&(this.bgDomNode.style.left="0px"),void 0!==e.bottom&&(this.bgDomNode.style.bottom="0px"),void 0!==e.right&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...ta.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width="11px",this.domNode.style.height="11px",void 0!==e.top&&(this.domNode.style.top=e.top+"px"),void 0!==e.left&&(this.domNode.style.left=e.left+"px"),void 0!==e.bottom&&(this.domNode.style.bottom=e.bottom+"px"),void 0!==e.right&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new fD),this._register(Mn(this.bgDomNode,os.POINTER_DOWN,(e=>this._arrowPointerDown(e)))),this._register(Mn(this.domNode,os.POINTER_DOWN,(e=>this._arrowPointerDown(e)))),this._pointerdownRepeatTimer=this._register(new od),this._pointerdownScheduleRepeatTimer=this._register(new sd)}_arrowPointerDown(e){if(!(e.target&&e.target instanceof Element))return;this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet((()=>{this._pointerdownRepeatTimer.cancelAndSet((()=>this._onActivate()),1e3/24)}),200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,(e=>{}),(()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()})),e.preventDefault()}}class CD extends E{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 sd)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return 2!==this._visibility&&(3===this._visibility||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(){this._isNeeded?this._shouldBeVisible?this._reveal():this._hide(!0):this._hide(!1)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet((()=>{var e;null===(e=this._domNode)||void 0===e||e.setClassName(this._visibleClassName)}),0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,null===(t=this._domNode)||void 0===t||t.setClassName(this._invisibleClassName+(e?" fade":"")))}}class wD extends _D{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 CD(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new fD),this._shouldRender=!0,this.domNode=Vk(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(En(this.domNode.domNode,os.POINTER_DOWN,(e=>this._domNodePointerDown(e))))}_createArrow(e){const t=this._register(new bD(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=Vk(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),"number"==typeof i&&this.slider.setWidth(i),"number"==typeof n&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(En(this.slider.domNode,os.POINTER_DOWN,(e=>{0===e.button&&(e.preventDefault(),this._sliderPointerDown(e))}))),this.onclick(this.slider.domNode,(e=>{e.leftButton&&e.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(),s=this._sliderPointerPosition(e);i<=s&&s<=n?0===e.button&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&"number"==typeof e.offsetX&&"number"==typeof e.offsetY)t=e.offsetX,i=e.offsetY;else{const n=Hn(this.domNode.domNode);t=e.pageX-n.left,i=e.pageY-n.top}const n=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),0===e.button&&(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,(e=>{const s=this._sliderOrthogonalPointerPosition(e),o=Math.abs(s-i);if(Oe&&o>140)return void this._setDesiredScrollPositionNow(n.getScrollPosition());const r=this._sliderPointerPosition(e)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(r))}),(()=>{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()}}class yD{constructor(e,t,i,n,s,o){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=n,this._scrollSize=s,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new yD(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)}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t&&(this._scrollSize=t,this._refreshComputedValues(),!0)}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t&&(this._scrollPosition=t,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,n,s){const o=Math.max(0,i-e),r=Math.max(0,o-2*t),a=n>0&&n>i;if(!a)return{computedAvailableSize:Math.round(o),computedIsNeeded:a,computedSliderSize:Math.round(r),computedSliderRatio:0,computedSliderPosition:0};const l=Math.round(Math.max(20,Math.floor(i*r/n))),h=(r-l)/(n-i),d=s*h;return{computedAvailableSize:Math.round(o),computedIsNeeded:a,computedSliderSize:Math.round(l),computedSliderRatio:h,computedSliderPosition:Math.round(d)}}_refreshComputedValues(){const e=yD._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 Et(null,1,0))}),this._createArrow({className:"scra",icon:Jr.scrollbarButtonRight,top:i,left:void 0,bottom:void 0,right:e,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new Et(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(2===e.horizontal?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(2===e.vertical?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class LD extends wD{constructor(e,t,i){const n=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new yD(t.verticalHasArrows?t.arrowSize:0,2===t.vertical?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,s.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const e=(t.arrowSize-vD)/2,i=(t.verticalScrollbarSize-vD)/2;this._createArrow({className:"scra",icon:Jr.scrollbarButtonUp,top:e,left:i,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Et(null,0,1))}),this._createArrow({className:"scra",icon:Jr.scrollbarButtonDown,top:void 0,left:i,bottom:e,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Et(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(2===e.vertical?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class kD{constructor(e,t,i,n,s,o,r){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t|=0,i|=0,n|=0,s|=0,o|=0,r|=0),this.rawScrollLeft=n,this.rawScrollTop=r,t<0&&(t=0),n+t>i&&(n=i-t),n<0&&(n=0),s<0&&(s=0),r+s>o&&(r=o-s),r<0&&(r=0),this.width=t,this.scrollWidth=i,this.scrollLeft=n,this.height=s,this.scrollHeight=o,this.scrollTop=r}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new kD(this._forceIntegerValues,void 0!==e.width?e.width:this.width,void 0!==e.scrollWidth?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,void 0!==e.height?e.height:this.height,void 0!==e.scrollHeight?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new kD(this._forceIntegerValues,this.width,this.scrollWidth,void 0!==e.scrollLeft?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,void 0!==e.scrollTop?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,n=this.scrollWidth!==e.scrollWidth,s=this.scrollLeft!==e.scrollLeft,o=this.height!==e.height,r=this.scrollHeight!==e.scrollHeight,a=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:n,scrollLeftChanged:s,heightChanged:o,scrollHeightChanged:r,scrollTopChanged:a}}}class DD extends E{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new U),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new kD(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var i;const n=this._state.withScrollDimensions(e,t);this._setState(n,Boolean(this._smoothScrolling)),null===(i=this._smoothScrolling)||void 0===i||i.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(0===this._smoothScrollDuration)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:void 0===e.scrollLeft?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:void 0===e.scrollTop?this._smoothScrolling.to.scrollTop:e.scrollTop};const i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let n;n=t?new ED(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{const t=this._state.withScrollPosition(e);this._smoothScrolling=ED.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())}))}hasPendingScrollAnimation(){return Boolean(this._smoothScrolling)}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);return this._setState(t,!0),this._smoothScrolling?e.isDone?(this._smoothScrolling.dispose(),void(this._smoothScrolling=null)):void(this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())}))):void 0}_setState(e,t){const i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}}class xD{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function ND(e,t){const i=t-e;return function(t){return e+i*(1-function(e){return Math.pow(e,3)}(1-t))}}class ED{constructor(e,t,i,n){this.from=e,this.to=t,this.duration=n,this.startTime=i,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,i){if(Math.abs(e-t)>2.5*i){let r,a;return e0&&Math.abs(e.deltaY)>0)return 1;let t=.5;-1===this._front&&-1===this._rear||this._memory[this._rear];return this._isAlmostInt(e.deltaX)&&this._isAlmostInt(e.deltaY)||(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}MD.INSTANCE=new MD;class TD extends _D{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new U),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new U),e.style.overflow="hidden",this._options=function(e){const t={lazyRender:void 0!==e.lazyRender&&e.lazyRender,className:void 0!==e.className?e.className:"",useShadows:void 0===e.useShadows||e.useShadows,handleMouseWheel:void 0===e.handleMouseWheel||e.handleMouseWheel,flipAxes:void 0!==e.flipAxes&&e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:void 0!==e.consumeMouseWheelIfScrollbarIsNeeded&&e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:void 0!==e.alwaysConsumeMouseWheel&&e.alwaysConsumeMouseWheel,scrollYToX:void 0!==e.scrollYToX&&e.scrollYToX,mouseWheelScrollSensitivity:void 0!==e.mouseWheelScrollSensitivity?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:void 0!==e.fastScrollSensitivity?e.fastScrollSensitivity:5,scrollPredominantAxis:void 0===e.scrollPredominantAxis||e.scrollPredominantAxis,mouseWheelSmoothScroll:void 0===e.mouseWheelSmoothScroll||e.mouseWheelSmoothScroll,arrowSize:void 0!==e.arrowSize?e.arrowSize:11,listenOnDomNode:void 0!==e.listenOnDomNode?e.listenOnDomNode:null,horizontal:void 0!==e.horizontal?e.horizontal:1,horizontalScrollbarSize:void 0!==e.horizontalScrollbarSize?e.horizontalScrollbarSize:10,horizontalSliderSize:void 0!==e.horizontalSliderSize?e.horizontalSliderSize:0,horizontalHasArrows:void 0!==e.horizontalHasArrows&&e.horizontalHasArrows,vertical:void 0!==e.vertical?e.vertical:1,verticalScrollbarSize:void 0!==e.verticalScrollbarSize?e.verticalScrollbarSize:10,verticalHasArrows:void 0!==e.verticalHasArrows&&e.verticalHasArrows,verticalSliderSize:void 0!==e.verticalSliderSize?e.verticalSliderSize:0,scrollByPage:void 0!==e.scrollByPage&&e.scrollByPage};t.horizontalSliderSize=void 0!==e.horizontalSliderSize?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=void 0!==e.verticalSliderSize?e.verticalSliderSize:t.verticalScrollbarSize,Pe&&(t.className+=" mac");return t}(t),this._scrollable=i,this._register(this._scrollable.onScroll((e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)})));const n={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new LD(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new SD(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=Vk(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Vk(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Vk(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,(e=>this._onMouseOver(e))),this.onmouseleave(this._listenOnDomNode,(e=>this._onMouseLeave(e))),this._hideTimeout=this._register(new sd),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=k(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,Pe&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){void 0!==e.handleMouseWheel&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),void 0!==e.mouseWheelScrollSensitivity&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),void 0!==e.fastScrollSensitivity&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),void 0!==e.scrollPredominantAxis&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),void 0!==e.horizontal&&(this._options.horizontal=e.horizontal),void 0!==e.vertical&&(this._options.vertical=e.vertical),void 0!==e.horizontalScrollbarSize&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),void 0!==e.verticalScrollbarSize&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),void 0!==e.scrollByPage&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Et(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=k(this._mouseWheelToDispose),e)){const e=e=>{this._onMouseWheel(new Et(e))};this._mouseWheelToDispose.push(En(this._listenOnDomNode,os.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(e){var t;if(null===(t=e.browserEvent)||void 0===t?void 0:t.defaultPrevented)return;const i=MD.INSTANCE;i.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let t=e.deltaY*this._options.mouseWheelScrollSensitivity,s=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&s+t===0?s=t=0:Math.abs(t)>=Math.abs(s)?s=0:t=0),this._options.flipAxes&&([t,s]=[s,t]);const o=!Pe&&e.browserEvent&&e.browserEvent.shiftKey;!this._options.scrollYToX&&!o||s||(s=t,t=0),e.browserEvent&&e.browserEvent.altKey&&(s*=this._options.fastScrollSensitivity,t*=this._options.fastScrollSensitivity);const r=this._scrollable.getFutureScrollPosition();let a={};if(t){const e=50*t,i=r.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(a,i)}if(s){const e=50*s,t=r.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(a,t)}if(a=this._scrollable.validateScrollPosition(a),r.scrollLeft!==a.scrollLeft||r.scrollTop!==a.scrollTop){this._options.mouseWheelSmoothScroll&&i.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(a):this._scrollable.setScrollPositionNow(a),n=!0}}let s=n;!s&&this._options.alwaysConsumeMouseWheel&&(s=!0),!s&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(s=!0),s&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,n=i?" left":"",s=t?" top":"",o=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${s}`),this._topLeftShadowDomNode.setClassName(`shadow${o}${s}${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()),500)}}class RD extends TD{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;const i=new DD({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:e=>An(e)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class AD extends TD{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 OD extends TD{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;const i=new DD({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:e=>An(e)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll((e=>{e.scrollTopChanged&&(this._element.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this._element.scrollLeft=e.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})}}var PD;function FD(e,t){const i=[];for(const n of t){if(e.start>=n.range.end)continue;if(e.end=t.end||t.start>=e.end)return{start:0,end:0};const i=Math.max(e.start,t.start),n=Math.min(e.end,t.end);return n-i<=0?{start:0,end:0}:{start:i,end:n}}function i(e){return e.end-e.start<=0}e.intersect=t,e.isEmpty=i,e.intersects=function(e,n){return!i(t(e,n))},e.relativeComplement=function(e,t){const n=[],s={start:e.start,end:Math.min(t.start,e.end)},o={start:Math.max(t.end,e.start),end:e.end};return i(s)||n.push(s),i(o)||n.push(o),n}}(PD||(PD={}));class WD{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=null!=e?e:0,this._size=this._paddingTop}splice(e,t,i=[]){const n=i.length-t,s=FD({start:0,end:e},this.groups),o=FD({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map((e=>({range:BD(e.range,n),size:e.size}))),r=i.map(((t,i)=>({range:{start:e+i,end:e+i+1},size:t.size})));this.groups=function(...e){return function(e){const t=[];let i=null;for(const n of e){const e=n.range.start,s=n.range.end,o=n.size;i&&o===i.size?i.range.end=s:(i={range:{start:e,end:s},size:o},t.push(i))}return t}(e.reduce(((e,t)=>e.concat(t)),[]))}(s,r,o),this._size=this._paddingTop+this.groups.reduce(((e,t)=>e+t.size*(t.range.end-t.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}}var HD=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};const zD={CurrentDragAndDropData:void 0},UD={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements:e=>[e],getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class KD{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class jD{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class qD{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;ti,(null==e?void 0:e.getPosInSet)?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(e,t)=>t+1,(null==e?void 0:e.getRole)?this.getRole=e.getRole.bind(e):this.getRole=e=>"listitem",(null==e?void 0:e.isChecked)?this.isChecked=e.isChecked.bind(e):this.isChecked=e=>{}}}class GD{get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}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 e of this.items)this.measureItemWidth(e);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:Un(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=UD){var s,o,r,a,l,h,d,c,u,g,p,m,f;if(this.virtualDelegate=t,this.domId="list_id_"+ ++GD.InstanceCount,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Jh(50),this.splicing=!1,this.dragOverAnimationStopDisposable=E.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=E.None,this.onDragLeaveTimeout=E.None,this.disposables=new N,this._onDidChangeContentHeight=new U,this._onDidChangeContentWidth=new U,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=new WD(null!==(s=n.paddingTop)&&void 0!==s?s:0);for(const _ of i)this.renderers.set(_.templateId,_);this.cache=this.disposables.add(new VD(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","boolean"!=typeof n.mouseSupport||n.mouseSupport),this._horizontalScrolling=null!==(o=n.horizontalScrolling)&&void 0!==o?o:UD.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=void 0===n.paddingBottom?0:n.paddingBottom,this.accessibilityProvider=new $D(n.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows";(null!==(r=n.transformOptimization)&&void 0!==r?r:UD.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(ZL.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new DD({forceIntegerValues:!0,smoothScrollDuration:null!==(a=n.smoothScrolling)&&void 0!==a&&a?125:0,scheduleAtNextAnimationFrame:e=>An(e)})),this.scrollableElement=this.disposables.add(new AD(this.rowsContainer,{alwaysConsumeMouseWheel:null!==(l=n.alwaysConsumeMouseWheel)&&void 0!==l?l:UD.alwaysConsumeMouseWheel,horizontal:1,vertical:null!==(h=n.verticalScrollMode)&&void 0!==h?h:UD.verticalScrollMode,useShadows:null!==(d=n.useShadows)&&void 0!==d?d:UD.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(En(this.rowsContainer,$L.Change,(e=>this.onTouchChange(e)))),this.disposables.add(En(this.scrollableElement.getDomNode(),"scroll",(e=>e.target.scrollTop=0))),this.disposables.add(En(this.domNode,"dragover",(e=>this.onDragOver(this.toDragEvent(e))))),this.disposables.add(En(this.domNode,"drop",(e=>this.onDrop(this.toDragEvent(e))))),this.disposables.add(En(this.domNode,"dragleave",(e=>this.onDragLeave(this.toDragEvent(e))))),this.disposables.add(En(this.domNode,"dragend",(e=>this.onDragEnd(e)))),this.setRowLineHeight=null!==(c=n.setRowLineHeight)&&void 0!==c?c:UD.setRowLineHeight,this.setRowHeight=null!==(u=n.setRowHeight)&&void 0!==u?u:UD.setRowHeight,this.supportDynamicHeights=null!==(g=n.supportDynamicHeights)&&void 0!==g?g:UD.supportDynamicHeights,this.dnd=null!==(p=n.dnd)&&void 0!==p?p:this.disposables.add(UD.dnd),this.layout(null===(m=n.initialSize)||void 0===m?void 0:m.height,null===(f=n.initialSize)||void 0===f?void 0:f.width)}updateOptions(e){let t;if(void 0!==e.paddingBottom&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),void 0!==e.smoothScrolling&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),void 0!==e.horizontalScrolling&&(this.horizontalScrolling=e.horizontalScrolling),void 0!==e.scrollByPage&&(t=Object.assign(Object.assign({},null!=t?t:{}),{scrollByPage:e.scrollByPage})),void 0!==e.mouseWheelScrollSensitivity&&(t=Object.assign(Object.assign({},null!=t?t:{}),{mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity})),void 0!==e.fastScrollSensitivity&&(t=Object.assign(Object.assign({},null!=t?t:{}),{fastScrollSensitivity:e.fastScrollSensitivity})),t&&this.scrollableElement.updateOptions(t),void 0!==e.paddingTop&&e.paddingTop!==this.rangeMap.paddingTop){const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),i=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(t,Math.max(0,this.lastRenderTop+i),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){const n=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),s={start:e,end:e+t},o=PD.intersect(n,s),r=new Map;for(let C=o.end-1;C>=o.start;C--){const e=this.items[C];if(e.dragStartDisposable.dispose(),e.checkedDisposable.dispose(),e.row){let t=r.get(e.templateId);t||(t=[],r.set(e.templateId,t));const i=this.renderers.get(e.templateId);i&&i.disposeElement&&i.disposeElement(e.element,C,e.row.templateData,e.size),t.push(e.row)}e.row=null}const a={start:e+t,end:this.items.length},l=PD.intersect(a,n),h=PD.relativeComplement(a,n),d=i.map((e=>({id:String(this.itemId++),element:e,templateId:this.virtualDelegate.getTemplateId(e),size:this.virtualDelegate.getHeight(e),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(e),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:E.None,checkedDisposable:E.None})));let c;0===e&&t>=this.items.length?(this.rangeMap=new WD(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,d),c=this.items,this.items=d):(this.rangeMap.splice(e,t,d),c=this.items.splice(e,t,...d));const u=i.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=BD(l,u),m=PD.intersect(g,p);for(let C=m.start;CBD(e,u))),v=[{start:e,end:e+i.length},..._].map((e=>PD.intersect(g,e))),b=this.getNextToLastElement(v);for(const C of v)for(let e=C.start;ee.element))}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=An((()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null})))}eventuallyUpdateScrollWidth(){this.horizontalScrolling?this.scrollableElementWidthDelayer.trigger((()=>this.updateScrollWidth())):this.scrollableElementWidthDelayer.cancel()}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)void 0!==t.width&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:0===e?0:e+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(){const e=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),t=this.rangeMap.positionAt(e.start),i=this.rangeMap.positionAt(e.start+1);if(-1!==i){if((i-t)/2+t{for(const e of l)for(let t=e.start;tn.row.domNode.setAttribute("aria-checked",String(!!e));e(r.value),n.checkedDisposable=r.onDidChange(e)}!s&&n.row.domNode.parentElement||(t?this.rowsContainer.insertBefore(n.row.domNode,t):this.rowsContainer.appendChild(n.row.domNode)),this.updateItemInDOM(n,e);const a=this.renderers.get(n.templateId);if(!a)throw new Error(`No renderer found for template id ${n.templateId}`);null==a||a.renderElement(n.element,e,n.row.templateData,n.size);const l=this.dnd.getDragURI(n.element);n.dragStartDisposable.dispose(),n.row.domNode.draggable=!!l,l&&(n.dragStartDisposable=En(n.row.domNode,"dragstart",(e=>this.onDragStart(n.element,l,e)))),this.horizontalScrolling&&(this.measureItemWidth(n),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=Un(e.row.domNode);const t=window.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})}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 B.map(this.disposables.add(new Ky(this.domNode,"click")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onMouseDblClick(){return B.map(this.disposables.add(new Ky(this.domNode,"dblclick")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onMouseMiddleClick(){return B.filter(B.map(this.disposables.add(new Ky(this.domNode,"auxclick")).event,(e=>this.toMouseEvent(e)),this.disposables),(e=>1===e.browserEvent.button),this.disposables)}get onMouseDown(){return B.map(this.disposables.add(new Ky(this.domNode,"mousedown")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onMouseOver(){return B.map(this.disposables.add(new Ky(this.domNode,"mouseover")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onMouseOut(){return B.map(this.disposables.add(new Ky(this.domNode,"mouseout")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onContextMenu(){return B.any(B.map(this.disposables.add(new Ky(this.domNode,"contextmenu")).event,(e=>this.toMouseEvent(e)),this.disposables),B.map(this.disposables.add(new Ky(this.domNode,$L.Contextmenu)).event,(e=>this.toGestureEvent(e)),this.disposables))}get onTouchStart(){return B.map(this.disposables.add(new Ky(this.domNode,"touchstart")).event,(e=>this.toTouchEvent(e)),this.disposables)}get onTap(){return B.map(this.disposables.add(new Ky(this.rowsContainer,$L.Tap)).event,(e=>this.toGestureEvent(e)),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}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){var n,s;if(!i.dataTransfer)return;const o=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(aD.TEXT,t),i.dataTransfer.setDragImage){let e;this.dnd.getDragLabel&&(e=this.dnd.getDragLabel(o,i)),void 0===e&&(e=String(o.length));const t=fs(".monaco-drag-image");t.textContent=e;const n=(e=>{for(;e&&!e.classList.contains("monaco-workbench");)e=e.parentElement;return e||document.body})(this.domNode);n.appendChild(t),i.dataTransfer.setDragImage(t,-10,-10),setTimeout((()=>n.removeChild(t)),0)}this.domNode.classList.add("dragging"),this.currentDragData=new KD(o),zD.CurrentDragAndDropData=new jD(o),null===(s=(n=this.dnd).onDragStart)||void 0===s||s.call(n,this.currentDragData,i)}onDragOver(e){var t;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),zD.CurrentDragAndDropData&&"vscode-ui"===zD.CurrentDragAndDropData.getData())return!1;if(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer)return!1;if(!this.currentDragData)if(zD.CurrentDragAndDropData)this.currentDragData=zD.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new qD}const i=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.browserEvent);if(this.canDrop="boolean"==typeof i?i:i.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;let n;if(e.browserEvent.dataTransfer.dropEffect="boolean"!=typeof i&&0===i.effect?"copy":"move",n="boolean"!=typeof i&&i.feedback?i.feedback:void 0===e.index?[-1]:[e.index],n=zd(n).filter((e=>e>=-1&&ee-t)),n=-1===n[0]?[-1]:n,s=this.currentDragFeedback,o=n,Array.isArray(s)&&Array.isArray(o)?Td(s,o):s===o)return!0;var s,o;if(this.currentDragFeedback=n,this.currentDragFeedbackDisposable.dispose(),-1===n[0])this.domNode.classList.add("drop-target"),this.rowsContainer.classList.add("drop-target"),this.currentDragFeedbackDisposable=x((()=>{this.domNode.classList.remove("drop-target"),this.rowsContainer.classList.remove("drop-target")}));else{for(const e of n){const i=this.items[e];i.dropTarget=!0,null===(t=i.row)||void 0===t||t.domNode.classList.add("drop-target")}this.currentDragFeedbackDisposable=x((()=>{var e;for(const t of n){const i=this.items[t];i.dropTarget=!1,null===(e=i.row)||void 0===e||e.domNode.classList.remove("drop-target")}}))}return!0}onDragLeave(e){var t,i;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=id((()=>this.clearDragOverFeedback()),100,this.disposables),this.currentDragData&&(null===(i=(t=this.dnd).onDragLeave)||void 0===i||i.call(t,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,zD.CurrentDragAndDropData=void 0,t&&e.browserEvent.dataTransfer&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.browserEvent))}onDragEnd(e){var t,i;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,zD.CurrentDragAndDropData=void 0,null===(i=(t=this.dnd).onDragEnd)||void 0===i||i.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=E.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const e=Vn(this.domNode).top;this.dragOverAnimationDisposable=function(e){const t=()=>{e(),i=An(t)};let i=An(t);return x((()=>i.dispose()))}(this.animateDragAndDropScrollTop.bind(this,e))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=id((()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}),1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(void 0===this.dragOverMouseY)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)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;i instanceof HTMLElement&&i!==this.rowsContainer&&t.contains(i);){const e=i.getAttribute("data-index");if(e){const t=Number(e);if(!isNaN(t))return t}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 s,o;e===this.elementTop(n.start)?(s=n.start,o=0):n.end-n.start>1&&(s=n.start+1,o=this.elementTop(s)-e);let r=0;for(;;){const a=this.getRenderRange(e,t);let l=!1;for(let e=a.start;e=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},QD=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class JD{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((e=>e.templateData===i));if(n>=0){const e=this.renderedElements[n];this.trait.unrender(i),e.index=t}else{const e={index:t,templateData:i};this.renderedElements.push(e)}this.trait.renderIndex(t,i)}splice(e,t,i){const n=[];for(const s of this.renderedElements)s.index=e+t&&n.push({index:s.index+i-t,templateData:s.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((t=>t.templateData===e));t<0||this.renderedElements.splice(t,1)}}class ex{get name(){return this._trait}get renderer(){return new JD(this)}constructor(e){this._trait=e,this.length=0,this.indexes=[],this.sortedIndexes=[],this._onChange=new U,this.onChange=this._onChange.event}splice(e,t,i){var n;t=Math.max(0,Math.min(t,this.length-e));const s=i.length-t,o=e+t,r=[];let a=0;for(;a=o;)r.push(this.sortedIndexes[a++]+s);const l=this.length+s;if(this.sortedIndexes.length>0&&0===r.length&&l>0){const t=null!==(n=this.sortedIndexes.find((t=>t>=e)))&&void 0!==n?n:l-1;r.push(Math.min(t,l-1))}this.renderer.splice(e,t,i.length),this._set(r,r),this.length=l}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(vx),t)}_set(e,t,i){const n=this.indexes,s=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const o=_x(s,e);return this.renderer.renderIndexes(o),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return Rd(this.sortedIndexes,e,vx)>=0}dispose(){k(this._onChange)}}XD([qL],ex.prototype,"renderer",null);class tx extends ex{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 ix{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((e=>this.identityProvider.getId(this.view.element(e)).toString()));if(0===n.length)return this.trait.splice(e,t,new Array(i.length).fill(!1));const s=new Set(n),o=i.map((e=>s.has(this.identityProvider.getId(e).toString())));this.trait.splice(e,t,o)}}function nx(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName}function sx(e){return!!e.classList.contains("monaco-editor")||!e.classList.contains("monaco-list")&&(!!e.parentElement&&sx(e.parentElement))}function ox(e){return!!("A"===e.tagName&&e.classList.contains("monaco-button")||"DIV"===e.tagName&&e.classList.contains("monaco-button-dropdown"))||!e.classList.contains("monaco-list")&&(!!e.parentElement&&ox(e.parentElement))}class rx{get onKeyDown(){return B.chain(this.disposables.add(new Ky(this.view.domNode,"keydown")).event,(e=>e.filter((e=>!nx(e.target))).map((e=>new St(e)))))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new N,this.multipleSelectionDisposables=new N,this.multipleSelectionSupport=i.multipleSelectionSupport,this.disposables.add(this.onKeyDown((e=>{switch(e.keyCode){case 3:return this.onEnter(e);case 16:return this.onUpArrow(e);case 18:return this.onDownArrow(e);case 11:return this.onPageUpArrow(e);case 12:return this.onPageDownArrow(e);case 9:return this.onEscape(e);case 31:this.multipleSelectionSupport&&(Pe?e.metaKey:e.ctrlKey)&&this.onCtrlA(e)}})))}updateOptions(e){void 0!==e.multipleSelectionSupport&&(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(Kd(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()}}XD([qL],rx.prototype,"onKeyDown",null),function(e){e[e.Automatic=0]="Automatic",e[e.Trigger=1]="Trigger"}(ZD||(ZD={})),function(e){e[e.Idle=0]="Idle",e[e.Typing=1]="Typing"}(YD||(YD={}));const ax=new class{mightProducePrintableCharacter(e){return!(e.ctrlKey||e.metaKey||e.altKey)&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30||e.keyCode>=98&&e.keyCode<=107||e.keyCode>=85&&e.keyCode<=95)}};class lx{constructor(e,t,i,n,s){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=n,this.delegate=s,this.enabled=!1,this.state=YD.Idle,this.mode=ZD.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new N,this.disposables=new N,this.updateOptions(e.options)}updateOptions(e){var t,i;null===(t=e.typeNavigationEnabled)||void 0===t||t?this.enable():this.disable(),this.mode=null!==(i=e.typeNavigationMode)&&void 0!==i?i:ZD.Automatic}enable(){if(this.enabled)return;let e=!1;const t=B.chain(this.enabledDisposables.add(new Ky(this.view.domNode,"keydown")).event,(t=>t.filter((e=>!nx(e.target))).filter((()=>this.mode===ZD.Automatic||this.triggered)).map((e=>new St(e))).filter((t=>e||this.keyboardNavigationEventFilter(t))).filter((e=>this.delegate.mightProducePrintableCharacter(e))).forEach((e=>as(e,!0))).map((e=>e.browserEvent.key)))),i=B.debounce(t,(()=>null),800,void 0,void 0,void 0,this.enabledDisposables);B.reduce(B.any(t,i),((e,t)=>null===t?null:(e||"")+t),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(){var e;const t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){const i=null===(e=this.list.options.accessibilityProvider)||void 0===e?void 0:e.getAriaLabel(this.list.element(t[0]));i&&Ps(i)}this.previouslyFocused=-1}onInput(e){if(!e)return this.state=YD.Idle,void(this.triggered=!1);const t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===YD.Idle?1:0;this.state=YD.Typing;for(let s=0;s1&&1===n.length)return this.previouslyFocused=i,this.list.setFocus([t]),void this.list.reveal(t)}}}else if(void 0===r||$o(e,r))return this.previouslyFocused=i,this.list.setFocus([t]),void this.list.reveal(t)}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class hx{constructor(e,t){this.list=e,this.view=t,this.disposables=new N;const i=B.chain(this.disposables.add(new Ky(t.domNode,"keydown")).event,(e=>e.filter((e=>!nx(e.target))).map((e=>new St(e))))),n=B.chain(i,(e=>e.filter((e=>!(2!==e.keyCode||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)))));n(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(0===t.length)return;const i=this.view.domElement(t[0]);if(!i)return;const n=i.querySelector("[tabIndex]");if(!(n&&n instanceof HTMLElement&&-1!==n.tabIndex))return;const s=window.getComputedStyle(n);"hidden"!==s.visibility&&"none"!==s.display&&(e.preventDefault(),e.stopPropagation(),n.focus())}dispose(){this.disposables.dispose()}}function dx(e){return Pe?e.browserEvent.metaKey:e.browserEvent.ctrlKey}function cx(e){return e.browserEvent.shiftKey}const ux={isSelectionSingleChangeEvent:dx,isSelectionRangeChangeEvent:cx};class gx{constructor(e){this.list=e,this.disposables=new N,this._onPointer=new U,this.onPointer=this._onPointer.event,!1!==e.options.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||ux),this.mouseSupport=void 0===e.options.mouseSupport||!!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(ZL.addTarget(e.getHTMLElement()))),B.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){void 0!==e.multipleSelectionSupport&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||ux))}isSelectionSingleChangeEvent(e){return!!this.multipleSelectionController&&this.multipleSelectionController.isSelectionSingleChangeEvent(e)}isSelectionRangeChangeEvent(e){return!!this.multipleSelectionController&&this.multipleSelectionController.isSelectionRangeChangeEvent(e)}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){sx(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(nx(e.browserEvent.target)||sx(e.browserEvent.target))return;const t=void 0===e.index?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport)return;if(nx(e.browserEvent.target)||sx(e.browserEvent.target))return;if(e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;return void 0===t?(this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),void this.list.setAnchor(void 0)):this.isSelectionChangeEvent(e)?this.changeSelection(e):(this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),(i=e.browserEvent)instanceof MouseEvent&&2===i.button||this.list.setSelection([t],e.browserEvent),void this._onPointer.fire(e));var i}onDoubleClick(e){if(nx(e.browserEvent.target)||sx(e.browserEvent.target))return;if(this.isSelectionChangeEvent(e))return;if(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)){if(void 0===i){const e=this.list.getFocus()[0];i=null!=e?e:t,this.list.setAnchor(i)}const n=Kd(Math.min(i,t),Math.max(i,t)+1),s=this.list.getSelection(),o=function(e,t){const i=e.indexOf(t);if(-1===i)return[];const n=[];let s=i-1;for(;s>=0&&e[s]===t-(i-s);)n.push(e[s--]);n.reverse(),s=i;for(;s=e.length)i.push(t[s++]);else if(s>=t.length)i.push(e[n++]);else{if(e[n]===t[s]){n++,s++;continue}e[n]e!==t));this.list.setFocus([t]),this.list.setAnchor(t),i.length===n.length?this.list.setSelection([...n,t],e.browserEvent):this.list.setSelection(n,e.browserEvent)}}dispose(){this.disposables.dispose()}}class px{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){var t,i;const n=this.selectorSuffix&&`.${this.selectorSuffix}`,s=[];e.listBackground&&s.push(`.monaco-list${n} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(s.push(`.monaco-list${n}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),s.push(`.monaco-list${n}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&s.push(`.monaco-list${n}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(s.push(`.monaco-list${n}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),s.push(`.monaco-list${n}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&s.push(`.monaco-list${n}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&s.push(`.monaco-list${n}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&s.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${n}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }\n\t\t\t`),e.listFocusAndSelectionForeground&&s.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${n}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }\n\t\t\t`),e.listInactiveFocusForeground&&(s.push(`.monaco-list${n} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),s.push(`.monaco-list${n} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&s.push(`.monaco-list${n} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(s.push(`.monaco-list${n} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),s.push(`.monaco-list${n} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(s.push(`.monaco-list${n} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),s.push(`.monaco-list${n} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&s.push(`.monaco-list${n} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&s.push(`.monaco-list${n}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&s.push(`.monaco-list${n}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const o=Ss(e.listFocusAndSelectionOutline,Ss(e.listSelectionOutline,null!==(t=e.listFocusOutline)&&void 0!==t?t:""));o&&s.push(`.monaco-list${n}:focus .monaco-list-row.focused.selected { outline: 1px solid ${o}; outline-offset: -1px;}`),e.listFocusOutline&&s.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${n}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }\n\t\t\t\t.monaco-workbench.context-menu-visible .monaco-list${n}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }\n\t\t\t`);const r=Ss(e.listSelectionOutline,null!==(i=e.listInactiveFocusOutline)&&void 0!==i?i:"");r&&s.push(`.monaco-list${n} .monaco-list-row.focused.selected { outline: 1px dotted ${r}; outline-offset: -1px; }`),e.listSelectionOutline&&s.push(`.monaco-list${n} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&s.push(`.monaco-list${n} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&s.push(`.monaco-list${n} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropBackground&&s.push(`\n\t\t\t\t.monaco-list${n}.drop-target,\n\t\t\t\t.monaco-list${n} .monaco-list-rows.drop-target,\n\t\t\t\t.monaco-list${n} .monaco-list-row.drop-target { background-color: ${e.listDropBackground} !important; color: inherit !important; }\n\t\t\t`),e.tableColumnsBorder&&s.push(`\n\t\t\t\t.monaco-table > .monaco-split-view2,\n\t\t\t\t.monaco-table > .monaco-split-view2 .monaco-sash.vertical::before,\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2,\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\t\t\tborder-color: ${e.tableColumnsBorder};\n\t\t\t\t}\n\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2,\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\t\t\tborder-color: transparent;\n\t\t\t\t}\n\t\t\t`),e.tableOddRowsBackgroundColor&&s.push(`\n\t\t\t\t.monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr,\n\t\t\t\t.monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr,\n\t\t\t\t.monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr {\n\t\t\t\t\tbackground-color: ${e.tableOddRowsBackgroundColor};\n\t\t\t\t}\n\t\t\t`),this.styleElement.textContent=s.join("\n")}}const mx={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropBackground:"#383B3D",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:lc.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:lc.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:lc.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},fx={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){},dispose(){}}};function _x(e,t){const i=[];let n=0,s=0;for(;n=e.length)i.push(t[s++]);else if(s>=t.length)i.push(e[n++]);else{if(e[n]===t[s]){i.push(e[n]),n++,s++;continue}e[n]e-t;class bx{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 s=0;for(const o of this.renderers)o.renderElement(e,t,i[s++],n)}disposeElement(e,t,i,n){var s;let o=0;for(const r of this.renderers)null===(s=r.disposeElement)||void 0===s||s.call(r,e,t,i[o],n),o+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class Cx{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e);n?i.setAttribute("aria-label",n):i.removeAttribute("aria-label");const s=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);"number"==typeof s?i.setAttribute("aria-level",`${s}`):i.removeAttribute("aria-level")}disposeTemplate(e){}}class wx{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){var i,n;null===(n=(i=this.dnd).onDragStart)||void 0===n||n.call(i,e,t)}onDragOver(e,t,i,n){return this.dnd.onDragOver(e,t,i,n)}onDragLeave(e,t,i,n){var s,o;null===(o=(s=this.dnd).onDragLeave)||void 0===o||o.call(s,e,t,i,n)}onDragEnd(e){var t,i;null===(i=(t=this.dnd).onDragEnd)||void 0===i||i.call(t,e)}drop(e,t,i,n){this.dnd.drop(e,t,i,n)}dispose(){this.dnd.dispose()}}class yx{get onDidChangeFocus(){return B.map(this.eventBufferer.wrapEvent(this.focus.onChange),(e=>this.toListEvent(e)),this.disposables)}get onDidChangeSelection(){return B.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 onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}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=B.chain(this.disposables.add(new Ky(this.view.domNode,"keydown")).event,(t=>t.map((e=>new St(e))).filter((t=>e=58===t.keyCode||t.shiftKey&&68===t.keyCode)).map((e=>as(e,!0))).filter((()=>!1)))),i=B.chain(this.disposables.add(new Ky(this.view.domNode,"keyup")).event,(t=>t.forEach((()=>e=!1)).map((e=>new St(e))).filter((e=>58===e.keyCode||e.shiftKey&&68===e.keyCode)).map((e=>as(e,!0))).map((({browserEvent:e})=>{const t=this.getFocus(),i=t.length?t[0]:void 0;return{index:i,element:void 0!==i?this.view.element(i):void 0,anchor:void 0!==i?this.view.domElement(i):this.view.domNode,browserEvent:e}})))),n=B.chain(this.view.onContextMenu,(t=>t.filter((t=>!e)).map((({element:e,index:t,browserEvent:i})=>({element:e,index:t,anchor:new Nt(i),browserEvent:i})))));return B.any(t,i,n)}get onKeyDown(){return this.disposables.add(new Ky(this.view.domNode,"keydown")).event}get onDidFocus(){return B.signal(this.disposables.add(new Ky(this.view.domNode,"focus",!0)).event)}constructor(e,t,i,n,s=fx){var o,r,a,l;this.user=e,this._options=s,this.focus=new ex("focused"),this.anchor=new ex("anchor"),this.eventBufferer=new Z,this._ariaLabel="",this.disposables=new N,this._onDidDispose=new U,this.onDidDispose=this._onDidDispose.event;const h=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?null===(o=this._options.accessibilityProvider)||void 0===o?void 0:o.getWidgetRole():"list";this.selection=new tx("listbox"!==h);const d=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=s.accessibilityProvider,this.accessibilityProvider&&(d.push(new Cx(this.accessibilityProvider)),null===(a=(r=this.accessibilityProvider).onDidChangeActiveDescendant)||void 0===a||a.call(r,this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map((e=>new bx(e.templateId,[...d,e])));const c=Object.assign(Object.assign({},s),{dnd:s.dnd&&new wx(this,s.dnd)});if(this.view=this.createListView(t,i,n,c),this.view.domNode.setAttribute("role",h),s.styleController)this.styleController=s.styleController(this.view.domId);else{const e=Jn(this.view.domNode);this.styleController=new px(e,this.view.domId)}if(this.spliceable=new cD([new ix(this.focus,this.view,s.identityProvider),new ix(this.selection,this.view,s.identityProvider),new ix(this.anchor,this.view,s.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 hx(this,this.view)),("boolean"!=typeof s.keyboardSupport||s.keyboardSupport)&&(this.keyboardController=new rx(this,this.view,s),this.disposables.add(this.keyboardController)),s.keyboardNavigationLabelProvider){const e=s.keyboardNavigationDelegate||ax;this.typeNavigationController=new lx(this,this.view,s.keyboardNavigationLabelProvider,null!==(l=s.keyboardNavigationEventFilter)&&void 0!==l?l:()=>!0,e),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(s),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()),!1!==this._options.multipleSelectionSupport&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,n){return new GD(e,t,i,n)}createMouseController(e){return new gx(this)}updateOptions(e={}){var t,i;this._options=Object.assign(Object.assign({},this._options),e),null===(t=this.typeNavigationController)||void 0===t||t.updateOptions(this._options),void 0!==this._options.multipleSelectionController&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),null===(i=this.keyboardController)||void 0===i||i.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new mD(this.user,`Invalid start index: ${e}`);if(t<0)throw new mD(this.user,`Invalid delete count: ${t}`);0===t&&0===i.length||this.eventBufferer.bufferEvents((()=>this.spliceable.splice(e,t,i)))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}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)}setSelection(e,t){for(const i of e)if(i<0||i>=this.length)throw new mD(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(void 0!==e){if(e<0||e>=this.length)throw new mD(this.user,`Invalid index ${e}`);this.anchor.set([e])}else this.anchor.set([])}getAnchor(){return Ud(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return void 0===e?void 0:this.element(e)}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new mD(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,n){if(0===this.length)return;const s=this.focus.get(),o=this.findNextIndex(s.length>0?s[0]+e:0,t,n);o>-1&&this.setFocus([o],i)}focusPrevious(e=1,t=!1,i,n){if(0===this.length)return;const s=this.focus.get(),o=this.findPreviousIndex(s.length>0?s[0]-e:0,t,n);o>-1&&this.setFocus([o],i)}focusNextPage(e,t){return QD(this,void 0,void 0,(function*(){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=0===i?0:i-1;const n=this.getFocus()[0];if(n!==i&&(void 0===n||i>n)){const s=this.findPreviousIndex(i,!1,t);s>-1&&n!==s?this.setFocus([s],e):this.setFocus([i],e)}else{const s=this.view.getScrollTop();let o=s+this.view.renderHeight;i>n&&(o-=this.view.elementHeight(i)),this.view.setScrollTop(o),this.view.getScrollTop()!==s&&(this.setFocus([]),yield td(0),yield this.focusNextPage(e,t))}}))}focusPreviousPage(e,t){return QD(this,void 0,void 0,(function*(){let i;const n=this.view.getScrollTop();i=0===n?this.view.indexAt(n):this.view.indexAfter(n-1);const s=this.getFocus()[0];if(s!==i&&(void 0===s||s>=i)){const n=this.findNextIndex(i,!1,t);n>-1&&s!==n?this.setFocus([n],e):this.setFocus([i],e)}else{const i=n;this.view.setScrollTop(n-this.view.renderHeight),this.view.getScrollTop()!==i&&(this.setFocus([]),yield td(0),yield this.focusPreviousPage(e,t))}}))}focusLast(e,t){if(0===this.length)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(0===this.length)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%=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){if(e<0||e>=this.length)throw new mD(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),n=this.view.elementTop(e),s=this.view.elementHeight(e);if(Vr(t)){const e=s-this.view.renderHeight;this.view.setScrollTop(e*uD(t,0,1)+n)}else{const e=n+s,t=i+this.view.renderHeight;n=t||(n=t&&s>=this.view.renderHeight?this.view.setScrollTop(n):e>=t&&this.view.setScrollTop(e-this.view.renderHeight))}}getHTMLElement(){return this.view.domNode}getElementID(e){return this.view.getElementDomId(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map((e=>this.view.element(e))),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var e;const t=this.focus.get();if(t.length>0){let i;(null===(e=this.accessibilityProvider)||void 0===e?void 0:e.getActiveDescendantId)&&(i=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",i||this.view.getElementDomId(t[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",0===e.length),this.view.domNode.classList.toggle("selection-single",1===e.length),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}XD([qL],yx.prototype,"onDidChangeFocus",null),XD([qL],yx.prototype,"onDidChangeSelection",null),XD([qL],yx.prototype,"onContextMenu",null),XD([qL],yx.prototype,"onKeyDown",null),XD([qL],yx.prototype,"onDidFocus",null);const Sx=fs,Lx="selectOption.entry.template";class kx{get templateId(){return Lx}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=ds(e,Sx(".option-text")),t.detail=ds(e,Sx(".option-detail")),t.decoratorRight=ds(e,Sx(".option-decorator-right")),t}renderElement(e,t,i){const n=i,s=e.text,o=e.detail,r=e.decoratorRight,a=e.isDisabled;n.text.textContent=s,n.detail.textContent=o||"",n.decoratorRight.innerText=r||"",a?n.root.classList.add("option-disabled"):n.root.classList.remove("option-disabled")}disposeTemplate(e){}}class Dx extends E{constructor(e,t,i,n,s){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=n,this.selectBoxOptions=s||Object.create(null),"number"!=typeof this.selectBoxOptions.minBottomMargin?this.selectBoxOptions.minBottomMargin=Dx.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","string"==typeof this.selectBoxOptions.ariaLabel&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),"string"==typeof this.selectBoxOptions.ariaDescription&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new U,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}getHeight(){return 22}getTemplateId(){return Lx}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=fs(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=ds(this.selectDropDownContainer,Sx(".select-box-details-pane"));const t=ds(this.selectDropDownContainer,Sx(".select-box-dropdown-container-width-control")),i=ds(t,Sx(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",ds(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=Jn(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(En(this.selectDropDownContainer,os.DRAG_START,(e=>{as(e,!0)})))}registerListeners(){let e;this._register(Mn(this.selectElement,"change",(e=>{this.selected=e.target.selectedIndex,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value}),this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)}))),this._register(En(this.selectElement,os.CLICK,(e=>{as(e),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()}))),this._register(En(this.selectElement,os.MOUSE_DOWN,(e=>{as(e)}))),this._register(En(this.selectElement,"touchstart",(t=>{e=this._isVisible}))),this._register(En(this.selectElement,"touchend",(t=>{as(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()}))),this._register(En(this.selectElement,os.KEY_DOWN,(e=>{const t=new St(e);let i=!1;Pe?18!==t.keyCode&&16!==t.keyCode&&10!==t.keyCode&&3!==t.keyCode||(i=!0):(18===t.keyCode&&t.altKey||16===t.keyCode&&t.altKey||10===t.keyCode||3===t.keyCode)&&(i=!0),i&&(this.showSelectDropDown(),as(e,!0))})))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){Td(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach(((e,t)=>{this.selectElement.add(this.createOption(e.text,t,e.isDisabled)),"string"==typeof e.description&&(this._hasDetails=!0)}))),void 0!==t&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;null===(e=this.selectList)||void 0===e||e.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.selectElement.title=this.options[this.selected].text)}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("\n")}styleSelectElement(){var e,t,i;const n=null!==(e=this.styles.selectBackground)&&void 0!==e?e:"",s=null!==(t=this.styles.selectForeground)&&void 0!==t?t:"",o=null!==(i=this.styles.selectBorder)&&void 0!==i?i:"";this.selectElement.style.backgroundColor=n,this.selectElement.style.color=s,this.selectElement.style.borderColor=o}styleList(){var e,t;const i=null!==(e=this.styles.selectBackground)&&void 0!==e?e:"",n=Ss(this.styles.selectListBackground,i);this.selectDropDownListContainer.style.backgroundColor=n,this.selectionDetailsPane.style.backgroundColor=n;const s=null!==(t=this.styles.focusBorder)&&void 0!==t?t:"";this.selectDropDownContainer.style.outlineColor=s,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:()=>{try{e.removeChild(this.selectDropDownContainer)}catch(t){}}}}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=Hn(this.selectElement),i=getComputedStyle(this.selectElement),n=parseFloat(i.getPropertyValue("--dropdown-padding-top"))+parseFloat(i.getPropertyValue("--dropdown-padding-bottom")),s=window.innerHeight-t.top-t.height-(this.selectBoxOptions.minBottomMargin||0),o=t.top-Dx.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,r=this.selectElement.offsetWidth,a=this.setWidthControlElement(this.widthControlElement),l=Math.max(a,Math.round(r)).toString()+"px";this.selectDropDownContainer.style.width=l,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let h=this.selectList.contentHeight;this._hasDetails&&void 0===this._cachedMaxDetailsHeight&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const d=this._hasDetails?this._cachedMaxDetailsHeight:0,c=h+n+d,u=Math.floor((s-n-d)/this.getHeight()),g=Math.floor((o-n-d)/this.getHeight());if(e)return!(t.top+t.height>window.innerHeight-22||t.topu&&this.options.length>u?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(t.top+t.height>window.innerHeight-22||t.tops&&(h=u*this.getHeight())}else c>o&&(h=g*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+n+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=h+n+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=l,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}return!1}setWidthControlElement(e){let t=0;if(e){let i=0,n=0;this.options.forEach(((e,t)=>{const s=e.detail?e.detail.length:0,o=e.decoratorRight?e.decoratorRight.length:0,r=e.text.length+s+o;r>n&&(i=t,n=r)})),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=zn(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=ds(e,Sx(".select-box-dropdown-list-container")),this.listRenderer=new kx,this.selectList=new yx("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:e=>{let t=e.text;return e.detail&&(t+=`. ${e.detail}`),e.decoratorRight&&(t+=`. ${e.decoratorRight}`),e.description&&(t+=`. ${e.description}`),t},getWidgetAriaLabel:()=>ue(0,"Select Box"),getRole:()=>Pe?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new Ky(this.selectDropDownListContainer,"keydown")),i=B.chain(t.event,(e=>e.filter((()=>this.selectList.length>0)).map((e=>new St(e)))));this._register(B.chain(i,(e=>e.filter((e=>3===e.keyCode))))(this.onEnter,this)),this._register(B.chain(i,(e=>e.filter((e=>2===e.keyCode))))(this.onEnter,this)),this._register(B.chain(i,(e=>e.filter((e=>9===e.keyCode))))(this.onEscape,this)),this._register(B.chain(i,(e=>e.filter((e=>16===e.keyCode))))(this.onUpArrow,this)),this._register(B.chain(i,(e=>e.filter((e=>18===e.keyCode))))(this.onDownArrow,this)),this._register(B.chain(i,(e=>e.filter((e=>12===e.keyCode))))(this.onPageDown,this)),this._register(B.chain(i,(e=>e.filter((e=>11===e.keyCode))))(this.onPageUp,this)),this._register(B.chain(i,(e=>e.filter((e=>14===e.keyCode))))(this.onHome,this)),this._register(B.chain(i,(e=>e.filter((e=>13===e.keyCode))))(this.onEnd,this)),this._register(B.chain(i,(e=>e.filter((e=>e.keyCode>=21&&e.keyCode<=56||e.keyCode>=85&&e.keyCode<=113))))(this.onCharacter,this)),this._register(En(this.selectList.getHTMLElement(),os.POINTER_UP,(e=>this.onPointerUp(e)))),this._register(this.selectList.onMouseOver((e=>void 0!==e.index&&this.selectList.setFocus([e.index])))),this._register(this.selectList.onDidChangeFocus((e=>this.onListFocus(e)))),this._register(En(this.selectDropDownContainer,os.FOCUS_OUT,(e=>{this._isVisible&&!qn(e.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;as(e);const t=e.target;if(!t)return;if(t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const n=Number(i.getAttribute("data-index")),s=i.classList.contains("option-disabled");n>=0&&n{for(let t=0;tthis.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){if(this.selected>0){as(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){as(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){as(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){as(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=gt.toString(e.keyCode);let i=-1;for(let n=0;n{this._register(En(this.selectElement,e,(e=>{this.selectElement.focus()})))})),this._register(Mn(this.selectElement,"click",(e=>{as(e,!0)}))),this._register(Mn(this.selectElement,"change",(e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})}))),this._register(Mn(this.selectElement,"keydown",(e=>{let t=!1;Pe?18!==e.keyCode&&16!==e.keyCode&&10!==e.keyCode||(t=!0):(18===e.keyCode&&e.altKey||10===e.keyCode||3===e.keyCode)&&(t=!0),t&&e.stopPropagation()})))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){this.options&&Td(this.options,e)||(this.options=e,this.selectElement.options.length=0,this.options.forEach(((e,t)=>{this.selectElement.add(this.createOption(e.text,t,e.isDisabled))}))),void 0!==t&&this.select(t)}select(e){0===this.options.length?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(e)})))}handleActionChangeEvent(e){void 0!==e.enabled&&this.updateEnabled(),void 0!==e.checked&&this.updateChecked(),void 0!==e.class&&this.updateClass(),void 0!==e.label&&(this.updateLabel(),this.updateTooltip()),void 0!==e.tooltip&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new ja)),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(ZL.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,ne&&this._register(En(e,os.DRAG_START,(e=>{var t;return null===(t=e.dataTransfer)||void 0===t?void 0:t.setData(aD.TEXT,this._action.label)})))),this._register(En(t,$L.Tap,(e=>this.onClick(e,!0)))),this._register(En(t,os.MOUSE_DOWN,(e=>{i||as(e,!0),this._action.enabled&&0===e.button&&t.classList.add("active")}))),Pe&&this._register(En(t,os.CONTEXT_MENU,(e=>{0===e.button&&!0===e.ctrlKey&&this.onClick(e)}))),this._register(En(t,os.CLICK,(e=>{as(e,!0),this.options&&this.options.isMenu||this.onClick(e)}))),this._register(En(t,os.DBLCLICK,(e=>{as(e,!0)}))),[os.MOUSE_UP,os.MOUSE_OUT].forEach((e=>{this._register(En(t,e,(e=>{as(e),t.classList.remove("active")})))}))}onClick(e,t=!1){var i;as(e,!0);const n=jr(this._context)?(null===(i=this.options)||void 0===i?void 0:i.useEventAsContext)?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,n)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("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(){}getTooltip(){return this.action.tooltip}updateTooltip(){var e;if(!this.element)return;const t=null!==(e=this.getTooltip())&&void 0!==e?e:"";this.updateAriaLabel(),this.options.hoverDelegate?(this.element.title="",this.customHover?this.customHover.update(t):(this.customHover=dD(this.options.hoverDelegate,this.element,t),this._store.add(this.customHover))):this.element.title=t}updateAriaLabel(){var e;if(this.element){const t=null!==(e=this.getTooltip())&&void 0!==e?e:"";this.element.setAttribute("aria-label",t)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class Ix extends Ex{constructor(e,t,i){super(e,t,i),this.options=i,this.options.icon=void 0!==i.icon&&i.icon,this.options.label=void 0===i.label||i.label,this.cssClass=""}render(e){super.render(e),this.element&&(this.label=ds(this.element,fs("a.action-label"))),this.label&&this.label.setAttribute("role",this.getDefaultAriaRole()),this.options.label&&this.options.keybinding&&this.element&&(ds(this.element,fs("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===qa.ID?"presentation":this.options.isMenu?"menuitem":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}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=ue(0,"{0} ({1})",e,this.options.keybinding))),null!=e?e:void 0}updateClass(){var e;this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.action.class,this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):null===(e=this.label)||void 0===e||e.classList.remove("codicon")}updateEnabled(){var e,t;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),null===(e=this.element)||void 0===e||e.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),null===(t=this.element)||void 0===t||t.classList.add("disabled"))}updateAriaLabel(){var e;if(this.label){const t=null!==(e=this.getTooltip())&&void 0!==e?e:"";this.label.setAttribute("aria-label",t)}}updateChecked(){this.label&&(void 0!==this.action.checked?(this.label.classList.toggle("checked",this.action.checked),this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox")):(this.label.classList.remove("checked"),this.label.setAttribute("aria-checked",""),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class Mx extends Ex{constructor(e,t,i,n,s,o,r){super(e,t),this.selectBox=new Nx(i,n,s,o,r),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}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(){var e;null===(e=this.selectBox)||void 0===e||e.focus()}blur(){var e;null===(e=this.selectBox)||void 0===e||e.blur()}render(e){this.selectBox.render(e)}}var Tx=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Rx extends E{constructor(e,t={}){var i,n,s,o,r,a;let l,h;switch(super(),this._actionRunnerDisposables=this._register(new N),this.viewItemDisposables=this._register(new R),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new U),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new U({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new U),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new U),this.onWillRun=this._onWillRun.event,this.options=t,this._context=null!==(i=t.context)&&void 0!==i?i:null,this._orientation=null!==(n=this.options.orientation)&&void 0!==n?n:0,this._triggerKeys={keyDown:null!==(o=null===(s=this.options.triggerKeys)||void 0===s?void 0:s.keyDown)&&void 0!==o&&o,keys:null!==(a=null===(r=this.options.triggerKeys)||void 0===r?void 0:r.keys)&&void 0!==a?a:[3,10]},this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new ja,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun((e=>this._onDidRun.fire(e)))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun((e=>this._onWillRun.fire(e)))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar",!1!==t.animated&&this.domNode.classList.add("animated"),this._orientation){case 0:l=[15],h=[17];break;case 1:l=[16],h=[18],this.domNode.className+=" vertical"}this._register(En(this.domNode,os.KEY_DOWN,(e=>{const t=new St(e);let i=!0;const n="number"==typeof this.focusedItem?this.viewItems[this.focusedItem]:void 0;l&&(t.equals(l[0])||t.equals(l[1]))?i=this.focusPrevious():h&&(t.equals(h[0])||t.equals(h[1]))?i=this.focusNext():t.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():t.equals(14)?i=this.focusFirst():t.equals(13)?i=this.focusLast():t.equals(2)&&n instanceof Ex&&n.trapsArrowNavigation?i=this.focusNext():this.isTriggerKeyEvent(t)?this._triggerKeys.keyDown?this.doTrigger(t):this.triggerKeyDown=!0:i=!1,i&&(t.preventDefault(),t.stopPropagation())}))),this._register(En(this.domNode,os.KEY_UP,(e=>{const t=new St(e);this.isTriggerKeyEvent(t)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(t)),t.preventDefault(),t.stopPropagation()):(t.equals(2)||t.equals(1026))&&this.updateFocusedItem()}))),this.focusTracker=this._register(hs(this.domNode)),this._register(this.focusTracker.onDidBlur((()=>{Xn()!==this.domNode&&qn(Xn(),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()>=2?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const e=this.viewItems.find((e=>e instanceof Ex&&e.isEnabled()));e instanceof Ex&&e.setFocusable(!0)}else this.viewItems.forEach((e=>{e instanceof Ex&&e.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((e=>this._onDidRun.fire(e)))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun((e=>this._onWillRun.fire(e)))),this.viewItems.forEach((t=>t.actionRunner=e))}getContainer(){return this.domNode}getAction(e){var t;if("number"==typeof e)return null===(t=this.viewItems[e])||void 0===t?void 0:t.action;if(e instanceof HTMLElement){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let t=0;t{const i=document.createElement("li");let s;i.className="action-item",i.setAttribute("role","presentation");const o=Object.assign({hoverDelegate:this.options.hoverDelegate},t);this.options.actionViewItemProvider&&(s=this.options.actionViewItemProvider(e,o)),s||(s=new Ix(this.context,e,o)),this.options.allowContextMenu||this.viewItemDisposables.set(s,En(i,os.CONTEXT_MENU,(e=>{as(e,!0)}))),s.actionRunner=this._actionRunner,s.setActionContext(this.context),s.render(i),this.focusable&&s instanceof Ex&&0===this.viewItems.length&&s.setFocusable(!0),null===n||n<0||n>=this.actionsList.children.length?(this.actionsList.appendChild(i),this.viewItems.push(s)):(this.actionsList.insertBefore(i,this.actionsList.children[n]),this.viewItems.splice(n,0,s),n++)})),"number"==typeof this.focusedItem&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=k(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),Dn(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return 0===this.viewItems.length}focus(e){let t,i=!1;if(void 0===e?i=!0:"number"==typeof e?t=e:"boolean"==typeof e&&(i=e),i&&void 0===this.focusedItem){const e=this.viewItems.findIndex((e=>e.isEnabled()));this.focusedItem=-1===e?void 0:e,this.updateFocus(void 0,void 0,!0)}else void 0!==t&&(this.focusedItem=t),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(void 0===this.focusedItem)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===qa.ID));return this.updateFocus(),!0}focusPrevious(e){if(void 0===this.focusedItem)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===qa.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){var n;void 0===this.focusedItem&&this.actionsList.focus({preventScroll:t}),void 0!==this.previouslyFocusedItem&&this.previouslyFocusedItem!==this.focusedItem&&(null===(n=this.viewItems[this.previouslyFocusedItem])||void 0===n||n.blur());const s=void 0!==this.focusedItem&&this.viewItems[this.focusedItem];if(s){let n=!0;Gr(s.focus)||(n=!1),this.options.focusOnlyEnabledItems&&Gr(s.isEnabled)&&!s.isEnabled()&&(n=!1),s.action.id===qa.ID&&(n=!1),n?(i||this.previouslyFocusedItem!==this.focusedItem)&&(s.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0)}}doTrigger(e){if(void 0===this.focusedItem)return;const t=this.viewItems[this.focusedItem];if(t instanceof Ex){const i=null===t._context||void 0===t._context?e:t._context;this.run(t._action,i)}}run(e,t){return Tx(this,void 0,void 0,(function*(){yield this._actionRunner.run(e,t)}))}dispose(){this._context=void 0,this.viewItems=k(this.viewItems),this.getContainer().remove(),super.dispose()}}class Ax{constructor(e,t,i=t){this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=t,this.modifierLabels[3]=i}toLabel(e,t,i){if(0===t.length)return null;const n=[];for(let s=0,o=t.length;s=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},oN=function(e,t){return function(i,n){t(i,n,e)}},rN=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const aN="acceptSelectedCodeAction",lN="previewSelectedCodeAction";class hN{get templateId(){return"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){var n,s;i.text.textContent=null!==(s=null===(n=e.group)||void 0===n?void 0:n.title)&&void 0!==s?s:""}disposeTemplate(e){}}let dN=class{get templateId(){return"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);return{container:e,icon:t,text:i,keybinding:new zx(e,$e)}}renderElement(e,t,i){var n,s,o;if((null===(n=e.group)||void 0===n?void 0:n.icon)?(i.icon.className=ta.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=Sp(e.group.icon.color.id))):(i.icon.className=ta.asClassName(Jr.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=mN(e.label),i.keybinding.set(e.keybinding),function(e,...t){e?_s(...t):vs(...t)}(!!e.keybinding,i.keybinding.element);const r=null===(s=this._keybindingService.lookupKeybinding(aN))||void 0===s?void 0:s.getLabel(),a=null===(o=this._keybindingService.lookupKeybinding(lN))||void 0===o?void 0:o.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:r&&a?this._supportsPreview&&e.canPreview?i.container.title=ue(0,"{0} to apply, {1} to preview",r,a):i.container.title=ue(0,"{0} to apply",r):i.container.title=""}disposeTemplate(e){}};dN=sN([oN(1,WL)],dN);class cN extends UIEvent{constructor(){super("acceptSelectedAction")}}class uN extends UIEvent{constructor(){super("previewSelectedAction")}}function gN(e){if("action"===e.kind)return e.label}let pN=class extends E{constructor(e,t,i,n,s,o){super(),this._delegate=n,this._contextViewService=s,this._keybindingService=o,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new jh),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const r={getHeight:e=>"header"===e.kind?this._headerLineHeight:this._actionLineHeight,getTemplateId:e=>e.kind};this._list=this._register(new yx(e,this.domNode,r,[new dN(t,this._keybindingService),new hN],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:gN},accessibilityProvider:{getAriaLabel:e=>{if("action"===e.kind){let t=e.label?mN(null==e?void 0:e.label):"";return e.disabled&&(t=ue(0,"{0}, Disabled Reason: {1}",t,e.disabled)),t}return null},getWidgetAriaLabel:()=>ue(0,"Action Widget"),getRole:e=>"action"===e.kind?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(Qx),this._register(this._list.onMouseClick((e=>this.onListClick(e)))),this._register(this._list.onMouseOver((e=>this.onListHover(e)))),this._register(this._list.onDidChangeFocus((()=>this.onFocus()))),this._register(this._list.onDidChangeSelection((e=>this.onListSelection(e)))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&"action"===e.kind}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter((e=>"header"===e.kind)).length,i=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(i);const n=this._allMenuItems.map(((e,t)=>{const i=document.getElementById(this._list.getElementID(t));if(i){i.style.width="auto";const e=i.getBoundingClientRect().width;return i.style.width="",e}return 0})),s=Math.max(...n,e),o=Math.min(i,.7*document.body.clientHeight);return this._list.layout(o,s),this.domNode.style.height=`${o}px`,this._list.domFocus(),s}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(0===t.length)return;const i=t[0],n=this._list.element(i);if(!this.focusCondition(n))return;const s=e?new uN:new cN;this._list.setSelection([i],s)}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 uN):this._list.setSelection([])}onFocus(){var e,t;this._list.domFocus();const i=this._list.getFocus();if(0===i.length)return;const n=i[0],s=this._list.element(n);null===(t=(e=this._delegate).onFocus)||void 0===t||t.call(e,s.item)}onListHover(e){return rN(this,void 0,void 0,(function*(){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&"action"===t.kind){const e=yield this._delegate.onHover(t.item,this.cts.token);t.canPreview=e?e.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus("number"==typeof e.index?[e.index]:[])}))}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};function mN(e){return e.replace(/\r\n|\r|\n/g," ")}pN=sN([oN(4,Ux),oN(5,WL)],pN);var fN=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},_N=function(e,t){return function(i,n){t(i,n,e)}};Dp("actionBar.toggledBackground",{dark:Vp,light:Vp,hcDark:Vp,hcLight:Vp},ue(0,"Background color for toggled action items in action bar."));const vN={Visible:new Al("codeActionMenuVisible",!1,ue(0,"Whether the action widget list is visible"))},bN=Ba("actionWidgetService");let CN=class extends E{get isVisible(){return vN.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new I)}show(e,t,i,n,s,o,r){const a=vN.Visible.bindTo(this._contextKeyService),l=this._instantiationService.createInstance(pN,e,t,i,n);this._contextViewService.showContextView({getAnchor:()=>s,render:e=>(a.set(!0),this._renderWidget(e,l,null!=r?r:[])),onHide:e=>{a.reset(),this._onWidgetClosed(e)}},o,!1)}acceptSelected(e){var t;null===(t=this._list.value)||void 0===t||t.acceptSelected(e)}focusPrevious(){var e,t;null===(t=null===(e=this._list)||void 0===e?void 0:e.value)||void 0===t||t.focusPrevious()}focusNext(){var e,t;null===(t=null===(e=this._list)||void 0===e?void 0:e.value)||void 0===t||t.focusNext()}hide(){var e;null===(e=this._list.value)||void 0===e||e.hide(),this._list.clear()}_renderWidget(e,t,i){var n;const s=document.createElement("div");if(s.classList.add("action-widget"),e.appendChild(s),this._list.value=t,!this._list.value)throw new Error("List has no value");s.appendChild(this._list.value.domNode);const o=new N,r=document.createElement("div"),a=e.appendChild(r);a.classList.add("context-view-block"),o.add(En(a,os.MOUSE_DOWN,(e=>e.stopPropagation())));const l=document.createElement("div"),h=e.appendChild(l);h.classList.add("context-view-pointerBlock"),o.add(En(h,os.POINTER_MOVE,(()=>h.remove()))),o.add(En(h,os.MOUSE_DOWN,(()=>h.remove())));let d=0;if(i.length){const e=this._createActionBar(".action-widget-action-bar",i);e&&(s.appendChild(e.getContainer().parentElement),o.add(e),d=e.getContainer().offsetWidth)}const c=null===(n=this._list.value)||void 0===n?void 0:n.layout(d);s.style.width=`${c}px`;const u=o.add(hs(e));return o.add(u.onDidBlur((()=>this.hide()))),o}_createActionBar(e,t){if(!t.length)return;const i=fs(e),n=new Rx(i);return n.push(t,{icon:!1,label:!0}),n}_onWidgetClosed(e){var t;null===(t=this._list.value)||void 0===t||t.hide(e)}};CN=fN([_N(0,Ux),_N(1,Ol),_N(2,Fa)],CN),yu(bN,CN,1);const wN=1100;var yN,SN;ah(class extends rh{constructor(){super({id:"hideCodeActionWidget",title:{value:ue(0,"Hide action widget"),original:"Hide action widget"},precondition:vN.Visible,keybinding:{weight:wN,primary:9,secondary:[1033]}})}run(e){e.get(bN).hide()}}),ah(class extends rh{constructor(){super({id:"selectPrevCodeAction",title:{value:ue(0,"Select previous action"),original:"Select previous action"},precondition:vN.Visible,keybinding:{weight:wN,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(e){const t=e.get(bN);t instanceof CN&&t.focusPrevious()}}),ah(class extends rh{constructor(){super({id:"selectNextCodeAction",title:{value:ue(0,"Select next action"),original:"Select next action"},precondition:vN.Visible,keybinding:{weight:wN,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(e){const t=e.get(bN);t instanceof CN&&t.focusNext()}}),ah(class extends rh{constructor(){super({id:aN,title:{value:ue(0,"Accept selected action"),original:"Accept selected action"},precondition:vN.Visible,keybinding:{weight:wN,primary:3,secondary:[2137]}})}run(e){const t=e.get(bN);t instanceof CN&&t.acceptSelected()}}),ah(class extends rh{constructor(){super({id:lN,title:{value:ue(0,"Preview selected action"),original:"Preview selected action"},precondition:vN.Visible,keybinding:{weight:wN,primary:2051}})}run(e){const t=e.get(bN);t instanceof CN&&t.acceptSelected(!0)}}),function(e){e[e.Hint=1]="Hint",e[e.Info=2]="Info",e[e.Warning=4]="Warning",e[e.Error=8]="Error"}(yN||(yN={})),function(e){e.compare=function(e,t){return t-e};const t=Object.create(null);t[e.Error]=ue(0,"Error"),t[e.Warning]=ue(0,"Warning"),t[e.Info]=ue(0,"Info"),e.toString=function(e){return t[e]||""},e.fromSeverity=function(t){switch(t){case gL.Error:return e.Error;case gL.Warning:return e.Warning;case gL.Info:return e.Info;case gL.Ignore:return e.Hint}},e.toSeverity=function(t){switch(t){case e.Error:return gL.Error;case e.Warning:return gL.Warning;case e.Info:return gL.Info;case e.Hint:return gL.Ignore}}}(yN||(yN={})),function(e){const t="";function i(e,i){const n=[t];return e.source?n.push(e.source.replace("\xa6","\\\xa6")):n.push(t),e.code?"string"==typeof e.code?n.push(e.code.replace("\xa6","\\\xa6")):n.push(e.code.value.replace("\xa6","\\\xa6")):n.push(t),void 0!==e.severity&&null!==e.severity?n.push(yN.toString(e.severity)):n.push(t),e.message&&i?n.push(e.message.replace("\xa6","\\\xa6")):n.push(t),void 0!==e.startLineNumber&&null!==e.startLineNumber?n.push(e.startLineNumber.toString()):n.push(t),void 0!==e.startColumn&&null!==e.startColumn?n.push(e.startColumn.toString()):n.push(t),void 0!==e.endLineNumber&&null!==e.endLineNumber?n.push(e.endLineNumber.toString()):n.push(t),void 0!==e.endColumn&&null!==e.endColumn?n.push(e.endColumn.toString()):n.push(t),n.push(t),n.join("\xa6")}e.makeKey=function(e){return i(e,!0)},e.makeKeyOptionalMessage=i}(SN||(SN={}));const LN=Ba("markerService");var kN=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const DN=new Al("supportedCodeAction","");class xN extends E{constructor(e,t,i,n=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=n,this._autoTriggerTimer=this._register(new sd),this._register(this._markerService.onMarkerChanged((e=>this._onMarkerChanges(e)))),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((e=>ba(e,t.uri)))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet((()=>{this.trigger({type:2,triggerAction:bL.Default})}),this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=this._editor.getSelection();if(i.isEmpty()&&2===e.type){const{lineNumber:e,column:n}=i.getPosition(),s=t.getLineContent(e);if(0===s.length)return;if(1===n){if(/\s/.test(s[0]))return}else if(n===t.getLineMaxColumn(e)){if(/\s/.test(s[s.length-1]))return}else if(/\s/.test(s[n-2])&&/\s/.test(s[n-1]))return}return i}}var NN;!function(e){e.Empty={type:0};e.Triggered=class{constructor(e,t,i){this.trigger=e,this.position=t,this._cancellablePromise=i,this.type=1,this.actions=i.catch((e=>{if(d(e))return EN;throw e}))}cancel(){this._cancellablePromise.cancel()}}}(NN||(NN={}));const EN=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1});class IN extends E{constructor(e,t,i,n,s,o){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=s,this._configurationService=o,this._codeActionOracle=this._register(new I),this._state=NN.Empty,this._onDidChangeState=this._register(new U),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=DN.bindTo(n),this._register(this._editor.onDidChangeModel((()=>this._update()))),this._register(this._editor.onDidChangeModelLanguage((()=>this._update()))),this._register(this._registry.onDidChange((()=>this._update()))),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(NN.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const t=null===(e=this._editor)||void 0===e?void 0:e.getModel();return!!this._configurationService&&this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickfixes",{resource:null==t?void 0:t.uri})}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(NN.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(90)){const t=this._registry.all(e).flatMap((e=>{var t;return null!==(t=e.providedCodeActionKinds)&&void 0!==t?t:[]}));this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new xN(this._editor,this._markerService,(t=>{var i;if(!t)return void this.setState(NN.Empty);const n=t.selection.getStartPosition(),s=Yh((i=>kN(this,void 0,void 0,(function*(){var n,s,o,r,a,l;if(this._settingEnabledNearbyQuickfixes()&&1===t.trigger.type&&(t.trigger.triggerAction===bL.QuickFix||(null===(s=null===(n=t.trigger.filter)||void 0===n?void 0:n.include)||void 0===s?void 0:s.contains(wL.QuickFix)))){const n=yield OL(this._registry,e,t.selection,t.trigger,_L.None,i);if(i.isCancellationRequested)return EN;if(!(null===(o=n.validActions)||void 0===o?void 0:o.some((e=>!!e.action.kind&&wL.QuickFix.contains(new wL(e.action.kind)))))){const s=this._markerService.read({resource:e.uri});if(s.length>0){const o=t.selection.getPosition();let h=o,d=Number.MAX_VALUE,c=!1;for(const e of s){const t=e.endColumn,i=e.endLineNumber,n=e.startLineNumber;(i===o.lineNumber||n===o.lineNumber)&&Math.abs(o.column-t){e.highlightRange=e.action.isPreferred})),c.push(...d.validActions)),{validActions:c,allActions:n.allActions,documentation:n.documentation,hasAutoFix:n.hasAutoFix,dispose:()=>{n.dispose()}}}}}}return OL(this._registry,e,t.selection,t.trigger,_L.None,i)}))));1===t.trigger.type&&(null===(i=this._progressService)||void 0===i||i.showWhile(s,250)),this.setState(new NN.Triggered(t.trigger,n,s))}),void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:bL.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;null===(t=this._codeActionOracle.value)||void 0===t||t.trigger(e)}setState(e,t){e!==this._state&&(1===this._state.type&&this._state.cancel(),this._state=e,t||this._disposed||this._onDidChangeState.fire(e))}}var MN,TN=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},RN=function(e,t){return function(i,n){t(i,n,e)}},AN=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let ON=MN=class extends E{static get(e){return e.getContribution(MN.ID)}constructor(e,t,i,n,s,o,r,a,l,h){super(),this._commandService=r,this._configurationService=a,this._actionWidgetService=l,this._instantiationService=h,this._activeCodeActions=this._register(new I),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new IN(this._editor,s.codeActionProvider,t,i,o,a)),this._register(this._model.onDidChangeState((e=>this.update(e)))),this._lightBulbWidget=new Zs((()=>{const e=this._editor.getContribution(ek.ID);return e&&this._register(e.onClick((e=>this.showCodeActionList(e.actions,e,{includeDisabledActions:!1,fromLightbulb:!0})))),e})),this._resolver=n.createInstance(UL),this._register(this._editor.onDidLayoutChange((()=>this._actionWidgetService.hide())))}dispose(){this._disposed=!0,super.dispose()}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,n){var s;if(!this._editor.hasModel())return;null===(s=oD.get(this._editor))||void 0===s||s.closeMessage();const o=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:n,context:{notAvailableMessage:e,position:o}})}_trigger(e){return this._model.trigger(e)}_applyCodeAction(e,t,i){return AN(this,void 0,void 0,(function*(){try{yield this._instantiationService.invokeFunction(BL,e,FL.FromCodeActions,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:bL.QuickFix,filter:{}})}}))}update(e){var t,i,n,s,o,a,l;return AN(this,void 0,void 0,(function*(){if(1!==e.type)return void(null===(t=this._lightBulbWidget.rawValue)||void 0===t||t.hide());let h;try{h=yield e.actions}catch(Mre){return void r(Mre)}if(!this._disposed)if(null===(i=this._lightBulbWidget.value)||void 0===i||i.update(h,e.trigger,e.position),1===e.trigger.type){if(null===(n=e.trigger.filter)||void 0===n?void 0:n.include){const t=this.tryGetValidActionToApply(e.trigger,h);if(t){try{null===(s=this._lightBulbWidget.value)||void 0===s||s.hide(),yield this._applyCodeAction(t,!1,!1)}finally{h.dispose()}return}if(e.trigger.context){const t=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,h);if(t&&t.action.disabled)return null===(o=oD.get(this._editor))||void 0===o||o.showMessage(t.action.disabled,e.trigger.context.position),void h.dispose()}}const t=!!(null===(a=e.trigger.filter)||void 0===a?void 0:a.include);if(e.trigger.context&&(!h.allActions.length||!t&&!h.validActions.length))return null===(l=oD.get(this._editor))||void 0===l||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=h,void h.dispose();this._activeCodeActions.value=h,this.showCodeActionList(h,this.toCoords(e.position),{includeDisabledActions:t,fromLightbulb:!1})}else this._actionWidgetService.isVisible?h.dispose():this._activeCodeActions.value=h}))}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length)return"first"===e.autoApply&&0===t.validActions.length||"ifSingle"===e.autoApply&&1===t.allActions.length?t.allActions.find((({action:e})=>e.disabled)):void 0}tryGetValidActionToApply(e,t){if(t.validActions.length)return"first"===e.autoApply&&t.validActions.length>0||"ifSingle"===e.autoApply&&1===t.validActions.length?t.validActions[0]:void 0}showCodeActionList(e,t,i){return AN(this,void 0,void 0,(function*(){const n=this._editor.createDecorationsCollection(),s=this._editor.getDomNode();if(!s)return;const o=i.includeDisabledActions&&(this._showDisabled||0===e.validActions.length)?e.allActions:e.validActions;if(!o.length)return;const r=Va.isIPosition(t)?this.toCoords(t):t,a={onSelect:(e,t)=>AN(this,void 0,void 0,(function*(){this._applyCodeAction(e,!0,!!t),this._actionWidgetService.hide(),n.clear()})),onHide:()=>{var e;null===(e=this._editor)||void 0===e||e.focus(),n.clear()},onHover:(e,t)=>AN(this,void 0,void 0,(function*(){var i;if(yield e.resolve(t),!t.isCancellationRequested)return{canPreview:!!(null===(i=e.action.edit)||void 0===i?void 0:i.edits.length)}})),onFocus:e=>{var t,i;if(e&&e.highlightRange&&e.action.diagnostics){const s=[{range:e.action.diagnostics[0],options:MN.DECORATION}];n.set(s);const o=e.action.diagnostics[0];Fs(ue(0,"Context: {0} at line {1} and column {2}.",null===(i=null===(t=this._editor.getModel())||void 0===t?void 0:t.getWordAtPosition({lineNumber:o.startLineNumber,column:o.startColumn}))||void 0===i?void 0:i.word,o.startLineNumber,o.startColumn))}else n.clear()}};this._actionWidgetService.show("codeActionWidget",!0,function(e,t,i){if(!t)return e.map((e=>{var t;return{kind:"action",item:e,group:KL,disabled:!!e.action.disabled,label:e.action.disabled||e.action.title,canPreview:!!(null===(t=e.action.edit)||void 0===t?void 0:t.edits.length)}}));const n=jL.map((e=>({group:e,actions:[]})));for(const o of e){const e=o.action.kind?new wL(o.action.kind):wL.None;for(const t of n)if(t.group.kind.contains(e)){t.actions.push(o);break}}const s=[];for(const o of n)if(o.actions.length){s.push({kind:"header",group:o.group});for(const e of o.actions)s.push({kind:"action",item:e,group:o.group,label:e.action.title,disabled:!!e.action.disabled,keybinding:i(e.action)})}return s}(o,this._shouldShowHeaders(),this._resolver.getResolver()),a,r,s,this._getActionBarActions(e,t,i))}))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=Hn(this._editor.getDomNode());return{x:i.left+t.left,y:i.top+t.top+t.height}}_shouldShowHeaders(){var e;const t=null===(e=this._editor)||void 0===e?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:null==t?void 0:t.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const n=e.documentation.map((e=>{var t;return{id:e.id,label:e.title,tooltip:null!==(t=e.tooltip)&&void 0!==t?t:"",class:void 0,enabled:!0,run:()=>{var t;return this._commandService.executeCommand(e.id,...null!==(t=e.arguments)&&void 0!==t?t:[])}}}));return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&n.push(this._showDisabled?{id:"hideMoreActions",label:ue(0,"Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:ue(0,"Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),n}};function PN(e){return pl.regex(DN.keys()[0],new RegExp("(\\s|^)"+eo(e.value)+"\\b"))}ON.ID="editor.contrib.codeActionController",ON.DECORATION=Iw.register({description:"quickfix-highlight",className:"quickfix-edit-highlight"}),ON=MN=TN([RN(1,LN),RN(2,Ol),RN(3,Fa),RN(4,oL),RN(5,vL),RN(6,Ya),RN(7,pu),RN(8,bN),RN(9,Fa)],ON),H_(((e,t)=>{((e,i)=>{i&&t.addRule(`.monaco-editor ${e} { background-color: ${i}; }`)})(".quickfix-edit-highlight",e.getColor(Um));const i=e.getColor(qm);i&&t.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${A_(e.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)}));const FN={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:ue(0,"Kind of the code action to run.")},apply:{type:"string",description:ue(0,"Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[ue(0,"Always apply the first returned code action."),ue(0,"Apply the first returned code action if it is the only one."),ue(0,"Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:ue(0,"Controls if only preferred code actions should be returned.")}}};function BN(e,t,i,n,s=bL.Default){if(e.hasModel()){const o=ON.get(e);null==o||o.manualTriggerAtCurrentPosition(t,s,i,n)}}Dh(ON.ID,ON,3),Dh(ek.ID,ek,4),Lh(class extends bh{constructor(){super({id:xL,label:ue(0,"Quick Fix..."),alias:"Quick Fix...",precondition:pl.and(Oh.writable,Oh.hasCodeActionsProvider),kbOpts:{kbExpr:Oh.textInputFocus,primary:2137,weight:100}})}run(e,t){return BN(t,ue(0,"No code actions available"),void 0,void 0,bL.QuickFix)}}),Lh(class extends bh{constructor(){super({id:EL,label:ue(0,"Refactor..."),alias:"Refactor...",precondition:pl.and(Oh.writable,Oh.hasCodeActionsProvider),kbOpts:{kbExpr:Oh.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:pl.and(Oh.writable,PN(wL.Refactor))},description:{description:"Refactor...",args:[{name:"args",schema:FN}]}})}run(e,t,i){const n=SL.fromUser(i,{kind:wL.Refactor,apply:"never"});return BN(t,"string"==typeof(null==i?void 0:i.kind)?n.preferred?ue(0,"No preferred refactorings for '{0}' available",i.kind):ue(0,"No refactorings for '{0}' available",i.kind):n.preferred?ue(0,"No preferred refactorings available"):ue(0,"No refactorings available"),{include:wL.Refactor.contains(n.kind)?n.kind:wL.None,onlyIncludePreferredActions:n.preferred},n.apply,bL.Refactor)}}),Lh(class extends bh{constructor(){super({id:IL,label:ue(0,"Source Action..."),alias:"Source Action...",precondition:pl.and(Oh.writable,Oh.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:pl.and(Oh.writable,PN(wL.Source))},description:{description:"Source Action...",args:[{name:"args",schema:FN}]}})}run(e,t,i){const n=SL.fromUser(i,{kind:wL.Source,apply:"never"});return BN(t,"string"==typeof(null==i?void 0:i.kind)?n.preferred?ue(0,"No preferred source actions for '{0}' available",i.kind):ue(0,"No source actions for '{0}' available",i.kind):n.preferred?ue(0,"No preferred source actions available"):ue(0,"No source actions available"),{include:wL.Source.contains(n.kind)?n.kind:wL.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply,bL.SourceAction)}}),Lh(class extends bh{constructor(){super({id:ML,label:ue(0,"Organize Imports"),alias:"Organize Imports",precondition:pl.and(Oh.writable,PN(wL.SourceOrganizeImports)),kbOpts:{kbExpr:Oh.textInputFocus,primary:1581,weight:100}})}run(e,t){return BN(t,ue(0,"No organize imports action available"),{include:wL.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",bL.OrganizeImports)}}),Lh(class extends bh{constructor(){super({id:NL,label:ue(0,"Auto Fix..."),alias:"Auto Fix...",precondition:pl.and(Oh.writable,PN(wL.QuickFix)),kbOpts:{kbExpr:Oh.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return BN(t,ue(0,"No auto fixes available"),{include:wL.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",bL.AutoFix)}}),Lh(class extends bh{constructor(){super({id:TL,label:ue(0,"Fix All"),alias:"Fix All",precondition:pl.and(Oh.writable,PN(wL.SourceFixAll))})}run(e,t){return BN(t,ue(0,"No fix all action available"),{include:wL.SourceFixAll,includeSourceActions:!0},"ifSingle",bL.FixAll)}}),Sh(new class extends vh{constructor(){super({id:DL,precondition:pl.and(Oh.writable,Oh.hasCodeActionsProvider),description:{description:"Trigger a code action",args:[{name:"args",schema:FN}]}})}runEditorCommand(e,t,i){const n=SL.fromUser(i,{kind:wL.Empty,apply:"ifSingle"});return BN(t,"string"==typeof(null==i?void 0:i.kind)?n.preferred?ue(0,"No preferred code actions for '{0}' available",i.kind):ue(0,"No code actions for '{0}' available",i.kind):n.preferred?ue(0,"No preferred code actions available"):ue(0,"No code actions available"),{include:n.kind,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}),jl.as(xu).registerConfiguration(Object.assign(Object.assign({},YS),{properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:ue(0,"Enable/disable showing group headers in the Code Action menu."),default:!0}}})),jl.as(xu).registerConfiguration(Object.assign(Object.assign({},YS),{properties:{"editor.codeActionWidget.includeNearbyQuickfixes":{type:"boolean",scope:5,description:ue(0,"Enable/disable showing nearest quickfix within a line when not currently on a diagnostic."),default:!1}}}));class WN{static capture(e){if(0===e.getScrollTop()||e.hasPendingScrollAnimation())return new WN(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 s=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-s}return new WN(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,n,s){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=n,this._cursorPosition=s}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)}}var VN=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class HN{constructor(){this.lenses=[],this._disposables=new N}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})}}function zN(e,t,i){return VN(this,void 0,void 0,(function*(){const n=e.ordered(t),s=new Map,o=new HN,r=n.map(((e,n)=>VN(this,void 0,void 0,(function*(){s.set(e,n);try{const n=yield Promise.resolve(e.provideCodeLenses(t,i));n&&o.add(n,e)}catch(r){a(r)}}))));return yield Promise.all(r),o.lenses=o.lenses.sort(((e,t)=>e.symbol.range.startLineNumbert.symbol.range.startLineNumber?1:s.get(e.provider)s.get(t.provider)?1:e.symbol.range.startColumnt.symbol.range.startColumn?1:0)),o}))}Xa.registerCommand("_executeCodeLensProvider",(function(e,...t){let[i,n]=t;qr(an.isUri(i)),qr("number"==typeof n||!n);const{codeLensProvider:s}=e.get(oL),o=e.get(Ha).getModel(i);if(!o)throw u();const r=[],a=new N;return zN(s,o,Uh.None).then((e=>{a.add(e);const t=[];for(const i of e.lenses)null==n||Boolean(i.symbol.command)?r.push(i.symbol):n-- >0&&i.provider.resolveCodeLens&&t.push(Promise.resolve(i.provider.resolveCodeLens(o,i.symbol,Uh.None)).then((e=>r.push(e||i.symbol))));return Promise.all(t)})).then((()=>r)).finally((()=>{setTimeout((()=>a.dispose()),100)}))}));var UN,KN,jN=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};!function(e){e[e.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",e[e.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"}(UN||(UN={})),function(e){e[e.None=0]="None",e[e.Initialized=1]="Initialized",e[e.Closed=2]="Closed"}(KN||(KN={}));class qN extends E{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new j),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=KN.None,this.cache=new Map,this.flushDelayer=this._register(new ed(qN.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal((e=>this.onDidChangeItemsExternal(e))))}onDidChangeItemsExternal(e){var t,i;this._onDidChangeStorage.pause();try{null===(t=e.changed)||void 0===t||t.forEach(((e,t)=>this.acceptExternal(t,e))),null===(i=e.deleted)||void 0===i||i.forEach((e=>this.acceptExternal(e,void 0)))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===KN.Closed)return;let i=!1;if(jr(t))i=this.cache.delete(e);else{this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0)}i&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const i=this.cache.get(e);return jr(i)?t:i}getBoolean(e,t){const i=this.get(e);return jr(i)?t:"true"===i}getNumber(e,t){const i=this.get(e);return jr(i)?t:parseInt(i,10)}set(e,t,i=!1){return jN(this,void 0,void 0,(function*(){if(this.state===KN.Closed)return;if(jr(t))return this.delete(e,i);const n=Br(t)||Array.isArray(t)?(s=t,JSON.stringify(s,mk)):String(t);var s;return this.cache.get(e)!==n?(this.cache.set(e,n),this.pendingInserts.set(e,n),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()):void 0}))}delete(e,t=!1){return jN(this,void 0,void 0,(function*(){if(this.state===KN.Closed)return;return this.cache.delete(e)?(this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()):void 0}))}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}flushPending(){return jN(this,void 0,void 0,(function*(){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((()=>{var e;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)null===(e=this.whenFlushedCallbacks.pop())||void 0===e||e()}))}))}doFlush(e){return jN(this,void 0,void 0,(function*(){return this.options.hint===UN.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger((()=>this.flushPending()),e)}))}}qN.DEFAULT_FLUSH_DELAY=100;class $N{constructor(){this.onDidChangeItemsExternal=B.None,this.items=new Map}updateItems(e){var t,i;return jN(this,void 0,void 0,(function*(){null===(t=e.insert)||void 0===t||t.forEach(((e,t)=>this.items.set(t,e))),null===(i=e.delete)||void 0===i||i.forEach((e=>this.items.delete(e)))}))}}const GN="__$__targetStorageMarker",ZN=Ba("storageService");var YN;!function(e){e[e.NONE=0]="NONE",e[e.SHUTDOWN=1]="SHUTDOWN"}(YN||(YN={}));class XN extends E{constructor(e={flushInterval:XN.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new j),this._onDidChangeTarget=this._register(new j),this._onWillSaveState=this._register(new U),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,i){return B.filter(this._onDidChangeValue.event,(i=>i.scope===e&&(void 0===t||i.key===t)),i)}emitDidChangeValue(e,t){const{key:i,external:n}=t;if(i===GN){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:n})}get(e,t,i){var n;return null===(n=this.getStorage(t))||void 0===n?void 0:n.get(e,i)}getBoolean(e,t,i){var n;return null===(n=this.getStorage(t))||void 0===n?void 0:n.getBoolean(e,i)}getNumber(e,t,i){var n;return null===(n=this.getStorage(t))||void 0===n?void 0:n.getNumber(e,i)}store(e,t,i,n,s=!1){jr(t)?this.remove(e,i,s):this.withPausedEmitters((()=>{var o;this.updateKeyTarget(e,i,n),null===(o=this.getStorage(i))||void 0===o||o.set(e,t,s)}))}remove(e,t,i=!1){this.withPausedEmitters((()=>{var n;this.updateKeyTarget(e,t,void 0),null===(n=this.getStorage(t))||void 0===n||n.delete(e,i)}))}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i,n=!1){var s,o;const r=this.getKeyTargets(t);"number"==typeof i?r[e]!==i&&(r[e]=i,null===(s=this.getStorage(t))||void 0===s||s.set(GN,JSON.stringify(r),n)):"number"==typeof r[e]&&(delete r[e],null===(o=this.getStorage(t))||void 0===o||o.set(GN,JSON.stringify(r),n))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?function(e){const t=e.get(GN);if(t)try{return JSON.parse(t)}catch(i){}return Object.create(null)}(t):Object.create(null)}}XN.DEFAULT_FLUSH_INTERVAL=6e4;var QN=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},JN=function(e,t){return function(i,n){t(i,n,e)}};const eE=Ba("ICodeLensCache");class tE{constructor(e,t){this.lineCount=e,this.data=t}}let iE=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new js(20,.75);ad((()=>e.remove("codelens/cache",1)));const t="codelens/cache2",i=e.get(t,1,"{}");this._deserialize(i),B.once(e.onWillSaveState)((i=>{i.reason===YN.SHUTDOWN&&e.store(t,this._serialize(),1,1)}))}put(e,t){const i=t.lenses.map((e=>{var t;return{range:e.symbol.range,command:e.symbol.command&&{id:"",title:null===(t=e.symbol.command)||void 0===t?void 0:t.title}}})),n=new HN;n.add({lenses:i,dispose:()=>{}},this._fakeProvider);const s=new tE(e.getLineCount(),n);this._cache.set(e.uri.toString(),s)}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 e of i.data.lenses)n.add(e.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 e in t){const i=t[e],n=[];for(const e of i.lines)n.push({range:new Rh(e,1,e,11)});const s=new HN;s.add({lenses:n,dispose(){}},this._fakeProvider),this._cache.set(e,new tE(i.lineCount,s))}}catch(ge){}}};iE=QN([JN(0,ZN)],iE),yu(eE,iE,1);class nE{constructor(e,t,i){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){void 0===this._lastHeight?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return 0!==this._lastHeight&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class sE{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id="codelens.widget-"+sE._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 s=0;s{e.symbol.command&&a.push(e.symbol),i.addDecoration({range:e.symbol.range,options:rE},(e=>this._decorationIds[t]=e)),r=r?Rh.plusRange(r,e.symbol.range):Rh.lift(e.symbol.range)})),this._viewZone=new nE(r.startLineNumber-1,s,o),this._viewZoneId=n.addZone(this._viewZone),a.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(a,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new sE(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],null==t||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||Rh.isEmpty(n.range)!==i.isEmpty())}))}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach(((e,i)=>{t.addDecoration({range:e.symbol.range,options:rE},(e=>this._decorationIds[i]=e))}))}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;tgE(t,e)),n)):function(e,t){return t=pE(181387,t),Object.keys(e).sort().reduce(((t,i)=>(t=mE(i,t),gE(e[i],t))),t)}(e,t);case"string":return mE(e,t);case"boolean":return function(e,t){return pE(e?433:863,t)}(e,t);case"number":return pE(e,t);case"undefined":return pE(937,t);default:return pE(617,t)}var i,n}function pE(e,t){return(t<<5)-t+e|0}function mE(e,t){t=pE(149417,t);for(let i=0,n=e.length;i>>n)>>>0}function _E(e,t=0,i=e.byteLength,n=0){for(let s=0;se.toString(16).padStart(2,"0"))).join(""):function(e,t,i="0"){for(;e.length>>0).toString(16),t/4)}class bE{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(0===t)return;const i=this._buff;let n,s,o=this._buffLen,r=this._leftoverHighSurrogate;for(0!==r?(n=r,s=-1,r=0):(n=e.charCodeAt(0),s=0);;){let a=n;if(wo(n)){if(!(s+1>>6,e[t++]=128|(63&i)>>>0):i<65536?(e[t++]=224|(61440&i)>>>12,e[t++]=128|(4032&i)>>>6,e[t++]=128|(63&i)>>>0):(e[t++]=240|(1835008&i)>>>18,e[t++]=128|(258048&i)>>>12,e[t++]=128|(4032&i)>>>6,e[t++]=128|(63&i)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),vE(this._h0)+vE(this._h1)+vE(this._h2)+vE(this._h3)+vE(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,_E(this._buff,this._buffLen),this._buffLen>56&&(this._step(),_E(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=bE._bigBlock32,t=this._buffDV;for(let d=0;d<64;d+=4)e.setUint32(d,t.getUint32(d,!1),!1);for(let d=64;d<320;d+=4)e.setUint32(d,fE(e.getUint32(d-12,!1)^e.getUint32(d-32,!1)^e.getUint32(d-56,!1)^e.getUint32(d-64,!1),1),!1);let i,n,s,o=this._h0,r=this._h1,a=this._h2,l=this._h3,h=this._h4;for(let d=0;d<80;d++)d<20?(i=r&a|~r&l,n=1518500249):d<40?(i=r^a^l,n=1859775393):d<60?(i=r&a|r&l|a&l,n=2400959708):(i=r^a^l,n=3395469782),s=fE(o,5)+i+h+n+e.getUint32(4*d,!1)&4294967295,h=l,l=a,a=fE(r,30),r=o,o=s;this._h0=this._h0+o&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+a&4294967295,this._h3=this._h3+l&4294967295,this._h4=this._h4+h&4294967295}}bE._bigBlock32=new DataView(new ArrayBuffer(320));const CE=Ba("environmentService");var wE=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},yE=function(e,t){return function(i,n){t(i,n,e)}};const SE=Ba("ILanguageFeatureDebounceService");var LE;!function(e){const t=new WeakMap;let i=0;e.of=function(e){let n=t.get(e);return void 0===n&&(n=++i,t.set(e,n)),n}}(LE||(LE={}));class kE{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class DE{constructor(e,t,i,n,s,o){this._logService=e,this._name=t,this._registry=i,this._default=n,this._min=s,this._max=o,this._cache=new js(50,.7)}_key(e){return e.id+this._registry.all(e).reduce(((e,t)=>gE(LE.of(t),e)),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?uD(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 pD(6),this._cache.set(i,n));const s=uD(n.update(t),this._min,this._max);return $k(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${s}ms`),s}_overall(){const e=new gD;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){return uD(0|this._overall()||this._default,this._min,this._max)}}let xE=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){var n,s,o;const r=null!==(n=null==i?void 0:i.min)&&void 0!==n?n:50,a=null!==(s=null==i?void 0:i.max)&&void 0!==s?s:Math.pow(r,2),l=null!==(o=null==i?void 0:i.key)&&void 0!==o?o:void 0,h=`${LE.of(e)},${r}${l?","+l:""}`;let d=this._data.get(h);return d||(this._isDev?d=new DE(this._logService,t,e,0|this._overallAverage()||1.5*r,r,a):(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),d=new kE(1.5*r)),this._data.set(h,d)),d}_overallAverage(){const e=new gD;for(const t of this._data.values())e.update(t.default());return e.value}};xE=wE([yE(0,hh),yE(1,CE)],xE),yu(SE,xE,1);var NE=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},EE=function(e,t){return function(i,n){t(i,n,e)}},IE=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let ME=class{constructor(e,t,i,n,s,o){this._editor=e,this._languageFeaturesService=t,this._commandService=n,this._notificationService=s,this._codeLensCache=o,this._disposables=new N,this._localToDispose=new N,this._lenses=[],this._oldCodeLensModels=new N,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new rd((()=>this._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((e=>{(e.hasChanged(50)||e.hasChanged(19)||e.hasChanged(18))&&this._updateLensStyle(),e.hasChanged(17)&&this._onModelChange()}))),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),null===(e=this._currentCodeLensModel)||void 0===e||e.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(66)/this._editor.getOption(52));let t=this._editor.getOption(19);return(!t||t<5)&&(t=.9*this._editor.getOption(52)|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(18),n=this._editor.getOption(50),{style:s}=this._editor.getContainerDomNode();s.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),s.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),s.setProperty("--vscode-editorCodeLens-fontFeatureSettings",n.fontFeatureSettings),i&&(s.setProperty("--vscode-editorCodeLens-fontFamily",i),s.setProperty("--vscode-editorCodeLens-fontFamilyDefault",qS.fontFamily)),this._editor.changeViewZones((t=>{for(const i of this._lenses)i.updateHeight(e,t)}))}_localDispose(){var e,t,i;null===(e=this._getCodeLensModelPromise)||void 0===e||e.cancel(),this._getCodeLensModelPromise=void 0,null===(t=this._resolveCodeLensesPromise)||void 0===t||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),null===(i=this._currentCodeLensModel)||void 0===i||i.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e)return;if(!this._editor.getOption(17)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e))return void(t&&this._localToDispose.add(id((()=>{const i=this._codeLensCache.get(e);t===i&&(this._codeLensCache.delete(e),this._onModelChange())}),3e4)));for(const n of this._languageFeaturesService.codeLensProvider.all(e))if("function"==typeof n.onDidChange){const e=n.onDidChange((()=>i.schedule()));this._localToDispose.add(e)}const i=new rd((()=>{var t;const n=Date.now();null===(t=this._getCodeLensModelPromise)||void 0===t||t.cancel(),this._getCodeLensModelPromise=Yh((t=>zN(this._languageFeaturesService.codeLensProvider,e,t))),this._getCodeLensModelPromise.then((t=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=t,this._codeLensCache.put(e,t);const s=this._provideCodeLensDebounce.update(e,Date.now()-n);i.delay=s,this._renderCodeLensSymbols(t),this._resolveCodeLensesInViewportSoon()}),r)}),this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(x((()=>this._resolveCodeLensesScheduler.cancel()))),this._localToDispose.add(this._editor.onDidChangeModelContent((()=>{var e;this._editor.changeDecorations((e=>{this._editor.changeViewZones((t=>{const i=[];let n=-1;this._lenses.forEach((e=>{e.isValid()&&n!==e.getLineNumber()?(e.update(t),n=e.getLineNumber()):i.push(e)}));const s=new oE;i.forEach((e=>{e.dispose(s,t),this._lenses.splice(this._lenses.indexOf(e),1)})),s.commit(e)}))})),i.schedule(),this._resolveCodeLensesScheduler.cancel(),null===(e=this._resolveCodeLensesPromise)||void 0===e||e.cancel(),this._resolveCodeLensesPromise=void 0}))),this._localToDispose.add(this._editor.onDidFocusEditorWidget((()=>{i.schedule()}))),this._localToDispose.add(this._editor.onDidBlurEditorText((()=>{i.cancel()}))),this._localToDispose.add(this._editor.onDidScrollChange((e=>{e.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()}))),this._localToDispose.add(this._editor.onDidLayoutChange((()=>{this._resolveCodeLensesInViewportSoon()}))),this._localToDispose.add(x((()=>{if(this._editor.getModel()){const e=WN.capture(this._editor);this._editor.changeDecorations((e=>{this._editor.changeViewZones((t=>{this._disposeAllLenses(e,t)}))})),e.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)}))),this._localToDispose.add(this._editor.onMouseDown((e=>{if(9!==e.target.type)return;let t=e.target.element;if("SPAN"===(null==t?void 0:t.tagName)&&(t=t.parentElement),"A"===(null==t?void 0:t.tagName))for(const i of this._lenses){const e=i.getCommand(t);if(e){this._commandService.executeCommand(e.id,...e.arguments||[]).catch((e=>this._notificationService.error(e)));break}}}))),i.schedule()}_disposeAllLenses(e,t){const i=new oE;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 r of e.lenses){const e=r.symbol.range.startLineNumber;e<1||e>t||(n&&n[n.length-1].symbol.range.startLineNumber===e?n.push(r):(n=[r],i.push(n)))}if(!i.length&&!this._lenses.length)return;const s=WN.capture(this._editor),o=this._getLayoutInfo();this._editor.changeDecorations((e=>{this._editor.changeViewZones((t=>{const n=new oE;let s=0,r=0;for(;rthis._resolveCodeLensesInViewportSoon()))),s++,r++)}for(;sthis._resolveCodeLensesInViewportSoon()))),r++;n.commit(e)}))})),s.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;null===(e=this._resolveCodeLensesPromise)||void 0===e||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const i=[],n=[];if(this._lenses.forEach((e=>{const s=e.computeIfNecessary(t);s&&(i.push(s),n.push(e))})),0===i.length)return;const s=Date.now(),o=Yh((e=>{const s=i.map(((i,s)=>{const o=new Array(i.length),r=i.map(((i,n)=>i.symbol.command||"function"!=typeof i.provider.resolveCodeLens?(o[n]=i.symbol,Promise.resolve(void 0)):Promise.resolve(i.provider.resolveCodeLens(t,i.symbol,e)).then((e=>{o[n]=e}),a)));return Promise.all(r).then((()=>{e.isCancellationRequested||n[s].isDisposed()||n[s].updateCommands(o)}))}));return Promise.all(s)}));this._resolveCodeLensesPromise=o,this._resolveCodeLensesPromise.then((()=>{const e=this._resolveCodeLensesDebounce.update(t,Date.now()-s);this._resolveCodeLensesScheduler.delay=e,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),o===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)}),(e=>{r(e),o===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)}))}getModel(){var e;return IE(this,void 0,void 0,(function*(){return yield this._getCodeLensModelPromise,yield this._resolveCodeLensesPromise,(null===(e=this._currentCodeLensModel)||void 0===e?void 0:e.isDisposed)?void 0:this._currentCodeLensModel}))}};ME.ID="css.editor.codeLens",ME=NE([EE(1,oL),EE(2,SE),EE(3,Ya),EE(4,mL),EE(5,eE)],ME),Dh(ME.ID,ME,1),Lh(class extends bh{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:Oh.hasCodeLensProvider,label:ue(0,"Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}run(e,t){return IE(this,void 0,void 0,(function*(){if(!t.hasModel())return;const i=e.get(cE),n=e.get(Ya),s=e.get(mL),o=t.getSelection().positionLineNumber,r=t.getContribution(ME.ID);if(!r)return;const a=yield r.getModel();if(!a)return;const l=[];for(const e of a.lenses)e.symbol.command&&e.symbol.range.startLineNumber===o&&l.push({label:e.symbol.command.title,command:e.symbol.command});if(0===l.length)return;const h=yield i.pick(l,{canPickMany:!1,placeHolder:ue(0,"Select a command")});if(!h)return;let d=h.command;if(a.isDisposed){const e=yield r.getModel(),t=null==e?void 0:e.lenses.find((e=>{var t;return e.symbol.range.startLineNumber===o&&(null===(t=e.symbol.command)||void 0===t?void 0:t.title)===d.title}));if(!t||!t.symbol.command)return;d=t.symbol.command}try{yield n.executeCommand(d.id,...d.arguments||[])}catch(c){s.error(c)}}))}});class TE{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new RE(this.x-window.scrollX,this.y-window.scrollY)}}class RE{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new TE(this.clientX+window.scrollX,this.clientY+window.scrollY)}}class AE{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n,this._editorPagePositionBrand=void 0}}class OE{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function PE(e){const t=Hn(e);return new AE(t.left,t.top,t.width,t.height)}function FE(e,t,i){const n=t.width/e.offsetWidth,s=t.height/e.offsetHeight,o=(i.x-t.x)/n,r=(i.y-t.y)/s;return new OE(o,r)}class BE extends Nt{constructor(e,t,i){super(e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new TE(this.posx,this.posy),this.editorPos=PE(i),this.relativePos=FE(i,this.editorPos,this.pos)}}class WE{constructor(e){this._editorViewDomNode=e}_create(e){return new BE(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return En(e,"contextmenu",(e=>{t(this._create(e))}))}onMouseUp(e,t){return En(e,"mouseup",(e=>{t(this._create(e))}))}onMouseDown(e,t){return En(e,os.MOUSE_DOWN,(e=>{t(this._create(e))}))}onPointerDown(e,t){return En(e,os.POINTER_DOWN,(e=>{t(this._create(e),e.pointerId)}))}onMouseLeave(e,t){return En(e,os.MOUSE_LEAVE,(e=>{t(this._create(e))}))}onMouseMove(e,t){return En(e,"mousemove",(e=>t(this._create(e))))}}class VE{constructor(e){this._editorViewDomNode=e}_create(e){return new BE(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return En(e,"pointerup",(e=>{t(this._create(e))}))}onPointerDown(e,t){return En(e,os.POINTER_DOWN,(e=>{t(this._create(e),e.pointerId)}))}onPointerLeave(e,t){return En(e,os.POINTER_LEAVE,(e=>{t(this._create(e))}))}onPointerMove(e,t){return En(e,"pointermove",(e=>t(this._create(e))))}}class HE extends E{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new fD),this._keydownListener=null}startMonitoring(e,t,i,n,s){this._keydownListener=Mn(e.ownerDocument,"keydown",(e=>{e.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,e.browserEvent)}),!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,(e=>{n(new BE(e,!0,this._editorViewDomNode))}),(e=>{this._keydownListener.dispose(),s(e)}))}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class zE{constructor(e){this._editor=e,this._instanceId=++zE._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new rd((()=>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 UE(t,`dyn-rule-${this._instanceId}-${n}`,Zn(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())}}zE._idPool=0;class UE{constructor(e,t,i,n){this.key=e,this.className=t,this.properties=n,this._referenceCount=0,this._styleElement=Jn(i),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(const n in t){const e=t[n];let s;s="object"==typeof e?Sp(e.id):e;i+=`\n\t${KE(n)}: ${s};`}return i+="\n}",i}dispose(){this._styleElement.remove()}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function KE(e){return e.replace(/(^[A-Z])/,(([e])=>e.toLowerCase())).replace(/([A-Z])/g,(([e])=>`-${e.toLowerCase()}`))}const jE="$initialize";let qE=!1;function $E(e){We&&(qE||(qE=!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(e.message))}class GE{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.method=i,this.args=n,this.type=0}}class ZE{constructor(e,t,i,n){this.vsWorker=e,this.seq=t,this.res=i,this.err=n,this.type=1}}class YE{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=n,this.type=2}}class XE{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class QE{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class JE{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,s)=>{this._pendingReplies[i]={resolve:n,reject:s},this._send(new GE(this._workerId,i,e,t))}))}listen(e,t){let i=null;const n=new U({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,n),this._send(new YE(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new QE(this._workerId,i)),i=null}});return n.event}handleMessage(e){e&&e.vsWorker&&(-1!==this._workerId&&e.vsWorker!==this._workerId||this._handleMessage(e))}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq])return void console.warn("Got reply to unknown seq");const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;return e.err.$isError&&(i=new Error,i.name=e.err.name,i.message=e.err.message,i.stack=e.err.stack),void t.reject(i)}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then((e=>{this._send(new ZE(this._workerId,t,e,void 0))}),(e=>{e.detail instanceof Error&&(e.detail=l(e.detail)),this._send(new ZE(this._workerId,t,void 0,l(e)))}))}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)((e=>{this._send(new XE(this._workerId,t,e))}));this._pendingEvents.set(t,i)}_handleEventMessage(e){this._pendingEmitters.has(e.req)?this._pendingEmitters.get(e.req).fire(e.event):console.warn("Got event for unknown req")}_handleUnsubscribeEventMessage(e){this._pendingEvents.has(e.req)?(this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)):console.warn("Got unsubscribe for unknown req")}_send(e){const t=[];if(0===e.type)for(let i=0;i{this._protocol.handleMessage(e)}),(e=>{null==n||n(e)}))),this._protocol=new JE({sendMessage:(e,t)=>{this._worker.postMessage(e,t)},handleMessage:(e,t)=>{if("function"!=typeof i[e])return Promise.reject(new Error("Missing method "+e+" on main thread host."));try{return Promise.resolve(i[e].apply(i,t))}catch(Mre){return Promise.reject(Mre)}},handleEvent:(e,t)=>{if(iI(e)){const n=i[e].call(i,t);if("function"!=typeof n)throw new Error(`Missing dynamic event ${e} on main thread host.`);return n}if(tI(e)){const t=i[e];if("function"!=typeof t)throw new Error(`Missing event ${e} on main thread host.`);return t}throw new Error(`Malformed event name ${e}`)}}),this._protocol.setWorkerId(this._worker.getId());let s=null;const o=globalThis.require;void 0!==o&&"function"==typeof o.getConfig?s=o.getConfig():void 0!==globalThis.requirejs&&(s=globalThis.requirejs.s.contexts._.config);const r=bd(i);this._onModuleLoaded=this._protocol.sendMessage(jE,[this._worker.getId(),JSON.parse(JSON.stringify(s)),t,r]);const a=(e,t)=>this._request(e,t),l=(e,t)=>this._protocol.listen(e,t);this._lazyProxy=new Promise(((e,i)=>{n=i,this._onModuleLoaded.then((t=>{e(nI(t,a,l))}),(e=>{i(e),this._onError("Worker failed to load "+t,e)}))}))}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 tI(e){return"o"===e[0]&&"n"===e[1]&&fo(e.charCodeAt(2))}function iI(e){return/^onDynamic/.test(e)&&fo(e.charCodeAt(9))}function nI(e,t,i){const n=e=>function(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)},s=e=>function(t){return i(e,t)},o={};for(const r of e)iI(r)?o[r]=s(r):tI(r)?o[r]=i(r,void 0):o[r]=n(r);return o}const sI=Fk("defaultWorkerFactory",{createScriptURL:e=>e});class oI{constructor(e,t,i,n,s){this.id=t,this.label=i;const o=function(e){const t=globalThis.MonacoEnvironment;if(t){if("function"==typeof t.getWorker)return t.getWorker("workerMain.js",e);if("function"==typeof t.getWorkerUrl){const i=t.getWorkerUrl("workerMain.js",e);return new Worker(sI?sI.createScriptURL(i):i,{name:e})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}(i);"function"==typeof o.then?this.worker=o:this.worker=Promise.resolve(o),this.postMessage(e,[]),this.worker.then((e=>{e.onmessage=function(e){n(e.data)},e.onmessageerror=s,"function"==typeof e.addEventListener&&e.addEventListener("error",s)}))}getId(){return this.id}postMessage(e,t){var i;null===(i=this.worker)||void 0===i||i.then((i=>{try{i.postMessage(e,t)}catch(n){r(n),r(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:n}))}}))}dispose(){var e;null===(e=this.worker)||void 0===e||e.then((e=>e.terminate())),this.worker=null}}class rI{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){const n=++rI.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new oI(e,n,this._label||"anonymous"+n,t,(e=>{$E(e),this._webWorkerFailedBeforeError=e,i(e)}))}}rI.LAST_WORKER_ID=0;class aI{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 lI{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 aI(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}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 gI{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[n,s,o]=gI._getElements(e),[r,a,l]=gI._getElements(t);this._hasStrings=o&&l,this._originalStringElements=n,this._originalElementsOrHash=s,this._modifiedStringElements=r,this._modifiedElementsOrHash=a,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&"string"==typeof e[0]}static _getElements(e){const t=e.getElements();if(gI._isStringArray(t)){const e=new Int32Array(t.length);for(let i=0,n=t.length;i=e&&n>=i&&this.ElementsAreEqual(t,n);)t--,n--;if(e>t||i>n){let s;return i<=n?(dI.Assert(e===t+1,"originalStart should only be one more than originalEnd"),s=[new aI(e,0,i,n-i+1)]):e<=t?(dI.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),s=[new aI(e,t-e+1,i,0)]):(dI.Assert(e===t+1,"originalStart should only be one more than originalEnd"),dI.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),s=[]),s}const o=[0],r=[0],a=this.ComputeRecursionPoint(e,t,i,n,o,r,s),l=o[0],h=r[0];if(null!==a)return a;if(!s[0]){const o=this.ComputeDiffRecursive(e,l,i,h,s);let r=[];return r=s[0]?[new aI(l+1,t-(l+1)+1,h+1,n-(h+1)+1)]:this.ComputeDiffRecursive(l+1,t,h+1,n,s),this.ConcatenateChanges(o,r)}return[new aI(e,t-e+1,i,n-i+1)]}WALKTRACE(e,t,i,n,s,o,r,a,l,h,d,c,u,g,p,m,f,_){let v=null,b=null,C=new uI,w=t,y=i,S=u[0]-m[0]-n,L=-1073741824,k=this.m_forwardHistory.length-1;do{const t=S+e;t===w||t=0&&(e=(l=this.m_forwardHistory[k])[0],w=1,y=l.length-1)}while(--k>=-1);if(v=C.getReverseChanges(),_[0]){let e=u[0]+1,t=m[0]+1;if(null!==v&&v.length>0){const i=v[v.length-1];e=Math.max(e,i.getOriginalEnd()),t=Math.max(t,i.getModifiedEnd())}b=[new aI(e,c-e+1,t,p-t+1)]}else{C=new uI,w=o,y=r,S=u[0]-m[0]-a,L=1073741824,k=f?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const e=S+s;e===w||e=h[e+1]?(g=(d=h[e+1]-1)-S-a,d>L&&C.MarkNextChange(),L=d+1,C.AddOriginalElement(d+1,g+1),S=e+1-s):(g=(d=h[e-1])-S-a,d>L&&C.MarkNextChange(),L=d,C.AddModifiedElement(d+1,g+1),S=e-1-s),k>=0&&(s=(h=this.m_reverseHistory[k])[0],w=1,y=h.length-1)}while(--k>=-1);b=C.getChanges()}return this.ConcatenateChanges(v,b)}ComputeRecursionPoint(e,t,i,n,s,o,r){let a=0,l=0,h=0,d=0,c=0,u=0;e--,i--,s[0]=0,o[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(n-i),p=g+1,m=new Int32Array(p),f=new Int32Array(p),_=n-i,v=t-e,b=e-i,C=t-n,w=(v-_)%2==0;m[_]=e,f[v]=t,r[0]=!1;for(let y=1;y<=g/2+1;y++){let g=0,S=0;h=this.ClipDiagonalBound(_-y,y,_,p),d=this.ClipDiagonalBound(_+y,y,_,p);for(let e=h;e<=d;e+=2){a=e===h||eg+S&&(g=a,S=l),!w&&Math.abs(e-v)<=y-1&&a>=f[e])return s[0]=a,o[0]=l,i<=f[e]&&y<=1448?this.WALKTRACE(_,h,d,b,v,c,u,C,m,f,a,t,s,l,n,o,w,r):null}const L=(g-e+(S-i)-y)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(g,L))return r[0]=!0,s[0]=g,o[0]=S,L>0&&y<=1448?this.WALKTRACE(_,h,d,b,v,c,u,C,m,f,a,t,s,l,n,o,w,r):(e++,i++,[new aI(e,t-e+1,i,n-i+1)]);c=this.ClipDiagonalBound(v-y,y,v,p),u=this.ClipDiagonalBound(v+y,y,v,p);for(let p=c;p<=u;p+=2){a=p===c||p=f[p+1]?f[p+1]-1:f[p-1],l=a-(p-v)-C;const g=a;for(;a>e&&l>i&&this.ElementsAreEqual(a,l);)a--,l--;if(f[p]=a,w&&Math.abs(p-_)<=y&&a<=m[p])return s[0]=a,o[0]=l,g>=m[p]&&y<=1448?this.WALKTRACE(_,h,d,b,v,c,u,C,m,f,a,t,s,l,n,o,w,r):null}if(y<=1447){let e=new Int32Array(d-h+2);e[0]=_-h+1,cI.Copy2(m,h,e,1,d-h+1),this.m_forwardHistory.push(e),e=new Int32Array(u-c+2),e[0]=v-c+1,cI.Copy2(f,c,e,1,u-c+1),this.m_reverseHistory.push(e)}}return this.WALKTRACE(_,h,d,b,v,c,u,C,m,f,a,t,s,l,n,o,w,r)}PrettifyChanges(e){for(let t=0;t0,r=i.modifiedLength>0;for(;i.originalStart+i.originalLength=0;t--){const i=e[t];let n=0,s=0;if(t>0){const i=e[t-1];n=i.originalStart+i.originalLength,s=i.modifiedStart+i.modifiedLength}const o=i.originalLength>0,r=i.modifiedLength>0;let a=0,l=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let e=1;;e++){const t=i.originalStart-e,h=i.modifiedStart-e;if(tl&&(l=d,a=e)}i.originalStart-=a,i.modifiedStart-=a;const h=[null];t>0&&this.ChangesOverlap(e[t-1],e[t],h)&&(e[t-1]=h[0],e.splice(t,1),t++)}if(this._hasStrings)for(let t=1,i=e.length;t0&&t>a&&(a=t,l=d,h=e)}return a>0?[l,h]:null}_contiguousSequenceScore(e,t,i){let n=0;for(let s=0;s=this._originalElementsOrHash.length-1||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||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){return(this._OriginalRegionIsBoundary(e,t)?1:0)+(this._ModifiedRegionIsBoundary(i,n)?1:0)}ConcatenateChanges(e,t){const i=[];if(0===e.length||0===t.length)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 cI.Copy(e,0,n,0,e.length-1),n[e.length-1]=i[0],cI.Copy(t,1,n,e.length,t.length-1),n}{const i=new Array(e.length+t.length);return cI.Copy(e,0,i,0,e.length),cI.Copy(t,0,i,e.length,t.length),i}}ChangesOverlap(e,t,i){if(dI.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),dI.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 s=e.originalLength;const o=e.modifiedStart;let r=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(s=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(r=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new aI(n,s,o,r),!0}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=Kb(e),t=Kb(t),this.values[e]!==t&&(this.values[e]=t,e-1=i.length)return!1;const s=i.length-e;return t>=s&&(t=s),0!==t&&(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 0===this.values.length?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=Kb(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;0===t&&(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,s=0,o=0;for(;t<=i;)if(n=t+(i-t)/2|0,s=this.prefixSum[n],o=s-this.values[n],e=s))break;t=n+1}return new fI(n,e-o)}}class mI{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(),0===e?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const t=this._indexBySum[e],i=t>0?this._prefixSum[t-1]:0;return new fI(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=jd(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]=i+t;for(let n=0;nt&&(t=o),n>i&&(i=n),r>i&&(i=r)}t++,i++;const n=new vI(i,t,0);for(let s=0,o=e.length;s=this._maxCharCode?0:this._states.get(e,t)}}let CI=null;let wI=null;class yI{static _createLink(e,t,i,n,s){let o=s-1;do{const i=t.charCodeAt(o);if(2!==e.get(i))break;o--}while(o>n);if(n>0){const e=t.charCodeAt(n-1),i=t.charCodeAt(o);(40===e&&41===i||91===e&&93===i||123===e&&125===i)&&o--}return{range:{startLineNumber:i,startColumn:n+1,endLineNumber:i,endColumn:o+2},url:t.substring(n,o+1)}}static computeLinks(e,t=function(){return null===CI&&(CI=new bI([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),CI}()){const i=function(){if(null===wI){wI=new jb(0);const e=" \t<>'\"\u3001\u3002\uff61\uff64\uff0c\uff0e\uff1a\uff1b\u2018\u3008\u300c\u300e\u3014\uff08\uff3b\uff5b\uff62\uff63\uff5d\uff3d\uff09\u3015\u300f\u300d\u3009\u2019\uff40\uff5e\u2026";for(let i=0;i=0?(n+=i?1:-1,n<0?n=e.length-1:n%=e.length,e[n]):null}}var LI,kI,DI,xI,NI,EI,II,MI,TI,RI,AI,OI,PI,FI,BI,WI,VI,HI,zI,UI,KI,jI,qI,$I,GI,ZI,YI,XI,QI,JI,eM,tM,iM,nM,sM,oM,rM,aM,lM;SI.INSTANCE=new SI,function(e){e[e.Unknown=0]="Unknown",e[e.Disabled=1]="Disabled",e[e.Enabled=2]="Enabled"}(LI||(LI={})),function(e){e[e.Invoke=1]="Invoke",e[e.Auto=2]="Auto"}(kI||(kI={})),function(e){e[e.None=0]="None",e[e.KeepWhitespace=1]="KeepWhitespace",e[e.InsertAsSnippet=4]="InsertAsSnippet"}(DI||(DI={})),function(e){e[e.Method=0]="Method",e[e.Function=1]="Function",e[e.Constructor=2]="Constructor",e[e.Field=3]="Field",e[e.Variable=4]="Variable",e[e.Class=5]="Class",e[e.Struct=6]="Struct",e[e.Interface=7]="Interface",e[e.Module=8]="Module",e[e.Property=9]="Property",e[e.Event=10]="Event",e[e.Operator=11]="Operator",e[e.Unit=12]="Unit",e[e.Value=13]="Value",e[e.Constant=14]="Constant",e[e.Enum=15]="Enum",e[e.EnumMember=16]="EnumMember",e[e.Keyword=17]="Keyword",e[e.Text=18]="Text",e[e.Color=19]="Color",e[e.File=20]="File",e[e.Reference=21]="Reference",e[e.Customcolor=22]="Customcolor",e[e.Folder=23]="Folder",e[e.TypeParameter=24]="TypeParameter",e[e.User=25]="User",e[e.Issue=26]="Issue",e[e.Snippet=27]="Snippet"}(xI||(xI={})),function(e){e[e.Deprecated=1]="Deprecated"}(NI||(NI={})),function(e){e[e.Invoke=0]="Invoke",e[e.TriggerCharacter=1]="TriggerCharacter",e[e.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"}(EI||(EI={})),function(e){e[e.EXACT=0]="EXACT",e[e.ABOVE=1]="ABOVE",e[e.BELOW=2]="BELOW"}(II||(II={})),function(e){e[e.NotSet=0]="NotSet",e[e.ContentFlush=1]="ContentFlush",e[e.RecoverFromMarkers=2]="RecoverFromMarkers",e[e.Explicit=3]="Explicit",e[e.Paste=4]="Paste",e[e.Undo=5]="Undo",e[e.Redo=6]="Redo"}(MI||(MI={})),function(e){e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(TI||(TI={})),function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}(RI||(RI={})),function(e){e[e.None=0]="None",e[e.Keep=1]="Keep",e[e.Brackets=2]="Brackets",e[e.Advanced=3]="Advanced",e[e.Full=4]="Full"}(AI||(AI={})),function(e){e[e.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",e[e.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",e[e.accessibilitySupport=2]="accessibilitySupport",e[e.accessibilityPageSize=3]="accessibilityPageSize",e[e.ariaLabel=4]="ariaLabel",e[e.ariaRequired=5]="ariaRequired",e[e.autoClosingBrackets=6]="autoClosingBrackets",e[e.autoClosingComments=7]="autoClosingComments",e[e.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",e[e.autoClosingDelete=9]="autoClosingDelete",e[e.autoClosingOvertype=10]="autoClosingOvertype",e[e.autoClosingQuotes=11]="autoClosingQuotes",e[e.autoIndent=12]="autoIndent",e[e.automaticLayout=13]="automaticLayout",e[e.autoSurround=14]="autoSurround",e[e.bracketPairColorization=15]="bracketPairColorization",e[e.guides=16]="guides",e[e.codeLens=17]="codeLens",e[e.codeLensFontFamily=18]="codeLensFontFamily",e[e.codeLensFontSize=19]="codeLensFontSize",e[e.colorDecorators=20]="colorDecorators",e[e.colorDecoratorsLimit=21]="colorDecoratorsLimit",e[e.columnSelection=22]="columnSelection",e[e.comments=23]="comments",e[e.contextmenu=24]="contextmenu",e[e.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",e[e.cursorBlinking=26]="cursorBlinking",e[e.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",e[e.cursorStyle=28]="cursorStyle",e[e.cursorSurroundingLines=29]="cursorSurroundingLines",e[e.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",e[e.cursorWidth=31]="cursorWidth",e[e.disableLayerHinting=32]="disableLayerHinting",e[e.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",e[e.domReadOnly=34]="domReadOnly",e[e.dragAndDrop=35]="dragAndDrop",e[e.dropIntoEditor=36]="dropIntoEditor",e[e.emptySelectionClipboard=37]="emptySelectionClipboard",e[e.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",e[e.extraEditorClassName=39]="extraEditorClassName",e[e.fastScrollSensitivity=40]="fastScrollSensitivity",e[e.find=41]="find",e[e.fixedOverflowWidgets=42]="fixedOverflowWidgets",e[e.folding=43]="folding",e[e.foldingStrategy=44]="foldingStrategy",e[e.foldingHighlight=45]="foldingHighlight",e[e.foldingImportsByDefault=46]="foldingImportsByDefault",e[e.foldingMaximumRegions=47]="foldingMaximumRegions",e[e.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",e[e.fontFamily=49]="fontFamily",e[e.fontInfo=50]="fontInfo",e[e.fontLigatures=51]="fontLigatures",e[e.fontSize=52]="fontSize",e[e.fontWeight=53]="fontWeight",e[e.fontVariations=54]="fontVariations",e[e.formatOnPaste=55]="formatOnPaste",e[e.formatOnType=56]="formatOnType",e[e.glyphMargin=57]="glyphMargin",e[e.gotoLocation=58]="gotoLocation",e[e.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",e[e.hover=60]="hover",e[e.inDiffEditor=61]="inDiffEditor",e[e.inlineSuggest=62]="inlineSuggest",e[e.letterSpacing=63]="letterSpacing",e[e.lightbulb=64]="lightbulb",e[e.lineDecorationsWidth=65]="lineDecorationsWidth",e[e.lineHeight=66]="lineHeight",e[e.lineNumbers=67]="lineNumbers",e[e.lineNumbersMinChars=68]="lineNumbersMinChars",e[e.linkedEditing=69]="linkedEditing",e[e.links=70]="links",e[e.matchBrackets=71]="matchBrackets",e[e.minimap=72]="minimap",e[e.mouseStyle=73]="mouseStyle",e[e.mouseWheelScrollSensitivity=74]="mouseWheelScrollSensitivity",e[e.mouseWheelZoom=75]="mouseWheelZoom",e[e.multiCursorMergeOverlapping=76]="multiCursorMergeOverlapping",e[e.multiCursorModifier=77]="multiCursorModifier",e[e.multiCursorPaste=78]="multiCursorPaste",e[e.multiCursorLimit=79]="multiCursorLimit",e[e.occurrencesHighlight=80]="occurrencesHighlight",e[e.overviewRulerBorder=81]="overviewRulerBorder",e[e.overviewRulerLanes=82]="overviewRulerLanes",e[e.padding=83]="padding",e[e.pasteAs=84]="pasteAs",e[e.parameterHints=85]="parameterHints",e[e.peekWidgetDefaultFocus=86]="peekWidgetDefaultFocus",e[e.definitionLinkOpensInPeek=87]="definitionLinkOpensInPeek",e[e.quickSuggestions=88]="quickSuggestions",e[e.quickSuggestionsDelay=89]="quickSuggestionsDelay",e[e.readOnly=90]="readOnly",e[e.readOnlyMessage=91]="readOnlyMessage",e[e.renameOnType=92]="renameOnType",e[e.renderControlCharacters=93]="renderControlCharacters",e[e.renderFinalNewline=94]="renderFinalNewline",e[e.renderLineHighlight=95]="renderLineHighlight",e[e.renderLineHighlightOnlyWhenFocus=96]="renderLineHighlightOnlyWhenFocus",e[e.renderValidationDecorations=97]="renderValidationDecorations",e[e.renderWhitespace=98]="renderWhitespace",e[e.revealHorizontalRightPadding=99]="revealHorizontalRightPadding",e[e.roundedSelection=100]="roundedSelection",e[e.rulers=101]="rulers",e[e.scrollbar=102]="scrollbar",e[e.scrollBeyondLastColumn=103]="scrollBeyondLastColumn",e[e.scrollBeyondLastLine=104]="scrollBeyondLastLine",e[e.scrollPredominantAxis=105]="scrollPredominantAxis",e[e.selectionClipboard=106]="selectionClipboard",e[e.selectionHighlight=107]="selectionHighlight",e[e.selectOnLineNumbers=108]="selectOnLineNumbers",e[e.showFoldingControls=109]="showFoldingControls",e[e.showUnused=110]="showUnused",e[e.snippetSuggestions=111]="snippetSuggestions",e[e.smartSelect=112]="smartSelect",e[e.smoothScrolling=113]="smoothScrolling",e[e.stickyScroll=114]="stickyScroll",e[e.stickyTabStops=115]="stickyTabStops",e[e.stopRenderingLineAfter=116]="stopRenderingLineAfter",e[e.suggest=117]="suggest",e[e.suggestFontSize=118]="suggestFontSize",e[e.suggestLineHeight=119]="suggestLineHeight",e[e.suggestOnTriggerCharacters=120]="suggestOnTriggerCharacters",e[e.suggestSelection=121]="suggestSelection",e[e.tabCompletion=122]="tabCompletion",e[e.tabIndex=123]="tabIndex",e[e.unicodeHighlighting=124]="unicodeHighlighting",e[e.unusualLineTerminators=125]="unusualLineTerminators",e[e.useShadowDOM=126]="useShadowDOM",e[e.useTabStops=127]="useTabStops",e[e.wordBreak=128]="wordBreak",e[e.wordSeparators=129]="wordSeparators",e[e.wordWrap=130]="wordWrap",e[e.wordWrapBreakAfterCharacters=131]="wordWrapBreakAfterCharacters",e[e.wordWrapBreakBeforeCharacters=132]="wordWrapBreakBeforeCharacters",e[e.wordWrapColumn=133]="wordWrapColumn",e[e.wordWrapOverride1=134]="wordWrapOverride1",e[e.wordWrapOverride2=135]="wordWrapOverride2",e[e.wrappingIndent=136]="wrappingIndent",e[e.wrappingStrategy=137]="wrappingStrategy",e[e.showDeprecated=138]="showDeprecated",e[e.inlayHints=139]="inlayHints",e[e.editorClassName=140]="editorClassName",e[e.pixelRatio=141]="pixelRatio",e[e.tabFocusMode=142]="tabFocusMode",e[e.layoutInfo=143]="layoutInfo",e[e.wrappingInfo=144]="wrappingInfo",e[e.defaultColorDecorators=145]="defaultColorDecorators",e[e.colorDecoratorsActivatedOn=146]="colorDecoratorsActivatedOn",e[e.inlineCompletionsAccessibilityVerbose=147]="inlineCompletionsAccessibilityVerbose"}(OI||(OI={})),function(e){e[e.TextDefined=0]="TextDefined",e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(PI||(PI={})),function(e){e[e.LF=0]="LF",e[e.CRLF=1]="CRLF"}(FI||(FI={})),function(e){e[e.Left=1]="Left",e[e.Right=2]="Right"}(BI||(BI={})),function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"}(WI||(WI={})),function(e){e[e.Both=0]="Both",e[e.Right=1]="Right",e[e.Left=2]="Left",e[e.None=3]="None"}(VI||(VI={})),function(e){e[e.Type=1]="Type",e[e.Parameter=2]="Parameter"}(HI||(HI={})),function(e){e[e.Automatic=0]="Automatic",e[e.Explicit=1]="Explicit"}(zI||(zI={})),function(e){e[e.DependsOnKbLayout=-1]="DependsOnKbLayout",e[e.Unknown=0]="Unknown",e[e.Backspace=1]="Backspace",e[e.Tab=2]="Tab",e[e.Enter=3]="Enter",e[e.Shift=4]="Shift",e[e.Ctrl=5]="Ctrl",e[e.Alt=6]="Alt",e[e.PauseBreak=7]="PauseBreak",e[e.CapsLock=8]="CapsLock",e[e.Escape=9]="Escape",e[e.Space=10]="Space",e[e.PageUp=11]="PageUp",e[e.PageDown=12]="PageDown",e[e.End=13]="End",e[e.Home=14]="Home",e[e.LeftArrow=15]="LeftArrow",e[e.UpArrow=16]="UpArrow",e[e.RightArrow=17]="RightArrow",e[e.DownArrow=18]="DownArrow",e[e.Insert=19]="Insert",e[e.Delete=20]="Delete",e[e.Digit0=21]="Digit0",e[e.Digit1=22]="Digit1",e[e.Digit2=23]="Digit2",e[e.Digit3=24]="Digit3",e[e.Digit4=25]="Digit4",e[e.Digit5=26]="Digit5",e[e.Digit6=27]="Digit6",e[e.Digit7=28]="Digit7",e[e.Digit8=29]="Digit8",e[e.Digit9=30]="Digit9",e[e.KeyA=31]="KeyA",e[e.KeyB=32]="KeyB",e[e.KeyC=33]="KeyC",e[e.KeyD=34]="KeyD",e[e.KeyE=35]="KeyE",e[e.KeyF=36]="KeyF",e[e.KeyG=37]="KeyG",e[e.KeyH=38]="KeyH",e[e.KeyI=39]="KeyI",e[e.KeyJ=40]="KeyJ",e[e.KeyK=41]="KeyK",e[e.KeyL=42]="KeyL",e[e.KeyM=43]="KeyM",e[e.KeyN=44]="KeyN",e[e.KeyO=45]="KeyO",e[e.KeyP=46]="KeyP",e[e.KeyQ=47]="KeyQ",e[e.KeyR=48]="KeyR",e[e.KeyS=49]="KeyS",e[e.KeyT=50]="KeyT",e[e.KeyU=51]="KeyU",e[e.KeyV=52]="KeyV",e[e.KeyW=53]="KeyW",e[e.KeyX=54]="KeyX",e[e.KeyY=55]="KeyY",e[e.KeyZ=56]="KeyZ",e[e.Meta=57]="Meta",e[e.ContextMenu=58]="ContextMenu",e[e.F1=59]="F1",e[e.F2=60]="F2",e[e.F3=61]="F3",e[e.F4=62]="F4",e[e.F5=63]="F5",e[e.F6=64]="F6",e[e.F7=65]="F7",e[e.F8=66]="F8",e[e.F9=67]="F9",e[e.F10=68]="F10",e[e.F11=69]="F11",e[e.F12=70]="F12",e[e.F13=71]="F13",e[e.F14=72]="F14",e[e.F15=73]="F15",e[e.F16=74]="F16",e[e.F17=75]="F17",e[e.F18=76]="F18",e[e.F19=77]="F19",e[e.F20=78]="F20",e[e.F21=79]="F21",e[e.F22=80]="F22",e[e.F23=81]="F23",e[e.F24=82]="F24",e[e.NumLock=83]="NumLock",e[e.ScrollLock=84]="ScrollLock",e[e.Semicolon=85]="Semicolon",e[e.Equal=86]="Equal",e[e.Comma=87]="Comma",e[e.Minus=88]="Minus",e[e.Period=89]="Period",e[e.Slash=90]="Slash",e[e.Backquote=91]="Backquote",e[e.BracketLeft=92]="BracketLeft",e[e.Backslash=93]="Backslash",e[e.BracketRight=94]="BracketRight",e[e.Quote=95]="Quote",e[e.OEM_8=96]="OEM_8",e[e.IntlBackslash=97]="IntlBackslash",e[e.Numpad0=98]="Numpad0",e[e.Numpad1=99]="Numpad1",e[e.Numpad2=100]="Numpad2",e[e.Numpad3=101]="Numpad3",e[e.Numpad4=102]="Numpad4",e[e.Numpad5=103]="Numpad5",e[e.Numpad6=104]="Numpad6",e[e.Numpad7=105]="Numpad7",e[e.Numpad8=106]="Numpad8",e[e.Numpad9=107]="Numpad9",e[e.NumpadMultiply=108]="NumpadMultiply",e[e.NumpadAdd=109]="NumpadAdd",e[e.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",e[e.NumpadSubtract=111]="NumpadSubtract",e[e.NumpadDecimal=112]="NumpadDecimal",e[e.NumpadDivide=113]="NumpadDivide",e[e.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",e[e.ABNT_C1=115]="ABNT_C1",e[e.ABNT_C2=116]="ABNT_C2",e[e.AudioVolumeMute=117]="AudioVolumeMute",e[e.AudioVolumeUp=118]="AudioVolumeUp",e[e.AudioVolumeDown=119]="AudioVolumeDown",e[e.BrowserSearch=120]="BrowserSearch",e[e.BrowserHome=121]="BrowserHome",e[e.BrowserBack=122]="BrowserBack",e[e.BrowserForward=123]="BrowserForward",e[e.MediaTrackNext=124]="MediaTrackNext",e[e.MediaTrackPrevious=125]="MediaTrackPrevious",e[e.MediaStop=126]="MediaStop",e[e.MediaPlayPause=127]="MediaPlayPause",e[e.LaunchMediaPlayer=128]="LaunchMediaPlayer",e[e.LaunchMail=129]="LaunchMail",e[e.LaunchApp2=130]="LaunchApp2",e[e.Clear=131]="Clear",e[e.MAX_VALUE=132]="MAX_VALUE"}(UI||(UI={})),function(e){e[e.Hint=1]="Hint",e[e.Info=2]="Info",e[e.Warning=4]="Warning",e[e.Error=8]="Error"}(KI||(KI={})),function(e){e[e.Unnecessary=1]="Unnecessary",e[e.Deprecated=2]="Deprecated"}(jI||(jI={})),function(e){e[e.Inline=1]="Inline",e[e.Gutter=2]="Gutter"}(qI||(qI={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.TEXTAREA=1]="TEXTAREA",e[e.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",e[e.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",e[e.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",e[e.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",e[e.CONTENT_TEXT=6]="CONTENT_TEXT",e[e.CONTENT_EMPTY=7]="CONTENT_EMPTY",e[e.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",e[e.CONTENT_WIDGET=9]="CONTENT_WIDGET",e[e.OVERVIEW_RULER=10]="OVERVIEW_RULER",e[e.SCROLLBAR=11]="SCROLLBAR",e[e.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",e[e.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"}($I||($I={})),function(e){e[e.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",e[e.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",e[e.TOP_CENTER=2]="TOP_CENTER"}(GI||(GI={})),function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"}(ZI||(ZI={})),function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.None=2]="None",e[e.LeftOfInjectedText=3]="LeftOfInjectedText",e[e.RightOfInjectedText=4]="RightOfInjectedText"}(YI||(YI={})),function(e){e[e.Off=0]="Off",e[e.On=1]="On",e[e.Relative=2]="Relative",e[e.Interval=3]="Interval",e[e.Custom=4]="Custom"}(XI||(XI={})),function(e){e[e.None=0]="None",e[e.Text=1]="Text",e[e.Blocks=2]="Blocks"}(QI||(QI={})),function(e){e[e.Smooth=0]="Smooth",e[e.Immediate=1]="Immediate"}(JI||(JI={})),function(e){e[e.Auto=1]="Auto",e[e.Hidden=2]="Hidden",e[e.Visible=3]="Visible"}(eM||(eM={})),function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"}(tM||(tM={})),function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(iM||(iM={})),function(e){e[e.File=0]="File",e[e.Module=1]="Module",e[e.Namespace=2]="Namespace",e[e.Package=3]="Package",e[e.Class=4]="Class",e[e.Method=5]="Method",e[e.Property=6]="Property",e[e.Field=7]="Field",e[e.Constructor=8]="Constructor",e[e.Enum=9]="Enum",e[e.Interface=10]="Interface",e[e.Function=11]="Function",e[e.Variable=12]="Variable",e[e.Constant=13]="Constant",e[e.String=14]="String",e[e.Number=15]="Number",e[e.Boolean=16]="Boolean",e[e.Array=17]="Array",e[e.Object=18]="Object",e[e.Key=19]="Key",e[e.Null=20]="Null",e[e.EnumMember=21]="EnumMember",e[e.Struct=22]="Struct",e[e.Event=23]="Event",e[e.Operator=24]="Operator",e[e.TypeParameter=25]="TypeParameter"}(nM||(nM={})),function(e){e[e.Deprecated=1]="Deprecated"}(sM||(sM={})),function(e){e[e.Hidden=0]="Hidden",e[e.Blink=1]="Blink",e[e.Smooth=2]="Smooth",e[e.Phase=3]="Phase",e[e.Expand=4]="Expand",e[e.Solid=5]="Solid"}(oM||(oM={})),function(e){e[e.Line=1]="Line",e[e.Block=2]="Block",e[e.Underline=3]="Underline",e[e.LineThin=4]="LineThin",e[e.BlockOutline=5]="BlockOutline",e[e.UnderlineThin=6]="UnderlineThin"}(rM||(rM={})),function(e){e[e.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",e[e.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",e[e.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",e[e.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"}(aM||(aM={})),function(e){e[e.None=0]="None",e[e.Same=1]="Same",e[e.Indent=2]="Indent",e[e.DeepIndent=3]="DeepIndent"}(lM||(lM={}));class hM{static chord(e,t){return pt(e,t)}}function dM(){return{editor:void 0,languages:void 0,CancellationTokenSource:jh,Emitter:U,KeyCode:UI,KeyMod:hM,Position:Va,Range:Rh,Selection:Ah,SelectionDirection:tM,MarkerSeverity:KI,MarkerTag:jI,Uri:an,Token:bC}}hM.CtrlCmd=2048,hM.Shift=1024,hM.Alt=512,hM.WinCtrl=256;class cM{static computeUnicodeHighlights(e,t,i){const n=i?i.startLineNumber:1,s=i?i.endLineNumber:e.getLineCount(),o=new uM(t),r=o.getCandidateCodePoints();let a;a="allNonBasicAscii"===r?new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):new RegExp(""+`[${eo(Array.from(r).map((e=>String.fromCodePoint(e))).join(""))}]`,"g");const l=new eC(null,a),h=[];let d,c=!1,u=0,g=0,p=0;e:for(let m=n,f=s;m<=f;m++){const t=e.getLineContent(m),i=t.length;l.reset(0);do{if(d=l.next(t),d){let e=d.index,n=d.index+d[0].length;if(e>0){wo(t.charCodeAt(e-1))&&e--}if(n+1=t){c=!0;break e}h.push(new Rh(m,e+1,m,n+1))}}}while(d)}return{ranges:h,hasMore:c,ambiguousCharacterCount:u,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:p}}static computeUnicodeHighlightReason(e,t){const i=new uM(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const n=e.codePointAt(0),s=i.ambiguousCharacters.getPrimaryConfusable(n),o=Ko.getLocales().filter((e=>!Ko.getInstance(new Set([...t.allowedLocales,e])).isAmbiguous(n)));return{kind:0,confusableWith:String.fromCodePoint(s),notAmbiguousInLocales:o}}case 1:return{kind:2}}}}class uM{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=Ko.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of jo.codePoints)gM(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 0;if(this.options.nonBasicASCII)return 1;let n=!1,s=!1;if(t)for(const o of t){const e=o.codePointAt(0),t=To(o);n=n||t,t||this.ambiguousCharacters.isAmbiguous(e)||jo.isInvisibleCharacter(e)||(s=!0)}return!n&&s?0:this.options.invisibleCharacters&&!gM(e)&&jo.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}}function gM(e){return" "===e||"\n"===e||"\t"===e}class pM{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class mM{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class fM{static inverse(e,t,i){const n=[];let s=1,o=1;for(const a of e){const e=new _M(new wc(s,a.original.startLineNumber),new wc(o,a.modified.startLineNumber),void 0);e.modified.isEmpty||n.push(e),s=a.original.endLineNumberExclusive,o=a.modified.endLineNumberExclusive}const r=new _M(new wc(s,t+1),new wc(o,i+1),void 0);return r.modified.isEmpty||n.push(r),n}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new fM(this.modified,this.original)}join(e){return new fM(this.original.join(e.original),this.modified.join(e.modified))}}class _M extends fM{constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){var e;return new _M(this.modified,this.original,null===(e=this.innerChanges)||void 0===e?void 0:e.map((e=>e.flip())))}}class vM{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new vM(this.modifiedRange,this.originalRange)}}class bM{computeDiff(e,t,i){var n;const s=new kM(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),o=[];let r=null;for(const a of s.changes){let e,t;e=0===a.originalEndLineNumber?new wc(a.originalStartLineNumber+1,a.originalStartLineNumber+1):new wc(a.originalStartLineNumber,a.originalEndLineNumber+1),t=0===a.modifiedEndLineNumber?new wc(a.modifiedStartLineNumber+1,a.modifiedStartLineNumber+1):new wc(a.modifiedStartLineNumber,a.modifiedEndLineNumber+1);let i=new _M(e,t,null===(n=a.charChanges)||void 0===n?void 0:n.map((e=>new vM(new Rh(e.originalStartLineNumber,e.originalStartColumn,e.originalEndLineNumber,e.originalEndColumn),new Rh(e.modifiedStartLineNumber,e.modifiedStartColumn,e.modifiedEndLineNumber,e.modifiedEndColumn)))));r&&(r.modified.endLineNumberExclusive!==i.modified.startLineNumber&&r.original.endLineNumberExclusive!==i.original.startLineNumber||(i=new _M(r.original.join(i.original),r.modified.join(i.modified),r.innerChanges&&i.innerChanges?r.innerChanges.concat(i.innerChanges):void 0),o.pop())),o.push(i),r=i}return Ul((()=>Kl(o,((e,t)=>t.original.startLineNumber-e.original.endLineNumberExclusive==t.modified.startLineNumber-e.modified.endLineNumberExclusive&&e.original.endLineNumberExclusive(10===e?"\\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-1===e?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),10===this._charCodes[e]?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-1===e?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),10===this._charCodes[e]?1:this._columns[e]+1)}}class SM{constructor(e,t,i,n,s,o,r,a){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=n,this.modifiedStartLineNumber=s,this.modifiedStartColumn=o,this.modifiedEndLineNumber=r,this.modifiedEndColumn=a}static createFromDiffChange(e,t,i){const n=t.getStartLineNumber(e.originalStart),s=t.getStartColumn(e.originalStart),o=t.getEndLineNumber(e.originalStart+e.originalLength-1),r=t.getEndColumn(e.originalStart+e.originalLength-1),a=i.getStartLineNumber(e.modifiedStart),l=i.getStartColumn(e.modifiedStart),h=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),d=i.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new SM(n,s,o,r,a,l,h,d)}}class LM{constructor(e,t,i,n,s){this.originalStartLineNumber=e,this.originalEndLineNumber=t,this.modifiedStartLineNumber=i,this.modifiedEndLineNumber=n,this.charChanges=s}static createFromDiffResult(e,t,i,n,s,o,r){let a,l,h,d,c;if(0===t.originalLength?(a=i.getStartLineNumber(t.originalStart)-1,l=0):(a=i.getStartLineNumber(t.originalStart),l=i.getEndLineNumber(t.originalStart+t.originalLength-1)),0===t.modifiedLength?(h=n.getStartLineNumber(t.modifiedStart)-1,d=0):(h=n.getStartLineNumber(t.modifiedStart),d=n.getEndLineNumber(t.modifiedStart+t.modifiedLength-1)),o&&t.originalLength>0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&s()){const o=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),a=n.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(o.getElements().length>0&&a.getElements().length>0){let e=CM(o,a,s,!0).changes;r&&(e=function(e){if(e.length<=1)return e;const t=[e[0]];let i=t[0];for(let n=1,s=e.length;n1&&r>1;){if(e.charCodeAt(i-2)!==t.charCodeAt(r-2))break;i--,r--}(i>1||r>1)&&this._pushTrimWhitespaceCharChange(n,s+1,1,i,o+1,1,r)}{let i=xM(e,1),r=xM(t,1);const a=e.length+1,l=t.length+1;for(;i!0;const t=Date.now();return()=>Date.now()-t{i.push(IM.fromOffsetPairs(e?e.getEndExclusives():MM.zero,n?n.getStarts():new MM(t,(e?e.seq2Range.endExclusive-e.seq1Range.endExclusive:0)+t)))})),i}static fromOffsetPairs(e,t){return new IM(new uc(e.offset1,t.offset1),new uc(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new IM(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new IM(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return 0===e?this:new IM(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return 0===e?this:new IM(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return 0===e?this:new IM(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),i=this.seq2Range.intersect(e.seq2Range);if(t&&i)return new IM(t,i)}getStarts(){return new MM(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new MM(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class MM{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}}MM.zero=new MM(0,0),MM.max=new MM(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);class TM{isValid(){return!0}}TM.instance=new TM;class RM{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new f("timeout must be positive")}isValid(){return!(Date.now()-this.startTime0&&a>0&&3===o.get(g-1,a-1)&&(d+=r.get(g-1,a-1)),d+=n?n(g,a):1):d=-1;const c=Math.max(l,h,d);if(c===d){const e=g>0&&a>0?r.get(g-1,a-1):0;r.set(g,a,e+1),o.set(g,a,3)}else c===l?(r.set(g,a,0),o.set(g,a,1)):c===h&&(r.set(g,a,0),o.set(g,a,2));s.set(g,a,c)}const a=[];let l=e.length,h=t.length;function d(e,t){e+1===l&&t+1===h||a.push(new IM(new uc(e+1,l),new uc(t+1,h))),l=e,h=t}let c=e.length-1,u=t.length-1;for(;c>=0&&u>=0;)3===o.get(c,u)?(d(c,u),c--,u--):1===o.get(c,u)?c--:u--;return d(-1,-1),a.reverse(),new EM(a,!1)}}class BM{compute(e,t,i=TM.instance){if(0===e.length||0===t.length)return EM.trivial(e,t);const n=e,s=t;function o(e,t){for(;en.length||u>s.length)continue;const g=o(c,u);a.set(h,g);const p=c===r?l.get(h+1):l.get(h-1);if(l.set(h,g!==c?new WM(p,c,u,g-c):p),a.get(h)===n.length&&a.get(h)-h===s.length)break e}}let d=l.get(h);const c=[];let u=n.length,g=s.length;for(;;){const e=d?d.x+d.length:0,t=d?d.y+d.length:0;if(e===u&&t===g||c.push(new IM(new uc(e,u),new uc(t,g))),!d)break;u=d.x,g=d.y,d=d.prev}return c.reverse(),new EM(c,!1)}}class WM{constructor(e,t,i,n){this.prev=e,this.x=t,this.y=i,this.length=n}}class VM{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)>=this.negativeArr.length){const e=this.negativeArr;this.negativeArr=new Int32Array(2*e.length),this.negativeArr.set(e)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const e=this.positiveArr;this.positiveArr=new Int32Array(2*e.length),this.positiveArr.set(e)}this.positiveArr[e]=t}}}class HM{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 zM{constructor(e,t,i){this.lines=e,this.considerWhitespaceChanges=i,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let n=!1;t.start>0&&t.endExclusive>=e.length&&(t=new uc(t.start-1,t.endExclusive),n=!0),this.lineRange=t,this.firstCharOffsetByLine[0]=0;for(let s=this.lineRange.start;sString.fromCharCode(e))).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=qM(e>0?this.elements[e-1]:-1),i=qM(et<=e));return new Va(this.lineRange.start+t+1,e-this.firstCharOffsetByLine[t]+this.additionalOffsetByLine[t]+1)}translateRange(e){return Rh.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length)return;if(!UM(this.elements[e]))return;let t=e;for(;t>0&&UM(this.elements[t-1]);)t--;let i=e;for(;it<=e.start)))&&void 0!==t?t:0,s=null!==(i=function(e,t){const i=_c(e,t);return i===e.length?void 0:e[i]}(this.firstCharOffsetByLine,(t=>e.endExclusive<=t)))&&void 0!==i?i:this.elements.length;return new uc(n,s)}}function UM(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57}const KM={0:0,1:0,2:0,3:10,4:2,5:3,6:10,7:10};function jM(e){return KM[e]}function qM(e){return 10===e?7:13===e?6:OM(e)?5:e>=97&&e<=122?0:e>=65&&e<=90?1:e>=48&&e<=57?2:-1===e?3:4}function $M(e,t,i,n,s,o){let{moves:r,excludedChanges:a}=function(e,t,i,n){const s=[],o=e.filter((e=>e.modified.isEmpty&&e.original.length>=3)).map((e=>new PM(e.original,t,e))),r=new Set(e.filter((e=>e.original.isEmpty&&e.modified.length>=3)).map((e=>new PM(e.modified,i,e)))),a=new Set;for(const l of o){let e,t=-1;for(const i of r){const n=l.computeSimilarity(i);n>t&&(t=n,e=i)}if(t>.9&&e&&(r.delete(e),s.push(new fM(l.range,e.range)),a.add(l.source),a.add(e.source)),!n.isValid())return{moves:s,excludedChanges:a}}return{moves:s,excludedChanges:a}}(e,t,i,o);if(!o.isValid())return[];const l=function(e,t,i,n,s,o){const r=[],a=new $s;for(const u of e)for(let e=u.original.startLineNumber;ee.modified.startLineNumber),Jd));for(const u of e){let e=[];for(let t=u.modified.startLineNumber;t{for(const n of e)if(n.originalLineRange.endLineNumberExclusive+1===t.endLineNumberExclusive&&n.modifiedLineRange.endLineNumberExclusive+1===s.endLineNumberExclusive)return n.originalLineRange=new wc(n.originalLineRange.startLineNumber,t.endLineNumberExclusive),n.modifiedLineRange=new wc(n.modifiedLineRange.startLineNumber,s.endLineNumberExclusive),void o.push(n);const i={modifiedLineRange:s,originalLineRange:t};l.push(i),o.push(i)})),e=o}if(!o.isValid())return[]}l.sort(tc(Qd((e=>e.modifiedLineRange.length),Jd)));const h=new yc,d=new yc;for(const u of l){const e=u.modifiedLineRange.startLineNumber-u.originalLineRange.startLineNumber,t=h.subtractFrom(u.modifiedLineRange),i=d.subtractFrom(u.originalLineRange).getWithDelta(e),n=t.getIntersection(i);for(const s of n.ranges){if(s.length<3)continue;const t=s,i=s.delta(-e);r.push(new fM(i,t)),h.addRange(t),d.addRange(i)}}r.sort(Qd((e=>e.original.startLineNumber),Jd));const c=new vc(e);for(let u=0;ue.original.startLineNumber<=t.original.startLineNumber)),a=mc(e,(e=>e.modified.startLineNumber<=t.modified.startLineNumber)),l=Math.max(t.original.startLineNumber-i.original.startLineNumber,t.modified.startLineNumber-a.modified.startLineNumber),g=c.findLastMonotonous((e=>e.original.startLineNumbere.modified.startLineNumbern.length||i>s.length)break;if(h.contains(i)||d.contains(e))break;if(!GM(n[e-1],s[i-1],o))break}for(f>0&&(d.addRange(new wc(t.original.startLineNumber-f,t.original.startLineNumber)),h.addRange(new wc(t.modified.startLineNumber-f,t.modified.startLineNumber))),_=0;_n.length||i>s.length)break;if(h.contains(i)||d.contains(e))break;if(!GM(n[e-1],s[i-1],o))break}_>0&&(d.addRange(new wc(t.original.endLineNumberExclusive,t.original.endLineNumberExclusive+_)),h.addRange(new wc(t.modified.endLineNumberExclusive,t.modified.endLineNumberExclusive+_))),(f>0||_>0)&&(r[u]=new fM(new wc(t.original.startLineNumber-f,t.original.endLineNumberExclusive+_),new wc(t.modified.startLineNumber-f,t.modified.endLineNumberExclusive+_)))}return r}(e.filter((e=>!a.has(e))),n,s,t,i,o);return Gd(r,l),r=function(e){if(0===e.length)return e;e.sort(Qd((e=>e.original.startLineNumber),Jd));const t=[e[0]];for(let i=1;i=0&&r>=0&&o+r<=2?t[t.length-1]=n.join(s):t.push(s)}return t}(r),r=r.filter((e=>e.original.toOffsetRange().slice(t).map((e=>e.trim())).join("\n").length>=10)),r=function(e,t){const i=new vc(e);return t=t.filter((t=>(i.findLastMonotonous((e=>e.original.endLineNumberExclusivee.modified.endLineNumberExclusive300&&t.length>300)return!1;const n=(new BM).compute(new zM([e],new uc(0,1),!1),new zM([t],new uc(0,1),!1),i);let s=0;const o=IM.invert(n.diffs,e.length);for(const a of o)a.seq1Range.forEach((t=>{OM(e.charCodeAt(t))||s++}));const r=function(t){let i=0;for(let n=0;nt.length?e:t);return s/r>.6&&r>10}function ZM(e,t,i){let n=i;return n=function(e,t,i){if(0===i.length)return i;const n=[];n.push(i[0]);for(let o=1;o0&&(r=r.delta(a))}s.push(r)}n.length>0&&s.push(n[n.length-1]);return s}(e,t,n),n=function(e,t,i){if(!e.getBoundaryScore||!t.getBoundaryScore)return i;for(let n=0;n0?i[n-1]:void 0,o=i[n],r=n+1=n.start&&e.seq2Range.start-o>=s.start&&i.isStronglyEqual(e.seq2Range.start-o,e.seq2Range.endExclusive-o)&&o<100;)o++;o--;let r=0;for(;e.seq1Range.start+rl&&(l=r,a=h)}return e.delta(a)}class XM{constructor(e,t){this.trimmedHash=e,this.lines=t}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){return 1e3-((0===e?0:QM(this.lines[e-1]))+(e===this.lines.length?0:QM(this.lines[e])))}getText(e){return this.lines.slice(e.start,e.endExclusive).join("\n")}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function QM(e){let t=0;for(;te===t)))return new pM([],[],!1);if(1===e.length&&0===e[0].length||1===t.length&&0===t[0].length)return new pM([new _M(new wc(1,e.length+1),new wc(1,t.length+1),[new vM(new Rh(1,1,e.length,e[0].length+1),new Rh(1,1,t.length,t[0].length+1))])],[],!1);const n=0===i.maxComputationTimeMs?TM.instance:new RM(i.maxComputationTimeMs),s=!i.ignoreTrimWhitespace,o=new Map;function r(e){let t=o.get(e);return void 0===t&&(t=o.size,o.set(e,t)),t}const a=e.map((e=>r(e.trim()))),l=t.map((e=>r(e.trim()))),h=new XM(a,e),d=new XM(l,t),c=(()=>h.length+d.length<1700?this.dynamicProgrammingDiffing.compute(h,d,n,((i,n)=>e[i]===t[n]?0===t[n].length?.1:1+Math.log(1+t[n].length):.99)):this.myersDiffingAlgorithm.compute(h,d))();let u=c.diffs,g=c.hitTimeout;u=ZM(h,d,u),u=function(e,t,i){let n=i;if(0===n.length)return n;let s,o=0;do{s=!1;const r=[n[0]];for(let a=1;a5||i.seq1Range.length+i.seq2Range.length>5)}d(h,l)?(s=!0,r[r.length-1]=r[r.length-1].join(l)):r.push(l)}n=r}while(o++<10&&s);return n}(h,0,u);const p=[],m=i=>{if(s)for(let o=0;oC.seq1Range.start-f==C.seq2Range.start-_));m(C.seq1Range.start-f),f=C.seq1Range.endExclusive,_=C.seq2Range.endExclusive;const i=this.refineDiff(e,t,C,n,s);i.hitTimeout&&(g=!0);for(const e of i.mappings)p.push(e)}m(e.length-f);const v=eT(p,e,t);let b=[];return i.computeMoves&&(b=this.computeMoves(v,e,t,a,l,n,s)),Ul((()=>{function i(e,t){if(e.lineNumber<1||e.lineNumber>t.length)return!1;const i=t[e.lineNumber-1];return!(e.column<1||e.column>i.length+1)}function n(e,t){return!(e.startLineNumber<1||e.startLineNumber>t.length+1)&&!(e.endLineNumberExclusive<1||e.endLineNumberExclusive>t.length+1)}for(const s of v){if(!s.innerChanges)return!1;for(const n of s.innerChanges){if(!(i(n.modifiedRange.getStartPosition(),t)&&i(n.modifiedRange.getEndPosition(),t)&&i(n.originalRange.getStartPosition(),e)&&i(n.originalRange.getEndPosition(),e)))return!1}if(!n(s.modified,t)||!n(s.original,e))return!1}return!0})),new pM(v,b,g)}computeMoves(e,t,i,n,s,o,r){return $M(e,t,i,n,s,o).map((e=>{const n=eT(this.refineDiff(t,i,new IM(e.original.toOffsetRange(),e.modified.toOffsetRange()),o,r).mappings,t,i,!0);return new mM(e,n)}))}refineDiff(e,t,i,n,s){const o=new zM(e,i.seq1Range,s),r=new zM(t,i.seq2Range,s),a=o.length+r.length<500?this.dynamicProgrammingDiffing.compute(o,r,n):this.myersDiffingAlgorithm.compute(o,r,n);let l=a.diffs;l=ZM(o,r,l),l=function(e,t,i){const n=[];let s;function o(){if(!s)return;const e=s.s1Range.length-s.deleted;s.s2Range.length,s.added,Math.max(s.deleted,s.added)+(s.count-1)>e&&n.push(new IM(s.s1Range,s.s2Range)),s=void 0}for(const r of i){function a(e,t){var i,n,a,l;if(!s||!s.s1Range.containsRange(e)||!s.s2Range.containsRange(t))if(!s||s.s1Range.endExclusive0||t.length>0;){const n=e[0],s=t[0];let o;o=n&&(!s||n.seq1Range.start0&&i[i.length-1].seq1Range.endExclusive>=o.seq1Range.start?i[i.length-1]=i[i.length-1].join(o):i.push(o)}return i}(i,n)}(o,r,l),l=function(e,t,i){const n=[];for(const s of i){const e=n[n.length-1];e&&(s.seq1Range.start-e.seq1Range.endExclusive<=2||s.seq2Range.start-e.seq2Range.endExclusive<=2)?n[n.length-1]=new IM(e.seq1Range.join(s.seq1Range),e.seq2Range.join(s.seq2Range)):n.push(s)}return n}(0,0,l),l=function(e,t,i){let n=i;if(0===n.length)return n;let s,o=0;do{s=!1;const a=[n[0]];for(let l=1;l5||s.length>500)return!1;const o=e.getText(s).trim();if(o.length>20||o.split(/\r\n|\r|\n/).length>1)return!1;const r=e.countLinesIn(i.seq1Range),a=i.seq1Range.length,l=t.countLinesIn(i.seq2Range),c=i.seq2Range.length,u=e.countLinesIn(n.seq1Range),g=n.seq1Range.length,p=t.countLinesIn(n.seq2Range),m=n.seq2Range.length;function f(e){return Math.min(e,130)}return Math.pow(Math.pow(f(40*r+a),1.5)+Math.pow(f(40*l+c),1.5),1.5)+Math.pow(Math.pow(f(40*u+g),1.5)+Math.pow(f(40*p+m),1.5),1.5)>1.3*Math.pow(Math.pow(130,1.5),1.5)}c(d,h)?(s=!0,a[a.length-1]=a[a.length-1].join(h)):a.push(h)}n=a}while(o++<10&&s);const r=[];return function(e,t){for(let i=0;i{let s=i;function o(e){return e.length>0&&e.trim().length<=3&&i.seq1Range.length+i.seq2Range.length>100}const a=e.extendToFullLines(i.seq1Range),l=e.getText(new uc(a.start,i.seq1Range.start));o(l)&&(s=s.deltaStart(-l.length));const h=e.getText(new uc(i.seq1Range.endExclusive,a.endExclusive));o(h)&&(s=s.deltaEnd(h.length));const d=IM.fromOffsetPairs(t?t.getEndExclusives():MM.zero,n?n.getStarts():MM.max),c=s.intersect(d);r.push(c)})),r}(o,r,l);return{mappings:l.map((e=>new vM(o.translateRange(e.seq1Range),r.translateRange(e.seq2Range)))),hitTimeout:a.hitTimeout}}}function eT(e,t,i,n=!1){const s=[];for(const o of Pd(e.map((e=>function(e,t,i){let n=0,s=0;1===e.modifiedRange.endColumn&&1===e.originalRange.endColumn&&e.originalRange.startLineNumber+n<=e.originalRange.endLineNumber&&e.modifiedRange.startLineNumber+n<=e.modifiedRange.endLineNumber&&(s=-1);e.modifiedRange.startColumn-1>=i[e.modifiedRange.startLineNumber-1].length&&e.originalRange.startColumn-1>=t[e.originalRange.startLineNumber-1].length&&e.originalRange.startLineNumber<=e.originalRange.endLineNumber+s&&e.modifiedRange.startLineNumber<=e.modifiedRange.endLineNumber+s&&(n=1);const o=new wc(e.originalRange.startLineNumber+n,e.originalRange.endLineNumber+1+s),r=new wc(e.modifiedRange.startLineNumber+n,e.modifiedRange.endLineNumber+1+s);return new _M(o,r,[e])}(e,t,i))),((e,t)=>e.original.overlapOrTouch(t.original)||e.modified.overlapOrTouch(t.modified)))){const e=o[0],t=o[o.length-1];s.push(new _M(e.original.join(t.original),e.modified.join(t.modified),o.map((e=>e.innerChanges[0]))))}return Ul((()=>!(!n&&s.length>0&&s[0].original.startLineNumber!==s[0].modified.startLineNumber)&&Kl(s,((e,t)=>t.original.startLineNumber-e.original.endLineNumberExclusive==t.modified.startLineNumber-e.modified.endLineNumberExclusive&&e.original.endLineNumberExclusivenew bM,iT=()=>new JM;function nT(e){const t=[];for(const i of e){const e=Number(i);(e||0===e&&""!==i.replace(/\s/g,""))&&t.push(e)}return t}function sT(e,t,i,n){return{red:e/255,blue:i/255,green:t/255,alpha:n}}function oT(e,t){const i=t.index,n=t[0].length;if(!i)return;const s=e.positionAt(i);return{startLineNumber:s.lineNumber,startColumn:s.column,endLineNumber:s.lineNumber,endColumn:s.column+n}}function rT(e,t){if(!e)return;const i=lc.Format.CSS.parseHex(t);return i?{range:e,color:sT(i.rgba.r,i.rgba.g,i.rgba.b,i.rgba.a)}:void 0}function aT(e,t,i){if(!e||1!==t.length)return;const n=nT(t[0].values());return{range:e,color:sT(n[0],n[1],n[2],i?n[3]:1)}}function lT(e,t,i){if(!e||1!==t.length)return;const n=nT(t[0].values()),s=new lc(new rc(n[0],n[1]/100,n[2]/100,i?n[3]:1));return{range:e,color:sT(s.rgba.r,s.rgba.g,s.rgba.b,s.rgba.a)}}function hT(e,t){return"string"==typeof e?[...e.matchAll(t)]:e.findMatches(t)}function dT(e){return e&&"function"==typeof e.getValue&&"function"==typeof e.positionAt?function(e){const t=[],i=hT(e,/\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 i=n.filter((e=>void 0!==e)),s=i[1],o=i[2];if(!o)continue;let r;if("rgb"===s){const t=/^\(\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;r=aT(oT(e,n),hT(o,t),!1)}else if("rgba"===s){const t=/^\(\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;r=aT(oT(e,n),hT(o,t),!0)}else if("hsl"===s){const t=/^\(\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;r=lT(oT(e,n),hT(o,t),!1)}else if("hsla"===s){const t=/^\(\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;r=lT(oT(e,n),hT(o,t),!0)}else"#"===s&&(r=rT(oT(e,n),s+o));r&&t.push(r)}return t}(e):[]}var cT=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class uT extends _I{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 e=this._lines[t-1].length+1;i<1?(i=1,n=!0):i>e&&(i=e,n=!0)}return n?{lineNumber:t,column:i}:e}}class gT{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 uT(an.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]}computeUnicodeHighlights(e,t,i){return cT(this,void 0,void 0,(function*(){const n=this._getModel(e);return n?cM.computeUnicodeHighlights(n,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}))}computeDiff(e,t,i,n){return cT(this,void 0,void 0,(function*(){const s=this._getModel(e),o=this._getModel(t);return s&&o?gT.computeDiff(s,o,i,n):null}))}static computeDiff(e,t,i,n){const s="advanced"===n?iT():tT(),o=e.getLinesContent(),r=t.getLinesContent(),a=s.computeDiff(o,r,i);function l(e){return e.map((e=>{var t;return[e.original.startLineNumber,e.original.endLineNumberExclusive,e.modified.startLineNumber,e.modified.endLineNumberExclusive,null===(t=e.innerChanges)||void 0===t?void 0:t.map((e=>[e.originalRange.startLineNumber,e.originalRange.startColumn,e.originalRange.endLineNumber,e.originalRange.endColumn,e.modifiedRange.startLineNumber,e.modifiedRange.startColumn,e.modifiedRange.endLineNumber,e.modifiedRange.endColumn]))]}))}return{identical:!(a.changes.length>0)&&this._modelsAreIdentical(e,t),quitEarly:a.hitTimeout,changes:l(a.changes),moves:a.moves.map((e=>[e.lineRangeMapping.original.startLineNumber,e.lineRangeMapping.original.endLineNumberExclusive,e.lineRangeMapping.modified.startLineNumber,e.lineRangeMapping.modified.endLineNumberExclusive,l(e.changes)]))}}static _modelsAreIdentical(e,t){const i=e.getLineCount();if(i!==t.getLineCount())return!1;for(let n=1;n<=i;n++){if(e.getLineContent(n)!==t.getLineContent(n))return!1}return!0}computeMoreMinimalEdits(e,t,i){return cT(this,void 0,void 0,(function*(){const n=this._getModel(e);if(!n)return t;const s=[];let o;t=t.slice(0).sort(((e,t)=>{if(e.range&&t.range)return Rh.compareRangesUsingStarts(e.range,t.range);return(e.range?0:1)-(t.range?0:1)}));let r=0;for(let e=1;egT._diffLimit){s.push({range:e,text:a});continue}const r=hI(t,a,i),h=n.offsetAt(Rh.lift(e).getStartPosition());for(const e of r){const t=n.positionAt(h+e.originalStart),i=n.positionAt(h+e.originalStart+e.originalLength),o={text:a.substr(e.modifiedStart,e.modifiedLength),range:{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:i.lineNumber,endColumn:i.column}};n.getValueInRange(o.range)!==o.text&&s.push(o)}}return"number"==typeof o&&s.push({eol:o,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),s}))}computeLinks(e){return cT(this,void 0,void 0,(function*(){const t=this._getModel(e);return t?function(e){return e&&"function"==typeof e.getLineCount&&"function"==typeof e.getLineContent?yI.computeLinks(e):[]}(t):null}))}computeDefaultDocumentColors(e){return cT(this,void 0,void 0,(function*(){const t=this._getModel(e);return t?dT(t):null}))}textualSuggest(e,t,i,n){return cT(this,void 0,void 0,(function*(){const s=new F,o=new RegExp(i,n),r=new Set;e:for(const i of e){const e=this._getModel(i);if(e)for(const i of e.words(o))if(i!==t&&isNaN(Number(i))&&(r.add(i),r.size>gT._suggestionsLimit))break e}return{words:Array.from(r),duration:s.elapsed()}}))}computeWordRanges(e,t,i,n){return cT(this,void 0,void 0,(function*(){const s=this._getModel(e);if(!s)return Object.create(null);const o=new RegExp(i,n),r=Object.create(null);for(let e=t.startLineNumber;efunction(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)},n={};for(const s of e)n[s]=i(s);return n}(i,((e,t)=>this._host.fhr(e,t))),s={host:n,getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(s,t),Promise.resolve(bd(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||"function"!=typeof this._foreignModule[e])return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(Mre){return Promise.reject(Mre)}}}gT._diffLimit=1e5,gT._suggestionsLimit=1e4,"function"==typeof importScripts&&(globalThis.monaco=dM());const pT=Ba("textResourceConfigurationService"),mT=Ba("textResourcePropertiesService");var fT=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},_T=function(e,t){return function(i,n){t(i,n,e)}},vT=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const bT=3e5;function CT(e,t){const i=e.getModel(t);return!!i&&!i.isTooLargeForSyncing()}let wT=class extends E{constructor(e,t,i,n,s){super(),this._modelService=e,this._workerManager=this._register(new ST(this._modelService,n)),this._logService=i,this._register(s.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(e,t)=>CT(this._modelService,e.uri)?this._workerManager.withWorker().then((t=>t.computeLinks(e.uri))).then((e=>e&&{links:e})):Promise.resolve({links:[]})})),this._register(s.completionProvider.register("*",new yT(this._workerManager,t,this._modelService,n)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return CT(this._modelService,e)}computedUnicodeHighlights(e,t,i){return this._workerManager.withWorker().then((n=>n.computedUnicodeHighlights(e,t,i)))}computeDiff(e,t,i,n){return vT(this,void 0,void 0,(function*(){const s=yield this._workerManager.withWorker().then((s=>s.computeDiff(e,t,i,n)));if(!s)return null;return{identical:s.identical,quitEarly:s.quitEarly,changes:o(s.changes),moves:s.moves.map((e=>new mM(new fM(new wc(e[0],e[1]),new wc(e[2],e[3])),o(e[4]))))};function o(e){return e.map((e=>{var t;return new _M(new wc(e[0],e[1]),new wc(e[2],e[3]),null===(t=e[4])||void 0===t?void 0:t.map((e=>new vM(new Rh(e[0],e[1],e[2],e[3]),new Rh(e[4],e[5],e[6],e[7])))))}))}}))}computeMoreMinimalEdits(e,t,i=!1){if(Hd(t)){if(!CT(this._modelService,e))return Promise.resolve(t);const n=F.create(),s=this._workerManager.withWorker().then((n=>n.computeMoreMinimalEdits(e,t,i)));return s.finally((()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),n.elapsed()))),Promise.race([s,td(1e3).then((()=>t))])}return Promise.resolve(void 0)}canNavigateValueSet(e){return CT(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then((n=>n.navigateValueSet(e,t,i)))}canComputeWordRanges(e){return CT(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then((i=>i.computeWordRanges(e,t)))}};wT=fT([_T(0,Ha),_T(1,pT),_T(2,hh),_T(3,Ju),_T(4,oL)],wT);class yT{constructor(e,t,i,n){this.languageConfigurationService=n,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}provideCompletionItems(e,t){return vT(this,void 0,void 0,(function*(){const i=this._configurationService.getValue(e.uri,t,"editor");if(!i.wordBasedSuggestions)return;const n=[];if("currentDocument"===i.wordBasedSuggestionsMode)CT(this._modelService,e.uri)&&n.push(e.uri);else for(const t of this._modelService.getModels())CT(this._modelService,t.uri)&&(t===e?n.unshift(t.uri):"allDocuments"!==i.wordBasedSuggestionsMode&&t.getLanguageId()!==e.getLanguageId()||n.push(t.uri));if(0===n.length)return;const s=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),o=e.getWordAtPosition(t),r=o?new Rh(t.lineNumber,o.startColumn,t.lineNumber,o.endColumn):Rh.fromPositions(t),a=r.setEndPosition(t.lineNumber,t.column),l=yield this._workerManager.withWorker(),h=yield l.textualSuggest(n,null==o?void 0:o.word,s);return h?{duration:h.duration,suggestions:h.words.map((e=>({kind:18,label:e,insertText:e,range:{insert:a,replace:r}})))}:void 0}))}}class ST extends E{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=(new Date).getTime();this._register(new od).cancelAndSet((()=>this._checkStopIdleWorker()),Math.round(15e4)),this._register(this._modelService.onModelRemoved((e=>this._checkStopEmptyWorker())))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;0===this._modelService.getModels().length&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;(new Date).getTime()-this._lastWorkerUsedTime>bT&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=(new Date).getTime(),this._editorWorkerClient||(this._editorWorkerClient=new xT(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class LT extends E{constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){const e=new od;e.cancelAndSet((()=>this._checkStopModelSync()),Math.round(3e4)),this._register(e)}}dispose(){for(const e in this._syncedModels)k(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const i of e){const e=i.toString();this._syncedModels[e]||this._beginModelSync(i,t),this._syncedModels[e]&&(this._syncedModelsLastUsedTime[e]=(new Date).getTime())}}_checkStopModelSync(){const e=(new Date).getTime(),t=[];for(const i in this._syncedModelsLastUsedTime){e-this._syncedModelsLastUsedTime[i]>6e4&&t.push(i)}for(const i of t)this._stopModelSync(i)}_beginModelSync(e,t){const i=this._modelService.getModel(e);if(!i)return;if(!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 s=new N;s.add(i.onDidChangeContent((e=>{this._proxy.acceptModelChanged(n.toString(),e)}))),s.add(i.onWillDispose((()=>{this._stopModelSync(n)}))),s.add(x((()=>{this._proxy.acceptRemovedModel(n)}))),this._syncedModels[n]=s}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],k(t)}}class kT{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class DT{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class xT extends E{constructor(e,t,i,n){super(),this.languageConfigurationService=n,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new rI(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 eI(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new DT(this)))}catch(e){$E(e),this._worker=new kT(new gT(new DT(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,(e=>($E(e),this._worker=new kT(new gT(new DT(this),null)),this._getOrCreateWorker().getProxyObject())))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new LT(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e,t=!1){return vT(this,void 0,void 0,(function*(){return this._disposed?Promise.reject(function(){const e=new Error(h);return e.name=e.message,e}()):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((s=>s.computeDiff(e.toString(),t.toString(),i,n)))}computeMoreMinimalEdits(e,t,i){return this._withSyncedResources([e]).then((n=>n.computeMoreMinimalEdits(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())))}textualSuggest(e,t,i){return vT(this,void 0,void 0,(function*(){const n=yield this._withSyncedResources(e),s=i.source,o=i.flags;return n.textualSuggest(e.map((e=>e.toString())),t,s,o)}))}computeWordRanges(e,t){return this._withSyncedResources([e]).then((i=>{const n=this._modelService.getModel(e);if(!n)return Promise.resolve(null);const s=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId()).getWordDefinition(),o=s.source,r=s.flags;return i.computeWordRanges(e.toString(),t,o,r)}))}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then((n=>{const s=this._modelService.getModel(e);if(!s)return null;const o=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId()).getWordDefinition(),r=o.source,a=o.flags;return n.navigateValueSet(e.toString(),t,i,r,a)}))}dispose(){super.dispose(),this._disposed=!0}}const NT=[];function ET(e){NT.push(e)}function IT(){return NT.slice(0)}var MT=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},TT=function(e,t){return function(i,n){t(i,n,e)}},RT=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class AT{constructor(e,t){this._editorWorkerClient=new xT(e,!1,"editorWorkerService",t)}provideDocumentColors(e,t){return RT(this,void 0,void 0,(function*(){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)}))}provideColorPresentations(e,t,i){const n=t.range,s=t.color,o=s.alpha,r=new lc(new oc(Math.round(255*s.red),Math.round(255*s.green),Math.round(255*s.blue),o)),a=o?lc.Format.CSS.formatRGB(r):lc.Format.CSS.formatRGBA(r),l=o?lc.Format.CSS.formatHSL(r):lc.Format.CSS.formatHSLA(r),h=o?lc.Format.CSS.formatHex(r):lc.Format.CSS.formatHexA(r),d=[];return d.push({label:a,textEdit:{range:n,text:a}}),d.push({label:l,textEdit:{range:n,text:l}}),d.push({label:h,textEdit:{range:n,text:h}}),d}}let OT=class extends E{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new AT(e,t)))}};OT=MT([TT(0,Ha),TT(1,Ju),TT(2,oL)],OT),ET(OT);var PT=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function FT(e,t,i,n=!0){return PT(this,void 0,void 0,(function*(){return zT(new WT,e,t,i,n)}))}function BT(e,t,i,n){return Promise.resolve(i.provideColorPresentations(e,t,n))}class WT{constructor(){}compute(e,t,i,n){return PT(this,void 0,void 0,(function*(){const s=yield e.provideDocumentColors(t,i);if(Array.isArray(s))for(const t of s)n.push({colorInfo:t,provider:e});return Array.isArray(s)}))}}class VT{constructor(){}compute(e,t,i,n){return PT(this,void 0,void 0,(function*(){const s=yield e.provideDocumentColors(t,i);if(Array.isArray(s))for(const e of s)n.push({range:e.range,color:[e.color.red,e.color.green,e.color.blue,e.color.alpha]});return Array.isArray(s)}))}}class HT{constructor(e){this.colorInfo=e}compute(e,t,i,n){return PT(this,void 0,void 0,(function*(){const i=yield e.provideColorPresentations(t,this.colorInfo,Uh.None);return Array.isArray(i)&&n.push(...i),Array.isArray(i)}))}}function zT(e,t,i,n,s){return PT(this,void 0,void 0,(function*(){let o,r=!1;const l=[],h=t.ordered(i);for(let t=h.length-1;t>=0;t--){const s=h[t];if(s instanceof AT)o=s;else try{(yield e.compute(s,i,n,l))&&(r=!0)}catch(Mre){a(Mre)}}return r?l:o&&s?(yield e.compute(o,i,n,l),l):[]}))}function UT(e,t){const{colorProvider:i}=e.get(oL),n=e.get(Ha).getModel(t);if(!n)throw u();return{model:n,colorProviderRegistry:i,isDefaultColorDecoratorsEnabled:e.get(pu).getValue("editor.defaultColorDecorators",{resource:t})}}Xa.registerCommand("_executeDocumentColorProvider",(function(e,...t){const[i]=t;if(!(i instanceof an))throw u();const{model:n,colorProviderRegistry:s,isDefaultColorDecoratorsEnabled:o}=UT(e,i);return zT(new VT,s,n,Uh.None,o)})),Xa.registerCommand("_executeColorPresentationProvider",(function(e,...t){const[i,n]=t,{uri:s,range:o}=n;if(!(s instanceof an&&Array.isArray(i)&&4===i.length&&Rh.isIRange(o)))throw u();const{model:r,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=UT(e,s),[h,d,c,g]=i;return zT(new HT({range:o,color:{red:h,green:d,blue:c,alpha:g}}),a,r,Uh.None,l)}));var KT,jT=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},qT=function(e,t){return function(i,n){t(i,n,e)}},$T=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const GT=Object.create({});let ZT=KT=class extends E{constructor(e,t,i,n){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new N),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new zE(this._editor),this._decoratorLimitReporter=new YT,this._colorDecorationClassRefs=this._register(new N),this._debounceInformation=n.for(i.colorProvider,"Document Colors",{min:KT.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((e=>{const t=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145);const i=t!==this._isColorDecoratorsEnabled||e.hasChanged(21),n=e.hasChanged(145);(i||n)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())}))),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&"object"==typeof i){const e=i.colorDecorators;if(e&&void 0!==e.enable&&!e.enable)return e.enable}return this._editor.getOption(20)}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 sd,this._timeoutTimer.cancelAndSet((()=>{this._timeoutTimer=null,this.beginCompute()}),this._debounceInformation.get(e)))}))),this.beginCompute())}beginCompute(){return $T(this,void 0,void 0,(function*(){this._computePromise=Yh((e=>$T(this,void 0,void 0,(function*(){const t=this._editor.getModel();if(!t)return[];const i=new F(!1),n=yield FT(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,i.elapsed()),n}))));try{const e=yield this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(Mre){r(Mre)}}))}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((e=>({range:{startLineNumber:e.colorInfo.range.startLineNumber,startColumn:e.colorInfo.range.startColumn,endLineNumber:e.colorInfo.range.endLineNumber,endColumn:e.colorInfo.range.endColumn},options:Iw.EMPTY})));this._editor.changeDecorations((i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach(((t,i)=>this._colorDatas.set(t,e[i])))}))}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(21);for(let s=0;sthis._colorDatas.has(e.id)));return 0===i.length?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};ZT.ID="editor.contrib.colorDetector",ZT.RECOMPUTE_TIME=1e3,ZT=KT=jT([qT(1,pu),qT(2,oL),qT(3,SE)],ZT);class YT{constructor(){this._onDidChange=new U,this._computed=0,this._limited=!1}update(e,t){e===this._computed&&t===this._limited||(this._computed=e,this._limited=t,this._onDidChange.fire())}}Dh(ZT.ID,ZT,1);class XT{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 U,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new U,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new U,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({format:e.format,location:e.location.toString()})))}},e.fromJSONObject=function(e){const t=e=>Fr(e)?e:void 0;if(e&&Array.isArray(e.src)&&e.src.every((e=>Fr(e.format)&&Fr(e.location))))return{weight:t(e.weight),style:t(e.style),src:e.src.map((e=>({format:e.format,location:an.parse(e.location)})))}}}(JT||(JT={}));const eR=new class{constructor(){this._onDidChange=new U,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:ue(0,"The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:ue(0,"The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${ta.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,n){const s=this.iconsById[e];if(s){if(i&&!s.description){s.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const t=this.iconReferenceSchema.enum.indexOf(e);-1!==t&&(this.iconReferenceSchema.enumDescriptions[t]=i),this._onDidChange.fire()}return s}const o={id:e,description:i,defaults:t,deprecationMessage:n};this.iconsById[e]=o;const r={$ref:"#/definitions/icons"};return n&&(r.deprecationMessage=n),i&&(r.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=r,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map((e=>this.iconsById[e]))}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){const e=(e,t)=>e.id.localeCompare(t.id),t=e=>{for(;ta.isThemeIcon(e.defaults);)e=this.iconsById[e.defaults.id];return`codicon codicon-${e?e.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const n=Object.keys(this.iconsById).map((e=>this.iconsById[e]));for(const s of n.filter((e=>!!e.description)).sort(e))i.push(`||${s.id}|${ta.isThemeIcon(s.defaults)?s.defaults.id:s.id}|${s.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const s of n.filter((e=>!ta.isThemeIcon(e.defaults))).sort(e))i.push(`||${s.id}|`);return i.join("\n")}};function tR(e,t,i,n){return eR.registerIcon(e,t,i,n)}function iR(){return eR}jl.add("base.contributions.icons",eR),function(){const e=Qr();for(const t in e){const i="\\"+e[t].toString(16);eR.registerIcon(t,{fontCharacter:i})}}();const nR="vscode://schemas/icons",sR=jl.as(ku);sR.registerSchema(nR,eR.getIconSchema());const oR=new rd((()=>sR.notifySchemaChanged(nR)),200);eR.onDidChange((()=>{oR.isScheduled()||oR.schedule()}));const rR=tR("widget-close",Jr.close,ue(0,"Icon for the close action in widgets.")),aR=(tR("goto-previous-location",Jr.arrowUp,ue(0,"Icon for goto previous editor location.")),tR("goto-next-location",Jr.arrowDown,ue(0,"Icon for goto next editor location.")),ta.modify(Jr.sync,"spin"),ta.modify(Jr.loading,"spin"),fs);class lR extends E{constructor(e,t,i,n=!1){super(),this.model=t,this.showingStandaloneColorPicker=n,this._closeButton=null,this._domNode=aR(".colorpicker-header"),ds(e,this._domNode),this._pickedColorNode=ds(this._domNode,aR(".picked-color")),ds(this._pickedColorNode,aR("span.codicon.codicon-color-mode")),this._pickedColorPresentation=ds(this._pickedColorNode,document.createElement("span")),this._pickedColorPresentation.classList.add("picked-color-presentation");const s=ue(0,"Click to toggle color options (rgb/hsl/hex)");this._pickedColorNode.setAttribute("title",s),this._originalColorNode=ds(this._domNode,aR(".original-color")),this._originalColorNode.style.backgroundColor=lc.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=i.getColorTheme().getColor(Gm)||lc.white,this._register(i.onDidColorThemeChange((e=>{this.backgroundColor=e.getColor(Gm)||lc.white}))),this._register(En(this._pickedColorNode,os.CLICK,(()=>this.model.selectNextColorPresentation()))),this._register(En(this._originalColorNode,os.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=lc.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 hR(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=lc.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 hR extends E{constructor(e){super(),this._onClicked=this._register(new U),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),ds(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),ds(this._button,t);ds(t,aR(".button"+ta.asCSSSelector(tR("color-picker-close",Jr.close,ue(0,"Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}}class dR extends E{constructor(e,t,i,n=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=aR(".colorpicker-body"),ds(e,this._domNode),this._saturationBox=new cR(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 gR(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 pR(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 mR(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 lc(new ac(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new lc(new ac(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=360*(1-e);this.model.color=new lc(new ac(360===i?0:i,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}class cR extends E{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new U,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new U,this.onColorFlushed=this._onColorFlushed.event,this._domNode=aR(".saturation-wrap"),ds(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",ds(this._domNode,this._canvas),this.selection=aR(".saturation-selection"),ds(this._domNode,this.selection),this.layout(),this._register(En(this._domNode,os.POINTER_DOWN,(e=>this.onPointerDown(e)))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!(e.target&&e.target instanceof Element))return;this.monitor=this._register(new fD);const t=Hn(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,(e=>this.onDidChangePosition(e.pageX-t.left,e.pageY-t.top)),(()=>null));const i=En(e.target.ownerDocument,os.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 lc(new ac(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 s=i.createLinearGradient(0,0,0,this._canvas.height);s.addColorStop(0,"rgba(0, 0, 0, 0)"),s.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=lc.Format.CSS.format(t),i.fill(),i.fillStyle=n,i.fill(),i.fillStyle=s,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 uR extends E{constructor(e,t,i=!1){super(),this.model=t,this._onDidChange=new U,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new U,this.onColorFlushed=this._onColorFlushed.event,i?(this.domNode=ds(e,aR(".standalone-strip")),this.overlay=ds(this.domNode,aR(".standalone-overlay"))):(this.domNode=ds(e,aR(".strip")),this.overlay=ds(this.domNode,aR(".overlay"))),this.slider=ds(this.domNode,aR(".slider")),this.slider.style.top="0px",this._register(En(this.domNode,os.POINTER_DOWN,(e=>this.onPointerDown(e)))),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 fD),i=Hn(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,(e=>this.onDidChangeTop(e.pageY-i.top)),(()=>null));const n=En(e.target.ownerDocument,os.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 gR extends uR{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,s=new lc(new oc(t,i,n,1)),o=new lc(new oc(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${s} 0%, ${o} 100%)`}getValue(e){return e.hsva.a}}class pR extends uR{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class mR extends E{constructor(e){super(),this._onClicked=this._register(new U),this.onClicked=this._onClicked.event,this._button=ds(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._button.onclick=e=>{this._onClicked.fire()}}get button(){return this._button}}class fR extends _D{constructor(e,t,i,n,s=!1){super(),this.model=t,this.pixelRatio=i,this._register(te.onDidChange((()=>this.layout())));const o=aR(".colorpicker-widget");e.appendChild(o),this.header=this._register(new lR(o,this.model,n,s)),this.body=this._register(new dR(o,this.model,this.pixelRatio,s))}layout(){this.body.layout()}}var _R=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},vR=function(e,t){return function(i,n){t(i,n,e)}},bR=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class CR{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return 1===e.type&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let wR=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return cd.fromPromise(this._computeAsync(e,t,i))}_computeAsync(e,t,i){return bR(this,void 0,void 0,(function*(){if(!this._editor.hasModel())return[];const e=ZT.get(this._editor);if(!e)return[];for(const i of t){if(!e.isColorDecoration(i))continue;const t=e.getColorData(i.range.getStartPosition());if(t){return[yield LR(this,this._editor.getModel(),t.colorInfo,t.provider)]}}return[]}))}renderHoverParts(e,t){return kR(this,this._editor,this._themeService,t,e)}};wR=_R([vR(1,P_)],wR);class yR{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n}}let SR=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}createColorHover(e,t,i){return bR(this,void 0,void 0,(function*(){if(!this._editor.hasModel())return null;if(!ZT.get(this._editor))return null;const n=yield FT(i,this._editor.getModel(),Uh.None);let s=null,o=null;for(const t of n){const i=t.colorInfo;Rh.containsRange(i.range,e.range)&&(s=i,o=t.provider)}const r=null!=s?s:e,a=null!=o?o:t,l=!!s;return{colorHover:yield LR(this,this._editor.getModel(),r,a),foundInEditor:l}}))}updateEditorModel(e){return bR(this,void 0,void 0,(function*(){if(!this._editor.hasModel())return;const t=e.model;let i=new Rh(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(yield xR(this._editor.getModel(),t,this._color,i,e),i=DR(this._editor,i,t))}))}renderHoverParts(e,t){return kR(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};function LR(e,t,i,n){return bR(this,void 0,void 0,(function*(){const s=t.getValueInRange(i.range),{red:o,green:r,blue:a,alpha:l}=i.color,h=new oc(Math.round(255*o),Math.round(255*r),Math.round(255*a),l),d=new lc(h),c=yield BT(t,i,n,Uh.None),u=new XT(d,[],0);return u.colorPresentations=c||[],u.guessColorPresentation(d,s),e instanceof wR?new CR(e,Rh.lift(i.range),u,n):new yR(e,Rh.lift(i.range),u,n)}))}function kR(e,t,i,n,s){if(0===n.length||!t.hasModel())return E.None;if(s.setMinimumDimensions){const e=t.getOption(66)+8;s.setMinimumDimensions(new Wn(302,e))}const o=new N,r=n[0],a=t.getModel(),l=r.model,h=o.add(new fR(s.fragment,l,t.getOption(141),i,e instanceof SR));s.setColorPicker(h);let d=!1,c=new Rh(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);if(e instanceof SR){const t=n[0].model.color;e.color=t,xR(a,l,t,c,r),o.add(l.onColorFlushed((t=>{e.color=t})))}else o.add(l.onColorFlushed((e=>bR(this,void 0,void 0,(function*(){yield xR(a,l,e,c,r),d=!0,c=DR(t,c,l,s)})))));return o.add(l.onDidChangeColor((e=>{xR(a,l,e,c,r)}))),o.add(t.onDidChangeModelContent((e=>{d?d=!1:(s.hide(),t.focus())}))),o}function DR(e,t,i,n){let s,o;if(i.presentation.textEdit){s=[i.presentation.textEdit],o=new Rh(i.presentation.textEdit.range.startLineNumber,i.presentation.textEdit.range.startColumn,i.presentation.textEdit.range.endLineNumber,i.presentation.textEdit.range.endColumn);const t=e.getModel()._setTrackedRange(null,o,3);e.pushUndoStop(),e.executeEdits("colorpicker",s),o=e.getModel()._getTrackedRange(t)||o}else s=[{range:t,text:i.presentation.label,forceMoveMarkers:!1}],o=t.setEndPosition(t.endLineNumber,t.startColumn+i.presentation.label.length),e.pushUndoStop(),e.executeEdits("colorpicker",s);return i.presentation.additionalTextEdits&&(s=[...i.presentation.additionalTextEdits],e.executeEdits("colorpicker",s),n&&n.hide()),e.pushUndoStop(),o}function xR(e,t,i,n,s){return bR(this,void 0,void 0,(function*(){const o=yield BT(e,{range:n,color:{red:i.rgba.r/255,green:i.rgba.g/255,blue:i.rgba.b/255,alpha:i.rgba.a}},s.provider,Uh.None);t.colorPresentations=o||[]}))}function NR(e,t){return!!e[t]}SR=_R([vR(1,P_)],SR);class ER{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=NR(e.event,t.triggerModifier),this.hasSideBySideModifier=NR(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class IR{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=NR(e,t.triggerModifier)}}class MR{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 TR(e){return"altKey"===e?Pe?new MR(57,"metaKey",6,"altKey"):new MR(5,"ctrlKey",6,"altKey"):Pe?new MR(6,"altKey",57,"metaKey"):new MR(6,"altKey",5,"ctrlKey")}class RR extends E{constructor(e,t){var i;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new U),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new U),this.onExecute=this._onExecute.event,this._onCancel=this._register(new U),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=null!==(i=null==t?void 0:t.extractLineNumberFromMouseEvent)&&void 0!==i?i:e=>e.target.position?e.target.position.lineNumber:0,this._opts=TR(this._editor.getOption(77)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration((e=>{if(e.hasChanged(77)){const e=TR(this._editor.getOption(77));if(this._opts.equals(e))return;this._opts=e,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}}))),this._register(this._editor.onMouseMove((e=>this._onEditorMouseMove(new ER(e,this._opts))))),this._register(this._editor.onMouseDown((e=>this._onEditorMouseDown(new ER(e,this._opts))))),this._register(this._editor.onMouseUp((e=>this._onEditorMouseUp(new ER(e,this._opts))))),this._register(this._editor.onKeyDown((e=>this._onEditorKeyDown(new IR(e,this._opts))))),this._register(this._editor.onKeyUp((e=>this._onEditorKeyUp(new IR(e,this._opts))))),this._register(this._editor.onMouseDrag((()=>this._resetHandler()))),this._register(this._editor.onDidChangeCursorSelection((e=>this._onDidChangeCursorSelection(e)))),this._register(this._editor.onDidChangeModel((e=>this._resetHandler()))),this._register(this._editor.onDidChangeModelContent((()=>this._resetHandler()))),this._register(this._editor.onDidScrollChange((e=>{(e.scrollTopChanged||e.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()}}const AR=Ba("markerDecorationsService");var OR=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},PR=function(e,t){return function(i,n){t(i,n,e)}};let FR=class{constructor(e,t){}dispose(){}};FR.ID="editor.contrib.markerDecorations",FR=OR([PR(1,AR)],FR),Dh(FR.ID,FR,0);class BR extends E{constructor(e,t){super(),this._onDidChange=this._register(new U),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 s=()=>{if(i&&!n)try{i=!1,n=!0,t()}finally{requestAnimationFrame((()=>{n=!1,s()}))}};this._resizeObserver=new ResizeObserver((t=>{e=t&&t[0]&&t[0].contentRect?t[0].contentRect:null,i=!0,s()})),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())}}class WR{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class VR{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(){this._createDomElements(),document.body.appendChild(this._container),this._readFromDomElements(),document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");Hk(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");Hk(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const n=document.createElement("div");Hk(n,this._bareFontInfo),n.style.fontStyle="italic",e.appendChild(n);const s=[];for(const o of this._requests){let e;0===o.type&&(e=t),2===o.type&&(e=i),1===o.type&&(e=n),e.appendChild(document.createElement("br"));const r=document.createElement("span");VR._render(r,o),e.appendChild(r),s.push(r)}this._container=e,this._testElements=s}static _render(e,t){if(" "===t.chr){let t="\xa0";for(let e=0;e<8;e++)t+=t;e.innerText=t}else{let i=t.chr;for(let e=0;e<8;e++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;ethis._values[e]))}}const qR=new class extends E{constructor(){super(),this._onDidChange=this._register(new U),this.onDidChange=this._onDidChange.event,this._cache=new jR,this._evictUntrustedReadingsTimeout=-1}dispose(){-1!==this._evictUntrustedReadingsTimeout&&(window.clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearAllFontInfos(){this._cache=new jR,this._onDidChange.fire()}_writeToCache(e,t){this._cache.put(e,t),t.isTrusted||-1!==this._evictUntrustedReadingsTimeout||(this._evictUntrustedReadingsTimeout=window.setTimeout((()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings()}),5e3))}_evictUntrustedReadings(){const e=this._cache.getValues();let t=!1;for(const i of e)i.isTrusted||(t=!0,this._cache.remove(i));t&&this._onDidChange.fire()}readFontInfo(e){if(!this._cache.has(e)){let t=this._actualReadFontInfo(e);(t.typicalHalfwidthCharacterWidth<=2||t.typicalFullwidthCharacterWidth<=2||t.spaceWidth<=2||t.maxDigitWidth<=2)&&(t=new KR({pixelRatio:te.value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:t.isMonospace,typicalHalfwidthCharacterWidth:Math.max(t.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(t.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:t.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(t.spaceWidth,5),middotWidth:Math.max(t.middotWidth,5),wsmiddotWidth:Math.max(t.wsmiddotWidth,5),maxDigitWidth:Math.max(t.maxDigitWidth,5)},!1)),this._writeToCache(e,t)}return this._cache.get(e)}_createRequest(e,t,i,n){const s=new WR(e,t);return i.push(s),null==n||n.push(s),s}_actualReadFontInfo(e){const t=[],i=[],n=this._createRequest("n",0,t,i),s=this._createRequest("\uff4d",0,t,null),o=this._createRequest(" ",0,t,i),r=this._createRequest("0",0,t,i),a=this._createRequest("1",0,t,i),l=this._createRequest("2",0,t,i),h=this._createRequest("3",0,t,i),d=this._createRequest("4",0,t,i),c=this._createRequest("5",0,t,i),u=this._createRequest("6",0,t,i),g=this._createRequest("7",0,t,i),p=this._createRequest("8",0,t,i),m=this._createRequest("9",0,t,i),f=this._createRequest("\u2192",0,t,i),_=this._createRequest("\uffeb",0,t,null),v=this._createRequest("\xb7",0,t,i),b=this._createRequest(String.fromCharCode(11825),0,t,null),C="|/-_ilm%";for(let k=0,D=8;k.001){y=!1;break}}let L=!0;return y&&_.width!==S&&(L=!1),_.width>f.width&&(L=!1),new KR({pixelRatio:te.value,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,fontVariationSettings:e.fontVariationSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:y,typicalHalfwidthCharacterWidth:n.width,typicalFullwidthCharacterWidth:s.width,canUseHalfwidthRightwardsArrow:L,spaceWidth:o.width,middotWidth:v.width,wsmiddotWidth:b.width,maxDigitWidth:w},!0)}};class $R{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=$R._read(e,this.key);this.migrate(t,(t=>$R._read(e,t)),((t,i)=>$R._write(e,t,i)))}static _read(e,t){if(void 0===e)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 s=t.substring(0,n);return e[s]=e[s]||{},void this._write(e[s],t.substring(n+1),i)}e[t]=i}}function GR(e,t){$R.items.push(new $R(e,t))}function ZR(e,t){GR(e,((i,n,s)=>{if(void 0!==i)for(const[o,r]of t)if(i===o)return void s(e,r)}))}$R.items=[],ZR("wordWrap",[[!0,"on"],[!1,"off"]]),ZR("lineNumbers",[[!0,"on"],[!1,"off"]]),ZR("cursorBlinking",[["visible","solid"]]),ZR("renderWhitespace",[[!0,"boundary"],[!1,"none"]]),ZR("renderLineHighlight",[[!0,"line"],[!1,"none"]]),ZR("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]),ZR("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]),ZR("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]),ZR("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]),ZR("autoIndent",[[!1,"advanced"],[!0,"full"]]),ZR("matchBrackets",[[!0,"always"],[!1,"never"]]),ZR("renderFinalNewline",[[!0,"on"],[!1,"off"]]),ZR("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]),GR("autoClosingBrackets",((e,t,i)=>{!1===e&&(i("autoClosingBrackets","never"),void 0===t("autoClosingQuotes")&&i("autoClosingQuotes","never"),void 0===t("autoSurround")&&i("autoSurround","never"))})),GR("renderIndentGuides",((e,t,i)=>{void 0!==e&&(i("renderIndentGuides",void 0),void 0===t("guides.indentation")&&i("guides.indentation",!!e))})),GR("highlightActiveIndentGuide",((e,t,i)=>{void 0!==e&&(i("highlightActiveIndentGuide",void 0),void 0===t("guides.highlightActiveIndentation")&&i("guides.highlightActiveIndentation",!!e))}));const YR={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"};GR("suggest.filteredTypes",((e,t,i)=>{if(e&&"object"==typeof e){for(const n of Object.entries(YR)){!1===e[n[0]]&&void 0===t(`suggest.${n[1]}`)&&i(`suggest.${n[1]}`,!1)}i("suggest.filteredTypes",void 0)}})),GR("quickSuggestions",((e,t,i)=>{if("boolean"==typeof e){const t=e?"on":"off";i("quickSuggestions",{comments:t,strings:t,other:t})}})),GR("experimental.stickyScroll.enabled",((e,t,i)=>{"boolean"==typeof e&&(i("experimental.stickyScroll.enabled",void 0),void 0===t("stickyScroll.enabled")&&i("stickyScroll.enabled",e))})),GR("experimental.stickyScroll.maxLineCount",((e,t,i)=>{"number"==typeof e&&(i("experimental.stickyScroll.maxLineCount",void 0),void 0===t("stickyScroll.maxLineCount")&&i("stickyScroll.maxLineCount",e))}));const XR=new class{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new U,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}},QR=Ba("accessibilityService"),JR=new Al("accessibilityModeEnabled",!1);var eA=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},tA=function(e,t){return function(i,n){t(i,n,e)}};let iA=class extends E{constructor(e,t,i,n){super(),this._accessibilityService=n,this._onDidChange=this._register(new U),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new U),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new pS,this.isSimpleWidget=e,this._containerObserver=this._register(new BR(i,t.dimension)),this._rawOptions=aA(t),this._validatedOptions=rA.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(HR.onDidChangeZoomLevel((()=>this._recomputeOptions()))),this._register(XR.onDidChangeTabFocus((()=>this._recomputeOptions()))),this._register(this._containerObserver.onDidChange((()=>this._recomputeOptions()))),this._register(qR.onDidChange((()=>this._recomputeOptions()))),this._register(te.onDidChange((()=>this._recomputeOptions()))),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized((()=>this._recomputeOptions())))}_recomputeOptions(){const e=this._computeOptions(),t=rA.checkEquals(this.options,e);null!==t&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=UR.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:XR.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return rA.computeOptions(this._validatedOptions,n)}_readEnvConfiguration(){return{extraEditorClassName:nA(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:se||ne,pixelRatio:te.value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return qR.readFontInfo(e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=aA(e);rA.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=rA.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=function(e){let t=0;for(;e;)e=Math.floor(e/10),t++;return t||1}(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())}};function nA(){let e="";return re||ae||(e+="no-user-select "),re&&(e+="no-minimap-shadow ",e+="enable-user-select "),Pe&&(e+="mac "),e}iA=eA([tA(3,QR)],iA);class sA{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class oA{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 rA{static validateOptions(e){const t=new sA;for(const i of $S){const n="_never_"===i.name?void 0:e[i.name];t._write(i.id,i.validate(n))}return t}static computeOptions(e,t){const i=new oA;for(const n of $S)i._write(n.id,n.compute(t,i,e._read(n.id)));return i}static _deepEquals(e,t){if("object"!=typeof e||"object"!=typeof t||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return!(!Array.isArray(e)||!Array.isArray(t))&&Td(e,t);if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!rA._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let n=!1;for(const s of $S){const o=!rA._deepEquals(e._read(s.id),t._read(s.id));i[s.id]=o,o&&(n=!0)}return n?new gS(i):null}static applyUpdate(e,t){let i=!1;for(const n of $S)if(t.hasOwnProperty(n.name)){const s=n.applyUpdate(e[n.name],t[n.name]);e[n.name]=s.newValue,i=i||s.didChange}return i}}function aA(e){const t=gd(e);return function(e){$R.items.forEach((t=>t.apply(e)))}(t),t}class lA extends E{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;i=o.left?n.width=Math.max(n.width,o.left+o.width-n.left):(t[i++]=n,n=o)}return t[i++]=n,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||0===e.length)return null;const n=[];for(let s=0,o=e.length;sr)return null;if((t=Math.min(r,Math.max(0,t)))===(n=Math.min(r,Math.max(0,n)))&&i===s&&0===i&&!e.children[t].firstChild){const i=e.children[t].getClientRects();return o.markDidDomLayout(),this._createHorizontalRangesFromClientRects(i,o.clientRectDeltaLeft,o.clientRectScale)}t!==n&&n>0&&0===s&&(n--,s=1073741824);let a=e.children[t].firstChild,l=e.children[n].firstChild;if(a&&l||(!a&&0===i&&t>0&&(a=e.children[t-1].firstChild,i=1073741824),!l&&0===s&&n>0&&(l=e.children[n-1].firstChild,s=1073741824)),!a||!l)return null;i=Math.min(a.textContent.length,Math.max(0,i)),s=Math.min(l.textContent.length,Math.max(0,s));const h=this._readClientRects(a,i,l,s,o.endNode);return o.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,o.clientRectDeltaLeft,o.clientRectScale)}}class bA{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;if(i!==t.length)return!1;for(let n=0;n=s||(r[a++]=new bA(Math.max(1,l.startColumn-n+1),Math.min(o+1,l.endColumn-n+1),l.className,l.type));return r}static filter(e,t,i,n){if(0===e.length)return[];const s=[];let o=0;for(let r=0,a=e.length;rt)continue;if(l.isEmpty()&&(0===a.type||3===a.type))continue;const h=l.startLineNumber===t?l.startColumn:i,d=l.endLineNumber===t?l.endColumn:n;s[o++]=new bA(h,d,a.inlineClassName,a.type)}return s}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=bA._typeCompare(e.type,t.type);return 0!==i?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 yA{static normalize(e,t){if(0===t.length)return[];const i=[],n=new wA;let s=0;for(let o=0,r=t.length;o1){wo(e.charCodeAt(a-2))&&a--}if(l>1){wo(e.charCodeAt(l-2))&&l--}const c=a-1,u=l-2;s=n.consumeLowerThan(c,s,i),0===n.count&&(s=c),n.insert(u,h,d)}return n.consumeLowerThan(1073741824,s,i),i}}class SA{constructor(e,t,i,n){this.endIndex=e,this.type=t,this.metadata=i,this.containsRTL=n,this._linePartBrand=void 0}isWhitespace(){return!!(1&this.metadata)}isPseudoAfter(){return!!(4&this.metadata)}}class LA{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class kA{constructor(e,t,i,n,s,o,r,a,l,h,d,c,u,g,p,m,f,_,v){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=n,this.isBasicASCII=s,this.containsRTL=o,this.fauxIndentLength=r,this.lineTokens=a,this.lineDecorations=l.sort(bA.compare),this.tabSize=h,this.startVisibleColumn=d,this.spaceWidth=c,this.stopRenderingLineAfter=p,this.renderWhitespace="all"===m?4:"boundary"===m?1:"selection"===m?2:"trailing"===m?3:0,this.renderControlCharacters=f,this.fontLigatures=_,this.selectionsOnLine=v&&v.sort(((e,t)=>e.startOffset>>16}static getCharIndex(e){return(65535&e)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,n){const s=(t<<16|i)>>>0;this._data[e-1]=s,this._horizontalOffset[e-1]=n}getHorizontalOffset(e){return 0===this._horizontalOffset.length?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return 0===this.length?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=xA.getPartIndex(t),n=xA.getCharIndex(t);return new DA(i,n)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(0===this.length)return 0;const n=(e<<16|i)>>>0;let s=0,o=this.length-1;for(;s+1>>1,t=this._data[e];if(t===n)return e;t>n?o=e:s=e}if(s===o)return s;const r=this._data[s],a=this._data[o];if(r===n)return s;if(a===n)return o;const l=xA.getPartIndex(r),h=xA.getCharIndex(r);let d;d=l!==xA.getPartIndex(a)?t:xA.getCharIndex(a);return i-h<=d-i?s:o}}class NA{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function EA(e,t){if(0===e.lineContent.length){if(e.lineDecorations.length>0){t.appendString("");let i=0,n=0,s=0;for(const r of e.lineDecorations)1!==r.type&&2!==r.type||(t.appendString(''),1===r.type&&(s|=1,i++),2===r.type&&(s|=2,n++));t.appendString("");const o=new xA(1,i+n);return o.setColumnInfo(1,i,0,0),new NA(o,!1,s)}return t.appendString(""),new NA(new xA(0,0),!1,0)}return function(e,t){const i=e.fontIsMonospace,n=e.canUseHalfwidthRightwardsArrow,s=e.containsForeignElements,o=e.lineContent,r=e.len,a=e.isOverflowing,l=e.overflowingCharCount,h=e.parts,d=e.fauxIndentLength,c=e.tabSize,u=e.startVisibleColumn,g=e.containsRTL,p=e.spaceWidth,m=e.renderSpaceCharCode,f=e.renderWhitespace,_=e.renderControlCharacters,v=new xA(r+1,h.length);let b=!1,C=0,w=u,y=0,S=0,L=0;g?t.appendString(''):t.appendString("");for(let k=0,D=h.length;k=d&&(i+=n)}}for(D&&(t.appendString(' style="width:'),t.appendString(String(p*e)),t.appendString('px"')),t.appendASCIICharCode(62);C1?t.appendCharCode(8594):t.appendCharCode(65515);for(let e=2;e<=i;e++)t.appendCharCode(160)}else e=2,i=1,t.appendCharCode(m),t.appendCharCode(8204);y+=e,S+=i,C>=d&&(w+=i)}}else for(t.appendASCIICharCode(62);C=d&&(w+=n)}x?L++:L=0,C>=r&&!b&&e.isPseudoAfter()&&(b=!0,v.setColumnInfo(C+1,k,y,S)),t.appendString("")}b||v.setColumnInfo(r+1,h.length-1,y,S);a&&(t.appendString(''),t.appendString(ue(0,"Show more ({0})",function(e){if(e<1024)return ue(0,"{0} chars",e);if(e<1048576)return`${(e/1024).toFixed(1)} KB`;return`${(e/1024/1024).toFixed(1)} MB`}(l))),t.appendString(""));return t.appendString(""),new NA(v,g,s)}(function(e){const t=e.lineContent;let i,n,s;-1!==e.stopRenderingLineAfter&&e.stopRenderingLineAfter0&&(o[r++]=new SA(n,"",0,!1));let a=n;for(let l=0,h=i.getCount();l=s){const i=!!t&&Io(e.substring(a,s));o[r++]=new SA(s,d,0,i);break}const c=!!t&&Io(e.substring(a,h));o[r++]=new SA(h,d,0,c),a=h}return o}(t,e.containsRTL,e.lineTokens,e.fauxIndentLength,s);e.renderControlCharacters&&!e.isBasicASCII&&(o=function(e,t){const i=[];let n=new SA(0,"",0,!1),s=0;for(const o of t){const t=o.endIndex;for(;sn.endIndex&&(n=new SA(s,o.type,o.metadata,o.containsRTL),i.push(n)),n=new SA(s+1,"mtkcontrol",o.metadata,!1),i.push(n))}s>n.endIndex&&(n=new SA(t,o.type,o.metadata,o.containsRTL),i.push(n))}return i}(t,o));(4===e.renderWhitespace||1===e.renderWhitespace||2===e.renderWhitespace&&e.selectionsOnLine||3===e.renderWhitespace&&!e.continuesWithWrappedLine)&&(o=function(e,t,i,n){const s=e.continuesWithWrappedLine,o=e.fauxIndentLength,r=e.tabSize,a=e.startVisibleColumn,l=e.useMonospaceOptimizations,h=e.selectionsOnLine,d=1===e.renderWhitespace,c=3===e.renderWhitespace,u=e.renderSpaceWidth!==e.spaceWidth,g=[];let p=0,m=0,f=n[m].type,_=n[m].containsRTL,v=n[m].endIndex;const b=n.length;let C,w=!1,y=ro(t);-1===y?(w=!0,y=i,C=i):C=lo(t);let S=!1,L=0,k=h&&h[L],D=a%r;for(let N=o;N=k.endOffset&&(L++,k=h&&h[L]),NC)s=!0;else if(9===e)s=!0;else if(32===e)if(d)if(S)s=!0;else{const e=N+1N),s&&c&&(s=w||N>C),s&&_&&N>=y&&N<=C&&(s=!1),S){if(!s||!l&&D>=r){if(u){for(let e=(p>0?g[p-1].endIndex:o)+1;e<=N;e++)g[p++]=new SA(e,"mtkw",1,!1)}else g[p++]=new SA(N,"mtkw",1,!1);D%=r}}else(N===v||s&&N>o)&&(g[p++]=new SA(N,f,0,_),D%=r);for(9===e?D=r:Oo(e)?D+=2:D++,S=s;N===v&&(m++,m0?t.charCodeAt(i-1):0,n=i>1?t.charCodeAt(i-2):0;32===e&&32!==n&&9!==n||(x=!0)}else x=!0;if(x)if(u){for(let e=(p>0?g[p-1].endIndex:o)+1;e<=i;e++)g[p++]=new SA(e,"mtkw",1,!1)}else g[p++]=new SA(i,"mtkw",1,!1);else g[p++]=new SA(i,f,0,_);return g}(e,t,s,o));let r=0;if(e.lineDecorations.length>0){for(let t=0,i=e.lineDecorations.length;th&&(h=e.startOffset,a[l++]=new SA(h,n,d,u)),!(e.endOffset+1<=t)){h=t,a[l++]=new SA(h,n+" "+e.className,d|e.metadata,u);break}h=e.endOffset+1,a[l++]=new SA(h,n+" "+e.className,d|e.metadata,u),r++}t>h&&(h=t,a[l++]=new SA(h,n,d,u))}const d=i[i.length-1].endIndex;if(r=50&&(s[o++]=new SA(h+1,t,r,l),d=h+1,h=-1);d!==a&&(s[o++]=new SA(a,t,r,l))}else s[o++]=i;n=a}else for(let r=0,a=t.length;r50){const t=e.type,r=e.metadata,l=e.containsRTL,h=Math.ceil(a/50);for(let e=1;e=8234&&e<=8238||e>=8294&&e<=8297||e>=8206&&e<=8207||1564===e)}function AA(e){return e.toString(16).toUpperCase().padStart(4,"0")}const OA=!!Be||!(Fe||ne||re);let PA=!0;class FA{constructor(e,t){this.themeType=t;const i=e.options,n=i.get(50),s=i.get(38);this.renderWhitespace="off"===s?i.get(98):"none",this.renderControlCharacters=i.get(93),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(33),this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(66),this.stopRenderingLineAfter=i.get(116),this.fontLigatures=i.get(51)}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}}class BA{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)throw new Error("I have no rendered view line to set the dom node to...");this._renderedViewLine.domNode=Vk(e)}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return!(!A_(this._options.themeType)&&"selection"!==this._options.renderWhitespace)&&(this._isMaybeInvalid=!0,!0)}renderLine(e,t,i,n){if(!1===this._isMaybeInvalid)return!1;this._isMaybeInvalid=!1;const s=i.getViewLineRenderingData(e),o=this._options,r=bA.filter(s.inlineDecorations,e,s.minColumn,s.maxColumn);let a=null;if(A_(o.themeType)||"selection"===this._options.renderWhitespace){const t=i.selections;for(const i of t){if(i.endLineNumbere)continue;const t=i.startLineNumber===e?i.startColumn:s.minColumn,n=i.endLineNumber===e?i.endColumn:s.maxColumn;t');const h=EA(l,n);n.appendString("");let d=null;return PA&&OA&&s.isBasicASCII&&o.useMonospaceOptimizations&&0===h.containsForeignElements&&(d=new WA(this._renderedViewLine?this._renderedViewLine.domNode:null,l,h.characterMapping)),d||(d=zA(this._renderedViewLine?this._renderedViewLine.domNode:null,l,h.characterMapping,h.containsRTL,h.containsForeignElements)),this._renderedViewLine=d,!0}layoutLine(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return!this._renderedViewLine||this._renderedViewLine.getWidthIsFast()}needsMonospaceFontCheck(){return!!this._renderedViewLine&&this._renderedViewLine instanceof WA}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof WA?this._renderedViewLine.monospaceAssumptionsAreValid():PA}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof WA&&(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 s=this._renderedViewLine.input.stopRenderingLineAfter;if(-1!==s&&t>s+1&&i>s+1)return new _A(!0,[new mA(this.getWidth(n),0)]);-1!==s&&t>s+1&&(t=s+1),-1!==s&&i>s+1&&(i=s+1);const o=this._renderedViewLine.getVisibleRangesForRange(e,t,i,n);return o&&o.length>0?new _A(!1,o):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}BA.CLASS_NAME="view-line";class WA{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const n=Math.floor(t.lineContent.length/300);if(n>0){this._keyColumnPixelOffsetCache=new Float32Array(n);for(let e=0;e=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),PA=!1)}return PA}toSlowRenderedLine(){return zA(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i,n){const s=this._getColumnPixelOffset(e,t,n),o=this._getColumnPixelOffset(e,i,n);return[new mA(s,o-s)]}_getColumnPixelOffset(e,t,i){if(t<=300){const e=this._characterMapping.getHorizontalOffset(t);return this._charWidth*e}const n=Math.floor((t-1)/300)-1,s=300*(n+1)+1;let o=-1;if(this._keyColumnPixelOffsetCache&&(o=this._keyColumnPixelOffsetCache[n],-1===o&&(o=this._actualReadPixelOffset(e,s,i),this._keyColumnPixelOffsetCache[n]=o)),-1===o){const e=this._characterMapping.getHorizontalOffset(t);return this._charWidth*e}const r=this._characterMapping.getHorizontalOffset(s),a=this._characterMapping.getHorizontalOffset(t);return o+this._charWidth*(a-r)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return-1;const n=this._characterMapping.getDomPosition(t),s=vA.readHorizontalRanges(this._getReadingTarget(this.domNode),n.partIndex,n.charIndex,n.partIndex,n.charIndex,i);return s&&0!==s.length?s[0].left:-1}getColumnOfNodeOffset(e,t){return jA(this._characterMapping,e,t)}}class VA{constructor(e,t,i,n,s){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=s,this._cachedWidth=-1,this._pixelOffsetCache=null,!n||0===this._characterMapping.length){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let e=0,t=this._characterMapping.length;e<=t;e++)this._pixelOffsetCache[e]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,null==e||e.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return-1!==this._cachedWidth}getVisibleRangesForRange(e,t,i,n){if(!this.domNode)return null;if(null!==this._pixelOffsetCache){const s=this._readPixelOffset(this.domNode,e,t,n);if(-1===s)return null;const o=this._readPixelOffset(this.domNode,e,i,n);return-1===o?null:[new mA(s,o-s)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,n)}_readVisibleRangesForRange(e,t,i,n,s){if(i===n){const n=this._readPixelOffset(e,t,i,s);return-1===n?null:[new mA(n,0)]}return this._readRawVisibleRangesForRange(e,i,n,s)}_readPixelOffset(e,t,i,n){if(0===this._characterMapping.length){if(0===this._containsForeignElements)return 0;if(2===this._containsForeignElements)return 0;if(1===this._containsForeignElements)return this.getWidth(n);const t=this._getReadingTarget(e);return t.firstChild?(n.markDidDomLayout(),t.firstChild.offsetWidth):0}if(null!==this._pixelOffsetCache){const s=this._pixelOffsetCache[i];if(-1!==s)return s;const o=this._actualReadPixelOffset(e,t,i,n);return this._pixelOffsetCache[i]=o,o}return this._actualReadPixelOffset(e,t,i,n)}_actualReadPixelOffset(e,t,i,n){if(0===this._characterMapping.length){const t=vA.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,n);return t&&0!==t.length?t[0].left:-1}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&0===this._containsForeignElements)return this.getWidth(n);const s=this._characterMapping.getDomPosition(i),o=vA.readHorizontalRanges(this._getReadingTarget(e),s.partIndex,s.charIndex,s.partIndex,s.charIndex,n);if(!o||0===o.length)return-1;const r=o[0].left;if(this.input.isBasicASCII){const e=this._characterMapping.getHorizontalOffset(i),t=Math.round(this.input.spaceWidth*e);if(Math.abs(t-r)<=1)return t}return r}_readRawVisibleRangesForRange(e,t,i,n){if(1===t&&i===this._characterMapping.length)return[new mA(0,this.getWidth(n))];const s=this._characterMapping.getDomPosition(t),o=this._characterMapping.getDomPosition(i);return vA.readHorizontalRanges(this._getReadingTarget(e),s.partIndex,s.charIndex,o.partIndex,o.charIndex,n)}getColumnOfNodeOffset(e,t){return jA(this._characterMapping,e,t)}}class HA extends VA{_readVisibleRangesForRange(e,t,i,n,s){const o=super._readVisibleRangesForRange(e,t,i,n,s);if(!o||0===o.length||i===n||1===i&&n===this._characterMapping.length)return o;if(!this.input.containsRTL){const i=this._readPixelOffset(e,t,n,s);if(-1!==i){const e=o[o.length-1];e.left=4&&3===e[0]&&7===e[3]}static isStrictChildOfViewLines(e){return e.length>4&&3===e[0]&&7===e[3]}static isChildOfScrollableElement(e){return e.length>=2&&3===e[0]&&5===e[1]}static isChildOfMinimap(e){return e.length>=2&&3===e[0]&&8===e[1]}static isChildOfContentWidgets(e){return e.length>=4&&3===e[0]&&1===e[3]}static isChildOfOverflowGuard(e){return e.length>=1&&3===e[0]}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&2===e[0]}static isChildOfOverlayWidgets(e){return e.length>=2&&3===e[0]&&4===e[1]}}class QA{constructor(e,t,i){this.viewModel=e.viewModel;const n=e.configuration.options;this.layoutInfo=n.get(143),this.viewDomNode=t.viewDomNode,this.lineHeight=n.get(66),this.stickyTabStops=n.get(115),this.typicalHalfwidthCharacterWidth=n.get(50).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return QA.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const n=i.verticalOffset+i.height/2,s=e.viewModel.getLineCount();let o,r=null,a=null;return i.afterLineNumber!==s&&(a=new Va(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new Va(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),o=null===a?r:null===r?a:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,nO._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class eO extends JA{constructor(e,t,i,n,s){super(e,t,i,n),this._ctx=e,s?(this.target=s,this.targetPath=dA.collect(s,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}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}\n\ttarget: ${this.target?this.target.outerHTML:null}`}_getMouseColumn(e=null){return e&&e.columno.contentLeft+o.width)continue;const i=e.getVerticalOffsetForLineNumber(o.position.lineNumber);if(i<=s&&s<=i+o.height)return t.fulfillContentText(o.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const e=t.isInContentArea?8:5;return t.fulfillViewZone(e,i.position,i)}return null}static _hitTestTextArea(e,t){return XA.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 s=Math.abs(t.relativePos.x);const o={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:s};return s-=e.layoutInfo.glyphMarginLeft,s<=e.layoutInfo.glyphMarginWidth?t.fulfillMargin(2,n,i.range,o):(s-=e.layoutInfo.glyphMarginWidth,s<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,n,i.range,o):(s-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,n,i.range,o)))}return null}static _hitTestViewLines(e,t,i){if(!XA.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new Va(1,1),tO);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const i=e.viewModel.getLineCount(),n=e.viewModel.getLineMaxColumn(i);return t.fulfillContentEmpty(new Va(i,n),tO)}if(i){if(XA.isStrictChildOfViewLines(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(0===e.viewModel.getLineLength(i)){const n=e.getLineWidth(i),s=iO(t.mouseContentHorizontalOffset-n);return t.fulfillContentEmpty(new Va(i,1),s)}const n=e.getLineWidth(i);if(t.mouseContentHorizontalOffset>=n){const s=iO(t.mouseContentHorizontalOffset-n),o=new Va(i,e.viewModel.getLineMaxColumn(i));return t.fulfillContentEmpty(o,s)}}return t.fulfillUnknown()}const n=nO._doHitTest(e,t);return 1===n.type?nO.createMouseTargetFromHitTestPosition(e,t,n.spanNode,n.position,n.injectedText):this._createMouseTarget(e,t.withTarget(n.hitTarget),!0)}static _hitTestMinimap(e,t){if(XA.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new Va(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(XA.isChildOfScrollableElement(t.targetPath)&&t.target&&1===t.target.nodeType){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new Va(i,n))}}return null}static _hitTestScrollbar(e,t){if(XA.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new Va(i,n))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(143),n=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return nO._getMouseColumn(n,t.get(50).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){if(e<0)return 1;return Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,n,s){const o=n.lineNumber,r=n.column,a=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>a){const e=iO(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(n,e)}const l=e.visibleRangeForPosition(o,r);if(!l)return t.fulfillUnknown(n);const h=l.left;if(Math.abs(t.mouseContentHorizontalOffset-h)<1)return t.fulfillContentText(n,null,{mightBeForeignElement:!!s,injectedText:s});const d=[];if(d.push({offset:l.left,column:r}),r>1){const t=e.visibleRangeForPosition(o,r-1);t&&d.push({offset:t.left,column:r-1})}if(re.offset-t.offset));const c=t.pos.toClientCoordinates(),u=i.getBoundingClientRect(),g=u.left<=c.clientX&&c.clientX<=u.right;let p=null;for(let m=1;ms)){const i=Math.floor((n+s)/2);let o=t.pos.y+(i-t.mouseVerticalOffset);o<=t.editorPos.y&&(o=t.editorPos.y+1),o>=t.editorPos.y+t.editorPos.height&&(o=t.editorPos.y+t.editorPos.height-1);const r=new TE(t.pos.x,o),a=this._actualDoHitTestWithCaretRangeFromPoint(e,r.toClientCoordinates());if(1===a.type)return a}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=Yn(e.viewDomNode);let n;if(n=i?void 0===i.caretRangeFromPoint?function(e,t,i){const n=document.createRange();let s=e.elementFromPoint(t,i);if(null!==s){for(;s&&s.firstChild&&s.firstChild.nodeType!==s.firstChild.TEXT_NODE&&s.lastChild&&s.lastChild.firstChild;)s=s.lastChild;const e=s.getBoundingClientRect(),i=`${window.getComputedStyle(s,null).getPropertyValue("font-style")} ${window.getComputedStyle(s,null).getPropertyValue("font-variant")} ${window.getComputedStyle(s,null).getPropertyValue("font-weight")} ${window.getComputedStyle(s,null).getPropertyValue("font-size")}/${window.getComputedStyle(s,null).getPropertyValue("line-height")} ${window.getComputedStyle(s,null).getPropertyValue("font-family")}`,o=s.innerText;let r,a=e.left,l=0;if(t>e.left+e.width)l=o.length;else{const e=sO.getInstance();for(let n=0;nthis._createMouseTarget(e,t)),(e=>this._getMouseColumn(e)))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(143).height;const n=new WE(this.viewHelper.viewDomNode);this._register(n.onContextMenu(this.viewHelper.viewDomNode,(e=>this._onContextMenu(e,!0)))),this._register(n.onMouseMove(this.viewHelper.viewDomNode,(e=>{this._onMouseMove(e),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=En(this.viewHelper.viewDomNode.ownerDocument,"mousemove",(e=>{this.viewHelper.viewDomNode.contains(e.target)||this._onMouseLeave(new BE(e,!1,this.viewHelper.viewDomNode))})))}))),this._register(n.onMouseUp(this.viewHelper.viewDomNode,(e=>this._onMouseUp(e)))),this._register(n.onMouseLeave(this.viewHelper.viewDomNode,(e=>this._onMouseLeave(e))));let s=0;this._register(n.onPointerDown(this.viewHelper.viewDomNode,((e,t)=>{s=t}))),this._register(En(this.viewHelper.viewDomNode,os.POINTER_UP,(e=>{this._mouseDownOperation.onPointerUp()}))),this._register(n.onMouseDown(this.viewHelper.viewDomNode,(e=>this._onMouseDown(e,s)))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=MD.INSTANCE;let t=0,i=HR.getZoomLevel(),n=!1,s=0;function o(e){return Pe?(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey:e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey}this._register(En(this.viewHelper.viewDomNode,os.MOUSE_WHEEL,(r=>{if(this.viewController.emitMouseWheel(r),!this._context.configuration.options.get(75))return;const a=new Et(r);if(e.acceptStandardWheelEvent(a),e.isPhysicalMouseWheel()){if(o(r)){const e=HR.getZoomLevel(),t=a.deltaY>0?1:-1;HR.setZoomLevel(e+t),a.preventDefault(),a.stopPropagation()}}else Date.now()-t>50&&(i=HR.getZoomLevel(),n=o(r),s=0),t=Date.now(),s+=a.deltaY,n&&(HR.setZoomLevel(i+s/5),a.preventDefault(),a.stopPropagation())}),{capture:!0,passive:!1}))}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(143)){const e=this._context.configuration.options.get(143).height;this._height!==e&&(this._height=e,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){const i=new RE(e,t).toPageCoordinates(),n=PE(this.viewHelper.viewDomNode);if(i.yn.y+n.height||i.xn.x+n.width)return null;const s=FE(this.viewHelper.viewDomNode,n,i);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),n,i,s,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const t=Yn(this.viewHelper.viewDomNode);t&&(i=t.elementsFromPoint(e.posx,e.posy).find((e=>this.viewHelper.viewDomNode.contains(e))))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){if(this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),this._mouseDownOperation.isActive())return;e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(h&&(n||o&&r))d(),this._mouseDownOperation.start(i.type,e,t);else if(s)e.preventDefault();else if(a){const n=i.detail;h&&this.viewHelper.shouldSuppressMouseDownOnViewZone(n.viewZoneId)&&(d(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else l&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(d(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}}class rO extends E{constructor(e,t,i,n,s,o){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=n,this._createMouseTarget=s,this._getMouseColumn=o,this._mouseMoveMonitor=this._register(new HE(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new aO(this._context,this._viewHelper,this._mouseTargetFactory,((e,t,i)=>this._dispatchMouse(e,t,i)))),this._mouseState=new hO,this._currentSelection=new Ah(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}):13!==t.type||"above"!==t.outsidePosition&&"below"!==t.outsidePosition?(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,1)):this._topBottomDragScrolling.start(t,e))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(3===e),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 s=this._context.configuration.options;if(!s.get(90)&&s.get(35)&&!s.get(22)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&6===n.type&&n.position&&this._currentSelection.containsPosition(n.position))return this._mouseState.isDragAndDrop=!0,this._isActive=!0,void this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,(e=>this._onMouseDownThenMove(e)),(e=>{const t=this._findMousePosition(this._lastMouseEvent,!1);e&&e instanceof KeyboardEvent?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:t?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()}));this._mouseState.isDragAndDrop=!1,this._dispatchMouse(n,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,(e=>this._onMouseDownThenMove(e)),(()=>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,s=this._getMouseColumn(e);if(e.posyt.y+t.height){const o=e.posy-t.y-t.height,r=n.getCurrentScrollTop()+e.relativePos.y,a=QA.getZoneAtCoord(this._context,r);if(a){const e=this._helpPositionJumpOverViewZone(a);if(e)return YA.createOutsideEditor(s,e,"below",o)}const l=n.getLineNumberAtVerticalOffset(r);return YA.createOutsideEditor(s,new Va(l,i.getLineMaxColumn(l)),"below",o)}const o=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){const n=e.posx-t.x-t.width;return YA.createOutsideEditor(s,new Va(o,i.getLineMaxColumn(o)),"right",n)}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(8===n.type||5===n.type){const e=this._helpPositionJumpOverViewZone(n.detail);if(e)return YA.createViewZone(n.type,n.element,n.mouseColumn,e,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new Va(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:6===e.type&&null!==e.detail.injectedText})}}class aO extends E{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 lO(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class lO extends E{constructor(e,t,i,n,s,o){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._position=s,this._mouseEvent=o,this._lastTime=Date.now(),this._animationFrameDisposable=An((()=>this._execute()))}dispose(){this._animationFrameDisposable.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(66),t=this._context.configuration.options.get(143).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(66),t=this._getScrollSpeed()*(this._tick()/1e3)*e,i="above"===this._position.outsidePosition?-t:t;this._context.viewModel.viewLayout.deltaScrollNow(0,i),this._viewHelper.renderNow();const n=this._context.viewLayout.getLinesViewportData(),s="above"===this._position.outsidePosition?n.startLineNumber:n.endLineNumber;let o;{const e=PE(this._viewHelper.viewDomNode),t=this._context.configuration.options.get(143).horizontalScrollbarHeight,i=new TE(this._mouseEvent.pos.x,e.y+e.height-t-.1),n=FE(this._viewHelper.viewDomNode,e,i);o=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),e,i,n,null)}o.position&&o.position.lineNumber===s||(o="above"===this._position.outsidePosition?YA.createOutsideEditor(this._position.mouseColumn,new Va(s,1),"above",this._position.outsideDistance):YA.createOutsideEditor(this._position.mouseColumn,new Va(s,this._context.viewModel.getLineMaxColumn(s)),"below",this._position.outsideDistance)),this._dispatchMouse(o,!0,2),this._animationFrameDisposable=An((()=>this._execute()))}}class hO{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>hO.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)}}hO.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class dO extends oO{constructor(e,t,i){super(e,t,i),this._register(ZL.addTarget(this.viewHelper.linesContentDomNode)),this._register(En(this.viewHelper.linesContentDomNode,$L.Tap,(e=>this.onTap(e)))),this._register(En(this.viewHelper.linesContentDomNode,$L.Change,(e=>this.onChange(e)))),this._register(En(this.viewHelper.linesContentDomNode,$L.Contextmenu,(e=>this._onContextMenu(new BE(e,!1,this.viewHelper.viewDomNode),!1)))),this._lastPointerType="mouse",this._register(En(this.viewHelper.linesContentDomNode,"pointerdown",(e=>{const t=e.pointerType;this._lastPointerType="mouse"!==t?"touch"===t?"touch":"pen":"mouse"})));const n=new VE(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,(e=>this._onMouseMove(e)))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,(e=>this._onMouseUp(e)))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,(e=>this._onMouseLeave(e)))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,((e,t)=>this._onMouseDown(e,t))))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new BE(e,!1,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:!1,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:6===t.type&&null!==t.detail.injectedText})}onChange(e){"touch"===this._lastPointerType&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}_onMouseDown(e,t){"touch"!==e.browserEvent.pointerType&&super._onMouseDown(e,t)}}class cO extends oO{constructor(e,t,i){super(e,t,i),this._register(ZL.addTarget(this.viewHelper.linesContentDomNode)),this._register(En(this.viewHelper.linesContentDomNode,$L.Tap,(e=>this.onTap(e)))),this._register(En(this.viewHelper.linesContentDomNode,$L.Change,(e=>this.onChange(e)))),this._register(En(this.viewHelper.linesContentDomNode,$L.Contextmenu,(e=>this._onContextMenu(new BE(e,!1,this.viewHelper.viewDomNode),!1))))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new BE(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const e=document.createEvent("CustomEvent");e.initEvent($y.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(e),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class uO extends E{constructor(e,t,i){super(),He&&tt?this.handler=this._register(new dO(e,t,i)):window.TouchEvent?this.handler=this._register(new cO(e,t,i)):this.handler=this._register(new oO(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class gO extends lA{}class pO extends gO{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new Va(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(66);const t=e.get(67);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(94);const i=e.get(143);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),2!==this._renderLineNumbers&&3!==this._renderLineNumbers||(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}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Va(e,1));if(1!==t.column)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(2===this._renderLineNumbers){const e=Math.abs(this._lastCursorModelPosition.lineNumber-i);return 0===e?''+i+"":String(e)}return 3===this._renderLineNumbers?this._lastCursorModelPosition.lineNumber===i||i%10==0?String(i):"":String(i)}prepareRender(e){if(0===this._renderLineNumbers)return void(this._renderResult=null);const t=Fe?this._lineHeight%2==0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,s=this._context.viewModel.getLineCount(),o=[];for(let r=i;r<=n;r++){const e=r-i,n=this._getLineRenderLineNumber(r);if(!n){o[e]="";continue}let a="";if(r===s&&0===this._context.viewModel.getLineLength(r)){if("off"===this._renderFinalNewline){o[e]="";continue}"dimmed"===this._renderFinalNewline&&(a=" dimmed-line-number")}r===this._activeLineNumber&&(a=" active-line-number"),o[e]=`
    ${n}
    `}this._renderResult=o}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}pO.CLASS_NAME="line-numbers",H_(((e,t)=>{const i=e.getColor(G_),n=e.getColor(dv);n?t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${n}; }`):i&&t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i.transparent(.4)}; }`)}));class mO extends hA{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=Vk(document.createElement("div")),this._domNode.setClassName(mO.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=Vk(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(mO.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(143);return this._canUseLayerHinting=!t.get(32),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)}}mO.CLASS_NAME="glyph-margin",mO.OUTER_CLASS_NAME="margin";const fO="monaco-mouse-cursor-text";const _O=new class{constructor(){this._onDidChange=new U,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()}};var vO=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},bO=function(e,t){return function(i,n){t(i,n,e)}};class CO{constructor(e,t,i,n,s){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=n,this.distanceToModelLineEnd=s,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new Va(this.modelLineNumber,this.distanceToModelLineStart+1),i=new Va(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||(this._previousPresentation=e||{foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const wO=ne;let yO=class extends hA{constructor(e,t,i,n){super(e),this._keybindingService=n,this._primaryCursorPosition=new Va(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=i,this._scrollLeft=0,this._scrollTop=0;const s=this._context.configuration.options,o=s.get(143);this._setAccessibilityOptions(s),this._contentLeft=o.contentLeft,this._contentWidth=o.contentWidth,this._contentHeight=o.height,this._fontInfo=s.get(50),this._lineHeight=s.get(66),this._emptySelectionClipboard=s.get(37),this._copyWithSyntaxHighlighting=s.get(25),this._visibleTextArea=null,this._selections=[new Ah(1,1,1,1)],this._modelSelections=[new Ah(1,1,1,1)],this._lastRenderPosition=null,this.textArea=Vk(document.createElement("textarea")),dA.write(this.textArea,6),this.textArea.setClassName(`inputarea ${fO}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:r}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=r*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(s)),this.textArea.setAttribute("aria-required",s.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(s.get(123))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",ue(0,"editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",s.get(90)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=Vk(document.createElement("div")),this.textAreaCover.setPosition("absolute");const a={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:e=>this._context.viewModel.getLineMaxColumn(e),getValueInRange:(e,t)=>this._context.viewModel.getValueInRange(e,t),getValueLengthInRange:(e,t)=>this._context.viewModel.getValueLengthInRange(e,t),modifyPosition:(e,t)=>this._context.viewModel.modifyPosition(e,t)},l={getDataToCopy:()=>{const e=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,Oe),t=this._context.viewModel.model.getEOL(),i=this._emptySelectionClipboard&&1===this._modelSelections.length&&this._modelSelections[0].isEmpty(),n=Array.isArray(e)?e:null,s=Array.isArray(e)?e.join(t):e;let o,r=null;if(Gy.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&s.length<65536){const e=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);e&&(o=e.html,r=e.mode)}return{isFromEmptySelection:i,multicursorText:n,text:s,html:o,mode:r}},getScreenReaderContent:()=>{if(1===this._accessibilitySupport){const e=this._selections[0];if(Pe&&e.isEmpty()){const t=e.getStartPosition();let i=this._getWordBeforePosition(t);if(0===i.length&&(i=this._getCharacterBeforePosition(t)),i.length>0)return new jy(i,i.length,i.length,Rh.fromPositions(t),0)}const t=500;if(Pe&&!e.isEmpty()&&a.getValueLengthInRange(e,0)0)return new jy(i,n,n,Rh.fromPositions(t),0)}return jy.EMPTY}return qy.fromEditorSelection(a,this._selections[0],this._accessibilityPageSize,0===this._accessibilitySupport)},deduceModelPosition:(e,t,i)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(e,t,i)},h=this._register(new Jy(this.textArea.domNode));this._textAreaInput=this._register(new Xy(l,h,$e,{isAndroid:le,isChrome:oe,isFirefox:ne,isSafari:re})),this._register(this._textAreaInput.onKeyDown((e=>{this._viewController.emitKeyDown(e)}))),this._register(this._textAreaInput.onKeyUp((e=>{this._viewController.emitKeyUp(e)}))),this._register(this._textAreaInput.onPaste((e=>{let t=!1,i=null,n=null;e.metadata&&(t=this._emptySelectionClipboard&&!!e.metadata.isFromEmptySelection,i=void 0!==e.metadata.multicursorText?e.metadata.multicursorText:null,n=e.metadata.mode),this._viewController.paste(e.text,t,i,n)}))),this._register(this._textAreaInput.onCut((()=>{this._viewController.cut()}))),this._register(this._textAreaInput.onType((e=>{e.replacePrevCharCnt||e.replaceNextCharCnt||e.positionDelta?this._viewController.compositionType(e.text,e.replacePrevCharCnt,e.replaceNextCharCnt,e.positionDelta):this._viewController.type(e.text)}))),this._register(this._textAreaInput.onSelectionChangeRequest((e=>{this._viewController.setSelection(e)}))),this._register(this._textAreaInput.onCompositionStart((e=>{const t=this.textArea.domNode,i=this._modelSelections[0],{distanceToModelLineStart:n,widthOfHiddenTextBefore:s}=(()=>{const e=t.value.substring(0,Math.min(t.selectionStart,t.selectionEnd)),n=e.lastIndexOf("\n"),s=e.substring(n+1),o=s.lastIndexOf("\t"),r=s.length-o-1,a=i.getStartPosition(),l=Math.min(a.column-1,r),h=a.column-1-l,d=s.substring(0,s.length-l),{tabSize:c}=this._context.viewModel.model.getOptions(),u=function(e,t,i,n){if(0===t.length)return 0;const s=e.createElement("div");s.style.position="absolute",s.style.top="-50000px",s.style.width="50000px";const o=e.createElement("span");Hk(o,i),o.style.whiteSpace="pre",o.style.tabSize=n*i.spaceWidth+"px",o.append(t),s.appendChild(o),e.body.appendChild(s);const r=o.offsetWidth;return e.body.removeChild(s),r}(this.textArea.domNode.ownerDocument,d,this._fontInfo,c);return{distanceToModelLineStart:h,widthOfHiddenTextBefore:u}})(),{distanceToModelLineEnd:o}=(()=>{const e=t.value.substring(Math.max(t.selectionStart,t.selectionEnd)),n=e.indexOf("\n"),s=-1===n?e:e.substring(0,n),o=s.indexOf("\t"),r=-1===o?s.length:s.length-o-1,a=i.getEndPosition(),l=Math.min(this._context.viewModel.model.getLineMaxColumn(a.lineNumber)-a.column,r);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(a.lineNumber)-a.column-l}})();this._context.viewModel.revealRange("keyboard",!0,Rh.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new CO(this._context,i.startLineNumber,n,s,o),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${fO} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()}))),this._register(this._textAreaInput.onCompositionUpdate((e=>{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 ${fO}`),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(_O.onDidChange((()=>{this._ensureReadOnlyAttribute()})))}writeScreenReaderContent(e){this._textAreaInput.writeScreenReaderContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=Gb('`~!@#$%^&*()-=+[{]}\\|;:",.<>/?');let n=!0,s=e.column,o=!0,r=e.column,a=0;for(;a<50&&(n||o);){if(n&&s<=1&&(n=!1),n){const e=t.charCodeAt(s-2);0!==i.get(e)?n=!1:s--}if(o&&r>t.length&&(o=!1),o){const e=t.charCodeAt(r-1);0!==i.get(e)?o=!1:r++}a++}return[t.substring(s-1,r-1),e.column-s]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=Gb(this._context.configuration.options.get(129));let n=e.column,s=0;for(;n>1;){const o=t.charCodeAt(n-2);if(0!==i.get(o)||s>50)return t.substring(n-1,e.column-1);s++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const t=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!wo(t.charCodeAt(0)))return t}return""}_getAriaLabel(e){var t,i,n;if(1===e.get(2)){const e=null===(t=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))||void 0===t?void 0:t.getAriaLabel(),s=null===(i=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))||void 0===i?void 0:i.getAriaLabel(),o=null===(n=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))||void 0===n?void 0:n.getAriaLabel(),r=ue(0,"The editor is not accessible at this time.");return e?ue(0,"{0} To enable screen reader optimized mode, use {1}",r,e):s?ue(0,"{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",r,s):o?ue(0,"{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(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);2===this._accessibilitySupport&&t===ZS.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const i=e.get(143).wrappingColumn;if(-1!==i&&1!==this._accessibilitySupport){const t=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(i*t.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=wO?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(50),this._lineHeight=t.get(66),this._emptySelectionClipboard=t.get(37),this._copyWithSyntaxHighlighting=t.get(25),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(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(123))),(e.hasChanged(34)||e.hasChanged(90))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeScreenReaderContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeScreenReaderContent("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()}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;!_O.enabled||e.get(34)&&e.get(90)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new Va(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),null===(t=this._visibleTextArea)||void 0===t||t.prepareRender(e)}render(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()}_render(){var e;if(this._visibleTextArea){const e=this._visibleTextArea.visibleTextareaStart,t=this._visibleTextArea.visibleTextareaEnd,i=this._visibleTextArea.startPosition,n=this._visibleTextArea.endPosition;if(i&&n&&e&&t&&t.left>=this._scrollLeft&&e.left<=this._scrollLeft+this._contentWidth){const s=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,o=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let r=this._visibleTextArea.widthOfHiddenLineTextBefore,a=this._contentLeft+e.left-this._scrollLeft,l=t.left-e.left+1;if(athis._contentWidth&&(l=this._contentWidth);const h=this._context.viewModel.getViewLineData(i.lineNumber),d=h.tokens.findTokenIndexAtOffset(i.column-1),c=d===h.tokens.findTokenIndexAtOffset(n.column-1),u=this._visibleTextArea.definePresentation(c?h.tokens.getPresentation(d):null);this.textArea.domNode.scrollTop=o*this._lineHeight,this.textArea.domNode.scrollLeft=r,this._doRender({lastRenderPosition:null,top:s,left:a,width:l,height:this._lineHeight,useCover:!1,color:(EC.getColorMap()||[])[u.foreground],italic:u.italic,bold:u.bold,underline:u.underline,strikethrough:u.strikethrough})}return}if(!this._primaryCursorVisibleRange)return void this._renderAtTopLeft();const t=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(tthis._contentLeft+this._contentWidth)return void this._renderAtTopLeft();const i=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(i<0||i>this._contentHeight)this._renderAtTopLeft();else if(Pe){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const n=null!==(e=this._textAreaInput.textAreaState.newlineCountBeforeSelection)&&void 0!==e?e:this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=n*this._lineHeight}else this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:wO?0:1,useCover:!1})}_newlinecount(e){let t=0,i=-1;for(;;){if(i=e.indexOf("\n",i+1),-1===i)break;t++}return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:wO?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;Hk(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?lc.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(57)?i.setClassName("monaco-editor-background textAreaCover "+mO.OUTER_CLASS_NAME):0!==n.get(67).renderType?i.setClassName("monaco-editor-background textAreaCover "+pO.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};yO=vO([bO(3,WL)],yO);class SO{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){Ry.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column=4?this._selectAll():3===e.mouseDownCount?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):2===e.mouseDownCount?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||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){Ry.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Ry.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),Ry.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),Ry.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Ry.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Ry.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Ry.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Ry.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Ry.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Ry.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Ry.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Ry.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Ry.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 LO{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){var t;null===(t=this.onKeyDown)||void 0===t||t.call(this,e)}emitKeyUp(e){var t;null===(t=this.onKeyUp)||void 0===t||t.call(this,e)}emitContextMenu(e){var t;null===(t=this.onContextMenu)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var t;null===(t=this.onMouseMove)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var t;null===(t=this.onMouseLeave)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var t;null===(t=this.onMouseDown)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var t;null===(t=this.onMouseUp)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var t;null===(t=this.onMouseDrag)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var t;null===(t=this.onMouseDrop)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;null===(e=this.onMouseDropCanceled)||void 0===e||e.call(this)}emitMouseWheel(e){var t;null===(t=this.onMouseWheel)||void 0===t||t.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return LO.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const i=Object.assign({},e);return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),5!==i.type&&8!==i.type||(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 Va(e.afterLineNumber,1)).lineNumber}}}class kO{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 f("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(0===this.getCount())return null;const i=this.getStartLineNumber(),n=this.getEndLineNumber();if(tn)return null;let s=0,o=0;for(let r=i;r<=n;r++){const i=r-this._rendLineNumberStart;e<=r&&r<=t&&(0===o?(s=i,o=1):o++)}if(e=n&&r<=s&&(this._lines[r-this._rendLineNumberStart].onContentChanged(),o=!0);return o}onLinesInserted(e,t){if(0===this.getCount())return null;const i=t-e+1,n=this.getStartLineNumber(),s=this.getEndLineNumber();if(e<=n)return this._rendLineNumberStart+=i,null;if(e>s)return null;if(i+e>s){return this._lines.splice(e-this._rendLineNumberStart,s-e+1)}const o=[];for(let d=0;di)continue;const r=Math.max(t,o.fromLineNumber),a=Math.min(i,o.toLineNumber);for(let e=r;e<=a;e++){const t=e-this._rendLineNumberStart;this._lines[t].onTokensChanged(),n=!0}}return n}}class DO{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new kO((()=>this._host.createVisibleLine()))}_createDomNode(){const e=Vk(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(143)}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 e=t,o=Math.min(i,s.rendLineNumberStart-1);e<=o&&(this._insertLinesBefore(s,e,o,n,t),s.linesLength+=o-e+1)}else if(s.rendLineNumberStart0&&(this._removeLinesBefore(s,e),s.linesLength-=e)}if(s.rendLineNumberStart=t,s.rendLineNumberStart+s.linesLength-1i){const e=Math.max(0,i-s.rendLineNumberStart+1),t=s.linesLength-1-e+1;t>0&&(this._removeLinesAfter(s,t),s.linesLength-=t)}return this._finishRendering(s,!1,n),s}_renderUntouchedLines(e,t,i,n,s){const o=e.rendLineNumberStart,r=e.lines;for(let a=t;a<=i;a++){const e=o+a;r[a].layoutLine(e,n[e-s])}}_insertLinesBefore(e,t,i,n,s){const o=[];let r=0;for(let a=t;a<=i;a++)o[r++]=this.host.createVisibleLine();e.lines=o.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i=0;r--){const t=e.lines[r];n[r]&&(t.setDomNode(o),o=o.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const n=document.createElement("div");xO._ttPolicy&&(t=xO._ttPolicy.createHTML(t)),n.innerHTML=t;for(let s=0;se}),xO._sb=new eu(1e5);class NO extends hA{constructor(e){super(e),this._visibleLines=new DO(this),this.domNode=this._visibleLines.domNode;const t=this._context.configuration.options.get(50);Hk(this.domNode,t),this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;ee.shouldRender()));for(let i=0,n=t.length;i'),n.appendString(s),n.appendString(""),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class IO extends NO{constructor(e){super(e);const t=this._context.configuration.options.get(143);this._contentWidth=t.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const t=this._context.configuration.options.get(143);return this._contentWidth=t.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 MO extends NO{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),Hk(this.domNode,t.get(50))}onConfigurationChanged(e){const t=this._context.configuration.options;Hk(this.domNode,t.get(50));const i=t.get(143);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 TO extends hA{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=Vk(document.createElement("div")),dA.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=Vk(document.createElement("div")),dA.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesDeleted(e){return this._updateAnchorsViewPositions(),!0}onLinesInserted(e){return this._updateAnchorsViewPositions(),!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}_updateAnchorsViewPositions(){const e=Object.keys(this._widgets);for(const t of e)this._widgets[t].updateAnchorViewPosition()}addWidget(e){const t=new RO(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,i,n,s){this._widgets[e.getId()].setPosition(t,i,n,s),this.setShouldRender()}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t];delete this._widgets[t];const i=e.domNode.domNode;i.parentNode.removeChild(i),i.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return!!this._widgets.hasOwnProperty(e)&&this._widgets[e].suppressMouseDown}onBeforeRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onBeforeRender(e)}prepareRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].prepareRender(e)}render(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].render(e)}}class RO{constructor(e,t,i){this._primaryAnchor=new AO(null,null),this._secondaryAnchor=new AO(null,null),this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=Vk(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=this._actual.allowEditorOverflow||!1,this.suppressMouseDown=this._actual.suppressMouseDown||!1;const n=this._context.configuration.options,s=n.get(143);this._fixedOverflowWidgets=n.get(42),this._contentWidth=s.contentWidth,this._contentLeft=s.contentLeft,this._lineHeight=n.get(66),this._affinity=null,this._preference=[],this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),this.domNode.setDisplay("none"),this.domNode.setVisibility("hidden"),this.domNode.setAttribute("widgetId",this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){const t=this._context.configuration.options;if(this._lineHeight=t.get(66),e.hasChanged(143)){const e=t.get(143);this._contentLeft=e.contentLeft,this._contentWidth=e.contentWidth,this._maxWidth=this._getMaxWidth()}}updateAnchorViewPosition(){this._setPosition(this._affinity,this._primaryAnchor.modelPosition,this._secondaryAnchor.modelPosition)}_setPosition(e,t,i){function n(e,t,i){if(!e)return new AO(null,null);const n=t.model.validatePosition(e);if(t.coordinatesConverter.modelPositionIsVisible(n)){const s=t.coordinatesConverter.convertModelPositionToViewPosition(n,null!=i?i:void 0);return new AO(e,s)}return new AO(e,null)}this._affinity=e,this._primaryAnchor=n(t,this._context.viewModel,this._affinity),this._secondaryAnchor=n(i,this._context.viewModel,this._affinity)}_getMaxWidth(){const e=this.domNode.domNode.ownerDocument,t=e.defaultView;return this.allowEditorOverflow?(null==t?void 0:t.innerWidth)||e.documentElement.offsetWidth||e.body.offsetWidth:this._contentWidth}setPosition(e,t,i,n){this._setPosition(n,e,t),this._preference=i,this._primaryAnchor.viewPosition&&this._preference&&this._preference.length>0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,n){const s=e.top,o=s,r=e.top+e.height,a=s-i,l=o>=i,h=r,d=n.viewportHeight-r>=i;let c=e.left;return c+t>n.scrollLeft+n.viewportWidth&&(c=n.scrollLeft+n.viewportWidth-t),cr){const e=l-(r-n);l-=e,i-=e}if(l=22,_=u+i<=g.height-22;return this._fixedOverflowWidgets?{fitsAbove:f,aboveTop:Math.max(c,22),fitsBelow:_,belowTop:u,left:m}:{fitsAbove:f,aboveTop:r,fitsBelow:_,belowTop:a,left:p}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new OO(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var t,i;return{primary:n(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),secondary:n((null===(t=this._secondaryAnchor.viewPosition)||void 0===t?void 0:t.lineNumber)===(null===(i=this._primaryAnchor.viewPosition)||void 0===i?void 0:i.lineNumber)?this._secondaryAnchor.viewPosition:null,this._affinity,this._lineHeight)};function n(t,i,n){if(!t)return null;const s=e.visibleRangeForPosition(t);if(!s)return null;const o=1===t.column&&3===i?0:s.left,r=e.getVerticalOffsetForLineNumber(t.lineNumber)-e.scrollTop;return new PO(r,o,n)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const n=this._context.configuration.options.get(50);let s=t.left;return s=se.endLineNumber||this.domNode.setMaxWidth(this._maxWidth))}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData)return this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),void("function"==typeof this._actual.afterRender&&FO(this._actual.afterRender,this._actual,null));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),"function"==typeof this._actual.afterRender&&FO(this._actual.afterRender,this._actual,this._renderData.position)}}class AO{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class OO{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class PO{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function FO(e,t,...i){try{return e.call(t,...i)}catch(ge){return null}}class BO extends gO{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(143);this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new Ah(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=this._selections.map((e=>e.positionLineNumber));t.sort(((e,t)=>e-t)),Td(this._cursorLineNumbers,t)||(this._cursorLineNumbers=t,e=!0);const i=this._selections.every((e=>e.isEmpty()));return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);return this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),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)}prepareRender(e){if(!this._shouldRenderThis())return void(this._renderData=null);const t=this._renderOne(e),i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,s=this._cursorLineNumbers.length;let o=0;const r=[];for(let a=i;a<=n;a++){const e=a-i;for(;o=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return("gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class WO extends BO{_renderOne(e){return`
    `}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class VO extends BO{_renderOne(e){return`
    `}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}H_(((e,t)=>{const i=e.getColor(U_);if(i&&(t.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${i}; border: none; }`)),!i||i.isTransparent()||e.defines(K_)){const i=e.getColor(K_);i&&(t.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${i}; }`),A_(e.type)&&(t.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"),t.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")))}}));class HO extends gO{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=t.get(50).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._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=t.get(50).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 a=0,l=t.length;a{if(e.options.zIndext.options.zIndex)return 1;const i=e.options.className,n=t.options.className;return in?1:Rh.compareRangesUsingStarts(e.range,t.range)}));const s=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber,r=[];for(let a=s;a<=o;a++){r[a-s]=""}this._renderWholeLineDecorations(e,i,r),this._renderNormalDecorations(e,i,r),this._renderResult=r}_renderWholeLineDecorations(e,t,i){const n=String(this._lineHeight),s=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber;for(let r=0,a=t.length;r',l=Math.max(e.range.startLineNumber,s),h=Math.min(e.range.endLineNumber,o);for(let t=l;t<=h;t++){i[t-s]+=a}}}_renderNormalDecorations(e,t,i){var n;const s=String(this._lineHeight),o=e.visibleRange.startLineNumber;let r=null,a=!1,l=null,h=!1;for(let d=0,c=t.length;d';a[t]+=d}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class zO extends hA{constructor(e,t,i,n){super(e);const s=this._context.configuration.options,o=s.get(102),r=s.get(74),a=s.get(40),l=s.get(105),h={listenOnDomNode:i.domNode,className:"editor-scrollable "+B_(e.theme.type),useShadows:!1,lazyRender:!0,vertical:o.vertical,horizontal:o.horizontal,verticalHasArrows:o.verticalHasArrows,horizontalHasArrows:o.horizontalHasArrows,verticalScrollbarSize:o.verticalScrollbarSize,verticalSliderSize:o.verticalSliderSize,horizontalScrollbarSize:o.horizontalScrollbarSize,horizontalSliderSize:o.horizontalSliderSize,handleMouseWheel:o.handleMouseWheel,alwaysConsumeMouseWheel:o.alwaysConsumeMouseWheel,arrowSize:o.arrowSize,mouseWheelScrollSensitivity:r,fastScrollSensitivity:a,scrollPredominantAxis:l,scrollByPage:o.scrollByPage};this.scrollbar=this._register(new AD(t.domNode,h,this._context.viewLayout.getScrollable())),dA.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=Vk(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const d=(e,t,i)=>{const n={};if(t){const t=e.scrollTop;t&&(n.scrollTop=this._context.viewLayout.getCurrentScrollTop()+t,e.scrollTop=0)}if(i){const t=e.scrollLeft;t&&(n.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+t,e.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(n,1)};this._register(En(i.domNode,"scroll",(e=>d(i.domNode,!0,!0)))),this._register(En(t.domNode,"scroll",(e=>d(t.domNode,!0,!1)))),this._register(En(n.domNode,"scroll",(e=>d(n.domNode,!0,!1)))),this._register(En(this.scrollbarDomNode.domNode,"scroll",(e=>d(this.scrollbarDomNode.domNode,!0,!1))))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(143);this.scrollbarDomNode.setLeft(t.contentLeft);"right"===e.get(72).side?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(102)||e.hasChanged(74)||e.hasChanged(40)){const e=this._context.configuration.options,t=e.get(102),i=e.get(74),n=e.get(40),s=e.get(105),o={vertical:t.vertical,horizontal:t.horizontal,verticalScrollbarSize:t.verticalScrollbarSize,horizontalScrollbarSize:t.horizontalScrollbarSize,scrollByPage:t.scrollByPage,handleMouseWheel:t.handleMouseWheel,mouseWheelScrollSensitivity:i,fastScrollSensitivity:n,scrollPredominantAxis:s};this.scrollbar.updateOptions(o)}return e.hasChanged(143)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+B_(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class UO extends gO{constructor(e){super(),this._context=e,this._primaryPosition=null;const t=this._context.configuration.options,i=t.get(144),n=t.get(50);this._lineHeight=t.get(66),this._spaceWidth=n.spaceWidth,this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(16),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,i=t.get(144),n=t.get(50);return this._lineHeight=t.get(66),this._spaceWidth=n.spaceWidth,this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(16),!0}onCursorStateChanged(e){var t;const i=e.selections[0].getPosition();return!(null===(t=this._primaryPosition)||void 0===t?void 0:t.equals(i))&&(this._primaryPosition=i,!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}onLanguageConfigurationChanged(e){return!0}prepareRender(e){var t,i,n,s;if(!this._bracketPairGuideOptions.indentation&&!1===this._bracketPairGuideOptions.bracketPairs)return void(this._renderResult=null);const o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=e.scrollWidth,l=this._lineHeight,h=this._primaryPosition,d=this.getGuidesByLine(o,Math.min(r+1,this._context.viewModel.getLineCount()),h),c=[];for(let u=o;u<=r;u++){const r=u-o,h=d[r];let g="";const p=null!==(i=null===(t=e.visibleRangeForPosition(new Va(u,1)))||void 0===t?void 0:t.left)&&void 0!==i?i:0;for(const t of h){const i=-1===t.column?p+(t.visibleColumn-1)*this._spaceWidth:e.visibleRangeForPosition(new Va(u,t.column)).left;if(i>a||this._maxIndentLeft>0&&i>this._maxIndentLeft)break;const o=t.horizontalLine?t.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",r=t.horizontalLine?(null!==(s=null===(n=e.visibleRangeForPosition(new Va(u,t.horizontalLine.endColumn)))||void 0===n?void 0:n.left)&&void 0!==s?s:i+this._spaceWidth)-i:this._spaceWidth;g+=`
    `}c[r]=g}this._renderResult=c}getGuidesByLine(e,t,i){const n=!1!==this._bracketPairGuideOptions.bracketPairs?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:!0===this._bracketPairGuideOptions.bracketPairsHorizontal?Qv.Enabled:"active"===this._bracketPairGuideOptions.bracketPairsHorizontal?Qv.EnabledForActive:Qv.Disabled,includeInactive:!0===this._bracketPairGuideOptions.bracketPairs}):null,s=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let o=0,r=0,a=0;if(!1!==this._bracketPairGuideOptions.highlightActiveIndentation&&i){const n=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);o=n.startLineNumber,r=n.endLineNumber,a=n.indent}const{indentSize:l}=this._context.viewModel.model.getOptions(),h=[];for(let d=e;d<=t;d++){const t=new Array;h.push(t);const i=n?n[d-e]:[],c=new ic(i),u=s?s[d-e]:0;for(let e=1;e<=u;e++){const n=(e-1)*l+1,s=("always"===this._bracketPairGuideOptions.highlightActiveIndentation||0===i.length)&&o<=d&&d<=r&&e===a;t.push(...c.takeWhile((e=>e.visibleColumn!0))||[])}return h}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function KO(e){if(!e||!e.isTransparent())return e}H_(((e,t)=>{const i=[{bracketColor:bv,guideColor:Dv,guideColorActive:Tv},{bracketColor:Cv,guideColor:xv,guideColorActive:Rv},{bracketColor:wv,guideColor:Nv,guideColorActive:Av},{bracketColor:yv,guideColor:Ev,guideColorActive:Ov},{bracketColor:Sv,guideColor:Iv,guideColorActive:Pv},{bracketColor:Lv,guideColor:Mv,guideColorActive:Fv}],n=new ib,s=[{indentColor:X_,indentColorActive:nv},{indentColor:Q_,indentColorActive:sv},{indentColor:J_,indentColorActive:ov},{indentColor:ev,indentColorActive:rv},{indentColor:tv,indentColorActive:av},{indentColor:iv,indentColorActive:lv}],o=i.map((t=>{var i,n;const s=e.getColor(t.bracketColor),o=e.getColor(t.guideColor),r=e.getColor(t.guideColorActive),a=KO(null!==(i=KO(o))&&void 0!==i?i:null==s?void 0:s.transparent(.3)),l=KO(null!==(n=KO(r))&&void 0!==n?n:s);if(a&&l)return{guideColor:a,guideColorActive:l}})).filter(Kr),r=s.map((t=>{const i=e.getColor(t.indentColor),n=e.getColor(t.indentColorActive),s=KO(i),o=KO(n);if(s&&o)return{indentColor:s,indentColorActive:o}})).filter(Kr);if(o.length>0){for(let e=0;e<30;e++){const i=o[e%o.length];t.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(e).replace(/ /g,".")} { --guide-color: ${i.guideColor}; --guide-color-active: ${i.guideColorActive}; }`)}t.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),t.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),t.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),t.addRule(`.monaco-editor .vertical.${n.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),t.addRule(`.monaco-editor .horizontal-top.${n.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),t.addRule(`.monaco-editor .horizontal-bottom.${n.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(r.length>0){for(let e=0;e<30;e++){const i=r[e%r.length];t.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${e} { --indent-color: ${i.indentColor}; --indent-color-active: ${i.indentColorActive}; }`)}t.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),t.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}}));class jO{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 qO{constructor(){this._currentVisibleRange=new Rh(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class $O{constructor(e,t,i,n,s,o,r){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=n,this.startScrollTop=s,this.stopScrollTop=o,this.scrollType=r,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class GO{constructor(e,t,i,n,s){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=n,this.scrollType=s,this.type="selections";let o=t[0].startLineNumber,r=t[0].endLineNumber;for(let a=1,l=t.length;a{this._updateLineWidthsSlow()}),200),this._asyncCheckMonospaceFontAssumptions=new rd((()=>{this._checkMonospaceFontAssumptions()}),2e3),this._lastRenderedData=new qO,this._horizontalRevealRequest=null,this._stickyScrollEnabled=n.get(114).enabled,this._maxNumberStickyLines=n.get(114).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new BA(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(144)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(50),n=t.get(144);return this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.isViewportWrapping,this._revealHorizontalRightPadding=t.get(99),this._cursorSurroundingLines=t.get(29),this._cursorSurroundingLinesStyle=t.get(30),this._canUseLayerHinting=!t.get(32),this._stickyScrollEnabled=t.get(114).enabled,this._maxNumberStickyLines=t.get(114).maxLineCount,Hk(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(143)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new FA(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const e=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let t=e;t<=i;t++){this._visibleLines.getVisibleLine(t).onOptionsChanged(this._viewLineOptions)}return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=!1;for(let s=t;s<=i;s++)n=this._visibleLines.getVisibleLine(s).onSelectionChanged()||n;return n}onDecorationsChanged(e){{const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++)this._visibleLines.getVisibleLine(i).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(-1===t)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 $O(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 GO(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const n=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,n),!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(null===i)return null;const n=this._getLineNumberFor(i);if(-1===n)return null;if(n<1||n>this._context.viewModel.getLineCount())return null;if(1===this._context.viewModel.getLineMaxColumn(n))return new Va(n,1);const s=this._visibleLines.getStartLineNumber(),o=this._visibleLines.getEndLineNumber();if(no)return null;let r=this._visibleLines.getVisibleLine(n).getColumnOfNodeOffset(e,t);const a=this._context.viewModel.getLineMinColumn(n);return ri)return-1;const n=new jO(this.domNode.domNode,this._textRangeRestingSpot),s=this._visibleLines.getVisibleLine(e).getWidth(n);return this._updateLineWidthsSlowIfDomDidLayout(n),s}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,n=Rh.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;const s=[];let o=0;const r=new jO(this.domNode.domNode,this._textRangeRestingSpot);let a=0;t&&(a=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Va(n.startLineNumber,1)).lineNumber);const l=this._visibleLines.getStartLineNumber(),h=this._visibleLines.getEndLineNumber();for(let d=n.startLineNumber;d<=n.endLineNumber;d++){if(dh)continue;const e=d===n.startLineNumber?n.startColumn:1,c=d!==n.endLineNumber,u=c?this._context.viewModel.getLineMaxColumn(d):n.endColumn,g=this._visibleLines.getVisibleLine(d).getVisibleRangesForRange(d,e,u,r);if(g){if(t&&dthis._visibleLines.getEndLineNumber())return null;const n=new jO(this.domNode.domNode,this._textRangeRestingSpot),s=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,n);return this._updateLineWidthsSlowIfDomDidLayout(n),s}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new fA(t.outsideRenderedLine,t.ranges[0].left):null}_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,s=!0;for(let o=t;o<=i;o++){const t=this._visibleLines.getVisibleLine(o);!e||t.getWidthIsFast()?n=Math.max(n,t.getWidth(null)):s=!1}return s&&1===t&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(n),s}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let s=i;s<=n;s++){const i=this._visibleLines.getVisibleLine(s);if(i.needsMonospaceFontCheck()){const n=i.getWidth(null);n>t&&(t=n,e=s)}}if(-1!==e&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let s=i;s<=n;s++){this._visibleLines.getVisibleLine(s).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 t=this._horizontalRevealRequest;if(e.startLineNumber<=t.minLineNumber&&t.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const e=this._computeScrollLeftToReveal(t);e&&(this._isViewportWrapping||this._ensureMaxLineWidth(e.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:e.scrollLeft},t.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),Fe&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++){if(this._visibleLines.getVisibleLine(i).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 e=s[0].startLineNumber,t=s[0].endLineNumber;for(let i=1,n=s.length;ia){if(!h)return-1;u=d}else if(5===o||6===o)if(6===o&&r<=d&&c<=l)u=r;else{const e=d-Math.max(5*this._lineHeight,.2*a),t=c-a;u=Math.max(t,e)}else if(1===o||2===o)if(2===o&&r<=d&&c<=l)u=r;else{const e=(d+c)/2;u=Math.max(0,e-a/2)}else u=this._computeMinimumScrolling(r,l,d,c,3===o,4===o);return u}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(143),n=t.left,s=n+t.width-i.verticalScrollbarWidth;let o=1073741824,r=0;if("range"===e.type){const t=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!t)return null;for(const e of t.ranges)o=Math.min(o,Math.round(e.left)),r=Math.max(r,Math.round(e.left+e.width))}else for(const a of e.selections){if(a.startLineNumber!==a.endLineNumber)return null;const e=this._visibleRangesForLineRange(a.startLineNumber,a.startColumn,a.endColumn);if(!e)return null;for(const t of e.ranges)o=Math.min(o,Math.round(t.left)),r=Math.max(r,Math.round(t.left+t.width))}if(e.minimalReveal||(o=Math.max(0,o-ZO.HORIZONTAL_EXTRA_PX),r+=this._revealHorizontalRightPadding),"selections"===e.type&&r-o>t.width)return null;return{scrollLeft:this._computeMinimumScrolling(n,s,o,r),maxHorizontalOffset:r}}_computeMinimumScrolling(e,t,i,n,s,o){s=!!s,o=!!o;const r=(t|=0)-(e|=0);return(n|=0)-(i|=0)t?Math.max(0,n-r):e:i}}ZO.HORIZONTAL_EXTRA_PX=30;class YO{constructor(e,t,i,n){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i),this.zIndex=null!=n?n:0}}class XO{constructor(e,t){this.className=e,this.zIndex=t}}class QO{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class JO extends gO{_render(e,t,i){const n=[];for(let r=e;r<=t;r++){n[r-e]=new QO}if(0===i.length)return n;i.sort(((e,t)=>e.className===t.className?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.classNamen)continue;const o=Math.max(e.startLineNumber,i),r=Math.min(s.preference.lane,this._glyphMarginDecorationLaneCount);t.push(new iP(o,r,s.preference.zIndex,s))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort(((e,t)=>e.lineNumber===t.lineNumber?e.lane===t.lane?e.zIndex===t.zIndex?t.type===e.type?0===e.type&&0===t.type?e.className0;){const e=t.peek();if(!e)break;const n=t.takeWhile((t=>t.lineNumber===e.lineNumber&&t.lane===e.lane));if(!n||0===n.length)break;const s=n[0];if(0===s.type){const e=[];for(const t of n){if(t.zIndex!==s.zIndex||t.type!==s.type)break;0!==e.length&&e[e.length-1]===t.className||e.push(t.className)}i.push(s.accept(e.join(" ")))}else s.widget.renderInfo={lineNumber:s.lineNumber,lane:s.lane}}this._decorationGlyphsToRender=i}render(e){if(!this._glyphMargin){for(const e of Object.values(this._widgets))e.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;){const e=this._managedDomNodes.pop();null==e||e.domNode.remove()}return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const i of Object.values(this._widgets))if(i.renderInfo){const n=e.viewportData.relativeVerticalOffset[i.renderInfo.lineNumber-e.viewportData.startLineNumber],s=this._glyphMarginLeft+(i.renderInfo.lane-1)*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(n),i.domNode.setLeft(s),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}else i.domNode.setDisplay("none");for(let i=0;ithis._decorationGlyphsToRender.length;){const e=this._managedDomNodes.pop();null==e||e.domNode.remove()}}}class tP{constructor(e,t,i,n){this.lineNumber=e,this.lane=t,this.zIndex=i,this.className=n,this.type=0}accept(e){return new nP(this.lineNumber,this.lane,e)}}class iP{constructor(e,t,i,n){this.lineNumber=e,this.lane=t,this.zIndex=i,this.widget=n,this.type=1}}class nP{constructor(e,t,i){this.lineNumber=e,this.lane=t,this.combinedClassName=i}}class sP extends JO{constructor(e){super(),this._context=e;const t=this._context.configuration.options.get(143);this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,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.get(143);return this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.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 s=0,o=t.length;s',o=[];for(let r=t;r<=i;r++){const e=r-t,i=n[e].getDecorations();let a="";for(const t of i)a+='
    ';s[e]=r}this._renderResult=s}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class rP{constructor(e,t,i,n){this._rgba8Brand=void 0,this.r=rP._clamp(e),this.g=rP._clamp(t),this.b=rP._clamp(i),this.a=rP._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:0|e}}rP.Empty=new rP(0,0,0,0);class aP extends E{static getInstance(){return this._INSTANCE||(this._INSTANCE=S(new aP)),this._INSTANCE}constructor(){super(),this._onDidChange=new U,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(EC.onDidChange((e=>{e.changedColorMap&&this._updateColorMap()})))}_updateColorMap(){const e=EC.getColorMap();if(!e)return this._colors=[rP.Empty],void(this._backgroundIsLight=!0);this._colors=[rP.Empty];for(let i=1;i=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}aP._INSTANCE=null;class lP{constructor(e,t,i,n){this._viewportBrand=void 0,this.top=0|e,this.left=0|t,this.width=0|i,this.height=0|n}}class hP{constructor(e,t){this.tabSize=e,this.data=t}}class dP{constructor(e,t,i,n,s,o,r){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=n,this.startVisibleColumn=s,this.tokens=o,this.inlineDecorations=r}}class cP{constructor(e,t,i,n,s,o,r,a,l,h){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=n,this.isBasicASCII=cP.isBasicASCII(i,o),this.containsRTL=cP.containsRTL(i,this.isBasicASCII,s),this.tokens=r,this.inlineDecorations=a,this.tabSize=l,this.startVisibleColumn=h}static isBasicASCII(e,t){return!t||To(e)}static containsRTL(e,t,i){return!(t||!i)&&Io(e)}}class uP{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class gP{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=n}toInlineDecoration(e){return new uP(new Rh(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class pP{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class mP{constructor(e,t,i){this.color=e,this.zIndex=t,this.data=i}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.colort.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&Td(e.data,t.data)}static equalsArr(e,t){return Td(e,t,mP.equals)}}const fP=(()=>{const e=[];for(let t=32;t<=126;t++)e.push(t);return e.push(65533),e})();class _P{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=_P.soften(e,.8),this.charDataLight=_P.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let n=0,s=e.length;ne.width||i+g>e.height)return void console.warn("bad render request outside image data");const p=h?this.charDataLight:this.charDataNormal,m=((e,t)=>(e-=32)<0||e>96?t<=2?(e+96)%96:95:e)(n,l),f=4*e.width,_=r.r,v=r.g,b=r.b,C=s.r-_,w=s.g-v,y=s.b-b,S=Math.max(o,a),L=e.data;let k=m*c*u,D=i*f+4*t;for(let x=0;xe.width||i+d>e.height)return void console.warn("bad render request outside image data");const c=4*e.width,u=s/255*.5,g=o.r,p=o.g,m=o.b,f=g+(n.r-g)*u,_=p+(n.g-p)*u,v=m+(n.b-m)*u,b=Math.max(s,r),C=e.data;let w=i*c+4*t;for(let y=0;y{const t=new Uint8ClampedArray(e.length/2);for(let i=0;i>1]=vP[e[i]]<<4|15&vP[e[i+1]];return t},CP={1:_((()=>bP("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792"))),2:_((()=>bP("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126")))};class wP{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return i=CP[e]?new _P(CP[e](),e):wP.createFromSampleData(wP.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="16px",t.height=16,t.width=960,t.style.width="960px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let n=0;for(const s of fP)i.fillText(String.fromCharCode(s),n,8),n+=10;return i.getImageData(0,0,960,16)}static createFromSampleData(e,t){if(61440!==e.length)throw new Error("Unexpected source in MinimapCharRenderer");const i=wP._downsample(e,t);return new _P(i,t)}static _downsampleChar(e,t,i,n,s){const o=1*s,r=2*s;let a=n,l=0;for(let h=0;h0){const e=255/a;for(let t=0;twP.create(this.fontScale,a.fontFamily))),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=yP._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=yP._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(b_);return i?new rP(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(C_);return t?rP._clamp(Math.round(255*t.rgba.a)):255}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.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class SP{constructor(e,t,i,n,s,o,r,a,l){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=n,this.sliderTop=s,this.sliderHeight=o,this.topPaddingLineCount=r,this.startLineNumber=a,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,s,o,r,a,l,h,d){const c=e.pixelRatio,u=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/u),p=e.lineHeight;if(e.minimapHeightIsEditorHeight){let t=a*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(t+=Math.max(0,s-e.lineHeight-e.paddingBottom));const i=Math.max(1,Math.floor(s*s/t)),n=Math.max(0,e.minimapHeight-i),o=n/(h-s),d=l*o,c=n>0,u=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),g=Math.floor(e.paddingTop/e.lineHeight);return new SP(l,h,c,o,d,i,g,1,Math.min(r,u))}let m;if(o&&i!==r){const e=i-t+1;m=Math.floor(e*u/c)}else{const e=s/p;m=Math.floor(e*u/c)}const f=Math.floor(e.paddingTop/p);let _,v=Math.floor(e.paddingBottom/p);if(e.scrollBeyondLastLine){const e=s/p;v=Math.max(v,e-1)}if(v>0){_=(f+r+v-s/p-1)*u/c}else _=Math.max(0,(f+r)*u/c-m);_=Math.min(e.minimapHeight-m,_);const b=_/(h-s),C=l*b;if(g>=f+r+v){return new SP(l,h,_>0,b,C,m,f,1,r)}{let i,s;i=t>1?t+f:Math.max(1,l/p);let o=Math.max(1,Math.floor(i-C*c/u));ol&&(o=Math.min(o,d.startLineNumber),s=Math.max(s,d.topPaddingLineCount)),d.scrollTop=e.paddingTop?(t-o+s+_)*u/c:l/e.paddingTop*(s+_)*u/c,new SP(l,h,!0,b,v,m,s,o,a)}}}class LP{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}LP.INVALID=new LP(-1);class kP{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new kO((()=>LP.INVALID)),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const t=this._renderedLines._get().lines;for(let i=0,n=t.length;i1){for(let t=0,i=n-1;t0&&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 s=this.minimapLines.length-1;s>=0&&!(this.minimapLines[s]=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=Boolean(this._samplingState),[t,i]=xP.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()}}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 s=0,o=t-e+1;s{e.preventDefault();if(0===this._model.options.renderMinimap)return;if(!this._lastRenderData)return;if("proportional"!==this._model.options.size){if(0===e.button&&this._lastRenderData){const t=Hn(this._slider.domNode),i=t.top+t.height/2;this._startSliderDragging(e,i,this._lastRenderData.renderedLayout)}return}const t=this._model.options.minimapLineHeight,i=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*e.offsetY;let n=Math.floor(i/t)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;n=Math.min(n,this._model.getLineCount()),this._model.revealLineNumber(n)})),this._sliderPointerMoveMonitor=new fD,this._sliderPointerDownListener=Mn(this._slider.domNode,os.POINTER_DOWN,(e=>{e.preventDefault(),e.stopPropagation(),0===e.button&&this._lastRenderData&&this._startSliderDragging(e,e.pageY,this._lastRenderData.renderedLayout)})),this._gestureDisposable=ZL.addTarget(this._domNode.domNode),this._sliderTouchStartListener=En(this._domNode.domNode,$L.Start,(e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(e))}),{passive:!1}),this._sliderTouchMoveListener=En(this._domNode.domNode,$L.Change,(e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(e)}),{passive:!1}),this._sliderTouchEndListener=Mn(this._domNode.domNode,$L.End,(e=>{e.preventDefault(),e.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 s=(e,s)=>{const o=Hn(this._domNode.domNode),r=Math.min(Math.abs(s-n),Math.abs(s-o.left),Math.abs(s-o.left-o.width));if(Oe&&r>140)return void this._model.setScrollTop(i.scrollTop);const a=e-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(a))};e.pageY!==t&&s(e.pageY,n),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,(e=>s(e.pageY,e.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"always"===this._model.options.showSlider?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 DP(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)}onLinesDeleted(e,t){var i;return null===(i=this._lastRenderData)||void 0===i||i.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var i;return null===(i=this._lastRenderData)||void 0===i||i.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(m_),this._renderDecorations=!0,!0}onTokensChanged(e){return!!this._lastRenderData&&this._lastRenderData.onTokensChanged(e)}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(0===this._model.options.renderMinimap)return this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),void this._sliderHorizontal.setHeight(0);e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const t=SP.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(t.sliderNeeded?"block":"none"),this._slider.setTop(t.sliderTop),this._slider.setHeight(t.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(t.sliderHeight),this.renderDecorations(t),this._lastRenderData=this.renderLines(t)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(Rh.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort(((e,t)=>(e.options.zIndex||0)-(t.options.zIndex||0)));const{canvasInnerWidth:n,canvasInnerHeight:s}=this._model.options,o=this._model.options.minimapLineHeight,r=this._model.options.minimapCharWidth,a=this._model.getOptions().tabSize,l=this._decorationsCanvas.domNode.getContext("2d");l.clearRect(0,0,n,s);const h=new IP(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(l,t,h,e,o),this._renderDecorationsLineHighlights(l,i,h,e,o);const d=new IP(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(l,t,d,e,o,a,r,n),this._renderDecorationsHighlights(l,i,d,e,o,a,r,n)}}_renderSelectionLineHighlights(e,t,i,n,s){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let o=0,r=0;for(const a of t){const t=n.intersectWithViewport(a);if(!t)continue;const[l,h]=t;for(let e=l;e<=h;e++)i.set(e,!0);const d=n.getYForLineNumber(l,s),c=n.getYForLineNumber(h,s);r>=d||(r>o&&e.fillRect(8,o,e.canvas.width,r-o),o=d),r=c}r>o&&e.fillRect(8,o,e.canvas.width,r-o)}_renderDecorationsLineHighlights(e,t,i,n,s){const o=new Map;for(let r=t.length-1;r>=0;r--){const a=t[r],l=a.options.minimap;if(!l||l.position!==yd.Inline)continue;const h=n.intersectWithViewport(a.range);if(!h)continue;const[d,c]=h,u=l.getColor(this._theme.value);if(!u||u.isTransparent())continue;let g=o.get(u.toString());g||(g=u.transparent(.5).toString(),o.set(u.toString(),g)),e.fillStyle=g;for(let t=d;t<=c;t++){if(i.has(t))continue;i.set(t,!0);const o=n.getYForLineNumber(d,s);e.fillRect(8,o,e.canvas.width,s)}}}_renderSelectionsHighlights(e,t,i,n,s,o,r,a){if(this._selectionColor&&!this._selectionColor.isTransparent())for(const l of t){const t=n.intersectWithViewport(l);if(!t)continue;const[h,d]=t;for(let c=h;c<=d;c++)this.renderDecorationOnLine(e,i,l,this._selectionColor,n,c,s,s,o,r,a)}}_renderDecorationsHighlights(e,t,i,n,s,o,r,a){for(const l of t){const t=l.options.minimap;if(!t)continue;const h=n.intersectWithViewport(l.range);if(!h)continue;const[d,c]=h,u=t.getColor(this._theme.value);if(u&&!u.isTransparent())for(let g=d;g<=c;g++)switch(t.position){case yd.Inline:this.renderDecorationOnLine(e,i,l.range,u,n,g,s,s,o,r,a);continue;case yd.Gutter:{const t=n.getYForLineNumber(g,s),i=2;this.renderDecoration(e,u,i,t,2,s);continue}}}}renderDecorationOnLine(e,t,i,n,s,o,r,a,l,h,d){const c=s.getYForLineNumber(o,a);if(c+r<0||c>this._model.options.canvasInnerHeight)return;const{startLineNumber:u,endLineNumber:g}=i,p=u===o?i.startColumn:1,m=g===o?i.endColumn:this._model.getLineMaxColumn(o),f=this.getXOffsetForPosition(t,o,p,l,h,d),_=this.getXOffsetForPosition(t,o,m,l,h,d);this.renderDecoration(e,n,f,c,_-f,r)}getXOffsetForPosition(e,t,i,n,s,o){if(1===i)return 8;if((i-1)*s>=o)return o;let r=e.get(t);if(!r){const i=this._model.getLineContent(t);r=[8];let a=8;for(let e=1;e=o){r[e]=o;break}r[e]=l,a=l}e.set(t,r)}return i-1b?Math.floor((n-b)/2):0,w=c.a/255,y=new rP(Math.round((c.r-d.r)*w+d.r),Math.round((c.g-d.g)*w+d.g),Math.round((c.b-d.b)*w+d.b),255);let S=e.topPaddingLineCount*n;const L=[];for(let x=0,N=i-t+1;x=0&&t_)return;const r=m.charCodeAt(C);if(9===r){const e=c-(C+w)%c;w+=e-1,b+=e*o}else if(32===r)b+=o;else{const c=Oo(r)?2:1;for(let u=0;u_)return}}}}}class IP{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let n=0,s=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]}}class MP extends hA{constructor(e){super(e);const t=this._context.configuration.options.get(143);this._widgets={},this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,this._domNode=Vk(document.createElement("div")),dA.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options.get(143);return this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,!0}addWidget(e){const t=Vk(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return i.preference===t?(this._updateMaxMinWidth(),!1):(i.preference=t,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t].domNode.domNode;delete this._widgets[t],e.parentNode.removeChild(e),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){var e,t;let i=0;const n=Object.keys(this._widgets);for(let s=0,o=n.length;s=3){const t=Math.floor(n/3),i=Math.floor(n/3),s=n-t-i,o=e+t;return[[0,e,o,e,e+t+s,e,o,e],[0,t,s,t+s,i,t+s+i,s+i,t+s+i]]}if(2===i){const t=Math.floor(n/2),i=n-t;return[[0,e,e,e,e+t,e,e,e],[0,t,t,t,i,t+i,t+i,t+i]]}return[[0,e,e,e,e,e,e,e],[0,n,n,n,n,n,n,n]]}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.cursorColor===e.cursorColor&&this.themeType===e.themeType&&lc.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}}class RP extends hA{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=Vk(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=EC.onDidChange((e=>{e.changedColorMap&&this._updateSettings(!0)})),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new TP(this._context.configuration,this._context.theme);return(!this._settings||!this._settings.equals(t))&&(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=2,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=1,!0}onConfigurationChanged(e){return!!this._updateSettings(!1)&&this._markRenderingIsNeeded()}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;te.lineNumber===t.lineNumber))||(this._actualShouldRender=2),1===this._actualShouldRender)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const i=this._settings.canvasWidth,n=this._settings.canvasHeight,s=this._settings.lineHeight,o=this._context.viewLayout,r=n/this._context.viewLayout.getScrollHeight(),a=6*this._settings.pixelRatio|0,l=a/2|0,h=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(h.fillStyle=lc.Format.CSS.formatHexA(e),h.fillRect(0,0,i,n)):(h.clearRect(0,0,i,n),h.fillStyle=lc.Format.CSS.formatHexA(e),h.fillRect(0,0,i,n)):h.clearRect(0,0,i,n);const d=this._settings.x,c=this._settings.w;for(const u of t){const e=u.color,t=u.data;h.fillStyle=e;let i=0,g=0,p=0;for(let u=0,m=t.length/3;un&&(e=n-l),_=e-l,v=e+l}_>p+1||e!==i?(0!==u&&h.fillRect(d[i],g,c[i],p-g),i=e,g=_,p=v):v>p&&(p=v)}h.fillRect(d[i],g,c[i],p-g)}if(!this._settings.hideCursor&&this._settings.cursorColor){const e=2*this._settings.pixelRatio|0,t=e/2|0,i=this._settings.x[7],s=this._settings.w[7];h.fillStyle=this._settings.cursorColor;let a=-100,l=-100;for(let d=0,c=this._cursorPositions.length;dn&&(u=n-t);const g=u-t,p=g+e;g>l+1?(0!==d&&h.fillRect(i,a,s,l-a),a=g,l=p):p>l&&(l=p)}h.fillRect(i,a,s,l-a)}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.stroke(),h.moveTo(0,0),h.lineTo(i,0),h.stroke())}}class AP{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=0|e,this.to=0|t,this.colorId=0|i}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 OP{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&&(u=i-g);const p=a.color;let m=this._color2Id[p];m||(m=++this._lastAssignedId,this._color2Id[p]=m,this._id2Color[m]=p);const f=new AP(u-g,u+g,m);a.setColorZone(f),o.push(f)}return this._colorZonesInvalid=!1,o.sort(AP.compare),o}}class FP extends lA{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=Vk(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new PP((e=>this._context.viewLayout.getVerticalOffsetForLineNumber(e))),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(66)),this._zoneManager.setPixelRatio(i.get(141)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(66)&&(this._zoneManager.setLineHeight(t.get(66)),this._render()),e.hasChanged(141)&&(this._zoneManager.setPixelRatio(t.get(141)),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(0===this._zoneManager.getOuterHeight())return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),n=this._zoneManager.getId2Color(),s=this._domNode.domNode.getContext("2d");return s.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(s,i,n,e),!0}_renderOneLane(e,t,i,n){let s=0,o=0,r=0;for(const a of t){const t=a.colorId,l=a.from,h=a.to;t!==s?(e.fillRect(0,o,n,r-o),s=t,e.fillStyle=i[s],o=l,r=h):r>=l?r=Math.max(r,h):(e.fillRect(0,o,n,r-o),o=l,r=h)}e.fillRect(0,o,n,r-o)}}class BP extends hA{constructor(e){super(e),this.domNode=Vk(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(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).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 e=Vk(document.createElement("div"));e.setClassName("view-ruler"),e.setWidth(n),this.domNode.appendChild(e),this._renderedRulers.push(e),s--}return}let i=e-t;for(;i>0;){const e=this._renderedRulers.pop();this.domNode.removeChild(e),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t0;return this._shouldShow!==e&&(this._shouldShow=e,!0)}getDomNode(){return this._domNode}_updateWidth(){const e=this._context.configuration.options.get(143);0===e.minimap.renderMinimap||e.minimap.minimapWidth>0&&0===e.minimap.minimapLeft?this._width=e.width:this._width=e.width-e.verticalScrollbarWidth}onConfigurationChanged(e){const t=this._context.configuration.options.get(102);return this._useShadows=t.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":"")}}class VP{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class HP{constructor(e,t){this.lineNumber=e,this.ranges=t}}function zP(e){return new VP(e)}function UP(e){return new HP(e.lineNumber,e.ranges.map(zP))}class KP extends gO{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(66),this._roundedSelection=t.get(100),this._typicalHalfwidthCharacterWidth=t.get(50).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._lineHeight=t.get(66),this._roundedSelection=t.get(100),this._typicalHalfwidthCharacterWidth=t.get(50).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 s=null,o=null;if(i&&i.length>0&&t.length>0){const n=t[0].lineNumber;if(n===e.startLineNumber)for(let e=0;!s&&e=0;e--)i[e].lineNumber===r&&(o=i[e].ranges[0]);s&&!s.startStyle&&(s=null),o&&!o.startStyle&&(o=null)}for(let r=0,a=t.length;r0){const e=t[r-1].ranges[0].left,s=t[r-1].ranges[0].left+t[r-1].ranges[0].width;jP(i-e)e&&(h.top=1),jP(l-s)'}_actualRenderOneSelection(e,t,i,n){if(0===n.length)return;const s=!!n[0].ranges[0].startStyle,o=this._lineHeight.toString(),r=(this._lineHeight-1).toString(),a=n[0].lineNumber,l=n[n.length-1].lineNumber;for(let h=0,d=n.length;h1,r)}this._previousFrameVisibleRangesWithStyle=s,this._renderResult=t.map((([e,t])=>e+t))}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function jP(e){return e<0?-e:e}KP.SELECTION_CLASS_NAME="selected-text",KP.SELECTION_TOP_LEFT="top-left-radius",KP.SELECTION_BOTTOM_LEFT="bottom-left-radius",KP.SELECTION_TOP_RIGHT="top-right-radius",KP.SELECTION_BOTTOM_RIGHT="bottom-right-radius",KP.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",KP.ROUNDED_PIECE_WIDTH=10,H_(((e,t)=>{const i=e.getColor(Wm);i&&!i.isTransparent()&&t.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${i}; }`)}));class qP{constructor(e,t,i,n,s,o,r){this.top=e,this.left=t,this.paddingLeft=i,this.width=n,this.height=s,this.textContent=o,this.textContentClassName=r}}class $P{constructor(e){this._context=e;const t=this._context.configuration.options,i=t.get(50);this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=Vk(document.createElement("div")),this._domNode.setClassName(`cursor ${fO}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Hk(this._domNode,i),this._domNode.setDisplay("none"),this._position=new Va(1,1),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}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(50);return this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),Hk(this._domNode,i),!0}onCursorPositionChanged(e,t){return this._domNode.domNode.style.transitionProperty=t?"none":"",this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[n,s]=function(e,t){t>0&&yo(e.charCodeAt(t))&&t--;const i=t+xo(e,t);return[i-No(e,i),i]}(i,t-1);return[new Va(e,n+1),i.substring(n,s)]}_prepareRender(e){let t="",i="";const[n,s]=this._getGraphemeAwarePosition();if(this._cursorStyle===IS.Line||this._cursorStyle===IS.LineThin){const o=e.visibleRangeForPosition(n);if(!o||o.outsideRenderedLine)return null;let r;this._cursorStyle===IS.Line?(r=bs(this._lineCursorWidth>0?this._lineCursorWidth:2),r>2&&(t=s,i=this._getTokenClassName(n))):r=bs(1);let a=o.left,l=0;r>=2&&a>=1&&(l=1,a-=l);const h=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta;return new qP(h,a,l,r,this._lineHeight,t,i)}const o=e.linesVisibleRangesForRange(new Rh(n.lineNumber,n.column,n.lineNumber,n.column+s.length),!1);if(!o||0===o.length)return null;const r=o[0];if(r.outsideRenderedLine||0===r.ranges.length)return null;const a=r.ranges[0],l="\t"===s||a.width<1?this._typicalHalfwidthCharacterWidth:a.width;this._cursorStyle===IS.Block&&(t=s,i=this._getTokenClassName(n));let h=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta,d=this._lineHeight;return this._cursorStyle!==IS.Underline&&this._cursorStyle!==IS.UnderlineThin||(h+=this._lineHeight-2,d=2),new qP(h,a.left,0,l,d,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 ${fO} ${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)}}class GP extends hA{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(90),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new $P(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=Vk(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 sd,this._cursorFlatBlinkInterval=new od,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(90),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,n=this._secondaryCursors.length;it.length){const e=this._secondaryCursors.length-t.length;for(let t=0;t{for(let i=0,n=e.ranges.length;i{this._isVisible?this._hide():this._show()}),GP.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet((()=>{this._blinkingEnabled=!0,this._updateDomClassName()}),GP.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case IS.Line:e+=" cursor-line-style";break;case IS.Block:e+=" cursor-block-style";break;case IS.Underline:e+=" cursor-underline-style";break;case IS.LineThin:e+=" cursor-line-thin-style";break;case IS.BlockOutline:e+=" cursor-block-outline-style";break;case IS.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return"on"!==this._cursorSmoothCaretAnimation&&"explicit"!==this._cursorSmoothCaretAnimation||(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e{const i=e.getColor(j_);if(i){let n=e.getColor(q_);n||(n=i.opposite()),t.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${i}; border-color: ${i}; color: ${n}; }`),A_(e.type)&&t.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${n}; border-right: 1px solid ${n}; }`)}}));const ZP=()=>{throw new Error("Invalid change accessor")};class YP extends hA{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._lineHeight=t.get(66),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=Vk(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=Vk(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((e=>{const n=Object.keys(this._zones);for(let s=0,o=n.length;s{const n={addZone:e=>(t=!0,this._addZone(i,e)),removeZone:e=>{e&&(t=this._removeZone(i,e)||t)},layoutZone:e=>{e&&(t=this._layoutZone(i,e)||t)}};!function(e,t){try{return e(t)}catch(Mre){r(Mre)}}(e,n),n.addZone=ZP,n.removeZone=ZP,n.layoutZone=ZP})),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),n={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:Vk(t.domNode),marginDomNode:t.marginDomNode?Vk(t.marginDomNode):null};return this._safeCallOnComputedHeight(n.delegate,i.heightInPx),n.domNode.setPosition("absolute"),n.domNode.domNode.style.width="100%",n.domNode.setDisplay("none"),n.domNode.setAttribute("monaco-view-zone",n.whitespaceId),this.domNode.appendChild(n.domNode),n.marginDomNode&&(n.marginDomNode.setPosition("absolute"),n.marginDomNode.domNode.style.width="100%",n.marginDomNode.setDisplay("none"),n.marginDomNode.setAttribute("monaco-view-zone",n.whitespaceId),this.marginDomNode.appendChild(n.marginDomNode)),this._zones[n.whitespaceId]=n,this.setShouldRender(),n.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.parentNode.removeChild(i.domNode.domNode),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.parentNode.removeChild(i.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],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){if(this._zones.hasOwnProperty(e)){const t=this._zones[e];return Boolean(t.delegate.suppressMouseDown)}return!1}_heightInPixels(e){return"number"==typeof e.heightInPx?e.heightInPx:"number"==typeof e.heightInLines?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return"number"==typeof e.minWidthInPx?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if("function"==typeof e.onComputedHeight)try{e.onComputedHeight(t)}catch(Mre){r(Mre)}}_safeCallOnDomNodeTop(e,t){if("function"==typeof e.onDomNodeTop)try{e.onDomNodeTop(t)}catch(Mre){r(Mre)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let n=!1;for(const o of t)this._zones[o.id].isInHiddenArea||(i[o.id]=o,n=!0);const s=Object.keys(this._zones);for(let o=0,r=s.length;oo)continue;const e=t.startLineNumber===o?t.startColumn:i.minColumn,s=t.endLineNumber===o?t.endColumn:i.maxColumn;e=S.endOffset&&(y++,S=i&&i[y]),9!==n&&32!==n)continue;if(c&&!C&&k<=v)continue;if(d&&k>=w&&k<=v&&32===n){const e=k-1>=0?r.charCodeAt(k-1):0,t=k+1=0?r.charCodeAt(k-1):0;if(32===n&&32!==e&&9!==e)continue}if(i&&(!S||S.startOffset>k||S.endOffset<=k))continue;const s=e.visibleRangeForPosition(new Va(t,k+1));s&&(o?(L=Math.max(L,s.left),b+=9===n?this._renderArrow(u,m,s.left):``):b+=9===n?`
    ${_?String.fromCharCode(65515):String.fromCharCode(8594)}
    `:`
    ${String.fromCharCode(f)}
    `)}return o?(L=Math.round(L+m),``+b+""):b}_renderArrow(e,t,i){const n=e/2,s=i,o={x:0,y:t/7/2},r={x:.8*t,y:o.y},a={x:r.x-.2*r.x,y:r.y+.2*r.x},l={x:a.x+.1*r.x,y:a.y+.1*r.x},h={x:l.x+.35*r.x,y:l.y-.35*r.x};return``}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class iF{constructor(e){const t=e.options,i=t.get(50),n=t.get(38);"off"===n?(this.renderWhitespace="none",this.renderWithSVG=!1):"svg"===n?(this.renderWhitespace=t.get(98),this.renderWithSVG=!0):(this.renderWhitespace=t.get(98),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(66),this.stopRenderingLineAfter=t.get(116)}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}}var nF=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},sF=function(e,t){return function(i,n){t(i,n,e)}};let oF=class extends lA{constructor(e,t,i,n,s,o,r){super(),this._instantiationService=r,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new Ah(1,1,1,1)],this._renderAnimationFrame=null;const a=new SO(t,n,s,e);this._context=new QP(t,i,n),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(yO,this._context,a,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=Vk(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=Vk(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=Vk(document.createElement("div")),dA.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new zO(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new ZO(this._context,this._linesContent),this._viewZones=new YP(this._context),this._viewParts.push(this._viewZones);const l=new RP(this._context);this._viewParts.push(l);const h=new WP(this._context);this._viewParts.push(h);const d=new IO(this._context);this._viewParts.push(d),d.addDynamicOverlay(new WO(this._context)),d.addDynamicOverlay(new KP(this._context)),d.addDynamicOverlay(new UO(this._context)),d.addDynamicOverlay(new HO(this._context)),d.addDynamicOverlay(new tF(this._context));const c=new MO(this._context);this._viewParts.push(c),c.addDynamicOverlay(new VO(this._context)),c.addDynamicOverlay(new oP(this._context)),c.addDynamicOverlay(new sP(this._context)),c.addDynamicOverlay(new pO(this._context)),this._glyphMarginWidgets=new eP(this._context),this._viewParts.push(this._glyphMarginWidgets);const u=new mO(this._context);u.getDomNode().appendChild(this._viewZones.marginDomNode),u.getDomNode().appendChild(c.getDomNode()),u.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(u),this._contentWidgets=new TO(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new GP(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new MP(this._context),this._viewParts.push(this._overlayWidgets);const g=new BP(this._context);this._viewParts.push(g);const p=new eF(this._context);this._viewParts.push(p);const m=new NP(this._context);if(this._viewParts.push(m),l){const e=this._scrollbar.getOverviewRulerLayoutInfo();e.parent.insertBefore(l.getDomNode(),e.insertBefore)}this._linesContent.appendChild(d.getDomNode()),this._linesContent.appendChild(g.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(u.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(h.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(m.getDomNode()),this._overflowGuardContainer.appendChild(p.domNode),this.domNode.appendChild(this._overflowGuardContainer),o?o.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode):this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this._applyLayout(),this._pointerHandler=this._register(new uO(this._context,a,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._shouldRecomputeGlyphMarginLanes&&(this._shouldRecomputeGlyphMarginLanes=!1,this._context.configuration.setGlyphMarginDecorationLaneCount(this._computeGlyphMarginLaneCount())),Wy.onRenderStart(),this._renderNow()}_computeGlyphMarginLaneCount(){const e=this._context.viewModel.model;let t=[];t=t.concat(e.getAllMarginDecorations().map((e=>{var t,i;const n=null!==(i=null===(t=e.options.glyphMargin)||void 0===t?void 0:t.position)&&void 0!==i?i:wd.Left;return{range:e.range,lane:n}}))),t=t.concat(this._glyphMarginWidgets.getWidgets().map((t=>({range:e.validateRange(t.preference.range),lane:t.preference.lane})))),t.sort(((e,t)=>Rh.compareRangesUsingStarts(e.range,t.range)));let i=null,n=null;for(const s of t)if(s.lane===wd.Left&&(!i||Rh.compareRangesUsingEnds(i,s.range)<0)&&(i=s.range),s.lane===wd.Right&&(!n||Rh.compareRangesUsingEnds(n,s.range)<0)&&(n=s.range),i&&n){if(i.endLineNumber{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new ZA(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 Va(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){const e=this._context.configuration.options.get(143);this.domNode.setWidth(e.width),this.domNode.setHeight(e.height),this._overflowGuardContainer.setWidth(e.width),this._overflowGuardContainer.setHeight(e.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(140)+" "+B_(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(){null!==this._renderAnimationFrame&&(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(){null===this._renderAnimationFrame&&(this._renderAnimationFrame=Rn(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){!function(e){try{return e()}catch(Mre){r(Mre)}}((()=>this._actualRender()))}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_actualRender(){if(!xn(this.domNode.domNode))return;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&0===e.length)return;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new JP(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender());const n=new uA(this._context.viewLayout,i,this._viewLines);for(const s of e)s.prepareRender(n);for(const s of e)s.render(n),s.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},1),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 s=this._viewLines.visibleRangeForPosition(new Va(n.lineNumber,n.column));return s?s.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?LO.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new FP(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const e of this._viewParts)e.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._textAreaHandler.writeScreenReaderContent(e)}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){var t,i,n,s,o,r,a,l;this._contentWidgets.setWidgetPosition(e.widget,null!==(i=null===(t=e.position)||void 0===t?void 0:t.position)&&void 0!==i?i:null,null!==(s=null===(n=e.position)||void 0===n?void 0:n.secondaryPosition)&&void 0!==s?s:null,null!==(r=null===(o=e.position)||void 0===o?void 0:o.preference)&&void 0!==r?r:null,null!==(l=null===(a=e.position)||void 0===a?void 0:a.positionAffinity)&&void 0!==l?l: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){const t=e.position?e.position.preference:null;this._overlayWidgets.setWidgetPosition(e.widget,t)&&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()}};oF=nF([sF(6,Fa)],oF);class rF{constructor(e,t,i,n,s,o){this.id=e,this.label=t,this.alias=i,this._precondition=n,this._run=s,this._contextKeyService=o}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}const aF={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"};class lF{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new $w(new Rh(1,1,1,1),0,0,new Va(1,1),0),new $w(new Rh(1,1,1,1),0,0,new Va(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,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new Kw(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?Ah.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):Ah.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,2)}static _validateViewState(e,t){const i=t.position,n=t.selectionStart.getStartPosition(),s=t.selectionStart.getEndPosition(),o=e.normalizePosition(i,2),r=this._validatePositionWithCache(e,n,i,o),a=this._validatePositionWithCache(e,s,n,r);return i.equals(o)&&n.equals(r)&&s.equals(a)?t:new $w(Rh.fromPositions(r,a),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+n.column-r.column,o,t.leftoverVisibleColumns+i.column-o.column)}_setState(e,t,i){if(i&&(i=lF._validateViewState(e.viewModel,i)),t){const i=e.model.validateRange(t.selectionStart),n=t.selectionStart.equalsRange(i)?t.selectionStartLeftoverVisibleColumns:0,s=e.model.validatePosition(t.position),o=t.position.equals(s)?t.leftoverVisibleColumns:0;t=new $w(i,t.selectionStartKind,n,s,o)}else{if(!i)return;const n=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),s=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new $w(n,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,s,i.leftoverVisibleColumns)}if(i){const n=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),s=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new $w(n,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,s,t.leftoverVisibleColumns)}else{const n=e.coordinatesConverter.convertModelPositionToViewPosition(new Va(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),s=e.coordinatesConverter.convertModelPositionToViewPosition(new Va(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),o=new Rh(n.lineNumber,n.column,s.lineNumber,s.column),r=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new $w(o,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,r,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class hF{constructor(e){this.context=e,this.cursors=[new lF(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 function(e,t){return bc(e,((e,i)=>-t(e,i)))}(this.cursors,Qd((e=>e.viewState.position),Va.compare)).viewState.position}getBottomMostViewPosition(){return function(e,t){if(0===e.length)return;let i=e[0];for(let n=1;n=0&&(i=s)}return i}(this.cursors,Qd((e=>e.viewState.position),Va.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(Kw.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){null!==e&&(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 e=t-i;for(let t=0;t=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(1===this.cursors.length)return;const e=this.cursors.slice(0),t=[];for(let i=0,n=e.length;ie.selection),Rh.compareRangesUsingStarts));for(let i=0;ia&&e.index--;e.splice(a,1),t.splice(r,1),this._removeSecondaryCursor(a-1),i--}}}}class dF{constructor(e,t,i,n){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=n}}class cF{constructor(){this.type=0}}class uF{constructor(){this.type=1}}class gF{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class pF{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=3}}class mF{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0)}}class fF{constructor(){this.type=5}}class _F{constructor(e){this.type=6,this.isFocused=e}}class vF{constructor(){this.type=7}}class bF{constructor(){this.type=8}}class CF{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class wF{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class yF{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class SF{constructor(e,t,i,n,s,o,r){this.source=e,this.minimalReveal=t,this.range=i,this.selections=n,this.verticalType=s,this.revealHorizontal=o,this.scrollType=r,this.type=12}}class LF{constructor(e){this.type=13,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 kF{constructor(e){this.theme=e,this.type=14}}class DF{constructor(e){this.type=15,this.ranges=e}}class xF{constructor(){this.type=16}}class NF{constructor(){this.type=17}}class EF extends E{constructor(){super(),this._onEvent=this._register(new U),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 IF{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class MF{constructor(e,t,i,n){this.kind=0,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 MF(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class TF{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new TF(this.oldHasFocus,e.hasFocus)}}class RF{constructor(e,t,i,n,s,o,r,a){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=n,this.scrollWidth=s,this.scrollLeft=o,this.scrollHeight=r,this.scrollTop=a,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 RF(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class AF{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class OF{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class PF{constructor(e,t,i,n,s,o,r){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=n,this.source=s,this.reason=o,this.reachedMaxCursorCount=r}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length;if(i!==t.length)return!1;for(let n=0;n0){const e=this._cursors.getSelections();for(let t=0;to&&(n=n.slice(0,o),s=!0);const r=jF.from(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,r,s)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,i,n,s,o){const r=this._cursors.getViewPositions();let a=null,l=null;r.length>1?l=this._cursors.getViewSelections():a=Rh.fromPositions(r[0],r[0]),e.emitViewEvent(new SF(t,i,a,l,n,s,o))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,n=t.length;i0){const t=Kw.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?5:i.isRedoing?6:2,t)&&this.revealPrimary(e,"modelChange",!1,0,!0,0)}else{const t=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,Kw.fromModelSelections(t))}}}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()}setSelections(e,t,i,n){this.setStates(e,t,n,Kw.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],n=[];for(let r=0,a=e.length;r0&&this._pushAutoClosedAction(i,n),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){e&&0!==e.length||(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,n,s){const o=jF.from(this._model,this);if(o.equals(n))return!1;const r=this._cursors.getSelections(),a=this._cursors.getViewSelections();if(e.emitViewEvent(new pF(a,r,i)),!n||n.cursorState.length!==o.cursorState.length||o.cursorState.some(((e,t)=>!e.modelState.equals(n.cursorState[t].modelState)))){const a=n?n.cursorState.map((e=>e.modelState.selection)):null,l=n?n.modelVersionId:0;e.emitOutgoingEvent(new PF(a,r,l,o.modelVersionId,t||"keyboard",i,s))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,n=e.length;i=0)return null;const s=n.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!s)return null;const o=s[1],r=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(o);if(!r||1!==r.length)return null;const a=r[0].open,l=n.text.length-s[2].length-1,h=n.text.lastIndexOf(a,l-1);if(-1===h)return null;t.push([h,l])}return t}executeEdits(e,t,i,n){let s=null;"snippet"===t&&(s=this._findAutoClosingPairs(i)),s&&(i[0]._isTracked=!0);const o=[],r=[],a=this._model.pushEditOperations(this.getSelections(),i,(e=>{if(s)for(let i=0,n=s.length;i0&&this._pushAutoClosedAction(o,r)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;const s=jF.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(o){r(o)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,s,!1)&&this.revealPrimary(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return qF.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new ZF(this._model,this.getSelections())}endComposition(e,t){const i=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit((()=>{"keyboard"===t&&this._executeEditOperation(Sy.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,i,this.getSelections(),this.getAutoClosedCharacters()))}),e,t)}type(e,t,i){this._executeEdit((()=>{if("keyboard"===i){const e=t.length;let i=0;for(;i{this._executeEditOperation(Sy.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,s))}),e,o);else if(0!==s){const t=this.getSelections().map((e=>{const t=e.getPosition();return new Ah(t.lineNumber,t.column+s,t.lineNumber,t.column+s)}));this.setSelections(e,o,t,0)}}paste(e,t,i,n,s){this._executeEdit((()=>{this._executeEditOperation(Sy.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))}),e,s,4)}cut(e,t){this._executeEdit((()=>{this._executeEditOperation(oy.cut(this.context.cursorConfig,this._model,this.getSelections()))}),e,t)}executeCommand(e,t,i){this._executeEdit((()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Gw(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))}),e,i)}executeCommands(e,t,i){this._executeEdit((()=>{this._executeEditOperation(new Gw(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))}),e,i)}}class jF{static from(e,t){return new jF(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e)return!1;if(this.modelVersionId!==e.modelVersionId)return!1;if(this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t=t.length)return!1;if(!t[i].strictContainsRange(e[i]))return!1}return!0}}class $F{static executeCommands(e,t,i){const n={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},s=this._innerExecuteCommands(n,i);for(let o=0,r=n.trackedRanges.length;o0&&(o[0]._isTracked=!0);let r=e.model.pushEditOperations(e.selectionsBefore,o,(i=>{const n=[];for(let t=0;te.identifier.minor-t.identifier.minor,o=[];for(let r=0;r0?(n[r].sort(s),o[r]=t[r].computeCursorState(e.model,{getInverseEditOperations:()=>n[r],getTrackedSelection:t=>{const i=parseInt(t,10),n=e.model._getTrackedRange(e.trackedRanges[i]);return 0===e.trackedRangesDirection[i]?new Ah(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn):new Ah(n.endLineNumber,n.endColumn,n.startLineNumber,n.startColumn)}})):o[r]=e.selectionsBefore[r];return o}));r||(r=e.selectionsBefore);const a=[];for(const l in s)s.hasOwnProperty(l)&&a.push(parseInt(l,10));a.sort(((e,t)=>t-e));for(const l of a)r.splice(l,1);return r}static _arrayIsEmpty(e){for(let t=0,i=e.length;t{Rh.isEmpty(e)&&""===o||n.push({identifier:{major:t,minor:s++},range:e,text:o,forceMoveMarkers:r,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let a=!1;const l={addEditOperation:o,addTrackedEditOperation:(e,t,i)=>{a=!0,o(e,t,i)},trackSelection:(t,i)=>{const n=Ah.liftSelection(t);let s;if(n.isEmpty())if("boolean"==typeof i)s=i?2:3;else{const t=e.model.getLineMaxColumn(n.startLineNumber);s=n.startColumn===t?2:3}else s=1;const o=e.trackedRanges.length,r=e.model._setTrackedRange(null,n,s);return e.trackedRanges[o]=r,e.trackedRangesDirection[o]=n.getDirection(),o.toString()}};try{i.getEditOperations(e.model,l)}catch(Mre){return r(Mre),{operations:[],hadTrackedEditOperation:!1}}return{operations:n,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){(e=e.slice(0)).sort(((e,t)=>-Rh.compareRangesUsingEnds(e.range,t.range)));const t={};for(let i=1;is.identifier.major?n.identifier.major:s.identifier.major,t[o.toString()]=!0;for(let t=0;t0&&i--}}return t}}class GF{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class ZF{static _capture(e,t){const i=[];for(const n of t){if(n.startLineNumber!==n.endLineNumber)return null;i.push(new GF(e.getLineContent(n.startLineNumber),n.startColumn-1,n.endColumn-1))}return i}constructor(e,t){this._original=ZF._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=ZF._capture(e,t);if(!i)return null;if(this._original.length!==i.length)return null;const n=[];for(let s=0,o=this._original.length;s>>1;t===e[o].afterLineNumber?i{t=!0,e|=0,i|=0,n|=0,s|=0;const o=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new XF(o,e,i,n,s)),o},changeOneWhitespace:(e,i,n)=>{t=!0,i|=0,n|=0,this._pendingChanges.change({id:e,newAfterLineNumber:i,newHeight:n})},removeWhitespace:e=>{t=!0,this._pendingChanges.remove({id:e})}})}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 t of e)this._insertWhitespace(t);for(const e of t)this._changeOneWhitespace(e.id,e.newAfterLineNumber,e.newHeight);for(const e of i){const t=this._findWhitespaceIndex(e.id);-1!==t&&this._removeWhitespace(t)}return}const n=new Set;for(const a of i)n.add(a.id);const s=new Map;for(const a of t)s.set(a.id,a);const o=e=>{const t=[];for(const i of e)if(!n.has(i.id)){if(s.has(i.id)){const e=s.get(i.id);i.afterLineNumber=e.newAfterLineNumber,i.height=e.newHeight}t.push(i)}return t},r=o(this._arr).concat(o(e));r.sort(((e,t)=>e.afterLineNumber===t.afterLineNumber?e.ordinal-t.ordinal:e.afterLineNumber-t.afterLineNumber)),this._arr=r,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=QF.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|=0,t|=0,this._lineCount+=t-e+1;for(let i=0,n=this._arr.length;i=t.length||t[s+1].afterLineNumber>=e)return s;i=s+1|0}else n=s-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e|=0;const t=this._findLastWhitespaceBeforeLineNumber(e)+1;return t1?this._lineHeight*(e-1):0;return i+this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0))+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e|=0;return this._lineHeight*e+this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0))+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),-1===this._minWidth){let e=0;for(let t=0,i=this._arr.length;tthis.getLinesTotalHeight()}isInTopPadding(e){return 0!==this._paddingTop&&(this._checkPendingChanges(),e=this.getLinesTotalHeight()-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),(e|=0)<0)return 1;const t=0|this._lineCount,i=this._lineHeight;let n=1,s=t;for(;n=o+i)n=t+1;else{if(e>=o)return t;s=t}}return n>t?t:n}getLinesViewportData(e,t){this._checkPendingChanges(),e|=0,t|=0;const i=this._lineHeight,n=0|this.getLineNumberAtOrAfterVerticalOffset(e),s=0|this.getVerticalOffsetForLineNumber(n);let o=0|this._lineCount,r=0|this.getFirstWhitespaceIndexAfterLineNumber(n);const a=0|this.getWhitespacesCount();let l,h;-1===r?(r=a,h=o+1,l=0):(h=0|this.getAfterLineNumberForWhitespaceIndex(r),l=0|this.getHeightForWhitespaceIndex(r));let d=s,c=d;const u=5e5;let g=0;s>=u&&(g=Math.floor(s/u)*u,g=Math.floor(g/i)*i,c-=g);const p=[],m=e+(t-e)/2;let f=-1;for(let C=n;C<=o;C++){if(-1===f){(d<=m&&mm)&&(f=C)}for(d+=i,p[C-n]=c,c+=i;h===C;)c+=l,d+=l,r++,r>=a?h=o+1:(h=0|this.getAfterLineNumberForWhitespaceIndex(r),l=0|this.getHeightForWhitespaceIndex(r));if(d>=t){o=C;break}}-1===f&&(f=o);const _=0|this.getVerticalOffsetForLineNumber(o);let v=n,b=o;return vt&&b--,{bigNumbersDelta:g,startLineNumber:n,endLineNumber:o,relativeVerticalOffset:p,centeredLineNumber:f,completelyVisibleStartLineNumber:v,completelyVisibleEndLineNumber:b}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e|=0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i,n;return i=t>=1?this._lineHeight*t:0,n=e>0?this.getWhitespacesAccumulatedHeight(e-1):0,i+n+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e|=0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;if(e>=this.getVerticalOffsetForWhitespaceIndex(i)+this.getHeightForWhitespaceIndex(i))return-1;for(;t=s+this.getHeightForWhitespaceIndex(n))t=n+1;else{if(e>=s)return n;i=n}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e|=0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0)return null;if(t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const n=this.getHeightForWhitespaceIndex(t);return{id:this.getIdForWhitespaceIndex(t),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(t),verticalOffset:i,height:n}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e|=0,t|=0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),n=this.getWhitespacesCount()-1;if(i<0)return[];const s=[];for(let o=i;o<=n;o++){const e=this.getVerticalOffsetForWhitespaceIndex(o),i=this.getHeightForWhitespaceIndex(o);if(e>=t)break;s.push({id:this.getIdForWhitespaceIndex(o),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(o),verticalOffset:e,height:i})}return s}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].height}}QF.INSTANCE_COUNT=0;class JF{constructor(e,t,i,n){(e|=0)<0&&(e=0),(t|=0)<0&&(t=0),(i|=0)<0&&(i=0),(n|=0)<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 eB extends E{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new U),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new JF(0,0,0,0),this._scrollable=this._register(new DD({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 MF(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 tB extends E{constructor(e,t,i){super(),this._configuration=e;const n=this._configuration.options,s=n.get(143),o=n.get(83);this._linesLayout=new QF(t,n.get(66),o.top,o.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new eB(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new JF(s.contentWidth,0,s.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(113)?125:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(66)&&this._linesLayout.setLineHeight(t.get(66)),e.hasChanged(83)){const e=t.get(83);this._linesLayout.setPadding(e.top,e.bottom)}if(e.hasChanged(143)){const e=t.get(143),i=e.contentWidth,n=e.height,s=this._scrollable.getScrollDimensions(),o=s.contentWidth;this._scrollable.setScrollDimensions(new JF(i,s.contentWidth,n,this._getContentHeight(i,n,o)))}else this._updateHeight();e.hasChanged(113)&&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 i=this._configuration.options.get(102);return 2===i.horizontal||e>=t?0:i.horizontalScrollbarSize}_getContentHeight(e,t,i){const n=this._configuration.options;let s=this._linesLayout.getLinesTotalHeight();return n.get(104)?s+=Math.max(0,t-n.get(66)-n.get(83).bottom):s+=this._getHorizontalScrollbarHeight(e,i),s}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,n=e.contentWidth;this._scrollable.setScrollDimensions(new JF(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new lP(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new lP(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,i=e.get(144),n=e.get(50),s=e.get(143);if(i.isViewportWrapping){const i=e.get(72);return t>s.contentWidth+n.typicalHalfwidthCharacterWidth&&i.enabled&&"right"===i.side?t+s.verticalScrollbarWidth:t}{const i=e.get(103)*n.typicalHalfwidthCharacterWidth,o=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+i+s.verticalScrollbarWidth,o,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 JF(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t);return{scrollTop:t,scrollTopWithoutViewZones:t-this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i),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){1===t?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 iB{constructor(e,t,i,n,s){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=n,this._coordinatesConverter=s,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,s=e.options;let o;if(s.isWholeLine){const e=this._coordinatesConverter.convertModelPositionToViewPosition(new Va(n.startLineNumber,1),0,!1,!0),t=this._coordinatesConverter.convertModelPositionToViewPosition(new Va(n.endLineNumber,this.model.getLineMaxColumn(n.endLineNumber)),1);o=new Rh(e.lineNumber,e.column,t.lineNumber,t.column)}else o=this._coordinatesConverter.convertModelRangeToViewRange(n,1);i=new pP(o,s),this._decorationsCache[t]=i}return i}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=null!==this._cachedModelDecorationsResolver;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 Rh(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,OS(this.configuration.options),t,i),s=e.startLineNumber,o=e.endLineNumber,r=[];let a=0;const l=[];for(let h=s;h<=o;h++)l[h-s]=[];for(let h=0,d=n.length;h1===e))}function oB(e,t){return rB(e,t.range,(e=>2===e))}function rB(e,t,i){for(let n=t.startLineNumber;n<=t.endLineNumber;n++){const s=e.tokenization.getLineTokens(n),o=n===t.startLineNumber,r=n===t.endLineNumber;let a=o?s.findTokenIndexAtOffset(t.startColumn-1):0;for(;at.endColumn-1)break}if(!i(s.getStandardTokenType(a)))return!1;a++}}return!0}function aB(e,t){return null===e?t?hB.INSTANCE:dB.INSTANCE:new lB(e,t)}class lB{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,s=this._projectionData.breakOffsets[i];let o;if(null!==this._projectionData.injectionOffsets){const i=this._projectionData.injectionOffsets.map(((e,t)=>new tw(0,0,e+1,this._projectionData.injectionOptions[t],0)));o=tw.applyInjectedText(e.getLineContent(t),i).substring(n,s)}else o=e.getValueInRange({startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:s+1});return i>0&&(o=uB(this._projectionData.wrappedTextIndentLength)+o),o}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,s,o,r){this._assertVisible();const a=this._projectionData,l=a.injectionOffsets,h=a.injectionOptions;let d,c=null;if(l){c=[];let e=0,t=0;for(let i=0;i0?a.breakOffsets[i-1]:0,o=a.breakOffsets[i];for(;to)break;if(s0?a.wrappedTextIndentLength:0,r=t+Math.max(d-s,0),l=t+Math.min(c-s,o-s);r!==l&&n.push(new gP(r,l,e.inlineClassName,e.inlineClassNameAffectsLetterSpacing))}}if(!(c<=o))break;e+=r,t++}}}d=l?e.tokenization.getLineTokens(t).withInserted(l.map(((e,t)=>({offset:e,text:h[t].content,tokenMetadata:PC.defaultTokenMetadata})))):e.tokenization.getLineTokens(t);for(let u=i;u0?n.wrappedTextIndentLength:0,o=i>0?n.breakOffsets[i-1]:0,r=n.breakOffsets[i],a=e.sliceAndInflate(o,r,s);let l=a.getLineContent();i>0&&(l=uB(n.wrappedTextIndentLength)+l);const h=this._projectionData.getMinOutputOffset(i)+1,d=l.length+1,c=i+1=cB.length)for(let t=1;t<=e;t++)cB[t]=gB(t);return cB[e]}function gB(e){return new Array(e+1).join(" ")}class pB{constructor(e,t,i,n,s,o,r,a,l,h){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=n,this.fontInfo=s,this.tabSize=o,this.wrappingStrategy=r,this.wrappingColumn=a,this.wrappingIndent=l,this.wordBreak=h,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new _B(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),s=i.length,o=this.createLineBreaksComputer(),r=new ic(tw.fromDecorations(n));for(let p=0;pe.lineNumber===p+1));o.addRequest(i[p],e,t?t[p]:null)}const a=o.finalize(),l=[],h=this.hiddenAreasDecorationIds.map((e=>this.model.getDecorationRange(e))).sort(Rh.compareRangesUsingStarts);let d=1,c=0,u=-1,g=u+1=d&&e<=c,i=aB(a[p],!t);l[p]=i.getViewLineCount(),this.modelLineProjections[p]=i}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new mI(l)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map((e=>this.model.getDecorationRange(e)))}setHiddenAreas(e){const t=function(e){if(0===e.length)return[];const t=e.slice();t.sort(Rh.compareRangesUsingStarts);const i=[];let n=t[0].startLineNumber,s=t[0].endLineNumber;for(let o=1,r=t.length;os+1?(i.push(new Rh(n,1,s,1)),n=e.startLineNumber,s=e.endLineNumber):e.endLineNumber>s&&(s=e.endLineNumber)}return i.push(new Rh(n,1,s,1)),i}(e.map((e=>this.model.validateRange(e)))),i=this.hiddenAreasDecorationIds.map((e=>this.model.getDecorationRange(e))).sort(Rh.compareRangesUsingStarts);if(t.length===i.length){let e=!1;for(let n=0;n({range:e,options:Iw.EMPTY})));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,n);const s=t;let o=1,r=0,a=-1,l=a+1=o&&e<=r?this.modelLineProjections[d].isVisible()&&(this.modelLineProjections[d]=this.modelLineProjections[d].setVisible(!1),t=!0):(h=!0,this.modelLineProjections[d].isVisible()||(this.modelLineProjections[d]=this.modelLineProjections[d].setVisible(!0),t=!0)),t){const e=this.modelLineProjections[d].getViewLineCount();this.projectedModelLineLineCounts.setValue(d,e)}}return h||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return!(e<1||e>this.modelLineProjections.length)&&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&&(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,n,s){const o=this.fontInfo.equals(e),r=this.wrappingStrategy===t,a=this.wrappingColumn===i,l=this.wrappingIndent===n,h=this.wordBreak===s;if(o&&r&&a&&l&&h)return!1;const d=o&&r&&!a&&l&&h;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=n,this.wordBreak=s;let c=null;if(d){c=[];for(let e=0,t=this.modelLineProjections.length;e2&&!this.modelLineProjections[t-2].isVisible(),o=1===t?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let r=0;const a=[],l=[];for(let h=0,d=n.length;hr?(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,h=l+r-1,u=h+1,g=u+(s-r)-1,a=!0):st?t:0|e}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),s=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),o=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),r=this.model.guides.getActiveIndentGuide(n.lineNumber,s.lineNumber,o.lineNumber),a=this.convertModelPositionToViewPosition(r.startLineNumber,1),l=this.convertModelPositionToViewPosition(r.endLineNumber,this.model.getLineMaxColumn(r.endLineNumber));return{startLineNumber:a.lineNumber,endLineNumber:l.lineNumber,indent:r.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),i=t.index,n=t.remainder;return new mB(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 Va(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 Va(e.modelLineNumber,n)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),n=this.getViewLineInfo(t),s=new Array;let o=this.getModelStartPositionOfViewLine(i),r=new Array;for(let a=i.modelLineNumber;a<=n.modelLineNumber;a++){const e=this.modelLineProjections[a-1];if(e.isVisible()){const t=a===i.modelLineNumber?i.modelLineWrappedLineIdx:0,s=a===n.modelLineNumber?n.modelLineWrappedLineIdx+1:e.getViewLineCount();for(let e=t;e{if(-1!==e.forWrappedLinesAfterColumn){if(this.modelLineProjections[i.modelLineNumber-1].getViewPositionOfModelPosition(0,e.forWrappedLinesAfterColumn).lineNumber>=i.modelLineWrappedLineIdx)return}if(-1!==e.forWrappedLinesBeforeOrAtColumn){if(this.modelLineProjections[i.modelLineNumber-1].getViewPositionOfModelPosition(0,e.forWrappedLinesBeforeOrAtColumn).lineNumberi.modelLineWrappedLineIdx)return}const n=this.convertModelPositionToViewPosition(i.modelLineNumber,e.horizontalLine.endColumn),s=this.modelLineProjections[i.modelLineNumber-1].getViewPositionOfModelPosition(0,e.horizontalLine.endColumn);return s.lineNumber===i.modelLineWrappedLineIdx?new Jv(e.visibleColumn,t,e.className,new eb(e.horizontalLine.top,n.column),-1,-1):s.lineNumber!!e)))}}return o}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 s=[];const o=[],r=[],a=i.lineNumber-1,l=n.lineNumber-1;let h=null;for(let g=a;g<=l;g++){const e=this.modelLineProjections[g];if(e.isVisible()){const t=e.getViewLineNumberOfModelPosition(0,g===a?i.column:1),n=e.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),s=n-t+1;let l=0;s>1&&1===e.getViewLineMinColumn(this.model,g+1,n)&&(l=0===t?1:2),o.push(s),r.push(l),null===h&&(h=new Va(g+1,0))}else null!==h&&(s=s.concat(this.model.guides.getLinesIndentGuides(h.lineNumber,g)),h=null)}null!==h&&(s=s.concat(this.model.guides.getLinesIndentGuides(h.lineNumber,n.lineNumber)),h=null);const d=t-e+1,c=new Array(d);let u=0;for(let g=0,p=s.length;gt&&(c=!0,d=t-s+1),n.getViewLinesData(this.model,l+1,h,d,s-e,i,a),s+=d,c)break}return a}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const n=this.projectedModelLineLineCounts.getIndexOf(e-1),s=n.index,o=n.remainder,r=this.modelLineProjections[s],a=r.getViewLineMinColumn(this.model,s+1,o),l=r.getViewLineMaxColumn(this.model,s+1,o);tl&&(t=l);const h=r.getModelColumnOfViewPosition(o,t);return this.model.validatePosition(new Va(s+1,h)).equals(i)?new Va(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 Rh(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 Va(i.modelLineNumber,n))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new Rh(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2,n=!1,s=!1){const o=this.model.validatePosition(new Va(e,t)),r=o.lineNumber,a=o.column;let l=r-1,h=!1;if(s)for(;l0&&!this.modelLineProjections[l].isVisible();)l--,h=!0;if(0===l&&!this.modelLineProjections[l].isVisible())return new Va(n?0:1,1);const d=1+this.projectedModelLineLineCounts.getPrefixSum(l);let c;return c=h?s?this.modelLineProjections[l].getViewPositionOfModelPosition(d,1,i):this.modelLineProjections[l].getViewPositionOfModelPosition(d,this.model.getLineMaxColumn(l+1),i):this.modelLineProjections[r-1].getViewPositionOfModelPosition(d,a,i),c}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return Rh.fromPositions(i)}{const t=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),i=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new Rh(t.lineNumber,t.column,i.lineNumber,i.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){const e=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(e,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(0===i&&!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,s){const o=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),r=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(r.lineNumber-o.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new Rh(o.lineNumber,1,r.lineNumber,r.column),t,i,n,s);let a=[];const l=o.lineNumber-1,h=r.lineNumber-1;let d=null;for(let p=l;p<=h;p++){if(this.modelLineProjections[p].isVisible())null===d&&(d=new Va(p+1,p===l?o.column:1));else if(null!==d){const e=this.model.getLineMaxColumn(p);a=a.concat(this.model.getDecorationsInRange(new Rh(d.lineNumber,d.column,p,e),t,i,n)),d=null}}null!==d&&(a=a.concat(this.model.getDecorationsInRange(new Rh(d.lineNumber,d.column,r.lineNumber,r.column),t,i,n)),d=null),a.sort(((e,t)=>{const i=Rh.compareRangesUsingStarts(e.range,t.range);return 0===i?e.idt.id?1:0:i}));const c=[];let u=0,g=null;for(const p of a){const e=p.id;g!==e&&(g=e,c[u++]=p)}return c}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 0===t.modelLineWrappedLineIdx?this.model.getLineIndentColumn(t.modelLineNumber):0}}class mB{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class fB{constructor(e,t){this.modelRange=e,this.viewLines=t}}class _B{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)}}class vB{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new bB(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 wF(t,i)}onModelLinesInserted(e,t,i,n){return new yF(t,i)}onModelLineChanged(e,t,i){return[!1,new CF(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 s=0;st)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}class CB extends E{constructor(e,t,i,n,s,o,r,a,l){if(super(),this.languageConfigurationService=r,this._themeService=a,this._attachedView=l,this.hiddenAreasModel=new SB,this.previousHiddenAreas=[],this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new EF,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new Uw(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._updateConfigurationViewLineCount=this._register(new rd((()=>this._updateConfigurationViewLineCountNow()),0)),this._hasFocus=!1,this._viewportStart=wB.create(this.model),this.model.isTooLargeForTokenization())this._lines=new vB(this.model);else{const e=this._configuration.options,t=e.get(50),i=e.get(137),o=e.get(144),r=e.get(136),a=e.get(128);this._lines=new pB(this._editorId,this.model,n,s,t,this.model.getOptions().tabSize,i,o.wrappingColumn,r,a)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new KF(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new tB(this._configuration,this.getLineCount(),o)),this._register(this.viewLayout.onDidScroll((e=>{e.scrollTopChanged&&this._handleVisibleLinesChanged(),e.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new LF(e)),this._eventDispatcher.emitOutgoingEvent(new RF(e.oldScrollWidth,e.oldScrollLeft,e.oldScrollHeight,e.oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop))}))),this._register(this.viewLayout.onDidContentSizeChange((e=>{this._eventDispatcher.emitOutgoingEvent(e)}))),this._decorations=new iB(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast((e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}}))),this._register(aP.getInstance().onDidChange((()=>{this._eventDispatcher.emitSingleViewEvent(new xF)}))),this._register(this._themeService.onDidColorThemeChange((e=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new kF(e))}))),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 Rh(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 _F(e)),this._eventDispatcher.emitOutgoingEvent(new TF(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new cF)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new uF)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new Va(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new kB(t,this._viewportStart.startLineDelta)}return new kB(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),n=this._configuration.options,s=n.get(50),o=n.get(137),r=n.get(144),a=n.get(136),l=n.get(128);this._lines.setWrappingSettings(s,o,r.wrappingColumn,a,l)&&(e.emitViewEvent(new fF),e.emitViewEvent(new bF),e.emitViewEvent(new mF(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(90)&&(this._decorations.reset(),e.emitViewEvent(new mF(null))),e.emitViewEvent(new gF(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),Uw.shouldRecreate(t)&&(this.cursorConfig=new Uw(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText((e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();let i=!1,n=!1;const s=e instanceof lw?e.rawContentChangedEvent.changes:e.changes,o=e instanceof lw?e.rawContentChangedEvent.versionId:null,r=this._lines.createLineBreaksComputer();for(const e of s)switch(e.changeType){case 4:for(let t=0;t!e.ownerId||e.ownerId===this._editorId))),r.addRequest(i,n,null)}break;case 2:{let t=null;e.injectedText&&(t=e.injectedText.filter((e=>!e.ownerId||e.ownerId===this._editorId))),r.addRequest(e.detail,t,null);break}}const a=r.finalize(),l=new ic(a);for(const e of s)switch(e.changeType){case 1:this._lines.onModelFlushed(),t.emitViewEvent(new fF),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),i=!0;break;case 3:{const n=this._lines.onModelLinesDeleted(o,e.fromLineNumber,e.toLineNumber);null!==n&&(t.emitViewEvent(n),this.viewLayout.onLinesDeleted(n.fromLineNumber,n.toLineNumber)),i=!0;break}case 4:{const n=l.takeCount(e.detail.length),s=this._lines.onModelLinesInserted(o,e.fromLineNumber,e.toLineNumber,n);null!==s&&(t.emitViewEvent(s),this.viewLayout.onLinesInserted(s.fromLineNumber,s.toLineNumber)),i=!0;break}case 2:{const i=l.dequeue(),[s,r,a,h]=this._lines.onModelLineChanged(o,e.lineNumber,i);n=s,r&&t.emitViewEvent(r),a&&(t.emitViewEvent(a),this.viewLayout.onLinesInserted(a.fromLineNumber,a.toLineNumber)),h&&(t.emitViewEvent(h),this.viewLayout.onLinesDeleted(h.fromLineNumber,h.toLineNumber));break}}null!==o&&this._lines.acceptVersionId(o),this.viewLayout.onHeightMaybeChanged(),!i&&n&&(t.emitViewEvent(new bF),t.emitViewEvent(new mF(null)),this._cursor.onLineMappingChanged(t),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 e=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(e){const t=this.coordinatesConverter.convertModelPositionToViewPosition(e.getStartPosition()),i=this.viewLayout.getVerticalOffsetForLineNumber(t.lineNumber);this.viewLayout.setScrollPosition({scrollTop:i+this._viewportStart.startLineDelta},1)}}try{const t=this._eventDispatcher.beginEmitViewEvents();e instanceof lw&&t.emitOutgoingEvent(new HF(e.contentChangedEvent)),this._cursor.onModelContentChanged(t,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 vF),this.cursorConfig=new Uw(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new VF(e))}))),this._register(this.model.onDidChangeLanguage((e=>{this.cursorConfig=new Uw(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new WF(e))}))),this._register(this.model.onDidChangeOptions((e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const e=this._eventDispatcher.beginEmitViewEvents();e.emitViewEvent(new fF),e.emitViewEvent(new bF),e.emitViewEvent(new mF(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new Uw(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new zF(e))}))),this._register(this.model.onDidChangeDecorations((e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new mF(e)),this._eventDispatcher.emitOutgoingEvent(new BF(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 s=!1;try{const e=this._eventDispatcher.beginEmitViewEvents();s=this._lines.setHiddenAreas(i),s&&(e.emitViewEvent(new fF),e.emitViewEvent(new bF),e.emitViewEvent(new mF(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged()),n.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),s&&this._eventDispatcher.emitOutgoingEvent(new OF)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(143),t=this._configuration.options.get(66),i=Math.max(20,Math.round(e.height/t)),n=this.viewLayout.getLinesViewportData(),s=Math.max(1,n.completelyVisibleStartLineNumber-i),o=Math.min(this.getLineCount(),n.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new Rh(s,this.getLineMinColumn(s),o,this.getLineMaxColumn(o)))}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(0===i.length)return[t];const n=[];let s=0,o=t.startLineNumber,r=t.startColumn;const a=t.endLineNumber,l=t.endColumn;for(let h=0,d=i.length;ha||(ot.toInlineDecoration(e)))]),new cP(o.minColumn,o.maxColumn,o.content,o.continuesWithWrappedLine,i,n,o.tokens,t,s,o.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const n=this._lines.getViewLinesData(e,t,i);return new hP(this.getTabSize(),n)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,OS(this._configuration.options)),i=new yB;for(const n of t){const t=n.options,s=t.overviewRuler;if(!s)continue;const o=s.position;if(0===o)continue;const r=s.getColor(e.value),a=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.startLineNumber,n.range.startColumn),l=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.endLineNumber,n.range.endColumn);i.accept(r,t.zIndex,a,l,o)}return i.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const e=t.options.overviewRuler;null==e||e.invalidateCachedColor();const i=t.options.minimap;null==i||i.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);return this.model.modifyPosition(i,t)}deduceModelPositionRelativeToViewPosition(e,t,i){const n=this.coordinatesConverter.convertViewPositionToModelPosition(e);2===this.model.getEOL().length&&(t<0?t-=i:t+=i);const s=this.model.getOffsetAt(n)+t;return this.model.getPositionAt(s)}getPlainTextToCopy(e,t,i){const n=i?"\r\n":this.model.getEOL();(e=e.slice(0)).sort(Rh.compareRangesUsingStarts);let s=!1,o=!1;for(const a of e)a.isEmpty()?s=!0:o=!0;if(!o){if(!t)return"";const i=e.map((e=>e.startLineNumber));let s="";for(let e=0;e0&&i[e-1]===i[e]||(s+=this.model.getLineContent(i[e])+n);return s}if(s&&t){const t=[];let n=0;for(const s of e){const e=s.startLineNumber;s.isEmpty()?e!==n&&t.push(this.model.getLineContent(e)):t.push(this.model.getValueInRange(s,i?2:0)),n=e}return 1===t.length?t[0]:t}const r=[];for(const a of e)a.isEmpty()||r.push(this.model.getValueInRange(a,i?2:0));return 1===r.length?r[0]:r}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===Ku)return null;if(1!==e.length)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const e=n.startLineNumber;n=new Rh(e,this.model.getLineMinColumn(e),e,this.model.getLineMaxColumn(e))}const s=this._configuration.options.get(50),o=this._getColorMap();let r;if(/[:;\\\/<>]/.test(s.fontFamily)||s.fontFamily===qS.fontFamily)r=qS.fontFamily;else{r=s.fontFamily,r=r.replace(/"/g,"'");if(!/[,']/.test(r)){/[+ ]/.test(r)&&(r=`'${r}'`)}r=`${r}, ${qS.fontFamily}`}return{mode:i,html:`
    `+this._getHTMLToCopy(n,o)+"
    "}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,o=e.endColumn,r=this.getTabSize();let a="";for(let l=i;l<=s;l++){const e=this.model.tokenization.getLineTokens(l),h=e.getLineContent(),d=l===i?n-1:0,c=l===s?o-1:h.length;a+=""===h?"
    ":Kk(h,e.inflate(),t,d,c,r,Oe)}return a}_getColorMap(){const e=EC.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=0){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){this._cursor.context.cursorConfig.readOnly?this._eventDispatcher.emitOutgoingEvent(new FF):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,s){this._executeCursorEdit((o=>this._cursor.compositionType(o,e,t,i,n,s)))}paste(e,t,i,n){this._executeCursorEdit((s=>this._cursor.paste(s,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)))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector((n=>this._cursor.revealPrimary(n,e,i,0,t,0)))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new Rh(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector((t=>t.emitViewEvent(new SF(e,!1,i,null,0,!0,0))))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new Rh(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector((t=>t.emitViewEvent(new SF(e,!1,i,null,0,!0,0))))}revealRange(e,t,i,n,s){this._withViewEventsCollector((o=>o.emitViewEvent(new SF(e,!1,i,null,n,t,s))))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new NF),this._eventDispatcher.emitOutgoingEvent(new AF))}_withViewEventsCollector(e){try{return e(this._eventDispatcher.beginEmitViewEvents())}finally{this._eventDispatcher.endEmitViewEvents()}}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}}class wB{static create(e){const t=e._setTrackedRange(null,new Rh(1,1,1,1),1);return new wB(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,s){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=n,this._startLineDelta=s}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new Va(t,e.getLineMinColumn(t))),n=e.model._setTrackedRange(this._modelTrackedRange,new Rh(i.lineNumber,i.column,i.lineNumber,i.column),1),s=e.viewLayout.getVerticalOffsetForLineNumber(t),o=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=n,this._startLineDelta=o-s}invalidate(){this._isValid=!1}}class yB{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,n,s){const o=this._asMap[e];if(o){const e=o.data,t=e[e.length-3],r=e[e.length-1];if(t===s&&r+1>=i)return void(n>r&&(e[e.length-1]=n));e.push(s,i,n)}else{const o=new mP(e,t,[s,i,n]);this._asMap[e]=o,this.asArray.push(o)}}}class SB{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&LB(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(((e,t)=>function(e,t){const i=[];let n=0,s=0;for(;n0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let i=this.breakOffsets[e]-t;return e>0&&(i+=this.wrappedTextIndentLength),i}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let i=0===e?t:this.breakOffsets[e-1]+t;if(null!==this.injectionOffsets)for(let n=0;nthis.injectionOffsets[n];n++)i0?this.breakOffsets[s-1]:0,0===t)if(e<=o)n=s-1;else{if(!(e>r))break;i=s+1}else if(e=r))break;i=s+1}}let r=e-o;return s>0&&(r+=this.wrappedTextIndentLength),new IB(s,r)}normalizeOutputPosition(e,t,i){if(null!==this.injectionOffsets){const n=this.outputPositionToOffsetInInputWithInjections(e,t),s=this.normalizeOffsetInInputWithInjectionsAroundInjections(n,i);if(s!==n)return this.offsetInInputWithInjectionsToOutputPosition(s,i)}if(0===i){if(e>0&&t===this.getMinOutputOffset(e))return new IB(e-1,this.getMaxOutputOffset(e-1))}else if(1===i){if(e0&&(t=Math.max(0,t-this.wrappedTextIndentLength));return(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(2===t){if(e===i.offsetInInputWithInjections+i.length&&NB(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let e=i.offsetInInputWithInjections;if(EB(this.injectionOptions[i.injectedTextIndex].cursorStops))return e;let t=i.injectedTextIndex-1;for(;t>=0&&this.injectionOffsets[t]===this.injectionOffsets[i.injectedTextIndex]&&!NB(this.injectionOptions[t].cursorStops)&&(e-=this.injectionOptions[t].content.length,!EB(this.injectionOptions[t].cursorStops));)t--;return e}}if(1===t||4===t){let e=i.offsetInInputWithInjections+i.length,t=i.injectedTextIndex;for(;t+1=0&&this.injectionOffsets[t-1]===this.injectionOffsets[t];)e-=this.injectionOptions[t-1].content.length,t--;return e}zl()}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(null!==t){let n=0;for(let s=0;se)break;if(e<=a)return{injectedTextIndex:s,offsetInInputWithInjections:r,length:o};n+=o}}}}function NB(e){return null==e||(e===Sd.Right||e===Sd.Both)}function EB(e){return null==e||(e===Sd.Left||e===Sd.Both)}class IB{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new Va(e+this.outputLineIndex,this.outputOffset+1)}}class MB{static create(e){return new MB(e.get(132),e.get(131))}constructor(e,t){this.classifier=new TB(e,t)}createLineBreaksComputer(e,t,i,n,s){const o=[],r=[],a=[];return{addRequest:(e,t,i)=>{o.push(e),r.push(t),a.push(i)},finalize:()=>{const l=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,h=[];for(let e=0,d=o.length;e=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}}let RB=[],AB=[];function OB(e,t,i,n,s,o,r,a){if(-1===s)return null;const l=i.length;if(l<=1)return null;const h="keepAll"===a,d=t.breakOffsets,c=t.breakOffsetsVisibleColumn,u=VB(i,n,s,o,r),g=s-u,p=RB,m=AB;let f=0,_=0,v=0,b=s;const C=d.length;let w=0;if(w>=0){let e=Math.abs(c[w]-b);for(;w+1=e)break;e=t,w++}}for(;wt&&(t=_,s=v);let r=0,a=0,u=0,y=0;if(s<=b){let v=s,C=0===t?0:i.charCodeAt(t-1),w=0===t?0:e.get(C),S=!0;for(let s=t;s_&&WB(C,w,l,d,h)&&(r=t,a=v),v+=c,v>b){t>_?(u=t,y=v-c):(u=s+1,y=v),v-a>g&&(r=0),S=!1;break}C=l,w=d}if(S){f>0&&(p[f]=d[d.length-1],m[f]=c[d.length-1],f++);break}}if(0===r){let l=s,d=i.charCodeAt(t),c=e.get(d),p=!1;for(let n=t-1;n>=_;n--){const t=n+1,s=i.charCodeAt(n);if(9===s){p=!0;break}let m,f;if(yo(s)?(n--,m=0,f=2):(m=e.get(s),f=Oo(s)?o:1),l<=b){if(0===u&&(u=t,y=l),l<=b-g)break;if(WB(s,m,d,c,h)){r=t,a=l;break}}l-=f,d=s,c=m}if(0!==r){const e=g-(y-a);if(e<=n){const t=i.charCodeAt(u);let s;s=wo(t)?2:FB(t,y,n,o),e-s<0&&(r=0)}}if(p){w--;continue}}if(0===r&&(r=u,a=y),r<=_){const e=i.charCodeAt(_);wo(e)?(r=_+2,a=v+2):(r=_+1,a=v+FB(e,v,n,o))}for(_=r,p[f]=r,v=a,m[f]=a,f++,b=a+g;w<0||w=S)break;S=e,w++}}return 0===f?null:(p.length=f,m.length=f,RB=t.breakOffsets,AB=t.breakOffsetsVisibleColumn,t.breakOffsets=p,t.breakOffsetsVisibleColumn=m,t.wrappedTextIndentLength=u,t)}function PB(e,t,i,n,s,o,r,a){const l=tw.applyInjectedText(t,i);let h,d;if(i&&i.length>0?(h=i.map((e=>e.options)),d=i.map((e=>e.column-1))):(h=null,d=null),-1===s)return h?new xB(d,h,[l.length],[],0):null;const c=l.length;if(c<=1)return h?new xB(d,h,[l.length],[],0):null;const u="keepAll"===a,g=VB(l,n,s,o,r),p=s-g,m=[],f=[];let _=0,v=0,b=0,C=s,w=l.charCodeAt(0),y=e.get(w),S=FB(w,0,n,o),L=1;wo(w)&&(S+=1,w=l.charCodeAt(1),y=e.get(w),L++);for(let k=L;kC&&((0===v||S-b>p)&&(v=t,b=S-r),m[_]=v,f[_]=b,_++,C=b+p,v=0),w=i,y=s}return 0!==_||i&&0!==i.length?(m[_]=c,f[_]=S,new xB(d,h,m,f,g)):null}function FB(e,t,i,n){return 9===e?i-t%i:Oo(e)||e<32?n:1}function BB(e,t){return t-e%t}function WB(e,t,i,n,s){return 32!==i&&(2===t&&2!==n||1!==t&&1===n||!s&&3===t&&2!==n||!s&&3===n&&1!==t)}function VB(e,t,i,n,s){let o=0;if(0!==s){const r=ro(e);if(-1!==r){for(let i=0;ii&&(o=0)}}return o}const HB=Fk("domLineBreaksComputer",{createHTML:e=>e});class zB{static create(){return new zB}constructor(){}createLineBreaksComputer(e,t,i,n,s){const o=[],r=[];return{addRequest:(e,t,i)=>{o.push(e),r.push(t)},finalize:()=>function(e,t,i,n,s,o,r){var a;function l(t){const i=r[t];if(i){const n=tw.applyInjectedText(e[t],i),s=i.map((e=>e.options)),o=i.map((e=>e.column-1));return new xB(o,s,[n.length],[],0)}return null}if(-1===n){const t=[];for(let i=0,n=e.length;ih?(o=0,a=0):l=h-e}const d=n.substr(o),c=UB(d,a,i,l,p,u);m[k]=o,f[k]=a,_[k]=d,v[k]=c[0],b[k]=c[1]}const C=p.build(),w=null!==(a=null==HB?void 0:HB.createHTML(C))&&void 0!==a?a:C;g.innerHTML=w,g.style.position="absolute",g.style.top="10000","keepAll"===o?(g.style.wordBreak="keep-all",g.style.overflowWrap="anywhere"):(g.style.wordBreak="inherit",g.style.overflowWrap="break-word");document.body.appendChild(g);const y=document.createRange(),S=Array.prototype.slice.call(g.children,0),L=[];for(let k=0;ke.options)),a=h.map((e=>e.column-1))):(o=null,a=null),L[k]=new xB(a,o,e,s,i)}return document.body.removeChild(g),L}(o,e,t,i,n,s,r)}}}function UB(e,t,i,n,s,o){if(0!==o){const e=String(o);s.appendString('
    ');const r=e.length;let a=t,l=0;const h=[],d=[];let c=0");for(let u=0;u"),h[u]=l,d[u]=a;const t=c;c=u+1"),h[e.length]=l,d[e.length]=a,s.appendString("
    "),[h,d]}function KB(e,t,i,n){if(i.length<=1)return null;const s=Array.prototype.slice.call(t.children,0),o=[];try{jB(e,s,n,0,null,i.length-1,null,o)}catch(r){return console.log(r),null}return 0===o.length?null:(o.push(i.length),o)}function jB(e,t,i,n,s,o,r,a){if(n===o)return;if(s=s||qB(e,t,i[n],i[n+1]),r=r||qB(e,t,i[o],i[o+1]),Math.abs(s[0].top-r[0].top)<=.1)return;if(n+1===o)return void a.push(o);const l=n+(o-n)/2|0,h=qB(e,t,i[l],i[l+1]);jB(e,t,i,n,s,l,h,a),jB(e,t,i,l,h,o,r,a)}function qB(e,t,i,n){return e.setStart(t[i/16384|0].firstChild,i%16384),e.setEnd(t[n/16384|0].firstChild,n%16384),e.getClientRects()}class $B extends E{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new R),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const n of t)this._pending.has(n.id)?r(new Error(`Cannot have two contributions with the same id ${n.id}`)):this._pending.set(n.id,n);this._instantiateSome(0),this._register(ad((()=>{this._instantiateSome(1)}))),this._register(ad((()=>{this._instantiateSome(2)}))),this._register(ad((()=>{this._instantiateSome(3)}),5e3))}saveViewState(){const e={};for(const[t,i]of this._instances)"function"==typeof i.saveViewState&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(const[t,i]of this._instances)"function"==typeof i.restoreViewState&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){this._register(ad((()=>{this._instantiateSome(1)}),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 e=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,e),"function"==typeof e.restoreViewState&&0!==t.instantiation&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(i){r(i)}}}}var GB,ZB=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},YB=function(e,t){return function(i,n){t(i,n,e)}},XB=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let QB=0;class JB{constructor(e,t,i,n,s,o){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=s,this.attachedView=o}dispose(){k(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}}let eW=GB=class extends E{get isSimpleWidget(){return this._configuration.isSimpleWidget}constructor(e,t,i,n,s,o,a,l,h,d,c,u){var g;super(),this.languageConfigurationService=c,this._deliveryQueue=new K,this._contributions=this._register(new $B),this._onDidDispose=this._register(new U),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new iW(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new tW({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new tW({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new iW(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new iW(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new iW(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new iW(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new iW(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new iW(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new iW(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new iW(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new iW(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new iW(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new iW(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new iW(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new iW(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new iW(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new iW(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new iW(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new iW(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),s.willCreateCodeEditor();const p=Object.assign({},t);let m;this._domElement=e,this._overflowWidgetsDomNode=p.overflowWidgetsDomNode,delete p.overflowWidgetsDomNode,this._id=++QB,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,p,d)),this._register(this._configuration.onDidChange((e=>{this._onDidChangeConfiguration.fire(e);const t=this._configuration.options;if(e.hasChanged(143)){const e=t.get(143);this._onDidLayoutChange.fire(e)}}))),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=h,this._codeEditorService=s,this._commandService=o,this._themeService=l,this._register(new nW(this,this._contextKeyService)),this._register(new sW(this,this._contextKeyService,u)),this._instantiationService=n.createChild(new DB([Ol,this._contextKeyService])),this._modelData=null,this._focusTracker=new oW(e),this._register(this._focusTracker.onChange((()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())}))),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={},m=Array.isArray(i.contributions)?i.contributions:xh.getEditorContributions(),this._contributions.initialize(this,m,this._instantiationService);for(const _ of xh.getEditorActions()){if(this._actions.has(_.id)){r(new Error(`Cannot have two actions with the same id ${_.id}`));continue}const e=new rF(_.id,_.label,_.alias,null!==(g=_.precondition)&&void 0!==g?g:void 0,(()=>this._instantiationService.invokeFunction((e=>Promise.resolve(_.runEditorCommand(e,this,null))))),this._contextKeyService);this._actions.set(e.id,e)}const f=()=>!this._configuration.options.get(90)&&this._configuration.options.get(36).enabled;this._register(new Ds(this._domElement,{onDragEnter:()=>{},onDragOver:e=>{if(!f())return;const t=this.getTargetAtClientPoint(e.clientX,e.clientY);(null==t?void 0:t.position)&&this.showDropIndicatorAt(t.position)},onDrop:e=>XB(this,void 0,void 0,(function*(){if(!f())return;if(this.removeDropIndicator(),!e.dataTransfer)return;const t=this.getTargetAtClientPoint(e.clientX,e.clientY);(null==t?void 0:t.position)&&this._onDropIntoEditor.fire({position:t.position,event:e})})),onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var t;null===(t=this._modelData)||void 0===t||t.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i){return new iA(e,t,this._domElement,i)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return aF.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?ry.getWordAtPosition(this._modelData.model,this._configuration.options.get(129),e):null}getValue(e=null){if(!this._modelData)return"";const t=!(!e||!e.preserveBOM);let i=0;return e&&e.lineEnding&&"\n"===e.lineEnding?i=1:e&&e.lineEnding&&"\r\n"===e.lineEnding&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){this._modelData&&this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){const t=e;if(null===this._modelData&&null===t)return;if(this._modelData&&this._modelData.model===t)return;const i=this.hasTextFocus(),n=this._detachModel();this._attachModel(t),i&&this.hasModel()&&this.focus();const s={oldModelUrl:n?n.uri:null,newModelUrl:t?t.uri:null};this._removeDecorationTypes(),this._onDidChangeModel.fire(s),this._postDetachModelCleanup(n),this._contributions.onAfterModelAttached()}_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 s=e.model.validatePosition({lineNumber:t,column:i}),o=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(o.lineNumber,n)}getTopForLineNumber(e,t=!1){return this._modelData?GB._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?GB._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const s=e.model.validatePosition({lineNumber:t,column:i}),o=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(o.lineNumber,n)}getBottomForLineNumber(e,t=!1){return this._modelData?GB._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var i;null===(i=this._modelData)||void 0===i||i.viewModel.setHiddenAreas(e.map((e=>Rh.lift(e))),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return dc.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!Va.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(!Rh.isIRange(e))throw new Error("Invalid arguments");const s=this._modelData.model.validateRange(e),o=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(s);this._modelData.viewModel.revealRange("api",i,o,t,n)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if("number"!=typeof e)throw new Error("Invalid arguments");this._sendRevealRange(new Rh(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,n){if(!Va.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new Rh(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=Ah.isISelection(e),n=Rh.isIRange(e);if(!i&&!n)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(n){const i={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(i,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new Ah(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,n){if("number"!=typeof e||"number"!=typeof t)throw new Error("Invalid arguments");this._sendRevealRange(new Rh(e,1,t,1),i,!1,n)}revealRange(e,t=0,i=!1,n=!0){this._revealRange(e,i?1:0,n,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,i,n){if(!Rh.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(Rh.lift(e),t,i,n)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||0===e.length)throw new Error("Invalid arguments");for(let t=0,i=e.length;t0&&this._modelData.viewModel.restoreCursorState(e):this._modelData.viewModel.restoreCursorState([e]),this._contributions.restoreViewState(t.contributionsState||{});const i=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(i)}}handleInitialized(){var e;null===(e=this._getViewModel())||void 0===e||e.visibleLinesStabilized()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter((e=>e.isSupported())),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){switch(i=i||{},t){case"compositionStart":return void this._startComposition();case"compositionEnd":return void this._endComposition(e);case"type":{const t=i;return void this._type(e,t.text||"")}case"replacePreviousChar":{const t=i;return void this._compositionType(e,t.text||"",t.replaceCharCnt||0,0,0)}case"compositionType":{const t=i;return void this._compositionType(e,t.text||"",t.replacePrevCharCnt||0,t.replaceNextCharCnt||0,t.positionDelta||0)}case"paste":{const t=i;return void this._paste(e,t.text||"",t.pasteOnNewLine||!1,t.multicursorText||null,t.mode||null)}case"cut":return void this._cut(e)}const n=this.getAction(t);n?Promise.resolve(n.run(i)).then(void 0,r):this._modelData&&(this._triggerEditorCommand(e,t,i)||this._triggerCommand(t,i))}_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&&0!==t.length&&("keyboard"===e&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),"keyboard"===e&&this._onDidType.fire(t))}_compositionType(e,t,i,n,s){this._modelData&&this._modelData.viewModel.compositionType(t,i,n,s,e)}_paste(e,t,i,n,s){if(!this._modelData||0===t.length)return;const o=this._modelData.viewModel,r=o.getSelection().getStartPosition();o.paste(t,i,n,e);const a=o.getSelection().getStartPosition();"keyboard"===e&&this._onDidPaste.fire({range:new Rh(r.lineNumber,r.column,a.lineNumber,a.column),languageId:s})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const n=xh.getEditorCommand(t);return!!n&&((i=i||{}).source=e,this._instantiationService.invokeFunction((e=>{Promise.resolve(n.runEditorCommand(e,this,i)).then(void 0,r)})),!0)}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!!this._modelData&&(!this._configuration.options.get(90)&&(this._modelData.model.pushStackElement(),!0))}popUndoStop(){return!!this._modelData&&(!this._configuration.options.get(90)&&(this._modelData.model.popStackElement(),!0))}executeEdits(e,t,i){if(!this._modelData)return!1;if(this._configuration.options.get(90))return!1;let n;return n=i?Array.isArray(i)?()=>i:i:()=>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 rW(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,OS(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,OS(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?0===e.length&&0===t.length?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){this._modelData&&0!==e.length&&this._modelData.model.changeDecorations((t=>{t.deltaDecorations(e,[])}))}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.deltaDecorations(t,[]),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(143)}createOverviewRuler(e){return this._modelData&&this._modelData.hasRealView?this._modelData.view.createOverviewRuler(e):null}getContainerDomNode(){return this._domElement}getDomNode(){return this._modelData&&this._modelData.hasRealView?this._modelData.view.domNode.domNode:null}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){this._configuration.observeContainer(e),this.render()}focus(){this._modelData&&this._modelData.hasRealView&&this._modelData.view.focus()}hasTextFocus(){return!(!this._modelData||!this._modelData.hasRealView)&&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."),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 e=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(e)}}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 e=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(e)}}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 e=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(e)}}changeViewZones(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getTargetAtClientPoint(e,t):null}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const t=this._modelData.model.validatePosition(e),i=this._configuration.options,n=i.get(143);return{top:GB._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),left:this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+n.glyphMarginWidth+n.lineNumbersWidth+n.decorationsWidth-this.getScrollLeft(),height:i.get(66)}}getOffsetForColumn(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getOffsetForColumn(e,t):-1}render(e=!1){this._modelData&&this._modelData.hasRealView&&this._modelData.view.render(!0,e)}setAriaOptions(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.setAriaOptions(e)}applyFontInfo(e){Hk(e,this._configuration.options.get(50))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e)return void(this._modelData=null);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 CB(this._id,this._configuration,e,zB.create(),MB.create(this._configuration.options),(e=>An(e)),this.languageConfigurationService,this._themeService,i);t.push(e.onWillDispose((()=>this.setModel(null)))),t.push(n.onEvent((t=>{switch(t.kind){case 0:this._onDidContentSizeChange.fire(t);break;case 1:this._editorTextFocus.setValue(t.hasFocus);break;case 2:this._onDidScrollChange.fire(t);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{if(t.reachedMaxCursorCount){const e=ue(0,"The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",this.getOption(79));this._notificationService.prompt(pL.Warning,e,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:ue(0,"Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const e=[];for(let s=0,o=t.selections.length;s{this._paste("keyboard",e,t,i,n)},type:e=>{this._type("keyboard",e)},compositionType:(e,t,i,n)=>{this._compositionType("keyboard",e,t,i,n)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:{paste:(e,t,i,n)=>{const s={text:e,pasteOnNewLine:t,multicursorText:i,mode:n};this._commandService.executeCommand("paste",s)},type:e=>{const t={text:e};this._commandService.executeCommand("type",t)},compositionType:(e,t,i,n)=>{if(i||n){const s={text:e,replacePrevCharCnt:t,replaceNextCharCnt:i,positionDelta:n};this._commandService.executeCommand("compositionType",s)}else{const i={text:e,replaceCharCnt:t};this._commandService.executeCommand("replacePreviousChar",i)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new LO(e.coordinatesConverter);i.onKeyDown=e=>this._onKeyDown.fire(e),i.onKeyUp=e=>this._onKeyUp.fire(e),i.onContextMenu=e=>this._onContextMenu.fire(e),i.onMouseMove=e=>this._onMouseMove.fire(e),i.onMouseLeave=e=>this._onMouseLeave.fire(e),i.onMouseDown=e=>this._onMouseDown.fire(e),i.onMouseUp=e=>this._onMouseUp.fire(e),i.onMouseDrag=e=>this._onMouseDrag.fire(e),i.onMouseDrop=e=>this._onMouseDrop.fire(e),i.onMouseDropCanceled=e=>this._onMouseDropCanceled.fire(e),i.onMouseWheel=e=>this._onMouseWheel.fire(e);return[new oF(t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){null==e||e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&this._domElement.removeChild(t),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return null!==this._modelData}showDropIndicatorAt(e){const t=[{range:new Rh(e.lineNumber,e.column,e.lineNumber,e.column),options:GB.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}};eW.dropIntoEditorDecorationOptions=Iw.register({description:"workbench-dnd-target",className:"dnd-target"}),eW=GB=ZB([YB(3,Fa),YB(4,Wa),YB(5,Ya),YB(6,Ol),YB(7,P_),YB(8,mL),YB(9,QR),YB(10,Ju),YB(11,oL)],eW);class tW extends E{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new U(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new U(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,2===this._value?this._onDidChangeToTrue.fire():1===this._value&&this._onDidChangeToFalse.fire())}}class iW extends U{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class nW extends E{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=Oh.editorSimpleInput.bindTo(t),this._editorFocus=Oh.focus.bindTo(t),this._textInputFocus=Oh.textInputFocus.bindTo(t),this._editorTextFocus=Oh.editorTextFocus.bindTo(t),this._tabMovesFocus=Oh.tabMovesFocus.bindTo(t),this._editorReadonly=Oh.readOnly.bindTo(t),this._inDiffEditor=Oh.inDiffEditor.bindTo(t),this._editorColumnSelection=Oh.columnSelection.bindTo(t),this._hasMultipleSelections=Oh.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=Oh.hasNonEmptySelection.bindTo(t),this._canUndo=Oh.canUndo.bindTo(t),this._canRedo=Oh.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(XR.onDidChangeTabFocus((e=>this._tabMovesFocus.set(e)))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(XR.getTabFocusMode()),this._editorReadonly.set(e.get(90)),this._inDiffEditor.set(e.get(61)),this._editorColumnSelection.set(e.get(22))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some((e=>!e.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(Boolean(e&&e.canUndo())),this._canRedo.set(Boolean(e&&e.canRedo()))}}class sW extends E{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=Oh.languageId.bindTo(t),this._hasCompletionItemProvider=Oh.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=Oh.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=Oh.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=Oh.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=Oh.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=Oh.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=Oh.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=Oh.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=Oh.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=Oh.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=Oh.hasReferenceProvider.bindTo(t),this._hasRenameProvider=Oh.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=Oh.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=Oh.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=Oh.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=Oh.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=Oh.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=Oh.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=Oh.isInWalkThroughSnippet.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._isInWalkThrough.reset()}))}_update(){const e=this._editor.getModel();e?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._isInWalkThrough.set(e.uri.scheme===vn.walkThroughSnippet)})):this.reset()}}class oW extends E{constructor(e){super(),this._onChange=this._register(new U),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(hs(e)),this._register(this._domFocusTracker.onDidFocus((()=>{this._hasFocus=!0,this._onChange.fire(void 0)}))),this._register(this._domFocusTracker.onDidBlur((()=>{this._hasFocus=!1,this._onChange.fire(void 0)})))}hasFocus(){return this._hasFocus}}class rW{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((i=>{this._isChangingDecorations||e.call(t,i)}),i)}getRange(e){return this._editor.hasModel()?e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e]):null}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(){0!==this._decorationIds.length&&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}}const aW=encodeURIComponent("");function hW(e){return aW+encodeURIComponent(e.toString())+lW}const dW=encodeURIComponent('');H_(((e,t)=>{const i=e.getColor(fm);i&&t.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${hW(i)}") repeat-x bottom left; }`);const n=e.getColor(vm);n&&t.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${hW(n)}") repeat-x bottom left; }`);const s=e.getColor(Cm);s&&t.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${hW(s)}") repeat-x bottom left; }`);const o=e.getColor(ym);o&&t.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${function(e){return dW+encodeURIComponent(e.toString())+cW}(o)}") no-repeat bottom left; }`);const r=e.getColor(gv);r&&t.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${r.rgba.a}; }`)}));var uW=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},gW=function(e,t){return function(i,n){t(i,n,e)}};let pW=class extends eW{constructor(e,t,i,n,s,o,r,a,l,h,d,c,u){super(e,Object.assign(Object.assign({},n.getRawOptions()),{overflowWidgetsDomNode:n.getOverflowWidgetsDomNode()}),i,s,o,r,a,l,h,d,c,u),this._parentEditor=n,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(n.onDidChangeConfiguration((e=>this._onParentConfigurationChanged(e))))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){_d(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};pW=uW([gW(4,Fa),gW(5,Wa),gW(6,Ya),gW(7,Ol),gW(8,P_),gW(9,mL),gW(10,QR),gW(11,Ju),gW(12,oL)],pW);var mW=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};var fW;!function(e){e.North="north",e.South="south",e.East="east",e.West="west"}(fW||(fW={}));const _W=new U;const vW=new U;class bW{constructor(){this.disposables=new N}get onPointerMove(){return this.disposables.add(new Ky(window,"mousemove")).event}get onPointerUp(){return this.disposables.add(new Ky(window,"mouseup")).event}dispose(){this.disposables.dispose()}}mW([qL],bW.prototype,"onPointerMove",null),mW([qL],bW.prototype,"onPointerUp",null);class CW{get onPointerMove(){return this.disposables.add(new Ky(this.el,$L.Change)).event}get onPointerUp(){return this.disposables.add(new Ky(this.el,$L.End)).event}constructor(e){this.el=e,this.disposables=new N}dispose(){this.disposables.dispose()}}mW([qL],CW.prototype,"onPointerMove",null),mW([qL],CW.prototype,"onPointerUp",null);class wW{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}mW([qL],wW.prototype,"onPointerMove",null),mW([qL],wW.prototype,"onPointerUp",null);const yW="pointer-events-disabled";class SW extends E{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",0===e),this.el.classList.toggle("minimum",1===e),this.el.classList.toggle("maximum",2===e),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=t=>{this.orthogonalStartDragHandleDisposables.clear(),0!==t&&(this._orthogonalStartDragHandle=ds(this.el,fs(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(x((()=>this._orthogonalStartDragHandle.remove()))),this.orthogonalStartDragHandleDisposables.add(new Ky(this._orthogonalStartDragHandle,"mouseenter")).event((()=>SW.onMouseEnter(e)),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new Ky(this._orthogonalStartDragHandle,"mouseleave")).event((()=>SW.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=t=>{this.orthogonalEndDragHandleDisposables.clear(),0!==t&&(this._orthogonalEndDragHandle=ds(this.el,fs(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(x((()=>this._orthogonalEndDragHandle.remove()))),this.orthogonalEndDragHandleDisposables.add(new Ky(this._orthogonalEndDragHandle,"mouseenter")).event((()=>SW.onMouseEnter(e)),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new Ky(this._orthogonalEndDragHandle,"mouseleave")).event((()=>SW.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=300,this.hoverDelayer=this._register(new Jh(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new U),this._onDidStart=this._register(new U),this._onDidChange=this._register(new U),this._onDidReset=this._register(new U),this._onDidEnd=this._register(new U),this.orthogonalStartSashDisposables=this._register(new N),this.orthogonalStartDragHandleDisposables=this._register(new N),this.orthogonalEndSashDisposables=this._register(new N),this.orthogonalEndDragHandleDisposables=this._register(new N),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=ds(e,fs(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),Pe&&this.el.classList.add("mac");const n=this._register(new Ky(this.el,"mousedown")).event;this._register(n((e=>this.onPointerStart(e,new bW)),this));const s=this._register(new Ky(this.el,"dblclick")).event;this._register(s(this.onPointerDoublePress,this));const o=this._register(new Ky(this.el,"mouseenter")).event;this._register(o((()=>SW.onMouseEnter(this))));const r=this._register(new Ky(this.el,"mouseleave")).event;this._register(r((()=>SW.onMouseLeave(this)))),this._register(ZL.addTarget(this.el));const a=this._register(new Ky(this.el,$L.Start)).event;this._register(a((e=>this.onPointerStart(e,new CW(this.el))),this));const l=this._register(new Ky(this.el,$L.Tap)).event;let h;this._register(l((e=>{if(h)return clearTimeout(h),h=void 0,void this.onPointerDoublePress(e);clearTimeout(h),h=setTimeout((()=>h=void 0),250)}),this)),"number"==typeof i.size?(this.size=i.size,0===i.orientation?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=4,this._register(_W.event((e=>{this.size=e,this.layout()})))),this._register(vW.event((e=>this.hoverDelay=e))),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||0,1===this.orientation?(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",false),this.layout()}onPointerStart(e,t){as(e);let i=!1;if(!e.__orthogonalSashEvent){const n=this.getOrthogonalSash(e);n&&(i=!0,e.__orthogonalSashEvent=!0,n.onPointerStart(e,new wW(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new wW(t))),!this.state)return;const n=document.getElementsByTagName("iframe");for(const c of n)c.classList.add(yW);const s=e.pageX,o=e.pageY,r=e.altKey,a={startX:s,currentX:s,startY:o,currentY:o,altKey:r};this.el.classList.add("active"),this._onDidStart.fire(a);const l=Jn(this.el),h=()=>{let e="";e=i?"all-scroll":1===this.orientation?1===this.state?"s-resize":2===this.state?"n-resize":Pe?"row-resize":"ns-resize":1===this.state?"e-resize":2===this.state?"w-resize":Pe?"col-resize":"ew-resize",l.textContent=`* { cursor: ${e} !important; }`},d=new N;h(),i||this.onDidEnablementChange.event(h,null,d);t.onPointerMove((e=>{as(e,!1);const t={startX:s,currentX:e.pageX,startY:o,currentY:e.pageY,altKey:r};this._onDidChange.fire(t)}),null,d),t.onPointerUp((e=>{as(e,!1),this.el.removeChild(l),this.el.classList.remove("active"),this._onDidEnd.fire(),d.dispose();for(const t of n)t.classList.remove(yW)}),null,d),d.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&&SW.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&SW.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){SW.onMouseLeave(this)}layout(){if(0===this.orientation){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){var t;const i=null!==(t=e.initialTarget)&&void 0!==t?t:e.target;if(i&&i instanceof HTMLElement)return i.classList.contains("orthogonal-drag-handle")?i.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash:void 0}dispose(){super.dispose(),this.el.remove()}}const LW=new lc(new oc(0,122,204)),kW={showArrow:!0,showFrame:!0,className:"",frameColor:LW,arrowColor:LW,keepEditorSelection:!1};class DW{constructor(e,t,i,n,s,o,r,a){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=n,this.showInHiddenAreas=r,this.ordinal=a,this._onDomNodeTop=s,this._onComputedHeight=o}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class xW{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class NW{constructor(e){this._editor=e,this._ruleName=NW._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),ns(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(){ns(this._ruleName),is(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){1===e.column&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:Rh.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}NW._IdGenerator=new dk(".arrow-decoration-");class EW{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new N,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=gd(t),_d(this.options,kW,!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((e=>{const t=this._getWidth(e);this.domNode.style.width=t+"px",this.domNode.style.left=this._getLeft(e)+"px",this._onWidth(t)})))}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 NW(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&&0===e.minimap.minimapLeft?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;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))}null===(t=this._resizeSash)||void 0===t||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const i=Rh.isIRange(e)?Rh.lift(e):Rh.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:Iw.EMPTY}])}hide(){var e;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),null===(e=this._arrow)||void 0===e||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(66);let t=0;if(this.options.showArrow){t+=2*Math.round(e/3)}if(this.options.showFrame){t+=2*Math.round(e/9)}return t}_showImpl(e,t){const i=e.getStartPosition(),n=this.editor.getLayoutInfo(),s=this._getWidth(n);this.domNode.style.width=`${s}px`,this.domNode.style.left=this._getLeft(n)+"px";const o=document.createElement("div");o.style.overflow="hidden";const r=this.editor.getOption(66);if(!this.options.allowUnlimitedHeight){const e=Math.max(12,this.editor.getLayoutInfo().height/r*.8);t=Math.min(t,e)}let a=0,l=0;if(this._arrow&&this.options.showArrow&&(a=Math.round(r/3),this._arrow.height=a,this._arrow.show(i)),this.options.showFrame&&(l=Math.round(r/9)),this.editor.changeViewZones((e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new DW(o,i.lineNumber,i.column,t,(e=>this._onViewZoneTop(e)),(e=>this._onViewZoneHeight(e)),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=e.addZone(this._viewZone),this._overlayWidget=new xW("vs.editor.contrib.zoneWidget"+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)})),this.container&&this.options.showFrame){const e=this.options.frameWidth?this.options.frameWidth:l;this.container.style.borderTopWidth=e+"px",this.container.style.borderBottomWidth=e+"px"}const h=t*r-this._decoratingElementsHeight();this.container&&(this.container.style.top=a+"px",this.container.style.height=h+"px",this.container.style.overflow="hidden"),this._doLayout(h,s),this.options.keepEditorSelection||this.editor.setSelection(e);const d=this.editor.getModel();if(d){const t=d.validateRange(new Rh(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(t,t.startLineNumber===d.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}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;let e;this._resizeSash=this._disposables.add(new SW(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0),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(66),n=i<0?Math.ceil(i):Math.floor(i),s=e.heightInLines+n;s>5&&s<35&&this._relayout(s)}})))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(null===this.domNode.style.height?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}class IW extends ja{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new U),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=ds(e,fs(".monaco-dropdown")),this._label=ds(this._element,fs(".dropdown-label"));let i=t.labelRenderer;i||(i=e=>(e.textContent=t.label||"",null));for(const s of[os.CLICK,os.MOUSE_DOWN,$L.Tap])this._register(En(this.element,s,(e=>as(e,!0))));for(const s of[os.MOUSE_DOWN,$L.Tap])this._register(En(this._label,s,(e=>{e instanceof MouseEvent&&(e.detail>1||0!==e.button)||(this.visible?this.hide():this.show())})));this._register(En(this._label,os.KEY_UP,(e=>{const t=new St(e);(t.equals(3)||t.equals(10))&&(as(e,!0),this.visible?this.hide():this.show())})));const n=i(this._label);n&&this._register(n),this._register(ZL.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}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 MW extends IW{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:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class TW extends Ex{constructor(e,t,i,n=Object.create(null)){super(null,e,n),this.actionItem=null,this._onDidChangeVisibility=this._register(new U),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=Array.isArray(this.menuActionsOrProvider),i={contextMenuProvider:this.contextMenuProvider,labelRenderer:e=>{this.element=ds(e,fs("a.action-label"));let t=[];return"string"==typeof this.options.classNames?t=this.options.classNames.split(/\s+/g).filter((e=>!!e)):this.options.classNames&&(t=this.options.classNames),t.find((e=>"icon"===e))||t.push("codicon"),this.element.classList.add(...t),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this.element.title=this._action.label||"",this.element.ariaLabel=this._action.label||"",null},menuAsChild:this.options.menuAsChild,actions:t?this.menuActionsOrProvider:void 0,actionProvider:t?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new MW(e,i)),this._register(this.dropdownMenu.onDidChangeVisibility((e=>{var t;null===(t=this.element)||void 0===t||t.setAttribute("aria-expanded",`${e}`),this._onDidChangeVisibility.fire(e)}))),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const e=this;this.dropdownMenu.menuOptions=Object.assign(Object.assign({},this.dropdownMenu.menuOptions),{get anchorAlignment(){return e.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),null!=e?e:void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){var e;null===(e=this.dropdownMenu)||void 0===e||e.show()}updateEnabled(){var e,t;const i=!this.action.enabled;null===(e=this.actionItem)||void 0===e||e.classList.toggle("disabled",i),null===(t=this.element)||void 0===t||t.classList.toggle("disabled",i)}}var RW=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},AW=function(e,t){return function(i,n){t(i,n,e)}},OW=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function PW(e,t,i,n,s,o){FW(e.getActions(t),i,!1,"string"==typeof n?e=>e===n:n,s,o)}function FW(e,t,i,n=e=>"navigation"===e,s=()=>!1,o=!1){let r,a;Array.isArray(t)?(r=t,a=t):(r=t.primary,a=t.secondary);const l=new Set;for(const[h,d]of e){let e;n(h)?(e=r,e.length>0&&o&&e.push(new qa)):(e=a,e.length>0&&e.push(new qa));for(let t of d){i&&(t=t instanceof oh&&t.alt?t.alt:t);const n=e.push(t);t instanceof $a&&l.add({group:h,action:t,index:n-1})}}for(const{group:h,action:d,index:c}of l){const e=n(h)?r:a,t=d.actions;s(d,h,e.length)&&e.splice(c,1,...t)}}let BW=class extends Ix{constructor(e,t,i,n,s,o,r,a){super(void 0,e,{icon:!(!e.class&&!e.item.icon),label:!e.class&&!e.item.icon,draggable:null==t?void 0:t.draggable,keybinding:null==t?void 0:t.keybinding,hoverDelegate:null==t?void 0:t.hoverDelegate}),this._keybindingService=i,this._notificationService=n,this._contextKeyService=s,this._themeService=o,this._contextMenuService=r,this._accessibilityService=a,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new I),this._altKey=ks.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){return OW(this,void 0,void 0,(function*(){e.preventDefault(),e.stopPropagation();try{yield 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=()=>{var e;const i=!!(null===(e=this._menuItemAction.alt)||void 0===e?void 0:e.enabled)&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);i!==this._wantsAltCommand&&(this._wantsAltCommand=i,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(En(e,"mouseleave",(e=>{t=!1,i()}))),this._register(En(e,"mouseenter",(e=>{t=!0,i()}))),i()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var e;const t=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),i=t&&t.getLabel(),n=this._commandAction.tooltip||this._commandAction.label;let s=i?ue(0,"{0} ({1})",n,i):n;if(!this._wantsAltCommand&&(null===(e=this._menuItemAction.alt)||void 0===e?void 0:e.enabled)){const e=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,t=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),i=t&&t.getLabel(),n=i?ue(0,"{0} ({1})",e,i):e;s=ue(0,"{0}\n[{1}] {2}",s,Ox.modifierLabels[$e].altKey,n)}return s}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const n=this._commandAction.checked&&((s=e.toggled)&&void 0!==s.condition)&&e.toggled.icon?e.toggled.icon:e.icon;var s;if(n)if(ta.isThemeIcon(n)){const e=ta.asClassNameArray(n);i.classList.add(...e),this._itemClassDispose.value=x((()=>{i.classList.remove(...e)}))}else{const e=O_(this._themeService.getColorTheme().type)?ws(n.dark):ws(n.light),t=fs("span");t.style.webkitMask=t.style.mask=`${e} no-repeat 50% 50%`,t.style.background="var(--vscode-icon-foreground)",t.style.display="inline-block",t.style.width="100%",t.style.height="100%",i.appendChild(t),i.classList.add("icon"),this._itemClassDispose.value=D(x((()=>{i.classList.remove("icon"),us(i)})),this._themeService.onDidColorThemeChange((()=>{this.updateClass()})))}}};BW=RW([AW(2,WL),AW(3,mL),AW(4,Ol),AW(5,P_),AW(6,Kx),AW(7,QR)],BW);let WW=class extends TW{constructor(e,t,i,n,s){var o,r,a;const l=Object.assign(Object.assign({},t),{menuAsChild:null!==(o=null==t?void 0:t.menuAsChild)&&void 0!==o&&o,classNames:null!==(r=null==t?void 0:t.classNames)&&void 0!==r?r:ta.isThemeIcon(e.item.icon)?ta.asClassName(e.item.icon):void 0,keybindingProvider:null!==(a=null==t?void 0:t.keybindingProvider)&&void 0!==a?a:e=>i.lookupKeybinding(e.id)});super(e,{getActions:()=>e.actions},n,l),this._keybindingService=i,this._contextMenuService=n,this._themeService=s}render(e){super.render(e),qr(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!ta.isThemeIcon(i)){this.element.classList.add("icon");const e=()=>{this.element&&(this.element.style.backgroundImage=O_(this._themeService.getColorTheme().type)?ws(i.dark):ws(i.light))};e(),this._register(this._themeService.onDidColorThemeChange((()=>{e()})))}}};WW=RW([AW(2,WL),AW(3,Kx),AW(4,P_)],WW);let VW=class extends Ex{constructor(e,t,i,n,s,o,r,a){var l,h,d;let c;super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=s,this._menuService=o,this._instaService=r,this._storageService=a,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;const u=(null==t?void 0:t.persistLastActionId)?a.get(this._storageKey,1):void 0;u&&(c=e.actions.find((e=>u===e.id))),c||(c=e.actions[0]),this._defaultAction=this._instaService.createInstance(BW,c,{keybinding:this._getDefaultActionKeybindingLabel(c)});const g=Object.assign(Object.assign({keybindingProvider:e=>this._keybindingService.lookupKeybinding(e.id)},t),{menuAsChild:null===(l=null==t?void 0:t.menuAsChild)||void 0===l||l,classNames:null!==(h=null==t?void 0:t.classNames)&&void 0!==h?h:["codicon","codicon-chevron-down"],actionRunner:null!==(d=null==t?void 0:t.actionRunner)&&void 0!==d?d:new ja});this._dropdown=new TW(e,e.actions,this._contextMenuService,g),this._dropdown.actionRunner.onDidRun((e=>{e.action instanceof oh&&this.update(e.action)}))}update(e){var t;(null===(t=this._options)||void 0===t?void 0:t.persistLastActionId)&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(BW,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends ja{runAction(e,t){return OW(this,void 0,void 0,(function*(){yield e.run(void 0)}))}},this._container&&this._defaultAction.render(cs(this._container,fs(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let i;if(null===(t=this._options)||void 0===t?void 0:t.renderKeybindingWithDefaultActionLabel){const t=this._keybindingService.lookupKeybinding(e.id);t&&(i=`(${t.getLabel()})`)}return i}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=fs(".action-container");this._defaultAction.render(ds(this._container,t)),this._register(En(t,os.KEY_DOWN,(e=>{const t=new St(e);t.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),t.stopPropagation())})));const i=fs(".dropdown-action-container");this._dropdown.render(ds(this._container,i)),this._register(En(i,os.KEY_DOWN,(e=>{var t;const i=new St(e);i.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),null===(t=this._defaultAction.element)||void 0===t||t.focus(),i.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()}};VW=RW([AW(2,WL),AW(3,mL),AW(4,Kx),AW(5,th),AW(6,Fa),AW(7,ZN)],VW);let HW=class extends Mx{constructor(e,t){super(null,e,e.actions.map((e=>({text:e.id===qa.ID?"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500":e.label,isDisabled:!e.enabled}))),0,t,eN,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex((e=>e.checked))))}render(e){super.render(e),e.style.borderColor=Sp(em)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};function zW(e,t,i){return t instanceof oh?e.createInstance(BW,t,i):t instanceof sh?t.item.isSelection?e.createInstance(HW,t):t.item.rememberDefaultAction?e.createInstance(VW,t,Object.assign(Object.assign({},i),{persistLastActionId:!0})):e.createInstance(WW,t,i):void 0}HW=RW([AW(1,Ux)],HW);var UW=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},KW=function(e,t){return function(i,n){t(i,n,e)}};const jW=Ba("IPeekViewService");var qW;yu(jW,class{constructor(){this._widgets=new Map}addExclusiveWidget(e,t){const i=this._widgets.get(e);i&&(i.listener.dispose(),i.widget.dispose());this._widgets.set(e,{widget:t,listener:t.onDidClose((()=>{const i=this._widgets.get(e);i&&i.widget===t&&(i.listener.dispose(),this._widgets.delete(e))}))})}},1),function(e){e.inPeekEditor=new Al("inReferenceSearchEditor",!0,ue(0,"Whether the current code editor is embedded inside peek")),e.notInPeekEditor=e.inPeekEditor.toNegated()}(qW||(qW={}));let $W=class{constructor(e,t){e instanceof pW&&qW.inPeekEditor.bindTo(t)}dispose(){}};$W.ID="editor.contrib.referenceController",$W=UW([KW(1,Ol)],$W),Dh($W.ID,$W,0);const GW={headerBackgroundColor:lc.white,primaryHeadingColor:lc.fromHex("#333333"),secondaryHeadingColor:lc.fromHex("#6c6c6cb3")};let ZW=class extends EW{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new U,this.onDidClose=this._onDidClose.event,_d(this.options,GW,!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=fs(".head"),this._bodyElement=fs(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=fs(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),Mn(this._titleElement,"click",(e=>this._onTitleClick(e)))),ds(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=fs("span.filename"),this._secondaryHeading=fs("span.dirname"),this._metaHeading=fs("span.meta"),ds(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=fs(".peekview-actions");ds(this._headElement,i);const n=this._getActionBarOptions();this._actionbarWidget=new Rx(i,n),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new Ka("peekview.close",ue(0,"Close"),ta.asClassName(Jr.close),!0,(()=>(this.dispose(),Promise.resolve()))),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:zW.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:Dn(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,_s(this._metaHeading)):vs(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0)return void this.dispose();const i=Math.ceil(1.2*this.editor.getOption(66)),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`)}};ZW=UW([KW(2,Fa)],ZW);const YW=Dp("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:lc.black,hcLight:lc.white},ue(0,"Background color of the peek view title area.")),XW=Dp("peekViewTitleLabel.foreground",{dark:lc.white,light:lc.black,hcDark:lc.white,hcLight:Lm},ue(0,"Color of the peek view title.")),QW=Dp("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},ue(0,"Color of the peek view title info.")),JW=Dp("peekView.border",{dark:Cm,light:Cm,hcDark:Mp,hcLight:Mp},ue(0,"Color of the peek view borders and arrow.")),eV=Dp("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:lc.black,hcLight:lc.white},ue(0,"Background color of the peek view result list.")),tV=(Dp("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:lc.white,hcLight:Lm},ue(0,"Foreground color for line nodes in the peek view result list.")),Dp("peekViewResult.fileForeground",{dark:lc.white,light:"#1E1E1E",hcDark:lc.white,hcLight:Lm},ue(0,"Foreground color for file nodes in the peek view result list.")),Dp("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},ue(0,"Background color of the selected entry in the peek view result list.")),Dp("peekViewResult.selectionForeground",{dark:lc.white,light:"#6C6C6C",hcDark:lc.white,hcLight:Lm},ue(0,"Foreground color of the selected entry in the peek view result list.")),Dp("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:lc.black,hcLight:lc.white},ue(0,"Background color of the peek view editor.")));Dp("peekViewEditorGutter.background",{dark:tV,light:tV,hcDark:tV,hcLight:tV},ue(0,"Background color of the gutter in the peek view editor.")),Dp("peekViewEditorStickyScroll.background",{dark:tV,light:tV,hcDark:tV,hcLight:tV},ue(0,"Background color of sticky scroll in the peek view editor.")),Dp("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},ue(0,"Match highlight color in the peek view result list.")),Dp("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},ue(0,"Match highlight color in the peek view editor.")),Dp("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Tp,hcLight:Tp},ue(0,"Match highlight border in the peek view editor."));function iV(e){return!(!e||"function"!=typeof e.getEditorType)&&e.getEditorType()===aF.ICodeEditor}function nV(e){return!(!e||"function"!=typeof e.getEditorType)&&e.getEditorType()===aF.IDiffEditor}function sV(e){return iV(e)?e:nV(e)?e.getModifiedEditor():function(e){return!!e&&"object"==typeof e&&"function"==typeof e.onDidChangeActiveEditor}(e)&&iV(e.activeCodeEditor)?e.activeCodeEditor:null}class oV{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:E.None}}renderElement(e,t,i,n){var s;if(null===(s=i.disposable)||void 0===s||s.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 jh,a=o.resolve(e,r.token);i.disposable={dispose:()=>r.cancel()},this.renderer.renderPlaceholder(e,i.data),a.then((t=>this.renderer.renderElement(t,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 rV{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}}class aV{constructor(e,t,i,n,s={}){const o=()=>this.model,r=n.map((e=>new oV(e,o)));this.list=new yx(e,t,i,r,function(e,t){return Object.assign(Object.assign({},t),{accessibilityProvider:t.accessibilityProvider&&new rV(e,t.accessibilityProvider)})}(o,s))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return B.map(this.list.onMouseDblClick,(({element:e,index:t,browserEvent:i})=>({element:void 0===e?void 0:this._model.get(e),index:t,browserEvent:i})))}get onPointer(){return B.map(this.list.onPointer,(({element:e,index:t,browserEvent:i})=>({element:void 0===e?void 0:this._model.get(e),index:t,browserEvent:i})))}get onDidChangeSelection(){return B.map(this.list.onDidChangeSelection,(({elements:e,indexes:t,browserEvent:i})=>({elements:e.map((e=>this._model.get(e))),indexes:t,browserEvent:i})))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,Kd(e.length))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map((e=>this.model.get(e)))}style(e){this.list.style(e)}dispose(){this.list.dispose()}}const lV={separatorBorder:lc.transparent};class hV{set size(e){this._size=e}get size(){return this._size}get visible(){return void 0===this._cachedVisibleSize}setVisible(e,t){var i,n;e!==this.visible&&(e?(this.size=uD(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize="number"==typeof t?t:this.size,this.size=0),this.container.classList.toggle("visible",e),null===(n=(i=this.view).setVisible)||void 0===n||n.call(i,e))}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(){var e;return null===(e=this.view.proportionalLayout)||void 0===e||e}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,"number"==typeof i?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}layout(e,t){this.layoutContainer(e),this.view.layout(this.size,e,t)}dispose(){this.disposable.dispose()}}class dV extends hV{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class cV extends hV{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var uV,gV;!function(e){e[e.Idle=0]="Idle",e[e.Busy=1]="Busy"}(uV||(uV={})),function(e){e.Distribute={type:"distribute"},e.Split=function(e){return{type:"split",index:e}},e.Auto=function(e){return{type:"auto",index:e}},e.Invisible=function(e){return{type:"invisible",cachedVisibleSize:e}}}(gV||(gV={}));class pV extends E{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}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={}){var i,n,s,o,r;super(),this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=uV.Idle,this._onDidSashChange=this._register(new U),this._onDidSashReset=this._register(new U),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=null!==(i=t.orientation)&&void 0!==i?i:0,this.inverseAltBehavior=null!==(n=t.inverseAltBehavior)&&void 0!==n&&n,this.proportionalLayout=null===(s=t.proportionalLayout)||void 0===s||s,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(0===this.orientation?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=ds(this.el,fs(".sash-container")),this.viewContainer=fs(".split-view-container"),this.scrollable=this._register(new DD({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:An})),this.scrollableElement=this._register(new AD(this.viewContainer,{vertical:0===this.orientation?null!==(o=t.scrollbarVisibility)&&void 0!==o?o:1:2,horizontal:1===this.orientation?null!==(r=t.scrollbarVisibility)&&void 0!==r?r:1:2},this.scrollable));const a=this._register(new Ky(this.viewContainer,"scroll")).event;this._register(a((e=>{const t=this.scrollableElement.getScrollPosition(),i=Math.abs(this.viewContainer.scrollLeft-t.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,n=Math.abs(this.viewContainer.scrollTop-t.scrollTop)<=1?void 0:this.viewContainer.scrollTop;void 0===i&&void 0===n||this.scrollableElement.setScrollPosition({scrollLeft:i,scrollTop:n})}))),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll((e=>{e.scrollTopChanged&&(this.viewContainer.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this.viewContainer.scrollLeft=e.scrollLeft)}))),ds(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||lV),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach(((e,t)=>{const i=Ur(e.visible)||e.visible?e.size:{type:"invisible",cachedVisibleSize:e.size},n=e.view;this.doAddView(n,i,t,!0)})),this.contentSize=this.viewItems.reduce(((e,t)=>e+t.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)}layout(e,t){const i=Math.max(this.size,this.contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let t=0;for(let i=0;i1===this.viewItems[e].priority)),s=t.filter((e=>2===this.viewItems[e].priority));this.resize(this.viewItems.length-1,e-i,void 0,n,s)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map((e=>e.proportionalLayout?e.size/this.contentSize:void 0)))}onSashStart({sash:e,start:t,alt:i}){for(const r of this.viewItems)r.enabled=!1;const n=this.sashItems.findIndex((t=>t.sash===e)),s=D(En(document.body,"keydown",(e=>o(this.sashDragState.current,e.altKey))),En(document.body,"keyup",(()=>o(this.sashDragState.current,!1)))),o=(e,t)=>{const i=this.viewItems.map((e=>e.size));let o,r,a=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(t=!t),t){if(n===this.sashItems.length-1){const e=this.viewItems[n];a=(e.minimumSize-e.size)/2,l=(e.maximumSize-e.size)/2}else{const e=this.viewItems[n+1];a=(e.size-e.maximumSize)/2,l=(e.size-e.minimumSize)/2}}if(!t){const e=Kd(n,-1),t=Kd(n+1,this.viewItems.length),s=e.reduce(((e,t)=>e+(this.viewItems[t].minimumSize-i[t])),0),a=e.reduce(((e,t)=>e+(this.viewItems[t].viewMaximumSize-i[t])),0),l=0===t.length?Number.POSITIVE_INFINITY:t.reduce(((e,t)=>e+(i[t]-this.viewItems[t].minimumSize)),0),h=0===t.length?Number.NEGATIVE_INFINITY:t.reduce(((e,t)=>e+(i[t]-this.viewItems[t].viewMaximumSize)),0),d=Math.max(s,h),c=Math.min(l,a),u=this.findFirstSnapIndex(e),g=this.findFirstSnapIndex(t);if("number"==typeof u){const e=this.viewItems[u],t=Math.floor(e.viewMinimumSize/2);o={index:u,limitDelta:e.visible?d-t:d+t,size:e.size}}if("number"==typeof g){const e=this.viewItems[g],t=Math.floor(e.viewMinimumSize/2);r={index:g,limitDelta:e.visible?c+t:c-t,size:e.size}}}this.sashDragState={start:e,current:e,index:n,sizes:i,minDelta:a,maxDelta:l,alt:t,snapBefore:o,snapAfter:r,disposable:s}};o(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:n,alt:s,minDelta:o,maxDelta:r,snapBefore:a,snapAfter:l}=this.sashDragState;this.sashDragState.current=e;const h=e-i,d=this.resize(t,h,n,void 0,void 0,o,r,a,l);if(s){const e=t===this.sashItems.length-1,i=this.viewItems.map((e=>e.size)),n=e?t:t+1,s=this.viewItems[n],o=s.size-s.maximumSize,r=s.size-s.minimumSize,a=e?t-1:t+1;this.resize(a,-d,i,void 0,void 0,o,r)}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=uD(t="number"==typeof t?t:e.size,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(this.state!==uV.Idle)throw new Error("Cant modify splitview");if(this.state=uV.Busy,e<0||e>=this.viewItems.length)return;const i=Kd(this.viewItems.length).filter((t=>t!==e)),n=[...i.filter((e=>1===this.viewItems[e].priority)),e],s=i.filter((e=>2===this.viewItems[e].priority)),o=this.viewItems[e];t=uD(t=Math.round(t),o.minimumSize,Math.min(o.maximumSize,this.size)),o.size=t,this.relayout(n,s),this.state=uV.Idle}distributeViewSizes(){const e=[];let t=0;for(const r of this.viewItems)r.maximumSize-r.minimumSize>0&&(e.push(r),t+=r.size);const i=Math.floor(t/e.length);for(const r of e)r.size=uD(i,r.minimumSize,r.maximumSize);const n=Kd(this.viewItems.length),s=n.filter((e=>1===this.viewItems[e].priority)),o=n.filter((e=>2===this.viewItems[e].priority));this.relayout(s,o)}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!==uV.Idle)throw new Error("Cant modify splitview");this.state=uV.Busy;const s=fs(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(s):this.viewContainer.insertBefore(s,this.viewContainer.children.item(i));const o=e.onDidChange((e=>this.onViewChange(l,e))),r=D(o,x((()=>this.viewContainer.removeChild(s))));let a;"number"==typeof t?a=t:("auto"===t.type&&(t=this.areViewsDistributed()?{type:"distribute"}:{type:"split",index:t.index}),a="split"===t.type?this.getViewSize(t.index)/2:"invisible"===t.type?{cachedVisibleSize:t.cachedVisibleSize}:e.minimumSize);const l=0===this.orientation?new dV(s,e,a,r):new cV(s,e,a,r);if(this.viewItems.splice(i,0,l),this.viewItems.length>1){const e={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},t=0===this.orientation?new SW(this.sashContainer,{getHorizontalSashTop:e=>this.getSashPosition(e),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},e),{orientation:1})):new SW(this.sashContainer,{getVerticalSashLeft:e=>this.getSashPosition(e),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},e),{orientation:0})),n=0===this.orientation?e=>({sash:t,start:e.startY,current:e.currentY,alt:e.altKey}):e=>({sash:t,start:e.startX,current:e.currentX,alt:e.altKey}),s=B.map(t.onDidStart,n)(this.onSashStart,this),o=B.map(t.onDidChange,n)(this.onSashChange,this),r=B.map(t.onDidEnd,(()=>this.sashItems.findIndex((e=>e.sash===t)))),a=r(this.onSashEnd,this),l=t.onDidReset((()=>{const e=this.sashItems.findIndex((e=>e.sash===t)),i=Kd(e,-1),n=Kd(e+1,this.viewItems.length),s=this.findFirstSnapIndex(i),o=this.findFirstSnapIndex(n);("number"!=typeof s||this.viewItems[s].visible)&&("number"!=typeof o||this.viewItems[o].visible)&&this._onDidSashReset.fire(e)})),h=D(s,o,a,l,t),d={sash:t,disposable:h};this.sashItems.splice(i-1,0,d)}let h;s.appendChild(e.element),"number"!=typeof t&&"split"===t.type&&(h=[t.index]),n||this.relayout([i],h),this.state=uV.Idle,n||"number"==typeof t||"distribute"!==t.type||this.distributeViewSizes()}relayout(e,t){const i=this.viewItems.reduce(((e,t)=>e+t.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((e=>e.size)),n,s,o=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,a,l){if(e<0||e>=this.viewItems.length)return 0;const h=Kd(e,-1),d=Kd(e+1,this.viewItems.length);if(s)for(const y of s)qd(h,y),qd(d,y);if(n)for(const y of n)$d(h,y),$d(d,y);const c=h.map((e=>this.viewItems[e])),u=h.map((e=>i[e])),g=d.map((e=>this.viewItems[e])),p=d.map((e=>i[e])),m=h.reduce(((e,t)=>e+(this.viewItems[t].minimumSize-i[t])),0),f=h.reduce(((e,t)=>e+(this.viewItems[t].maximumSize-i[t])),0),_=0===d.length?Number.POSITIVE_INFINITY:d.reduce(((e,t)=>e+(i[t]-this.viewItems[t].minimumSize)),0),v=0===d.length?Number.NEGATIVE_INFINITY:d.reduce(((e,t)=>e+(i[t]-this.viewItems[t].maximumSize)),0),b=Math.max(m,v,o),C=Math.min(_,f,r);let w=!1;if(a){const e=this.viewItems[a.index],i=t>=a.limitDelta;w=i!==e.visible,e.setVisible(i,a.size)}if(!w&&l){const e=this.viewItems[l.index],i=te+t.size),0);let i=this.size-t;const n=Kd(this.viewItems.length-1,-1),s=n.filter((e=>1===this.viewItems[e].priority)),o=n.filter((e=>2===this.viewItems[e].priority));for(const r of o)qd(n,r);for(const r of s)$d(n,r);"number"==typeof e&&$d(n,e);for(let r=0;0!==i&&re+t.size),0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach((e=>e.sash.layout())),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){0===this.orientation?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((t=>e=t.size-t.minimumSize>0||e));e=!1;const i=this.viewItems.map((t=>e=t.maximumSize-t.size>0||e)),n=[...this.viewItems].reverse();e=!1;const s=n.map((t=>e=t.size-t.minimumSize>0||e)).reverse();e=!1;const o=n.map((t=>e=t.maximumSize-t.size>0||e)).reverse();let r=0;for(let a=0;a0||this.startSnappingEnabled)?e.state=1:d&&t[a]&&(r0)return;if(!e.visible&&e.snap)return t}}areViewsDistributed(){let e,t;for(const i of this.viewItems)if(e=void 0===e?i.size:Math.min(e,i.size),t=void 0===t?i.size:Math.max(t,i.size),t-e>2)return!1;return!0}dispose(){var e;null===(e=this.sashDragState)||void 0===e||e.disposable.dispose(),k(this.viewItems),this.viewItems=[],this.sashItems.forEach((e=>e.disposable.dispose())),this.sashItems=[],super.dispose()}}class mV{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=mV.TemplateId,this.renderedTemplates=new Set;const n=new Map(t.map((e=>[e.templateId,e])));this.renderers=[];for(const s of e){const e=n.get(s.templateId);if(!e)throw new Error(`Table cell renderer for template id ${s.templateId} not found.`);this.renderers.push(e)}}renderTemplate(e){const t=ds(e,fs(".monaco-table-tr")),i=[],n=[];for(let o=0;onew fV(e,t))),a={size:r.reduce(((e,t)=>e+t.column.weight),0),views:r.map((e=>({size:e.column.weight,view:e})))};this.splitview=this.disposables.add(new pV(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:a})),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const l=new mV(n,s,(e=>this.splitview.getViewSize(e)));var h;this.list=this.disposables.add(new yx(e,this.domNode,(h=i,{getHeight:e=>h.getHeight(e),getTemplateId:()=>mV.TemplateId}),[l],o)),B.any(...r.map((e=>e.onDidLayout)))((([e,t])=>l.layoutColumn(e,t)),null,this.disposables),this.splitview.onDidSashReset((e=>{const t=n.reduce(((e,t)=>e+t.weight),0),i=n[e].weight/t*this.cachedWidth;this.splitview.resizeView(e,i)}),null,this.disposables),this.styleElement=Jn(this.domNode),this.style(mx)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\ttop: ${this.virtualDelegate.headerRowHeight+1}px;\n\t\t\theight: calc(100% - ${this.virtualDelegate.headerRowHeight}px);\n\t\t}`),this.styleElement.textContent=t.join("\n"),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}_V.InstanceCount=0;class vV extends _D{constructor(e){super(),this._onChange=this._register(new U),this.onChange=this._onChange.event,this._onKeyDown=this._register(new U),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(...ta.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this.domNode.title=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,(e=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),e.preventDefault())})),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,(e=>{if(10===e.keyCode||3===e.keyCode)return this.checked=!this._checked,this._onChange.fire(!0),e.preventDefault(),void e.stopPropagation();this._onKeyDown.fire(e)}))}get enabled(){return"true"!==this.domNode.getAttribute("aria-disabled")}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()}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))}}const bV=ue(0,"Match Case"),CV=ue(0,"Match Whole Word"),wV=ue(0,"Use Regular Expression");class yV extends vV{constructor(e){super({icon:Jr.caseSensitive,title:bV+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class SV extends vV{constructor(e){super({icon:Jr.wholeWord,title:CV+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class LV extends vV{constructor(e){super({icon:Jr.regex,title:wV+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class kV{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 DV{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 0!==this._currentPosition()?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return null===this._navigator.current()}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new kV(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}}const xV=fs;class NV extends _D{constructor(e,t,i){var n;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new U),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new U),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=null!==(n=this.options.tooltip)&&void 0!==n?n:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=ds(e,xV(".monaco-inputbox.idle"));const s=this.options.flexibleHeight?"textarea":"input",o=ds(this.element,xV(".ibwrapper"));if(this.input=ds(o,xV(s+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,(()=>this.element.classList.add("synthetic-focus"))),this.onblur(this.input,(()=>this.element.classList.remove("synthetic-focus"))),this.options.flexibleHeight){this.maxHeight="number"==typeof this.options.flexibleMaxHeight?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=ds(o,xV("div.mirror")),this.mirror.innerText="\xa0",this.scrollableElement=new RD(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),ds(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll((e=>this.input.scrollTop=e.scrollTop)));const t=this._register(new Ky(document,"selectionchange")),i=B.filter(t.event,(()=>{const e=document.getSelection();return(null==e?void 0:e.anchorNode)===o}));this._register(i(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 Rx(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.input.title=e}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 height(){return"number"==typeof this.cachedHeight?this.cachedHeight:jn(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return document.activeElement===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}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if("number"!=typeof this.cachedContentHeight||"number"!=typeof this.cachedHeight||!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("open"===this.state&&vd(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 ${Ss(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()}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())),null==e?void 0:e.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2: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 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=zn(this.element)+"px";let i;this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:i=>{var n,s;if(!this.message)return null;e=ds(i,xV(".monaco-inputbox-container")),t();const o={inline:!0,className:"monaco-inputbox-message"},r=this.message.formatContent?tk(this.message.content,o):function(e,t={}){const i=ik(t);return i.textContent=e,i}(this.message.content,o);r.classList.add(this.classForType(this.message.type));const a=this.stylesForType(this.message.type);return r.style.backgroundColor=null!==(n=a.background)&&void 0!==n?n:"",r.style.color=null!==(s=a.foreground)&&void 0!==s?s:"",r.style.border=a.border?`1px solid ${a.border}`:"",ds(e,r),null},onHide:()=>{this.state="closed"},layout:t}),i=3===this.message.type?ue(0,"Error: {0}",this.message.content):2===this.message.type?ue(0,"Warning: {0}",this.message.content):ue(0,"Info: {0}",this.message.content),Ps(i),this.state="open"}_hideMessage(){this.contextViewProvider&&("open"===this.state&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),"open"===this.state&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,t=10===e.charCodeAt(e.length-1)?" ":"";(e+t).replace(/\u000c/g,"")?this.mirror.textContent=e+t:this.mirror.innerText="\xa0",this.layout()}applyStyles(){var e,t,i;const n=this.options.inputBoxStyles,s=null!==(e=n.inputBackground)&&void 0!==e?e:"",o=null!==(t=n.inputForeground)&&void 0!==t?t:"",r=null!==(i=n.inputBorder)&&void 0!==i?i:"";this.element.style.backgroundColor=s,this.element.style.color=o,this.input.style.backgroundColor="inherit",this.input.style.color=o,this.element.style.border=`1px solid ${Ss(r,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=jn(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,s=t.value;null!==i&&null!==n&&(this.value=s.substr(0,i)+e+s.substr(n),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,null===(e=this.actionbar)||void 0===e||e.dispose(),super.dispose()}}class EV extends NV{constructor(e,t,i){const n=ue(0,"for history"),s=` or \u21c5 ${n}`,o=` (\u21c5 ${n})`;super(e,t,i),this._onDidFocus=this._register(new U),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new U),this.onDidBlur=this._onDidBlur.event,this.history=new DV(i.history,100);const r=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(s)&&!this.placeholder.endsWith(o)&&this.history.getHistory().length){const e=this.placeholder.endsWith(")")?s:o,t=this.placeholder+e;i.showPlaceholderOnFocus&&document.activeElement!==this.input?this.placeholder=t:this.setPlaceHolder(t)}};this.observer=new MutationObserver(((e,t)=>{e.forEach((e=>{e.target.textContent||r()}))})),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,(()=>r())),this.onblur(this.input,(()=>{const e=e=>{if(this.placeholder.endsWith(e)){const t=this.placeholder.slice(0,this.placeholder.length-e.length);return i.showPlaceholderOnFocus?this.placeholder=t:this.setPlaceHolder(t),!0}return!1};e(o)||e(s)}))}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}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=null!=e?e:"",Fs(this.value?this.value:ue(0,"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,Fs(this.value))}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()}}const IV=ue(0,"input");class MV extends _D{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new I),this.additionalToggles=[],this._onDidOptionChange=this._register(new U),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new U),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new U),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new U),this._onKeyUp=this._register(new U),this._onCaseSensitiveKeyDown=this._register(new U),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new U),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||IV,this.showCommonFindToggles=!!i.showCommonFindToggles;const n=i.appendCaseSensitiveLabel||"",s=i.appendWholeWordsLabel||"",o=i.appendRegexLabel||"",r=i.history||[],a=!!i.flexibleHeight,l=!!i.flexibleWidth,h=i.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new EV(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:r,showHistoryHint:i.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:h,inputBoxStyles:i.inputBoxStyles})),this.showCommonFindToggles){this.regex=this._register(new LV(Object.assign({appendTitle:o,isChecked:!1},i.toggleStyles))),this._register(this.regex.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this._register(this.regex.onKeyDown((e=>{this._onRegexKeyDown.fire(e)}))),this.wholeWords=this._register(new SV(Object.assign({appendTitle:s,isChecked:!1},i.toggleStyles))),this._register(this.wholeWords.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this.caseSensitive=this._register(new yV(Object.assign({appendTitle:n,isChecked:!1},i.toggleStyles))),this._register(this.caseSensitive.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this._register(this.caseSensitive.onKeyDown((e=>{this._onCaseSensitiveKeyDown.fire(e)})));const e=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,(t=>{if(t.equals(15)||t.equals(17)||t.equals(9)){const i=e.indexOf(document.activeElement);if(i>=0){let n=-1;t.equals(17)?n=(i+1)%e.length:t.equals(15)&&(n=0===i?e.length-1:i-1),t.equals(9)?(e[i].blur(),this.inputBox.focus()):n>=0&&e[n].focus(),as(t,!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(null==i?void 0:i.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),null==e||e.appendChild(this.domNode),this._register(En(this.inputBox.inputElement,"compositionstart",(e=>{this.imeSessionInProgress=!0}))),this._register(En(this.inputBox.inputElement,"compositionend",(e=>{this.imeSessionInProgress=!1,this._onInput.fire()}))),this.onkeydown(this.inputBox.inputElement,(e=>this._onKeyDown.fire(e))),this.onkeyup(this.inputBox.inputElement,(e=>this._onKeyUp.fire(e))),this.oninput(this.inputBox.inputElement,(e=>this._onInput.fire())),this.onmousedown(this.inputBox.inputElement,(e=>this._onMouseDown.fire(e)))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){var e,t,i;this.domNode.classList.remove("disabled"),this.inputBox.enable(),null===(e=this.regex)||void 0===e||e.enable(),null===(t=this.wholeWords)||void 0===t||t.enable(),null===(i=this.caseSensitive)||void 0===i||i.enable();for(const n of this.additionalToggles)n.enable()}disable(){var e,t,i;this.domNode.classList.add("disabled"),this.inputBox.disable(),null===(e=this.regex)||void 0===e||e.disable(),null===(t=this.wholeWords)||void 0===t||t.disable(),null===(i=this.caseSensitive)||void 0===i||i.disable();for(const n of this.additionalToggles)n.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 N;for(const t of null!=e?e:[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()}))),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){var t,i,n,s,o,r;this.inputBox.paddingRight=e?0:(null!==(i=null===(t=this.caseSensitive)||void 0===t?void 0:t.width())&&void 0!==i?i:0)+(null!==(s=null===(n=this.wholeWords)||void 0===n?void 0:n.width())&&void 0!==s?s:0)+(null!==(r=null===(o=this.regex)||void 0===o?void 0:o.width())&&void 0!==r?r:0)+this.additionalToggles.reduce(((e,t)=>e+t.width()),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){var e,t;return null!==(t=null===(e=this.caseSensitive)||void 0===e?void 0:e.checked)&&void 0!==t&&t}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e,t;return null!==(t=null===(e=this.wholeWords)||void 0===e?void 0:e.checked)&&void 0!==t&&t}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e,t;return null!==(t=null===(e=this.regex)||void 0===e?void 0:e.checked)&&void 0!==t&&t}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;null===(e=this.caseSensitive)||void 0===e||e.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()}}var TV,RV;!function(e){e[e.Expanded=0]="Expanded",e[e.Collapsed=1]="Collapsed",e[e.PreserveOrExpanded=2]="PreserveOrExpanded",e[e.PreserveOrCollapsed=3]="PreserveOrCollapsed"}(TV||(TV={})),function(e){e[e.Unknown=0]="Unknown",e[e.Twistie=1]="Twistie",e[e.Element=2]="Element",e[e.Filter=3]="Filter"}(RV||(RV={}));class AV extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class OV{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 PV(e){return"object"==typeof e&&"visibility"in e&&"data"in e}function FV(e){switch(e){case!0:return 1;case!1:return 0;default:return e}}function BV(e){return"boolean"==typeof e.collapsible}class WV{constructor(e,t,i,n={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new Z,this._onDidChangeCollapseState=new U,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new U,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new U,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new Jh(qh),this.collapseByDefault=void 0!==n.collapseByDefault&&n.collapseByDefault,this.filter=n.filter,this.autoExpandSingleChildren=void 0!==n.autoExpandSingleChildren&&n.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=v.empty(),n={}){if(0===e.length)throw new AV(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,s,o){var r;void 0===n&&(n=v.empty()),void 0===o&&(o=null!==(r=s.diffDepth)&&void 0!==r?r:0);const{parentNode:a}=this.getParentNodeWithListIndex(t);if(!a.lastDiffIds)return this.spliceSimple(t,i,n,s);const l=[...n],h=t[t.length-1],d=new gI({getElements:()=>a.lastDiffIds},{getElements:()=>[...a.children.slice(0,h),...l,...a.children.slice(h+i)].map((t=>e.getId(t.element).toString()))}).ComputeDiff(!1);if(d.quitEarly)return a.lastDiffIds=void 0,this.spliceSimple(t,i,l,s);const c=t.slice(0,-1),u=(t,i,n)=>{if(o>0)for(let r=0;rt.originalStart-e.originalStart)))u(g,p,g-(m.originalStart+m.originalLength)),g=m.originalStart,p=m.modifiedStart-h,this.spliceSimple([...c,g],m.originalLength,v.slice(l,p,p+m.modifiedLength),s);u(g,p,g)}spliceSimple(e,t,i=v.empty(),{onDidCreateNode:n,onDidDeleteNode:s,diffIdentityProvider:o}){const{parentNode:r,listIndex:a,revealed:l,visible:h}=this.getParentNodeWithListIndex(e),d=[],c=v.map(i,(e=>this.createTreeNode(e,r,r.visible?1:0,l,d,n))),u=e[e.length-1],g=r.children.length>0;let p=0;for(let v=u;v>=0&&vo.getId(e.element).toString()))):r.lastDiffIds=r.children.map((e=>o.getId(e.element).toString())):r.lastDiffIds=void 0;let C=0;for(const v of b)v.visible&&C++;if(0!==C)for(let v=u+m.length;ve+(t.visible?t.renderNodeCount:0)),0);this._updateAncestorsRenderNodeCount(r,_-e),this.list.splice(a,e,d)}if(b.length>0&&s){const e=t=>{s(t),t.children.forEach(e)};b.forEach(e)}this._onDidSplice.fire({insertedNodes:m,deletedNodes:b});const w=r.children.length>0;g!==w&&this.setCollapsible(e.slice(0,-1),w);let y=r;for(;y;){if(2===y.visibility){this.refilterDelayer.trigger((()=>this.refilter()));break}y=y.parent}}rerender(e){if(0===e.length)throw new AV(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:n}=this.getTreeNodeWithListIndex(e);t.visible&&n&&this.list.splice(i,1,[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);void 0===t&&(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);void 0===t&&(t=!n.collapsed);const s={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents((()=>this._setCollapseState(e,s)))}_setCollapseState(e,t){const{node:i,listIndex:n,revealed:s}=this.getTreeNodeWithListIndex(e),o=this._setListNodeCollapseState(i,n,s,t);if(i!==this.root&&this.autoExpandSingleChildren&&o&&!BV(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let n=-1;for(let e=0;e-1){n=-1;break}n=e}}n>-1&&this._setCollapseState([...e,n],t)}return o}_setListNodeCollapseState(e,t,i,n){const s=this._setNodeCollapseState(e,n,!1);if(!i||!e.visible||!s)return s;const o=e.renderNodeCount,r=this.updateNodeAfterCollapseChange(e),a=o-(-1===t?0:1);return this.list.splice(t+1,a,r.slice(1)),s}_setNodeCollapseState(e,t,i){let n;if(e===this.root?n=!1:(BV(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})),!BV(t)&&t.recursive)for(const s of e.children)n=this._setNodeCollapseState(s,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,s,o){const r={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:"boolean"==typeof e.collapsible?e.collapsible:void 0!==e.collapsed,collapsed:void 0===e.collapsed?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},a=this._filterNode(r,i);r.visibility=a,n&&s.push(r);const l=e.children||v.empty(),h=n&&0!==a&&!r.collapsed;let d=0,c=1;for(const u of l){const e=this.createTreeNode(u,r,a,h,s,o);r.children.push(e),c+=e.renderNodeCount,e.visible&&(e.visibleChildIndex=d++)}return r.collapsible=r.collapsible||r.children.length>0,r.visibleChildrenCount=d,r.visible=2===a?d>0:1===a,r.visible?r.collapsed||(r.renderNodeCount=c):(r.renderNodeCount=0,n&&s.pop()),null==o||o(r),r}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(!1===e.visible)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?1:0,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,n=!0){let s;if(e!==this.root){if(s=this._filterNode(e,t),0===s)return e.visible=!1,e.renderNodeCount=0,!1;n&&i.push(e)}const o=i.length;e.renderNodeCount=e===this.root?0:1;let r=!1;if(e.collapsed&&0===s)e.visibleChildrenCount=0;else{let t=0;for(const o of e.children)r=this._updateNodeAfterFilterChange(o,s,i,n&&!e.collapsed)||r,o.visible&&(o.visibleChildIndex=t++);e.visibleChildrenCount=t}return e!==this.root&&(e.visible=2===s?r:1===s,e.visibility=s),e.visible?e.collapsed||(e.renderNodeCount+=i.length-o):(e.renderNodeCount=0,n&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(0!==t)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):1;return"boolean"==typeof i?(e.filterData=void 0,i?1:0):PV(i)?(e.filterData=i.data,FV(i.visibility)):(e.filterData=void 0,FV(i))}hasTreeNode(e,t=this.root){if(!e||0===e.length)return!0;const[i,...n]=e;return!(i<0||i>t.children.length)&&this.hasTreeNode(n,t.children[i])}getTreeNode(e,t=this.root){if(!e||0===e.length)return t;const[i,...n]=e;if(i<0||i>t.children.length)throw new AV(this.user,"Invalid tree location");return this.getTreeNode(n,t.children[i])}getTreeNodeWithListIndex(e){if(0===e.length)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:n,visible:s}=this.getParentNodeWithListIndex(e),o=e[e.length-1];if(o<0||o>t.children.length)throw new AV(this.user,"Invalid tree location");const r=t.children[o];return{node:r,listIndex:i,revealed:n,visible:s&&r.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,n=!0,s=!0){const[o,...r]=e;if(o<0||o>t.children.length)throw new AV(this.user,"Invalid tree location");for(let a=0;ae.element))),this.data=e}}function zV(e){return e instanceof KD?new HV(e):e}class UV{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=E.None,this.disposables=new N}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map((e=>e.element)),t)}onDragStart(e,t){var i,n;null===(n=(i=this.dnd).onDragStart)||void 0===n||n.call(i,zV(e),t)}onDragOver(e,t,i,n,s=!0){const o=this.dnd.onDragOver(zV(e),t&&t.element,i,n),r=this.autoExpandNode!==t;if(r&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),void 0===t)return o;if(r&&"boolean"!=typeof o&&o.autoExpand&&(this.autoExpandDisposable=id((()=>{const e=this.modelProvider(),i=e.getNodeLocation(t);e.isCollapsed(i)&&e.setCollapsed(i,!1),this.autoExpandNode=void 0}),500,this.disposables)),"boolean"==typeof o||!o.accept||void 0===o.bubble||o.feedback){if(!s){return{accept:"boolean"==typeof o?o:o.accept,effect:"boolean"==typeof o?void 0:o.effect,feedback:[i]}}return o}if(1===o.bubble){const i=this.modelProvider(),s=i.getNodeLocation(t),o=i.getParentNodeLocation(s),r=i.getNode(o),a=o&&i.getListIndex(o);return this.onDragOver(e,r,a,n,!1)}const a=this.modelProvider(),l=a.getNodeLocation(t),h=a.getListIndex(l),d=a.getListRenderCount(l);return Object.assign(Object.assign({},o),{feedback:Kd(h,h+d)})}drop(e,t,i,n){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(zV(e),t&&t.element,i,n)}onDragEnd(e){var t,i;null===(i=(t=this.dnd).onDragEnd)||void 0===i||i.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}class KV{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){var i,n;null===(n=(i=this.delegate).setDynamicHeight)||void 0===n||n.call(i,e.element,t)}}!function(e){e.None="none",e.OnHover="onHover",e.Always="always"}(VV||(VV={}));class jV{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new N,this.onDidChange=B.forEach(e,(e=>this._elements=e),this.disposables)}dispose(){this.disposables.dispose()}}class qV{constructor(e,t,i,n,s,o={}){var r;this.renderer=e,this.modelProvider=t,this.activeNodes=n,this.renderedIndentGuides=s,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=qV.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=E.None,this.disposables=new N,this.templateId=e.templateId,this.updateOptions(o),B.map(i,(e=>e.node))(this.onDidChangeNodeTwistieState,this,this.disposables),null===(r=e.onDidChangeTwistieState)||void 0===r||r.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(void 0!==e.indent){const t=uD(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[e,t]of this.renderedNodes)this.renderTreeElement(e,t)}}if(void 0!==e.renderIndentGuides){const t=e.renderIndentGuides!==VV.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[e,t]of this.renderedNodes)this._renderIndentGuides(e,t);if(this.indentGuidesDisposable.dispose(),t){const e=new N;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,e),this.indentGuidesDisposable=e,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}void 0!==e.hideTwistiesOfChildlessElements&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=ds(e,fs(".monaco-tl-row")),i=ds(t,fs(".monaco-tl-indent")),n=ds(t,fs(".monaco-tl-twistie")),s=ds(t,fs(".monaco-tl-contents")),o=this.renderer.renderTemplate(s);return{container:e,indent:i,twistie:n,indentGuidesDisposable:E.None,templateData:o}}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){var s,o;i.indentGuidesDisposable.dispose(),null===(o=(s=this.renderer).disposeElement)||void 0===o||o.call(s,e,t,i.templateData,n),"number"==typeof n&&(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=qV.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(...ta.asClassNameArray(Jr.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(...ta.asClassNameArray(Jr.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(Dn(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new N,n=this.modelProvider();for(;;){const s=n.getNodeLocation(e),o=n.getParentNodeLocation(s);if(!o)break;const r=n.getNode(o),a=fs(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(r)&&a.classList.add("active"),0===t.indent.childElementCount?t.indent.appendChild(a):t.indent.insertBefore(a,t.indent.firstElementChild),this.renderedIndentGuides.add(r,a),i.add(x((()=>this.renderedIndentGuides.delete(r,a)))),e=r}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach((e=>{const n=i.getNodeLocation(e);try{const s=i.getParentNodeLocation(n);e.collapsible&&e.children.length>0&&!e.collapsed?t.add(e):s&&t.add(i.getNode(s))}catch(ge){}})),this.activeIndentNodes.forEach((e=>{t.has(e)||this.renderedIndentGuides.forEach(e,(e=>e.classList.remove("active")))})),t.forEach((e=>{this.activeIndentNodes.has(e)||this.renderedIndentGuides.forEach(e,(e=>e.classList.add("active")))})),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),k(this.disposables)}}qV.DefaultIndent=8;class $V{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}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 N,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let i=1;if(this._filter){const n=this._filter.filter(e,t);if(i="boolean"==typeof n?n?1:0:PV(n)?FV(n.visibility):n,0===i)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:Mr.Default,visibility:i};const n=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),s=Array.isArray(n)?n:[n];for(const o of s){const e=o&&o.toString();if(void 0===e)return{data:Mr.Default,visibility:i};let t;if(this.tree.findMatchType===ZV.Contiguous){const i=e.toLowerCase().indexOf(this._lowercasePattern);if(i>-1){t=[Number.MAX_SAFE_INTEGER,0];for(let e=this._lowercasePattern.length;e>0;e--)t.push(i+e-1)}}else t=Rr(this._pattern,this._lowercasePattern,0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(t)return this._matchCount++,1===s.length?{data:t,visibility:i}:{data:{label:e,score:t},visibility:i}}return this.tree.findMode===GV.Filter?"number"==typeof this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:Mr.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){k(this.disposables)}}var GV,ZV;!function(e){e[e.Highlight=0]="Highlight",e[e.Filter=1]="Filter"}(GV||(GV={})),function(e){e[e.Fuzzy=0]="Fuzzy",e[e.Contiguous=1]="Contiguous"}(ZV||(ZV={}));class YV{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,s,o={}){var r,a;this.tree=e,this.view=i,this.filter=n,this.contextViewProvider=s,this.options=o,this._pattern="",this.width=0,this._onDidChangeMode=new U,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new U,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new U,this._onDidChangeOpenState=new U,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new N,this.disposables=new N,this._mode=null!==(r=e.options.defaultFindMode)&&void 0!==r?r:GV.Highlight,this._matchType=null!==(a=e.options.defaultFindMatchType)&&void 0!==a?a:ZV.Fuzzy,t.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){void 0!==e.defaultFindMode&&(this.mode=e.defaultFindMode),void 0!==e.defaultFindMatchType&&(this.matchType=e.defaultFindMatchType)}onDidSpliceModel(){this.widget&&0!==this.pattern.length&&(this.tree.refilter(),this.render())}render(){var e,t,i,n;const s=this.filter.totalCount>0&&0===this.filter.matchCount;this.pattern&&s?null===(e=this.tree.options.showNotFoundMessage)||void 0===e||e?null===(t=this.widget)||void 0===t||t.showMessage({type:2,content:ue(0,"No elements found.")}):null===(i=this.widget)||void 0===i||i.showMessage({type:2}):null===(n=this.widget)||void 0===n||n.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this._mode===GV.Filter||(this.filter.totalCount>0&&this.filter.matchCount<=1||!Mr.isDefault(e.filterData))}layout(e){var t;this.width=e,null===(t=this.widget)||void 0===t||t.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}}function XV(e){let t=RV.Unknown;return $n(e.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?t=RV.Twistie:$n(e.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?t=RV.Element:$n(e.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(t=RV.Filter),{browserEvent:e.browserEvent,element:e.element?e.element.element:null,target:t}}function QV(e,t){t(e),e.children.forEach((e=>QV(e,t)))}class JV{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 U,this.onDidChange=this._onDidChange.event}set(e,t){!(null==t?void 0:t.__forceEvent)&&Td(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 e=this;this._onDidChange.fire({get elements(){return e.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 e=this.createNodeSet(),i=t=>e.delete(t);return t.forEach((e=>QV(e,i))),void this.set([...e.values()])}const i=new Set,n=e=>i.add(this.identityProvider.getId(e.element).toString());t.forEach((e=>QV(e,n)));const s=new Map,o=e=>s.set(this.identityProvider.getId(e.element).toString(),e);e.forEach((e=>QV(e,o)));const r=[];for(const a of this.nodes){const e=this.identityProvider.getId(a.element).toString();if(i.has(e)){const t=s.get(e);t&&t.visible&&r.push(t)}else r.push(a)}if(this.nodes.length>0&&0===r.length){const e=this.getFirstViewElementWithTrait();e&&r.push(e)}this._set(r,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class eH extends gx{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if(ox(e.browserEvent.target)||nx(e.browserEvent.target)||sx(e.browserEvent.target))return;if(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;let s=!1;if(s="function"==typeof this.tree.expandOnlyOnTwistieClick?this.tree.expandOnlyOnTwistieClick(t.element):!!this.tree.expandOnlyOnTwistieClick,s&&!n&&2!==e.browserEvent.detail)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&2===e.browserEvent.detail)return super.onViewPointer(e);if(t.collapsible){const i=this.tree.getNodeLocation(t),o=e.browserEvent.altKey;if(this.tree.setFocus([i]),this.tree.toggleCollapsed(i,o),s&&n)return void(e.browserEvent.isHandledByList=!0)}super.onViewPointer(e)}onDoubleClick(e){!e.browserEvent.target.classList.contains("monaco-tl-twistie")&&this.tree.expandOnDoubleClick&&(e.browserEvent.isHandledByList||super.onDoubleClick(e))}}class tH extends yx{constructor(e,t,i,n,s,o,r,a){super(e,t,i,n,a),this.focusTrait=s,this.selectionTrait=o,this.anchorTrait=r}createMouseController(e){return new eH(this,e.tree)}splice(e,t,i=[]){if(super.splice(e,t,i),0===i.length)return;const n=[],s=[];let o;i.forEach(((t,i)=>{this.focusTrait.has(t)&&n.push(e+i),this.selectionTrait.has(t)&&s.push(e+i),this.anchorTrait.has(t)&&(o=e+i)})),n.length>0&&super.setFocus(zd([...super.getFocus(),...n])),s.length>0&&super.setSelection(zd([...super.getSelection(),...s])),"number"==typeof o&&super.setAnchor(o)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map((e=>this.element(e))),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map((e=>this.element(e))),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(void 0===e?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class iH{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 onMouseDblClick(){return B.filter(B.map(this.view.onMouseDblClick,XV),(e=>e.target!==RV.Filter))}get onPointer(){return B.map(this.view.onPointer,XV)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return B.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get findMode(){var e,t;return null!==(t=null===(e=this.findController)||void 0===e?void 0:e.mode)&&void 0!==t?t:GV.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){var e,t;return null!==(t=null===(e=this.findController)||void 0===e?void 0:e.matchType)&&void 0!==t?t:ZV.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get expandOnDoubleClick(){return void 0===this._options.expandOnDoubleClick||this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return void 0===this._options.expandOnlyOnTwistieClick||this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,i,n,s={}){var o;this._user=e,this._options=s,this.eventBufferer=new Z,this.onDidChangeFindOpenState=B.None,this.disposables=new N,this._onWillRefilter=new U,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new U;const r=new KV(i),a=new Y,l=new Y,h=this.disposables.add(new jV(l.event)),d=new $s;this.renderers=n.map((e=>new qV(e,(()=>this.model),a.event,h,d,s)));for(const m of this.renderers)this.disposables.add(m);let c;s.keyboardNavigationLabelProvider&&(c=new $V(this,s.keyboardNavigationLabelProvider,s.filter),s=Object.assign(Object.assign({},s),{filter:c}),this.disposables.add(c)),this.focus=new JV((()=>this.view.getFocusedElements()[0]),s.identityProvider),this.selection=new JV((()=>this.view.getSelectedElements()[0]),s.identityProvider),this.anchor=new JV((()=>this.view.getAnchorElement()),s.identityProvider),this.view=new tH(e,t,r,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},function(e,t){return t&&Object.assign(Object.assign({},t),{identityProvider:t.identityProvider&&{getId:e=>t.identityProvider.getId(e.element)},dnd:t.dnd&&new UV(e,t.dnd),multipleSelectionController:t.multipleSelectionController&&{isSelectionSingleChangeEvent:e=>t.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element})),isSelectionRangeChangeEvent:e=>t.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},accessibilityProvider:t.accessibilityProvider&&Object.assign(Object.assign({},t.accessibilityProvider),{getSetSize(t){const i=e(),n=i.getNodeLocation(t),s=i.getParentNodeLocation(n);return i.getNode(s).visibleChildrenCount},getPosInSet:e=>e.visibleChildIndex+1,isChecked:t.accessibilityProvider&&t.accessibilityProvider.isChecked?e=>t.accessibilityProvider.isChecked(e.element):void 0,getRole:t.accessibilityProvider&&t.accessibilityProvider.getRole?e=>t.accessibilityProvider.getRole(e.element):()=>"treeitem",getAriaLabel:e=>t.accessibilityProvider.getAriaLabel(e.element),getWidgetAriaLabel:()=>t.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:t.accessibilityProvider&&t.accessibilityProvider.getWidgetRole?()=>t.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:t.accessibilityProvider&&t.accessibilityProvider.getAriaLevel?e=>t.accessibilityProvider.getAriaLevel(e.element):e=>e.depth,getActiveDescendantId:t.accessibilityProvider.getActiveDescendantId&&(e=>t.accessibilityProvider.getActiveDescendantId(e.element))}),keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},t.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel:e=>t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)})})}((()=>this.model),s)),{tree:this})),this.model=this.createModel(e,this.view,s),a.input=this.model.onDidChangeCollapseState;const u=B.forEach(this.model.onDidSplice,(e=>{this.eventBufferer.bufferEvents((()=>{this.focus.onDidModelSplice(e),this.selection.onDidModelSplice(e)}))}),this.disposables);u((()=>null),null,this.disposables);const g=this.disposables.add(new U),p=this.disposables.add(new Jh(0));if(this.disposables.add(B.any(u,this.focus.onDidChange,this.selection.onDidChange)((()=>{p.trigger((()=>{const e=new Set;for(const t of this.focus.getNodes())e.add(t);for(const t of this.selection.getNodes())e.add(t);g.fire([...e.values()])}))}))),l.input=g.event,!1!==s.keyboardSupport){const e=B.chain(this.view.onKeyDown,(e=>e.filter((e=>!nx(e.target))).map((e=>new St(e)))));B.chain(e,(e=>e.filter((e=>15===e.keyCode))))(this.onLeftArrow,this,this.disposables),B.chain(e,(e=>e.filter((e=>17===e.keyCode))))(this.onRightArrow,this,this.disposables),B.chain(e,(e=>e.filter((e=>10===e.keyCode))))(this.onSpace,this,this.disposables)}if((null===(o=s.findWidgetEnabled)||void 0===o||o)&&s.keyboardNavigationLabelProvider&&s.contextViewProvider){const e=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new YV(this,this.model,this.view,c,s.contextViewProvider,e),this.focusNavigationFilter=e=>this.findController.shouldAllowFocus(e),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=B.None,this.onDidChangeFindMatchType=B.None;this.styleElement=Jn(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===VV.Always)}updateOptions(e={}){var t;this._options=Object.assign(Object.assign({},this._options),e);for(const i of this.renderers)i.updateOptions(e);this.view.updateOptions(this._options),null===(t=this.findController)||void 0===t||t.updateOptions(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===VV.Always)}get options(){return this._options}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}domFocus(){this.view.domFocus()}layout(e,t){var i;this.view.layout(e,t),Vr(t)&&(null===(i=this.findController)||void 0===i||i.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}; }`)),this.styleElement.textContent=i.join("\n"),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)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){const i=e.map((e=>this.model.getNode(e)));this.selection.set(i,t);const n=e.map((e=>this.model.getListIndex(e))).filter((e=>e>-1));this.view.setSelection(n,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const i=e.map((e=>this.model.getNode(e)));this.focus.set(i,t);const n=e.map((e=>this.model.getListIndex(e))).filter((e=>e>-1));this.view.setFocus(n,t,!0)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);-1!==i&&this.view.reveal(i,t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){const e=this.model.getParentNodeLocation(n);if(!e)return;const t=this.model.getListIndex(e);this.view.reveal(t),this.view.setFocus([t])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!1)){if(!i.children.some((e=>e.visible)))return;const[e]=this.view.getFocus(),t=e+1;this.view.reveal(t),this.view.setFocus([t])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i),s=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,s)}dispose(){k(this.disposables),this.view.dispose()}}class nH{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new WV(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare:(e,t)=>i.sorter.compare(e.element,t.element)}),this.identityProvider=i.identityProvider}setChildren(e,t=v.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=v.empty(),i){const n=new Set,s=new Set;this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},i),{onDidCreateNode:e=>{var t;if(null===e.element)return;const o=e;if(n.add(o.element),this.nodes.set(o.element,o),this.identityProvider){const e=this.identityProvider.getId(o.element).toString();s.add(e),this.nodesByIdentity.set(e,o)}null===(t=i.onDidCreateNode)||void 0===t||t.call(i,o)},onDidDeleteNode:e=>{var t;if(null===e.element)return;const o=e;if(n.has(o.element)||this.nodes.delete(o.element),this.identityProvider){const e=this.identityProvider.getId(o.element).toString();s.has(e)||this.nodesByIdentity.delete(e)}null===(t=i.onDidDeleteNode)||void 0===t||t.call(i,o)}}))}preserveCollapseState(e=v.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),v.map(e,(e=>{let t=this.nodes.get(e.element);if(!t&&this.identityProvider){const i=this.identityProvider.getId(e.element).toString();t=this.nodesByIdentity.get(i)}if(!t){let t;return t=void 0===e.collapsed?void 0:e.collapsed===TV.Collapsed||e.collapsed===TV.PreserveOrCollapsed||e.collapsed!==TV.Expanded&&e.collapsed!==TV.PreserveOrExpanded&&Boolean(e.collapsed),Object.assign(Object.assign({},e),{children:this.preserveCollapseState(e.children),collapsed:t})}const i="boolean"==typeof e.collapsible?e.collapsible:t.collapsible;let n;return n=void 0===e.collapsed||e.collapsed===TV.PreserveOrCollapsed||e.collapsed===TV.PreserveOrExpanded?t.collapsed:e.collapsed===TV.Collapsed||e.collapsed!==TV.Expanded&&Boolean(e.collapsed),Object.assign(Object.assign({},e),{collapsible:i,collapsed:n,children:this.preserveCollapseState(e.children)})}))}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(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(null===e)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new AV(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(null===e)throw new AV(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new AV(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(null===e)return[];const t=this.nodes.get(e);if(!t)throw new AV(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function sH(e){return{element:{elements:[e.element],incompressible:e.incompressible||!1},children:v.map(v.from(e.children),sH),collapsible:e.collapsible,collapsed:e.collapsed}}function oH(e){const t=[e.element],i=e.incompressible||!1;let n,s;for(;[s,n]=v.consume(v.from(e.children),2),1===s.length&&!s[0].incompressible;)e=s[0],t.push(e.element);return{element:{elements:t,incompressible:i},children:v.map(v.concat(s,n),oH),collapsible:e.collapsible,collapsed:e.collapsed}}function rH(e,t=0){let i;return i=trH(e,0))),0===t&&e.element.incompressible?{element:e.element.elements[t],children:i,incompressible:!0,collapsible:e.collapsible,collapsed:e.collapsed}:{element:e.element.elements[t],children:i,collapsible:e.collapsible,collapsed:e.collapsed}}function aH(e){return rH(e,0)}function lH(e,t,i){return e.element===t?Object.assign(Object.assign({},e),{children:i}):Object.assign(Object.assign({},e),{children:v.map(v.from(e.children),(e=>lH(e,t,i)))})}class hH{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new nH(e,t,i),this.enabled=void 0===i.compressionEnabled||i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=v.empty(),i){const n=i.diffIdentityProvider&&(s=i.diffIdentityProvider,{getId:e=>e.elements.map((e=>s.getId(e).toString())).join("\0")});var s;if(null===e){const e=v.map(t,this.enabled?oH:sH);return void this._setChildren(null,e,{diffIdentityProvider:n,diffDepth:1/0})}const o=this.nodes.get(e);if(!o)throw new AV(this.user,"Unknown compressed tree node");const r=this.model.getNode(o),a=this.model.getParentNodeLocation(o),l=this.model.getNode(a),h=lH(aH(r),e,t),d=(this.enabled?oH:sH)(h),c=i.diffIdentityProvider?(e,t)=>i.diffIdentityProvider.getId(e)===i.diffIdentityProvider.getId(t):void 0;if(Td(d.element.elements,r.element.elements,c))return void this._setChildren(o,d.children||v.empty(),{diffIdentityProvider:n,diffDepth:1});const u=l.children.map((e=>e===r?d:e));this._setChildren(l.element,u,{diffIdentityProvider:n,diffDepth:r.depth-l.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const t=this.model.getNode().children,i=v.map(t,aH),n=v.map(i,e?oH:sH);this._setChildren(null,n,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const n=new Set;this.model.setChildren(e,t,Object.assign(Object.assign({},i),{onDidCreateNode:e=>{for(const t of e.element.elements)n.add(t),this.nodes.set(t,e.element)},onDidDeleteNode:e=>{for(const t of e.element.elements)n.has(t)||this.nodes.delete(t)}}))}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(void 0===e)return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return null===t?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return null===i?null:i.elements[i.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(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)}refilter(){this.model.refilter()}getCompressedNode(e){if(null===e)return null;const t=this.nodes.get(e);if(!t)throw new AV(this.user,`Tree element not found: ${e}`);return t}}const dH=e=>e[e.length-1];class cH{get element(){return null===this.node.element?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map((e=>new cH(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}}class uH{get onDidSplice(){return B.map(this.model.onDidSplice,(({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map((e=>this.nodeMapper.map(e))),deletedNodes:t.map((e=>this.nodeMapper.map(e)))})))}get onDidChangeCollapseState(){return B.map(this.model.onDidChangeCollapseState,(({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t})))}get onDidChangeRenderNodeCount(){return B.map(this.model.onDidChangeRenderNodeCount,(e=>this.nodeMapper.map(e)))}constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||dH;const n=e=>this.elementMapper(e.elements);this.nodeMapper=new OV((e=>new cH(n,e))),this.model=new hH(e,function(e,t){return{splice(i,n,s){t.splice(i,n,s.map((t=>e.map(t))))},updateElementHeight(e,i){t.updateElementHeight(e,i)}}}(this.nodeMapper,t),function(e,t){return Object.assign(Object.assign({},t),{identityProvider:t.identityProvider&&{getId:i=>t.identityProvider.getId(e(i))},sorter:t.sorter&&{compare:(e,i)=>t.sorter.compare(e.elements[0],i.elements[0])},filter:t.filter&&{filter:(i,n)=>t.filter.filter(e(i),n)}})}(n,i))}setChildren(e,t=v.empty(),i={}){this.model.setChildren(e,t,i)}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 null==t?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)}refilter(){return this.model.refilter()}getCompressedTreeNode(e=null){return this.model.getNode(e)}}var gH=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};class pH extends iH{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,n,s={}){super(e,t,i,n,s),this.user=e}setChildren(e,t=v.empty(),i){this.model.setChildren(e,t,i)}rerender(e){void 0!==e?this.model.rerender(e):this.view.rerender()}hasElement(e){return this.model.has(e)}createModel(e,t,i){return new nH(e,t,i)}}class mH{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t){this._compressedTreeNodeProvider=e,this.renderer=t,this.templateId=t.templateId,t.onDidChangeTwistieState&&(this.onDidChangeTwistieState=t.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){const s=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element);1===s.element.elements.length?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,n)):(i.compressedTreeNode=s,this.renderer.renderCompressedElements(s,t,i.data,n))}disposeElement(e,t,i,n){var s,o,r,a;i.compressedTreeNode?null===(o=(s=this.renderer).disposeCompressedElements)||void 0===o||o.call(s,i.compressedTreeNode,t,i.data,n):null===(a=(r=this.renderer).disposeElement)||void 0===a||a.call(r,e,t,i.data,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return!!this.renderer.renderTwistie&&this.renderer.renderTwistie(e,t)}}gH([qL],mH.prototype,"compressedTreeNodeProvider",null);class fH extends pH{constructor(e,t,i,n,s={}){const o=()=>this;super(e,t,i,n.map((e=>new mH(o,e))),function(e,t){return t&&Object.assign(Object.assign({},t),{keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(i){let n;try{n=e().getCompressedTreeNode(i)}catch(ge){return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i)}return 1===n.element.elements.length?t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i):t.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(n.element.elements)}}})}(o,s))}setChildren(e,t=v.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new uH(e,t,i)}updateOptions(e={}){super.updateOptions(e),void 0!==e.compressionEnabled&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}var _H=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function vH(e){return Object.assign(Object.assign({},e),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function bH(e,t){return!!t.parent&&(t.parent===e||bH(e,t.parent))}class CH{get element(){return this.node.element.element}get children(){return this.node.children.map((e=>new CH(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 wH{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(...ta.asClassNameArray(Jr.treeItemLoading)),!0):(t.classList.remove(...ta.asClassNameArray(Jr.treeItemLoading)),!1)}disposeElement(e,t,i,n){var s,o;null===(o=(s=this.renderer).disposeElement)||void 0===o||o.call(s,this.nodeMapper.map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function yH(e){return{browserEvent:e.browserEvent,elements:e.elements.map((e=>e.element))}}function SH(e){return{browserEvent:e.browserEvent,element:e.element&&e.element.element,target:e.target}}class LH extends KD{constructor(e){super(e.elements.map((e=>e.element))),this.data=e}}function kH(e){return e instanceof KD?new LH(e):e}class DH{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((e=>e.element)),t)}onDragStart(e,t){var i,n;null===(n=(i=this.dnd).onDragStart)||void 0===n||n.call(i,kH(e),t)}onDragOver(e,t,i,n,s=!0){return this.dnd.onDragOver(kH(e),t&&t.element,i,n)}drop(e,t,i,n){this.dnd.drop(kH(e),t&&t.element,i,n)}onDragEnd(e){var t,i;null===(i=(t=this.dnd).onDragEnd)||void 0===i||i.call(t,e)}dispose(){this.dnd.dispose()}}function xH(e){return e&&Object.assign(Object.assign({},e),{collapseByDefault:!0,identityProvider:e.identityProvider&&{getId:t=>e.identityProvider.getId(t.element)},dnd:e.dnd&&new DH(e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent:t=>e.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},t),{element:t.element})),isSelectionRangeChangeEvent:t=>e.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))},accessibilityProvider:e.accessibilityProvider&&Object.assign(Object.assign({},e.accessibilityProvider),{getPosInSet:void 0,getSetSize:void 0,getRole:e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",isChecked:e.accessibilityProvider.isChecked?t=>{var i;return!!(null===(i=e.accessibilityProvider)||void 0===i?void 0:i.isChecked(t.element))}:void 0,getAriaLabel:t=>e.accessibilityProvider.getAriaLabel(t.element),getWidgetAriaLabel:()=>e.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider.getAriaLevel&&(t=>e.accessibilityProvider.getAriaLevel(t.element)),getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))}),filter:e.filter&&{filter:(t,i)=>e.filter.filter(t.element,i)},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}),sorter:void 0,expandOnlyOnTwistieClick:void 0===e.expandOnlyOnTwistieClick?void 0:"function"!=typeof e.expandOnlyOnTwistieClick?e.expandOnlyOnTwistieClick:t=>e.expandOnlyOnTwistieClick(t.element),defaultFindVisibility:t=>t.hasChildren&&t.stale?1:"number"==typeof e.defaultFindVisibility?e.defaultFindVisibility:void 0===e.defaultFindVisibility?2:e.defaultFindVisibility(t.element)})}function NH(e,t){t(e),e.children.forEach((e=>NH(e,t)))}class EH{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return B.map(this.tree.onDidChangeFocus,yH)}get onDidChangeSelection(){return B.map(this.tree.onDidChangeSelection,yH)}get onMouseDblClick(){return B.map(this.tree.onMouseDblClick,SH)}get onPointer(){return B.map(this.tree.onPointer,SH)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeFindOpenState(){return this.tree.onDidChangeFindOpenState}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,n,s,o={}){this.user=e,this.dataSource=s,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new U,this._onDidChangeNodeSlowState=new U,this.nodeMapper=new OV((e=>new CH(e))),this.disposables=new N,this.identityProvider=o.identityProvider,this.autoExpandSingleChildren=void 0!==o.autoExpandSingleChildren&&o.autoExpandSingleChildren,this.sorter=o.sorter,this.collapseByDefault=o.collapseByDefault,this.tree=this.createTree(e,t,i,n,o),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.root=vH({element:void 0,parent:null,hasChildren:!0}),this.identityProvider&&(this.root=Object.assign(Object.assign({},this.root),{id:null})),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}createTree(e,t,i,n,s){const o=new KV(i),r=n.map((e=>new wH(e,this.nodeMapper,this._onDidChangeNodeSlowState.event))),a=xH(s)||{};return new pH(e,t,o,r,a)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}setInput(e,t){return _H(this,void 0,void 0,(function*(){this.refreshPromises.forEach((e=>e.cancel())),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};yield this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&"number"==typeof t.scrollTop&&(this.scrollTop=t.scrollTop)}))}_updateChildren(e=this.root.element,t=!0,i=!1,n,s){return _H(this,void 0,void 0,(function*(){if(void 0===this.root.element)throw new AV(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield B.toPromise(this._onDidRender.event));const o=this.getDataNode(e);if(yield this.refreshAndRenderNode(o,t,n,s),i)try{this.tree.rerender(o)}catch(ge){}}))}rerender(e){if(void 0===e||e===this.root.element)return void this.tree.rerender();const t=this.getDataNode(e);this.tree.rerender(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)}expand(e,t=!1){return _H(this,void 0,void 0,(function*(){if(void 0===this.root.element)throw new AV(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield B.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i))return!1;if(i.refreshPromise&&(yield this.root.refreshPromise,yield B.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&&(yield this.root.refreshPromise,yield B.toPromise(this._onDidRender.event)),n}))}setSelection(e,t){const i=e.map((e=>this.getDataNode(e)));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map((e=>e.element))}setFocus(e,t){const i=e.map((e=>this.getDataNode(e)));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map((e=>e.element))}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}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 AV(this.user,`Data tree node not found: ${e}`);return t}refreshAndRenderNode(e,t,i,n){return _H(this,void 0,void 0,(function*(){yield this.refreshNode(e,t,i),this.render(e,i,n)}))}refreshNode(e,t,i){return _H(this,void 0,void 0,(function*(){let n;if(this.subTreeRefreshPromises.forEach(((s,o)=>{!n&&function(e,t){return e===t||bH(e,t)||bH(t,e)}(o,e)&&(n=s.then((()=>this.refreshNode(e,t,i))))})),n)return n;if(e!==this.root){if(this.tree.getNode(e).collapsed)return e.hasChildren=!!this.dataSource.hasChildren(e.element),void(e.stale=!0)}return this.doRefreshSubTree(e,t,i)}))}doRefreshSubTree(e,t,i){return _H(this,void 0,void 0,(function*(){let n;e.refreshPromise=new Promise((e=>n=e)),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally((()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)}));try{const n=yield this.doRefreshNode(e,t,i);e.stale=!1,yield dd.settled(n.map((e=>this.doRefreshSubTree(e,t,i))))}finally{n()}}))}doRefreshNode(e,t,i){return _H(this,void 0,void 0,(function*(){let n;if(e.hasChildren=!!this.dataSource.hasChildren(e.element),e.hasChildren){const t=this.doGetChildren(e);if(Hr(t))n=Promise.resolve(t);else{const i=td(800);i.then((()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)}),(e=>null)),n=t.finally((()=>i.cancel()))}}else n=Promise.resolve(v.empty());try{const s=yield n;return this.setChildren(e,s,t,i)}catch(s){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),d(s))return[];throw s}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 Hr(i)?this.processChildren(i):(t=Yh((()=>_H(this,void 0,void 0,(function*(){return this.processChildren(yield i)})))),this.refreshPromises.set(e,t),t.finally((()=>{this.refreshPromises.delete(e)})))}_onDidChangeCollapseState({node:e,deep:t}){null!==e.element&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(r))}setChildren(e,t,i,n){const s=[...t];if(0===e.children.length&&0===s.length)return[];const o=new Map,r=new Map;for(const h of e.children)if(o.set(h.element,h),this.identityProvider){const e=this.tree.isCollapsed(h);r.set(h.id,{node:h,collapsed:e})}const a=[],l=s.map((t=>{const s=!!this.dataSource.hasChildren(t);if(!this.identityProvider){const i=vH({element:t,parent:e,hasChildren:s});return s&&this.collapseByDefault&&!this.collapseByDefault(t)&&(i.collapsedByDefault=!1,a.push(i)),i}const l=this.identityProvider.getId(t).toString(),h=r.get(l);if(h){const e=h.node;return o.delete(e.element),this.nodes.delete(e.element),this.nodes.set(t,e),e.element=t,e.hasChildren=s,i?h.collapsed?(e.children.forEach((e=>NH(e,(e=>this.nodes.delete(e.element))))),e.children.splice(0,e.children.length),e.stale=!0):a.push(e):s&&this.collapseByDefault&&!this.collapseByDefault(t)&&(e.collapsedByDefault=!1,a.push(e)),e}const d=vH({element:t,parent:e,id:l,hasChildren:s});return n&&n.viewState.focus&&n.viewState.focus.indexOf(l)>-1&&n.focus.push(d),n&&n.viewState.selection&&n.viewState.selection.indexOf(l)>-1&&n.selection.push(d),n&&n.viewState.expanded&&n.viewState.expanded.indexOf(l)>-1?a.push(d):s&&this.collapseByDefault&&!this.collapseByDefault(t)&&(d.collapsedByDefault=!1,a.push(d)),d}));for(const h of o.values())NH(h,(e=>this.nodes.delete(e.element)));for(const h of l)this.nodes.set(h.element,h);return e.children.splice(0,e.children.length,...l),e!==this.root&&this.autoExpandSingleChildren&&1===l.length&&0===a.length&&(l[0].collapsedByDefault=!1,a.push(l[0])),a}render(e,t,i){const n=e.children.map((e=>this.asTreeElement(e,t))),s=i&&Object.assign(Object.assign({},i),{diffIdentityProvider:i.diffIdentityProvider&&{getId:e=>i.diffIdentityProvider.getId(e.element)}});this.tree.setChildren(e===this.root?null:e,n,s),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 i=!(t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1)&&e.collapsedByDefault,e.collapsedByDefault=void 0,{element:e,children:e.hasChildren?v.map(e.children,(e=>this.asTreeElement(e,t))):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class IH{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 IH(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 MH{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(...ta.asClassNameArray(Jr.treeItemLoading)),!0):(t.classList.remove(...ta.asClassNameArray(Jr.treeItemLoading)),!1)}disposeElement(e,t,i,n){var s,o;null===(o=(s=this.renderer).disposeElement)||void 0===o||o.call(s,this.nodeMapper.map(e),t,i.templateData,n)}disposeCompressedElements(e,t,i,n){var s,o;null===(o=(s=this.renderer).disposeCompressedElements)||void 0===o||o.call(s,this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=k(this.disposables)}}class TH extends EH{constructor(e,t,i,n,s,o,r={}){super(e,t,i,s,o,r),this.compressionDelegate=n,this.compressibleNodeMapper=new OV((e=>new IH(e))),this.filter=r.filter}createTree(e,t,i,n,s){const o=new KV(i),r=n.map((e=>new MH(e,this.nodeMapper,(()=>this.compressibleNodeMapper),this._onDidChangeNodeSlowState.event))),a=function(e){const t=e&&xH(e);return t&&Object.assign(Object.assign({},t),{keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},t.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map((e=>e.element)))})})}(s)||{};return new fH(e,t,o,r,a)}asTreeElement(e,t){return Object.assign({incompressible:this.compressionDelegate.isIncompressible(e.element)},super.asTreeElement(e,t))}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t){if(!this.identityProvider)return super.render(e,t);const i=e=>this.identityProvider.getId(e).toString(),n=e=>{const t=new Set;for(const n of e){const e=this.tree.getCompressedTreeNode(n===this.root?null:n);if(e.element)for(const n of e.element.elements)t.add(i(n.element))}return t},s=n(this.tree.getSelection()),o=n(this.tree.getFocus());super.render(e,t);const r=this.getSelection();let a=!1;const l=this.getFocus();let h=!1;const d=e=>{const t=e.element;if(t)for(let n=0;n{const t=this.filter.filter(e,1),i="boolean"==typeof(n=t)?n?1:0:PV(n)?FV(n.visibility):FV(n);var n;if(2===i)throw new Error("Recursive tree visibility not supported in async data compressed trees");return 1===i}))),super.processChildren(e)}}class RH extends iH{constructor(e,t,i,n,s,o={}){super(e,t,i,n,o),this.user=e,this.dataSource=s,this.identityProvider=o.identityProvider}createModel(e,t,i){return new nH(e,t,i)}}new Al("isMac",Pe,ue(0,"Whether the operating system is macOS")),new Al("isLinux",Fe,ue(0,"Whether the operating system is Linux"));const AH=new Al("isWindows",Oe,ue(0,"Whether the operating system is Windows")),OH=new Al("isWeb",We,ue(0,"Whether the platform is a web browser")),PH=(new Al("isMacNative",Pe&&!We,ue(0,"Whether the operating system is macOS on a non-browser platform")),new Al("isIOS",He,ue(0,"Whether the operating system is iOS")),new Al("isMobile",ze,ue(0,"Whether the platform is a mobile web browser")),new Al("isDevelopment",!1,!0),new Al("productQualityType","",ue(0,"Quality type of VS Code")),"inputFocus");new Al(PH,!1,ue(0,"Whether keyboard focus is inside an input box"));var FH=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},BH=function(e,t){return function(i,n){t(i,n,e)}};const WH=Ba("listService");const VH=new Al("listScrollAtBoundary","none"),HH=(pl.or(VH.isEqualTo("top"),VH.isEqualTo("both")),pl.or(VH.isEqualTo("bottom"),VH.isEqualTo("both")),new Al("listFocus",!0)),zH=new Al("listSupportsMultiselect",!0),UH=pl.and(HH,pl.not(PH)),KH=new Al("listHasSelectionOrFocus",!1),jH=new Al("listDoubleSelection",!1),qH=new Al("listMultiSelection",!1),$H=new Al("listSelectionNavigation",!1),GH=new Al("listSupportsFind",!0),ZH=new Al("treeElementCanCollapse",!1),YH=new Al("treeElementHasParent",!1),XH=new Al("treeElementCanExpand",!1),QH=new Al("treeElementHasChild",!1),JH=new Al("treeFindOpen",!1),ez="listTypeNavigationMode",tz="listAutomaticKeyboardNavigation";function iz(e,t){const i=e.createScoped(t.getHTMLElement());return HH.bindTo(i),i}function nz(e,t){const i=VH.bindTo(e),n=()=>{const e=0===t.scrollTop,n=t.scrollHeight-t.renderHeight-t.scrollTop<1;e&&n?i.set("both"):e?i.set("top"):n?i.set("bottom"):i.set("none")};return n(),t.onDidScroll(n)}const sz="workbench.list.multiSelectModifier",oz="workbench.list.openMode",rz="workbench.list.horizontalScrolling",az="workbench.list.defaultFindMode",lz="workbench.list.typeNavigationMode",hz="workbench.list.keyboardNavigation",dz="workbench.list.scrollByPage",cz="workbench.list.defaultFindMatchType",uz="workbench.tree.indent",gz="workbench.tree.renderIndentGuides",pz="workbench.list.smoothScrolling",mz="workbench.list.mouseWheelScrollSensitivity",fz="workbench.list.fastScrollSensitivity",_z="workbench.tree.expandMode";function vz(e){return"alt"===e.getValue(sz)}class bz extends E{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=vz(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration(sz)&&(this.useAltAsMultipleSelectionModifier=vz(this.configurationService))})))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:dx(e)}isSelectionRangeChangeEvent(e){return cx(e)}}function Cz(e,t){var i;const n=e.get(pu),s=e.get(WL),o=new N;return[Object.assign(Object.assign({},t),{keyboardNavigationDelegate:{mightProducePrintableCharacter:e=>s.mightProducePrintableCharacter(e)},smoothScrolling:Boolean(n.getValue(pz)),mouseWheelScrollSensitivity:n.getValue(mz),fastScrollSensitivity:n.getValue(fz),multipleSelectionController:null!==(i=t.multipleSelectionController)&&void 0!==i?i:o.add(new bz(n)),keyboardNavigationEventFilter:Nz(s),scrollByPage:Boolean(n.getValue(dz))}),o]}let wz=class extends yx{constructor(e,t,i,n,s,o,r,a,l){const h=void 0!==s.horizontalScrolling?s.horizontalScrolling:Boolean(a.getValue(rz)),[d,c]=l.invokeFunction(Cz,s);super(e,t,i,n,Object.assign(Object.assign({keyboardSupport:!1},d),{horizontalScrolling:h})),this.disposables.add(c),this.contextKeyService=iz(o,this),this.disposables.add(nz(this.contextKeyService,this)),this.listSupportsMultiSelect=zH.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==s.multipleSelectionSupport);$H.bindTo(this.contextKeyService).set(Boolean(s.selectionNavigation)),this.listHasSelectionOrFocus=KH.bindTo(this.contextKeyService),this.listDoubleSelection=jH.bindTo(this.contextKeyService),this.listMultiSelection=qH.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=vz(a),this.disposables.add(this.contextKeyService),this.disposables.add(r.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(this.onDidChangeSelection((()=>{const e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(2===e.length)}))}))),this.disposables.add(this.onDidChangeFocus((()=>{const e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)}))),this.disposables.add(a.onDidChangeConfiguration((e=>{e.affectsConfiguration(sz)&&(this._useAltAsMultipleSelectionModifier=vz(a));let t={};if(e.affectsConfiguration(rz)&&void 0===this.horizontalScrolling){const e=Boolean(a.getValue(rz));t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(dz)){const e=Boolean(a.getValue(dz));t=Object.assign(Object.assign({},t),{scrollByPage:e})}if(e.affectsConfiguration(pz)){const e=Boolean(a.getValue(pz));t=Object.assign(Object.assign({},t),{smoothScrolling:e})}if(e.affectsConfiguration(mz)){const e=a.getValue(mz);t=Object.assign(Object.assign({},t),{mouseWheelScrollSensitivity:e})}if(e.affectsConfiguration(fz)){const e=a.getValue(fz);t=Object.assign(Object.assign({},t),{fastScrollSensitivity:e})}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new kz(this,Object.assign({configurationService:a},s)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?Jx(e):Qx)}};wz=FH([BH(5,Ol),BH(6,WH),BH(7,pu),BH(8,Fa)],wz);let yz=class extends aV{constructor(e,t,i,n,s,o,r,a,l){const h=void 0!==s.horizontalScrolling?s.horizontalScrolling:Boolean(a.getValue(rz)),[d,c]=l.invokeFunction(Cz,s);super(e,t,i,n,Object.assign(Object.assign({keyboardSupport:!1},d),{horizontalScrolling:h})),this.disposables=new N,this.disposables.add(c),this.contextKeyService=iz(o,this),this.disposables.add(nz(this.contextKeyService,this.widget)),this.horizontalScrolling=s.horizontalScrolling,this.listSupportsMultiSelect=zH.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==s.multipleSelectionSupport);$H.bindTo(this.contextKeyService).set(Boolean(s.selectionNavigation)),this._useAltAsMultipleSelectionModifier=vz(a),this.disposables.add(this.contextKeyService),this.disposables.add(r.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(a.onDidChangeConfiguration((e=>{e.affectsConfiguration(sz)&&(this._useAltAsMultipleSelectionModifier=vz(a));let t={};if(e.affectsConfiguration(rz)&&void 0===this.horizontalScrolling){const e=Boolean(a.getValue(rz));t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(dz)){const e=Boolean(a.getValue(dz));t=Object.assign(Object.assign({},t),{scrollByPage:e})}if(e.affectsConfiguration(pz)){const e=Boolean(a.getValue(pz));t=Object.assign(Object.assign({},t),{smoothScrolling:e})}if(e.affectsConfiguration(mz)){const e=a.getValue(mz);t=Object.assign(Object.assign({},t),{mouseWheelScrollSensitivity:e})}if(e.affectsConfiguration(fz)){const e=a.getValue(fz);t=Object.assign(Object.assign({},t),{fastScrollSensitivity:e})}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new kz(this,Object.assign({configurationService:a},s)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?Jx(e):Qx)}dispose(){this.disposables.dispose(),super.dispose()}};yz=FH([BH(5,Ol),BH(6,WH),BH(7,pu),BH(8,Fa)],yz);let Sz=class extends _V{constructor(e,t,i,n,s,o,r,a,l,h){const d=void 0!==o.horizontalScrolling?o.horizontalScrolling:Boolean(l.getValue(rz)),[c,u]=h.invokeFunction(Cz,o);super(e,t,i,n,s,Object.assign(Object.assign({keyboardSupport:!1},c),{horizontalScrolling:d})),this.disposables.add(u),this.contextKeyService=iz(r,this),this.disposables.add(nz(this.contextKeyService,this)),this.listSupportsMultiSelect=zH.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==o.multipleSelectionSupport);$H.bindTo(this.contextKeyService).set(Boolean(o.selectionNavigation)),this.listHasSelectionOrFocus=KH.bindTo(this.contextKeyService),this.listDoubleSelection=jH.bindTo(this.contextKeyService),this.listMultiSelection=qH.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=vz(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection((()=>{const e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(2===e.length)}))}))),this.disposables.add(this.onDidChangeFocus((()=>{const e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)}))),this.disposables.add(l.onDidChangeConfiguration((e=>{e.affectsConfiguration(sz)&&(this._useAltAsMultipleSelectionModifier=vz(l));let t={};if(e.affectsConfiguration(rz)&&void 0===this.horizontalScrolling){const e=Boolean(l.getValue(rz));t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(dz)){const e=Boolean(l.getValue(dz));t=Object.assign(Object.assign({},t),{scrollByPage:e})}if(e.affectsConfiguration(pz)){const e=Boolean(l.getValue(pz));t=Object.assign(Object.assign({},t),{smoothScrolling:e})}if(e.affectsConfiguration(mz)){const e=l.getValue(mz);t=Object.assign(Object.assign({},t),{mouseWheelScrollSensitivity:e})}if(e.affectsConfiguration(fz)){const e=l.getValue(fz);t=Object.assign(Object.assign({},t),{fastScrollSensitivity:e})}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new Dz(this,Object.assign({configurationService:l},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?Jx(e):Qx)}dispose(){this.disposables.dispose(),super.dispose()}};Sz=FH([BH(6,Ol),BH(7,WH),BH(8,pu),BH(9,Fa)],Sz);class Lz extends E{constructor(e,t){var i;super(),this.widget=e,this._onDidOpen=this._register(new U),this.onDidOpen=this._onDidOpen.event,this._register(B.filter(this.widget.onDidChangeSelection,(e=>e.browserEvent instanceof KeyboardEvent))((e=>this.onSelectionFromKeyboard(e)))),this._register(this.widget.onPointer((e=>this.onPointer(e.element,e.browserEvent)))),this._register(this.widget.onMouseDblClick((e=>this.onMouseDblClick(e.element,e.browserEvent)))),"boolean"!=typeof(null==t?void 0:t.openOnSingleClick)&&(null==t?void 0:t.configurationService)?(this.openOnSingleClick="doubleClick"!==(null==t?void 0:t.configurationService.getValue(oz)),this._register(null==t?void 0:t.configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration(oz)&&(this.openOnSingleClick="doubleClick"!==(null==t?void 0:t.configurationService.getValue(oz)))})))):this.openOnSingleClick=null===(i=null==t?void 0:t.openOnSingleClick)||void 0===i||i}onSelectionFromKeyboard(e){if(1!==e.elements.length)return;const t=e.browserEvent,i="boolean"!=typeof t.preserveFocus||t.preserveFocus,n="boolean"==typeof t.pinned?t.pinned:!i;this._open(this.getSelectedElement(),i,n,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick)return;if(2===t.detail)return;const i=1===t.button,n=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!0,i,n,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 n=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!1,!0,n,t)}_open(e,t,i,n,s){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:n,element:e,browserEvent:s})}}class kz extends Lz{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class Dz extends Lz{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class xz extends Lz{constructor(e,t){super(e,t)}getSelectedElement(){var e;return null!==(e=this.widget.getSelection()[0])&&void 0!==e?e:void 0}}function Nz(e){let t=!1;return i=>{if(i.toKeyCodeChord().isModifierKey())return!1;if(t)return t=!1,!1;const n=e.softDispatch(i,i.target);return 1===n.kind?(t=!0,!1):(t=!1,0===n.kind)}}let Ez=class extends pH{constructor(e,t,i,n,s,o,r,a,l){const{options:h,getTypeNavigationMode:d,disposable:c}=o.invokeFunction(Pz,s);super(e,t,i,n,h),this.disposables.add(c),this.internals=new Fz(this,s,d,s.overrideStyles,r,a,l),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};Ez=FH([BH(5,Fa),BH(6,Ol),BH(7,WH),BH(8,pu)],Ez);let Iz=class extends fH{constructor(e,t,i,n,s,o,r,a,l){const{options:h,getTypeNavigationMode:d,disposable:c}=o.invokeFunction(Pz,s);super(e,t,i,n,h),this.disposables.add(c),this.internals=new Fz(this,s,d,s.overrideStyles,r,a,l),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};Iz=FH([BH(5,Fa),BH(6,Ol),BH(7,WH),BH(8,pu)],Iz);let Mz=class extends RH{constructor(e,t,i,n,s,o,r,a,l,h){const{options:d,getTypeNavigationMode:c,disposable:u}=r.invokeFunction(Pz,o);super(e,t,i,n,s,d),this.disposables.add(u),this.internals=new Fz(this,o,c,o.overrideStyles,a,l,h),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),void 0!==e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};Mz=FH([BH(6,Fa),BH(7,Ol),BH(8,WH),BH(9,pu)],Mz);let Tz=class extends EH{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,s,o,r,a,l,h){const{options:d,getTypeNavigationMode:c,disposable:u}=r.invokeFunction(Pz,o);super(e,t,i,n,s,d),this.disposables.add(u),this.internals=new Fz(this,o,c,o.overrideStyles,a,l,h),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};Tz=FH([BH(6,Fa),BH(7,Ol),BH(8,WH),BH(9,pu)],Tz);let Rz=class extends TH{constructor(e,t,i,n,s,o,r,a,l,h,d){const{options:c,getTypeNavigationMode:u,disposable:g}=a.invokeFunction(Pz,r);super(e,t,i,n,s,o,c),this.disposables.add(g),this.internals=new Fz(this,r,u,r.overrideStyles,l,h,d),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};function Az(e){const t=e.getValue(az);if("highlight"===t)return GV.Highlight;if("filter"===t)return GV.Filter;const i=e.getValue(hz);return"simple"===i||"highlight"===i?GV.Highlight:"filter"===i?GV.Filter:void 0}function Oz(e){const t=e.getValue(cz);return"fuzzy"===t?ZV.Fuzzy:"contiguous"===t?ZV.Contiguous:void 0}function Pz(e,t){var i;const n=e.get(pu),s=e.get(Ux),o=e.get(Ol),r=e.get(Fa),a=void 0!==t.horizontalScrolling?t.horizontalScrolling:Boolean(n.getValue(rz)),[l,h]=r.invokeFunction(Cz,t),d=t.paddingBottom,c=void 0!==t.renderIndentGuides?t.renderIndentGuides:n.getValue(gz);return{getTypeNavigationMode:()=>{const e=o.getContextKeyValue(ez);if("automatic"===e)return ZD.Automatic;if("trigger"===e)return ZD.Trigger;if(!1===o.getContextKeyValue(tz))return ZD.Trigger;const t=n.getValue(lz);return"automatic"===t?ZD.Automatic:"trigger"===t?ZD.Trigger:void 0},disposable:h,options:Object.assign(Object.assign({keyboardSupport:!1},l),{indent:"number"==typeof n.getValue(uz)?n.getValue(uz):void 0,renderIndentGuides:c,smoothScrolling:Boolean(n.getValue(pz)),defaultFindMode:Az(n),defaultFindMatchType:Oz(n),horizontalScrolling:a,scrollByPage:Boolean(n.getValue(dz)),paddingBottom:d,hideTwistiesOfChildlessElements:t.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:null!==(i=t.expandOnlyOnTwistieClick)&&void 0!==i?i:"doubleClick"===n.getValue(_z),contextViewProvider:s,findWidgetStyles:Yx})}}Rz=FH([BH(7,Fa),BH(8,Ol),BH(9,WH),BH(10,pu)],Rz);let Fz=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,s,o,r){var a;this.tree=e,this.disposables=[],this.contextKeyService=iz(s,e),this.disposables.push(nz(this.contextKeyService,e)),this.listSupportsMultiSelect=zH.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==t.multipleSelectionSupport);$H.bindTo(this.contextKeyService).set(Boolean(t.selectionNavigation)),this.listSupportFindWidget=GH.bindTo(this.contextKeyService),this.listSupportFindWidget.set(null===(a=t.findWidgetEnabled)||void 0===a||a),this.hasSelectionOrFocus=KH.bindTo(this.contextKeyService),this.hasDoubleSelection=jH.bindTo(this.contextKeyService),this.hasMultiSelection=qH.bindTo(this.contextKeyService),this.treeElementCanCollapse=ZH.bindTo(this.contextKeyService),this.treeElementHasParent=YH.bindTo(this.contextKeyService),this.treeElementCanExpand=XH.bindTo(this.contextKeyService),this.treeElementHasChild=QH.bindTo(this.contextKeyService),this.treeFindOpen=JH.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=vz(r),this.updateStyleOverrides(n);const l=()=>{const t=e.getFocus()[0];if(!t)return;const i=e.getNode(t);this.treeElementCanCollapse.set(i.collapsible&&!i.collapsed),this.treeElementHasParent.set(!!e.getParentElement(t)),this.treeElementCanExpand.set(i.collapsible&&i.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(t))},h=new Set;h.add(ez),h.add(tz),this.disposables.push(this.contextKeyService,o.register(e),e.onDidChangeSelection((()=>{const t=e.getSelection(),i=e.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.hasSelectionOrFocus.set(t.length>0||i.length>0),this.hasMultiSelection.set(t.length>1),this.hasDoubleSelection.set(2===t.length)}))})),e.onDidChangeFocus((()=>{const t=e.getSelection(),i=e.getFocus();this.hasSelectionOrFocus.set(t.length>0||i.length>0),l()})),e.onDidChangeCollapseState(l),e.onDidChangeModel(l),e.onDidChangeFindOpenState((e=>this.treeFindOpen.set(e))),r.onDidChangeConfiguration((n=>{let s={};if(n.affectsConfiguration(sz)&&(this._useAltAsMultipleSelectionModifier=vz(r)),n.affectsConfiguration(uz)){const e=r.getValue(uz);s=Object.assign(Object.assign({},s),{indent:e})}if(n.affectsConfiguration(gz)&&void 0===t.renderIndentGuides){const e=r.getValue(gz);s=Object.assign(Object.assign({},s),{renderIndentGuides:e})}if(n.affectsConfiguration(pz)){const e=Boolean(r.getValue(pz));s=Object.assign(Object.assign({},s),{smoothScrolling:e})}if(n.affectsConfiguration(az)||n.affectsConfiguration(hz)){const e=Az(r);s=Object.assign(Object.assign({},s),{defaultFindMode:e})}if(n.affectsConfiguration(lz)||n.affectsConfiguration(hz)){const e=i();s=Object.assign(Object.assign({},s),{typeNavigationMode:e})}if(n.affectsConfiguration(cz)){const e=Oz(r);s=Object.assign(Object.assign({},s),{defaultFindMatchType:e})}if(n.affectsConfiguration(rz)&&void 0===t.horizontalScrolling){const e=Boolean(r.getValue(rz));s=Object.assign(Object.assign({},s),{horizontalScrolling:e})}if(n.affectsConfiguration(dz)){const e=Boolean(r.getValue(dz));s=Object.assign(Object.assign({},s),{scrollByPage:e})}if(n.affectsConfiguration(_z)&&void 0===t.expandOnlyOnTwistieClick&&(s=Object.assign(Object.assign({},s),{expandOnlyOnTwistieClick:"doubleClick"===r.getValue(_z)})),n.affectsConfiguration(mz)){const e=r.getValue(mz);s=Object.assign(Object.assign({},s),{mouseWheelScrollSensitivity:e})}if(n.affectsConfiguration(fz)){const e=r.getValue(fz);s=Object.assign(Object.assign({},s),{fastScrollSensitivity:e})}Object.keys(s).length>0&&e.updateOptions(s)})),this.contextKeyService.onDidChangeContext((t=>{t.affectsSome(h)&&e.updateOptions({typeNavigationMode:i()})}))),this.navigator=new xz(e,Object.assign({configurationService:r},t)),this.disposables.push(this.navigator)}updateOptions(e){void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?Jx(e):Qx)}dispose(){this.disposables=k(this.disposables)}};Fz=FH([BH(4,Ol),BH(5,WH),BH(6,pu)],Fz);jl.as(xu).registerConfiguration({id:"workbench",order:7,title:ue(0,"Workbench"),type:"object",properties:{[sz]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[ue(0,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),ue(0,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:ue(0,"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.")},[oz]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:ue(0,"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.")},[rz]:{type:"boolean",default:!1,description:ue(0,"Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[dz]:{type:"boolean",default:!1,description:ue(0,"Controls whether clicks in the scrollbar scroll page by page.")},[uz]:{type:"number",default:8,minimum:4,maximum:40,description:ue(0,"Controls tree indentation in pixels.")},[gz]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:ue(0,"Controls whether the tree should render indent guides.")},[pz]:{type:"boolean",default:!1,description:ue(0,"Controls whether lists and trees have smooth scrolling.")},[mz]:{type:"number",default:1,markdownDescription:ue(0,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[fz]:{type:"number",default:5,markdownDescription:ue(0,"Scrolling speed multiplier when pressing `Alt`.")},[az]:{type:"string",enum:["highlight","filter"],enumDescriptions:[ue(0,"Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),ue(0,"Filter elements when searching.")],default:"highlight",description:ue(0,"Controls the default find mode for lists and trees in the workbench.")},[hz]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[ue(0,"Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),ue(0,"Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),ue(0,"Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:ue(0,"Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:ue(0,"Please use 'workbench.list.defaultFindMode' and\t'workbench.list.typeNavigationMode' instead.")},[cz]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[ue(0,"Use fuzzy matching when searching."),ue(0,"Use contiguous matching when searching.")],default:"fuzzy",description:ue(0,"Controls the type of matching used when searching lists and trees in the workbench.")},[_z]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:ue(0,"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.")},[lz]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:ue(0,"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 Bz=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Wz{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=ck.nextId()}get uri(){return this.link.uri}get range(){var e,t;return null!==(t=null!==(e=this._range)&&void 0!==e?e:this.link.targetSelectionRange)&&void 0!==t?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const t=null===(e=this.parent.getPreview(this))||void 0===e?void 0:e.preview(this.range);return t?ue(0,"{0} in {1} on line {2} at column {3}",t.value,wa(this.uri),this.range.startLineNumber,this.range.startColumn):ue(0,"in {0} on line {1} at column {2}",wa(this.uri),this.range.startLineNumber,this.range.startColumn)}}class Vz{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:s,endLineNumber:o,endColumn:r}=e,a=i.getWordUntilPosition({lineNumber:n,column:s-t}),l=new Rh(n,a.startColumn,n,s),h=new Rh(o,r,o,1073741824),d=i.getValueInRange(l).replace(/^\s+/,""),c=i.getValueInRange(e);return{value:d+c+i.getValueInRange(h).replace(/\s+$/,""),highlight:{start:d.length,end:d.length+c.length}}}}class Hz{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Us}dispose(){k(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return 1===e?ue(0,"1 symbol in {0}, full path {1}",wa(this.uri),this.uri.fsPath):ue(0,"{0} symbols in {1}, full path {2}",e,wa(this.uri),this.uri.fsPath)}resolve(e){return Bz(this,void 0,void 0,(function*(){if(0!==this._previews.size)return this;for(const i of this.children)if(!this._previews.has(i.uri))try{const t=yield e.createModelReference(i.uri);this._previews.set(i.uri,new Vz(t))}catch(t){r(t)}return this}))}}class zz{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new U,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;let n;e.sort(zz._compareReferences);for(const s of e)if(n&&va.isEqual(n.uri,s.uri,!0)||(n=new Hz(this,s.uri),this.groups.push(n)),0===n.children.length||0!==zz._compareReferences(s,n.children[n.children.length-1])){const e=new Wz(i===s,n,s,(e=>this._onDidChangeReferenceRange.fire(e)));this.references.push(e),n.children.push(e)}}dispose(){k(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new zz(this._links,this._title)}get title(){return this._title}get isEmpty(){return 0===this.groups.length}get ariaMessage(){return this.isEmpty?ue(0,"No results found"):1===this.references.length?ue(0,"Found 1 symbol in {0}",this.references[0].uri.fsPath):1===this.groups.length?ue(0,"Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):ue(0,"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 s=i.children.length,o=i.parent.groups.length;return 1===o||t&&n+10?(n=t?(n+1)%s:(n+s-1)%s,i.children[n]):(n=i.parent.groups.indexOf(i),t?(n=(n+1)%o,i.parent.groups[n].children[0]):(n=(n+o-1)%o,i.parent.groups[n].children[i.parent.groups[n].children.length-1]))}nearestReference(e,t){const i=this.references.map(((i,n)=>({idx:n,prefixLen:bo(i.uri.toString(),e.toString()),offsetDist:100*Math.abs(i.range.startLineNumber-t.lineNumber)+Math.abs(i.range.startColumn-t.column)}))).sort(((e,t)=>e.prefixLen>t.prefixLen?-1:e.prefixLent.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()&&Rh.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 va.compare(e.uri,t.uri)||Rh.compareRangesUsingStarts(e.range,t.range)}}class Uz{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=ds(e,fs(".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()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){var e,t;this.element.textContent=Qs(this.countFormat,this.count),this.element.title=Qs(this.titleFormat,this.count),this.element.style.backgroundColor=null!==(e=this.styles.badgeBackground)&&void 0!==e?e:"",this.element.style.color=null!==(t=this.styles.badgeForeground)&&void 0!==t?t:"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}class Kz{constructor(e,t){var i;this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=null!==(i=null==t?void 0:t.supportIcons)&&void 0!==i&&i,this.domNode=ds(e,fs("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",n){e||(e=""),n&&(e=Kz.escapeNewLines(e,t)),this.didEverRender&&this.text===e&&this.title===i&&vd(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="\r\n"===e?-1:0,s+=i;for(const i of t)i.end<=s||(i.start>=s&&(i.start+=n),i.end>=s&&(i.end+=n));return i+=n,"\u23ce"}))}}class jz{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 qz extends E{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new jz(ds(e,fs(".monaco-icon-label")))),this.labelContainer=ds(this.domNode.element,fs(".monaco-icon-label-container"));const i=ds(this.labelContainer,fs("span.monaco-icon-name-container"));(null==t?void 0:t.supportHighlights)||(null==t?void 0:t.supportIcons)?this.nameNode=new Gz(i,!!t.supportIcons):this.nameNode=new $z(i),this.hoverDelegate=null==t?void 0:t.hoverDelegate}get element(){return this.domNode.element}setLabel(e,t,i){const n=["monaco-icon-label"],s=["monaco-icon-label-container"];let o="";if(i&&(i.extraClasses&&n.push(...i.extraClasses),i.italic&&n.push("italic"),i.strikethrough&&n.push("strikethrough"),i.disabledCommand&&s.push("disabled"),i.title&&(o+=i.title)),this.domNode.className=n.join(" "),this.domNode.element.setAttribute("aria-label",o),this.labelContainer.className=s.join(" "),this.setupHover((null==i?void 0:i.descriptionTitle)?this.labelContainer:this.element,null==i?void 0:i.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const e=this.getOrCreateDescriptionNode();e instanceof Kz?(e.set(t||"",i?i.descriptionMatches:void 0,void 0,null==i?void 0:i.labelEscapeNewLines),this.setupHover(e.element,null==i?void 0:i.descriptionTitle)):(e.textContent=t&&(null==i?void 0:i.labelEscapeNewLines)?Kz.escapeNewLines(t,[]):t||"",this.setupHover(e.element,(null==i?void 0:i.descriptionTitle)||""),e.empty=!t)}}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),t)if(this.hoverDelegate){const i=dD(this.hoverDelegate,e,t);i&&this.customHovers.set(e,i)}else!function(e,t){Fr(t)?e.title=aa(t):(null==t?void 0:t.markdownNotSupportedFallback)?e.title=t.markdownNotSupportedFallback:e.removeAttribute("title")}(e,t);else e.removeAttribute("title")}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new jz(ds(this.labelContainer,fs("span.monaco-icon-description-container"))));(null===(e=this.creationOptions)||void 0===e?void 0:e.supportDescriptionHighlights)?this.descriptionNode=new Kz(ds(t.element,fs("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons}):this.descriptionNode=this._register(new jz(ds(t.element,fs("span.label-description"))))}return this.descriptionNode}}class $z{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label!==e||!vd(this.options,t))if(this.label=e,this.options=t,"string"==typeof e)this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=ds(this.container,fs("a.label-name",{id:null==t?void 0: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 s={start:n,end:n+e.length},o=i.map((e=>PD.intersect(s,e))).filter((e=>!PD.isEmpty(e))).map((({start:e,end:t})=>({start:e-n,end:t-n})));return n=s.end+t.length,o}))}(e,i,null==t?void 0:t.matches);for(let s=0;s=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Qz=function(e,t){return function(i,n){t(i,n,e)}};let Jz=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof zz||e instanceof Hz}getChildren(e){if(e instanceof zz)return e.groups;if(e instanceof Hz)return e.resolve(this._resolverService).then((e=>e.children));throw new Error("bad tree")}};Jz=Xz([Qz(0,za)],Jz);class eU{getHeight(){return 23}getTemplateId(e){return e instanceof Hz?sU.id:rU.id}}let tU=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof Wz){const i=null===(t=e.parent.getPreview(e))||void 0===t?void 0:t.preview(e.range);if(i)return i.value}return wa(e.uri)}};tU=Xz([Qz(0,WL)],tU);class iU{getId(e){return e instanceof Wz?e.id:e.uri}}let nU=class extends E{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new qz(i,{supportHighlights:!0})),this.badge=new Uz(ds(i,fs(".count")),{},Xx),e.appendChild(i)}set(e,t){const i=Sa(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(ue(0,"{0} references",n)):this.badge.setTitleFormat(ue(0,"{0} reference",n))}};nU=Xz([Qz(1,Zz)],nU);let sU=Yz=class{constructor(e){this._instantiationService=e,this.templateId=Yz.id}renderTemplate(e){return this._instantiationService.createInstance(nU,e)}renderElement(e,t,i){i.set(e.element,_r(e.filterData))}disposeTemplate(e){e.dispose()}};sU.id="FileReferencesRenderer",sU=Yz=Xz([Qz(0,Fa)],sU);class oU{constructor(e){this.label=new Kz(e)}set(e,t){var i;const n=null===(i=e.parent.getPreview(e))||void 0===i?void 0:i.preview(e.range);if(n&&n.value){const{value:e,highlight:i}=n;t&&!Mr.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(e,_r(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(e,[i]))}else this.label.set(`${wa(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`)}}class rU{constructor(){this.templateId=rU.id}renderTemplate(e){return new oU(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}rU.id="OneReferenceRenderer";class aU{getWidgetAriaLabel(){return ue(0,"References")}getAriaLabel(e){return e.ariaMessage}}var lU=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},hU=function(e,t){return function(i,n){t(i,n,e)}},dU=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class cU{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new N,this._callOnModelChange=new N,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())return void this._addDecorations(t.parent)}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations((()=>this._onDecorationChanged())));const t=[],i=[];for(let n=0,s=e.children.length;n{const s=n.deltaDecorations([],t);for(let t=0;t{e.equals(9)&&(this._keybindingService.dispatchEvent(e,e.target),e.stopPropagation())}),!0)),this._tree=this._instantiationService.createInstance(gU,"ReferencesWidget",this._treeContainer,new eU,[this._instantiationService.createInstance(sU),this._instantiationService.createInstance(rU)],this._instantiationService.createInstance(Jz),t),this._splitView.addView({onDidChange:B.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:e=>{this._preview.layout({height:this._dim.height,width:e})}},gV.Distribute),this._splitView.addView({onDidChange:B.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:e=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${e}px`,this._tree.layout(this._dim.height,e)}},gV.Distribute),this._disposables.add(this._splitView.onDidSashChange((()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)}),void 0));const i=(e,t)=>{e instanceof Wz&&("show"===t&&this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:t,source:"tree"}))};this._tree.onDidOpen((e=>{e.sideBySide?i(e.element,"side"):e.editorOptions.pinned?i(e.element,"goto"):i(e.element,"show")})),vs(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Wn(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=ue(0,"No results"),_s(this._messageContainer),Promise.resolve(void 0)):(vs(this._messageContainer),this._decorationsManager=new cU(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(2!==t.detail)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"),_s(this._treeContainer),_s(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(1===this._model.groups.length?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();return e instanceof Wz?e:e instanceof Hz&&e.children.length>0?e.children[0]:void 0}revealReference(e){return dU(this,void 0,void 0,(function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}))}_revealReference(e,t){return dU(this,void 0,void 0,(function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==vn.inMemory?this.setTitle(Ca(e.uri),this._uriLabel.getUriLabel(Sa(e.uri))):this.setTitle(ue(0,"References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent||(t&&this._tree.reveal(e.parent),yield this._tree.expand(e.parent)),this._tree.reveal(e);const n=yield i;if(!this._model)return void n.dispose();k(this._previewModelReference);const s=n.object;if(s){const t=this._preview.getModel()===s.textEditorModel?0:1,i=Rh.lift(e.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(s.textEditorModel),this._preview.setSelection(i),this._preview.revealRangeInCenter(i,t)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()}))}};pU=lU([hU(3,P_),hU(4,za),hU(5,Fa),hU(6,jW),hU(7,Zz),hU(8,hw),hU(9,WL),hU(10,Lc),hU(11,Ju)],pU);var mU,fU=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},_U=function(e,t){return function(i,n){t(i,n,e)}},vU=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const bU=new Al("referenceSearchVisible",!1,ue(0,"Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let CU=mU=class{static get(e){return e.getContribution(mU.ID)}constructor(e,t,i,n,s,o,r,a){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=n,this._notificationService=s,this._instantiationService=o,this._storageService=r,this._configurationService=a,this._disposables=new N,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=bU.bindTo(i)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),null===(e=this._widget)||void 0===e||e.dispose(),null===(t=this._model)||void 0===t||t.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 s="peekViewLayout",o=uU.fromJSON(this._storageService.get(s,0,"{}"));this._widget=this._instantiationService.createInstance(pU,this._editor,this._defaultTreeKeyboardSupport,o),this._widget.setTitle(ue(0,"Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose((()=>{t.cancel(),this._widget&&(this._storageService.store(s,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()}))),this._disposables.add(this._widget.onDidSelectReference((e=>{const{element:t,kind:n}=e;if(t)switch(n){case"open":"editor"===e.source&&this._configurationService.getValue("editor.stablePeek")||this.openReference(t,!1,!1);break;case"side":this.openReference(t,!0,!1);break;case"goto":i?this._gotoReference(t,!0):this.openReference(t,!1,!0)}})));const r=++this._requestIdPool;t.then((t=>{var i;if(r===this._requestIdPool&&this._widget)return null===(i=this._model)||void 0===i||i.dispose(),this._model=t,this._widget.setModel(this._model).then((()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(ue(0,"{0} ({1})",this._model.title,this._model.references.length));const t=this._editor.getModel().uri,i=new Va(e.startLineNumber,e.startColumn),n=this._model.nearestReference(t,i);if(n)return this._widget.setSelection(n).then((()=>{this._widget&&"editor"===this._editor.getOption(86)&&this._widget.focusOnPreviewEditor()}))}}));t.dispose()}),(e=>{this._notificationService.error(e)}))}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}goToNextOrPreviousReference(e){return vU(this,void 0,void 0,(function*(){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),s=this._editor.hasTextFocus(),o=this._widget.isPreviewEditorFocused();yield this._widget.setSelection(n),yield this._gotoReference(n,!1),s?this._editor.focus():this._widget&&o&&this._widget.focusOnPreviewEditor()}))}revealReference(e){return vU(this,void 0,void 0,(function*(){this._editor.hasModel()&&this._model&&this._widget&&(yield this._widget.revealReference(e))}))}closeWidget(e=!0){var t,i;null===(t=this._widget)||void 0===t||t.dispose(),null===(i=this._model)||void 0===i||i.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){var i;null===(i=this._widget)||void 0===i||i.hide(),this._ignoreModelChangeEvent=!0;const n=Rh.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:n,selectionSource:"code.jump",pinned:t}},this._editor).then((e=>{var t;if(this._ignoreModelChangeEvent=!1,e&&this._widget)if(this._editor===e)this._widget.show(n),this._widget.focusOnReferenceTree();else{const i=mU.get(e),s=this._model.clone();this.closeWidget(),e.focus(),null==i||i.toggleWidget(n,Yh((e=>Promise.resolve(s))),null!==(t=this._peekMode)&&void 0!==t&&t)}else this.closeWidget()}),(e=>{this._ignoreModelChangeEvent=!1,r(e)}))}openReference(e,t,i){t||this.closeWidget();const{uri:n,range:s}=e;this._editorService.openCodeEditor({resource:n,options:{selection:s,selectionSource:"code.jump",pinned:i}},this._editor,t)}};function wU(e,t){const i=function(e){const t=e.get(Wa).getFocusedCodeEditor();return t instanceof pW?t.getParentEditor():t}(e);if(!i)return;const n=CU.get(i);n&&t(n)}CU.ID="editor.contrib.referencesController",CU=mU=fU([_U(2,Ol),_U(3,Wa),_U(4,mL),_U(5,Fa),_U(6,ZN),_U(7,pu)],CU),$l.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:pt(2089,60),when:pl.or(bU,qW.inPeekEditor),handler(e){wU(e,(e=>{e.changeFocusBetweenPreviewAndReferences()}))}}),$l.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:pl.or(bU,qW.inPeekEditor),handler(e){wU(e,(e=>{e.goToNextOrPreviousReference(!0)}))}}),$l.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:pl.or(bU,qW.inPeekEditor),handler(e){wU(e,(e=>{e.goToNextOrPreviousReference(!1)}))}}),Xa.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference"),Xa.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference"),Xa.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch"),Xa.registerCommand("closeReferenceSearch",(e=>wU(e,(e=>e.closeWidget())))),$l.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:pl.and(qW.inPeekEditor,pl.not("config.editor.stablePeek"))}),$l.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:pl.and(bU,pl.not("config.editor.stablePeek"))}),$l.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:pl.and(bU,UH,ZH.negate(),XH.negate()),handler(e){var t;const i=null===(t=e.get(WH).lastFocusedList)||void 0===t?void 0:t.getFocus();Array.isArray(i)&&i[0]instanceof Wz&&wU(e,(e=>e.revealReference(i[0])))}}),$l.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:pl.and(bU,UH,ZH.negate(),XH.negate()),handler(e){var t;const i=null===(t=e.get(WH).lastFocusedList)||void 0===t?void 0:t.getFocus();Array.isArray(i)&&i[0]instanceof Wz&&wU(e,(e=>e.openReference(i[0],!0,!0)))}}),Xa.registerCommand("openReference",(e=>{var t;const i=null===(t=e.get(WH).lastFocusedList)||void 0===t?void 0:t.getFocus();Array.isArray(i)&&i[0]instanceof Wz&&wU(e,(e=>e.openReference(i[0],!1,!0)))}));var yU=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},SU=function(e,t){return function(i,n){t(i,n,e)}};const LU=new Al("hasSymbols",!1,ue(0,"Whether there are symbol locations that can be navigated via keyboard-only.")),kU=Ba("ISymbolNavigationService");let DU=class{constructor(e,t,i,n){this._editorService=t,this._notificationService=i,this._keybindingService=n,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=LU.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),null===(e=this._currentState)||void 0===e||e.dispose(),null===(t=this._currentMessage)||void 0===t||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1)return void this.reset();this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const i=new xU(this._editorService),n=i.onDidChange((e=>{if(this._ignoreEditorChange)return;const i=this._editorService.getActiveCodeEditor();if(!i)return;const n=i.getModel(),s=i.getPosition();if(!n||!s)return;let o=!1,r=!1;for(const a of t.references)if(ba(a.uri,n.uri))o=!0,r=r||Rh.containsPosition(a.range,s);else if(o)break;o&&r||this.reset()}));this._currentState=D(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:Rh.collapseToStart(t.range),selectionRevealType:3}},e).finally((()=>{this._ignoreEditorChange=!1}))}_showMessage(){var e;null===(e=this._currentMessage)||void 0===e||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),i=t?ue(0,"Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):ue(0,"Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};DU=yU([SU(0,Ol),SU(1,Wa),SU(2,mL),SU(3,WL)],DU),yu(kU,DU,1),Sh(new class extends vh{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:LU,kbOpts:{weight:100,primary:70}})}runEditorCommand(e,t){return e.get(kU).revealNext(t)}}),$l.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:LU,primary:9,handler(e){e.get(kU).reset()}});let xU=class{constructor(e){this._listener=new Map,this._disposables=new N,this._onDidChange=new U,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(),k(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,D(e.onDidChangeCursorPosition((t=>this._onDidChange.fire({editor:e}))),e.onDidChangeModelContent((t=>this._onDidChange.fire({editor:e})))))}_onDidRemoveEditor(e){var t;null===(t=this._listener.get(e))||void 0===t||t.dispose(),this._listener.delete(e)}};xU=yU([SU(0,Wa)],xU);var NU=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function EU(e,t,i,n){return NU(this,void 0,void 0,(function*(){const s=i.ordered(e).map((i=>Promise.resolve(n(i,e,t)).then(void 0,(e=>{a(e)}))));return Bd((yield Promise.all(s)).flat())}))}function IU(e,t,i,n){return EU(t,i,e,((e,t,i)=>e.provideDefinition(t,i,n)))}function MU(e,t,i,n){return EU(t,i,e,((e,t,i)=>e.provideDeclaration(t,i,n)))}function TU(e,t,i,n){return EU(t,i,e,((e,t,i)=>e.provideImplementation(t,i,n)))}function RU(e,t,i,n){return EU(t,i,e,((e,t,i)=>e.provideTypeDefinition(t,i,n)))}function AU(e,t,i,n,s){return EU(t,i,e,((e,t,i)=>NU(this,void 0,void 0,(function*(){const o=yield e.provideReferences(t,i,{includeDeclaration:!0},s);if(!n||!o||2!==o.length)return o;const r=yield e.provideReferences(t,i,{includeDeclaration:!1},s);return r&&1===r.length?r:o}))))}function OU(e){return NU(this,void 0,void 0,(function*(){const t=yield e(),i=new zz(t,""),n=i.references.map((e=>e.link));return i.dispose(),n}))}yh("_executeDefinitionProvider",((e,t,i)=>{const n=IU(e.get(oL).definitionProvider,t,i,Uh.None);return OU((()=>n))})),yh("_executeTypeDefinitionProvider",((e,t,i)=>{const n=RU(e.get(oL).typeDefinitionProvider,t,i,Uh.None);return OU((()=>n))})),yh("_executeDeclarationProvider",((e,t,i)=>{const n=MU(e.get(oL).declarationProvider,t,i,Uh.None);return OU((()=>n))})),yh("_executeReferenceProvider",((e,t,i)=>{const n=AU(e.get(oL).referenceProvider,t,i,!1,Uh.None);return OU((()=>n))})),yh("_executeImplementationProvider",((e,t,i)=>{const n=TU(e.get(oL).implementationProvider,t,i,Uh.None);return OU((()=>n))}));var PU,FU,BU,WU,VU,HU,zU,UU,KU=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};nh.appendMenuItem(eh.EditorContext,{submenu:eh.EditorContextPeek,title:ue(0,"Peek"),group:"navigation",order:100});class jU{static is(e){return!(!e||"object"!=typeof e)&&(e instanceof jU||!(!Va.isIPosition(e.position)||!e.model))}constructor(e,t){this.model=e,this.position=t}}class qU extends wh{static all(){return qU._allSymbolNavigationCommands.values()}static _patchConfig(e){const t=Object.assign(Object.assign({},e),{f1:!0});if(t.menu)for(const i of v.wrap(t.menu))i.id!==eh.EditorContext&&i.id!==eh.EditorContextPeek||(i.when=pl.and(e.precondition,i.when));return t}constructor(e,t){super(qU._patchConfig(t)),this.configuration=e,qU._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,n){if(!t.hasModel())return Promise.resolve(void 0);const s=e.get(mL),o=e.get(Wa),r=e.get(vL),a=e.get(kU),l=e.get(oL),h=e.get(Fa),d=t.getModel(),c=t.getPosition(),u=jU.is(i)?i:new jU(d,c),g=new dL(t,5),p=Xh(this._getLocationModel(l,u.model,u.position,g.token),g.token).then((e=>KU(this,void 0,void 0,(function*(){var s;if(!e||g.token.isCancellationRequested)return;let r;if(Ps(e.ariaMessage),e.referenceAt(d.uri,c)){const e=this._getAlternativeCommand(t);!qU._activeAlternativeCommands.has(e)&&qU._allSymbolNavigationCommands.has(e)&&(r=qU._allSymbolNavigationCommands.get(e))}const l=e.references.length;if(0===l){if(!this.configuration.muteMessage){const e=d.getWordAtPosition(c);null===(s=oD.get(t))||void 0===s||s.showMessage(this._getNoResultFoundMessage(e),c)}}else{if(1!==l||!r)return this._onResult(o,a,t,e,n);qU._activeAlternativeCommands.add(this.desc.id),h.invokeFunction((e=>r.runEditorCommand(e,t,i,n).finally((()=>{qU._activeAlternativeCommands.delete(this.desc.id)}))))}}))),(e=>{s.error(e)})).finally((()=>{g.dispose()}));return r.showWhile(p,250),p}_onResult(e,t,i,n,s){return KU(this,void 0,void 0,(function*(){const o=this._getGoToPreference(i);if(i instanceof pW||!(this.configuration.openInPeek||"peek"===o&&n.references.length>1)){const r=n.firstReference(),a=n.references.length>1&&"gotoAndPeek"===o,l=yield this._openReference(i,e,r,this.configuration.openToSide,!a);a&&l?this._openInPeek(l,n,s):n.dispose(),"goto"===o&&t.put(r)}else this._openInPeek(i,n,s)}))}_openReference(e,t,i,n,s){return KU(this,void 0,void 0,(function*(){let o;var r;if((r=i)&&an.isUri(r.uri)&&Rh.isIRange(r.range)&&(Rh.isIRange(r.originSelectionRange)||Rh.isIRange(r.targetSelectionRange))&&(o=i.targetSelectionRange),o||(o=i.range),!o)return;const a=yield t.openCodeEditor({resource:i.uri,options:{selection:Rh.collapseToStart(o),selectionRevealType:3,selectionSource:"code.jump"}},e,n);if(a){if(s){const e=a.getModel(),t=a.createDecorationsCollection([{range:o,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout((()=>{a.getModel()===e&&t.clear()}),350)}return a}}))}_openInPeek(e,t,i){const n=CU.get(e);n&&e.hasModel()?n.toggleWidget(null!=i?i:e.getSelection(),Yh((e=>Promise.resolve(t))),this.configuration.openInPeek):t.dispose()}}qU._allSymbolNavigationCommands=new Map,qU._activeAlternativeCommands=new Set;class $U extends qU{_getLocationModel(e,t,i,n){return KU(this,void 0,void 0,(function*(){return new zz(yield IU(e.definitionProvider,t,i,n),ue(0,"Definitions"))}))}_getNoResultFoundMessage(e){return e&&e.word?ue(0,"No definition found for '{0}'",e.word):ue(0,"No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}ah(((PU=class extends $U{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:PU.id,title:{value:ue(0,"Go to Definition"),original:"Go to Definition",mnemonicTitle:ue(0,"Go to &&Definition")},precondition:pl.and(Oh.hasDefinitionProvider,Oh.isInWalkThroughSnippet.toNegated()),keybinding:[{when:Oh.editorTextFocus,primary:70,weight:100},{when:pl.and(Oh.editorTextFocus,OH),primary:2118,weight:100}],menu:[{id:eh.EditorContext,group:"navigation",order:1.1},{id:eh.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),Xa.registerCommandAlias("editor.action.goToDeclaration",PU.id)}}).id="editor.action.revealDefinition",PU)),ah(((FU=class extends $U{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:FU.id,title:{value:ue(0,"Open Definition to the Side"),original:"Open Definition to the Side"},precondition:pl.and(Oh.hasDefinitionProvider,Oh.isInWalkThroughSnippet.toNegated()),keybinding:[{when:Oh.editorTextFocus,primary:pt(2089,70),weight:100},{when:pl.and(Oh.editorTextFocus,OH),primary:pt(2089,2118),weight:100}]}),Xa.registerCommandAlias("editor.action.openDeclarationToTheSide",FU.id)}}).id="editor.action.revealDefinitionAside",FU)),ah(((BU=class extends $U{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:BU.id,title:{value:ue(0,"Peek Definition"),original:"Peek Definition"},precondition:pl.and(Oh.hasDefinitionProvider,qW.notInPeekEditor,Oh.isInWalkThroughSnippet.toNegated()),keybinding:{when:Oh.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:eh.EditorContextPeek,group:"peek",order:2}}),Xa.registerCommandAlias("editor.action.previewDeclaration",BU.id)}}).id="editor.action.peekDefinition",BU));class GU extends qU{_getLocationModel(e,t,i,n){return KU(this,void 0,void 0,(function*(){return new zz(yield MU(e.declarationProvider,t,i,n),ue(0,"Declarations"))}))}_getNoResultFoundMessage(e){return e&&e.word?ue(0,"No declaration found for '{0}'",e.word):ue(0,"No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}ah(((WU=class extends GU{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:WU.id,title:{value:ue(0,"Go to Declaration"),original:"Go to Declaration",mnemonicTitle:ue(0,"Go to &&Declaration")},precondition:pl.and(Oh.hasDeclarationProvider,Oh.isInWalkThroughSnippet.toNegated()),menu:[{id:eh.EditorContext,group:"navigation",order:1.3},{id:eh.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?ue(0,"No declaration found for '{0}'",e.word):ue(0,"No declaration found")}}).id="editor.action.revealDeclaration",WU)),ah(class extends GU{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:ue(0,"Peek Declaration"),original:"Peek Declaration"},precondition:pl.and(Oh.hasDeclarationProvider,qW.notInPeekEditor,Oh.isInWalkThroughSnippet.toNegated()),menu:{id:eh.EditorContextPeek,group:"peek",order:3}})}});class ZU extends qU{_getLocationModel(e,t,i,n){return KU(this,void 0,void 0,(function*(){return new zz(yield RU(e.typeDefinitionProvider,t,i,n),ue(0,"Type Definitions"))}))}_getNoResultFoundMessage(e){return e&&e.word?ue(0,"No type definition found for '{0}'",e.word):ue(0,"No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}ah(((VU=class extends ZU{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:VU.ID,title:{value:ue(0,"Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:ue(0,"Go to &&Type Definition")},precondition:pl.and(Oh.hasTypeDefinitionProvider,Oh.isInWalkThroughSnippet.toNegated()),keybinding:{when:Oh.editorTextFocus,primary:0,weight:100},menu:[{id:eh.EditorContext,group:"navigation",order:1.4},{id:eh.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}}).ID="editor.action.goToTypeDefinition",VU)),ah(((HU=class extends ZU{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:HU.ID,title:{value:ue(0,"Peek Type Definition"),original:"Peek Type Definition"},precondition:pl.and(Oh.hasTypeDefinitionProvider,qW.notInPeekEditor,Oh.isInWalkThroughSnippet.toNegated()),menu:{id:eh.EditorContextPeek,group:"peek",order:4}})}}).ID="editor.action.peekTypeDefinition",HU));class YU extends qU{_getLocationModel(e,t,i,n){return KU(this,void 0,void 0,(function*(){return new zz(yield TU(e.implementationProvider,t,i,n),ue(0,"Implementations"))}))}_getNoResultFoundMessage(e){return e&&e.word?ue(0,"No implementation found for '{0}'",e.word):ue(0,"No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}ah(((zU=class extends YU{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:zU.ID,title:{value:ue(0,"Go to Implementations"),original:"Go to Implementations",mnemonicTitle:ue(0,"Go to &&Implementations")},precondition:pl.and(Oh.hasImplementationProvider,Oh.isInWalkThroughSnippet.toNegated()),keybinding:{when:Oh.editorTextFocus,primary:2118,weight:100},menu:[{id:eh.EditorContext,group:"navigation",order:1.45},{id:eh.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}}).ID="editor.action.goToImplementation",zU)),ah(((UU=class extends YU{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:UU.ID,title:{value:ue(0,"Peek Implementations"),original:"Peek Implementations"},precondition:pl.and(Oh.hasImplementationProvider,qW.notInPeekEditor,Oh.isInWalkThroughSnippet.toNegated()),keybinding:{when:Oh.editorTextFocus,primary:3142,weight:100},menu:{id:eh.EditorContextPeek,group:"peek",order:5}})}}).ID="editor.action.peekImplementation",UU));class XU extends qU{_getNoResultFoundMessage(e){return e?ue(0,"No references found for '{0}'",e.word):ue(0,"No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}ah(class extends XU{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{value:ue(0,"Go to References"),original:"Go to References",mnemonicTitle:ue(0,"Go to &&References")},precondition:pl.and(Oh.hasReferenceProvider,qW.notInPeekEditor,Oh.isInWalkThroughSnippet.toNegated()),keybinding:{when:Oh.editorTextFocus,primary:1094,weight:100},menu:[{id:eh.EditorContext,group:"navigation",order:1.45},{id:eh.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}_getLocationModel(e,t,i,n){return KU(this,void 0,void 0,(function*(){return new zz(yield AU(e.referenceProvider,t,i,!0,n),ue(0,"References"))}))}}),ah(class extends XU{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:{value:ue(0,"Peek References"),original:"Peek References"},precondition:pl.and(Oh.hasReferenceProvider,qW.notInPeekEditor,Oh.isInWalkThroughSnippet.toNegated()),menu:{id:eh.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,i,n){return KU(this,void 0,void 0,(function*(){return new zz(yield AU(e.referenceProvider,t,i,!1,n),ue(0,"References"))}))}});class QU extends qU{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:{value:ue(0,"Go to Any Symbol"),original:"Go to Any Symbol"},precondition:pl.and(qW.notInPeekEditor,Oh.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}_getLocationModel(e,t,i,n){return KU(this,void 0,void 0,(function*(){return new zz(this._references,ue(0,"Locations"))}))}_getNoResultFoundMessage(e){return e&&ue(0,"No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return null!==(t=this._gotoMultipleBehaviour)&&void 0!==t?t:e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}}Xa.registerCommand({id:"editor.action.goToLocations",description:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:an},{name:"position",description:"The position at which to start",constraint:Va.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:(e,t,i,n,s,o,r)=>KU(void 0,void 0,void 0,(function*(){qr(an.isUri(t)),qr(Va.isIPosition(i)),qr(Array.isArray(n)),qr(void 0===s||"string"==typeof s),qr(void 0===r||"boolean"==typeof r);const a=e.get(Wa),l=yield a.openCodeEditor({resource:t},a.getFocusedCodeEditor());if(iV(l))return l.setPosition(i),l.revealPositionInCenterIfOutsideViewport(i,0),l.invokeWithinContext((e=>{const t=new class extends QU{_getNoResultFoundMessage(e){return o||super._getNoResultFoundMessage(e)}}({muteMessage:!Boolean(o),openInPeek:Boolean(r),openToSide:!1},n,s);e.get(Fa).invokeFunction(t.run.bind(t),l)}))}))}),Xa.registerCommand({id:"editor.action.peekLocations",description:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:an},{name:"position",description:"The position at which to start",constraint:Va.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:(e,t,i,n,s)=>KU(void 0,void 0,void 0,(function*(){e.get(Ya).executeCommand("editor.action.goToLocations",t,i,n,s,void 0,!0)}))}),Xa.registerCommand({id:"editor.action.findReferences",handler:(e,t,i)=>{qr(an.isUri(t)),qr(Va.isIPosition(i));const n=e.get(oL),s=e.get(Wa);return s.openCodeEditor({resource:t},s.getFocusedCodeEditor()).then((e=>{if(!iV(e)||!e.hasModel())return;const t=CU.get(e);if(!t)return;const s=Yh((t=>AU(n.referenceProvider,e.getModel(),Va.lift(i),!1,t).then((e=>new zz(e,ue(0,"References")))))),o=new Rh(i.lineNumber,i.column,i.lineNumber,i.column);return Promise.resolve(t.toggleWidget(o,s,!1))}))}}),Xa.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var JU,eK=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},tK=function(e,t){return function(i,n){t(i,n,e)}},iK=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let nK=JU=class{constructor(e,t,i,n){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=n,this.toUnhook=new N,this.toUnhookForKeyboard=new N,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const s=new RR(e);this.toUnhook.add(s),this.toUnhook.add(s.onMouseMoveOrRelevantKeyDown((([e,t])=>{this.startFindDefinitionFromMouse(e,null!=t?t:void 0)}))),this.toUnhook.add(s.onExecute((e=>{this.isEnabled(e)&&this.gotoDefinition(e.target.position,e.hasSideBySideModifier).catch((e=>{r(e)})).finally((()=>{this.removeLinkDecorations()}))}))),this.toUnhook.add(s.onCancel((()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null})))}static get(e){return e.getContribution(JU.ID)}startFindDefinitionFromCursor(e){return iK(this,void 0,void 0,(function*(){yield this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition((()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()}))),this.toUnhookForKeyboard.add(this.editor.onKeyDown((e=>{e&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())})))}))}startFindDefinitionFromMouse(e,t){if(9===e.target.type&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t))return this.currentWordAtPosition=null,void this.removeLinkDecorations();const i=e.target.position;this.startFindDefinition(i)}startFindDefinition(e){var t;return iK(this,void 0,void 0,(function*(){this.toUnhookForKeyboard.clear();const i=e?null===(t=this.editor.getModel())||void 0===t?void 0:t.getWordAtPosition(e):null;if(!i)return this.currentWordAtPosition=null,void this.removeLinkDecorations();if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return;this.currentWordAtPosition=i;const n=new hL(this.editor,15);let s;this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Yh((t=>this.findDefinition(e,t)));try{s=yield this.previousPromise}catch(a){return void r(a)}if(!s||!s.length||!n.validate(this.editor))return void this.removeLinkDecorations();const o=s[0].originSelectionRange?Rh.lift(s[0].originSelectionRange):new Rh(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);if(s.length>1){let e=o;for(const{originSelectionRange:t}of s)t&&(e=Rh.plusRange(e,t));this.addDecoration(e,(new Ta).appendText(ue(0,"Click to show {0} definitions.",s.length)))}else{const e=s[0];if(!e.uri)return;this.textModelResolverService.createModelReference(e.uri).then((t=>{if(!t.object||!t.object.textEditorModel)return void t.dispose();const{object:{textEditorModel:i}}=t,{startLineNumber:n}=e.range;if(n<1||n>i.getLineCount())return void t.dispose();const s=this.getPreviewValue(i,n,e),r=this.languageService.guessLanguageIdByFilepathOrFirstLine(i.uri);this.addDecoration(o,s?(new Ta).appendCodeblock(r||"",s):void 0),t.dispose()}))}}))}getPreviewValue(e,t,i){let n=i.range;n.endLineNumber-n.startLineNumber>=JU.MAX_SOURCE_PREVIEW_LINES&&(n=this.getPreviewRangeBasedOnIndentation(e,t));return this.stripIndentationFromPreviewRange(e,t,n)}stripIndentationFromPreviewRange(e,t,i){let n=e.getLineFirstNonWhitespaceColumn(t);for(let s=t+1;s{const i=!t&&this.editor.getOption(87)&&!this.isInPeekEditor(e);return new $U({openToSide:t,openInPeek:i,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(e)}))}isInPeekEditor(e){const t=e.get(Ol);return qW.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};nK.ID="editor.contrib.gotodefinitionatposition",nK.MAX_SOURCE_PREVIEW_LINES=8,nK=JU=eK([tK(1,za),tK(2,Lc),tK(3,oL)],nK),Dh(nK.ID,nK,2);const sK=fs;class oK extends E{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 OD(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class rK extends E{static render(e,t,i){return new rK(e,t,i)}constructor(e,t,i){super(),this.actionContainer=ds(e,sK("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=ds(this.actionContainer,sK("a.action")),this.action.setAttribute("role","button"),t.iconClass&&ds(this.action,sK(`span.icon.${t.iconClass}`));ds(this.action,sK("span")).textContent=i?`${t.label} (${i})`:t.label,this._register(En(this.actionContainer,os.CLICK,(e=>{e.stopPropagation(),e.preventDefault(),t.run(this.actionContainer)}))),this._register(En(this.actionContainer,os.KEY_DOWN,(e=>{const i=new St(e);(i.equals(3)||i.equals(10))&&(e.stopPropagation(),e.preventDefault(),t.run(this.actionContainer))}))),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"))}}var aK=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))},lK=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=e[i]&&function(t){return new Promise((function(n,s){(function(e,t,i,n){Promise.resolve(n).then((function(t){e({value:t,done:i})}),t)})(n,s,(t=e[i](t)).done,t.value)}))}}};class hK{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}}class dK extends E{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new U),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new rd((()=>this._triggerAsyncComputation()),0)),this._secondWaitScheduler=this._register(new rd((()=>this._triggerSyncComputation()),0)),this._loadingMessageScheduler=this._register(new rd((()=>this._triggerLoadingMessage()),0)),this._state=0,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(60).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(2),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=function(e){const t=new jh,i=e(t.token);return new ud(t,(e=>$h(this,void 0,void 0,(function*(){var n,s,o,r;const a=t.token.onCancellationRequested((()=>{a.dispose(),t.dispose(),e.reject(new c)}));try{try{for(var l,h=!0,d=Gh(i);!(n=(l=yield d.next()).done);h=!0){r=l.value,h=!1;const i=r;if(t.token.isCancellationRequested)return;e.emitOne(i)}}catch(u){s={error:u}}finally{try{h||n||!(o=d.return)||(yield o.call(d))}finally{if(s)throw s.error}}a.dispose(),t.dispose()}catch(g){a.dispose(),t.dispose(),e.reject(g)}}))))}((e=>this._computer.computeAsync(e))),(()=>{aK(this,void 0,void 0,(function*(){var e,t,i,n;try{try{for(var s,o=!0,a=lK(this._asyncIterable);!(e=(s=yield a.next()).done);o=!0){n=s.value,o=!1;const e=n;e&&(this._result.push(e),this._fireResult())}}catch(l){t={error:l}}finally{try{o||e||!(i=a.return)||(yield i.call(a))}finally{if(t)throw t.error}}this._asyncIterableDone=!0,3!==this._state&&4!==this._state||this._setState(0)}catch(Mre){r(Mre)}}))})()):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?0:3)}_triggerLoadingMessage(){3===this._state&&this._setState(4)}_fireResult(){if(1===this._state||2===this._state)return;const e=0===this._state,t=4===this._state;this._onResult.fire(new hK(this._result.slice(0),e,t))}start(e){if(0===e)0===this._state&&(this._setState(1),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case 2:this._secondWaitScheduler.cancel(),this._triggerSyncComputation()}}cancel(){this._firstWaitScheduler.cancel(),this._secondWaitScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._setState(0,!1)}}class cK{constructor(e,t,i,n){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=n,this.type=1}equals(e){return 1===e.type&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return 1===e.type&&t.lineNumber===this.range.startLineNumber}}class uK{constructor(e,t,i,n,s,o){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=n,this.initialMousePosY=s,this.supportsMarkerHover=o,this.type=2}equals(e){return 2===e.type&&this.owner===e.owner}canAdoptVisibleHover(e,t){return 2===e.type&&this.owner===e.owner}}const gK=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class pK{constructor(){let e;this._onDidWillResize=new U,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new U,this.onDidResize=this._onDidResize.event,this._sashListener=new N,this._size=new Wn(0,0),this._minSize=new Wn(0,0),this._maxSize=new Wn(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new SW(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new SW(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new SW(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:fW.North}),this._southSash=new SW(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:fW.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let t=0,i=0;this._sashListener.add(B.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)((()=>{void 0===e&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)}))),this._sashListener.add(B.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)((()=>{void 0!==e&&(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(B.any(this._eastSash.onDidReset,this._westSash.onDidReset)((e=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))),this._sashListener.add(B.any(this._northSash.onDidReset,this._southSash.onDidReset)((e=>{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?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=n?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:n}=this._minSize,{height:s,width:o}=this._maxSize;e=Math.max(i,Math.min(s,e)),t=Math.max(n,Math.min(o,t));const r=new Wn(t,e);Wn.equals(r,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=r,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}}class mK extends E{constructor(e,t=new Wn(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new pK),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Wn.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize((e=>{this._resize(new Wn(e.dimension.width,e.dimension.height)),e.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(){var e;return(null===(e=this._contentPosition)||void 0===e?void 0:e.position)?Va.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;return Hn(t).top+i.top-30}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const n=Hn(t),s=Fn(t.ownerDocument.body),o=n.top+i.top+i.height;return s.height-o-24}_findPositionPreference(e,t){var i,n;const s=Math.min(null!==(i=this._availableVerticalSpaceBelow(t))&&void 0!==i?i:1/0,e),o=Math.min(null!==(n=this._availableVerticalSpaceAbove(t))&&void 0!==n?n:1/0,e),r=Math.min(Math.max(o,s),e),a=Math.min(e,r);let l;return l=this._editor.getOption(60).above?a<=o?1:2:a<=s?2:1,1===l?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),l}_resize(e){this._resizableNode.layout(e.height,e.width)}}var fK,_K,vK=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},bK=function(e,t){return function(i,n){t(i,n,e)}};const CK=fs;let wK=fK=class extends E{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(kK,this._editor)),this._participants=[];for(const n of gK.getAll())this._participants.push(this._instantiationService.createInstance(n,this._editor));this._participants.sort(((e,t)=>e.hoverOrdinal-t.hoverOrdinal)),this._computer=new xK(this._editor,this._participants),this._hoverOperation=this._register(new dK(this._editor,this._computer)),this._register(this._hoverOperation.onResult((e=>{if(!this._computer.anchor)return;const t=e.hasLoadingMessage?this._addLoadingMessage(e.value):e.value;this._withResult(new yK(this._computer.anchor,t,e.isComplete))}))),this._register(Mn(this._widget.getDomNode(),"keydown",(e=>{e.equals(9)&&this.hide()}))),this._register(EC.onDidChange((()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)})))}get widget(){return this._widget}maybeShowAt(e){if(this._widget.isResizing)return!0;const t=[];for(const n of this._participants)if(n.suggestHoverAnchor){const i=n.suggestHoverAnchor(e);i&&t.push(i)}const i=e.target;if(6===i.type&&t.push(new cK(0,i.range,e.event.posx,e.event.posy)),7===i.type){const n=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!i.detail.isAfterLines&&"number"==typeof i.detail.horizontalDistanceToText&&i.detail.horizontalDistanceToTextt.priority-e.priority)),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,i,n){this._startShowingOrUpdateHover(new cK(0,e,void 0,void 0),t,i,n,null)}_startShowingOrUpdateHover(e,t,i,n,s){if(!this._widget.position||!this._currentResult)return!!e&&(this._startHoverOperationIfNecessary(e,t,i,n,!1),!0);return this._editor.getOption(60).sticky&&s&&this._widget.isMouseGettingCloser(s.event.posx,s.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,i,n,!0),!0):e?!(!e||!this._currentResult.anchor.equals(e))||(e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.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,s){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=s,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&0===e.messages.length&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}containsNode(e){return!!e&&this._widget.getDomNode().contains(e)}_addLoadingMessage(e){if(this._computer.anchor)for(const t of this._participants)if(t.createLoadingMessage){const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}return e}_withResult(e){if(this._widget.position&&this._currentResult&&this._currentResult.isComplete){if(!e.isComplete)return;if(this._computer.insistOnKeepingHoverVisible&&0===e.messages.length)return}this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:i,showAtSecondaryPosition:n,highlightRange:s}=fK.computeHoverRanges(this._editor,e.range,t),o=new N,r=o.add(new DK(this._keybindingService)),a=document.createDocumentFragment();let l=null;const h={fragment:a,statusBar:r,setColorPicker:e=>l=e,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:e=>this._widget.setMinimumDimensions(e),hide:()=>this.hide()};for(const c of this._participants){const e=t.filter((e=>e.owner===c));e.length>0&&o.add(c.renderHoverParts(h,e))}const d=t.some((e=>e.isBeforeContent));if(r.hasContent&&a.appendChild(r.hoverElement),a.hasChildNodes()){if(s){const e=this._editor.createDecorationsCollection();e.set([{range:s,options:fK._DECORATION_OPTIONS}]),o.add(x((()=>{e.clear()})))}this._widget.showAt(a,new LK(l,i,n,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,d,e.initialMousePosX,e.initialMousePosY,o))}else o.dispose()}static computeHoverRanges(e,t,i){let n=1;if(e.hasModel()){const i=e._getViewModel(),s=i.coordinatesConverter,o=s.convertModelRangeToViewRange(t),r=new Va(o.startLineNumber,i.getLineMinColumn(o.startLineNumber));n=s.convertViewPositionToModelPosition(r).column}const s=t.startLineNumber;let o=t.startColumn,r=i[0].range,a=null;for(const l of i)r=Rh.plusRange(r,l.range),l.range.startLineNumber===s&&l.range.endLineNumber===s&&(o=Math.max(Math.min(o,l.range.startColumn),n)),l.forceShowAtRange&&(a=l.range);return{showAtPosition:a?a.getStartPosition():new Va(s,t.startColumn),showAtSecondaryPosition:a?a.getStartPosition():new Va(s,o),highlightRange:r}}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}};wK._DECORATION_OPTIONS=Iw.register({description:"content-hover-highlight",className:"hoverHighlight"}),wK=fK=vK([bK(1,Fa),bK(2,WL)],wK);class yK{constructor(e,t,i){this.anchor=e,this.messages=t,this.isComplete=i}filter(e){const t=this.messages.filter((t=>t.isValidForHoverAnchor(e)));return t.length===this.messages.length?this:new SK(this,this.anchor,t,this.isComplete)}}class SK extends yK{constructor(e,t,i,n){super(t,i,n),this.original=e}filter(e){return this.original.filter(e)}}class LK{constructor(e,t,i,n,s,o,r,a,l,h){this.colorPicker=e,this.showAtPosition=t,this.showAtSecondaryPosition=i,this.preferAbove=n,this.stoleFocus=s,this.source=o,this.isBeforeContent=r,this.initialMousePosX=a,this.initialMousePosY=l,this.disposables=h,this.closestMouseDistance=void 0}}let kK=_K=class extends mK{get isColorPickerVisible(){var e;return Boolean(null===(e=this._visibleData)||void 0===e?void 0:e.colorPicker)}get isVisibleFromKeyboard(){var e;return 1===(null===(e=this._visibleData)||void 0===e?void 0:e.source)}get isVisible(){var e;return null!==(e=this._hoverVisibleKey.get())&&void 0!==e&&e}get isFocused(){var e;return null!==(e=this._hoverFocusedKey.get())&&void 0!==e&&e}constructor(e,t,i,n,s){const o=e.getOption(66)+8,r=new Wn(150,o);super(e,r),this._configurationService=i,this._accessibilityService=n,this._keybindingService=s,this._hover=this._register(new oK),this._minimumSize=r,this._hoverVisibleKey=Oh.hoverVisible.bindTo(t),this._hoverFocusedKey=Oh.hoverFocused.bindTo(t),ds(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange((()=>this._layout()))),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(50)&&this._updateFont()})));const a=this._register(hs(this._resizableNode.domNode));this._register(a.onDidFocus((()=>{this._hoverFocusedKey.set(!0)}))),this._register(a.onDidBlur((()=>{this._hoverFocusedKey.set(!1)}))),this._setHoverData(void 0),this._layout(),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),null===(e=this._visibleData)||void 0===e||e.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return _K.ID}static _applyDimensions(e,t,i){const n="number"==typeof t?`${t}px`:t,s="number"==typeof i?`${i}px`:i;e.style.width=n,e.style.height=s}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return _K._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return _K._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const n="number"==typeof t?`${t}px`:t,s="number"==typeof i?`${i}px`:i;e.style.maxWidth=n,e.style.maxHeight=s}_setHoverWidgetMaxDimensions(e,t){_K._applyMaxDimensions(this._hover.contentsDomNode,e,t),_K._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth","number"==typeof e?`${e}px`:e),this._layoutContentWidget()}_hasHorizontalScrollbar(){const e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){const e=this._hover.contentsDomNode,t=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;e.style.paddingBottom!==t&&(e.style.paddingBottom=t)}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,i=e.height;this._setHoverWidgetDimensions(t,i),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,i-10))}_updateResizableNodeMaxDimensions(){var e,t;const i=null!==(e=this._findMaximumRenderingWidth())&&void 0!==e?e:1/0,n=null!==(t=this._findMaximumRenderingHeight())&&void 0!==t?t:1/0;this._resizableNode.maxSize=new Wn(i,n),this._setHoverWidgetMaxDimensions(i,n)}_resize(e){var t,i;_K._lastDimensions=new Wn(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),null===(i=null===(t=this._visibleData)||void 0===t?void 0:t.colorPicker)||void 0===i||i.layout()}_findAvailableSpaceVertically(){var e;const t=null===(e=this._visibleData)||void 0===e?void 0:e.showAtPosition;if(t)return 1===this._positionPreference?this._availableVerticalSpaceAbove(t):this._availableVerticalSpaceBelow(t)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=6;return Array.from(this._hover.contentsDomNode.children).forEach((e=>{t+=e.clientHeight})),this._hasHorizontalScrollbar()&&(t+=10),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((e=>e.scrollWidth>e.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=void 0===this._contentWidth?0:this._contentWidth-2;if(e||this._hover.containerDomNode.clientWidththis._visibleData.closestMouseDistance+4)&&(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,n),!0)}_setHoverData(e){var t;null===(t=this._visibleData)||void 0===t||t.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_layout(){const{fontSize:e,lineHeight:t}=this._editor.getOption(50),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=""+t/e,this._updateMaxDimensions()}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach((e=>this._editor.applyFontInfo(e)))}_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,_K._lastDimensions.height),t=Math.max(.66*this._editor.getLayoutInfo().width,500,_K._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var e;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[null!==(e=this._positionPreference)&&void 0!==e?e:1]}:null}showAt(e,t){var i,n,s,o;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const r=jn(this._hover.containerDomNode),a=t.showAtPosition;this._positionPreference=null!==(i=this._findPositionPreference(r,a))&&void 0!==i?i:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),null===(n=t.colorPicker)||void 0===n||n.layout();const l=(h=!0===this._configurationService.getValue("accessibility.verbosity.hover")&&this._accessibilityService.isScreenReaderOptimized(),d=null!==(o=null===(s=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))||void 0===s?void 0:s.getAriaLabel())&&void 0!==o?o:"",h&&d?ue(0,"Inspect this in the accessible view with {0}.",d):h?ue(0,"Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):"");var h,d;l&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+l)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new Wn(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")}_adjustHoverHeightForScrollbar(e){var t;const i=this._hover.containerDomNode,n=this._hover.contentsDomNode,s=null!==(t=this._findMaximumRenderingHeight())&&void 0!==t?t:1/0;this._setContainerDomNodeDimensions(zn(i),Math.min(s,e)),this._setContentsDomNodeDimensions(zn(n),Math.min(s,e-10))}setMinimumDimensions(e){this._minimumSize=new Wn(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=void 0===this._contentWidth?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new Wn(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let i=jn(t),n=zn(t);if(this._resizableNode.layout(i,n),this._setHoverWidgetDimensions(n,i),i=jn(t),n=zn(t),this._contentWidth=n,this._updateMinimumWidth(),this._resizableNode.layout(i,n),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(i)),null===(e=this._visibleData)||void 0===e?void 0:e.showAtPosition){const e=jn(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(e,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-30})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+30})}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})}};kK.ID="editor.contrib.resizableContentHoverWidget",kK._lastDimensions=new Wn(0,0),kK=_K=vK([bK(1,Ol),bK(2,pu),bK(3,QR),bK(4,WL)],kK);let DK=class extends E{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=CK("div.hover-row.status-bar"),this.actionsElement=ds(this.hoverElement,CK("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(rK.render(this.actionsElement,e,i))}append(e){const t=ds(this.actionsElement,e);return this._hasContent=!0,t}};DK=vK([bK(0,WL)],DK);class xK{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=0,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(1!==t.type&&!t.supportsMarkerHover)return[];const i=e.getModel(),n=t.range.startLineNumber;if(n>i.getLineCount())return[];const s=i.getLineMaxColumn(n);return e.getLineDecorations(n).filter((e=>{if(e.options.isWholeLine)return!0;const i=e.range.startLineNumber===n?e.range.startColumn:1,o=e.range.endLineNumber===n?e.range.endColumn:s;if(e.options.showIfCollapsed){if(i>t.range.startColumn+1||t.range.endColumn-1>o)return!1}else if(i>t.range.startColumn||t.range.endColumn>o)return!1;return!0}))}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return cd.EMPTY;const i=xK._getLineDecorations(this._editor,t);return cd.merge(this._participants.map((n=>n.computeAsync?n.computeAsync(t,i,e):cd.EMPTY)))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=xK._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return Bd(t)}}function NK(e,t,i,n,s,o){const r=i+s/2,a=n+o/2,l=Math.max(Math.abs(e-r)-s/2,0),h=Math.max(Math.abs(t-a)-o/2,0);return Math.sqrt(l*l+h*h)}const EK=fs;class IK extends E{constructor(e,t,i){super(),this._renderDisposeables=this._register(new N),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new oK),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new Jk({editor:this._editor},t,i)),this._computer=new MK(this._editor),this._hoverOperation=this._register(new dK(this._editor,this._computer)),this._register(this._hoverOperation.onResult((e=>{this._withResult(e.value)}))),this._register(this._editor.onDidChangeModelDecorations((()=>this._onModelDecorationsChanged()))),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(50)&&this._updateFont()}))),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return IK.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach((e=>this._editor.applyFontInfo(e)))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(0))}startShowingAt(e){this._computer.lineNumber!==e&&(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._hoverOperation.start(0))}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 e=EK("div.hover-row.markdown-hover"),t=ds(e,EK("div.hover-contents")),s=this._renderDisposeables.add(this._markdownRenderer.render(n.value));t.appendChild(s.element),i.appendChild(e)}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(),s=this._editor.getOption(66),o=i-n-(this._hover.containerDomNode.clientHeight-s)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(o),0)}px`}}IK.ID="editor.contrib.modesGlyphHoverWidget";class MK{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){const e=e=>({value:e}),t=this._editor.getLineDecorations(this._lineNumber),i=[];if(!t)return i;for(const n of t){if(!n.options.glyphMarginClassName)continue;const t=n.options.glyphMarginHoverMessage;t&&!Ra(t)&&i.push(...Zd(t).map(e))}return i}}var TK=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class RK{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}function AK(e,t,i,n){const s=e.ordered(t).map(((e,s)=>function(e,t,i,n,s){return TK(this,void 0,void 0,(function*(){try{const o=yield Promise.resolve(e.provideHover(i,n,s));if(o&&function(e){const t=void 0!==e.range,i=void 0!==e.contents&&e.contents&&e.contents.length>0;return t&&i}(o))return new RK(e,o,t)}catch(o){a(o)}}))}(e,s,t,i,n)));return cd.fromPromises(s).coalesce()}yh("_executeHoverProvider",((e,t,i)=>function(e,t,i,n){return AK(e,t,i,n).map((e=>e.hover)).toPromise()}(e.get(oL).hoverProvider,t,i,Uh.None)));var OK=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},PK=function(e,t){return function(i,n){t(i,n,e)}};const FK=fs;class BK{constructor(e,t,i,n,s){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=n,this.ordinal=s}isValidForHoverAnchor(e){return 1===e.type&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let WK=class{constructor(e,t,i,n,s){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=n,this._languageFeaturesService=s,this.hoverOrdinal=3}createLoadingMessage(e){return new BK(this,e.range,[(new Ta).appendText(ue(0,"Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||1!==e.type)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,s=i.getLineMaxColumn(n),o=[];let r=1e3;const a=i.getLineLength(n),l=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),h=this._editor.getOption(116),d=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:l});let c=!1;h>=0&&a>h&&e.range.startColumn>=h&&(c=!0,o.push(new BK(this,e.range,[{value:ue(0,"Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,r++))),!c&&"number"==typeof d&&a>=d&&o.push(new BK(this,e.range,[{value:ue(0,"Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,r++));let u=!1;for(const g of t){const t=g.range.startLineNumber===n?g.range.startColumn:1,i=g.range.endLineNumber===n?g.range.endColumn:s,a=g.options.hoverMessage;if(!a||Ra(a))continue;g.options.beforeContentClassName&&(u=!0);const l=new Rh(e.range.startLineNumber,t,e.range.startLineNumber,i);o.push(new BK(this,l,Zd(a),u,r++))}return o}computeAsync(e,t,i){if(!this._editor.hasModel()||1!==e.type)return cd.EMPTY;const n=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(n))return cd.EMPTY;const s=new Va(e.range.startLineNumber,e.range.startColumn);return AK(this._languageFeaturesService.hoverProvider,n,s,i).filter((e=>!Ra(e.hover.contents))).map((t=>{const i=t.hover.range?Rh.lift(t.hover.range):e.range;return new BK(this,i,t.hover.contents,!1,t.ordinal)}))}renderHoverParts(e,t){return VK(e,t,this._editor,this._languageService,this._openerService)}};function VK(e,t,i,n,s){t.sort(((e,t)=>e.ordinal-t.ordinal));const o=new N;for(const r of t)for(const t of r.contents){if(Ra(t))continue;const r=FK("div.hover-row.markdown-hover"),a=ds(r,FK("div.hover-contents")),l=o.add(new Jk({editor:i},n,s));o.add(l.onDidRenderAsync((()=>{a.className="hover-contents code-hover-contents",e.onContentsChanged()})));const h=o.add(l.render(t));a.appendChild(h.element),e.fragment.appendChild(r)}return o}WK=OK([PK(1,Lc),PK(2,qk),PK(3,pu),PK(4,oL)],WK);var HK=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},zK=function(e,t){return function(i,n){t(i,n,e)}};class UK{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let KK=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new U,this.onDidChange=this._onDidChange.event,this._dispoables=new N,this._markers=[],this._nextIdx=-1,an.isUri(e)?this._resourceFilter=t=>t.toString()===e.toString():e&&(this._resourceFilter=e);const n=this._configService.getValue("problems.sortOrder"),s=(e,t)=>{let i=ho(e.resource.toString(),t.resource.toString());return 0===i&&(i="position"===n?Rh.compareRangesUsingStarts(e,t)||yN.compare(e.severity,t.severity):yN.compare(e.severity,t.severity)||Rh.compareRangesUsingStarts(e,t)),i},o=()=>{this._markers=this._markerService.read({resource:an.isUri(e)?e:void 0,severities:yN.Error|yN.Warning|yN.Info}),"function"==typeof e&&(this._markers=this._markers.filter((e=>this._resourceFilter(e.resource)))),this._markers.sort(s)};o(),this._dispoables.add(t.onMarkerChanged((e=>{this._resourceFilter&&!e.some((e=>this._resourceFilter(e)))||(o(),this._nextIdx=-1,this._onDidChange.fire())})))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e||!(!this._resourceFilter||!e)&&this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new UK(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let n=!1,s=this._markers.findIndex((t=>t.resource.toString()===e.uri.toString()));s<0&&(s=Rd(this._markers,{resource:e.uri},((e,t)=>ho(e.resource.toString(),t.resource.toString()))),s<0&&(s=~s));for(let o=s;ot.resource.toString()===e.toString()));if(!(i<0))for(;i=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},YK=function(e,t){return function(i,n){t(i,n,e)}};class XK{constructor(e,t,i,n,s){this._openerService=n,this._labelService=s,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new N,this._editor=t;const o=document.createElement("div");o.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),o.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),o.appendChild(this._relatedBlock),this._disposables.add(Mn(this._relatedBlock,"click",(e=>{e.preventDefault();const t=this._relatedDiagnostics.get(e.target);t&&i(t)}))),this._scrollable=new RD(o,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll((e=>{o.style.left=`-${e.scrollLeft}px`,o.style.top=`-${e.scrollTop}px`}))),this._disposables.add(this._scrollable)}dispose(){k(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:s}=e;let o=((null==t?void 0:t.length)||0)+2;s&&(o+="string"==typeof s?s.length:s.value.length);const r=oo(i);this._lines=r.length,this._longestLineLength=0;for(const c of r)this._longestLineLength=Math.max(c.length+o,this._longestLineLength);Dn(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let a=this._messageBlock;for(const c of r)a=document.createElement("div"),a.innerText=c,""===c&&(a.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(a);if(t||s){const e=document.createElement("span");if(e.classList.add("details"),a.appendChild(e),t){const i=document.createElement("span");i.innerText=t,i.classList.add("source"),e.appendChild(i)}if(s)if("string"==typeof s){const t=document.createElement("span");t.innerText=`(${s})`,t.classList.add("code"),e.appendChild(t)}else{this._codeLink=fs("a.code-link"),this._codeLink.setAttribute("href",`${s.target.toString()}`),this._codeLink.onclick=e=>{this._openerService.open(s.target,{allowCommands:!0}),e.preventDefault(),e.stopPropagation()};ds(this._codeLink,fs("span")).innerText=s.value,e.appendChild(this._codeLink)}}if(Dn(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Hd(n)){const e=this._relatedBlock.appendChild(document.createElement("div"));e.style.paddingTop=`${Math.floor(.66*this._editor.getOption(66))}px`,this._lines+=1;for(const t of n){const i=document.createElement("div"),n=document.createElement("a");n.classList.add("filename"),n.innerText=`${this._labelService.getUriBasenameLabel(t.resource)}(${t.startLineNumber}, ${t.startColumn}): `,n.title=this._labelService.getUriLabel(t.resource),this._relatedDiagnostics.set(n,t);const s=document.createElement("span");s.innerText=t.message,i.appendChild(n),i.appendChild(s),this._lines+=1,e.appendChild(i)}}const l=this._editor.getOption(50),h=Math.ceil(l.typicalFullwidthCharacterWidth*this._longestLineLength*.75),d=l.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:h,scrollHeight:d})}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 yN.Error:t=ue(0,"Error");break;case yN.Warning:t=ue(0,"Warning");break;case yN.Info:t=ue(0,"Info");break;case yN.Hint:t=ue(0,"Hint")}let i=ue(0,"{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const n=this._editor.getModel();if(n&&e.startLineNumber<=n.getLineCount()&&e.startLineNumber>=1){i=`${n.getLineContent(e.startLineNumber)}, ${i}`}return i}}let QK=GK=class extends ZW{constructor(e,t,i,n,s,o,r){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},s),this._themeService=t,this._openerService=i,this._menuService=n,this._contextKeyService=o,this._labelService=r,this._callOnDispose=new N,this._onDidSelectRelatedInformation=new U,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=yN.Warning,this._backgroundColor=lc.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(lj);let t=ij,i=nj;this._severity===yN.Warning?(t=sj,i=oj):this._severity===yN.Info&&(t=rj,i=aj);const n=e.getColor(t),s=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:s,primaryHeadingColor:e.getColor(XW),secondaryHeadingColor:e.getColor(QW)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun((e=>this.editor.focus())));const t=[],i=this._menuService.createMenu(GK.TitleMenu,this._contextKeyService);PW(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=ds(e,fs(""))}_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 XK(this._container,this.editor,(e=>this._onDidSelectRelatedInformation.fire(e)),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=Rh.lift(e),s=this.editor.getPosition(),o=s&&n.containsPosition(s)?s:n.getStartPosition();super.show(o,this.computeRequiredHeight());const r=this.editor.getModel();if(r){const e=ue(0,i>1?"{0} of {1} problems":"{0} of {1} problem",t,i);this.setTitle(wa(r.uri),e)}this._icon.className=`codicon ${$K.className(yN.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(o,0),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()}};QK.TitleMenu=new eh("gotoErrorTitleMenu"),QK=GK=ZK([YK(1,P_),YK(2,qk),YK(3,th),YK(4,Fa),YK(5,Ol),YK(6,Zz)],QK);const JK=x_(fm,_m),ej=x_(vm,bm),tj=x_(Cm,wm),ij=Dp("editorMarkerNavigationError.background",{dark:JK,light:JK,hcDark:Mp,hcLight:Mp},ue(0,"Editor marker navigation widget error color.")),nj=Dp("editorMarkerNavigationError.headerBackground",{dark:D_(ij,.1),light:D_(ij,.1),hcDark:null,hcLight:null},ue(0,"Editor marker navigation widget error heading background.")),sj=Dp("editorMarkerNavigationWarning.background",{dark:ej,light:ej,hcDark:Mp,hcLight:Mp},ue(0,"Editor marker navigation widget warning color.")),oj=Dp("editorMarkerNavigationWarning.headerBackground",{dark:D_(sj,.1),light:D_(sj,.1),hcDark:"#0C141F",hcLight:D_(sj,.2)},ue(0,"Editor marker navigation widget warning heading background.")),rj=Dp("editorMarkerNavigationInfo.background",{dark:tj,light:tj,hcDark:Mp,hcLight:Mp},ue(0,"Editor marker navigation widget info color.")),aj=Dp("editorMarkerNavigationInfo.headerBackground",{dark:D_(rj,.1),light:D_(rj,.1),hcDark:null,hcLight:null},ue(0,"Editor marker navigation widget info heading background.")),lj=Dp("editorMarkerNavigation.background",{dark:Sm,light:Sm,hcDark:Sm,hcLight:Sm},ue(0,"Editor marker navigation widget background."));var hj,dj=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},cj=function(e,t){return function(i,n){t(i,n,e)}},uj=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let gj=hj=class{static get(e){return e.getContribution(hj.ID)}constructor(e,t,i,n,s){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=n,this._instantiationService=s,this._sessionDispoables=new N,this._editor=e,this._widgetVisible=_j.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(QK,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((e=>{var t,i,n;(null===(t=this._model)||void 0===t?void 0:t.selected)&&Rh.containsPosition(null===(i=this._model)||void 0===i?void 0:i.selected.marker,e.position)||null===(n=this._model)||void 0===n||n.resetIndex()}))),this._sessionDispoables.add(this._model.onDidChange((()=>{if(!this._widget||!this._widget.position||!this._model)return;const e=this._model.find(this._editor.getModel().uri,this._widget.position);e?this._widget.updateMarker(e.marker):this._widget.showStale()}))),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation((e=>{this._editorService.openCodeEditor({resource:e.resource,options:{pinned:!0,revealIfOpened:!0,selection:Rh.lift(e).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 Va(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}nagivate(e,t){var i,n;return uj(this,void 0,void 0,(function*(){if(this._editor.hasModel()){const s=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(s.move(e,this._editor.getModel(),this._editor.getPosition()),!s.selected)return;if(s.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const o=yield this._editorService.openCodeEditor({resource:s.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:s.selected.marker}},this._editor);o&&(null===(i=hj.get(o))||void 0===i||i.close(),null===(n=hj.get(o))||void 0===n||n.nagivate(e,t))}else this._widget.showAtMarker(s.selected.marker,s.selected.index,s.selected.total)}}))}};gj.ID="editor.contrib.markerController",gj=hj=dj([cj(1,jK),cj(2,Ol),cj(3,Wa),cj(4,Fa)],gj);class pj extends bh{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}run(e,t){var i;return uj(this,void 0,void 0,(function*(){t.hasModel()&&(null===(i=gj.get(t))||void 0===i||i.nagivate(this._next,this._multiFile))}))}}class mj extends pj{constructor(){super(!0,!1,{id:mj.ID,label:mj.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:Oh.focus,primary:578,weight:100},menuOpts:{menuId:QK.TitleMenu,title:mj.LABEL,icon:tR("marker-navigation-next",Jr.arrowDown,ue(0,"Icon for goto next marker.")),group:"navigation",order:1}})}}mj.ID="editor.action.marker.next",mj.LABEL=ue(0,"Go to Next Problem (Error, Warning, Info)");class fj extends pj{constructor(){super(!1,!1,{id:fj.ID,label:fj.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:Oh.focus,primary:1602,weight:100},menuOpts:{menuId:QK.TitleMenu,title:fj.LABEL,icon:tR("marker-navigation-previous",Jr.arrowUp,ue(0,"Icon for goto previous marker.")),group:"navigation",order:2}})}}fj.ID="editor.action.marker.prev",fj.LABEL=ue(0,"Go to Previous Problem (Error, Warning, Info)");Dh(gj.ID,gj,4),Lh(mj),Lh(fj),Lh(class extends pj{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:ue(0,"Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:Oh.focus,primary:66,weight:100},menuOpts:{menuId:eh.MenubarGoMenu,title:ue(0,"Next &&Problem"),group:"6_problem_nav",order:1}})}}),Lh(class extends pj{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:ue(0,"Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:Oh.focus,primary:1090,weight:100},menuOpts:{menuId:eh.MenubarGoMenu,title:ue(0,"Previous &&Problem"),group:"6_problem_nav",order:2}})}});const _j=new Al("markersNavigationVisible",!1);Sh(new(vh.bindToContribution(gj.get))({id:"closeMarkersNavigation",precondition:_j,handler:e=>e.close(),kbOpts:{weight:150,kbExpr:Oh.focus,primary:9,secondary:[1033]}}));var vj=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},bj=function(e,t){return function(i,n){t(i,n,e)}};const Cj=fs;class wj{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return 1===e.type&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const yj={type:1,filter:{include:wL.QuickFix},triggerAction:bL.QuickFixHover};let Sj,Lj,kj=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()||1!==e.type&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,s=i.getLineMaxColumn(n),o=[];for(const r of t){const t=r.range.startLineNumber===n?r.range.startColumn:1,a=r.range.endLineNumber===n?r.range.endColumn:s,l=this._markerDecorationsService.getMarker(i.uri,r);if(!l)continue;const h=new Rh(e.range.startLineNumber,t,e.range.startLineNumber,a);o.push(new wj(this,h,l))}return o}renderHoverParts(e,t){if(!t.length)return E.None;const i=new N;t.forEach((t=>e.fragment.appendChild(this.renderMarkerHover(t,i))));const n=1===t.length?t[0]:t.sort(((e,t)=>yN.compare(e.marker.severity,t.marker.severity)))[0];return this.renderMarkerStatusbar(e,n,i),i}renderMarkerHover(e,t){const i=Cj("div.hover-row"),n=ds(i,Cj("div.marker.hover-contents")),{source:s,message:o,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(n);const h=ds(n,Cj("span"));if(h.style.whiteSpace="pre-wrap",h.innerText=o,s||a)if(a&&"string"!=typeof a){const e=Cj("span");if(s){ds(e,Cj("span")).innerText=s}const i=ds(e,Cj("a.code-link"));i.setAttribute("href",a.target.toString()),t.add(En(i,"click",(e=>{this._openerService.open(a.target,{allowCommands:!0}),e.preventDefault(),e.stopPropagation()})));ds(i,Cj("span")).innerText=a.value;const o=ds(n,e);o.style.opacity="0.6",o.style.paddingLeft="6px"}else{const e=ds(n,Cj("span"));e.style.opacity="0.6",e.style.paddingLeft="6px",e.innerText=s&&a?`${s}(${a})`:s||`(${a})`}if(Hd(l))for(const{message:d,resource:c,startLineNumber:u,startColumn:g}of l){const e=ds(n,Cj("div"));e.style.marginTop="8px";const i=ds(e,Cj("a"));i.innerText=`${wa(c)}(${u}, ${g}): `,i.style.cursor="pointer",t.add(En(i,"click",(e=>{e.stopPropagation(),e.preventDefault(),this._openerService&&this._openerService.open(c,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:u,startColumn:g}}}).catch(r)})));const s=ds(e,Cj("span"));s.innerText=d,this._editor.applyFontInfo(s)}return i}renderMarkerStatusbar(e,t,i){if(t.marker.severity!==yN.Error&&t.marker.severity!==yN.Warning&&t.marker.severity!==yN.Info||e.statusBar.addAction({label:ue(0,"View Problem"),commandId:mj.ID,run:()=>{var i;e.hide(),null===(i=gj.get(this._editor))||void 0===i||i.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){const n=e.statusBar.append(Cj("div"));this.recentMarkerCodeActionsInfo&&(SN.makeKey(this.recentMarkerCodeActionsInfo.marker)===SN.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(n.textContent=ue(0,"No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const s=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?E.None:i.add(id((()=>n.textContent=ue(0,"Checking for quick fixes...")),200));n.textContent||(n.textContent=String.fromCharCode(160));const o=this.getCodeActions(t.marker);i.add(x((()=>o.cancel()))),o.then((o=>{if(s.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:o.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions)return o.dispose(),void(n.textContent=ue(0,"No quick fixes available"));n.style.display="none";let r=!1;i.add(x((()=>{r||o.dispose()}))),e.statusBar.addAction({label:ue(0,"Quick Fix..."),commandId:xL,run:t=>{r=!0;const i=ON.get(this._editor),n=Hn(t);e.hide(),null==i||i.showCodeActions(yj,o,{x:n.left,y:n.top,width:n.width,height:n.height})}})}),r)}}getCodeActions(e){return Yh((t=>OL(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new Rh(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),yj,_L.None,t)))}};function Dj(){return Sj}kj=vj([bj(1,AR),bj(2,qk),bj(3,oL)],kj);class xj{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){const i=void 0===t?void 0:e,n=void 0===t?e:t;return Lj({owner:i,debugName:()=>{const e=Rj(n);if(void 0!==e)return e;const t=/^\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());return t?`${this.debugName}.${t[2]}`:i?void 0:`${this.debugName} (mapped)`}},(e=>n(this.read(e),e)))}}class Nj extends xj{constructor(){super(...arguments),this.observers=new Set}addObserver(e){const t=this.observers.size;this.observers.add(e),0===t&&this.onFirstObserverAdded()}removeObserver(e){this.observers.delete(e)&&0===this.observers.size&&this.onLastObserverRemoved()}onFirstObserverAdded(){}onLastObserverRemoved(){}}function Ej(e,t){const i=new Mj(e,t);try{e(i)}finally{i.finish()}}function Ij(e,t,i){e?t(e):Ej(t,i)}class Mj{constructor(e,t){var i;this._fn=e,this._getDebugName=t,this.updatingObservers=[],null===(i=Dj())||void 0===i||i.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():Rj(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){var e;const t=this.updatingObservers;this.updatingObservers=null;for(const{observer:i,observable:n}of t)i.endUpdate(n);null===(e=Dj())||void 0===e||e.handleEndTransaction()}}function Tj(e,t,i,n){let s;if(void 0!==e){if("function"!=typeof e)return e;if(s=e(),void 0!==s)return s}if(void 0!==t&&(s=Rj(t),void 0!==s))return s;if(void 0!==i)for(const o in i)if(i[o]===n)return o}function Rj(e){const t=e.toString(),i=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(t),n=i?i[1]:void 0;return null==n?void 0:n.trim()}function Aj(e,t){return"string"==typeof e?new Oj(void 0,e,t):new Oj(e,void 0,t)}class Oj extends Nj{get debugName(){var e;return null!==(e=Tj(this._debugName,void 0,this._owner,this))&&void 0!==e?e:"ObservableValue"}constructor(e,t,i){super(),this._owner=e,this._debugName=t,this._value=i}get(){return this._value}set(e,t,i){var n;if(this._value===e)return;let s;t||(t=s=new Mj((()=>{}),(()=>`Setting ${this.debugName}`)));try{const s=this._value;this._setValue(e),null===(n=Dj())||void 0===n||n.handleObservableChanged(this,{oldValue:s,newValue:e,change:i,didChange:!0,hadValue:!0});for(const e of this.observers)t.updateObserver(e,this),e.handleChange(this,i)}finally{s&&s.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function Pj(e,t){return"string"==typeof e?new Fj(void 0,e,t):new Fj(e,void 0,t)}class Fj extends Oj{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){var e;null===(e=this._value)||void 0===e||e.dispose()}}const Bj=(e,t)=>e===t;function Wj(e,t){return void 0!==t?new zj(e,void 0,t,void 0,void 0,void 0,Bj):new zj(void 0,void 0,e,void 0,void 0,void 0,Bj)}function Vj(e,t){var i;return new zj(e.owner,e.debugName,t,void 0,void 0,void 0,null!==(i=e.equalityComparer)&&void 0!==i?i:Bj)}function Hj(e,t){let i,n;void 0===t?(i=e,n=void 0):(n=e,i=t);const s=new N;return new zj(n,(()=>{var e;return null!==(e=Rj(i))&&void 0!==e?e:"(anonymous)"}),(e=>(s.clear(),i(e,s))),void 0,void 0,(()=>s.dispose()),Bj)}!function(e){Lj=e}(Wj);class zj extends Nj{get debugName(){var e;return null!==(e=Tj(this._debugName,this._computeFn,this._owner,this))&&void 0!==e?e:"(anonymous)"}constructor(e,t,i,n,s,o=void 0,r){var a,l;super(),this._owner=e,this._debugName=t,this._computeFn=i,this.createChangeSummary=n,this._handleChange=s,this._handleLastObserverRemoved=o,this._equalityComparator=r,this.state=0,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=null===(a=this.createChangeSummary)||void 0===a?void 0:a.call(this),null===(l=Dj())||void 0===l||l.handleDerivedCreated(this)}onLastObserverRemoved(){var e;this.state=0,this.value=void 0;for(const t of this.dependencies)t.removeObserver(this);this.dependencies.clear(),null===(e=this._handleLastObserverRemoved)||void 0===e||e.call(this)}get(){var e;if(0===this.observers.size){const t=this._computeFn(this,null===(e=this.createChangeSummary)||void 0===e?void 0:e.call(this));return this.onLastObserverRemoved(),t}do{if(1===this.state)for(const e of this.dependencies)if(e.reportChanges(),2===this.state)break;1===this.state&&(this.state=3),this._recomputeIfNeeded()}while(3!==this.state);return this.value}_recomputeIfNeeded(){var e,t;if(3===this.state)return;const i=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=i;const n=0!==this.state,s=this.value;this.state=3;const o=this.changeSummary;this.changeSummary=null===(e=this.createChangeSummary)||void 0===e?void 0:e.call(this);try{this.value=this._computeFn(this,o)}finally{for(const e of this.dependenciesToBeRemoved)e.removeObserver(this);this.dependenciesToBeRemoved.clear()}const r=n&&!this._equalityComparator(s,this.value);if(null===(t=Dj())||void 0===t||t.handleDerivedRecomputed(this,{oldValue:s,newValue:this.value,change:void 0,didChange:r,hadValue:n}),r)for(const a of this.observers)a.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=1===this.updateCount;if(3===this.state&&(this.state=1,!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--,0===this.updateCount){const e=[...this.observers];for(const t of e)t.endUpdate(this)}if(this.updateCount<0)throw new f}handlePossibleChange(e){if(3===this.state&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=1;for(const e of this.observers)e.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:t=>t===e},this.changeSummary),n=3===this.state;if(i&&(1===this.state||n)&&(this.state=2,n))for(const e of this.observers)e.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)}}function Uj(e,t){return new $j(e.debugName,t,void 0,void 0)}function Kj(e){return new $j(void 0,e,void 0,void 0)}function jj(e,t){return new $j(e.debugName,t,e.createEmptyChangeSummary,e.handleChange)}function qj(e){const t=new N,i=Uj({debugName:()=>Rj(e)||"(anonymous)"},(i=>{t.clear(),e(i,t)}));return x((()=>{i.dispose(),t.dispose()}))}class $j{get debugName(){if("string"==typeof this._debugName)return this._debugName;if("function"==typeof this._debugName){const e=this._debugName();if(void 0!==e)return e}const e=Rj(this._runFn);return void 0!==e?e:"(anonymous)"}constructor(e,t,i,n){var s,o;this._debugName=e,this._runFn=t,this.createChangeSummary=i,this._handleChange=n,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=null===(s=this.createChangeSummary)||void 0===s?void 0:s.call(this),null===(o=Dj())||void 0===o||o.handleAutorunCreated(this),this._runIfNeeded(),C(this)}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear(),w(this)}_runIfNeeded(){var e,t,i;if(3===this.state)return;const n=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=n,this.state=3;try{if(!this.disposed){null===(e=Dj())||void 0===e||e.handleAutorunTriggered(this);const i=this.changeSummary;this.changeSummary=null===(t=this.createChangeSummary)||void 0===t?void 0:t.call(this),this._runFn(this,i)}}finally{null===(i=Dj())||void 0===i||i.handleAutorunFinished(this);for(const e of this.dependenciesToBeRemoved)e.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(){3===this.state&&(this.state=1),this.updateCount++}endUpdate(){if(1===this.updateCount)do{if(1===this.state){this.state=3;for(const e of this.dependencies)if(e.reportChanges(),2===this.state)break}this._runIfNeeded()}while(3!==this.state);this.updateCount--,Ul((()=>this.updateCount>=0))}handlePossibleChange(e){3===this.state&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=1)}handleChange(e,t){if(this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){(!this._handleChange||this._handleChange({changedObservable:e,change:t,didChange:t=>t===e},this.changeSummary))&&(this.state=2)}}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 Gj(e){return new Zj(e)}!function(e){e.Observer=$j}(Kj||(Kj={}));class Zj extends xj{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 Yj(e,t){return new Xj(e,t)}class Xj extends Nj{constructor(e,t){super(),this.event=e,this._getValue=t,this.hasValue=!1,this.handleEvent=e=>{var t;const i=this._getValue(e),n=!this.hasValue||this.value!==i;null===(t=Dj())||void 0===t||t.handleFromEventObservableTriggered(this,{oldValue:this.value,newValue:i,change:void 0,didChange:n,hadValue:this.hasValue}),n&&(this.value=i,this.hasValue&&Ej((e=>{for(const t of this.observers)e.updateObserver(t,this),t.handleChange(this,void 0)}),(()=>{const e=this.getDebugName();return"Event fired"+(e?`: ${e}`:"")})),this.hasValue=!0)}}getDebugName(){return Rj(this._getValue)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0,this.hasValue=!1,this.value=void 0}get(){return this.subscription?(this.hasValue||this.handleEvent(void 0),this.value):this._getValue(void 0)}}function Qj(e,t){return new Jj(e,t)}!function(e){e.Observer=Xj}(Yj||(Yj={}));class Jj extends Nj{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{Ej((e=>{for(const t of this.observers)e.updateObserver(t,this),t.handleChange(this,void 0)}),(()=>this.debugName))}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function eq(e){return"string"==typeof e?new tq(e):new tq(void 0,e)}class tq extends Nj{get debugName(){var e;return null!==(e=Tj(this._debugName,void 0,this._owner,this))&&void 0!==e?e:"Observable Signal"}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(e)for(const i of this.observers)e.updateObserver(i,this),i.handleChange(this,t);else Ej((e=>{this.trigger(e,t)}),(()=>`Trigger signal ${this.debugName}`))}get(){}}function iq(e){const t=new nq(!0);return e.addObserver(t),e.reportChanges(),x((()=>{e.removeObserver(t)}))}class nq{constructor(e){this.forceRecompute=e,this.counter=0}beginUpdate(e){this.counter++}endUpdate(e){this.counter--,0===this.counter&&this.forceRecompute&&e.reportChanges()}handlePossibleChange(e){}handleChange(e,t){}}const sq="editor.action.inlineSuggest.commit",oq="editor.action.inlineSuggest.showPrevious",rq="editor.action.inlineSuggest.showNext";var aq=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class lq extends E{constructor(e,t,i={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new G),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new N),this.options=i,this.lookupKeybindings="function"==typeof this.options.getKeyBinding,this.toggleMenuAction=this._register(new hq((()=>{var e;return null===(e=this.toggleMenuActionViewItem)||void 0===e?void 0:e.show()}),i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new Rx(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,actionViewItemProvider:(e,n)=>{var s;if(e.id===hq.ID)return this.toggleMenuActionViewItem=new TW(e,e.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:ta.asClassNameArray(null!==(s=i.moreIcon)&&void 0!==s?s:Jr.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const t=i.actionViewItemProvider(e,n);if(t)return t}if(e instanceof $a){const i=new TW(e,e.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:e.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry});return i.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(i),this.disposables.add(this._onDidChangeDropdownVisibility.add(i.onDidChangeVisibility)),i}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,t){this.clear();const i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.forEach((e=>{this.actionBar.push(e,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(e)})}))}getKeybindingLabel(e){var t,i,n;const s=this.lookupKeybindings?null===(i=(t=this.options).getKeyBinding)||void 0===i?void 0:i.call(t,e):void 0;return null!==(n=null==s?void 0:s.getLabel())&&void 0!==n?n:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class hq extends Ka{constructor(e,t){t=t||ue(0,"More Actions..."),super(hq.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}run(){return aq(this,void 0,void 0,(function*(){this.toggleDropdownMenu()}))}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}hq.ID="toolbar.toggle.more";var dq=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},cq=function(e,t){return function(i,n){t(i,n,e)}};let uq=class extends lq{constructor(e,t,i,n,s,o,r){super(e,s,Object.assign(Object.assign({getKeyBinding:e=>{var t;return null!==(t=o.lookupKeybinding(e.id))&&void 0!==t?t:void 0}},t),{allowContextMenu:!0,skipTelemetry:"string"==typeof(null==t?void 0:t.telemetrySource)})),this._options=t,this._menuService=i,this._contextKeyService=n,this._contextMenuService=s,this._sessionDisposables=this._store.add(new N);const a=null==t?void 0:t.telemetrySource;a&&this._store.add(this.actionBar.onDidRun((e=>r.publicLog2("workbenchActionExecuted",{id:e.action.id,from:a}))))}setActions(e,t=[],i){var n,s,o;this._sessionDisposables.clear();const r=e.slice(),a=t.slice(),l=[];let h=0;const d=[];let c=!1;if(-1!==(null===(n=this._options)||void 0===n?void 0:n.hiddenItemStrategy))for(let u=0;unull==e?void 0:e.id))),t=this._options.overflowBehavior.maxItems-e.size;let i=0;for(let n=0;n=t&&(r[n]=void 0,d[n]=s))}}Wd(r),Wd(d),super.setActions(r,qa.join(d,a)),l.length>0&&this._sessionDisposables.add(En(this.getElement(),"contextmenu",(e=>{var t,n,s,o,r;const a=new Nt(e),d=this.getItemAction(a.target);if(!d)return;a.preventDefault(),a.stopPropagation();let u,g=!1;if(1===h&&0===(null===(t=this._options)||void 0===t?void 0:t.hiddenItemStrategy)){g=!0;for(let e=0;ethis._menuService.resetHiddenStates(i)}))),this._contextMenuService.showContextMenu({getAnchor:()=>a,getActions:()=>p,menuId:null===(s=this._options)||void 0===s?void 0:s.contextMenu,menuActionOptions:Object.assign({renderShortTitle:!0},null===(o=this._options)||void 0===o?void 0:o.menuOptions),skipTelemetry:"string"==typeof(null===(r=this._options)||void 0===r?void 0:r.telemetrySource),contextKeyService:this._contextKeyService})})))}};uq=dq([cq(2,th),cq(3,Ol),cq(4,Kx),cq(5,WL),cq(6,lh)],uq);var gq,pq=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},mq=function(e,t){return function(i,n){t(i,n,e)}};let fq=class extends E{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=Yj(this.editor.onDidChangeConfiguration,(()=>"always"===this.editor.getOption(62).showToolbar)),this.sessionPosition=void 0,this.position=Wj(this,(e=>{var t,i,n;const s=null===(t=this.model.read(e))||void 0===t?void 0:t.ghostText.read(e);if(!this.alwaysShowToolbar.read(e)||!s||0===s.parts.length)return this.sessionPosition=void 0,null;const o=s.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==s.lineNumber&&(this.sessionPosition=void 0);const r=new Va(s.lineNumber,Math.min(o,null!==(n=null===(i=this.sessionPosition)||void 0===i?void 0:i.column)&&void 0!==n?n:Number.MAX_SAFE_INTEGER));return this.sessionPosition=r,r})),this._register(qj(((t,i)=>{const n=this.model.read(t);if(!n||!this.alwaysShowToolbar.read(t))return;const s=i.add(this.instantiationService.createInstance(bq,this.editor,!0,this.position,n.selectedInlineCompletionIndex,n.inlineCompletionsCount,n.selectedInlineCompletion.map((e=>{var t;return null!==(t=null==e?void 0:e.inlineCompletion.source.inlineCompletions.commands)&&void 0!==t?t:[]}))));e.addContentWidget(s),i.add(x((()=>e.removeContentWidget(s)))),i.add(Kj((e=>{this.position.read(e)&&n.lastTriggerKind.read(e)!==pC.Explicit&&n.triggerExplicitly()})))})))}};fq=pq([mq(2,Fa)],fq);const _q=tR("inline-suggestion-hints-next",Jr.chevronRight,ue(0,"Icon for show next parameter hint.")),vq=tR("inline-suggestion-hints-previous",Jr.chevronLeft,ue(0,"Icon for show previous parameter hint."));let bq=gq=class extends E{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const n=new Ka(e,t,i,!0,(()=>this._commandService.executeCommand(e))),s=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let o=t;return s&&(o=ue(0,"{0} ({1})",t,s.getLabel())),n.tooltip=o,n}constructor(e,t,i,n,s,o,r,a,l,h,d){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=n,this._suggestionCount=s,this._extraCommands=o,this._commandService=r,this.keybindingService=l,this._contextKeyService=h,this._menuService=d,this.id="InlineSuggestionHintsContentWidget"+gq.id++,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=Ns("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[Ns("div@toolBar")]),this.previousAction=this.createCommandAction(oq,ue(0,"Previous"),ta.asClassName(vq)),this.availableSuggestionCountAction=new Ka("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(rq,ue(0,"Next"),ta.asClassName(_q)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(eh.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new rd((()=>{this.availableSuggestionCountAction.label=""}),100)),this.disableButtonsDebounced=this._register(new rd((()=>{this.previousAction.enabled=this.nextAction.enabled=!1}),100)),this.lastCommands=[],this.toolBar=this._register(a.createInstance(yq,this.nodes.toolBar,eh.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:e=>e.startsWith("primary")},actionViewItemProvider:(e,t)=>{if(e instanceof oh)return a.createInstance(wq,e,void 0);if(e===this.availableSuggestionCountAction){const t=new Cq(void 0,e,{label:!0,icon:!1});return t.setClass("availableSuggestionCount"),t}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility((e=>{gq._dropDownVisible=e}))),this._register(Kj((e=>{this._position.read(e),this.editor.layoutContentWidget(this)}))),this._register(Kj((e=>{const t=this._suggestionCount.read(e),i=this._currentSuggestionIdx.read(e);void 0!==t?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${i+1}/${t}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),void 0!==t&&t>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()}))),this._register(Kj((e=>{const t=this._extraCommands.read(e);if(Td(this.lastCommands,t))return;this.lastCommands=t;const i=t.map((e=>({class:void 0,id:e.id,enabled:!0,tooltip:e.tooltip||"",label:e.title,run:t=>this._commandService.executeCommand(e.id)})));for(const[n,s]of this.inlineCompletionsActionsMenus.getActions())for(const e of s)e instanceof oh&&i.push(e);i.length>0&&i.unshift(new qa),this.toolBar.setAdditionalSecondaryActions(i)})))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};bq._dropDownVisible=!1,bq.id=0,bq=gq=pq([mq(6,Ya),mq(7,Fa),mq(8,WL),mq(9,Ol),mq(10,th)],bq);class Cq extends Ix{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}}class wq extends BW{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=Ns("div.keybinding").root;new zx(t,$e,Object.assign({disableTitle:!0},Hx)).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}}let yq=class extends uq{constructor(e,t,i,n,s,o,r,a){super(e,Object.assign({resetMenu:t},i),n,s,o,r,a),this.menuId=t,this.options2=i,this.menuService=n,this.contextKeyService=s,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(){var e,t,i,n,s,o,r;const a=[],l=[];PW(this.menu,null===(e=this.options2)||void 0===e?void 0:e.menuOptions,{primary:a,secondary:l},null===(i=null===(t=this.options2)||void 0===t?void 0:t.toolbarOptions)||void 0===i?void 0:i.primaryGroup,null===(s=null===(n=this.options2)||void 0===n?void 0:n.toolbarOptions)||void 0===s?void 0:s.shouldInlineSubmenu,null===(r=null===(o=this.options2)||void 0===o?void 0:o.toolbarOptions)||void 0===r?void 0:r.useSeparatorsInPrimaryActions),l.push(...this.additionalActions),a.unshift(...this.prependedPrimaryActions),this.setActions(a,l)}setPrependedPrimaryActions(e){Td(this.prependedPrimaryActions,e,((e,t)=>e===t))||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Td(this.additionalActions,e,((e,t)=>e===t))||(this.additionalActions=e,this.updateToolbar())}};yq=pq([mq(3,th),mq(4,Ol),mq(5,Kx),mq(6,WL),mq(7,lh)],yq);var Sq,Lq=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},kq=function(e,t){return function(i,n){t(i,n,e)}};const Dq=!1;let xq=Sq=class extends E{static get(e){return e.getContribution(Sq.ID)}constructor(e,t,i,n,s){super(),this._editor=e,this._instantiationService=t,this._openerService=i,this._languageService=n,this._keybindingService=s,this._toUnhook=new N,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new rd((()=>this._reactToEditorMouseMove(this._mouseMoveEvent)),0)),this._hookEvents(),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(60)&&(this._unhookEvents(),this._hookEvents())}))),this._register(this._editor.onMouseLeave((()=>{this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()})))}_hookEvents(){const e=this._editor.getOption(60);this._isHoverEnabled=e.enabled,this._isHoverSticky=e.sticky,this._hidingDelay=e.hidingDelay,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown((e=>this._onEditorMouseDown(e)))),this._toUnhook.add(this._editor.onMouseUp((e=>this._onEditorMouseUp(e)))),this._toUnhook.add(this._editor.onMouseMove((e=>this._onEditorMouseMove(e)))),this._toUnhook.add(this._editor.onKeyDown((e=>this._onKeyDown(e))))):(this._toUnhook.add(this._editor.onMouseMove((e=>this._onEditorMouseMove(e)))),this._toUnhook.add(this._editor.onKeyDown((e=>this._onKeyDown(e))))),this._toUnhook.add(this._editor.onMouseLeave((e=>this._onEditorMouseLeave(e)))),this._toUnhook.add(this._editor.onDidChangeModel((()=>this._hideWidgets()))),this._toUnhook.add(this._editor.onDidScrollChange((e=>this._onEditorScrollChanged(e))))}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){var t;this._isMouseDown=!0;const i=e.target;9!==i.type||i.detail!==kK.ID?12===i.type&&i.detail===IK.ID||(12!==i.type&&(this._hoverClicked=!1),(null===(t=this._contentWidget)||void 0===t?void 0:t.widget.isResizing)||this._hideWidgets()):this._hoverClicked=!0}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseLeave(e){var t,i;const n=e.event.browserEvent.relatedTarget;(null===(t=this._contentWidget)||void 0===t?void 0:t.widget.isResizing)||(null===(i=this._contentWidget)||void 0===i?void 0:i.containsNode(n))||this._hideWidgets()}_isMouseOverWidget(e){var t,i,n,s,o;const r=e.target;return!(!this._isHoverSticky||9!==r.type||r.detail!==kK.ID)||(!(!this._isHoverSticky||!(null===(t=this._contentWidget)||void 0===t?void 0:t.containsNode(null===(i=e.event.browserEvent.view)||void 0===i?void 0:i.document.activeElement))||(null===(s=null===(n=e.event.browserEvent.view)||void 0===n?void 0:n.getSelection())||void 0===s?void 0:s.isCollapsed))||(!(this._isHoverSticky||9!==r.type||r.detail!==kK.ID||!(null===(o=this._contentWidget)||void 0===o?void 0:o.isColorPickerVisible))||!(!this._isHoverSticky||12!==r.type||r.detail!==IK.ID)))}_onEditorMouseMove(e){var t,i,n,s;if(this._mouseMoveEvent=e,(null===(t=this._contentWidget)||void 0===t?void 0:t.isFocused)||(null===(i=this._contentWidget)||void 0===i?void 0:i.isResizing))return;if(this._isMouseDown&&this._hoverClicked)return;if(this._isHoverSticky&&(null===(n=this._contentWidget)||void 0===n?void 0:n.isVisibleFromKeyboard))return;this._isMouseOverWidget(e)?this._reactToEditorMouseMoveRunner.cancel():(null===(s=this._contentWidget)||void 0===s?void 0:s.isVisible)&&this._isHoverSticky&&this._hidingDelay>0?this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hidingDelay):this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t,i,n;if(!e)return;const s=e.target,o=null===(t=s.element)||void 0===t?void 0:t.classList.contains("colorpicker-color-decoration"),r=this._editor.getOption(146);if(o&&("click"===r&&!this._hoverActivatedByColorDecoratorClick||"hover"===r&&!this._isHoverEnabled||"clickAndHover"===r&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)||!o&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)return void this._hideWidgets();if(this._getOrCreateContentWidget().maybeShowAt(e))null===(i=this._glyphWidget)||void 0===i||i.hide();else{if(2===s.type&&s.position)return null===(n=this._contentWidget)||void 0===n||n.hide(),this._glyphWidget||(this._glyphWidget=new IK(this._editor,this._languageService,this._openerService)),void this._glyphWidget.startShowingAt(s.position.lineNumber);Dq,this._hideWidgets()}}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const i=this._keybindingService.softDispatch(e,this._editor.getDomNode()),n=1===i.kind||2===i.kind&&"editor.action.showHover"===i.commandId&&(null===(t=this._contentWidget)||void 0===t?void 0:t.isVisible);5===e.keyCode||6===e.keyCode||57===e.keyCode||4===e.keyCode||n||this._hideWidgets()}_hideWidgets(){var e,t,i;this._isMouseDown&&this._hoverClicked&&(null===(e=this._contentWidget)||void 0===e?void 0:e.isColorPickerVisible)||bq.dropDownVisible||(this._hoverActivatedByColorDecoratorClick=!1,this._hoverClicked=!1,null===(t=this._glyphWidget)||void 0===t||t.hide(),null===(i=this._contentWidget)||void 0===i||i.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(wK,this._editor)),this._contentWidget}showContentHover(e,t,i,n,s=!1){this._hoverActivatedByColorDecoratorClick=s,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,n)}focus(){var e;null===(e=this._contentWidget)||void 0===e||e.focus()}scrollUp(){var e;null===(e=this._contentWidget)||void 0===e||e.scrollUp()}scrollDown(){var e;null===(e=this._contentWidget)||void 0===e||e.scrollDown()}scrollLeft(){var e;null===(e=this._contentWidget)||void 0===e||e.scrollLeft()}scrollRight(){var e;null===(e=this._contentWidget)||void 0===e||e.scrollRight()}pageUp(){var e;null===(e=this._contentWidget)||void 0===e||e.pageUp()}pageDown(){var e;null===(e=this._contentWidget)||void 0===e||e.pageDown()}goToTop(){var e;null===(e=this._contentWidget)||void 0===e||e.goToTop()}goToBottom(){var e;null===(e=this._contentWidget)||void 0===e||e.goToBottom()}get isColorPickerVisible(){var e;return null===(e=this._contentWidget)||void 0===e?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return null===(e=this._contentWidget)||void 0===e?void 0:e.isVisible}dispose(){var e,t;super.dispose(),this._unhookEvents(),this._toUnhook.dispose(),null===(e=this._glyphWidget)||void 0===e||e.dispose(),null===(t=this._contentWidget)||void 0===t||t.dispose()}};xq.ID="editor.contrib.hover",xq=Sq=Lq([kq(1,Fa),kq(2,qk),kq(3,Lc),kq(4,WL)],xq);Dh(xq.ID,xq,2),Lh(class extends bh{constructor(){super({id:"editor.action.showHover",label:ue(0,"Show or Focus Hover"),description:{description:"Show or Focus Hover",args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if when triggered with the keyboard, the hover should take focus immediately.",type:"boolean",default:!1}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const n=xq.get(t);if(!n)return;const s=t.getPosition(),o=new Rh(s.lineNumber,s.column,s.lineNumber,s.column),r=2===t.getOption(2)||!!(null==i?void 0:i.focus);n.isHoverVisible?n.focus():n.showContentHover(o,1,1,r)}}),Lh(class extends bh{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:ue(0,"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){const i=xq.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const s=new Rh(n.lineNumber,n.column,n.lineNumber,n.column),o=nK.get(t);if(!o)return;o.startFindDefinitionFromCursor(n).then((()=>{i.showContentHover(s,1,1,!0)}))}}),Lh(class extends bh{constructor(){super({id:"editor.action.scrollUpHover",label:ue(0,"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:Oh.hoverFocused,kbOpts:{kbExpr:Oh.hoverFocused,primary:16,weight:100}})}run(e,t){const i=xq.get(t);i&&i.scrollUp()}}),Lh(class extends bh{constructor(){super({id:"editor.action.scrollDownHover",label:ue(0,"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:Oh.hoverFocused,kbOpts:{kbExpr:Oh.hoverFocused,primary:18,weight:100}})}run(e,t){const i=xq.get(t);i&&i.scrollDown()}}),Lh(class extends bh{constructor(){super({id:"editor.action.scrollLeftHover",label:ue(0,"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:Oh.hoverFocused,kbOpts:{kbExpr:Oh.hoverFocused,primary:15,weight:100}})}run(e,t){const i=xq.get(t);i&&i.scrollLeft()}}),Lh(class extends bh{constructor(){super({id:"editor.action.scrollRightHover",label:ue(0,"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:Oh.hoverFocused,kbOpts:{kbExpr:Oh.hoverFocused,primary:17,weight:100}})}run(e,t){const i=xq.get(t);i&&i.scrollRight()}}),Lh(class extends bh{constructor(){super({id:"editor.action.pageUpHover",label:ue(0,"Page Up Hover"),alias:"Page Up Hover",precondition:Oh.hoverFocused,kbOpts:{kbExpr:Oh.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const i=xq.get(t);i&&i.pageUp()}}),Lh(class extends bh{constructor(){super({id:"editor.action.pageDownHover",label:ue(0,"Page Down Hover"),alias:"Page Down Hover",precondition:Oh.hoverFocused,kbOpts:{kbExpr:Oh.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const i=xq.get(t);i&&i.pageDown()}}),Lh(class extends bh{constructor(){super({id:"editor.action.goToTopHover",label:ue(0,"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:Oh.hoverFocused,kbOpts:{kbExpr:Oh.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const i=xq.get(t);i&&i.goToTop()}}),Lh(class extends bh{constructor(){super({id:"editor.action.goToBottomHover",label:ue(0,"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:Oh.hoverFocused,kbOpts:{kbExpr:Oh.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const i=xq.get(t);i&&i.goToBottom()}}),gK.register(WK),gK.register(kj),H_(((e,t)=>{const i=e.getColor(Zm);i&&(t.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${i.transparent(.5)}; }`),t.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${i.transparent(.5)}; }`),t.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${i.transparent(.5)}; }`))}));class Nq extends E{constructor(e){super(),this._editor=e,this._register(e.onMouseDown((e=>this.onMouseDown(e))))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(146);if("click"!==t&&"clickAndHover"!==t)return;const i=e.target;if(6!==i.type)return;if(!i.detail.injectedText)return;if(i.detail.injectedText.options.attachedData!==GT)return;if(!i.range)return;const n=this._editor.getContribution(xq.ID);if(n&&!n.isColorPickerVisible){const e=new Rh(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);n.showContentHover(e,1,0,!1,!0)}}}Nq.ID="editor.contrib.colorContribution",Dh(Nq.ID,Nq,2),gK.register(wR);var Eq,Iq,Mq=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Tq=function(e,t){return function(i,n){t(i,n,e)}},Rq=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let Aq=Eq=class extends E{constructor(e,t,i,n,s,o,r){super(),this._editor=e,this._modelService=i,this._keybindingService=n,this._instantiationService=s,this._languageFeatureService=o,this._languageConfigurationService=r,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=Oh.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=Oh.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){var e;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||null===(e=this._standaloneColorPickerWidget)||void 0===e||e.focus():this._standaloneColorPickerWidget=new Oq(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),null===(e=this._standaloneColorPickerWidget)||void 0===e||e.hide(),this._editor.focus()}insertColor(){var e;null===(e=this._standaloneColorPickerWidget)||void 0===e||e.updateEditor(),this.hide()}static get(e){return e.getContribution(Eq.ID)}};Aq.ID="editor.contrib.standaloneColorPickerController",Aq=Eq=Mq([Tq(1,Ol),Tq(2,Ha),Tq(3,WL),Tq(4,Fa),Tq(5,oL),Tq(6,Ju)],Aq),Dh(Aq.ID,Aq,1);let Oq=Iq=class extends E{constructor(e,t,i,n,s,o,r,a){var l;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._modelService=s,this._keybindingService=o,this._languageFeaturesService=r,this._languageConfigurationService=a,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new U),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=n.createInstance(SR,this._editor),this._position=null===(l=this._editor._getViewModel())||void 0===l?void 0:l.getPrimaryCursorState().modelState.position;const h=this._editor.getSelection(),d=h?{startLineNumber:h.startLineNumber,startColumn:h.startColumn,endLineNumber:h.endLineNumber,endColumn:h.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},c=this._register(hs(this._body));this._register(c.onDidBlur((e=>{this.hide()}))),this._register(c.onDidFocus((e=>{this.focus()}))),this._register(this._editor.onDidChangeCursorPosition((()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()}))),this._register(this._editor.onMouseMove((e=>{var t;const i=null===(t=e.target.element)||void 0===t?void 0:t.classList;i&&i.contains("colorpicker-color-decoration")&&this.hide()}))),this._register(this.onResult((e=>{this._render(e.value,e.foundInEditor)}))),this._start(d),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return Iq.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(60).above;return{position:this._position,secondaryPosition:this._position,preference:e?[1,2]:[2,1],positionAffinity:2}}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()}_start(e){return Rq(this,void 0,void 0,(function*(){const t=yield this._computeAsync(e);t&&this._onResult.fire(new Pq(t.result,t.foundInEditor))}))}_computeAsync(e){return Rq(this,void 0,void 0,(function*(){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=yield this._standaloneColorPickerParticipant.createColorHover(t,new AT(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null}))}_render(e,t){const i=document.createDocumentFragment();let n;const s={fragment:i,statusBar:this._register(new DK(this._keybindingService)),setColorPicker:e=>n=e,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(s,[e])),void 0===n)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(.66*this._editor.getLayoutInfo().width,500)+"px",this._body.tabIndex=0,this._body.appendChild(i),n.layout();const o=n.body,r=o.saturationBox.domNode.clientWidth,a=o.domNode.clientWidth-r-22-8,l=n.body.enterButton;null==l||l.onClicked((()=>{this.updateEditor(),this.hide()}));const h=n.header;h.pickedColorNode.style.width=r+8+"px";h.originalColorNode.style.width=a+"px";const d=n.header.closeButton;null==d||d.onClicked((()=>{this.hide()})),t&&(l&&(l.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};Oq.ID="editor.contrib.standaloneColorPickerWidget",Oq=Iq=Mq([Tq(3,Fa),Tq(4,Ha),Tq(5,WL),Tq(6,oL),Tq(7,Ju)],Oq);class Pq{constructor(e,t){this.value=e,this.foundInEditor=t}}Lh(class extends bh{constructor(){super({id:"editor.action.hideColorPicker",label:ue(0,"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:Oh.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var i;null===(i=Aq.get(t))||void 0===i||i.hide()}}),Lh(class extends bh{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:ue(0,"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:Oh.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var i;null===(i=Aq.get(t))||void 0===i||i.insertColor()}}),ah(class extends wh{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{value:ue(0,"Show or Focus Standalone Color Picker"),mnemonicTitle:ue(0,"&&Show or Focus Standalone Color Picker"),original:"Show or Focus Standalone Color Picker"},precondition:void 0,menu:[{id:eh.CommandPalette}]})}runEditorCommand(e,t){var i;null===(i=Aq.get(t))||void 0===i||i.showOrFocus()}});class Fq{static insert(e,t){return{range:new Rh(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}class Bq{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;if(i+n>e.length)return!1;for(let s=0;s=65&&n<=90&&n+32===o||o>=65&&o<=90&&o+32===n))return!1}return!0}_createOperationsForBlockComment(e,t,i,n,s,o){const r=e.startLineNumber,a=e.startColumn,l=e.endLineNumber,h=e.endColumn,d=s.getLineContent(r),c=s.getLineContent(l);let u,g=d.lastIndexOf(t,a-1+t.length),p=c.indexOf(i,h-1-i.length);if(-1!==g&&-1!==p)if(r===l){d.substring(g+t.length,p).indexOf(i)>=0&&(g=-1,p=-1)}else{const e=d.substring(g+t.length),n=c.substring(0,p);(e.indexOf(i)>=0||n.indexOf(i)>=0)&&(g=-1,p=-1)}-1!==g&&-1!==p?(n&&g+t.length0&&32===c.charCodeAt(p-1)&&(i=" "+i,p-=1),u=Bq._createRemoveBlockCommentOperations(new Rh(r,g+t.length+1,l,p+1),t,i)):(u=Bq._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=1===u.length?i:null);for(const m of u)o.addTrackedEditOperation(m.range,m.text)}static _createRemoveBlockCommentOperations(e,t,i){const n=[];return Rh.isEmpty(e)?n.push(Fq.delete(new Rh(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(n.push(Fq.delete(new Rh(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),n.push(Fq.delete(new Rh(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),n}static _createAddBlockCommentOperations(e,t,i,n){const s=[];return Rh.isEmpty(e)?s.push(Fq.replace(new Rh(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(s.push(Fq.insert(new Va(e.startLineNumber,e.startColumn),t+(n?" ":""))),s.push(Fq.insert(new Va(e.endLineNumber,e.endColumn),(n?" ":"")+i))),s}getEditOperations(e,t){const i=this._selection.startLineNumber,n=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const s=e.getLanguageIdAtPosition(i,n),o=this.languageConfigurationService.getLanguageConfiguration(s).comments;o&&o.blockCommentStartToken&&o.blockCommentEndToken&&this._createOperationsForBlockComment(this._selection,o.blockCommentStartToken,o.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(2===i.length){const e=i[0],t=i[1];return new Ah(e.range.endLineNumber,e.range.endColumn,t.range.startLineNumber,t.range.startColumn)}{const e=i[0].range,t=this._usedEndToken?-this._usedEndToken.length-1:0;return new Ah(e.endLineNumber,e.endColumn+t,e.endLineNumber,e.endColumn+t)}}}class Wq{constructor(e,t,i,n,s,o,r){this.languageConfigurationService=e,this._selection=t,this._tabSize=i,this._type=n,this._insertSpace=s,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=o,this._ignoreFirstLine=r||!1}static _gatherPreflightCommentStrings(e,t,i,n){e.tokenization.tokenizeIfCheap(t);const s=e.getLanguageIdAtPosition(t,1),o=n.getLanguageConfiguration(s).comments,r=o?o.lineCommentToken:null;if(!r)return null;const a=[];for(let l=0,h=i-t+1;lr?s-1:s}}}class Vq extends bh{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(Ju);if(!t.hasModel())return;const n=[],s=t.getModel().getOptions(),o=t.getOption(23),r=t.getSelections().map(((e,t)=>({selection:e,index:t,ignoreFirstLine:!1})));r.sort(((e,t)=>Rh.compareRangesUsingStarts(e.selection,t.selection)));let a=r[0];for(let l=1;l=0;t--,this._valueLen--){const e=this._value.charCodeAt(t);if(!(47===e||this._splitOnBackslash&&92===e))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new qq(new Kq(e,t))}static forStrings(){return new qq(new Hq)}static forConfigKeys(){return new qq(new zq)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let n;this._root||(this._root=new jq,this._root.segment=i.value());const s=[];for(n=this._root;;){const e=i.cmp(n.segment);if(e>0)n.left||(n.left=new jq,n.left.segment=i.value()),s.push([-1,n]),n=n.left;else if(e<0)n.right||(n.right=new jq,n.right.segment=i.value()),s.push([1,n]),n=n.right;else{if(!i.hasNext())break;i.next(),n.mid||(n.mid=new jq,n.mid.segment=i.value()),s.push([0,n]),n=n.mid}}const o=n.value;n.value=t,n.key=e;for(let r=s.length-1;r>=0;r--){const e=s[r][1];e.updateHeight();const t=e.balanceFactor();if(t<-1||t>1){const t=s[r][0],i=s[r+1][0];if(1===t&&1===i)s[r][1]=e.rotateLeft();else if(-1===t&&-1===i)s[r][1]=e.rotateRight();else if(1===t&&-1===i)e.right=s[r+1][1]=s[r+1][1].rotateRight(),s[r][1]=e.rotateLeft();else{if(-1!==t||1!==i)throw new Error;e.left=s[r+1][1]=s[r+1][1].rotateLeft(),s[r][1]=e.rotateRight()}if(r>0)switch(s[r-1][0]){case-1:s[r-1][1].left=s[r][1];break;case 1:s[r-1][1].right=s[r][1];break;case 0:s[r-1][1].mid=s[r][1]}else this._root=s[0][1]}}return o}get(e){var t;return null===(t=this._getNode(e))||void 0===t?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const e=t.cmp(i.segment);if(e>0)i=i.left;else if(e<0)i=i.right;else{if(!t.hasNext())break;t.next(),i=i.mid}}return i}has(e){const t=this._getNode(e);return!(void 0===(null==t?void 0:t.value)&&void 0===(null==t?void 0:t.mid))}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){var i;const n=this._iter.reset(e),s=[];let o=this._root;for(;o;){const e=n.cmp(o.segment);if(e>0)s.push([-1,o]),o=o.left;else if(e<0)s.push([1,o]),o=o.right;else{if(!n.hasNext())break;n.next(),s.push([0,o]),o=o.mid}}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 e=this._min(o.right);if(e.key){const{key:t,value:i,segment:n}=e;this._delete(e.key,!1),o.key=t,o.value=i,o.segment=n}}else{const e=null!==(i=o.left)&&void 0!==i?i:o.right;if(s.length>0){const[t,i]=s[s.length-1];switch(t){case-1:i.left=e;break;case 0:i.mid=e;break;case 1:i.right=e}}else this._root=e}for(let e=s.length-1;e>=0;e--){const t=s[e][1];t.updateHeight();const i=t.balanceFactor();if(i>1?(t.right.balanceFactor()>=0||(t.right=t.right.rotateRight()),s[e][1]=t.rotateLeft()):i<-1&&(t.left.balanceFactor()<=0||(t.left=t.left.rotateLeft()),s[e][1]=t.rotateRight()),e>0)switch(s[e-1][0]){case-1:s[e-1][1].left=s[e][1];break;case 1:s[e-1][1].right=s[e][1];break;case 0:s[e-1][1].mid=s[e][1]}else this._root=s[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let i,n=this._root;for(;n;){const e=t.cmp(n.segment);if(e>0)n=n.left;else if(e<0)n=n.right;else{if(!t.hasNext())break;t.next(),i=n.value||i,n=n.mid}}return n&&n.value||i}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let n=this._root;for(;n;){const e=i.cmp(n.segment);if(e>0)n=n.left;else if(e<0)n=n.right;else{if(!i.hasNext())return n.mid?this._entries(n.mid):t?n.value:void 0;i.next(),n=n.mid}}}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))}}const $q=Ba("contextService");function Gq(e){const t=e;return"string"==typeof(null==t?void 0:t.id)&&an.isUri(t.uri)}function Zq(e){const t=e;return"string"==typeof(null==t?void 0:t.id)&&!Gq(e)&&!function(e){const t=e;return"string"==typeof(null==t?void 0:t.id)&&an.isUri(t.configPath)}(e)}const Yq={id:"ext-dev"},Xq={id:"empty-window"};class Qq{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}const Jq="code-workspace",e$=(ue(0,"Code Workspace"),"4064f6ec-cb38-4ad0-af64-ee6467e63c82");var t$,i$=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},n$=function(e,t){return function(i,n){t(i,n,e)}};let s$,o$=t$=class{static get(e){return e.getContribution(t$.ID)}constructor(e,t,i,n,s,o,r,a){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=n,this._keybindingService=s,this._menuService=o,this._configurationService=r,this._workspaceContextService=a,this._toDispose=new N,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu((e=>this._onContextMenu(e)))),this._toDispose.add(this._editor.onMouseWheel((e=>{if(this._contextMenuIsBeingShownCount>0){const t=this._contextViewService.getContextViewElement(),i=e.srcElement;i.shadowRoot&&Yn(t)===i.shadowRoot||this._contextViewService.hideContextView()}}))),this._toDispose.add(this._editor.onKeyDown((e=>{this._editor.getOption(24)&&58===e.keyCode&&(e.preventDefault(),e.stopPropagation(),this.showContextMenu())})))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(24))return this._editor.focus(),void(e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position));if(12===e.target.type)return;if(6===e.target.type&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),11===e.target.type)return this._showScrollbarContextMenu(e.event);if(6!==e.target.type&&7!==e.target.type&&1!==e.target.type)return;if(this._editor.focus(),e.target.position){let t=!1;for(const i of this._editor.getSelections())if(i.containsPosition(e.target.position)){t=!0;break}t||this._editor.setPosition(e.target.position)}let t=null;1!==e.target.type&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(24))return;if(!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?eh.SimpleEditorContext:eh.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],n=this._menuService.createMenu(t,this._contextKeyService),s=n.getActions({arg:e.uri});n.dispose();for(const o of s){const[,t]=o;let n=0;for(const s of t)if(s instanceof sh){const t=this._getMenuActions(e,s.item.submenu);t.length>0&&(i.push(new $a(s.id,s.label,t)),n++)}else i.push(s),n++;n&&i.push(new qa)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const i=this._editor.getOption(60);this._editor.updateOptions({hover:{enabled:!1}});let n=t;if(!n){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const e=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),t=Hn(this._editor.getDomNode()),i=t.left+e.left,s=t.top+e.top+e.height;n={x:i,y:s}}const s=this._editor.getOption(126)&&!He;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:s?this._editor.getDomNode():void 0,getAnchor:()=>n,getActions:()=>e,getActionViewItem:e=>{const t=this._keybindingFor(e);if(t)return new Ix(e,e,{label:!0,keybinding:t.getLabel(),isMenu:!0});const i=e;return"function"==typeof i.getActionViewItem?i.getActionViewItem():new Ix(e,e,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:e=>this._keybindingFor(e),onHide:e=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:i})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel())return;if(this._workspaceContextService.getWorkspace().id===e$)return;const t=this._editor.getOption(72);let i=0;const n=e=>({id:"menu-action-"+ ++i,label:e.label,tooltip:"",class:void 0,enabled:void 0===e.enabled||e.enabled,checked:e.checked,run:e.run}),s=(e,t,s,o,r)=>{if(!t)return n({label:e,enabled:t,run:()=>{}});const a=e=>()=>{this._configurationService.updateValue(s,e)},l=[];for(const i of r)l.push(n({label:i.label,checked:o===i.value,run:a(i.value)}));return((e,t)=>new $a("menu-action-"+ ++i,e,t,void 0))(e,l)},o=[];o.push(n({label:ue(0,"Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),o.push(new qa),o.push(n({label:ue(0,"Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),o.push(s(ue(0,"Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:ue(0,"Proportional"),value:"proportional"},{label:ue(0,"Fill"),value:"fill"},{label:ue(0,"Fit"),value:"fit"}])),o.push(s(ue(0,"Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:ue(0,"Mouse Over"),value:"mouseover"},{label:ue(0,"Always"),value:"always"}]));const r=this._editor.getOption(126)&&!He;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:r?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>o,onHide:e=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};o$.ID="editor.contrib.contextmenu",o$=t$=i$([n$(1,Kx),n$(2,Ux),n$(3,Ol),n$(4,WL),n$(5,th),n$(6,pu),n$(7,$q)],o$);Dh(o$.ID,o$,2),Lh(class extends bh{constructor(){super({id:"editor.action.showContextMenu",label:ue(0,"Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:Oh.textInputFocus,primary:1092,weight:100}})}run(e,t){var i;null===(i=o$.get(t))||void 0===i||i.showContextMenu()}});class r${constructor(e){this.selections=e}equals(e){const t=this.selections.length;if(t!==e.selections.length)return!1;for(let i=0;i{this._undoStack=[],this._redoStack=[]}))),this._register(e.onDidChangeModelContent((e=>{this._undoStack=[],this._redoStack=[]}))),this._register(e.onDidChangeCursorSelection((t=>{if(this._isCursorUndoRedo)return;if(!t.oldSelections)return;if(t.oldModelVersionId!==t.modelVersionId)return;const i=new r$(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new a$(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())})))}cursorUndo(){this._editor.hasModel()&&0!==this._undoStack.length&&(this._redoStack.push(new a$(new r$(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){this._editor.hasModel()&&0!==this._redoStack.length&&(this._undoStack.push(new a$(new r$(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}}l$.ID="editor.contrib.cursorUndoRedoController";function h$(){return!!Ii.VSCODE_DEV}function d$(e){if(h$()){const t=function(){s$||(s$=new Set);const e=globalThis;e.$hotReload_applyNewExports||(e.$hotReload_applyNewExports=e=>{for(const t of s$){const i=t(e);if(i)return i}});return s$}();return t.add(e),{dispose(){t.delete(e)}}}return{dispose(){}}}function c$(e,t){const i=new N,n=e.createDecorationsCollection();return i.add(Uj({debugName:()=>`Apply decorations from ${t.debugName}`},(e=>{const i=t.read(e);n.set(i)}))),i.add({dispose:()=>{n.clear()}}),i}function u$(e,t){return e.appendChild(t),x((()=>{e.removeChild(t)}))}Dh(l$.ID,l$,0),Lh(class extends bh{constructor(){super({id:"cursorUndo",label:ue(0,"Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:Oh.textInputFocus,primary:2099,weight:100}})}run(e,t,i){var n;null===(n=l$.get(t))||void 0===n||n.cursorUndo()}}),Lh(class extends bh{constructor(){super({id:"cursorRedo",label:ue(0,"Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){var n;null===(n=l$.get(t))||void 0===n||n.cursorRedo()}});class g$ extends E{get width(){return this._width}get height(){return this._height}constructor(e,t){super(),this.elementSizeObserver=this._register(new BR(e,t)),this._width=Aj(this,this.elementSizeObserver.getWidth()),this._height=Aj(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange((e=>Ej((e=>{this._width.set(this.elementSizeObserver.getWidth(),e),this._height.set(this.elementSizeObserver.getHeight(),e)})))))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function p$(e,t){let i=e.get(),n=i,s=i;const o=Aj("animatedValue",i);let r=-1;let a;function l(){const e=Date.now()-r;var t,h,d,c;s=Math.floor((h=n,d=i-n,(t=e)===(c=300)?h+d:d*(1-Math.pow(2,-10*t/c))+h)),e<300?a=requestAnimationFrame(l):s=i,o.set(s,void 0)}return t.add(jj({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(t,i)=>(t.didChange(e)&&(i.animate=i.animate||t.change),!0)},((t,o)=>{void 0!==a&&(cancelAnimationFrame(a),a=void 0),n=s,i=e.read(t),r=Date.now()-(o.animate?0:300),l()}))),o}class m$ extends E{constructor(e,t,i){super(),this._register(new _$(e,i)),this._register(v$(i,{height:t.actualHeight,top:t.actualTop}))}}class f${get afterLineNumber(){return this._afterLineNumber.get()}constructor(e,t){this._afterLineNumber=e,this.heightInPx=t,this.domNode=document.createElement("div"),this._actualTop=Aj(this,void 0),this._actualHeight=Aj(this,void 0),this.actualTop=this._actualTop,this.actualHeight=this._actualHeight,this.showInHiddenAreas=!0,this.onChange=this._afterLineNumber,this.onDomNodeTop=e=>{this._actualTop.set(e,void 0)},this.onComputedHeight=e=>{this._actualHeight.set(e,void 0)}}}class _${constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId="managedOverlayWidget-"+_$._counter++,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}function v$(e,t){return Kj((i=>{for(let[n,s]of Object.entries(t))s&&"object"==typeof s&&"read"in s&&(s=s.read(i)),"number"==typeof s&&(s=`${s}px`),n=n.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase())),e.style[n]=s}))}function b$(e,t){return function(e,t){if(h$()){Qj("reload",(t=>d$((i=>{if([...Object.values(i)].some((t=>e.includes(t))))return e=>(t(void 0),!0)})))).read(t)}}([e],t),e}function C$(e,t,i){const n=new N,s=[];return n.add(Kj((o=>{const r=t.read(o),a=new Map,l=new Map;i&&i(!0),e.changeViewZones((e=>{for(const t of s)e.removeZone(t);s.length=0;for(const t of r){const i=e.addZone(t);s.push(i),a.set(t,i)}})),i&&i(!1),n.add(jj({createEmptyChangeSummary:()=>[],handleChange(e,t){const i=l.get(e.changedObservable);return void 0!==i&&t.push(i),!0}},((t,n)=>{for(const e of r)e.onChange&&(l.set(e.onChange,a.get(e)),e.onChange.read(t));i&&i(!0),e.changeViewZones((e=>{for(const t of n)e.layoutZone(t)})),i&&i(!1)})))}))),n.add({dispose(){i&&i(!0),e.changeViewZones((e=>{for(const t of s)e.removeZone(t)})),i&&i(!1)}}),n}_$._counter=0;class w$ extends jh{dispose(){super.dispose(!0)}}const y$=Ba("audioCue");class S${static register(e){return new S$(e.fileName)}constructor(e){this.fileName=e}}S$.error=S$.register({fileName:"error.mp3"}),S$.warning=S$.register({fileName:"warning.mp3"}),S$.foldedArea=S$.register({fileName:"foldedAreas.mp3"}),S$.break=S$.register({fileName:"break.mp3"}),S$.quickFixes=S$.register({fileName:"quickFixes.mp3"}),S$.taskCompleted=S$.register({fileName:"taskCompleted.mp3"}),S$.taskFailed=S$.register({fileName:"taskFailed.mp3"}),S$.terminalBell=S$.register({fileName:"terminalBell.mp3"}),S$.diffLineInserted=S$.register({fileName:"diffLineInserted.mp3"}),S$.diffLineDeleted=S$.register({fileName:"diffLineDeleted.mp3"}),S$.diffLineModified=S$.register({fileName:"diffLineModified.mp3"}),S$.chatRequestSent=S$.register({fileName:"chatRequestSent.mp3"}),S$.chatResponsePending=S$.register({fileName:"chatResponsePending.mp3"}),S$.chatResponseReceived1=S$.register({fileName:"chatResponseReceived1.mp3"}),S$.chatResponseReceived2=S$.register({fileName:"chatResponseReceived2.mp3"}),S$.chatResponseReceived3=S$.register({fileName:"chatResponseReceived3.mp3"}),S$.chatResponseReceived4=S$.register({fileName:"chatResponseReceived4.mp3"});class L${constructor(e){this.randomOneOf=e}}class k${static register(e){const t=new L$("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new k$(t,e.name,e.settingsKey);return k$._audioCues.add(i),i}constructor(e,t,i){this.sound=e,this.name=t,this.settingsKey=i}}k$._audioCues=new Set,k$.error=k$.register({name:ue(0,"Error on Line"),sound:S$.error,settingsKey:"audioCues.lineHasError"}),k$.warning=k$.register({name:ue(0,"Warning on Line"),sound:S$.warning,settingsKey:"audioCues.lineHasWarning"}),k$.foldedArea=k$.register({name:ue(0,"Folded Area on Line"),sound:S$.foldedArea,settingsKey:"audioCues.lineHasFoldedArea"}),k$.break=k$.register({name:ue(0,"Breakpoint on Line"),sound:S$.break,settingsKey:"audioCues.lineHasBreakpoint"}),k$.inlineSuggestion=k$.register({name:ue(0,"Inline Suggestion on Line"),sound:S$.quickFixes,settingsKey:"audioCues.lineHasInlineSuggestion"}),k$.terminalQuickFix=k$.register({name:ue(0,"Terminal Quick Fix"),sound:S$.quickFixes,settingsKey:"audioCues.terminalQuickFix"}),k$.onDebugBreak=k$.register({name:ue(0,"Debugger Stopped on Breakpoint"),sound:S$.break,settingsKey:"audioCues.onDebugBreak"}),k$.noInlayHints=k$.register({name:ue(0,"No Inlay Hints on Line"),sound:S$.error,settingsKey:"audioCues.noInlayHints"}),k$.taskCompleted=k$.register({name:ue(0,"Task Completed"),sound:S$.taskCompleted,settingsKey:"audioCues.taskCompleted"}),k$.taskFailed=k$.register({name:ue(0,"Task Failed"),sound:S$.taskFailed,settingsKey:"audioCues.taskFailed"}),k$.terminalCommandFailed=k$.register({name:ue(0,"Terminal Command Failed"),sound:S$.error,settingsKey:"audioCues.terminalCommandFailed"}),k$.terminalBell=k$.register({name:ue(0,"Terminal Bell"),sound:S$.terminalBell,settingsKey:"audioCues.terminalBell"}),k$.notebookCellCompleted=k$.register({name:ue(0,"Notebook Cell Completed"),sound:S$.taskCompleted,settingsKey:"audioCues.notebookCellCompleted"}),k$.notebookCellFailed=k$.register({name:ue(0,"Notebook Cell Failed"),sound:S$.taskFailed,settingsKey:"audioCues.notebookCellFailed"}),k$.diffLineInserted=k$.register({name:ue(0,"Diff Line Inserted"),sound:S$.diffLineInserted,settingsKey:"audioCues.diffLineInserted"}),k$.diffLineDeleted=k$.register({name:ue(0,"Diff Line Deleted"),sound:S$.diffLineDeleted,settingsKey:"audioCues.diffLineDeleted"}),k$.diffLineModified=k$.register({name:ue(0,"Diff Line Modified"),sound:S$.diffLineModified,settingsKey:"audioCues.diffLineModified"}),k$.chatRequestSent=k$.register({name:ue(0,"Chat Request Sent"),sound:S$.chatRequestSent,settingsKey:"audioCues.chatRequestSent"}),k$.chatResponseReceived=k$.register({name:ue(0,"Chat Response Received"),settingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[S$.chatResponseReceived1,S$.chatResponseReceived2,S$.chatResponseReceived3,S$.chatResponseReceived4]}}),k$.chatResponsePending=k$.register({name:ue(0,"Chat Response Pending"),sound:S$.chatResponsePending,settingsKey:"audioCues.chatResponsePending"});var D$=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},x$=function(e,t){return function(i,n){t(i,n,e)}},N$=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const E$=tR("diff-review-insert",Jr.add,ue(0,"Icon for 'Insert' in accessible diff viewer.")),I$=tR("diff-review-remove",Jr.remove,ue(0,"Icon for 'Remove' in accessible diff viewer.")),M$=tR("diff-review-close",Jr.close,ue(0,"Icon for 'Close' in accessible diff viewer."));let T$=class extends E{constructor(e,t,i,n,s,o,r,a,l){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=n,this._width=s,this._height=o,this._diffs=r,this._editors=a,this._instantiationService=l,this.model=Hj(this,((e,t)=>{const i=this._visible.read(e);if(this._parentNode.style.visibility=i?"visible":"hidden",!i)return null;const n=t.add(this._instantiationService.createInstance(R$,this._diffs,this._editors,this._setVisible,this._canClose));return{model:n,view:t.add(this._instantiationService.createInstance(H$,this._parentNode,n,this._width,this._height,this._editors))}})),this._register(iq(this.model))}next(){Ej((e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this.model.get().model.nextGroup(e)}))}prev(){Ej((e=>{this._setVisible(!0,e),this.model.get().model.previousGroup(e)}))}close(){Ej((e=>{this._setVisible(!1,e)}))}};T$._ttPolicy=Fk("diffReview",{createHTML:e=>e}),T$=D$([x$(8,Fa)],T$);let R$=class extends E{constructor(e,t,i,n,s){super(),this._diffs=e,this._editors=t,this._setVisible=i,this.canClose=n,this._audioCueService=s,this._groups=Aj(this,[]),this._currentGroupIdx=Aj(this,0),this._currentElementIdx=Aj(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map(((e,t)=>this._groups.read(t)[e])),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map(((e,t)=>{var i;return null===(i=this.currentGroup.read(t))||void 0===i?void 0:i.lines[e]})),this._register(Kj((e=>{const t=this._diffs.read(e);if(!t)return void this._groups.set([],void 0);const i=function(e,t,i){const n=[];for(const s of Pd(e,((e,t)=>t.modified.startLineNumber-e.modified.endLineNumberExclusive<2*A$))){const e=[];e.push(new F$);const o=new wc(Math.max(1,s[0].original.startLineNumber-A$),Math.min(s[s.length-1].original.endLineNumberExclusive+A$,t+1)),r=new wc(Math.max(1,s[0].modified.startLineNumber-A$),Math.min(s[s.length-1].modified.endLineNumberExclusive+A$,i+1));Fd(s,((t,i)=>{const n=new wc(t?t.original.endLineNumberExclusive:o.startLineNumber,i?i.original.startLineNumber:o.endLineNumberExclusive),s=new wc(t?t.modified.endLineNumberExclusive:r.startLineNumber,i?i.modified.startLineNumber:r.endLineNumberExclusive);n.forEach((t=>{e.push(new V$(t,s.startLineNumber+(t-n.startLineNumber)))})),i&&(i.original.forEach((t=>{e.push(new B$(i,t))})),i.modified.forEach((t=>{e.push(new W$(i,t))})))}));const a=s[0].modified.join(s[s.length-1].modified),l=s[0].original.join(s[s.length-1].original);n.push(new P$(new fM(a,l),e))}return n}(t,this._editors.original.getModel().getLineCount(),this._editors.modified.getModel().getLineCount());Ej((e=>{const t=this._editors.modified.getPosition();if(t){const n=i.findIndex((e=>(null==t?void 0:t.lineNumber){const t=this.currentElement.read(e);(null==t?void 0:t.type)===O$.Deleted?this._audioCueService.playAudioCue(k$.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(null==t?void 0:t.type)===O$.Added&&this._audioCueService.playAudioCue(k$.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})}))),this._register(Kj((e=>{var t;const i=this.currentElement.read(e);if(i&&i.type!==O$.Header){const e=null!==(t=i.modifiedLineNumber)&&void 0!==t?t:i.diff.modified.startLineNumber;this._editors.modified.setSelection(Rh.fromPositions(new Va(e,1)))}})))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||Ij(t,(t=>{this._currentGroupIdx.set(uc.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),t),this._currentElementIdx.set(0,t)}))}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||Ej((i=>{this._currentElementIdx.set(uc.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);-1!==i&&Ej((e=>{this._currentElementIdx.set(i,e)}))}revealCurrentElementInEditor(){this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===O$.Deleted?(this._editors.original.setSelection(Rh.fromPositions(new Va(e.originalLineNumber,1))),this._editors.original.revealLine(e.originalLineNumber),this._editors.original.focus()):(e.type!==O$.Header&&(this._editors.modified.setSelection(Rh.fromPositions(new Va(e.modifiedLineNumber,1))),this._editors.modified.revealLine(e.modifiedLineNumber)),this._editors.modified.focus()))}close(){this._setVisible(!1,void 0),this._editors.modified.focus()}};R$=D$([x$(4,y$)],R$);const A$=3;var O$;!function(e){e[e.Header=0]="Header",e[e.Unchanged=1]="Unchanged",e[e.Deleted=2]="Deleted",e[e.Added=3]="Added"}(O$||(O$={}));class P${constructor(e,t){this.range=e,this.lines=t}}class F${constructor(){this.type=O$.Header}}class B${constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=O$.Deleted,this.modifiedLineNumber=void 0}}class W${constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=O$.Added,this.originalLineNumber=void 0}}class V${constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=O$.Unchanged}}let H$=class extends E{constructor(e,t,i,n,s,o){super(),this._element=e,this._model=t,this._width=i,this._height=n,this._editors=s,this._languageService=o,this.domNode=this._element,this.domNode.className="diff-review monaco-editor-background";const r=document.createElement("div");r.className="diff-review-actions",this._actionBar=this._register(new Rx(r)),this._register(Kj((e=>{this._actionBar.clear(),this._model.canClose.read(e)&&this._actionBar.push(new Ka("diffreview.close",ue(0,"Close"),"close-diff-review "+ta.asClassName(M$),!0,(()=>N$(this,void 0,void 0,(function*(){return 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 OD(this._content,{})),us(this.domNode,this._scrollbar.getDomNode(),r),this._register(x((()=>{us(this.domNode)}))),this._register(v$(this.domNode,{width:this._width,height:this._height})),this._register(v$(this._content,{width:this._width,height:this._height})),this._register(qj(((e,t)=>{this._model.currentGroup.read(e),this._render(t)}))),this._register(Mn(this.domNode,"keydown",(e=>{(e.equals(18)||e.equals(2066)||e.equals(530))&&(e.preventDefault(),this._model.goToNextLine()),(e.equals(16)||e.equals(2064)||e.equals(528))&&(e.preventDefault(),this._model.goToPreviousLine()),(e.equals(9)||e.equals(2057)||e.equals(521)||e.equals(1033))&&(e.preventDefault(),this._model.close()),(e.equals(10)||e.equals(3))&&(e.preventDefault(),this._model.revealCurrentElementInEditor())})))}_render(e){const t=this._editors.original.getOptions(),i=this._editors.modified.getOptions(),n=document.createElement("div");n.className="diff-review-table",n.setAttribute("role","list"),n.setAttribute("aria-label",ue(0,"Accessible Diff Viewer. Use arrow up and down to navigate.")),Hk(n,i.get(50)),us(this._content,n);const s=this._editors.original.getModel(),o=this._editors.modified.getModel();if(!s||!o)return;const r=s.getOptions(),a=o.getOptions(),l=i.get(66),h=this._model.currentGroup.get();for(const d of(null==h?void 0:h.lines)||[]){if(!h)break;let c;if(d.type===O$.Header){const e=document.createElement("div");e.className="diff-review-row",e.setAttribute("role","listitem");const t=h.range,i=this._model.currentGroupIndex.get(),n=this._model.groups.get().length,s=e=>0===e?ue(0,"no lines changed"):1===e?ue(0,"1 line changed"):ue(0,"{0} lines changed",e),o=s(t.original.length),r=s(t.modified.length);e.setAttribute("aria-label",ue(0,"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",i+1,n,t.original.startLineNumber,o,t.modified.startLineNumber,r));const a=document.createElement("div");a.className="diff-review-cell diff-review-summary",a.appendChild(document.createTextNode(`${i+1}/${n}: @@ -${t.original.startLineNumber},${t.original.length} +${t.modified.startLineNumber},${t.modified.length} @@`)),e.appendChild(a),c=e}else c=this._createRow(d,l,this._width.get(),t,s,r,i,o,a);n.appendChild(c);const u=Wj((e=>this._model.currentElement.read(e)===d));e.add(Kj((e=>{const t=u.read(e);c.tabIndex=t?0:-1,t&&c.focus()}))),e.add(En(c,"focus",(()=>{this._model.goToLine(d)})))}this._scrollbar.scanDomNode()}_createRow(e,t,i,n,s,o,r,a,l){const h=n.get(143),d=h.glyphMarginWidth+h.lineNumbersWidth,c=r.get(143),u=10+c.glyphMarginWidth+c.lineNumbersWidth;let g="diff-review-row",p="";let m=null;switch(e.type){case O$.Added:g="diff-review-row line-insert",p=" char-insert",m=E$;break;case O$.Deleted:g="diff-review-row line-delete",p=" char-delete",m=I$}const f=document.createElement("div");f.style.minWidth=i+"px",f.className=g,f.setAttribute("role","listitem"),f.ariaLevel="";const _=document.createElement("div");_.className="diff-review-cell",_.style.height=`${t}px`,f.appendChild(_);const v=document.createElement("span");v.style.width=d+"px",v.style.minWidth=d+"px",v.className="diff-review-line-number"+p,void 0!==e.originalLineNumber?v.appendChild(document.createTextNode(String(e.originalLineNumber))):v.innerText="\xa0",_.appendChild(v);const b=document.createElement("span");b.style.width=u+"px",b.style.minWidth=u+"px",b.style.paddingRight="10px",b.className="diff-review-line-number"+p,void 0!==e.modifiedLineNumber?b.appendChild(document.createTextNode(String(e.modifiedLineNumber))):b.innerText="\xa0",_.appendChild(b);const C=document.createElement("span");if(C.className="diff-review-spacer",m){const e=document.createElement("span");e.className=ta.asClassName(m),e.innerText="\xa0\xa0",C.appendChild(e)}else C.innerText="\xa0\xa0";let w;if(_.appendChild(C),void 0!==e.modifiedLineNumber){let t=this._getLineHtml(a,r,l.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);T$._ttPolicy&&(t=T$._ttPolicy.createHTML(t)),_.insertAdjacentHTML("beforeend",t),w=a.getLineContent(e.modifiedLineNumber)}else{let t=this._getLineHtml(s,n,o.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);T$._ttPolicy&&(t=T$._ttPolicy.createHTML(t)),_.insertAdjacentHTML("beforeend",t),w=s.getLineContent(e.originalLineNumber)}0===w.length&&(w=ue(0,"blank"));let y="";switch(e.type){case O$.Unchanged:y=e.originalLineNumber===e.modifiedLineNumber?ue(0,"{0} unchanged line {1}",w,e.originalLineNumber):ue(0,"{0} original line {1} modified line {2}",w,e.originalLineNumber,e.modifiedLineNumber);break;case O$.Added:y=ue(0,"+ {0} modified line {1}",w,e.modifiedLineNumber);break;case O$.Deleted:y=ue(0,"- {0} original line {1}",w,e.originalLineNumber)}return f.setAttribute("aria-label",y),f}_getLineHtml(e,t,i,n,s){const o=e.getLineContent(n),r=t.get(50),a=PC.createEmpty(o,s),l=cP.isBasicASCII(o,e.mightContainNonBasicASCII()),h=cP.containsRTL(o,l,e.mightContainRTL());return MA(new kA(r.isMonospace&&!t.get(33),r.canUseHalfwidthRightwardsArrow,o,!1,l,h,0,a,[],i,0,r.spaceWidth,r.middotWidth,r.wsmiddotWidth,t.get(116),t.get(98),t.get(93),t.get(51)!==MS.OFF,null)).html}};H$=D$([x$(5,Lc)],H$);const z$=tR("diff-insert",Jr.add,ue(0,"Line decoration for inserts in the diff editor.")),U$=tR("diff-remove",Jr.remove,ue(0,"Line decoration for removals in the diff editor.")),K$=Iw.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+ta.asClassName(z$),marginClassName:"gutter-insert"}),j$=Iw.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+ta.asClassName(U$),marginClassName:"gutter-delete"}),q$=Iw.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),$$=Iw.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),G$=Iw.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),Z$=Iw.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),Y$=Iw.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),X$=Iw.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),Q$=Iw.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),J$=Iw.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"}),eG=Iw.register({description:"diff-editor-arrow-revert-change",glyphMarginHoverMessage:new Ta(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(ue(0,"Click to revert change")),glyphMarginClassName:"arrow-revert-change "+ta.asClassName(Jr.arrowRight),zIndex:10001});class tG extends E{constructor(e,t,i,n,s){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=n,this._editors=s,this._originalScrollTop=Yj(this._editors.original.onDidScrollChange,(()=>this._editors.original.getScrollTop())),this._modifiedScrollTop=Yj(this._editors.modified.onDidScrollChange,(()=>this._editors.modified.getScrollTop())),this._viewZonesChanged=Qj("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Aj(this,0),this._modifiedViewZonesChangedSignal=Qj("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=Qj("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=Hj(((e,t)=>{var i;this._element.replaceChildren();const n=this._diffModel.read(e),s=null===(i=null==n?void 0:n.diff.read(e))||void 0===i?void 0:i.movedTexts;if(!s||0===s.length)return void this.width.set(0,void 0);this._viewZonesChanged.read(e);const o=this._originalEditorLayoutInfo.read(e),r=this._modifiedEditorLayoutInfo.read(e);if(!o||!r)return void this.width.set(0,void 0);this._modifiedViewZonesChangedSignal.read(e),this._originalViewZonesChangedSignal.read(e);const a=s.map((t=>{function i(e,t){return(t.getTopForLineNumber(e.startLineNumber,!0)+t.getTopForLineNumber(e.endLineNumberExclusive,!0))/2}const n=i(t.lineRangeMapping.original,this._editors.original),s=this._originalScrollTop.read(e),o=i(t.lineRangeMapping.modified,this._editors.modified),r=n-s,a=o-this._modifiedScrollTop.read(e),l=Math.min(n,o),h=Math.max(n,o);return{range:new uc(l,h),from:r,to:a,fromWithoutScroll:n,toWithoutScroll:o,move:t}}));a.sort(function(...e){return(t,i)=>{for(const n of e){const e=n(t,i);if(!Ld.isNeitherLessOrGreaterThan(e))return e}return Ld.neitherLessOrGreaterThan}}(Qd((e=>e.fromWithoutScroll>e.toWithoutScroll),ec),Qd((e=>e.fromWithoutScroll>e.toWithoutScroll?e.fromWithoutScroll:-e.toWithoutScroll),Jd)));const l=iG.compute(a.map((e=>e.range))),h=o.verticalScrollbarWidth,d=10*(l.getTrackCount()-1)+20,c=h+d+(r.contentLeft-tG.movedCodeBlockPadding);let u=0;for(const g of a){const e=h+10+10*l.getTrack(u),i=15,s=15,o=c,a=r.glyphMarginWidth+r.lineNumbersWidth,d=18,p=document.createElementNS("http://www.w3.org/2000/svg","rect");p.classList.add("arrow-rectangle"),p.setAttribute("x",""+(o-a)),p.setAttribute("y",""+(g.to-d/2)),p.setAttribute("width",`${a}`),p.setAttribute("height",`${d}`),this._element.appendChild(p);const m=document.createElementNS("http://www.w3.org/2000/svg","g"),f=document.createElementNS("http://www.w3.org/2000/svg","path");f.setAttribute("d",`M 0 ${g.from} L ${e} ${g.from} L ${e} ${g.to} L ${o-s} ${g.to}`),f.setAttribute("fill","none"),m.appendChild(f);const _=document.createElementNS("http://www.w3.org/2000/svg","polygon");_.classList.add("arrow"),t.add(Kj((e=>{f.classList.toggle("currentMove",g.move===n.activeMovedText.read(e)),_.classList.toggle("currentMove",g.move===n.activeMovedText.read(e))}))),_.setAttribute("points",`${o-s},${g.to-i/2} ${o},${g.to} ${o-s},${g.to+i/2}`),m.appendChild(_),this._element.appendChild(m),u++}this.width.set(d,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(x((()=>this._element.remove()))),this._register(Kj((e=>{const t=this._originalEditorLayoutInfo.read(e),i=this._modifiedEditorLayoutInfo.read(e);t&&i&&(this._element.style.left=t.width-t.verticalScrollbarWidth+"px",this._element.style.height=`${t.height}px`,this._element.style.width=`${t.verticalScrollbarWidth+t.contentLeft-tG.movedCodeBlockPadding+this.width.read(e)}px`)}))),this._register(iq(this._state));const o=Wj((e=>{const t=this._diffModel.read(e),i=null==t?void 0:t.diff.read(e);return i?i.movedTexts.map((e=>({move:e,original:new f$(Gj(e.lineRangeMapping.original.startLineNumber-1),18),modified:new f$(Gj(e.lineRangeMapping.modified.startLineNumber-1),18)}))):[]}));this._register(C$(this._editors.original,o.map((e=>e.map((e=>e.original)))))),this._register(C$(this._editors.modified,o.map((e=>e.map((e=>e.modified)))))),this._register(qj(((e,t)=>{const i=o.read(e);for(const n of i)t.add(new nG(this._editors.original,n.original,n.move,"original",this._diffModel.get())),t.add(new nG(this._editors.modified,n.modified,n.move,"modified",this._diffModel.get()))})));const r=Yj(this._editors.original.onDidChangeCursorPosition,(()=>this._editors.original.getPosition())),a=Yj(this._editors.modified.onDidChangeCursorPosition,(()=>this._editors.modified.getPosition())),l=Qj("original.onDidFocusEditorWidget",(e=>this._editors.original.onDidFocusEditorWidget((()=>setTimeout((()=>e(void 0)),0))))),h=Qj("modified.onDidFocusEditorWidget",(e=>this._editors.modified.onDidFocusEditorWidget((()=>setTimeout((()=>e(void 0)),0)))));let d="modified";this._register(jj({createEmptyChangeSummary:()=>{},handleChange:(e,t)=>(e.didChange(l)&&(d="original"),e.didChange(h)&&(d="modified"),!0)},(e=>{l.read(e),h.read(e);const t=this._diffModel.read(e);if(!t)return;const i=t.diff.read(e);let n;if(i&&"original"===d){const t=r.read(e);t&&(n=i.movedTexts.find((e=>e.lineRangeMapping.original.contains(t.lineNumber))))}if(i&&"modified"===d){const t=a.read(e);t&&(n=i.movedTexts.find((e=>e.lineRangeMapping.modified.contains(t.lineNumber))))}n!==t.movedTextToCompare.get()&&t.movedTextToCompare.set(void 0,void 0),t.setActiveMovedText(n)})))}}tG.movedCodeBlockPadding=4;class iG{static compute(e){const t=[],i=[];for(const n of e){let e=t.findIndex((e=>!e.intersectsStrict(n)));if(-1===e){const i=6;t.length>=i?e=Cc(t,Qd((e=>e.intersectWithRangeLength(n)),Jd)):(e=t.length,t.push(new gc))}t[e].addRange(n),i.push(e)}return new iG(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class nG extends m${constructor(e,t,i,n,s){const o=Ns("div.diff-hidden-lines-widget");super(e,t,o.root),this._editor=e,this._move=i,this._kind=n,this._diffModel=s,this._nodes=Ns("div.diff-moved-code-block",{style:{marginRight:"4px"}},[Ns("div.text-content@textContent"),Ns("div.action-bar@actionBar")]),o.root.appendChild(this._nodes.root);const r=Yj(this._editor.onDidLayoutChange,(()=>this._editor.getLayoutInfo()));let a;this._register(v$(this._nodes.root,{paddingRight:r.map((e=>e.verticalScrollbarWidth))})),a=i.changes.length>0?"original"===this._kind?ue(0,"Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):ue(0,"Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):"original"===this._kind?ue(0,"Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):ue(0,"Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const l=this._register(new Rx(this._nodes.actionBar,{highlightToggledItems:!0})),h=new Ka("",a,"",!1);l.push(h,{icon:!1,label:!0});const d=new Ka("","Compare",ta.asClassName(Jr.compareChanges),!0,(()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)}));this._register(Kj((e=>{const t=this._diffModel.movedTextToCompare.read(e)===i;d.checked=t}))),l.push(d,{icon:!1,label:!0})}}class sG extends E{constructor(e,t,i){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=Wj(this,(e=>{var t;const i=null===(t=this._diffModel.read(e))||void 0===t?void 0:t.diff.read(e);if(!i)return null;const n=this._diffModel.read(e).movedTextToCompare.read(e),s=this._options.renderIndicators.read(e),o=this._options.showEmptyDecorations.read(e),r=[],a=[];if(!n)for(const h of i.mappings){if(h.lineRangeMapping.original.isEmpty||r.push({range:h.lineRangeMapping.original.toInclusiveRange(),options:s?j$:$$}),h.lineRangeMapping.modified.isEmpty||a.push({range:h.lineRangeMapping.modified.toInclusiveRange(),options:s?K$:q$}),h.lineRangeMapping.modified.isEmpty||h.lineRangeMapping.original.isEmpty)h.lineRangeMapping.original.isEmpty||r.push({range:h.lineRangeMapping.original.toInclusiveRange(),options:Q$}),h.lineRangeMapping.modified.isEmpty||a.push({range:h.lineRangeMapping.modified.toInclusiveRange(),options:Z$});else for(const e of h.lineRangeMapping.innerChanges||[])h.lineRangeMapping.original.contains(e.originalRange.startLineNumber)&&r.push({range:e.originalRange,options:e.originalRange.isEmpty()&&o?J$:X$}),h.lineRangeMapping.modified.contains(e.modifiedRange.startLineNumber)&&a.push({range:e.modifiedRange,options:e.modifiedRange.isEmpty()&&o?Y$:G$});h.lineRangeMapping.modified.isEmpty||!this._options.shouldRenderRevertArrows.read(e)||n||a.push({range:Rh.fromPositions(new Va(h.lineRangeMapping.modified.startLineNumber,1)),options:eG})}if(n)for(const h of n.changes){const e=h.original.toInclusiveRange();e&&r.push({range:e,options:s?j$:$$});const t=h.modified.toInclusiveRange();t&&a.push({range:t,options:s?K$:q$});for(const i of h.innerChanges||[])r.push({range:i.originalRange,options:X$}),a.push({range:i.modifiedRange,options:G$})}const l=this._diffModel.read(e).activeMovedText.read(e);for(const h of i.movedTexts)r.push({range:h.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(h===l?" currentMove":""),blockPadding:[tG.movedCodeBlockPadding,0,tG.movedCodeBlockPadding,tG.movedCodeBlockPadding]}}),a.push({range:h.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(h===l?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:r,modifiedDecorations:a}})),this._register(c$(this._editors.original,this._decorations.map((e=>(null==e?void 0:e.originalDecorations)||[])))),this._register(c$(this._editors.modified,this._decorations.map((e=>(null==e?void 0:e.modifiedDecorations)||[]))))}}class oG extends E{constructor(e,t,i){super(),this._options=e,this._domNode=t,this._dimensions=i,this._sashRatio=Aj(this,void 0),this.sashLeft=Wj(this,(e=>{var t;const i=null!==(t=this._sashRatio.read(e))&&void 0!==t?t:this._options.splitViewDefaultRatio.read(e);return this._computeSashLeft(i,e)})),this._sash=this._register(new SW(this._domNode,{getVerticalSashTop:e=>0,getVerticalSashLeft:e=>this.sashLeft.get(),getVerticalSashHeight:e=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart((()=>{this._startSashPosition=this.sashLeft.get()}))),this._register(this._sash.onDidChange((e=>{const t=this._dimensions.width.get(),i=this._computeSashLeft((this._startSashPosition+(e.currentX-e.startX))/t,void 0);this._sashRatio.set(i/t,void 0)}))),this._register(this._sash.onDidEnd((()=>this._sash.layout()))),this._register(this._sash.onDidReset((()=>this._sashRatio.set(void 0,void 0)))),this._register(Kj((e=>{const t=this._options.enableSplitViewResizing.read(e);this._sash.state=t?3:0,this.sashLeft.read(e),this._dimensions.height.read(e),this._sash.layout()})))}setBoundarySashes(e){this._sash.orthogonalEndSash=e.bottom}_computeSashLeft(e,t){const i=this._dimensions.width.read(t),n=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),s=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):n,o=100;return i<=200?n:si-o?i-o:s}}class rG{remove(){var e;null===(e=this.parent)||void 0===e||e.children.delete(this.id)}static findId(e,t){let i;"string"==typeof e?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,void 0!==t.children.get(i)&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let n=i;for(let s=0;void 0!==t.children.get(n);s++)n=`${i}_${s}`;return n}static empty(e){return 0===e.children.size}}class aG extends rG{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class lG extends rG{constructor(e,t,i,n){super(),this.id=e,this.parent=t,this.label=i,this.order=n,this.children=new Map}}class hG extends rG{static create(e,t,i){const n=new jh(i),s=new hG(t.uri),o=e.ordered(t),r=o.map(((e,i)=>{var o;const r=rG.findId(`provider_${i}`,s),l=new lG(r,s,null!==(o=e.displayName)&&void 0!==o?o:"Unknown Outline Provider",i);return Promise.resolve(e.provideDocumentSymbols(t,n.token)).then((e=>{for(const t of e||[])hG._makeOutlineElement(t,l);return l}),(e=>(a(e),l))).then((e=>{rG.empty(e)?e.remove():s._groups.set(r,e)}))})),l=e.onDidChange((()=>{Td(e.ordered(t),o)||n.cancel()}));return Promise.all(r).then((()=>n.token.isCancellationRequested&&!i.isCancellationRequested?hG.create(e,t,i):s._compact())).finally((()=>{n.dispose(),l.dispose()}))}static _makeOutlineElement(e,t){const i=rG.findId(e,t),n=new aG(i,t,e);if(e.children)for(const s of e.children)hG._makeOutlineElement(s,n);t.children.set(n.id,n)}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)0===i.children.size?this._groups.delete(t):e+=1;if(1!==e)this.children=this._groups;else{const e=v.first(this._groups.values());for(const[,t]of e.children)t.parent=this,this.children.set(t.id,t)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof aG?e.push(t.symbol):e.push(...v.map(t.children.values(),(e=>e.symbol)));return e.sort(((e,t)=>Rh.compareRangesUsingStarts(e.range,t.range)))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return hG._flattenDocumentSymbols(t,e,""),t.sort(((e,t)=>Va.compare(Rh.getStartPosition(e.range),Rh.getStartPosition(t.range))||Va.compare(Rh.getEndPosition(t.range),Rh.getEndPosition(e.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&&hG._flattenDocumentSymbols(e,n.children,n.name)}}var dG=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},cG=function(e,t){return function(i,n){t(i,n,e)}},uG=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let gG=class extends E{get isUpdatingViewZones(){return this._isUpdatingViewZones}constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._languageFeaturesService=n,this._isUpdatingViewZones=!1,this._modifiedOutlineSource=Hj(this,((e,t)=>{const i=this._editors.modifiedModel.read(e);if(i)return t.add(new pG(this._languageFeaturesService,i))})),this._register(this._editors.original.onDidChangeCursorPosition((e=>{if(3===e.reason){const e=this._diffModel.get();Ej((t=>{for(const i of this._editors.original.getSelections()||[])null==e||e.ensureOriginalLineIsVisible(i.getStartPosition().lineNumber,t),null==e||e.ensureOriginalLineIsVisible(i.getEndPosition().lineNumber,t)}))}}))),this._register(this._editors.modified.onDidChangeCursorPosition((e=>{if(3===e.reason){const e=this._diffModel.get();Ej((t=>{for(const i of this._editors.modified.getSelections()||[])null==e||e.ensureModifiedLineIsVisible(i.getStartPosition().lineNumber,t),null==e||e.ensureModifiedLineIsVisible(i.getEndPosition().lineNumber,t)}))}})));const s=this._diffModel.map(((e,t)=>{var i,n;return 0===(null===(i=null==e?void 0:e.diff.read(t))||void 0===i?void 0:i.mappings.length)?[]:null!==(n=null==e?void 0:e.unchangedRegions.read(t))&&void 0!==n?n:[]})),o=Hj(this,((e,t)=>{const i=this._modifiedOutlineSource.read(e);if(!i)return{origViewZones:[],modViewZones:[]};const n=[],o=[],r=this._options.renderSideBySide.read(e),a=s.read(e);for(const s of a)if(!s.shouldHideControls(e)){{const e=Wj((e=>s.getHiddenOriginalRange(e).startLineNumber-1)),o=new f$(e,24);n.push(o),t.add(new mG(this._editors.original,o,s,s.originalUnchangedRange,!r,i,(e=>this._diffModel.get().ensureModifiedLineIsVisible(e,void 0)),this._options))}{const e=Wj((e=>s.getHiddenModifiedRange(e).startLineNumber-1)),n=new f$(e,24);o.push(n),t.add(new mG(this._editors.modified,n,s,s.modifiedUnchangedRange,!1,i,(e=>this._diffModel.get().ensureModifiedLineIsVisible(e,void 0)),this._options))}}return{origViewZones:n,modViewZones:o}})),r={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new Ta(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(ue(0,"Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+ta.asClassName(Jr.fold),zIndex:10001};this._register(c$(this._editors.original,Wj((e=>{const t=s.read(e),i=t.map((e=>({range:e.originalUnchangedRange.toInclusiveRange(),options:r})));for(const n of t)n.shouldHideControls(e)&&i.push({range:Rh.fromPositions(new Va(n.originalLineNumber,1)),options:a});return i})))),this._register(c$(this._editors.modified,Wj((e=>{const t=s.read(e),i=t.map((e=>({range:e.modifiedUnchangedRange.toInclusiveRange(),options:r})));for(const n of t)n.shouldHideControls(e)&&i.push({range:wc.ofLength(n.modifiedLineNumber,1).toInclusiveRange(),options:a});return i})))),this._register(C$(this._editors.original,o.map((e=>e.origViewZones)),(e=>this._isUpdatingViewZones=e))),this._register(C$(this._editors.modified,o.map((e=>e.modViewZones)),(e=>this._isUpdatingViewZones=e))),this._register(Kj((e=>{const t=s.read(e);this._editors.original.setHiddenAreas(t.map((t=>t.getHiddenOriginalRange(e).toInclusiveRange())).filter(Kr)),this._editors.modified.setHiddenAreas(t.map((t=>t.getHiddenModifiedRange(e).toInclusiveRange())).filter(Kr))}))),this._register(this._editors.modified.onMouseUp((e=>{var t;if(!e.event.rightButton&&e.target.position&&(null===(t=e.target.element)||void 0===t?void 0:t.className.includes("fold-unchanged"))){const t=e.target.position.lineNumber,i=this._diffModel.get();if(!i)return;const n=i.unchangedRegions.get().find((e=>e.modifiedUnchangedRange.includes(t)));if(!n)return;n.collapseAll(void 0),e.event.stopPropagation(),e.event.preventDefault()}}))),this._register(this._editors.original.onMouseUp((e=>{var t;if(!e.event.rightButton&&e.target.position&&(null===(t=e.target.element)||void 0===t?void 0:t.className.includes("fold-unchanged"))){const t=e.target.position.lineNumber,i=this._diffModel.get();if(!i)return;const n=i.unchangedRegions.get().find((e=>e.originalUnchangedRange.includes(t)));if(!n)return;n.collapseAll(void 0),e.event.stopPropagation(),e.event.preventDefault()}})))}};gG=dG([cG(3,oL)],gG);let pG=class extends E{constructor(e,t){super(),this._languageFeaturesService=e,this._textModel=t,this._currentModel=Aj(this,void 0);const i=Qj("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),n=Qj("_textModel.onDidChangeContent",B.debounce((e=>this._textModel.onDidChangeContent(e)),(()=>{}),100));this._register(qj(((e,t)=>uG(this,void 0,void 0,(function*(){i.read(e),n.read(e);const s=t.add(new w$),o=yield hG.create(this._languageFeaturesService.documentSymbolProvider,this._textModel,s.token);t.isDisposed||this._currentModel.set(o,void 0)})))))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const n=i.asListOfDocumentSymbols().filter((t=>e.contains(t.range.startLineNumber)&&!e.contains(t.range.endLineNumber)));return n.sort(tc(Qd((e=>e.range.endLineNumber-e.range.startLineNumber),Jd))),n.map((e=>({name:e.name,kind:e.kind,startLineNumber:e.range.startLineNumber})))}};pG=dG([cG(0,oL)],pG);class mG extends m${constructor(e,t,i,n,s,o,r,a){const l=Ns("div.diff-hidden-lines-widget");super(e,t,l.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=n,this.hide=s,this._modifiedOutlineSource=o,this._revealModifiedHiddenLine=r,this._options=a,this._nodes=Ns("div.diff-hidden-lines",[Ns("div.top@top",{title:ue(0,"Click or drag to show more above")}),Ns("div.center@content",{style:{display:"flex"}},[Ns("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[fs("a",{title:ue(0,"Show all"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...lk("$(unfold)"))]),Ns("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),Ns("div.bottom@bottom",{title:ue(0,"Click or drag to show more below"),role:"button"})]),l.root.appendChild(this._nodes.root);const h=Yj(this._editor.onDidLayoutChange,(()=>this._editor.getLayoutInfo()));this.hide?us(this._nodes.first):this._register(v$(this._nodes.first,{width:h.map((e=>e.contentLeft))}));const d=this._editor;this._register(En(this._nodes.top,"mousedown",(e=>{if(0!==e.button)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),e.preventDefault();const t=e.clientY;let i=!1;const n=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set(!0,void 0);const s=En(window,"mousemove",(e=>{const s=e.clientY-t;i=i||Math.abs(s)>2;const o=Math.round(s/d.getOption(66)),r=Math.max(0,Math.min(n+o,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(r,void 0)})),o=En(window,"mouseup",(e=>{i||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(!1,void 0),s.dispose(),o.dispose()}))}))),this._register(En(this._nodes.bottom,"mousedown",(e=>{if(0!==e.button)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),e.preventDefault();const t=e.clientY;let i=!1;const n=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set(!0,void 0);const s=En(window,"mousemove",(e=>{const s=e.clientY-t;i=i||Math.abs(s)>2;const o=Math.round(s/d.getOption(66)),r=Math.max(0,Math.min(n-o,this._unchangedRegion.getMaxVisibleLineCountBottom())),a=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(r,void 0);const l=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(l-a))})),o=En(window,"mouseup",(e=>{if(this._unchangedRegion.isDragged.set(!1,void 0),!i){const e=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const t=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(t-e))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),s.dispose(),o.dispose()}))}))),this._register(Kj((e=>{const t=[];if(!this.hide){const n=ue(0,"{0} hidden lines",i.getHiddenModifiedRange(e).length),s=fs("span",{title:ue(0,"Double click to unfold")},n);s.addEventListener("dblclick",(e=>{0===e.button&&(e.preventDefault(),this._unchangedRegion.showAll(void 0))})),t.push(s);const o=this._unchangedRegion.getHiddenModifiedRange(e),r=this._modifiedOutlineSource.getBreadcrumbItems(o,e);if(r.length>0){t.push(fs("span",void 0,"\xa0\xa0|\xa0\xa0"));for(let e=0;e{this._revealModifiedHiddenLine(i.startLineNumber)}}}}us(this._nodes.others,...t)})))}}const fG=Ba("editorWorkerService");var _G,vG=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},bG=function(e,t){return function(i,n){t(i,n,e)}},CG=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let wG=_G=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new U,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;null===(e=this.diffAlgorithmOnDidChangeSubscription)||void 0===e||e.dispose()}computeDiff(e,t,i,n){var s,o;return CG(this,void 0,void 0,(function*(){if("string"!=typeof this.diffAlgorithm)return this.diffAlgorithm.computeDiff(e,t,i,n);if(1===e.getLineCount()&&1===e.getLineMaxColumn(1))return 1===t.getLineCount()&&1===t.getLineMaxColumn(1)?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new _M(new wc(1,2),new wc(1,t.getLineCount()+1),[new vM(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const r=JSON.stringify([e.uri.toString(),t.uri.toString()]),a=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),l=_G.diffCache.get(r);if(l&&l.context===a)return l.result;const h=F.create(),d=yield this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),c=h.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:c,timedOut:null===(s=null==d?void 0:d.quitEarly)||void 0===s||s,detectedMoves:i.computeMoves?null!==(o=null==d?void 0:d.moves.length)&&void 0!==o?o:0:-1}),n.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!d)throw new Error("no diff result available");return _G.diffCache.size>10&&_G.diffCache.delete(_G.diffCache.keys().next().value),_G.diffCache.set(r,{result:d,context:a}),d}))}setOptions(e){var t;let i=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&(null===(t=this.diffAlgorithmOnDidChangeSubscription)||void 0===t||t.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,"string"!=typeof e.diffAlgorithm&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange((()=>this.onDidChangeEventEmitter.fire()))),i=!0),i&&this.onDidChangeEventEmitter.fire()}};wG.diffCache=new Map,wG=_G=vG([bG(1,fG),bG(2,lh)],wG);var yG=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},SG=function(e,t){return function(i,n){t(i,n,e)}};const LG=Ba("diffProviderFactoryService");let kG=class{constructor(e){this.instantiationService=e}createDiffProvider(e,t){return this.instantiationService.createInstance(wG,t)}};kG=yG([SG(0,Fa)],kG),yu(LG,kG,1);var DG=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},xG=function(e,t){return function(i,n){t(i,n,e)}},NG=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let EG=class extends E{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,i,n){super(),this.model=e,this._options=t,this._editor=i,this._diffProviderFactoryService=n,this._isDiffUpToDate=Aj(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=Aj(this,void 0),this.diff=this._diff,this._unchangedRegions=Aj(this,{regions:[],originalDecorationIds:[],modifiedDecorationIds:[]}),this.unchangedRegions=Wj(this,(e=>this._options.hideUnchangedRegions.read(e)?this._unchangedRegions.read(e).regions:(Ej((e=>{for(const t of this._unchangedRegions.get().regions)t.collapseAll(e)})),[]))),this.movedTextToCompare=Aj(this,void 0),this._activeMovedText=Aj(this,void 0),this._hoveredMovedText=Aj(this,void 0),this.activeMovedText=Wj(this,(e=>{var t,i;return null!==(i=null!==(t=this.movedTextToCompare.read(e))&&void 0!==t?t:this._hoveredMovedText.read(e))&&void 0!==i?i:this._activeMovedText.read(e)})),this._cancellationTokenSource=new jh,this._diffProvider=Wj(this,(e=>{const t=this._diffProviderFactoryService.createDiffProvider(this._editor,{diffAlgorithm:this._options.diffAlgorithm.read(e)});return{diffProvider:t,onChangeSignal:Qj("onDidChange",t.onDidChange)}})),this._register(x((()=>this._cancellationTokenSource.cancel())));const s=eq("contentChangedSignal"),o=this._register(new rd((()=>s.trigger(void 0)),200)),r=(t,i,n)=>{const s=TG.fromDiffs(t.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(n),this._options.hideUnchangedRegionsContextLineCount.read(n)),o=this._unchangedRegions.get(),r=o.originalDecorationIds.map((t=>e.original.getDecorationRange(t))).filter((e=>!!e)).map((e=>wc.fromRange(e))),a=o.modifiedDecorationIds.map((t=>e.modified.getDecorationRange(t))).filter((e=>!!e)).map((e=>wc.fromRange(e))),l=e.original.deltaDecorations(o.originalDecorationIds,s.map((e=>({range:e.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})))),h=e.modified.deltaDecorations(o.modifiedDecorationIds,s.map((e=>({range:e.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))));for(const e of s)for(let t=0;t{if(this._diff.get()){const i=Eg.fromModelContentChanges(t.changes),n=AG(this._lastDiff,i,e.original,e.modified);n&&(this._lastDiff=n,Ej((e=>{this._diff.set(IG.fromDiffResult(this._lastDiff),e),r(n,e);const t=this.movedTextToCompare.get();this.movedTextToCompare.set(t?this._lastDiff.moves.find((e=>e.lineRangeMapping.modified.intersect(t.lineRangeMapping.modified))):void 0,e)})))}o.schedule()}))),this._register(e.original.onDidChangeContent((t=>{if(this._diff.get()){const i=Eg.fromModelContentChanges(t.changes),n=RG(this._lastDiff,i,e.original,e.modified);n&&(this._lastDiff=n,Ej((e=>{this._diff.set(IG.fromDiffResult(this._lastDiff),e),r(n,e);const t=this.movedTextToCompare.get();this.movedTextToCompare.set(t?this._lastDiff.moves.find((e=>e.lineRangeMapping.modified.intersect(t.lineRangeMapping.modified))):void 0,e)})))}o.schedule()}))),this._register(qj(((t,i)=>NG(this,void 0,void 0,(function*(){var n,a;this._options.hideUnchangedRegionsMinimumLineCount.read(t),this._options.hideUnchangedRegionsContextLineCount.read(t),o.cancel(),s.read(t);const l=this._diffProvider.read(t);l.onChangeSignal.read(t),b$(JM,t),b$(ZM,t),this._isDiffUpToDate.set(!1,void 0);let h=[];i.add(e.original.onDidChangeContent((e=>{const t=Eg.fromModelContentChanges(e.changes);h=hp(h,t)})));let d=[];i.add(e.modified.onDidChangeContent((e=>{const t=Eg.fromModelContentChanges(e.changes);d=hp(d,t)})));let c=yield l.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(t),maxComputationTimeMs:this._options.maxComputationTimeMs.read(t),computeMoves:this._options.showMoves.read(t)},this._cancellationTokenSource.token);var u,g,p;this._cancellationTokenSource.token.isCancellationRequested||(u=c,g=e.original,p=e.modified,c={changes:u.changes.map((e=>new _M(e.original,e.modified,e.innerChanges?e.innerChanges.map((e=>function(e,t,i){let n=e.originalRange,s=e.modifiedRange;return(1!==n.endColumn||1!==s.endColumn)&&n.endColumn===t.getLineMaxColumn(n.endLineNumber)&&s.endColumn===i.getLineMaxColumn(s.endLineNumber)&&n.endLineNumber{r(c,e),this._lastDiff=c;const t=IG.fromDiffResult(c);this._diff.set(t,e),this._isDiffUpToDate.set(!0,e);const i=this.movedTextToCompare.get();this.movedTextToCompare.set(i?this._lastDiff.moves.find((e=>e.lineRangeMapping.modified.intersect(i.lineRangeMapping.modified))):void 0,e)})))})))))}ensureModifiedLineIsVisible(e,t){var i;if(0===(null===(i=this.diff.get())||void 0===i?void 0:i.mappings.length))return;const n=this._unchangedRegions.get().regions;for(const s of n)if(s.getHiddenModifiedRange(void 0).contains(e))return void s.showModifiedLine(e,t)}ensureOriginalLineIsVisible(e,t){var i;if(0===(null===(i=this.diff.get())||void 0===i?void 0:i.mappings.length))return;const n=this._unchangedRegions.get().regions;for(const s of n)if(s.getHiddenOriginalRange(void 0).contains(e))return void s.showOriginalLine(e,t)}waitForDiff(){return NG(this,void 0,void 0,(function*(){var e,t;yield(e=this.isDiffUpToDate,t=e=>e,new Promise((i=>{let n=!1,s=!1;const o=Kj((r=>{const a=e.read(r);t(a)&&(n?o.dispose():s=!0,i(a))}));n=!0,s&&o.dispose()})))}))}serializeState(){return{collapsedRegions:this._unchangedRegions.get().regions.map((e=>({range:e.getHiddenModifiedRange(void 0).serialize()})))}}restoreSerializedState(e){const t=e.collapsedRegions.map((e=>wc.deserialize(e.range))),i=this._unchangedRegions.get();Ej((e=>{for(const n of i.regions)for(const i of t)if(n.modifiedUnchangedRange.intersect(i)){n.setHiddenModifiedRange(i,e);break}}))}};EG=DG([xG(3,LG)],EG);class IG{static fromDiffResult(e){return new IG(e.changes.map((e=>new MG(e))),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,n){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=n}}class MG{constructor(e){this.lineRangeMapping=e}}class TG{static fromDiffs(e,t,i,n,s){const o=_M.inverse(e,t,i),r=[];for(const a of o){let e=a.original.startLineNumber,o=a.modified.startLineNumber,l=a.original.length;const h=1===e&&1===o,d=e+l===t+1&&o+l===i+1;(h||d)&&l>=s+n?(h&&!d&&(l-=s),d&&!h&&(e+=s,o+=s,l-=s),r.push(new TG(e,o,l,0,0))):l>=2*s+n&&(e+=s,o+=s,l-=2*s,r.push(new TG(e,o,l,0,0)))}return r}get originalUnchangedRange(){return wc.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return wc.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,n,s){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=Aj(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=Aj(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=Wj(this,(e=>this.visibleLineCountTop.read(e)+this.visibleLineCountBottom.read(e)===this.lineCount&&!this.isDragged.read(e))),this.isDragged=Aj(this,!1),this._visibleLineCountTop.set(n,void 0),this._visibleLineCountBottom.set(s,void 0)}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return wc.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return wc.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){const i=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),n=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;i{var s;this._contextMenuService.showContextMenu({domForShadowRoot:c&&null!==(s=i.getDomNode())&&void 0!==s?s:void 0,getAnchor:()=>({x:e,y:t}),getActions:()=>{const e=[],t=n.modified.isEmpty;e.push(new Ka("diff.clipboard.copyDeletedContent",t?n.original.length>1?ue(0,"Copy deleted lines"):ue(0,"Copy deleted line"):n.original.length>1?ue(0,"Copy changed lines"):ue(0,"Copy changed line"),void 0,!0,(()=>OG(this,void 0,void 0,(function*(){const e=this._originalTextModel.getValueInRange(n.original.toExclusiveRange());yield this._clipboardService.writeText(e)}))))),n.original.length>1&&e.push(new Ka("diff.clipboard.copyDeletedLineContent",ue(0,t?"Copy deleted line ({0})":"Copy changed line ({0})",n.original.startLineNumber+d),void 0,!0,(()=>OG(this,void 0,void 0,(function*(){let e=this._originalTextModel.getLineContent(n.original.startLineNumber+d);if(""===e){e=0===this._originalTextModel.getEndOfLineSequence()?"\n":"\r\n"}yield this._clipboardService.writeText(e)})))));return i.getOption(90)||e.push(new Ka("diff.inline.revertChange",ue(0,"Revert this change"),void 0,!0,(()=>OG(this,void 0,void 0,(function*(){this._editor.revert(this._diff)}))))),e},autoSelectFirstItem:!0})};this._register(Mn(this._diffActions,"mousedown",(e=>{const{top:t,height:i}=Hn(this._diffActions),n=Math.floor(h/3);e.preventDefault(),u(e.posx,t+i+n)}))),this._register(i.onMouseMove((e=>{8!==e.target.type&&5!==e.target.type||e.target.detail.viewZoneId!==this._getViewZoneId()?this.visibility=!1:(d=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,h),this.visibility=!0)}))),this._register(i.onMouseDown((e=>{if(e.event.rightButton&&(8===e.target.type||5===e.target.type)){e.target.detail.viewZoneId===this._getViewZoneId()&&(e.event.preventDefault(),d=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,h),u(e.event.posx,e.event.posy+h))}})))}_updateLightBulbPosition(e,t,i){const{top:n}=Hn(e),s=t-n,o=Math.floor(s/i),r=o*i;if(this._diffActions.style.top=`${r}px`,this._viewLineCounts){let e=0;for(let t=0;te});function BG(e,t,i,n){Hk(n,t.fontInfo);const s=i.length>0,o=new eu(1e4);let r=0,a=0;const l=[];for(let c=0;c');const l=t.getLineContent(),h=cP.isBasicASCII(l,s),d=cP.containsRTL(l,h,o),c=EA(new kA(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,h,d,0,t,i,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==MS.OFF,null),a);return a.appendString(""),c.characterMapping.getHorizontalOffset(c.characterMapping.length)}var zG=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},UG=function(e,t){return function(i,n){t(i,n,e)}};let KG=class extends E{constructor(e,t,i,n,s,o,r){super(),this._editors=e,this._diffModel=t,this._options=i,this._diffEditorWidget=n,this._canIgnoreViewZoneUpdateEvent=s,this._clipboardService=o,this._contextMenuService=r,this._originalTopPadding=Aj(this,0),this._originalScrollOffset=Aj(this,0),this._originalScrollOffsetAnimated=p$(this._originalScrollOffset,this._store),this._modifiedTopPadding=Aj(this,0),this._modifiedScrollOffset=Aj(this,0),this._modifiedScrollOffsetAnimated=p$(this._modifiedScrollOffset,this._store);let a=!1;const l=Aj("state",0),h=this._register(new rd((()=>{l.set(l.get()+1,void 0)}),0));this._register(this._editors.original.onDidChangeViewZones((e=>{a||this._canIgnoreViewZoneUpdateEvent()||h.schedule()}))),this._register(this._editors.modified.onDidChangeViewZones((e=>{a||this._canIgnoreViewZoneUpdateEvent()||h.schedule()}))),this._register(this._editors.original.onDidChangeConfiguration((e=>{(e.hasChanged(144)||e.hasChanged(66))&&h.schedule()}))),this._register(this._editors.modified.onDidChangeConfiguration((e=>{(e.hasChanged(144)||e.hasChanged(66))&&h.schedule()})));const d=this._diffModel.map((e=>e?Yj(e.model.original.onDidChangeTokens,(()=>2===e.model.original.tokenization.backgroundTokenizationState)):void 0)).map(((e,t)=>null==e?void 0:e.read(t))),c=new Set,u=new Set,g=Wj((e=>{const t=this._diffModel.read(e),i=null==t?void 0:t.diff.read(e);if(!t||!i)return null;l.read(e);const n=this._options.renderSideBySide.read(e);return jG(this._editors.original,this._editors.modified,i.mappings,c,u,n)})),p=Wj((e=>{var t;const i=null===(t=this._diffModel.read(e))||void 0===t?void 0:t.movedTextToCompare.read(e);if(!i)return null;l.read(e);const n=i.changes.map((e=>new MG(e)));return jG(this._editors.original,this._editors.modified,n,c,u,!0)}));function m(){const e=document.createElement("div");return e.className="diagonal-fill",e}const f=this._register(new N),_=Wj((e=>{var t,i,n,s,o,r,a,l;f.clear();const h=g.read(e)||[],c=[],u=[],_=this._modifiedTopPadding.read(e);_>0&&u.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:_,showInHiddenAreas:!0,suppressMouseDown:!0});const v=this._originalTopPadding.read(e);v>0&&c.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:v,showInHiddenAreas:!0,suppressMouseDown:!0});const b=this._options.renderSideBySide.read(e),C=b||null===(t=this._editors.modified._getViewModel())||void 0===t?void 0:t.createLineBreaksComputer();if(C)for(const N of h)if(N.diff)for(let E=N.originalRange.startLineNumber;Ethis._editors.original.getModel().tokenization.getLineTokens(e))),I.originalRange.mapToLineArray((e=>w[y++])),k,D),A=[];for(const B of I.diff.innerChanges||[])A.push(new uP(B.originalRange.delta(-(I.diff.original.startLineNumber-1)),X$.className,0));const O=BG(R,x,A,T),P=document.createElement("div");if(P.className="inline-deleted-margin-view-zone",Hk(P,x.fontInfo),this._options.renderIndicators.read(e))for(let W=0;W$r(F)),P,this._editors.modified,I.diff,this._diffEditorWidget,O.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let H=0;H1&&c.push({afterLineNumber:I.originalRange.startLineNumber+H,domNode:m(),heightInPx:(z-1)*S,showInHiddenAreas:!0,suppressMouseDown:!0})}u.push({afterLineNumber:I.modifiedRange.startLineNumber-1,domNode:T,heightInPx:O.heightInLines*S,minWidthInPx:O.minWidthInPx,marginDomNode:P,setZoneId(e){F=e},showInHiddenAreas:!0,suppressMouseDown:!0})}const M=document.createElement("div");M.className="gutter-delete",c.push({afterLineNumber:I.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:I.modifiedHeightInPx,marginDomNode:M,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const U=I.modifiedHeightInPx-I.originalHeightInPx;if(U>0){if(null==L?void 0:L.lineRangeMapping.original.delta(-1).deltaLength(2).contains(I.originalRange.endLineNumberExclusive-1))continue;c.push({afterLineNumber:I.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:U,showInHiddenAreas:!0,suppressMouseDown:!0})}else{if(null==L?void 0:L.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(I.modifiedRange.endLineNumberExclusive-1))continue;function K(){const e=document.createElement("div");return e.className="arrow-revert-change "+ta.asClassName(Jr.arrowRight),fs("div",{},e)}let j;I.diff&&I.diff.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(e)&&(j=K()),u.push({afterLineNumber:I.modifiedRange.endLineNumberExclusive-1,domNode:m(),heightInPx:-U,marginDomNode:j,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const q of null!==(l=p.read(e))&&void 0!==l?l:[]){if(!(null==L?void 0:L.lineRangeMapping.original.intersect(q.originalRange))||!(null==L?void 0:L.lineRangeMapping.modified.intersect(q.modifiedRange)))continue;const $=q.modifiedHeightInPx-q.originalHeightInPx;$>0?c.push({afterLineNumber:q.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:$,showInHiddenAreas:!0,suppressMouseDown:!0}):u.push({afterLineNumber:q.modifiedRange.endLineNumberExclusive-1,domNode:m(),heightInPx:-$,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:c,mod:u}}));this._register(qj((e=>{const t=WN.capture(this._editors.modified),i=_.read(e);a=!0,this._editors.original.changeViewZones((e=>{for(const t of c)e.removeZone(t);c.clear();for(const t of i.orig){const i=e.addZone(t);t.setZoneId&&t.setZoneId(i),c.add(i)}})),this._editors.modified.changeViewZones((e=>{for(const t of u)e.removeZone(t);u.clear();for(const t of i.mod){const i=e.addZone(t);t.setZoneId&&t.setZoneId(i),u.add(i)}})),a=!1,t.restore(this._editors.modified)}))),this._register(x((()=>{this._editors.original.changeViewZones((e=>{for(const t of c)e.removeZone(t);c.clear()})),this._editors.modified.changeViewZones((e=>{for(const t of u)e.removeZone(t);u.clear()}))})));let v=!1;this._register(this._editors.original.onDidScrollChange((e=>{e.scrollLeftChanged&&!v&&(v=!0,this._editors.modified.setScrollLeft(e.scrollLeft),v=!1)}))),this._register(this._editors.modified.onDidScrollChange((e=>{e.scrollLeftChanged&&!v&&(v=!0,this._editors.original.setScrollLeft(e.scrollLeft),v=!1)}))),this._originalScrollTop=Yj(this._editors.original.onDidScrollChange,(()=>this._editors.original.getScrollTop())),this._modifiedScrollTop=Yj(this._editors.modified.onDidScrollChange,(()=>this._editors.modified.getScrollTop())),this._register(Kj((e=>{const t=this._originalScrollTop.read(e)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(e))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(e));t!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(t,1)}))),this._register(Kj((e=>{const t=this._modifiedScrollTop.read(e)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(e))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(e));t!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(t,1)}))),this._register(Kj((e=>{var t;const i=null===(t=this._diffModel.read(e))||void 0===t?void 0:t.movedTextToCompare.read(e);let n=0;if(i){const e=this._editors.original.getTopForLineNumber(i.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();n=this._editors.modified.getTopForLineNumber(i.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-e}n>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(n,void 0)):n<0?(this._modifiedTopPadding.set(-n,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()-n,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+n,void 0,!0)})))}};function jG(e,t,i,n,s,o){const r=new ic(qG(e,n)),a=new ic(qG(t,s)),l=e.getOption(66),h=t.getOption(66),d=[];let c=0,u=0;function g(e,t){for(;;){let i=r.peek(),n=a.peek();if(i&&i.lineNumber>=e&&(i=void 0),n&&n.lineNumber>=t&&(n=void 0),!i&&!n)break;const s=i?i.lineNumber-c:Number.MAX_VALUE,o=n?n.lineNumber-u:Number.MAX_VALUE;so?(a.dequeue(),i={lineNumber:n.lineNumber-u+c,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:wc.ofLength(i.lineNumber,1),modifiedRange:wc.ofLength(n.lineNumber,1),originalHeightInPx:l+i.heightInPx,modifiedHeightInPx:h+n.heightInPx,diff:void 0})}}for(const p of i){const m=p.lineRangeMapping;g(m.original.startLineNumber,m.modified.startLineNumber);let f=!0,_=m.modified.startLineNumber,v=m.original.startLineNumber;function b(e,t){var i,n,s,o;if(et.lineNumbere+t.heightInPx),0))&&void 0!==n?n:0,m=null!==(o=null===(s=a.takeWhile((e=>e.lineNumbere+t.heightInPx),0))&&void 0!==o?o:0;d.push({originalRange:c,modifiedRange:u,originalHeightInPx:c.length*l+g,modifiedHeightInPx:u.length*h+m,diff:p.lineRangeMapping}),v=e,_=t}if(o)for(const C of m.innerChanges||[])C.originalRange.startColumn>1&&C.modifiedRange.startColumn>1&&b(C.originalRange.startLineNumber,C.modifiedRange.startLineNumber),C.originalRange.endColumn1&&n.push({lineNumber:a,heightInPx:r*(e-1)})}for(const a of e.getWhitespaces()){if(t.has(a.id))continue;const e=0===a.afterLineNumber?0:o.convertViewPositionToModelPosition(new Va(a.afterLineNumber,1)).lineNumber;i.push({lineNumber:e,heightInPx:a.height})}return function(e,t,i,n){if(0===e.length)return t;if(0===t.length)return e;const s=[];let o=0,r=0;for(;od?(s.push(l),r++):(s.push(n(a,l)),o++,r++)}for(;oe.lineNumber),((e,t)=>({lineNumber:e.lineNumber,heightInPx:e.heightInPx+t.heightInPx})))}KG=zG([UG(5,eS),UG(6,Kx)],KG);var $G,GG=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},ZG=function(e,t){return function(i,n){t(i,n,e)}};let YG=$G=class extends E{constructor(e,t,i,n,s,o,r,a){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=n,this._rootHeight=s,this._modifiedEditorLayoutInfo=o,this._options=r,this._themeService=a;const l=Yj(this._themeService.onDidColorThemeChange,(()=>this._themeService.getColorTheme())),h=Wj((e=>{const t=l.read(e);return{insertColor:t.getColor(lf)||(t.getColor(rf)||sf).transparent(2),removeColor:t.getColor(hf)||(t.getColor(af)||of).transparent(2)}})),d=Yj(this._editors.modified.onDidScrollChange,(()=>this._editors.modified.getScrollTop())),c=Yj(this._editors.modified.onDidScrollChange,(()=>this._editors.modified.getScrollHeight()));this._register(qj(((e,t)=>{if(!this._options.renderOverviewRuler.read(e))return;const i=Vk(document.createElement("div"));i.setClassName("diffViewport"),i.setPosition("absolute");const n=Ns("div.diffOverview",{style:{position:"absolute",top:"0px",width:$G.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;t.add(u$(n,i.domNode)),t.add(Mn(n,os.POINTER_DOWN,(e=>{this._editors.modified.delegateVerticalScrollbarPointerDown(e)}))),t.add(En(n,os.MOUSE_WHEEL,(e=>{this._editors.modified.delegateScrollFromMouseWheelEvent(e)}),{passive:!1})),t.add(u$(this._rootElement,n)),t.add(qj(((e,t)=>{const s=this._diffModel.read(e),o=this._editors.original.createOverviewRuler("original diffOverviewRuler");o&&(t.add(o),t.add(u$(n,o.getDomNode())));const r=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(r&&(t.add(r),t.add(u$(n,r.getDomNode()))),!o||!r)return;const a=Qj("viewZoneChanged",this._editors.original.onDidChangeViewZones),l=Qj("viewZoneChanged",this._editors.modified.onDidChangeViewZones),u=Qj("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),g=Qj("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);t.add(Kj((e=>{var t;a.read(e),l.read(e),u.read(e),g.read(e);const i=h.read(e),n=null===(t=null==s?void 0:s.diff.read(e))||void 0===t?void 0:t.mappings;function d(e,t,i){const n=i._getViewModel();return n?e.filter((e=>e.length>0)).map((e=>{const i=n.coordinatesConverter.convertModelPositionToViewPosition(new Va(e.startLineNumber,1)),s=n.coordinatesConverter.convertModelPositionToViewPosition(new Va(e.endLineNumberExclusive,1)),o=s.lineNumber-i.lineNumber;return new OP(i.lineNumber,s.lineNumber,o,t.toString())})):[]}const c=d((n||[]).map((e=>e.lineRangeMapping.original)),i.removeColor,this._editors.original),p=d((n||[]).map((e=>e.lineRangeMapping.modified)),i.insertColor,this._editors.modified);null==o||o.setZones(c),null==r||r.setZones(p)}))),t.add(Kj((e=>{const t=this._rootHeight.read(e),s=this._rootWidth.read(e),a=this._modifiedEditorLayoutInfo.read(e);if(a){const n=$G.ENTIRE_DIFF_OVERVIEW_WIDTH-2*$G.ONE_OVERVIEW_WIDTH;o.setLayout({top:0,height:t,right:n+$G.ONE_OVERVIEW_WIDTH,width:$G.ONE_OVERVIEW_WIDTH}),r.setLayout({top:0,height:t,right:0,width:$G.ONE_OVERVIEW_WIDTH});const s=d.read(e),l=c.read(e),h=this._editors.modified.getOption(102),u=new yD(h.verticalHasArrows?h.arrowSize:0,h.verticalScrollbarSize,0,a.height,l,s);i.setTop(u.getSliderPosition()),i.setHeight(u.getSliderSize())}else i.setTop(0),i.setHeight(0);n.style.height=t+"px",n.style.left=s-$G.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",i.setWidth($G.ENTIRE_DIFF_OVERVIEW_WIDTH)})))})))})))}};YG.ONE_OVERVIEW_WIDTH=15,YG.ENTIRE_DIFF_OVERVIEW_WIDTH=2*$G.ONE_OVERVIEW_WIDTH,YG=$G=GG([ZG(7,P_)],YG);Dp("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},ue(0,"The border color for text that got moved in the diff editor.")),Dp("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},ue(0,"The active border color for text that got moved in the diff editor."));class XG extends E{constructor(){super(...arguments),this._id=++XG.idCounter,this._onDidDispose=this._register(new U),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){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=0){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,n=!0){this._targetEditor.revealRange(e,t,i,n)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){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)}}XG.idCounter=0;var QG=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},JG=function(e,t){return function(i,n){t(i,n,e)}};let eZ=class extends E{constructor(e,t,i,n,s,o,r){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._createInnerEditor=s,this._instantiationService=o,this._keybindingService=r,this._onDidContentSizeChange=this._register(new U),this.original=this._register(this._createLeftHandSideEditor(i.editorOptions.get(),n.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(i.editorOptions.get(),n.modifiedEditor||{})),this.modifiedModel=Yj(this.modified.onDidChangeModel,(()=>this.modified.getModel())),this._register(jj({createEmptyChangeSummary:()=>({}),handleChange:(e,t)=>(e.didChange(i.editorOptions)&&Object.assign(t,e.change.changedOptions),!0)},((e,t)=>{i.editorOptions.read(e),this._options.renderSideBySide.read(e),this.modified.updateOptions(this._adjustOptionsForRightHandSide(e,t)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(e,t))})))}_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 s=this._createInnerEditor(e,t,i,n);return this._register(s.onDidContentSizeChange((e=>{const t=this.original.getContentWidth()+this.modified.getContentWidth()+YG.ENTIRE_DIFF_OVERVIEW_WIDTH,i=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:i,contentWidth:t,contentHeightChanged:e.contentHeightChanged,contentWidthChanged:e.contentWidthChanged})}))),s}_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}),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=ZS.revealHorizontalRightPadding.defaultValue+YG.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t=Object.assign(Object.assign({},e),{dimension:{height:0,width:0}});return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar=Object.assign({},t.scrollbar||{}),t.scrollbar.vertical="visible",t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap=Object.assign({},t.minimap||{}),t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){var t;e||(e="");const i=ue(0," use {0} to open the accessibility help.",null===(t=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))||void 0===t?void 0:t.getAriaLabel());return this._options.accessibilityVerbose.get()?e+i:e?e.replaceAll(i,""):""}};eZ=QG([JG(5,Fa),JG(6,WL)],eZ);class tZ{get editorOptions(){return this._options}constructor(e,t){this.diffEditorWidth=t,this.couldShowInlineViewBecauseOfSize=Wj(this,(e=>this._options.read(e).renderSideBySide&&this.diffEditorWidth.read(e)<=this._options.read(e).renderSideBySideInlineBreakpoint)),this.renderOverviewRuler=Wj(this,(e=>this._options.read(e).renderOverviewRuler)),this.renderSideBySide=Wj(this,(e=>this._options.read(e).renderSideBySide&&!(this._options.read(e).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(e)))),this.readOnly=Wj(this,(e=>this._options.read(e).readOnly)),this.shouldRenderRevertArrows=Wj(this,(e=>!!this._options.read(e).renderMarginRevertIcon&&(!!this.renderSideBySide.read(e)&&!this.readOnly.read(e)))),this.renderIndicators=Wj(this,(e=>this._options.read(e).renderIndicators)),this.enableSplitViewResizing=Wj(this,(e=>this._options.read(e).enableSplitViewResizing)),this.splitViewDefaultRatio=Wj(this,(e=>this._options.read(e).splitViewDefaultRatio)),this.ignoreTrimWhitespace=Wj(this,(e=>this._options.read(e).ignoreTrimWhitespace)),this.maxComputationTimeMs=Wj(this,(e=>this._options.read(e).maxComputationTime)),this.showMoves=Wj(this,(e=>this._options.read(e).experimental.showMoves&&this.renderSideBySide.read(e))),this.isInEmbeddedEditor=Wj(this,(e=>this._options.read(e).isInEmbeddedEditor)),this.diffWordWrap=Wj(this,(e=>this._options.read(e).diffWordWrap)),this.originalEditable=Wj(this,(e=>this._options.read(e).originalEditable)),this.diffCodeLens=Wj(this,(e=>this._options.read(e).diffCodeLens)),this.accessibilityVerbose=Wj(this,(e=>this._options.read(e).accessibilityVerbose)),this.diffAlgorithm=Wj(this,(e=>this._options.read(e).diffAlgorithm)),this.showEmptyDecorations=Wj(this,(e=>this._options.read(e).experimental.showEmptyDecorations)),this.onlyShowAccessibleDiffViewer=Wj(this,(e=>this._options.read(e).onlyShowAccessibleDiffViewer)),this.hideUnchangedRegions=Wj(this,(e=>this._options.read(e).hideUnchangedRegions.enabled)),this.hideUnchangedRegionsRevealLineCount=Wj(this,(e=>this._options.read(e).hideUnchangedRegions.revealLineCount)),this.hideUnchangedRegionsContextLineCount=Wj(this,(e=>this._options.read(e).hideUnchangedRegions.contextLineCount)),this.hideUnchangedRegionsMinimumLineCount=Wj(this,(e=>this._options.read(e).hideUnchangedRegions.minimumLineCount));const i=Object.assign(Object.assign({},e),iZ(e,uS));this._options=Aj(this,i)}updateOptions(e){const t=iZ(e,this._options.get()),i=Object.assign(Object.assign(Object.assign({},this._options.get()),e),t);this._options.set(i,void 0,{changedOptions:e})}}function iZ(e,t){var i,n,s,o,r,a,l,h;return{enableSplitViewResizing:CS(e.enableSplitViewResizing,t.enableSplitViewResizing),splitViewDefaultRatio:LS(e.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:CS(e.renderSideBySide,t.renderSideBySide),renderMarginRevertIcon:CS(e.renderMarginRevertIcon,t.renderMarginRevertIcon),maxComputationTime:yS(e.maxComputationTime,t.maxComputationTime,0,1073741824),maxFileSize:yS(e.maxFileSize,t.maxFileSize,0,1073741824),ignoreTrimWhitespace:CS(e.ignoreTrimWhitespace,t.ignoreTrimWhitespace),renderIndicators:CS(e.renderIndicators,t.renderIndicators),originalEditable:CS(e.originalEditable,t.originalEditable),diffCodeLens:CS(e.diffCodeLens,t.diffCodeLens),renderOverviewRuler:CS(e.renderOverviewRuler,t.renderOverviewRuler),diffWordWrap:xS(e.diffWordWrap,t.diffWordWrap,["off","on","inherit"]),diffAlgorithm:xS(e.diffAlgorithm,t.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:CS(e.accessibilityVerbose,t.accessibilityVerbose),experimental:{showMoves:CS(null===(i=e.experimental)||void 0===i?void 0:i.showMoves,t.experimental.showMoves),showEmptyDecorations:CS(null===(n=e.experimental)||void 0===n?void 0:n.showEmptyDecorations,t.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:CS(null!==(o=null===(s=e.hideUnchangedRegions)||void 0===s?void 0:s.enabled)&&void 0!==o?o:null===(r=e.experimental)||void 0===r?void 0:r.collapseUnchangedRegions,t.hideUnchangedRegions.enabled),contextLineCount:yS(null===(a=e.hideUnchangedRegions)||void 0===a?void 0:a.contextLineCount,t.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:yS(null===(l=e.hideUnchangedRegions)||void 0===l?void 0:l.minimumLineCount,t.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:yS(null===(h=e.hideUnchangedRegions)||void 0===h?void 0:h.revealLineCount,t.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:CS(e.isInEmbeddedEditor,t.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:CS(e.onlyShowAccessibleDiffViewer,t.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:yS(e.renderSideBySideInlineBreakpoint,t.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:CS(e.useInlineViewWhenSpaceIsLimited,t.useInlineViewWhenSpaceIsLimited)}}var nZ=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},sZ=function(e,t){return function(i,n){t(i,n,e)}};let oZ=class extends XG{constructor(e,t,i,n,s,o,r,a){var l;super(),this._domElement=e,this._parentContextKeyService=n,this._parentInstantiationService=s,this._audioCueService=r,this._editorProgressService=a,this.elements=Ns("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[Ns("div.noModificationsOverlay@overlay",{style:{position:"absolute",height:"100%",visibility:"hidden"}},[fs("span",{},"No Changes")]),Ns("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),Ns("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),Ns("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=this._register(Pj("diffModel",void 0)),this.onDidChangeModel=B.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._parentInstantiationService.createChild(new DB([Ol,this._contextKeyService])),this._boundarySashes=Aj(this,void 0),this._accessibleDiffViewerShouldBeVisible=Aj(this,!1),this._accessibleDiffViewerVisible=Wj(this,(e=>!!this._options.onlyShowAccessibleDiffViewer.read(e)||this._accessibleDiffViewerShouldBeVisible.read(e))),this.movedBlocksLinesPart=Aj(this,void 0),this._layoutInfo=Wj(this,(e=>{var t,i,n;const s=this._rootSizeObserver.width.read(e),o=this._rootSizeObserver.height.read(e),r=null===(t=this._sash.read(e))||void 0===t?void 0:t.sashLeft.read(e),a=null!=r?r:Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),l=s-a-(this._options.renderOverviewRuler.read(e)?YG.ENTIRE_DIFF_OVERVIEW_WIDTH:0),h=a-(null!==(n=null===(i=this.movedBlocksLinesPart.read(e))||void 0===i?void 0:i.width.read(e))&&void 0!==n?n:0);return this.elements.original.style.width=h+"px",this.elements.original.style.left="0px",this.elements.modified.style.width=l+"px",this.elements.modified.style.left=a+"px",this._editors.original.layout({width:h,height:o}),this._editors.modified.layout({width:l,height:o}),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}})),this._diffValue=this._diffModel.map(((e,t)=>null==e?void 0:e.diff.read(t))),this.onDidUpdateDiff=B.fromObservableLight(this._diffValue),o.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(x((()=>this._domElement.removeChild(this.elements.root)))),this._rootSizeObserver=this._register(new g$(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout(null!==(l=t.automaticLayout)&&void 0!==l&&l),this._options=new tZ(t,this._rootSizeObserver.width),this._contextKeyService.createKey(Oh.isEmbeddedDiffEditor.key,!1);const h=Oh.isEmbeddedDiffEditor.bindTo(this._contextKeyService);this._register(Kj((e=>{h.set(this._options.isInEmbeddedEditor.read(e))})));const d=Oh.comparingMovedCode.bindTo(this._contextKeyService);this._register(Kj((e=>{var t;d.set(!!(null===(t=this._diffModel.read(e))||void 0===t?void 0:t.movedTextToCompare.read(e)))})));const c=Oh.diffEditorRenderSideBySideInlineBreakpointReached.bindTo(this._contextKeyService);this._register(Kj((e=>{c.set(this._options.couldShowInlineViewBecauseOfSize.read(e))}))),this._editors=this._register(this._instantiationService.createInstance(eZ,this.elements.original,this.elements.modified,this._options,i,((e,t,i,n)=>this._createInnerEditor(e,t,i,n)))),this._sash=Hj(this,((e,t)=>{const i=this._options.renderSideBySide.read(e);if(this.elements.root.classList.toggle("side-by-side",i),!i)return;const n=t.add(new oG(this._options,this.elements.root,{height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map(((e,t)=>e-(this._options.renderOverviewRuler.read(t)?YG.ENTIRE_DIFF_OVERVIEW_WIDTH:0)))}));return t.add(Kj((e=>{const t=this._boundarySashes.read(e);t&&n.setBoundarySashes(t)}))),n})),this._register(iq(this._sash)),this._register(qj(((e,t)=>{this.unchangedRangesFeature=t.add(this._instantiationService.createInstance(b$(gG,e),this._editors,this._diffModel,this._options))}))),this._register(qj(((e,t)=>{t.add(new(b$(sG,e))(this._editors,this._diffModel,this._options))}))),this._register(qj(((e,t)=>{t.add(this._instantiationService.createInstance(b$(KG,e),this._editors,this._diffModel,this._options,this,(()=>this.unchangedRangesFeature.isUpdatingViewZones)))}))),this._register(qj(((e,t)=>{t.add(this._instantiationService.createInstance(b$(YG,e),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map((e=>e.modifiedEditor)),this._options))}))),this._register(qj(((e,t)=>{this._accessibleDiffViewer=t.add(this._register(this._instantiationService.createInstance(b$(T$,e),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,((e,t)=>this._accessibleDiffViewerShouldBeVisible.set(e,t)),this._options.onlyShowAccessibleDiffViewer.map((e=>!e)),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map(((e,t)=>{var i;return null===(i=null==e?void 0:e.diff.read(t))||void 0===i?void 0:i.mappings.map((e=>e.lineRangeMapping))})),this._editors)))})));const u=this._accessibleDiffViewerVisible.map((e=>e?"hidden":"visible"));this._register(v$(this.elements.modified,{visibility:u})),this._register(v$(this.elements.original,{visibility:u})),this._createDiffEditorContributions(),o.addDiffEditor(this),this._register(iq(this._layoutInfo)),this._register(qj(((e,t)=>{this.movedBlocksLinesPart.set(t.add(new(b$(tG,e))(this.elements.root,this._diffModel,this._layoutInfo.map((e=>e.originalEditor)),this._layoutInfo.map((e=>e.modifiedEditor)),this._editors)),void 0)}))),this._register(v$(this.elements.overlay,{width:this._layoutInfo.map(((e,t)=>e.originalEditor.width+(this._options.renderSideBySide.read(t)?0:e.modifiedEditor.width))),visibility:Wj((e=>{var t,i;return this._options.hideUnchangedRegions.read(e)&&0===(null===(i=null===(t=this._diffModel.read(e))||void 0===t?void 0:t.diff.read(e))||void 0===i?void 0:i.mappings.length)?"visible":"hidden"}))})),this._register(this._editors.modified.onMouseDown((e=>{var t,i;if(!e.event.rightButton&&e.target.position&&(null===(t=e.target.element)||void 0===t?void 0:t.className.includes("arrow-revert-change"))){const t=e.target.position.lineNumber,n=e.target,s=this._diffModel.get();if(!s)return;const o=null===(i=s.diff.get())||void 0===i?void 0:i.mappings;if(!o)return;const r=o.find((e=>(null==n?void 0:n.detail.afterLineNumber)===e.lineRangeMapping.modified.startLineNumber-1||e.lineRangeMapping.modified.startLineNumber===t));if(!r)return;this.revert(r.lineRangeMapping),e.event.stopPropagation()}}))),this._register(B.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,(e=>{var t,i;if(3===(null==e?void 0:e.reason)){const n=null===(i=null===(t=this._diffModel.get())||void 0===t?void 0:t.diff.get())||void 0===i?void 0:i.mappings.find((t=>t.lineRangeMapping.modified.contains(e.position.lineNumber)));(null==n?void 0:n.lineRangeMapping.modified.isEmpty)?this._audioCueService.playAudioCue(k$.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):(null==n?void 0:n.lineRangeMapping.original.isEmpty)?this._audioCueService.playAudioCue(k$.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):n&&this._audioCueService.playAudioCue(k$.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}})));const g=this._diffModel.map(((e,t)=>null==e?void 0:e.isDiffUpToDate.read(t)));this._register(qj(((e,t)=>{if(!1===g.read(e)){const e=this._editorProgressService.show(!0,1e3);t.add(x((()=>e.done())))}})))}_createInnerEditor(e,t,i,n){return e.createInstance(eW,t,i,n)}_createDiffEditorContributions(){const e=xh.getDiffEditorContributions();for(const i of e)try{this._register(this._instantiationService.createInstance(i.ctor,this))}catch(t){r(t)}}get _targetEditor(){return this._editors.modified}getEditorType(){return aF.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var e;return{original:this._editors.original.saveViewState(),modified:this._editors.modified.saveViewState(),modelState:null===(e=this._diffModel.get())||void 0===e?void 0:e.serializeState()}}restoreViewState(e){var t;if(e&&e.original&&e.modified){const i=e;this._editors.original.restoreViewState(i.original),this._editors.modified.restoreViewState(i.modified),i.modelState&&(null===(t=this._diffModel.get())||void 0===t||t.restoreSerializedState(i.modelState))}}createViewModel(e){return this._instantiationService.createInstance(EG,e,this._options,this)}getModel(){var e,t;return null!==(t=null===(e=this._diffModel.get())||void 0===e?void 0:e.model)&&void 0!==t?t:null}setModel(e){!e&&this._diffModel.get()&&this._accessibleDiffViewer.close();const t=e?"model"in e?e:this.createViewModel(e):void 0;this._editors.original.setModel(t?t.model.original:null),this._editors.modified.setModel(t?t.model.modified:null),Ej((e=>{this._diffModel.set(t,e)}))}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var e;const t=null===(e=this._diffModel.get())||void 0===e?void 0:e.diff.get();return t?t.mappings.map((e=>{const t=e.lineRangeMapping;let i,n,s,o,r=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,n=0,r=void 0):(i=t.original.startLineNumber,n=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(s=t.modified.startLineNumber-1,o=0,r=void 0):(s=t.modified.startLineNumber,o=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:n,modifiedStartLineNumber:s,modifiedEndLineNumber:o,charChanges:null==r?void 0:r.map((e=>({originalStartLineNumber:e.originalRange.startLineNumber,originalStartColumn:e.originalRange.startColumn,originalEndLineNumber:e.originalRange.endLineNumber,originalEndColumn:e.originalRange.endColumn,modifiedStartLineNumber:e.modifiedRange.startLineNumber,modifiedStartColumn:e.modifiedRange.startColumn,modifiedEndLineNumber:e.modifiedRange.endLineNumber,modifiedEndColumn:e.modifiedRange.endColumn})))}})):null}revert(e){var t;const i=null===(t=this._diffModel.get())||void 0===t?void 0:t.model;if(!i)return;const n=e.innerChanges?e.innerChanges.map((e=>({range:e.modifiedRange,text:i.original.getValueInRange(e.originalRange)}))):[{range:e.modified.toExclusiveRange(),text:i.original.getValueInRange(e.original.toExclusiveRange())}];this._editors.modified.executeEdits("diffEditor",n)}accessibleDiffViewerNext(){this._accessibleDiffViewer.next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.prev()}mapToOtherSide(){var e,t;const i=this._editors.modified.hasWidgetFocus(),n=i?this._editors.modified:this._editors.original,s=i?this._editors.original:this._editors.modified;let o;const r=n.getSelection();if(r){const n=null===(t=null===(e=this._diffModel.get())||void 0===e?void 0:e.diff.get())||void 0===t?void 0:t.mappings.map((e=>i?e.lineRangeMapping.flip():e.lineRangeMapping));if(n){const e=rZ(r.getStartPosition(),n),t=rZ(r.getEndPosition(),n);o=Rh.plusRange(e,t)}}return{destination:s,destinationSelection:o}}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(){var e;const t=null===(e=this._diffModel.get())||void 0===e?void 0:e.unchangedRegions.get();t&&Ej((e=>{for(const i of t)i.collapseAll(e)}))}showAllUnchangedRegions(){var e;const t=null===(e=this._diffModel.get())||void 0===e?void 0:e.unchangedRegions.get();t&&Ej((e=>{for(const i of t)i.showAll(e)}))}};function rZ(e,t){const i=pc(t,(t=>t.original.startLineNumber<=e.lineNumber));if(!i)return Rh.fromPositions(e);if(i.original.endLineNumberExclusive<=e.lineNumber){const t=e.lineNumber-i.original.endLineNumberExclusive+i.modified.endLineNumberExclusive;return Rh.fromPositions(new Va(t,e.column))}if(!i.innerChanges)return Rh.fromPositions(new Va(i.modified.startLineNumber,1));const n=pc(i.innerChanges,(t=>t.originalRange.getStartPosition().isBeforeOrEqual(e)));if(!n){const t=e.lineNumber-i.original.startLineNumber+i.modified.startLineNumber;return Rh.fromPositions(new Va(t,e.column))}if(n.originalRange.containsPosition(e))return n.modifiedRange;{const t=(r=n.originalRange.getEndPosition(),a=e,r.lineNumber===a.lineNumber?new pg(0,a.column-r.column):new pg(a.lineNumber-r.lineNumber,a.column-1));return Rh.fromPositions((s=n.modifiedRange.getEndPosition(),0===(o=t).lineCount?new Va(s.lineNumber,s.column+o.columnCount):new Va(s.lineNumber+o.lineCount,o.columnCount+1)))}var s,o,r,a}oZ=nZ([sZ(3,Ol),sZ(4,Fa),sZ(5,Wa),sZ(6,y$),sZ(7,vL)],oZ);ah(class extends rh{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:{value:ue(0,"Toggle Collapse Unchanged Regions"),original:"Toggle Collapse Unchanged Regions"},icon:Jr.map,toggled:pl.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:pl.has("isInDiffEditor"),menu:{when:pl.has("isInDiffEditor"),id:eh.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(pu),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}});class aZ extends rh{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:{value:ue(0,"Toggle Show Moved Code Blocks"),original:"Toggle Show Moved Code Blocks"},precondition:pl.has("isInDiffEditor")})}run(e,...t){const i=e.get(pu),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}ah(aZ);class lZ extends rh{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:{value:ue(0,"Toggle Use Inline View When Space Is Limited"),original:"Toggle Use Inline View When Space Is Limited"},precondition:pl.has("isInDiffEditor")})}run(e,...t){const i=e.get(pu),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}ah(lZ),nh.appendMenuItem(eh.EditorTitle,{command:{id:(new lZ).desc.id,title:ue(0,"Use Inline View When Space Is Limited"),toggled:pl.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:pl.has("isInDiffEditor")},order:11,group:"1_diff",when:pl.and(Oh.diffEditorRenderSideBySideInlineBreakpointReached,pl.has("isInDiffEditor"))}),nh.appendMenuItem(eh.EditorTitle,{command:{id:(new aZ).desc.id,title:ue(0,"Show Moved Code Blocks"),icon:Jr.move,toggled:bl.create("config.diffEditor.experimental.showMoves",!0),precondition:pl.has("isInDiffEditor")},order:10,group:"1_diff",when:pl.has("isInDiffEditor")});const hZ={value:ue(0,"Diff Editor"),original:"Diff Editor"};ah(class extends wh{constructor(){super({id:"diffEditor.switchSide",title:{value:ue(0,"Switch Side"),original:"Switch Side"},icon:Jr.arrowSwap,precondition:pl.has("isInDiffEditor"),f1:!0,category:hZ})}runEditorCommand(e,t,i){const n=gZ(e);if(n instanceof oZ){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}});ah(class extends wh{constructor(){super({id:"diffEditor.exitCompareMove",title:{value:ue(0,"Exit Compare Move"),original:"Exit Compare Move"},icon:Jr.close,precondition:Oh.comparingMovedCode,f1:!1,category:hZ,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=gZ(e);n instanceof oZ&&n.exitCompareMove()}});ah(class extends wh{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:{value:ue(0,"Collapse All Unchanged Regions"),original:"Collapse All Unchanged Regions"},icon:Jr.fold,precondition:pl.has("isInDiffEditor"),f1:!0,category:hZ})}runEditorCommand(e,t,...i){const n=gZ(e);n instanceof oZ&&n.collapseAllUnchangedRegions()}});ah(class extends wh{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:{value:ue(0,"Show All Unchanged Regions"),original:"Show All Unchanged Regions"},icon:Jr.unfold,precondition:pl.has("isInDiffEditor"),f1:!0,category:hZ})}runEditorCommand(e,t,...i){const n=gZ(e);n instanceof oZ&&n.showAllUnchangedRegions()}});const dZ={value:ue(0,"Accessible Diff Viewer"),original:"Accessible Diff Viewer"};class cZ extends rh{constructor(){super({id:cZ.id,title:{value:ue(0,"Go to Next Difference"),original:"Go to Next Difference"},category:dZ,precondition:pl.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=gZ(e);null==t||t.accessibleDiffViewerNext()}}cZ.id="editor.action.accessibleDiffViewer.next",nh.appendMenuItem(eh.EditorTitle,{command:{id:cZ.id,title:ue(0,"Open Accessible Diff Viewer"),precondition:pl.has("isInDiffEditor")},order:10,group:"2_diff",when:pl.and(Oh.accessibleDiffViewerVisible.negate(),pl.has("isInDiffEditor"))});class uZ extends rh{constructor(){super({id:uZ.id,title:{value:ue(0,"Go to Previous Difference"),original:"Go to Previous Difference"},category:dZ,precondition:pl.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=gZ(e);null==t||t.accessibleDiffViewerPrev()}}function gZ(e){var t;const i=e.get(Wa),n=i.listDiffEditors(),s=null!==(t=i.getFocusedCodeEditor())&&void 0!==t?t:i.getActiveCodeEditor();if(!s)return null;for(let r=0,a=n.length;rthis.selection.endLineNumber?this.targetSelection=new Ah(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):this.targetPosition.lineNumberthis._onEditorMouseDown(e)))),this._register(this._editor.onMouseUp((e=>this._onEditorMouseUp(e)))),this._register(this._editor.onMouseDrag((e=>this._onEditorMouseDrag(e)))),this._register(this._editor.onMouseDrop((e=>this._onEditorMouseDrop(e)))),this._register(this._editor.onMouseDropCanceled((()=>this._onEditorMouseDropCanceled()))),this._register(this._editor.onKeyDown((e=>this.onEditorKeyDown(e)))),this._register(this._editor.onKeyUp((e=>this.onEditorKeyUp(e)))),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(35)&&!this._editor.getOption(22)&&(fZ(e)&&(this._modifierPressed=!0),this._mouseDown&&fZ(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){this._editor.getOption(35)&&!this._editor.getOption(22)&&(fZ(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===_Z.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(null===this._dragSelection){const e=(this._editor.getSelections()||[]).filter((e=>t.position&&e.containsPosition(t.position)));if(1!==e.length)return;this._dragSelection=e[0]}fZ(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 Va(e.target.position.lineNumber,e.target.position.column);if(null===this._dragSelection){let i=null;if(e.event.shiftKey){const e=this._editor.getSelection();if(e){const{selectionStartLineNumber:n,selectionStartColumn:s}=e;i=[new Ah(n,s,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map((e=>e.containsPosition(t)?new Ah(t.lineNumber,t.column,t.lineNumber,t.column):e));this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(fZ(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(_Z.ID,new mZ(this._dragSelection,t,fZ(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 Rh(e.lineNumber,e.column,e.lineNumber,e.column),options:_Z._DECORATION_OPTIONS}]),this._editor.revealPosition(e,1)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return 6===e.type||7===e.type}_hitMargin(e){return 2===e.type||3===e.type||4===e.type}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}}_Z.ID="editor.contrib.dragAndDrop",_Z.TRIGGER_KEY_VALUE=Pe?6:5,_Z._DECORATION_OPTIONS=Iw.register({description:"dnd-target",className:"dnd-target"}),Dh(_Z.ID,_Z,2);var vZ=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},bZ=function(e,t){return function(i,n){t(i,n,e)}},CZ=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class wZ{remove(){var e;null===(e=this.parent)||void 0===e||e.children.delete(this.id)}static findId(e,t){let i;"string"==typeof e?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,void 0!==t.children.get(i)&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let n=i;for(let s=0;void 0!==t.children.get(n);s++)n=`${i}_${s}`;return n}static empty(e){return 0===e.children.size}}class yZ extends wZ{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class SZ extends wZ{constructor(e,t,i,n){super(),this.id=e,this.parent=t,this.label=i,this.order=n,this.children=new Map}}class LZ extends wZ{static create(e,t,i){const n=new jh(i),s=new LZ(t.uri),o=e.ordered(t),r=o.map(((e,i)=>{var o;const r=wZ.findId(`provider_${i}`,s),l=new SZ(r,s,null!==(o=e.displayName)&&void 0!==o?o:"Unknown Outline Provider",i);return Promise.resolve(e.provideDocumentSymbols(t,n.token)).then((e=>{for(const t of e||[])LZ._makeOutlineElement(t,l);return l}),(e=>(a(e),l))).then((e=>{wZ.empty(e)?e.remove():s._groups.set(r,e)}))})),l=e.onDidChange((()=>{Td(e.ordered(t),o)||n.cancel()}));return Promise.all(r).then((()=>n.token.isCancellationRequested&&!i.isCancellationRequested?LZ.create(e,t,i):s._compact())).finally((()=>{n.dispose(),l.dispose(),n.dispose()}))}static _makeOutlineElement(e,t){const i=wZ.findId(e,t),n=new yZ(i,t,e);if(e.children)for(const s of e.children)LZ._makeOutlineElement(s,n);t.children.set(n.id,n)}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)0===i.children.size?this._groups.delete(t):e+=1;if(1!==e)this.children=this._groups;else{const e=v.first(this._groups.values());for(const[,t]of e.children)t.parent=this,this.children.set(t.id,t)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof yZ?e.push(t.symbol):e.push(...v.map(t.children.values(),(e=>e.symbol)));return e.sort(((e,t)=>Rh.compareRangesUsingStarts(e.range,t.range)))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return LZ._flattenDocumentSymbols(t,e,""),t.sort(((e,t)=>Va.compare(Rh.getStartPosition(e.range),Rh.getStartPosition(t.range))||Va.compare(Rh.getEndPosition(t.range),Rh.getEndPosition(e.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&&LZ._flattenDocumentSymbols(e,n.children,n.name)}}const kZ=Ba("IOutlineModelService");let DZ=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new N,this._cache=new js(10,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(i.onModelRemoved((e=>{this._cache.delete(e.id)})))}dispose(){this._disposables.dispose()}getOrCreate(e,t){return CZ(this,void 0,void 0,(function*(){const i=this._languageFeaturesService.documentSymbolProvider,n=i.ordered(e);let s=this._cache.get(e.id);if(!s||s.versionId!==e.getVersionId()||!Td(s.provider,n)){const t=new jh;s={versionId:e.getVersionId(),provider:n,promiseCnt:0,source:t,promise:LZ.create(i,e,t.token),model:void 0},this._cache.set(e.id,s);const o=Date.now();s.promise.then((t=>{s.model=t,this._debounceInformation.update(e,Date.now()-o)})).catch((t=>{this._cache.delete(e.id)}))}if(s.model)return s.model;s.promiseCnt+=1;const o=t.onCancellationRequested((()=>{0==--s.promiseCnt&&(s.source.cancel(),this._cache.delete(e.id))}));try{return yield s.promise}finally{o.dispose()}}))}};DZ=vZ([bZ(0,oL),bZ(1,SE),bZ(2,Ha)],DZ),yu(kZ,DZ,1);var xZ=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};Xa.registerCommand("_executeDocumentSymbolProvider",(function(e,...t){return xZ(this,void 0,void 0,(function*(){const[i]=t;qr(an.isUri(i));const n=e.get(kZ),s=e.get(za),o=yield s.createModelReference(i);try{return(yield n.getOrCreate(o.object.textEditorModel,Uh.None)).getTopLevelSymbols()}finally{o.dispose()}}))}));const NZ=function(){if("object"==typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID.bind(crypto);let e;e="object"==typeof crypto&&"function"==typeof crypto.getRandomValues?crypto.getRandomValues.bind(crypto):function(e){for(let t=0;tEZ(this,void 0,void 0,(function*(){return e})),asFile:()=>{},value:"string"==typeof e?e:void 0}}class MZ{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 v.some(this,(([e,t])=>t.asFile()))&&t.push("files"),AZ(TZ(e),t)}get(e){var t;return null===(t=this._entries.get(this.toKey(e)))||void 0===t?void 0:t[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 TZ(e)}}function TZ(e){return e.toLowerCase()}function RZ(e,t){return AZ(TZ(e),t.map(TZ))}function AZ(e,t){if("*/*"===e)return t.length>0;if(t.includes(e))return!0;const i=e.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!i)return!1;const[n,s,o]=i;return"*"===o&&t.some((e=>e.startsWith(s+"/")))}const OZ=Object.freeze({create:e=>zd(e.map((e=>e.toString()))).join("\r\n"),split:e=>e.split("\r\n"),parse:e=>OZ.split(e).filter((e=>!e.startsWith("#")))}),PZ="CodeEditors",FZ="CodeFiles";jl.add("workbench.contributions.dragAndDrop",new class{});class BZ{constructor(){}static getInstance(){return BZ.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}BZ.INSTANCE=new BZ;var WZ=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function VZ(e){const t=new MZ;for(const i of e.items){const e=i.type;if("string"===i.kind){const n=new Promise((e=>i.getAsString(e)));t.append(e,IZ(n))}else if("file"===i.kind){const n=i.getAsFile();n&&t.append(e,HZ(n))}}return t}function HZ(e){const t=e.path?an.parse(e.path):void 0;return function(e,t,i){const n={id:NZ(),name:e,uri:t,data:i};return{asString:()=>EZ(this,void 0,void 0,(function*(){return""})),asFile:()=>n,value:void 0}}(e.name,t,(()=>WZ(this,void 0,void 0,(function*(){return new Uint8Array(yield e.arrayBuffer())}))))}const zZ=Object.freeze([PZ,FZ,aD.RESOURCES,aD.INTERNAL_URI_LIST]);function UZ(e,t=!1){const i=VZ(e),n=i.get(aD.INTERNAL_URI_LIST);if(n)i.replace(Lu.uriList,n);else if(t||!i.has(Lu.uriList)){const t=[];for(const i of e.items){const e=i.getAsFile();if(e){const i=e.path;try{i?t.push(an.file(i).toString()):t.push(an.parse(e.name,!0).toString())}catch(ge){}}}t.length&&i.replace(Lu.uriList,IZ(OZ.create(t)))}for(const s of zZ)i.delete(s);return i}function KZ(e){var t;function i(e,t){return"providerId"in e&&e.providerId===t.providerId||"mimeType"in e&&e.mimeType===t.handledMimeType}const n=new Map;for(const r of e)for(const s of null!==(t=r.yieldTo)&&void 0!==t?t:[])for(const t of e)if(t!==r&&i(s,t)){let e=n.get(r);e||(e=[],n.set(r,e)),e.push(t)}if(!n.size)return Array.from(e);const s=new Set,o=[];return function e(t){if(!t.length)return[];const i=t[0];if(o.includes(i))return console.warn(`Yield to cycle detected for ${i.providerId}`),t;if(s.has(i))return e(t.slice(1));let r=[];const a=n.get(i);return a&&(o.push(i),r=e(a),o.pop()),s.add(i),[...r,i,...e(t.slice(1))]}(Array.from(e))}var jZ=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},qZ=function(e,t){return function(i,n){t(i,n,e)}},$Z=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const GZ=Iw.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:"\xa0",inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class ZZ extends E{constructor(e,t,i,n,s){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=s,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=fs(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=fs("span.icon");this.domNode.append(t),t.classList.add(...ta.asClassNameArray(Jr.loading),"codicon-modifier-spin");const i=()=>{const e=this.editor.getOption(66);this.domNode.style.height=`${e}px`,this.domNode.style.width=`${Math.ceil(.8*e)}px`};i(),this._register(this.editor.onDidChangeConfiguration((e=>{(e.hasChanged(52)||e.hasChanged(66))&&i()}))),this._register(En(this.domNode,os.CLICK,(e=>{this.delegate.cancel()})))}getId(){return ZZ.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}}ZZ.baseId="editor.widget.inlineProgressWidget";let YZ=class extends E{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new I),this._currentWidget=new I,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}showWhile(e,t,i){return $Z(this,void 0,void 0,(function*(){const n=this._operationIdPool++;this._currentOperation=n,this.clear(),this._showPromise.value=id((()=>{const n=Rh.fromPositions(e);this._currentDecorations.set([{range:n,options:GZ}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(ZZ,this.id,this._editor,n,t,i))}),this._showDelay);try{return yield i}finally{this._currentOperation===n&&(this.clear(),this._currentOperation=void 0)}}))}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};YZ=jZ([qZ(2,Fa)],YZ);lc.white.toString(),lc.white.toString();class XZ extends E{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new U),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")),e.appendChild(this._element),this._register(ZL.addTarget(this._element)),[os.CLICK,$L.Tap].forEach((e=>{this._register(En(this._element,e,(e=>{this.enabled?this._onDidClick.fire(e):as(e)})))})),this._register(En(this._element,os.KEY_DOWN,(e=>{const t=new St(e);let i=!1;this.enabled&&(t.equals(3)||t.equals(10))?(this._onDidClick.fire(e),i=!0):t.equals(9)&&(this._element.blur(),i=!0),i&&as(t,!0)}))),this._register(En(this._element,os.MOUSE_OVER,(e=>{this._element.classList.contains("disabled")||this.updateBackground(!0)}))),this._register(En(this._element,os.MOUSE_OUT,(e=>{this.updateBackground(!1)}))),this.focusTracker=this._register(hs(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 lk(e))if("string"==typeof i){if(i=i.trim(),""===i)continue;const e=document.createElement("span");e.textContent=i,t.push(e)}else t.push(i);return t}updateBackground(e){let t;t=this.options.secondary?e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){var t,i,n;if(this._label===e)return;if(Aa(this._label)&&Aa(e)&&((i=this._label)===(n=e)||i&&n&&i.value===n.value&&i.isTrusted===n.isTrusted&&i.supportThemeIcons===n.supportThemeIcons&&i.supportHtml===n.supportHtml&&(i.baseUri===n.baseUri||i.baseUri&&n.baseUri&&ba(an.from(i.baseUri),an.from(n.baseUri)))))return;this._element.classList.add("monaco-text-button");const s=this.options.supportShortLabel?this._labelElement:this._element;if(Aa(e)){const i=vk(e,{inline:!0});i.dispose();const n=null===(t=i.element.querySelector("p"))||void 0===t?void 0:t.innerHTML;if(n){const e=ki(n,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});s.innerHTML=e}else us(s)}else this.options.supportIcons?us(s,...this.getContentElements(e)):s.textContent=e;"string"==typeof this.options.title?this._element.title=this.options.title:this.options.title&&(this._element.title=Sk(e)),this._label=e}get label(){return this._label}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")}}var QZ,JZ=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},eY=function(e,t){return function(i,n){t(i,n,e)}},tY=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let iY=QZ=class extends E{constructor(e,t,i,n,s,o,r,a,l,h){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=s,this.edits=o,this.onSelectNewEdit=r,this._contextMenuService=a,this._keybindingService=h,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(l),this.visibleContext.set(!0),this._register(x((()=>this.visibleContext.reset()))),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(x((()=>this.editor.removeContentWidget(this)))),this._register(this.editor.onDidChangeCursorPosition((e=>{s.containsPosition(e.position)||this.dispose()}))),this._register(B.runAndSubscribe(h.onDidUpdateKeybindings,(()=>{this._updateButtonTitle()})))}_updateButtonTitle(){var e;const t=null===(e=this._keybindingService.lookupKeybinding(this.showCommand.id))||void 0===e?void 0:e.getLabel();this.button.element.title=this.showCommand.label+(t?` (${t})`:"")}create(){this.domNode=fs(".post-edit-widget"),this.button=this._register(new XZ(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(En(this.domNode,os.CLICK,(()=>this.showSelector())))}getId(){return QZ.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Hn(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map(((e,t)=>Za({id:"",label:e.label,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}})))})}};iY.baseId="editor.widget.postEditWidget",iY=QZ=JZ([eY(7,Kx),eY(8,Ol),eY(9,WL)],iY);let nY=class extends E{constructor(e,t,i,n,s,o){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._instantiationService=s,this._bulkEditService=o,this._currentWidget=this._register(new I),this._register(B.any(t.onDidChangeModel,t.onDidChangeModelContent)((()=>this.clear())))}applyEditAndShowIfNeeded(e,t,i,n){var s,o;return tY(this,void 0,void 0,(function*(){const r=this._editor.getModel();if(!r||!e.length)return;const a=t.allEdits[t.activeEditIndex];if(!a)return;let l=[];l=("string"==typeof a.insertText?""===a.insertText:""===a.insertText.snippet)?[]:e.map((e=>new nL(r.uri,"string"==typeof a.insertText?{range:e,text:a.insertText,insertAsSnippet:!1}:{range:e,text:a.insertText.snippet,insertAsSnippet:!0})));const h={edits:[...l,...null!==(o=null===(s=a.additionalEdit)||void 0===s?void 0:s.edits)&&void 0!==o?o:[]]},d=e[0],c=r.deltaDecorations([],[{range:d,options:{description:"paste-line-suffix",stickiness:0}}]);let u,g;try{u=yield this._bulkEditService.apply(h,{editor:this._editor,token:n}),g=r.getDecorationRange(c[0])}finally{r.deltaDecorations(c,[])}i&&u.isApplied&&t.allEdits.length>1&&this.show(null!=g?g:d,t,(s=>tY(this,void 0,void 0,(function*(){const o=this._editor.getModel();o&&(yield o.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:s,allEdits:t.allEdits},i,n))}))))}))}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(iY,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;null===(e=this._currentWidget.value)||void 0===e||e.showSelector()}};nY=JZ([eY(4,Fa),eY(5,tL)],nY);var sY,oY=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},rY=function(e,t){return function(i,n){t(i,n,e)}},aY=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const lY="editor.changePasteType",hY=new Al("pasteWidgetVisible",!1,ue(0,"Whether the paste widget is showing")),dY="application/vnd.code.copyMetadata";let cY=sY=class extends E{static get(e){return e.getContribution(sY.ID)}constructor(e,t,i,n,s,o,r){super(),this._bulkEditService=i,this._clipboardService=n,this._languageFeaturesService=s,this._quickInputService=o,this._progressService=r,this._editor=e;const a=e.getContainerDomNode();this._register(En(a,"copy",(e=>this.handleCopy(e)))),this._register(En(a,"cut",(e=>this.handleCopy(e)))),this._register(En(a,"paste",(e=>this.handlePaste(e)),!0)),this._pasteProgressManager=this._register(new YZ("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(nY,"pasteIntoEditor",e,hY,{id:lY,label:ue(0,"Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferredId:e},Qn().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}isPasteAsEnabled(){return this._editor.getOption(84).enabled&&!this._editor.getOption(90)}handleCopy(e){var t,i;if(!this._editor.hasTextFocus())return;if(We&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled())return;const n=this._editor.getModel(),s=this._editor.getSelections();if(!n||!(null==s?void 0:s.length))return;const o=this._editor.getOption(37);let r=s;const a=1===s.length&&s[0].isEmpty();if(a){if(!o)return;r=[new Rh(r[0].startLineNumber,1,r[0].startLineNumber,1+n.getLineLength(r[0].startLineNumber))]}const l=null===(t=this._editor._getViewModel())||void 0===t?void 0:t.getPlainTextToCopy(s,o,Oe),h={multicursorText:Array.isArray(l)?l:null,pasteOnNewLine:a,mode:null},d=this._languageFeaturesService.documentPasteEditProvider.ordered(n).filter((e=>!!e.prepareDocumentPaste));if(!d.length)return void this.setCopyMetadata(e.clipboardData,{defaultPastePayload:h});const c=VZ(e.clipboardData),u=d.flatMap((e=>{var t;return null!==(t=e.copyMimeTypes)&&void 0!==t?t:[]})),g=NZ();this.setCopyMetadata(e.clipboardData,{id:g,providerCopyMimeTypes:u,defaultPastePayload:h});const p=Yh((e=>aY(this,void 0,void 0,(function*(){const t=Bd(yield Promise.all(d.map((t=>aY(this,void 0,void 0,(function*(){try{return yield t.prepareDocumentPaste(n,r,c,e)}catch(i){return void console.error(i)}}))))));t.reverse();for(const e of t)for(const[t,i]of e)c.replace(t,i);return c}))));null===(i=this._currentCopyOperation)||void 0===i||i.dataTransferPromise.cancel(),this._currentCopyOperation={handle:g,dataTransferPromise:p}}handlePaste(e){var t,i;return aY(this,void 0,void 0,(function*(){if(!e.clipboardData||!this._editor.hasTextFocus())return;null===(t=this._currentPasteOperation)||void 0===t||t.cancel(),this._currentPasteOperation=void 0;const n=this._editor.getModel(),s=this._editor.getSelections();if(!(null==s?void 0:s.length)||!n)return;if(!this.isPasteAsEnabled())return;const o=this.fetchCopyMetadata(e),r=UZ(e.clipboardData);r.delete(dY);const a=[...e.clipboardData.types,...null!==(i=null==o?void 0:o.providerCopyMimeTypes)&&void 0!==i?i:[],Lu.uriList],l=this._languageFeaturesService.documentPasteEditProvider.ordered(n).filter((e=>{var t;return null===(t=e.pasteMimeTypes)||void 0===t?void 0:t.some((e=>RZ(e,a)))}));l.length&&(e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferredId,l,s,r,o):this.doPasteInline(l,s,r,o))}))}doPasteInline(e,t,i,n){const s=Yh((o=>aY(this,void 0,void 0,(function*(){const r=this._editor;if(!r.hasModel())return;const a=r.getModel(),l=new dL(r,3,void 0,o);try{if(yield this.mergeInDataFromCopy(i,n,l.token),l.token.isCancellationRequested)return;const s=e.filter((e=>uY(e,i)));if(!s.length||1===s.length&&"text"===s[0].id)return void(yield this.applyDefaultPasteHandler(i,n,l.token));const o=yield this.getPasteEdits(s,i,a,t,l.token);if(l.token.isCancellationRequested)return;if(1===o.length&&"text"===o[0].providerId)return void(yield this.applyDefaultPasteHandler(i,n,l.token));if(o.length){const e="afterPaste"===r.getOption(84).showPasteSelector;return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:o},e,l.token)}yield this.applyDefaultPasteHandler(i,n,l.token)}finally{l.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}}))));this._pasteProgressManager.showWhile(t[0].getEndPosition(),ue(0,"Running paste handlers. Click to cancel"),s),this._currentPasteOperation=s}showPasteAsPick(e,t,i,n,s){const o=Yh((r=>aY(this,void 0,void 0,(function*(){const a=this._editor;if(!a.hasModel())return;const l=a.getModel(),h=new dL(a,3,void 0,r);try{if(yield this.mergeInDataFromCopy(n,s,h.token),h.token.isCancellationRequested)return;let o=t.filter((e=>uY(e,n)));e&&(o=o.filter((t=>t.id===e)));const r=yield this.getPasteEdits(o,n,l,i,h.token);if(h.token.isCancellationRequested)return;if(!r.length)return;let a;if(e)a=r.at(0);else{const e=yield this._quickInputService.pick(r.map((e=>({label:e.label,description:e.providerId,detail:e.detail,edit:e}))),{placeHolder:ue(0,"Select Paste Action")});a=null==e?void 0:e.edit}if(!a)return;const d=function(e,t,i){var n,s;return{edits:[...t.map((t=>new nL(e,"string"==typeof i.insertText?{range:t,text:i.insertText,insertAsSnippet:!1}:{range:t,text:i.insertText.snippet,insertAsSnippet:!0}))),...null!==(s=null===(n=i.additionalEdit)||void 0===n?void 0:n.edits)&&void 0!==s?s:[]]}}(l.uri,i,a);yield this._bulkEditService.apply(d,{editor:this._editor})}finally{h.dispose(),this._currentPasteOperation===o&&(this._currentPasteOperation=void 0)}}))));this._progressService.withProgress({location:10,title:ue(0,"Running paste handlers")},(()=>o))}setCopyMetadata(e,t){e.setData(dY,JSON.stringify(t))}fetchCopyMetadata(e){var t;if(!e.clipboardData)return;const i=e.clipboardData.getData(dY);if(i)try{return JSON.parse(i)}catch(Vs){return}const[n,s]=Qy.getTextData(e.clipboardData);return s?{defaultPastePayload:{mode:s.mode,multicursorText:null!==(t=s.multicursorText)&&void 0!==t?t:null,pasteOnNewLine:!!s.isFromEmptySelection}}:void 0}mergeInDataFromCopy(e,t,i){var n;return aY(this,void 0,void 0,(function*(){if((null==t?void 0:t.id)&&(null===(n=this._currentCopyOperation)||void 0===n?void 0:n.handle)===t.id){const t=yield this._currentCopyOperation.dataTransferPromise;if(i.isCancellationRequested)return;for(const[i,n]of t)e.replace(i,n)}if(!e.has(Lu.uriList)){const t=yield this._clipboardService.readResources();if(i.isCancellationRequested)return;t.length&&e.append(Lu.uriList,IZ(OZ.create(t)))}}))}getPasteEdits(e,t,i,n,s){return aY(this,void 0,void 0,(function*(){const o=yield Xh(Promise.all(e.map((e=>aY(this,void 0,void 0,(function*(){var o;try{const r=yield null===(o=e.provideDocumentPasteEdits)||void 0===o?void 0:o.call(e,i,n,t,s);if(r)return Object.assign(Object.assign({},r),{providerId:e.id})}catch(r){console.error(r)}}))))),s);return KZ(Bd(null!=o?o:[]))}))}applyDefaultPasteHandler(e,t,i){var n,s,o;return aY(this,void 0,void 0,(function*(){const r=null!==(n=e.get(Lu.text))&&void 0!==n?n:e.get("text");if(!r)return;const a=yield r.asString();if(i.isCancellationRequested)return;const l={text:a,pasteOnNewLine:null!==(s=null==t?void 0:t.defaultPastePayload.pasteOnNewLine)&&void 0!==s&&s,multicursorText:null!==(o=null==t?void 0:t.defaultPastePayload.multicursorText)&&void 0!==o?o:null,mode:null};this._editor.trigger("keyboard","paste",l)}))}};function uY(e,t){var i;return Boolean(null===(i=e.pasteMimeTypes)||void 0===i?void 0:i.some((e=>t.matches(e))))}cY.ID="editor.contrib.copyPasteActionController",cY=sY=oY([rY(1,Fa),rY(2,tL),rY(3,eS),rY(4,oL),rY(5,cE),rY(6,fL)],cY);var gY=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},pY=function(e,t){return function(i,n){t(i,n,e)}},mY=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const fY=ue(0,"Built-in");class _Y{provideDocumentPasteEdits(e,t,i,n){return mY(this,void 0,void 0,(function*(){const e=yield this.getEdit(i,n);return e?{insertText:e.insertText,label:e.label,detail:e.detail,handledMimeType:e.handledMimeType,yieldTo:e.yieldTo}:void 0}))}provideDocumentOnDropEdits(e,t,i,n){return mY(this,void 0,void 0,(function*(){const e=yield this.getEdit(i,n);return e?{insertText:e.insertText,label:e.label,handledMimeType:e.handledMimeType,yieldTo:e.yieldTo}:void 0}))}}class vY extends _Y{constructor(){super(...arguments),this.id="text",this.dropMimeTypes=[Lu.text],this.pasteMimeTypes=[Lu.text]}getEdit(e,t){return mY(this,void 0,void 0,(function*(){const t=e.get(Lu.text);if(!t)return;if(e.has(Lu.uriList))return;const i=yield t.asString();return{handledMimeType:Lu.text,label:ue(0,"Insert Plain Text"),detail:fY,insertText:i}}))}}class bY extends _Y{constructor(){super(...arguments),this.id="uri",this.dropMimeTypes=[Lu.uriList],this.pasteMimeTypes=[Lu.uriList]}getEdit(e,t){return mY(this,void 0,void 0,(function*(){const i=yield wY(e);if(!i.length||t.isCancellationRequested)return;let n=0;const s=i.map((({uri:e,originalText:t})=>e.scheme===vn.file?e.fsPath:(n++,t))).join(" ");let o;return o=n>0?i.length>1?ue(0,"Insert Uris"):ue(0,"Insert Uri"):i.length>1?ue(0,"Insert Paths"):ue(0,"Insert Path"),{handledMimeType:Lu.uriList,insertText:s,label:o,detail:fY}}))}}let CY=class extends _Y{constructor(e){super(),this._workspaceContextService=e,this.id="relativePath",this.dropMimeTypes=[Lu.uriList],this.pasteMimeTypes=[Lu.uriList]}getEdit(e,t){return mY(this,void 0,void 0,(function*(){const i=yield wY(e);if(!i.length||t.isCancellationRequested)return;const n=Bd(i.map((({uri:e})=>{const t=this._workspaceContextService.getWorkspaceFolder(e);return t?Da(t.uri,e):void 0})));return n.length?{handledMimeType:Lu.uriList,insertText:n.join(" "),label:i.length>1?ue(0,"Insert Relative Paths"):ue(0,"Insert Relative Path"),detail:fY}:void 0}))}};function wY(e){return mY(this,void 0,void 0,(function*(){const t=e.get(Lu.uriList);if(!t)return[];const i=yield t.asString(),n=[];for(const e of OZ.parse(i))try{n.push({uri:an.parse(e),originalText:e})}catch(ge){}return n}))}CY=gY([pY(0,$q)],CY);let yY=class extends E{constructor(e,t){super(),this._register(e.documentOnDropEditProvider.register("*",new vY)),this._register(e.documentOnDropEditProvider.register("*",new bY)),this._register(e.documentOnDropEditProvider.register("*",new CY(t)))}};yY=gY([pY(0,oL),pY(1,$q)],yY);let SY=class extends E{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new vY)),this._register(e.documentPasteEditProvider.register("*",new bY)),this._register(e.documentPasteEditProvider.register("*",new CY(t)))}};SY=gY([pY(0,oL),pY(1,$q)],SY),Dh(cY.ID,cY,0),ET(SY),Sh(new class extends vh{constructor(){super({id:lY,precondition:hY,kbOpts:{weight:100,primary:2137}})}runEditorCommand(e,t,i){var n;return null===(n=cY.get(t))||void 0===n?void 0:n.changePasteType()}}),Lh(class extends bh{constructor(){super({id:"editor.action.pasteAs",label:ue(0,"Paste As..."),alias:"Paste As...",precondition:void 0,description:{description:"Paste as",args:[{name:"args",schema:{type:"object",properties:{id:{type:"string",description:ue(0,"The id of the paste edit to try applying. If not provided, the editor will show a picker.")}}}}]}})}run(e,t,i){var n;const s="string"==typeof(null==i?void 0:i.id)?i.id:void 0;return null===(n=cY.get(t))||void 0===n?void 0:n.pasteAs(s)}});class LY{constructor(e){this.identifier=e}}const kY=Ba("treeViewsDndService");yu(kY,class{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}}},1);var DY,xY=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},NY=function(e,t){return function(i,n){t(i,n,e)}},EY=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const IY="editor.experimental.dropIntoEditor.defaultProvider",MY="editor.changeDropType",TY=new Al("dropWidgetVisible",!1,ue(0,"Whether the drop widget is showing"));let RY=DY=class extends E{static get(e){return e.getContribution(DY.ID)}constructor(e,t,i,n,s){super(),this._configService=i,this._languageFeaturesService=n,this._treeViewsDragAndDropService=s,this.treeItemsTransfer=BZ.getInstance(),this._dropProgressManager=this._register(t.createInstance(YZ,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(nY,"dropIntoEditor",e,TY,{id:MY,label:ue(0,"Show drop options...")})),this._register(e.onDropIntoEditor((t=>this.onDropIntoEditor(e,t.position,t.event))))}changeDropType(){this._postDropWidgetManager.tryShowSelector()}onDropIntoEditor(e,t,i){var n;return EY(this,void 0,void 0,(function*(){if(!i.dataTransfer||!e.hasModel())return;null===(n=this._currentOperation)||void 0===n||n.cancel(),e.focus(),e.setPosition(t);const s=Yh((n=>EY(this,void 0,void 0,(function*(){const o=new dL(e,1,void 0,n);try{const s=yield this.extractDataTransferData(i);if(0===s.size||o.token.isCancellationRequested)return;const r=e.getModel();if(!r)return;const a=this._languageFeaturesService.documentOnDropEditProvider.ordered(r).filter((e=>!e.dropMimeTypes||e.dropMimeTypes.some((e=>s.matches(e))))),l=yield this.getDropEdits(a,r,t,s,o);if(o.token.isCancellationRequested)return;if(l.length){const i=this.getInitialActiveEditIndex(r,l),s="afterDrop"===e.getOption(36).showDropSelector;yield this._postDropWidgetManager.applyEditAndShowIfNeeded([Rh.fromPositions(t)],{activeEditIndex:i,allEdits:l},s,n)}}finally{o.dispose(),this._currentOperation===s&&(this._currentOperation=void 0)}}))));this._dropProgressManager.showWhile(t,ue(0,"Running drop handlers. Click to cancel"),s),this._currentOperation=s}))}getDropEdits(e,t,i,n,s){return EY(this,void 0,void 0,(function*(){const o=yield Xh(Promise.all(e.map((e=>EY(this,void 0,void 0,(function*(){try{const o=yield e.provideDocumentOnDropEdits(t,i,n,s.token);if(o)return Object.assign(Object.assign({},o),{providerId:e.id})}catch(o){console.error(o)}}))))),s.token);return KZ(Bd(null!=o?o:[]))}))}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(IY,{resource:e.uri});for(const[n,s]of Object.entries(i)){const e=t.findIndex((e=>s===e.providerId&&e.handledMimeType&&RZ(n,[e.handledMimeType])));if(e>=0)return e}return 0}extractDataTransferData(e){return EY(this,void 0,void 0,(function*(){if(!e.dataTransfer)return new MZ;const t=UZ(e.dataTransfer);if(this.treeItemsTransfer.hasData(LY.prototype)){const e=this.treeItemsTransfer.getData(LY.prototype);if(Array.isArray(e))for(const i of e){const e=yield this._treeViewsDragAndDropService.removeDragOperationTransfer(i.identifier);if(e)for(const[i,n]of e)t.replace(i,n)}}return t}))}};RY.ID="editor.contrib.dropIntoEditorController",RY=DY=xY([NY(1,Fa),NY(2,pu),NY(3,oL),NY(4,kY)],RY),Dh(RY.ID,RY,2),Sh(new class extends vh{constructor(){super({id:MY,precondition:TY,kbOpts:{weight:100,primary:2137}})}runEditorCommand(e,t,i){var n;null===(n=RY.get(t))||void 0===n||n.changeDropType()}}),ET(yY),jl.as(xu).registerConfiguration(Object.assign(Object.assign({},YS),{properties:{[IY]:{type:"object",scope:5,description:ue(0,"Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}}));class AY{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((e=>this._editor.getModel().getDecorationRange(e))).filter((e=>!!e));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(null!==this._highlightedDecorationId&&(e.changeDecorationOptions(this._highlightedDecorationId,AY._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),null!==t&&(this._highlightedDecorationId=t,e.changeDecorationOptions(this._highlightedDecorationId,AY._CURRENT_FIND_MATCH_DECORATION)),null!==this._rangeHighlightDecorationId&&(e.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),null!==t){let i=this._editor.getModel().getDecorationRange(t);if(i.startLineNumber!==i.endLineNumber&&1===i.endColumn){const e=i.endLineNumber-1,t=this._editor.getModel().getLineMaxColumn(e);i=new Rh(i.startLineNumber,i.startColumn,e,t)}this._rangeHighlightDecorationId=e.addDecoration(i,AY._RANGE_HIGHLIGHT_DECORATION)}})),i}set(e,t){this._editor.changeDecorations((i=>{let n=AY._FIND_MATCH_DECORATION;const s=[];if(e.length>1e3){n=AY._FIND_MATCH_NO_OVERVIEW_DECORATION;const t=this._editor.getModel().getLineCount(),i=this._editor.getLayoutInfo().height/t,o=Math.max(2,Math.ceil(3/i));let r=e[0].range.startLineNumber,a=e[0].range.endLineNumber;for(let n=1,l=e.length;n=t.startLineNumber?t.endLineNumber>a&&(a=t.endLineNumber):(s.push({range:new Rh(r,1,a,1),options:AY._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),r=t.startLineNumber,a=t.endLineNumber)}s.push({range:new Rh(r,1,a,1),options:AY._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const o=new Array(e.length);for(let t=0,r=e.length;ti.removeDecoration(e))),this._findScopeDecorationIds=[]),(null==t?void 0:t.length)&&(this._findScopeDecorationIds=t.map((e=>i.addDecoration(e,AY._FIND_SCOPE_DECORATION))))}))}matchBeforePosition(e){if(0===this._decorations.length)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(0===this._decorations.length)return null;for(let t=0,i=this._decorations.length;te.lineNumber)return n;if(!(n.startColumn0){const e=[];for(let t=0;tRh.compareRangesUsingStarts(e.range,t.range)));const i=[];let n=e[0];for(let t=1;t0?t[0].toUpperCase()+t.substr(1):e[0][0].toUpperCase()!==e[0][0]&&t.length>0?t[0].toLowerCase()+t.substr(1):t}return t}function FY(e,t,i){return-1!==e[0].indexOf(i)&&-1!==t.indexOf(i)&&e[0].split(i).length===t.split(i).length}function BY(e,t,i){const n=t.split(i),s=e[0].split(i);let o="";return n.forEach(((e,t)=>{o+=PY([s[t]],e)+i})),o.slice(0,-1)}class WY{constructor(e){this.staticValue=e,this.kind=0}}class VY{constructor(e){this.pieces=e,this.kind=1}}class HY{static fromStaticValue(e){return new HY([zY.staticValue(e)])}get hasReplacementPatterns(){return 1===this._state.kind}constructor(e){e&&0!==e.length?1===e.length&&null!==e[0].staticValue?this._state=new WY(e[0].staticValue):this._state=new VY(e):this._state=new WY("")}buildReplaceString(e,t){if(0===this._state.kind)return t?PY(e,this._state.staticValue):this._state.staticValue;let i="";for(let n=0,s=this._state.pieces.length;n0){const e=[],i=t.caseOps.length;let n=0;for(let o=0,r=s.length;o=i){e.push(s.slice(o));break}switch(t.caseOps[n]){case"U":e.push(s[o].toUpperCase());break;case"u":e.push(s[o].toUpperCase()),n++;break;case"L":e.push(s[o].toLowerCase());break;case"l":e.push(s[o].toLowerCase()),n++;break;default:e.push(s[o])}}s=e.join("")}i+=s}return i}static _substitute(e,t){if(null===t)return"";if(0===e)return t[0];let i="";for(;e>0;){if(ethis.research(!1)),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition((e=>{3!==e.reason&&5!==e.reason&&6!==e.reason||this._decorations.setStartPosition(this._editor.getPosition())}))),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent((e=>{this._ignoreModelContentChanged||(e.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())}))),this._toDispose.add(this._state.onFindReplaceStateChange((e=>this._onStateChanged(e)))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,k(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){if(!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)}),240)):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;void 0!==t?null!==t&&(i=Array.isArray(t)?t:[t]):i=this._decorations.getFindScopes(),null!==i&&(i=i.map((e=>{if(e.startLineNumber!==e.endLineNumber){let t=e.endLineNumber;return 1===e.endColumn&&(t-=1),new Rh(e.startLineNumber,1,t,this._editor.getModel().getLineMaxColumn(t))}return e})));const n=this._findMatches(i,!1,fX);this._decorations.set(n,i);const s=this._editor.getSelection();let o=this._decorations.getCurrentMatchesPosition(s);if(0===o&&n.length>0){const e=_c(n.map((e=>e.range)),(e=>Rh.compareRangesUsingStarts(e,s)>=0));o=e>0?e-1+1:o}this._state.changeMatchInfo(o,this._decorations.getCount(),void 0),e&&this._editor.getOption(41).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,0),!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,0)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:n}=e;const s=this._editor.getModel();return t||1===n?(1===i?i=s.getLineCount():i--,n=s.getLineMaxColumn(i)):n--,new Va(i,n)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const t=this._decorations.matchAfterPosition(e);return void(t&&this._setCurrentFindMatch(t))}if(this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:n}=e;const s=this._editor.getModel();return t||n===s.getLineMaxColumn(i)?(i===s.getLineCount()?i=1:i++,n=1):n++,new Va(i,n)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const t=this._decorations.matchBeforePosition(e);return void(t&&this._setCurrentFindMatch(t))}if(this._decorations.getCount()=s)break;const o=e.charCodeAt(n);if(36===o){i.emitUnchanged(n-1),i.emitStatic("$",n+1);continue}if(48===o||38===o){i.emitUnchanged(n-1),i.emitMatchIndex(0,n+1,t),t.length=0;continue}if(49<=o&&o<=57){let r=o-48;if(n+1=s)break;const o=e.charCodeAt(n);switch(o){case 92:i.emitUnchanged(n-1),i.emitStatic("\\",n+1);break;case 110:i.emitUnchanged(n-1),i.emitStatic("\n",n+1);break;case 116:i.emitUnchanged(n-1),i.emitStatic("\t",n+1);break;case 117:case 85:case 108:case 76:i.emitUnchanged(n-1),i.emitStatic("",n+1),t.push(String.fromCharCode(o))}}}return i.finalize()}(this._state.replaceString):HY.fromStaticValue(this._state.replaceString)}replace(){if(!this._hasMatches())return;const e=this._getReplacePattern(),t=this._editor.getSelection(),i=this._getNextMatch(t.getStartPosition(),!0,!1);if(i)if(t.equalsRange(i.range)){const n=e.buildReplaceString(i.matches,this._state.preserveCase),s=new Xw(t,n);this._executeEditorCommand("replace",s),this._decorations.setStartPosition(new Va(t.startLineNumber,t.startColumn+n.length)),this.research(!0)}else this._decorations.setStartPosition(this._editor.getPosition()),this._setCurrentFindMatch(i.range)}_findMatches(e,t,i){const n=(e||[null]).map((e=>_X._getSearchRange(this._editor.getModel(),e)));return this._editor.getModel().findMatches(this._state.searchString,n,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();null===e&&this._state.matchesCount>=fX?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const e=new Zb(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null).parseSearchRequest();if(!e)return;let t=e.regex;if(!t.multiline){let e="mu";t.ignoreCase&&(e+="i"),t.global&&(e+="g"),t=new RegExp(t.source,e)}const i=this._editor.getModel(),n=i.getValue(1),s=i.getFullModelRange(),o=this._getReplacePattern();let r;const a=this._state.preserveCase;r=o.hasReplacementPatterns||a?n.replace(t,(function(){return o.buildReplaceString(arguments,a)})):n.replace(t,o.buildReplaceString(null,a));const l=new ty(s,r,this._editor.getSelection());this._executeEditorCommand("replaceAll",l)}_regularReplaceAll(e){const t=this._getReplacePattern(),i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),n=[];for(let o=0,r=i.length;oe.range)),n);this._executeEditorCommand("replaceAll",s)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let t=this._findMatches(e,!1,1073741824).map((e=>new Ah(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn)));const i=this._editor.getSelection();for(let n=0,s=t.length;nthis._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:Sp(Wp),inputActiveOptionForeground:Sp(Hp),inputActiveOptionBackground:Sp(Vp)};this.caseSensitive=this._register(new yV(Object.assign({appendTitle:this._keybindingLabelFor(lX),isChecked:this._state.matchCase},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 SV(Object.assign({appendTitle:this._keybindingLabelFor(hX),isChecked:this._state.wholeWord},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 LV(Object.assign({appendTitle:this._keybindingLabelFor(dX),isChecked:this._state.isRegex},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((e=>{let t=!1;e.isRegex&&(this.regex.checked=this._state.isRegex,t=!0),e.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,t=!0),e.matchCase&&(this.caseSensitive.checked=this._state.matchCase,t=!0),!this._state.isRevealed&&t&&this._revealTemporarily()}))),this._register(En(this._domNode,os.MOUSE_LEAVE,(e=>this._onMouseLeave()))),this._register(En(this._domNode,"mouseover",(e=>this._onMouseOver())))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return vX.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}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")}}function bX(e,t){return 1===e||2!==e&&t}vX.ID="editor.contrib.findOptionsWidget";class CX extends E{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return bX(this._isRegexOverride,this._isRegex)}get wholeWord(){return bX(this._wholeWordOverride,this._wholeWord)}get matchCase(){return bX(this._matchCaseOverride,this._matchCase)}get preserveCase(){return bX(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}constructor(){super(),this._onFindReplaceStateChange=this._register(new U),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,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 s=!1;0===t&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,n.matchesPosition=!0,s=!0),this._matchesCount!==t&&(this._matchesCount=t,n.matchesCount=!0,s=!0),void 0!==i&&(Rh.equalsRange(this._currentMatch,i)||(this._currentMatch=i,n.currentMatch=!0,s=!0)),s&&this._onFindReplaceStateChange.fire(n)}change(e,t,i=!0){var n;const s={moveCursor:t,updateHistory:i,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;const r=this.isRegex,a=this.wholeWord,l=this.matchCase,h=this.preserveCase;void 0!==e.searchString&&this._searchString!==e.searchString&&(this._searchString=e.searchString,s.searchString=!0,o=!0),void 0!==e.replaceString&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,s.replaceString=!0,o=!0),void 0!==e.isRevealed&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,s.isRevealed=!0,o=!0),void 0!==e.isReplaceRevealed&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,s.isReplaceRevealed=!0,o=!0),void 0!==e.isRegex&&(this._isRegex=e.isRegex),void 0!==e.wholeWord&&(this._wholeWord=e.wholeWord),void 0!==e.matchCase&&(this._matchCase=e.matchCase),void 0!==e.preserveCase&&(this._preserveCase=e.preserveCase),void 0!==e.searchScope&&((null===(n=e.searchScope)||void 0===n?void 0:n.every((e=>{var t;return null===(t=this._searchScope)||void 0===t?void 0:t.some((t=>!Rh.equalsRange(t,e)))})))||(this._searchScope=e.searchScope,s.searchScope=!0,o=!0)),void 0!==e.loop&&this._loop!==e.loop&&(this._loop=e.loop,s.loop=!0,o=!0),void 0!==e.isSearching&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,s.isSearching=!0,o=!0),void 0!==e.filters&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,s.filters=!0,o=!0),this._isRegexOverride=void 0!==e.isRegexOverride?e.isRegexOverride:0,this._wholeWordOverride=void 0!==e.wholeWordOverride?e.wholeWordOverride:0,this._matchCaseOverride=void 0!==e.matchCaseOverride?e.matchCaseOverride:0,this._preserveCaseOverride=void 0!==e.preserveCaseOverride?e.preserveCaseOverride:0,r!==this.isRegex&&(o=!0,s.isRegex=!0),a!==this.wholeWord&&(o=!0,s.wholeWord=!0),l!==this.matchCase&&(o=!0,s.matchCase=!0),h!==this.preserveCase&&(o=!0,s.preserveCase=!0),o&&this._onFindReplaceStateChange.fire(s)}canNavigateBack(){return this.canNavigateInLoop()||1!==this.matchesPosition}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=fX}}const wX=ue(0,"input"),yX=ue(0,"Preserve Case");class SX extends vV{constructor(e){super({icon:Jr.preserveCase,title:yX+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class LX extends _D{constructor(e,t,i,n){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new U),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new U),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new U),this._onInput=this._register(new U),this._onKeyUp=this._register(new U),this._onPreserveCaseKeyDown=this._register(new U),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=n.placeholder||"",this.validation=n.validation,this.label=n.label||wX;const s=n.appendPreserveCaseLabel||"",o=n.history||[],r=!!n.flexibleHeight,a=!!n.flexibleWidth,l=n.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new EV(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:o,showHistoryHint:n.showHistoryHint,flexibleHeight:r,flexibleWidth:a,flexibleMaxHeight:l,inputBoxStyles:n.inputBoxStyles})),this.preserveCase=this._register(new SX(Object.assign({appendTitle:s,isChecked:!1},n.toggleStyles))),this._register(this.preserveCase.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this._register(this.preserveCase.onKeyDown((e=>{this._onPreserveCaseKeyDown.fire(e)}))),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const h=[this.preserveCase.domNode];this.onkeydown(this.domNode,(e=>{if(e.equals(15)||e.equals(17)||e.equals(9)){const t=h.indexOf(document.activeElement);if(t>=0){let i=-1;e.equals(17)?i=(t+1)%h.length:e.equals(15)&&(i=0===t?h.length-1:t-1),e.equals(9)?(h[t].blur(),this.inputBox.focus()):i>=0&&h[i].focus(),as(e,!0)}}}));const d=document.createElement("div");d.className="controls",d.style.display=this._showOptionButtons?"block":"none",d.appendChild(this.preserveCase.domNode),this.domNode.appendChild(d),null==e||e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,(e=>this._onKeyDown.fire(e))),this.onkeyup(this.inputBox.inputElement,(e=>this._onKeyUp.fire(e))),this.oninput(this.inputBox.inputElement,(e=>this._onInput.fire())),this.onmousedown(this.inputBox.inputElement,(e=>this._onMouseDown.fire(e)))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){var e;null===(e=this.inputBox)||void 0===e||e.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var kX=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},DX=function(e,t){return function(i,n){t(i,n,e)}};const xX=new Al("suggestWidgetVisible",!1,ue(0,"Whether suggestion are visible")),NX="historyNavigationWidgetFocus",EX="historyNavigationForwardsEnabled",IX="historyNavigationBackwardsEnabled";let MX;const TX=[];function RX(e,t){if(TX.includes(t))throw new Error("Cannot register the same widget multiple times");TX.push(t);const i=new N,n=new Al(NX,!1).bindTo(e),s=new Al(EX,!0).bindTo(e),o=new Al(IX,!0).bindTo(e),r=()=>{n.set(!0),MX=t},a=()=>{n.set(!1),MX===t&&(MX=void 0)};return t.element===document.activeElement&&r(),i.add(t.onDidFocus((()=>r()))),i.add(t.onDidBlur((()=>a()))),i.add(x((()=>{TX.splice(TX.indexOf(t),1),a()}))),{historyNavigationForwardsEnablement:s,historyNavigationBackwardsEnablement:o,dispose(){i.dispose()}}}let AX=class extends MV{constructor(e,t,i,n){super(e,t,i);const s=this._register(n.createScoped(this.inputBox.element));this._register(RX(s,this.inputBox))}};AX=kX([DX(3,Ol)],AX);let OX=class extends LX{constructor(e,t,i,n,s=!1){super(e,t,s,i);const o=this._register(n.createScoped(this.inputBox.element));this._register(RX(o,this.inputBox))}};function PX(e){var t,i;return"Up"===(null===(t=e.lookupKeybinding("history.showPrevious"))||void 0===t?void 0:t.getElectronAccelerator())&&"Down"===(null===(i=e.lookupKeybinding("history.showNext"))||void 0===i?void 0:i.getElectronAccelerator())}OX=kX([DX(3,Ol)],OX),$l.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:pl.and(pl.has(NX),pl.equals(IX,!0),pl.not("isComposing"),xX.isEqualTo(!1)),primary:16,secondary:[528],handler:e=>{null==MX||MX.showPreviousValue()}}),$l.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:pl.and(pl.has(NX),pl.equals(EX,!0),pl.not("isComposing"),xX.isEqualTo(!1)),primary:18,secondary:[530],handler:e=>{null==MX||MX.showNextValue()}});var FX=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const BX=tR("find-selection",Jr.selection,ue(0,"Icon for 'Find in Selection' in the editor find widget.")),WX=tR("find-collapsed",Jr.chevronRight,ue(0,"Icon to indicate that the editor find widget is collapsed.")),VX=tR("find-expanded",Jr.chevronDown,ue(0,"Icon to indicate that the editor find widget is expanded.")),HX=tR("find-replace",Jr.replace,ue(0,"Icon for 'Replace' in the editor find widget.")),zX=tR("find-replace-all",Jr.replaceAll,ue(0,"Icon for 'Replace All' in the editor find widget.")),UX=tR("find-previous-match",Jr.arrowUp,ue(0,"Icon for 'Find Previous' in the editor find widget.")),KX=tR("find-next-match",Jr.arrowDown,ue(0,"Icon for 'Find Next' in the editor find widget.")),jX=ue(0,"Find / Replace"),qX=ue(0,"Find"),$X=ue(0,"Find"),GX=ue(0,"Previous Match"),ZX=ue(0,"Next Match"),YX=ue(0,"Find in Selection"),XX=ue(0,"Close"),QX=ue(0,"Replace"),JX=ue(0,"Replace"),eQ=ue(0,"Replace"),tQ=ue(0,"Replace All"),iQ=ue(0,"Toggle Replace"),nQ=ue(0,"Only the first {0} results are highlighted, but all find operations work on the entire text.",fX),sQ=ue(0,"{0} of {1}"),oQ=ue(0,"No results"),rQ=419;let aQ=69;const lQ="ctrlEnterReplaceAll.windows.donotask",hQ=Pe?256:2048;class dQ{constructor(e){this.afterLineNumber=e,this.heightInPx=33,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function cQ(e,t,i){const n=!!t.match(/\n/);i&&n&&i.selectionStart>0&&e.stopPropagation()}function uQ(e,t,i){const n=!!t.match(/\n/);i&&n&&i.selectionEndthis._updateHistoryDelayer.cancel()))),this._register(this._state.onFindReplaceStateChange((e=>this._onStateChanged(e)))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration((e=>{if(e.hasChanged(90)&&(this._codeEditor.getOption(90)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),e.hasChanged(143)&&this._tryUpdateWidgetWidth(),e.hasChanged(2)&&this.updateAccessibilitySupport(),e.hasChanged(41)){const e=this._codeEditor.getOption(41).loop;this._state.change({loop:e},!1);const t=this._codeEditor.getOption(41).addExtraSpaceOnTop;t&&!this._viewZone&&(this._viewZone=new dQ(0),this._showViewZone()),!t&&this._viewZone&&this._removeViewZone()}}))),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection((()=>{this._isVisible&&this._updateToggleSelectionFindButton()}))),this._register(this._codeEditor.onDidFocusEditorWidget((()=>FX(this,void 0,void 0,(function*(){if(this._isVisible){const e=yield this._controller.getGlobalBufferTerm();e&&e!==this._state.searchString&&(this._state.change({searchString:e},!1),this._findInput.select())}}))))),this._findInputFocused=jY.bindTo(o),this._findFocusTracker=this._register(hs(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=qY.bindTo(o),this._replaceFocusTracker=this._register(hs(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(41).addExtraSpaceOnTop&&(this._viewZone=new dQ(0)),this._register(this._codeEditor.onDidChangeModel((()=>{this._isVisible&&(this._viewZoneId=void 0)}))),this._register(this._codeEditor.onDidScrollChange((e=>{e.scrollTopChanged?this._layoutViewZone():setTimeout((()=>{this._layoutViewZone()}),0)})))}getId(){return gQ.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:0}: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(90)||this._isReplaceVisible||(this._isReplaceVisible=!0,this._replaceInput.width=zn(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 e=this._state.searchString.length>0&&0===this._state.matchesCount;this._domNode.classList.toggle("no-results",e),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,r)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){let e;if(this._matchesCount.style.minWidth=aQ+"px",this._state.matchesCount>=fX?this._matchesCount.title=nQ:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild),this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=fX&&(t+="+");let i=String(this._state.matchesPosition);"0"===i&&(i="?"),e=Qs(sQ,i,t)}else e=oQ;this._matchesCount.appendChild(document.createTextNode(e)),Ps(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),aQ=Math.max(aQ,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===oQ)return""===i?ue(0,"{0} found",e):ue(0,"{0} found for '{1}'",e,i);if(t){const n=ue(0,"{0} found for '{1}', at {2}",e,i,t.startLineNumber+":"+t.startColumn),s=this._codeEditor.getModel();if(s&&t.startLineNumber<=s.getLineCount()&&t.startLineNumber>=1){return`${s.getLineContent(t.startLineNumber)}, ${n}`}return n}return ue(0,"{0} found for '{1}'",e,i)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=!!e&&(e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn),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(90);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(41).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const t=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=t;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(41).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const n=Hn(i),s=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),o=n.left+(s?s.left:0),r=s?s.top:0;if(this._viewZone&&re.startLineNumber&&(t=!1);const i=Vn(this._domNode).left;o>i&&(t=!1);const s=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());n.left+(s?s.left:0)>i&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach((e=>{clearTimeout(e)})),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(41).addExtraSpaceOnTop)return void this._removeViewZone();if(!this._isVisible)return;const t=this._viewZone;void 0===this._viewZoneId&&t&&this._codeEditor.changeViewZones((i=>{t.heightInPx=this._getHeight(),this._viewZoneId=i.addZone(t),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+t.heightInPx)}))}_showViewZone(e=!0){if(!this._isVisible)return;if(!this._codeEditor.getOption(41).addExtraSpaceOnTop)return;void 0===this._viewZone&&(this._viewZone=new dQ(0));const t=this._viewZone;this._codeEditor.changeViewZones((i=>{if(void 0!==this._viewZoneId){const n=this._getHeight();if(n===t.heightInPx)return;const s=n-t.heightInPx;return t.heightInPx=n,i.layoutZone(this._viewZoneId),void(e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+s))}{let n=this._getHeight();if(n-=this._codeEditor.getOption(83).top,n<=0)return;t.heightInPx=n,this._viewZoneId=i.addZone(t),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+n)}}))}_removeViewZone(){this._codeEditor.changeViewZones((e=>{void 0!==this._viewZoneId&&(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)return;if(!xn(this._domNode))return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0)return void this._domNode.classList.add("hiddenEditor");this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const t=e.width,i=e.minimap.minimapWidth;let n=!1,s=!1,o=!1;if(this._resized){if(zn(this._domNode)>rQ)return this._domNode.style.maxWidth=t-28-i-15+"px",void(this._replaceInput.width=zn(this._findInput.domNode))}if(447+i>=t&&(s=!0),447+i-aQ>=t&&(o=!0),447+i-aQ>=t+50&&(n=!0),this._domNode.classList.toggle("collapsed-find-widget",n),this._domNode.classList.toggle("narrow-find-widget",o),this._domNode.classList.toggle("reduced-find-widget",s),o||n||(this._domNode.style.maxWidth=t-28-i-15+"px"),this._findInput.layout({collapsedFindWidget:n,narrowFindWidget:o,reducedFindWidget:s}),this._resized){const e=this._findInput.inputBox.element.clientWidth;e>0&&(this._replaceInput.width=e)}else this._isReplaceVisible&&(this._replaceInput.width=zn(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(null===this._cachedHeight||this._cachedHeight!==e)&&(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((e=>{1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(e.endLineNumber-1)));const t=this._state.currentMatch;return e.startLineNumber===e.endLineNumber||Rh.equalsRange(e,t)?null:e})).filter((e=>!!e)),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){return e.equals(3|hQ)?(this._keybindingService.dispatchEvent(e,e.target)||this._findInput.inputBox.insertAtCursor("\n"),void e.preventDefault()):e.equals(2)?(this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),void e.preventDefault()):e.equals(2066)?(this._codeEditor.focus(),void e.preventDefault()):e.equals(16)?cQ(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea")):e.equals(18)?uQ(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea")):void 0}_onReplaceInputKeyDown(e){return e.equals(3|hQ)?(this._keybindingService.dispatchEvent(e,e.target)||(Oe&&Be&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(ue(0,"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(lQ,!0,0,0)),this._replaceInput.inputBox.insertAtCursor("\n")),void e.preventDefault()):e.equals(2)?(this._findInput.focusOnCaseSensitive(),void e.preventDefault()):e.equals(1026)?(this._findInput.focus(),void e.preventDefault()):e.equals(2066)?(this._codeEditor.focus(),void e.preventDefault()):e.equals(16)?cQ(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea")):e.equals(18)?uQ(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea")):void 0}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){const e=!0,t=!0;this._findInput=this._register(new AX(null,this._contextViewProvider,{width:221,label:qX,placeholder:$X,appendCaseSensitiveLabel:this._keybindingLabelFor(lX),appendWholeWordsLabel:this._keybindingLabelFor(hX),appendRegexLabel:this._keybindingLabelFor(dX),validation:e=>{if(0===e.length||!this._findInput.getRegex())return null;try{return new RegExp(e,"gu"),null}catch(Mre){return{content:Mre.message}}},flexibleHeight:e,flexibleWidth:t,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>PX(this._keybindingService),inputBoxStyles:Zx,toggleStyles:Gx},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((e=>this._onFindInputKeyDown(e)))),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((e=>{e.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),e.preventDefault())}))),this._register(this._findInput.onRegexKeyDown((e=>{e.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),e.preventDefault())}))),this._register(this._findInput.inputBox.onDidHeightChange((e=>{this._tryUpdateHeight()&&this._showViewZone()}))),Fe&&this._register(this._findInput.onMouseDown((e=>this._onFindInputMouseDown(e)))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new pQ({label:GX+this._keybindingLabelFor(iX),icon:UX,onTrigger:()=>{$r(this._codeEditor.getAction(iX)).run().then(void 0,r)}})),this._nextBtn=this._register(new pQ({label:ZX+this._keybindingLabelFor(tX),icon:KX,onTrigger:()=>{$r(this._codeEditor.getAction(tX)).run().then(void 0,r)}}));const i=document.createElement("div");i.className="find-part",i.appendChild(this._findInput.domNode);const n=document.createElement("div");n.className="find-actions",i.appendChild(n),n.appendChild(this._matchesCount),n.appendChild(this._prevBtn.domNode),n.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new vV({icon:BX,title:YX+this._keybindingLabelFor(cX),isChecked:!1,inputActiveOptionBackground:Sp(Vp),inputActiveOptionBorder:Sp(Wp),inputActiveOptionForeground:Sp(Hp)})),this._register(this._toggleSelectionFind.onChange((()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){const e=this._codeEditor.getSelections();e.map((e=>(1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(e.endLineNumber-1))),e.isEmpty()?null:e))).filter((e=>!!e)),e.length&&this._state.change({searchScope:e},!0)}}else this._state.change({searchScope:null},!0)}))),n.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new pQ({label:XX+this._keybindingLabelFor(aX),icon:rR,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:e=>{e.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),e.preventDefault())}})),this._replaceInput=this._register(new OX(null,void 0,{label:QX,placeholder:JX,appendPreserveCaseLabel:this._keybindingLabelFor(uX),history:[],flexibleHeight:e,flexibleWidth:t,flexibleMaxHeight:118,showHistoryHint:()=>PX(this._keybindingService),inputBoxStyles:Zx,toggleStyles:Gx},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown((e=>this._onReplaceInputKeyDown(e)))),this._register(this._replaceInput.inputBox.onDidChange((()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)}))),this._register(this._replaceInput.inputBox.onDidHeightChange((e=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()}))),this._register(this._replaceInput.onDidOptionChange((()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)}))),this._register(this._replaceInput.onPreserveCaseKeyDown((e=>{e.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),e.preventDefault())}))),this._replaceBtn=this._register(new pQ({label:eQ+this._keybindingLabelFor(gX),icon:HX,onTrigger:()=>{this._controller.replace()},onKeyDown:e=>{e.equals(1026)&&(this._closeBtn.focus(),e.preventDefault())}})),this._replaceAllBtn=this._register(new pQ({label:tQ+this._keybindingLabelFor(pX),icon:zX,onTrigger:()=>{this._controller.replaceAll()}}));const s=document.createElement("div");s.className="replace-part",s.appendChild(this._replaceInput.domNode);const o=document.createElement("div");o.className="replace-actions",s.appendChild(o),o.appendChild(this._replaceBtn.domNode),o.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new pQ({label:iQ,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=zn(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}})),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=jX,this._domNode.role="dialog",this._domNode.style.width="419px",this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(i),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(s),this._resizeSash=new SW(this._domNode,this,{orientation:0,size:2}),this._resized=!1;let a=rQ;this._register(this._resizeSash.onDidStart((()=>{a=zn(this._domNode)}))),this._register(this._resizeSash.onDidChange((e=>{this._resized=!0;const t=a+e.startX-e.currentX;if(t(parseFloat(Pn(this._domNode).maxWidth)||0)||(this._domNode.style.width=`${t}px`,this._isReplaceVisible&&(this._replaceInput.width=zn(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())}))),this._register(this._resizeSash.onDidReset((()=>{const e=zn(this._domNode);if(e{this._opts.onTrigger(),e.preventDefault()})),this.onkeydown(this._domNode,(e=>{var t,i;if(e.equals(10)||e.equals(3))return this._opts.onTrigger(),void e.preventDefault();null===(i=(t=this._opts).onKeyDown)||void 0===i||i.call(t,e)}))}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(...ta.asClassNameArray(WX)),this._domNode.classList.add(...ta.asClassNameArray(VX))):(this._domNode.classList.remove(...ta.asClassNameArray(VX)),this._domNode.classList.add(...ta.asClassNameArray(WX)))}}H_(((e,t)=>{const i=(e,i)=>{i&&t.addRule(`.monaco-editor ${e} { background-color: ${i}; }`)};i(".findMatch",e.getColor(Um)),i(".currentFindMatch",e.getColor(zm)),i(".findScope",e.getColor(Km));i(".find-widget",e.getColor(km));const n=e.getColor(Ap);n&&t.addRule(`.monaco-editor .find-widget { box-shadow: 0 0 8px 2px ${n}; }`);const s=e.getColor(Op);s&&t.addRule(`.monaco-editor .find-widget { border-left: 1px solid ${s}; border-right: 1px solid ${s}; border-bottom: 1px solid ${s}; }`);const o=e.getColor(qm);o&&t.addRule(`.monaco-editor .findMatch { border: 1px ${A_(e.type)?"dotted":"solid"} ${o}; box-sizing: border-box; }`);const r=e.getColor(jm);r&&t.addRule(`.monaco-editor .currentFindMatch { border: 2px solid ${r}; padding: 1px; box-sizing: border-box; }`);const a=e.getColor($m);a&&t.addRule(`.monaco-editor .findScope { border: 1px ${A_(e.type)?"dashed":"solid"} ${a}; }`);const l=e.getColor(Mp);l&&t.addRule(`.monaco-editor .find-widget { border: 1px solid ${l}; }`);const h=e.getColor(Dm);h&&t.addRule(`.monaco-editor .find-widget { color: ${h}; }`);const d=e.getColor(Np);d&&t.addRule(`.monaco-editor .find-widget.no-results .matchesCount { color: ${d}; }`);const c=e.getColor(Nm);if(c)t.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${c}; }`);else{const i=e.getColor(xm);i&&t.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${i}; }`)}const u=e.getColor(Qf);u&&t.addRule(`\n\t\t.monaco-editor .find-widget .button:not(.disabled):hover,\n\t\t.monaco-editor .find-widget .codicon-find-selection:hover {\n\t\t\tbackground-color: ${u} !important;\n\t\t}\n\t`);const g=e.getColor(Ip);g&&t.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${g}; }`)}));var mQ,fQ=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},_Q=function(e,t){return function(i,n){t(i,n,e)}},vQ=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function bQ(e,t="single",i=!1){if(!e.hasModel())return null;const n=e.getSelection();if("single"===t&&n.startLineNumber===n.endLineNumber||"multiple"===t)if(n.isEmpty()){const t=e.getConfiguredWordAtPosition(n.getStartPosition());if(t&&!1===i)return t.word}else if(e.getModel().getValueLengthInRange(n)<524288)return e.getModel().getValueInRange(n);return null}let CQ=mQ=class extends E{get editor(){return this._editor}static get(e){return e.getContribution(mQ.ID)}constructor(e,t,i,n,s){super(),this._editor=e,this._findWidgetVisible=KY.bindTo(t),this._contextKeyService=t,this._storageService=i,this._clipboardService=n,this._notificationService=s,this._updateHistoryDelayer=new Jh(500),this._state=this._register(new CX),this.loadQueryState(),this._register(this._state.onFindReplaceStateChange((e=>this._onStateChanged(e)))),this._model=null,this._register(this._editor.onDidChangeModel((()=>{const e=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),e&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(41).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,1,1),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,1),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,1),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,1)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!jY.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()){const e=this._editor.getSelections();e.map((e=>(1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._editor.getModel().getLineMaxColumn(e.endLineNumber-1))),e.isEmpty()?null:e))).filter((e=>!!e)),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=eo(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}_start(e,t){return vQ(this,void 0,void 0,(function*(){if(this.disposeModel(),!this._editor.hasModel())return;const i=Object.assign(Object.assign({},t),{isRevealed:!0});if("single"===e.seedSearchStringFromSelection){const t=bQ(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);t&&(this._state.isRegex?i.searchString=eo(t):i.searchString=t)}else if("multiple"===e.seedSearchStringFromSelection&&!e.updateSearchScope){const t=bQ(this._editor,e.seedSearchStringFromSelection);t&&(i.searchString=t)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const e=yield this.getGlobalBufferTerm();if(!this._editor.hasModel())return;e&&(i.searchString=e)}if(e.forceRevealReplace||i.isReplaceRevealed?i.isReplaceRevealed=!0:this._findWidgetVisible.get()||(i.isReplaceRevealed=!1),e.updateSearchScope){const e=this._editor.getSelections();e.some((e=>!e.isEmpty()))&&(i.searchScope=e)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new _X(this._editor,this._state))}))}start(e,t){return this._start(e,t)}moveToNextMatch(){return!!this._model&&(this._model.moveToNextMatch(),!0)}moveToPrevMatch(){return!!this._model&&(this._model.moveToPrevMatch(),!0)}goToMatch(e){return!!this._model&&(this._model.moveToMatch(e),!0)}replace(){return!!this._model&&(this._model.replace(),!0)}replaceAll(){var e;return!!this._model&&((null===(e=this._editor.getModel())||void 0===e?void 0:e.isTooLargeForHeapOperation())?(this._notificationService.warn(ue(0,"The file is too large to perform a replace all operation.")),!1):(this._model.replaceAll(),!0))}selectAllMatches(){return!!this._model&&(this._model.selectAllMatches(),this._editor.focus(),!0)}getGlobalBufferTerm(){return vQ(this,void 0,void 0,(function*(){return this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""}))}setGlobalBufferTerm(e){this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}};CQ.ID="editor.contrib.findController",CQ=mQ=fQ([_Q(1,Ol),_Q(2,ZN),_Q(3,eS),_Q(4,mL)],CQ);let wQ=class extends CQ{constructor(e,t,i,n,s,o,r,a){super(e,i,r,a,o),this._contextViewService=t,this._keybindingService=n,this._themeService=s,this._widget=null,this._findOptionsWidget=null}_start(e,t){const i=Object.create(null,{_start:{get:()=>super._start}});return vQ(this,void 0,void 0,(function*(){this._widget||this._createFindWidget();const n=this._editor.getSelection();let s=!1;switch(this._editor.getOption(41).autoFindInSelection){case"always":s=!0;break;case"never":s=!1;break;case"multiline":s=!!n&&n.startLineNumber!==n.endLineNumber;break}e.updateSearchScope=e.updateSearchScope||s,yield i._start.call(this,e,t),this._widget&&(2===e.shouldFocus?this._widget.focusReplaceInput():1===e.shouldFocus&&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 gQ(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new vX(this._editor,this._state,this._keybindingService))}};wQ=fQ([_Q(1,Ux),_Q(2,Ol),_Q(3,WL),_Q(4,P_),_Q(5,mL),_Q(6,ZN),_Q(7,eS)],wQ);kh(new Ch({id:QY,label:ue(0,"Find"),alias:"Find",precondition:pl.or(Oh.focus,pl.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:eh.MenubarEditMenu,group:"3_find",title:ue(0,"&&Find"),order:1}})).addImplementation(0,((e,t,i)=>{const n=CQ.get(t);return!!n&&n.start({forceRevealReplace:!1,seedSearchStringFromSelection:"never"!==t.getOption(41).seedSearchStringFromSelection?"single":"none",seedSearchStringFromNonEmptySelection:"selection"===t.getOption(41).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:t.getOption(41).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop})}));const yQ={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"},regex:{type:"boolean"},regexOverride:{type:"number",description:ue(0,'Overrides "Use Regular Expression" flag.\nThe flag will not be saved for the future.\n0: Do Nothing\n1: True\n2: False')},wholeWord:{type:"boolean"},wholeWordOverride:{type:"number",description:ue(0,'Overrides "Match Whole Word" flag.\nThe flag will not be saved for the future.\n0: Do Nothing\n1: True\n2: False')},matchCase:{type:"boolean"},matchCaseOverride:{type:"number",description:ue(0,'Overrides "Math Case" flag.\nThe flag will not be saved for the future.\n0: Do Nothing\n1: True\n2: False')},preserveCase:{type:"boolean"},preserveCaseOverride:{type:"number",description:ue(0,'Overrides "Preserve Case" flag.\nThe flag will not be saved for the future.\n0: Do Nothing\n1: True\n2: False')},findInSelection:{type:"boolean"}}}}]};class SQ extends bh{run(e,t){return vQ(this,void 0,void 0,(function*(){const e=CQ.get(t);e&&!this._run(e)&&(yield e.start({forceRevealReplace:!1,seedSearchStringFromSelection:0===e.getState().searchString.length&&"never"!==t.getOption(41).seedSearchStringFromSelection?"single":"none",seedSearchStringFromNonEmptySelection:"selection"===t.getOption(41).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(e))}))}}class LQ extends bh{run(e,t){return vQ(this,void 0,void 0,(function*(){const e=CQ.get(t);if(!e)return;const i=bQ(t,"single",!1);i&&e.setSearchString(i),this._run(e)||(yield e.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(e))}))}}kh(new Ch({id:rX,label:ue(0,"Replace"),alias:"Replace",precondition:pl.or(Oh.focus,pl.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:eh.MenubarEditMenu,group:"3_find",title:ue(0,"&&Replace"),order:2}})).addImplementation(0,((e,t,i)=>{if(!t.hasModel()||t.getOption(90))return!1;const n=CQ.get(t);if(!n)return!1;const s=t.getSelection(),o=n.isFindInputFocused(),r=!s.isEmpty()&&s.startLineNumber===s.endLineNumber&&"never"!==t.getOption(41).seedSearchStringFromSelection&&!o,a=o||r?2:1;return n.start({forceRevealReplace:!0,seedSearchStringFromSelection:r?"single":"none",seedSearchStringFromNonEmptySelection:"selection"===t.getOption(41).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:"never"!==t.getOption(41).seedSearchStringFromSelection,shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop})})),Dh(CQ.ID,wQ,0),Lh(class extends bh{constructor(){super({id:eX,label:ue(0,"Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},description:yQ})}run(e,t,i){return vQ(this,void 0,void 0,(function*(){const e=CQ.get(t);if(e){const n=i?{searchString:i.searchString,replaceString:i.replaceString,isReplaceRevealed:void 0!==i.replaceString,isRegex:i.isRegex,wholeWord:i.matchWholeWord,matchCase:i.isCaseSensitive,preserveCase:i.preserveCase}:{};yield e.start({forceRevealReplace:!1,seedSearchStringFromSelection:0===e.getState().searchString.length&&"never"!==t.getOption(41).seedSearchStringFromSelection?"single":"none",seedSearchStringFromNonEmptySelection:"selection"===t.getOption(41).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:(null==i?void 0:i.findInSelection)||!1,loop:t.getOption(41).loop},n),e.setGlobalBufferTerm(e.getState().searchString)}}))}}),Lh(class extends bh{constructor(){super({id:JY,label:ue(0,"Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}run(e,t){return vQ(this,void 0,void 0,(function*(){const e=CQ.get(t);e&&(yield e.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),e.setGlobalBufferTerm(e.getState().searchString))}))}}),Lh(class extends SQ{constructor(){super({id:tX,label:ue(0,"Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:Oh.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:pl.and(Oh.focus,jY),primary:3,weight:100}]})}_run(e){return!!e.moveToNextMatch()&&(e.editor.pushUndoStop(),!0)}}),Lh(class extends SQ{constructor(){super({id:iX,label:ue(0,"Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:Oh.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:pl.and(Oh.focus,jY),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}),Lh(class extends bh{constructor(){super({id:nX,label:ue(0,"Go to Match..."),alias:"Go to Match...",precondition:KY}),this._highlightDecorations=[]}run(e,t,i){const n=CQ.get(t);if(!n)return;const s=n.getState().matchesCount;if(s<1){return void e.get(mL).notify({severity:pL.Warning,message:ue(0,"No matches. Try searching for something else.")})}const o=e.get(cE).createInputBox();o.placeholder=ue(0,"Type a number to go to a specific match (between 1 and {0})",s);const r=e=>{const t=parseInt(e);if(isNaN(t))return;const i=n.getState().matchesCount;return t>0&&t<=i?t-1:t<0&&t>=-i?i+t:void 0},a=e=>{const i=r(e);if("number"==typeof i){o.validationMessage=void 0,n.goToMatch(i);const e=n.getState().currentMatch;e&&this.addDecorations(t,e)}else o.validationMessage=ue(0,"Please type a number between 1 and {0}",n.getState().matchesCount),this.clearDecorations(t)};o.onDidChangeValue((e=>{a(e)})),o.onDidAccept((()=>{const e=r(o.value);"number"==typeof e?(n.goToMatch(e),o.hide()):o.validationMessage=ue(0,"Please type a number between 1 and {0}",n.getState().matchesCount)})),o.onDidHide((()=>{this.clearDecorations(t),o.dispose()})),o.show()}clearDecorations(e){e.changeDecorations((e=>{this._highlightDecorations=e.deltaDecorations(this._highlightDecorations,[])}))}addDecorations(e,t){e.changeDecorations((e=>{this._highlightDecorations=e.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:F_(mv),position:Cd.Full}}}])}))}}),Lh(class extends LQ{constructor(){super({id:sX,label:ue(0,"Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:Oh.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}),Lh(class extends LQ{constructor(){super({id:oX,label:ue(0,"Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:Oh.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}});const kQ=vh.bindToContribution(CQ.get);Sh(new kQ({id:aX,precondition:KY,handler:e=>e.closeFindWidget(),kbOpts:{weight:105,kbExpr:pl.and(Oh.focus,pl.not("isComposing")),primary:9,secondary:[1033]}})),Sh(new kQ({id:lX,precondition:void 0,handler:e=>e.toggleCaseSensitive(),kbOpts:{weight:105,kbExpr:Oh.focus,primary:$Y.primary,mac:$Y.mac,win:$Y.win,linux:$Y.linux}})),Sh(new kQ({id:hX,precondition:void 0,handler:e=>e.toggleWholeWords(),kbOpts:{weight:105,kbExpr:Oh.focus,primary:GY.primary,mac:GY.mac,win:GY.win,linux:GY.linux}})),Sh(new kQ({id:dX,precondition:void 0,handler:e=>e.toggleRegex(),kbOpts:{weight:105,kbExpr:Oh.focus,primary:ZY.primary,mac:ZY.mac,win:ZY.win,linux:ZY.linux}})),Sh(new kQ({id:cX,precondition:void 0,handler:e=>e.toggleSearchScope(),kbOpts:{weight:105,kbExpr:Oh.focus,primary:YY.primary,mac:YY.mac,win:YY.win,linux:YY.linux}})),Sh(new kQ({id:uX,precondition:void 0,handler:e=>e.togglePreserveCase(),kbOpts:{weight:105,kbExpr:Oh.focus,primary:XY.primary,mac:XY.mac,win:XY.win,linux:XY.linux}})),Sh(new kQ({id:gX,precondition:KY,handler:e=>e.replace(),kbOpts:{weight:105,kbExpr:Oh.focus,primary:3094}})),Sh(new kQ({id:gX,precondition:KY,handler:e=>e.replace(),kbOpts:{weight:105,kbExpr:pl.and(Oh.focus,qY),primary:3}})),Sh(new kQ({id:pX,precondition:KY,handler:e=>e.replaceAll(),kbOpts:{weight:105,kbExpr:Oh.focus,primary:2563}})),Sh(new kQ({id:pX,precondition:KY,handler:e=>e.replaceAll(),kbOpts:{weight:105,kbExpr:pl.and(Oh.focus,qY),primary:void 0,mac:{primary:2051}}})),Sh(new kQ({id:mX,precondition:KY,handler:e=>e.selectAllMatches(),kbOpts:{weight:105,kbExpr:Oh.focus,primary:515}}));const DQ={0:" ",1:"u",2:"r"},xQ=16777215,NQ=4278190080;class EQ{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<65535)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new EQ(e.length),this._userDefinedStates=new EQ(e.length),this._recoveredStates=new EQ(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(t,i)=>{const n=e[e.length-1];return this.getStartLineNumber(n)<=t&&this.getEndLineNumber(n)>=i};for(let i=0,n=this._startIndexes.length;ixQ||s>xQ)throw new Error("startLineNumber or endLineNumber must not exceed "+xQ);for(;e.length>0&&!t(n,s);)e.pop();const o=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=n+((255&o)<<24),this._endIndexes[i]=s+((65280&o)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&xQ}getEndLineNumber(e){return this._endIndexes[e]&xQ}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)?1:this.isRecovered(e)?2:0}setSource(e,t){1===t?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):2===t?(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]&NQ)>>>16);return 65535===t?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(0===i)return-1;for(;t=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);-1!==t;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;tArray.isArray(e)?i=>ii=h.startLineNumber))l&&l.startLineNumber===h.startLineNumber?(1===h.source?e=h:(e=l,e.isCollapsed=h.isCollapsed&&l.endLineNumber===h.endLineNumber,e.source=0),l=s(++r)):(e=h,h.isCollapsed&&0===h.source&&(e.source=2)),h=o(++a);else{let t=a,i=h;for(;;){if(!i||i.startLineNumber>l.endLineNumber){e=l;break}if(1===i.source&&i.endLineNumber>l.endLineNumber)break;i=o(++t)}l=s(++r)}if(e){for(;c&&c.endLineNumbere.startLineNumber&&e.startLineNumber>u&&e.endLineNumber<=i&&(!c||c.endLineNumber>=e.endLineNumber)&&(g.push(e),u=e.startLineNumber,c&&d.push(c),c=e)}}return g}}class MQ{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}}class TQ{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new U,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new IQ(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort(((e,t)=>e.regionIndex-t.regionIndex));const t={};this._decorationProvider.changeDecorations((i=>{let n=0,s=-1,o=-1;const r=e=>{for(;no&&(o=e),n++}};for(const a of e){const e=a.regionIndex,i=this._editorDecorationIds[e];if(i&&!t[i]){t[i]=!0,r(e);const n=!this._regions.isCollapsed(e);this._regions.setCollapsed(e,n),s=Math.max(s,this._regions.getEndLineNumber(e))}}r(this._regions.length)})),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=t=>{for(const i of e)if(!(i.startLineNumber>t.endLineNumber||t.startLineNumber>i.endLineNumber))return!0;return!1};for(let n=0;ni&&(i=o)}this._decorationProvider.changeDecorations((e=>this._editorDecorationIds=e.deltaDecorations(this._editorDecorationIds,t))),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(t,i)=>{for(const n of e)if(t=s.endLineNumber||s.startLineNumber<1||s.endLineNumber>i)continue;const o=this._getLinesChecksum(s.startLineNumber+1,s.endLineNumber);t.push({startLineNumber:s.startLineNumber,endLineNumber:s.endLineNumber,isCollapsed:s.isCollapsed,source:s.source,checksum:o})}return t.length>0?t:void 0}applyMemento(e){var t,i;if(!Array.isArray(e))return;const n=[],s=this._textModel.getLineCount();for(const r of e){if(r.startLineNumber>=r.endLineNumber||r.startLineNumber<1||r.endLineNumber>s)continue;const e=this._getLinesChecksum(r.startLineNumber+1,r.endLineNumber);r.checksum&&e!==r.checksum||n.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,type:void 0,isCollapsed:null===(t=r.isCollapsed)||void 0===t||t,source:null!==(i=r.source)&&void 0!==i?i:0})}const o=IQ.sanitizeAndMerge(this._regions,n,s);this.updatePost(IQ.fromFoldRanges(o))}_getLinesChecksum(e,t){return uE(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),s=1;for(;n>=0;){const e=this._regions.toRegion(n);t&&!t(e,s)||i.push(e),s++,n=e.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,s=e?e.endLineNumber:Number.MAX_VALUE;if(t&&2===t.length){const e=[];for(let o=n,r=this._regions.length;o0&&!n.containedBy(e[e.length-1]);)e.pop();e.push(n),t(n,e.length)&&i.push(n)}}else for(let o=n,r=this._regions.length;o1){const o=e.getRegionsInside(i,((e,i)=>e.isCollapsed!==s&&i0)for(const o of n){const n=e.getRegionAtLine(o);if(n&&(n.isCollapsed!==t&&s.push(n),i>1)){const o=e.getRegionsInside(n,((e,n)=>e.isCollapsed!==t&&ne.isCollapsed!==t&&ne.isCollapsed!==t&&n<=i));s.push(...n)}e.toggleCollapseState(s)}function PQ(e,t,i){const n=[];for(const o of i){const t=e.getAllRegionsAtLine(o,void 0);t.length>0&&n.push(t[0])}const s=e.getRegionsInside(null,(e=>n.every((t=>!t.containedBy(e)&&!e.containedBy(t)))&&e.isCollapsed!==t));e.toggleCollapseState(s)}function FQ(e,t,i){const n=e.textModel,s=e.regions,o=[];for(let r=s.length-1;r>=0;r--)if(i!==s.isCollapsed(r)){const e=s.getStartLineNumber(r);t.test(n.getLineContent(e))&&o.push(s.toRegion(r))}e.toggleCollapseState(o)}function BQ(e,t,i){const n=e.regions,s=[];for(let o=n.length-1;o>=0;o--)i!==n.isCollapsed(o)&&t===n.getType(o)&&s.push(n.toRegion(o));e.toggleCollapseState(s)}class WQ{get onDidChange(){return this._updateEventEmitter.event}get hiddenRanges(){return this._hiddenRanges}constructor(e){this._updateEventEmitter=new U,this._hasLineChanges=!1,this._foldingModel=e,this._foldingModelListener=e.onDidChange((e=>this.updateHiddenRanges())),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some((e=>e.range.endLineNumber!==e.range.startLineNumber||0!==hc(e.text)[0])))}updateHiddenRanges(){let e=!1;const t=[];let i=0,n=0,s=Number.MAX_VALUE,o=-1;const r=this._foldingModel.regions;for(;i0}isHidden(e){return null!==VQ(this._hiddenRanges,e)}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let n=null;const s=e=>(n&&function(e,t){return e>=t.startLineNumber&&e<=t.endLineNumber}(e,n)||(n=VQ(this._hiddenRanges,e)),n?n.startLineNumber-1:null);for(let o=0,r=e.length;o0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function VQ(e,t){const i=_c(e,(e=>t=0&&e[i].endLineNumber>=t?e[i]:null}class HQ{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id="indent"}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,n=t&&t.markers;return Promise.resolve(function(e,t,i,n=UQ){const s=e.getOptions().tabSize,o=new zQ(n);let r;i&&(r=new RegExp(`(${i.start.source})|(?:${i.end.source})`));const a=[],l=e.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let h=e.getLineCount();h>0;h--){const i=e.getLineContent(h),n=Xv(i,s);let l,d=a[a.length-1];if(-1!==n){if(r&&(l=i.match(r))){if(!l[1]){a.push({indent:-2,endAbove:h,line:h});continue}{let e=a.length-1;for(;e>0&&-2!==a[e].indent;)e--;if(e>0){a.length=e+1,d=a[e],o.insertFirst(h,d.line,n),d.line=h,d.indent=n,d.endAbove=h;continue}}}if(d.indent>n){do{a.pop(),d=a[a.length-1]}while(d.indent>n);const e=d.endAbove-1;e-h>=1&&o.insertFirst(h,e,n)}d.indent===n?d.endAbove=h:a.push({indent:n,endAbove:h,line:h})}else t&&(d.endAbove=h)}return o.toIndentRanges(e)}(this.editorModel,i,n,this.foldingRangesLimit))}}class zQ{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>xQ||t>xQ)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 e=new Uint32Array(this._length),t=new Uint32Array(this._length);for(let i=this._length-1,n=0;i>=0;i--,n++)e[n]=this._startIndexes[i],t[n]=this._endIndexes[i];return new IQ(e,t)}{this._foldingRangesLimit.update(this._length,t);let i=0,n=this._indentOccurrences.length;for(let e=0;et){n=e;break}i+=s}}const s=e.getOptions().tabSize,o=new Uint32Array(t),r=new Uint32Array(t);for(let a=this._length-1,l=0;a>=0;a--){const h=this._startIndexes[a],d=Xv(e.getLineContent(h),s);(d{}};const KQ=Dp("editor.foldBackground",{light:D_(Bm,.3),dark:D_(Bm,.3),hcDark:null,hcLight:null},ue(0,"Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);Dp("editorGutter.foldingControlForeground",{dark:Ep,light:Ep,hcDark:Ep,hcLight:Ep},ue(0,"Color of the folding control in the editor gutter."));const jQ=tR("folding-expanded",Jr.chevronDown,ue(0,"Icon for expanded ranges in the editor glyph margin.")),qQ=tR("folding-collapsed",Jr.chevronRight,ue(0,"Icon for collapsed ranges in the editor glyph margin.")),$Q=tR("folding-manual-collapsed",qQ,ue(0,"Icon for manually collapsed ranges in the editor glyph margin.")),GQ=tR("folding-manual-expanded",jQ,ue(0,"Icon for manually expanded ranges in the editor glyph margin.")),ZQ={color:F_(KQ),position:yd.Inline};class YQ{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?YQ.HIDDEN_RANGE_DECORATION:"never"===this.showFoldingControls?e?this.showFoldingHighlights?YQ.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:YQ.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:YQ.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?YQ.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:YQ.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?YQ.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:YQ.COLLAPSED_VISUAL_DECORATION:"mouseover"===this.showFoldingControls?i?YQ.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:YQ.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?YQ.MANUALLY_EXPANDED_VISUAL_DECORATION:YQ.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}YQ.COLLAPSED_VISUAL_DECORATION=Iw.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:ta.asClassName(qQ)}),YQ.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Iw.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:ZQ,isWholeLine:!0,firstLineDecorationClassName:ta.asClassName(qQ)}),YQ.MANUALLY_COLLAPSED_VISUAL_DECORATION=Iw.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:ta.asClassName($Q)}),YQ.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Iw.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:ZQ,isWholeLine:!0,firstLineDecorationClassName:ta.asClassName($Q)}),YQ.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Iw.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0}),YQ.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Iw.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:ZQ,isWholeLine:!0}),YQ.EXPANDED_VISUAL_DECORATION=Iw.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+ta.asClassName(jQ)}),YQ.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Iw.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:ta.asClassName(jQ)}),YQ.MANUALLY_EXPANDED_VISUAL_DECORATION=Iw.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+ta.asClassName(GQ)}),YQ.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Iw.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:ta.asClassName(GQ)}),YQ.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Iw.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0}),YQ.HIDDEN_RANGE_DECORATION=Iw.register({description:"folding-hidden-range-decoration",stickiness:1});const XQ={};class QQ{constructor(e,t,i,n,s){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=n,this.fallbackRangeProvider=s,this.id="syntax",this.disposables=new N,s&&this.disposables.add(s);for(const o of t)"function"==typeof o.onDidChange&&this.disposables.add(o.onDidChange(i))}compute(e){return function(e,t,i){let n=null;const s=e.map(((e,s)=>Promise.resolve(e.provideFoldingRanges(t,XQ,i)).then((e=>{if(!i.isCancellationRequested&&Array.isArray(e)){Array.isArray(n)||(n=[]);const i=t.getLineCount();for(const t of e)t.start>0&&t.end>t.start&&t.end<=i&&n.push({start:t.start,end:t.end,rank:s,kind:t.kind})}}),a)));return Promise.all(s).then((e=>n))}(this.providers,this.editorModel,e).then((t=>{var i,n;if(t){return function(e,t){const i=e.sort(((e,t)=>{let i=e.start-t.start;return 0===i&&(i=e.rank-t.rank),i})),n=new JQ(t);let s;const o=[];for(const r of i)if(s){if(r.start>s.start)if(r.end<=s.end)o.push(s),s=r,n.add(r.start,r.end,r.kind&&r.kind.value,o.length);else{if(r.start>s.end){do{s=o.pop()}while(s&&r.start>s.end);s&&o.push(s),s=r}n.add(r.start,r.end,r.kind&&r.kind.value,o.length)}}else s=r,n.add(r.start,r.end,r.kind&&r.kind.value,o.length);return n.toIndentRanges()}(t,this.foldingRangesLimit)}return null!==(n=null===(i=this.fallbackRangeProvider)||void 0===i?void 0:i.compute(e))&&void 0!==n?n:null}))}dispose(){this.disposables.dispose()}}class JQ{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>xQ||t>xQ)return;const s=this._length;this._startIndexes[s]=e,this._endIndexes[s]=t,this._nestingLevels[s]=n,this._types[s]=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 e=new Uint32Array(this._length),t=new Uint32Array(this._length);for(let i=0;ie){i=r;break}t+=n}}const n=new Uint32Array(e),s=new Uint32Array(e),o=[];for(let r=0,a=0;r=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},iJ=function(e,t){return function(i,n){t(i,n,e)}},nJ=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const sJ=new Al("foldingEnabled",!1);let oJ=eJ=class extends E{static get(e){return e.getContribution(eJ.ID)}static getFoldingRangeProviders(e,t){var i,n;const s=e.foldingRangeProvider.ordered(t);return null!==(n=null===(i=eJ._foldingRangeSelector)||void 0===i?void 0:i.call(eJ,s,t))&&void 0!==n?n:s}constructor(e,t,i,n,s,o){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=o,this.localToDispose=this._register(new N),this.editor=e,this._foldingLimitReporter=new rJ(e);const r=this.editor.getOptions();this._isEnabled=r.get(43),this._useFoldingProviders="indentation"!==r.get(44),this._unfoldOnClickAfterEndOfLine=r.get(48),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=r.get(46),this.updateDebounceInfo=s.for(o.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 YQ(e),this.foldingDecorationProvider.showFoldingControls=r.get(109),this.foldingDecorationProvider.showFoldingHighlights=r.get(45),this.foldingEnabled=sJ.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel((()=>this.onModelChanged()))),this._register(this.editor.onDidChangeConfiguration((e=>{if(e.hasChanged(43)&&(this._isEnabled=this.editor.getOptions().get(43),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),e.hasChanged(47)&&this.onModelChanged(),e.hasChanged(109)||e.hasChanged(45)){const e=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=e.get(109),this.foldingDecorationProvider.showFoldingHighlights=e.get(45),this.triggerFoldingModelChanged()}e.hasChanged(44)&&(this._useFoldingProviders="indentation"!==this.editor.getOptions().get(44),this.onFoldingStrategyChanged()),e.hasChanged(48)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(48)),e.hasChanged(46)&&(this._foldingImportsByDefault=this.editor.getOptions().get(46))}))),this.onModelChanged()}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 TQ(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new WQ(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange((e=>this.onHiddenRangesChanges(e)))),this.updateScheduler=new Jh(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new rd((()=>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((e=>this.onDidChangeModelContent(e)))),this.localToDispose.add(this.editor.onDidChangeCursorPosition((()=>this.onCursorPositionChanged()))),this.localToDispose.add(this.editor.onMouseDown((e=>this.onEditorMouseDown(e)))),this.localToDispose.add(this.editor.onMouseUp((e=>this.onEditorMouseUp(e)))),this.localToDispose.add({dispose:()=>{var e,t;this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),null===(e=this.updateScheduler)||void 0===e||e.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,null===(t=this.rangeProvider)||void 0===t||t.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var e;null===(e=this.rangeProvider)||void 0===e||e.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new HQ(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=eJ.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new QQ(e,i,(()=>this.triggerFoldingModelChanged()),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;null===(t=this.hiddenRangeModel)||void 0===t||t.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 F,i=this.getRangeProvider(e.textModel),n=this.foldingRegionPromise=Yh((e=>i.compute(e)));return n.then((i=>{if(i&&n===this.foldingRegionPromise){let n;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const e=i.setCollapsedAllOfType(xC.Imports.value,!0);e&&(n=WN.capture(this.editor),this._currentModelHasFoldedImports=e)}const s=this.editor.getSelections(),o=s?s.map((e=>e.startLineNumber)):[];e.update(i,o),null==n||n.restore(this.editor);const r=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=r)}return e}))})).then(void 0,(e=>(r(e),null))))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const e=this.editor.getSelections();e&&this.hiddenRangeModel.adjustSelections(e)&&this.editor.setSelections(e)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then((e=>{if(e){const t=this.editor.getSelections();if(t&&t.length>0){const i=[];for(const n of t){const t=n.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(t)&&i.push(...e.getAllRegionsAtLine(t,(e=>e.isCollapsed&&t>e.startLineNumber)))}i.length&&(e.toggleCollapseState(i),this.reveal(t[0].getPosition()))}}})).then(void 0,r)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range)return;if(!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:{const t=e.target.detail,n=e.target.element.offsetLeft;if(t.offsetX-n<4)return;i=!0;break}case 7:if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()){if(!e.target.detail.isAfterLines)break}return;case 6:if(this.hiddenRangeModel.hasRanges()){const e=this.editor.getModel();if(e&&t.startColumn===e.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,s=e.target.range;if(!s||s.startLineNumber!==i)return;if(n){if(4!==e.target.type)return}else{const e=this.editor.getModel();if(!e||s.startColumn!==e.getLineMaxColumn(i))return}const o=t.getRegionAtLine(i);if(o&&o.startLineNumber===i){const s=o.isCollapsed;if(n||s){let n=[];if(e.event.altKey){const e=e=>!e.containedBy(o)&&!o.containedBy(e),i=t.getRegionsInside(null,e);for(const t of i)t.isCollapsed&&n.push(t);0===n.length&&(n=i)}else{const i=e.event.middleButton||e.event.shiftKey;if(i)for(const e of t.getRegionsInside(o))e.isCollapsed===s&&n.push(e);!s&&i&&0!==n.length||n.push(o)}t.toggleCollapseState(n),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};oJ.ID="editor.contrib.folding",oJ=eJ=tJ([iJ(1,Ol),iJ(2,Ju),iJ(3,mL),iJ(4,SE),iJ(5,oL)],oJ);class rJ{constructor(e){this.editor=e,this._onDidChange=new U,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(47)}update(e,t){e===this._computed&&t===this._limited||(this._computed=e,this._limited=t,this._onDidChange.fire())}}class aJ extends bh{runEditorCommand(e,t,i){const n=e.get(Ju),s=oJ.get(t);if(!s)return;const o=s.getFoldingModel();return o?(this.reportTelemetry(e,t),o.then((e=>{if(e){this.invoke(s,e,t,i,n);const o=t.getSelection();o&&s.reveal(o.getStartPosition())}}))):void 0}getSelectedLines(e){const t=e.getSelections();return t?t.map((e=>e.startLineNumber)):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map((e=>e+1)):this.getSelectedLines(t)}run(e,t){}}function lJ(e){if(!Ur(e)){if(!Br(e))return!1;const t=e;if(!Ur(t.levels)&&!Vr(t.levels))return!1;if(!Ur(t.direction)&&!Fr(t.direction))return!1;if(!(Ur(t.selectionLines)||Array.isArray(t.selectionLines)&&t.selectionLines.every(Vr)))return!1}return!0}class hJ extends aJ{getFoldingLevel(){return parseInt(this.id.substr(hJ.ID_PREFIX.length))}invoke(e,t,i){!function(e,t,i,n){const s=e.getRegionsInside(null,((e,s)=>s===t&&e.isCollapsed!==i&&!n.some((t=>e.containsLine(t)))));e.toggleCollapseState(s)}(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}}hJ.ID_PREFIX="editor.foldLevel",hJ.ID=e=>hJ.ID_PREFIX+e;Dh(oJ.ID,oJ,0),Lh(class extends aJ{constructor(){super({id:"editor.unfold",label:ue(0,"Unfold"),alias:"Unfold",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},description:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t\t* 'levels': Number of levels to unfold. If not set, defaults to 1.\n\t\t\t\t\t\t* 'direction': If 'up', unfold given number of levels up otherwise unfolds down.\n\t\t\t\t\t\t* '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.\n\t\t\t\t\t\t",constraint:lJ,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 s=n&&n.levels||1,o=this.getLineNumbers(n,i);n&&"up"===n.direction?OQ(t,!1,s,o):AQ(t,!1,s,o)}}),Lh(class extends aJ{constructor(){super({id:"editor.unfoldRecursively",label:ue(0,"Unfold Recursively"),alias:"Unfold Recursively",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2142),weight:100}})}invoke(e,t,i,n){AQ(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}),Lh(class extends aJ{constructor(){super({id:"editor.fold",label:ue(0,"Fold"),alias:"Fold",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:3164,mac:{primary:2652},weight:100},description:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t\t\t* 'levels': Number of levels to fold.\n\t\t\t\t\t\t\t* 'direction': If 'up', folds given number of levels up otherwise folds down.\n\t\t\t\t\t\t\t* '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.\n\t\t\t\t\t\t\tIf no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead.\n\t\t\t\t\t\t",constraint:lJ,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 s=this.getLineNumbers(n,i),o=n&&n.levels,r=n&&n.direction;"number"!=typeof o&&"string"!=typeof r?function(e,t,i){const n=[];for(const s of i){const i=e.getAllRegionsAtLine(s,(e=>e.isCollapsed!==t));i.length>0&&n.push(i[0])}e.toggleCollapseState(n)}(t,!0,s):"up"===r?OQ(t,!0,o||1,s):AQ(t,!0,o||1,s)}}),Lh(class extends aJ{constructor(){super({id:"editor.foldRecursively",label:ue(0,"Fold Recursively"),alias:"Fold Recursively",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2140),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);AQ(t,!0,Number.MAX_VALUE,n)}}),Lh(class extends aJ{constructor(){super({id:"editor.foldAll",label:ue(0,"Fold All"),alias:"Fold All",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2069),weight:100}})}invoke(e,t,i){AQ(t,!0)}}),Lh(class extends aJ{constructor(){super({id:"editor.unfoldAll",label:ue(0,"Unfold All"),alias:"Unfold All",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2088),weight:100}})}invoke(e,t,i){AQ(t,!1)}}),Lh(class extends aJ{constructor(){super({id:"editor.foldAllBlockComments",label:ue(0,"Fold All Block Comments"),alias:"Fold All Block Comments",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2138),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())BQ(t,xC.Comment.value,!0);else{const e=i.getModel();if(!e)return;const n=s.getLanguageConfiguration(e.getLanguageId()).comments;if(n&&n.blockCommentStartToken){FQ(t,new RegExp("^\\s*"+eo(n.blockCommentStartToken)),!0)}}}}),Lh(class extends aJ{constructor(){super({id:"editor.foldAllMarkerRegions",label:ue(0,"Fold All Regions"),alias:"Fold All Regions",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2077),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())BQ(t,xC.Region.value,!0);else{const e=i.getModel();if(!e)return;const n=s.getLanguageConfiguration(e.getLanguageId()).foldingRules;if(n&&n.markers&&n.markers.start){FQ(t,new RegExp(n.markers.start),!0)}}}}),Lh(class extends aJ{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:ue(0,"Unfold All Regions"),alias:"Unfold All Regions",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2078),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())BQ(t,xC.Region.value,!1);else{const e=i.getModel();if(!e)return;const n=s.getLanguageConfiguration(e.getLanguageId()).foldingRules;if(n&&n.markers&&n.markers.start){FQ(t,new RegExp(n.markers.start),!1)}}}}),Lh(class extends aJ{constructor(){super({id:"editor.foldAllExcept",label:ue(0,"Fold All Except Selected"),alias:"Fold All Except Selected",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2136),weight:100}})}invoke(e,t,i){PQ(t,!0,this.getSelectedLines(i))}}),Lh(class extends aJ{constructor(){super({id:"editor.unfoldAllExcept",label:ue(0,"Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2134),weight:100}})}invoke(e,t,i){PQ(t,!1,this.getSelectedLines(i))}}),Lh(class extends aJ{constructor(){super({id:"editor.toggleFold",label:ue(0,"Toggle Fold"),alias:"Toggle Fold",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2090),weight:100}})}invoke(e,t,i){RQ(t,1,this.getSelectedLines(i))}}),Lh(class extends aJ{constructor(){super({id:"editor.gotoParentFold",label:ue(0,"Go to Parent Fold"),alias:"Go to Parent Fold",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const e=function(e,t){let i=null;const n=t.getRegionAtLine(e);if(null!==n&&(i=n.startLineNumber,e===i)){const e=n.parentIndex;i=-1!==e?t.regions.getStartLineNumber(e):null}return i}(n[0],t);null!==e&&i.setSelection({startLineNumber:e,startColumn:1,endLineNumber:e,endColumn:1})}}}),Lh(class extends aJ{constructor(){super({id:"editor.gotoPreviousFold",label:ue(0,"Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const e=function(e,t){let i=t.getRegionAtLine(e);if(null!==i&&i.startLineNumber===e){if(e!==i.startLineNumber)return i.startLineNumber;{const e=i.parentIndex;let n=0;for(-1!==e&&(n=t.regions.getStartLineNumber(i.parentIndex));null!==i;){if(!(i.regionIndex>0))return null;if(i=t.regions.toRegion(i.regionIndex-1),i.startLineNumber<=n)return null;if(i.parentIndex===e)return i.startLineNumber}}}else if(t.regions.length>0)for(i=t.regions.toRegion(t.regions.length-1);null!==i;){if(i.startLineNumber0?t.regions.toRegion(i.regionIndex-1):null}return null}(n[0],t);null!==e&&i.setSelection({startLineNumber:e,startColumn:1,endLineNumber:e,endColumn:1})}}}),Lh(class extends aJ{constructor(){super({id:"editor.gotoNextFold",label:ue(0,"Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const e=function(e,t){let i=t.getRegionAtLine(e);if(null!==i&&i.startLineNumber===e){const e=i.parentIndex;let n=0;if(-1!==e)n=t.regions.getEndLineNumber(i.parentIndex);else{if(0===t.regions.length)return null;n=t.regions.getEndLineNumber(t.regions.length-1)}for(;null!==i;){if(!(i.regionIndex=n)return null;if(i.parentIndex===e)return i.startLineNumber}}else if(t.regions.length>0)for(i=t.regions.toRegion(0);null!==i;){if(i.startLineNumber>e)return i.startLineNumber;i=i.regionIndexe.startLineNumber&&(s.push({startLineNumber:e.startLineNumber,endLineNumber:t,type:void 0,isCollapsed:!0,source:1}),i.setSelection({startLineNumber:e.startLineNumber,startColumn:1,endLineNumber:e.startLineNumber,endColumn:1}))}if(s.length>0){s.sort(((e,t)=>e.startLineNumber-t.startLineNumber));const e=IQ.sanitizeAndMerge(t.regions,s,null===(n=i.getModel())||void 0===n?void 0:n.getLineCount());t.updatePost(IQ.fromFoldRanges(e))}}}}),Lh(class extends aJ{constructor(){super({id:"editor.removeManualFoldingRanges",label:ue(0,"Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2137),weight:100}})}invoke(e,t,i){const n=i.getSelections();if(n){const i=[];for(const e of n){const{startLineNumber:t,endLineNumber:n}=e;i.push(n>=t?{startLineNumber:t,endLineNumber:n}:{endLineNumber:n,startLineNumber:t})}t.removeManualRanges(i),e.triggerFoldingModelChanged()}}});for(let Tre=1;Tre<=7;Tre++)dJ=new hJ({id:hJ.ID(Tre),label:ue(0,"Fold Level {0}",Tre),alias:`Fold Level ${Tre}`,precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2048|21+Tre),weight:100}}),Nh.INSTANCE.registerEditorAction(dJ);var dJ;Xa.registerCommand("_executeFoldingRangeProvider",(function(e,...t){return nJ(this,void 0,void 0,(function*(){const[i]=t;if(!(i instanceof an))throw u();const n=e.get(oL),s=e.get(Ha).getModel(i);if(!s)throw u();const o=e.get(pu);if(!o.getValue("editor.folding",{resource:i}))return[];const r=e.get(Ju),a=o.getValue("editor.foldingStrategy",{resource:i}),l={get limit(){return o.getValue("editor.foldingMaximumRegions",{resource:i})},update:(e,t)=>{}},h=new HQ(s,r,l);let d=h;if("indentation"!==a){const e=oJ.getFoldingRangeProviders(n,s);e.length&&(d=new QQ(s,e,(()=>{}),l,h))}const c=yield d.compute(Uh.None),g=[];try{if(c)for(let e=0;eFq.replace(Rh.lift(e.range),e.text)))):e.executeEdits("formatEditsCommand",s.map((e=>Fq.replaceMove(Rh.lift(e.range),e.text)))),i&&e.pushUndoStop(),n.restoreRelativeVerticalPositionOfCursor(e)}}class uJ{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return"string"==typeof e?e.toLowerCase():e._lower}}class gJ{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(uJ.toKey(e))}has(e){return this._set.has(uJ.toKey(e))}}var pJ=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function mJ(e){if(!(e=e.filter((e=>e.range))).length)return;let{range:t}=e[0];for(let s=1;sa.provideDocumentRangeFormattingEdits(e,e.getFullModelRange(),t,i)})}return n}class _J{static setFormatterSelector(e){return{dispose:_J._selectors.unshift(e)}}static select(e,t,i){return pJ(this,void 0,void 0,(function*(){if(0===e.length)return;const n=v.first(_J._selectors);return n?yield n(e,t,i):void 0}))}}function vJ(e,t,i,n,s,o){return pJ(this,void 0,void 0,(function*(){const r=e.get(Fa),{documentRangeFormattingEditProvider:a}=e.get(oL),l=iV(t)?t.getModel():t,h=a.ordered(l),d=yield _J.select(h,l,n);d&&(s.report(d),yield r.invokeFunction(bJ,d,t,i,o))}))}function bJ(e,t,i,n,s){var o,r;return pJ(this,void 0,void 0,(function*(){const a=e.get(fG),l=e.get(hh);let h,d;iV(i)?(h=i.getModel(),d=new dL(i,5,void 0,s)):(h=i,d=new cL(i,s));const c=[];let u=0;for(const e of Zd(n).sort(Rh.compareRangesUsingStarts))u>0&&Rh.areIntersectingOrTouching(c[u-1],e)?c[u-1]=Rh.fromPositions(c[u-1].getStartPosition(),e.getEndPosition()):u=c.push(e);const g=e=>pJ(this,void 0,void 0,(function*(){var i,n;l.trace("[format][provideDocumentRangeFormattingEdits] (request)",null===(i=t.extensionId)||void 0===i?void 0:i.value,e);const s=(yield t.provideDocumentRangeFormattingEdits(h,e,h.getFormattingOptions(),d.token))||[];return l.trace("[format][provideDocumentRangeFormattingEdits] (response)",null===(n=t.extensionId)||void 0===n?void 0:n.value,s),s})),p=(e,t)=>{if(!e.length||!t.length)return!1;const i=e.reduce(((e,t)=>Rh.plusRange(e,t.range)),e[0].range);if(!t.some((e=>Rh.intersectRanges(i,e.range))))return!1;for(const n of e)for(const e of t)if(Rh.intersectRanges(n.range,e.range))return!0;return!1},m=[],f=[];try{if("function"==typeof t.provideDocumentRangesFormattingEdits){l.trace("[format][provideDocumentRangeFormattingEdits] (request)",null===(o=t.extensionId)||void 0===o?void 0:o.value,c);const e=(yield t.provideDocumentRangesFormattingEdits(h,c,h.getFormattingOptions(),d.token))||[];l.trace("[format][provideDocumentRangeFormattingEdits] (response)",null===(r=t.extensionId)||void 0===r?void 0:r.value,e),f.push(e)}else{for(const e of c){if(d.token.isCancellationRequested)return!0;f.push(yield g(e))}for(let e=0;e({text:e.text,range:Rh.lift(e.range),forceMoveMarkers:!0}))),(e=>{for(const{range:i}of e)if(Rh.areIntersectingOrTouching(i,t))return[new Ah(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn)];return null}))}return!0}))}function CJ(e,t,i,n,s){return pJ(this,void 0,void 0,(function*(){const o=e.get(Fa),r=e.get(oL),a=iV(t)?t.getModel():t,l=fJ(r.documentFormattingEditProvider,r.documentRangeFormattingEditProvider,a),h=yield _J.select(l,a,i);h&&(n.report(h),yield o.invokeFunction(wJ,h,t,i,s))}))}function wJ(e,t,i,n,s){return pJ(this,void 0,void 0,(function*(){const o=e.get(fG);let r,a,l;iV(i)?(r=i.getModel(),a=new dL(i,5,void 0,s)):(r=i,a=new cL(i,s));try{const e=yield t.provideDocumentFormattingEdits(r,r.getFormattingOptions(),a.token);if(l=yield o.computeMoreMinimalEdits(r.uri,e),a.token.isCancellationRequested)return!0}finally{a.dispose()}if(!l||0===l.length)return!1;if(iV(i))cJ.execute(i,l,2!==n),2!==n&&(mJ(l),i.revealPositionInCenterIfOutsideViewport(i.getPosition(),1));else{const[{range:e}]=l,t=new Ah(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn);r.pushEditOperations([t],l.map((e=>({text:e.text,range:Rh.lift(e.range),forceMoveMarkers:!0}))),(e=>{for(const{range:i}of e)if(Rh.areIntersectingOrTouching(i,t))return[new Ah(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn)];return null}))}return!0}))}function yJ(e,t,i,n,s,o,r){const l=t.onTypeFormattingEditProvider.ordered(i);return 0===l.length||l[0].autoFormatTriggerCharacters.indexOf(s)<0?Promise.resolve(void 0):Promise.resolve(l[0].provideOnTypeFormattingEdits(i,n,s,o,r)).catch(a).then((t=>e.computeMoreMinimalEdits(i.uri,t)))}_J._selectors=new O,Xa.registerCommand("_executeFormatRangeProvider",(function(e,...t){return pJ(this,void 0,void 0,(function*(){const[i,n,s]=t;qr(an.isUri(i)),qr(Rh.isIRange(n));const o=e.get(za),r=e.get(fG),l=e.get(oL),h=yield o.createModelReference(i);try{return function(e,t,i,n,s,o){return pJ(this,void 0,void 0,(function*(){const r=t.documentRangeFormattingEditProvider.ordered(i);for(const t of r){const r=yield Promise.resolve(t.provideDocumentRangeFormattingEdits(i,n,s,o)).catch(a);if(Hd(r))return yield e.computeMoreMinimalEdits(i.uri,r)}}))}(r,l,h.object.textEditorModel,Rh.lift(n),s,Uh.None)}finally{h.dispose()}}))})),Xa.registerCommand("_executeFormatDocumentProvider",(function(e,...t){return pJ(this,void 0,void 0,(function*(){const[i,n]=t;qr(an.isUri(i));const s=e.get(za),o=e.get(fG),r=e.get(oL),l=yield s.createModelReference(i);try{return function(e,t,i,n,s){return pJ(this,void 0,void 0,(function*(){const o=fJ(t.documentFormattingEditProvider,t.documentRangeFormattingEditProvider,i);for(const t of o){const o=yield Promise.resolve(t.provideDocumentFormattingEdits(i,n,s)).catch(a);if(Hd(o))return yield e.computeMoreMinimalEdits(i.uri,o)}}))}(o,r,l.object.textEditorModel,n,Uh.None)}finally{l.dispose()}}))})),Xa.registerCommand("_executeFormatOnTypeProvider",(function(e,...t){return pJ(this,void 0,void 0,(function*(){const[i,n,s,o]=t;qr(an.isUri(i)),qr(Va.isIPosition(n)),qr("string"==typeof s);const r=e.get(za),a=e.get(fG),l=e.get(oL),h=yield r.createModelReference(i);try{return yJ(a,l,h.object.textEditorModel,Va.lift(n),s,o,Uh.None)}finally{h.dispose()}}))}));var SJ=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},LJ=function(e,t){return function(i,n){t(i,n,e)}},kJ=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let DJ=class{constructor(e,t,i){this._editor=e,this._languageFeaturesService=t,this._workerService=i,this._disposables=new N,this._sessionDisposables=new N,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((e=>{e.hasChanged(56)&&this._update()}))),this._update()}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(56))return;if(!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;const i=new qb;for(const n of t.autoFormatTriggerCharacters)i.add(n.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType((e=>{const t=e.charCodeAt(e.length-1);i.has(t)&&this._trigger(String.fromCharCode(t))})))}_trigger(e){if(!this._editor.hasModel())return;if(this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),i=this._editor.getPosition(),n=new jh,s=this._editor.onDidChangeModelContent((e=>{if(e.isFlush)return n.cancel(),void s.dispose();for(let t=0,o=e.changes.length;t{n.token.isCancellationRequested||Hd(e)&&(cJ.execute(this._editor,e,!0),mJ(e))})).finally((()=>{s.dispose()}))}};DJ.ID="editor.contrib.autoFormat",DJ=SJ([LJ(1,oL),LJ(2,fG)],DJ);let xJ=class{constructor(e,t,i){this.editor=e,this._languageFeaturesService=t,this._instantiationService=i,this._callOnDispose=new N,this._callOnModel=new N,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(55)&&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(vJ,this.editor,e,2,_L.None,Uh.None).catch(r))}};xJ.ID="editor.contrib.formatOnPaste",xJ=SJ([LJ(1,oL),LJ(2,Fa)],xJ);Dh(DJ.ID,DJ,2),Dh(xJ.ID,xJ,2),Lh(class extends bh{constructor(){super({id:"editor.action.formatDocument",label:ue(0,"Format Document"),alias:"Format Document",precondition:pl.and(Oh.notInCompositeEditor,Oh.writable,Oh.hasDocumentFormattingProvider),kbOpts:{kbExpr:Oh.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}run(e,t){return kJ(this,void 0,void 0,(function*(){if(t.hasModel()){const i=e.get(Fa),n=e.get(vL);yield n.showWhile(i.invokeFunction(CJ,t,1,_L.None,Uh.None),250)}}))}}),Lh(class extends bh{constructor(){super({id:"editor.action.formatSelection",label:ue(0,"Format Selection"),alias:"Format Selection",precondition:pl.and(Oh.writable,Oh.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2084),weight:100},contextMenuOpts:{when:Oh.hasNonEmptySelection,group:"1_modification",order:1.31}})}run(e,t){return kJ(this,void 0,void 0,(function*(){if(!t.hasModel())return;const i=e.get(Fa),n=t.getModel(),s=t.getSelections().map((e=>e.isEmpty()?new Rh(e.startLineNumber,1,e.startLineNumber,n.getLineMaxColumn(e.startLineNumber)):e)),o=e.get(vL);yield o.showWhile(i.invokeFunction(vJ,t,s,1,_L.None,Uh.None),250)}))}}),Xa.registerCommand("editor.action.format",(e=>kJ(void 0,void 0,void 0,(function*(){const t=e.get(Wa).getFocusedCodeEditor();if(!t||!t.hasModel())return;const i=e.get(Ya);t.getSelection().isEmpty()?yield i.executeCommand("editor.action.formatDocument"):yield i.executeCommand("editor.action.formatSelection")}))));class NJ{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t){var i;const n=new N;e.canAcceptInBackground=!!(null===(i=this.options)||void 0===i?void 0:i.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const s=n.add(new I);return s.value=this.doProvide(e,t),n.add(this.onDidActiveTextEditorControlChange((()=>{s.value=void 0,s.value=this.doProvide(e,t)}))),n}doProvide(e,t){var i;const n=new N,s=this.activeTextEditorControl;if(s&&this.canProvideWithTextEditor(s)){const o={editor:s},r=sV(s);if(r){let e=null!==(i=s.saveViewState())&&void 0!==i?i:void 0;n.add(r.onDidChangeCursorPosition((()=>{var t;e=null!==(t=s.saveViewState())&&void 0!==t?t:void 0}))),o.restoreViewState=()=>{e&&s===this.activeTextEditorControl&&s.restoreViewState(e)},n.add(_(t.onCancellationRequested)((()=>{var e;return null===(e=o.restoreViewState)||void 0===e?void 0:e.call(o)})))}n.add(x((()=>this.clearDecorations(s)))),n.add(this.provideWithTextEditor(o,e,t))}else n.add(this.provideWithoutTextEditor(e,t));return n}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&Fs(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return nV(e)?null===(t=e.getModel())||void 0===t?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations((e=>{const i=[];this.rangeHighlightDecorationId&&(i.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),i.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const n=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:F_(mv),position:Cd.Full}}}],[s,o]=e.deltaDecorations(i,n);this.rangeHighlightDecorationId={rangeHighlightId:s,overviewRulerDecorationId:o}}))}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations((e=>{e.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])})),this.rangeHighlightDecorationId=void 0)}}class EJ extends NJ{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=ue(0,"Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,E.None}provideWithTextEditor(e,t,i){const n=e.editor,s=new N;s.add(t.onDidAccept((i=>{const[s]=t.selectedItems;if(s){if(!this.isValidLineNumber(n,s.lineNumber))return;this.gotoLocation(e,{range:this.toRange(s.lineNumber,s.column),keyMods:t.keyMods,preserveFocus:i.inBackground}),i.inBackground||t.hide()}})));const o=()=>{const e=this.parsePosition(n,t.value.trim().substr(EJ.PREFIX.length)),i=this.getPickLabel(n,e.lineNumber,e.column);if(t.items=[{lineNumber:e.lineNumber,column:e.column,label:i}],t.ariaLabel=i,!this.isValidLineNumber(n,e.lineNumber))return void this.clearDecorations(n);const s=this.toRange(e.lineNumber,e.column);n.revealRangeInCenter(s,0),this.addDecorations(n,s)};o(),s.add(t.onDidChangeValue((()=>o())));const r=sV(n);if(r){2===r.getOptions().get(67).renderType&&(r.updateOptions({lineNumbers:"on"}),s.add(x((()=>r.updateOptions({lineNumbers:"relative"})))))}return s}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map((e=>parseInt(e,10))).filter((e=>!isNaN(e))),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)?ue(0,"Go to line {0} and character {1}.",t,i):ue(0,"Go to line {0}.",t);const n=e.getPosition()||{lineNumber:1,column:1},s=this.lineCount(e);return s>1?ue(0,"Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",n.lineNumber,n.column,s):ue(0,"Current Line: {0}, Character: {1}. Type a line number to navigate to.",n.lineNumber,n.column)}isValidLineNumber(e,t){return!(!t||"number"!=typeof t)&&(t>0&&t<=this.lineCount(e))}isValidColumn(e,t,i){if(!i||"number"!=typeof i)return!1;const n=this.getModel(e);if(!n)return!1;const s={lineNumber:t,column:i};return n.validatePosition(s).equals(s)}lineCount(e){var t,i;return null!==(i=null===(t=this.getModel(e))||void 0===t?void 0:t.getLineCount())&&void 0!==i?i:0}}var IJ;EJ.PREFIX=":",function(e){e[e.PRESERVE=0]="PRESERVE",e[e.LAST=1]="LAST"}(IJ||(IJ={}));const MJ="workbench.contributions.quickaccess";var TJ,RJ,AJ,OJ,PJ,FJ,BJ,WJ;jl.add(MJ,new class{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return 0===e.prefix.length?this.defaultProvider=e:this.providers.push(e),this.providers.sort(((e,t)=>t.prefix.length-e.prefix.length)),x((()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)}))}getQuickAccessProviders(){return Bd([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find((t=>e.startsWith(t.prefix)))||void 0||this.defaultProvider}}),function(e){e.inspectTokensAction=ue(0,"Developer: Inspect Tokens")}(TJ||(TJ={})),function(e){e.gotoLineActionLabel=ue(0,"Go to Line/Column...")}(RJ||(RJ={})),function(e){e.helpQuickAccessActionLabel=ue(0,"Show all Quick Access Providers")}(AJ||(AJ={})),function(e){e.quickCommandActionLabel=ue(0,"Command Palette"),e.quickCommandHelp=ue(0,"Show And Run Commands")}(OJ||(OJ={})),function(e){e.quickOutlineActionLabel=ue(0,"Go to Symbol..."),e.quickOutlineByCategoryActionLabel=ue(0,"Go to Symbol by Category...")}(PJ||(PJ={})),function(e){e.editorViewAccessibleLabel=ue(0,"Editor content"),e.accessibilityHelpMessage=ue(0,"Press Alt+F1 for Accessibility Options.")}(FJ||(FJ={})),function(e){e.toggleHighContrast=ue(0,"Toggle High Contrast Theme")}(BJ||(BJ={})),function(e){e.bulkEditServiceSummary=ue(0,"Made {0} edits in {1} files")}(WJ||(WJ={}));var VJ=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},HJ=function(e,t){return function(i,n){t(i,n,e)}};let zJ=class extends EJ{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=B.None}get activeTextEditorControl(){var e;return null!==(e=this.editorService.getFocusedCodeEditor())&&void 0!==e?e:void 0}};zJ=VJ([HJ(0,Wa)],zJ);class UJ extends bh{constructor(){super({id:UJ.ID,label:RJ.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:Oh.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(cE).quickAccess.show(zJ.PREFIX)}}UJ.ID="editor.action.gotoLine",Lh(UJ),jl.as(MJ).registerQuickAccessProvider({ctor:zJ,prefix:zJ.PREFIX,helpEntries:[{description:RJ.gotoLineActionLabel,commandId:UJ.ID}]});class KJ extends E{constructor(e){super(),this.editor=e,this.widget=null,He&&(this._register(e.onDidChangeConfiguration((()=>this.update()))),this.update())}update(){const e=!this.editor.getOption(90);!this.widget&&e?this.widget=new jJ(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}KJ.ID="editor.contrib.iPadShowKeyboard";class jJ extends E{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(En(this._domNode,"touchstart",(e=>{this.editor.focus()}))),this._register(En(this._domNode,"focus",(e=>{this.editor.focus()}))),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return jJ.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}jJ.ID="editor.contrib.ShowKeyboardWidget",Dh(KJ.ID,KJ,3);class qJ{constructor(e,t,i){this._editRange=e,this._originalSelection=t,this._text=i}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new Ah(i.endLineNumber,Math.min(this._originalSelection.positionColumn,i.endColumn),i.endLineNumber,Math.min(this._originalSelection.positionColumn,i.endColumn)):new Ah(i.endLineNumber,i.endColumn-this._text.length,i.endLineNumber,i.endColumn)}}var $J,GJ=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},ZJ=function(e,t){return function(i,n){t(i,n,e)}};let YJ=$J=class{static get(e){return e.getContribution($J.ID)}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){var i;null===(i=this.currentRequest)||void 0===i||i.cancel();const n=this.editor.getSelection(),s=this.editor.getModel();if(!s||!n)return;let o=n;if(o.startLineNumber!==o.endLineNumber)return;const a=new hL(this.editor,5),l=s.uri;return this.editorWorkerService.canNavigateValueSet(l)?(this.currentRequest=Yh((e=>this.editorWorkerService.navigateValueSet(l,o,t))),this.currentRequest.then((t=>{var i;if(!t||!t.range||!t.value)return;if(!a.validate(this.editor))return;const n=Rh.lift(t.range);let s=t.range;const l=t.value.length-(o.endColumn-o.startColumn);s={startLineNumber:s.startLineNumber,startColumn:s.startColumn,endLineNumber:s.endLineNumber,endColumn:s.startColumn+t.value.length},l>1&&(o=new Ah(o.startLineNumber,o.startColumn,o.endLineNumber,o.endColumn+l-1));const h=new qJ(n,o,t.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,h),this.editor.pushUndoStop(),this.decorations.set([{range:s,options:$J.DECORATION}]),null===(i=this.decorationRemover)||void 0===i||i.cancel(),this.decorationRemover=td(350),this.decorationRemover.then((()=>this.decorations.clear())).catch(r)})).catch(r)):Promise.resolve(void 0)}};YJ.ID="editor.contrib.inPlaceReplaceController",YJ.DECORATION=Iw.register({description:"in-place-replace",className:"valueSetReplacement"}),YJ=$J=GJ([ZJ(1,fG)],YJ);function XJ(e,t){let i=0;for(let n=0;n=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},e0=function(e,t){return function(i,n){t(i,n,e)}};function t0(e,t,i,n,s){if(1===e.getLineCount()&&1===e.getLineMaxColumn(1))return[];const o=t.getLanguageConfiguration(e.getLanguageId()).indentationRules;if(!o)return[];for(n=Math.min(n,e.getLineCount());i<=n&&o.unIndentedLinePattern;){const t=e.getLineContent(i);if(!o.unIndentedLinePattern.test(t))break;i++}if(i>n-1)return[];const{tabSize:r,indentSize:a,insertSpaces:l}=e.getOptions(),h=(e,t)=>(t=t||1,_y.shiftIndent(e,e.length+t,r,a,l)),d=(e,t)=>(t=t||1,_y.unshiftIndent(e,e.length+t,r,a,l)),c=[];let u;const g=e.getLineContent(i);let p=g;if(null!=s){u=s;const e=ao(g);p=u+g.substring(e.length),o.decreaseIndentPattern&&o.decreaseIndentPattern.test(p)&&(u=d(u),p=u+g.substring(e.length)),g!==p&&c.push(Fq.replaceMove(new Ah(i,1,i,e.length+1),cc(u,a,l)))}else u=ao(g);let m=u;o.increaseIndentPattern&&o.increaseIndentPattern.test(p)?(m=h(m),u=h(u)):o.indentNextLinePattern&&o.indentNextLinePattern.test(p)&&(m=h(m));for(let f=++i;f<=n;f++){const t=e.getLineContent(f),i=ao(t),n=m+t.substring(i.length);o.decreaseIndentPattern&&o.decreaseIndentPattern.test(n)&&(m=d(m),u=d(u)),i!==m&&c.push(Fq.replaceMove(new Ah(f,1,f,i.length+1),cc(m,a,l))),o.unIndentedLinePattern&&o.unIndentedLinePattern.test(t)||(o.increaseIndentPattern&&o.increaseIndentPattern.test(n)?(u=h(u),m=u):m=o.indentNextLinePattern&&o.indentNextLinePattern.test(n)?h(m):u)}return c}class i0 extends bh{constructor(){super({id:i0.ID,label:ue(0,"Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:Oh.writable})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),s=t.getSelection();if(!s)return;const o=new u0(s,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[o]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}}i0.ID="editor.action.indentationToSpaces";class n0 extends bh{constructor(){super({id:n0.ID,label:ue(0,"Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:Oh.writable})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),s=t.getSelection();if(!s)return;const o=new g0(s,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[o]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}}n0.ID="editor.action.indentationToTabs";class s0 extends bh{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(cE),n=e.get(Ha),s=t.getModel();if(!s)return;const o=n.getCreationOptions(s.getLanguageId(),s.uri,s.isForSimpleWidget),r=s.getOptions(),a=[1,2,3,4,5,6,7,8].map((e=>({id:e.toString(),label:e.toString(),description:e===o.tabSize&&e===r.tabSize?ue(0,"Configured Tab Size"):e===o.tabSize?ue(0,"Default Tab Size"):e===r.tabSize?ue(0,"Current Tab Size"):void 0}))),l=Math.min(s.getOptions().tabSize-1,7);setTimeout((()=>{i.pick(a,{placeHolder:ue(0,"Select Tab Size for Current File"),activeItem:a[l]}).then((e=>{if(e&&s&&!s.isDisposed()){const t=parseInt(e.label,10);this.displaySizeOnly?s.updateOptions({tabSize:t}):s.updateOptions({tabSize:t,indentSize:t,insertSpaces:this.insertSpaces})}}))}),50)}}class o0 extends s0{constructor(){super(!1,!1,{id:o0.ID,label:ue(0,"Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0})}}o0.ID="editor.action.indentUsingTabs";class r0 extends s0{constructor(){super(!0,!1,{id:r0.ID,label:ue(0,"Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0})}}r0.ID="editor.action.indentUsingSpaces";class a0 extends s0{constructor(){super(!0,!0,{id:a0.ID,label:ue(0,"Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0})}}a0.ID="editor.action.changeTabDisplaySize";class l0 extends bh{constructor(){super({id:l0.ID,label:ue(0,"Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0})}run(e,t){const i=e.get(Ha),n=t.getModel();if(!n)return;const s=i.getCreationOptions(n.getLanguageId(),n.uri,n.isForSimpleWidget);n.detectIndentation(s.insertSpaces,s.tabSize)}}l0.ID="editor.action.detectIndentation";class h0{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const i of e)i.range&&"string"==typeof i.text&&this._edits.push(i)}getEditOperations(e,t){for(const n of this._edits)t.addEditOperation(Rh.lift(n.range),n.text);let i=!1;Array.isArray(this._edits)&&1===this._edits.length&&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)}}let d0=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new N,this.callOnModel=new N,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(12)<4||this.editor.getOption(55)||this.editor.hasModel()&&this.callOnModel.add(this.editor.onDidPaste((({range:e})=>{this.trigger(e)})))}trigger(e){const t=this.editor.getSelections();if(null===t||t.length>1)return;const i=this.editor.getModel();if(!i)return;if(!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const n=this.editor.getOption(12),{tabSize:s,indentSize:o,insertSpaces:r}=i.getOptions(),a=[],l={shiftIndent:e=>_y.shiftIndent(e,e.length+1,s,o,r),unshiftIndent:e=>_y.unshiftIndent(e,e.length+1,s,o,r)};let h=e.startLineNumber;for(;h<=e.endLineNumber&&this.shouldIgnoreLine(i,h);)h++;if(h>e.endLineNumber)return;let d=i.getLineContent(h);if(!/\S/.test(d.substring(0,e.startColumn-1))){const e=wy(n,i,i.getLanguageId(),h,l,this._languageConfigurationService);if(null!==e){const t=ao(d),n=XJ(e,s);if(n!==XJ(t,s)){const e=QJ(n,s,r);a.push({range:new Rh(h,1,h,t.length+1),text:e}),d=e+d.substr(t.length)}else{const e=yy(i,h,this._languageConfigurationService);if(0===e||8===e)return}}}const c=h;for(;hi.tokenization.getLineTokens(e),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(e,t)=>i.getLanguageIdAtPosition(e,t)},getLineContent:e=>e===c?d:i.getLineContent(e)},i.getLanguageId(),h+1,l,this._languageConfigurationService);if(null!==t){const n=XJ(t,s),o=XJ(ao(i.getLineContent(h+1)),s);if(n!==o){const t=n-o;for(let n=h+1;n<=e.endLineNumber;n++){const e=ao(i.getLineContent(n)),o=QJ(XJ(e,s)+t,s,r);o!==e&&a.push({range:new Rh(n,1,n,e.length+1),text:o})}}}}if(a.length>0){this.editor.pushUndoStop();const e=new h0(a,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",e),this.editor.pushUndoStop()}}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const i=e.getLineFirstNonWhitespaceColumn(t);if(0===i)return!0;const n=e.tokenization.getLineTokens(t);if(n.getCount()>0){const e=n.findTokenIndexAtOffset(i);if(e>=0&&1===n.getStandardTokenType(e))return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}};function c0(e,t,i,n){if(1===e.getLineCount()&&1===e.getLineMaxColumn(1))return;let s="";for(let r=0;r0&&(t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop())}}),Lh(class extends bh{constructor(){super({id:"editor.action.reindentselectedlines",label:ue(0,"Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:Oh.writable})}run(e,t){const i=e.get(Ju),n=t.getModel();if(!n)return;const s=t.getSelections();if(null===s)return;const o=[];for(const r of s){let e=r.startLineNumber,t=r.endLineNumber;if(e!==t&&1===r.endColumn&&t--,1===e){if(e===t)continue}else e--;const s=t0(n,i,e,t);o.push(...s)}o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}});var p0=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class m0{constructor(e,t){this.range=e,this.direction=t}}class f0{constructor(e,t,i){this.hint=e,this.anchor=t,this.provider=i,this._isResolved=!1}with(e){const t=new f0(this.hint,e.anchor,this.provider);return t._isResolved=this._isResolved,t._currentResolve=this._currentResolve,t}resolve(e){return p0(this,void 0,void 0,(function*(){if("function"==typeof this.provider.resolveInlayHint){if(this._currentResolve){if(yield this._currentResolve,e.isCancellationRequested)return;return this.resolve(e)}this._isResolved||(this._currentResolve=this._doResolve(e).finally((()=>this._currentResolve=void 0))),yield this._currentResolve}}))}_doResolve(e){var t,i;return p0(this,void 0,void 0,(function*(){try{const n=yield Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=null!==(t=null==n?void 0:n.tooltip)&&void 0!==t?t:this.hint.tooltip,this.hint.label=null!==(i=null==n?void 0:n.label)&&void 0!==i?i:this.hint.label,this._isResolved=!0}catch(n){a(n),this._isResolved=!1}}))}}class _0{static create(e,t,i,n){return p0(this,void 0,void 0,(function*(){const s=[],o=e.ordered(t).reverse().map((e=>i.map((i=>p0(this,void 0,void 0,(function*(){try{const o=yield e.provideInlayHints(t,i,n);(null==o?void 0:o.hints.length)&&s.push([o,e])}catch(o){a(o)}}))))));if(yield Promise.all(o.flat()),n.isCancellationRequested||t.isDisposed())throw new c;return new _0(i,s,t)}))}constructor(e,t,i){this._disposables=new N,this.ranges=e,this.provider=new Set;const n=[];for(const[s,o]of t){this._disposables.add(s),this.provider.add(o);for(const e of s.hints){const t=i.validatePosition(e.position);let s="before";const r=_0._getRangeAtPosition(i,t);let a;r.getStartPosition().isBefore(t)?(a=Rh.fromPositions(r.getStartPosition(),t),s="after"):(a=Rh.fromPositions(t,r.getEndPosition()),s="before"),n.push(new f0(e,new m0(a,s),o))}}this.items=n.sort(((e,t)=>Va.compare(e.hint.position,t.hint.position)))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const i=t.lineNumber,n=e.getWordAtPosition(t);if(n)return new Rh(i,n.startColumn,i,n.endColumn);e.tokenization.tokenizeIfCheap(i);const s=e.tokenization.getLineTokens(i),o=t.column-1,r=s.findTokenIndexAtOffset(o);let a=s.getStartOffset(r),l=s.getEndOffset(r);return l-a==1&&(a===o&&r>1?(a=s.getStartOffset(r-1),l=s.getEndOffset(r-1)):l===o&&rJl(e)?e.command.id:NZ())));for(const e of qU.all())u.has(e.desc.id)&&c.push(new Ka(e.desc.id,oh.label(e.desc,{renderShortTitle:!0}),void 0,!0,(()=>v0(this,void 0,void 0,(function*(){const i=yield o.createModelReference(d.uri);try{const s=new jU(i.object.textEditorModel,Rh.getStartPosition(d.range)),o=n.item.anchor.range;yield l.invokeFunction(e.runEditorCommand.bind(e),t,s,o)}finally{i.dispose()}})))));if(n.part.command){const{command:e}=n.part;c.push(new qa),c.push(new Ka(e.id,e.title,void 0,!0,(()=>v0(this,void 0,void 0,(function*(){var t;try{yield a.executeCommand(e.id,...null!==(t=e.arguments)&&void 0!==t?t:[])}catch(i){h.notify({severity:pL.Error,source:n.item.provider.displayName,message:i})}})))))}const g=t.getOption(126);r.showContextMenu({domForShadowRoot:g&&null!==(s=t.getDomNode())&&void 0!==s?s:void 0,getAnchor:()=>{const e=Hn(i);return{x:e.left,y:e.top+e.height+8}},getActions:()=>c,onHide:()=>{t.focus()},autoSelectFirstItem:!0})}))}function C0(e,t,i,n){return v0(this,void 0,void 0,(function*(){const s=e.get(za),o=yield s.createModelReference(n.uri);yield i.invokeWithinContext((e=>v0(this,void 0,void 0,(function*(){const s=t.hasSideBySideModifier,r=e.get(Ol),a=qW.inPeekEditor.getValue(r),l=!s&&i.getOption(87)&&!a;return new $U({openToSide:s,openInPeek:l,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(e,new jU(o.object.textEditorModel,Rh.getStartPosition(n.range)),Rh.lift(n.range))})))),o.dispose()}))}var w0,y0=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},S0=function(e,t){return function(i,n){t(i,n,e)}},L0=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class k0{constructor(){this._entries=new js(50)}get(e){const t=k0._key(e);return this._entries.get(t)}set(e,t){const i=k0._key(e);this._entries.set(i,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const D0=Ba("IInlayHintsCache");yu(D0,k0,1);class x0{constructor(e,t){this.item=e,this.index=t}get part(){const e=this.item.hint.label;return"string"==typeof e?{label:e}:e[this.index]}}class N0{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}let E0=w0=class{static get(e){var t;return null!==(t=e.getContribution(w0.ID))&&void 0!==t?t:void 0}constructor(e,t,i,n,s,o,r){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=n,this._commandService=s,this._notificationService=o,this._instaService=r,this._disposables=new N,this._sessionDisposables=new N,this._decorationsMetadata=new Map,this._ruleFactory=new zE(this._editor),this._activeRenderMode=0,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((e=>{e.hasChanged(139)&&this._update()}))),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(139);if("off"===e.enabled)return;const t=this._editor.getModel();if(!t||!this._languageFeaturesService.inlayHintsProvider.has(t))return;const i=this._inlayHintsCache.get(t);let n;i&&this._updateHintsDecorators([t.getFullModelRange()],i),this._sessionDisposables.add(x((()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)})));const s=new Set,o=new rd((()=>L0(this,void 0,void 0,(function*(){const e=Date.now();null==n||n.dispose(!0),n=new jh;const i=t.onWillDispose((()=>null==n?void 0:n.cancel()));try{const i=n.token,r=yield _0.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),i);if(o.delay=this._debounceInfo.update(t,Date.now()-e),i.isCancellationRequested)return void r.dispose();for(const e of r.provider)"function"!=typeof e.onDidChangeInlayHints||s.has(e)||(s.add(e),this._sessionDisposables.add(e.onDidChangeInlayHints((()=>{o.isScheduled()||o.schedule()}))));this._sessionDisposables.add(r),this._updateHintsDecorators(r.ranges,r.items),this._cacheHintsForFastRestore(t)}catch(a){r(a)}finally{n.dispose(),i.dispose()}}))),this._debounceInfo.get(t));if(this._sessionDisposables.add(o),this._sessionDisposables.add(x((()=>null==n?void 0:n.dispose(!0)))),o.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange((e=>{!e.scrollTopChanged&&o.isScheduled()||o.schedule()}))),this._sessionDisposables.add(this._editor.onDidChangeModelContent((e=>{const t=Math.max(o.delay,1250);o.schedule(t)}))),"on"===e.enabled)this._activeRenderMode=0;else{let t,i;"onUnlessPressed"===e.enabled?(t=0,i=1):(t=1,i=0),this._activeRenderMode=t,this._sessionDisposables.add(ks.getInstance().event((e=>{if(!this._editor.hasModel())return;const n=e.altKey&&e.ctrlKey&&!e.shiftKey&&!e.metaKey?i:t;if(n!==this._activeRenderMode){this._activeRenderMode=n;const e=this._editor.getModel(),t=this._copyInlayHintsWithCurrentAnchor(e);this._updateHintsDecorators([e.getFullModelRange()],t),o.schedule(0)}})))}this._sessionDisposables.add(this._installDblClickGesture((()=>o.schedule(0)))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new N,t=e.add(new RR(this._editor)),i=new N;return e.add(i),e.add(t.onMouseMoveOrRelevantKeyDown((e=>{const[t]=e,n=this._getInlayHintLabelPart(t),s=this._editor.getModel();if(!n||!s)return void i.clear();const o=new jh;i.add(x((()=>o.dispose(!0)))),n.item.resolve(o.token),this._activeInlayHintPart=n.part.command||n.part.location?new N0(n,t.hasTriggerModifier):void 0;const r=s.validatePosition(n.item.hint.position).lineNumber,a=new Rh(r,1,r,s.getLineMaxColumn(r)),l=this._getInlineHintsForRange(a);this._updateHintsDecorators([a],l),i.add(x((()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([a],l)})))}))),e.add(t.onCancel((()=>i.clear()))),e.add(t.onExecute((e=>L0(this,void 0,void 0,(function*(){const t=this._getInlayHintLabelPart(e);if(t){const i=t.part;i.location?this._instaService.invokeFunction(C0,e,this._editor,i.location):kC.is(i.command)&&(yield this._invokeCommand(i.command,t.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((t=>L0(this,void 0,void 0,(function*(){if(2!==t.event.detail)return;const i=this._getInlayHintLabelPart(t);if(i&&(t.event.preventDefault(),yield i.item.resolve(Uh.None),Hd(i.item.hint.textEdits))){const t=i.item.hint.textEdits.map((e=>Fq.replace(Rh.lift(e.range),e.text)));this._editor.executeEdits("inlayHint.default",t),e()}}))))}_installContextMenu(){return this._editor.onContextMenu((e=>L0(this,void 0,void 0,(function*(){if(!(e.event.target instanceof HTMLElement))return;const t=this._getInlayHintLabelPart(e);t&&(yield this._instaService.invokeFunction(b0,this._editor,e.event.target,t))}))))}_getInlayHintLabelPart(e){var t;if(6!==e.target.type)return;const i=null===(t=e.target.detail.injectedText)||void 0===t?void 0:t.options;return i instanceof Ew&&(null==i?void 0:i.attachedData)instanceof x0?i.attachedData:void 0}_invokeCommand(e,t){var i;return L0(this,void 0,void 0,(function*(){try{yield this._commandService.executeCommand(e.id,...null!==(i=e.arguments)&&void 0!==i?i:[])}catch(n){this._notificationService.notify({severity:pL.Error,source:t.provider.displayName,message:n})}}))}_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 s=e.getDecorationRange(i);if(s){const e=new m0(s,n.item.anchor.direction),i=n.item.with({anchor:e});t.set(n.item,i)}}return Array.from(t.values())}_getHintsRanges(){const e=this._editor.getModel(),t=this._editor.getVisibleRangesPlusViewportAboveBelow(),i=[];for(const n of t.sort(Rh.compareRangesUsingStarts)){const t=e.validateRange(new Rh(n.startLineNumber-30,n.startColumn,n.endLineNumber+30,n.endColumn));0!==i.length&&Rh.areIntersectingOrTouching(i[i.length-1],t)?i[i.length-1]=Rh.plusRange(i[i.length-1],t):i.push(t)}return i}_updateHintsDecorators(e,t){var i,n;const s=[],o=(e,t,i,n,o)=>{const r={content:i,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:t.className,cursorStops:n,attachedData:o};s.push({item:e,classNameRef:t,decoration:{range:e.anchor.range,options:{description:"InlayHint",showIfCollapsed:e.anchor.range.isEmpty(),collapseOnReplaceEdit:!e.anchor.range.isEmpty(),stickiness:0,[e.anchor.direction]:0===this._activeRenderMode?r:void 0}}})},r=(e,t)=>{const i=this._ruleFactory.createClassNameRef({width:(a/3|0)+"px",display:"inline-block"});o(e,i,"\u200a",t?Sd.Right:Sd.None)},{fontSize:a,fontFamily:l,padding:h,isUniform:d}=this._getLayoutInfo(),c="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(c,l);for(const p of t){p.hint.paddingLeft&&r(p,!1);const e="string"==typeof p.hint.label?[{label:p.hint.label}]:p.hint.label;for(let t=0;tw0._MAX_DECORATORS)break}const u=[];for(const p of e)for(const{id:e}of null!==(n=this._editor.getDecorationsInRange(p))&&void 0!==n?n:[]){const t=this._decorationsMetadata.get(e);t&&(u.push(e),t.classNameRef.dispose(),this._decorationsMetadata.delete(e))}const g=WN.capture(this._editor);this._editor.changeDecorations((e=>{const t=e.deltaDecorations(u,s.map((e=>e.decoration)));for(let i=0;ii)&&(s=i);const o=e.fontFamily||n;return{fontSize:s,fontFamily:o,padding:t,isUniform:!t&&o===n&&s===i}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}};function I0(e){return e.replace(/[ \t]/g,"\xa0")}E0.ID="editor.contrib.InlayHints",E0._MAX_DECORATORS=1500,E0=w0=y0([S0(1,oL),S0(2,SE),S0(3,D0),S0(4,Ya),S0(5,mL),S0(6,Fa)],E0),Xa.registerCommand("_executeInlayHintProvider",((e,...t)=>L0(void 0,void 0,void 0,(function*(){const[i,n]=t;qr(an.isUri(i)),qr(Rh.isIRange(n));const{inlayHintsProvider:s}=e.get(oL),o=yield e.get(za).createModelReference(i);try{const e=yield _0.create(s,o.object.textEditorModel,[Rh.lift(n)],Uh.None),t=e.items.map((e=>e.hint));return setTimeout((()=>e.dispose()),0),t}finally{o.dispose()}}))));var M0=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},T0=function(e,t){return function(i,n){t(i,n,e)}},R0=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))},A0=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=e[i]&&function(t){return new Promise((function(n,s){(function(e,t,i,n){Promise.resolve(n).then((function(t){e({value:t,done:i})}),t)})(n,s,(t=e[i](t)).done,t.value)}))}}};class O0 extends uK{constructor(e,t,i,n){super(10,t,e.item.anchor.range,i,n,!0),this.part=e}}let P0=class extends WK{constructor(e,t,i,n,s,o){super(e,t,i,n,o),this._resolverService=s,this.hoverOrdinal=6}suggestHoverAnchor(e){var t;if(!E0.get(this._editor))return null;if(6!==e.target.type)return null;const i=null===(t=e.target.detail.injectedText)||void 0===t?void 0:t.options;return i instanceof Ew&&i.attachedData instanceof x0?new O0(i.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,i){return e instanceof O0?new cd((t=>R0(this,void 0,void 0,(function*(){var n,s,o,r;const{part:a}=e;if(yield a.item.resolve(i),i.isCancellationRequested)return;let l,h;if("string"==typeof a.item.hint.tooltip?l=(new Ta).appendText(a.item.hint.tooltip):a.item.hint.tooltip&&(l=a.item.hint.tooltip),l&&t.emitOne(new BK(this,e.range,[l],!1,0)),Hd(a.item.hint.textEdits)&&t.emitOne(new BK(this,e.range,[(new Ta).appendText(ue(0,"Double-click to insert"))],!1,10001)),"string"==typeof a.part.tooltip?h=(new Ta).appendText(a.part.tooltip):a.part.tooltip&&(h=a.part.tooltip),h&&t.emitOne(new BK(this,e.range,[h],!1,1)),a.part.location||a.part.command){let i;const n=ue(0,"altKey"===this._editor.getOption(77)?Pe?"cmd + click":"ctrl + click":Pe?"option + click":"alt + click");a.part.location&&a.part.command?i=(new Ta).appendText(ue(0,"Go to Definition ({0}), right click for more",n)):a.part.location?i=(new Ta).appendText(ue(0,"Go to Definition ({0})",n)):a.part.command&&(i=new Ta(`[${ue(0,"Execute Command")}](${d=a.part.command,an.from({scheme:vn.command,path:d.id,query:d.arguments&&encodeURIComponent(JSON.stringify(d.arguments))}).toString()} "${a.part.command.title}") (${n})`,{isTrusted:!0})),i&&t.emitOne(new BK(this,e.range,[i],!1,1e4))}var d;const c=yield this._resolveInlayHintLabelPartHover(a,i);try{for(var u,g=!0,p=A0(c);!(n=(u=yield p.next()).done);g=!0){r=u.value,g=!1;const e=r;t.emitOne(e)}}catch(m){s={error:m}}finally{try{g||n||!(o=p.return)||(yield o.call(p))}finally{if(s)throw s.error}}})))):cd.EMPTY}_resolveInlayHintLabelPartHover(e,t){return R0(this,void 0,void 0,(function*(){if(!e.part.location)return cd.EMPTY;const{uri:i,range:n}=e.part.location,s=yield this._resolverService.createModelReference(i);try{const i=s.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(i)?AK(this._languageFeaturesService.hoverProvider,i,new Va(n.startLineNumber,n.startColumn),t).filter((e=>!Ra(e.hover.contents))).map((t=>new BK(this,e.item.anchor.range,t.hover.contents,!1,2+t.ordinal))):cd.EMPTY}finally{s.dispose()}}))}};P0=M0([T0(1,Lc),T0(2,qk),T0(3,pu),T0(4,za),T0(5,oL)],P0),Dh(E0.ID,E0,1),gK.register(P0);class F0 extends E{constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=F0.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=F0.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=F0.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=F0.suppressSuggestions.bindTo(this.contextKeyService),this._register(Kj((e=>{const t=this.model.read(e),i=null==t?void 0:t.state.read(e),n=!!(null==i?void 0:i.inlineCompletion)&&void 0!==(null==i?void 0:i.ghostText)&&!(null==i?void 0:i.ghostText.isEmpty());this.inlineCompletionVisible.set(n),(null==i?void 0:i.ghostText)&&(null==i?void 0:i.inlineCompletion)&&this.suppressSuggestions.set(i.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions)}))),this._register(Kj((e=>{const t=this.model.read(e);let i=!1,n=!0;const s=null==t?void 0:t.ghostText.read(e);if((null==t?void 0:t.selectedSuggestItem)&&s&&s.parts.length>0){const{column:e,lines:o}=s.parts[0],r=o[0];if(e<=t.textModel.getLineIndentColumn(s.lineNumber)){let e=ro(r);-1===e&&(e=r.length-1),i=e>0;const s=t.textModel.getOptions().tabSize;n=dc.visibleColumnFromColumn(r,e+1,s)t)throw new f(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new Rh(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function H0(e,t){return new Va(e.lineNumber+t.lineNumber-1,1===t.lineNumber?e.column+t.column-1:t.column)}function z0(e){let t=1,i=1;for(const n of e)"\n"===n?(t++,i=1):i++;return new Va(t,i)}class U0{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])))}renderForScreenReader(e){if(0===this.parts.length)return"";const t=this.parts[this.parts.length-1],i=function(e,t){const i=new B0(e),n=t.map((e=>{const t=Rh.lift(e.range);return{startOffset:i.getOffset(t.getStartPosition()),endOffset:i.getOffset(t.getEndPosition()),text:e.text}}));n.sort(((e,t)=>t.startOffset-e.startOffset));for(const s of n)e=e.substring(0,s.startOffset)+s.text+e.substring(s.endOffset);return e}(e.substr(0,t.column-1),this.parts.map((e=>({range:{startLineNumber:1,endLineNumber:1,startColumn:e.column,endColumn:e.column},text:e.lines.join("\n")}))));return i.substring(this.parts[0].column-1)}isEmpty(){return this.parts.every((e=>0===e.lines.length))}get lineCount(){return 1+this.parts.reduce(((e,t)=>e+t.lines.length-1),0)}}class K0{constructor(e,t,i){this.column=e,this.lines=t,this.preview=i}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every(((t,i)=>t===e.lines[i]))}}class j0{constructor(e,t,i,n=0){this.lineNumber=e,this.columnRange=t,this.newLines=i,this.additionalReservedLineCount=n,this.parts=[new K0(this.columnRange.endColumnExclusive,this.newLines,!1)]}renderForScreenReader(e){return this.newLines.join("\n")}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every((e=>0===e.lines.length))}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 q0(e,t){return e===t||!(!e||!t)&&((e instanceof U0&&t instanceof U0||e instanceof j0&&t instanceof j0)&&e.equals(t))}var $0=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},G0=function(e,t){return function(i,n){t(i,n,e)}};const Z0="ghost-text";let Y0=class extends E{constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=Aj(this,!1),this.currentTextModel=Yj(this.editor.onDidChangeModel,(()=>this.editor.getModel())),this.uiState=Wj(this,(e=>{if(this.isDisposed.read(e))return;const t=this.currentTextModel.read(e);if(t!==this.model.targetTextModel.read(e))return;const i=this.model.ghostText.read(e);if(!i)return;const n=i instanceof j0?i.columnRange:void 0,s=[],o=[];function r(e,t){if(o.length>0){const i=o[o.length-1];t&&i.decorations.push(new bA(i.content.length+1,i.content.length+1+e[0].length,t,0)),i.content+=e[0],e=e.slice(1)}for(const i of e)o.push({content:i,decorations:t?[new bA(1,i.length+1,t,0)]:[]})}const a=t.getLineContent(i.lineNumber);let l,h=0;for(const c of i.parts){let e=c.lines;void 0===l?(s.push({column:c.column,text:e[0],preview:c.preview}),e=e.slice(1)):r([a.substring(h,c.column-1)],void 0),e.length>0&&(r(e,Z0),void 0===l&&c.column<=a.length&&(l=c.column)),h=c.column-1}void 0!==l&&r([a.substring(h)],void 0);const d=void 0!==l?new V0(l,a.length+1):void 0;return{replacedRange:n,inlineTexts:s,additionalLines:o,hiddenRange:d,lineNumber:i.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(e),targetTextModel:t}})),this.decorations=Wj(this,(e=>{const t=this.uiState.read(e);if(!t)return[];const i=[];t.replacedRange&&i.push({range:t.replacedRange.toRange(t.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),t.hiddenRange&&i.push({range:t.hiddenRange.toRange(t.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const n of t.inlineTexts)i.push({range:Rh.fromPositions(new Va(t.lineNumber,n.column)),options:{description:Z0,after:{content:n.text,inlineClassName:n.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:Sd.Left},showIfCollapsed:!0}});return i})),this.additionalLinesWidget=this._register(new X0(this.editor,this.languageService.languageIdCodec,Wj((e=>{const t=this.uiState.read(e);return t?{lineNumber:t.lineNumber,additionalLines:t.additionalLines,minReservedLineCount:t.additionalReservedLineCount,targetTextModel:t.targetTextModel}:void 0})))),this._register(x((()=>{this.isDisposed.set(!0,void 0)}))),this._register(function(e,t){const i=new N,n=e.createDecorationsCollection();return i.add(Uj({debugName:()=>`Apply decorations from ${t.debugName}`},(e=>{const i=t.read(e);n.set(i)}))),i.add({dispose:()=>{n.clear()}}),i}(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};Y0=$0([G0(2,Lc)],Y0);class X0 extends E{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=Qj("editorOptionChanged",B.filter(this.editor.onDidChangeConfiguration,(e=>e.hasChanged(33)||e.hasChanged(116)||e.hasChanged(98)||e.hasChanged(93)||e.hasChanged(51)||e.hasChanged(50)||e.hasChanged(66)))),this._register(Kj((e=>{const t=this.lines.read(e);this.editorOptionsChanged.read(e),t?this.updateLines(t.lineNumber,t.additionalLines,t.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:s}=n.getOptions();this.editor.changeViewZones((n=>{this._viewZoneId&&(n.removeZone(this._viewZoneId),this._viewZoneId=void 0);const o=Math.max(t.length,i);if(o>0){const i=document.createElement("div");!function(e,t,i,n,s){const o=n.get(33),r=n.get(116),a="none",l=n.get(93),h=n.get(51),d=n.get(50),c=n.get(66),u=new eu(1e4);u.appendString('
    ');for(let m=0,f=i.length;m');const g=To(n),p=Io(n),f=PC.createEmpty(n,s);EA(new kA(d.isMonospace&&!o,d.canUseHalfwidthRightwardsArrow,n,!1,g,p,0,f,e.decorations,t,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,r,a,l,h!==MS.OFF,null),u),u.appendString("
    ")}u.appendString(""),Hk(e,d);const g=u.build(),p=Q0?Q0.createHTML(g):g;e.innerHTML=p}(i,s,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=n.addZone({afterLineNumber:e,heightInLines:o,domNode:i,afterColumnAffinity:1})}}))}}const Q0=Fk("editorGhostText",{createHTML:e=>e});class J0{constructor(e){this.lines=e,this.tokenization={getLineTokens:e=>this.lines[e-1]}}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}}class e1{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return 95===e||e>=97&&e<=122||e>=65&&e<=90}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:14,pos:this.pos,len:0};const e=this.pos;let t,i=0,n=this.value.charCodeAt(e);if(t=e1._table[n],"number"==typeof t)return this.pos+=1,{type:t,pos:e,len:1};if(e1.isDigitCharacter(n)){t=8;do{i+=1,n=this.value.charCodeAt(e+i)}while(e1.isDigitCharacter(n));return this.pos+=i,{type:t,pos:e,len:i}}if(e1.isVariableCharacter(n)){t=9;do{n=this.value.charCodeAt(e+ ++i)}while(e1.isVariableCharacter(n)||e1.isDigitCharacter(n));return this.pos+=i,{type:t,pos:e,len:i}}t=10;do{i+=1,n=this.value.charCodeAt(e+i)}while(!isNaN(n)&&void 0===e1._table[n]&&!e1.isDigitCharacter(n)&&!e1.isVariableCharacter(n));return this.pos+=i,{type:t,pos:e,len:i}}}e1._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};class t1{constructor(){this._children=[]}appendChild(e){return e instanceof i1&&this._children[this._children.length-1]instanceof i1?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),s=i.children.slice(0);s.splice(n,1,...t),i._children=s,function e(t,i){for(const n of t)n.parent=i,e(n.children,n)}(t,i)}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 d1)return e;e=e.parent}}toString(){return this.children.reduce(((e,t)=>e+t.toString()),"")}len(){return 0}}class i1 extends t1{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new i1(this.value)}}class n1 extends t1{}class s1 extends n1{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 0===this.index}get choice(){return 1===this._children.length&&this._children[0]instanceof o1?this._children[0]:void 0}clone(){const e=new s1(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map((e=>e.clone())),e}}class o1 extends t1{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof i1&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new o1;return this.options.forEach(e.appendChild,e),e}}class r1 extends t1{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((e=>e instanceof a1&&Boolean(e.elseValue)))&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof a1){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const e=new r1;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map((e=>e.clone())),e}}class a1 extends t1{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}resolve(e){return"upcase"===this.shorthandName?e?e.toLocaleUpperCase():"":"downcase"===this.shorthandName?e?e.toLocaleLowerCase():"":"capitalize"===this.shorthandName?e?e[0].toLocaleUpperCase()+e.substr(1):"":"pascalcase"===this.shorthandName?e?this._toPascalCase(e):"":"camelcase"===this.shorthandName?e?this._toCamelCase(e):"":Boolean(e)&&"string"==typeof this.ifValue?this.ifValue:Boolean(e)||"string"!=typeof this.elseValue?e||"":this.elseValue}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((e=>e.charAt(0).toUpperCase()+e.substr(1))).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(((e,t)=>0===t?e.charAt(0).toLowerCase()+e.substr(1):e.charAt(0).toUpperCase()+e.substr(1))).join(""):e}clone(){return new a1(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class l1 extends n1{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),void 0!==t&&(this._children=[new i1(t)],!0)}clone(){const e=new l1(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map((e=>e.clone())),e}}function h1(e,t){const i=[...e];for(;i.length>0;){const e=i.shift();if(!t(e))break;i.unshift(...e.children)}}class d1 extends t1{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk((function(i){return i instanceof s1&&(e.push(i),t=!t||t.indexn===e?(i=!0,!1):(t+=n.len(),!0))),i?t:-1}fullLen(e){let t=0;return h1([e],(e=>(t+=e.len(),!0))),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof s1&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk((t=>(t instanceof l1&&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)}clone(){const e=new d1;return this._children=this.children.map((e=>e.clone())),e}walk(e){h1(this.children,e)}}class c1{constructor(){this._scanner=new e1,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const n=new d1;return this.parseFragment(e,n),this.ensureFinalTabstop(n,null!=i&&i,null!=t&&t),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,s=[];t.walk((e=>(e instanceof s1&&(e.isFinalTabstop?n.set(0,void 0):!n.has(e.index)&&e.children.length>0?n.set(e.index,e.children):s.push(e)),!0)));const o=(e,i)=>{const s=n.get(e.index);if(!s)return;const r=new s1(e.index);r.transform=e.transform;for(const t of s){const e=t.clone();r.appendChild(e),e instanceof s1&&n.has(e.index)&&!i.has(e.index)&&(i.add(e.index),o(e,i),i.delete(e.index))}t.replace(e,[r])},r=new Set;for(const a of s)o(a,r);return t.children.slice(i)}ensureFinalTabstop(e,t,i){if(t||i&&e.placeholders.length>0){e.placeholders.find((e=>0===e.index))||e.appendChild(new s1(0))}}_accept(e,t){if(void 0===e||this._token.type===e){const e=!t||this._scanner.tokenText(this._token);return this._token=this._scanner.next(),e}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(14===this._token.type)return!1;if(5===this._token.type){const e=this._scanner.next();if(0!==e.type&&4!==e.type&&5!==e.type)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(5,!0))&&(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new i1(t)),!0)}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new s1(Number(t)):new l1(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const n=new s1(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(n),!0;if(!this._parse(n))return e.appendChild(new i1("${"+t+":")),n.children.forEach(e.appendChild,e),!0}else{if(!(n.index>0&&this._accept(7)))return this._accept(6)?this._parseTransform(n)?(e.appendChild(n),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(n),!0):this._backTo(i);{const t=new o1;for(;;){if(this._parseChoiceElement(t)){if(this._accept(2))continue;if(this._accept(7)&&(n.appendChild(t),this._accept(4)))return e.appendChild(n),!0}return this._backTo(i),!1}}}}_parseChoiceElement(e){const t=this._token,i=[];for(;2!==this._token.type&&7!==this._token.type;){let e;if(e=(e=this._accept(5,!0))?this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||e:this._accept(void 0,!0),!e)return this._backTo(t),!1;i.push(e)}return 0===i.length?(this._backTo(t),!1):(e.appendChild(new i1(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const n=new l1(t);if(!this._accept(1))return this._accept(6)?this._parseTransform(n)?(e.appendChild(n),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(n),!0):this._backTo(i);for(;;){if(this._accept(4))return e.appendChild(n),!0;if(!this._parse(n))return e.appendChild(new i1("${"+t+":")),n.children.forEach(e.appendChild,e),!0}}_parseTransform(e){const t=new r1;let i="",n="";for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(6,!0)||e,i+=e;else{if(14===this._token.type)return!1;i+=this._accept(void 0,!0)}}for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(5,!0)||this._accept(6,!0)||e,t.appendChild(new i1(e));else if(!this._parseFormatString(t)&&!this._parseAnything(t))return!1}for(;!this._accept(4);){if(14===this._token.type)return!1;n+=this._accept(void 0,!0)}try{t.regexp=new RegExp(i,n)}catch(Mre){return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const n=this._accept(8,!0);if(!n)return this._backTo(t),!1;if(!i)return e.appendChild(new a1(Number(n))),!0;if(this._accept(4))return e.appendChild(new a1(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1;if(this._accept(6)){const i=this._accept(9,!0);return i&&this._accept(4)?(e.appendChild(new a1(Number(n),i)),!0):(this._backTo(t),!1)}if(this._accept(11)){const t=this._until(4);if(t)return e.appendChild(new a1(Number(n),void 0,t,void 0)),!0}else if(this._accept(12)){const t=this._until(4);if(t)return e.appendChild(new a1(Number(n),void 0,void 0,t)),!0}else if(this._accept(13)){const t=this._until(1);if(t){const i=this._until(4);if(i)return e.appendChild(new a1(Number(n),void 0,t,i)),!0}}else{const t=this._until(4);if(t)return e.appendChild(new a1(Number(n),void 0,void 0,t)),!0}return this._backTo(t),!1}_parseAnything(e){return 14!==this._token.type&&(e.appendChild(new i1(this._scanner.tokenText(this._token))),this._accept(void 0),!0)}}var u1=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function g1(e,t,i,n,s=Uh.None,o){return u1(this,void 0,void 0,(function*(){const r=function(e,t){const i=t.getWordAtPosition(e),n=t.getLineMaxColumn(e.lineNumber);return i?new Rh(e.lineNumber,i.startColumn,e.lineNumber,n):Rh.fromPositions(e,e.with(void 0,n))}(t,i),l=e.all(i),h=new $s;for(const e of l)e.groupId&&h.add(e.groupId,e);function d(e){if(!e.yieldsToGroupIds)return[];const t=[];for(const i of e.yieldsToGroupIds||[]){const e=h.get(i);for(const i of e)t.push(i)}return t}const c=new Map,u=new Set;function g(e,t){if(t=[...t,e],u.has(e))return t;u.add(e);try{const i=d(e);for(const e of i){const i=g(e,t);if(i)return i}}finally{u.delete(e)}}function p(e){const o=c.get(e);if(o)return o;const r=g(e,[]);r&&a(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${r.map((e=>e.toString?e.toString():""+e)).join(" -> ")}`));const l=new hd;return c.set(e,l.p),(()=>u1(this,void 0,void 0,(function*(){if(!r){const t=d(e);for(const e of t){const t=yield p(e);if(t&&t.items.length>0)return}}try{return yield e.provideInlineCompletions(i,t,n,s)}catch(Mre){return void a(Mre)}})))().then((e=>l.complete(e)),(e=>l.error(e))),l.p}const m=yield Promise.all(l.map((e=>u1(this,void 0,void 0,(function*(){return{provider:e,completions:yield p(e)}}))))),f=new Map,_=[];for(const e of m){const t=e.completions;if(!t)continue;const n=new m1(t,e.provider);_.push(n);for(const e of t.items){const t=f1.from(e,n,r,i,o);f.set(t.hash(),t)}}return new p1(Array.from(f.values()),new Set(f.keys()),_)}))}class p1{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()}}class m1{constructor(e,t){this.inlineCompletions=e,this.provider=t,this.refCount=1}addRef(){this.refCount++}removeRef(){this.refCount--,0===this.refCount&&this.provider.freeInlineCompletions(this.inlineCompletions)}}class f1{static from(e,t,i,n,s){let o,r,a=e.range?Rh.lift(e.range):i;if("string"==typeof e.insertText){if(o=e.insertText,s&&e.completeBracketPairs){o=_1(o,a.getStartPosition(),n,s);const t=o.length-e.insertText.length;0!==t&&(a=new Rh(a.startLineNumber,a.startColumn,a.endLineNumber,a.endColumn+t))}r=void 0}else if("snippet"in e.insertText){const t=e.insertText.snippet.length;if(s&&e.completeBracketPairs){e.insertText.snippet=_1(e.insertText.snippet,a.getStartPosition(),n,s);const i=e.insertText.snippet.length-t;0!==i&&(a=new Rh(a.startLineNumber,a.startColumn,a.endLineNumber,a.endColumn+i))}const i=(new c1).parse(e.insertText.snippet);1===i.children.length&&i.children[0]instanceof i1?(o=i.children[0].value,r=void 0):(o=i.toString(),r={snippet:e.insertText.snippet,range:a})}else zl(e.insertText);return new f1(o,e.command,a,o,r,e.additionalTextEdits||W0,e,t)}constructor(e,t,i,n,s,o,r,a){this.filterText=e,this.command=t,this.range=i,this.insertText=n,this.snippetInfo=s,this.additionalTextEdits=o,this.sourceInlineCompletion=r,this.source=a,n=(e=e.replace(/\r\n|\r/g,"\n")).replace(/\r\n|\r/g,"\n")}withRange(e){return new f1(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()})}}function _1(e,t,i,n){const s=i.getLineContent(t.lineNumber).substring(0,t.column-1)+e,o=i.tokenization.tokenizeLineWithEdit(t,s.length-(t.column-1),e),r=null==o?void 0:o.sliceAndInflate(t.column-1,s.length,0);if(!r)return e;const a=function(e,t){const i=new Og,n=new ep(i,(e=>t.getLanguageConfiguration(e))),s=ap(new Yg(new J0([e]),n),[],void 0,!0);let o="";const r=e.getLineContent();return function e(t,i){if(2===t.kind)if(e(t.openingBracket,i),i=Cg(i,t.openingBracket.length),t.child&&(e(t.child,i),i=Cg(i,t.child.length)),t.closingBracket)e(t.closingBracket,i),i=Cg(i,t.closingBracket.length);else{const e=n.getSingleLanguageBracketTokens(t.openingBracket.languageId).findClosingTokenText(t.openingBracket.bracketIds);o+=e}else if(3===t.kind);else if(0===t.kind||1===t.kind)o+=r.substring(i,Cg(i,t.length));else if(4===t.kind)for(const n of t.children)e(n,i),i=Cg(i,n.length)}(s,mg),o}(r,n);return a}class v1{constructor(e,t){this.range=e,this.text=t}removeCommonPrefix(e,t){const i=t?this.range.intersectRanges(t):this.range;if(!i)return this;const n=e.getValueInRange(i,1),s=bo(n,this.text),o=H0(this.range.getStartPosition(),z0(n.substring(0,s))),r=this.text.substring(s),a=Rh.fromPositions(o,this.range.getEndPosition());return new v1(a,r)}augments(e){return this.text.startsWith(e.text)&&(t=this.range,(i=e.range).getStartPosition().equals(t.getStartPosition())&&i.getEndPosition().isBeforeOrEqual(t.getEndPosition()));var t,i}computeGhostText(e,t,i,n=0){let s=this.removeCommonPrefix(e);if(s.range.endLineNumber!==s.range.startLineNumber)return;const o=e.getLineContent(s.range.startLineNumber),r=ao(o).length;if(s.range.startColumn-1<=r){const e=ao(s.text).length,t=o.substring(s.range.startColumn-1,r),[i,n]=[s.range.getStartPosition(),s.range.getEndPosition()],a=i.column+t.length<=n.column?i.delta(0,t.length):n,l=Rh.fromPositions(a,n),h=s.text.startsWith(t)?s.text.substring(t.length):s.text.substring(e);s=new v1(l,h)}const a=e.getValueInRange(s.range),l=function(e,t){if((null==b1?void 0:b1.originalValue)===e&&(null==b1?void 0:b1.newValue)===t)return null==b1?void 0:b1.changes;{let i=w1(e,t,!0);if(i){const n=C1(i);if(n>0){const s=w1(e,t,!1);s&&C1(s)0===e.originalLength));if(e.length>1||1===e.length&&e[0].originalStart!==a.length)return}const c=s.text.length-n;for(const u of l){const e=s.range.startColumn+u.originalStart+u.originalLength;if("subwordSmart"===t&&i&&i.lineNumber===s.range.startLineNumber&&e0)return;if(0===u.modifiedLength)continue;const n=u.modifiedStart+u.modifiedLength,o=Math.max(u.modifiedStart,Math.min(n,c)),r=s.text.substring(u.modifiedStart,o),a=s.text.substring(o,Math.max(u.modifiedStart,n));if(r.length>0){const t=oo(r);d.push(new K0(e,t,!1))}if(a.length>0){const t=oo(a);d.push(new K0(e,t,!0))}}return new U0(h,d)}}let b1;function C1(e){let t=0;for(const i of e)t+=i.originalLength;return t}function w1(e,t,i){if(e.length>5e3||t.length>5e3)return;function n(e){let t=0;for(let i=0,n=e.length;it&&(t=n)}return t}const s=Math.max(n(e),n(t));function o(e){if(e<0)throw new Error("unexpected");return s+e+1}function r(e){let t=0,n=0;const s=new Int32Array(e.length);for(let r=0,a=e.length;ra},{getElements:()=>l}).ComputeDiff(!1).changes}var y1=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},S1=function(e,t){return function(i,n){t(i,n,e)}},L1=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let k1=class extends E{constructor(e,t,i,n,s){super(),this.textModel=e,this.versionId=t,this._debounceValue=i,this.languageFeaturesService=n,this.languageConfigurationService=s,this._updateOperation=this._register(new I),this.inlineCompletions=Pj("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=Pj("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent((()=>{this._updateOperation.clear()})))}fetch(e,t,i){var n,s;const o=new D1(e,t,this.textModel.getVersionId()),r=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if(null===(n=this._updateOperation.value)||void 0===n?void 0:n.request.satisfies(o))return this._updateOperation.value.promise;if(null===(s=r.get())||void 0===s?void 0:s.request.satisfies(o))return Promise.resolve(!0);const a=!!this._updateOperation.value;this._updateOperation.clear();const l=new jh,h=(()=>L1(this,void 0,void 0,(function*(){var n,s;if((a||t.triggerKind===pC.Automatic)&&(yield(n=this._debounceValue.get(this.textModel),new Promise((e=>{let t;const i=setTimeout((()=>{t&&t.dispose(),e()}),n);s&&(t=s.onCancellationRequested((()=>{clearTimeout(i),t&&t.dispose(),e()})))})))),l.token.isCancellationRequested||this.textModel.getVersionId()!==o.versionId)return!1;const h=new Date,d=yield g1(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,l.token,this.languageConfigurationService);if(l.token.isCancellationRequested||this.textModel.getVersionId()!==o.versionId)return!1;const c=new Date;this._debounceValue.update(this.textModel,c.getTime()-h.getTime());const u=new N1(d,o,this.textModel,this.versionId);if(i){const t=i.toInlineCompletion(void 0);i.canBeReused(this.textModel,e)&&!d.has(t)&&u.prepend(i.inlineCompletion,t.range,!0)}return this._updateOperation.clear(),Ej((e=>{r.set(u,e)})),!0})))(),d=new x1(o,l,h);return this._updateOperation.value=d,h}clear(e){this._updateOperation.clear(),this.inlineCompletions.set(void 0,e),this.suggestWidgetInlineCompletions.set(void 0,e)}clearSuggestWidgetInlineCompletions(e){var t;(null===(t=this._updateOperation.value)||void 0===t?void 0:t.request.context.selectedSuggestionInfo)&&this._updateOperation.clear(),this.suggestWidgetInlineCompletions.set(void 0,e)}cancelUpdate(){this._updateOperation.clear()}};k1=y1([S1(3,oL),S1(4,Ju)],k1);class D1{constructor(e,t,i){this.position=e,this.context=t,this.versionId=i}satisfies(e){return this.position.equals(e.position)&&function(e,t,i){if(!e||!t)return e===t;return i(e,t)}(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,((e,t)=>e.equals(t)))&&(e.context.triggerKind===pC.Automatic||this.context.triggerKind===pC.Explicit)&&this.versionId===e.versionId}}class x1{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class N1{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=[],this._rangeVersionIdValue=0,this._rangeVersionId=Wj(this,(e=>{this.versionId.read(e);let t=!1;for(const i of this._inlineCompletions)t=t||i._updateRange(this.textModel);return t&&this._rangeVersionIdValue++,this._rangeVersionIdValue}));const s=i.deltaDecorations([],e.completions.map((e=>({range:e.range,options:{description:"inline-completion-tracking-range"}}))));this._inlineCompletions=e.completions.map(((e,t)=>new E1(e,s[t],this._rangeVersionId)))}clone(){return this._refCount++,this}dispose(){if(this._refCount--,0===this._refCount){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 E1(e,n,this._rangeVersionId,t)),this._prependedInlineCompletionItems.push(e)}}class E1{get forwardStable(){var e;return null!==(e=this.inlineCompletion.source.inlineCompletions.enableForwardStability)&&void 0!==e&&e}constructor(e,t,i,n){this.inlineCompletion=e,this.decorationId=t,this.rangeVersion=i,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._isValid=!0,this._updatedRange=null!=n?n:e.range}toInlineCompletion(e){return this.inlineCompletion.withRange(this._getUpdatedRange(e))}toSingleTextEdit(e){return new v1(this._getUpdatedRange(e),this.inlineCompletion.insertText)}isVisible(e,t,i){const n=this._toFilterTextReplacement(i).removeCommonPrefix(e);if(!this._isValid||!this.inlineCompletion.range.getStartPosition().equals(this._getUpdatedRange(i).getStartPosition())||t.lineNumber!==n.range.startLineNumber)return!1;const s=e.getValueInRange(n.range,1).toLowerCase(),o=n.text.toLowerCase(),r=Math.max(0,t.column-n.range.startColumn);let a=o.substring(0,r),l=o.substring(r),h=s.substring(0,r),d=s.substring(r);const c=e.getLineIndentColumn(n.range.startLineNumber);return n.range.startColumn<=c&&(h=h.trimStart(),0===h.length&&(d=d.trimStart()),a=a.trimStart(),0===a.length&&(l=l.trimStart())),a.startsWith(h)&&!!Yo(d,l)}canBeReused(e,t){return this._isValid&&this._getUpdatedRange(void 0).containsPosition(t)&&this.isVisible(e,t,void 0)&&!this._isSmallerThanOriginal(void 0)}_toFilterTextReplacement(e){return new v1(this._getUpdatedRange(e),this.inlineCompletion.filterText)}_isSmallerThanOriginal(e){return I1(this._getUpdatedRange(e)).isBefore(I1(this.inlineCompletion.range))}_getUpdatedRange(e){return this.rangeVersion.read(e),this._updatedRange}_updateRange(e){const t=e.getDecorationRange(this.decorationId);return t?!this._updatedRange.equalsRange(t)&&(this._updatedRange=t,!0):(this._isValid=!1,!0)}}function I1(e){return e.startLineNumber===e.endLineNumber?new Va(1,1+e.endColumn-e.startColumn):new Va(1+e.endLineNumber-e.startLineNumber,e.endColumn)}var M1=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const T1={Visible:xX,HasFocusedSuggestion:new Al("suggestWidgetHasFocusedSuggestion",!1,ue(0,"Whether any suggestion is focused")),DetailsVisible:new Al("suggestWidgetDetailsVisible",!1,ue(0,"Whether suggestion details are visible")),MultipleSuggestions:new Al("suggestWidgetMultipleSuggestions",!1,ue(0,"Whether there are multiple suggestions to pick from")),MakesTextEdit:new Al("suggestionMakesTextEdit",!0,ue(0,"Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new Al("acceptSuggestionOnEnter",!0,ue(0,"Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new Al("suggestionHasInsertAndReplaceRange",!1,ue(0,"Whether the current suggestion has insert and replace behaviour")),InsertMode:new Al("suggestionInsertMode",void 0,{type:"string",description:ue(0,"Whether the default behaviour is to insert or replace")}),CanResolve:new Al("suggestionCanResolve",!1,ue(0,"Whether the current suggestion supports to resolve further details"))},R1=new eh("suggestWidgetStatusBar");class A1{constructor(e,t,i,n){var s;this.position=e,this.completion=t,this.container=i,this.provider=n,this.isInvalid=!1,this.score=Mr.Default,this.distance=0,this.textLabel="string"==typeof t.label?t.label:null===(s=t.label)||void 0===s?void 0:s.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,Rh.isIRange(t.range)?(this.editStart=new Va(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new Va(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new Va(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||Rh.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new Va(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new Va(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new Va(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||Rh.spansMultipleLines(t.range.insert)||Rh.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),"function"!=typeof n.resolveCompletionItem&&(this._resolveCache=Promise.resolve(),this._resolveDuration=0)}get isResolved(){return void 0!==this._resolveDuration}get resolveDuration(){return void 0!==this._resolveDuration?this._resolveDuration:-1}resolve(e){return M1(this,void 0,void 0,(function*(){if(!this._resolveCache){const t=e.onCancellationRequested((()=>{this._resolveCache=void 0,this._resolveDuration=void 0})),i=new F(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then((e=>{Object.assign(this.completion,e),this._resolveDuration=i.elapsed()}),(e=>{d(e)&&(this._resolveCache=void 0,this._resolveDuration=void 0)})).finally((()=>{t.dispose()}))}return this._resolveCache}))}}class O1{constructor(e=2,t=new Set,i=new Set,n=new Map,s=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=n,this.showDeprecated=s}}let P1;O1.default=new O1;class F1{constructor(e,t,i,n){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=n}}function B1(e,t,i,n=O1.default,s={triggerKind:0},o=Uh.None){return M1(this,void 0,void 0,(function*(){const r=new F;i=i.clone();const l=t.getWordAtPosition(i),h=l?new Rh(i.lineNumber,l.startColumn,i.lineNumber,l.endColumn):Rh.fromPositions(i),d={replace:h,insert:h.setEndPosition(i.lineNumber,i.column)},u=[],g=new N,p=[];let m=!1;const f=(e,t,s)=>{var o,r,a;let l=!1;if(!t)return l;for(const h of t.suggestions)if(!n.kindFilter.has(h.kind)){if(!n.showDeprecated&&(null===(o=null==h?void 0:h.tags)||void 0===o?void 0:o.includes(1)))continue;h.range||(h.range=d),h.sortText||(h.sortText="string"==typeof h.label?h.label:h.label.label),!m&&h.insertTextRules&&4&h.insertTextRules&&(m=c1.guessNeedsClipboard(h.insertText)),u.push(new A1(i,h,t,e)),l=!0}return L(t)&&g.add(t),p.push({providerName:null!==(r=e._debugDisplayName)&&void 0!==r?r:"unknown_provider",elapsedProvider:null!==(a=t.duration)&&void 0!==a?a:-1,elapsedOverall:s.elapsed()}),l},_=(()=>M1(this,void 0,void 0,(function*(){})))();for(const c of e.orderedGroups(t)){let e=!1;if(yield Promise.all(c.map((r=>M1(this,void 0,void 0,(function*(){if(n.providerItemsToReuse.has(r)){const t=n.providerItemsToReuse.get(r);return t.forEach((e=>u.push(e))),void(e=e||t.length>0)}if(!(n.providerFilter.size>0)||n.providerFilter.has(r))try{const n=new F,a=yield r.provideCompletionItems(t,i,s,o);e=f(r,a,n)||e}catch(l){a(l)}}))))),e||o.isCancellationRequested)break}return yield _,o.isCancellationRequested?(g.dispose(),Promise.reject(new c)):new F1(u.sort((v=n.snippetSortOrder,V1.get(v))),m,{entries:p,elapsed:r.elapsed()},g);var v}))}function W1(e,t){if(e.sortTextLow&&t.sortTextLow){if(e.sortTextLowt.sortTextLow)return 1}return e.textLabelt.textLabel?1:e.completion.kind-t.completion.kind}const V1=new Map;V1.set(0,(function(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return-1;if(27===t.completion.kind)return 1}return W1(e,t)})),V1.set(2,(function(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return 1;if(27===t.completion.kind)return-1}return W1(e,t)})),V1.set(1,W1),Xa.registerCommand("_executeCompletionItemProvider",((e,...t)=>M1(void 0,void 0,void 0,(function*(){const[i,n,s,o]=t;qr(an.isUri(i)),qr(Va.isIPosition(n)),qr("string"==typeof s||!s),qr("number"==typeof o||!o);const{completionProvider:r}=e.get(oL),a=yield e.get(za).createModelReference(i);try{const e={incomplete:!1,suggestions:[]},t=[],i=a.object.textEditorModel.validatePosition(n),l=yield B1(r,a.object.textEditorModel,i,void 0,{triggerCharacter:null!=s?s:void 0,triggerKind:s?1:0});for(const n of l.items)t.length<(null!=o?o:0)&&t.push(n.resolve(Uh.None)),e.incomplete=e.incomplete||n.container.incomplete,e.suggestions.push(n.completion);try{return yield Promise.all(t),e}finally{setTimeout((()=>l.disposable.dispose()),100)}}finally{a.dispose()}}))));class H1{static isAllOff(e){return"off"===e.other&&"off"===e.comments&&"off"===e.strings}static isAllOn(e){return"on"===e.other&&"on"===e.comments&&"on"===e.strings}static valueFor(e,t){switch(t){case 1:return e.comments;case 2:return e.strings;default:return e.other}}}function z1(e,t=Oe){return function(e,t=Oe){return!!t&&ma(e.charCodeAt(0))&&58===e.charCodeAt(1)}(e,t)?e.charAt(0).toUpperCase()+e.slice(1):e}Object.create(null);var U1=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},K1=function(e,t){return function(i,n){t(i,n,e)}};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 j1{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const i=t.resolve(e);if(void 0!==i)return i}}}class q1{constructor(e,t,i,n){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=n}resolve(e){const{name:t}=e;if("SELECTION"===t||"TM_SELECTED_TEXT"===t){let t=this._model.getValueInRange(this._selection)||void 0,i=this._selection.startLineNumber!==this._selection.endLineNumber;if(!t&&this._overtypingCapturer){const e=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);e&&(t=e.value,i=e.multiline)}if(t&&i&&e.snippet){const i=ao(this._model.getLineContent(this._selection.startLineNumber),0,this._selection.startColumn-1);let n=i;e.snippet.walk((t=>t!==e&&(t instanceof i1&&(n=ao(oo(t.value).pop())),!0)));const s=bo(n,i);t=t.replace(/(\r\n|\r|\n)(.*)/g,((e,t,i)=>`${t}${n.substr(s)}${i}`))}return t}if("TM_CURRENT_LINE"===t)return this._model.getLineContent(this._selection.positionLineNumber);if("TM_CURRENT_WORD"===t){const e=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return e&&e.word||void 0}return"TM_LINE_INDEX"===t?String(this._selection.positionLineNumber-1):"TM_LINE_NUMBER"===t?String(this._selection.positionLineNumber):"CURSOR_INDEX"===t?String(this._selectionIdx):"CURSOR_NUMBER"===t?String(this._selectionIdx+1):void 0}}class $1{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if("TM_FILENAME"===t)return Xi(this._model.uri.fsPath);if("TM_FILENAME_BASE"===t){const e=Xi(this._model.uri.fsPath),t=e.lastIndexOf(".");return t<=0?e:e.slice(0,t)}return"TM_DIRECTORY"===t?"."===Yi(this._model.uri.fsPath)?"":this._labelService.getUriLabel(Sa(this._model.uri)):"TM_FILEPATH"===t?this._labelService.getUriLabel(this._model.uri):"RELATIVE_FILEPATH"===t?this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0}):void 0}}class G1{constructor(e,t,i,n){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=n}resolve(e){if("CLIPBOARD"!==e.name)return;const t=this._readClipboardText();if(t){if(this._spread){const e=t.split(/\r\n|\n|\r/).filter((e=>!Ys(e)));if(e.length===this._selectionCount)return e[this._selectionIdx]}return t}}}let Z1=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)return"LINE_COMMENT"===t?n.lineCommentToken||void 0:"BLOCK_COMMENT_START"===t?n.blockCommentStartToken||void 0:"BLOCK_COMMENT_END"===t&&n.blockCommentEndToken||void 0}};Z1=U1([K1(2,Ju)],Z1);class Y1{constructor(){this._date=new Date}resolve(e){const{name:t}=e;if("CURRENT_YEAR"===t)return String(this._date.getFullYear());if("CURRENT_YEAR_SHORT"===t)return String(this._date.getFullYear()).slice(-2);if("CURRENT_MONTH"===t)return String(this._date.getMonth().valueOf()+1).padStart(2,"0");if("CURRENT_DATE"===t)return String(this._date.getDate().valueOf()).padStart(2,"0");if("CURRENT_HOUR"===t)return String(this._date.getHours().valueOf()).padStart(2,"0");if("CURRENT_MINUTE"===t)return String(this._date.getMinutes().valueOf()).padStart(2,"0");if("CURRENT_SECOND"===t)return String(this._date.getSeconds().valueOf()).padStart(2,"0");if("CURRENT_DAY_NAME"===t)return Y1.dayNames[this._date.getDay()];if("CURRENT_DAY_NAME_SHORT"===t)return Y1.dayNamesShort[this._date.getDay()];if("CURRENT_MONTH_NAME"===t)return Y1.monthNames[this._date.getMonth()];if("CURRENT_MONTH_NAME_SHORT"===t)return Y1.monthNamesShort[this._date.getMonth()];if("CURRENT_SECONDS_UNIX"===t)return String(Math.floor(this._date.getTime()/1e3));if("CURRENT_TIMEZONE_OFFSET"===t){const e=this._date.getTimezoneOffset(),t=e>0?"-":"+",i=Math.trunc(Math.abs(e/60)),n=i<10?"0"+i:i,s=Math.abs(e)-60*i;return t+n+":"+(s<10?"0"+s:s)}}}Y1.dayNames=[ue(0,"Sunday"),ue(0,"Monday"),ue(0,"Tuesday"),ue(0,"Wednesday"),ue(0,"Thursday"),ue(0,"Friday"),ue(0,"Saturday")],Y1.dayNamesShort=[ue(0,"Sun"),ue(0,"Mon"),ue(0,"Tue"),ue(0,"Wed"),ue(0,"Thu"),ue(0,"Fri"),ue(0,"Sat")],Y1.monthNames=[ue(0,"January"),ue(0,"February"),ue(0,"March"),ue(0,"April"),ue(0,"May"),ue(0,"June"),ue(0,"July"),ue(0,"August"),ue(0,"September"),ue(0,"October"),ue(0,"November"),ue(0,"December")],Y1.monthNamesShort=[ue(0,"Jan"),ue(0,"Feb"),ue(0,"Mar"),ue(0,"Apr"),ue(0,"May"),ue(0,"Jun"),ue(0,"Jul"),ue(0,"Aug"),ue(0,"Sep"),ue(0,"Oct"),ue(0,"Nov"),ue(0,"Dec")];class X1{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=function(e,t){if("string"==typeof e||void 0===e)return"string"==typeof e?{id:Xi(e)}:t?Yq:Xq;const i=e;return i.configuration?{id:i.id,configPath:i.configuration}:1===i.folders.length?{id:i.id,uri:i.folders[0].uri}:{id:i.id}}(this._workspaceService.getWorkspace());return Zq(t)?void 0:"WORKSPACE_NAME"===e.name?this._resolveWorkspaceName(t):"WORKSPACE_FOLDER"===e.name?this._resoveWorkspacePath(t):void 0}_resolveWorkspaceName(e){if(Gq(e))return Xi(e.uri.path);let t=Xi(e.configPath.path);return t.endsWith(Jq)&&(t=t.substr(0,t.length-14-1)),t}_resoveWorkspacePath(e){if(Gq(e))return z1(e.uri.fsPath);const t=Xi(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?z1(i):"/"}}class Q1{resolve(e){const{name:t}=e;return"RANDOM"===t?Math.random().toString().slice(-6):"RANDOM_HEX"===t?Math.random().toString(16).slice(-6):"UUID"===t?NZ():void 0}}var J1,e2=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},t2=function(e,t){return function(i,n){t(i,n,e)}};class i2{constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=Od(t.placeholders,s1.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(-1===this._offset)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),s=this._snippet.fullLen(i),o=Rh.fromPositions(e.getPositionAt(this._offset+n),e.getPositionAt(this._offset+n+s)),r=i.isFinalTabstop?i2._decor.inactiveFinal:i2._decor.inactive,a=t.addDecoration(o,r);this._placeholderDecorations.set(i,a)}}))}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const e=[];for(const t of this._placeholderGroups[this._placeholderGroupsIdx])if(t.transform){const i=this._placeholderDecorations.get(t),n=this._editor.getModel().getDecorationRange(i),s=this._editor.getModel().getValueInRange(n),o=t.transform.resolve(s).split(/\r\n|\r|\n/);for(let e=1;e0&&this._editor.executeEdits("snippet.placeholderTransform",e)}let t=!1;!0===e&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations((e=>{const i=new Set,n=[];for(const s of this._placeholderGroups[this._placeholderGroupsIdx]){const o=this._placeholderDecorations.get(s),r=this._editor.getModel().getDecorationRange(o);n.push(new Ah(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(s),e.changeDecorationOptions(o,s.isFinalTabstop?i2._decor.activeFinal:i2._decor.active),i.add(s);for(const t of this._snippet.enclosingPlaceholders(s)){const n=this._placeholderDecorations.get(t);e.changeDecorationOptions(n,t.isFinalTabstop?i2._decor.activeFinal:i2._decor.active),i.add(t)}}for(const[t,s]of this._placeholderDecorations)i.has(t)||e.changeDecorationOptions(s,t.isFinalTabstop?i2._decor.inactiveFinal:i2._decor.inactive);return n}));return t?this.move(e):null!=i?i:[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof s1){const e=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(e).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||0===this._placeholderGroups.length}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}get isTrivialSnippet(){if(0===this._snippet.placeholders.length)return!0;if(1===this._snippet.placeholders.length){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 t=this._placeholderDecorations.get(n),s=this._editor.getModel().getDecorationRange(t);if(!s){e.delete(n.index);break}i.push(s)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!(null==e?void 0:e.choice))return;const t=this._placeholderDecorations.get(e);if(!t)return;const i=this._editor.getModel().getDecorationRange(t);return i?{range:i,choice:e.choice}:void 0}get hasChoice(){let e=!1;return this._snippet.walk((t=>(e=t instanceof o1,!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 s=e.shift();console.assert(-1!==s._offset),console.assert(!s._placeholderDecorations);const o=s._snippet.placeholderInfo.last.index;for(const e of s._snippet.placeholderInfo.all)e.isFinalTabstop?e.index=n.index+(o+1)/this._nestingLevel:e.index=n.index+e.index/this._nestingLevel;this._snippet.replace(n,s._snippet.children);const r=this._placeholderDecorations.get(n);i.removeDecoration(r),this._placeholderDecorations.delete(n);for(const e of s._snippet.placeholders){const n=s._snippet.offset(e),o=s._snippet.fullLen(e),r=Rh.fromPositions(t.getPositionAt(s._offset+n),t.getPositionAt(s._offset+n+o)),a=i.addDecoration(r,i2._decor.inactive);this._placeholderDecorations.set(e,a)}}this._placeholderGroups=Od(this._snippet.placeholders,s1.compareByIndex)}))}}i2._decor={active:Iw.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:Iw.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:Iw.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:Iw.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};const n2={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let s2=J1=class{static adjustWhitespace(e,t,i,n,s){const o=ao(e.getLineContent(t.lineNumber),0,t.column-1);let r;return n.walk((t=>{if(!(t instanceof i1)||t.parent instanceof o1)return!0;if(s&&!s.has(t))return!0;const a=t.value.split(/\r\n|\r|\n/);if(i){const i=n.offset(t);if(0===i)a[0]=e.normalizeIndentation(a[0]);else{r=null!=r?r:n.toString();const t=r.charCodeAt(i-1);10!==t&&13!==t||(a[0]=e.normalizeIndentation(o+a[0]))}for(let t=1;te.get($q))),g=e.invokeWithinContext((e=>new $1(e.get(Zz),c))),p=()=>r,m=c.getValueInRange(J1.adjustSelection(c,e.getSelection(),i,0)),f=c.getValueInRange(J1.adjustSelection(c,e.getSelection(),0,n)),_=c.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),v=e.getSelections().map(((e,t)=>({selection:e,idx:t}))).sort(((e,t)=>Rh.compareRangesUsingStarts(e.selection,t.selection)));for(const{selection:b,idx:C}of v){let r=J1.adjustSelection(c,b,i,0),w=J1.adjustSelection(c,b,0,n);m!==c.getValueInRange(r)&&(r=b),f!==c.getValueInRange(w)&&(w=b);const y=b.setStartPosition(r.startLineNumber,r.startColumn).setEndPosition(w.endLineNumber,w.endColumn),S=(new c1).parse(t,!0,s),L=y.getStartPosition(),k=J1.adjustWhitespace(c,L,o||C>0&&_!==c.getLineFirstNonWhitespaceColumn(b.positionLineNumber),S);S.resolveVariables(new j1([g,new G1(p,C,v.length,"spread"===e.getOption(78)),new q1(c,b,C,a),new Z1(c,b,l),new Y1,new X1(u),new Q1])),h[C]=Fq.replace(y,S.toString()),h[C].identifier={major:C,minor:0},h[C]._isTracked=!0,d[C]=new i2(e,S,k)}return{edits:h,snippets:d}}static createEditsAndSnippetsFromEdits(e,t,i,n,s,o,r){if(!e.hasModel()||0===t.length)return{edits:[],snippets:[]};const a=[],l=e.getModel(),h=new c1,d=new d1,c=new j1([e.invokeWithinContext((e=>new $1(e.get(Zz),l))),new G1((()=>s),0,e.getSelections().length,"spread"===e.getOption(78)),new q1(l,e.getSelection(),0,o),new Z1(l,e.getSelection(),r),new Y1,new X1(e.invokeWithinContext((e=>e.get($q)))),new Q1]);t=t.sort(((e,t)=>Rh.compareRangesUsingStarts(e.range,t.range)));let u=0;for(let g=0;g0){const i=t[g-1].range,n=Rh.fromPositions(i.getEndPosition(),e.getStartPosition()),s=new i1(l.getValueInRange(n));d.appendChild(s),u+=s.value.length}const n=h.parseFragment(i,d);J1.adjustWhitespace(l,e.getStartPosition(),!0,d,new Set(n)),d.resolveVariables(c);const s=d.toString(),o=s.slice(u);u=s.length;const r=Fq.replace(e,o);r.identifier={major:g,minor:0},r._isTracked=!0,a.push(r)}return h.ensureFinalTabstop(d,i,!0),{edits:a,snippets:[new i2(e,d,"")]}}constructor(e,t,i=n2,n){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=n,this._templateMerges=[],this._snippets=[]}dispose(){k(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(){if(!this._editor.hasModel())return;const{edits:e,snippets:t}="string"==typeof this._template?J1.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):J1.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,(e=>{const i=e.filter((e=>!!e.identifier));for(let n=0;nAh.fromPositions(e.range.getEndPosition())))})),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=n2){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:n}=J1.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",i,(e=>{const t=e.filter((e=>!!e.identifier));for(let s=0;sAh.fromPositions(e.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{e.push(...n.get(t))}))}e.sort(Rh.compareRangesUsingStarts);for(const[i,n]of t)if(n.length===e.length){n.sort(Rh.compareRangesUsingStarts);for(let s=0;s0}};s2=J1=e2([t2(3,Ju)],s2);var o2,r2=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},a2=function(e,t){return function(i,n){t(i,n,e)}};const l2={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let h2=o2=class{static get(e){return e.getContribution(o2.ID)}constructor(e,t,i,n,s){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=s,this._snippetListener=new N,this._modelVersionId=-1,this._inSnippet=o2.InSnippetMode.bindTo(n),this._hasNextTabstop=o2.HasNextTabstop.bindTo(n),this._hasPrevTabstop=o2.HasPrevTabstop.bindTo(n)}dispose(){var e;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),null===(e=this._session)||void 0===e||e.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,void 0===t?l2:Object.assign(Object.assign({},l2),t))}catch(Mre){this.cancel(),this._logService.error(Mre),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}_doInsert(e,t){var i;if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&"string"!=typeof e&&this.cancel(),this._session?(qr("string"==typeof e),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new s2(this._editor,e,t,this._languageConfigurationService),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),null===(i=this._session)||void 0===i?void 0:i.hasChoice){const e={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(e,t)=>{if(!this._session||e!==this._editor.getModel()||!Va.equals(this._editor.getPosition(),t))return;const{activeChoice:i}=this._session;if(!i||0===i.choice.options.length)return;const n=e.getValueInRange(i.range),s=Boolean(i.choice.options.find((e=>e.value===n))),o=[];for(let r=0;r{null==i||i.dispose(),n=!1},o=()=>{n||(i=this._languageFeaturesService.completionProvider.register({language:t.getLanguageId(),pattern:t.uri.fsPath,scheme:t.uri.scheme,exclusive:!0},e),this._snippetListener.add(i),n=!0)};this._choiceCompletions={provider:e,enable:o,disable:s}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent((e=>e.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(){var e;if(!this._session||!this._editor.hasModel())return void(this._currentChoice=void 0);const{activeChoice:t}=this._session;if(!t||!this._choiceCompletions)return null===(e=this._choiceCompletions)||void 0===e||e.disable(),void(this._currentChoice=void 0);this._currentChoice!==t.choice&&(this._currentChoice=t.choice,this._choiceCompletions.enable(),queueMicrotask((()=>{!function(e,t){var i;null===(i=e.getContribution("editor.contrib.suggestController"))||void 0===i||i.triggerSuggest((new Set).add(t),void 0,!0)}(this._editor,this._choiceCompletions.provider)})))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){var t;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,null===(t=this._session)||void 0===t||t.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){var e;null===(e=this._session)||void 0===e||e.prev(),this._updateState()}next(){var e;null===(e=this._session)||void 0===e||e.next(),this._updateState()}isInSnippet(){return Boolean(this._inSnippet.get())}};h2.ID="snippetController2",h2.InSnippetMode=new Al("inSnippetMode",!1,ue(0,"Whether the editor in current in snippet mode")),h2.HasNextTabstop=new Al("hasNextTabstop",!1,ue(0,"Whether there is a next tab stop when in snippet mode")),h2.HasPrevTabstop=new Al("hasPrevTabstop",!1,ue(0,"Whether there is a previous tab stop when in snippet mode")),h2=o2=r2([a2(1,hh),a2(2,oL),a2(3,Ol),a2(4,Ju)],h2),Dh(h2.ID,h2,4);const d2=vh.bindToContribution(h2.get);Sh(new d2({id:"jumpToNextSnippetPlaceholder",precondition:pl.and(h2.InSnippetMode,h2.HasNextTabstop),handler:e=>e.next(),kbOpts:{weight:130,kbExpr:Oh.editorTextFocus,primary:2}})),Sh(new d2({id:"jumpToPrevSnippetPlaceholder",precondition:pl.and(h2.InSnippetMode,h2.HasPrevTabstop),handler:e=>e.prev(),kbOpts:{weight:130,kbExpr:Oh.editorTextFocus,primary:1026}})),Sh(new d2({id:"leaveSnippet",precondition:h2.InSnippetMode,handler:e=>e.cancel(!0),kbOpts:{weight:130,kbExpr:Oh.editorTextFocus,primary:9,secondary:[1033]}})),Sh(new d2({id:"acceptSnippet",precondition:h2.InSnippetMode,handler:e=>e.finish()}));var c2,u2=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},g2=function(e,t){return function(i,n){t(i,n,e)}},p2=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};!function(e){e[e.Undo=0]="Undo",e[e.Redo=1]="Redo",e[e.AcceptWord=2]="AcceptWord",e[e.Other=3]="Other"}(c2||(c2={}));let m2=class extends E{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,n,s,o,r,a,l,h,d,c){let u;super(),this.textModel=e,this.selectedSuggestItem=t,this.cursorPosition=i,this.textModelVersionId=n,this._debounceValue=s,this._suggestPreviewEnabled=o,this._suggestPreviewMode=r,this._inlineSuggestMode=a,this._enabled=l,this._instantiationService=h,this._commandService=d,this._languageConfigurationService=c,this._source=this._register(this._instantiationService.createInstance(k1,this.textModel,this.textModelVersionId,this._debounceValue)),this._isActive=Aj(this,!1),this._forceUpdate=eq("forceUpdate"),this._selectedInlineCompletionId=Aj(this,void 0),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([c2.Redo,c2.Undo,c2.AcceptWord]),this._fetchInlineCompletions=function(e,t){var i;return new zj(e.owner,e.debugName,t,e.createEmptyChangeSummary,e.handleChange,void 0,null!==(i=e.equalityComparer)&&void 0!==i?i:Bj)}({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:pC.Automatic}),handleChange:(e,t)=>(e.didChange(this.textModelVersionId)&&this._preserveCurrentCompletionReasons.has(e.change)?t.preserveCurrentCompletion=!0:e.didChange(this._forceUpdate)&&(t.inlineCompletionTriggerKind=e.change),!0)},((e,t)=>{this._forceUpdate.read(e);if(!(this._enabled.read(e)&&this.selectedSuggestItem.read(e)||this._isActive.read(e)))return void this._source.cancelUpdate();this.textModelVersionId.read(e);const i=this.selectedInlineCompletion.get(),n=t.preserveCurrentCompletion||(null==i?void 0:i.forwardStable)?i:void 0,s=this._source.suggestWidgetInlineCompletions.get(),o=this.selectedSuggestItem.read(e);if(s&&!o){const e=this._source.inlineCompletions.get();Ej((t=>{e&&s.request.versionId>e.request.versionId&&this._source.inlineCompletions.set(s.clone(),t),this._source.clearSuggestWidgetInlineCompletions(t)}))}const r=this.cursorPosition.read(e),a={triggerKind:t.inlineCompletionTriggerKind,selectedSuggestionInfo:null==o?void 0:o.toSelectedSuggestionInfo()};return this._source.fetch(r,a,n)})),this._filteredInlineCompletionItems=Wj(this,(e=>{const t=this._source.inlineCompletions.read(e);if(!t)return[];const i=this.cursorPosition.read(e),n=t.inlineCompletions.filter((t=>t.isVisible(this.textModel,i,e)));return n})),this.selectedInlineCompletionIndex=Wj(this,(e=>{const t=this._selectedInlineCompletionId.read(e),i=this._filteredInlineCompletionItems.read(e),n=void 0===this._selectedInlineCompletionId?-1:i.findIndex((e=>e.semanticId===t));return-1===n?(this._selectedInlineCompletionId.set(void 0,void 0),0):n})),this.selectedInlineCompletion=Wj(this,(e=>this._filteredInlineCompletionItems.read(e)[this.selectedInlineCompletionIndex.read(e)])),this.lastTriggerKind=this._source.inlineCompletions.map((e=>null==e?void 0:e.request.context.triggerKind)),this.inlineCompletionsCount=Wj(this,(e=>this.lastTriggerKind.read(e)===pC.Explicit?this._filteredInlineCompletionItems.read(e).length:void 0)),this.state=Vj({owner:this,equalityComparer:(e,t)=>e&&t?q0(e.ghostText,t.ghostText)&&e.inlineCompletion===t.inlineCompletion&&e.suggestItem===t.suggestItem:e===t},(e=>{var t;const i=this.textModel,n=this.selectedSuggestItem.read(e);if(n){const s=n.toSingleTextEdit().removeCommonPrefix(i),o=this._computeAugmentedCompletion(s,e);if(!this._suggestPreviewEnabled.read(e)&&!o)return;const r=null!==(t=null==o?void 0:o.edit)&&void 0!==t?t:s,a=o?o.edit.text.length-s.text.length:0,l=this._suggestPreviewMode.read(e),h=this.cursorPosition.read(e),d=r.computeGhostText(i,l,h,a);return{ghostText:null!=d?d:new U0(r.range.endLineNumber,[]),inlineCompletion:null==o?void 0:o.completion,suggestItem:n}}{if(!this._isActive.read(e))return;const t=this.selectedInlineCompletion.read(e);if(!t)return;const n=t.toSingleTextEdit(e),s=this._inlineSuggestMode.read(e),o=this.cursorPosition.read(e),r=n.computeGhostText(i,s,o);return r?{ghostText:r,inlineCompletion:t,suggestItem:void 0}:void 0}})),this.ghostText=Vj({owner:this,equalityComparer:q0},(e=>{const t=this.state.read(e);if(t)return t.ghostText})),this._register(iq(this._fetchInlineCompletions)),this._register(Kj((e=>{var t,i;const n=this.state.read(e),s=null==n?void 0:n.inlineCompletion;if((null==s?void 0:s.semanticId)!==(null==u?void 0:u.semanticId)&&(u=s,s)){const e=s.inlineCompletion,n=e.source;null===(i=(t=n.provider).handleItemDidShow)||void 0===i||i.call(t,n.inlineCompletions,e.sourceInlineCompletion,e.insertText)}})))}trigger(e){return p2(this,void 0,void 0,(function*(){this._isActive.set(!0,e),yield this._fetchInlineCompletions.get()}))}triggerExplicitly(e){return p2(this,void 0,void 0,(function*(){Ij(e,(e=>{this._isActive.set(!0,e),this._forceUpdate.trigger(e,pC.Explicit)})),yield this._fetchInlineCompletions.get()}))}stop(e){Ij(e,(e=>{this._isActive.set(!1,e),this._source.clear(e)}))}_computeAugmentedCompletion(e,t){const i=this.textModel,n=this._source.suggestWidgetInlineCompletions.read(t);return function(e,t){for(const i of e){const e=t(i);if(void 0!==e)return e}}(n?n.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(Kr),(n=>{let s=n.toSingleTextEdit(t);return s=s.removeCommonPrefix(i,Rh.fromPositions(s.range.getStartPosition(),e.range.getEndPosition())),s.augments(e)?{edit:s,completion:n}:void 0}))}_deltaSelectedInlineCompletionIndex(e){return p2(this,void 0,void 0,(function*(){yield 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)}))}next(){return p2(this,void 0,void 0,(function*(){yield this._deltaSelectedInlineCompletionIndex(1)}))}previous(){return p2(this,void 0,void 0,(function*(){yield this._deltaSelectedInlineCompletionIndex(-1)}))}accept(e){var t;return p2(this,void 0,void 0,(function*(){if(e.getModel()!==this.textModel)throw new f;const i=this.state.get();if(!i||i.ghostText.isEmpty()||!i.inlineCompletion)return;const n=i.inlineCompletion.toInlineCompletion(void 0);e.pushUndoStop(),n.snippetInfo?(e.executeEdits("inlineSuggestion.accept",[Fq.replaceMove(n.range,""),...n.additionalTextEdits]),e.setPosition(n.snippetInfo.range.getStartPosition()),null===(t=h2.get(e))||void 0===t||t.insert(n.snippetInfo.snippet,{undoStopBefore:!1})):e.executeEdits("inlineSuggestion.accept",[Fq.replaceMove(n.range,n.insertText),...n.additionalTextEdits]),n.command&&n.source.addRef(),Ej((e=>{this._source.clear(e),this._isActive.set(!1,e)})),n.command&&(yield this._commandService.executeCommand(n.command.id,...n.command.arguments||[]).then(void 0,a),n.source.removeRef())}))}acceptNextWord(e){return p2(this,void 0,void 0,(function*(){yield this._acceptNext(e,((e,t)=>{const i=this.textModel.getLanguageIdAtPosition(e.lineNumber,e.column),n=this._languageConfigurationService.getLanguageConfiguration(i),s=new RegExp(n.wordDefinition.source,n.wordDefinition.flags.replace("g","")),o=t.match(s);let r=0;r=o&&void 0!==o.index?0===o.index?o[0].length:o.index:t.length;const a=/\s+/g.exec(t);return a&&void 0!==a.index&&a.index+a[0].length{const i=t.match(/\n/);return i&&void 0!==i.index?i.index+1:t.length}))}))}_acceptNext(e,t){return p2(this,void 0,void 0,(function*(){if(e.getModel()!==this.textModel)throw new f;const i=this.state.get();if(!i||i.ghostText.isEmpty()||!i.inlineCompletion)return;const n=i.ghostText,s=i.inlineCompletion.toInlineCompletion(void 0);if(s.snippetInfo||s.filterText!==s.insertText)return void(yield this.accept(e));const o=n.parts[0],r=new Va(n.lineNumber,o.column),a=o.lines.join("\n"),l=t(r,a);if(l===a.length&&1===n.parts.length)return void this.accept(e);const h=a.substring(0,l);this._isAcceptingPartially=!0;try{e.pushUndoStop(),e.executeEdits("inlineSuggestion.accept",[Fq.replace(Rh.fromPositions(r),h)]);const t=z0(h);e.setPosition(H0(r,t))}finally{this._isAcceptingPartially=!1}if(s.source.provider.handlePartialAccept){const t=Rh.fromPositions(s.range.getStartPosition(),H0(r,z0(h))),i=e.getModel().getValueInRange(t,1);s.source.provider.handlePartialAccept(s.source.inlineCompletions,s.sourceInlineCompletion,i.length)}}))}handleSuggestAccepted(e){var t,i;const n=e.toSingleTextEdit().removeCommonPrefix(this.textModel),s=this._computeAugmentedCompletion(n,void 0);if(!s)return;const o=s.completion.inlineCompletion;null===(i=(t=o.source.provider).handlePartialAccept)||void 0===i||i.call(t,o.source.inlineCompletions,o.sourceInlineCompletion,n.text.length)}};m2=u2([g2(9,Fa),g2(10,Ya),g2(11,Ju)],m2);var f2,_2=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},v2=function(e,t){return function(i,n){t(i,n,e)}};class b2{constructor(e){this.name=e}select(e,t,i){if(0===i.length)return 0;const n=i[0].score[0];for(let s=0;sthis._saveState()),500),this._disposables.add(e.onWillSaveState((e=>{e.reason===YN.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){var i;const n=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if((null===(i=this._strategy)||void 0===i?void 0:i.name)!==n){this._saveState();const e=f2._strategyCtors.get(n)||C2;this._strategy=new e;try{const e=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,t=this._storageService.get(`${f2._storagePrefix}/${n}`,e);t&&this._strategy.fromJSON(JSON.parse(t))}catch(Mre){}}return this._strategy}_saveState(){if(this._strategy){const e=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,t=JSON.stringify(this._strategy);this._storageService.store(`${f2._storagePrefix}/${this._strategy.name}`,t,e,1)}}};w2._strategyCtors=new Map([["recentlyUsedByPrefix",class extends b2{constructor(){super("recentlyUsedByPrefix"),this._trie=qq.forStrings(),this._seq=0}memorize(e,t,i){const{word:n}=e.getWordUntilPosition(t),s=`${e.getLanguageId()}/${n}`;this._trie.set(s,{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 s=`${e.getLanguageId()}/${n}`;let o=this._trie.get(s);if(o||(o=this._trie.findSubstr(s)),o)for(let r=0;re.push([i,t]))),e.sort(((e,t)=>-(e[1].touch-t[1].touch))).forEach(((e,t)=>e[1].touch=t)),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="number"==typeof i.type?i.type:gC.fromString(i.type),this._trie.set(t,i)}}}],["recentlyUsed",class extends b2{constructor(){super("recentlyUsed"),this._cache=new js(300,.66),this._seq=0}memorize(e,t,i){const n=`${e.getLanguageId()}/${i.textLabel}`;this._cache.set(n,{touch:this._seq++,type:i.completion.kind,insertText:i.completion.insertText})}select(e,t,i){if(0===i.length)return 0;const n=e.getLineContent(t.lineNumber).substr(t.column-10,t.column-1);if(/\s$/.test(n))return super.select(e,t,i);const s=i[0].score[0];let o=-1,r=-1,a=-1;for(let l=0;la&&n.type===i[l].completion.kind&&n.insertText===i[l].completion.insertText&&(a=n.touch,r=l),i[l].completion.preselect&&-1===o)return l}return-1!==r?r:-1!==o?o:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();for(const[t,i]of e)i.touch=0,i.type="number"==typeof i.type?i.type:gC.fromString(i.type),this._cache.set(t,i);this._seq=this._cache.size}}],["first",C2]]),w2._storagePrefix="suggest/memories",w2=f2=_2([v2(0,ZN),v2(1,pu)],w2);const y2=Ba("ISuggestMemories");yu(y2,w2,1);var S2,L2=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},k2=function(e,t){return function(i,n){t(i,n,e)}};let D2=S2=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=S2.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration((e=>e.hasChanged(122)&&this._update())),this._update()}dispose(){var e;this._configListener.dispose(),null===(e=this._selectionListener)||void 0===e||e.dispose(),this._ckAtEnd.reset()}_update(){const e="on"===this._editor.getOption(122);if(this._enabled!==e)if(this._enabled=e,this._enabled){const e=()=>{if(!this._editor.hasModel())return void this._ckAtEnd.set(!1);const e=this._editor.getModel(),t=this._editor.getSelection(),i=e.getWordAtPosition(t.getStartPosition());i?this._ckAtEnd.set(i.endColumn===t.getStartPosition().column):this._ckAtEnd.set(!1)};this._selectionListener=this._editor.onDidChangeCursorSelection(e),e()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};D2.AtEnd=new Al("atEndOfWord",!1),D2=S2=L2([k2(1,Ol)],D2);var x2,N2=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},E2=function(e,t){return function(i,n){t(i,n,e)}};let I2=x2=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=x2.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),null===(e=this._listener)||void 0===e||e.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},i){if(0===e.items.length)return void this.reset();x2._moveIndex(!0,e,t)!==t?(this._acceptNext=i,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition((()=>{this._ignore||this.reset()})),this._ckOtherSuggestions.set(!0)):this.reset()}static _moveIndex(e,t,i){let n=i;for(let s=t.items.length;s>0&&(n=(n+t.items.length+(e?1:-1))%t.items.length,n!==i)&&t.items[n].completion.additionalTextEdits;s--);return n}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=x2._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};I2.OtherSuggestions=new Al("hasOtherSuggestions",!1),I2=x2=N2([E2(1,Ol)],I2);class M2{constructor(e,t,i,n){this._disposables=new N,this._disposables.add(i.onDidSuggest((e=>{0===e.completionModel.items.length&&this.reset()}))),this._disposables.add(i.onDidCancel((e=>{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((s=>{if(this._active&&!t.isFrozen()&&0!==i.state){const t=s.charCodeAt(s.length-1);this._active.acceptCharacters.has(t)&&e.getOption(0)&&n(this._active.item)}})))}_onItem(e){if(!e||!Hd(e.item.completion.commitCharacters))return void this.reset();if(this._active&&this._active.item.item===e.item)return;const t=new qb;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()}}var T2=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class R2{provideSelectionRanges(e,t){return T2(this,void 0,void 0,(function*(){const i=[];for(const n of t){const t=[];i.push(t);const s=new Map;yield new Promise((t=>R2._bracketsRightYield(t,0,e,n,s))),yield new Promise((i=>R2._bracketsLeftYield(i,0,e,n,s,t)))}return i}))}static _bracketsRightYield(e,t,i,n,s){const o=new Map,r=Date.now();for(;;){if(t>=R2._maxRounds){e();break}if(!n){e();break}const a=i.bracketPairs.findNextBracket(n);if(!a){e();break}if(Date.now()-r>R2._maxDuration){setTimeout((()=>R2._bracketsRightYield(e,t+1,i,n,s)));break}if(a.bracketInfo.isOpeningBracket){const e=a.bracketInfo.bracketText,t=o.has(e)?o.get(e):0;o.set(e,t+1)}else{const e=a.bracketInfo.getOpeningBrackets()[0].bracketText;let t=o.has(e)?o.get(e):0;if(t-=1,o.set(e,Math.max(0,t)),t<0){let t=s.get(e);t||(t=new O,s.set(e,t)),t.push(a.range)}}n=a.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,n,s,o){const r=new Map,a=Date.now();for(;;){if(t>=R2._maxRounds&&0===s.size){e();break}if(!n){e();break}const l=i.bracketPairs.findPrevBracket(n);if(!l){e();break}if(Date.now()-a>R2._maxDuration){setTimeout((()=>R2._bracketsLeftYield(e,t+1,i,n,s,o)));break}if(l.bracketInfo.isOpeningBracket){const e=l.bracketInfo.bracketText;let t=r.has(e)?r.get(e):0;if(t-=1,r.set(e,Math.max(0,t)),t<0){const t=s.get(e);if(t){const n=t.shift();0===t.size&&s.delete(e);const r=Rh.fromPositions(l.range.getEndPosition(),n.getStartPosition()),a=Rh.fromPositions(l.range.getStartPosition(),n.getEndPosition());o.push({range:r}),o.push({range:a}),R2._addBracketLeading(i,a,o)}}}else{const e=l.bracketInfo.getOpeningBrackets()[0].bracketText,t=r.has(e)?r.get(e):0;r.set(e,t+1)}n=l.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const n=t.startLineNumber,s=e.getLineFirstNonWhitespaceColumn(n);0!==s&&s!==t.startColumn&&(i.push({range:Rh.fromPositions(new Va(n,s),t.getEndPosition())}),i.push({range:Rh.fromPositions(new Va(n,1),t.getEndPosition())}));const o=n-1;if(o>0){const n=e.getLineFirstNonWhitespaceColumn(o);n===t.startColumn&&n!==e.getLineLastNonWhitespaceColumn(o)&&(i.push({range:Rh.fromPositions(new Va(o,n),t.getEndPosition())}),i.push({range:Rh.fromPositions(new Va(o,1),t.getEndPosition())}))}}}R2._maxDuration=30,R2._maxRounds=2;var A2=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class O2{static create(e,t){return A2(this,void 0,void 0,(function*(){if(!t.getOption(117).localityBonus)return O2.None;if(!t.hasModel())return O2.None;const i=t.getModel(),n=t.getPosition();if(!e.canComputeWordRanges(i.uri))return O2.None;const[s]=yield(new R2).provideSelectionRanges(i,[n]);if(0===s.length)return O2.None;const o=yield e.computeWordRanges(i.uri,s[0].range);if(!o)return O2.None;const r=i.getWordUntilPosition(n);return delete o[r.word],new class extends O2{distance(e,i){if(!n.equals(t.getPosition()))return 0;if(17===i.kind)return 2<<20;const r="string"==typeof i.label?i.label:i.label.label,a=o[r];if(Vd(a))return 2<<20;const l=Rd(a,Rh.fromPositions(e),Rh.compareRangesUsingStarts),h=l>=0?a[l]:a[Math.max(0,~l-1)];let d=s.length;for(const t of s){if(!Rh.containsRange(t.range,h))break;d-=1}return d}}}))}}O2.None=new class extends O2{distance(){return 0}};class P2{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}}class F2{constructor(e,t,i,n,s,o,r=Tr.default,a=void 0){this.clipboardText=a,this._snippetCompareFn=F2._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=n,this._options=s,this._refilterKind=1,this._lineContext=i,this._fuzzyScoreOptions=r,"top"===o?this._snippetCompareFn=F2._compareCompletionItemsSnippetsUp:"bottom"===o&&(this._snippetCompareFn=F2._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(){0!==this._refilterKind&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:i}=this._lineContext;let n="",s="";const o=1===this._refilterKind?this._items:this._filteredItems,r=[],a=!this._options.filterGraceful||o.length>2e3?Rr:Or;for(let l=0;l=u)h.score=Mr.Default;else if("string"==typeof h.completion.filterText){const t=a(n,s,e,h.completion.filterText,h.filterTextLow,0,this._fuzzyScoreOptions);if(!t)continue;0===uo(h.completion.filterText,h.textLabel)?h.score=t:(h.score=fr(n,s,e,h.textLabel,h.labelLow,0),h.score[0]=t[0])}else{const t=a(n,s,e,h.textLabel,h.labelLow,0,this._fuzzyScoreOptions);if(!t)continue;h.score=t}}h.idx=l,h.distance=this._wordDistance.distance(h.position,h.completion),r.push(h),e.push(h.textLabel.length)}this._filteredItems=r.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?Ad(e.length-.85,e,((e,t)=>e-t)):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(27===e.completion.kind)return 1;if(27===t.completion.kind)return-1}return F2._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return-1;if(27===t.completion.kind)return 1}return F2._compareCompletionItems(e,t)}}var B2,W2=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},V2=function(e,t){return function(i,n){t(i,n,e)}},H2=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class z2{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}}let U2=B2=class{constructor(e,t,i,n,s,o,r,a,l){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=n,this._logService=s,this._contextKeyService=o,this._configurationService=r,this._languageFeaturesService=a,this._envService=l,this._toDispose=new N,this._triggerCharacterListener=new N,this._triggerQuickSuggest=new sd,this._triggerState=void 0,this._completionDisposables=new N,this._onDidCancel=new U,this._onDidTrigger=new U,this._onDidSuggest=new U,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new Ah(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 h=!1;this._toDispose.add(this._editor.onDidCompositionStart((()=>{h=!0}))),this._toDispose.add(this._editor.onDidCompositionEnd((()=>{h=!1,this._onCompositionEnd()}))),this._toDispose.add(this._editor.onDidChangeCursorSelection((e=>{h||this._onCursorChange(e)}))),this._toDispose.add(this._editor.onDidChangeModelContent((()=>{h||void 0===this._triggerState||this._refilterCompletionItems()}))),this._updateTriggerCharacters()}dispose(){k(this._triggerCharacterListener),k([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(90)||!this._editor.hasModel()||!this._editor.getOption(120))return;const e=new Map;for(const i of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const t of i.triggerCharacters||[]){let n=e.get(t);n||(n=new Set,n.add(P1),e.set(t,n)),n.add(i)}const t=t=>{var i;if(!function(e,t,i){if(!Boolean(t.getContextKeyValue("inlineSuggestionVisible")))return!0;const n=t.getContextKeyValue(F0.suppressSuggestions.key);return void 0!==n?!n:!e.getOption(62).suppressSuggestions}(this._editor,this._contextKeyService,this._configurationService))return;if(z2.shouldAutoTrigger(this._editor))return;if(!t){const e=this._editor.getPosition();t=this._editor.getModel().getLineContent(e.lineNumber).substr(0,e.column-1)}let n="";yo(t.charCodeAt(t.length-1))?wo(t.charCodeAt(t.length-2))&&(n=t.substr(t.length-2)):n=t.charAt(t.length-1);const s=e.get(n);if(s){const e=new Map;if(this._completionModel)for(const[t,i]of this._completionModel.getItemsByProvider())s.has(t)||e.set(t,i);this.trigger({auto:!0,triggerKind:1,triggerCharacter:n,retrigger:Boolean(this._completionModel),clipboardText:null===(i=this._completionModel)||void 0===i?void 0:i.clipboardText,completionOptions:{providerFilter:s,providerItemsToReuse:e}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd((()=>t())))}get state(){return this._triggerState?this._triggerState.auto?2:1:0}cancel(e=!1){var t;void 0!==this._triggerState&&(this._triggerQuickSuggest.cancel(),null===(t=this._requestToken)||void 0===t||t.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(){void 0!==this._triggerState&&(this._editor.hasModel()&&this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.trigger({auto:this._triggerState.auto,retrigger:!0}):this.cancel())}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||0!==e.reason&&3!==e.reason||"keyboard"!==e.source&&"deleteLeft"!==e.source?this.cancel():void 0===this._triggerState&&0===e.reason?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():void 0!==this._triggerState&&3===e.reason&&this._refilterCompletionItems()}_onCompositionEnd(){void 0===this._triggerState?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){var e;H1.isAllOff(this._editor.getOption(88))||this._editor.getOption(117).snippetsPreventQuickSuggestions&&(null===(e=h2.get(this._editor))||void 0===e?void 0:e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet((()=>{if(void 0!==this._triggerState)return;if(!z2.shouldAutoTrigger(this._editor))return;if(!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const e=this._editor.getModel(),t=this._editor.getPosition(),i=this._editor.getOption(88);if(!H1.isAllOff(i)){if(!H1.isAllOn(i)){e.tokenization.tokenizeIfCheap(t.lineNumber);const n=e.tokenization.getLineTokens(t.lineNumber),s=n.getStandardTokenType(n.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if("on"!==H1.valueFor(i,s))return}(function(e,t,i){if(!Boolean(t.getContextKeyValue(F0.inlineSuggestionVisible.key)))return!0;const n=t.getContextKeyValue(F0.suppressSuggestions.key);return void 0!==n?!n:!e.getOption(62).suppressSuggestions})(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(e)&&this.trigger({auto:!0})}}),this._editor.getOption(89)))}_refilterCompletionItems(){qr(this._editor.hasModel()),qr(void 0!==this._triggerState);const e=this._editor.getModel(),t=this._editor.getPosition(),i=new z2(e,t,Object.assign(Object.assign({},this._triggerState),{refilter:!0}));this._onNewContext(i)}trigger(e){var t,i,n,s,o,a;if(!this._editor.hasModel())return;const l=this._editor.getModel(),h=new z2(l,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:null!==(t=e.shy)&&void 0!==t&&t,position:this._editor.getPosition()}),this._context=h;let d={triggerKind:null!==(i=e.triggerKind)&&void 0!==i?i:0};e.triggerCharacter&&(d={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new jh;let c=1;switch(this._editor.getOption(111)){case"top":c=0;break;case"bottom":c=2}const{itemKind:u,showDeprecated:g}=B2._createSuggestFilter(this._editor),p=new O1(c,null!==(s=null===(n=e.completionOptions)||void 0===n?void 0:n.kindFilter)&&void 0!==s?s:u,null===(o=e.completionOptions)||void 0===o?void 0:o.providerFilter,null===(a=e.completionOptions)||void 0===a?void 0:a.providerItemsToReuse,g),m=O2.create(this._editorWorkerService,this._editor),f=B1(this._languageFeaturesService.completionProvider,l,this._editor.getPosition(),p,d,this._requestToken.token);Promise.all([f,m]).then((([t,i])=>H2(this,void 0,void 0,(function*(){var n;if(null===(n=this._requestToken)||void 0===n||n.dispose(),!this._editor.hasModel())return;let s=null==e?void 0:e.clipboardText;if(!s&&t.needsClipboard&&(s=yield this._clipboardService.readText()),void 0===this._triggerState)return;const o=this._editor.getModel(),r=new z2(o,this._editor.getPosition(),e),a=Object.assign(Object.assign({},Tr.default),{firstMatchCanBeWeak:!this._editor.getOption(117).matchOnWordStartOnly});if(this._completionModel=new F2(t.items,this._context.column,{leadingLineContent:r.leadingLineContent,characterCountDelta:r.column-this._context.column},i,this._editor.getOption(117),this._editor.getOption(111),a,s),this._completionDisposables.add(t.disposable),this._onNewContext(r),this._reportDurationsTelemetry(t.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const e of t.items)e.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${e.provider._debugDisplayName}`,e.completion)})))).catch(r)}_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;"none"===e.getOption(111)&&t.add(27);const i=e.getOption(117);return i.showMethods||t.add(0),i.showFunctions||t.add(1),i.showConstructors||t.add(2),i.showFields||t.add(3),i.showVariables||t.add(4),i.showClasses||t.add(5),i.showStructs||t.add(6),i.showInterfaces||t.add(7),i.showModules||t.add(8),i.showProperties||t.add(9),i.showEvents||t.add(10),i.showOperators||t.add(11),i.showUnits||t.add(12),i.showValues||t.add(13),i.showConstants||t.add(14),i.showEnums||t.add(15),i.showEnumMembers||t.add(16),i.showKeywords||t.add(17),i.showWords||t.add(18),i.showColors||t.add(19),i.showFiles||t.add(20),i.showReferences||t.add(21),i.showColors||t.add(22),i.showFolders||t.add(23),i.showTypeParameters||t.add(24),i.showSnippets||t.add(27),i.showUsers||t.add(25),i.showIssues||t.add(26),{itemKind:t,showDeprecated:i.showDeprecated}}_onNewContext(e){if(this._context)if(e.lineNumber===this._context.lineNumber)if(ao(e.leadingLineContent)===ao(this._context.leadingLineContent)){if(e.columnthis._context.leadingWord.startColumn){if(z2.shouldAutoTrigger(this._editor)&&this._context){const e=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:e}})}}else if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&0!==e.leadingWord.word.length){const e=new Map,t=new Set;for(const[i,n]of this._completionModel.getItemsByProvider())n.length>0&&n[0].container.incomplete?t.add(i):e.set(i,n);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:2,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:t,providerItemsToReuse:e}})}else{const t=this._completionModel.lineContext;let i=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},0===this._completionModel.items.length){const n=z2.shouldAutoTrigger(this._editor);if(!this._context)return void this.cancel();if(n&&this._context.leadingWord.endColumn0,i&&0===e.leadingWord.word.length)return void this.cancel()}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:i})}}else this.cancel();else this.cancel()}};U2=B2=W2([V2(1,fG),V2(2,eS),V2(3,lh),V2(4,hh),V2(5,Ol),V2(6,pu),V2(7,oL),V2(8,CE)],U2);class K2{constructor(e,t){this._disposables=new N,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType((()=>{if(this._locked||!e.hasModel())return;const t=e.getSelections(),i=t.length;let n=!1;for(let e=0;eK2._maxSelectionLength)return;this._lastOvertyped[e]={value:s.getValueInRange(i),multiline:i.startLineNumber!==i.endLineNumber}}}))),this._disposables.add(t.onDidTrigger((e=>{this._locked=!0}))),this._disposables.add(t.onDidCancel((e=>{this._locked=!1})))}getLastOvertypedInfo(e){if(e>=0&&e=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},q2=function(e,t){return function(i,n){t(i,n,e)}};class $2 extends BW{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();this.label&&(this.label.textContent=ue(0,"{0} ({1})",this._action.label,$2.symbolPrintEnter(e)))}static symbolPrintEnter(e){var t;return null===(t=e.getLabel())||void 0===t?void 0:t.replace(/\benter\b/gi,"\u23ce")}}let G2=class{constructor(e,t,i,n,s){this._menuId=t,this._menuService=n,this._contextKeyService=s,this._menuDisposables=new N,this.element=ds(e,fs(".suggest-status-bar"));const o=e=>e instanceof oh?i.createInstance($2,e,void 0):void 0;this._leftActions=new Rx(this.element,{actionViewItemProvider:o}),this._rightActions=new Rx(this.element,{actionViewItemProvider:o}),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 t=[],i=[];for(const[n,s]of e.getActions())"left"===n?t.push(...s):i.push(...s);this._leftActions.clear(),this._leftActions.push(t),this._rightActions.clear(),this._rightActions.push(i)};this._menuDisposables.add(e.onDidChange((()=>t()))),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};G2=j2([q2(2,Fa),q2(3,th),q2(4,Ol)],G2);var Z2=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Y2=function(e,t){return function(i,n){t(i,n,e)}};function X2(e){return!!e&&Boolean(e.completion.documentation||e.completion.detail&&e.completion.detail!==e.completion.label)}let Q2=class{constructor(e,t){this._editor=e,this._onDidClose=new U,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new U,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new N,this._renderDisposeable=new N,this._borderWidth=1,this._size=new Wn(330,0),this.domNode=fs(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(Jk,{editor:e}),this._body=fs(".body"),this._scrollbar=new OD(this._body,{alwaysConsumeMouseWheel:!0}),ds(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=ds(this._body,fs(".header")),this._close=ds(this._header,fs("span"+ta.asCSSSelector(Jr.close))),this._close.title=ue(0,"Close"),this._type=ds(this._header,fs("p.type")),this._docs=ds(this._body,fs("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(50)&&this._configureFont()})))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(50),i=t.getMassagedFontFamily(),n=e.get(118)||t.fontSize,s=e.get(119)||t.lineHeight,o=t.fontWeight,r=`${n}px`,a=`${s}px`;this.domNode.style.fontSize=r,this.domNode.style.lineHeight=""+s/n,this.domNode.style.fontWeight=o,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=i,this._close.style.height=a,this._close.style.width=a}getLayoutInfo(){const e=this._editor.getOption(119)||this._editor.getOption(50).lineHeight,t=this._borderWidth;return{lineHeight:e,borderWidth:t,borderHeight:2*t,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=ue(0,"Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,2*this.getLayoutInfo().lineHeight),this._onDidChangeContents.fire(this)}renderItem(e,t){var i,n;this._renderDisposeable.clear();let{detail:s,documentation:o}=e.completion;if(t){let t="";t+=`score: ${e.score[0]}\n`,t+=`prefix: ${null!==(i=e.word)&&void 0!==i?i:"(no prefix)"}\n`,t+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel}\n`,t+=`distance: ${e.distance} (localityBonus-setting)\n`,t+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"}\n`,t+=`commit_chars: ${null===(n=e.completion.commitCharacters)||void 0===n?void 0:n.join("")}\n`,o=(new Ta).appendCodeblock("empty",t),s=`Provider: ${e.provider._debugDisplayName}`}if(t||X2(e)){if(this.domNode.classList.remove("no-docs","no-type"),s){const e=s.length>1e5?`${s.substr(0,1e5)}\u2026`:s;this._type.textContent=e,this._type.title=e,_s(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gim.test(e))}else Dn(this._type),this._type.title="",vs(this._type),this.domNode.classList.add("no-type");if(Dn(this._docs),"string"==typeof o)this._docs.classList.remove("markdown-docs"),this._docs.textContent=o;else if(o){this._docs.classList.add("markdown-docs"),Dn(this._docs);const e=this._markdownRenderer.render(o);this._docs.appendChild(e.element),this._renderDisposeable.add(e),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=e=>{e.preventDefault(),e.stopPropagation()},this._close.onclick=e=>{e.preventDefault(),e.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}else this.clearContents()}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get size(){return this._size}layout(e,t){const i=new Wn(e,t);Wn.equals(i,this._size)||(this._size=i,function(e,t,i){"number"==typeof t&&(e.style.width=`${t}px`),"number"==typeof i&&(e.style.height=`${i}px`)}(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}};Q2=Z2([Y2(1,Fa)],Q2);class J2{constructor(e,t){let i,n;this.widget=e,this._editor=t,this._disposables=new N,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new pK,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let s=0,o=0;this._disposables.add(this._resizable.onDidWillResize((()=>{i=this._topLeft,n=this._resizable.size}))),this._disposables.add(this._resizable.onDidResize((e=>{if(i&&n){this.widget.layout(e.dimension.width,e.dimension.height);let t=!1;e.west&&(o=n.width-e.dimension.width,t=!0),e.north&&(s=n.height-e.dimension.height,t=!0),t&&this._applyTopLeft({top:i.top+s,left:i.left+o})}e.done&&(i=void 0,n=void 0,s=0,o=0,this._userSize=e.dimension)}))),this._disposables.add(this.widget.onDidChangeContents((()=>{var e;this._anchorBox&&this._placeAtAnchor(this._anchorBox,null!==(e=this._userSize)&&void 0!==e?e: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 null}show(){this._added||(this._editor.addOverlayWidget(this),this.getDomNode().style.position="fixed",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){var i;const n=e.getBoundingClientRect();this._anchorBox=n,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,null!==(i=this._userSize)&&void 0!==i?i:this.widget.size,t)}_placeAtAnchor(e,t,i){var n;const s=Fn(this.getDomNode().ownerDocument.body),o=this.widget.getLayoutInfo(),r=new Wn(220,2*o.lineHeight),a=e.top,l=function(){const i=s.width-(e.left+e.width+o.borderWidth+o.horizontalPadding),n=-o.borderWidth+e.left+e.width,l=new Wn(i,s.height-e.top-o.borderHeight-o.verticalPadding),h=l.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:a,left:n,fit:i-t.width,maxSizeTop:l,maxSizeBottom:h,minSize:r.with(Math.min(i,r.width))}}(),h=[l,function(){const i=e.left-o.borderWidth-o.horizontalPadding,n=Math.max(o.horizontalPadding,e.left-t.width-o.borderWidth),l=new Wn(i,s.height-e.top-o.borderHeight-o.verticalPadding),h=l.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:a,left:n,fit:i-t.width,maxSizeTop:l,maxSizeBottom:h,minSize:r.with(Math.min(i,r.width))}}(),function(){const i=e.left,n=-o.borderWidth+e.top+e.height,a=new Wn(e.width-o.borderHeight,s.height-e.top-e.height-o.verticalPadding);return{top:n,left:i,fit:a.height-t.height,maxSizeBottom:a,maxSizeTop:a,minSize:r.with(a.width)}}()],d=null!==(n=h.find((e=>e.fit>=0)))&&void 0!==n?n:h.sort(((e,t)=>t.fit-e.fit))[0],c=e.top+e.height-o.borderHeight;let u,g=t.height;const p=Math.max(d.maxSizeTop.height,d.maxSizeBottom.height);let m;g>p&&(g=p),i?g<=d.maxSizeTop.height?(u=!0,m=d.maxSizeTop):(u=!1,m=d.maxSizeBottom):g<=d.maxSizeBottom.height?(u=!1,m=d.maxSizeBottom):(u=!0,m=d.maxSizeTop),this._applyTopLeft({left:d.left,top:u?d.top:c-g}),this.getDomNode().style.position="fixed",this._resizable.enableSashes(!u,d===l,u,d!==l),this._resizable.minSize=d.minSize,this._resizable.maxSize=m,this._resizable.layout(g,Math.min(m.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this.getDomNode().style.left=`${this._topLeft.left}px`,this.getDomNode().style.top=`${this._topLeft.top}px`}}var e4;!function(e){e[e.FILE=0]="FILE",e[e.FOLDER=1]="FOLDER",e[e.ROOT_FOLDER=2]="ROOT_FOLDER"}(e4||(e4={}));const t4=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function i4(e,t,i,n){const s=n===e4.ROOT_FOLDER?["rootfolder-icon"]:n===e4.FOLDER?["folder-icon"]:["file-icon"];if(i){let o;if(i.scheme===vn.data){o=Ia.parseMetaData(i).get(Ia.META_DATA_LABEL)}else{const e=i.path.match(t4);e?(o=n4(e[2].toLowerCase()),e[1]&&s.push(`${n4(e[1].toLowerCase())}-name-dir-icon`)):o=n4(i.authority.toLowerCase())}if(n===e4.FOLDER)s.push(`${o}-name-folder-icon`);else{if(o){if(s.push(`${o}-name-file-icon`),s.push("name-file-icon"),o.length<=255){const e=o.split(".");for(let t=1;t=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},r4=function(e,t){return function(i,n){t(i,n,e)}};function a4(e){return`suggest-aria-id:${e}`}const l4=tR("suggest-more-info",Jr.chevronRight,ue(0,"Icon for more information in the suggest widget.")),h4=new(s4=class{extract(e,t){if(e.textLabel.match(s4._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(s4._regexStrict))return t[0]=e.completion.detail,!0;if("string"==typeof e.completion.documentation){const i=s4._regexRelaxed.exec(e.completion.documentation);if(i&&(0===i.index||i.index+i[0].length===e.completion.documentation.length))return t[0]=i[0],!0}return!1}},s4._regexRelaxed=/(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/,s4._regexStrict=new RegExp(`^${s4._regexRelaxed.source}$`,"i"),s4);let d4=class{constructor(e,t,i,n){this._editor=e,this._modelService=t,this._languageService=i,this._themeService=n,this._onDidToggleDetails=new U,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new N,i=e;i.classList.add("show-file-icons");const n=ds(e,fs(".icon")),s=ds(n,fs("span.colorspan")),o=ds(e,fs(".contents")),r=ds(o,fs(".main")),a=ds(r,fs(".icon-label.codicon")),l=ds(r,fs("span.left")),h=ds(r,fs("span.right")),d=new qz(l,{supportHighlights:!0,supportIcons:!0});t.add(d);const c=ds(l,fs("span.signature-label")),u=ds(l,fs("span.qualifier-label")),g=ds(h,fs("span.details-label")),p=ds(h,fs("span.readMore"+ta.asCSSSelector(l4)));p.title=ue(0,"Read More");const m=()=>{const e=this._editor.getOptions(),t=e.get(50),s=t.getMassagedFontFamily(),o=t.fontFeatureSettings,a=e.get(118)||t.fontSize,l=e.get(119)||t.lineHeight,h=t.fontWeight,d=`${a}px`,c=`${l}px`,u=`${t.letterSpacing}px`;i.style.fontSize=d,i.style.fontWeight=h,i.style.letterSpacing=u,r.style.fontFamily=s,r.style.fontFeatureSettings=o,r.style.lineHeight=c,n.style.height=c,n.style.width=c,p.style.height=c,p.style.width=c};return m(),t.add(this._editor.onDidChangeConfiguration((e=>{(e.hasChanged(50)||e.hasChanged(118)||e.hasChanged(119))&&m()}))),{root:i,left:l,right:h,icon:n,colorspan:s,iconLabel:d,iconContainer:a,parametersLabel:c,qualifierLabel:u,detailsLabel:g,readMore:p,disposables:t}}renderElement(e,t,i){const{completion:n}=e;i.root.id=a4(t),i.colorspan.style.backgroundColor="";const s={labelEscapeNewLines:!0,matches:_r(e.score)},o=[];if(19===n.kind&&h4.extract(e,o))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=o[0];else if(20===n.kind&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const t=i4(this._modelService,this._languageService,an.from({scheme:"fake",path:e.textLabel}),e4.FILE),o=i4(this._modelService,this._languageService,an.from({scheme:"fake",path:n.detail}),e4.FILE);s.extraClasses=t.length>o.length?t:o}else 23===n.kind&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",s.extraClasses=[i4(this._modelService,this._languageService,an.from({scheme:"fake",path:e.textLabel}),e4.FOLDER),i4(this._modelService,this._languageService,an.from({scheme:"fake",path:n.detail}),e4.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...ta.asClassNameArray(gC.toIcon(n.kind))));n.tags&&n.tags.indexOf(1)>=0&&(s.extraClasses=(s.extraClasses||[]).concat(["deprecated"]),s.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,s),"string"==typeof n.label?(i.parametersLabel.textContent="",i.detailsLabel.textContent=c4(n.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=c4(n.label.detail||""),i.detailsLabel.textContent=c4(n.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(117).showInlineDetails?_s(i.detailsLabel):vs(i.detailsLabel),X2(e)?(i.right.classList.add("can-expand-details"),_s(i.readMore),i.readMore.onmousedown=e=>{e.stopPropagation(),e.preventDefault()},i.readMore.onclick=e=>{e.stopPropagation(),e.preventDefault(),this._onDidToggleDetails.fire()}):(i.right.classList.remove("can-expand-details"),vs(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};function c4(e){return e.replace(/\r\n|\r|\n/g,"")}d4=o4([r4(1,Ha),r4(2,Lc),r4(3,P_)],d4);var u4,g4=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},p4=function(e,t){return function(i,n){t(i,n,e)}},m4=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};Dp("editorSuggestWidget.background",{dark:km,light:km,hcDark:km,hcLight:km},ue(0,"Background color of the suggest widget.")),Dp("editorSuggestWidget.border",{dark:xm,light:xm,hcDark:xm,hcLight:xm},ue(0,"Border color of the suggest widget."));const f4=Dp("editorSuggestWidget.foreground",{dark:Lm,light:Lm,hcDark:Lm,hcLight:Lm},ue(0,"Foreground color of the suggest widget."));Dp("editorSuggestWidget.selectedForeground",{dark:zf,light:zf,hcDark:zf,hcLight:zf},ue(0,"Foreground color of the selected entry in the suggest widget.")),Dp("editorSuggestWidget.selectedIconForeground",{dark:Uf,light:Uf,hcDark:Uf,hcLight:Uf},ue(0,"Icon foreground color of the selected entry in the suggest widget."));const _4=Dp("editorSuggestWidget.selectedBackground",{dark:Kf,light:Kf,hcDark:Kf,hcLight:Kf},ue(0,"Background color of the selected entry in the suggest widget."));Dp("editorSuggestWidget.highlightForeground",{dark:kf,light:kf,hcDark:kf,hcLight:kf},ue(0,"Color of the match highlights in the suggest widget.")),Dp("editorSuggestWidget.focusHighlightForeground",{dark:Df,light:Df,hcDark:Df,hcLight:Df},ue(0,"Color of the match highlights in the suggest widget when an item is focused.")),Dp("editorSuggestWidgetStatus.foreground",{dark:D_(f4,.5),light:D_(f4,.5),hcDark:D_(f4,.5),hcLight:D_(f4,.5)},ue(0,"Foreground color of the suggest widget status."));class v4{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof pW}`}restore(){var e;const t=null!==(e=this._service.get(this._key,0))&&void 0!==e?e:"";try{const e=JSON.parse(t);if(Wn.is(e))return Wn.lift(e)}catch(Vs){}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let b4=u4=class{constructor(e,t,i,n,s){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new I,this._pendingShowDetails=new I,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new sd,this._disposables=new N,this._onDidSelect=new j,this._onDidFocus=new j,this._onDidHide=new U,this._onDidShow=new U,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new U,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new pK,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new C4(this,e),this._persistedSize=new v4(t,e);class o{constructor(e,t,i=!1,n=!1){this.persistedSize=e,this.currentSize=t,this.persistHeight=i,this.persistWidth=n}}let r;this._disposables.add(this.element.onDidWillResize((()=>{this._contentWidget.lockPreference(),r=new o(this._persistedSize.restore(),this.element.size)}))),this._disposables.add(this.element.onDidResize((e=>{var t,i,n,s;if(this._resize(e.dimension.width,e.dimension.height),r&&(r.persistHeight=r.persistHeight||!!e.north||!!e.south,r.persistWidth=r.persistWidth||!!e.east||!!e.west),e.done){if(r){const{itemHeight:e,defaultSize:o}=this.getLayoutInfo(),a=Math.round(e/2);let{width:l,height:h}=this.element.size;(!r.persistHeight||Math.abs(r.currentSize.height-h)<=a)&&(h=null!==(i=null===(t=r.persistedSize)||void 0===t?void 0:t.height)&&void 0!==i?i:o.height),(!r.persistWidth||Math.abs(r.currentSize.width-l)<=a)&&(l=null!==(s=null===(n=r.persistedSize)||void 0===n?void 0:n.width)&&void 0!==s?s:o.width),this._persistedSize.store(new Wn(l,h))}this._contentWidget.unlockPreference(),r=void 0}}))),this._messageElement=ds(this.element.domNode,fs(".message")),this._listElement=ds(this.element.domNode,fs(".tree"));const a=this._disposables.add(s.createInstance(Q2,this.editor));a.onDidClose(this.toggleDetails,this,this._disposables),this._details=new J2(a,this.editor);const l=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(117).showIcons);l();const h=s.createInstance(d4,this.editor);this._disposables.add(h),this._disposables.add(h.onDidToggleDetails((()=>this.toggleDetails()))),this._list=new yx("SuggestWidget",this._listElement,{getHeight:e=>this.getLayoutInfo().itemHeight,getTemplateId:e=>"suggestion"},[h],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>ue(0,"Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:e=>{let t=e.textLabel;if("string"!=typeof e.completion.label){const{detail:i,description:n}=e.completion.label;i&&n?t=ue(0,"{0} {1}, {2}",t,i,n):i?t=ue(0,"{0} {1}",t,i):n&&(t=ue(0,"{0}, {1}",t,n))}if(!e.isResolved||!this._isDetailsVisible())return t;const{documentation:i,detail:n}=e.completion;return ue(0,"{0}, docs: {1}",t,Qs("{0}{1}",n||"",i?"string"==typeof i?i:i.value:""))}}}),this._list.style(Jx({listInactiveFocusBackground:_4,listInactiveFocusOutline:Tp})),this._status=s.createInstance(G2,this.element.domNode,R1);const d=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(117).showStatusBar);d(),this._disposables.add(n.onDidColorThemeChange((e=>this._onThemeChange(e)))),this._onThemeChange(n.getColorTheme()),this._disposables.add(this._list.onMouseDown((e=>this._onListMouseDownOrTap(e)))),this._disposables.add(this._list.onTap((e=>this._onListMouseDownOrTap(e)))),this._disposables.add(this._list.onDidChangeSelection((e=>this._onListSelection(e)))),this._disposables.add(this._list.onDidChangeFocus((e=>this._onListFocus(e)))),this._disposables.add(this.editor.onDidChangeCursorSelection((()=>this._onCursorSelectionChanged()))),this._disposables.add(this.editor.onDidChangeConfiguration((e=>{e.hasChanged(117)&&(d(),l())}))),this._ctxSuggestWidgetVisible=T1.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=T1.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=T1.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=T1.HasFocusedSuggestion.bindTo(i),this._disposables.add(Mn(this._details.widget.domNode,"keydown",(e=>{this._onDetailsKeydown.fire(e)}))),this._disposables.add(this.editor.onMouseDown((e=>this._onEditorMouseDown(e))))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),null===(e=this._loadingTimeout)||void 0===e||e.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(){0!==this._state&&this._contentWidget.layout()}_onListMouseDownOrTap(e){void 0!==e.element&&void 0!==e.index&&(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=A_(e.type)?2:1}_onListFocus(e){var t;if(this._ignoreFocusEvents)return;if(!e.elements.length)return this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0}),void this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);if(!this._completionModel)return;this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);const i=e.elements[0],n=e.indexes[0];i!==this._focusedItem&&(null===(t=this._currentSuggestionDetails)||void 0===t||t.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=i,this._list.reveal(n),this._currentSuggestionDetails=Yh((e=>m4(this,void 0,void 0,(function*(){const t=id((()=>{this._isDetailsVisible()&&this.showDetails(!0)}),250),n=e.onCancellationRequested((()=>t.dispose()));try{return yield i.resolve(e)}finally{t.dispose(),n.dispose()}})))),this._currentSuggestionDetails.then((()=>{n>=this._list.length||i!==this._list.element(n)||(this._ignoreFocusEvents=!0,this._list.splice(n,1,[i]),this._list.setFocus([n]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:a4(n)}))})).catch(r)),this._onDidFocus.fire({item:i,index:n,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",4===e),this.element.domNode.classList.remove("message"),e){case 0:vs(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 1:this.element.domNode.classList.add("message"),this._messageElement.textContent=u4.LOADING_MESSAGE,vs(this._listElement,this._status.element),_s(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Fs(u4.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=u4.NO_SUGGESTIONS_MESSAGE,vs(this._listElement,this._status.element),_s(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Fs(u4.NO_SUGGESTIONS_MESSAGE);break;case 3:case 4:vs(this._messageElement),_s(this._listElement,this._status.element),this._show();break;case 5:vs(this._messageElement),_s(this._listElement,this._status.element),this._details.show(),this._show()}}_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){0===this._state&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=id((()=>this._setState(1)),t)))}showSuggestions(e,t,i,n,s){var o,r;if(this._contentWidget.setPosition(this.editor.getPosition()),null===(o=this._loadingTimeout)||void 0===o||o.dispose(),null===(r=this._currentSuggestionDetails)||void 0===r||r.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&2!==this._state&&0!==this._state)return void this._setState(4);const a=this._completionModel.items.length,l=0===a;if(this._ctxSuggestWidgetMultipleSuggestions.set(a>1),l)return this._setState(n?0:2),void(this._completionModel=void 0);this._focusedItem=void 0,this._onDidFocus.pause(),this._onDidSelect.pause();try{this._list.splice(0,this._list.length,this._completionModel.items),this._setState(i?4:3),this._list.reveal(t,0),this._list.setFocus(s?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=Rn((()=>{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 0:return!1;case 5:return this._details.widget.pageDown(),!0;case 1:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollBottom(),!0;case 1:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageUp(),!0;case 1:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollTop(),!0;case 1:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(0!==this._state&&2!==this._state&&1!==this._state&&this._completionModel&&this._list.getFocus().length>0)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){5===this._state?(this._setState(3),this._details.widget.domNode.classList.remove("focused")):3===this._state&&this._isDetailsVisible()&&(this._setState(5),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")):!X2(this._list.getFocusedElements()[0])&&!this._explainMode||3!==this._state&&5!==this._state&&4!==this._state||(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._pendingShowDetails.value=Rn((()=>{this._pendingShowDetails.clear(),this._details.show(),e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._positionDetails(),this.editor.focus(),this.element.domNode.classList.add("shows-details")}))}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this.showDetails(!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){var e;this._pendingLayout.clear(),this._pendingShowDetails.clear(),null===(e=this._loadingTimeout)||void 0===e||e.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const t=this._persistedSize.restore(),i=Math.ceil(4.3*this.getLayoutInfo().itemHeight);t&&t.heightl&&(a=l);const h=this._completionModel?this._completionModel.stats.pLabelLen*o.typicalHalfwidthCharacterWidth:a,d=o.statusBarHeight+this._list.contentHeight+o.borderHeight,c=o.itemHeight+o.statusBarHeight,u=Hn(this.editor.getDomNode()),g=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),p=u.top+g.top+g.height,m=Math.min(s.height-p-o.verticalPadding,d),f=u.top+g.top-o.verticalPadding,_=Math.min(f,d);let v=Math.min(Math.max(_,m)+o.borderHeight,d);r===(null===(t=this._cappedHeight)||void 0===t?void 0:t.capped)&&(r=this._cappedHeight.wanted),rv&&(r=v);const b=150;r>m||this._forceRenderingAbove&&f>b?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),v=_):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),v=m),this.element.preferredSize=new Wn(h,o.defaultSize.height),this.element.maxSize=new Wn(l,v),this.element.minSize=new Wn(220,c),this._cappedHeight=r===d?{wanted:null!==(n=null===(i=this._cappedHeight)||void 0===i?void 0:i.wanted)&&void 0!==n?n:e.height,capped:r}:void 0}this._resize(a,r)}_resize(e,t){const{width:i,height:n}=this.element.maxSize;e=Math.min(i,e),t=Math.min(n,t);const{statusBarHeight:s}=this.getLayoutInfo();this._list.layout(t-s,e),this._listElement.style.height=t-s+"px",this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){var e;this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,2===(null===(e=this._contentWidget.getPosition())||void 0===e?void 0:e.preference[0]))}getLayoutInfo(){const e=this.editor.getOption(50),t=uD(this.editor.getOption(119)||e.lineHeight,8,1e3),i=this.editor.getOption(117).showStatusBar&&2!==this._state&&1!==this._state?t:0,n=this._details.widget.borderWidth,s=2*n;return{itemHeight:t,statusBarHeight:i,borderWidth:n,borderHeight:s,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new Wn(430,i+12*t+s)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}};b4.LOADING_MESSAGE=ue(0,"Loading..."),b4.NO_SUGGESTIONS_MESSAGE=ue(0,"No suggestions."),b4=u4=g4([p4(1,ZN),p4(2,Ol),p4(3,P_),p4(4,Fa)],b4);class C4{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?{position:this._position,preference:[this._preference]}:null}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:i,horizontalPadding:n}=this._widget.getLayoutInfo();return new Wn(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 w4,y4=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},S4=function(e,t){return function(i,n){t(i,n,e)}};class L4{constructor(e,t){this._model=e,this._position=t;if(e.getLineMaxColumn(t.lineNumber)!==t.column){const i=e.getOffsetAt(t),n=e.getPositionAt(i+1);this._marker=e.deltaDecorations([],[{range:Rh.fromPositions(t,n),options:{description:"suggest-line-suffix",stickiness:1}}])}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.deltaDecorations(this._marker,[])}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker[0]);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}return this._model.getLineMaxColumn(e.lineNumber)-e.column}}let k4=w4=class{static get(e){return e.getContribution(w4.ID)}constructor(e,t,i,n,s,o,r){this._memoryService=t,this._commandService=i,this._contextKeyService=n,this._instantiationService=s,this._logService=o,this._telemetryService=r,this._lineSuffix=new I,this._toDispose=new N,this._selectors=new D4((e=>e.priority)),this._onWillInsertSuggestItem=new U,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=s.createInstance(U2,this.editor),this._selectors.register({priority:0,select:(e,t,i)=>this._memoryService.select(e,t,i)});const a=T1.InsertMode.bindTo(n);a.set(e.getOption(117).insertMode),this._toDispose.add(this.model.onDidTrigger((()=>a.set(e.getOption(117).insertMode)))),this.widget=this._toDispose.add(new ld((()=>{const e=this._instantiationService.createInstance(b4,this.editor);this._toDispose.add(e),this._toDispose.add(e.onDidSelect((e=>this._insertSuggestion(e,0)),this));const t=new M2(this.editor,e,this.model,(e=>this._insertSuggestion(e,2)));this._toDispose.add(t);const i=T1.MakesTextEdit.bindTo(this._contextKeyService),n=T1.HasInsertAndReplaceRange.bindTo(this._contextKeyService),s=T1.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(x((()=>{i.reset(),n.reset(),s.reset()}))),this._toDispose.add(e.onDidFocus((({item:e})=>{const t=this.editor.getPosition(),o=e.editStart.column,r=t.column;let a=!0;if(!("smart"!==this.editor.getOption(1)||2!==this.model.state||e.completion.additionalTextEdits||4&e.completion.insertTextRules||r-o!==e.completion.insertText.length)){a=this.editor.getModel().getValueInRange({startLineNumber:t.lineNumber,startColumn:o,endLineNumber:t.lineNumber,endColumn:r})!==e.completion.insertText}i.set(a),n.set(!Va.equals(e.editInsertEnd,e.editReplaceEnd)),s.set(Boolean(e.provider.resolveCompletionItem)||Boolean(e.completion.documentation)||e.completion.detail!==e.completion.label)}))),this._toDispose.add(e.onDetailsKeyDown((e=>{e.toKeyCodeChord().equals(new _t(!0,!1,!1,!1,33))||Pe&&e.toKeyCodeChord().equals(new _t(!1,!1,!1,!0,33))?e.stopPropagation():e.toKeyCodeChord().isModifierKey()||this.editor.focus()}))),e}))),this._overtypingCapturer=this._toDispose.add(new ld((()=>this._toDispose.add(new K2(this.editor,this.model))))),this._alternatives=this._toDispose.add(new ld((()=>this._toDispose.add(new I2(this.editor,this._contextKeyService))))),this._toDispose.add(s.createInstance(D2,e)),this._toDispose.add(this.model.onDidTrigger((e=>{this.widget.value.showTriggered(e.auto,e.shy?250:50),this._lineSuffix.value=new L4(this.editor.getModel(),e.position)}))),this._toDispose.add(this.model.onDidSuggest((e=>{if(e.triggerOptions.shy)return;let t=-1;for(const n of this._selectors.itemsOrderedByPriorityDesc)if(t=n.select(this.editor.getModel(),this.editor.getPosition(),e.completionModel.items),-1!==t)break;-1===t&&(t=0);let i=!1;if(e.triggerOptions.auto){const t=this.editor.getOption(117);"never"===t.selectionMode||"always"===t.selectionMode?i="never"===t.selectionMode:"whenTriggerCharacter"===t.selectionMode?i=1!==e.triggerOptions.triggerKind:"whenQuickSuggestion"===t.selectionMode&&(i=1===e.triggerOptions.triggerKind&&!e.triggerOptions.refilter)}this.widget.value.showSuggestions(e.completionModel,t,e.isFrozen,e.triggerOptions.auto,i)}))),this._toDispose.add(this.model.onDidCancel((e=>{e.retrigger||this.widget.value.hideWidget()}))),this._toDispose.add(this.editor.onDidBlurEditorWidget((()=>{this.model.cancel(),this.model.clear()})));const l=T1.AcceptSuggestionsOnEnter.bindTo(n),h=()=>{const e=this.editor.getOption(1);l.set("on"===e||"smart"===e)};this._toDispose.add(this.editor.onDidChangeConfiguration((()=>h()))),h()}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)return this._alternatives.value.reset(),this.model.cancel(),void this.model.clear();if(!this.editor.hasModel())return;const i=h2.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const n=this.editor.getModel(),s=n.getAlternativeVersionId(),{item:o}=e,l=[],h=new jh;1&t||this.editor.pushUndoStop();const d=this.getOverwriteInfo(o,Boolean(8&t));this._memoryService.memorize(n,this.editor.getPosition(),o);const c=o.isResolved;let u=-1,g=-1;if(Array.isArray(o.completion.additionalTextEdits)){this.model.cancel();const e=WN.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",o.completion.additionalTextEdits.map((e=>Fq.replaceMove(Rh.lift(e.range),e.text)))),e.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!c){const e=new F;let i;const s=n.onDidChangeContent((e=>{if(e.isFlush)return h.cancel(),void s.dispose();for(const t of e.changes){const e=Rh.getEndPosition(t.range);i&&!Va.isBefore(e,i)||(i=e)}})),r=t;t|=2;let a=!1;const d=this.editor.onWillType((()=>{d.dispose(),a=!0,2&r||this.editor.pushUndoStop()}));l.push(o.resolve(h.token).then((()=>{if(!o.completion.additionalTextEdits||h.token.isCancellationRequested)return;if(i&&o.completion.additionalTextEdits.some((e=>Va.isBefore(i,Rh.getStartPosition(e.range)))))return!1;a&&this.editor.pushUndoStop();const e=WN.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",o.completion.additionalTextEdits.map((e=>Fq.replaceMove(Rh.lift(e.range),e.text)))),e.restoreRelativeVerticalPositionOfCursor(this.editor),!a&&2&r||this.editor.pushUndoStop(),!0})).then((t=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",e.elapsed(),t),g=!0===t?1:!1===t?0:-2})).finally((()=>{s.dispose(),d.dispose()})))}let{insertText:p}=o.completion;if(4&o.completion.insertTextRules||(p=c1.escape(p)),this.model.cancel(),i.insert(p,{overwriteBefore:d.overwriteBefore,overwriteAfter:d.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(1&o.completion.insertTextRules),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),2&t||this.editor.pushUndoStop(),o.completion.command)if(o.completion.command.id===x4.id)this.model.trigger({auto:!0,retrigger:!0});else{const e=new F;l.push(this._commandService.executeCommand(o.completion.command.id,...o.completion.command.arguments?[...o.completion.command.arguments]:[]).catch((e=>{o.completion.extensionId?a(e):r(e)})).finally((()=>{u=e.elapsed()})))}4&t&&this._alternatives.value.set(e,(e=>{for(h.cancel();n.canUndo();){s!==n.getAlternativeVersionId()&&n.undo(),this._insertSuggestion(e,3|(8&t?8:0));break}})),this._alertCompletionItem(o),Promise.all(l).finally((()=>{this._reportSuggestionAcceptedTelemetry(o,n,c,u,g),this.model.clear(),h.dispose()}))}_reportSuggestionAcceptedTelemetry(e,t,i,n,s){var o,r,a;0!==Math.floor(100*Math.random())&&this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:null!==(r=null===(o=e.extensionId)||void 0===o?void 0:o.value)&&void 0!==r?r:"unknown",providerId:null!==(a=e.provider._debugDisplayName)&&void 0!==a?a:"unknown",kind:e.completion.kind,basenameHash:uE(wa(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:ya(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:n,additionalEditsAsync:s})}getOverwriteInfo(e,t){qr(this.editor.hasModel());let i="replace"===this.editor.getOption(117).insertMode;t&&(i=!i);const n=e.position.column-e.editStart.column,s=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column;return{overwriteBefore:n+(this.editor.getPosition().column-e.position.column),overwriteAfter:s+(this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0)}}_alertCompletionItem(e){if(Hd(e.completion.additionalTextEdits)){Ps(ue(0,"Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length))}}triggerSuggest(e,t,i){this.editor.hasModel()&&(this.model.trigger({auto:null!=t&&t,completionOptions:{providerFilter:e,kindFilter:i?new Set:void 0}}),this.editor.revealPosition(this.editor.getPosition(),0),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=e=>{if(4&e.completion.insertTextRules||e.completion.additionalTextEdits)return!0;const t=this.editor.getPosition(),i=e.editStart.column,n=t.column;if(n-i!==e.completion.insertText.length)return!0;return this.editor.getModel().getValueInRange({startLineNumber:t.lineNumber,startColumn:i,endLineNumber:t.lineNumber,endColumn:n})!==e.completion.insertText};B.once(this.model.onDidTrigger)((e=>{const t=[];B.any(this.model.onDidTrigger,this.model.onDidCancel)((()=>{k(t),i()}),void 0,t),this.model.onDidSuggest((({completionModel:e})=>{if(k(t),0===e.items.length)return void i();const s=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),e.items),o=e.items[s];n(o)?(this.editor.pushUndoStop(),this._insertSuggestion({index:s,item:o,model:e},7)):i()}),void 0,t)})),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let n=0;e&&(n|=4),t&&(n|=8),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)}};k4.ID="editor.contrib.suggestController",k4=w4=y4([S4(1,y2),S4(2,Ya),S4(3,Ol),S4(4,Fa),S4(5,hh),S4(6,lh)],k4);class D4{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(-1!==this._items.indexOf(e))throw new Error("Value is already registered");return this._items.push(e),this._items.sort(((e,t)=>this.prioritySelector(t)-this.prioritySelector(e))),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}class x4 extends bh{constructor(){super({id:x4.id,label:ue(0,"Trigger Suggest"),alias:"Trigger Suggest",precondition:pl.and(Oh.writable,Oh.hasCompletionItemProvider,T1.Visible.toNegated()),kbOpts:{kbExpr:Oh.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,i){const n=k4.get(t);if(!n)return;let s;i&&"object"==typeof i&&!0===i.auto&&(s=!0),n.triggerSuggest(void 0,s,void 0)}}x4.id="editor.action.triggerSuggest",Dh(k4.ID,k4,2),Lh(x4);const N4=190,E4=vh.bindToContribution(k4.get);Sh(new E4({id:"acceptSelectedSuggestion",precondition:pl.and(T1.Visible,T1.HasFocusedSuggestion),handler(e){e.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:pl.and(T1.Visible,Oh.textInputFocus),weight:N4},{primary:3,kbExpr:pl.and(T1.Visible,Oh.textInputFocus,T1.AcceptSuggestionsOnEnter,T1.MakesTextEdit),weight:N4}],menuOpts:[{menuId:R1,title:ue(0,"Insert"),group:"left",order:1,when:T1.HasInsertAndReplaceRange.toNegated()},{menuId:R1,title:ue(0,"Insert"),group:"left",order:1,when:pl.and(T1.HasInsertAndReplaceRange,T1.InsertMode.isEqualTo("insert"))},{menuId:R1,title:ue(0,"Replace"),group:"left",order:1,when:pl.and(T1.HasInsertAndReplaceRange,T1.InsertMode.isEqualTo("replace"))}]})),Sh(new E4({id:"acceptAlternativeSelectedSuggestion",precondition:pl.and(T1.Visible,Oh.textInputFocus,T1.HasFocusedSuggestion),kbOpts:{weight:N4,kbExpr:Oh.textInputFocus,primary:1027,secondary:[1026]},handler(e){e.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:R1,group:"left",order:2,when:pl.and(T1.HasInsertAndReplaceRange,T1.InsertMode.isEqualTo("insert")),title:ue(0,"Replace")},{menuId:R1,group:"left",order:2,when:pl.and(T1.HasInsertAndReplaceRange,T1.InsertMode.isEqualTo("replace")),title:ue(0,"Insert")}]})),Xa.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion"),Sh(new E4({id:"hideSuggestWidget",precondition:T1.Visible,handler:e=>e.cancelSuggestWidget(),kbOpts:{weight:N4,kbExpr:Oh.textInputFocus,primary:9,secondary:[1033]}})),Sh(new E4({id:"selectNextSuggestion",precondition:pl.and(T1.Visible,pl.or(T1.MultipleSuggestions,T1.HasFocusedSuggestion.negate())),handler:e=>e.selectNextSuggestion(),kbOpts:{weight:N4,kbExpr:Oh.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})),Sh(new E4({id:"selectNextPageSuggestion",precondition:pl.and(T1.Visible,pl.or(T1.MultipleSuggestions,T1.HasFocusedSuggestion.negate())),handler:e=>e.selectNextPageSuggestion(),kbOpts:{weight:N4,kbExpr:Oh.textInputFocus,primary:12,secondary:[2060]}})),Sh(new E4({id:"selectLastSuggestion",precondition:pl.and(T1.Visible,pl.or(T1.MultipleSuggestions,T1.HasFocusedSuggestion.negate())),handler:e=>e.selectLastSuggestion()})),Sh(new E4({id:"selectPrevSuggestion",precondition:pl.and(T1.Visible,pl.or(T1.MultipleSuggestions,T1.HasFocusedSuggestion.negate())),handler:e=>e.selectPrevSuggestion(),kbOpts:{weight:N4,kbExpr:Oh.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})),Sh(new E4({id:"selectPrevPageSuggestion",precondition:pl.and(T1.Visible,pl.or(T1.MultipleSuggestions,T1.HasFocusedSuggestion.negate())),handler:e=>e.selectPrevPageSuggestion(),kbOpts:{weight:N4,kbExpr:Oh.textInputFocus,primary:11,secondary:[2059]}})),Sh(new E4({id:"selectFirstSuggestion",precondition:pl.and(T1.Visible,pl.or(T1.MultipleSuggestions,T1.HasFocusedSuggestion.negate())),handler:e=>e.selectFirstSuggestion()})),Sh(new E4({id:"focusSuggestion",precondition:pl.and(T1.Visible,T1.HasFocusedSuggestion.negate()),handler:e=>e.focusSuggestion(),kbOpts:{weight:N4,kbExpr:Oh.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}})),Sh(new E4({id:"focusAndAcceptSuggestion",precondition:pl.and(T1.Visible,T1.HasFocusedSuggestion.negate()),handler:e=>{e.focusSuggestion(),e.acceptSelectedSuggestion(!0,!1)}})),Sh(new E4({id:"toggleSuggestionDetails",precondition:pl.and(T1.Visible,T1.HasFocusedSuggestion),handler:e=>e.toggleSuggestionDetails(),kbOpts:{weight:N4,kbExpr:Oh.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:R1,group:"right",order:1,when:pl.and(T1.DetailsVisible,T1.CanResolve),title:ue(0,"show less")},{menuId:R1,group:"right",order:1,when:pl.and(T1.DetailsVisible.toNegated(),T1.CanResolve),title:ue(0,"show more")}]})),Sh(new E4({id:"toggleExplainMode",precondition:T1.Visible,handler:e=>e.toggleExplainMode(),kbOpts:{weight:100,primary:2138}})),Sh(new E4({id:"toggleSuggestionFocus",precondition:T1.Visible,handler:e=>e.toggleSuggestionFocus(),kbOpts:{weight:N4,kbExpr:Oh.textInputFocus,primary:2570,mac:{primary:778}}})),Sh(new E4({id:"insertBestCompletion",precondition:pl.and(Oh.textInputFocus,pl.equals("config.editor.tabCompletion","on"),D2.AtEnd,T1.Visible.toNegated(),I2.OtherSuggestions.toNegated(),h2.InSnippetMode.toNegated()),handler:(e,t)=>{e.triggerSuggestAndAcceptBest(Br(t)?Object.assign({fallback:"tab"},t):{fallback:"tab"})},kbOpts:{weight:N4,primary:2}})),Sh(new E4({id:"insertNextSuggestion",precondition:pl.and(Oh.textInputFocus,pl.equals("config.editor.tabCompletion","on"),I2.OtherSuggestions,T1.Visible.toNegated(),h2.InSnippetMode.toNegated()),handler:e=>e.acceptNextSuggestion(),kbOpts:{weight:N4,kbExpr:Oh.textInputFocus,primary:2}})),Sh(new E4({id:"insertPrevSuggestion",precondition:pl.and(Oh.textInputFocus,pl.equals("config.editor.tabCompletion","on"),I2.OtherSuggestions,T1.Visible.toNegated(),h2.InSnippetMode.toNegated()),handler:e=>e.acceptPrevSuggestion(),kbOpts:{weight:N4,kbExpr:Oh.textInputFocus,primary:1026}})),Lh(class extends bh{constructor(){super({id:"editor.action.resetSuggestSize",label:ue(0,"Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(e,t){var i;null===(i=k4.get(t))||void 0===i||i.resetWidgetSize()}});class I4 extends E{get selectedItem(){return this._selectedItem}constructor(e,t,i,n){super(),this.editor=e,this.suggestControllerPreselector=t,this.checkModelVersion=i,this.onWillAccept=n,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._selectedItem=Aj(this,void 0),this._register(e.onKeyDown((e=>{e.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))}))),this._register(e.onKeyUp((e=>{e.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))})));const s=k4.get(this.editor);if(s){this._register(s.registerSelector({priority:100,select:(e,t,i)=>{var n;Ej((e=>this.checkModelVersion(e)));const o=this.editor.getModel();if(!o)return-1;const r=null===(n=this.suggestControllerPreselector())||void 0===n?void 0:n.removeCommonPrefix(o);if(!r)return-1;const a=Va.lift(t),l=bc(i.map(((e,t)=>{const i=M4.fromSuggestion(s,o,a,e,this.isShiftKeyPressed).toSingleTextEdit().removeCommonPrefix(o);return{index:t,valid:r.augments(i),prefixLength:i.text.length,suggestItem:e}})).filter((e=>e&&e.valid&&e.prefixLength>0)),Qd((e=>e.prefixLength),Jd));return l?l.index:-1}}));let e=!1;const t=()=>{e||(e=!0,this._register(s.widget.value.onDidShow((()=>{this.isSuggestWidgetVisible=!0,this.update(!0)}))),this._register(s.widget.value.onDidHide((()=>{this.isSuggestWidgetVisible=!1,this.update(!1)}))),this._register(s.widget.value.onDidFocus((()=>{this.isSuggestWidgetVisible=!0,this.update(!0)}))))};this._register(B.once(s.model.onDidTrigger)((e=>{t()}))),this._register(s.onWillInsertSuggestItem((e=>{const t=this.editor.getPosition(),i=this.editor.getModel();if(!t||!i)return;const n=M4.fromSuggestion(s,i,t,e.item,this.isShiftKeyPressed);this.onWillAccept(n)})))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();this._isActive===e&&function(e,t){if(e===t)return!0;if(!e||!t)return!1;return e.equals(t)}(this._currentSuggestItemInfo,t)||(this._isActive=e,this._currentSuggestItemInfo=t,Ej((e=>{this.checkModelVersion(e),this._selectedItem.set(this._isActive?this._currentSuggestItemInfo:void 0,e)})))}getSuggestItemInfo(){const e=k4.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),i=this.editor.getPosition(),n=this.editor.getModel();return t&&i&&n?M4.fromSuggestion(e,n,i,t.item,this.isShiftKeyPressed):void 0}stopForceRenderingAbove(){const e=k4.get(this.editor);null==e||e.stopForceRenderingAbove()}forceRenderingAbove(){const e=k4.get(this.editor);null==e||e.forceRenderingAbove()}}class M4{static fromSuggestion(e,t,i,n,s){let{insertText:o}=n.completion,r=!1;if(4&n.completion.insertTextRules){const e=(new c1).parse(o);e.children.length<100&&s2.adjustWhitespace(t,i,!0,e),o=e.toString(),r=!0}const a=e.getOverwriteInfo(n,s);return new M4(Rh.fromPositions(i.delta(0,-a.overwriteBefore),i.delta(0,Math.max(a.overwriteAfter,0))),o,n.completion.kind,r)}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 yC(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new v1(this.range,this.insertText)}}var T4,R4=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},A4=function(e,t){return function(i,n){t(i,n,e)}};let O4=T4=class extends E{static get(e){return e.getContribution(T4.ID)}constructor(e,t,i,n,s,o,r,a,l){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=i,this.configurationService=n,this.commandService=s,this.debounceService=o,this.languageFeaturesService=r,this.audioCueService=a,this._keybindingService=l,this.model=Pj("inlineCompletionModel",void 0),this.textModelVersionId=Aj(this,-1),this.cursorPosition=Aj(this,new Va(1,1)),this.suggestWidgetAdaptor=this._register(new I4(this.editor,(()=>{var e,t;return null===(t=null===(e=this.model.get())||void 0===e?void 0:e.selectedInlineCompletion.get())||void 0===t?void 0:t.toSingleTextEdit(void 0)}),(e=>this.updateObservables(e,c2.Other)),(e=>{Ej((t=>{var i;this.updateObservables(t,c2.Other),null===(i=this.model.get())||void 0===i||i.handleSuggestAccepted(e)}))}))),this._enabled=Yj(this.editor.onDidChangeConfiguration,(()=>this.editor.getOption(62).enabled)),this.ghostTextWidget=this._register(this.instantiationService.createInstance(Y0,this.editor,{ghostText:this.model.map(((e,t)=>null==e?void 0:e.ghostText.read(t))),minReservedLineCount:Gj(0),targetTextModel:this.model.map((e=>null==e?void 0:e.textModel))})),this._debounceValue=this.debounceService.for(this.languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._register(new F0(this.contextKeyService,this.model)),this._register(B.runAndSubscribe(e.onDidChangeModel,(()=>Ej((i=>{this.model.set(void 0,i),this.updateObservables(i,c2.Other);const n=e.getModel();if(n){const s=t.createInstance(m2,n,this.suggestWidgetAdaptor.selectedItem,this.cursorPosition,this.textModelVersionId,this._debounceValue,Yj(e.onDidChangeConfiguration,(()=>e.getOption(117).preview)),Yj(e.onDidChangeConfiguration,(()=>e.getOption(117).previewMode)),Yj(e.onDidChangeConfiguration,(()=>e.getOption(62).mode)),this._enabled);this.model.set(s,i)}})))));const h=e=>{var t;return e.isUndoing?c2.Undo:e.isRedoing?c2.Redo:(null===(t=this.model.get())||void 0===t?void 0:t.isAcceptingPartially)?c2.AcceptWord:c2.Other};let d;this._register(e.onDidChangeModelContent((e=>Ej((t=>this.updateObservables(t,h(e))))))),this._register(e.onDidChangeCursorPosition((e=>Ej((t=>{var i;this.updateObservables(t,c2.Other),3!==e.reason&&"api"!==e.source||null===(i=this.model.get())||void 0===i||i.stop(t)}))))),this._register(e.onDidType((()=>Ej((e=>{var t;this.updateObservables(e,c2.Other),this._enabled.get()&&(null===(t=this.model.get())||void 0===t||t.trigger(e))}))))),this._register(this.commandService.onDidExecuteCommand((t=>{new Set([By.Tab.id,By.DeleteLeft.id,By.DeleteRight.id,sq,"acceptSelectedSuggestion"]).has(t.commandId)&&e.hasTextFocus()&&this._enabled.get()&&Ej((e=>{var t;null===(t=this.model.get())||void 0===t||t.trigger(e)}))}))),this._register(this.editor.onDidBlurEditorWidget((()=>{this.contextKeyService.getContextKeyValue("accessibleViewIsShown")||this.configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(62).keepOnBlur||bq.dropDownVisible||Ej((e=>{var t;null===(t=this.model.get())||void 0===t||t.stop(e)}))}))),this._register(Kj((e=>{var t;const i=null===(t=this.model.read(e))||void 0===t?void 0:t.state.read(e);(null==i?void 0:i.suggestItem)?i.ghostText.lineCount>=2&&this.suggestWidgetAdaptor.forceRenderingAbove():this.suggestWidgetAdaptor.stopForceRenderingAbove()}))),this._register(x((()=>{this.suggestWidgetAdaptor.stopForceRenderingAbove()}))),this._register(Kj((e=>{const t=this.model.read(e),i=null==t?void 0:t.state.read(e);if(t&&i&&i.inlineCompletion){if(i.inlineCompletion.semanticId!==d){d=i.inlineCompletion.semanticId;const e=t.textModel.getLineContent(i.ghostText.lineNumber);this.audioCueService.playAudioCue(k$.inlineSuggestion).then((()=>{this.editor.getOption(8)&&this.provideScreenReaderUpdate(i.ghostText.renderForScreenReader(e))}))}}else d=void 0}))),this._register(new fq(this.editor,this.model,this.instantiationService)),this._register(this.configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this.configurationService.getValue("accessibility.verbosity.inlineCompletions")})}))),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this.configurationService.getValue("accessibility.verbosity.inlineCompletions")})}provideScreenReaderUpdate(e){const t=this.contextKeyService.getContextKeyValue("accessibleViewIsShown"),i=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let n;!t&&i&&this.editor.getOption(147)&&(n=ue(0,"Inspect this in the accessible view ({0})",i.getAriaLabel())),Ps(n?e+", "+n:e)}updateObservables(e,t){var i,n;const s=this.editor.getModel();this.textModelVersionId.set(null!==(i=null==s?void 0:s.getVersionId())&&void 0!==i?i:-1,e,t),this.cursorPosition.set(null!==(n=this.editor.getPosition())&&void 0!==n?n:new Va(1,1),e)}shouldShowHoverAt(e){var t;const i=null===(t=this.model.get())||void 0===t?void 0:t.ghostText.get();return!!i&&i.parts.some((t=>e.containsPosition(new Va(i.lineNumber,t.column))))}shouldShowHoverAtViewZone(e){return this.ghostTextWidget.ownsViewZone(e)}};O4.ID="editor.contrib.inlineCompletionsController",O4=T4=R4([A4(1,Fa),A4(2,Ol),A4(3,pu),A4(4,Ya),A4(5,SE),A4(6,oL),A4(7,y$),A4(8,WL)],O4);var P4=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class F4 extends bh{constructor(){super({id:F4.ID,label:ue(0,"Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:pl.and(Oh.writable,F0.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}run(e,t){var i;return P4(this,void 0,void 0,(function*(){const e=O4.get(t);null===(i=null==e?void 0:e.model.get())||void 0===i||i.next()}))}}F4.ID=rq;class B4 extends bh{constructor(){super({id:B4.ID,label:ue(0,"Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:pl.and(Oh.writable,F0.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}run(e,t){var i;return P4(this,void 0,void 0,(function*(){const e=O4.get(t);null===(i=null==e?void 0:e.model.get())||void 0===i||i.previous()}))}}B4.ID=oq;class W4 extends bh{constructor(){super({id:W4.ID,label:ue(0,"Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:F0.inlineSuggestionVisible,kbOpts:{weight:100,primary:9}})}run(e,t){return P4(this,void 0,void 0,(function*(){const e=O4.get(t);Ej((t=>{var i;null===(i=null==e?void 0:e.model.get())||void 0===i||i.stop(t)}))}))}}W4.ID="editor.action.inlineSuggest.hide";class V4 extends rh{constructor(){super({id:V4.ID,title:ue(0,"Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:eh.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:pl.equals("config.editor.inlineSuggest.showToolbar","always")})}run(e,t){return P4(this,void 0,void 0,(function*(){const t=e.get(pu),i="always"===t.getValue("editor.inlineSuggest.showToolbar")?"onHover":"always";t.updateValue("editor.inlineSuggest.showToolbar",i)}))}}V4.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";var H4=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},z4=function(e,t){return function(i,n){t(i,n,e)}};class U4{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return 1===e.type&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let K4=class{constructor(e,t,i,n,s,o){this._editor=e,this._languageService=t,this._openerService=i,this.accessibilityService=n,this._instantiationService=s,this._telemetryService=o,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=O4.get(this._editor);if(!t)return null;const i=e.target;if(8===i.type){const n=i.detail;if(t.shouldShowHoverAtViewZone(n.viewZoneId))return new uK(1e3,this,Rh.fromPositions(this._editor.getModel().validatePosition(n.positionBefore||n.position)),e.event.posx,e.event.posy,!1)}if(7===i.type&&t.shouldShowHoverAt(i.range))return new uK(1e3,this,i.range,e.event.posx,e.event.posy,!1);if(6===i.type){if(i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range))return new uK(1e3,this,i.range,e.event.posx,e.event.posy,!1)}return null}computeSync(e,t){if("always"===this._editor.getOption(62).showToolbar)return[];const i=O4.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new U4(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new N,n=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(8)&&this.renderScreenReaderText(e,n,i);const s=n.controller.model.get(),o=this._instantiationService.createInstance(bq,this._editor,!1,Gj(null),s.selectedInlineCompletionIndex,s.inlineCompletionsCount,s.selectedInlineCompletion.map((e=>{var t;return null!==(t=null==e?void 0:e.inlineCompletion.source.inlineCompletions.commands)&&void 0!==t?t:[]})));return e.fragment.appendChild(o.getDomNode()),s.triggerExplicitly(),i.add(o),i}renderScreenReaderText(e,t,i){const n=fs,s=n("div.hover-row.markdown-hover"),o=ds(s,n("div.hover-contents",{"aria-live":"assertive"})),r=i.add(new Jk({editor:this._editor},this._languageService,this._openerService));i.add(Kj((n=>{var s;const a=null===(s=t.controller.model.read(n))||void 0===s?void 0:s.ghostText.read(n);if(a){const t=this._editor.getModel().getLineContent(a.lineNumber);(t=>{i.add(r.onDidRenderAsync((()=>{o.className="hover-contents code-hover-contents",e.onContentsChanged()})));const n=ue(0,"Suggestion:"),s=i.add(r.render((new Ta).appendText(n).appendCodeblock("text",t)));o.replaceChildren(s.element)})(a.renderForScreenReader(t))}else us(o)}))),e.fragment.appendChild(s)}};K4=H4([z4(1,Lc),z4(2,qk),z4(3,QR),z4(4,Fa),z4(5,lh)],K4),Dh(O4.ID,O4,3),Lh(class extends bh{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:ue(0,"Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:Oh.writable})}run(e,t){var i;return P4(this,void 0,void 0,(function*(){const e=O4.get(t);null===(i=null==e?void 0:e.model.get())||void 0===i||i.triggerExplicitly()}))}}),Lh(F4),Lh(B4),Lh(class extends bh{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:ue(0,"Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:pl.and(Oh.writable,F0.inlineSuggestionVisible),kbOpts:{weight:101,primary:2065,kbExpr:pl.and(Oh.writable,F0.inlineSuggestionVisible)},menuOpts:[{menuId:eh.InlineSuggestionToolbar,title:ue(0,"Accept Word"),group:"primary",order:2}]})}run(e,t){var i;return P4(this,void 0,void 0,(function*(){const e=O4.get(t);yield null===(i=null==e?void 0:e.model.get())||void 0===i?void 0:i.acceptNextWord(e.editor)}))}}),Lh(class extends bh{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:ue(0,"Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:pl.and(Oh.writable,F0.inlineSuggestionVisible),kbOpts:{weight:101},menuOpts:[{menuId:eh.InlineSuggestionToolbar,title:ue(0,"Accept Line"),group:"secondary",order:2}]})}run(e,t){var i;return P4(this,void 0,void 0,(function*(){const e=O4.get(t);yield null===(i=null==e?void 0:e.model.get())||void 0===i?void 0:i.acceptNextLine(e.editor)}))}}),Lh(class extends bh{constructor(){super({id:sq,label:ue(0,"Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:F0.inlineSuggestionVisible,menuOpts:[{menuId:eh.InlineSuggestionToolbar,title:ue(0,"Accept"),group:"primary",order:1}],kbOpts:{primary:2,weight:200,kbExpr:pl.and(F0.inlineSuggestionVisible,Oh.tabMovesFocus.toNegated(),F0.inlineSuggestionHasIndentationLessThanTabSize,T1.Visible.toNegated(),Oh.hoverFocused.toNegated())}})}run(e,t){var i;return P4(this,void 0,void 0,(function*(){const e=O4.get(t);e&&(null===(i=e.model.get())||void 0===i||i.accept(e.editor),e.editor.focus())}))}}),Lh(W4),ah(V4),gK.register(K4);const j4=Ba("themeService");var q4,$4=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},G4=function(e,t){return function(i,n){t(i,n,e)}};let Z4=q4=class extends E{static get(e){return e.getContribution(q4.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel((e=>this.stop()))),this._register(this._editor.onDidChangeModelLanguage((e=>this.stop()))),this._register(EC.onDidChange((e=>this.stop()))),this._register(this._editor.onKeyUp((e=>9===e.keyCode&&this.stop())))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new Y4(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};Z4.ID="editor.contrib.inspectTokens",Z4=q4=$4([G4(1,j4),G4(2,Lc)],Z4);class Y4 extends E{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=function(e,t){const i=EC.get(t);if(i)return i;const n=e.encodeLanguageId(t);return{getInitialState:()=>IC,tokenize:(e,i,n)=>MC(t,n),tokenizeEncoded:(e,t,i)=>TC(n,i)}}(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition((e=>this._compute(this._editor.getPosition())))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return Y4._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let a=t.tokens1.length-1;a>=0;a--){const n=t.tokens1[a];if(e.column-1>=n.offset){i=a;break}}let n=0;for(let a=t.tokens2.length>>>1;a>=0;a--)if(e.column-1>=t.tokens2[a<<1]){n=a;break}const s=this._model.getLineContent(e.lineNumber);let o="";if(ie.lineNumber===t.lineNumber?e.column-t.column:e.lineNumber-t.lineNumber));for(let r=t.length-2;r>=0;r--)t[r].lineNumber===t[r+1].lineNumber&&t.splice(r,1);const i=[];let n=0,s=0;const o=t.length;for(let r=1,a=e.getLineCount();r<=a;r++){const a=e.getLineContent(r),l=a.length+1;let h=0;if(s=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},e5=function(e,t){return function(i,n){t(i,n,e)}};let t5=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.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===i)return void(this._selectionId=t.trackSelection(this._selection));if(!this._isMovingDown&&1===this._selection.startLineNumber)return void(this._selectionId=t.trackSelection(this._selection));this._moveEndPositionDown=!1;let n=this._selection;n.startLineNumbere.tokenization.getLineTokens(t),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(t,i)=>e.getLanguageIdAtPosition(t,i)},getLineContent:null};if(n.startLineNumber===n.endLineNumber&&1===e.getLineMaxColumn(n.startLineNumber)){const i=n.startLineNumber,s=this._isMovingDown?i+1:i-1;1===e.getLineMaxColumn(s)?t.addEditOperation(new Rh(1,1,1,1),null):(t.addEditOperation(new Rh(i,1,i,1),e.getLineContent(s)),t.addEditOperation(new Rh(s,1,s,e.getLineMaxColumn(s)),null)),n=new Ah(s,1,s,1)}else{let i,o;if(this._isMovingDown){i=n.endLineNumber+1,o=e.getLineContent(i),t.addEditOperation(new Rh(i-1,e.getLineMaxColumn(i-1),i,e.getLineMaxColumn(i)),null);let h=o;if(this.shouldAutoIndent(e,n)){const d=this.matchEnterRule(e,a,s,i,n.startLineNumber-1);if(null!==d){const t=QJ(d+XJ(ao(e.getLineContent(i)),s),s,r);h=t+this.trimStart(o)}else{l.getLineContent=t=>t===n.startLineNumber?e.getLineContent(i):e.getLineContent(t);const t=wy(this._autoIndent,l,e.getLanguageIdAtPosition(i,1),n.startLineNumber,a,this._languageConfigurationService);if(null!==t){const n=ao(e.getLineContent(i)),a=XJ(t,s);if(a!==XJ(n,s)){const e=QJ(a,s,r);h=e+this.trimStart(o)}}}t.addEditOperation(new Rh(n.startLineNumber,1,n.startLineNumber,1),h+"\n");const c=this.matchEnterRuleMovingDown(e,a,s,n.startLineNumber,i,h);if(null!==c)0!==c&&this.getIndentEditsOfMovingBlock(e,t,n,s,r,c);else{l.getLineContent=t=>t===n.startLineNumber?h:t>=n.startLineNumber+1&&t<=n.endLineNumber+1?e.getLineContent(t-1):e.getLineContent(t);const o=wy(this._autoIndent,l,e.getLanguageIdAtPosition(i,1),n.startLineNumber+1,a,this._languageConfigurationService);if(null!==o){const i=ao(e.getLineContent(n.startLineNumber)),a=XJ(o,s),l=XJ(i,s);if(a!==l){const i=a-l;this.getIndentEditsOfMovingBlock(e,t,n,s,r,i)}}}}else t.addEditOperation(new Rh(n.startLineNumber,1,n.startLineNumber,1),h+"\n")}else if(i=n.startLineNumber-1,o=e.getLineContent(i),t.addEditOperation(new Rh(i,1,i+1,1),null),t.addEditOperation(new Rh(n.endLineNumber,e.getLineMaxColumn(n.endLineNumber),n.endLineNumber,e.getLineMaxColumn(n.endLineNumber)),"\n"+o),this.shouldAutoIndent(e,n)){l.getLineContent=t=>t===i?e.getLineContent(n.startLineNumber):e.getLineContent(t);const o=this.matchEnterRule(e,a,s,n.startLineNumber,n.startLineNumber-2);if(null!==o)0!==o&&this.getIndentEditsOfMovingBlock(e,t,n,s,r,o);else{const o=wy(this._autoIndent,l,e.getLanguageIdAtPosition(n.startLineNumber,1),i,a,this._languageConfigurationService);if(null!==o){const i=ao(e.getLineContent(n.startLineNumber)),a=XJ(o,s),l=XJ(i,s);if(a!==l){const i=a-l;this.getIndentEditsOfMovingBlock(e,t,n,s,r,i)}}}}}this._selectionId=t.trackSelection(n)}buildIndentConverter(e,t,i){return{shiftIndent:n=>_y.shiftIndent(n,n.length+1,e,t,i),unshiftIndent:n=>_y.unshiftIndent(n,n.length+1,e,t,i)}}parseEnterResult(e,t,i,n,s){if(s){let o=s.indentation;s.indentAction===Mc.None||s.indentAction===Mc.Indent?o=s.indentation+s.appendText:s.indentAction===Mc.IndentOutdent?o=s.indentation:s.indentAction===Mc.Outdent&&(o=t.unshiftIndent(s.indentation)+s.appendText);const r=e.getLineContent(n);if(this.trimStart(r).indexOf(this.trimStart(o))>=0){const s=ao(e.getLineContent(n));let r=ao(o);const a=yy(e,n,this._languageConfigurationService);null!==a&&2&a&&(r=t.unshiftIndent(r));return XJ(r,i)-XJ(s,i)}}return null}matchEnterRuleMovingDown(e,t,i,n,s,o){if(lo(o)>=0){const o=e.getLineMaxColumn(s),r=cy(this._autoIndent,e,new Rh(s,o,s,o),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,r)}{let s=n-1;for(;s>=1;){if(lo(e.getLineContent(s))>=0)break;s--}if(s<1||n>e.getLineCount())return null;const o=e.getLineMaxColumn(s),r=cy(this._autoIndent,e,new Rh(s,o,s,o),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,r)}}matchEnterRule(e,t,i,n,s,o){let r=s;for(;r>=1;){let t;t=r===s&&void 0!==o?o:e.getLineContent(r);if(lo(t)>=0)break;r--}if(r<1||n>e.getLineCount())return null;const a=e.getLineMaxColumn(r),l=cy(this._autoIndent,e,new Rh(r,a,r,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,l)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4)return!1;if(!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const i=e.getLanguageIdAtPosition(t.startLineNumber,1);return i===e.getLanguageIdAtPosition(t.endLineNumber,1)&&null!==this._languageConfigurationService.getLanguageConfiguration(i).indentRulesSupport}getIndentEditsOfMovingBlock(e,t,i,n,s,o){for(let r=i.startLineNumber;r<=i.endLineNumber;r++){const a=ao(e.getLineContent(r)),l=QJ(XJ(a,n)+o,n,s);l!==a&&(t.addEditOperation(new Rh(r,1,r,a.length+1),l),r===i.endLineNumber&&i.endColumn<=a.length+1&&""===l&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&i.startLineNumber=s)return null;const o=[];for(let a=n;a<=s;a++)o.push(e.getLineContent(a));let r=o.slice(0);return r.sort(i5.getCollator().compare),!0===i&&(r=r.reverse()),{startLineNumber:n,endLineNumber:s,before:o,after:r}}i5._COLLATOR=null;class s5 extends bh{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map(((e,t)=>({selection:e,index:t,ignore:!1})));i.sort(((e,t)=>Rh.compareRangesUsingStarts(e.selection,t.selection)));let n=i[0];for(let o=1;onew Va(e.positionLineNumber,e.positionColumn))));const s=t.getSelection();if(null===s)return;const o=new X4(s,n);t.pushUndoStop(),t.executeCommands(this.id,[o]),t.pushUndoStop()}}a5.ID="editor.action.trimTrailingWhitespace";class l5 extends bh{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),n=this._getRangesToDelete(t),s=[];for(let a=0,l=n.length-1;aFq.replace(e,"")));t.pushUndoStop(),t.executeEdits(this.id,r,o),t.pushUndoStop()}}class h5 extends bh{run(e,t){const i=t.getSelections();if(null===i)return;const n=t.getModel();if(null===n)return;const s=t.getOption(129),o=[];for(const r of i)if(r.isEmpty()){const e=r.getStartPosition(),i=t.getConfiguredWordAtPosition(e);if(!i)continue;const a=new Rh(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn),l=n.getValueInRange(a);o.push(Fq.replace(a,this._modifyText(l,s)))}else{const e=n.getValueInRange(r);o.push(Fq.replace(r,this._modifyText(e,s)))}t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop()}}class d5{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(e){}}return this._actual}isSupported(){return null!==this.get()}}class c5 extends h5{constructor(){super({id:"editor.action.transformToTitlecase",label:ue(0,"Transform to Title Case"),alias:"Transform to Title Case",precondition:Oh.writable})}_modifyText(e,t){const i=c5.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,(e=>e.toLocaleUpperCase())):e}}c5.titleBoundary=new d5("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");class u5 extends h5{constructor(){super({id:"editor.action.transformToSnakecase",label:ue(0,"Transform to Snake Case"),alias:"Transform to Snake Case",precondition:Oh.writable})}_modifyText(e,t){const i=u5.caseBoundary.get(),n=u5.singleLetters.get();return i&&n?e.replace(i,"$1_$2").replace(n,"$1_$2$3").toLocaleLowerCase():e}}u5.caseBoundary=new d5("(\\p{Ll})(\\p{Lu})","gmu"),u5.singleLetters=new d5("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");class g5 extends h5{constructor(){super({id:"editor.action.transformToCamelcase",label:ue(0,"Transform to Camel Case"),alias:"Transform to Camel Case",precondition:Oh.writable})}_modifyText(e,t){const i=g5.wordBoundary.get();if(!i)return e;const n=e.split(i);return n.shift()+n.map((e=>e.substring(0,1).toLocaleUpperCase()+e.substring(1))).join("")}}g5.wordBoundary=new d5("[_\\s-]","gm");class p5 extends h5{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every((e=>e.isSupported()))}constructor(){super({id:"editor.action.transformToKebabcase",label:ue(0,"Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:Oh.writable})}_modifyText(e,t){const i=p5.caseBoundary.get(),n=p5.singleLetters.get(),s=p5.underscoreBoundary.get();return i&&n&&s?e.replace(s,"$1-$3").replace(i,"$1-$2").replace(n,"$1-$2").toLocaleLowerCase():e}}p5.caseBoundary=new d5("(\\p{Ll})(\\p{Lu})","gmu"),p5.singleLetters=new d5("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu"),p5.underscoreBoundary=new d5("(\\S)(_)(\\S)","gm"),Lh(class extends s5{constructor(){super(!1,{id:"editor.action.copyLinesUpAction",label:ue(0,"Copy Line Up"),alias:"Copy Line Up",precondition:Oh.writable,kbOpts:{kbExpr:Oh.editorTextFocus,primary:1552,linux:{primary:3600},weight:100},menuOpts:{menuId:eh.MenubarSelectionMenu,group:"2_line",title:ue(0,"&&Copy Line Up"),order:1}})}}),Lh(class extends s5{constructor(){super(!0,{id:"editor.action.copyLinesDownAction",label:ue(0,"Copy Line Down"),alias:"Copy Line Down",precondition:Oh.writable,kbOpts:{kbExpr:Oh.editorTextFocus,primary:1554,linux:{primary:3602},weight:100},menuOpts:{menuId:eh.MenubarSelectionMenu,group:"2_line",title:ue(0,"Co&&py Line Down"),order:2}})}}),Lh(class extends bh{constructor(){super({id:"editor.action.duplicateSelection",label:ue(0,"Duplicate Selection"),alias:"Duplicate Selection",precondition:Oh.writable,menuOpts:{menuId:eh.MenubarSelectionMenu,group:"2_line",title:ue(0,"&&Duplicate Selection"),order:5}})}run(e,t,i){if(!t.hasModel())return;const n=[],s=t.getSelections(),o=t.getModel();for(const r of s)if(r.isEmpty())n.push(new Q4(r,!0));else{const e=new Ah(r.endLineNumber,r.endColumn,r.endLineNumber,r.endColumn);n.push(new Qw(e,o.getValueInRange(r)))}t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}),Lh(class extends o5{constructor(){super(!1,{id:"editor.action.moveLinesUpAction",label:ue(0,"Move Line Up"),alias:"Move Line Up",precondition:Oh.writable,kbOpts:{kbExpr:Oh.editorTextFocus,primary:528,linux:{primary:528},weight:100},menuOpts:{menuId:eh.MenubarSelectionMenu,group:"2_line",title:ue(0,"Mo&&ve Line Up"),order:3}})}}),Lh(class extends o5{constructor(){super(!0,{id:"editor.action.moveLinesDownAction",label:ue(0,"Move Line Down"),alias:"Move Line Down",precondition:Oh.writable,kbOpts:{kbExpr:Oh.editorTextFocus,primary:530,linux:{primary:530},weight:100},menuOpts:{menuId:eh.MenubarSelectionMenu,group:"2_line",title:ue(0,"Move &&Line Down"),order:4}})}}),Lh(class extends r5{constructor(){super(!1,{id:"editor.action.sortLinesAscending",label:ue(0,"Sort Lines Ascending"),alias:"Sort Lines Ascending",precondition:Oh.writable})}}),Lh(class extends r5{constructor(){super(!0,{id:"editor.action.sortLinesDescending",label:ue(0,"Sort Lines Descending"),alias:"Sort Lines Descending",precondition:Oh.writable})}}),Lh(class extends bh{constructor(){super({id:"editor.action.removeDuplicateLines",label:ue(0,"Delete Duplicate Lines"),alias:"Delete Duplicate Lines",precondition:Oh.writable})}run(e,t){if(!t.hasModel())return;const i=t.getModel();if(1===i.getLineCount()&&1===i.getLineMaxColumn(1))return;const n=[],s=[];let o=0;for(const r of t.getSelections()){const e=new Set,t=[];for(let n=r.startLineNumber;n<=r.endLineNumber;n++){const s=i.getLineContent(n);e.has(s)||(t.push(s),e.add(s))}const a=new Ah(r.startLineNumber,1,r.endLineNumber,i.getLineMaxColumn(r.endLineNumber)),l=r.startLineNumber-o,h=new Ah(l,1,l+t.length-1,t[t.length-1].length);n.push(Fq.replace(a,t.join("\n"))),s.push(h),o+=r.endLineNumber-r.startLineNumber+1-t.length}t.pushUndoStop(),t.executeEdits(this.id,n,s),t.pushUndoStop()}}),Lh(a5),Lh(class extends bh{constructor(){super({id:"editor.action.deleteLines",label:ue(0,"Delete Line"),alias:"Delete Line",precondition:Oh.writable,kbOpts:{kbExpr:Oh.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),n=t.getModel();if(1===n.getLineCount()&&1===n.getLineMaxColumn(1))return;let s=0;const o=[],r=[];for(let a=0,l=i.length;a1&&(t-=1,h=n.getLineMaxColumn(t)),o.push(Fq.replace(new Ah(t,h,l,d),"")),r.push(new Ah(t-s,e.positionColumn,t-s,e.positionColumn)),s+=e.endLineNumber-e.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,o,r),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map((e=>{let t=e.endLineNumber;return e.startLineNumbere.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber));const i=[];let n=t[0];for(let s=1;s=t[s].startLineNumber?n.endLineNumber=t[s].endLineNumber:(i.push(n),n=t[s]);return i.push(n),i}}),Lh(class extends bh{constructor(){super({id:"editor.action.indentLines",label:ue(0,"Indent Line"),alias:"Indent Line",precondition:Oh.writable,kbOpts:{kbExpr:Oh.editorTextFocus,primary:2142,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Sy.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}),Lh(class extends bh{constructor(){super({id:"editor.action.outdentLines",label:ue(0,"Outdent Line"),alias:"Outdent Line",precondition:Oh.writable,kbOpts:{kbExpr:Oh.editorTextFocus,primary:2140,weight:100}})}run(e,t){By.Outdent.runEditorCommand(e,t,null)}}),Lh(class extends bh{constructor(){super({id:"editor.action.insertLineBefore",label:ue(0,"Insert Line Above"),alias:"Insert Line Above",precondition:Oh.writable,kbOpts:{kbExpr:Oh.editorTextFocus,primary:3075,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Sy.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}),Lh(class extends bh{constructor(){super({id:"editor.action.insertLineAfter",label:ue(0,"Insert Line Below"),alias:"Insert Line Below",precondition:Oh.writable,kbOpts:{kbExpr:Oh.editorTextFocus,primary:2051,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Sy.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}),Lh(class extends l5{constructor(){super({id:"deleteAllLeft",label:ue(0,"Delete All Left"),alias:"Delete All Left",precondition:Oh.writable,kbOpts:{kbExpr:Oh.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let i=null;const n=[];let s=0;return t.forEach((t=>{let o;if(1===t.endColumn&&s>0){const e=t.startLineNumber-s;o=new Ah(e,t.startColumn,e,t.startColumn)}else o=new Ah(t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn);s+=t.endLineNumber-t.startLineNumber,t.intersectRanges(e)?i=o:n.push(o)})),i&&n.unshift(i),n}_getRangesToDelete(e){const t=e.getSelections();if(null===t)return[];let i=t;const n=e.getModel();return null===n?[]:(i.sort(Rh.compareRangesUsingStarts),i=i.map((e=>{if(e.isEmpty()){if(1===e.startColumn){const t=Math.max(1,e.startLineNumber-1),i=1===e.startLineNumber?1:n.getLineLength(t)+1;return new Rh(t,i,e.startLineNumber,1)}return new Rh(e.startLineNumber,1,e.startLineNumber,e.startColumn)}return new Rh(e.startLineNumber,1,e.endLineNumber,e.endColumn)})),i)}}),Lh(class extends l5{constructor(){super({id:"deleteAllRight",label:ue(0,"Delete All Right"),alias:"Delete All Right",precondition:Oh.writable,kbOpts:{kbExpr:Oh.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,t){let i=null;const n=[];for(let s=0,o=t.length,r=0;s{if(e.isEmpty()){const i=t.getLineMaxColumn(e.startLineNumber);return e.startColumn===i?new Rh(e.startLineNumber,e.startColumn,e.startLineNumber+1,1):new Rh(e.startLineNumber,e.startColumn,e.startLineNumber,i)}return e}));return n.sort(Rh.compareRangesUsingStarts),n}}),Lh(class extends bh{constructor(){super({id:"editor.action.joinLines",label:ue(0,"Join Lines"),alias:"Join Lines",precondition:Oh.writable,kbOpts:{kbExpr:Oh.editorTextFocus,primary:0,mac:{primary:296},weight:100}})}run(e,t){const i=t.getSelections();if(null===i)return;let n=t.getSelection();if(null===n)return;i.sort(Rh.compareRangesUsingStarts);const s=[],o=i.reduce(((e,t)=>e.isEmpty()?e.endLineNumber===t.startLineNumber?(n.equalsSelection(e)&&(n=t),t):t.startLineNumber>e.endLineNumber+1?(s.push(e),t):new Ah(e.startLineNumber,e.startColumn,t.endLineNumber,t.endColumn):t.startLineNumber>e.endLineNumber?(s.push(e),t):new Ah(e.startLineNumber,e.startColumn,t.endLineNumber,t.endColumn)));s.push(o);const r=t.getModel();if(null===r)return;const a=[],l=[];let h=n,d=0;for(let c=0,u=s.length;c=1){let i=!0;""===m&&(i=!1),!i||" "!==m.charAt(m.length-1)&&"\t"!==m.charAt(m.length-1)||(i=!1,m=m.replace(/[\s\uFEFF\xA0]+$/g," "));const n=e.substr(t-1);m+=(i?" ":"")+n,g=i?n.length+1:n.length}else g=0}const f=new Rh(t,i,o,u);if(!f.isEmpty()){let i;e.isEmpty()?(a.push(Fq.replace(f,m)),i=new Ah(f.startLineNumber-d,m.length-g+1,t-d,m.length-g+1)):e.startLineNumber===e.endLineNumber?(a.push(Fq.replace(f,m)),i=new Ah(e.startLineNumber-d,e.startColumn,e.endLineNumber-d,e.endColumn)):(a.push(Fq.replace(f,m)),i=new Ah(e.startLineNumber-d,e.startColumn,e.startLineNumber-d,m.length-p)),null!==Rh.intersectRanges(f,n)?h=i:l.push(i)}d+=f.endLineNumber-f.startLineNumber}l.unshift(h),t.pushUndoStop(),t.executeEdits(this.id,a,l),t.pushUndoStop()}}),Lh(class extends bh{constructor(){super({id:"editor.action.transpose",label:ue(0,"Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:Oh.writable})}run(e,t){const i=t.getSelections();if(null===i)return;const n=t.getModel();if(null===n)return;const s=[];for(let o=0,r=i.length;o=r){if(t.lineNumber===n.getLineCount())continue;const e=new Rh(t.lineNumber,Math.max(1,t.column-1),t.lineNumber+1,1),i=n.getValueInRange(e).split("").reverse().join("");s.push(new Xw(new Ah(t.lineNumber,Math.max(1,t.column-1),t.lineNumber+1,1),i))}else{const e=new Rh(t.lineNumber,Math.max(1,t.column-1),t.lineNumber,t.column+1),i=n.getValueInRange(e).split("").reverse().join("");s.push(new ty(e,i,new Ah(t.lineNumber,t.column+1,t.lineNumber,t.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}),Lh(class extends h5{constructor(){super({id:"editor.action.transformToUppercase",label:ue(0,"Transform to Uppercase"),alias:"Transform to Uppercase",precondition:Oh.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}),Lh(class extends h5{constructor(){super({id:"editor.action.transformToLowercase",label:ue(0,"Transform to Lowercase"),alias:"Transform to Lowercase",precondition:Oh.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}),u5.caseBoundary.isSupported()&&u5.singleLetters.isSupported()&&Lh(u5),g5.wordBoundary.isSupported()&&Lh(g5),c5.titleBoundary.isSupported()&&Lh(c5),p5.isSupported()&&Lh(p5);var m5,f5=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},_5=function(e,t){return function(i,n){t(i,n,e)}},v5=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const b5=new Al("LinkedEditingInputVisible",!1);let C5=m5=class extends E{static get(e){return e.getContribution(m5.ID)}constructor(e,t,i,n,s){super(),this.languageConfigurationService=n,this._syncRangesToken=0,this._localToDispose=this._register(new N),this._editor=e,this._providers=i.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=b5.bindTo(t),this._debounceInformation=s.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 N),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequest=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel((()=>this.reinitialize(!0)))),this._register(this._editor.onDidChangeConfiguration((e=>{(e.hasChanged(69)||e.hasChanged(92))&&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=null!==t&&(this._editor.getOption(69)||this._editor.getOption(92))&&this._providers.has(t);if(i===this._enabled&&!e)return;if(this._enabled=i,this.clearRanges(),this._localToDispose.clear(),!i||null===t)return;this._localToDispose.add(B.runAndSubscribe(t.onDidChangeLanguageConfiguration,(()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()})));const n=new Jh(this._debounceInformation.get(t)),s=()=>{var e;this._rangeUpdateTriggerPromise=n.trigger((()=>this.updateRanges()),null!==(e=this._debounceDuration)&&void 0!==e?e:this._debounceInformation.get(t))},o=new Jh(0),r=e=>{this._rangeSyncTriggerPromise=o.trigger((()=>this._syncRanges(e)))};this._localToDispose.add(this._editor.onDidChangeCursorPosition((()=>{s()}))),this._localToDispose.add(this._editor.onDidChangeModelContent((e=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const t=this._currentDecorations.getRange(0);if(t&&e.changes.every((e=>t.intersectRanges(e.range))))return void r(this._syncRangesToken)}s()}))),this._localToDispose.add({dispose:()=>{n.dispose(),o.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||0===this._currentDecorations.length)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 e=n.match(this._currentWordPattern);if((e?e[0].length:0)!==n.length)return this.clearRanges()}const s=[];for(let o=1,r=this._currentDecorations.length;o1)return void this.clearRanges();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 e=this._currentDecorations.getRange(0);if(e&&e.containsPosition(t))return}}this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=n;const s=Yh((e=>v5(this,void 0,void 0,(function*(){try{const o=new F(!1),r=yield w5(this._providers,i,t,e);if(this._debounceInformation.update(i,o.elapsed()),s!==this._currentRequest)return;if(this._currentRequest=null,n!==i.getVersionId())return;let a=[];(null==r?void 0:r.ranges)&&(a=r.ranges),this._currentWordPattern=(null==r?void 0:r.wordPattern)||this._languageWordPattern;let l=!1;for(let e=0,i=a.length;e({range:e,options:m5.DECORATION})));this._visibleContextKey.set(!0),this._currentDecorations.set(h),this._syncRangesToken++}catch(o){d(o)||r(o),this._currentRequest!==s&&this._currentRequest||this.clearRanges()}}))));return this._currentRequest=s,s}))}};C5.ID="editor.contrib.linkedEditing",C5.DECORATION=Iw.register({description:"linked-editing",stickiness:0,className:"linked-editing-decoration"}),C5=m5=f5([_5(1,Ol),_5(2,oL),_5(3,Ju),_5(4,SE)],C5);function w5(e,t,i,n){return nd(e.ordered(t).map((e=>()=>v5(this,void 0,void 0,(function*(){try{return yield e.provideLinkedEditingRanges(t,i,n)}catch(Mre){return void a(Mre)}})))),(e=>!!e&&Hd(null==e?void 0:e.ranges)))}Sh(new(vh.bindToContribution(C5.get))({id:"cancelLinkedEditingInput",precondition:b5,handler:e=>e.clearRanges(),kbOpts:{kbExpr:Oh.editorTextFocus,weight:199,primary:9,secondary:[1033]}}));Dp("editor.linkedEditingBackground",{dark:lc.fromHex("#f00").transparent(.3),light:lc.fromHex("#f00").transparent(.3),hcDark:lc.fromHex("#f00").transparent(.3),hcLight:lc.white},ue(0,"Background color when the editor auto renames on type."));yh("_executeLinkedEditingProvider",((e,t,i)=>{const{linkedEditingRangeProvider:n}=e.get(oL);return w5(n,t,i,Uh.None)})),Dh(C5.ID,C5,1),Lh(class extends bh{constructor(){super({id:"editor.action.linkedEditing",label:ue(0,"Start Linked Editing"),alias:"Start Linked Editing",precondition:pl.and(Oh.writable,Oh.hasRenameProvider),kbOpts:{kbExpr:Oh.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const i=e.get(Wa),[n,s]=Array.isArray(t)&&t||[void 0,void 0];return an.isUri(n)&&Va.isIPosition(s)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then((e=>{e&&(e.setPosition(s),e.invokeWithinContext((t=>(this.reportTelemetry(t,e),this.run(t,e)))))}),r):super.runCommand(e,t)}run(e,t){const i=C5.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}});var y5=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class S5{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}resolve(e){return y5(this,void 0,void 0,(function*(){return this._link.url?this._link.url:"function"==typeof this._provider.resolveLink?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 L5{constructor(e){this._disposables=new N;let t=[];for(const[i,n]of e){const e=i.links.map((e=>new S5(e,n)));t=L5._union(t,e),L(i)&&this._disposables.add(i)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const i=[];let n,s,o,r;for(n=0,o=0,s=e.length,r=t.length;nPromise.resolve(e.provideLinks(t,i)).then((t=>{t&&(n[s]=[t,e])}),a)));return Promise.all(s).then((()=>{const e=new L5(Bd(n));return i.isCancellationRequested?(e.dispose(),new L5([])):e}))}Xa.registerCommand("_executeLinkProvider",((e,...t)=>y5(void 0,void 0,void 0,(function*(){let[i,n]=t;qr(i instanceof an),"number"!=typeof n&&(n=0);const{linkProvider:s}=e.get(oL),o=e.get(Ha).getModel(i);if(!o)return[];const r=yield k5(s,o,Uh.None);if(!r)return[];for(let e=0;e=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},N5=function(e,t){return function(i,n){t(i,n,e)}},E5=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let I5=D5=class extends E{static get(e){return e.getContribution(D5.ID)}constructor(e,t,i,n,s){super(),this.editor=e,this.openerService=t,this.notificationService=i,this.languageFeaturesService=n,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=s.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new rd((()=>this.computeLinksNow()),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const o=this._register(new RR(e));this._register(o.onMouseMoveOrRelevantKeyDown((([e,t])=>{this._onEditorMouseMove(e,t)}))),this._register(o.onExecute((e=>{this.onEditorMouseUp(e)}))),this._register(o.onCancel((e=>{this.cleanUpActiveLinkDecoration()}))),this._register(e.onDidChangeConfiguration((e=>{e.hasChanged(70)&&(this.updateDecorations([]),this.stop(),this.computeLinks.schedule(0))}))),this._register(e.onDidChangeModelContent((e=>{this.editor.hasModel()&&this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()))}))),this._register(e.onDidChangeModel((e=>{this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.computeLinks.schedule(0)}))),this._register(e.onDidChangeModelLanguage((e=>{this.stop(),this.computeLinks.schedule(0)}))),this._register(this.providers.onDidChange((e=>{this.stop(),this.computeLinks.schedule(0)}))),this.computeLinks.schedule(0)}computeLinksNow(){return E5(this,void 0,void 0,(function*(){if(!this.editor.hasModel()||!this.editor.getOption(70))return;const e=this.editor.getModel();if(!e.isTooLargeForSyncing()&&this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=Yh((t=>k5(this.providers,e,t)));try{const t=new F(!1);if(this.activeLinksList=yield this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){r(t)}finally{this.computePromise=null}}}))}updateDecorations(e){const t="altKey"===this.editor.getOption(77),i=[],n=Object.keys(this.currentOccurrences);for(const o of n){const e=this.currentOccurrences[o];i.push(e.decorationId)}const s=[];if(e)for(const o of e)s.push(T5.decoration(o,t));this.editor.changeDecorations((t=>{const n=t.deltaDecorations(i,s);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let i=0,s=n.length;i{t.activate(e,i),this.activeLinkDecorationId=t.decorationId}))}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e="altKey"===this.editor.getOption(77);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(Uh.None).then((e=>{if("string"==typeof e&&this.editor.hasModel()){const t=this.editor.getModel().uri;if(t.scheme===vn.file&&e.startsWith(`${vn.file}:`)){const i=an.parse(e);if(i.scheme===vn.file){const n=fa(i);let s=null;n.startsWith("/./")?s=`.${n.substr(1)}`:n.startsWith("//./")&&(s=`.${n.substr(2)}`),s&&(e=La(t,s))}}}return this.openerService.open(e,{openToSide:t,fromUserGesture:i,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})}),(e=>{const t=e instanceof Error?e.message:e;"invalid"===t?this.notificationService.warn(ue(0,"Failed to open this link because it is not well-formed: {0}",n.url.toString())):"missing"===t?this.notificationService.warn(ue(0,"Failed to open this link because its target is missing.")):r(e)}))}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 e=this.currentOccurrences[i.id];if(e)return e}return null}isEnabled(e,t){return Boolean(6===e.target.type&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey))}stop(){var e;this.computeLinks.cancel(),this.activeLinksList&&(null===(e=this.activeLinksList)||void 0===e||e.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}};I5.ID="editor.linkDetector",I5=D5=x5([N5(1,qk),N5(2,mL),N5(3,oL),N5(4,SE)],I5);const M5={general:Iw.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:Iw.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class T5{static decoration(e,t){return{range:e.range,options:T5._getOptions(e,t,!1)}}static _getOptions(e,t,i){const n=Object.assign({},i?M5.active:M5.general);return n.hoverMessage=function(e,t){const i=e.url&&/^command:/i.test(e.url.toString()),n=e.tooltip?e.tooltip:ue(0,i?"Execute command":"Follow link"),s=ue(0,t?Pe?"cmd + click":"ctrl + click":Pe?"option + click":"alt + click");if(e.url){let t="";if(/^command:/i.test(e.url.toString())){const i=e.url.toString().match(/^command:([^?#]+)/);if(i){t=ue(0,"Execute command {0}",i[1])}}return new Ta("",!0).appendLink(e.url.toString(!0).replace(/ /g,"%20"),n,t).appendMarkdown(` (${s})`)}return(new Ta).appendText(`${n} (${s})`)}(e,t),n}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,T5._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,T5._getOptions(this.link,t,!1))}}Dh(I5.ID,I5,1),Lh(class extends bh{constructor(){super({id:"editor.action.openLink",label:ue(0,"Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const i=I5.get(t);if(!i)return;if(!t.hasModel())return;const n=t.getSelections();for(const s of n){const e=i.getLinkOccurrence(s.getEndPosition());e&&i.openLinkOccurrence(e,!1)}}});class R5 extends E{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown((e=>{const t=this._editor.getOption(116);t>=0&&6===e.target.type&&e.target.position.column>=t&&this._editor.updateOptions({stopRenderingLineAfter:-1})})))}}R5.ID="editor.contrib.longLinesHelper",Dh(R5.ID,R5,2);const A5=Dp("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},ue(0,"Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0);Dp("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},ue(0,"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),Dp("editor.wordHighlightTextBackground",{light:A5,dark:A5,hcDark:A5,hcLight:A5},ue(0,"Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const O5=Dp("editor.wordHighlightBorder",{light:null,dark:null,hcDark:Tp,hcLight:Tp},ue(0,"Border color of a symbol during read-access, like reading a variable."));Dp("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:Tp,hcLight:Tp},ue(0,"Border color of a symbol during write-access, like writing to a variable.")),Dp("editor.wordHighlightTextBorder",{light:O5,dark:O5,hcDark:O5,hcLight:O5},ue(0,"Border color of a textual occurrence for a symbol."));const P5=Dp("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},ue(0,"Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),F5=Dp("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hcDark:"#C0A0C0CC",hcLight:"#C0A0C0CC"},ue(0,"Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),B5=Dp("editorOverviewRuler.wordHighlightTextForeground",{dark:u_,light:u_,hcDark:u_,hcLight:u_},ue(0,"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),W5=Iw.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:F_(F5),position:Cd.Center},minimap:{color:F_(p_),position:yd.Inline}}),V5=Iw.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:F_(B5),position:Cd.Center},minimap:{color:F_(p_),position:yd.Inline}}),H5=Iw.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:F_(u_),position:Cd.Center},minimap:{color:F_(p_),position:yd.Inline}}),z5=Iw.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),U5=Iw.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:F_(P5),position:Cd.Center},minimap:{color:F_(p_),position:yd.Inline}});function K5(e){return e?z5:H5}H_(((e,t)=>{const i=e.getColor(Hm);i&&t.addRule(`.monaco-editor .selectionHighlight { background-color: ${i.transparent(.5)}; }`)}));var j5,q5=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},$5=function(e,t){return function(i,n){t(i,n,e)}};function G5(e,t){const i=t.filter((t=>!e.find((e=>e.equals(t)))));if(i.length>=1){const e=i.map((e=>`line ${e.viewState.position.lineNumber} column ${e.viewState.position.column}`)).join(", ");Fs(1===i.length?ue(0,"Cursor added: {0}",e):ue(0,"Cursors added: {0}",e))}}class Z5{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class Y5{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new Y5(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let n,s,o=!1;const r=e.getSelections();1===r.length&&r[0].isEmpty()?(o=!0,n=!0,s=!0):(n=i.wholeWord,s=i.matchCase);const a=e.getSelection();let l,h=null;if(a.isEmpty()){const t=e.getConfiguredWordAtPosition(a.getStartPosition());if(!t)return null;l=t.word,h=new Ah(a.startLineNumber,t.startColumn,a.startLineNumber,t.endColumn)}else l=e.getModel().getValueInRange(a).replace(/\r\n/g,"\n");return new Y5(e,t,o,l,n,s,h)}constructor(e,t,i,n,s,o,r){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=n,this.wholeWord=s,this.matchCase=o,this.currentMatch=r}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new Z5(t.concat(e),e,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new Z5(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const e=this.currentMatch;return this.currentMatch=null,e}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(129):null,!1);return i?new Ah(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 Z5(t.concat(e),e,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new Z5(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const e=this.currentMatch;return this.currentMatch=null,e}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(129):null,!1);return i?new Ah(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(129):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1,1073741824)}}class X5 extends E{static get(e){return e.getContribution(X5.ID)}constructor(e){super(),this._sessionDispose=this._register(new N),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=Y5.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=1,i.matchCaseOverride=1,i.isRegexOverride=2),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection((e=>{this._ignoreSelectionChange||this._endSession()}))),this._sessionDispose.add(this._editor.onDidBlurEditorText((()=>{this._endSession()}))),this._sessionDispose.add(e.getState().onFindReplaceStateChange((e=>{(e.matchCase||e.wholeWord)&&this._endSession()})))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};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 Ah(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 i=e.getState().matchCase;if(!t3(this._editor.getModel(),t,i)){const e=this._editor.getModel(),i=[];for(let n=0,s=t.length;n0&&i.isRegex){const e=this._editor.getModel();t=i.searchScope?e.findMatches(i.searchString,i.searchScope,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(129):null,!1,1073741824):e.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(129):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(i.searchScope)}if(t.length>0){const e=this._editor.getSelection();for(let i=0,n=t.length;inew Ah(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn))))}}}X5.ID="editor.contrib.multiCursorController";class Q5 extends bh{run(e,t){const i=X5.get(t);if(!i)return;const n=t._getViewModel();if(n){const s=n.getCursorStates(),o=CQ.get(t);if(o)this._run(i,o);else{const n=e.get(Fa).createInstance(CQ,t);this._run(i,n),n.dispose()}G5(s,n.getCursorStates())}}}class J5{constructor(e,t,i,n,s){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=n,this._modelVersionId=this._model.getVersionId(),this._cachedFindMatches=null,s&&this._model===s._model&&this._searchText===s._searchText&&this._matchCase===s._matchCase&&this._wordSeparators===s._wordSeparators&&this._modelVersionId===s._modelVersionId&&(this._cachedFindMatches=s._cachedFindMatches)}findMatches(){return null===this._cachedFindMatches&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map((e=>e.range)),this._cachedFindMatches.sort(Rh.compareRangesUsingStarts)),this._cachedFindMatches}}let e3=j5=class extends E{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(107),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new rd((()=>this._update()),300)),this.state=null,this._register(e.onDidChangeConfiguration((t=>{this._isEnabled=e.getOption(107)}))),this._register(e.onDidChangeCursorSelection((e=>{this._isEnabled&&(e.selection.isEmpty()?3===e.reason?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())}))),this._register(e.onDidChangeModel((e=>{this._setState(null)}))),this._register(e.onDidChangeModelContent((e=>{this._isEnabled&&this.updateSoon.schedule()})));const i=CQ.get(e);i&&this._register(i.getState().onFindReplaceStateChange((e=>{this._update()}))),this.updateSoon.schedule()}_update(){this._setState(j5._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,i){if(!t)return null;if(!i.hasModel())return null;const n=i.getSelection();if(n.startLineNumber!==n.endLineNumber)return null;const s=X5.get(i);if(!s)return null;const o=CQ.get(i);if(!o)return null;let r=s.getSession(o);if(!r){const e=i.getSelections();if(e.length>1){const t=o.getState().matchCase;if(!t3(i.getModel(),e,t))return null}r=Y5.create(i,o)}if(!r)return null;if(r.currentMatch)return null;if(/^[ \t]+$/.test(r.searchText))return null;if(r.searchText.length>200)return null;const a=o.getState(),l=a.matchCase;if(a.isRevealed){let e=a.searchString;l||(e=e.toLowerCase());let t=r.searchText;if(l||(t=t.toLowerCase()),e===t&&r.matchCase===a.matchCase&&r.wholeWord===a.wholeWord&&!a.isRegex)return null}return new J5(i.getModel(),r.searchText,r.matchCase,r.wholeWord?i.getOption(129):null,e)}_setState(e){if(this.state=e,!this.state)return void this._decorations.clear();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(Rh.compareRangesUsingStarts);const s=[];for(let a=0,l=0,h=i.length,d=n.length;a=d)s.push(e),a++;else{const t=Rh.compareRangesUsingStarts(e,n[l]);t<0?(!n[l].isEmpty()&&Rh.areIntersecting(e,n[l])||s.push(e),a++):(t>0||a++,l++)}}const o=this._languageFeaturesService.documentHighlightProvider.has(t)&&this.editor.getOption(80),r=s.map((e=>({range:e,options:K5(o)})));this._decorations.set(r)}dispose(){this._setState(null),super.dispose()}};function t3(e,t,i){const n=i3(e,t[0],!i);for(let s=1,o=t.length;s1&&i.push(new Ah(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=t.getSelections(),s=t._getViewModel(),o=s.getCursorStates(),r=[];n.forEach((e=>this.getCursorsForSelection(e,i,r))),r.length>0&&t.setSelections(r),G5(o,s.getCursorStates())}}),Lh(class extends Q5{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:ue(0,"Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:Oh.focus,primary:2082,weight:100},menuOpts:{menuId:eh.MenubarSelectionMenu,group:"3_multi",title:ue(0,"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}),Lh(class extends Q5{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:ue(0,"Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:eh.MenubarSelectionMenu,group:"3_multi",title:ue(0,"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}),Lh(class extends Q5{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:ue(0,"Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:Oh.focus,primary:pt(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}),Lh(class extends Q5{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:ue(0,"Move Last Selection To Previous Find Match"),alias:"Move Last Selection To Previous Find Match",precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}}),Lh(class extends Q5{constructor(){super({id:"editor.action.selectHighlights",label:ue(0,"Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:Oh.focus,primary:3114,weight:100},menuOpts:{menuId:eh.MenubarSelectionMenu,group:"3_multi",title:ue(0,"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}),Lh(class extends Q5{constructor(){super({id:"editor.action.changeAll",label:ue(0,"Change All Occurrences"),alias:"Change All Occurrences",precondition:pl.and(Oh.writable,Oh.editorTextFocus),kbOpts:{kbExpr:Oh.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}),Lh(class extends bh{constructor(){super({id:"editor.action.addCursorsToBottom",label:ue(0,"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(),s=[];for(let a=i[0].startLineNumber;a<=n;a++)s.push(new Ah(a,i[0].startColumn,a,i[0].endColumn));const o=t._getViewModel(),r=o.getCursorStates();s.length>0&&t.setSelections(s),G5(r,o.getCursorStates())}}),Lh(class extends bh{constructor(){super({id:"editor.action.addCursorsToTop",label:ue(0,"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 r=i[0].startLineNumber;r>=1;r--)n.push(new Ah(r,i[0].startColumn,r,i[0].endColumn));const s=t._getViewModel(),o=s.getCursorStates();n.length>0&&t.setSelections(n),G5(o,s.getCursorStates())}}),Lh(class extends bh{constructor(){super({id:"editor.action.focusNextCursor",label:ue(0,"Focus Next Cursor"),description:{description:ue(0,"Focuses the next cursor"),args:[]},alias:"Focus Next Cursor",precondition:void 0})}run(e,t,i){if(!t.hasModel())return;const n=t._getViewModel();if(n.cursorConfig.readOnly)return;n.model.pushStackElement();const s=Array.from(n.getCursorStates()),o=s.shift();o&&(s.push(o),n.setCursorStates(i.source,3,s),n.revealPrimaryCursor(i.source,!0),G5(s,n.getCursorStates()))}}),Lh(class extends bh{constructor(){super({id:"editor.action.focusPreviousCursor",label:ue(0,"Focus Previous Cursor"),description:{description:ue(0,"Focuses the previous cursor"),args:[]},alias:"Focus Previous Cursor",precondition:void 0})}run(e,t,i){if(!t.hasModel())return;const n=t._getViewModel();if(n.cursorConfig.readOnly)return;n.model.pushStackElement();const s=Array.from(n.getCursorStates()),o=s.pop();o&&(s.unshift(o),n.setCursorStates(i.source,3,s),n.revealPrimaryCursor(i.source,!0),G5(s,n.getCursorStates()))}});var n3=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const s3={Visible:new Al("parameterHintsVisible",!1),MultipleSignatures:new Al("parameterHintsMultipleSignatures",!1)};function o3(e,t,i,n,s){return n3(this,void 0,void 0,(function*(){const o=e.ordered(t);for(const e of o)try{const o=yield e.provideSignatureHelp(t,i,s,n);if(o)return o}catch(r){a(r)}}))}Xa.registerCommand("_executeSignatureHelpProvider",((e,...t)=>n3(void 0,void 0,void 0,(function*(){const[i,n,s]=t;qr(an.isUri(i)),qr(Va.isIPosition(n)),qr("string"==typeof s||!s);const o=e.get(oL),r=yield e.get(za).createModelReference(i);try{const e=yield o3(o.signatureHelpProvider,r.object.textEditorModel,Va.lift(n),{triggerKind:mC.Invoke,isRetrigger:!1,triggerCharacter:s},Uh.None);if(!e)return;return setTimeout((()=>e.dispose()),0),e.value}finally{r.dispose()}}))));var r3,a3=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};!function(e){e.Default={type:0};e.Pending=class{constructor(e,t){this.request=e,this.previouslyActiveHints=t,this.type=2}};e.Active=class{constructor(e){this.hints=e,this.type=1}}}(r3||(r3={}));class l3 extends E{constructor(e,t,i=l3.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new U),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=r3.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new I),this.triggerChars=new qb,this.retriggerChars=new qb,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new Jh(i),this._register(this.editor.onDidBlurEditorWidget((()=>this.cancel()))),this._register(this.editor.onDidChangeConfiguration((()=>this.onEditorConfigurationChange()))),this._register(this.editor.onDidChangeModel((e=>this.onModelChanged()))),this._register(this.editor.onDidChangeModelLanguage((e=>this.onModelChanged()))),this._register(this.editor.onDidChangeCursorSelection((e=>this.onCursorChange(e)))),this._register(this.editor.onDidChangeModelContent((e=>this.onModelContentChange()))),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType((e=>this.onDidType(e)))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){2===this._state.type&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=r3.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(r)}next(){if(1!==this.state.type)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e==e-1,n=this.editor.getOption(85).cycle;!(e<2||i)||n?this.updateActiveSignature(i&&n?0:t+1):this.cancel()}previous(){if(1!==this.state.type)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=0===t,n=this.editor.getOption(85).cycle;!(e<2||i)||n?this.updateActiveSignature(i&&n?e-1:t-1):this.cancel()}updateActiveSignature(e){1===this.state.type&&(this.state=new r3.Active(Object.assign(Object.assign({},this.state.hints),{activeSignature:e})),this._onChangedHints.fire(this.state.hints))}doTrigger(e){return a3(this,void 0,void 0,(function*(){const t=1===this.state.type||2===this.state.type,i=this.getLastActiveHints();if(this.cancel(!0),0===this._pendingTriggers.length)return!1;const n=this._pendingTriggers.reduce(h3);this._pendingTriggers=[];const s={triggerKind:n.triggerKind,triggerCharacter:n.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const o=this.editor.getModel(),a=this.editor.getPosition();this.state=new r3.Pending(Yh((e=>o3(this.providers,o,a,s,e))),i);try{const t=yield this.state.request;return e!==this.triggerId?(null==t||t.dispose(),!1):t&&t.value.signatures&&0!==t.value.signatures.length?(this.state=new r3.Active(t.value),this._lastSignatureHelpResult.value=t,this._onChangedHints.fire(this.state.hints),!0):(null==t||t.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1)}catch(l){return e===this.triggerId&&(this.state=r3.Default),r(l),!1}}))}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return 1===this.state.type||2===this.state.type||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 e of t.signatureHelpTriggerCharacters||[])if(e.length){const t=e.charCodeAt(0);this.triggerChars.add(t),this.retriggerChars.add(t)}for(const e of t.signatureHelpRetriggerCharacters||[])e.length&&this.retriggerChars.add(e.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:mC.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){"mouse"===e.source?this.cancel():this.isTriggered&&this.trigger({triggerKind:mC.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:mC.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(85).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}function h3(e,t){switch(t.triggerKind){case mC.Invoke:return t;case mC.ContentChange:return e;case mC.TriggerCharacter:default:return t}}l3.DEFAULT_DELAY=120;var d3,c3=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},u3=function(e,t){return function(i,n){t(i,n,e)}};const g3=fs,p3=tR("parameter-hints-next",Jr.chevronDown,ue(0,"Icon for show next parameter hint.")),m3=tR("parameter-hints-previous",Jr.chevronUp,ue(0,"Icon for show previous parameter hint."));let f3=d3=class extends E{constructor(e,t,i,n,s){super(),this.editor=e,this.model=t,this.renderDisposeables=this._register(new N),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new Jk({editor:e},s,n)),this.keyVisible=s3.Visible.bindTo(i),this.keyMultipleSignatures=s3.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=g3(".editor-widget.parameter-hints-widget"),t=ds(e,g3(".phwrapper"));t.tabIndex=-1;const i=ds(t,g3(".controls")),n=ds(i,g3(".button"+ta.asCSSSelector(m3))),s=ds(i,g3(".overloads")),o=ds(i,g3(".button"+ta.asCSSSelector(p3)));this._register(En(n,"click",(e=>{as(e),this.previous()}))),this._register(En(o,"click",(e=>{as(e),this.next()})));const r=g3(".body"),a=new OD(r,{alwaysConsumeMouseWheel:!0});this._register(a),t.appendChild(a.getDomNode());const l=ds(r,g3(".signature")),h=ds(r,g3(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:l,overloads:s,docs:h,scrollbar:a},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection((e=>{this.visible&&this.editor.layoutContentWidget(this)})));const d=()=>{if(!this.domNodes)return;const e=this.editor.getOption(50);this.domNodes.element.style.fontSize=`${e.fontSize}px`,this.domNodes.element.style.lineHeight=""+e.lineHeight/e.fontSize};d(),this._register(B.chain(this.editor.onDidChangeConfiguration.bind(this.editor),(e=>e.filter((e=>e.hasChanged(50)))))(d)),this._register(this.editor.onDidLayoutChange((e=>this.updateMaxHeight()))),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout((()=>{var e;null===(e=this.domNodes)||void 0===e||e.element.classList.add("visible")}),100),this.editor.layoutContentWidget(this))}hide(){var e;this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,null===(e=this.domNodes)||void 0===e||e.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){var t;if(this.renderDisposeables.clear(),!this.domNodes)return;const i=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",i),this.keyMultipleSignatures.set(i),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const n=e.signatures[e.activeSignature];if(!n)return;const s=ds(this.domNodes.signature,g3(".code")),o=this.editor.getOption(50);s.style.fontSize=`${o.fontSize}px`,s.style.fontFamily=o.fontFamily;const r=n.parameters.length>0,a=null!==(t=n.activeParameter)&&void 0!==t?t:e.activeParameter;if(r)this.renderParameters(s,n,a);else{ds(s,g3("span")).textContent=n.label}const l=n.parameters[a];if(null==l?void 0:l.documentation){const e=g3("span.documentation");if("string"==typeof l.documentation)e.textContent=l.documentation;else{const t=this.renderMarkdownDocs(l.documentation);e.appendChild(t.element)}ds(this.domNodes.docs,g3("p",{},e))}if(void 0===n.documentation);else if("string"==typeof n.documentation)ds(this.domNodes.docs,g3("p",{},n.documentation));else{const e=this.renderMarkdownDocs(n.documentation);ds(this.domNodes.docs,e.element)}const h=this.hasDocs(n,l);if(this.domNodes.signature.classList.toggle("has-docs",h),this.domNodes.docs.classList.toggle("empty",!h),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,l){let e="";const t=n.parameters[a];e=Array.isArray(t.label)?n.label.substring(t.label[0],t.label[1]):t.label,t.documentation&&(e+="string"==typeof t.documentation?`, ${t.documentation}`:`, ${t.documentation.value}`),n.documentation&&(e+="string"==typeof n.documentation?`, ${n.documentation}`:`, ${n.documentation.value}`),this.announcedLabel!==e&&(Ps(ue(0,"{0}, hint",e)),this.announcedLabel=e)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var e;null===(e=this.domNodes)||void 0===e||e.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&"string"==typeof t.documentation&&$r(t.documentation).length>0)||(!!(t&&"object"==typeof t.documentation&&$r(t.documentation).value.length>0)||(!!(e.documentation&&"string"==typeof e.documentation&&$r(e.documentation).length>0)||!!(e.documentation&&"object"==typeof e.documentation&&$r(e.documentation.value).length>0)))}renderParameters(e,t,i){const[n,s]=this.getParameterLabelOffsets(t,i),o=document.createElement("span");o.textContent=t.label.substring(0,n);const r=document.createElement("span");r.textContent=t.label.substring(n,s),r.className="parameter active";const a=document.createElement("span");a.textContent=t.label.substring(s),ds(e,o,r,a)}getParameterLabelOffsets(e,t){const i=e.parameters[t];if(i){if(Array.isArray(i.label))return i.label;if(i.label.length){const t=new RegExp(`(\\W|^)${eo(i.label)}(?=\\W|$)`,"g");t.test(e.label);const n=t.lastIndex-i.label.length;return n>=0?[n,t.lastIndex]:[0,0]}return[0,0]}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 d3.ID}updateMaxHeight(){if(!this.domNodes)return;const e=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=e;const t=this.domNodes.element.getElementsByClassName("phwrapper");t.length&&(t[0].style.maxHeight=e)}};f3.ID="editor.widget.parameterHintsWidget",f3=d3=c3([u3(2,Ol),u3(3,qk),u3(4,Lc)],f3),Dp("editorHoverWidget.highlightForeground",{dark:kf,light:kf,hcDark:kf,hcLight:kf},ue(0,"Foreground color of the active item in the parameter hint."));var _3,v3=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},b3=function(e,t){return function(i,n){t(i,n,e)}};let C3=_3=class extends E{static get(e){return e.getContribution(_3.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new l3(e,i.signatureHelpProvider)),this._register(this.model.onChangedHints((e=>{var t;e?(this.widget.value.show(),this.widget.value.render(e)):null===(t=this.widget.rawValue)||void 0===t||t.hide()}))),this.widget=new Zs((()=>this._register(t.createInstance(f3,this.editor,this.model))))}cancel(){this.model.cancel()}previous(){var e;null===(e=this.widget.rawValue)||void 0===e||e.previous()}next(){var e;null===(e=this.widget.rawValue)||void 0===e||e.next()}trigger(e){this.model.trigger(e,0)}};C3.ID="editor.controller.parameterHints",C3=_3=v3([b3(1,Fa),b3(2,oL)],C3);Dh(C3.ID,C3,2),Lh(class extends bh{constructor(){super({id:"editor.action.triggerParameterHints",label:ue(0,"Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:Oh.hasSignatureHelpProvider,kbOpts:{kbExpr:Oh.editorTextFocus,primary:3082,weight:100}})}run(e,t){const i=C3.get(t);null==i||i.trigger({triggerKind:mC.Invoke})}});const w3=vh.bindToContribution(C3.get);function y3(e,t){return t&&(e.stack||e.stacktrace)?ue(0,"{0}: {1}",L3(e),S3(e.stack)||S3(e.stacktrace)):L3(e)}function S3(e){return Array.isArray(e)?e.join("\n"):e}function L3(e){return"ERR_UNC_HOST_NOT_ALLOWED"===e.code?`${e.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:"string"==typeof e.code&&"number"==typeof e.errno&&"string"==typeof e.syscall?ue(0,"A system error occurred ({0})",e.message):e.message||ue(0,"An unknown error occurred. Please consult the log for more details.")}function k3(e=null,t=!1){if(!e)return ue(0,"An unknown error occurred. Please consult the log for more details.");if(Array.isArray(e)){const i=Bd(e),n=k3(i[0],t);return i.length>1?ue(0,"{0} ({1} errors in total)",n,i.length):n}if(Fr(e))return e;if(e.detail){const i=e.detail;if(i.error)return y3(i.error,t);if(i.exception)return y3(i.exception,t)}return e.stack?y3(e,t):e.message?e.message:ue(0,"An unknown error occurred. Please consult the log for more details.")}Sh(new w3({id:"closeParameterHints",precondition:s3.Visible,handler:e=>e.cancel(),kbOpts:{weight:175,kbExpr:Oh.focus,primary:9,secondary:[1033]}})),Sh(new w3({id:"showPrevParameterHint",precondition:pl.and(s3.Visible,s3.MultipleSignatures),handler:e=>e.previous(),kbOpts:{weight:175,kbExpr:Oh.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}})),Sh(new w3({id:"showNextParameterHint",precondition:pl.and(s3.Visible,s3.MultipleSignatures),handler:e=>e.next(),kbOpts:{weight:175,kbExpr:Oh.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));class D3{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),n=new Map,s=[];for(const[o,r]of this.documents){if(t.isCancellationRequested)return[];for(const e of r.chunks){const t=this.computeSimilarityScore(e,i,n);t>0&&s.push({key:o,score:t})}}return s}static termFrequencies(e){return function(e){var t;const i=new Map;for(const n of e)i.set(n,(null!==(t=i.get(n))&&void 0!==t?t:0)+1);return i}(D3.splitTerms(e))}static*splitTerms(e){const t=e=>e.toLowerCase();for(const[i]of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)){yield t(i);const e=i.split(/(?<=[a-z])(?=[A-Z])/g);if(e.length>1)for(const i of e)i.length>2&&/\p{Letter}{3,}/gu.test(i)&&(yield t(i))}}updateDocuments(e){var t;for(const{key:i}of e)this.deleteDocument(i);for(const i of e){const e=[];for(const n of i.textChunks){const i=D3.termFrequencies(n);for(const e of i.keys())this.chunkOccurrences.set(e,(null!==(t=this.chunkOccurrences.get(e))&&void 0!==t?t:0)+1);e.push({text:n,tf:i})}this.chunkCount+=e.length,this.documents.set(i.key,{chunks:e})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const e of t.chunks)for(const t of e.tf.keys()){const e=this.chunkOccurrences.get(t);if("number"==typeof e){const i=e-1;i<=0?this.chunkOccurrences.delete(t):this.chunkOccurrences.set(t,i)}}}}computeSimilarityScore(e,t,i){let n=0;for(const[s,o]of Object.entries(t)){const t=e.tf.get(s);if(!t)continue;let r=i.get(s);"number"!=typeof r&&(r=this.computeIdf(s),i.set(s,r));n+=t*r*o}return n}computeEmbedding(e){const t=D3.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){var t;const i=null!==(t=this.chunkOccurrences.get(e))&&void 0!==t?t:0;return i>0?Math.log((this.chunkCount+1)/i):0}computeTfidf(e){const t=Object.create(null);for(const[i,n]of e){const e=this.computeIdf(i);e>0&&(t[i]=n*e)}return t}}const x3=Ba("dialogService");var N3,E3=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function I3(e){const t=e;return Array.isArray(t.items)}function M3(e){const t=e;return!!t.picks&&t.additionalPicks instanceof Promise}!function(e){e[e.NO_ACTION=0]="NO_ACTION",e[e.CLOSE_PICKER=1]="CLOSE_PICKER",e[e.REFRESH_PICKER=2]="REFRESH_PICKER",e[e.REMOVE_ITEM=3]="REMOVE_ITEM"}(N3||(N3={}));class T3 extends E{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var n;const s=new N;let o;e.canAcceptInBackground=!!(null===(n=this.options)||void 0===n?void 0:n.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const r=s.add(new I),a=()=>E3(this,void 0,void 0,(function*(){const n=r.value=new N;null==o||o.dispose(!0),e.busy=!1,o=new jh(t);const s=o.token,a=e.value.substr(this.prefix.length).trim(),l=this._getPicks(a,n,s,i),h=(t,i)=>{var n;let s,o;if(I3(t)?(s=t.items,o=t.active):s=t,0===s.length){if(i)return!1;(a.length>0||e.hideInput)&&(null===(n=this.options)||void 0===n?void 0:n.noResultsPick)&&(s=Gr(this.options.noResultsPick)?[this.options.noResultsPick(a)]:[this.options.noResultsPick])}return e.items=s,o&&(e.activeItems=[o]),!0},d=t=>E3(this,void 0,void 0,(function*(){let i=!1,n=!1;yield Promise.all([(()=>E3(this,void 0,void 0,(function*(){"number"==typeof t.mergeDelay&&(yield td(t.mergeDelay),s.isCancellationRequested)||n||(i=h(t.picks,!0))})))(),(()=>E3(this,void 0,void 0,(function*(){e.busy=!0;try{const n=yield t.additionalPicks;if(s.isCancellationRequested)return;let o,r,a,l;if(I3(t.picks)?(o=t.picks.items,r=t.picks.active):o=t.picks,I3(n)?(a=n.items,l=n.active):a=n,a.length>0||!i){let t;if(!r&&!l){const i=e.activeItems[0];i&&-1!==o.indexOf(i)&&(t=i)}h({items:[...o,...a],active:r||l||t})}}finally{s.isCancellationRequested||(e.busy=!1),n=!0}})))()])}));if(null===l);else if(M3(l))yield d(l);else if(l instanceof Promise){e.busy=!0;try{const e=yield l;if(s.isCancellationRequested)return;M3(e)?yield d(e):h(e)}finally{s.isCancellationRequested||(e.busy=!1)}}else h(l)}));return s.add(e.onDidChangeValue((()=>a()))),a(),s.add(e.onDidAccept((t=>{const[i]=e.selectedItems;"function"==typeof(null==i?void 0:i.accept)&&(t.inBackground||e.hide(),i.accept(e.keyMods,t))}))),s.add(e.onDidTriggerItemButton((({button:i,item:n})=>E3(this,void 0,void 0,(function*(){var s,o;if("function"==typeof n.trigger){const r=null!==(o=null===(s=n.buttons)||void 0===s?void 0:s.indexOf(i))&&void 0!==o?o:-1;if(r>=0){const i=n.trigger(r,e.keyMods),s="number"==typeof i?i:yield i;if(t.isCancellationRequested)return;switch(s){case N3.NO_ACTION:break;case N3.CLOSE_PICKER:e.hide();break;case N3.REFRESH_PICKER:a();break;case N3.REMOVE_ITEM:{const t=e.items.indexOf(n);if(-1!==t){const i=e.items.slice(),n=i.splice(t,1),s=e.activeItems.filter((e=>e!==n[0])),o=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=i,s&&(e.activeItems=s),e.keepScrollPosition=o}break}}}}}))))),s}}var R3,A3,O3=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},P3=function(e,t){return function(i,n){t(i,n,e)}},F3=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let B3=R3=class extends T3{constructor(e,t,i,n,s,o){super(R3.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=n,this.telemetryService=s,this.dialogService=o,this.commandsHistory=this._register(this.instantiationService.createInstance(W3)),this.options=e}_getPicks(e,t,i,n){var s,o,r,a;return F3(this,void 0,void 0,(function*(){const t=yield this.getCommandPicks(i);if(i.isCancellationRequested)return[];const l=_((()=>{const n=new D3;n.updateDocuments(t.map((e=>({key:e.commandId,textChunks:[e.label+(e.commandAlias?` ${e.commandAlias}`:"")]}))));return function(e){var t,i;const n=e.slice(0);n.sort(((e,t)=>t.score-e.score));const s=null!==(i=null===(t=n[0])||void 0===t?void 0:t.score)&&void 0!==i?i:0;if(s>0)for(const o of n)o.score/=s;return n}(n.calculateScores(e,i)).filter((e=>e.score>R3.TFIDF_THRESHOLD)).slice(0,R3.TFIDF_MAX_RESULTS)})),h=[];for(const n of t){const t=null!==(s=R3.WORD_FILTER(e,n.label))&&void 0!==s?s:void 0,r=n.commandAlias&&null!==(o=R3.WORD_FILTER(e,n.commandAlias))&&void 0!==o?o:void 0;if(t||r)n.highlights={label:t,detail:this.options.showAlias?r:void 0},h.push(n);else if(e===n.commandId)h.push(n);else if(e.length>=3){const e=l();if(i.isCancellationRequested)return[];const t=e.find((e=>e.key===n.commandId));t&&(n.tfIdfScore=t.score,h.push(n))}}const d=new Map;for(const e of h){const t=d.get(e.label);t?(e.description=e.commandId,t.description=t.commandId):d.set(e.label,e)}h.sort(((e,t)=>{if(e.tfIdfScore&&t.tfIdfScore)return e.tfIdfScore===t.tfIdfScore?e.label.localeCompare(t.label):t.tfIdfScore-e.tfIdfScore;if(e.tfIdfScore)return 1;if(t.tfIdfScore)return-1;const i=this.commandsHistory.peek(e.commandId),n=this.commandsHistory.peek(t.commandId);if(i&&n)return i>n?-1:1;if(i)return-1;if(n)return 1;if(this.options.suggestedCommandIds){const i=this.options.suggestedCommandIds.has(e.commandId),n=this.options.suggestedCommandIds.has(t.commandId);if(i&&n)return 0;if(i)return-1;if(n)return 1}return e.label.localeCompare(t.label)}));const c=[];let u=!1,g=!0,p=!!this.options.suggestedCommandIds;for(let e=0;eF3(this,void 0,void 0,(function*(){var s;const o=yield this.getAdditionalCommandPicks(t,h,e,i);if(i.isCancellationRequested)return[];const r=o.map((e=>this.toCommandPick(e,n)));return g&&"separator"!==(null===(s=r[0])||void 0===s?void 0:s.type)&&r.unshift({type:"separator",label:ue(0,"similar commands")}),r})))()}:c}))}toCommandPick(e,t){if("separator"===e.type)return e;const i=this.keybindingService.lookupKeybinding(e.commandId),n=i?ue(0,"{0}, {1}",e.label,i.getAriaLabel()):e.label;return Object.assign(Object.assign({},e),{ariaLabel:n,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:()=>F3(this,void 0,void 0,(function*(){var i,n;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:null!==(i=null==t?void 0:t.from)&&void 0!==i?i:"quick open"});try{(null===(n=e.args)||void 0===n?void 0:n.length)?yield this.commandService.executeCommand(e.commandId,...e.args):yield this.commandService.executeCommand(e.commandId)}catch(s){d(s)||this.dialogService.error(ue(0,"Command '{0}' resulted in an error",e.label),k3(s))}}))})}};B3.PREFIX=">",B3.TFIDF_THRESHOLD=.5,B3.TFIDF_MAX_RESULTS=5,B3.WORD_FILTER=qo($o,(function(e,t,i=!1){if(!t||0===t.length)return null;let n=null,s=0;for(e=e.toLowerCase(),t=t.toLowerCase();sthis.updateConfiguration(e))))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=A3.getConfiguredCommandHistoryLength(this.configurationService),A3.cache&&A3.cache.limit!==this.configuredCommandsHistoryLength&&(A3.cache.limit=this.configuredCommandsHistoryLength,A3.saveState(this.storageService)))}load(){const e=this.storageService.get(A3.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch(n){}const i=A3.cache=new js(this.configuredCommandsHistoryLength,1);if(t){let e;e=t.usesLRU?t.entries:t.entries.sort(((e,t)=>e.value-t.value)),e.forEach((e=>i.set(e.key,e.value)))}A3.counter=this.storageService.getNumber(A3.PREF_KEY_COUNTER,0,A3.counter)}push(e){A3.cache&&(A3.cache.set(e,A3.counter++),A3.saveState(this.storageService))}peek(e){var t;return null===(t=A3.cache)||void 0===t?void 0:t.peek(e)}static saveState(e){if(!A3.cache)return;const t={usesLRU:!0,entries:[]};A3.cache.forEach(((e,i)=>t.entries.push({key:i,value:e}))),e.store(A3.PREF_KEY_CACHE,JSON.stringify(t),0,0),e.store(A3.PREF_KEY_COUNTER,A3.counter,0,0)}static getConfiguredCommandHistoryLength(e){var t,i;const n=null===(i=null===(t=e.getValue().workbench)||void 0===t?void 0:t.commandPalette)||void 0===i?void 0:i.history;return"number"==typeof n?n:A3.DEFAULT_COMMANDS_HISTORY_LENGTH}};W3.DEFAULT_COMMANDS_HISTORY_LENGTH=50,W3.PREF_KEY_CACHE="commandPalette.mru.cache",W3.PREF_KEY_COUNTER="commandPalette.mru.counter",W3.counter=1,W3=A3=O3([P3(0,ZN),P3(1,pu)],W3);class V3 extends B3{constructor(e,t,i,n,s,o){super(e,t,i,n,s,o)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const i of e.getSupportedActions())t.push({commandId:i.id,commandAlias:i.alias,label:aa(i.label)||i.id});return t}}var H3=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},z3=function(e,t){return function(i,n){t(i,n,e)}},U3=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let K3=class extends V3{get activeTextEditorControl(){var e;return null!==(e=this.codeEditorService.getFocusedCodeEditor())&&void 0!==e?e:void 0}constructor(e,t,i,n,s,o){super({showAlias:!1},e,i,n,s,o),this.codeEditorService=t}getCommandPicks(){return U3(this,void 0,void 0,(function*(){return this.getCodeEditorCommandPicks()}))}hasAdditionalCommandPicks(){return!1}getAdditionalCommandPicks(){return U3(this,void 0,void 0,(function*(){return[]}))}};K3=H3([z3(0,Fa),z3(1,Wa),z3(2,WL),z3(3,Ya),z3(4,lh),z3(5,x3)],K3);class j3 extends bh{constructor(){super({id:j3.ID,label:OJ.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:Oh.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(cE).quickAccess.show(K3.PREFIX)}}j3.ID="editor.action.quickCommand",Lh(j3),jl.as(MJ).registerQuickAccessProvider({ctor:K3,prefix:K3.PREFIX,helpEntries:[{description:OJ.quickCommandHelp,commandId:j3.ID}]});var q3,$3=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},G3=function(e,t){return function(i,n){t(i,n,e)}};let Z3=q3=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=jl.as(MJ)}provide(e){const t=new N;return t.add(e.onDidAccept((()=>{const[t]=e.selectedItems;t&&this.quickInputService.quickAccess.show(t.prefix,{preserveValue:!0})}))),t.add(e.onDidChangeValue((e=>{const t=this.registry.getQuickAccessProvider(e.substr(q3.PREFIX.length));t&&t.prefix&&t.prefix!==q3.PREFIX&&this.quickInputService.quickAccess.show(t.prefix,{preserveValue:!0})}))),e.items=this.getQuickAccessProviders().filter((e=>e.prefix!==q3.PREFIX)),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort(((e,t)=>e.prefix.localeCompare(t.prefix))).flatMap((e=>this.createPicks(e)))}createPicks(e){return e.helpEntries.map((t=>{const i=t.prefix||e.prefix,n=i||"\u2026";return{prefix:i,label:n,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:ue(0,"{0}, {1}",n,t.description),description:t.description}}))}};Z3.PREFIX="?",Z3=q3=$3([G3(0,cE),G3(1,WL)],Z3),jl.as(MJ).registerQuickAccessProvider({ctor:Z3,prefix:"",helpEntries:[{description:AJ.helpQuickAccessActionLabel}]});const Y3=[void 0,[]];function X3(e,t,i=0,n=0){const s=t;return s.values&&s.values.length>1?function(e,t,i,n){let s=0;const o=[];for(const r of t){const[t,a]=Q3(e,r,i,n);if("number"!=typeof t)return Y3;s+=t,o.push(...a)}return[s,J3(o)]}(e,s.values,i,n):Q3(e,t,i,n)}function Q3(e,t,i,n){const s=Rr(t.original,t.originalLowercase,i,e,e.toLowerCase(),n,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return s?[s[0],_r(s)]:Y3}Object.freeze({score:0});function J3(e){const t=e.sort(((e,t)=>e.start-t.start)),i=[];let n;for(const s of t)n&&e6(n,s)?(n.start=Math.min(n.start,s.start),n.end=Math.max(n.end,s.end)):(n=s,i.push(s));return i}function e6(e,t){return!(e.end=0,r=t6(e);let a;const l=e.split(i6);if(l.length>1)for(const h of l){const e=t6(h),{pathNormalized:t,normalized:i,normalizedLowercase:n}=s6(h);i&&(a||(a=[]),a.push({original:h,originalLowercase:h.toLowerCase(),pathNormalized:t,normalized:i,normalizedLowercase:n,expectContiguousMatch:e}))}return{original:e,originalLowercase:t,pathNormalized:i,normalized:n,normalizedLowercase:s,values:a,containsPathSeparator:o,expectContiguousMatch:r}}function s6(e){let t;t=Oe?e.replace(/\//g,Ji):e.replace(/\\/g,Ji);const i=(n=t,n.replace(/\*/g,"")).replace(/\s|"/g,"");var n;return{pathNormalized:t,normalized:i,normalizedLowercase:i.toLowerCase()}}function o6(e){return Array.isArray(e)?n6(e.map((e=>e.original)).join(i6)):n6(e.original)}var r6,a6=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},l6=function(e,t){return function(i,n){t(i,n,e)}},h6=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let d6=r6=class extends NJ{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,ue(0,"To go to a symbol, first open a text editor with symbol information.")),E.None}provideWithTextEditor(e,t,i){const n=e.editor,s=this.getModel(n);return s?this._languageFeaturesService.documentSymbolProvider.has(s)?this.doProvideWithEditorSymbols(e,s,t,i):this.doProvideWithoutEditorSymbols(e,s,t,i):E.None}doProvideWithoutEditorSymbols(e,t,i,n){const s=new N;return this.provideLabelPick(i,ue(0,"The active text editor does not provide symbol information.")),(()=>{h6(this,void 0,void 0,(function*(){(yield this.waitForLanguageSymbolRegistry(t,s))&&!n.isCancellationRequested&&s.add(this.doProvideWithEditorSymbols(e,t,i,n))}))})(),s}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}waitForLanguageSymbolRegistry(e,t){return h6(this,void 0,void 0,(function*(){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new hd,n=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange((()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(n.dispose(),i.complete(!0))})));return t.add(x((()=>i.complete(!1)))),i.p}))}doProvideWithEditorSymbols(e,t,i,n){var s;const o=e.editor,r=new N;r.add(i.onDidAccept((t=>{const[n]=i.selectedItems;n&&n.range&&(this.gotoLocation(e,{range:n.range.selection,keyMods:i.keyMods,preserveFocus:t.inBackground}),t.inBackground||i.hide())}))),r.add(i.onDidTriggerItemButton((({item:t})=>{t&&t.range&&(this.gotoLocation(e,{range:t.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())})));const a=this.getDocumentSymbols(t,n);let l;const h=e=>h6(this,void 0,void 0,(function*(){null==l||l.dispose(!0),i.busy=!1,l=new jh(n),i.busy=!0;try{const t=n6(i.value.substr(r6.PREFIX.length).trim()),s=yield this.doGetSymbolPicks(a,t,void 0,l.token);if(n.isCancellationRequested)return;if(s.length>0){if(i.items=s,e&&0===t.original.length){const t=pc(s,(t=>Boolean("separator"!==t.type&&t.range&&Rh.containsPosition(t.range.decoration,e))));t&&(i.activeItems=[t])}}else t.original.length>0?this.provideLabelPick(i,ue(0,"No matching editor symbols")):this.provideLabelPick(i,ue(0,"No editor symbols"))}finally{n.isCancellationRequested||(i.busy=!1)}}));return r.add(i.onDidChangeValue((()=>h(void 0)))),h(null===(s=o.getSelection())||void 0===s?void 0:s.getPosition()),r.add(i.onDidChangeActive((()=>{const[e]=i.activeItems;e&&e.range&&(o.revealRangeInCenter(e.range.selection,0),this.addDecorations(o,e.range.decoration))}))),r}doGetSymbolPicks(e,t,i,n){var s,o;return h6(this,void 0,void 0,(function*(){const r=yield e;if(n.isCancellationRequested)return[];const a=0===t.original.indexOf(r6.SCOPE_PREFIX),l=a?1:0;let h,d,c;t.values&&t.values.length>1?(h=o6(t.values[0]),d=o6(t.values.slice(1))):h=t;const u=null===(o=null===(s=this.options)||void 0===s?void 0:s.openSideBySideDirection)||void 0===o?void 0:o.call(s);u&&(c=[{iconClass:"right"===u?ta.asClassName(Jr.splitHorizontal):ta.asClassName(Jr.splitVertical),tooltip:ue(0,"right"===u?"Open to the Side":"Open to the Bottom")}]);const g=[];for(let v=0;vl){let E=!1;if(h!==t&&([S,L]=X3(w,Object.assign(Object.assign({},t),{values:void 0}),l,y),"number"==typeof S&&(E=!0)),"number"!=typeof S&&([S,L]=X3(w,h,l,y),"number"!=typeof S))continue;if(!E&&d){if(x&&d.original.length>0&&([k,D]=X3(x,d)),"number"!=typeof k)continue;"number"==typeof S&&(S+=k)}}const N=b.tags&&b.tags.indexOf(1)>=0;g.push({index:v,kind:b.kind,score:S,label:w,ariaLabel:(p=b.name,m=b.kind,ue(0,"{0} ({1})",p,SC[m])),description:x,highlights:N?void 0:{label:L,description:D},range:{selection:Rh.collapseToStart(b.selectionRange),decoration:b.range},strikethrough:N,buttons:c})}var p,m;const f=g.sort(((e,t)=>a?this.compareByKindAndScore(e,t):this.compareByScore(e,t)));let _=[];if(a){let I,M,T=0;function R(){M&&"number"==typeof I&&T>0&&(M.label=Qs(u6[I]||c6,T))}for(const A of f)I!==A.kind?(R(),I=A.kind,T=1,M={type:"separator"},_.push(M)):T++,_.push(A);R()}else f.length>0&&(_=[{label:ue(0,"symbols ({0})",g.length),type:"separator"},...f]);return _}))}compareByScore(e,t){if("number"!=typeof e.score&&"number"==typeof t.score)return 1;if("number"==typeof e.score&&"number"!=typeof t.score)return-1;if("number"==typeof e.score&&"number"==typeof t.score){if(e.score>t.score)return-1;if(e.scoret.index?1:0}compareByKindAndScore(e,t){const i=u6[e.kind]||c6,n=u6[t.kind]||c6,s=i.localeCompare(n);return 0===s?this.compareByScore(e,t):s}getDocumentSymbols(e,t){return h6(this,void 0,void 0,(function*(){const i=yield this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}))}};d6.PREFIX="@",d6.SCOPE_PREFIX=":",d6.PREFIX_BY_CATEGORY=`${r6.PREFIX}${r6.SCOPE_PREFIX}`,d6=r6=a6([l6(0,oL),l6(1,kZ)],d6);const c6=ue(0,"properties ({0})"),u6={5:ue(0,"methods ({0})"),11:ue(0,"functions ({0})"),8:ue(0,"constructors ({0})"),12:ue(0,"variables ({0})"),4:ue(0,"classes ({0})"),22:ue(0,"structs ({0})"),23:ue(0,"events ({0})"),24:ue(0,"operators ({0})"),10:ue(0,"interfaces ({0})"),2:ue(0,"namespaces ({0})"),3:ue(0,"packages ({0})"),25:ue(0,"type parameters ({0})"),1:ue(0,"modules ({0})"),6:ue(0,"properties ({0})"),9:ue(0,"enumerations ({0})"),21:ue(0,"enumeration members ({0})"),14:ue(0,"strings ({0})"),0:ue(0,"files ({0})"),17:ue(0,"arrays ({0})"),15:ue(0,"numbers ({0})"),16:ue(0,"booleans ({0})"),18:ue(0,"objects ({0})"),19:ue(0,"keys ({0})"),7:ue(0,"fields ({0})"),13:ue(0,"constants ({0})")};var g6=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},p6=function(e,t){return function(i,n){t(i,n,e)}};let m6=class extends d6{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=B.None}get activeTextEditorControl(){var e;return null!==(e=this.editorService.getFocusedCodeEditor())&&void 0!==e?e:void 0}};m6=g6([p6(0,Wa),p6(1,oL),p6(2,kZ)],m6);class f6 extends bh{constructor(){super({id:f6.ID,label:PJ.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:Oh.hasDocumentSymbolProvider,kbOpts:{kbExpr:Oh.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(cE).quickAccess.show(d6.PREFIX,{itemActivation:dE.NONE})}}f6.ID="editor.action.quickOutline",Lh(f6),jl.as(MJ).registerQuickAccessProvider({ctor:m6,prefix:d6.PREFIX,helpEntries:[{description:PJ.quickOutlineActionLabel,prefix:d6.PREFIX,commandId:f6.ID},{description:PJ.quickOutlineByCategoryActionLabel,prefix:d6.PREFIX_BY_CATEGORY}]});class _6 extends E{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit((()=>this._onDidAttemptReadOnlyEdit())))}_onDidAttemptReadOnlyEdit(){const e=oD.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(91);t||(t=this.editor.isSimpleWidget?new Ta(ue(0,"Cannot edit in read-only input")):new Ta(ue(0,"Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}}_6.ID="editor.contrib.readOnlyMessageController",Dh(_6.ID,_6,2);var v6=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},b6=function(e,t){return function(i,n){t(i,n,e)}};let C6=class extends CU{constructor(e,t,i,n,s,o,r){super(!0,e,t,i,n,s,o,r)}};C6=v6([b6(1,Ol),b6(2,Wa),b6(3,mL),b6(4,Fa),b6(5,ZN),b6(6,pu)],C6),Dh(CU.ID,C6,4);var w6=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},y6=function(e,t){return function(i,n){t(i,n,e)}};const S6=new Al("renameInputVisible",!1,ue(0,"Whether the rename input widget is visible"));let L6=class{constructor(e,t,i,n,s){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=n,this._disposables=new N,this.allowEditorOverflow=!0,this._visibleContextKey=S6.bindTo(s),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(50)&&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._input=document.createElement("input"),this._input.className="rename-input",this._input.type="text",this._input.setAttribute("aria-label",ue(0,"Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._input),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){var t,i,n,s;if(!this._input||!this._domNode)return;const o=e.getColor(Ap),r=e.getColor(Op);this._domNode.style.backgroundColor=String(null!==(t=e.getColor(km))&&void 0!==t?t:""),this._domNode.style.boxShadow=o?` 0 0 8px 2px ${o}`:"",this._domNode.style.border=r?`1px solid ${r}`:"",this._domNode.style.color=String(null!==(i=e.getColor(Fp))&&void 0!==i?i:""),this._input.style.backgroundColor=String(null!==(n=e.getColor(Pp))&&void 0!==n?n:"");const a=e.getColor(Bp);this._input.style.borderWidth=a?"1px":"0px",this._input.style.borderStyle=a?"solid":"none",this._input.style.borderColor=null!==(s=null==a?void 0:a.toString())&&void 0!==s?s:"none"}_updateFont(){if(!this._input||!this._label)return;const e=this._editor.getOption(50);this._input.style.fontFamily=e.fontFamily,this._input.style.fontWeight=e.fontWeight,this._input.style.fontSize=`${e.fontSize}px`,this._label.style.fontSize=.8*e.fontSize+"px"}getPosition(){return this._visible?{position:this._position,preference:[2,1]}:null}beforeRender(){var e,t;const[i,n]=this._acceptKeybindings;return this._label.innerText=ue(0,"{0} to Rename, {1} to Preview",null===(e=this._keybindingService.lookupKeybinding(i))||void 0===e?void 0:e.getLabel(),null===(t=this._keybindingService.lookupKeybinding(n))||void 0===t?void 0:t.getLabel()),null}afterRender(e){e||this.cancelInput(!0)}acceptInput(e){var t;null===(t=this._currentAcceptInput)||void 0===t||t.call(this,e)}cancelInput(e){var t;null===(t=this._currentCancelInput)||void 0===t||t.call(this,e)}getInput(e,t,i,n,s,o){this._domNode.classList.toggle("preview",s),this._position=new Va(e.startLineNumber,e.startColumn),this._input.value=t,this._input.setAttribute("selectionStart",i.toString()),this._input.setAttribute("selectionEnd",n.toString()),this._input.size=Math.max(1.1*(e.endColumn-e.startColumn),20);const r=new N;return new Promise((e=>{this._currentCancelInput=t=>(this._currentAcceptInput=void 0,this._currentCancelInput=void 0,e(t),!0),this._currentAcceptInput=i=>{0!==this._input.value.trim().length&&this._input.value!==t?(this._currentAcceptInput=void 0,this._currentCancelInput=void 0,e({newName:this._input.value,wantsPreview:s&&i})):this.cancelInput(!0)},r.add(o.onCancellationRequested((()=>this.cancelInput(!0)))),r.add(this._editor.onDidBlurEditorWidget((()=>{var e;return this.cancelInput(!(null===(e=this._domNode)||void 0===e?void 0:e.ownerDocument.hasFocus()))}))),this._show()})).finally((()=>{r.dispose(),this._hide()}))}_show(){this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout((()=>{this._input.focus(),this._input.setSelectionRange(parseInt(this._input.getAttribute("selectionStart")),parseInt(this._input.getAttribute("selectionEnd")))}),100)}_hide(){this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}};L6=w6([y6(2,P_),y6(3,WL),y6(4,Ol)],L6);var k6,D6=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},x6=function(e,t){return function(i,n){t(i,n,e)}},N6=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class E6{constructor(e,t,i){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=i.ordered(e)}hasProvider(){return this._providers.length>0}resolveRenameLocation(e){return N6(this,void 0,void 0,(function*(){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx0?t.join("\n"):void 0}:{range:Rh.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join("\n"):void 0}}))}provideRenameEdits(e,t){return N6(this,void 0,void 0,(function*(){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}))}_provideRenameEdits(e,t,i,n){return N6(this,void 0,void 0,(function*(){const s=this._providers[t];if(!s)return{edits:[],rejectReason:i.join("\n")};const o=yield s.provideRenameEdits(this.model,this.position,e,n);return o?o.rejectReason?this._provideRenameEdits(e,t+1,i.concat(o.rejectReason),n):o:this._provideRenameEdits(e,t+1,i.concat(ue(0,"No result.")),n)}))}}let I6=k6=class{static get(e){return e.getContribution(k6.ID)}constructor(e,t,i,n,s,o,r,a){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=s,this._logService=o,this._configService=r,this._languageFeaturesService=a,this._disposableStore=new N,this._cts=new jh,this._renameInputField=this._disposableStore.add(this._instaService.createInstance(L6,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}run(){var e,t;return N6(this,void 0,void 0,(function*(){if(this._cts.dispose(!0),this._cts=new jh,!this.editor.hasModel())return;const i=this.editor.getPosition(),n=new E6(this.editor.getModel(),i,this._languageFeaturesService.renameProvider);if(!n.hasProvider())return;const s=new dL(this.editor,5,void 0,this._cts.token);let o;try{const e=n.resolveRenameLocation(s.token);this._progressService.showWhile(e,250),o=yield e}catch(Mre){return void(null===(e=oD.get(this.editor))||void 0===e||e.showMessage(Mre||ue(0,"An unknown error occurred while resolving rename location"),i))}finally{s.dispose()}if(!o)return;if(o.rejectReason)return void(null===(t=oD.get(this.editor))||void 0===t||t.showMessage(o.rejectReason,i));if(s.token.isCancellationRequested)return;const r=new dL(this.editor,5,o.range,this._cts.token),a=this.editor.getSelection();let l=0,h=o.text.length;Rh.isEmpty(a)||Rh.spansMultipleLines(a)||!Rh.containsRange(o.range,a)||(l=Math.max(0,a.startColumn-o.range.startColumn),h=Math.min(o.range.endColumn,a.endColumn)-o.range.startColumn);const d=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),c=yield this._renameInputField.getInput(o.range,o.text,l,h,d,r.token);if("boolean"==typeof c)return c&&this.editor.focus(),void r.dispose();this.editor.focus();const u=Xh(n.provideRenameEdits(c.newName,r.token),r.token).then((e=>N6(this,void 0,void 0,(function*(){e&&this.editor.hasModel()&&(e.rejectReason?this._notificationService.info(e.rejectReason):(this.editor.setSelection(Rh.fromPositions(this.editor.getSelection().getPosition())),this._bulkEditService.apply(e,{editor:this.editor,showPreview:c.wantsPreview,label:ue(0,"Renaming '{0}' to '{1}'",null==o?void 0:o.text,c.newName),code:"undoredo.rename",quotableLabel:ue(0,"Renaming {0} to {1}",null==o?void 0:o.text,c.newName),respectAutoSaveConfig:!0}).then((e=>{e.ariaSummary&&Ps(ue(0,"Successfully renamed '{0}' to '{1}'. Summary: {2}",o.text,c.newName,e.ariaSummary))})).catch((e=>{this._notificationService.error(ue(0,"Rename failed to apply edits")),this._logService.error(e)}))))}))),(e=>{this._notificationService.error(ue(0,"Rename failed to compute edits")),this._logService.error(e)})).finally((()=>{r.dispose()}));return this._progressService.showWhile(u,250),u}))}acceptRenameInput(e){this._renameInputField.acceptInput(e)}cancelRenameInput(){this._renameInputField.cancelInput(!0)}};I6.ID="editor.contrib.renameController",I6=k6=D6([x6(1,Fa),x6(2,mL),x6(3,tL),x6(4,vL),x6(5,hh),x6(6,pT),x6(7,oL)],I6);Dh(I6.ID,I6,4),Lh(class extends bh{constructor(){super({id:"editor.action.rename",label:ue(0,"Rename Symbol"),alias:"Rename Symbol",precondition:pl.and(Oh.writable,Oh.hasRenameProvider),kbOpts:{kbExpr:Oh.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(Wa),[n,s]=Array.isArray(t)&&t||[void 0,void 0];return an.isUri(n)&&Va.isIPosition(s)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then((e=>{e&&(e.setPosition(s),e.invokeWithinContext((t=>(this.reportTelemetry(t,e),this.run(t,e)))))}),r):super.runCommand(e,t)}run(e,t){const i=I6.get(t);return i?i.run():Promise.resolve()}});const M6=vh.bindToContribution(I6.get);Sh(new M6({id:"acceptRenameInput",precondition:S6,handler:e=>e.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:pl.and(Oh.focus,pl.not("isComposing")),primary:3}})),Sh(new M6({id:"acceptRenameInputWithPreview",precondition:pl.and(S6,pl.has("config.editor.rename.enablePreview")),handler:e=>e.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:pl.and(Oh.focus,pl.not("isComposing")),primary:1027}})),Sh(new M6({id:"cancelRenameInput",precondition:S6,handler:e=>e.cancelRenameInput(),kbOpts:{weight:199,kbExpr:Oh.focus,primary:9,secondary:[1033]}})),yh("_executeDocumentRenameProvider",(function(e,t,i,...n){const[s]=n;qr("string"==typeof s);const{renameProvider:o}=e.get(oL);return function(e,t,i,n){return N6(this,void 0,void 0,(function*(){const s=new E6(t,i,e),o=yield s.resolveRenameLocation(Uh.None);return(null==o?void 0:o.rejectReason)?{edits:[],rejectReason:o.rejectReason}:s.provideRenameEdits(n,Uh.None)}))}(o,t,i,s)})),yh("_executePrepareRename",(function(e,t,i){return N6(this,void 0,void 0,(function*(){const{renameProvider:n}=e.get(oL),s=new E6(t,i,n),o=yield s.resolveRenameLocation(Uh.None);if(null==o?void 0:o.rejectReason)throw new Error(o.rejectReason);return o}))})),jl.as(xu).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:ue(0,"Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});class T6{static create(e,t){return new T6(e,new R6(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 Rh(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn):e}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,s,o]=this._tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new T6(this._startLineNumber,n),new T6(this._startLineNumber+o,s)]}applyEdit(e,t){const[i,n,s]=hc(t);this.acceptEdit(e,i,n,s,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,i,n,s){this._acceptDeleteRange(e),this._acceptInsertText(new Va(e.startLineNumber,e.startColumn),t,i,n,s),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 e=i-t;return void(this._startLineNumber-=e)}const n=this._tokens.getMaxDeltaLine();if(!(t>=n+1)){if(t<0&&i>=n+1)return this._startLineNumber=0,void this._tokens.clear();if(t<0){const n=-t;this._startLineNumber-=n,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,s){if(0===t&&0===i)return;const o=e.lineNumber-this._startLineNumber;if(o<0)return void(this._startLineNumber+=t);o>=this._tokens.getMaxDeltaLine()+1||this._tokens.acceptInsertText(o,e.column-1,t,i,n,s)}}class R6{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let i=0;ie)){let s=n;for(;s>t&&this._getDeltaLine(s-1)===e;)s--;let o=n;for(;oe||d===e&&u>=t)&&(de||r===e&&g>=t){if(rs?p-=s-i:p=i;else if(u===t&&g===i){if(!(u===n&&p>s)){h=!0;continue}p-=s-i}else if(us)){h=!0;continue}u=t,g=i,p=g+(p-s)}else if(u>n){if(0===a&&!h){l=r;break}u-=a}else{if(!(u===n&&g>=s))throw new Error("Not possible!");e&&0===u&&(g+=e,p+=e),u-=a,g-=s-i,p-=s-i}const f=4*l;o[f]=u,o[f+1]=g,o[f+2]=p,o[f+3]=m,l++}this._tokenCount=l}acceptInsertText(e,t,i,n,s,o){const r=0===i&&1===n&&(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122),a=this._tokens,l=this._tokenCount;for(let h=0;h=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},P6=function(e,t){return function(i,n){t(i,n,e)}};let F6=class{constructor(e,t,i,n){this._legend=e,this._themeService=t,this._languageService=i,this._logService=n,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new V6}getMetadata(e,t,i){const n=this._languageService.languageIdCodec.encodeLanguageId(i),s=this._hashTable.get(e,t,n);let o;if(s)o=s.metadata,this._logService.getLevel()===dh.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${Gg.getForeground(o)}, fontStyle ${Gg.getFontStyle(o).toString(2)}`);else{let s=this._legend.tokenTypes[e];const r=[];if(s){let e=t;for(let t=0;e>0&&t>=1;e>0&&this._logService.getLevel()===dh.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),r.push("not-in-legend"));const n=this._themeService.getColorTheme().getTokenStyleMetadata(s,r,i);if(void 0===n)o=2147483647;else{if(o=0,void 0!==n.italic){o|=1|(n.italic?1:0)<<11}if(void 0!==n.bold){o|=2|(n.bold?2:0)<<11}if(void 0!==n.underline){o|=4|(n.underline?4:0)<<11}if(void 0!==n.strikethrough){o|=8|(n.strikethrough?8:0)<<11}if(n.foreground){o|=16|n.foreground<<15}0===o&&(o=2147483647)}}else this._logService.getLevel()===dh.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),o=2147483647,s="not-in-legend";this._hashTable.add(e,t,n,o),this._logService.getLevel()===dh.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${s}) / ${t} (${r.join(" ")}): foreground ${Gg.getForeground(o)}, fontStyle ${Gg.getFontStyle(o).toString(2)}`)}return o}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,console.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,console.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,i,n,s){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,console.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${i}: The provided start offset ${n} is outside the previous data (length ${s}).`))}};function B6(e,t,i){const n=e.data,s=e.data.length/5|0,o=Math.max(Math.ceil(s/1024),400),r=[];let a=0,l=1,h=0;for(;ae&&0===n[5*t];)t--;if(t-1===e){let e=d;for(;e+1d)t.warnOverlappingSemanticTokens(r,d+1);else{const e=t.getMetadata(_,v,i);2147483647!==e&&(0===g&&(g=r),c[u]=r-g,c[u+1]=d,c[u+2]=f,c[u+3]=e,u+=4,p=r,m=f)}l=r,h=d,a++}u!==c.length&&(c=c.subarray(0,u));const f=T6.create(g,c);r.push(f)}return r}F6=O6([P6(1,P_),P6(2,Lc),P6(3,hh)],F6);class W6{constructor(e,t,i,n){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=n,this.next=null}}class V6{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=V6._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const e=this._elements;this._currentLengthIndex++,this._currentLength=V6._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+10?i[0]:[]}(e,t),r=yield Promise.all(o.map((e=>z6(this,void 0,void 0,(function*(){let o,r=null;try{o=yield e.provideDocumentSemanticTokens(t,e===i?n:null,s)}catch(a){r=a,o=null}return o&&(U6(o)||K6(o))||(o=null),new j6(e,o,r)})))));for(const e of r){if(e.error)throw e.error;if(e.tokens)return e}return r.length>0?r[0]:null}))}class G6{constructor(e,t){this.provider=e,this.tokens=t}}function Z6(e,t){const i=e.orderedGroups(t);return i.length>0?i[0]:[]}function Y6(e,t,i,n){return z6(this,void 0,void 0,(function*(){const s=Z6(e,t),o=yield Promise.all(s.map((e=>z6(this,void 0,void 0,(function*(){let s;try{s=yield e.provideDocumentRangeSemanticTokens(t,i,n)}catch(o){a(o),s=null}return s&&U6(s)||(s=null),new G6(e,s)})))));for(const e of o)if(e.tokens)return e;return o.length>0?o[0]:null}))}Xa.registerCommand("_provideDocumentSemanticTokensLegend",((e,...t)=>z6(void 0,void 0,void 0,(function*(){const[i]=t;qr(i instanceof an);const n=e.get(Ha).getModel(i);if(!n)return;const{documentSemanticTokensProvider:s}=e.get(oL),o=function(e,t){const i=e.orderedGroups(t);return i.length>0?i[0]:null}(s,n);return o?o[0].getLegend():e.get(Ya).executeCommand("_provideDocumentRangeSemanticTokensLegend",i)})))),Xa.registerCommand("_provideDocumentSemanticTokens",((e,...t)=>z6(void 0,void 0,void 0,(function*(){const[i]=t;qr(i instanceof an);const n=e.get(Ha).getModel(i);if(!n)return;const{documentSemanticTokensProvider:s}=e.get(oL);if(!q6(s,n))return e.get(Ya).executeCommand("_provideDocumentRangeSemanticTokens",i,n.getFullModelRange());const o=yield $6(s,n,null,null,Uh.None);if(!o)return;const{provider:r,tokens:a}=o;if(!a||!U6(a))return;const l=H6({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),l})))),Xa.registerCommand("_provideDocumentRangeSemanticTokensLegend",((e,...t)=>z6(void 0,void 0,void 0,(function*(){const[i,n]=t;qr(i instanceof an);const s=e.get(Ha).getModel(i);if(!s)return;const{documentRangeSemanticTokensProvider:o}=e.get(oL),r=Z6(o,s);if(0===r.length)return;if(1===r.length)return r[0].getLegend();if(!n||!Rh.isIRange(n))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),r[0].getLegend();const a=yield Y6(o,s,Rh.lift(n),Uh.None);return a?a.provider.getLegend():void 0})))),Xa.registerCommand("_provideDocumentRangeSemanticTokens",((e,...t)=>z6(void 0,void 0,void 0,(function*(){const[i,n]=t;qr(i instanceof an),qr(Rh.isIRange(n));const s=e.get(Ha).getModel(i);if(!s)return;const{documentRangeSemanticTokensProvider:o}=e.get(oL),r=yield Y6(o,s,Rh.lift(n),Uh.None);return r&&r.tokens?H6({id:0,type:"full",data:r.tokens.data}):void 0}))));const X6=Ba("semanticTokensStylingService"),Q6="editor.semanticHighlighting";function J6(e,t,i){var n;const s=null===(n=i.getValue(Q6,{overrideIdentifier:e.getLanguageId(),resource:e.uri}))||void 0===n?void 0:n.enabled;return"boolean"==typeof s?s:t.getColorTheme().semanticHighlighting}var e9,t9=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},i9=function(e,t){return function(i,n){t(i,n,e)}};let n9=class extends E{constructor(e,t,i,n,s,o){super(),this._watchers=Object.create(null);const r=t=>{this._watchers[t.uri.toString()]=new s9(t,e,i,s,o)},a=(e,t)=>{t.dispose(),delete this._watchers[e.uri.toString()]},l=()=>{for(const e of t.getModels()){const t=this._watchers[e.uri.toString()];J6(e,i,n)?t||r(e):t&&a(e,t)}};this._register(t.onModelAdded((e=>{J6(e,i,n)&&r(e)}))),this._register(t.onModelRemoved((e=>{const t=this._watchers[e.uri.toString()];t&&a(e,t)}))),this._register(n.onDidChangeConfiguration((e=>{e.affectsConfiguration(Q6)&&l()}))),this._register(i.onDidColorThemeChange(l))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};n9=t9([i9(0,X6),i9(1,Ha),i9(2,P_),i9(3,pu),i9(4,SE),i9(5,oL)],n9);let s9=e9=class extends E{constructor(e,t,i,n,s){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=s.documentSemanticTokensProvider,this._debounceInformation=n.for(this._provider,"DocumentSemanticTokens",{min:e9.REQUEST_MIN_DELAY,max:e9.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new rd((()=>this._fetchDocumentSemanticTokensNow()),e9.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 o=()=>{k(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const t of this._provider.all(e))"function"==typeof t.onDidChange&&this._documentProvidersChangeListeners.push(t.onDidChange((()=>{this._currentDocumentRequestCancellationTokenSource?this._providersChangedDuringRequest=!0:this._fetchDocumentSemanticTokens.schedule(0)})))};o(),this._register(this._provider.onDidChange((()=>{o(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))}))),this._register(i.onDidColorThemeChange((e=>{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),k(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!q6(this._provider,this._model))return void(this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1));if(!this._model.isAttachedToEditor())return;const e=new jh,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=$6(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const s=[],o=this._model.onDidChangeContent((e=>{s.push(e)})),a=new F(!1);n.then((e=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,o.dispose(),e){const{provider:t,tokens:i}=e,n=this._semanticTokensStylingService.getStyling(t);this._setDocumentSemanticTokens(t,i||null,n,s)}else this._setDocumentSemanticTokens(null,null,null,s)}),(e=>{e&&(d(e)||"string"==typeof e.message&&-1!==e.message.indexOf("busy"))||r(e),this._currentDocumentRequestCancellationTokenSource=null,o.dispose(),(s.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))}))}static _copy(e,t,i,n,s){s=Math.min(s,i.length-n,e.length-t);for(let o=0;o{(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);else if(e&&i){if(!t)return this._model.tokenization.setSemanticTokens(null,!0),void o();if(K6(t)){if(!s)return void this._model.tokenization.setSemanticTokens(null,!0);if(0===t.edits.length)t={resultId:t.resultId,data:s.data};else{let e=0;for(const i of t.edits)e+=(i.data?i.data.length:0)-i.deleteCount;const n=s.data,o=new Uint32Array(n.length+e);let r=n.length,a=o.length;for(let l=t.edits.length-1;l>=0;l--){const e=t.edits[l];if(e.start>n.length)return i.warnInvalidEditStart(s.resultId,t.resultId,l,e.start,n.length),void this._model.tokenization.setSemanticTokens(null,!0);const h=r-(e.start+e.deleteCount);h>0&&(e9._copy(n,r-h,o,a-h,h),a-=h),e.data&&(e9._copy(e.data,0,o,a-e.data.length,e.data.length),a-=e.data.length),r=e.start}r>0&&e9._copy(n,0,o,0,r),t={resultId:t.resultId,data:o}}}if(U6(t)){this._currentDocumentResponse=new o9(e,t.resultId,t.data);const s=B6(t,i,this._model.getLanguageId());if(n.length>0)for(const e of n)for(const t of s)for(const i of e.changes)t.applyEdit(i.range,i.text);this._model.tokenization.setSemanticTokens(s,!0)}else this._model.tokenization.setSemanticTokens(null,!0);o()}else this._model.tokenization.setSemanticTokens(null,!1)}};s9.REQUEST_MIN_DELAY=300,s9.REQUEST_MAX_DELAY=2e3,s9=e9=t9([i9(1,X6),i9(2,P_),i9(3,SE),i9(4,oL)],s9);class o9{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}ET(n9);var r9=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},a9=function(e,t){return function(i,n){t(i,n,e)}};let l9=class extends E{constructor(e,t,i,n,s,o){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._provider=o.documentRangeSemanticTokensProvider,this._debounceInformation=s.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new rd((()=>this._tokenizeViewportNow()),100)),this._outstandingRequests=[];const r=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange((()=>{r()}))),this._register(this._editor.onDidChangeModel((()=>{this._cancelAll(),r()}))),this._register(this._editor.onDidChangeModelContent((e=>{this._cancelAll(),r()}))),this._register(this._provider.onDidChange((()=>{this._cancelAll(),r()}))),this._register(this._configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration(Q6)&&(this._cancelAll(),r())}))),this._register(this._themeService.onDidColorThemeChange((()=>{this._cancelAll(),r()}))),r()}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;tthis._requestRange(e,t))))}_requestRange(e,t){const i=e.getVersionId(),n=Yh((i=>Promise.resolve(Y6(this._provider,e,t,i)))),s=new F(!1);return n.then((n=>{if(this._debounceInformation.update(e,s.elapsed()),!n||!n.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:o,tokens:r}=n,a=this._semanticTokensStylingService.getStyling(o);e.tokenization.setPartialSemanticTokens(t,B6(r,a,e.getLanguageId()))})).then((()=>this._removeOutstandingRequest(n)),(()=>this._removeOutstandingRequest(n))),n}};l9.ID="editor.contrib.viewportSemanticTokens",l9=r9([a9(1,X6),a9(2,P_),a9(3,pu),a9(4,SE),a9(5,oL)],l9),Dh(l9.ID,l9,1);class h9{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const n of t){const t=[];i.push(t),this.selectSubwords&&this._addInWordRanges(t,e,n),this._addWordRanges(t,e,n),this._addWhitespaceLine(t,e,n),t.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const n=t.getWordAtPosition(i);if(!n)return;const{word:s,startColumn:o}=n,r=i.column-o;let a=r,l=r,h=0;for(;a>=0;a--){const e=s.charCodeAt(a);if(a!==r&&(95===e||45===e))break;if(mo(e)&&fo(h))break;h=e}for(a+=1;l0&&0===t.getLineFirstNonWhitespaceColumn(i.lineNumber)&&0===t.getLineLastNonWhitespaceColumn(i.lineNumber)&&e.push({range:new Rh(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var d9,c9=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},u9=function(e,t){return function(i,n){t(i,n,e)}},g9=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class p9{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 p9(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}let m9=d9=class{static get(e){return e.getContribution(d9.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;null===(e=this._selectionListener)||void 0===e||e.dispose()}run(e){return g9(this,void 0,void 0,(function*(){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||(yield _9(this._languageFeaturesService.selectionRangeProvider,i,t.map((e=>e.getPosition())),this._editor.getOption(112),Uh.None).then((e=>{var i;if(Hd(e)&&e.length===t.length&&this._editor.hasModel()&&Td(this._editor.getSelections(),t,((e,t)=>e.equalsSelection(t)))){for(let i=0;ie.containsPosition(t[i].getStartPosition())&&e.containsPosition(t[i].getEndPosition()))),e[i].unshift(t[i]);this._state=e.map((e=>new p9(0,e))),null===(i=this._selectionListener)||void 0===i||i.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition((()=>{var e;this._ignoreSelection||(null===(e=this._selectionListener)||void 0===e||e.dispose(),this._state=void 0)}))}}))),!this._state)return;this._state=this._state.map((t=>t.mov(e)));const n=this._state.map((e=>Ah.fromPositions(e.ranges[e.index].getStartPosition(),e.ranges[e.index].getEndPosition())));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}}))}};m9.ID="editor.contrib.smartSelectController",m9=d9=c9([u9(1,oL)],m9);class f9 extends bh{constructor(e,t){super(t),this._forward=e}run(e,t){return g9(this,void 0,void 0,(function*(){const e=m9.get(t);e&&(yield e.run(this._forward))}))}}Xa.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");function _9(e,t,i,n,s){return g9(this,void 0,void 0,(function*(){const o=e.all(t).concat(new h9(n.selectSubwords));1===o.length&&o.unshift(new R2);const r=[],l=[];for(const e of o)r.push(Promise.resolve(e.provideSelectionRanges(t,i,s)).then((e=>{if(Hd(e)&&e.length===i.length)for(let t=0;t{if(0===e.length)return[];e.sort(((e,t)=>Va.isBefore(e.getStartPosition(),t.getStartPosition())?1:Va.isBefore(t.getStartPosition(),e.getStartPosition())||Va.isBefore(e.getEndPosition(),t.getEndPosition())?-1:Va.isBefore(t.getEndPosition(),e.getEndPosition())?1:0));const i=[];let s;for(const t of e)(!s||Rh.containsRange(t,s)&&!Rh.equalsRange(t,s))&&(i.push(t),s=t);if(!n.selectLeadingAndTrailingWhitespace)return i;const o=[i[0]];for(let n=1;ne}),y9="data-sticky-line-index",S9="data-sticky-is-line",L9="data-sticky-is-folding-icon";class k9 extends E{constructor(e){super(),this._editor=e,this._foldingIconStore=new N,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(66),this._stickyLines=[],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 pW),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(114).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(114)&&t(),e.hasChanged(66)&&(this._lineHeight=this._editor.getOption(66))}))),this._register(this._editor.onDidScrollChange((e=>{e.scrollLeftChanged&&t(),e.scrollWidthChanged&&this._updateWidgetWidth()}))),this._register(this._editor.onDidChangeModel((()=>{t(),this._updateWidgetWidth()}))),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange((e=>{this._updateWidgetWidth()}))),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getStickyLineForLine(e){return this._stickyLines.find((t=>t.lineNumber===e))}getCurrentLines(){return this._lineNumbers}setState(e,t,i=1/0){if((!this._previousState&&!e||this._previousState&&this._previousState.equals(e))&&i===1/0)return;this._previousState=e;const n=this._stickyLines;if(this._clearStickyWidget(),!e||!this._editor._getViewModel())return;if(e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const t=[...e.startLineNumbers];null!==e.showEndForLine&&(t[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=t}else this._lastLineRelativePosition=0,this._lineNumbers=[];this._renderRootNode(n,t,i)}_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"}_clearStickyWidget(){this._stickyLines=[],this._foldingIconStore.clear(),Dn(this._lineNumbersDomNode),Dn(this._linesDomNode),this._rootDomNode.style.display="none"}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${e?.5:0}s`)}_setFoldingIconsVisibility(e){for(const t of this._stickyLines){const i=t.foldingIcon;i&&i.setVisible(!!e||i.isCollapsed)}}_renderRootNode(e,t,i=1/0){return b9(this,void 0,void 0,(function*(){const n=this._editor.getLayoutInfo();for(const[o,r]of this._lineNumbers.entries()){const s=e[o],a=r>=i||(null==s?void 0:s.lineNumber)!==r?this._renderChildNode(o,r,t,n):this._updateTopAndZIndexOfStickyLine(s);a&&(this._linesDomNode.appendChild(a.lineDomNode),this._lineNumbersDomNode.appendChild(a.lineNumberDomNode),this._stickyLines.push(a))}t&&(this._setFoldingHoverListeners(),this._useFoldingOpacityTransition(!this._isOnGlyphMargin));const s=this._lineNumbers.length*this._lineHeight+this._lastLineRelativePosition;0!==s?(this._rootDomNode.style.display="block",this._lineNumbersDomNode.style.height=`${s}px`,this._linesDomNodeScrollable.style.height=`${s}px`,this._rootDomNode.style.height=`${s}px`,this._rootDomNode.style.marginLeft="0px",this._updateMinContentWidth(),this._editor.layoutOverlayWidget(this)):this._clearStickyWidget()}))}_setFoldingHoverListeners(){"mouseover"===this._editor.getOption(109)&&(this._foldingIconStore.add(En(this._lineNumbersDomNode,os.MOUSE_ENTER,(e=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)}))),this._foldingIconStore.add(En(this._lineNumbersDomNode,os.MOUSE_LEAVE,(()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)}))))}_renderChildNode(e,t,i,n){const s=this._editor._getViewModel();if(!s)return;const o=s.coordinatesConverter.convertModelPositionToViewPosition(new Va(t,1)).lineNumber,r=s.getViewLineRenderingData(o),a=this._editor.getOption(67);let l;try{l=bA.filter(r.inlineDecorations,o,r.minColumn,r.maxColumn)}catch(b){l=[]}const h=new kA(!0,!0,r.content,r.continuesWithWrappedLine,r.isBasicASCII,r.containsRTL,0,r.tokens,l,r.tabSize,r.startVisibleColumn,1,1,1,500,"none",!0,!0,null),d=new eu(2e3),c=EA(h,d);let u;u=w9?w9.createHTML(d.build()):d.build();const g=document.createElement("span");g.setAttribute(y9,String(e)),g.setAttribute(S9,""),g.setAttribute("role","listitem"),g.tabIndex=0,g.className="sticky-line-content",g.classList.add(`stickyLine${t}`),g.style.lineHeight=`${this._lineHeight}px`,g.innerHTML=u;const p=document.createElement("span");p.setAttribute(y9,String(e)),p.setAttribute("data-sticky-is-line-number",""),p.className="sticky-line-number",p.style.lineHeight=`${this._lineHeight}px`;const m=n.contentLeft;p.style.width=`${m}px`;const f=document.createElement("span");1===a.renderType||3===a.renderType&&t%10==0?f.innerText=t.toString():2===a.renderType&&(f.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),f.className="sticky-line-number-inner",f.style.lineHeight=`${this._lineHeight}px`,f.style.width=`${n.lineNumbersWidth}px`,f.style.paddingLeft=`${n.lineNumbersLeft}px`,p.appendChild(f);const _=this._renderFoldingIconForLine(i,t);_&&p.appendChild(_.domNode),this._editor.applyFontInfo(g),this._editor.applyFontInfo(f),p.style.lineHeight=`${this._lineHeight}px`,g.style.lineHeight=`${this._lineHeight}px`,p.style.height=`${this._lineHeight}px`,g.style.height=`${this._lineHeight}px`;const v=new D9(e,t,g,p,_,c.characterMapping);return this._updateTopAndZIndexOfStickyLine(v)}_updateTopAndZIndexOfStickyLine(e){var t;const i=e.index,n=e.lineDomNode,s=e.lineNumberDomNode,o=i===this._lineNumbers.length-1;n.style.zIndex=o?"0":"1",s.style.zIndex=o?"0":"1";const r=`${i*this._lineHeight+this._lastLineRelativePosition+((null===(t=e.foldingIcon)||void 0===t?void 0:t.isCollapsed)?1:0)}px`,a=i*this._lineHeight+"px";return n.style.top=o?r:a,s.style.top=o?r:a,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(109);if(!e||"never"===i)return;const n=e.regions,s=n.findRange(t),o=n.getStartLineNumber(s);if(!(t===o))return;const r=n.isCollapsed(s),a=new x9(r,o,n.getEndLineNumber(s),this._lineHeight);return a.setVisible(!!this._isOnGlyphMargin||(r||"always"===i)),a.domNode.setAttribute(L9,""),a}_updateMinContentWidth(){this._minContentWidthInPx=0;for(const e of this._stickyLines)e.lineDomNode.scrollWidth>this._minContentWidthInPx&&(this._minContentWidthInPx=e.lineDomNode.scrollWidth);this._minContentWidthInPx+=this._editor.getLayoutInfo().verticalScrollbarWidth}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:null}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=jA(t.characterMapping,e,0);return new Va(t.lineNumber,i)}getLineNumberFromChildDomNode(e){var t,i;return null!==(i=null===(t=this._getRenderedStickyLineFromChildDomNode(e))||void 0===t?void 0:t.lineNumber)&&void 0!==i?i:null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return null===t||t<0||t>=this._stickyLines.length?null:this._stickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,y9);return t?parseInt(t,10):null}isInStickyLine(e){return void 0!==this._getAttributeValue(e,S9)}isInFoldingIconDomNode(e){return void 0!==this._getAttributeValue(e,L9)}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(null!==i)return i;e=e.parentElement}}}class D9{constructor(e,t,i,n,s,o){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=n,this.foldingIcon=s,this.characterMapping=o}}class x9{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=ta.asClassName(e?qQ:jQ)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class N9{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class E9{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class I9{constructor(e,t,i,n){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=n}}var M9,T9,R9=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},A9=function(e,t){return function(i,n){t(i,n,e)}},O9=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};!function(e){e.OUTLINE_MODEL="outlineModel",e.FOLDING_PROVIDER_MODEL="foldingProviderModel",e.INDENTATION_MODEL="indentationModel"}(M9||(M9={})),function(e){e[e.VALID=0]="VALID",e[e.INVALID=1]="INVALID",e[e.CANCELED=2]="CANCELED"}(T9||(T9={}));let P9=class extends E{constructor(e,t,i,n){super(),this._editor=e,this._languageConfigurationService=t,this._languageFeaturesService=i,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Jh(300)),this._updateOperation=this._register(new N);const s=new B9(i),o=new H9(this._editor,i),r=new V9(this._editor,t);switch(n){case M9.OUTLINE_MODEL:this._modelProviders.push(s),this._modelProviders.push(o),this._modelProviders.push(r);break;case M9.FOLDING_PROVIDER_MODEL:this._modelProviders.push(o),this._modelProviders.push(r);break;case M9.INDENTATION_MODEL:this._modelProviders.push(r)}}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}update(e,t,i){return O9(this,void 0,void 0,(function*(){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),yield this._updateScheduler.trigger((()=>O9(this,void 0,void 0,(function*(){for(const n of this._modelProviders){const{statusPromise:s,modelPromise:o}=n.computeStickyModel(e,t,i);this._modelPromise=o;const r=yield s;if(this._modelPromise!==o)return null;switch(r){case T9.CANCELED:return this._updateOperation.clear(),null;case T9.VALID:return n.stickyModel}}return null})))).catch((e=>(r(e),null)))}))}};P9=R9([A9(1,Ju),A9(2,oL)],P9);class F9{constructor(){this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,T9.INVALID}computeStickyModel(e,t,i){if(i.isCancellationRequested||!this.isProviderValid(e))return{statusPromise:this._invalid(),modelPromise:null};const n=Yh((i=>this.createModelFromProvider(e,t,i)));return{statusPromise:n.then((n=>this.isModelValid(n)?i.isCancellationRequested?T9.CANCELED:(this._stickyModel=this.createStickyModel(e,t,i,n),T9.VALID):this._invalid())).then(void 0,(e=>(r(e),T9.CANCELED))),modelPromise:n}}isModelValid(e){return!0}isProviderValid(e){return!0}}let B9=class extends F9{constructor(e){super(),this._languageFeaturesService=e}createModelFromProvider(e,t,i){return LZ.create(this._languageFeaturesService.documentSymbolProvider,e,i)}createStickyModel(e,t,i,n){var s;const{stickyOutlineElement:o,providerID:r}=this._stickyModelFromOutlineModel(n,null===(s=this._stickyModel)||void 0===s?void 0:s.outlineProviderId);return new I9(e.uri,t,o,r)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(v.first(e.children.values())instanceof SZ){const n=v.find(e.children.values(),(e=>e.id===t));if(n)i=n.children;else{let n,s="",o=-1;for(const[t,i]of e.children.entries()){const e=this._findSumOfRangesOfGroup(i);e>o&&(n=i,o=e,s=i.id)}t=s,i=n.children}}else i=e.children;const n=[],s=Array.from(i.values()).sort(((e,t)=>{const i=new N9(e.symbol.range.startLineNumber,e.symbol.range.endLineNumber),n=new N9(t.symbol.range.startLineNumber,t.symbol.range.endLineNumber);return this._comparator(i,n)}));for(const o of s)n.push(this._stickyModelFromOutlineElement(o,o.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new E9(void 0,n,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const s of e.children.values())if(s.symbol.selectionRange.startLineNumber!==s.symbol.range.endLineNumber)if(s.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(s,s.symbol.selectionRange.startLineNumber));else for(const e of s.children.values())i.push(this._stickyModelFromOutlineElement(e,s.symbol.selectionRange.startLineNumber));i.sort(((e,t)=>this._comparator(e.range,t.range)));const n=new N9(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new E9(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 yZ?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};B9=R9([A9(0,oL)],B9);class W9 extends F9{constructor(e){super(),this._foldingLimitReporter=new rJ(e)}createStickyModel(e,t,i,n){const s=this._fromFoldingRegions(n);return new I9(e.uri,t,s,void 0)}isModelValid(e){return null!==e}_fromFoldingRegions(e){const t=e.length,i=[],n=new E9(void 0,[],void 0);for(let s=0;s0}createModelFromProvider(e,t,i){const n=oJ.getFoldingRangeProviders(this._languageFeaturesService,e);return new QQ(e,n,(()=>this.createModelFromProvider(e,t,i)),this._foldingLimitReporter,void 0).compute(i)}};H9=R9([A9(1,oL)],H9);var z9=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},U9=function(e,t){return function(i,n){t(i,n,e)}},K9=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class j9{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}let q9=class extends E{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new U),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._options=null,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new N),this._updateSoon=this._register(new rd((()=>this.update()),50)),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(114)&&this.readConfiguration()}))),this.readConfiguration()}readConfiguration(){this._stickyModelProvider=null,this._sessionStore.clear(),this._options=this._editor.getOption(114),this._options.enabled&&(this._stickyModelProvider=this._sessionStore.add(new P9(this._editor,this._languageConfigurationService,this._languageFeaturesService,this._options.defaultModel)),this._sessionStore.add(this._editor.onDidChangeModel((()=>{this._model=null,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.update())}getVersionId(){var e;return null===(e=this._model)||void 0===e?void 0:e.version}update(){var e;return K9(this,void 0,void 0,(function*(){null===(e=this._cts)||void 0===e||e.dispose(!0),this._cts=new jh,yield this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}))}updateStickyModel(e){return K9(this,void 0,void 0,(function*(){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization())return void(this._model=null);const t=this._editor.getModel(),i=t.getVersionId(),n=yield this._stickyModelProvider.update(t,i,e);e.isCancellationRequested||(this._model=n)}))}updateIndex(e){return-1===e?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,n,s){if(0===t.children.length)return;let o=s;const r=[];for(let h=0;he-t))),l=this.updateIndex(Rd(r,e.startLineNumber+n,((e,t)=>e-t)));for(let h=a;h<=l;h++){const r=t.children[h];if(!r)return;if(r.range){const t=r.range.startLineNumber,s=r.range.endLineNumber;e.startLineNumber<=s+1&&t-1<=e.endLineNumber&&t!==o&&(o=t,i.push(new j9(t,s-1,n+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,r,i,n+1,t))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,r,i,n,s)}}getCandidateStickyLinesIntersecting(e){var t,i;if(!(null===(t=this._model)||void 0===t?void 0:t.element))return[];let n=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,n,0,-1);const s=null===(i=this._editor._getViewModel())||void 0===i?void 0:i.getHiddenAreas();if(s)for(const o of s)n=n.filter((e=>!(e.startLineNumber>=o.startLineNumber&&e.endLineNumber<=o.endLineNumber+1)));return n}};q9=z9([U9(1,oL),U9(2,Ju)],q9);var $9,G9=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Z9=function(e,t){return function(i,n){t(i,n,e)}},Y9=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let X9=$9=class extends E{constructor(e,t,i,n,s,o,r){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=n,this._contextKeyService=r,this._sessionStore=new N,this._foldingModel=null,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._showEndForLine=null,this._stickyScrollWidget=new k9(this._editor),this._stickyLineCandidateProvider=new q9(this._editor,i,s),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=new C9([],[],0),this._readConfiguration();const a=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration((e=>{(e.hasChanged(114)||e.hasChanged(72)||e.hasChanged(66)||e.hasChanged(109))&&this._readConfiguration()}))),this._register(En(a,os.CONTEXT_MENU,(e=>Y9(this,void 0,void 0,(function*(){this._onContextMenu(e)}))))),this._stickyScrollFocusedContextKey=Oh.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=Oh.stickyScrollVisible.bindTo(this._contextKeyService);const l=this._register(hs(a));this._register(l.onDidBlur((e=>{!1===this._positionRevealed&&0===a.clientHeight?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()}))),this._register(l.onDidFocus((e=>{this.focus()}))),this._registerMouseListeners(),this._register(En(a,os.MOUSE_DOWN,(e=>{this._onMouseDown=!0})))}static get(e){return e.getContribution($9.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),null===(e=this._focusDisposableStore)||void 0===e||e.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown)return this._onMouseDown=!1,void this._editor.focus();!0!==this._stickyScrollFocusedContextKey.get()&&(this._focused=!0,this._focusDisposableStore=new N,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,0)))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(Rh.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new N),t=this._register(new RR(this._editor,{extractLineNumberFromMouseEvent:e=>{const t=this._stickyScrollWidget.getEditorPositionFromNode(e.target.element);return t?t.lineNumber:0}})),i=e=>{if(!this._editor.hasModel())return null;if(12!==e.target.type||e.target.detail!==this._stickyScrollWidget.getId())return null;const t=e.target.element;if(!t||t.innerText!==t.innerHTML)return null;const i=this._stickyScrollWidget.getEditorPositionFromNode(t);return i?{range:new Rh(i.lineNumber,i.column,i.lineNumber,i.column+t.innerText.length),textElement:t}:null},n=this._stickyScrollWidget.getDomNode();this._register(Mn(n,os.CLICK,(e=>{if(e.ctrlKey||e.altKey||e.metaKey)return;if(!e.leftButton)return;if(e.shiftKey){const t=this._stickyScrollWidget.getLineIndexFromChildDomNode(e.target);if(null===t)return;const i=new Va(this._endLineNumbers[t],1);return void this._revealLineInCenterIfOutsideViewport(i)}if(this._stickyScrollWidget.isInFoldingIconDomNode(e.target)){const t=this._stickyScrollWidget.getLineNumberFromChildDomNode(e.target);return void this._toggleFoldingRegionForLine(t)}if(!this._stickyScrollWidget.isInStickyLine(e.target))return;let t=this._stickyScrollWidget.getEditorPositionFromNode(e.target);if(!t){const i=this._stickyScrollWidget.getLineNumberFromChildDomNode(e.target);if(null===i)return;t=new Va(i,1)}this._revealPosition(t)}))),this._register(Mn(n,os.MOUSE_MOVE,(e=>{if(e.shiftKey){const t=this._stickyScrollWidget.getLineIndexFromChildDomNode(e.target);if(null===t||null!==this._showEndForLine&&this._showEndForLine===t)return;return this._showEndForLine=t,void this._renderStickyScroll()}null!==this._showEndForLine&&(this._showEndForLine=null,this._renderStickyScroll())}))),this._register(En(n,os.MOUSE_LEAVE,(e=>{null!==this._showEndForLine&&(this._showEndForLine=null,this._renderStickyScroll())}))),this._register(t.onMouseMoveOrRelevantKeyDown((([t,n])=>{const s=i(t);if(!s||!t.hasTriggerModifier||!this._editor.hasModel())return void e.clear();const{range:o,textElement:r}=s;if(o.equalsRange(this._stickyRangeProjectedOnEditor)){if("underline"===r.style.textDecoration)return}else this._stickyRangeProjectedOnEditor=o,e.clear();const a=new jh;let l;e.add(x((()=>a.dispose(!0)))),IU(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new Va(o.startLineNumber,o.startColumn+1),a.token).then((t=>{if(!a.token.isCancellationRequested)if(0!==t.length){this._candidateDefinitionsLength=t.length;const i=r;l!==i?(e.clear(),l=i,l.style.textDecoration="underline",e.add(x((()=>{l.style.textDecoration="none"})))):l||(l=i,l.style.textDecoration="underline",e.add(x((()=>{l.style.textDecoration="none"}))))}else e.clear()}))}))),this._register(t.onCancel((()=>{e.clear()}))),this._register(t.onExecute((e=>Y9(this,void 0,void 0,(function*(){if(12!==e.target.type||e.target.detail!==this._stickyScrollWidget.getId())return;const t=this._stickyScrollWidget.getEditorPositionFromNode(e.target.element);t&&(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:t.lineNumber,column:1})),this._instaService.invokeFunction(C0,e,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor}))})))))}_onContextMenu(e){const t=new Nt(e);this._contextMenuService.showContextMenu({menuId:eh.StickyScrollContext,getAnchor:()=>t})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||null===e)return;const t=this._stickyScrollWidget.getStickyLineForLine(e),i=null==t?void 0:t.foldingIcon;if(!i)return;RQ(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(66)*t.index+1;this._editor.setScrollTop(n),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(114);if(!1===e.enabled)return this._editor.removeOverlayWidget(this._stickyScrollWidget),this._sessionStore.clear(),void(this._enabled=!1);e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange((e=>{e.scrollTopChanged&&(this._showEndForLine=null,this._renderStickyScroll())}))),this._sessionStore.add(this._editor.onDidLayoutChange((()=>this._onDidResize()))),this._sessionStore.add(this._editor.onDidChangeModelTokens((e=>this._onTokensChange(e)))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll((()=>{this._showEndForLine=null,this._renderStickyScroll()}))),this._enabled=!0);2===this._editor.getOption(67).renderType&&this._sessionStore.add(this._editor.onDidChangeCursorPosition((()=>{this._showEndForLine=null,this._renderStickyScroll()})))}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const i of t)for(const t of e.ranges)if(i>=t.fromLineNumber&&i<=t.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(-1)}_onDidResize(){const e=this._editor.getLayoutInfo().height/this._editor.getOption(66);this._maxStickyLines=Math.round(.25*e)}_renderStickyScroll(e=1/0){var t,i;return Y9(this,void 0,void 0,(function*(){const n=this._editor.getModel();if(!n||n.isTooLargeForTokenization())return this._foldingModel=null,void this._stickyScrollWidget.setState(void 0,null,e);const s=this._stickyLineCandidateProvider.getVersionId();if(void 0===s||s===n.getVersionId())if(this._foldingModel=null!==(i=yield null===(t=oJ.get(this._editor))||void 0===t?void 0:t.getFoldingModel())&&void 0!==i?i:null,this._widgetState=this.findScrollWidgetState(),this._stickyScrollVisibleContextKey.set(!(0===this._widgetState.startLineNumbers.length)),this._focused)if(-1===this._focusedStickyElementIndex)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,-1!==this._focusedStickyElementIndex&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const t=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];if(this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),0===this._stickyScrollWidget.lineNumberCount)this._focusedStickyElementIndex=-1;else{this._stickyScrollWidget.lineNumbers.includes(t)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}}else this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e)}))}findScrollWidgetState(){const e=this._editor.getOption(66),t=Math.min(this._maxStickyLines,this._editor.getOption(114).maxLineCount),i=this._editor.getScrollTop();let n=0;const s=[],o=[],r=this._editor.getVisibleRanges();if(0!==r.length){const a=new N9(r[0].startLineNumber,r[r.length-1].endLineNumber),l=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(a);for(const r of l){const a=r.startLineNumber,l=r.endLineNumber,h=r.nestingDepth;if(l-a>0){const r=(h-1)*e,d=h*e,c=this._editor.getBottomForLineNumber(a)-i,u=this._editor.getTopForLineNumber(l)-i,g=this._editor.getBottomForLineNumber(l)-i;if(r>u&&r<=g){s.push(a),o.push(l+1),n=g-d;break}if(d>c&&d<=g&&(s.push(a),o.push(l+1)),s.length===t)break}}}return this._endLineNumbers=o,new C9(s,o,n,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}};X9.ID="store.contrib.stickyScrollController",X9=$9=G9([Z9(1,Kx),Z9(2,oL),Z9(3,Fa),Z9(4,Ju),Z9(5,SE),Z9(6,Ol)],X9);var Q9=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const J9=100;Dh(X9.ID,X9,1),ah(class extends rh{constructor(){super({id:"editor.action.toggleStickyScroll",title:{value:ue(0,"Toggle Sticky Scroll"),mnemonicTitle:ue(0,"&&Toggle Sticky Scroll"),original:"Toggle Sticky Scroll"},category:v9.View,toggled:{condition:pl.equals("config.editor.stickyScroll.enabled",!0),title:ue(0,"Sticky Scroll"),mnemonicTitle:ue(0,"&&Sticky Scroll")},menu:[{id:eh.CommandPalette},{id:eh.MenubarAppearanceMenu,group:"4_editor",order:3},{id:eh.StickyScrollContext}]})}run(e){return Q9(this,void 0,void 0,(function*(){const t=e.get(pu),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)}))}}),ah(class extends wh{constructor(){super({id:"editor.action.focusStickyScroll",title:{value:ue(0,"Focus Sticky Scroll"),mnemonicTitle:ue(0,"&&Focus Sticky Scroll"),original:"Focus Sticky Scroll"},precondition:pl.and(pl.has("config.editor.stickyScroll.enabled"),Oh.stickyScrollVisible),menu:[{id:eh.CommandPalette}]})}runEditorCommand(e,t){var i;null===(i=X9.get(t))||void 0===i||i.focus()}}),ah(class extends wh{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:{value:ue(0,"Select previous sticky scroll line"),original:"Select previous sticky scroll line"},precondition:Oh.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:J9,primary:16}})}runEditorCommand(e,t){var i;null===(i=X9.get(t))||void 0===i||i.focusPrevious()}}),ah(class extends wh{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:{value:ue(0,"Select next sticky scroll line"),original:"Select next sticky scroll line"},precondition:Oh.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:J9,primary:18}})}runEditorCommand(e,t){var i;null===(i=X9.get(t))||void 0===i||i.focusNext()}}),ah(class extends wh{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:{value:ue(0,"Go to focused sticky scroll line"),original:"Go to focused sticky scroll line"},precondition:Oh.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:J9,primary:3}})}runEditorCommand(e,t){var i;null===(i=X9.get(t))||void 0===i||i.goToFocused()}}),ah(class extends wh{constructor(){super({id:"editor.action.selectEditor",title:{value:ue(0,"Select Editor"),original:"Select Editor"},precondition:Oh.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:J9,primary:9}})}runEditorCommand(e,t){var i;null===(i=X9.get(t))||void 0===i||i.selectEditor()}});var e7,t7=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},i7=function(e,t){return function(i,n){t(i,n,e)}},n7=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class s7{constructor(e,t,i,n,s,o){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=n,this.command=s,this.completion=o}}let o7=class extends M{constructor(e,t,i,n,s,o){super(s.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=n,this._suggestMemoryService=o}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(Uh.None)}return t}};o7=t7([i7(5,y2)],o7);let r7=class{constructor(e,t,i,n){this._getEditorOption=e,this._languageFeatureService=t,this._clipboardService=i,this._suggestMemoryService=n}provideInlineCompletions(e,t,i,n){var s;return n7(this,void 0,void 0,(function*(){if(i.selectedSuggestionInfo)return;const o=this._getEditorOption(88,e);if(H1.isAllOff(o))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const r=e.tokenization.getLineTokens(t.lineNumber),a=r.getStandardTokenType(r.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if("inline"!==H1.valueFor(o,a))return;let l,h,d=e.getWordAtPosition(t);if((null==d?void 0:d.word)||(l=this._getTriggerCharacterInfo(e,t)),!(null==d?void 0:d.word)&&!l)return;if(d||(d=e.getWordUntilPosition(t)),d.endColumn!==t.column)return;const c=e.getValueInRange(new Rh(t.lineNumber,1,t.lineNumber,t.column));if(!l&&(null===(s=this._lastResult)||void 0===s?void 0:s.canBeReused(e,t.lineNumber,d))){const e=new P2(c,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=e,this._lastResult.acquire(),h=this._lastResult}else{const i=yield B1(this._languageFeatureService.completionProvider,e,t,new O1(void 0,void 0,null==l?void 0:l.providers),l&&{triggerKind:1,triggerCharacter:l.ch},n);let s;i.needsClipboard&&(s=yield this._clipboardService.readText());const o=new F2(i.items,t.column,new P2(c,0),O2.None,this._getEditorOption(117,e),this._getEditorOption(111,e),{boostFullMatch:!1,firstMatchCanBeWeak:!1},s);h=new o7(e,t.lineNumber,d,o,i,this._suggestMemoryService)}return this._lastResult=h,h}))}handleItemDidShow(e,t){t.completion.resolve(Uh.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var i;const n=e.getValueInRange(Rh.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),s=new Set;for(const o of this._languageFeatureService.completionProvider.all(e))(null===(i=o.triggerCharacters)||void 0===i?void 0:i.includes(n))&&s.add(o);if(0!==s.size)return{providers:s,ch:n}}};r7=t7([i7(1,oL),i7(2,eS),i7(3,y2)],r7);let a7=e7=class{constructor(e,t,i,n){if(1==++e7._counter){const s=n.createInstance(r7,((t,n)=>{var s;return(null!==(s=i.listCodeEditors().find((e=>e.getModel()===n)))&&void 0!==s?s:e).getOption(t)}));e7._disposable=t.inlineCompletionsProvider.register("*",s)}}dispose(){var e;0==--e7._counter&&(null===(e=e7._disposable)||void 0===e||e.dispose(),e7._disposable=void 0)}};a7._counter=0,a7=e7=t7([i7(1,oL),i7(2,Wa),i7(3,Fa)],a7),Dh("suggest.inlineCompletionsProvider",a7,0);class l7{constructor(e,t,i,n,s){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=n,this.background=s}}const h7=/^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;class d7{constructor(){this._lastColorId=0,this._id2color=[],this._color2id=new Map}getId(e){if(null===e)return 0;const t=e.match(h7);if(!t)throw new Error("Illegal value for token color: "+e);e=t[1].toUpperCase();let i=this._color2id.get(e);return i||(i=++this._lastColorId,this._color2id.set(e,i),this._id2color[i]=lc.fromHex("#"+e),i)}getColorMap(){return this._id2color.slice(0)}}class c7{static createFromRawTokenTheme(e,t){return this.createFromParsedTokenTheme(function(e){if(!e||!Array.isArray(e))return[];const t=[];let i=0;for(let n=0,s=e.length;n{const i=function(e,t){return et?1:0}(e.token,t.token);return 0!==i?i:e.index-t.index}));let i=0,n="000000",s="ffffff";for(;e.length>=1&&""===e[0].token;){const t=e.shift();-1!==t.fontStyle&&(i=t.fontStyle),null!==t.foreground&&(n=t.foreground),null!==t.background&&(s=t.background)}const o=new d7;for(const d of t)o.getId(d);const r=o.getId(n),a=o.getId(s),l=new g7(i,r,a),h=new p7(l);for(let d=0,c=e.length;d>>0,this._cache.set(t,i)}return(i|e)>>>0}}const u7=/\b(comment|string|regex|regexp)\b/;class g7{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new g7(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){-1!==e&&(this._fontStyle=e),0!==t&&(this._foreground=t),0!==i&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class p7{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(""===e)return this._mainRule;const t=e.indexOf(".");let i,n;-1===t?(i=e,n=""):(i=e.substring(0,t),n=e.substring(t+1));const s=this._children.get(i);return void 0!==s?s.match(n):this._mainRule}insert(e,t,i,n){if(""===e)return void this._mainRule.acceptOverwrite(t,i,n);const s=e.indexOf(".");let o,r;-1===s?(o=e,r=""):(o=e.substring(0,s),r=e.substring(s+1));let a=this._children.get(o);void 0===a&&(a=new p7(this._mainRule.clone()),this._children.set(o,a)),a.insert(r,t,i,n)}}const m7={base:"vs",inherit:!1,rules:[{token:"",foreground:"000000",background:"fffffe"},{token:"invalid",foreground:"cd3131"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"001188"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"delimiter.xml",foreground:"0000FF"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"FF0000"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"FF0000"},{token:"attribute.value",foreground:"0451A5"},{token:"attribute.value.number",foreground:"098658"},{token:"attribute.value.unit",foreground:"098658"},{token:"attribute.value.html",foreground:"0000FF"},{token:"attribute.value.xml",foreground:"0000FF"},{token:"string",foreground:"A31515"},{token:"string.html",foreground:"0000FF"},{token:"string.sql",foreground:"FF0000"},{token:"string.yaml",foreground:"0451A5"},{token:"keyword",foreground:"0000FF"},{token:"keyword.json",foreground:"0451A5"},{token:"keyword.flow",foreground:"AF00DB"},{token:"keyword.flow.scss",foreground:"0000FF"},{token:"operator.scss",foreground:"666666"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[Sm]:"#FFFFFE",[Lm]:"#000000",[Vm]:"#E5EBF1",[X_]:"#D3D3D3",[nv]:"#939393",[Hm]:"#ADD6FF4D"}},f7={base:"vs-dark",inherit:!1,rules:[{token:"",foreground:"D4D4D4",background:"1E1E1E"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"74B0DF"},{token:"variable.predefined",foreground:"4864AA"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"B5CEA8"},{token:"number.hex",foreground:"5BB498"},{token:"regexp",foreground:"B46695"},{token:"annotation",foreground:"cc6666"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"DCDCDC"},{token:"delimiter.html",foreground:"808080"},{token:"delimiter.xml",foreground:"808080"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"A79873"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"DD6A6F"},{token:"metatag.content.html",foreground:"9CDCFE"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key.json",foreground:"9CDCFE"},{token:"string.value.json",foreground:"CE9178"},{token:"attribute.name",foreground:"9CDCFE"},{token:"attribute.value",foreground:"CE9178"},{token:"attribute.value.number.css",foreground:"B5CEA8"},{token:"attribute.value.unit.css",foreground:"B5CEA8"},{token:"attribute.value.hex.css",foreground:"D4D4D4"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"keyword.json",foreground:"CE9178"},{token:"keyword.flow.scss",foreground:"569CD6"},{token:"operator.scss",foreground:"909090"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[Sm]:"#1E1E1E",[Lm]:"#D4D4D4",[Vm]:"#3A3D41",[X_]:"#404040",[nv]:"#707070",[Hm]:"#ADD6FF26"}},_7={base:"hc-black",inherit:!1,rules:[{token:"",foreground:"FFFFFF",background:"000000"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"1AEBFF"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"FFFFFF"},{token:"regexp",foreground:"C0C0C0"},{token:"annotation",foreground:"569CD6"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"FFFF00"},{token:"delimiter.html",foreground:"FFFF00"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta",foreground:"D4D4D4"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"569CD6"},{token:"metatag.content.html",foreground:"1AEBFF"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key",foreground:"9CDCFE"},{token:"string.value",foreground:"CE9178"},{token:"attribute.name",foreground:"569CD6"},{token:"attribute.value",foreground:"3FF23F"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[Sm]:"#000000",[Lm]:"#FFFFFF",[X_]:"#FFFFFF",[nv]:"#FFFFFF"}},v7={base:"hc-light",inherit:!1,rules:[{token:"",foreground:"292929",background:"FFFFFF"},{token:"invalid",foreground:"B5200D"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"264F70"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"B5200D"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"264F78"},{token:"attribute.value",foreground:"0451A5"},{token:"string",foreground:"A31515"},{token:"string.sql",foreground:"B5200D"},{token:"keyword",foreground:"0000FF"},{token:"keyword.flow",foreground:"AF00DB"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[Sm]:"#FFFFFF",[Lm]:"#292929",[X_]:"#292929",[nv]:"#292929"}};class b7{getIcon(e){const t=iR();let i=e.defaults;for(;ta.isThemeIcon(i);){const e=t.getIcon(i.id);if(!e)return;i=e.defaults}return i}}const C7="vs",w7="vs-dark",y7="hc-black",S7="hc-light",L7=jl.as(Lp),k7=jl.as(W_);class D7{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(x7(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 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,lc.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=N7(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,lc.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);return i||(!1!==t?this.getDefault(e):void 0)}getDefault(e){let t=this.defaultColors[e];return t||(t=L7.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case C7:return R_.LIGHT;case y7:return R_.HIGH_CONTRAST_DARK;case S7:return R_.HIGH_CONTRAST_LIGHT;default:return R_.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const i=N7(this.themeData.base);e=i.rules,i.encodedTokensColors&&(t=i.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const t={token:""};i&&(t.foreground=i),n&&(t.background=n),e.push(t)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=c7.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const n=this.tokenTheme._match([e].concat(t).join(".")).metadata,s=Gg.getForeground(n),o=Gg.getFontStyle(n);return{foreground:s,italic:Boolean(1&o),bold:Boolean(2&o),underline:Boolean(4&o),strikethrough:Boolean(8&o)}}}function x7(e){return e===C7||e===w7||e===y7||e===S7}function N7(e){switch(e){case C7:return m7;case w7:return f7;case y7:return _7;case S7:return v7}}function E7(e){const t=N7(e);return new D7(e,t)}Lh(class extends bh{constructor(){super({id:"editor.action.toggleHighContrast",label:BJ.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(j4),n=i.getColorTheme();A_(n.type)?(i.setTheme(this._originalThemeName||(O_(n.type)?w7:C7)),this._originalThemeName=null):(i.setTheme(O_(n.type)?y7:S7),this._originalThemeName=n.themeName)}});class I7 extends rh{constructor(){super({id:I7.ID,title:{value:ue(0,"Toggle Tab Key Moves Focus"),original:"Toggle Tab Key Moves Focus"},precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},f1:!0})}run(){const e=!XR.getTabFocusMode();XR.setTabFocusMode(e),Ps(ue(0,e?"Pressing Tab will now move focus to the next focusable element":"Pressing Tab will now insert the tab character"))}}I7.ID="editor.action.toggleTabFocusMode",ah(I7);Lh(class extends bh{constructor(){super({id:"editor.action.forceRetokenize",label:ue(0,"Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const n=new F;i.tokenization.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}});var M7=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},T7=function(e,t){return function(i,n){t(i,n,e)}};let R7=class extends E{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}constructor(e,t,i={},n){var s;super(),this._link=t,this._enabled=!0,this.el=ds(e,fs("a.monaco-link",{tabIndex:null!==(s=t.tabIndex)&&void 0!==s?s:0,href:t.href,title:t.title},t.label)),this.el.setAttribute("role","button");const o=this._register(new Ky(this.el,"click")),r=this._register(new Ky(this.el,"keypress")),a=B.chain(r.event,(e=>e.map((e=>new St(e))).filter((e=>3===e.keyCode)))),l=this._register(new Ky(this.el,$L.Tap)).event;this._register(ZL.addTarget(this.el));const h=B.any(o.event,a,l);this._register(h((e=>{this.enabled&&(as(e,!0),(null==i?void 0:i.opener)?i.opener(this._link.href):n.open(this._link.href,{allowCommands:!0}))}))),this.enabled=!0}};R7=M7([T7(3,qk)],R7);var A7=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},O7=function(e,t){return function(i,n){t(i,n,e)}};let P7=class extends E{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(F7))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show(Object.assign(Object.assign({},e),{onClose:()=>{var t;this.hide(),null===(t=e.onClose)||void 0===t||t.call(e)}})),this._editor.setBanner(this.banner.element,26)}};P7=A7([O7(1,Fa)],P7);let F7=class extends E{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(Jk,{}),this.element=fs("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){return e.ariaLabel?e.ariaLabel:"string"==typeof e.message?e.message:void 0}getBannerMessage(e){if("string"==typeof e){const t=fs("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){Dn(this.element)}show(e){Dn(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=ds(this.element,fs("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(fs(`div${ta.asCSSSelector(e.icon)}`));const n=ds(this.element,fs("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=ds(this.element,fs("div.message-actions-container")),e.actions)for(const o of e.actions)this._register(this.instantiationService.createInstance(R7,this.messageActionsContainer,Object.assign(Object.assign({},o),{tabIndex:-1}),{}));const s=ds(this.element,fs("div.action-container"));this.actionBar=this._register(new Rx(s)),this.actionBar.push(this._register(new Ka("banner.close","Close Banner",ta.asClassName(rR),!0,(()=>{"function"==typeof e.onClose&&e.onClose()}))),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};F7=A7([O7(0,Fa)],F7);const B7=Ba("workspaceTrustManagementService");var W7=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},V7=function(e,t){return function(i,n){t(i,n,e)}},H7=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const z7=tR("extensions-warning-message",Jr.warning,ue(0,"Icon shown with a warning message in the extensions editor."));let U7=class extends E{constructor(e,t,i,n){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=e=>{if(e&&e.hasMore){if(this._bannerClosed)return;const t=Math.max(e.ambiguousCharacterCount,e.nonBasicAsciiCharacterCount,e.invisibleCharacterCount);let i;if(e.nonBasicAsciiCharacterCount>=t)i={message:ue(0,"This document contains many non-basic ASCII unicode characters"),command:new t8};else if(e.ambiguousCharacterCount>=t)i={message:ue(0,"This document contains many ambiguous unicode characters"),command:new J7};else{if(!(e.invisibleCharacterCount>=t))throw new Error("Unreachable");i={message:ue(0,"This document contains many invisible unicode characters"),command:new e8}}this._bannerController.show({id:"unicodeHighlightBanner",message:i.message,icon:z7,actions:[{label:i.command.shortLabel,href:`command:${i.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(n.createInstance(P7,e)),this._register(this._editor.onDidChangeModel((()=>{this._bannerClosed=!1,this._updateHighlighter()}))),this._options=e.getOption(124),this._register(i.onDidChangeTrust((e=>{this._updateHighlighter()}))),this._register(e.onDidChangeConfiguration((t=>{t.hasChanged(124)&&(this._options=e.getOption(124),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=function(e,t){return{nonBasicASCII:t.nonBasicASCII===FS?!e:t.nonBasicASCII,ambiguousCharacters:t.ambiguousCharacters,invisibleCharacters:t.invisibleCharacters,includeComments:t.includeComments===FS?!e:t.includeComments,includeStrings:t.includeStrings===FS?!e:t.includeStrings,allowedCharacters:t.allowedCharacters,allowedLocales:t.allowedLocales}}(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every((e=>!1===e)))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map((e=>e.codePointAt(0))),allowedLocales:Object.keys(e.allowedLocales).map((e=>{if("_os"===e){return(new Intl.NumberFormat).resolvedOptions().locale}return"_vscode"===e?Ke:e}))};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new K7(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new j7(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};U7.ID="editor.contrib.unicodeHighlighter",U7=W7([V7(1,fG),V7(2,B7),V7(3,Fa)],U7);let K7=class extends E{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 rd((()=>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())return void this._decorations.clear();const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then((t=>{if(this._model.isDisposed())return;if(this._model.getVersionId()!==e)return;this._updateState(t);const i=[];if(!t.hasMore)for(const e of t.ranges)i.push({range:e,options:Y7.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)}))}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!nB(t,e))return null;return{reason:Z7(t.getValueInRange(e.range),this._options),inComment:sB(t,e),inString:oB(t,e)}}};K7=W7([V7(3,fG)],K7);class j7 extends E{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 rd((()=>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())return void this._decorations.clear();const e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const n of e){const e=cM.computeUnicodeHighlights(this._model,this._options,n);for(const t of e.ranges)i.ranges.push(t);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||e.hasMore}if(!i.hasMore)for(const n of i.ranges)t.push({range:n,options:Y7.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 nB(t,e)?{reason:Z7(i,this._options),inComment:sB(t,e),inString:oB(t,e)}:null}}let q7=class{constructor(e,t,i){this._editor=e,this._languageService=t,this._openerService=i,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||1!==e.type)return[];const i=this._editor.getModel(),n=this._editor.getContribution(U7.ID);if(!n)return[];const s=[],o=new Set;let r=300;for(const a of t){const e=n.getDecorationInfo(a);if(!e)continue;const t=i.getValueInRange(a.range).codePointAt(0),l=G7(t);let h;switch(e.reason.kind){case 0:h=To(e.reason.confusableWith)?ue(0,"The character {0} could be confused with the ASCII character {1}, which is more common in source code.",l,G7(e.reason.confusableWith.codePointAt(0))):ue(0,"The character {0} could be confused with the character {1}, which is more common in source code.",l,G7(e.reason.confusableWith.codePointAt(0)));break;case 1:h=ue(0,"The character {0} is invisible.",l);break;case 2:h=ue(0,"The character {0} is not a basic ASCII character.",l)}if(o.has(h))continue;o.add(h);const d={codePoint:t,reason:e.reason,inComment:e.inComment,inString:e.inString},c=ue(0,"Adjust settings"),u=`command:${i8.ID}?${encodeURIComponent(JSON.stringify(d))}`,g=new Ta("",!0).appendMarkdown(h).appendText(" ").appendLink(u,c);s.push(new BK(this,a.range,[g],!1,r++))}return s}renderHoverParts(e,t){return VK(e,t,this._editor,this._languageService,this._openerService)}};function $7(e){return`U+${e.toString(16).padStart(4,"0")}`}function G7(e){let t=`\`${$7(e)}\``;return jo.isInvisibleCharacter(e)||(t+=` "${function(e){if(96===e)return"`` ` ``";return"`"+String.fromCodePoint(e)+"`"}(e)}"`),t}function Z7(e,t){return cM.computeUnicodeHighlightReason(e,t)}q7=W7([V7(1,Lc),V7(2,qk)],q7);class Y7{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=Iw.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,n)),n}}Y7.instance=new Y7;class X7 extends bh{constructor(){super({id:J7.ID,label:ue(0,"Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=ue(0,"Disable Highlight In Comments")}run(e,t,i){return H7(this,void 0,void 0,(function*(){const t=null==e?void 0:e.get(pu);t&&this.runAction(t)}))}runAction(e){return H7(this,void 0,void 0,(function*(){yield e.updateValue(zS,!1,2)}))}}class Q7 extends bh{constructor(){super({id:J7.ID,label:ue(0,"Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=ue(0,"Disable Highlight In Strings")}run(e,t,i){return H7(this,void 0,void 0,(function*(){const t=null==e?void 0:e.get(pu);t&&this.runAction(t)}))}runAction(e){return H7(this,void 0,void 0,(function*(){yield e.updateValue(US,!1,2)}))}}class J7 extends bh{constructor(){super({id:J7.ID,label:ue(0,"Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=ue(0,"Disable Ambiguous Highlight")}run(e,t,i){return H7(this,void 0,void 0,(function*(){const t=null==e?void 0:e.get(pu);t&&this.runAction(t)}))}runAction(e){return H7(this,void 0,void 0,(function*(){yield e.updateValue(HS,!1,2)}))}}J7.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";class e8 extends bh{constructor(){super({id:e8.ID,label:ue(0,"Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=ue(0,"Disable Invisible Highlight")}run(e,t,i){return H7(this,void 0,void 0,(function*(){const t=null==e?void 0:e.get(pu);t&&this.runAction(t)}))}runAction(e){return H7(this,void 0,void 0,(function*(){yield e.updateValue(WS,!1,2)}))}}e8.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";class t8 extends bh{constructor(){super({id:t8.ID,label:ue(0,"Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=ue(0,"Disable Non ASCII Highlight")}run(e,t,i){return H7(this,void 0,void 0,(function*(){const t=null==e?void 0:e.get(pu);t&&this.runAction(t)}))}runAction(e){return H7(this,void 0,void 0,(function*(){yield e.updateValue(VS,!1,2)}))}}t8.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";class i8 extends bh{constructor(){super({id:i8.ID,label:ue(0,"Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}run(e,t,i){return H7(this,void 0,void 0,(function*(){const{codePoint:t,reason:n,inString:s,inComment:o}=i,r=String.fromCodePoint(t),a=e.get(cE),l=e.get(pu);const h=[];if(0===n.kind)for(const e of n.notAmbiguousInLocales)h.push({label:ue(0,'Allow unicode characters that are more common in the language "{0}".',e),run:()=>H7(this,void 0,void 0,(function*(){n8(l,[e])}))});if(h.push({label:function(e){return jo.isInvisibleCharacter(e)?ue(0,"Exclude {0} (invisible character) from being highlighted",$7(e)):ue(0,"Exclude {0} from being highlighted",`${$7(e)} "${r}"`)}(t),run:()=>function(e,t){return H7(this,void 0,void 0,(function*(){const i=e.getValue(BS);let n;n="object"==typeof i&&i?i:{};for(const e of t)n[String.fromCodePoint(e)]=!0;yield e.updateValue(BS,n,2)}))}(l,[t])}),o){const e=new X7;h.push({label:e.label,run:()=>H7(this,void 0,void 0,(function*(){return e.runAction(l)}))})}else if(s){const e=new Q7;h.push({label:e.label,run:()=>H7(this,void 0,void 0,(function*(){return e.runAction(l)}))})}if(0===n.kind){const e=new J7;h.push({label:e.label,run:()=>H7(this,void 0,void 0,(function*(){return e.runAction(l)}))})}else if(1===n.kind){const e=new e8;h.push({label:e.label,run:()=>H7(this,void 0,void 0,(function*(){return e.runAction(l)}))})}else if(2===n.kind){const e=new t8;h.push({label:e.label,run:()=>H7(this,void 0,void 0,(function*(){return e.runAction(l)}))})}else!function(e){throw new Error(`Unexpected value: ${e}`)}(n);const d=yield a.pick(h,{title:ue(0,"Configure Unicode Highlight Options")});d&&(yield d.run())}))}}function n8(e,t){var i;return H7(this,void 0,void 0,(function*(){const n=null===(i=e.inspect(KS).user)||void 0===i?void 0:i.value;let s;s="object"==typeof n&&n?Object.assign({},n):{};for(const e of t)s[e]=!0;yield e.updateValue(KS,s,2)}))}i8.ID="editor.action.unicodeHighlight.showExcludeOptions",Lh(J7),Lh(e8),Lh(t8),Lh(i8),Dh(U7.ID,U7,1),gK.register(q7);var s8=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},o8=function(e,t){return function(i,n){t(i,n,e)}},r8=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const a8="ignoreUnusualLineTerminators";let l8=class extends E{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(125),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(125)&&(this._config=this._editor.getOption(125),this._checkForUnusualLineTerminators())}))),this._register(this._editor.onDidChangeModel((()=>{this._checkForUnusualLineTerminators()}))),this._register(this._editor.onDidChangeModelContent((e=>{e.isUndoing||this._checkForUnusualLineTerminators()}))),this._checkForUnusualLineTerminators()}_checkForUnusualLineTerminators(){return r8(this,void 0,void 0,(function*(){if("off"===this._config)return;if(!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators())return;const t=function(e,t){return e.getModelProperty(t.uri,a8)}(this._codeEditorService,e);if(!0===t)return;if(this._editor.getOption(90))return;if("auto"===this._config)return void e.removeUnusualLineTerminators(this._editor.getSelections());if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=yield this._dialogService.confirm({title:ue(0,"Unusual Line Terminators"),message:ue(0,"Detected unusual line terminators"),detail:ue(0,"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`.",wa(e.uri)),primaryButton:ue(0,"&&Remove Unusual Line Terminators"),cancelButton:ue(0,"Ignore")})}finally{this._isPresentingDialog=!1}i.confirmed?e.removeUnusualLineTerminators(this._editor.getSelections()):function(e,t,i){e.setModelProperty(t.uri,a8,i)}(this._codeEditorService,e,!0)}))}};l8.ID="editor.contrib.unusualLineTerminatorsDetector",l8=s8([o8(1,x3),o8(2,Wa)],l8),Dh(l8.ID,l8,1);var h8,d8=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},c8=function(e,t){return function(i,n){t(i,n,e)}};const u8=new Al("hasWordHighlights",!1);function g8(e,t,i,n){return nd(e.ordered(t).map((e=>()=>Promise.resolve(e.provideDocumentHighlights(t,i,n)).then(void 0,a))),Hd)}class p8{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=Yh((e=>this._compute(this._model,this._selection,this._wordSeparators,e)))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new Rh(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const n=t.startLineNumber,s=t.startColumn,o=t.endColumn,r=this._getCurrentWordRange(e,t);let a=Boolean(this._wordRange&&this._wordRange.equalsRange(r));for(let l=0,h=i.length;!a&&l=o&&(a=!0)}return a}cancel(){this.result.cancel()}}class m8 extends p8{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return g8(this._providers,e,t.getPosition(),n).then((e=>e||[]))}}class f8 extends p8{constructor(e,t,i){super(e,t,i),this._selectionIsEmpty=t.isEmpty()}_compute(e,t,i,n){return td(250,n).then((()=>{if(!t.isEmpty())return[];const n=e.getWordAtPosition(t.getPosition());if(!n||n.word.length>1e3)return[];return e.findMatches(n.word,!0,!1,!0,i,!1).map((e=>({range:e.range,kind:fC.Text})))}))}isValid(e,t,i){const n=t.isEmpty();return this._selectionIsEmpty===n&&super.isValid(e,t,i)}}yh("_executeDocumentHighlights",((e,t,i)=>g8(e.get(oL).documentHighlightProvider,t,i,Uh.None)));class _8{constructor(e,t,i,n){this.toUnhook=new N,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=[],this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this.linkedHighlighters=i,this._hasWordHighlights=u8.bindTo(n),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(80),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition((e=>{this._ignorePositionChangeEvent||this.occurrencesHighlight&&this._onPositionChanged(e)}))),this.toUnhook.add(e.onDidChangeModelContent((e=>{this._stopAll()}))),this.toUnhook.add(e.onDidChangeConfiguration((e=>{const t=this.editor.getOption(80);this.occurrencesHighlight!==t&&(this.occurrencesHighlight=t,this._stopAll())}))),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight&&this._run()}_getSortedHighlights(){return this.decorations.getRanges().sort(Rh.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),t=e.findIndex((e=>e.containsPosition(this.editor.getPosition()))),i=(t+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const t=this._getWord();if(t){Ps(`${this.editor.getModel().getLineContent(n.startLineNumber)}, ${i+1} of ${e.length} for '${t.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),t=e.findIndex((e=>e.containsPosition(this.editor.getPosition()))),i=(t-1+e.length)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const t=this._getWord();if(t){Ps(`${this.editor.getModel().getLineContent(n.startLineNumber)}, ${i+1} of ${e.length} for '${t.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeDecorations(){this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1))}_stopAll(){this._removeDecorations(),-1!==this.renderDecorationsTimer&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),null!==this.workerRequest&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){this.occurrencesHighlight&&3===e.reason?this._run():this._stopAll()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.getWordAtPosition({lineNumber:t,column:i})}_run(){const e=this.editor.getSelection();if(e.startLineNumber!==e.endLineNumber)return void this._stopAll();const t=e.startColumn,i=e.endColumn,n=this._getWord();if(!n||n.startColumn>t||n.endColumn{e===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=t||[],this._beginRenderDecorations())}),r)}}_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=[];for(const i of this.workerRequestValue)i.range&&e.push({range:i.range,options:(t=i.kind,t===fC.Write?W5:t===fC.Text?V5:U5)});var t;this.decorations.set(e),this._hasWordHighlights.set(this.hasDecorations());for(const i of this.linkedHighlighters())(null==i?void 0:i.editor.getModel())===this.editor.getModel()&&(i._stopAll(),i.decorations.set(e),i._hasWordHighlights.set(i.hasDecorations()))}dispose(){this._stopAll(),this.toUnhook.dispose()}}let v8=h8=class extends E{static get(e){return e.getContribution(h8.ID)}constructor(e,t,i){super(),this.wordHighlighter=null,this.linkedContributions=new Set;const n=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this.wordHighlighter=new _8(e,i.documentHighlightProvider,(()=>v.map(this.linkedContributions,(e=>e.wordHighlighter))),t))};this._register(e.onDidChangeModel((e=>{this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),n()}))),n()}saveViewState(){return!(!this.wordHighlighter||!this.wordHighlighter.hasDecorations())}moveNext(){var e;null===(e=this.wordHighlighter)||void 0===e||e.moveNext()}moveBack(){var e;null===(e=this.wordHighlighter)||void 0===e||e.moveBack()}restoreViewState(e){this.wordHighlighter&&e&&this.wordHighlighter.restore()}dispose(){this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),super.dispose()}};v8.ID="editor.contrib.wordHighlighter",v8=h8=d8([c8(1,Ol),c8(2,oL)],v8);class b8 extends bh{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=v8.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}Dh(v8.ID,v8,0),Lh(class extends b8{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:ue(0,"Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:u8,kbOpts:{kbExpr:Oh.editorTextFocus,primary:65,weight:100}})}}),Lh(class extends b8{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:ue(0,"Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:u8,kbOpts:{kbExpr:Oh.editorTextFocus,primary:1089,weight:100}})}}),Lh(class extends bh{constructor(){super({id:"editor.action.wordHighlight.trigger",label:ue(0,"Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:u8.toNegated(),kbOpts:{kbExpr:Oh.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const n=v8.get(t);n&&n.restoreViewState(!0)}});class C8 extends vh{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=Gb(t.getOption(129)),s=t.getModel(),o=t.getSelections().map((e=>{const t=new Va(e.positionLineNumber,e.positionColumn),i=this._move(n,s,t,this._wordNavigationType);return this._moveTo(e,i,this._inSelectionMode)}));if(s.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,o.map((e=>Kw.fromModelSelection(e)))),1===o.length){const e=new Va(o[0].positionLineNumber,o[0].positionColumn);t.revealPosition(e,0)}}_moveTo(e,t,i){return i?new Ah(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new Ah(t.lineNumber,t.column,t.lineNumber,t.column)}}class w8 extends C8{_move(e,t,i,n){return ry.moveWordLeft(e,t,i,n)}}class y8 extends C8{_move(e,t,i,n){return ry.moveWordRight(e,t,i,n)}}class S8 extends vh{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e.get(Ju);if(!t.hasModel())return;const s=Gb(t.getOption(129)),o=t.getModel(),r=t.getSelections(),a=t.getOption(6),l=t.getOption(11),h=n.getLanguageConfiguration(o.getLanguageId()).getAutoClosingPairs(),d=t._getViewModel(),c=r.map((e=>{const i=this._delete({wordSeparators:s,model:o,selection:e,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:a,autoClosingQuotes:l,autoClosingPairs:h,autoClosedCharacters:d.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Xw(i,"")}));t.pushUndoStop(),t.executeCommands(this.id,c),t.pushUndoStop()}}class L8 extends S8{_delete(e,t){const i=ry.deleteWordLeft(e,t);return i||new Rh(1,1,1,1)}}class k8 extends S8{_delete(e,t){const i=ry.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),s=e.model.getLineMaxColumn(n);return new Rh(n,s,n,s)}}Sh(new class extends w8{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}),Sh(new class extends w8{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}),Sh(new class extends w8{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:pl.and(Oh.textInputFocus,null===(e=pl.and(JR,AH))||void 0===e?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}),Sh(new class extends w8{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}),Sh(new class extends w8{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}),Sh(new class extends w8{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:pl.and(Oh.textInputFocus,null===(e=pl.and(JR,AH))||void 0===e?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}),Sh(new class extends y8{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}),Sh(new class extends y8{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:pl.and(Oh.textInputFocus,null===(e=pl.and(JR,AH))||void 0===e?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}),Sh(new class extends y8{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}),Sh(new class extends y8{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}),Sh(new class extends y8{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:pl.and(Oh.textInputFocus,null===(e=pl.and(JR,AH))||void 0===e?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}),Sh(new class extends y8{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}),Sh(new class extends w8{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n){return super._move(Gb(ZS.wordSeparators.defaultValue),t,i,n)}}),Sh(new class extends w8{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n){return super._move(Gb(ZS.wordSeparators.defaultValue),t,i,n)}}),Sh(new class extends y8{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n){return super._move(Gb(ZS.wordSeparators.defaultValue),t,i,n)}}),Sh(new class extends y8{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n){return super._move(Gb(ZS.wordSeparators.defaultValue),t,i,n)}}),Sh(new class extends L8{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:Oh.writable})}}),Sh(new class extends L8{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:Oh.writable})}}),Sh(new class extends L8{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:Oh.writable,kbOpts:{kbExpr:Oh.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}),Sh(new class extends k8{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:Oh.writable})}}),Sh(new class extends k8{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:Oh.writable})}}),Sh(new class extends k8{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:Oh.writable,kbOpts:{kbExpr:Oh.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}),Lh(class extends bh{constructor(){super({id:"deleteInsideWord",precondition:Oh.writable,label:ue(0,"Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const n=Gb(t.getOption(129)),s=t.getModel(),o=t.getSelections().map((e=>{const t=ry.deleteInsideWord(n,s,e);return new Xw(t,"")}));t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}});class D8 extends C8{_move(e,t,i,n){return ay.moveWordPartLeft(e,t,i)}}Xa.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");Xa.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class x8 extends C8{_move(e,t,i,n){return ay.moveWordPartRight(e,t,i)}}Sh(new class extends S8{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:Oh.writable,kbOpts:{kbExpr:Oh.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=ay.deleteWordPartLeft(e);return i||new Rh(1,1,1,1)}}),Sh(new class extends S8{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:Oh.writable,kbOpts:{kbExpr:Oh.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=ay.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),s=e.model.getLineMaxColumn(n);return new Rh(n,s,n,s)}}),Sh(new class extends D8{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:Oh.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}),Sh(new class extends D8{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:Oh.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}),Sh(new class extends x8{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:Oh.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}),Sh(new class extends x8{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:Oh.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}});class N8 extends xT{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||"function"!=typeof this._foreignModuleHost[e])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(Mre){return Promise.reject(Mre)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then((e=>{const t=this._foreignModuleHost?bd(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then((t=>{this._foreignModuleCreateData=null;const i=(t,i)=>e.fmr(t,i),n=(e,t)=>function(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)},s={};for(const e of t)s[e]=n(e,i);return s}))}))),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then((e=>this.getProxy()))}}function E8(e){return!function(e){return Array.isArray(e)}(e)}function I8(e){return"string"==typeof e}function M8(e){return!I8(e)}function T8(e){return!e}function R8(e,t){return e.ignoreCase&&t?t.toLowerCase():t}function A8(e){return e.replace(/[&<>'"_]/g,"-")}function O8(e,t){console.log(`${e.languageId}: ${t}`)}function P8(e,t){return new Error(`${e.languageId}: ${t}`)}function F8(e,t,i,n,s){let o=null;return t.replace(/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g,(function(t,r,a,l,h,d,c,u,g){return T8(a)?T8(l)?!T8(h)&&h0;){const t=e.tokenizer[i];if(t)return t;const n=i.lastIndexOf(".");i=n<0?null:i.substr(0,n)}return null}var W8,V8=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},H8=function(e,t){return function(i,n){t(i,n,e)}};class z8{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(null!==e&&e.depth>=this._maxCacheDepth)return new U8(e,t);let i=U8.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let n=this._entries[i];return n||(n=new U8(e,t),this._entries[i]=n,n)}}z8._INSTANCE=new z8(5);class U8{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;null!==e;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;null!==e&&null!==t;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return null===e&&null===t}equals(e){return U8._equals(this,e)}push(e){return z8.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return z8.create(this.parent,e)}}class K8{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 K8(this.languageId,this.state)}}class j8{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(null!==t)return new q8(e,t);if(null!==e&&e.depth>=this._maxCacheDepth)return new q8(e,t);const i=U8.getStackElementId(e);let n=this._entries[i];return n||(n=new q8(e,null),this._entries[i]=n,n)}}j8._INSTANCE=new j8(5);class q8{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:j8.create(this.stack,this.embeddedLanguageData)}equals(e){return e instanceof q8&&(!!this.stack.equals(e.stack)&&(null===this.embeddedLanguageData&&null===e.embeddedLanguageData||null!==this.embeddedLanguageData&&null!==e.embeddedLanguageData&&this.embeddedLanguageData.equals(e.embeddedLanguageData)))}}class $8{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 bC(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,n){const s=i.languageId,o=i.state,r=EC.get(s);if(!r)return this.enterLanguage(s),this.emit(n,""),o;const a=r.tokenize(e,t,o);if(0!==n)for(const l of a.tokens)this._tokens.push(new bC(l.offset+n,l.type,l.language));else this._tokens=this._tokens.concat(a.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,a.endState}finalize(e){return new CC(this._tokens,e)}}class G8{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const i=1024|this._theme.match(this._currentLanguageId,t);this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){const n=null!==e?e.length:0,s=t.length,o=null!==i?i.length:0;if(0===n&&0===s&&0===o)return new Uint32Array(0);if(0===n&&0===s)return i;if(0===s&&0===o)return e;const r=new Uint32Array(n+s+o);null!==e&&r.set(e);for(let a=0;a{if(o)return;let t=!1;for(let i=0,n=e.changedLanguages.length;i{e.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))})))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const i=EC.get(t);if(i){if(i instanceof W8){const t=i.getLoadStatus();!1===t.loaded&&e.push(t.promise)}}else EC.isResolved(t)||e.push(EC.getOrCreate(t))}return 0===e.length?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then((e=>{}))}}getInitialState(){const e=z8.create(null,this._lexer.start);return j8.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return MC(this._languageId,i);const n=new $8,s=this._tokenize(e,t,i,n);return n.finalize(s)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return TC(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const n=new G8(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),s=this._tokenize(e,t,i,n);return n.finalize(s)}_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=B8(this._lexer,t.stack.state),!i))throw P8(this._lexer,"tokenizer state is not defined: "+t.stack.state);let n=-1,s=!1;for(const o of i){if(!M8(o.action)||"@pop"!==o.action.nextEmbedded)continue;s=!0;let t=o.regex;const i=o.regex.source;if("^(?:"===i.substr(0,4)&&")"===i.substr(i.length-1,1)){const e=(t.ignoreCase?"i":"")+(t.unicode?"u":"");t=new RegExp(i.substr(4,i.length-5),e)}const r=e.search(t);-1===r||0!==r&&o.matchOnlyAtLineStart||(-1===n||r0&&s.nestedLanguageTokenize(r,!1,i.embeddedLanguageData,n);const a=e.substring(o);return this._myTokenize(a,t,i,n+o,s)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,n,s){s.enterLanguage(this._languageId);const o=e.length,r=t&&this._lexer.includeLF?e+"\n":e,a=r.length;let l=i.embeddedLanguageData,h=i.stack,d=0,c=null,u=!0;for(;u||d=a)break;u=!1;let e=this._lexer.tokenizer[m];if(!e&&(e=B8(this._lexer,m),!e))throw P8(this._lexer,"tokenizer state is not defined: "+m);const t=r.substr(d);for(const i of e)if((0===d||!i.matchOnlyAtLineStart)&&(f=t.match(i.regex),f)){_=f[0],v=i.action;break}}if(f||(f=[""],_=""),v||(d=this._lexer.maxStack)throw P8(this._lexer,"maximum tokenizer stack size reached: ["+h.state+","+h.parent.state+",...]");h=h.push(m)}else if("@pop"===v.next){if(h.depth<=1)throw P8(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(b));h=h.pop()}else if("@popall"===v.next)h=h.popall();else{let e=F8(this._lexer,v.next,_,f,m);if("@"===e[0]&&(e=e.substr(1)),!B8(this._lexer,e))throw P8(this._lexer,"trying to set a next state '"+e+"' that is undefined in rule: "+this._safeRuleName(b));h=h.push(e)}}v.log&&"string"==typeof v.log&&O8(this._lexer,this._lexer.languageId+": "+F8(this._lexer,v.log,_,f,m))}if(null===w)throw P8(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(b));const y=i=>{const o=this._languageService.getLanguageIdByLanguageName(i)||this._languageService.getLanguageIdByMimeType(i)||i,r=this._getNestedEmbeddedLanguageData(o);if(d0)throw P8(this._lexer,"groups cannot be nested: "+this._safeRuleName(b));if(f.length!==w.length+1)throw P8(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(b));let e=0;for(let t=1;te});class J8{static colorizeElement(e,t,i,n){const s=(n=n||{}).theme||"vs",o=n.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!o)return console.error("Mode not detected"),Promise.resolve();const r=t.getLanguageIdByMimeType(o)||o;e.setTheme(s);const a=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+s;return this.colorize(t,a||"",r,n).then((e=>{var t;const n=null!==(t=null==Q8?void 0:Q8.createHTML(e))&&void 0!==t?t:e;i.innerHTML=n}),(e=>console.error(e)))}static colorize(e,t,i,n){return X8(this,void 0,void 0,(function*(){const s=e.languageIdCodec;let o=4;n&&"number"==typeof n.tabSize&&(o=n.tabSize),Bo(t)&&(t=t.substr(1));const r=oo(t);if(!e.isRegisteredLanguageId(i))return eee(r,o,s);const a=yield EC.getOrCreate(i);return a?function(e,t,i,n){return new Promise(((s,o)=>{const r=()=>{const a=function(e,t,i,n){let s=[],o=i.getInitialState();for(let r=0,a=e.length;r"),o=l.endState}return s.join("")}(e,t,i,n);if(i instanceof Z8){const e=i.getLoadStatus();if(!1===e.loaded)return void e.promise.then(r,o)}s(a)};r()}))}(r,o,a,s):eee(r,o,s)}))}static colorizeLine(e,t,i,n,s=4){const o=cP.isBasicASCII(e,t),r=cP.containsRTL(e,o,i);return MA(new kA(!1,!0,e,!1,o,r,0,n,[],s,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 s=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(n,e.mightContainNonBasicASCII(),e.mightContainRTL(),s,i)}}function eee(e,t,i){let n=[];const s=new Uint32Array(2);s[0]=0,s[1]=33587200;for(let o=0,r=e.length;o")}return n.join("")}var tee=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},iee=function(e,t){return function(i,n){t(i,n,e)}},nee=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let see=class extends E{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new U),this._onCodeEditorAdd=this._register(new U),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new U),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new U),this._onDiffEditorAdd=this._register(new U),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new U),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new O,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)}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}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach((t=>t.removeDecorationsByType(e)))))}setModelProperty(e,t,i){const n=e.toString();let s;this._modelProperties.has(n)?s=this._modelProperties.get(n):(s=new Map,this._modelProperties.set(n,s)),s.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i)){return this._modelProperties.get(i).get(t)}}openCodeEditor(e,t,i){return nee(this,void 0,void 0,(function*(){for(const n of this._codeEditorOpenHandlers){const s=yield n(e,t,i);if(null!==s)return s}return null}))}registerCodeEditorOpenHandler(e){return x(this._codeEditorOpenHandlers.unshift(e))}};see=tee([iee(0,P_)],see);var oee=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},ree=function(e,t){return function(i,n){t(i,n,e)}},aee=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let lee=class extends see{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(((e,t,i)=>aee(this,void 0,void 0,(function*(){return t?this.doOpenEditor(t,e):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 i=t.resource.scheme;if(i===vn.http||i===vn.https)return Cs(t.resource.toString()),e}return null}const i=t.options?t.options.selection:null;if(i)if("number"==typeof i.endLineNumber&&"number"==typeof i.endColumn)e.setSelection(i),e.revealRangeInCenter(i,1);else{const t={lineNumber:i.startLineNumber,column:i.startColumn};e.setPosition(t),e.revealPositionInCenter(t,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};lee=oee([ree(0,Ol),ree(1,P_)],lee),yu(Wa,lee,0);const hee=Ba("layoutService");var dee=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},cee=function(e,t){return function(i,n){t(i,n,e)}};let uee=class{get dimension(){return this._dimension||(this._dimension=Fn(window.document.body)),this._dimension}get hasContainer(){return!1}get container(){throw new Error("ILayoutService.container is not available in the standalone editor!")}focus(){var e;null===(e=this._codeEditorService.getFocusedCodeEditor())||void 0===e||e.focus()}constructor(e){this._codeEditorService=e,this.onDidLayout=B.None,this.offset={top:0,quickPickTop:0}}};uee=dee([cee(0,Wa)],uee);let gee=class extends uee{get hasContainer(){return!1}get container(){return this._container}constructor(e,t){super(t),this._container=e}};gee=dee([cee(1,Wa)],gee),yu(hee,uee,1);var pee=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},mee=function(e,t){return function(i,n){t(i,n,e)}},fee=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const _ee=!1;function vee(e){return e.scheme===vn.file?e.fsPath:e.path}let bee=0;class Cee{constructor(e,t,i,n,s,o,r){this.id=++bee,this.type=0,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=s,this.sourceId=o,this.sourceOrder=r,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}`}}class wee{constructor(e,t){this.resourceLabel=e,this.reason=t}}class yee{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,n]of this.elements){(0===n.reason?e:t).push(n.resourceLabel)}const i=[];return e.length>0&&i.push(ue(0,"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(ue(0,"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join("\n")}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 See{constructor(e,t,i,n,s,o,r){this.id=++bee,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=n,this.groupOrder=s,this.sourceId=o,this.sourceOrder=r,this.removedResources=null,this.invalidatedResources=null}canSplit(){return"function"==typeof this.actual.split}removeResource(e,t,i){this.removedResources||(this.removedResources=new yee),this.removedResources.has(t)||this.removedResources.set(t,new wee(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),0===this.invalidatedResources.size&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new yee),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new wee(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class Lee{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)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);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("\n")}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){1===e.type?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)1===t.type&&t.removeResource(this.resourceLabel,this.strResource,1);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 dw(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,s=-1;for(let r=0,a=this._past.length;r=t||o.id!==e.elements[n])&&(i=!1,s=0),i||1!==o.type||o.removeResource(this.resourceLabel,this.strResource,0)}let o=-1;for(let r=this._future.length-1;r>=0;r--,n++){const s=this._future[r];i&&(n>=t||s.id!==e.elements[n])&&(i=!1,o=r),i||1!==s.type||s.removeResource(this.resourceLabel,this.strResource,0)}-1!==s&&(this._past=this._past.slice(0,s)),-1!==o&&(this._future=this._future.slice(o+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 0===this._past.length?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return 0===this._future.length?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 kee{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;tt.sourceOrder)&&(t=o,i=n))}return[t,i]}canUndo(e){if(e instanceof uw){const[,t]=this._findClosestUndoElementWithSource(e.id);return!!t}const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){return this._editStacks.get(t).hasPastElements()}return!1}_onError(e,t){r(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,s){const o=this._acquireLocks(i);let r;try{r=t()}catch(a){return o(),n.dispose(),this._onError(a,e)}return r?r.then((()=>(o(),n.dispose(),s())),(t=>(o(),n.dispose(),this._onError(t,e)))):(o(),n.dispose(),s())}_invokeWorkspacePrepare(e){return fee(this,void 0,void 0,(function*(){if(void 0===e.actual.prepareUndoRedo)return E.None;const t=e.actual.prepareUndoRedo();return void 0===t?E.None:t}))}_invokeResourcePrepare(e,t){if(1!==e.actual.type||void 0===e.actual.prepareUndoRedo)return t(E.None);const i=e.actual.prepareUndoRedo();return i?L(i)?t(i):i.then((e=>t(e))):t(E.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||Dee);return new kee(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new Nee(this._undo(e,0,!0));for(const s of t.strResources)this.removeElements(s);return this._notificationService.warn(n),new Nee}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,ue(0,"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,ue(0,"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const s=[];for(const r of i.editStacks)r.getClosestPastElement()!==t&&s.push(r.resourceLabel);if(s.length>0)return this._tryToSplitAndUndo(e,t,null,ue(0,"Could not undo '{0}' across all files because changes were made to {1}",t.label,s.join(", ")));const o=[];for(const r of i.editStacks)r.locked&&o.push(r.resourceLabel);return o.length>0?this._tryToSplitAndUndo(e,t,null,ue(0,"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,o.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,ue(0,"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),s=this._checkWorkspaceUndo(e,t,n,!1);return s?s.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 i=t.getSecondClosestPastElement();if(i&&i.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}_confirmAndExecuteWorkspaceUndo(e,t,i,n){return fee(this,void 0,void 0,(function*(){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let s;!function(e){e[e.All=0]="All",e[e.This=1]="This",e[e.Cancel=2]="Cancel"}(s||(s={}));const{result:o}=yield this._dialogService.prompt({type:gL.Info,message:ue(0,"Would you like to undo '{0}' across all files?",t.label),buttons:[{label:ue(0,"&&Undo in {0} Files",i.editStacks.length),run:()=>s.All},{label:ue(0,"Undo this &&File"),run:()=>s.This}],cancelButton:{run:()=>s.Cancel}});if(o===s.Cancel)return;if(o===s.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const r=this._checkWorkspaceUndo(e,t,i,!1);if(r)return r.returnValue;n=!0}let s;try{s=yield this._invokeWorkspacePrepare(t)}catch(r){return this._onError(r,t)}const o=this._checkWorkspaceUndo(e,t,i,!0);if(o)return s.dispose(),o.returnValue;for(const e of i.editStacks)e.moveBackward(t);return this._safeInvokeWithLocks(t,(()=>t.actual.undo()),i,s,(()=>this._continueUndoInGroup(t.groupId,n)))}))}_resourceUndo(e,t,i){if(t.isValid){if(!e.locked)return this._invokeResourcePrepare(t,(n=>(e.moveBackward(t),this._safeInvokeWithLocks(t,(()=>t.actual.undo()),new kee([e]),n,(()=>this._continueUndoInGroup(t.groupId,i))))));{const e=ue(0,"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(e)}}else e.flushAllElements()}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,s]of this._editStacks){const o=s.getClosestPastElement();o&&(o.groupId===e&&(!t||o.groupOrder>t.groupOrder)&&(t=o,i=n))}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);return i?this._undo(i,0,t):void 0}undo(e){if(e instanceof uw){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return"string"==typeof e?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),s=n.getClosestPastElement();if(!s)return;if(s.groupId){const[e,n]=this._findClosestUndoElementInGroup(s.groupId);if(s!==e&&n)return this._undo(n,t,i)}if((s.sourceId!==t||s.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,s);try{return 1===s.type?this._workspaceUndo(e,s,i):this._resourceUndo(n,s,i)}finally{_ee}}_confirmAndContinueUndo(e,t,i){return fee(this,void 0,void 0,(function*(){if((yield this._dialogService.confirm({message:ue(0,"Would you like to undo '{0}'?",i.label),primaryButton:ue(0,"&&Yes"),cancelButton:ue(0,"No")})).confirmed)return this._undo(e,t,!0)}))}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,s]of this._editStacks){const o=s.getClosestFutureElement();o&&(o.sourceId===e&&(!t||o.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,ue(0,"Could not redo '{0}' across all files because changes were made to {1}",t.label,s.join(", ")));const o=[];for(const r of i.editStacks)r.locked&&o.push(r.resourceLabel);return o.length>0?this._tryToSplitAndRedo(e,t,null,ue(0,"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,o.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,ue(0,"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)}_executeWorkspaceRedo(e,t,i){return fee(this,void 0,void 0,(function*(){let n;try{n=yield this._invokeWorkspacePrepare(t)}catch(o){return this._onError(o,t)}const s=this._checkWorkspaceRedo(e,t,i,!0);if(s)return n.dispose(),s.returnValue;for(const e of i.editStacks)e.moveForward(t);return this._safeInvokeWithLocks(t,(()=>t.actual.redo()),i,n,(()=>this._continueRedoInGroup(t.groupId)))}))}_resourceRedo(e,t){if(t.isValid){if(!e.locked)return this._invokeResourcePrepare(t,(i=>(e.moveForward(t),this._safeInvokeWithLocks(t,(()=>t.actual.redo()),new kee([e]),i,(()=>this._continueRedoInGroup(t.groupId))))));{const e=ue(0,"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(e)}}else e.flushAllElements()}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,s]of this._editStacks){const o=s.getClosestFutureElement();o&&(o.groupId===e&&(!t||o.groupOrder=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Iee=function(e,t){return function(i,n){t(i,n,e)}};let Mee=class extends E{constructor(e,t,i){super(),this._themeService=e,this._logService=t,this._languageService=i,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange((()=>{this._caches=new WeakMap})))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new F6(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};Mee=Eee([Iee(0,P_),Iee(1,hh),Iee(2,Lc)],Mee),yu(X6,Mee,1);var Tee=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Ree="**",Aee="/",Oee="[/\\\\]",Pee="[^/\\\\]",Fee=/\//g;function Bee(e,t){switch(e){case 0:return"";case 1:return`${Pee}*?`;default:return`(?:${Oee}|${Pee}+${Oee}${t?`|${Oee}${Pee}+`:""})*?`}}function Wee(e,t){if(!e)return[];const i=[];let n=!1,s=!1,o="";for(const r of e){switch(r){case t:if(!n&&!s){i.push(o),o="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":s=!0;break;case"]":s=!1}o+=r}return o&&i.push(o),i}function Vee(e){if(!e)return"";let t="";const i=Wee(e,Aee);if(i.every((e=>e===Ree)))t=".*";else{let e=!1;i.forEach(((n,s)=>{if(n===Ree){if(e)return;t+=Bee(2,s===i.length-1)}else{let e=!1,o="",r=!1,a="";for(const i of n)if("}"!==i&&e)o+=i;else if(!r||"]"===i&&a)switch(i){case"{":e=!0;continue;case"[":r=!0;continue;case"}":{const i=`(?:${Wee(o,",").map((e=>Vee(e))).join("|")})`;t+=i,e=!1,o="";break}case"]":t+="["+a+"]",r=!1,a="";break;case"?":t+=Pee;continue;case"*":t+=Bee(1);continue;default:t+=eo(i)}else{let e;e="-"===i?i:"^"!==i&&"!"!==i||a?i===Aee?"":eo(i):"^",a+=e}sYee(e,t))).filter((e=>e!==Zee)),e),n=i.length;if(!n)return Zee;if(1===n)return i[0];const s=function(t,n){for(let s=0,o=i.length;s!!e.allBasenames));o&&(s.allBasenames=o.allBasenames);const r=i.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);r.length&&(s.allPaths=r);return s}(i,t):(s=jee.exec(Qee(i,t)))?Jee(s[1].substr(1),i,!0):(s=qee.exec(Qee(i,t)))?Jee(s[1],i,!1):function(e){try{const t=new RegExp(`^${Vee(e)}$`);return function(i){return t.lastIndex=0,"string"==typeof i&&t.test(i)?e:null}}catch(t){return Zee}}(i),$ee.set(n,o)),Xee(o,e)}function Xee(e,t){if("string"==typeof t)return e;const i=function(i,n){return pa(i,t.base,!Fe)?e(io(i.substr(t.base.length),Ji),n):null};return i.allBasenames=e.allBasenames,i.allPaths=e.allPaths,i.basenames=e.basenames,i.patterns=e.patterns,i}function Qee(e,t){return t.trimForExclusions&&e.endsWith("/**")?e.substr(0,e.length-2):e}function Jee(e,t,i){const n=Ji===qi.sep,s=n?e:e.replace(Fee,Ji),o=Ji+s,r=qi.sep+e;let a;return a=i?function(i,a){return"string"!=typeof i||i!==s&&!i.endsWith(o)&&(n||i!==e&&!i.endsWith(r))?null:t}:function(i,o){return"string"!=typeof i||i!==s&&(n||i!==e)?null:t},a.allPaths=[(i?"*/":"./")+e],a}function ete(e,t={}){if(!e)return Gee;if("string"==typeof e||function(e){const t=e;if(!t)return!1;return"string"==typeof t.base&&"string"==typeof t.pattern}(e)){const i=Yee(e,t);if(i===Zee)return Gee;const n=function(e,t){return!!i(e,t)};return i.allBasenames&&(n.allBasenames=i.allBasenames),i.allPaths&&(n.allPaths=i.allPaths),n}return function(e,t){const i=tte(Object.getOwnPropertyNames(e).map((i=>function(e,t,i){if(!1===t)return Zee;const n=Yee(e,i);if(n===Zee)return Zee;if("boolean"==typeof t)return n;if(t){const i=t.when;if("string"==typeof i){const t=(t,s,o,r)=>{if(!r||!n(t,s))return null;const a=r(i.replace("$(basename)",(()=>o)));return Zh(a)?a.then((t=>t?e:null)):a?e:null};return t.requiresSiblings=!0,t}}return n}(i,e[i],t))).filter((e=>e!==Zee))),n=i.length;if(!n)return Zee;if(!i.some((e=>!!e.requiresSiblings))){if(1===n)return i[0];const e=function(e,t){let n;for(let s=0,o=i.length;sTee(this,void 0,void 0,(function*(){for(const e of n){const t=yield e;if("string"==typeof t)return t}return null})))():null},t=i.find((e=>!!e.allBasenames));t&&(e.allBasenames=t.allBasenames);const s=i.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);return s.length&&(e.allPaths=s),e}const s=function(e,t,n){let s,o;for(let r=0,a=i.length;rTee(this,void 0,void 0,(function*(){for(const e of o){const t=yield e;if("string"==typeof t)return t}return null})))():null},o=i.find((e=>!!e.allBasenames));o&&(s.allBasenames=o.allBasenames);const r=i.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);r.length&&(s.allPaths=r);return s}(e,t)}function tte(e,t){const i=e.filter((e=>!!e.basenames));if(i.length<2)return e;const n=i.reduce(((e,t)=>{const i=t.basenames;return i?e.concat(i):e}),[]);let s;if(t){s=[];for(let e=0,i=n.length;e{const i=t.patterns;return i?e.concat(i):e}),[]);const o=function(e,t){if("string"!=typeof e)return null;if(!t){let i;for(i=e.length;i>0;i--){const t=e.charCodeAt(i-1);if(47===t||92===t)break}t=e.substr(i)}const i=n.indexOf(t);return-1!==i?s[i]:null};o.basenames=n,o.patterns=s,o.allBasenames=n;const r=e.filter((e=>!e.basenames));return r.push(o),r}function ite(e,t,i,n,s,o){if(Array.isArray(e)){let r=0;for(const a of e){const e=ite(a,t,i,n,s,o);if(10===e)return e;e>r&&(r=e)}return r}if("string"==typeof e)return n?"*"===e?5:e===i?10:0:0;if(e){const{language:h,pattern:d,scheme:c,hasAccessToAllModels:u,notebookType:g}=e;if(!n&&!u)return 0;g&&s&&(t=s);let p=0;if(c)if(c===t.scheme)p=10;else{if("*"!==c)return 0;p=5}if(h)if(h===i)p=10;else{if("*"!==h)return 0;p=Math.max(p,5)}if(g)if(g===o)p=10;else{if("*"!==g||void 0===o)return 0;p=Math.max(p,5)}if(d){let e;if(e="string"==typeof d?d:Object.assign(Object.assign({},d),{base:$i(d.base)}),e!==t.fsPath&&(r=e,a=t.fsPath,!r||"string"!=typeof a||!ete(r)(a,void 0,l)))return 0;p=10}return p}return 0;var r,a,l}function nte(e){return"string"!=typeof e&&(Array.isArray(e)?e.every(nte):!!e.exclusive)}class ste{constructor(e,t,i,n){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=n}equals(e){var t,i;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&(null===(t=this.notebookUri)||void 0===t?void 0:t.toString())===(null===(i=e.notebookUri)||void 0===i?void 0:i.toString())}}class ote{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new U,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),x((()=>{if(i){const e=this._entries.indexOf(i);e>=0&&(this._entries.splice(e,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}}))}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(const i of this._entries)i._score>0&&t.push(i.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,(e=>t.push(e.provider))),t}orderedGroups(e){const t=[];let i,n;return this._orderedForEach(e,(e=>{i&&n===e._score?i.push(e.provider):(n=e._score,i=[e.provider],t.push(i))})),t}_orderedForEach(e,t){this._updateScores(e);for(const i of this._entries)i._score>0&&t(i)}_updateScores(e){var t,i;const n=null===(t=this._notebookInfoResolver)||void 0===t?void 0:t.call(this,e.uri),s=n?new ste(e.uri,e.getLanguageId(),n.uri,n.type):new ste(e.uri,e.getLanguageId(),void 0,void 0);if(!(null===(i=this._lastCandidate)||void 0===i?void 0:i.equals(s))){this._lastCandidate=s;for(const t of this._entries)if(t._score=ite(t.selector,s.uri,s.languageId,Id(e),s.notebookUri,s.notebookType),nte(t.selector)&&t._score>0){for(const e of this._entries)e._score=0;t._score=1e3;break}this._entries.sort(ote._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:rte(e.selector)&&!rte(t.selector)?1:!rte(e.selector)&&rte(t.selector)?-1:e._timet._time?-1:0}}function rte(e){return"string"!=typeof e&&(Array.isArray(e)?e.some(rte):Boolean(e.isBuiltin))}function ate(e){return Object.isFrozen(e)?e:function(e){if(!e||"object"!=typeof e)return e;const t=[e];for(;t.length>0;){const e=t.shift();Object.freeze(e);for(const i in e)if(pd.call(e,i)){const n=e[i];"object"!=typeof n||Object.isFrozen(n)||Wr(n)||t.push(n)}}return e}(e)}yu(oL,class{constructor(){this.referenceProvider=new ote(this._score.bind(this)),this.renameProvider=new ote(this._score.bind(this)),this.codeActionProvider=new ote(this._score.bind(this)),this.definitionProvider=new ote(this._score.bind(this)),this.typeDefinitionProvider=new ote(this._score.bind(this)),this.declarationProvider=new ote(this._score.bind(this)),this.implementationProvider=new ote(this._score.bind(this)),this.documentSymbolProvider=new ote(this._score.bind(this)),this.inlayHintsProvider=new ote(this._score.bind(this)),this.colorProvider=new ote(this._score.bind(this)),this.codeLensProvider=new ote(this._score.bind(this)),this.documentFormattingEditProvider=new ote(this._score.bind(this)),this.documentRangeFormattingEditProvider=new ote(this._score.bind(this)),this.onTypeFormattingEditProvider=new ote(this._score.bind(this)),this.signatureHelpProvider=new ote(this._score.bind(this)),this.hoverProvider=new ote(this._score.bind(this)),this.documentHighlightProvider=new ote(this._score.bind(this)),this.selectionRangeProvider=new ote(this._score.bind(this)),this.foldingRangeProvider=new ote(this._score.bind(this)),this.linkProvider=new ote(this._score.bind(this)),this.inlineCompletionsProvider=new ote(this._score.bind(this)),this.completionProvider=new ote(this._score.bind(this)),this.linkedEditingRangeProvider=new ote(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new ote(this._score.bind(this)),this.documentSemanticTokensProvider=new ote(this._score.bind(this)),this.documentOnDropEditProvider=new ote(this._score.bind(this)),this.documentPasteEditProvider=new ote(this._score.bind(this))}_score(e){var t;return null===(t=this._notebookTypeResolver)||void 0===t?void 0:t.call(this,e)}},1);class lte{constructor(e={},t=[],i=[],n){this._contents=e,this._keys=t,this._overrides=i,this.raw=n,this.overrideConfigurations=new Map}get rawConfiguration(){var e;if(!this._rawConfiguration)if(null===(e=this.raw)||void 0===e?void 0:e.length){const e=this.raw.map((e=>{if(e instanceof lte)return e;const t=new hte("");return t.parseRaw(e),t.configurationModel}));this._rawConfiguration=e.reduce(((e,t)=>t===e?t:e.merge(t)),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 0===this._keys.length&&0===Object.keys(this._contents).length&&0===this._overrides.length}getValue(e){return e?bu(this.contents,e):this.contents}inspect(e,t){const i=this.rawConfiguration.getValue(e);return{value:i,override:t?this.rawConfiguration.getOverrideValue(e,t):void 0,merged:t?this.rawConfiguration.override(t).getValue(e):i}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?bu(i,e):i:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){var t,i;const n=gd(this.contents),s=gd(this.overrides),o=[...this.keys],r=(null===(t=this.raw)||void 0===t?void 0:t.length)?[...this.raw]:[this];for(const a of e)if(r.push(...(null===(i=a.raw)||void 0===i?void 0:i.length)?a.raw:[a]),!a.isEmpty()){this.mergeContents(n,a.contents);for(const e of a.overrides){const[t]=s.filter((t=>Td(t.identifiers,e.identifiers)));t?(this.mergeContents(t.contents,e.contents),t.keys.push(...e.keys),t.keys=zd(t.keys)):s.push(gd(e))}for(const e of a.keys)-1===o.indexOf(e)&&o.push(e)}return new lte(n,o,s,r.every((e=>e instanceof lte))?void 0:r)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||"object"!=typeof t||!Object.keys(t).length)return this;const i={};for(const n of zd([...Object.keys(this.contents),...Object.keys(t)])){let e=this.contents[n];const s=t[n];s&&("object"==typeof e&&"object"==typeof s?(e=gd(e),this.mergeContents(e,s)):e=s),i[n]=e}return new lte(i,this.keys,this.overrides)}mergeContents(e,t){for(const i of Object.keys(t))i in e&&Br(e[i])&&Br(t[i])?this.mergeContents(e[i],t[i]):e[i]=gd(t[i])}getContentsForOverrideIdentifer(e){let t=null,i=null;const n=e=>{e&&(i?this.mergeContents(i,e):i=gd(e))};for(const s of this.overrides)1===s.identifiers.length&&s.identifiers[0]===e?t=s.contents:s.identifiers.includes(e)&&n(s.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);-1!==t&&(this.keys.splice(t,1),_u(this.contents,e),Wu.test(e)&&this.overrides.splice(this.overrides.findIndex((t=>Td(t.identifiers,Vu(e)))),1))}updateValue(e,t,i){fu(this.contents,e,t,(e=>console.error(e))),(i=i||-1===this.keys.indexOf(e))&&this.keys.push(e),Wu.test(e)&&this.overrides.push({identifiers:Vu(e),keys:Object.keys(this.contents[e]),contents:mu(this.contents[e],(e=>console.error(e)))})}}class hte{constructor(e){this._name=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||new lte}parseRaw(e,t){this._raw=e;const{contents:i,keys:n,overrides:s,restricted:o,hasExcludedProperties:r}=this.doParseRaw(e,t);this._configurationModel=new lte(i,n,s,r?[e]:void 0),this._restrictedConfigurations=o||[]}doParseRaw(e,t){const i=jl.as(xu).getConfigurationProperties(),n=this.filter(e,i,!0,t);return{contents:mu(e=n.raw,(e=>console.error(`Conflict in settings file ${this._name}: ${e}`))),keys:Object.keys(e),overrides:this.toOverrides(e,(e=>console.error(`Conflict in settings file ${this._name}: ${e}`))),restricted:n.restricted,hasExcludedProperties:n.hasExcludedProperties}}filter(e,t,i,n){var s,o,r;let a=!1;if(!(null==n?void 0:n.scopes)&&!(null==n?void 0:n.skipRestricted)&&!(null===(s=null==n?void 0:n.exclude)||void 0===s?void 0:s.length))return{raw:e,restricted:[],hasExcludedProperties:a};const l={},h=[];for(const d in e)if(Wu.test(d)&&i){const i=this.filter(e[d],t,!1,n);l[d]=i.raw,a=a||i.hasExcludedProperties,h.push(...i.restricted)}else{const i=t[d],s=i?void 0!==i.scope?i.scope:3:void 0;(null==i?void 0:i.restricted)&&h.push(d),(null===(o=n.exclude)||void 0===o?void 0:o.includes(d))||!(null===(r=n.include)||void 0===r?void 0:r.includes(d))&&(void 0!==s&&void 0!==n.scopes&&!n.scopes.includes(s)||n.skipRestricted&&(null==i?void 0:i.restricted))?a=!0:l[d]=e[d]}return{raw:l,restricted:h,hasExcludedProperties:a}}toOverrides(e,t){const i=[];for(const n of Object.keys(e))if(Wu.test(n)){const s={};for(const t in e[n])s[t]=e[n][t];i.push({identifiers:Vu(n),keys:Object.keys(s),contents:mu(s,t)})}return i}}class dte{constructor(e,t,i,n,s,o,r,a,l,h,d,c,u){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=n,this.defaultConfiguration=s,this.policyConfiguration=o,this.applicationConfiguration=r,this.userConfiguration=a,this.localUserConfiguration=l,this.remoteUserConfiguration=h,this.workspaceConfiguration=d,this.folderConfigurationModel=c,this.memoryConfigurationModel=u}inspect(e,t,i){const n=e.inspect(t,i);return{get value(){return ate(n.value)},get override(){return ate(n.override)},get merged(){return ate(n.merged)}}}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.inspect(this.userConfiguration,this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return void 0!==this.userInspectValue.value||void 0!==this.userInspectValue.override?{value:this.userInspectValue.value,override:this.userInspectValue.override}:void 0}}class cte{constructor(e,t,i,n,s=new lte,o=new lte,r=new Us,a=new lte,l=new Us){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=n,this._remoteUserConfiguration=s,this._workspaceConfiguration=o,this._folderConfigurations=r,this._memoryConfiguration=a,this._memoryConfigurationByResource=l,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new Us,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=new lte,this._memoryConfigurationByResource.set(i.resource,n))):n=this._memoryConfiguration,void 0===t?n.removeValue(e):n.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const n=this.getConsolidatedConfigurationModel(e,t,i),s=this.getFolderConfigurationModelForResource(t.resource,i),o=t.resource&&this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration,r=new Set;for(const a of n.overrides)for(const t of a.identifiers)void 0!==n.getOverrideValue(e,t)&&r.add(t);return new dte(e,t,n.getValue(e),r.size?[...r]: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,s||void 0,o)}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}getConsolidatedConfigurationModel(e,t,i){let n=this.getConsolidatedConfigurationModelForResource(t,i);return t.overrideIdentifier&&(n=n.override(t.overrideIdentifier)),this._policyConfiguration.isEmpty()||void 0===this._policyConfiguration.getValue(e)||(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 s=this._memoryConfigurationByResource.get(e);s&&(i=i.merge(s))}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:s}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:n,keys:s}]),e}),[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),i=this.parseConfigurationModel(e.policy),n=this.parseConfigurationModel(e.application),s=this.parseConfigurationModel(e.user),o=this.parseConfigurationModel(e.workspace),r=e.folders.reduce(((e,t)=>(e.set(an.revive(t[0]),this.parseConfigurationModel(t[1])),e)),new Us);return new cte(t,i,n,s,new lte,o,r,new lte,new Us)}static parseConfigurationModel(e){return new lte(e.contents,e.keys,e.overrides)}}class ute{constructor(e,t,i,n){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=n,this._marker="\n",this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=".".charCodeAt(0),this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const s of e.keys)this.affectedKeys.add(s);for(const[,s]of e.overrides)for(const e of s)this.affectedKeys.add(e);this._affectsConfigStr=this._marker;for(const s of this.affectedKeys)this._affectsConfigStr+=s+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=cte.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var i;const n=this._marker+e,s=this._affectsConfigStr.indexOf(n);if(s<0)return!1;const o=s+n.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){return!vd(this.previousConfiguration?this.previousConfiguration.getValue(e,t,null===(i=this.previous)||void 0===i?void 0:i.workspace):void 0,this.currentConfiguraiton.getValue(e,t,this.currentWorkspace))}return!0}}const gte={kind:0},pte={kind:1};class mte{constructor(e,t,i){var n;this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const s of e){const e=s.command;e&&"-"!==e.charAt(0)&&this._defaultBoundCommands.set(e,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=mte.handleRemovals([].concat(e).concat(t));for(let s=0,o=this._keybindings.length;s=0;n--){const e=i[n];if(e.command===t.command)continue;let s=!0;for(let i=1;i=0;n--){const e=i[n];if(t.contextMatchesRules(e.when))return e}return i[i.length-1]}resolve(e,t,i){const n=[...t,i];this._log(`| Resolving ${n}`);const s=this._map.get(n[0]);if(void 0===s)return this._log("\\ No keybinding entries."),gte;let o=null;if(n.length<2)o=s;else{o=[];for(let e=0,t=s.length;et.chords.length)continue;let i=!0;for(let e=1;e=0;i--){const n=t[i];if(mte._contextMatchesRules(e,n.when))return n}return null}static _contextMatchesRules(e,t){return!t||t.evaluate(e)}}function fte(e){return e?`${e.serialize()}`:"no when condition"}function _te(e){return e.extensionId?e.isBuiltinExtension?`built-in extension ${e.extensionId}`:`user extension ${e.extensionId}`:e.isDefault?"built-in":"user"}const vte=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class bte extends E{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:B.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,n,s){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=n,this._logService=s,this._onDidUpdateKeybindings=this._register(new U),this._currentChords=[],this._currentChordChecker=new od,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=Cte.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new sd,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}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"),gte;const[n]=i.getDispatchChords();if(null===n)return this._log("\\ Keyboard event cannot be dispatched"),gte;const s=this._contextKeyService.getContext(t),o=this._currentChords.map((({keypress:e})=>e));return this._getResolver().resolve(s,o,n)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet((()=>{this._documentHasFocus()?Date.now()-e>5e3&&this._leaveChordMode():this._leaveChordMode()}),500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw g("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(ue(0,"({0}) was pressed. Waiting for second key of chord...",t));break;default:{const e=this._currentChords.map((({label:e})=>e)).join(", ");this._currentChordStatusMessage=this._notificationService.status(ue(0,"({0}) was pressed. Waiting for next key of chord...",e))}}this._scheduleLeaveChordMode(),_O.enabled&&_O.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],_O.enable()}_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=Cte.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=Cte.EMPTY,null===this._currentSingleModifier?(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[s]=i.getChords();return this._ignoreSingleModifiers=new Cte(s),null!==this._currentSingleModifier&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){var n;let s=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let o=null,r=null;if(i){const[t]=e.getSingleModifierDispatchChords();o=t,r=t?[t]:[]}else[o]=e.getDispatchChords(),r=this._currentChords.map((({keypress:e})=>e));if(null===o)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),s;const a=this._contextKeyService.getContext(t),l=e.getLabel(),h=this._getResolver().resolve(a,r,o);switch(h.kind){case 0:if(this._logService.trace("KeybindingService#dispatch",l,"[ No matching keybinding ]"),this.inChordMode){const e=this._currentChords.map((({label:e})=>e)).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${e}, ${l}".`),this._notificationService.status(ue(0,"The key combination ({0}, {1}) is not a command.",e,l),{hideAfter:1e4}),this._leaveChordMode(),s=!0}return s;case 1:return this._logService.trace("KeybindingService#dispatch",l,"[ Several keybindings match - more chords needed ]"),s=!0,this._expectAnotherChord(o,l),this._log(1===this._currentChords.length?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),s;case 2:if(this._logService.trace("KeybindingService#dispatch",l,`[ Will dispatch command ${h.commandId} ]`),null===h.commandId||""===h.commandId){if(this.inChordMode){const e=this._currentChords.map((({label:e})=>e)).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${e}, ${l}".`),this._notificationService.status(ue(0,"The key combination ({0}, {1}) is not a command.",e,l),{hideAfter:1e4}),this._leaveChordMode(),s=!0}}else this.inChordMode&&this._leaveChordMode(),h.isBubble||(s=!0),this._log(`+ Invoking command ${h.commandId}.`),void 0===h.commandArgs?this._commandService.executeCommand(h.commandId).then(void 0,(e=>this._notificationService.warn(e))):this._commandService.executeCommand(h.commandId,h.commandArgs).then(void 0,(e=>this._notificationService.warn(e))),vte.test(h.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:h.commandId,from:"keybinding",detail:null!==(n=e.getUserSettingsLabel())&&void 0!==n?n:void 0});return s}}mightProducePrintableCharacter(e){return!e.ctrlKey&&!e.metaKey&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30)}}class Cte{constructor(e){this._ctrlKey=!!e&&e.ctrlKey,this._shiftKey=!!e&&e.shiftKey,this._altKey=!!e&&e.altKey,this._metaKey=!!e&&e.metaKey}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}Cte.EMPTY=new Cte(null);class wte{constructor(e,t,i,n,s,o,r){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?yte(e.getDispatchChords()):[],e&&0===this.chords.length&&(this.chords=yte(e.getSingleModifierDispatchChords())),this.bubble=!!t&&94===t.charCodeAt(0),this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=n,this.isDefault=s,this.extensionId=o,this.isBuiltinExtension=r}}function yte(e){const t=[];for(let i=0,n=e.length;ithis._getLabel(e)))}getAriaLabel(){return Px.toLabel(this._os,this._chords,(e=>this._getAriaLabel(e)))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:Fx.toLabel(this._os,this._chords,(e=>this._getElectronAccelerator(e)))}getUserSettingsLabel(){return Bx.toLabel(this._os,this._chords,(e=>this._getUserSettingsLabel(e)))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map((e=>this._getChord(e)))}_getChord(e){return new bt(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 Lte extends Ste{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(2===this._os)switch(e){case 15:return"\u2190";case 16:return"\u2191";case 17:return"\u2192";case 18:return"\u2193"}return gt.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":gt.toString(e.keyCode)}_getElectronAccelerator(e){return gt.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=gt.toUserSettingsUS(e.keyCode);return t?t.toLowerCase():t}_getChordDispatch(e){return Lte.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+=gt.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return 5!==e.keyCode||e.shiftKey||e.altKey||e.metaKey?4!==e.keyCode||e.ctrlKey||e.altKey||e.metaKey?6!==e.keyCode||e.ctrlKey||e.shiftKey||e.metaKey?57!==e.keyCode||e.ctrlKey||e.shiftKey||e.altKey?null:"meta":"alt":"shift":"ctrl"}static _scanCodeToKeyCode(e){const t=ct[e];if(-1!==t)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof _t)return e;const t=this._scanCodeToKeyCode(e.scanCode);return 0===t?null:new _t(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=yte(e.chords.map((e=>this._toKeyCodeChord(e))));return i.length>0?[new Lte(i,t)]:[]}}var kte;function Dte(e,t,i){const n=i.mode===kte.ALIGN?i.offset:i.offset+i.size,s=i.mode===kte.ALIGN?i.offset+i.size:i.offset;return 0===i.position?t<=e-n?n:t<=s?s-t:Math.max(e-t,0):t<=s?s-t:t<=e-n?n:0}!function(e){e[e.AVOID=0]="AVOID",e[e.ALIGN=1]="ALIGN"}(kte||(kte={}));class xte extends E{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=E.None,this.toDisposeOnSetContainer=E.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=fs(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,vs(this.view),this.setContainer(e,t),this._register(x((()=>this.setContainer(null,1))))}setContainer(e,t){var i;if(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,null===(i=this.shadowRootHostElement)||void 0===i||i.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e){if(this.container=e,this.useFixedPosition=1!==t,this.useShadowDOM=3===t,this.useShadowDOM){this.shadowRootHostElement=fs(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=Nte,this.shadowRoot.appendChild(e),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(fs("slot"))}else this.container.appendChild(this.view);const i=new N;xte.BUBBLE_UP_EVENTS.forEach((e=>{i.add(Mn(this.container,e,(e=>{this.onDOMEvent(e,!1)})))})),xte.BUBBLE_DOWN_EVENTS.forEach((e=>{i.add(Mn(this.container,e,(e=>{this.onDOMEvent(e,!0)}),!0))})),this.toDisposeOnSetContainer=i}}show(e){var t,i;this.isVisible()&&this.hide(),Dn(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2575",this.view.style.position=this.useFixedPosition?"fixed":"absolute",_s(this.view),this.toDisposeOnClean=e.render(this.view)||E.None,this.delegate=e,this.doLayout(),null===(i=(t=this.delegate).focus)||void 0===i||i.call(t)}getViewElement(){return this.view}layout(){this.isVisible()&&(!1!==this.delegate.canRelayout||He&&tt?(this.delegate.layout&&this.delegate.layout(),this.doLayout()):this.hide())}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(ss(e)){const i=Hn(e),n=function(e){let t=e,i=1;do{const e=Pn(t).zoom;null!=e&&"1"!==e&&(i*=e),t=t.parentElement}while(null!==t&&t!==t.ownerDocument.documentElement);return i}(e);t={top:i.top*n,left:i.left*n,width:i.width*n,height:i.height*n}}else t=function(e){const t=e;return!!t&&"number"==typeof t.x&&"number"==typeof t.y}(e)?{top:e.y,left:e.x,width:e.width||1,height:e.height||2}:{top:e.posy,left:e.posx,width:2,height:2};const i=zn(this.view),n=jn(this.view),s=this.delegate.anchorPosition||0,o=this.delegate.anchorAlignment||0;let r,a;if(0===(this.delegate.anchorAxisAlignment||0)){const e={offset:t.top-window.pageYOffset,size:t.height,position:0===s?0:1},l={offset:t.left,size:t.width,position:0===o?0:1,mode:kte.ALIGN};r=Dte(window.innerHeight,n,e)+window.pageYOffset,PD.intersects({start:r,end:r+n},{start:e.offset,end:e.offset+e.size})&&(l.mode=kte.AVOID),a=Dte(window.innerWidth,i,l)}else{const e={offset:t.left,size:t.width,position:0===o?0:1},l={offset:t.top,size:t.height,position:0===s?0:1,mode:kte.ALIGN};a=Dte(window.innerWidth,i,e),PD.intersects({start:a,end:a+i},{start:e.offset,end:e.offset+e.size})&&(l.mode=kte.AVOID),r=Dte(window.innerHeight,n,l)+window.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(0===s?"bottom":"top"),this.view.classList.add(0===o?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const l=Hn(this.container);this.view.style.top=r-(this.useFixedPosition?Hn(this.view).top:l.top)+"px",this.view.style.left=a-(this.useFixedPosition?Hn(this.view).left:l.left)+"px",this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,(null==t?void 0:t.onHide)&&t.onHide(e),this.toDisposeOnClean.dispose(),vs(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!qn(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}xte.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],xte.BUBBLE_DOWN_EVENTS=["click"];const Nte='\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t.codicon[class*=\'codicon-\'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }\n\n\t:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }\n\t:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; }\n\t: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; }\n\t: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; }\n\t: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; }\n';var Ete=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Ite=function(e,t){return function(i,n){t(i,n,e)}};let Mte=class extends E{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=E.None,this.container=e.hasContainer?e.container:null,this.contextView=this._register(new xte(this.container,1)),this.layout(),this._register(e.onDidLayout((()=>this.layout())))}setContainer(e,t){this.contextView.setContainer(e,t||1)}showContextView(e,t,i){t?t===this.container&&this.shadowRoot===i||(this.container=t,this.setContainer(t,i?3:2)):this.layoutService.hasContainer&&this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.shadowRoot=i,this.contextView.show(e);const n=x((()=>{this.currentViewDisposable===n&&this.hideContextView()}));return this.currentViewDisposable=n,n}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};Mte=Ete([Ite(0,hee)],Mte);let Tte=[],Rte=[],Ate=[];function Ote(e,t=!1){!function(e,t,i){const n=function(e,t){return{id:e.id,mime:e.mime,filename:e.filename,extension:e.extension,filepattern:e.filepattern,firstline:e.firstline,userConfigured:t,filenameLowercase:e.filename?e.filename.toLowerCase():void 0,extensionLowercase:e.extension?e.extension.toLowerCase():void 0,filepatternLowercase:e.filepattern?ete(e.filepattern.toLowerCase()):void 0,filepatternOnPath:!!e.filepattern&&e.filepattern.indexOf(qi.sep)>=0}}(e,t);Tte.push(n),n.userConfigured?Ate.push(n):Rte.push(n);i&&!n.userConfigured&&Tte.forEach((e=>{e.mime===n.mime||e.userConfigured||(n.extension&&e.extension===n.extension&&console.warn(`Overwriting extension <<${n.extension}>> to now point to mime <<${n.mime}>>`),n.filename&&e.filename===n.filename&&console.warn(`Overwriting filename <<${n.filename}>> to now point to mime <<${n.mime}>>`),n.filepattern&&e.filepattern===n.filepattern&&console.warn(`Overwriting filepattern <<${n.filepattern}>> to now point to mime <<${n.mime}>>`),n.firstline&&e.firstline===n.firstline&&console.warn(`Overwriting firstline <<${n.firstline}>> to now point to mime <<${n.mime}>>`))}))}(e,!1,t)}function Pte(e,t){return function(e,t){let i;if(e)switch(e.scheme){case vn.file:i=e.fsPath;break;case vn.data:i=Ia.parseMetaData(e).get(Ia.META_DATA_LABEL);break;case vn.vscodeNotebookCell:i=void 0;break;default:i=e.path}if(!i)return[{id:"unknown",mime:Lu.unknown}];i=i.toLowerCase();const n=Xi(i),s=Fte(i,n,Ate);if(s)return[s,{id:Ku,mime:Lu.text}];const o=Fte(i,n,Rte);if(o)return[o,{id:Ku,mime:Lu.text}];if(t){const e=function(e){Bo(e)&&(e=e.substr(1));if(e.length>0)for(let t=Tte.length-1;t>=0;t--){const i=Tte[t];if(!i.firstline)continue;const n=e.match(i.firstline);if(n&&n.length>0)return i}return}(t);if(e)return[e,{id:Ku,mime:Lu.text}]}return[{id:"unknown",mime:Lu.unknown}]}(e,t).map((e=>e.id))}function Fte(e,t,i){var n;let s,o,r;for(let a=i.length-1;a>=0;a--){const l=i[a];if(t===l.filenameLowercase){s=l;break}if(l.filepattern&&(!o||l.filepattern.length>o.filepattern.length)){const i=l.filepatternOnPath?e:t;(null===(n=l.filepatternLowercase)||void 0===n?void 0:n.call(l,i))&&(o=l)}l.extension&&(!r||l.extension.length>r.extension.length)&&t.endsWith(l.extensionLowercase)&&(r=l)}return s||(o||(r||void 0))}const Bte=Object.prototype.hasOwnProperty,Wte="vs.editor.nullLanguage";class Vte{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(Wte,0),this._register(Ku,1),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)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||Wte}}class Hte extends E{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new U),this.onDidChange=this._onDidChange.event,Hte.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new Vte,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(Uu.onDidChangeLanguages((e=>{this._initializeFromRegistry()}))))}dispose(){Hte.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Tte=Tte.filter((e=>e.userConfigured)),Rte=[];const e=[].concat(Uu.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach((e=>{const t=this._languages[e];t.name&&(this._nameMap[t.name]=t.identifier),t.aliases.forEach((e=>{this._lowercaseNameMap[e.toLowerCase()]=t.identifier})),t.mimetypes.forEach((e=>{this._mimeTypesMap[e]=t.identifier}))})),jl.as(xu).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;Bte.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 e of t.extensions)Ote({id:i,mime:n,extension:e},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const l of t.filenames)Ote({id:i,mime:n,filename:l},this._warnOnOverwrite),e.filenames.push(l);if(Array.isArray(t.filenamePatterns))for(const l of t.filenamePatterns)Ote({id:i,mime:n,filepattern:l},this._warnOnOverwrite);if("string"==typeof t.firstLine&&t.firstLine.length>0){let e=t.firstLine;"^"!==e.charAt(0)&&(e="^"+e);try{const t=new RegExp(e);"^"!==(s=t).source&&"^$"!==s.source&&"$"!==s.source&&"^\\s*$"!==s.source&&s.exec("")&&0===s.lastIndex||Ote({id:i,mime:n,firstline:t},this._warnOnOverwrite)}catch(a){console.warn(`[${t.id}]: Invalid regular expression \`${e}\`: `,a)}}var s;e.aliases.push(i);let o=null;if(void 0!==t.aliases&&Array.isArray(t.aliases)&&(o=0===t.aliases.length?[null]:t.aliases),null!==o)for(const l of o)l&&0!==l.length&&e.aliases.push(l);const r=null!==o&&o.length>0;if(r&&null===o[0]);else{const t=(r?o[0]:null)||i;!r&&e.name||(e.name=t)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return!!e&&Bte.call(this._languages,e)}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return Bte.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&Bte.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return e||t?Pte(e,t):[]}}Hte.instanceCount=0;class zte extends E{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new U),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new U),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new U({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,zte.instanceCount++,this._registry=this._register(new Hte(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange((()=>this._onDidChange.fire())))}dispose(){zte.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){return Ud(this._registry.guessLanguageIdByFilepathOrFirstLine(e,t),null)}createById(e){return new Ute(this.onDidChange,(()=>this._createAndGetLanguageIdentifier(e)))}createByFilepathOrFirstLine(e,t){return new Ute(this.onDidChange,(()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)}))}_createAndGetLanguageIdentifier(e){return e&&this.isRegisteredLanguageId(e)||(e=Ku),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),EC.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}zte.instanceCount=0;class Ute{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 U({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){var e;const t=this._selector();t!==this.languageId&&(this.languageId=t,null===(e=this._emitter)||void 0===e||e.fire(this.languageId))}}const Kte=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,jte=/(&)?(&)([^\s&])/g;var qte;!function(e){e[e.Right=0]="Right",e[e.Left=1]="Left"}(qte||(qte={}));class $te extends Rx{constructor(e,t,i,n){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const s=document.createElement("div");s.classList.add("monaco-menu"),s.setAttribute("role","presentation"),super(s,{orientation:1,actionViewItemProvider:e=>this.doGetActionViewItem(e,i,o),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...Pe||Fe?[10]:[]],keyDown:!0}}),this.menuStyles=n,this.menuElement=s,this.actionsList.tabIndex=0,this.menuDisposables=this._register(new N),this.initializeOrUpdateStyleSheet(e,n),this._register(ZL.addTarget(s)),En(s,os.KEY_DOWN,(e=>{new St(e).equals(2)&&e.preventDefault()})),i.enableMnemonics&&this.menuDisposables.add(En(s,os.KEY_DOWN,(e=>{const t=e.key.toLocaleLowerCase();if(this.mnemonics.has(t)){as(e,!0);const i=this.mnemonics.get(t);if(1===i.length&&(i[0]instanceof Zte&&i[0].container&&this.focusItemByElement(i[0].container),i[0].onClick(e)),i.length>1){const e=i.shift();e&&e.container&&(this.focusItemByElement(e.container),i.push(e)),this.mnemonics.set(t,i)}}}))),Fe&&this._register(En(s,os.KEY_DOWN,(e=>{const t=new St(e);t.equals(14)||t.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),as(e,!0)):(t.equals(13)||t.equals(12))&&(this.focusedItem=0,this.focusPrevious(),as(e,!0))}))),this._register(En(this.domNode,os.MOUSE_OUT,(e=>{qn(e.relatedTarget,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),e.stopPropagation())}))),this._register(En(this.actionsList,os.MOUSE_OVER,(e=>{let t=e.target;if(t&&qn(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(t.classList.contains("action-item")){const e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}}))),this._register(ZL.addTarget(this.actionsList)),this._register(En(this.actionsList,$L.Tap,(e=>{let t=e.initialTarget;if(t&&qn(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(t.classList.contains("action-item")){const e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}})));const o={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new OD(s,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const r=this.scrollableElement.getDomNode();r.style.position="",this.styleScrollElement(r,n),this._register(En(s,$L.Change,(e=>{as(e,!0);const t=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:t-e.translationY})}))),this._register(En(r,os.MOUSE_UP,(e=>{e.preventDefault()}))),s.style.maxHeight=`${Math.max(10,window.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((e=>{var t;return!(null===(t=i.submenuIds)||void 0===t?void 0:t.has(e.id))||(console.warn(`Found submenu cycle: ${e.id}`),!1)})),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter((e=>!(e instanceof Yte))).forEach(((e,t,i)=>{e.updatePositionInSet(t+1,i.length)}))}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(Zn(e)?this.styleSheet=Jn(e):($te.globalStyleSheet||($te.globalStyleSheet=Jn()),this.styleSheet=$te.globalStyleSheet)),this.styleSheet.textContent=function(e,t){let i=`\n.monaco-menu {\n\tfont-size: 13px;\n\tborder-radius: 5px;\n\tmin-width: 160px;\n}\n\n${Xte(Jr.menuSelection)}\n${Xte(Jr.menuSubmenu)}\n\n.monaco-menu .monaco-action-bar {\n\ttext-align: right;\n\toverflow: hidden;\n\twhite-space: nowrap;\n}\n\n.monaco-menu .monaco-action-bar .actions-container {\n\tdisplay: flex;\n\tmargin: 0 auto;\n\tpadding: 0;\n\twidth: 100%;\n\tjustify-content: flex-end;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar.reverse .actions-container {\n\tflex-direction: row-reverse;\n}\n\n.monaco-menu .monaco-action-bar .action-item {\n\tcursor: pointer;\n\tdisplay: inline-block;\n\ttransition: transform 50ms ease;\n\tposition: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled {\n\tcursor: default;\n}\n\n.monaco-menu .monaco-action-bar.animated .action-item.active {\n\ttransform: scale(1.272019649, 1.272019649); /* 1.272019649 = \u221a\u03c6 */\n}\n\n.monaco-menu .monaco-action-bar .action-item .icon,\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar .action-label {\n\tfont-size: 11px;\n\tmargin-right: 4px;\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label,\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {\n\tcolor: var(--vscode-disabledForeground);\n}\n\n/* Vertical actions */\n\n.monaco-menu .monaco-action-bar.vertical {\n\ttext-align: left;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tdisplay: block;\n\tborder-bottom: 1px solid var(--vscode-menu-separatorBackground);\n\tpadding-top: 1px;\n\tpadding: 30px;\n}\n\n.monaco-menu .secondary-actions .monaco-action-bar .action-label {\n\tmargin-left: 6px;\n}\n\n/* Action Items */\n.monaco-menu .monaco-action-bar .action-item.select-container {\n\toverflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */\n\tflex: 1;\n\tmax-width: 170px;\n\tmin-width: 60px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin-right: 10px;\n}\n\n.monaco-menu .monaco-action-bar.vertical {\n\tmargin-left: 0;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tpadding: 0;\n\ttransform: none;\n\tdisplay: flex;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.active {\n\ttransform: none;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\tflex: 1 1 auto;\n\tdisplay: flex;\n\theight: 2em;\n\talign-items: center;\n\tposition: relative;\n\tmargin: 0 4px;\n\tborder-radius: 4px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding {\n\topacity: unset;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label {\n\tflex: 1 1 auto;\n\ttext-decoration: none;\n\tpadding: 0 1em;\n\tbackground: none;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .keybinding,\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tdisplay: inline-block;\n\tflex: 2 1 auto;\n\tpadding: 0 1em;\n\ttext-align: right;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {\n\tfont-size: 16px !important;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {\n\tmargin-left: auto;\n\tmargin-right: -20px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {\n\topacity: 0.4;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {\n\tdisplay: inline-block;\n\tbox-sizing: border-box;\n\tmargin: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tposition: static;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {\n\tposition: absolute;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\twidth: 100%;\n\theight: 0px !important;\n\topacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {\n\tpadding: 0.7em 1em 0.1em 1em;\n\tfont-weight: bold;\n\topacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:hover {\n\tcolor: inherit;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tposition: absolute;\n\tvisibility: hidden;\n\twidth: 1em;\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {\n\tvisibility: visible;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n/* Context Menu */\n\n.context-view.monaco-menu-container {\n\toutline: 0;\n\tborder: none;\n\tanimation: fadeIn 0.083s linear;\n\t-webkit-app-region: no-drag;\n}\n\n.context-view.monaco-menu-container :focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {\n\toutline: 0;\n}\n\n.hc-black .context-view.monaco-menu-container,\n.hc-light .context-view.monaco-menu-container,\n:host-context(.hc-black) .context-view.monaco-menu-container,\n:host-context(.hc-light) .context-view.monaco-menu-container {\n\tbox-shadow: none;\n}\n\n.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n.hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n:host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused {\n\tbackground: none;\n}\n\n/* Vertical Action Bar Styles */\n\n.monaco-menu .monaco-action-bar.vertical {\n\tpadding: 4px 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\theight: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),\n.monaco-menu .monaco-action-bar.vertical .keybinding {\n\tfont-size: inherit;\n\tpadding: 0 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tfont-size: inherit;\n\twidth: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tfont-size: inherit;\n\tmargin: 5px 0 !important;\n\tpadding: 0;\n\tborder-radius: 0;\n}\n\n.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator,\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tmargin-left: 0;\n\tmargin-right: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tfont-size: 60%;\n\tpadding: 0 1.8em;\n}\n\n.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator,\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n\tmask-size: 10px 10px;\n\t-webkit-mask-size: 10px 10px;\n}\n\n.monaco-menu .action-item {\n\tcursor: default;\n}`;if(t){i+="\n\t\t\t/* Arrows */\n\t\t\t.monaco-scrollable-element > .scrollbar > .scra {\n\t\t\t\tcursor: pointer;\n\t\t\t\tfont-size: 11px !important;\n\t\t\t}\n\n\t\t\t.monaco-scrollable-element > .visible {\n\t\t\t\topacity: 1;\n\n\t\t\t\t/* Background rule added for IE9 - to allow clicks on dom node */\n\t\t\t\tbackground:rgba(0,0,0,0);\n\n\t\t\t\ttransition: opacity 100ms linear;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .invisible {\n\t\t\t\topacity: 0;\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .invisible.fade {\n\t\t\t\ttransition: opacity 800ms linear;\n\t\t\t}\n\n\t\t\t/* Scrollable Content Inset Shadow */\n\t\t\t.monaco-scrollable-element > .shadow {\n\t\t\t\tposition: absolute;\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 3px;\n\t\t\t\theight: 3px;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 3px;\n\t\t\t\tleft: 0;\n\t\t\t\theight: 100%;\n\t\t\t\twidth: 3px;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.top-left-corner {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\theight: 3px;\n\t\t\t\twidth: 3px;\n\t\t\t}\n\t\t";const t=e.scrollbarShadow;t&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\t\tbox-shadow: ${t} 0 6px 6px -6px inset;\n\t\t\t\t}\n\n\t\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\t\tbox-shadow: ${t} 6px 0 6px -6px inset;\n\t\t\t\t}\n\n\t\t\t\t.monaco-scrollable-element > .shadow.top.left {\n\t\t\t\t\tbox-shadow: ${t} 6px 6px 6px -6px inset;\n\t\t\t\t}\n\t\t\t`);const n=e.scrollbarSliderBackground;n&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider {\n\t\t\t\t\tbackground: ${n};\n\t\t\t\t}\n\t\t\t`);const s=e.scrollbarSliderHoverBackground;s&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider:hover {\n\t\t\t\t\tbackground: ${s};\n\t\t\t\t}\n\t\t\t`);const o=e.scrollbarSliderActiveBackground;o&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider.active {\n\t\t\t\t\tbackground: ${o};\n\t\t\t\t}\n\t\t\t`)}return i}(t,Zn(e))}styleScrollElement(e,t){var i,n;const s=null!==(i=t.foregroundColor)&&void 0!==i?i:"",o=null!==(n=t.backgroundColor)&&void 0!==n?n:"",r=t.borderColor?`1px solid ${t.borderColor}`:"",a=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=r,e.style.borderRadius="5px",e.style.color=s,e.style.backgroundColor=o,e.style.boxShadow=a}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}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(En(this.element,os.MOUSE_UP,(e=>{if(as(e,!0),ne){if(new Nt(e).rightButton)return;this.onClick(e)}else setTimeout((()=>{this.onClick(e)}),0)}))),this._register(En(this.element,os.CONTEXT_MENU,(e=>{as(e,!0)}))))}),100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=ds(this.element,fs("a.action-menu-item")),this._action.id===qa.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=ds(this.item,fs("span.menu-item-check"+ta.asCSSSelector(Jr.menuSelection))),this.check.setAttribute("role","none"),this.label=ds(this.item,fs("span.action-label")),this.options.label&&this.options.keybinding&&(ds(this.item,fs("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(){var e;super.focus(),null===(e=this.item)||void 0===e||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){var e;if(this.label&&this.options.label){Dn(this.label);let t=aa(this.action.label);if(t){const i=function(e){const t=Kte,i=t.exec(e);if(!i)return e;const n=!i[1];return e.replace(t,n?"$2$3":"").trim()}(t);this.options.enableMnemonics||(t=i),this.label.setAttribute("aria-label",i.replace(/&&/g,"&"));const n=Kte.exec(t);if(n){t=Js(t),jte.lastIndex=0;let i=jte.exec(t);for(;i&&i[1];)i=jte.exec(t);const s=e=>e.replace(/&&/g,"&");i?this.label.append(io(s(t.substr(0,i.index))," "),fs("u",{"aria-hidden":"true"},i[3]),no(s(t.substr(i.index+i[0].length))," ")):this.label.innerText=s(t).trim(),null===(e=this.item)||void 0===e||e.setAttribute("aria-keyshortcuts",(n[1]?n[1]:n[3]).toLocaleLowerCase())}else this.label.innerText=t.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),void 0!==e?(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}`:"",s=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=null!=t?t:"",this.item.style.backgroundColor=null!=i?i:"",this.item.style.outline=n,this.item.style.outlineOffset=s),this.check&&(this.check.style.color=null!=t?t:"")}}class Zte extends Gte{constructor(e,t,i,n,s){super(e,e,n,s),this.submenuActions=t,this.parentData=i,this.submenuOptions=n,this.mysubmenu=null,this.submenuDisposables=this._register(new N),this.mouseOver=!1,this.expandDirection=n&&void 0!==n.expandDirection?n.expandDirection:qte.Right,this.showScheduler=new rd((()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))}),250),this.hideScheduler=new rd((()=>{this.element&&!qn(Xn(),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=ds(this.item,fs("span.submenu-indicator"+ta.asCSSSelector(Jr.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(En(this.element,os.KEY_UP,(e=>{const t=new St(e);(t.equals(17)||t.equals(3))&&(as(e,!0),this.createSubmenu(!0))}))),this._register(En(this.element,os.KEY_DOWN,(e=>{const t=new St(e);Xn()===this.item&&(t.equals(17)||t.equals(3))&&as(e,!0)}))),this._register(En(this.element,os.MOUSE_OVER,(e=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())}))),this._register(En(this.element,os.MOUSE_LEAVE,(e=>{this.mouseOver=!1}))),this._register(En(this.element,os.FOCUS_OUT,(e=>{this.element&&!qn(Xn(),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(){}onClick(e){as(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(ge){}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,n){const s={top:0,left:0};return s.left=Dte(e.width,t.width,{position:n===qte.Right?0:1,offset:i.left,size:i.width}),s.left>=i.left&&s.left{new St(e).equals(15)&&(as(e,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))}))),this.submenuDisposables.add(En(this.submenuContainer,os.KEY_DOWN,(e=>{new St(e).equals(15)&&as(e,!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){var t;this.item&&(null===(t=this.item)||void 0===t||t.setAttribute("aria-expanded",e))}applyStyle(){super.applyStyle();const e=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=null!=e?e:"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class Yte extends Ix{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 Xte(e){const t=Qr()[e.id];return`.codicon-${e.id}:before { content: '\\${t.toString(16)}'; }`}class Qte{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;let i;this.focusToReturn=document.activeElement;const n=ss(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:n=>{var s;this.lastContainer=n;const o=e.getMenuClassName?e.getMenuClassName():"";o&&(n.className+=" "+o),this.options.blockMouse&&(this.block=n.appendChild(fs(".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",null===(s=this.blockDisposable)||void 0===s||s.dispose(),this.blockDisposable=En(this.block,os.MOUSE_DOWN,(e=>e.stopPropagation())));const r=new N,a=e.actionRunner||new ja;return a.onWillRun((t=>this.onActionRun(t,!e.skipTelemetry)),this,r),a.onDidRun(this.onDidActionRun,this,r),i=new $te(n,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:a,getKeyBinding:e.getKeyBinding?e.getKeyBinding:e=>this.keybindingService.lookupKeybinding(e.id)},nN),i.onDidCancel((()=>this.contextViewService.hideContextView(!0)),null,r),i.onDidBlur((()=>this.contextViewService.hideContextView(!0)),null,r),r.add(En(window,os.BLUR,(()=>this.contextViewService.hideContextView(!0)))),r.add(En(window,os.MOUSE_DOWN,(e=>{if(e.defaultPrevented)return;const t=new Nt(e);let i=t.target;if(!t.rightButton){for(;i;){if(i===n)return;i=i.parentElement}this.contextViewService.hideContextView(!0)}}))),D(r,i)},focus:()=>{null==i||i.focus(!!e.autoSelectFirstItem)},onHide:t=>{var i,n,s;null===(i=e.onHide)||void 0===i||i.call(e,!!t),this.block&&(this.block.remove(),this.block=null),null===(n=this.blockDisposable)||void 0===n||n.dispose(),this.blockDisposable=null,this.lastContainer&&(Xn()===this.lastContainer||qn(Xn(),this.lastContainer))&&(null===(s=this.focusToReturn)||void 0===s||s.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&&!d(e.error)&&this.notificationService.error(e.error)}}var Jte=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},eie=function(e,t){return function(i,n){t(i,n,e)}};let tie=class extends E{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new Qte(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,s,o){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=s,this.contextKeyService=o,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new U),this._onDidHideContextMenu=this._store.add(new U)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=iie.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu(Object.assign(Object.assign({},e),{onHide:t=>{var i;null===(i=e.onHide)||void 0===i||i.call(e,t),this._onDidHideContextMenu.fire()}})),ks.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};var iie,nie;tie=Jte([eie(0,lh),eie(1,mL),eie(2,Ux),eie(3,WL),eie(4,th),eie(5,Ol)],tie),function(e){e.transform=function(e,t,i){if(!((n=e)&&n.menuId instanceof eh))return e;var n;const{menuId:s,menuActionOptions:o,contextKeyService:r}=e;return Object.assign(Object.assign({},e),{getActions:()=>{const n=[];if(s){const e=t.createMenu(s,null!=r?r:i);!function(e,t,i,n){const s=e.getActions(t),o=ks.getInstance();FW(s,i,o.keyStatus.altKey||(Oe||Fe)&&o.keyStatus.shiftKey,n?e=>e===n:e=>"navigation"===e)}(e,o,n),e.dispose()}return e.getActions?qa.join(e.getActions(),n):n}})}}(iie||(iie={})),function(e){e[e.API=0]="API",e[e.USER=1]="USER"}(nie||(nie={}));var sie=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},oie=function(e,t){return function(i,n){t(i,n,e)}},rie=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let aie=class{constructor(e){this._commandService=e}open(e,t){return rie(this,void 0,void 0,(function*(){if(!$k(e,vn.command))return!1;if(!(null==t?void 0:t.allowCommands))return!0;if("string"==typeof e&&(e=an.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path))return!0;let i=[];try{i=pk(decodeURIComponent(e.query))}catch(ge){try{i=pk(e.query)}catch(Vs){}}return Array.isArray(i)||(i=[i]),yield this._commandService.executeCommand(e.path,...i),!0}))}};aie=sie([oie(0,Ya)],aie);let lie=class{constructor(e){this._editorService=e}open(e,t){return rie(this,void 0,void 0,(function*(){"string"==typeof e&&(e=an.parse(e));const{selection:i,uri:n}=function(e){let t;const i=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(e.fragment);return i&&(t={startLineNumber:parseInt(i[1]),startColumn:i[2]?parseInt(i[2]):1,endLineNumber:i[4]?parseInt(i[4]):void 0,endColumn:i[4]?i[5]?parseInt(i[5]):1:void 0},e=e.with({fragment:""})),{selection:t,uri:e}}(e);return(e=n).scheme===vn.file&&(e=ka(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:i,source:(null==t?void 0:t.fromUserGesture)?nie.USER:nie.API},null==t?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),null==t?void 0:t.openToSide),!0}))}};lie=sie([oie(0,Wa)],lie);let hie=class{constructor(e,t){this._openers=new O,this._validators=new O,this._resolvers=new O,this._resolvedUriTargets=new Us((e=>e.with({path:null,fragment:null,query:null}).toString())),this._externalOpeners=new O,this._defaultExternalOpener={openExternal:e=>rie(this,void 0,void 0,(function*(){return Gk(e,vn.http,vn.https)?Cs(e):window.location.href=e,!0}))},this._openers.push({open:(e,t)=>rie(this,void 0,void 0,(function*(){return!(!(null==t?void 0:t.openExternal)&&!Gk(e,vn.mailto,vn.http,vn.https,vn.vsls))&&(yield this._doOpenExternal(e,t),!0)}))}),this._openers.push(new aie(t)),this._openers.push(new lie(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}open(e,t){var i;return rie(this,void 0,void 0,(function*(){const n="string"==typeof e?an.parse(e):e,s=null!==(i=this._resolvedUriTargets.get(n))&&void 0!==i?i:e;for(const e of this._validators)if(!(yield e.shouldOpen(s,t)))return!1;for(const i of this._openers){if(yield i.open(e,t))return!0}return!1}))}resolveExternalUri(e,t){return rie(this,void 0,void 0,(function*(){for(const i of this._resolvers)try{const n=yield i.resolveExternalUri(e,t);if(n)return this._resolvedUriTargets.has(n.resolved)||this._resolvedUriTargets.set(n.resolved,e),n}catch(ge){}throw new Error("Could not resolve external URI: "+e.toString())}))}_doOpenExternal(e,t){return rie(this,void 0,void 0,(function*(){const i="string"==typeof e?an.parse(e):e;let n,s;try{n=(yield this.resolveExternalUri(i,t)).resolved}catch(ge){n=i}if(s="string"==typeof e&&i.toString()===n.toString()?e:encodeURI(n.toString(!0)),null==t?void 0:t.allowContributedOpeners){const e="string"==typeof(null==t?void 0:t.allowContributedOpeners)?null==t?void 0:t.allowContributedOpeners:void 0;for(const t of this._externalOpeners){if(yield t.openExternal(s,{sourceUri:i,preferredOpenerId:e},Uh.None))return!0}}return this._defaultExternalOpener.openExternal(s,{sourceUri:i},Uh.None)}))}dispose(){this._validators.clear()}};hie=sie([oie(0,Wa),oie(1,Ya)],hie);var die=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},cie=function(e,t){return function(i,n){t(i,n,e)}};let uie=class extends E{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new U),this._markerDecorations=new Us,e.getModels().forEach((e=>this._onModelAdded(e))),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}_handleMarkerChange(e){e.forEach((e=>{const t=this._markerDecorations.get(e);t&&this._updateDecorations(t)}))}_onModelAdded(e){const t=new gie(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var t;const i=this._markerDecorations.get(e.uri);i&&(i.dispose(),this._markerDecorations.delete(e.uri)),e.uri.scheme!==vn.inMemory&&e.uri.scheme!==vn.internal&&e.uri.scheme!==vn.vscode||null===(t=this._markerService)||void 0===t||t.read({resource:e.uri}).map((e=>e.owner)).forEach((t=>this._markerService.remove(t,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};uie=die([cie(0,Ha),cie(1,LN)],uie);class gie extends E{constructor(e){super(),this.model=e,this._map=new qs,this._register(x((()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()})))}update(e){const{added:t,removed:i}=function(e,t){const i=[],n=[];for(const s of e)t.has(s)||i.push(s);for(const s of t)e.has(s)||n.push(s);return{removed:i,added:n}}(new Set(this._map.keys()),new Set(e));if(0===t.length&&0===i.length)return!1;const n=i.map((e=>this._map.get(e))),s=t.map((e=>({range:this._createDecorationRange(this.model,e),options:this._createDecorationOption(e)}))),o=this.model.deltaDecorations(n,s);for(const r of i)this._map.delete(r);for(let r=0;r=t)return i;const n=e.getWordAtPosition(i.getStartPosition());n&&(i=new Rh(i.startLineNumber,n.startColumn,i.endLineNumber,n.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&1===t.startColumn&&i.startLineNumber===i.endLineNumber){const n=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);n=0}}var pie,mie=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},fie=function(e,t){return function(i,n){t(i,n,e)}};function _ie(e){return e.toString()}class vie{constructor(e,t,i){this.model=e,this._modelEventListeners=new N,this.model=e,this._modelEventListeners.add(e.onWillDispose((()=>t(e)))),this._modelEventListeners.add(e.onDidChangeLanguage((t=>i(e,t))))}dispose(){this._modelEventListeners.dispose()}}const bie=Fe||Pe?1:2;class Cie{constructor(e,t,i,n,s,o,r,a){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=n,this.heapSize=s,this.sha1=o,this.versionId=r,this.alternativeVersionId=a}}let wie=pie=class extends E{constructor(e,t,i,n,s){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._languageService=n,this._languageConfigurationService=s,this._onModelAdded=this._register(new U),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new U),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new U),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration((e=>this._updateModelOptions(e)))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){var i;let n=Sc.tabSize;if(e.editor&&void 0!==e.editor.tabSize){const t=parseInt(e.editor.tabSize,10);isNaN(t)||(n=t),n<1&&(n=1)}let s="tabSize";if(e.editor&&void 0!==e.editor.indentSize&&"tabSize"!==e.editor.indentSize){const t=parseInt(e.editor.indentSize,10);isNaN(t)||(s=Math.max(t,1))}let o=Sc.insertSpaces;e.editor&&void 0!==e.editor.insertSpaces&&(o="false"!==e.editor.insertSpaces&&Boolean(e.editor.insertSpaces));let r=bie;const a=e.eol;"\r\n"===a?r=2:"\n"===a&&(r=1);let l=Sc.trimAutoWhitespace;e.editor&&void 0!==e.editor.trimAutoWhitespace&&(l="false"!==e.editor.trimAutoWhitespace&&Boolean(e.editor.trimAutoWhitespace));let h=Sc.detectIndentation;e.editor&&void 0!==e.editor.detectIndentation&&(h="false"!==e.editor.detectIndentation&&Boolean(e.editor.detectIndentation));let d=Sc.largeFileOptimizations;e.editor&&void 0!==e.editor.largeFileOptimizations&&(d="false"!==e.editor.largeFileOptimizations&&Boolean(e.editor.largeFileOptimizations));let c=Sc.bracketPairColorizationOptions;return(null===(i=e.editor)||void 0===i?void 0:i.bracketPairColorization)&&"object"==typeof e.editor.bracketPairColorization&&(c={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:n,indentSize:s,insertSpaces:o,detectIndentation:h,defaultEOL:r,trimAutoWhitespace:l,largeFileOptimizations:d,bracketPairColorizationOptions:c}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&"string"==typeof i&&"auto"!==i?i:3===$e||2===$e?"\n":"\r\n"}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return"boolean"!=typeof e||e}getCreationOptions(e,t,i){const n="string"==typeof e?e:e.languageId;let s=this._modelCreationOptionsByLanguageAndResource[n+t];if(!s){const e=this._configurationService.getValue("editor",{overrideIdentifier:n,resource:t}),o=this._getEOL(t,n);s=pie._readModelOptions({editor:e,eol:o},i),this._modelCreationOptionsByLanguageAndResource[n+t]=s}return s}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let n=0,s=i.length;ne){const t=[];for(this._disposedModels.forEach((e=>{e.sharesUndoRedoStack||t.push(e)})),t.sort(((e,t)=>e.time-t.time));t.length>0&&this._disposedModelsHeapSize>e;){const e=t.shift();this._removeDisposedModel(e.uri),null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,n){const s=this.getCreationOptions(t,i,n),o=new Cw(e,t,s,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(_ie(i))){const e=this._removeDisposedModel(i),t=this._undoRedoService.getElements(i),n=this._getSHA1Computer(),s=!!n.canComputeSHA1(o)&&n.computeSHA1(o)===e.sha1;if(s||e.sharesUndoRedoStack){for(const e of t.past)Gv(e)&&e.matchesResource(i)&&e.setModel(o);for(const e of t.future)Gv(e)&&e.matchesResource(i)&&e.setModel(o);this._undoRedoService.setElementsValidFlag(i,!0,(e=>Gv(e)&&e.matchesResource(i))),s&&(o._overwriteVersionId(e.versionId),o._overwriteAlternativeVersionId(e.alternativeVersionId),o._overwriteInitialUndoRedoSnapshot(e.initialUndoRedoSnapshot))}else null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}const r=_ie(o.uri);if(this._models[r])throw new Error("ModelService: Cannot add model because it already exists!");const a=new vie(o,(e=>this._onWillDispose(e)),((e,t)=>this._onDidChangeLanguage(e,t)));return this._models[r]=a,a}createModel(e,t,i,n=!1){let s;return s=t?this._createModelData(e,t,i,n):this._createModelData(e,Ku,i,n),this._onModelAdded.fire(s.model),s.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i0||t.future.length>0){for(const i of t.past)Gv(i)&&i.matchesResource(e.uri)&&(s=!0,o+=i.heapSize(e.uri),i.setModel(e.uri));for(const i of t.future)Gv(i)&&i.matchesResource(e.uri)&&(s=!0,o+=i.heapSize(e.uri),i.setModel(e.uri))}}const r=pie.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,a=this._getSHA1Computer();if(s)if(n||!(o>r)&&a.canComputeSHA1(e))this._ensureDisposedModelsHeapSize(r-o),this._undoRedoService.setElementsValidFlag(e.uri,!1,(t=>Gv(t)&&t.matchesResource(e.uri))),this._insertDisposedModel(new Cie(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),n,o,a.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else{const e=i.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}else if(!n){const e=i.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}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(),s=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),o=this.getCreationOptions(n,e.uri,e.isForSimpleWidget);pie._setModelOptionsForModel(e,o,s),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new yie}};wie.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20971520,wie=pie=mie([fie(0,pu),fie(1,mT),fie(2,hw),fie(3,Lc),fie(4,Ju)],wie);class yie{canComputeSHA1(e){return e.getValueLength()<=yie.MAX_MODEL_SIZE}computeSHA1(e){const t=new bE,i=e.createSnapshot();let n;for(;n=i.read();)t.update(n);return t.digest()}}yie.MAX_MODEL_SIZE=10485760;var Sie=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Lie=function(e,t){return function(i,n){t(i,n,e)}};let kie=class extends E{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=jl.as(MJ),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){var n;const[s,o]=this.getOrInstantiateProvider(e),r=this.visibleQuickAccess,a=null==r?void 0:r.descriptor;if(r&&o&&a===o)return e===o.prefix||(null==i?void 0:i.preserveValue)||(r.picker.value=e),void this.adjustValueSelection(r.picker,o,i);if(o&&!(null==i?void 0:i.preserveValue)){let t;if(r&&a&&a!==o){const e=r.value.substr(a.prefix.length);e&&(t=`${o.prefix}${e}`)}if(!t){const e=null==s?void 0:s.defaultFilterValue;e===IJ.LAST?t=this.lastAcceptedPickerValues.get(o):"string"==typeof e&&(t=`${o.prefix}${e}`)}"string"==typeof t&&(e=t)}const l=new N,h=l.add(this.quickInputService.createQuickPick());let d;h.value=e,this.adjustValueSelection(h,o,i),h.placeholder=null==o?void 0:o.placeholder,h.quickNavigate=null==i?void 0:i.quickNavigateConfiguration,h.hideInput=!!h.quickNavigate&&!r,("number"==typeof(null==i?void 0:i.itemActivation)||(null==i?void 0:i.quickNavigateConfiguration))&&(h.itemActivation=null!==(n=null==i?void 0:i.itemActivation)&&void 0!==n?n:dE.SECOND),h.contextKey=null==o?void 0:o.contextKey,h.filterValue=e=>e.substring(o?o.prefix.length:0),t&&(d=new hd,l.add(B.once(h.onWillAccept)((e=>{e.veto(),h.hide()})))),l.add(this.registerPickerListeners(h,s,o,e,null==i?void 0:i.providerOptions));const c=l.add(new jh);return s&&l.add(s.provide(h,c.token,null==i?void 0:i.providerOptions)),B.once(h.onDidHide)((()=>{0===h.selectedItems.length&&c.cancel(),l.dispose(),null==d||d.complete(h.selectedItems.slice(0))})),h.show(),t?null==d?void 0:d.p:void 0}adjustValueSelection(e,t,i){var n;let s;s=(null==i?void 0:i.preserveValue)?[e.value.length,e.value.length]:[null!==(n=null==t?void 0:t.prefix.length)&&void 0!==n?n:0,e.value.length],e.valueSelection=s}registerPickerListeners(e,t,i,n,s){const o=new N,r=this.visibleQuickAccess={picker:e,descriptor:i,value:n};return o.add(x((()=>{r===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)}))),o.add(e.onDidChangeValue((e=>{const[i]=this.getOrInstantiateProvider(e);i!==t?this.show(e,{preserveValue:!0,providerOptions:s}):r.value=e}))),i&&o.add(e.onDidAccept((()=>{this.lastAcceptedPickerValues.set(i,e.value)}))),o}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let i=this.mapProviderToDescriptor.get(t);return i||(i=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,i)),[i,t]}};kie=Sie([Lie(0,cE),Lie(1,Fa)],kie);const Die="done",xie="active",Nie="infinite",Eie="infinite-long-running",Iie="discrete";class Mie extends E{constructor(e,t){super(),this.workedVal=0,this.showDelayedScheduler=this._register(new rd((()=>_s(this.element)),0)),this.longRunningScheduler=this._register(new rd((()=>this.infiniteLongRunning()),Mie.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=(null==t?void 0:t.progressBarBackground)||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(xie,Nie,Eie,Iie),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(Die),this.element.classList.contains(Nie)?(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(Iie,Die,Eie),this.element.classList.add(xie,Nie),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(Eie)}getContainer(){return this.element}}Mie.LONG_RUNNING_INFINITE_THRESHOLD=1e4;const Tie=fs;class Rie extends E{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=e=>En(this.findInput.inputBox.inputElement,os.KEY_DOWN,(t=>{e(new St(t))})),this.onMouseDown=e=>En(this.findInput.inputBox.inputElement,os.MOUSE_DOWN,(t=>{e(new Nt(t))})),this.onDidChange=e=>this.findInput.onDidChange(e),this.container=ds(this.parent,Tie(".quick-input-box")),this.findInput=this._register(new MV(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)}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return"password"===this.findInput.inputBox.inputElement.type}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)}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}showDecoration(e){e===gL.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===gL.Info?1:e===gL.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===gL.Info?1:e===gL.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}const Aie=new Zs((()=>{const e=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:e,collatorIsNumeric:e.resolvedOptions().numeric}}));new Zs((()=>({collator:new Intl.Collator(void 0,{numeric:!0})}))),new Zs((()=>({collator:new Intl.Collator(void 0,{numeric:!0,sensitivity:"accent"})})));function Oie(e,t,i){const n=e.toLowerCase(),s=t.toLowerCase(),o=function(e,t,i){const n=e.toLowerCase(),s=t.toLowerCase(),o=n.startsWith(i),r=s.startsWith(i);if(o!==r)return o?-1:1;if(o&&r){if(n.lengths.length)return 1}return 0}(e,t,i);if(o)return o;const r=n.endsWith(i);if(r!==s.endsWith(i))return r?-1:1;const a=function(e,t,i=!1){const n=e||"",s=t||"",o=Aie.value.collator.compare(n,s);return Aie.value.collatorIsNumeric&&0===o&&n!==s?n=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};class Fie{constructor(e){this.nodes=e}toString(){return this.nodes.map((e=>"string"==typeof e?e:e.label)).join("")}}Pie([qL],Fie.prototype,"toString",null);const Bie=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;const Wie={},Vie=new dk("quick-input-button-icon-");function Hie(e){if(!e)return;let t;const i=e.dark.toString();return Wie[i]?t=Wie[i]:(t=Vie.nextId(),is(`.${t}, .hc-light .${t}`,`background-image: ${ws(e.light||e.dark)}`),is(`.vs-dark .${t}, .hc-black .${t}`,`background-image: ${ws(e.dark)}`),Wie[i]=t),t}function zie(e,t,i){us(t);const n=function(e){const t=[];let i,n=0;for(;i=Bie.exec(e);){i.index-n>0&&t.push(e.substring(n,i.index));const[,s,o,,r]=i;r?t.push({label:s,href:o,title:r}):t.push({label:s,href:o}),n=i.index+i[0].length}return n{rs(e)&&as(e,!0),i.callback(o.href)},a=i.disposables.add(new Ky(n,os.CLICK)).event,l=i.disposables.add(new Ky(n,os.KEY_DOWN)).event,h=B.chain(l,(e=>e.filter((e=>{const t=new St(e);return t.equals(10)||t.equals(3)}))));i.disposables.add(ZL.addTarget(n));const d=i.disposables.add(new Ky(n,$L.Tap)).event;B.any(a,d,h)(r,null,i.disposables),t.appendChild(n)}}var Uie=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Kie=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const jie=fs;class qie{constructor(e,t,i,n,s,o,r){var a,l,h;this._checked=!1,this._hidden=!1,this.hasCheckbox=n,this.index=i,this.fireButtonTriggered=s,this.fireSeparatorButtonTriggered=o,this._onChecked=r,this.onChecked=n?B.map(B.filter(this._onChecked.event,(e=>e.listElement===this)),(e=>e.checked)):B.None,"separator"===e.type?this._separator=e:(this.item=e,t&&"separator"===t.type&&!t.buttons&&(this._separator=t),this.saneDescription=this.item.description,this.saneDetail=this.item.detail,this._labelHighlights=null===(a=this.item.highlights)||void 0===a?void 0:a.label,this._descriptionHighlights=null===(l=this.item.highlights)||void 0===l?void 0:l.description,this._detailHighlights=null===(h=this.item.highlights)||void 0===h?void 0:h.detail,this.saneTooltip=this.item.tooltip),this._init=new Zs((()=>{var t;const i=null!==(t=e.label)&&void 0!==t?t:"",n=ha(i).text.trim(),s=e.ariaLabel||[i,this.saneDescription,this.saneDetail].map((e=>{return(t=e)?t.replace(/\$\((.*?)\)/g,((e,t)=>` ${t} `)).trim():"";var t})).filter((e=>!!e)).join(", ");return{saneLabel:i,saneSortLabel:n,saneAriaLabel:s}}))}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 checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({listElement:this,checked:e}))}get separator(){return this._separator}set separator(e){this._separator=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 $ie{constructor(e){this.themeService=e}get templateId(){return $ie.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=ds(e,jie(".quick-input-list-entry"));const i=ds(t.entry,jie("label.quick-input-list-label"));t.toDisposeTemplate.push(Mn(i,os.CLICK,(e=>{t.checkbox.offsetParent||e.preventDefault()}))),t.checkbox=ds(i,jie("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(Mn(t.checkbox,os.CHANGE,(e=>{t.element.checked=t.checkbox.checked})));const n=ds(i,jie(".quick-input-list-rows")),s=ds(n,jie(".quick-input-list-row")),o=ds(n,jie(".quick-input-list-row"));t.label=new qz(s,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.label),t.icon=cs(t.label.element,jie(".quick-input-list-icon"));const r=ds(s,jie(".quick-input-list-entry-keybinding"));t.keybinding=new zx(r,$e);const a=ds(o,jie(".quick-input-list-label-meta"));return t.detail=new qz(a,{supportHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.detail),t.separator=ds(t.entry,jie(".quick-input-list-separator")),t.actionBar=new Rx(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,i){var n,s,o,r;i.element=e,e.element=null!==(n=i.entry)&&void 0!==n?n:void 0;const a=e.item?e.item:e.separator;i.checkbox.checked=e.checked,i.toDisposeElement.push(e.onChecked((e=>i.checkbox.checked=e)));const{labelHighlights:l,descriptionHighlights:h,detailHighlights:d}=e;if(null===(s=e.item)||void 0===s?void 0:s.iconPath){const t=O_(this.themeService.getColorTheme().type)?e.item.iconPath.dark:null!==(o=e.item.iconPath.light)&&void 0!==o?o:e.item.iconPath.dark,n=an.revive(t);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=ws(n)}else i.icon.style.backgroundImage="",i.icon.className=(null===(r=e.item)||void 0===r?void 0:r.iconClass)?`quick-input-list-icon ${e.item.iconClass}`:"";const c={matches:l||[],descriptionTitle:e.saneDescription,descriptionMatches:h||[],labelEscapeNewLines:!0};"separator"!==a.type?(c.extraClasses=a.iconClasses,c.italic=a.italic,c.strikethrough=a.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item")):i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(e.saneLabel,e.saneDescription,c),i.keybinding.set("separator"===a.type?void 0:a.keybinding),e.saneDetail?(i.detail.element.style.display="",i.detail.setLabel(e.saneDetail,void 0,{matches:d,title:e.saneDetail,labelEscapeNewLines:!0})):i.detail.element.style.display="none",e.item&&e.separator&&e.separator.label?(i.separator.textContent=e.separator.label,i.separator.style.display=""):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!e.separator);const u=a.buttons;u&&u.length?(i.actionBar.push(u.map(((t,i)=>{let n=t.iconClass||(t.iconPath?Hie(t.iconPath):void 0);return t.alwaysVisible&&(n=n?`${n} always-visible`:"always-visible"),{id:`id-${i}`,class:n,enabled:!0,label:"",tooltip:t.tooltip||"",run:()=>{"separator"!==a.type?e.fireButtonTriggered({button:t,item:a}):e.fireSeparatorButtonTriggered({button:t,separator:a})}}})),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){i.toDisposeElement=k(i.toDisposeElement),i.actionBar.clear()}disposeTemplate(e){e.toDisposeElement=k(e.toDisposeElement),e.toDisposeTemplate=k(e.toDisposeTemplate)}}$ie.ID="listelement";class Gie{getHeight(e){return e.item?e.saneDetail?44:22:24}getTemplateId(e){return $ie.ID}}var Zie;!function(e){e[e.First=1]="First",e[e.Second=2]="Second",e[e.Last=3]="Last",e[e.Next=4]="Next",e[e.Previous=5]="Previous",e[e.NextPage=6]="NextPage",e[e.PreviousPage=7]="PreviousPage"}(Zie||(Zie={}));class Yie{constructor(e,t,i,n){this.parent=e,this.options=i,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.matchOnLabelMode="fuzzy",this.sortByLabel=!0,this._onChangedAllVisibleChecked=new U,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new U,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new U,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new U,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new U,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new U,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onKeyDown=new U,this.onKeyDown=this._onKeyDown.event,this._onLeave=new U,this.onLeave=this._onLeave.event,this._listElementChecked=new U,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=ds(this.parent,jie(".quick-input-list"));const s=new Gie,o=new Qie;if(this.list=i.createList("QuickInput",this.container,s,[new $ie(n)],{identityProvider:{getId:e=>{var t,i,n,s,o,r,a,l;return null!==(l=null!==(r=null!==(s=null!==(i=null===(t=e.item)||void 0===t?void 0:t.id)&&void 0!==i?i:null===(n=e.item)||void 0===n?void 0:n.label)&&void 0!==s?s:null===(o=e.separator)||void 0===o?void 0:o.id)&&void 0!==r?r:null===(a=e.separator)||void 0===a?void 0:a.label)&&void 0!==l?l:""}},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:o}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown((e=>{const t=new St(e);switch(t.keyCode){case 10:this.toggleCheckbox();break;case 31:(Pe?e.metaKey:e.ctrlKey)&&this.list.setFocus(Kd(this.list.length));break;case 16:{const e=this.list.getFocus();1===e.length&&0===e[0]&&this._onLeave.fire();break}case 18:{const e=this.list.getFocus();1===e.length&&e[0]===this.list.length-1&&this._onLeave.fire();break}}this._onKeyDown.fire(t)}))),this.disposables.push(this.list.onMouseDown((e=>{2!==e.browserEvent.button&&e.browserEvent.preventDefault()}))),this.disposables.push(En(this.container,os.CLICK,(e=>{(e.x||e.y)&&this._onLeave.fire()}))),this.disposables.push(this.list.onMouseMiddleClick((e=>{this._onLeave.fire()}))),this.disposables.push(this.list.onContextMenu((e=>{"number"==typeof e.index&&(e.browserEvent.preventDefault(),this.list.setSelection([e.index]))}))),i.hoverDelegate){const e=new ed(i.hoverDelegate.delay);this.disposables.push(this.list.onMouseOver((t=>Kie(this,void 0,void 0,(function*(){var i;if(t.browserEvent.target instanceof HTMLAnchorElement)e.cancel();else if(t.browserEvent.relatedTarget instanceof HTMLAnchorElement||!qn(t.browserEvent.relatedTarget,null===(i=t.element)||void 0===i?void 0:i.element))try{yield e.trigger((()=>Kie(this,void 0,void 0,(function*(){t.element&&this.showHover(t.element)}))))}catch(t){if(!d(t))throw t}}))))),this.disposables.push(this.list.onMouseOut((t=>{var i;qn(t.browserEvent.relatedTarget,null===(i=t.element)||void 0===i?void 0:i.element)||e.cancel()}))),this.disposables.push(e)}this.disposables.push(this._listElementChecked.event((e=>this.fireCheckedEvents()))),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onSeparatorButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return B.map(this.list.onDidChangeFocus,(e=>e.elements.map((e=>e.item))))}get onDidChangeSelection(){return B.map(this.list.onDidChangeSelection,(e=>({items:e.elements.map((e=>e.item)),event:e.browserEvent})))}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get ariaLabel(){return this.list.getHTMLElement().ariaLabel}set ariaLabel(e){this.list.getHTMLElement().ariaLabel=e}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let i=0,n=e.length;i{t.hidden||(t.checked=e)}))}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=k(this.elementDisposables);const t=e=>this.fireButtonTriggered(e),i=e=>this.fireSeparatorButtonTriggered(e);this.inputElements=e;const n=new Map,s=this.parent.classList.contains("show-checkboxes");this.elements=e.reduce(((o,r,a)=>{var l;const h=a>0?e[a-1]:void 0;if("separator"===r.type&&!r.buttons)return o;const d=new qie(r,h,a,s,t,i,this._listElementChecked),c=o.length;return o.push(d),n.set(null!==(l=d.item)&&void 0!==l?l:d.separator,c),o}),[]),this.elementsToIndexes=n,this.list.splice(0,this.list.length),this.list.splice(0,this.list.length,this.elements),this._onChangedVisibleCount.fire(this.elements.length)}getFocusedElements(){return this.list.getFocusedElements().map((e=>e.item))}setFocusedElements(e){if(this.list.setFocus(e.filter((e=>this.elementsToIndexes.has(e))).map((e=>this.elementsToIndexes.get(e)))),e.length>0){const e=this.list.getFocus()[0];"number"==typeof e&&this.list.reveal(e)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter((e=>this.elementsToIndexes.has(e))).map((e=>this.elementsToIndexes.get(e))))}getCheckedElements(){return this.elements.filter((e=>e.checked)).map((e=>e.item)).filter((e=>!!e))}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const i of e)t.add(i);for(const e of this.elements)e.checked=t.has(e.item)}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}set enabled(e){this.list.getHTMLElement().style.pointerEvents=e?"":"none"}focus(e){if(!this.list.length)return;switch(e===Zie.Second&&this.list.length<2&&(e=Zie.First),e){case Zie.First:this.list.scrollTop=0,this.list.focusFirst(void 0,(e=>!!e.item));break;case Zie.Second:this.list.scrollTop=0,this.list.focusNth(1,void 0,(e=>!!e.item));break;case Zie.Last:this.list.scrollTop=this.list.scrollHeight,this.list.focusLast(void 0,(e=>!!e.item));break;case Zie.Next:{this.list.focusNext(void 0,!0,void 0,(e=>!!e.item));const e=this.list.getFocus()[0];0!==e&&!this.elements[e-1].item&&this.list.firstVisibleIndex>e-1&&this.list.reveal(e-1);break}case Zie.Previous:{this.list.focusPrevious(void 0,!0,void 0,(e=>!!e.item));const e=this.list.getFocus()[0];0!==e&&!this.elements[e-1].item&&this.list.firstVisibleIndex>e-1&&this.list.reveal(e-1);break}case Zie.NextPage:this.list.focusNextPage(void 0,(e=>!!e.item));break;case Zie.PreviousPage:this.list.focusPreviousPage(void 0,(e=>!!e.item))}const t=this.list.getFocus()[0];"number"==typeof t&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}showHover(e){var t,i,n;void 0!==this.options.hoverDelegate&&(this._lastHover&&!this._lastHover.isDisposed&&(null===(i=(t=this.options.hoverDelegate).onDidHideHover)||void 0===i||i.call(t),null===(n=this._lastHover)||void 0===n||n.dispose()),e.element&&e.saneTooltip&&(this._lastHover=this.options.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:e=>{this.options.linkOpenerDelegate(e)},showPointer:!0,container:this.container,hoverPosition:1},!1)))}layout(e){this.list.getHTMLElement().style.maxHeight=e?44*Math.floor(e/44)+6+"px":"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;const t=e;if((e=e.trim())&&(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail)){let i;this.elements.forEach((n=>{var s,o,r,a;let l;l="fuzzy"===this.matchOnLabelMode?this.matchOnLabel&&null!==(s=da(e,ha(n.saneLabel)))&&void 0!==s?s:void 0:this.matchOnLabel&&null!==(o=function(e,t){const{text:i,iconOffsets:n}=t;if(!n||0===n.length)return Xie(e,i);const s=io(i," "),o=i.length-s.length,r=Xie(e,s);if(r)for(const a of r){const e=n[a.start+o]+o;a.start+=e,a.end+=e}return r}(t,ha(n.saneLabel)))&&void 0!==o?o:void 0;const h=this.matchOnDescription&&null!==(r=da(e,ha(n.saneDescription||"")))&&void 0!==r?r:void 0,d=this.matchOnDetail&&null!==(a=da(e,ha(n.saneDetail||"")))&&void 0!==a?a:void 0;if(l||h||d?(n.labelHighlights=l,n.descriptionHighlights=h,n.detailHighlights=d,n.hidden=!1):(n.labelHighlights=void 0,n.descriptionHighlights=void 0,n.detailHighlights=void 0,n.hidden=!n.item||!n.item.alwaysShow),n.item?n.separator=void 0:n.separator&&(n.hidden=!0),!this.sortByLabel){const e=n.index&&this.inputElements[n.index-1];i=e&&"separator"===e.type?e:i,i&&!n.hidden&&(n.separator=i,i=void 0)}}))}else this.elements.forEach((e=>{e.labelHighlights=void 0,e.descriptionHighlights=void 0,e.detailHighlights=void 0,e.hidden=!1;const t=e.index&&this.inputElements[e.index-1];e.item&&(e.separator=t&&"separator"===t.type&&!t.buttons?t:void 0)}));const i=this.elements.filter((e=>!e.hidden));if(this.sortByLabel&&e){const t=e.toLowerCase();i.sort(((e,i)=>function(e,t,i){const n=e.labelHighlights||[],s=t.labelHighlights||[];if(n.length&&!s.length)return-1;if(!n.length&&s.length)return 1;if(0===n.length&&0===s.length)return 0;return Oie(e.saneSortLabel,t.saneSortLabel,i)}(e,i,t)))}return this.elementsToIndexes=i.reduce(((e,t,i)=>{var n;return e.set(null!==(n=t.item)&&void 0!==n?n:t.separator,i),e}),new Map),this.list.splice(0,this.list.length,i),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(i.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const i of e)i.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return"none"!==this.container.style.display}dispose(){this.elementDisposables=k(this.elementDisposables),this.disposables=k(this.disposables)}fireCheckedEvents(){this._fireCheckedEvents&&(this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedCheckedCount.fire(this.getCheckedCount()),this._onChangedCheckedElements.fire(this.getCheckedElements()))}fireButtonTriggered(e){this._onButtonTriggered.fire(e)}fireSeparatorButtonTriggered(e){this._onSeparatorButtonTriggered.fire(e)}style(e){this.list.style(e)}toggleHover(){const e=this.list.getFocusedElements()[0];if(!(null==e?void 0:e.saneTooltip))return;if(this._lastHover&&!this._lastHover.isDisposed)return void this._lastHover.dispose();const t=this.list.getFocusedElements()[0];if(!t)return;this.showHover(t);const i=new N;i.add(this.list.onDidChangeFocus((e=>{e.indexes.length&&this.showHover(e.elements[0])}))),this._lastHover&&i.add(this._lastHover),this._toggleHover=i,this.elementDisposables.push(this._toggleHover)}}function Xie(e,t){const i=t.toLowerCase().indexOf(e.toLowerCase());return-1!==i?[{start:i,end:i+e.length}]:null}Uie([qL],Yie.prototype,"onDidChangeFocus",null),Uie([qL],Yie.prototype,"onDidChangeSelection",null);class Qie{getWidgetAriaLabel(){return ue(0,"Quick Input")}getAriaLabel(e){var t;return(null===(t=e.separator)||void 0===t?void 0:t.label)?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(e.hasCheckbox)return{value:e.checked,onDidChange:e.onChecked}}}var Jie=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const ene={iconClass:ta.asClassName(Jr.quickInputBack),tooltip:ue(0,"Back"),handle:-1};class tne extends E{constructor(e){super(),this.ui=e,this._widgetUpdated=!1,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=tne.noPromptMessage,this._severity=gL.Ignore,this.onDidTriggerButtonEmitter=this._register(new U),this.onDidHideEmitter=this._register(new U),this.onDisposeEmitter=this._register(new U),this.visibleDisposables=this._register(new N),this.onDidHide=this.onDidHideEmitter.event}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){const t=this._ignoreFocusOut!==e&&!He;this._ignoreFocusOut=e&&!He,t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=null!=e?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=>{-1!==this.buttons.indexOf(e)&&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=hE.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){var e,t;if(!this.visible)return;const i=this.getTitle();i&&this.ui.title.textContent!==i?this.ui.title.textContent=i:i||" "===this.ui.title.innerHTML||(this.ui.title.innerText="\xa0");const n=this.getDescription();if(this.ui.description1.textContent!==n&&(this.ui.description1.textContent=n),this.ui.description2.textContent!==n&&(this.ui.description2.textContent=n),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?us(this.ui.widget,this._widget):us(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new sd,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 e=this.buttons.filter((e=>e===ene));this.ui.leftActionBar.push(e.map(((e,t)=>{const i=new Ka(`id-${t}`,"",e.iconClass||Hie(e.iconPath),!0,(()=>Jie(this,void 0,void 0,(function*(){this.onDidTriggerButtonEmitter.fire(e)}))));return i.tooltip=e.tooltip||"",i})),{icon:!0,label:!1}),this.ui.rightActionBar.clear();const t=this.buttons.filter((e=>e!==ene));this.ui.rightActionBar.push(t.map(((e,t)=>{const i=new Ka(`id-${t}`,"",e.iconClass||Hie(e.iconPath),!0,(()=>Jie(this,void 0,void 0,(function*(){this.onDidTriggerButtonEmitter.fire(e)}))));return i.tooltip=e.tooltip||"",i})),{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const i=null!==(t=null===(e=this.toggles)||void 0===e?void 0:e.filter((e=>e instanceof vV)))&&void 0!==t?t:[];this.ui.inputBox.toggles=i}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const s=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==s&&(this._lastValidationMessage=s,us(this.ui.message),zie(s,this.ui.message,{callback:e=>{this.ui.linkOpenerDelegate(e)},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?ue(0,"{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==gL.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()}}tne.noPromptMessage=ue(0,"Press 'Enter' to confirm your input or 'Escape' to cancel");class ine extends tne{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new U),this.onWillAcceptEmitter=this._register(new U),this.onDidAcceptEmitter=this._register(new U),this.onDidCustomEmitter=this._register(new U),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._autoFocusOnList=!0,this._keepScrollPosition=!1,this._itemActivation=dE.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new U),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new U),this.onDidTriggerItemButtonEmitter=this._register(new U),this.onDidTriggerSeparatorButtonEmitter=this._register(new U),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.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){if(this._value!==e){if(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 autoFocusOnList(){return this._autoFocusOnList}set autoFocusOnList(e){this._autoFocusOnList=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?lE:this.ui.keyMods}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()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.autoFocusOnList&&(this.canSelectMany||this.ui.list.focus(Zie.First))}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange((e=>{this.doSetValue(e,!0)}))),this.visibleDisposables.add(this.ui.inputBox.onMouseDown((e=>{this.autoFocusOnList||this.ui.list.clearFocus()}))),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown((e=>{switch(e.keyCode){case 18:this.ui.list.focus(Zie.Next),this.canSelectMany&&this.ui.list.domFocus(),as(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(Zie.Previous):this.ui.list.focus(Zie.Last),this.canSelectMany&&this.ui.list.domFocus(),as(e,!0);break;case 12:this.ui.list.focus(Zie.NextPage),this.canSelectMany&&this.ui.list.domFocus(),as(e,!0);break;case 11:this.ui.list.focus(Zie.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),as(e,!0);break;case 17:if(!this._canAcceptInBackground)return;if(!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!0));break;case 14:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(Zie.First),as(e,!0));break;case 13:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(Zie.Last),as(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.ui.list.onDidChangeFocus((e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&Td(e,this._activeItems,((e,t)=>e===t))||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))}))),this.visibleDisposables.add(this.ui.list.onDidChangeSelection((({items:e,event:t})=>{this.canSelectMany?e.length&&this.ui.list.setSelectedElements([]):this.selectedItemsToConfirm!==this._selectedItems&&Td(e,this._selectedItems,((e,t)=>e===t))||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(t instanceof MouseEvent&&1===t.button))}))),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements((e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&Td(e,this._selectedItems,((e,t)=>e===t))||(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 En(this.ui.container,os.KEY_UP,(e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new St(e),i=t.keyCode;this._quickNavigate.keybindings.some((e=>{const n=e.getChords();return!(n.length>1)&&(n[0].shiftKey&&4===i?!(t.ctrlKey||t.altKey||t.metaKey):!(!n[0].altKey||6!==i)||(!(!n[0].ctrlKey||5!==i)||!(!n[0].metaKey||57!==i)))}))&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)}))}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,i={title:!!this.title||!!this.step||!!this.buttons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:"default"===this.ok?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;if(!n&&i.inputBox&&(n=this.placeholder||ine.DEFAULT_ARIA_LABEL,this.title&&(n+=` - ${this.title}`)),this.ui.list.ariaLabel!==n&&(this.ui.list.ariaLabel=null!=n?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)switch(this.itemsUpdated=!1,this.ui.list.setElements(this.items),this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case dE.NONE:this._itemActivation=dE.FIRST;break;case dE.SECOND:this.ui.list.focus(Zie.Second),this._itemActivation=dE.FIRST;break;case dE.LAST:this.ui.list.focus(Zie.Last),this._itemActivation=dE.FIRST;break;default:this.trySelectFirst()}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(Zie.First)),this.keepScrollPosition&&(this.scrollTop=e)}}ine.DEFAULT_ARIA_LABEL=ue(0,"Type to narrow down results.");class nne extends tne{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new U),this.onDidAcceptEmitter=this._register(new U),this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",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()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange((e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))}))),this.visibleDisposables.add(this.ui.onDidAccept((()=>this.onDidAcceptEmitter.fire()))),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}}const sne=fs;class one extends E{constructor(e,t){super(),this.options=e,this.themeService=t,this.enabled=!0,this.onDidAcceptEmitter=this._register(new U),this.onDidCustomEmitter=this._register(new U),this.onDidTriggerButtonEmitter=this._register(new U),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new U),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new U),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this.parentElement=e.container,this.styles=e.styles,this.registerKeyModsListeners()}registerKeyModsListeners(){const e=e=>{this.keyMods.ctrlCmd=e.ctrlKey||e.metaKey,this.keyMods.alt=e.altKey};this._register(En(window,os.KEY_DOWN,e,!0)),this._register(En(window,os.KEY_UP,e,!0)),this._register(En(window,os.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=ds(this.parentElement,sne(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=Jn(e),i=ds(e,sne(".quick-input-titlebar")),n=this.options.hoverDelegate?{hoverDelegate:this.options.hoverDelegate}:void 0,s=this._register(new Rx(i,n));s.domNode.classList.add("quick-input-left-action-bar");const o=ds(i,sne(".quick-input-title")),r=this._register(new Rx(i,n));r.domNode.classList.add("quick-input-right-action-bar");const a=ds(e,sne(".quick-input-header")),l=ds(a,sne("input.quick-input-check-all"));l.type="checkbox",l.setAttribute("aria-label",ue(0,"Toggle all checkboxes")),this._register(Mn(l,os.CHANGE,(e=>{const t=l.checked;D.setAllVisibleChecked(t)}))),this._register(En(l,os.CLICK,(e=>{(e.x||e.y)&&u.setFocus()})));const h=ds(a,sne(".quick-input-description")),d=ds(a,sne(".quick-input-and-message")),c=ds(d,sne(".quick-input-filter")),u=this._register(new Rie(c,this.styles.inputBox,this.styles.toggle));u.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=ds(c,sne(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const p=new Uz(g,{countFormat:ue(0,"{0} Results")},this.styles.countBadge),m=ds(c,sne(".quick-input-count"));m.setAttribute("aria-live","polite");const f=new Uz(m,{countFormat:ue(0,"{0} Selected")},this.styles.countBadge),_=ds(a,sne(".quick-input-action")),v=this._register(new XZ(_,this.styles.button));v.label=ue(0,"OK"),this._register(v.onDidClick((e=>{this.onDidAcceptEmitter.fire()})));const b=ds(a,sne(".quick-input-action")),C=this._register(new XZ(b,this.styles.button));C.label=ue(0,"Custom"),this._register(C.onDidClick((e=>{this.onDidCustomEmitter.fire()})));const w=ds(d,sne(`#${this.idPrefix}message.quick-input-message`)),y=this._register(new Mie(e,this.styles.progressBar));y.getContainer().classList.add("quick-input-progress");const S=ds(e,sne(".quick-input-html-widget"));S.tabIndex=-1;const L=ds(e,sne(".quick-input-description")),k=this.idPrefix+"list",D=this._register(new Yie(e,k,this.options,this.themeService));u.setAttribute("aria-controls",k),this._register(D.onDidChangeFocus((()=>{var e;u.setAttribute("aria-activedescendant",null!==(e=D.getActiveDescendant())&&void 0!==e?e:"")}))),this._register(D.onChangedAllVisibleChecked((e=>{l.checked=e}))),this._register(D.onChangedVisibleCount((e=>{p.setCount(e)}))),this._register(D.onChangedCheckedCount((e=>{f.setCount(e)}))),this._register(D.onLeave((()=>{setTimeout((()=>{u.setFocus(),this.controller instanceof ine&&this.controller.canSelectMany&&D.clearFocus()}),0)})));const x=hs(e);return this._register(x),this._register(En(e,os.FOCUS,(t=>{qn(t.relatedTarget,e)||(this.previousFocusElement=t.relatedTarget instanceof HTMLElement?t.relatedTarget:void 0)}),!0)),this._register(x.onDidBlur((()=>{this.getUI().ignoreFocusOut||this.options.ignoreFocusOut()||this.hide(hE.Blur),this.previousFocusElement=void 0}))),this._register(En(e,os.FOCUS,(e=>{u.setFocus()}))),this._register(Mn(e,os.KEY_DOWN,(t=>{if(!qn(t.target,S))switch(t.keyCode){case 3:as(t,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:as(t,!0),this.hide(hE.Gesture);break;case 2:if(!t.altKey&&!t.ctrlKey&&!t.metaKey){const i=[".quick-input-list .monaco-action-bar .always-visible",".quick-input-list-entry:hover .monaco-action-bar",".monaco-list-row.focused .monaco-action-bar"];if(e.classList.contains("show-checkboxes")?i.push("input"):i.push("input[type=text]"),this.getUI().list.isDisplayed()&&i.push(".monaco-list"),this.getUI().message&&i.push(".quick-input-message a"),this.getUI().widget){if(qn(t.target,this.getUI().widget))break;i.push(".quick-input-html-widget")}const n=e.querySelectorAll(i.join(", "));t.shiftKey&&t.target===n[0]?(as(t,!0),D.clearFocus()):!t.shiftKey&&qn(t.target,n[n.length-1])&&(as(t,!0),n[0].focus())}break;case 10:t.ctrlKey&&(as(t,!0),this.getUI().list.toggleHover())}}))),this.ui={container:e,styleSheet:t,leftActionBar:s,titleBar:i,title:o,description1:L,description2:h,widget:S,rightActionBar:r,checkAll:l,inputContainer:d,filterContainer:c,inputBox:u,visibleCountContainer:g,visibleCount:p,countContainer:m,count:f,okContainer:_,ok:v,message:w,customButtonContainer:b,customButton:C,list:D,progressBar:y,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:e=>this.show(e),hide:()=>this.hide(),setVisibilities:e=>this.setVisibilities(e),setEnabled:e=>this.setEnabled(e),setContextKey:e=>this.options.setContextKey(e),linkOpenerDelegate:e=>this.options.linkOpenerDelegate(e)},this.updateStyles(),this.ui}pick(e,t={},i=Uh.None){return new Promise(((n,s)=>{let o=e=>{var i;o=n,null===(i=t.onKeyMods)||void 0===i||i.call(t,r.keyMods),n(e)};if(i.isCancellationRequested)return void o(void 0);const r=this.createQuickPick();let a;const l=[r,r.onDidAccept((()=>{if(r.canSelectMany)o(r.selectedItems.slice()),r.hide();else{const e=r.activeItems[0];e&&(o(e),r.hide())}})),r.onDidChangeActive((e=>{const i=e[0];i&&t.onDidFocus&&t.onDidFocus(i)})),r.onDidChangeSelection((e=>{if(!r.canSelectMany){const t=e[0];t&&(o(t),r.hide())}})),r.onDidTriggerItemButton((e=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton(Object.assign(Object.assign({},e),{removeItem:()=>{const t=r.items.indexOf(e.item);if(-1!==t){const e=r.items.slice(),i=e.splice(t,1),n=r.activeItems.filter((e=>e!==i[0])),s=r.keepScrollPosition;r.keepScrollPosition=!0,r.items=e,n&&(r.activeItems=n),r.keepScrollPosition=s}}})))),r.onDidTriggerSeparatorButton((e=>{var i;return null===(i=t.onDidTriggerSeparatorButton)||void 0===i?void 0:i.call(t,e)})),r.onDidChangeValue((e=>{!a||e||1===r.activeItems.length&&r.activeItems[0]===a||(r.activeItems=[a])})),i.onCancellationRequested((()=>{r.hide()})),r.onDidHide((()=>{k(l),o(void 0)}))];r.title=t.title,r.canSelectMany=!!t.canPickMany,r.placeholder=t.placeHolder,r.ignoreFocusOut=!!t.ignoreFocusLost,r.matchOnDescription=!!t.matchOnDescription,r.matchOnDetail=!!t.matchOnDetail,r.matchOnLabel=void 0===t.matchOnLabel||t.matchOnLabel,r.autoFocusOnList=void 0===t.autoFocusOnList||t.autoFocusOnList,r.quickNavigate=t.quickNavigate,r.hideInput=!!t.hideInput,r.contextKey=t.contextKey,r.busy=!0,Promise.all([e,t.activeItem]).then((([e,t])=>{a=t,r.busy=!1,r.items=e,r.canSelectMany&&(r.selectedItems=e.filter((e=>"separator"!==e.type&&e.picked))),a&&(r.activeItems=[a])})),r.show(),Promise.resolve(e).then(void 0,(e=>{s(e),r.hide()}))}))}createQuickPick(){const e=this.getUI();return new ine(e)}createInputBox(){const e=this.getUI();return new nne(e)}show(e){const t=this.getUI();this.onShowEmitter.fire();const i=this.controller;this.controller=e,null==i||i.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",us(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(gL.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),us(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();ene.tooltip=n?ue(0,"Back ({0})",n):ue(0,"Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=!e.description||e.inputBox||e.checkAll?"none":"",t.checkAll.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t,i,n;const s=this.controller;if(!s)return;const o=!qn(document.activeElement,null!==(i=null===(t=this.ui)||void 0===t?void 0:t.container)&&void 0!==i?i:null);if(this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",!o){let e=this.previousFocusElement;for(;e&&!e.offsetParent;)e=null!==(n=e.parentElement)&&void 0!==n?n:void 0;(null==e?void 0:e.offsetParent)?(e.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}s.didHide(e)}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isDisplayed()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(.62*this.dimension.width,one.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&.4*this.dimension.height)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:n,widgetShadow:s}=this.styles.widget;this.ui.titleBar.style.backgroundColor=null!=e?e:"",this.ui.container.style.backgroundColor=null!=t?t:"",this.ui.container.style.color=null!=i?i:"",this.ui.container.style.border=n?`1px solid ${n}`:"",this.ui.container.style.boxShadow=s?`0 0 8px 2px ${s}`:"",this.ui.list.style(this.styles.list);const o=[];this.styles.pickerGroup.pickerGroupBorder&&o.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&o.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&o.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)&&(o.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&o.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&o.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&o.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&o.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&o.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),o.push("}"));const r=o.join("\n");r!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=r)}}isDisplayed(){return this.ui&&"none"!==this.ui.container.style.display}}one.MAX_WIDTH=600;var rne=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},ane=function(e,t){return function(i,n){t(i,n,e)}};let lne=class extends z_{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(kie))),this._quickAccess}constructor(e,t,i,n){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=n,this._onShow=this._register(new U),this._onHide=this._register(new U),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.container,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:e=>this.setContextKey(e),linkOpenerDelegate:e=>{this.instantiationService.invokeFunction((t=>{t.get(qk).open(e,{allowCommands:!0,fromUserGesture:!0})}))},returnFocus:()=>e.focus(),createList:(e,t,i,n,s)=>this.instantiationService.createInstance(wz,e,t,i,n,s),styles:this.computeStyles()},n=this._register(new one(Object.assign(Object.assign({},i),t),this.themeService));return n.layout(e.dimension,e.offset.quickPickTop),this._register(e.onDidLayout((t=>n.layout(t,e.offset.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 Al(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),t&&t.get()||(this.resetContextKeys(),null==t||t.set(!0))}resetContextKeys(){this.contexts.forEach((e=>{e.get()&&e.reset()}))}pick(e,t={},i=Uh.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:Sp(Em),quickInputForeground:Sp(Im),quickInputTitleBackground:Sp(Mm),widgetBorder:Sp(Op),widgetShadow:Sp(Ap)},inputBox:Zx,toggle:Gx,countBadge:Xx,button:qx,progressBar:$x,keybindingLabel:jx,list:Jx({listBackground:Em,listFocusBackground:Kf,listFocusForeground:zf,listInactiveFocusForeground:zf,listInactiveSelectionIconForeground:Uf,listInactiveFocusBackground:Kf,listFocusOutline:Tp,listInactiveFocusOutline:Tp}),pickerGroup:{pickerGroupBorder:Sp(Rm),pickerGroupForeground:Sp(Tm)}}}};lne=rne([ane(0,Fa),ane(1,Ol),ane(2,P_),ane(3,hee)],lne);var hne=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},dne=function(e,t){return function(i,n){t(i,n,e)}};let cne=class extends lne{constructor(e,t,i,n,s){super(t,i,n,new gee(e.getContainerDomNode(),s)),this.host=void 0;const o=gne.get(e);if(o){const t=o.widget;this.host={_serviceBrand:void 0,get hasContainer(){return!0},get container(){return t.getDomNode()},get dimension(){return e.getLayoutInfo()},get onDidLayout(){return e.onDidLayoutChange},focus:()=>e.focus(),offset:{top:0,quickPickTop:0}}}else this.host=void 0}createController(){return super.createController(this.host)}};cne=hne([dne(1,Fa),dne(2,Ol),dne(3,P_),dne(4,Wa)],cne);let une=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(cne,e);this.mapEditorToService.set(e,t),_(e.onDidDispose)((()=>{i.dispose(),this.mapEditorToService.delete(e)}))}return t}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t={},i=Uh.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};une=hne([dne(0,Fa),dne(1,Wa)],une);class gne{static get(e){return e.getContribution(gne.ID)}constructor(e){this.editor=e,this.widget=new pne(this.editor)}dispose(){this.widget.dispose()}}gne.ID="editor.controller.quickInput";class pne{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return pne.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}pne.ID="editor.contrib.quickInputWidget",Dh(gne.ID,gne,4);var mne=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},fne=function(e,t){return function(i,n){t(i,n,e)}};let _ne=class extends E{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new U,this._onDidChangeReducedMotion=new U,this._accessibilityModeEnabledContext=JR.bindTo(this._contextKeyService);const n=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration("editor.accessibilitySupport")&&(n(),this._onDidChangeScreenReaderOptimized.fire()),e.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())}))),n(),this._register(this.onDidChangeScreenReaderOptimized((()=>n())));const s=window.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=s.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(s)}initReducedMotionListeners(e){if(!this._layoutService.hasContainer)return;this._register(En(e,"change",(()=>{this._systemMotionReduced=e.matches,"auto"===this._configMotionReduced&&this._onDidChangeReducedMotion.fire()})));const t=()=>{const e=this.isMotionReduced();this._layoutService.container.classList.toggle("reduce-motion",e),this._layoutService.container.classList.toggle("enable-motion",!e)};t(),this._register(this.onDidChangeReducedMotion((()=>t())))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return"on"===e||"auto"===e&&2===this._accessibilitySupport}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return"on"===e||"auto"===e&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};_ne=mne([fne(0,Ol),fne(1,hee),fne(2,pu)],_ne);var vne,bne,Cne=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},wne=function(e,t){return function(i,n){t(i,n,e)}};let yne=class{constructor(e,t){this._commandService=e,this._hiddenStates=new Sne(t)}createMenu(e,t,i){return new kne(e,this._hiddenStates,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},i),this._commandService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};yne=Cne([wne(0,Ya),wne(1,ZN)],yne);let Sne=vne=class{constructor(e){this._storageService=e,this._disposables=new N,this._onDidChange=new U,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(vne._key,0,"{}");this._data=JSON.parse(t)}catch(t){this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,vne._key,this._disposables)((()=>{if(!this._ignoreChangeEvent)try{const t=e.get(vne._key,0,"{}");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){var i;return null!==(i=this._hiddenByDefaultCache.get(`${e.id}/${t}`))&&void 0!==i&&i}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){var i,n;const s=this._isHiddenByDefault(e,t),o=null!==(n=null===(i=this._data[e.id])||void 0===i?void 0:i.includes(t))&&void 0!==n&&n;return s?!o:o}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const n=this._data[e.id];if(i)if(n){n.indexOf(t)<0&&n.push(t)}else this._data[e.id]=[t];else if(n){const i=n.indexOf(t);i>=0&&function(e,t){const i=e.length-1;te[1])));s.length>0&&o.push(new sh(t,n,s))}}o.length>0&&t.push([n,o])}return t}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}static _compareMenuItems(e,t){const i=e.group,n=t.group;if(i!==n){if(!i)return 1;if(!n)return-1;if("navigation"===i)return-1;if("navigation"===n)return 1;const e=i.localeCompare(n);if(0!==e)return e}const s=e.order||0,o=t.order||0;return so?1:bne._compareTitles(Jl(e)?e.command.title:e.title,Jl(t)?t.command.title:t.title)}static _compareTitles(e,t){const i="string"==typeof e?e:e.original,n="string"==typeof t?t:t.original;return i.localeCompare(n)}};Lne=bne=Cne([wne(3,Ya),wne(4,Ol)],Lne);let kne=class{constructor(e,t,i,n,s){this._disposables=new N,this._menuInfo=new Lne(e,t,i.emitEventsForSubmenuChanges,n,s);const o=new rd((()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})}),i.eventDebounceDelay);this._disposables.add(o),this._disposables.add(nh.onDidChangeMenu((t=>{t.has(e)&&o.schedule()})));const r=this._disposables.add(new N);this._onDidChange=new q({onWillAddFirstListener:()=>{r.add(s.onDidChangeContext((e=>{const t=e.affectsSome(this._menuInfo.structureContextKeys),i=e.affectsSome(this._menuInfo.preconditionContextKeys),n=e.affectsSome(this._menuInfo.toggledContextKeys);(t||i||n)&&this._onDidChange.fire({menu:this,isStructuralChange:t,isEnablementChange:i,isToggleChange:n})}))),r.add(t.onDidChange((e=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})})))},onDidRemoveLastListener:r.clear.bind(r),delay:i.eventDebounceDelay,merge:e=>{let t=!1,i=!1,n=!1;for(const s of e)if(t=t||s.isStructuralChange,i=i||s.isEnablementChange,n=n||s.isToggleChange,t&&i&&n)break;return{menu:this,isStructuralChange:t,isEnablementChange:i,isToggleChange:n}}}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};function Dne(e,t,i){const n=void 0!==t.submenu?t.submenu.id:t.id;const s="string"==typeof t.title?t.title:t.title.value,o=Za({id:`hide/${e.id}/${n}`,label:ue(0,"Hide '{0}'",s),run(){i.updateHidden(e,n,!0)}}),r=Za({id:`toggle/${e.id}/${n}`,label:s,get checked(){return!i.isHidden(e,n)},run(){i.updateHidden(e,n,!!this.checked)}});return{hide:o,toggle:r,get isHidden(){return!r.checked}}}kne=Cne([wne(3,Ya),wne(4,Ol)],kne);var xne=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Nne=function(e,t){return function(i,n){t(i,n,e)}},Ene=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let Ine=class extends E{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],(re||ae)&&this.installWebKitWriteTextWorkaround()}installWebKitWriteTextWorkaround(){const e=()=>{const e=new hd;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=e,navigator.clipboard.write([new ClipboardItem({"text/plain":e.p})]).catch((t=>Ene(this,void 0,void 0,(function*(){t instanceof Error&&"NotAllowedError"===t.name&&e.isRejected||this.logService.error(t)}))))};this.layoutService.hasContainer&&(this._register(En(this.layoutService.container,"click",e)),this._register(En(this.layoutService.container,"keydown",e)))}writeText(e,t){return Ene(this,void 0,void 0,(function*(){if(t)return void this.mapTextToType.set(t,e);if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return yield navigator.clipboard.writeText(e)}catch(s){console.error(s)}const i=document.activeElement,n=document.body.appendChild(fs("textarea",{"aria-hidden":!0}));n.style.height="1px",n.style.width="1px",n.style.position="absolute",n.value=e,n.focus(),n.select(),document.execCommand("copy"),i instanceof HTMLElement&&i.focus(),document.body.removeChild(n)}))}readText(e){return Ene(this,void 0,void 0,(function*(){if(e)return this.mapTextToType.get(e)||"";try{return yield navigator.clipboard.readText()}catch(t){return console.error(t),""}}))}readFindText(){return Ene(this,void 0,void 0,(function*(){return this.findText}))}writeFindText(e){return Ene(this,void 0,void 0,(function*(){this.findText=e}))}writeResources(e){return Ene(this,void 0,void 0,(function*(){this.resources=e}))}readResources(){return Ene(this,void 0,void 0,(function*(){return this.resources}))}};Ine=xne([Nne(0,hee),Nne(1,hh)],Ine);var Mne=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Tne=function(e,t){return function(i,n){t(i,n,e)}};const Rne="data-keybinding-context";class Ane{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return Object.assign({},this._value)}setValue(e,t){return this._value[e]!==t&&(this._value[e]=t,!0)}removeValue(e){return e in this._value&&(delete this._value[e],!0)}getValue(e){const t=this._value[e];return void 0===t&&this._parent?this._parent.getValue(e):t}}class One extends Ane{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}One.INSTANCE=new One;class Pne extends Ane{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=qq.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration((e=>{if(7===e.source){const e=Array.from(this._values,(([e])=>e));this._values.clear(),i.fire(new Wne(e))}else{const t=[];for(const i of e.affectedKeys){const e=`config.${i}`,n=this._values.findSuperstr(e);void 0!==n&&(t.push(...v.map(n,(([e])=>e))),this._values.deleteSuperstr(e)),this._values.has(e)&&(t.push(e),this._values.delete(e))}i.fire(new Wne(t))}}))}dispose(){this._listener.dispose()}getValue(e){if(0!==e.indexOf(Pne._keyPrefix))return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(Pne._keyPrefix.length),i=this._configurationService.getValue(t);let n;switch(typeof i){case"number":case"boolean":case"string":n=i;break;default:n=Array.isArray(i)?JSON.stringify(i):i}return this._values.set(e,n),n}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}Pne._keyPrefix="config.";class Fne{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){void 0===this._defaultValue?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class Bne{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class Wne{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 Vne{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)))}}class Hne extends E{constructor(e){super(),this._onDidChangeContext=this._register(new j({merge:e=>new Vne(e)})),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new Fne(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 Une(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)}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 Bne(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new Bne(e))}getContext(e){return this._isDisposed?One.INSTANCE:this.getContextValuesContainer(function(e){for(;e;){if(e.hasAttribute(Rne)){const t=e.getAttribute(Rne);return t?parseInt(t,10):NaN}e=e.parentElement}return 0}(e))}dispose(){super.dispose(),this._isDisposed=!0}}let zne=class extends Hne{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new Pne(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?One.INSTANCE:this._contexts.get(e)||One.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 Ane(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};zne=Mne([Tne(0,pu)],zne);class Une extends Hne{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new I),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(Rne)){let e="";this._domNode.classList&&(e=Array.from(this._domNode.classList.values()).join(", ")),console.error("Element already has context attribute"+(e?": "+e:""))}this._domNode.setAttribute(Rne,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext((e=>{const t=this._parent.getContextValuesContainer(this._myContextId).value;var i;i=t,e.allKeysContainedIn(new Set(Object.keys(i)))||this._onDidChangeContext.fire(e)}))}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(Rne),super.dispose())}getContextValuesContainer(e){return this._isDisposed?One.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)}}Xa.registerCommand("_setContext",(function(e,t,i){e.get(Ol).createKey(String(t),function(e){return md(e,(e=>"object"==typeof e&&1===e.$mid?an.revive(e).toString():e instanceof an?e.toString():void 0))}(i))})),Xa.registerCommand({id:"getContextKeyInfo",handler:()=>[...Al.all()].sort(((e,t)=>e.key.localeCompare(t.key))),description:{description:ue(0,"A command that returns information about context keys"),args:[]}}),Xa.registerCommand("_generateContextKeyInfo",(function(){const e=[],t=new Set;for(const i of Al.all())t.has(i.key)||(t.add(i.key),e.push(i));e.sort(((e,t)=>e.key.localeCompare(t.key))),console.log(JSON.stringify(e,void 0,2))}));class Kne{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}}class jne{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())0===t.outgoing.size&&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 Kne(t,e),this._nodes.set(t,i)),i}isEmpty(){return 0===this._nodes.size}toString(){const e=[];for(const[t,i]of this._nodes)e.push(`${t}\n\t(-> incoming)[${[...i.incoming.keys()].join(", ")}]\n\t(outgoing ->)[${[...i.outgoing.keys()].join(",")}]\n`);return e.join("\n")}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 e=this._findCycle(n,t);if(e)return e;t.delete(i)}}}class qne extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=null!==(t=e.findCycleSlow())&&void 0!==t?t:`UNABLE to detect cycle, dumping graph: \n${e.toString()}`}}class $ne{constructor(e=new DB,t=!1,i,n=false){var s;this._services=e,this._strict=t,this._parent=i,this._enableTracing=n,this._activeInstantiations=new Set,this._services.set(Fa,this),this._globalGraph=n?null!==(s=null==i?void 0:i._globalGraph)&&void 0!==s?s:new jne((e=>e)):void 0}createChild(e){return new $ne(e,this._strict,this,this._enableTracing)}invokeFunction(e,...t){const i=Gne.traceInvocation(this._enableTracing,e);let n=!1;try{return e({get:e=>{if(n)throw g("service accessor is only valid during the invocation of its target method");const t=this._getOrCreateServiceInstance(e,i);if(!t)throw new Error(`[invokeFunction] unknown service '${e}'`);return t}},...t)}finally{n=!0,i.stop()}}createInstance(e,...t){let i,n;return e instanceof Cu?(i=Gne.traceCreation(this._enableTracing,e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=Gne.traceCreation(this._enableTracing,e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){const n=Ma.getServiceDependencies(e).sort(((e,t)=>e.index-t.index)),s=[];for(const r of n){const t=this._getOrCreateServiceInstance(r.id,i);t||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${r.id}.`,!1),s.push(t)}const o=n.length>0?n[0].index:t.length;if(t.length!==o){console.trace(`[createInstance] First service dependency of ${e.name} at position ${o+1} conflicts with ${t.length} static arguments`);const i=o-t.length;t=i>0?t.concat(new Array(i)):t.slice(0,o)}return Reflect.construct(e,t.concat(s))}_setServiceInstance(e,t){if(this._services.get(e)instanceof Cu)this._services.set(e,t);else{if(!this._parent)throw new Error("illegalState - setting UNKNOWN service instance");this._parent._setServiceInstance(e,t)}}_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 Cu?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){var n;const s=new jne((e=>e.id.toString()));let o=0;const r=[{id:e,desc:t,_trace:i}];for(;r.length;){const t=r.pop();if(s.lookupOrInsertNode(t),o++>1e3)throw new qne(s);for(const i of Ma.getServiceDependencies(t.desc.ctor)){const o=this._getServiceInstanceOrDescriptor(i.id);if(o||this._throwIfStrict(`[createInstance] ${e} depends on ${i.id} which is NOT registered.`,!0),null===(n=this._globalGraph)||void 0===n||n.insertEdge(String(t.id),String(i.id)),o instanceof Cu){const e={id:i.id,desc:o,_trace:t._trace.branch(i.id,!0)};s.insertEdge(t,e),r.push(e)}}}for(;;){const e=s.roots();if(0===e.length){if(!s.isEmpty())throw new qne(s);break}for(const{data:t}of e){if(this._getServiceInstanceOrDescriptor(t.id)instanceof Cu){const e=this._createServiceInstanceWithOwner(t.id,t.desc.ctor,t.desc.staticArguments,t.desc.supportsDelayedInstantiation,t._trace);this._setServiceInstance(t.id,e)}s.removeNode(t)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,s){if(this._services.get(e)instanceof Cu)return this._createServiceInstance(e,t,i,n,s);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,n,s);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],n,s){if(n){const n=new $ne(void 0,this._strict,this,this._enableTracing);n._globalGraphImplicitDependency=String(e);const o=new Map,r=new ld((()=>{const e=n._createInstance(t,i,s);for(const[t,i]of o){const n=e[t];if("function"==typeof n)for(const t of i)n.apply(e,t)}return o.clear(),e}));return new Proxy(Object.create(null),{get(e,t){if(!r.isInitialized&&"string"==typeof t&&(t.startsWith("onDid")||t.startsWith("onWill"))){let e=o.get(t);e||(e=new O,o.set(t,e));return(t,i,n)=>x(e.push([t,i,n]))}if(t in e)return e[t];const i=r.value;let n=i[t];return"function"!=typeof n||(n=n.bind(i),e[t]=n),n},set:(e,t,i)=>(r.value[t]=i,!0),getPrototypeOf:e=>t.prototype})}return this._createInstance(t,i,s)}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}class Gne{static traceInvocation(e,t){return e?new Gne(2,t.name||(new Error).stack.split("\n").slice(3,4).join("\n")):Gne._None}static traceCreation(e,t){return e?new Gne(1,t.name):Gne._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new Gne(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;Gne._totals+=e;let t=!1;const i=[`${1===this.type?"CREATE":"CALL"} ${this.name}`,`${function e(i,n){const s=[],o=new Array(i+1).join("\t");for(const[r,a,l]of n._dep)if(a&&l){t=!0,s.push(`${o}CREATES -> ${r}`);const n=e(i+1,l);n&&s.push(n)}else s.push(`${o}uses -> ${r}`);return s.join("\n")}(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${Gne._totals.toFixed(2)}ms)`];(e>2||t)&&Gne.all.add(i.join("\n"))}}Gne.all=new Set,Gne._None=new class extends Gne{constructor(){super(0,null)}stop(){}branch(){return this}},Gne._totals=0;const Zne=new Set([vn.inMemory,vn.vscodeSourceControl,vn.walkThrough,vn.walkThroughSnippet]);class Yne{constructor(){this._byResource=new Us,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 s=this._byOwner.get(t);s||(s=new Us,this._byOwner.set(t,s)),s.set(e,i)}get(e,t){const i=this._byResource.get(e);return null==i?void 0:i.get(t)}delete(e,t){let i=!1,n=!1;const s=this._byResource.get(e);s&&(i=s.delete(t));const o=this._byOwner.get(t);if(o&&(n=o.delete(e)),i!==n)throw new Error("illegal state");return i&&n}values(e){var t,i,n,s;return"string"==typeof e?null!==(i=null===(t=this._byOwner.get(e))||void 0===t?void 0:t.values())&&void 0!==i?i:v.empty():an.isUri(e)?null!==(s=null===(n=this._byResource.get(e))||void 0===n?void 0:n.values())&&void 0!==s?s:v.empty():v.map(v.concat(...this._byOwner.values()),(e=>e[1]))}}class Xne{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new Us,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const e=this._data.get(t);e&&this._substract(e);const i=this._resourceStats(t);this._add(i),this._data.set(t,i)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(Zne.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===yN.Error?t.errors+=1:i===yN.Warning?t.warnings+=1:i===yN.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 Qne{constructor(){this._onMarkerChanged=new q({delay:0,merge:Qne._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new Yne,this._stats=new Xne(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(Vd(i)){this._data.delete(t,e)&&this._onMarkerChanged.fire([t])}else{const n=[];for(const s of i){const i=Qne._toMarker(e,t,s);i&&n.push(i)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,severity:s,message:o,source:r,startLineNumber:a,startColumn:l,endLineNumber:h,endColumn:d,relatedInformation:c,tags:u}=i;if(o)return a=a>0?a:1,l=l>0?l:1,h=h>=a?h:a,d=d>0?d:l,{resource:t,owner:e,code:n,severity:s,message:o,source:r,startLineNumber:a,startColumn:l,endLineNumber:h,endColumn:d,relatedInformation:c,tags:u}}changeAll(e,t){const i=[],n=this._data.values(e);if(n)for(const s of n){const t=v.first(s);t&&(i.push(t.resource),this._data.delete(t.resource,e))}if(Hd(t)){const n=new Us;for(const{resource:s,marker:o}of t){const t=Qne._toMarker(e,s,o);if(!t)continue;const r=n.get(s);r?r.push(t):(n.set(s,[t]),i.push(s))}for(const[t,i]of n)this._data.set(t,e,i)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:s}=e;if((!s||s<0)&&(s=-1),t&&i){const e=this._data.get(i,t);if(e){const t=[];for(const i of e)if(Qne._accept(i,n)){const e=t.push(i);if(s>0&&e===s)break}return t}return[]}if(t||i){const e=this._data.values(null!=i?i:t),o=[];for(const t of e)for(const e of t)if(Qne._accept(e,n)){const t=o.push(e);if(s>0&&t===s)return o}return o}{const e=[];for(const t of this._data.values())for(const i of t)if(Qne._accept(i,n)){const t=e.push(i);if(s>0&&t===s)return e}return e}}static _accept(e,t){return void 0===t||(t&e.severity)===e.severity}static _merge(e){const t=new Us;for(const i of e)for(const e of i)t.set(e,!0);return Array.from(t.keys())}}class Jne extends E{constructor(){super(...arguments),this._configurationModel=new lte}get configurationModel(){return this._configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new lte;const e=jl.as(xu).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const n of e){const e=i[n],s=t[n];void 0!==e?this._configurationModel.addValue(n,e):s?this._configurationModel.addValue(n,s.default):this._configurationModel.removeValue(n)}}}class ese extends E{constructor(e,t=[]){super(),this.logger=new ph([e,...t]),this._register(e.onDidChangeLogLevel((e=>this.setLevel(e))))}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)}}var tse=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},ise=function(e,t){return function(i,n){t(i,n,e)}},nse=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class sse{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new U}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let ose=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new T(new sse(t))):Promise.reject(new Error("Model not found"))}};ose=tse([ise(0,Ha)],ose);class rse{show(){return rse.NULL_PROGRESS_RUNNER}showWhile(e,t){return nse(this,void 0,void 0,(function*(){yield e}))}}rse.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class ase{info(e){return this.notify({severity:gL.Info,message:e})}warn(e){return this.notify({severity:gL.Warning,message:e})}error(e){return this.notify({severity:gL.Error,message:e})}notify(e){switch(e.severity){case gL.Error:console.error(e.message);break;case gL.Warning:console.warn(e.message);break;default:console.log(e.message)}return ase.NO_OP}prompt(e,t,i,n){return ase.NO_OP}status(e,t){return E.None}}ase.NO_OP=new class{};let lse=class{constructor(e){this._onWillExecuteCommand=new U,this._onDidExecuteCommand=new U,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=Xa.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)}}};lse=tse([ise(0,Fa)],lse);let hse=class extends bte{constructor(e,t,i,n,s,o){super(e,t,i,n,s),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const r=e=>{const t=new N;t.add(En(e,os.KEY_DOWN,(e=>{const t=new St(e);this._dispatch(t,t.target)&&(t.preventDefault(),t.stopPropagation())}))),t.add(En(e,os.KEY_UP,(e=>{const t=new St(e);this._singleModifierDispatch(t,t.target)&&t.preventDefault()}))),this._domNodeListeners.push(new dse(e,t))},a=e=>{for(let t=0;t{e.getOption(61)||r(e.getContainerDomNode())};this._register(o.onCodeEditorAdd(l)),this._register(o.onCodeEditorRemove((e=>{e.getOption(61)||a(e.getContainerDomNode())}))),o.listCodeEditors().forEach(l);const h=e=>{r(e.getContainerDomNode())};this._register(o.onDiffEditorAdd(h)),this._register(o.onDiffEditorRemove((e=>{a(e.getContainerDomNode())}))),o.listDiffEditors().forEach(h)}addDynamicKeybinding(e,t,i,n){return D(Xa.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:n}]))}addDynamicKeybindings(e){const t=e.map((e=>{var t;return{keybinding:mt(e.keybinding,$e),command:null!==(t=e.command)&&void 0!==t?t:null,commandArgs:e.commandArgs,when:e.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}}));return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),x((()=>{for(let e=0;ethis._log(e)))}return this._cachedResolver}_documentHasFocus(){return document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let n=0;for(const s of e){const e=s.when||void 0,o=s.keybinding;if(o){const r=Lte.resolveKeybinding(o,$e);for(const o of r)i[n++]=new wte(o,s.command,s.commandArgs,e,t,null,!1)}else i[n++]=new wte(void 0,s.command,s.commandArgs,e,t,null,!1)}return i}resolveKeyboardEvent(e){const t=new _t(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new Lte([t],$e)}};hse=tse([ise(0,Ol),ise(1,Ya),ise(2,lh),ise(3,mL),ise(4,hh),ise(5,Wa)],hse);class dse extends E{constructor(e,t){super(),this.domNode=e,this._register(t)}}function cse(e){return e&&"object"==typeof e&&(!e.overrideIdentifier||"string"==typeof e.overrideIdentifier)&&(!e.resource||e.resource instanceof an)}class use{constructor(){this._onDidChangeConfiguration=new U,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const e=new Jne;this._configuration=new cte(e.reload(),new lte,new lte,new lte),e.dispose()}getValue(e,t){const i="string"==typeof e?e:void 0,n=cse(e)?e:cse(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[e,t]=n;this.getValue(e)!==t&&(this._configuration.updateValue(e,t),i.push(e))}if(i.length>0){const e=new ute({keys:i,overrides:[]},t,this._configuration);e.source=8,e.sourceConfig=null,this._onDidChangeConfiguration.fire(e)}return Promise.resolve()}updateValue(e,t,i,n){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}}let gse=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new U,this.configurationService.onDidChangeConfiguration((e=>{this._onDidChangeConfiguration.fire({affectedKeys:e.affectedKeys,affectsConfiguration:(t,i)=>e.affectsConfiguration(i)})}))}getValue(e,t,i){const n=Va.isIPosition(t)?t:null,s=n?"string"==typeof i?i:void 0:"string"==typeof t?t:void 0,o=e?this.getLanguage(e,n):void 0;return void 0===s?this.configurationService.getValue({resource:e,overrideIdentifier:o}):this.configurationService.getValue(s,{resource:e,overrideIdentifier:o})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};gse=tse([ise(0,pu),ise(1,Ha),ise(2,Lc)],gse);let pse=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&"string"==typeof i&&"auto"!==i?i:Fe||Pe?"\n":"\r\n"}};pse=tse([ise(0,pu)],pse);class mse{constructor(){const e=an.from({scheme:mse.SCHEME,authority:"model",path:"/"});this.workspace={id:e$,folders:[new Qq({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===mse.SCHEME?this.workspace.folders[0]:null}}function fse(e,t,i){if(!t)return;if(!(e instanceof use))return;const n=[];Object.keys(t).forEach((e=>{(function(e){return eL()[`editor.${e}`]||!1})(e)&&n.push([`editor.${e}`,t[e]]),i&&function(e){return eL()[`diffEditor.${e}`]||!1}(e)&&n.push([`diffEditor.${e}`,t[e]])})),n.length>0&&e.updateValues(n)}mse.SCHEME="inmemory";let _se=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return nse(this,void 0,void 0,(function*(){const t=Array.isArray(e)?e:iL.convert(e),i=new Map;for(const e of t){if(!(e instanceof nL))throw new Error("bad edit - only text edits are supported");const t=this._modelService.getModel(e.resource);if(!t)throw new Error("bad edit - model not found");if("number"==typeof e.versionId&&t.getVersionId()!==e.versionId)throw new Error("bad state - model changed in the meantime");let n=i.get(t);n||(n=[],i.set(t,n)),n.push(Fq.replaceMove(Rh.lift(e.textEdit.range),e.textEdit.text))}let n=0,s=0;for(const[e,o]of i)e.pushStackElement(),e.pushEditOperations([],o,(()=>[])),e.pushStackElement(),s+=1,n+=o.length;return{ariaSummary:Qs(WJ.bulkEditServiceSummary,n,s),isApplied:n>0}}))}};_se=tse([ise(0,Ha)],_se);let vse=class extends Mte{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const e=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();e&&(t=e.getContainerDomNode())}return super.showContextView(e,t,i)}};vse=tse([ise(0,hee),ise(1,Wa)],vse);let bse=class extends tie{constructor(e,t,i,n,s,o){super(e,t,i,n,s,o),this.configure({blockMouse:!1})}};bse=tse([ise(0,lh),ise(1,mL),ise(2,Ux),ise(3,WL),ise(4,th),ise(5,Ol)],bse);var Cse;yu(pu,use,0),yu(pT,gse,0),yu(mT,pse,0),yu($q,mse,0),yu(Zz,class{getUriLabel(e,t){return"file"===e.scheme?e.fsPath:e.path}getUriBasenameLabel(e){return wa(e)}},0),yu(lh,class{publicLog2(){}},0),yu(x3,class{confirm(e){return nse(this,void 0,void 0,(function*(){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}}))}doConfirm(e,t){let i=e;return t&&(i=i+"\n\n"+t),window.confirm(i)}prompt(e){var t,i;return nse(this,void 0,void 0,(function*(){let n;if(this.doConfirm(e.message,e.detail)){const s=[...null!==(t=e.buttons)&&void 0!==t?t:[]];e.cancelButton&&"string"!=typeof e.cancelButton&&"boolean"!=typeof e.cancelButton&&s.push(e.cancelButton),n=yield null===(i=s[0])||void 0===i?void 0:i.run({checkboxChecked:!1})}return{result:n}}))}error(e,t){return nse(this,void 0,void 0,(function*(){yield this.prompt({type:gL.Error,message:e,detail:t})}))}},0),yu(CE,class{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}},0),yu(mL,ase,0),yu(LN,Qne,0),yu(Lc,class extends zte{constructor(){super()}},0),yu(j4,class extends E{constructor(){super(),this._onColorThemeChange=this._register(new U),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new U),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new b7,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(C7,E7(C7)),this._knownThemes.set(w7,E7(w7)),this._knownThemes.set(y7,E7(y7)),this._knownThemes.set(S7,E7(S7));const e=this._register(function(e){const t=new N,i=t.add(new U),n=iR();return t.add(n.onDidChange((()=>i.fire()))),e&&t.add(e.onDidProductIconThemeChange((()=>i.fire()))),{dispose:()=>t.dispose(),onDidChange:i.event,getCSS(){const t=e?e.getProductIconTheme():new b7,i={},s=e=>{const n=t.getIcon(e);if(!n)return;const s=n.font;return s?(i[s.id]=s.definition,`.codicon-${e.id}:before { content: '${n.fontCharacter}'; font-family: ${ys(s.id)}; }`):`.codicon-${e.id}:before { content: '${n.fontCharacter}'; }`},o=[];for(const e of n.getIcons()){const t=s(e);t&&o.push(t)}for(const e in i){const t=i[e],n=t.weight?`font-weight: ${t.weight};`:"",s=t.style?`font-style: ${t.style};`:"",r=t.src.map((e=>`${ws(e.location)} format('${e.format}')`)).join(", ");o.push(`@font-face { src: ${r}; font-family: ${ys(e)};${n}${s} font-display: block; }`)}return o.join("\n")}}}(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}\n${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(C7),this._onOSSchemeChanged(),this._register(e.onDidChange((()=>{this._codiconCSS=e.getCSS(),this._updateCSS()}))),ee("(forced-colors: active)",(()=>{this._onOSSchemeChanged()}))}registerEditorContainer(e){return Zn(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=Jn(void 0,(e=>{e.className="monaco-colors",e.textContent=this._allCSS})),this._styleElements.push(this._globalStyleElement)),E.None}_registerShadowDomContainer(e){const t=Jn(e,(e=>{e.className="monaco-colors",e.textContent=this._allCSS}));return this._styleElements.push(t),{dispose:()=>{for(let e=0;e{t.base===e&&t.notifyBaseUpdated()})),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;t=this._knownThemes.has(e)?this._knownThemes.get(e):this._knownThemes.get(C7),this._updateActualTheme(t)}_updateActualTheme(e){e&&this._theme!==e&&(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=window.matchMedia("(forced-colors: active)").matches;if(e!==A_(this._theme.type)){let t;t=O_(this._theme.type)?e?y7:w7:e?S7:C7,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:i=>{t[i]||(e.push(i),t[i]=!0)}};k7.getThemingParticipants().forEach((e=>e(this._theme,i,this._environment)));const n=[];for(const o of L7.getColors()){const e=this._theme.getColor(o.id,!0);e&&n.push(`${yp(o.id)}: ${e.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor { ${n.join("\n")} }`);const s=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(function(e){const t=[];for(let i=1,n=e.length;ie.textContent=this._allCSS))}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}},0),yu(hh,class extends ese{constructor(){super(new gh)}},0),yu(Ha,wie,0),yu(AR,uie,0),yu(Ol,zne,0),yu(fL,class{withProgress(e,t,i){return t({report:()=>{}})}},0),yu(vL,rse,0),yu(ZN,class extends XN{constructor(){super(),this.applicationStorage=this._register(new qN(new $N,{hint:UN.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new qN(new $N,{hint:UN.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new qN(new $N,{hint:UN.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage((e=>this.emitDidChangeValue(1,e)))),this._register(this.profileStorage.onDidChangeStorage((e=>this.emitDidChangeValue(0,e)))),this._register(this.applicationStorage.onDidChangeStorage((e=>this.emitDidChangeValue(-1,e))))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}},0),yu(fG,wT,0),yu(tL,_se,0),yu(B7,class{constructor(){this._neverEmitter=new U,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}},0),yu(za,ose,0),yu(QR,_ne,0),yu(WH,class{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new N,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,i;e!==this._lastFocusedWidget&&(null===(t=this._lastFocusedWidget)||void 0===t||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,null===(i=this._lastFocusedWidget)||void 0===i||i.getHTMLElement().classList.add("last-focused"))}register(e,t){if(!this._hasCreatedStyleController){this._hasCreatedStyleController=!0;new px(Jn(),"").style(Qx)}if(this.lists.some((t=>t.widget===e)))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),e.getHTMLElement()===document.activeElement&&this.setLastFocusedList(e),D(e.onDidFocus((()=>this.setLastFocusedList(e))),x((()=>this.lists.splice(this.lists.indexOf(i),1))),e.onDidDispose((()=>{this.lists=this.lists.filter((e=>e!==i)),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)})))}dispose(){this.disposables.dispose()}},0),yu(Ya,lse,0),yu(WL,hse,0),yu(cE,une,0),yu(Ux,vse,0),yu(qk,hie,0),yu(eS,Ine,0),yu(Kx,bse,0),yu(th,yne,0),yu(y$,class{playAudioCue(e,t){return nse(this,void 0,void 0,(function*(){}))}},0),function(e){const t=new DB;for(const[r,a]of Su())t.set(r,a);const i=new $ne(t,!0);t.set(Fa,i),e.get=function(e){n||o({});const s=t.get(e);if(!s)throw new Error("Missing service "+e);return s instanceof Cu?i.invokeFunction((t=>t.get(e))):s};let n=!1;const s=new U;function o(e){if(n)return i;n=!0;for(const[i,n]of Su())t.get(i)||t.set(i,n);for(const i in e)if(e.hasOwnProperty(i)){const n=Ba(i);t.get(n)instanceof Cu&&t.set(n,e[i])}const o=IT();for(const t of o)try{i.createInstance(t)}catch(a){r(a)}return s.fire(),i}e.initialize=o,e.withServices=function(e){if(n)return e();const t=new N,i=t.add(s.event((()=>{i.dispose(),t.add(e())})));return t}}(Cse||(Cse={}));var wse=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},yse=function(e,t){return function(i,n){t(i,n,e)}};let Sse=0,Lse=!1;function kse(e){if(!e){if(Lse)return;Lse=!0}!function(e){Ms=document.createElement("div"),Ms.className="monaco-aria-container";const t=()=>{const e=document.createElement("div");return e.className="monaco-alert",e.setAttribute("role","alert"),e.setAttribute("aria-atomic","true"),Ms.appendChild(e),e};Ts=t(),Rs=t();const i=()=>{const e=document.createElement("div");return e.className="monaco-status",e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","true"),Ms.appendChild(e),e};As=i(),Os=i(),e.appendChild(Ms)}(e||document.body)}let Dse=class extends eW{constructor(e,t,i,n,s,o,r,a,l,h,d,c){const u=Object.assign({},t);u.ariaLabel=u.ariaLabel||FJ.editorViewAccessibleLabel,u.ariaLabel=u.ariaLabel+";"+FJ.accessibilityHelpMessage,super(e,u,{},i,n,s,o,a,l,h,d,c),this._standaloneKeybindingService=r instanceof hse?r:null,kse(u.ariaContainerElement)}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_"+ ++Sse,s=pl.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,s),n}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if("string"!=typeof e.id||"string"!=typeof e.label||"function"!=typeof e.run)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"),E.None;const t=e.id,i=e.label,n=pl.and(pl.equals("editorId",this.getId()),pl.deserialize(e.precondition)),s=e.keybindings,o=pl.and(n,pl.deserialize(e.keybindingContext)),r=e.contextMenuGroupId||null,a=e.contextMenuOrder||0,l=(t,...i)=>Promise.resolve(e.run(this,...i)),h=new N,d=this.getId()+":"+t;if(h.add(Xa.registerCommand(d,l)),r){const e={command:{id:d,title:i},when:n,group:r,order:a};h.add(nh.appendMenuItem(eh.EditorContext,e))}if(Array.isArray(s))for(const u of s)h.add(this._standaloneKeybindingService.addDynamicKeybinding(d,u,l,o));const c=new rF(d,i,i,n,((...t)=>Promise.resolve(e.run(this,...t))),this._contextKeyService);return this._actions.set(t,c),h.add(x((()=>{this._actions.delete(t)}))),h}_triggerCommand(e,t){if(this._codeEditorService instanceof lee)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};Dse=wse([yse(2,Fa),yse(3,Wa),yse(4,Ya),yse(5,Ol),yse(6,WL),yse(7,P_),yse(8,mL),yse(9,QR),yse(10,Ju),yse(11,oL)],Dse);let xse=class extends Dse{constructor(e,t,i,n,s,o,r,a,l,h,d,c,u,g,p){const m=Object.assign({},t);fse(h,m,!1);const f=a.registerEditorContainer(e);"string"==typeof m.theme&&a.setTheme(m.theme),void 0!==m.autoDetectHighContrast&&a.setAutoDetectHighContrast(Boolean(m.autoDetectHighContrast));const _=m.model;let v;if(delete m.model,super(e,m,i,n,s,o,r,a,l,d,g,p),this._configurationService=h,this._standaloneThemeService=a,this._register(f),void 0===_){const e=u.getLanguageIdByMimeType(m.language)||m.language||Ku;v=Ese(c,u,m.value||"",e,void 0),this._ownsModel=!0}else v=_,this._ownsModel=!1;if(this._attachModel(v),v){const e={oldModelUrl:null,newModelUrl:v.uri};this._onDidChangeModel.fire(e)}}dispose(){super.dispose()}updateOptions(e){fse(this._configurationService,e,!1),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),void 0!==e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};xse=wse([yse(2,Fa),yse(3,Wa),yse(4,Ya),yse(5,Ol),yse(6,WL),yse(7,j4),yse(8,mL),yse(9,pu),yse(10,QR),yse(11,Ha),yse(12,Lc),yse(13,Ju),yse(14,oL)],xse);let Nse=class extends oZ{constructor(e,t,i,n,s,o,r,a,l,h,d,c){const u=Object.assign({},t);fse(a,u,!0);const g=o.registerEditorContainer(e);"string"==typeof u.theme&&o.setTheme(u.theme),void 0!==u.autoDetectHighContrast&&o.setAutoDetectHighContrast(Boolean(u.autoDetectHighContrast)),super(e,u,{},n,i,s,c,h),this._configurationService=a,this._standaloneThemeService=o,this._register(g)}dispose(){super.dispose()}updateOptions(e){fse(this._configurationService,e,!0),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),void 0!==e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(Dse,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)}};function Ese(e,t,i,n,s){if(i=i||"",!n){const n=i.indexOf("\n");let o=i;return-1!==n&&(o=i.substring(0,n)),Ise(e,i,t.createByFilepathOrFirstLine(s||null,o),s)}return Ise(e,i,t.createById(n),s)}function Ise(e,t,i,n){return e.createModel(t,i,n)}Nse=wse([yse(2,Fa),yse(3,Ol),yse(4,Wa),yse(5,j4),yse(6,mL),yse(7,pu),yse(8,Kx),yse(9,vL),yse(10,eS),yse(11,y$)],Nse);var Mse=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Tse(e,t,i){return Cse.initialize(i||{}).createInstance(xse,e,t)}function Rse(e){return Cse.get(Wa).onCodeEditorAdd((t=>{e(t)}))}function Ase(e){return Cse.get(Wa).onDiffEditorAdd((t=>{e(t)}))}function Ose(){return Cse.get(Wa).listCodeEditors()}function Pse(){return Cse.get(Wa).listDiffEditors()}function Fse(e,t,i){return Cse.initialize(i||{}).createInstance(Nse,e,t)}function Bse(e){if("string"!=typeof e.id||"function"!=typeof e.run)throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return Xa.registerCommand(e.id,e.run)}function Wse(e){if("string"!=typeof e.id||"string"!=typeof e.label||"function"!=typeof e.run)throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const t=pl.deserialize(e.precondition),i=new N;if(i.add(Xa.registerCommand(e.id,((i,...n)=>vh.runEditorCommand(i,n,t,((t,i,n)=>Promise.resolve(e.run(i,...n))))))),e.contextMenuGroupId){const n={command:{id:e.id,title:e.label},when:t,group:e.contextMenuGroupId,order:e.contextMenuOrder||0};i.add(nh.appendMenuItem(eh.EditorContext,n))}if(Array.isArray(e.keybindings)){const n=Cse.get(WL);if(n instanceof hse){const s=pl.and(t,pl.deserialize(e.keybindingContext));i.add(n.addDynamicKeybindings(e.keybindings.map((t=>({keybinding:t,command:e.id,when:s})))))}else console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService")}return i}function Vse(e){return Hse([e])}function Hse(e){const t=Cse.get(WL);return t instanceof hse?t.addDynamicKeybindings(e.map((e=>({keybinding:e.keybinding,command:e.command,commandArgs:e.commandArgs,when:pl.deserialize(e.when)})))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),E.None)}function zse(e,t,i){const n=Cse.get(Lc),s=n.getLanguageIdByMimeType(t)||t;return Ese(Cse.get(Ha),n,e,s,i)}function Use(e,t){const i=Cse.get(Lc),n=i.getLanguageIdByMimeType(t)||t||Ku;e.setLanguage(i.createById(n))}function Kse(e,t,i){if(e){Cse.get(LN).changeOne(t,e.uri,i)}}function jse(e){Cse.get(LN).changeAll(e,[])}function qse(e){return Cse.get(LN).read(e)}function $se(e){return Cse.get(LN).onMarkerChanged(e)}function Gse(e){return Cse.get(Ha).getModel(e)}function Zse(){return Cse.get(Ha).getModels()}function Yse(e){return Cse.get(Ha).onModelAdded(e)}function Xse(e){return Cse.get(Ha).onModelRemoved(e)}function Qse(e){return Cse.get(Ha).onModelLanguageChanged((t=>{e({model:t.model,oldLanguage:t.oldLanguageId})}))}function Jse(e){return function(e,t,i){return new N8(e,t,i)}(Cse.get(Ha),Cse.get(Ju),e)}function eoe(e,t){const i=Cse.get(Lc),n=Cse.get(j4);return J8.colorizeElement(n,i,e,t).then((()=>{n.registerEditorContainer(e)}))}function toe(e,t,i){const n=Cse.get(Lc);return Cse.get(j4).registerEditorContainer(document.body),J8.colorize(n,e,t,i)}function ioe(e,t,i=4){return Cse.get(j4).registerEditorContainer(document.body),J8.colorizeModelLine(e,t,i)}function noe(e,t){EC.getOrCreate(t);const i=function(e){const t=EC.get(e);return t||{getInitialState:()=>IC,tokenize:(t,i,n)=>MC(e,n)}}(t),n=oo(e),s=[];let o=i.getInitialState();for(let r=0,a=n.length;rMse(this,void 0,void 0,(function*(){var n;if(!i)return null;const s=null===(n=t.options)||void 0===n?void 0:n.selection;let o;return s&&"number"==typeof s.endLineNumber&&"number"==typeof s.endColumn?o=s:s&&(o={lineNumber:s.startLineNumber,column:s.startColumn}),(yield e.openCodeEditor(i,t.resource,o))?i:null}))))}function doe(e,t){return"boolean"==typeof e?e:t}function coe(e,t){return"string"==typeof e?e:t}function uoe(e,t=!1){t&&(e=e.map((function(e){return e.toLowerCase()})));const i=function(e){const t={};for(const i of e)t[i]=!0;return t}(e);return t?function(e){return void 0!==i[e.toLowerCase()]&&i.hasOwnProperty(e.toLowerCase())}:function(e){return void 0!==i[e]&&i.hasOwnProperty(e)}}function goe(e,t){t=t.replace(/@@/g,"\x01");let i,n=0;do{i=!1,t=t.replace(/@(\w+)/g,(function(n,s){i=!0;let o="";if("string"==typeof e[s])o=e[s];else{if(!(e[s]&&e[s]instanceof RegExp))throw void 0===e[s]?P8(e,"language definition does not contain attribute '"+s+"', used at: "+t):P8(e,"attribute reference '"+s+"' must be a string, used at: "+t);o=e[s].source}return T8(o)?"":"(?:"+o+")"})),n++}while(i&&n<5);t=t.replace(/\x01/g,"@");const s=(e.ignoreCase?"i":"")+(e.unicode?"u":"");return new RegExp(t,s)}function poe(e,t,i,n){let s=-1,o=i,r=i.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);r&&(r[3]&&(s=parseInt(r[3]),r[2]&&(s+=100)),o=r[4]);let a,l="~",h=o;if(o&&0!==o.length?/^\w*$/.test(h)?l="==":(r=o.match(/^(@|!@|~|!~|==|!=)(.*)$/),r&&(l=r[1],h=r[2])):(l="!=",h=""),"~"!==l&&"!~"!==l||!/^(\w|\|)*$/.test(h))if("@"===l||"!@"===l){const i=e[h];if(!i)throw P8(e,"the @ match target '"+h+"' is not defined, in rule: "+t);if(!function(e,t){if(!t)return!1;if(!Array.isArray(t))return!1;for(const i of t)if(!e(i))return!1;return!0}((function(e){return"string"==typeof e}),i))throw P8(e,"the @ match target '"+h+"' must be an array of strings, in rule: "+t);const n=uoe(i,e.ignoreCase);a=function(e){return"@"===l?n(e):!n(e)}}else if("~"===l||"!~"===l)if(h.indexOf("$")<0){const t=goe(e,"^"+h+"$");a=function(e){return"~"===l?t.test(e):!t.test(e)}}else a=function(t,i,n,s){return goe(e,"^"+F8(e,h,i,n,s)+"$").test(t)};else if(h.indexOf("$")<0){const t=R8(e,h);a=function(e){return"=="===l?e===t:e!==t}}else{const t=R8(e,h);a=function(i,n,s,o,r){const a=F8(e,t,n,s,o);return"=="===l?i===a:i!==a}}else{const t=uoe(h.split("|"),e.ignoreCase);a=function(e){return"~"===l?t(e):!t(e)}}return-1===s?{name:i,value:n,test:function(e,t,i,n){return a(e,e,t,i,n)}}:{name:i,value:n,test:function(e,t,i,n){const o=function(e,t,i,n){if(n<0)return e;if(n=100){n-=100;const e=i.split(".");if(e.unshift(i),n=0&&(n.tokenSubst=!0),"string"==typeof i.bracket)if("@open"===i.bracket)n.bracket=1;else{if("@close"!==i.bracket)throw P8(e,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+t);n.bracket=-1}if(i.next){if("string"!=typeof i.next)throw P8(e,"the next state must be a string value in rule: "+t);{let s=i.next;if(!/^(@pop|@push|@popall)$/.test(s)&&("@"===s[0]&&(s=s.substr(1)),s.indexOf("$")<0&&!function(e,t){let i=t;for(;i&&i.length>0;){if(e.stateNames[i])return!0;const t=i.lastIndexOf(".");i=t<0?null:i.substr(0,t)}return!1}(e,F8(e,s,"",[],""))))throw P8(e,"the next state '"+i.next+"' is not defined in rule: "+t);n.next=s}}return"number"==typeof i.goBack&&(n.goBack=i.goBack),"string"==typeof i.switchTo&&(n.switchTo=i.switchTo),"string"==typeof i.log&&(n.log=i.log),"string"==typeof i.nextEmbedded&&(n.nextEmbedded=i.nextEmbedded,e.usesEmbedded=!0),n}}if(Array.isArray(i)){const n=[];for(let s=0,o=i.length;s0&&"^"===i[0],this.name=this.name+": "+i,this.regex=goe(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")")}setAction(e,t){this.action=moe(e,this.name,t)}}function _oe(e,t){if(!t||"object"!=typeof t)throw new Error("Monarch: expecting a language definition object");const i={};i.languageId=e,i.includeLF=doe(t.includeLF,!1),i.noThrow=!1,i.maxStack=100,i.start="string"==typeof t.start?t.start:null,i.ignoreCase=doe(t.ignoreCase,!1),i.unicode=doe(t.unicode,!1),i.tokenPostfix=coe(t.tokenPostfix,"."+i.languageId),i.defaultToken=coe(t.defaultToken,"source"),i.usesEmbedded=!1;const n=t;function s(e,o,r){for(const a of r){let r=a.include;if(r){if("string"!=typeof r)throw P8(i,"an 'include' attribute must be a string at: "+e);if("@"===r[0]&&(r=r.substr(1)),!t.tokenizer[r])throw P8(i,"include target '"+r+"' is not defined at: "+e);s(e+"."+r,o,t.tokenizer[r])}else{const t=new foe(e);if(Array.isArray(a)&&a.length>=1&&a.length<=3)if(t.setRegex(n,a[0]),a.length>=3)if("string"==typeof a[1])t.setAction(n,{token:a[1],next:a[2]});else{if("object"!=typeof a[1])throw P8(i,"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: "+e);{const e=a[1];e.next=a[2],t.setAction(n,e)}}else t.setAction(n,a[1]);else{if(!a.regex)throw P8(i,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+e);a.name&&"string"==typeof a.name&&(t.name=a.name),a.matchOnlyAtStart&&(t.matchOnlyAtLineStart=doe(a.matchOnlyAtLineStart,!1)),t.setRegex(n,a.regex),t.setAction(n,a.action)}o.push(t)}}}if(n.languageId=e,n.includeLF=i.includeLF,n.ignoreCase=i.ignoreCase,n.unicode=i.unicode,n.noThrow=i.noThrow,n.usesEmbedded=i.usesEmbedded,n.stateNames=t.tokenizer,n.defaultToken=i.defaultToken,!t.tokenizer||"object"!=typeof t.tokenizer)throw P8(i,"a language definition must define the 'tokenizer' attribute as an object");i.tokenizer=[];for(const r in t.tokenizer)if(t.tokenizer.hasOwnProperty(r)){i.start||(i.start=r);const e=t.tokenizer[r];i.tokenizer[r]=new Array,s("tokenizer."+r,i.tokenizer[r],e)}if(i.usesEmbedded=n.usesEmbedded,t.brackets){if(!Array.isArray(t.brackets))throw P8(i,"the 'brackets' attribute must be defined as an array")}else t.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 t.brackets){let e=r;if(e&&Array.isArray(e)&&3===e.length&&(e={token:e[2],open:e[0],close:e[1]}),e.open===e.close)throw P8(i,"open and close brackets in a 'brackets' attribute must be different: "+e.open+"\n hint: use the 'bracket' attribute if matching on equal brackets is required.");if("string"!=typeof e.open||"string"!=typeof e.token||"string"!=typeof e.close)throw P8(i,"every element in the 'brackets' array must be a '{open,close,token}' object or array");o.push({token:e.token+i.tokenPostfix,open:R8(i,e.open),close:R8(i,e.close)})}return i.brackets=o,i.noThrow=!0,i}var voe=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function boe(e){Uu.registerLanguage(e)}function Coe(){let e=[];return e=e.concat(Uu.getLanguages()),e}function woe(e){return Cse.get(Lc).languageIdCodec.encodeLanguageId(e)}function yoe(e,t){return Cse.withServices((()=>{const i=Cse.get(Lc).onDidRequestRichLanguageFeatures((n=>{n===e&&(i.dispose(),t())}));return i}))}function Soe(e,t){return Cse.withServices((()=>{const i=Cse.get(Lc).onDidRequestBasicLanguageFeatures((n=>{n===e&&(i.dispose(),t())}));return i}))}function Loe(e,t){if(!Cse.get(Lc).isRegisteredLanguageId(e))throw new Error(`Cannot set configuration for unknown language ${e}`);return Cse.get(Ju).register(e,t,100)}class koe{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if("function"==typeof this._actual.tokenize)return Doe.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 wC(n.tokens,n.endState)}}class Doe{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 s=0,o=e.length;s0&&s[o-1]===a)continue;let h=e.startIndex;0===l?h=0:hvoe(this,void 0,void 0,(function*(){const i=yield Promise.resolve(t.create());return i?"function"==typeof i.getInitialState?Eoe(e,i):new Z8(Cse.get(Lc),Cse.get(j4),e,_oe(e,i),Cse.get(pu)):null}))));return EC.registerFactory(e,i)}function Moe(e,t){if(!Cse.get(Lc).isRegisteredLanguageId(e))throw new Error(`Cannot set tokens provider for unknown language ${e}`);return xoe(t)?Ioe(e,{create:()=>t}):EC.register(e,Eoe(e,t))}function Toe(e,t){return xoe(t)?Ioe(e,{create:()=>t}):EC.register(e,(t=>new Z8(Cse.get(Lc),Cse.get(j4),e,_oe(e,t),Cse.get(pu)))(t))}function Roe(e,t){return Cse.get(oL).referenceProvider.register(e,t)}function Aoe(e,t){return Cse.get(oL).renameProvider.register(e,t)}function Ooe(e,t){return Cse.get(oL).signatureHelpProvider.register(e,t)}function Poe(e,t){return Cse.get(oL).hoverProvider.register(e,{provideHover:(e,i,n)=>{const s=e.getWordAtPosition(i);return Promise.resolve(t.provideHover(e,i,n)).then((e=>{if(e)return!e.range&&s&&(e.range=new Rh(i.lineNumber,s.startColumn,i.lineNumber,s.endColumn)),e.range||(e.range=new Rh(i.lineNumber,i.column,i.lineNumber,i.column)),e}))}})}function Foe(e,t){return Cse.get(oL).documentSymbolProvider.register(e,t)}function Boe(e,t){return Cse.get(oL).documentHighlightProvider.register(e,t)}function Woe(e,t){return Cse.get(oL).linkedEditingRangeProvider.register(e,t)}function Voe(e,t){return Cse.get(oL).definitionProvider.register(e,t)}function Hoe(e,t){return Cse.get(oL).implementationProvider.register(e,t)}function zoe(e,t){return Cse.get(oL).typeDefinitionProvider.register(e,t)}function Uoe(e,t){return Cse.get(oL).codeLensProvider.register(e,t)}function Koe(e,t,i){return Cse.get(oL).codeActionProvider.register(e,{providedCodeActionKinds:null==i?void 0:i.providedCodeActionKinds,documentation:null==i?void 0:i.documentation,provideCodeActions:(e,i,n,s)=>{const o=Cse.get(LN).read({resource:e.uri}).filter((e=>Rh.areIntersectingOrTouching(e,i)));return t.provideCodeActions(e,i,{markers:o,only:n.only,trigger:n.trigger},s)},resolveCodeAction:t.resolveCodeAction})}function joe(e,t){return Cse.get(oL).documentFormattingEditProvider.register(e,t)}function qoe(e,t){return Cse.get(oL).documentRangeFormattingEditProvider.register(e,t)}function $oe(e,t){return Cse.get(oL).onTypeFormattingEditProvider.register(e,t)}function Goe(e,t){return Cse.get(oL).linkProvider.register(e,t)}function Zoe(e,t){return Cse.get(oL).completionProvider.register(e,t)}function Yoe(e,t){return Cse.get(oL).colorProvider.register(e,t)}function Xoe(e,t){return Cse.get(oL).foldingRangeProvider.register(e,t)}function Qoe(e,t){return Cse.get(oL).declarationProvider.register(e,t)}function Joe(e,t){return Cse.get(oL).selectionRangeProvider.register(e,t)}function ere(e,t){return Cse.get(oL).documentSemanticTokensProvider.register(e,t)}function tre(e,t){return Cse.get(oL).documentRangeSemanticTokensProvider.register(e,t)}function ire(e,t){return Cse.get(oL).inlineCompletionsProvider.register(e,t)}function nre(e,t){return Cse.get(oL).inlayHintsProvider.register(e,t)}ZS.wrappingIndent.defaultValue=0,ZS.glyphMargin.defaultValue=!1,ZS.autoIndent.defaultValue=3,ZS.overviewRulerLanes.defaultValue=2,_J.setFormatterSelector(((e,t,i)=>Promise.resolve(e[0])));const sre=dM();sre.editor={create:Tse,getEditors:Ose,getDiffEditors:Pse,onDidCreateEditor:Rse,onDidCreateDiffEditor:Ase,createDiffEditor:Fse,addCommand:Bse,addEditorAction:Wse,addKeybindingRule:Vse,addKeybindingRules:Hse,createModel:zse,setModelLanguage:Use,setModelMarkers:Kse,getModelMarkers:qse,removeAllMarkers:jse,onDidChangeMarkers:$se,getModels:Zse,getModel:Gse,onDidCreateModel:Yse,onWillDisposeModel:Xse,onDidChangeModelLanguage:Qse,createWebWorker:Jse,colorizeElement:eoe,colorize:toe,colorizeModelLine:ioe,tokenize:noe,defineTheme:soe,setTheme:ooe,remeasureFonts:roe,registerCommand:aoe,registerLinkOpener:loe,registerEditorOpener:hoe,AccessibilitySupport:LI,ContentWidgetPositionPreference:II,CursorChangeReason:MI,DefaultEndOfLine:TI,EditorAutoIndentStrategy:AI,EditorOption:OI,EndOfLinePreference:PI,EndOfLineSequence:FI,MinimapPosition:qI,MouseTargetType:$I,OverlayWidgetPositionPreference:GI,OverviewRulerLane:ZI,GlyphMarginLane:BI,RenderLineNumbersType:XI,RenderMinimap:QI,ScrollbarVisibility:eM,ScrollType:JI,TextEditorCursorBlinkingStyle:oM,TextEditorCursorStyle:rM,TrackedRangeStickiness:aM,WrappingIndent:lM,InjectedTextCursorStops:VI,PositionAffinity:YI,ConfigurationChangedEvent:gS,BareFontInfo:UR,FontInfo:KR,TextModelResolvedOptions:kd,FindMatch:Dd,ApplyUpdateResult:fS,EditorZoom:HR,EditorType:aF,EditorOptions:ZS},sre.languages={register:boe,getLanguages:Coe,onLanguage:yoe,onLanguageEncountered:Soe,getEncodedLanguageId:woe,setLanguageConfiguration:Loe,setColorMap:Noe,registerTokensProviderFactory:Ioe,setTokensProvider:Moe,setMonarchTokensProvider:Toe,registerReferenceProvider:Roe,registerRenameProvider:Aoe,registerCompletionItemProvider:Zoe,registerSignatureHelpProvider:Ooe,registerHoverProvider:Poe,registerDocumentSymbolProvider:Foe,registerDocumentHighlightProvider:Boe,registerLinkedEditingRangeProvider:Woe,registerDefinitionProvider:Voe,registerImplementationProvider:Hoe,registerTypeDefinitionProvider:zoe,registerCodeLensProvider:Uoe,registerCodeActionProvider:Koe,registerDocumentFormattingEditProvider:joe,registerDocumentRangeFormattingEditProvider:qoe,registerOnTypeFormattingEditProvider:$oe,registerLinkProvider:Goe,registerColorProvider:Yoe,registerFoldingRangeProvider:Xoe,registerDeclarationProvider:Qoe,registerSelectionRangeProvider:Joe,registerDocumentSemanticTokensProvider:ere,registerDocumentRangeSemanticTokensProvider:tre,registerInlineCompletionsProvider:ire,registerInlayHintsProvider:nre,DocumentHighlightKind:RI,CompletionItemKind:xI,CompletionItemTag:NI,CompletionItemInsertTextRule:DI,SymbolKind:nM,SymbolTag:sM,IndentAction:WI,CompletionTriggerKind:EI,SignatureHelpTriggerKind:iM,InlayHintKind:HI,InlineCompletionTriggerKind:zI,CodeActionTriggerType:kI,FoldingRangeKind:xC,SelectedSuggestionInfo:yC};const ore=sre.CancellationTokenSource,rre=sre.Emitter,are=sre.KeyCode,lre=sre.KeyMod,hre=sre.Position,dre=sre.Range,cre=sre.Selection,ure=sre.SelectionDirection,gre=sre.MarkerSeverity,pre=sre.MarkerTag,mre=sre.Uri,fre=sre.Token,_re=sre.editor,vre=sre.languages,bre=globalThis.MonacoEnvironment;((null==bre?void 0:bre.globalAPI)||"function"==typeof define&&i.amdO)&&(globalThis.monaco=sre),void 0!==globalThis.require&&"function"==typeof globalThis.require.config&&globalThis.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});var Cre,wre,yre=Object.defineProperty,Sre=Object.getOwnPropertyDescriptor,Lre=Object.getOwnPropertyNames,kre=Object.prototype.hasOwnProperty,Dre=(e,t,i,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of Lre(t))kre.call(e,s)||s===i||yre(e,s,{get:()=>t[s],enumerable:!(n=Sre(t,s))||n.enumerable});return e},xre={};Dre(xre,Cre=s,"default"),wre&&Dre(wre,Cre,"default");var Nre,Ere=new class{_onDidChange=new xre.Emitter;_diagnosticsOptions;_modeConfiguration;_languageId;constructor(e,t,i){this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}}("json",{validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},{documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0});xre.languages.json={jsonDefaults:Ere},xre.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]}),xre.languages.onLanguage("json",(()=>{i.e(4839).then(i.bind(i,4839)).then((e=>e.setupMode(Ere)))})),self.MonacoEnvironment=(Nre={editorWorkerService:"editor.worker.js",json:"json.worker.js"},{globalAPI:!1,getWorkerUrl:function(e,t){var n=i.p,s=(n?n.replace(/\/$/,"")+"/":"")+Nre[t];if(/^((http:)|(https:)|(file:)|(\/\/))/.test(s)){var o=String(window.location),r=o.substr(0,o.length-window.location.hash.length-window.location.search.length-window.location.pathname.length);if(s.substring(0,r.length)!==r){/^(\/\/)/.test(s)&&(s=window.location.protocol+s);var a=new Blob(["/*"+t+'*/importScripts("'+s+'");'],{type:"application/javascript"});return URL.createObjectURL(a)}}return s}});const Ire=n},1569:(e,t,i)=>{i.r(t),i.d(t,{MonacoDiffEditor:()=>h,default:()=>g,monaco:()=>n});var n=i(8047),s=i(6540);function o(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}function r(){}var a=function(){return a=Object.assign||function(e){for(var t,i=1,n=arguments.length;i{i.d(t,{m:()=>ce});class n extends Error{constructor(e,t){super("".concat(e," at position ").concat(t)),this.position=t}}const s=92,o=47,r=42,a=123,l=125,h=91,d=93,c=40,u=41,g=32,p=10,m=9,f=13,_=8,v=12,b=34,C=43,w=45,y=39,S=48,L=57,k=44,D=46,x=58,N=59,E=65,I=97,M=69,T=101,R=70,A=102,O=160,P=8192,F=8202,B=8239,W=8287,V=12288,H=8220,z=8221,U=8216,K=8217,j=96,q=180;function $(e){return e>=S&&e<=L}function G(e){return e>=32&&e<=1114111}function Z(e){return Y.test(e)}const Y=/^[,:[\]/{}()\n+]$/;function X(e){return Q.test(e)||e&&te(e.charCodeAt(0))}const Q=/^[[{\w-]$/;function J(e){return e===p||e===f||e===m||e===_||e===v}function ee(e){return e===g||e===p||e===m||e===f}function te(e){return ie(e)||se(e)}function ie(e){return e===b||e===H||e===z}function ne(e){return e===b}function se(e){return e===y||e===U||e===K||e===j||e===q}function oe(e){return e===y}function re(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=e.lastIndexOf(t);return-1!==n?e.substring(0,n)+(i?"":e.substring(n+1)):e}function ae(e,t){let i=e.length;if(!ee(e.charCodeAt(i-1)))return e+t;for(;ee(e.charCodeAt(i-1));)i--;return e.substring(0,i)+t+e.substring(i)}function le(e,t,i){return e.substring(0,t)+e.substring(t+i)}const he={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},de={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function ce(e){let t=0,i="";m()||function(){throw new n("Unexpected end of json string",e.length)}();const g=y(k);for(g&&f(),X(e[t])&&function(e){return/[,\n][ \t\r]*$/.test(e)}(i)?(g||(i=ae(i,",")),function(){let e=!0,t=!0;for(;t;){if(e)e=!1;else{y(k)||(i=ae(i,","))}t=m()}t||(i=re(i,","));i="[\n".concat(i,"\n]")}()):g&&(i=re(i,","));e.charCodeAt(t)===l||e.charCodeAt(t)===d;)t++,f();if(t>=e.length)return i;function m(){f();const n=function(){if(e.charCodeAt(t)===a){i+="{",t++,f(),H(k)&&f();let n=!0;for(;t=e.length;o||(X(e[t])||r?i=ae(i,":"):me());m()||(o||r?i+="null":me())}return e.charCodeAt(t)===l?(i+="}",t++):i=ae(i,"}"),!0}return!1}()||function(){if(e.charCodeAt(t)===h){i+="[",t++,f(),H(k)&&f();let n=!0;for(;tn){const s=e.slice(n,t),o=/^0\d/.test(s);return i+=o?'"'.concat(s,'"'):s,!0}return!1}()||j("true","true")||j("false","false")||j("null","null")||j("True","true")||j("False","false")||j("None","null")||q();return f(),n}function f(){const e=t;let i=_();do{i=v(),i&&(i=_())}while(i);return t>e}function _(){let n,s="";for(;(n=ee(e.charCodeAt(t)))||((o=e.charCodeAt(t))===O||o>=P&&o<=F||o===B||o===W||o===V);)s+=n?e[t]:" ",t++;var o;return s.length>0&&(i+=s,!0)}function v(){if(e.charCodeAt(t)===o&&e.charCodeAt(t+1)===r){for(;t0&&void 0!==arguments[0]&&arguments[0],o=e.charCodeAt(t)===s;if(o&&(t++,o=!0),te(e.charCodeAt(t))){const a=ne(e.charCodeAt(t))?ne:oe(e.charCodeAt(t))?oe:se(e.charCodeAt(t))?se:ie,l=t,h=i.length;let d='"';for(t++;;){if(t>=e.length){const s=Y(t-1);return!n&&Z(e.charAt(s))?(t=l,i=i.substring(0,h),U(!0)):(d=ae(d,'"'),i+=d,!0)}if(a(e.charCodeAt(t))){const s=t,o=d.length;if(d+='"',t++,i+=d,f(),n||t>=e.length||Z(e.charAt(t))||te(e.charCodeAt(t))||$(e.charCodeAt(t)))return K(),!0;if(Z(e.charAt(Y(s-1))))return t=l,i=i.substring(0,h),U(!0);i=i.substring(0,h),t=s+1,d="".concat(d.substring(0,o),"\\").concat(d.substring(o))}else{if(n&&Z(e[t]))return d=ae(d,'"'),i+=d,K(),!0;if(e.charCodeAt(t)===s){const i=e.charAt(t+1);if(void 0!==de[i])d+=e.slice(t,t+2),t+=2;else if("u"===i){let i=2;for(;i<6&&((r=e.charCodeAt(t+i))>=S&&r<=L||r>=E&&r<=R||r>=I&&r<=A);)i++;6===i?(d+=e.slice(t,t+6),t+=6):t+i>=e.length?t=e.length:fe()}else d+=i,t+=2}else{const i=e.charAt(t),n=e.charCodeAt(t);n===b&&e.charCodeAt(t-1)!==s?(d+="\\".concat(i),t++):J(n)?(d+=he[i],t++):(G(n)||ge(i),d+=i,t++)}}o&&H(s)}}var r;return!1}function K(){let n=!1;for(f();e.charCodeAt(t)===C;){n=!0,t++,f(),i=re(i,'"',!0);const e=i.length,s=U();i=s?le(i,e,1):ae(i,'"')}return n}function j(n,s){return e.slice(t,t+n.length)===n&&(i+=s,t+=n.length,!0)}function q(){const n=t;for(;tn){if(e.charCodeAt(t)===c&&function(e){return/^\w+$/.test(e)}(e.slice(n,t).trim()))return t++,m(),e.charCodeAt(t)===u&&(t++,e.charCodeAt(t)===N&&t++),!0;{for(;ee(e.charCodeAt(t-1))&&t>0;)t--;const s=e.slice(n,t);return i+="undefined"===s?"null":JSON.stringify(s),e.charCodeAt(t)===b&&t++,!0}}}function Y(t){let i=t;for(;i>0&&ee(e.charCodeAt(i));)i--;return i}function Q(){return t>=e.length||Z(e[t])||ee(e.charCodeAt(t))}function ce(n){i+="".concat(e.slice(n,t),"0")}function ge(e){throw new n("Invalid character ".concat(JSON.stringify(e)),t)}function pe(){throw new n("Object key expected",t)}function me(){throw new n("Colon expected",t)}function fe(){const i=e.slice(t,t+6);throw new n('Invalid unicode character "'.concat(i,'"'),t)}!function(){throw new n("Unexpected character ".concat(JSON.stringify(e[t])),t)}()}function ue(e,t){return"*"===e[t]&&"/"===e[t+1]}},9571:(e,t,i)=>{i.d(t,{N9:()=>F,oR:()=>E});var n=i(6540),s=i(4164);const o=e=>"number"==typeof e&&!isNaN(e),r=e=>"string"==typeof e,a=e=>"function"==typeof e,l=e=>r(e)||a(e)?e:null,h=e=>(0,n.isValidElement)(e)||r(e)||a(e)||o(e);function d(e){let{enter:t,exit:i,appendPosition:s=!1,collapse:o=!0,collapseDuration:r=300}=e;return function(e){let{children:a,position:l,preventExitTransition:h,done:d,nodeRef:c,isIn:u,playToast:g}=e;const p=s?`${t}--${l}`:t,m=s?`${i}--${l}`:i,f=(0,n.useRef)(0);return(0,n.useLayoutEffect)((()=>{const e=c.current,t=p.split(" "),i=n=>{n.target===c.current&&(g(),e.removeEventListener("animationend",i),e.removeEventListener("animationcancel",i),0===f.current&&"animationcancel"!==n.type&&e.classList.remove(...t))};e.classList.add(...t),e.addEventListener("animationend",i),e.addEventListener("animationcancel",i)}),[]),(0,n.useEffect)((()=>{const e=c.current,t=()=>{e.removeEventListener("animationend",t),o?function(e,t,i){void 0===i&&(i=300);const{scrollHeight:n,style:s}=e;requestAnimationFrame((()=>{s.minHeight="initial",s.height=n+"px",s.transition=`all ${i}ms`,requestAnimationFrame((()=>{s.height="0",s.padding="0",s.margin="0",setTimeout(t,i)}))}))}(e,d,r):d()};u||(h?t():(f.current=1,e.className+=` ${m}`,e.addEventListener("animationend",t)))}),[u]),n.createElement(n.Fragment,null,a)}}function c(e,t){return null!=e?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const u=new Map;let g=[];const p=new Set,m=e=>p.forEach((t=>t(e))),f=()=>u.size>0;function _(e,t){var i;if(t)return!(null==(i=u.get(t))||!i.isToastActive(e));let n=!1;return u.forEach((t=>{t.isToastActive(e)&&(n=!0)})),n}function v(e,t){h(e)&&(f()||g.push({content:e,options:t}),u.forEach((i=>{i.buildToast(e,t)})))}function b(e,t){u.forEach((i=>{null!=t&&null!=t&&t.containerId?(null==t?void 0:t.containerId)===i.id&&i.toggle(e,null==t?void 0:t.id):i.toggle(e,null==t?void 0:t.id)}))}function C(e){const{subscribe:t,getSnapshot:i,setProps:s}=(0,n.useRef)(function(e){const t=e.containerId||1;return{subscribe(i){const s=function(e,t,i){let s=1,d=0,u=[],g=[],p=[],m=t;const f=new Map,_=new Set,v=()=>{p=Array.from(f.values()),_.forEach((e=>e()))},b=e=>{g=null==e?[]:g.filter((t=>t!==e)),v()},C=e=>{const{toastId:t,onOpen:s,updateId:o,children:r}=e.props,l=null==o;e.staleId&&f.delete(e.staleId),f.set(t,e),g=[...g,e.props.toastId].filter((t=>t!==e.staleId)),v(),i(c(e,l?"added":"updated")),l&&a(s)&&s((0,n.isValidElement)(r)&&r.props)};return{id:e,props:m,observe:e=>(_.add(e),()=>_.delete(e)),toggle:(e,t)=>{f.forEach((i=>{null!=t&&t!==i.props.toastId||a(i.toggle)&&i.toggle(e)}))},removeToast:b,toasts:f,clearQueue:()=>{d-=u.length,u=[]},buildToast:(t,g)=>{if((t=>{let{containerId:i,toastId:n,updateId:s}=t;const o=i?i!==e:1!==e,r=f.has(n)&&null==s;return o||r})(g))return;const{toastId:p,updateId:_,data:w,staleId:y,delay:S}=g,L=()=>{b(p)},k=null==_;k&&d++;const D={...m,style:m.toastStyle,key:s++,...Object.fromEntries(Object.entries(g).filter((e=>{let[t,i]=e;return null!=i}))),toastId:p,updateId:_,data:w,closeToast:L,isIn:!1,className:l(g.className||m.toastClassName),bodyClassName:l(g.bodyClassName||m.bodyClassName),progressClassName:l(g.progressClassName||m.progressClassName),autoClose:!g.isLoading&&(x=g.autoClose,N=m.autoClose,!1===x||o(x)&&x>0?x:N),deleteToast(){const e=f.get(p),{onClose:t,children:s}=e.props;a(t)&&t((0,n.isValidElement)(s)&&s.props),i(c(e,"removed")),f.delete(p),d--,d<0&&(d=0),u.length>0?C(u.shift()):v()}};var x,N;D.closeButton=m.closeButton,!1===g.closeButton||h(g.closeButton)?D.closeButton=g.closeButton:!0===g.closeButton&&(D.closeButton=!h(m.closeButton)||m.closeButton);let E=t;(0,n.isValidElement)(t)&&!r(t.type)?E=(0,n.cloneElement)(t,{closeToast:L,toastProps:D,data:w}):a(t)&&(E=t({closeToast:L,toastProps:D,data:w}));const I={content:E,props:D,staleId:y};m.limit&&m.limit>0&&d>m.limit&&k?u.push(I):o(S)?setTimeout((()=>{C(I)}),S):C(I)},setProps(e){m=e},setToggle:(e,t)=>{f.get(e).toggle=t},isToastActive:e=>g.some((t=>t===e)),getSnapshot:()=>m.newestOnTop?p.reverse():p}}(t,e,m);u.set(t,s);const d=s.observe(i);return g.forEach((e=>v(e.content,e.options))),g=[],()=>{d(),u.delete(t)}},setProps(e){var i;null==(i=u.get(t))||i.setProps(e)},getSnapshot(){var e;return null==(e=u.get(t))?void 0:e.getSnapshot()}}}(e)).current;s(e);const d=(0,n.useSyncExternalStore)(t,i,i);return{getToastToRender:function(e){if(!d)return[];const t=new Map;return d.forEach((e=>{const{position:i}=e.props;t.has(i)||t.set(i,[]),t.get(i).push(e)})),Array.from(t,(t=>e(t[0],t[1])))},isToastActive:_,count:null==d?void 0:d.length}}function w(e){const[t,i]=(0,n.useState)(!1),[s,o]=(0,n.useState)(!1),r=(0,n.useRef)(null),a=(0,n.useRef)({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:l,pauseOnHover:h,closeToast:d,onClick:c,closeOnClick:g}=e;var p,m;function f(){i(!0)}function _(){i(!1)}function v(i){const n=r.current;a.canDrag&&n&&(a.didMove=!0,t&&_(),a.delta="x"===e.draggableDirection?i.clientX-a.start:i.clientY-a.start,a.start!==i.clientX&&(a.canCloseOnClick=!1),n.style.transform=`translate3d(${"x"===e.draggableDirection?`${a.delta}px, var(--y)`:`0, calc(${a.delta}px + var(--y))`},0)`,n.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function b(){document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",b);const t=r.current;if(a.canDrag&&a.didMove&&t){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return o(!0),e.closeToast(),void e.collapseAll();t.style.transition="transform 0.2s, opacity 0.2s",t.style.removeProperty("transform"),t.style.removeProperty("opacity")}}null==(m=u.get((p={id:e.toastId,containerId:e.containerId,fn:i}).containerId||1))||m.setToggle(p.id,p.fn),(0,n.useEffect)((()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||_(),window.addEventListener("focus",f),window.addEventListener("blur",_),()=>{window.removeEventListener("focus",f),window.removeEventListener("blur",_)}}),[e.pauseOnFocusLoss]);const C={onPointerDown:function(t){if(!0===e.draggable||e.draggable===t.pointerType){a.didMove=!1,document.addEventListener("pointermove",v),document.addEventListener("pointerup",b);const i=r.current;a.canCloseOnClick=!0,a.canDrag=!0,i.style.transition="none","x"===e.draggableDirection?(a.start=t.clientX,a.removalDistance=i.offsetWidth*(e.draggablePercent/100)):(a.start=t.clientY,a.removalDistance=i.offsetHeight*(80===e.draggablePercent?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(t){const{top:i,bottom:n,left:s,right:o}=r.current.getBoundingClientRect();"touchend"!==t.nativeEvent.type&&e.pauseOnHover&&t.clientX>=s&&t.clientX<=o&&t.clientY>=i&&t.clientY<=n?_():f()}};return l&&h&&(C.onMouseEnter=_,e.stacked||(C.onMouseLeave=f)),g&&(C.onClick=e=>{c&&c(e),a.canCloseOnClick&&d()}),{playToast:f,pauseToast:_,isRunning:t,preventExitTransition:s,toastRef:r,eventHandlers:C}}function y(e){let{delay:t,isRunning:i,closeToast:o,type:r="default",hide:l,className:h,style:d,controlledProgress:c,progress:u,rtl:g,isIn:p,theme:m}=e;const f=l||c&&0===u,_={...d,animationDuration:`${t}ms`,animationPlayState:i?"running":"paused"};c&&(_.transform=`scaleX(${u})`);const v=(0,s.A)("Toastify__progress-bar",c?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${m}`,`Toastify__progress-bar--${r}`,{"Toastify__progress-bar--rtl":g}),b=a(h)?h({rtl:g,type:r,defaultClassName:v}):(0,s.A)(v,h),C={[c&&u>=1?"onTransitionEnd":"onAnimationEnd"]:c&&u<1?null:()=>{p&&o()}};return n.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":f},n.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${m} Toastify__progress-bar--${r}`}),n.createElement("div",{role:"progressbar","aria-hidden":f?"true":"false","aria-label":"notification timer",className:b,style:_,...C}))}let S=1;const L=()=>""+S++;function k(e){return e&&(r(e.toastId)||o(e.toastId))?e.toastId:L()}function D(e,t){return v(e,t),t.toastId}function x(e,t){return{...t,type:t&&t.type||e,toastId:k(t)}}function N(e){return(t,i)=>D(t,x(e,i))}function E(e,t){return D(e,x("default",t))}E.loading=(e,t)=>D(e,x("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),E.promise=function(e,t,i){let n,{pending:s,error:o,success:l}=t;s&&(n=r(s)?E.loading(s,i):E.loading(s.render,{...i,...s}));const h={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},d=(e,t,s)=>{if(null==t)return void E.dismiss(n);const o={type:e,...h,...i,data:s},a=r(t)?{render:t}:t;return n?E.update(n,{...o,...a}):E(a.render,{...o,...a}),s},c=a(e)?e():e;return c.then((e=>d("success",l,e))).catch((e=>d("error",o,e))),c},E.success=N("success"),E.info=N("info"),E.error=N("error"),E.warning=N("warning"),E.warn=E.warning,E.dark=(e,t)=>D(e,x("default",{theme:"dark",...t})),E.dismiss=function(e){!function(e){var t;if(f()){if(null==e||r(t=e)||o(t))u.forEach((t=>{t.removeToast(e)}));else if(e&&("containerId"in e||"id"in e)){const t=u.get(e.containerId);t?t.removeToast(e.id):u.forEach((t=>{t.removeToast(e.id)}))}}else g=g.filter((t=>null!=e&&t.options.toastId!==e))}(e)},E.clearWaitingQueue=function(e){void 0===e&&(e={}),u.forEach((t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()}))},E.isActive=_,E.update=function(e,t){void 0===t&&(t={});const i=((e,t)=>{var i;let{containerId:n}=t;return null==(i=u.get(n||1))?void 0:i.toasts.get(e)})(e,t);if(i){const{props:n,content:s}=i,o={delay:100,...n,...t,toastId:t.toastId||e,updateId:L()};o.toastId!==e&&(o.staleId=e);const r=o.render||s;delete o.render,D(r,o)}},E.done=e=>{E.update(e,{progress:1})},E.onChange=function(e){return p.add(e),()=>{p.delete(e)}},E.play=e=>b(!0,e),E.pause=e=>b(!1,e);const I="undefined"!=typeof window?n.useLayoutEffect:n.useEffect,M=e=>{let{theme:t,type:i,isLoading:s,...o}=e;return n.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:"colored"===t?"currentColor":`var(--toastify-icon-color-${i})`,...o})},T={info:function(e){return n.createElement(M,{...e},n.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return n.createElement(M,{...e},n.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return n.createElement(M,{...e},n.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return n.createElement(M,{...e},n.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return n.createElement("div",{className:"Toastify__spinner"})}},R=e=>{const{isRunning:t,preventExitTransition:i,toastRef:o,eventHandlers:r,playToast:l}=w(e),{closeButton:h,children:d,autoClose:c,onClick:u,type:g,hideProgressBar:p,closeToast:m,transition:f,position:_,className:v,style:b,bodyClassName:C,bodyStyle:S,progressClassName:L,progressStyle:k,updateId:D,role:x,progress:N,rtl:E,toastId:I,deleteToast:M,isIn:R,isLoading:A,closeOnClick:O,theme:P}=e,F=(0,s.A)("Toastify__toast",`Toastify__toast-theme--${P}`,`Toastify__toast--${g}`,{"Toastify__toast--rtl":E},{"Toastify__toast--close-on-click":O}),B=a(v)?v({rtl:E,position:_,type:g,defaultClassName:F}):(0,s.A)(F,v),W=function(e){let{theme:t,type:i,isLoading:s,icon:o}=e,r=null;const l={theme:t,type:i};return!1===o||(a(o)?r=o({...l,isLoading:s}):(0,n.isValidElement)(o)?r=(0,n.cloneElement)(o,l):s?r=T.spinner():(e=>e in T)(i)&&(r=T[i](l))),r}(e),V=!!N||!c,H={closeToast:m,type:g,theme:P};let z=null;return!1===h||(z=a(h)?h(H):(0,n.isValidElement)(h)?(0,n.cloneElement)(h,H):function(e){let{closeToast:t,theme:i,ariaLabel:s="close"}=e;return n.createElement("button",{className:`Toastify__close-button Toastify__close-button--${i}`,type:"button",onClick:e=>{e.stopPropagation(),t(e)},"aria-label":s},n.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},n.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(H)),n.createElement(f,{isIn:R,done:M,position:_,preventExitTransition:i,nodeRef:o,playToast:l},n.createElement("div",{id:I,onClick:u,"data-in":R,className:B,...r,style:b,ref:o},n.createElement("div",{...R&&{role:x},className:a(C)?C({type:g}):(0,s.A)("Toastify__toast-body",C),style:S},null!=W&&n.createElement("div",{className:(0,s.A)("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!A})},W),n.createElement("div",null,d)),z,n.createElement(y,{...D&&!V?{key:`pb-${D}`}:{},rtl:E,theme:P,delay:c,isRunning:t,isIn:R,closeToast:m,hide:p,type:g,style:k,className:L,controlledProgress:V,progress:N||0})))},A=function(e,t){return void 0===t&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},O=d(A("bounce",!0)),P=(d(A("slide",!0)),d(A("zoom")),d(A("flip")),{position:"top-right",transition:O,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"});function F(e){let t={...P,...e};const i=e.stacked,[o,r]=(0,n.useState)(!0),h=(0,n.useRef)(null),{getToastToRender:d,isToastActive:c,count:u}=C(t),{className:g,style:p,rtl:m,containerId:f}=t;function _(e){const t=(0,s.A)("Toastify__toast-container",`Toastify__toast-container--${e}`,{"Toastify__toast-container--rtl":m});return a(g)?g({position:e,rtl:m,defaultClassName:t}):(0,s.A)(t,l(g))}function v(){i&&(r(!0),E.play())}return I((()=>{if(i){var e;const i=h.current.querySelectorAll('[data-in="true"]'),n=12,s=null==(e=t.position)?void 0:e.includes("top");let r=0,a=0;Array.from(i).reverse().forEach(((e,t)=>{const i=e;i.classList.add("Toastify__toast--stacked"),t>0&&(i.dataset.collapsed=`${o}`),i.dataset.pos||(i.dataset.pos=s?"top":"bot");const l=r*(o?.2:1)+(o?0:n*t);i.style.setProperty("--y",`${s?l:-1*l}px`),i.style.setProperty("--g",`${n}`),i.style.setProperty("--s",""+(1-(o?a:0))),r+=i.offsetHeight,a+=.025}))}}),[o,u,i]),n.createElement("div",{ref:h,className:"Toastify",id:f,onMouseEnter:()=>{i&&(r(!1),E.pause())},onMouseLeave:v},d(((e,t)=>{const s=t.length?{...p}:{...p,pointerEvents:"none"};return n.createElement("div",{className:_(e),style:s,key:`container-${e}`},t.map((e=>{let{content:t,props:s}=e;return n.createElement(R,{...s,stacked:i,collapseAll:v,isIn:c(s.toastId,s.containerId),style:s.style,key:`toast-${s.key}`},t)})))})))}}}]); \ No newline at end of file +/*! For license information please see 392.3c5c3de4.js.LICENSE.txt */ +"use strict";(self.webpackChunkgmail_processor_docs=self.webpackChunkgmail_processor_docs||[]).push([[392],{8478:(e,t,i)=>{i.r(t),i.d(t,{default:()=>o});i(6540);var n=i(2303),s=i(4848);function o(e){let{children:t,fallback:i}=e;return(0,n.A)()?(0,s.jsx)(s.Fragment,{children:t?.()}):i??null}},760:function(e,t,i){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return s.default.createElement(r.default,{fallback:s.default.createElement(l.LoadingLabel,null)},(()=>s.default.createElement(s.default.Fragment,null,s.default.createElement(a.default,{fallback:e=>s.default.createElement(h,{...e})},s.default.createElement(c,{...e})))))};const s=n(i(6540)),o=n(i(1569)),r=n(i(8478)),a=n(i(7489)),l=i(9659);function h(e){let{error:t,tryAgain:i}=e;return s.default.createElement("div",null,s.default.createElement("p",null,s.default.createElement(l.ErrorOccurredLabel,{error:t})),s.default.createElement("button",{onClick:i},"Try Again!"))}function d(e,t){let i=e;return"boolean"==typeof i||void 0===i.$id?`https://docusaurus.io/json-viewer/schema_${t}.json`:i.$id}function c(e){const{schema:t,diagnosticsOptions:i,...n}=e;return s.default.createElement(o.default,{height:"90vh",language:"json",editorWillMount:e=>{const n=(Array.isArray(t)?t:[t]).map(((e,i)=>({uri:d(t,i),fileMatch:["*"],schema:e})));e.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,schemas:n,...i})},...n})}},2113:()=>{},8047:(e,t,i)=>{i.r(t),i.d(t,{CancellationTokenSource:()=>ore,Emitter:()=>rre,KeyCode:()=>are,KeyMod:()=>lre,MarkerSeverity:()=>gre,MarkerTag:()=>pre,Position:()=>hre,Range:()=>dre,Selection:()=>cre,SelectionDirection:()=>ure,Token:()=>fre,Uri:()=>mre,default:()=>Ire,editor:()=>_re,languages:()=>vre});var n={};i.r(n),i.d(n,{CancellationTokenSource:()=>ore,Emitter:()=>rre,KeyCode:()=>are,KeyMod:()=>lre,MarkerSeverity:()=>gre,MarkerTag:()=>pre,Position:()=>hre,Range:()=>dre,Selection:()=>cre,SelectionDirection:()=>ure,Token:()=>fre,Uri:()=>mre,editor:()=>_re,languages:()=>vre});var s={};i.r(s),i.d(s,{CancellationTokenSource:()=>ore,Emitter:()=>rre,KeyCode:()=>are,KeyMod:()=>lre,MarkerSeverity:()=>gre,MarkerTag:()=>pre,Position:()=>hre,Range:()=>dre,Selection:()=>cre,SelectionDirection:()=>ure,Token:()=>fre,Uri:()=>mre,default:()=>Ire,editor:()=>_re,languages:()=>vre});const o=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout((()=>{if(e.stack){if(m.isErrorNoTelemetry(e))throw new m(e.message+"\n\n"+e.stack);throw new Error(e.message+"\n\n"+e.stack)}throw e}),0)}}emit(e){this.listeners.forEach((t=>{t(e)}))}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function r(e){d(e)||o.onUnexpectedError(e)}function a(e){d(e)||o.onUnexpectedExternalError(e)}function l(e){if(e instanceof Error){const{name:t,message:i}=e;return{$isError:!0,name:t,message:i,stack:e.stacktrace||e.stack,noTelemetry:m.isErrorNoTelemetry(e)}}return e}const h="Canceled";function d(e){return e instanceof c||e instanceof Error&&e.name===h&&e.message===h}class c extends Error{constructor(){super(h),this.name=this.message}}function u(e){return e?new Error(`Illegal argument: ${e}`):new Error("Illegal argument")}function g(e){return e?new Error(`Illegal state: ${e}`):new Error("Illegal state")}class p extends Error{constructor(e){super("NotSupported"),e&&(this.message=e)}}class m extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof m)return e;const t=new m;return t.message=e.message,t.stack=e.stack,t}static isErrorNoTelemetry(e){return"CodeExpectedError"===e.name}}class f extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,f.prototype)}}function _(e){const t=this;let i,n=!1;return function(){return n||(n=!0,i=e.apply(t,arguments)),i}}var v;!function(e){function t(e){return e&&"object"==typeof e&&"function"==typeof e[Symbol.iterator]}e.is=t;const i=Object.freeze([]);function*n(e){yield e}e.empty=function(){return i},e.single=n,e.wrap=function(e){return t(e)?e:n(e)},e.from=function(e){return e||i},e.reverse=function*(e){for(let t=e.length-1;t>=0;t--)yield e[t]},e.isEmpty=function(e){return!e||!0===e[Symbol.iterator]().next().done},e.first=function(e){return e[Symbol.iterator]().next().value},e.some=function(e,t){for(const i of e)if(t(i))return!0;return!1},e.find=function(e,t){for(const i of e)if(t(i))return i},e.filter=function*(e,t){for(const i of e)t(i)&&(yield i)},e.map=function*(e,t){let i=0;for(const n of e)yield t(n,i++)},e.concat=function*(...e){for(const t of e)for(const e of t)yield e},e.reduce=function(e,t,i){let n=i;for(const s of e)n=t(n,s);return n},e.slice=function*(e,t,i=e.length){for(t<0&&(t+=e.length),i<0?i+=e.length:i>e.length&&(i=e.length);ts}]}}(v||(v={}));let b=null;function C(e){return null==b||b.trackDisposable(e),e}function w(e){null==b||b.markAsDisposed(e)}function y(e,t){null==b||b.setParent(e,t)}function S(e){return null==b||b.markAsSingleton(e),e}function L(e){return"function"==typeof e.dispose&&0===e.dispose.length}function k(e){if(v.is(e)){const i=[];for(const n of e)if(n)try{n.dispose()}catch(t){i.push(t)}if(1===i.length)throw i[0];if(i.length>1)throw new AggregateError(i,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function D(...e){const t=x((()=>k(e)));return function(e,t){if(b)for(const i of e)b.setParent(i,t)}(e,t),t}function x(e){const t=C({dispose:_((()=>{w(t),e()}))});return t}class N{constructor(){this._toDispose=new Set,this._isDisposed=!1,C(this)}dispose(){this._isDisposed||(w(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(0!==this._toDispose.size)try{k(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return y(e,this),this._isDisposed?N.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),y(e,null))}}N.DISABLE_DISPOSED_WARNING=!1;class E{constructor(){this._store=new N,C(this),y(this._store,this)}dispose(){w(this),this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}}E.None=Object.freeze({dispose(){}});class I{constructor(){this._isDisposed=!1,C(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||(null===(t=this._value)||void 0===t||t.dispose(),e&&y(e,this),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,w(this),null===(e=this._value)||void 0===e||e.dispose(),this._value=void 0}}class M{constructor(e){this._disposable=e,this._counter=1}acquire(){return this._counter++,this}release(){return 0==--this._counter&&this._disposable.dispose(),this}}class T{constructor(e){this.object=e}dispose(){}}class R{constructor(){this._store=new Map,this._isDisposed=!1,C(this)}dispose(){w(this),this._isDisposed=!0,this.clearAndDisposeAll()}clearAndDisposeAll(){if(this._store.size)try{k(this._store.values())}finally{this._store.clear()}}get(e){return this._store.get(e)}set(e,t,i=!1){var n;this._isDisposed&&console.warn(new Error("Trying to add a disposable to a DisposableMap that has already been disposed of. The added object will be leaked!").stack),i||null===(n=this._store.get(e))||void 0===n||n.dispose(),this._store.set(e,t)}deleteAndDispose(e){var t;null===(t=this._store.get(e))||void 0===t||t.dispose(),this._store.delete(e)}[Symbol.iterator](){return this._store[Symbol.iterator]()}}class A{constructor(e){this.element=e,this.next=A.Undefined,this.prev=A.Undefined}}A.Undefined=new A(void 0);class O{constructor(){this._first=A.Undefined,this._last=A.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===A.Undefined}clear(){let e=this._first;for(;e!==A.Undefined;){const t=e.next;e.prev=A.Undefined,e.next=A.Undefined,e=t}this._first=A.Undefined,this._last=A.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){const i=new A(e);if(this._first===A.Undefined)this._first=i,this._last=i;else if(t){const e=this._last;this._last=i,i.prev=e,e.next=i}else{const e=this._first;this._first=i,i.next=e,e.prev=i}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(i))}}shift(){if(this._first!==A.Undefined){const e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==A.Undefined){const e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==A.Undefined&&e.next!==A.Undefined){const t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===A.Undefined&&e.next===A.Undefined?(this._first=A.Undefined,this._last=A.Undefined):e.next===A.Undefined?(this._last=this._last.prev,this._last.next=A.Undefined):e.prev===A.Undefined&&(this._first=this._first.next,this._first.prev=A.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==A.Undefined;)yield e.element,e=e.next}}const P=globalThis.performance&&"function"==typeof globalThis.performance.now;class F{static create(e){return new F(e)}constructor(e){this._now=P&&!1===e?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}elapsed(){return-1!==this._stopTime?this._stopTime-this._startTime:this._now()-this._startTime}}var B;!function(e){function t(e){false}function i(e){return(t,i=null,n)=>{let s,o=!1;return s=e((e=>{if(!o)return s?s.dispose():o=!0,t.call(i,e)}),null,n),o&&s.dispose(),s}}function n(e,t,i){return o(((i,n=null,s)=>e((e=>i.call(n,t(e))),null,s)),i)}function s(e,t,i){return o(((i,n=null,s)=>e((e=>t(e)&&i.call(n,e)),null,s)),i)}function o(e,i){let n;const s={onWillAddFirstListener(){n=e(o.fire,o)},onDidRemoveLastListener(){null==n||n.dispose()}};i||t();const o=new U(s);return null==i||i.add(o),o.event}function r(e,i,n=100,s=!1,o=!1,r,a){let l,h,d,c,u=0;const g={leakWarningThreshold:r,onWillAddFirstListener(){l=e((e=>{u++,h=i(h,e),s&&!d&&(p.fire(h),h=void 0),c=()=>{const e=h;h=void 0,d=void 0,(!s||u>1)&&p.fire(e),u=0},"number"==typeof n?(clearTimeout(d),d=setTimeout(c,n)):void 0===d&&(d=0,queueMicrotask(c))}))},onWillRemoveListener(){o&&u>0&&(null==c||c())},onDidRemoveLastListener(){c=void 0,l.dispose()}};a||t();const p=new U(g);return null==a||a.add(p),p.event}e.None=()=>E.None,e.defer=function(e,t){return r(e,(()=>{}),0,void 0,!0,void 0,t)},e.once=i,e.map=n,e.forEach=function(e,t,i){return o(((i,n=null,s)=>e((e=>{t(e),i.call(n,e)}),null,s)),i)},e.filter=s,e.signal=function(e){return e},e.any=function(...e){return(t,i=null,n)=>function(e,t){t instanceof Array?t.push(e):t&&t.add(e);return e}(D(...e.map((e=>e((e=>t.call(i,e)))))),n)},e.reduce=function(e,t,i,s){let o=i;return n(e,(e=>(o=t(o,e),o)),s)},e.debounce=r,e.accumulate=function(t,i=0,n){return e.debounce(t,((e,t)=>e?(e.push(t),e):[t]),i,void 0,!0,void 0,n)},e.latch=function(e,t=(e,t)=>e===t,i){let n,o=!0;return s(e,(e=>{const i=o||!t(e,n);return o=!1,n=e,i}),i)},e.split=function(t,i,n){return[e.filter(t,i,n),e.filter(t,(e=>!i(e)),n)]},e.buffer=function(e,t=!1,i=[],n){let s=i.slice(),o=e((e=>{s?s.push(e):a.fire(e)}));n&&n.add(o);const r=()=>{null==s||s.forEach((e=>a.fire(e))),s=null},a=new U({onWillAddFirstListener(){o||(o=e((e=>a.fire(e))),n&&n.add(o))},onDidAddFirstListener(){s&&(t?setTimeout(r):r())},onDidRemoveLastListener(){o&&o.dispose(),o=null}});return n&&n.add(a),a.event},e.chain=function(e,t){return(i,n,s)=>{const o=t(new l);return e((function(e){const t=o.evaluate(e);t!==a&&i.call(n,t)}),void 0,s)}};const a=Symbol("HaltChainable");class l{constructor(){this.steps=[]}map(e){return this.steps.push(e),this}forEach(e){return this.steps.push((t=>(e(t),t))),this}filter(e){return this.steps.push((t=>e(t)?t:a)),this}reduce(e,t){let i=t;return this.steps.push((t=>(i=e(i,t),i))),this}latch(e=(e,t)=>e===t){let t,i=!0;return this.steps.push((n=>{const s=i||!e(n,t);return i=!1,t=n,s?n:a})),this}evaluate(e){for(const t of this.steps)if((e=t(e))===a)break;return e}}e.fromNodeEventEmitter=function(e,t,i=e=>e){const n=(...e)=>s.fire(i(...e)),s=new U({onWillAddFirstListener:()=>e.on(t,n),onDidRemoveLastListener:()=>e.removeListener(t,n)});return s.event},e.fromDOMEventEmitter=function(e,t,i=e=>e){const n=(...e)=>s.fire(i(...e)),s=new U({onWillAddFirstListener:()=>e.addEventListener(t,n),onDidRemoveLastListener:()=>e.removeEventListener(t,n)});return s.event},e.toPromise=function(e){return new Promise((t=>i(e)(t)))},e.fromPromise=function(e){const t=new U;return e.then((e=>{t.fire(e)}),(()=>{t.fire(void 0)})).finally((()=>{t.dispose()})),t.event},e.runAndSubscribe=function(e,t){return t(void 0),e((e=>t(e)))},e.runAndSubscribeWithStore=function(e,t){let i=null;function n(e){null==i||i.dispose(),i=new N,t(e,i)}n(void 0);const s=e((e=>n(e)));return x((()=>{s.dispose(),null==i||i.dispose()}))};class h{constructor(e,i){this._observable=e,this._counter=0,this._hasChanged=!1;const n={onWillAddFirstListener:()=>{e.addObserver(this)},onDidRemoveLastListener:()=>{e.removeObserver(this)}};i||t(),this.emitter=new U(n),i&&i.add(this.emitter)}beginUpdate(e){this._counter++}handlePossibleChange(e){}handleChange(e,t){this._hasChanged=!0}endUpdate(e){this._counter--,0===this._counter&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}e.fromObservable=function(e,t){return new h(e,t).emitter.event},e.fromObservableLight=function(e){return t=>{let i=0,n=!1;const s={beginUpdate(){i++},endUpdate(){i--,0===i&&(e.reportChanges(),n&&(n=!1,t()))},handlePossibleChange(){},handleChange(){n=!0}};return e.addObserver(s),e.reportChanges(),{dispose(){e.removeObserver(s)}}}}}(B||(B={}));class W{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${W._idPool++}`,W.all.add(this)}start(e){this._stopWatch=new F,this.listenerCount=e}stop(){if(this._stopWatch){const e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}}W.all=new Set,W._idPool=0;class V{constructor(e,t=Math.random().toString(18).slice(2,5)){this.threshold=e,this.name=t,this._warnCountdown=0}dispose(){var e;null===(e=this._stacks)||void 0===e||e.clear()}check(e,t){const i=this.threshold;if(i<=0||t{const t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}}class H{static create(){var e;return new H(null!==(e=(new Error).stack)&&void 0!==e?e:"")}constructor(e){this.value=e}print(){console.warn(this.value.split("\n").slice(2).join("\n"))}}class z{constructor(e){this.value=e}}class U{constructor(e){var t,i,n,s,o;this._size=0,this._options=e,this._leakageMon=(null===(t=this._options)||void 0===t?void 0:t.leakWarningThreshold)?new V(null!==(n=null===(i=this._options)||void 0===i?void 0:i.leakWarningThreshold)&&void 0!==n?n:-1):void 0,this._perfMon=(null===(s=this._options)||void 0===s?void 0:s._profName)?new W(this._options._profName):void 0,this._deliveryQueue=null===(o=this._options)||void 0===o?void 0:o.deliveryQueue}dispose(){var e,t,i,n;this._disposed||(this._disposed=!0,(null===(e=this._deliveryQueue)||void 0===e?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),null===(i=null===(t=this._options)||void 0===t?void 0:t.onDidRemoveLastListener)||void 0===i||i.call(t),null===(n=this._leakageMon)||void 0===n||n.dispose())}get event(){var e;return null!==(e=this._event)&&void 0!==e||(this._event=(e,t,i)=>{var n,s,o,r,a;if(this._leakageMon&&this._size>3*this._leakageMon.threshold)return console.warn(`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far`),E.None;if(this._disposed)return E.None;t&&(e=e.bind(t));const l=new z(e);let h;this._leakageMon&&this._size>=Math.ceil(.2*this._leakageMon.threshold)&&(l.stack=H.create(),h=this._leakageMon.check(l.stack,this._size+1)),this._listeners?this._listeners instanceof z?(null!==(a=this._deliveryQueue)&&void 0!==a||(this._deliveryQueue=new K),this._listeners=[this._listeners,l]):this._listeners.push(l):(null===(s=null===(n=this._options)||void 0===n?void 0:n.onWillAddFirstListener)||void 0===s||s.call(n,this),this._listeners=l,null===(r=null===(o=this._options)||void 0===o?void 0:o.onDidAddFirstListener)||void 0===r||r.call(o,this)),this._size++;const d=x((()=>{null==h||h(),this._removeListener(l)}));return i instanceof N?i.add(d):Array.isArray(i)&&i.push(d),d}),this._event}_removeListener(e){var t,i,n,s;if(null===(i=null===(t=this._options)||void 0===t?void 0:t.onWillRemoveListener)||void 0===i||i.call(t,this),!this._listeners)return;if(1===this._size)return this._listeners=void 0,null===(s=null===(n=this._options)||void 0===n?void 0:n.onDidRemoveLastListener)||void 0===s||s.call(n,this),void(this._size=0);const o=this._listeners,r=o.indexOf(e);if(-1===r)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,o[r]=void 0;const a=this._deliveryQueue.current===this;if(2*this._size<=o.length){let e=0;for(let t=0;t0}}class K{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}}class j extends U{constructor(e){super(e),this._isPaused=0,this._eventQueue=new O,this._mergeFn=null==e?void 0:e.merge}pause(){this._isPaused++}resume(){if(0!==this._isPaused&&0==--this._isPaused)if(this._mergeFn){if(this._eventQueue.size>0){const e=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(e))}}else for(;!this._isPaused&&0!==this._eventQueue.size;)super.fire(this._eventQueue.shift())}fire(e){this._size&&(0!==this._isPaused?this._eventQueue.push(e):super.fire(e))}}class q extends j{constructor(e){var t;super(e),this._delay=null!==(t=e.delay)&&void 0!==t?t:100}fire(e){this._handle||(this.pause(),this._handle=setTimeout((()=>{this._handle=void 0,this.resume()}),this._delay)),super.fire(e)}}class $ extends U{constructor(e){super(e),this._queuedEvents=[],this._mergeFn=null==e?void 0:e.merge}fire(e){this.hasListeners()&&(this._queuedEvents.push(e),1===this._queuedEvents.length&&queueMicrotask((()=>{this._mergeFn?super.fire(this._mergeFn(this._queuedEvents)):this._queuedEvents.forEach((e=>super.fire(e))),this._queuedEvents=[]})))}}class G{constructor(){this.hasListeners=!1,this.events=[],this.emitter=new U({onWillAddFirstListener:()=>this.onFirstListenerAdd(),onDidRemoveLastListener:()=>this.onLastListenerRemove()})}get event(){return this.emitter.event}add(e){const t={event:e,listener:null};this.events.push(t),this.hasListeners&&this.hook(t);return x(_((()=>{this.hasListeners&&this.unhook(t);const e=this.events.indexOf(t);this.events.splice(e,1)})))}onFirstListenerAdd(){this.hasListeners=!0,this.events.forEach((e=>this.hook(e)))}onLastListenerRemove(){this.hasListeners=!1,this.events.forEach((e=>this.unhook(e)))}hook(e){e.listener=e.event((e=>this.emitter.fire(e)))}unhook(e){e.listener&&e.listener.dispose(),e.listener=null}dispose(){this.emitter.dispose()}}class Z{constructor(){this.buffers=[]}wrapEvent(e){return(t,i,n)=>e((e=>{const n=this.buffers[this.buffers.length-1];n?n.push((()=>t.call(i,e))):t.call(i,e)}),void 0,n)}bufferEvents(e){const t=[];this.buffers.push(t);const i=e();return this.buffers.pop(),t.forEach((e=>e())),i}}class Y{constructor(){this.listening=!1,this.inputEvent=B.None,this.inputEventListener=E.None,this.emitter=new U({onDidAddFirstListener:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onDidRemoveLastListener:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(e){this.inputEvent=e,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=e(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}class X{constructor(){this._zoomFactor=1}getZoomFactor(){return this._zoomFactor}}X.INSTANCE=new X;class Q extends E{constructor(){super(),this._onDidChange=this._register(new U),this.onDidChange=this._onDidChange.event,this._listener=()=>this._handleChange(!0),this._mediaQueryList=null,this._handleChange(!1)}_handleChange(e){var t;null===(t=this._mediaQueryList)||void 0===t||t.removeEventListener("change",this._listener),this._mediaQueryList=window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`),this._mediaQueryList.addEventListener("change",this._listener),e&&this._onDidChange.fire()}}class J extends E{get value(){return this._value}constructor(){super(),this._onDidChange=this._register(new U),this.onDidChange=this._onDidChange.event,this._value=this._getPixelRatio();const e=this._register(new Q);this._register(e.onDidChange((()=>{this._value=this._getPixelRatio(),this._onDidChange.fire(this._value)})))}_getPixelRatio(){const e=document.createElement("canvas").getContext("2d");return(window.devicePixelRatio||1)/(e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1)}}function ee(e,t){"string"==typeof e&&(e=window.matchMedia(e)),e.addEventListener("change",t)}const te=new class{constructor(){this._pixelRatioMonitor=null}_getOrCreatePixelRatioMonitor(){return this._pixelRatioMonitor||(this._pixelRatioMonitor=S(new J)),this._pixelRatioMonitor}get value(){return this._getOrCreatePixelRatioMonitor().value}get onDidChange(){return this._getOrCreatePixelRatioMonitor().onDidChange}};const ie=navigator.userAgent,ne=ie.indexOf("Firefox")>=0,se=ie.indexOf("AppleWebKit")>=0,oe=ie.indexOf("Chrome")>=0,re=!oe&&ie.indexOf("Safari")>=0,ae=!oe&&!re&&se,le=(ie.indexOf("Electron/"),ie.indexOf("Android")>=0);let he=!1;if(window.matchMedia){const e=window.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=window.matchMedia("(display-mode: fullscreen)");he=e.matches,ee(e,(({matches:e})=>{he&&t.matches||(he=e)}))}let de="undefined"!=typeof document&&document.location&&document.location.hash.indexOf("pseudo=true")>=0;function ce(e,t){let i;return i=0===t.length?e:e.replace(/\{(\d+)\}/g,((e,i)=>{const n=i[0],s=t[n];let o=e;return"string"==typeof s?o=s:"number"!=typeof s&&"boolean"!=typeof s&&null!=s||(o=String(s)),o})),de&&(i="\uff3b"+i.replace(/[aouei]/g,"$&$&")+"\uff3d"),i}function ue(e,t,...i){return ce(t,i)}var ge;const pe="en";let me,fe,_e=!1,ve=!1,be=!1,Ce=!1,we=!1,ye=!1,Se=!1,Le=!1,ke=!1,De=!1,xe=pe,Ne=null,Ee=null;const Ie="object"==typeof self?self:"object"==typeof i.g?i.g:{};let Me;void 0!==Ie.vscode&&void 0!==Ie.vscode.process?Me=Ie.vscode.process:"undefined"!=typeof process&&(Me=process);const Te="string"==typeof(null===(ge=null==Me?void 0:Me.versions)||void 0===ge?void 0:ge.electron),Re=Te&&"renderer"===(null==Me?void 0:Me.type);if("object"!=typeof navigator||Re)if("object"==typeof Me){_e="win32"===Me.platform,ve="darwin"===Me.platform,be="linux"===Me.platform,Ce=be&&!!Me.env.SNAP&&!!Me.env.SNAP_REVISION,Se=Te,ke=!!Me.env.CI||!!Me.env.BUILD_ARTIFACTSTAGINGDIRECTORY,me=pe,xe=pe;const e=Me.env.VSCODE_NLS_CONFIG;if(e)try{const t=JSON.parse(e),i=t.availableLanguages["*"];me=t.locale,Ne=t.osLocale,xe=i||pe,Ee=t._translationsConfigFile}catch(Mre){}we=!0}else console.error("Unable to resolve platform.");else{fe=navigator.userAgent,_e=fe.indexOf("Windows")>=0,ve=fe.indexOf("Macintosh")>=0,Le=(fe.indexOf("Macintosh")>=0||fe.indexOf("iPad")>=0||fe.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,be=fe.indexOf("Linux")>=0,De=(null==fe?void 0:fe.indexOf("Mobi"))>=0,ye=!0;me=void ue(0,"_")||pe,xe=me,Ne=navigator.language}let Ae=0;ve?Ae=1:_e?Ae=3:be&&(Ae=2);const Oe=_e,Pe=ve,Fe=be,Be=we,We=ye,Ve=ye&&"function"==typeof Ie.importScripts,He=Le,ze=De,Ue=fe,Ke=xe,je="function"==typeof Ie.postMessage&&!Ie.importScripts,qe=(()=>{if(je){const e=[];Ie.addEventListener("message",(t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let i=0,n=e.length;i{const n=++t;e.push({id:n,callback:i}),Ie.postMessage({vscodeScheduleAsyncWork:n},"*")}}return e=>setTimeout(e)})(),$e=ve||Le?2:_e?1:3;let Ge=!0,Ze=!1;function Ye(){if(!Ze){Ze=!0;const e=new Uint8Array(2);e[0]=1,e[1]=2;const t=new Uint16Array(e.buffer);Ge=513===t[0]}return Ge}const Xe=!!(Ue&&Ue.indexOf("Chrome")>=0),Qe=!!(Ue&&Ue.indexOf("Firefox")>=0),Je=!!(!Xe&&Ue&&Ue.indexOf("Safari")>=0),et=!!(Ue&&Ue.indexOf("Edg/")>=0),tt=(Ue&&Ue.indexOf("Android"),Be||document.queryCommandSupported&&document.queryCommandSupported("copy")||navigator&&navigator.clipboard&&navigator.clipboard.writeText,Be||navigator&&navigator.clipboard&&navigator.clipboard.readText,Be||he||navigator.keyboard,"ontouchstart"in window||navigator.maxTouchPoints,window.PointerEvent&&("ontouchstart"in window||window.navigator.maxTouchPoints>0||navigator.maxTouchPoints>0));class it{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()]||0}}const nt=new it,st=new it,ot=new it,rt=new Array(230),at={},lt=[],ht=Object.create(null),dt=Object.create(null),ct=[],ut=[];for(let Tre=0;Tre<=193;Tre++)ct[Tre]=-1;for(let Tre=0;Tre<=132;Tre++)ut[Tre]=-1;var gt;function pt(e,t){return(e|(65535&t)<<16>>>0)>>>0}function mt(e,t){if("number"==typeof e){if(0===e)return null;const i=(65535&e)>>>0,n=(4294901760&e)>>>16;return new vt(0!==n?[ft(i,t),ft(n,t)]:[ft(i,t)])}{const i=[];for(let n=0;n=98&&e<=113)return null;switch(e){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return nt.keyCodeToStr(e)}}(gt||(gt={}));class _t{constructor(e,t,i,n,s){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyCode=s}equals(e){return e instanceof _t&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}isModifierKey(){return 0===this.keyCode||5===this.keyCode||57===this.keyCode||6===this.keyCode||4===this.keyCode}isDuplicateModifierCase(){return this.ctrlKey&&5===this.keyCode||this.shiftKey&&4===this.keyCode||this.altKey&&6===this.keyCode||this.metaKey&&57===this.keyCode}}class vt{constructor(e){if(0===e.length)throw u("chords");this.chords=e}}class bt{constructor(e,t,i,n,s,o){this.ctrlKey=e,this.shiftKey=t,this.altKey=i,this.metaKey=n,this.keyLabel=s,this.keyAriaLabel=o}}class Ct{}const wt=Pe?256:2048,yt=Pe?2048:256;class St{constructor(e){this._standardKeyboardEventBrand=!0;const t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState("AltGraph"),this.keyCode=function(e){if(e.charCode){const t=String.fromCharCode(e.charCode).toUpperCase();return gt.fromString(t)}const t=e.keyCode;if(3===t)return 7;if(ne)switch(t){case 59:return 85;case 60:if(Fe)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Pe)return 57}else if(se){if(Pe&&93===t)return 57;if(!Pe&&92===t)return 57}return rt[t]||0}(t),this.code=t.code,this.ctrlKey=this.ctrlKey||5===this.keyCode,this.altKey=this.altKey||6===this.keyCode,this.shiftKey=this.shiftKey||4===this.keyCode,this.metaKey=this.metaKey||57===this.keyCode,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=wt),this.altKey&&(t|=512),this.shiftKey&&(t|=1024),this.metaKey&&(t|=yt),t|=e,t}_computeKeyCodeChord(){let e=0;return 5!==this.keyCode&&4!==this.keyCode&&6!==this.keyCode&&57!==this.keyCode&&(e=this.keyCode),new _t(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}}let Lt=!1,kt=null;function Dt(e){if(!e.parent||e.parent===e)return null;try{const t=e.location,i=e.parent.location;if("null"!==t.origin&&"null"!==i.origin&&t.origin!==i.origin)return Lt=!0,null}catch(Mre){return Lt=!0,null}return e.parent}class xt{static getSameOriginWindowChain(){if(!kt){kt=[];let e,t=window;do{e=Dt(t),e?kt.push({window:t,iframeElement:t.frameElement||null}):kt.push({window:t,iframeElement:null}),t=e}while(t)}return kt.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let i=0,n=0;const s=this.getSameOriginWindowChain();for(const o of s){if(i+=o.window.scrollY,n+=o.window.scrollX,o.window===t)break;if(!o.iframeElement)break;const e=o.iframeElement.getBoundingClientRect();i+=e.top,n+=e.left}return{top:i,left:n}}}class Nt{constructor(e){this.timestamp=Date.now(),this.browserEvent=e,this.leftButton=0===e.button,this.middleButton=1===e.button,this.rightButton=2===e.button,this.buttons=e.buttons,this.target=e.target,this.detail=e.detail||1,"dblclick"===e.type&&(this.detail=2),this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,"number"==typeof e.pageX?(this.posx=e.pageX,this.posy=e.pageY):(this.posx=e.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=e.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);const t=xt.getPositionOfChildWindowRelativeToAncestorWindow(window,e.view);this.posx-=t.left,this.posy-=t.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}}class Et{constructor(e,t=0,i=0){if(this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=i,this.deltaX=t,e){const t=e,i=e;if(void 0!==t.wheelDeltaY)this.deltaY=t.wheelDeltaY/120;else if(void 0!==i.VERTICAL_AXIS&&i.axis===i.VERTICAL_AXIS)this.deltaY=-i.detail/3;else if("wheel"===e.type){const t=e;t.deltaMode===t.DOM_DELTA_LINE?this.deltaY=ne&&!Pe?-e.deltaY/3:-e.deltaY:this.deltaY=-e.deltaY/40}if(void 0!==t.wheelDeltaX)this.deltaX=re&&Oe?-t.wheelDeltaX/120:t.wheelDeltaX/120;else if(void 0!==i.HORIZONTAL_AXIS&&i.axis===i.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if("wheel"===e.type){const t=e;t.deltaMode===t.DOM_DELTA_LINE?this.deltaX=ne&&!Pe?-e.deltaX/3:-e.deltaX:this.deltaX=-e.deltaX/40}0===this.deltaY&&0===this.deltaX&&e.wheelDelta&&(this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;null===(e=this.browserEvent)||void 0===e||e.preventDefault()}stopPropagation(){var e;null===(e=this.browserEvent)||void 0===e||e.stopPropagation()}}const{entries:It,setPrototypeOf:Mt,isFrozen:Tt,getPrototypeOf:Rt,getOwnPropertyDescriptor:At}=Object;let{freeze:Ot,seal:Pt,create:Ft}=Object,{apply:Bt,construct:Wt}="undefined"!=typeof Reflect&&Reflect;Bt||(Bt=function(e,t,i){return e.apply(t,i)}),Ot||(Ot=function(e){return e}),Pt||(Pt=function(e){return e}),Wt||(Wt=function(e,t){return new e(...t)});const Vt=Qt(Array.prototype.forEach),Ht=Qt(Array.prototype.pop),zt=Qt(Array.prototype.push),Ut=Qt(String.prototype.toLowerCase),Kt=Qt(String.prototype.toString),jt=Qt(String.prototype.match),qt=Qt(String.prototype.replace),$t=Qt(String.prototype.indexOf),Gt=Qt(String.prototype.trim),Zt=Qt(RegExp.prototype.test),Yt=(Xt=TypeError,function(){for(var e=arguments.length,t=new Array(e),i=0;i1?i-1:0),s=1;s/gm),mi=Pt(/\${[\w\W]*}/gm),fi=Pt(/^data-[\-\w.\u00B7-\uFFFF]/),_i=Pt(/^aria-[\-\w]+$/),vi=Pt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),bi=Pt(/^(?:\w+script|data):/i),Ci=Pt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),wi=Pt(/^html$/i);var yi=Object.freeze({__proto__:null,MUSTACHE_EXPR:gi,ERB_EXPR:pi,TMPLIT_EXPR:mi,DATA_ATTR:fi,ARIA_ATTR:_i,IS_ALLOWED_URI:vi,IS_SCRIPT_OR_DATA:bi,ATTR_WHITESPACE:Ci,DOCTYPE_NAME:wi});const Si=()=>"undefined"==typeof window?null:window;var Li=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Si();const i=t=>e(t);if(i.version="3.0.5",i.removed=[],!t||!t.document||9!==t.document.nodeType)return i.isSupported=!1,i;const n=t.document,s=n.currentScript;let{document:o}=t;const{DocumentFragment:r,HTMLTemplateElement:a,Node:l,Element:h,NodeFilter:d,NamedNodeMap:c=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:u,DOMParser:g,trustedTypes:p}=t,m=h.prototype,f=ti(m,"cloneNode"),_=ti(m,"nextSibling"),v=ti(m,"childNodes"),b=ti(m,"parentNode");if("function"==typeof a){const e=o.createElement("template");e.content&&e.content.ownerDocument&&(o=e.content.ownerDocument)}let C,w="";const{implementation:y,createNodeIterator:S,createDocumentFragment:L,getElementsByTagName:k}=o,{importNode:D}=n;let x={};i.isSupported="function"==typeof It&&"function"==typeof b&&y&&void 0!==y.createHTMLDocument;const{MUSTACHE_EXPR:N,ERB_EXPR:E,TMPLIT_EXPR:I,DATA_ATTR:M,ARIA_ATTR:T,IS_SCRIPT_OR_DATA:R,ATTR_WHITESPACE:A}=yi;let{IS_ALLOWED_URI:O}=yi,P=null;const F=Jt({},[...ii,...ni,...si,...ri,...li]);let B=null;const W=Jt({},[...hi,...di,...ci,...ui]);let V=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}})),H=null,z=null,U=!0,K=!0,j=!1,q=!0,$=!1,G=!1,Z=!1,Y=!1,X=!1,Q=!1,J=!1,ee=!0,te=!1,ie=!0,ne=!1,se={},oe=null;const re=Jt({},["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 ae=null;const le=Jt({},["audio","video","img","source","image","track"]);let he=null;const de=Jt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ce="http://www.w3.org/1998/Math/MathML",ue="http://www.w3.org/2000/svg",ge="http://www.w3.org/1999/xhtml";let pe=ge,me=!1,fe=null;const _e=Jt({},[ce,ue,ge],Kt);let ve;const be=["application/xhtml+xml","text/html"];let Ce,we=null;const ye=o.createElement("form"),Se=function(e){return e instanceof RegExp||e instanceof Function},Le=function(e){if(!we||we!==e){if(e&&"object"==typeof e||(e={}),e=ei(e),ve=ve=-1===be.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ce="application/xhtml+xml"===ve?Kt:Ut,P="ALLOWED_TAGS"in e?Jt({},e.ALLOWED_TAGS,Ce):F,B="ALLOWED_ATTR"in e?Jt({},e.ALLOWED_ATTR,Ce):W,fe="ALLOWED_NAMESPACES"in e?Jt({},e.ALLOWED_NAMESPACES,Kt):_e,he="ADD_URI_SAFE_ATTR"in e?Jt(ei(de),e.ADD_URI_SAFE_ATTR,Ce):de,ae="ADD_DATA_URI_TAGS"in e?Jt(ei(le),e.ADD_DATA_URI_TAGS,Ce):le,oe="FORBID_CONTENTS"in e?Jt({},e.FORBID_CONTENTS,Ce):re,H="FORBID_TAGS"in e?Jt({},e.FORBID_TAGS,Ce):{},z="FORBID_ATTR"in e?Jt({},e.FORBID_ATTR,Ce):{},se="USE_PROFILES"in e&&e.USE_PROFILES,U=!1!==e.ALLOW_ARIA_ATTR,K=!1!==e.ALLOW_DATA_ATTR,j=e.ALLOW_UNKNOWN_PROTOCOLS||!1,q=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,$=e.SAFE_FOR_TEMPLATES||!1,G=e.WHOLE_DOCUMENT||!1,X=e.RETURN_DOM||!1,Q=e.RETURN_DOM_FRAGMENT||!1,J=e.RETURN_TRUSTED_TYPE||!1,Y=e.FORCE_BODY||!1,ee=!1!==e.SANITIZE_DOM,te=e.SANITIZE_NAMED_PROPS||!1,ie=!1!==e.KEEP_CONTENT,ne=e.IN_PLACE||!1,O=e.ALLOWED_URI_REGEXP||vi,pe=e.NAMESPACE||ge,V=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Se(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(V.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Se(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(V.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(V.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),$&&(K=!1),Q&&(X=!0),se&&(P=Jt({},[...li]),B=[],!0===se.html&&(Jt(P,ii),Jt(B,hi)),!0===se.svg&&(Jt(P,ni),Jt(B,di),Jt(B,ui)),!0===se.svgFilters&&(Jt(P,si),Jt(B,di),Jt(B,ui)),!0===se.mathMl&&(Jt(P,ri),Jt(B,ci),Jt(B,ui))),e.ADD_TAGS&&(P===F&&(P=ei(P)),Jt(P,e.ADD_TAGS,Ce)),e.ADD_ATTR&&(B===W&&(B=ei(B)),Jt(B,e.ADD_ATTR,Ce)),e.ADD_URI_SAFE_ATTR&&Jt(he,e.ADD_URI_SAFE_ATTR,Ce),e.FORBID_CONTENTS&&(oe===re&&(oe=ei(oe)),Jt(oe,e.FORBID_CONTENTS,Ce)),ie&&(P["#text"]=!0),G&&Jt(P,["html","head","body"]),P.table&&(Jt(P,["tbody"]),delete H.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw Yt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw Yt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');C=e.TRUSTED_TYPES_POLICY,w=C.createHTML("")}else void 0===C&&(C=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let i=null;const n="data-tt-policy-suffix";t&&t.hasAttribute(n)&&(i=t.getAttribute(n));const s="dompurify"+(i?"#"+i:"");try{return e.createPolicy(s,{createHTML:e=>e,createScriptURL:e=>e})}catch(o){return console.warn("TrustedTypes policy "+s+" could not be created."),null}}(p,s)),null!==C&&"string"==typeof w&&(w=C.createHTML(""));Ot&&Ot(e),we=e}},ke=Jt({},["mi","mo","mn","ms","mtext"]),De=Jt({},["foreignobject","desc","title","annotation-xml"]),xe=Jt({},["title","style","font","a","script"]),Ne=Jt({},ni);Jt(Ne,si),Jt(Ne,oi);const Ee=Jt({},ri);Jt(Ee,ai);const Ie=function(e){zt(i.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},Me=function(e,t){try{zt(i.removed,{attribute:t.getAttributeNode(e),from:t})}catch(n){zt(i.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!B[e])if(X||Q)try{Ie(t)}catch(n){}else try{t.setAttribute(e,"")}catch(n){}},Te=function(e){let t,i;if(Y)e=""+e;else{const t=jt(e,/^[\r\n\t ]+/);i=t&&t[0]}"application/xhtml+xml"===ve&&pe===ge&&(e=''+e+"");const n=C?C.createHTML(e):e;if(pe===ge)try{t=(new g).parseFromString(n,ve)}catch(r){}if(!t||!t.documentElement){t=y.createDocument(pe,"template",null);try{t.documentElement.innerHTML=me?w:n}catch(r){}}const s=t.body||t.documentElement;return e&&i&&s.insertBefore(o.createTextNode(i),s.childNodes[0]||null),pe===ge?k.call(t,G?"html":"body")[0]:G?t.documentElement:s},Re=function(e){return S.call(e.ownerDocument||e,e,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT,null,!1)},Ae=function(e){return"object"==typeof l?e instanceof l:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Oe=function(e,t,n){x[e]&&Vt(x[e],(e=>{e.call(i,t,n,we)}))},Pe=function(e){let t;if(Oe("beforeSanitizeElements",e,null),(n=e)instanceof u&&("string"!=typeof n.nodeName||"string"!=typeof n.textContent||"function"!=typeof n.removeChild||!(n.attributes instanceof c)||"function"!=typeof n.removeAttribute||"function"!=typeof n.setAttribute||"string"!=typeof n.namespaceURI||"function"!=typeof n.insertBefore||"function"!=typeof n.hasChildNodes))return Ie(e),!0;var n;const s=Ce(e.nodeName);if(Oe("uponSanitizeElement",e,{tagName:s,allowedTags:P}),e.hasChildNodes()&&!Ae(e.firstElementChild)&&(!Ae(e.content)||!Ae(e.content.firstElementChild))&&Zt(/<[/\w]/g,e.innerHTML)&&Zt(/<[/\w]/g,e.textContent))return Ie(e),!0;if(!P[s]||H[s]){if(!H[s]&&Be(s)){if(V.tagNameCheck instanceof RegExp&&Zt(V.tagNameCheck,s))return!1;if(V.tagNameCheck instanceof Function&&V.tagNameCheck(s))return!1}if(ie&&!oe[s]){const t=b(e)||e.parentNode,i=v(e)||e.childNodes;if(i&&t){for(let n=i.length-1;n>=0;--n)t.insertBefore(f(i[n],!0),_(e))}}return Ie(e),!0}return e instanceof h&&!function(e){let t=b(e);t&&t.tagName||(t={namespaceURI:pe,tagName:"template"});const i=Ut(e.tagName),n=Ut(t.tagName);return!!fe[e.namespaceURI]&&(e.namespaceURI===ue?t.namespaceURI===ge?"svg"===i:t.namespaceURI===ce?"svg"===i&&("annotation-xml"===n||ke[n]):Boolean(Ne[i]):e.namespaceURI===ce?t.namespaceURI===ge?"math"===i:t.namespaceURI===ue?"math"===i&&De[n]:Boolean(Ee[i]):e.namespaceURI===ge?!(t.namespaceURI===ue&&!De[n])&&!(t.namespaceURI===ce&&!ke[n])&&!Ee[i]&&(xe[i]||!Ne[i]):!("application/xhtml+xml"!==ve||!fe[e.namespaceURI]))}(e)?(Ie(e),!0):"noscript"!==s&&"noembed"!==s&&"noframes"!==s||!Zt(/<\/no(script|embed|frames)/i,e.innerHTML)?($&&3===e.nodeType&&(t=e.textContent,t=qt(t,N," "),t=qt(t,E," "),t=qt(t,I," "),e.textContent!==t&&(zt(i.removed,{element:e.cloneNode()}),e.textContent=t)),Oe("afterSanitizeElements",e,null),!1):(Ie(e),!0)},Fe=function(e,t,i){if(ee&&("id"===t||"name"===t)&&(i in o||i in ye))return!1;if(K&&!z[t]&&Zt(M,t));else if(U&&Zt(T,t));else if(!B[t]||z[t]){if(!(Be(e)&&(V.tagNameCheck instanceof RegExp&&Zt(V.tagNameCheck,e)||V.tagNameCheck instanceof Function&&V.tagNameCheck(e))&&(V.attributeNameCheck instanceof RegExp&&Zt(V.attributeNameCheck,t)||V.attributeNameCheck instanceof Function&&V.attributeNameCheck(t))||"is"===t&&V.allowCustomizedBuiltInElements&&(V.tagNameCheck instanceof RegExp&&Zt(V.tagNameCheck,i)||V.tagNameCheck instanceof Function&&V.tagNameCheck(i))))return!1}else if(he[t]);else if(Zt(O,qt(i,A,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==$t(i,"data:")||!ae[e]){if(j&&!Zt(R,qt(i,A,"")));else if(i)return!1}else;return!0},Be=function(e){return e.indexOf("-")>0},We=function(e){let t,n,s,o;Oe("beforeSanitizeAttributes",e,null);const{attributes:r}=e;if(!r)return;const a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:B};for(o=r.length;o--;){t=r[o];const{name:h,namespaceURI:d}=t;if(n="value"===h?t.value:Gt(t.value),s=Ce(h),a.attrName=s,a.attrValue=n,a.keepAttr=!0,a.forceKeepAttr=void 0,Oe("uponSanitizeAttribute",e,a),n=a.attrValue,a.forceKeepAttr)continue;if(Me(h,e),!a.keepAttr)continue;if(!q&&Zt(/\/>/i,n)){Me(h,e);continue}$&&(n=qt(n,N," "),n=qt(n,E," "),n=qt(n,I," "));const c=Ce(e.nodeName);if(Fe(c,s,n)){if(!te||"id"!==s&&"name"!==s||(Me(h,e),n="user-content-"+n),C&&"object"==typeof p&&"function"==typeof p.getAttributeType)if(d);else switch(p.getAttributeType(c,s)){case"TrustedHTML":n=C.createHTML(n);break;case"TrustedScriptURL":n=C.createScriptURL(n)}try{d?e.setAttributeNS(d,h,n):e.setAttribute(h,n),Ht(i.removed)}catch(l){}}}Oe("afterSanitizeAttributes",e,null)},Ve=function e(t){let i;const n=Re(t);for(Oe("beforeSanitizeShadowDOM",t,null);i=n.nextNode();)Oe("uponSanitizeShadowNode",i,null),Pe(i)||(i.content instanceof r&&e(i.content),We(i));Oe("afterSanitizeShadowDOM",t,null)};return i.sanitize=function(e){let t,s,o,a,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(me=!e,me&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ae(e)){if("function"!=typeof e.toString)throw Yt("toString is not a function");if("string"!=typeof(e=e.toString()))throw Yt("dirty is not a string, aborting")}if(!i.isSupported)return e;if(Z||Le(h),i.removed=[],"string"==typeof e&&(ne=!1),ne){if(e.nodeName){const t=Ce(e.nodeName);if(!P[t]||H[t])throw Yt("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)t=Te("\x3c!----\x3e"),s=t.ownerDocument.importNode(e,!0),1===s.nodeType&&"BODY"===s.nodeName||"HTML"===s.nodeName?t=s:t.appendChild(s);else{if(!X&&!$&&!G&&-1===e.indexOf("<"))return C&&J?C.createHTML(e):e;if(t=Te(e),!t)return X?null:J?w:""}t&&Y&&Ie(t.firstChild);const d=Re(ne?e:t);for(;o=d.nextNode();)Pe(o)||(o.content instanceof r&&Ve(o.content),We(o));if(ne)return e;if(X){if(Q)for(a=L.call(t.ownerDocument);t.firstChild;)a.appendChild(t.firstChild);else a=t;return(B.shadowroot||B.shadowrootmode)&&(a=D.call(n,a,!0)),a}let c=G?t.outerHTML:t.innerHTML;return G&&P["!doctype"]&&t.ownerDocument&&t.ownerDocument.doctype&&t.ownerDocument.doctype.name&&Zt(wi,t.ownerDocument.doctype.name)&&(c="\n"+c),$&&(c=qt(c,N," "),c=qt(c,E," "),c=qt(c,I," ")),C&&J?C.createHTML(c):c},i.setConfig=function(e){Le(e),Z=!0},i.clearConfig=function(){we=null,Z=!1},i.isValidAttribute=function(e,t,i){we||Le({});const n=Ce(e),s=Ce(t);return Fe(n,s,i)},i.addHook=function(e,t){"function"==typeof t&&(x[e]=x[e]||[],zt(x[e],t))},i.removeHook=function(e){if(x[e])return Ht(x[e])},i.removeHooks=function(e){x[e]&&(x[e]=[])},i.removeAllHooks=function(){x={}},i}();Li.version,Li.isSupported;const ki=Li.sanitize,Di=(Li.setConfig,Li.clearConfig,Li.isValidAttribute,Li.addHook),xi=Li.removeHook;Li.removeHooks,Li.removeAllHooks;let Ni;if(void 0!==Ie.vscode&&void 0!==Ie.vscode.process){const e=Ie.vscode.process;Ni={get platform(){return e.platform},get arch(){return e.arch},get env(){return e.env},cwd:()=>e.cwd()}}else Ni="undefined"!=typeof process?{get platform(){return process.platform},get arch(){return process.arch},get env(){return process.env},cwd:()=>process.env.VSCODE_CWD||process.cwd()}:{get platform(){return Oe?"win32":Pe?"darwin":"linux"},get arch(){},get env(){return{}},cwd:()=>"/"};const Ei=Ni.cwd,Ii=Ni.env,Mi=Ni.platform,Ti=46,Ri=47,Ai=92,Oi=58;class Pi extends Error{constructor(e,t,i){let n;"string"==typeof t&&0===t.indexOf("not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";const s=-1!==e.indexOf(".")?"property":"argument";let o=`The "${e}" ${s} ${n} of type ${t}`;o+=". Received type "+typeof i,super(o),this.code="ERR_INVALID_ARG_TYPE"}}function Fi(e,t){if("string"!=typeof e)throw new Pi(t,"string",e)}const Bi="win32"===Mi;function Wi(e){return e===Ri||e===Ai}function Vi(e){return e===Ri}function Hi(e){return e>=65&&e<=90||e>=97&&e<=122}function zi(e,t,i,n){let s="",o=0,r=-1,a=0,l=0;for(let h=0;h<=e.length;++h){if(h2){const e=s.lastIndexOf(i);-1===e?(s="",o=0):(s=s.slice(0,e),o=s.length-1-s.lastIndexOf(i)),r=h,a=0;continue}if(0!==s.length){s="",o=0,r=h,a=0;continue}}t&&(s+=s.length>0?`${i}..`:"..",o=2)}else s.length>0?s+=`${i}${e.slice(r+1,h)}`:s=e.slice(r+1,h),o=h-r-1;r=h,a=0}else l===Ti&&-1!==a?++a:a=-1}return s}function Ui(e,t){!function(e,t){if(null===e||"object"!=typeof e)throw new Pi(t,"Object",e)}(t,"pathObject");const i=t.dir||t.root,n=t.base||`${t.name||""}${t.ext||""}`;return i?i===t.root?`${i}${n}`:`${i}${e}${n}`:n}const Ki={resolve(...e){let t="",i="",n=!1;for(let s=e.length-1;s>=-1;s--){let o;if(s>=0){if(o=e[s],Fi(o,"path"),0===o.length)continue}else 0===t.length?o=Ei():(o=Ii[`=${t}`]||Ei(),(void 0===o||o.slice(0,2).toLowerCase()!==t.toLowerCase()&&o.charCodeAt(2)===Ai)&&(o=`${t}\\`));const r=o.length;let a=0,l="",h=!1;const d=o.charCodeAt(0);if(1===r)Wi(d)&&(a=1,h=!0);else if(Wi(d))if(h=!0,Wi(o.charCodeAt(1))){let e=2,t=e;for(;e2&&Wi(o.charCodeAt(2))&&(h=!0,a=3));if(l.length>0)if(t.length>0){if(l.toLowerCase()!==t.toLowerCase())continue}else t=l;if(n){if(t.length>0)break}else if(i=`${o.slice(a)}\\${i}`,n=h,h&&t.length>0)break}return i=zi(i,!n,"\\",Wi),n?`${t}\\${i}`:`${t}${i}`||"."},normalize(e){Fi(e,"path");const t=e.length;if(0===t)return".";let i,n=0,s=!1;const o=e.charCodeAt(0);if(1===t)return Vi(o)?"\\":e;if(Wi(o))if(s=!0,Wi(e.charCodeAt(1))){let s=2,o=s;for(;s2&&Wi(e.charCodeAt(2))&&(s=!0,n=3));let r=n0&&Wi(e.charCodeAt(t-1))&&(r+="\\"),void 0===i?s?`\\${r}`:r:s?`${i}\\${r}`:`${i}${r}`},isAbsolute(e){Fi(e,"path");const t=e.length;if(0===t)return!1;const i=e.charCodeAt(0);return Wi(i)||t>2&&Hi(i)&&e.charCodeAt(1)===Oi&&Wi(e.charCodeAt(2))},join(...e){if(0===e.length)return".";let t,i;for(let o=0;o0&&(void 0===t?t=i=n:t+=`\\${n}`)}if(void 0===t)return".";let n=!0,s=0;if("string"==typeof i&&Wi(i.charCodeAt(0))){++s;const e=i.length;e>1&&Wi(i.charCodeAt(1))&&(++s,e>2&&(Wi(i.charCodeAt(2))?++s:n=!1))}if(n){for(;s=2&&(t=`\\${t.slice(s)}`)}return Ki.normalize(t)},relative(e,t){if(Fi(e,"from"),Fi(t,"to"),e===t)return"";const i=Ki.resolve(e),n=Ki.resolve(t);if(i===n)return"";if((e=i.toLowerCase())===(t=n.toLowerCase()))return"";let s=0;for(;ss&&e.charCodeAt(o-1)===Ai;)o--;const r=o-s;let a=0;for(;aa&&t.charCodeAt(l-1)===Ai;)l--;const h=l-a,d=rd){if(t.charCodeAt(a+u)===Ai)return n.slice(a+u+1);if(2===u)return n.slice(a+u)}r>d&&(e.charCodeAt(s+u)===Ai?c=u:2===u&&(c=3)),-1===c&&(c=0)}let g="";for(u=s+c+1;u<=o;++u)u!==o&&e.charCodeAt(u)!==Ai||(g+=0===g.length?"..":"\\..");return a+=c,g.length>0?`${g}${n.slice(a,l)}`:(n.charCodeAt(a)===Ai&&++a,n.slice(a,l))},toNamespacedPath(e){if("string"!=typeof e||0===e.length)return e;const t=Ki.resolve(e);if(t.length<=2)return e;if(t.charCodeAt(0)===Ai){if(t.charCodeAt(1)===Ai){const e=t.charCodeAt(2);if(63!==e&&e!==Ti)return`\\\\?\\UNC\\${t.slice(2)}`}}else if(Hi(t.charCodeAt(0))&&t.charCodeAt(1)===Oi&&t.charCodeAt(2)===Ai)return`\\\\?\\${t}`;return e},dirname(e){Fi(e,"path");const t=e.length;if(0===t)return".";let i=-1,n=0;const s=e.charCodeAt(0);if(1===t)return Wi(s)?e:".";if(Wi(s)){if(i=n=1,Wi(e.charCodeAt(1))){let s=2,o=s;for(;s2&&Wi(e.charCodeAt(2))?3:2,n=i);let o=-1,r=!0;for(let a=t-1;a>=n;--a)if(Wi(e.charCodeAt(a))){if(!r){o=a;break}}else r=!1;if(-1===o){if(-1===i)return".";o=i}return e.slice(0,o)},basename(e,t){void 0!==t&&Fi(t,"ext"),Fi(e,"path");let i,n=0,s=-1,o=!0;if(e.length>=2&&Hi(e.charCodeAt(0))&&e.charCodeAt(1)===Oi&&(n=2),void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let r=t.length-1,a=-1;for(i=e.length-1;i>=n;--i){const l=e.charCodeAt(i);if(Wi(l)){if(!o){n=i+1;break}}else-1===a&&(o=!1,a=i+1),r>=0&&(l===t.charCodeAt(r)?-1==--r&&(s=i):(r=-1,s=a))}return n===s?s=a:-1===s&&(s=e.length),e.slice(n,s)}for(i=e.length-1;i>=n;--i)if(Wi(e.charCodeAt(i))){if(!o){n=i+1;break}}else-1===s&&(o=!1,s=i+1);return-1===s?"":e.slice(n,s)},extname(e){Fi(e,"path");let t=0,i=-1,n=0,s=-1,o=!0,r=0;e.length>=2&&e.charCodeAt(1)===Oi&&Hi(e.charCodeAt(0))&&(t=n=2);for(let a=e.length-1;a>=t;--a){const t=e.charCodeAt(a);if(Wi(t)){if(!o){n=a+1;break}}else-1===s&&(o=!1,s=a+1),t===Ti?-1===i?i=a:1!==r&&(r=1):-1!==i&&(r=-1)}return-1===i||-1===s||0===r||1===r&&i===s-1&&i===n+1?"":e.slice(i,s)},format:Ui.bind(null,"\\"),parse(e){Fi(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const i=e.length;let n=0,s=e.charCodeAt(0);if(1===i)return Wi(s)?(t.root=t.dir=e,t):(t.base=t.name=e,t);if(Wi(s)){if(n=1,Wi(e.charCodeAt(1))){let t=2,s=t;for(;t0&&(t.root=e.slice(0,n));let o=-1,r=n,a=-1,l=!0,h=e.length-1,d=0;for(;h>=n;--h)if(s=e.charCodeAt(h),Wi(s)){if(!l){r=h+1;break}}else-1===a&&(l=!1,a=h+1),s===Ti?-1===o?o=h:1!==d&&(d=1):-1!==o&&(d=-1);return-1!==a&&(-1===o||0===d||1===d&&o===a-1&&o===r+1?t.base=t.name=e.slice(r,a):(t.name=e.slice(r,o),t.base=e.slice(r,a),t.ext=e.slice(o,a))),t.dir=r>0&&r!==n?e.slice(0,r-1):t.root,t},sep:"\\",delimiter:";",win32:null,posix:null},ji=(()=>{if(Bi){const e=/\\/g;return()=>{const t=Ei().replace(e,"/");return t.slice(t.indexOf("/"))}}return()=>Ei()})(),qi={resolve(...e){let t="",i=!1;for(let n=e.length-1;n>=-1&&!i;n--){const s=n>=0?e[n]:ji();Fi(s,"path"),0!==s.length&&(t=`${s}/${t}`,i=s.charCodeAt(0)===Ri)}return t=zi(t,!i,"/",Vi),i?`/${t}`:t.length>0?t:"."},normalize(e){if(Fi(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===Ri,i=e.charCodeAt(e.length-1)===Ri;return 0===(e=zi(e,!t,"/",Vi)).length?t?"/":i?"./":".":(i&&(e+="/"),t?`/${e}`:e)},isAbsolute:e=>(Fi(e,"path"),e.length>0&&e.charCodeAt(0)===Ri),join(...e){if(0===e.length)return".";let t;for(let i=0;i0&&(void 0===t?t=n:t+=`/${n}`)}return void 0===t?".":qi.normalize(t)},relative(e,t){if(Fi(e,"from"),Fi(t,"to"),e===t)return"";if((e=qi.resolve(e))===(t=qi.resolve(t)))return"";const i=e.length,n=i-1,s=t.length-1,o=no){if(t.charCodeAt(1+a)===Ri)return t.slice(1+a+1);if(0===a)return t.slice(1+a)}else n>o&&(e.charCodeAt(1+a)===Ri?r=a:0===a&&(r=0));let l="";for(a=1+r+1;a<=i;++a)a!==i&&e.charCodeAt(a)!==Ri||(l+=0===l.length?"..":"/..");return`${l}${t.slice(1+r)}`},toNamespacedPath:e=>e,dirname(e){if(Fi(e,"path"),0===e.length)return".";const t=e.charCodeAt(0)===Ri;let i=-1,n=!0;for(let s=e.length-1;s>=1;--s)if(e.charCodeAt(s)===Ri){if(!n){i=s;break}}else n=!1;return-1===i?t?"/":".":t&&1===i?"//":e.slice(0,i)},basename(e,t){void 0!==t&&Fi(t,"ext"),Fi(e,"path");let i,n=0,s=-1,o=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t===e)return"";let r=t.length-1,a=-1;for(i=e.length-1;i>=0;--i){const l=e.charCodeAt(i);if(l===Ri){if(!o){n=i+1;break}}else-1===a&&(o=!1,a=i+1),r>=0&&(l===t.charCodeAt(r)?-1==--r&&(s=i):(r=-1,s=a))}return n===s?s=a:-1===s&&(s=e.length),e.slice(n,s)}for(i=e.length-1;i>=0;--i)if(e.charCodeAt(i)===Ri){if(!o){n=i+1;break}}else-1===s&&(o=!1,s=i+1);return-1===s?"":e.slice(n,s)},extname(e){Fi(e,"path");let t=-1,i=0,n=-1,s=!0,o=0;for(let r=e.length-1;r>=0;--r){const a=e.charCodeAt(r);if(a!==Ri)-1===n&&(s=!1,n=r+1),a===Ti?-1===t?t=r:1!==o&&(o=1):-1!==t&&(o=-1);else if(!s){i=r+1;break}}return-1===t||-1===n||0===o||1===o&&t===n-1&&t===i+1?"":e.slice(t,n)},format:Ui.bind(null,"/"),parse(e){Fi(e,"path");const t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;const i=e.charCodeAt(0)===Ri;let n;i?(t.root="/",n=1):n=0;let s=-1,o=0,r=-1,a=!0,l=e.length-1,h=0;for(;l>=n;--l){const t=e.charCodeAt(l);if(t!==Ri)-1===r&&(a=!1,r=l+1),t===Ti?-1===s?s=l:1!==h&&(h=1):-1!==s&&(h=-1);else if(!a){o=l+1;break}}if(-1!==r){const n=0===o&&i?1:o;-1===s||0===h||1===h&&s===r-1&&s===o+1?t.base=t.name=e.slice(n,r):(t.name=e.slice(n,s),t.base=e.slice(n,r),t.ext=e.slice(s,r))}return o>0?t.dir=e.slice(0,o-1):i&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null};qi.win32=Ki.win32=Ki,qi.posix=Ki.posix=qi;const $i=Bi?Ki.normalize:qi.normalize,Gi=Bi?Ki.resolve:qi.resolve,Zi=Bi?Ki.relative:qi.relative,Yi=Bi?Ki.dirname:qi.dirname,Xi=Bi?Ki.basename:qi.basename,Qi=Bi?Ki.extname:qi.extname,Ji=Bi?Ki.sep:qi.sep,en=/^\w[\w\d+.-]*$/,tn=/^\//,nn=/^\/\//;const sn="",on="/",rn=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class an{static isUri(e){return e instanceof an||!!e&&("string"==typeof e.authority&&"string"==typeof e.fragment&&"string"==typeof e.path&&"string"==typeof e.query&&"string"==typeof e.scheme&&"string"==typeof e.fsPath&&"function"==typeof e.with&&"function"==typeof e.toString)}constructor(e,t,i,n,s,o=!1){"object"==typeof e?(this.scheme=e.scheme||sn,this.authority=e.authority||sn,this.path=e.path||sn,this.query=e.query||sn,this.fragment=e.fragment||sn):(this.scheme=function(e,t){return e||t?e:"file"}(e,o),this.authority=t||sn,this.path=function(e,t){switch(e){case"https":case"http":case"file":t?t[0]!==on&&(t=on+t):t=on}return t}(this.scheme,i||sn),this.query=n||sn,this.fragment=s||sn,function(e,t){if(!e.scheme&&t)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);if(e.scheme&&!en.test(e.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(e.path)if(e.authority){if(!tn.test(e.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(nn.test(e.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}(this,o))}get fsPath(){return gn(this,!1)}with(e){if(!e)return this;let{scheme:t,authority:i,path:n,query:s,fragment:o}=e;return void 0===t?t=this.scheme:null===t&&(t=sn),void 0===i?i=this.authority:null===i&&(i=sn),void 0===n?n=this.path:null===n&&(n=sn),void 0===s?s=this.query:null===s&&(s=sn),void 0===o?o=this.fragment:null===o&&(o=sn),t===this.scheme&&i===this.authority&&n===this.path&&s===this.query&&o===this.fragment?this:new hn(t,i,n,s,o)}static parse(e,t=!1){const i=rn.exec(e);return i?new hn(i[2]||sn,_n(i[4]||sn),_n(i[5]||sn),_n(i[7]||sn),_n(i[9]||sn),t):new hn(sn,sn,sn,sn,sn)}static file(e){let t=sn;if(Oe&&(e=e.replace(/\\/g,on)),e[0]===on&&e[1]===on){const i=e.indexOf(on,2);-1===i?(t=e.substring(2),e=on):(t=e.substring(2,i),e=e.substring(i)||on)}return new hn("file",t,e,sn,sn)}static from(e,t){return new hn(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 i=Oe&&"file"===e.scheme?an.file(Ki.join(gn(e,!0),...t)).path:qi.join(e.path,...t),e.with({path:i})}toString(e=!1){return pn(this,e)}toJSON(){return this}static revive(e){var t,i;if(e){if(e instanceof an)return e;{const n=new hn(e);return n._formatted=null!==(t=e.external)&&void 0!==t?t:null,n._fsPath=e._sep===ln&&null!==(i=e.fsPath)&&void 0!==i?i:null,n}}return e}}const ln=Oe?1:void 0;class hn extends an{constructor(){super(...arguments),this._formatted=null,this._fsPath=null}get fsPath(){return this._fsPath||(this._fsPath=gn(this,!1)),this._fsPath}toString(e=!1){return e?pn(this,!0):(this._formatted||(this._formatted=pn(this,!1)),this._formatted)}toJSON(){const e={$mid:1};return this._fsPath&&(e.fsPath=this._fsPath,e._sep=ln),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 dn={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function cn(e,t,i){let n,s=-1;for(let o=0;o=97&&r<=122||r>=65&&r<=90||r>=48&&r<=57||45===r||46===r||95===r||126===r||t&&47===r||i&&91===r||i&&93===r||i&&58===r)-1!==s&&(n+=encodeURIComponent(e.substring(s,o)),s=-1),void 0!==n&&(n+=e.charAt(o));else{void 0===n&&(n=e.substr(0,o));const t=dn[r];void 0!==t?(-1!==s&&(n+=encodeURIComponent(e.substring(s,o)),s=-1),n+=t):-1===s&&(s=o)}}return-1!==s&&(n+=encodeURIComponent(e.substring(s))),void 0!==n?n:e}function un(e){let t;for(let i=0;i1&&"file"===e.scheme?`//${e.authority}${e.path}`:47===e.path.charCodeAt(0)&&(e.path.charCodeAt(1)>=65&&e.path.charCodeAt(1)<=90||e.path.charCodeAt(1)>=97&&e.path.charCodeAt(1)<=122)&&58===e.path.charCodeAt(2)?t?e.path.substr(1):e.path[1].toLowerCase()+e.path.substr(2):e.path,Oe&&(i=i.replace(/\//g,"\\")),i}function pn(e,t){const i=t?un:cn;let n="",{scheme:s,authority:o,path:r,query:a,fragment:l}=e;if(s&&(n+=s,n+=":"),(o||"file"===s)&&(n+=on,n+=on),o){let e=o.indexOf("@");if(-1!==e){const t=o.substr(0,e);o=o.substr(e+1),e=t.lastIndexOf(":"),-1===e?n+=i(t,!1,!1):(n+=i(t.substr(0,e),!1,!1),n+=":",n+=i(t.substr(e+1),!1,!0)),n+="@"}o=o.toLowerCase(),e=o.lastIndexOf(":"),-1===e?n+=i(o,!1,!0):(n+=i(o.substr(0,e),!1,!0),n+=o.substr(e))}if(r){if(r.length>=3&&47===r.charCodeAt(0)&&58===r.charCodeAt(2)){const e=r.charCodeAt(1);e>=65&&e<=90&&(r=`/${String.fromCharCode(e+32)}:${r.substr(3)}`)}else if(r.length>=2&&58===r.charCodeAt(1)){const e=r.charCodeAt(0);e>=65&&e<=90&&(r=`${String.fromCharCode(e+32)}:${r.substr(2)}`)}n+=i(r,!0,!1)}return a&&(n+="?",n+=i(a,!1,!1)),l&&(n+="#",n+=t?l:cn(l,!1,!1)),n}function mn(e){try{return decodeURIComponent(e)}catch(ge){return e.length>3?e.substr(0,3)+mn(e.substr(3)):e}}const fn=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function _n(e){return e.match(fn)?e.replace(fn,(e=>mn(e))):e}var vn;!function(e){e.inMemory="inmemory",e.vscode="vscode",e.internal="private",e.walkThrough="walkThrough",e.walkThroughSnippet="walkThroughSnippet",e.http="http",e.https="https",e.file="file",e.mailto="mailto",e.untitled="untitled",e.data="data",e.command="command",e.vscodeRemote="vscode-remote",e.vscodeRemoteResource="vscode-remote-resource",e.vscodeManagedRemoteResource="vscode-managed-remote-resource",e.vscodeUserData="vscode-userdata",e.vscodeCustomEditor="vscode-custom-editor",e.vscodeNotebookCell="vscode-notebook-cell",e.vscodeNotebookCellMetadata="vscode-notebook-cell-metadata",e.vscodeNotebookCellOutput="vscode-notebook-cell-output",e.vscodeInteractiveInput="vscode-interactive-input",e.vscodeSettings="vscode-settings",e.vscodeWorkspaceTrust="vscode-workspace-trust",e.vscodeTerminal="vscode-terminal",e.vscodeChatSesssion="vscode-chat-editor",e.webviewPanel="webview-panel",e.vscodeWebview="vscode-webview",e.extension="extension",e.vscodeFileResource="vscode-file",e.tmp="tmp",e.vsls="vsls",e.vscodeSourceControl="vscode-scm"}(vn||(vn={}));const bn=new class{constructor(){this._hosts=Object.create(null),this._ports=Object.create(null),this._connectionTokens=Object.create(null),this._preferredWebSchema="http",this._delegate=null,this._remoteResourcesPath=`/${vn.vscodeRemoteResource}`}setPreferredWebSchema(e){this._preferredWebSchema=e}rewrite(e){if(this._delegate)try{return this._delegate(e)}catch(a){return r(a),e}const t=e.authority;let i=this._hosts[t];i&&-1!==i.indexOf(":")&&-1===i.indexOf("[")&&(i=`[${i}]`);const n=this._ports[t],s=this._connectionTokens[t];let o=`path=${encodeURIComponent(e.path)}`;return"string"==typeof s&&(o+=`&tkn=${encodeURIComponent(s)}`),an.from({scheme:We?this._preferredWebSchema:vn.vscodeRemoteResource,authority:`${i}:${n}`,path:this._remoteResourcesPath,query:o})}};class Cn{uriToBrowserUri(e){return e.scheme===vn.vscodeRemote?bn.rewrite(e):e.scheme===vn.file&&(Be||Ve&&Ie.origin===`${vn.vscodeFileResource}://${Cn.FALLBACK_AUTHORITY}`)?e.with({scheme:vn.vscodeFileResource,authority:e.authority||Cn.FALLBACK_AUTHORITY,query:null,fragment:null}):e}}Cn.FALLBACK_AUTHORITY="vscode-app";const wn=new Cn;var yn;!function(e){const t=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"}]]);e.CoopAndCoep=Object.freeze(t.get("3"));const i="vscode-coi";e.getHeadersFromQuery=function(e){let n;"string"==typeof e?n=new URL(e).searchParams:e instanceof URL?n=e.searchParams:an.isUri(e)&&(n=new URL(e.toString(!0)).searchParams);const s=null==n?void 0:n.get(i);if(s)return t.get(s)},e.addSearchParam=function(e,t,n){if(!globalThis.crossOriginIsolated)return;const s=t&&n?"3":n?"2":"1";e instanceof URLSearchParams?e.set(i,s):e[i]=s}}(yn||(yn={}));const{registerWindow:Sn,getWindows:Ln,onDidCreateWindow:kn}=function(){const e=[],t=new U;return{onDidCreateWindow:t.event,registerWindow(i){e.push(i);const n=new N;return n.add(x((()=>{const t=e.indexOf(i);-1!==t&&e.splice(t,1)}))),t.fire({window:i,disposableStore:n}),n},getWindows:()=>e}}();function Dn(e){for(;e.firstChild;)e.firstChild.remove()}function xn(e){var t;return null!==(t=null==e?void 0:e.isConnected)&&void 0!==t&&t}class Nn{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 En(e,t,i,n){return new Nn(e,t,i,n)}function In(e){return function(t){return e(new Nt(t))}}const Mn=function(e,t,i,n){let s=i;return"click"===t||"mousedown"===t?s=In(i):"keydown"!==t&&"keypress"!==t&&"keyup"!==t||(s=function(e){return function(t){return e(new St(t))}}(i)),En(e,t,s,n)},Tn=function(e,t,i){return function(e,t,i){return En(e,He&&tt?os.POINTER_DOWN:os.MOUSE_DOWN,t,i)}(e,In(t),i)};let Rn,An;class On{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(Mre){r(Mre)}}static sort(e,t){return t.priority-e.priority}}function Pn(e){return e.ownerDocument.defaultView.getComputedStyle(e,null)}function Fn(e){var t;const i=e.ownerDocument,n=null===(t=i.defaultView)||void 0===t?void 0:t.window;if(e!==i.body)return new Wn(e.clientWidth,e.clientHeight);if(He&&(null==n?void 0:n.visualViewport))return new Wn(n.visualViewport.width,n.visualViewport.height);if((null==n?void 0:n.innerWidth)&&n.innerHeight)return new Wn(n.innerWidth,n.innerHeight);if(i.body&&i.body.clientWidth&&i.body.clientHeight)return new Wn(i.body.clientWidth,i.body.clientHeight);if(i.documentElement&&i.documentElement.clientWidth&&i.documentElement.clientHeight)return new Wn(i.documentElement.clientWidth,i.documentElement.clientHeight);throw new Error("Unable to figure out browser width and height")}!function(){let e=[],t=null,i=!1,n=!1;const s=()=>{for(i=!1,t=e,e=[],n=!0;t.length>0;){t.sort(On.sort);t.shift().execute()}n=!1};An=(t,n=0)=>{const o=new On(t,n);return e.push(o),i||(i=!0,requestAnimationFrame(s)),o},Rn=(e,i)=>{if(n){const n=new On(e,i);return t.push(n),n}return An(e,i)}}();class Bn{static convertToPixels(e,t){return parseFloat(t)||0}static getDimension(e,t,i){const n=Pn(e),s=n?n.getPropertyValue(t):"0";return Bn.convertToPixels(e,s)}static getBorderLeftWidth(e){return Bn.getDimension(e,"border-left-width","borderLeftWidth")}static getBorderRightWidth(e){return Bn.getDimension(e,"border-right-width","borderRightWidth")}static getBorderTopWidth(e){return Bn.getDimension(e,"border-top-width","borderTopWidth")}static getBorderBottomWidth(e){return Bn.getDimension(e,"border-bottom-width","borderBottomWidth")}static getPaddingLeft(e){return Bn.getDimension(e,"padding-left","paddingLeft")}static getPaddingRight(e){return Bn.getDimension(e,"padding-right","paddingRight")}static getPaddingTop(e){return Bn.getDimension(e,"padding-top","paddingTop")}static getPaddingBottom(e){return Bn.getDimension(e,"padding-bottom","paddingBottom")}static getMarginLeft(e){return Bn.getDimension(e,"margin-left","marginLeft")}static getMarginTop(e){return Bn.getDimension(e,"margin-top","marginTop")}static getMarginRight(e){return Bn.getDimension(e,"margin-right","marginRight")}static getMarginBottom(e){return Bn.getDimension(e,"margin-bottom","marginBottom")}}class Wn{constructor(e,t){this.width=e,this.height=t}with(e=this.width,t=this.height){return e!==this.width||t!==this.height?new Wn(e,t):this}static is(e){return"object"==typeof e&&"number"==typeof e.height&&"number"==typeof e.width}static lift(e){return e instanceof Wn?e:new Wn(e.width,e.height)}static equals(e,t){return e===t||!(!e||!t)&&(e.width===t.width&&e.height===t.height)}}function Vn(e){let t=e.offsetParent,i=e.offsetTop,n=e.offsetLeft;for(;null!==(e=e.parentNode)&&e!==e.ownerDocument.body&&e!==e.ownerDocument.documentElement;){i-=e.scrollTop;const s=Gn(e)?null:Pn(e);s&&(n-="rtl"!==s.direction?e.scrollLeft:-e.scrollLeft),e===t&&(n+=Bn.getBorderLeftWidth(e),i+=Bn.getBorderTopWidth(e),i+=e.offsetTop,n+=e.offsetLeft,t=e.offsetParent)}return{left:n,top:i}}function Hn(e){var t,i,n,s;const o=e.getBoundingClientRect();return{left:o.left+(null!==(i=null===(t=e.ownerDocument.defaultView)||void 0===t?void 0:t.scrollX)&&void 0!==i?i:0),top:o.top+(null!==(s=null===(n=e.ownerDocument.defaultView)||void 0===n?void 0:n.scrollY)&&void 0!==s?s:0),width:o.width,height:o.height}}function zn(e){const t=Bn.getMarginLeft(e)+Bn.getMarginRight(e);return e.offsetWidth+t}function Un(e){const t=Bn.getBorderLeftWidth(e)+Bn.getBorderRightWidth(e),i=Bn.getPaddingLeft(e)+Bn.getPaddingRight(e);return e.offsetWidth-t-i}function Kn(e){const t=Bn.getBorderTopWidth(e)+Bn.getBorderBottomWidth(e),i=Bn.getPaddingTop(e)+Bn.getPaddingBottom(e);return e.offsetHeight-t-i}function jn(e){const t=Bn.getMarginTop(e)+Bn.getMarginBottom(e);return e.offsetHeight+t}function qn(e,t){for(;e;){if(e===t)return!0;e=e.parentNode}return!1}function $n(e,t,i){return!!function(e,t,i){for(;e&&e.nodeType===e.ELEMENT_NODE;){if(e.classList.contains(t))return e;if(i)if("string"==typeof i){if(e.classList.contains(i))return null}else if(e===i)return null;e=e.parentNode}return null}(e,t,i)}function Gn(e){return e&&!!e.host&&!!e.mode}function Zn(e){return!!Yn(e)}function Yn(e){for(var t;e.parentNode;){if(e===(null===(t=e.ownerDocument)||void 0===t?void 0:t.body))return null;e=e.parentNode}return Gn(e)?e:null}function Xn(){let e=Qn().activeElement;for(;null==e?void 0:e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function Qn(){var e;return null!==(e=[document,...Ln().map((e=>e.document))].find((e=>e.hasFocus())))&&void 0!==e?e:document}function Jn(e=document.getElementsByTagName("head")[0],t){const i=document.createElement("style");return i.type="text/css",i.media="screen",null==t||t(i),e.appendChild(i),i}Wn.None=new Wn(0,0);let es=null;function ts(){return es||(es=Jn()),es}function is(e,t,i=ts()){i&&t&&i.sheet.insertRule(e+"{"+t+"}",0)}function ns(e,t=ts()){if(!t)return;const i=function(e){var t,i;return(null===(t=null==e?void 0:e.sheet)||void 0===t?void 0:t.rules)?e.sheet.rules:(null===(i=null==e?void 0:e.sheet)||void 0===i?void 0:i.cssRules)?e.sheet.cssRules:[]}(t),n=[];for(let s=0;s=0;s--)t.sheet.deleteRule(n[s])}function ss(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName}const os={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",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:se?"webkitAnimationStart":"animationstart",ANIMATION_END:se?"webkitAnimationEnd":"animationend",ANIMATION_ITERATION:se?"webkitAnimationIteration":"animationiteration"};function rs(e){const t=e;return!(!t||"function"!=typeof t.preventDefault||"function"!=typeof t.stopPropagation)}const as=(e,t)=>(e.preventDefault(),t&&e.stopPropagation(),e);class ls extends E{static hasFocusWithin(e){if(ss(e)){const t=Yn(e);return qn(t?t.activeElement:e.ownerDocument.activeElement,e)}return qn(window.document.activeElement,window.document)}constructor(e){super(),this._onDidFocus=this._register(new U),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new U),this.onDidBlur=this._onDidBlur.event;let t=ls.hasFocusWithin(e),i=!1;const n=()=>{i=!1,t||(t=!0,this._onDidFocus.fire())},s=()=>{t&&(i=!0,window.setTimeout((()=>{i&&(i=!1,t=!1,this._onDidBlur.fire())}),0))};this._refreshStateHandler=()=>{ls.hasFocusWithin(e)!==t&&(t?s():n())},this._register(En(e,os.FOCUS,n,!0)),this._register(En(e,os.BLUR,s,!0)),e instanceof HTMLElement&&(this._register(En(e,os.FOCUS_IN,(()=>this._refreshStateHandler()))),this._register(En(e,os.FOCUS_OUT,(()=>this._refreshStateHandler()))))}}function hs(e){return new ls(e)}function ds(e,...t){if(e.append(...t),1===t.length&&"string"!=typeof t[0])return t[0]}function cs(e,t){return e.insertBefore(t,e.firstChild),t}function us(e,...t){e.innerText="",ds(e,...t)}const gs=/([\w\-]+)?(#([\w\-]+))?((\.([\w\-]+))*)/;var ps;function ms(e,t,i,...n){const s=gs.exec(t);if(!s)throw new Error("Bad use of emmet");const o=s[1]||"div";let r;return r=e!==ps.HTML?document.createElementNS(e,o):document.createElement(o),s[3]&&(r.id=s[3]),s[4]&&(r.className=s[4].replace(/\./g," ").trim()),i&&Object.entries(i).forEach((([e,t])=>{void 0!==t&&(/^on\w+$/.test(e)?r[e]=t:"selected"===e?t&&r.setAttribute(e,"true"):r.setAttribute(e,t))})),r.append(...n),r}function fs(e,t,...i){return ms(ps.HTML,e,t,...i)}function _s(...e){for(const t of e)t.style.display="",t.removeAttribute("aria-hidden")}function vs(...e){for(const t of e)t.style.display="none",t.setAttribute("aria-hidden","true")}function bs(e){const t=window.devicePixelRatio*e;return Math.max(1,Math.floor(t))/window.devicePixelRatio}function Cs(e){window.open(e,"_blank","noopener")}function ws(e){return e?`url('${wn.uriToBrowserUri(e).toString(!0).replace(/'/g,"%27")}')`:"url('')"}function ys(e){return`'${e.replace(/'/g,"%27")}'`}function Ss(e,t){if(void 0!==e){const i=e.match(/^\s*var\((.+)\)$/);if(i){const e=i[1].split(",",2);return 2===e.length&&(t=Ss(e[1].trim(),t)),`var(${e[0]}, ${t})`}return e}return t}!function(e){e.HTML="http://www.w3.org/1999/xhtml",e.SVG="http://www.w3.org/2000/svg"}(ps||(ps={})),fs.SVG=function(e,t,...i){return ms(ps.SVG,e,t,...i)},bn.setPreferredWebSchema(/^https:/.test(window.location.href)?"https":"http");const Ls=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","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"]);Object.freeze({ALLOWED_TAGS:["a","button","blockquote","code","div","h1","h2","h3","h4","h5","h6","hr","input","label","li","p","pre","select","small","span","strong","textarea","ul","ol"],ALLOWED_ATTR:["href","data-href","data-command","target","title","name","src","alt","class","id","role","tabindex","style","data-code","width","height","align","x-dispatch","required","checked","placeholder","type","start"],RETURN_DOM:!1,RETURN_DOM_FRAGMENT:!1,RETURN_TRUSTED_TYPE:!0});class ks extends U{constructor(){super(),this._subscriptions=new N,this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1},this._subscriptions.add(En(window,"keydown",(e=>{if(e.defaultPrevented)return;const t=new St(e);if(6!==t.keyCode||!e.repeat){if(e.altKey&&!this._keyStatus.altKey)this._keyStatus.lastKeyPressed="alt";else if(e.ctrlKey&&!this._keyStatus.ctrlKey)this._keyStatus.lastKeyPressed="ctrl";else if(e.metaKey&&!this._keyStatus.metaKey)this._keyStatus.lastKeyPressed="meta";else if(e.shiftKey&&!this._keyStatus.shiftKey)this._keyStatus.lastKeyPressed="shift";else{if(6===t.keyCode)return;this._keyStatus.lastKeyPressed=void 0}this._keyStatus.altKey=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyPressed&&(this._keyStatus.event=e,this.fire(this._keyStatus))}}),!0)),this._subscriptions.add(En(window,"keyup",(e=>{e.defaultPrevented||(!e.altKey&&this._keyStatus.altKey?this._keyStatus.lastKeyReleased="alt":!e.ctrlKey&&this._keyStatus.ctrlKey?this._keyStatus.lastKeyReleased="ctrl":!e.metaKey&&this._keyStatus.metaKey?this._keyStatus.lastKeyReleased="meta":!e.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=e.altKey,this._keyStatus.ctrlKey=e.ctrlKey,this._keyStatus.metaKey=e.metaKey,this._keyStatus.shiftKey=e.shiftKey,this._keyStatus.lastKeyReleased&&(this._keyStatus.event=e,this.fire(this._keyStatus)))}),!0)),this._subscriptions.add(En(document.body,"mousedown",(()=>{this._keyStatus.lastKeyPressed=void 0}),!0)),this._subscriptions.add(En(document.body,"mouseup",(()=>{this._keyStatus.lastKeyPressed=void 0}),!0)),this._subscriptions.add(En(document.body,"mousemove",(e=>{e.buttons&&(this._keyStatus.lastKeyPressed=void 0)}),!0)),this._subscriptions.add(En(window,"blur",(()=>{this.resetKeyStatus()})))}get keyStatus(){return this._keyStatus}resetKeyStatus(){this.doResetKeyStatus(),this.fire(this._keyStatus)}doResetKeyStatus(){this._keyStatus={altKey:!1,shiftKey:!1,ctrlKey:!1,metaKey:!1}}static getInstance(){return ks.instance||(ks.instance=new ks),ks.instance}dispose(){super.dispose(),this._subscriptions.dispose()}}class Ds extends E{constructor(e,t){super(),this.element=e,this.callbacks=t,this.counter=0,this.dragStartTime=0,this.registerListeners()}registerListeners(){this._register(En(this.element,os.DRAG_ENTER,(e=>{this.counter++,this.dragStartTime=e.timeStamp,this.callbacks.onDragEnter(e)}))),this._register(En(this.element,os.DRAG_OVER,(e=>{var t,i;e.preventDefault(),null===(i=(t=this.callbacks).onDragOver)||void 0===i||i.call(t,e,e.timeStamp-this.dragStartTime)}))),this._register(En(this.element,os.DRAG_LEAVE,(e=>{this.counter--,0===this.counter&&(this.dragStartTime=0,this.callbacks.onDragLeave(e))}))),this._register(En(this.element,os.DRAG_END,(e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDragEnd(e)}))),this._register(En(this.element,os.DROP,(e=>{this.counter=0,this.dragStartTime=0,this.callbacks.onDrop(e)})))}}const xs=/(?[\w\-]+)?(?:#(?[\w\-]+))?(?(?:\.(?:[\w\-]+))*)(?:@(?(?:[\w\_])+))?/;function Ns(e,...t){let i,n;Array.isArray(t[0])?(i={},n=t[0]):(i=t[0]||{},n=t[1]);const s=xs.exec(e);if(!s||!s.groups)throw new Error("Bad use of h");const o=s.groups.tag||"div",r=document.createElement(o);s.groups.id&&(r.id=s.groups.id);const a=[];if(s.groups.class)for(const h of s.groups.class.split("."))""!==h&&a.push(h);if(void 0!==i.className)for(const h of i.className.split("."))""!==h&&a.push(h);a.length>0&&(r.className=a.join(" "));const l={};if(s.groups.name&&(l[s.groups.name]=r),n)for(const h of n)h instanceof HTMLElement?r.appendChild(h):"string"==typeof h?r.append(h):"root"in h&&(Object.assign(l,h),r.appendChild(h.root));for(const[h,d]of Object.entries(i))if("className"!==h)if("style"===h)for(const[e,t]of Object.entries(d))r.style.setProperty(Es(e),"number"==typeof t?t+"px":""+t);else"tabIndex"===h?r.tabIndex=d:r.setAttribute(Es(h),d.toString());return l.root=r,l}function Es(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}const Is=2e4;let Ms,Ts,Rs,As,Os;function Ps(e){Ms&&(Ts.textContent!==e?(Dn(Rs),Bs(Ts,e)):(Dn(Ts),Bs(Rs,e)))}function Fs(e){Ms&&(As.textContent!==e?(Dn(Os),Bs(As,e)):(Dn(As),Bs(Os,e)))}function Bs(e,t){Dn(e),t.length>Is&&(t=t.substr(0,Is)),e.textContent=t,e.style.visibility="hidden",e.style.visibility="visible"}var Ws,Vs,Hs;class zs{constructor(e,t){this.uri=e,this.value=t}}class Us{constructor(e,t){if(this[Ws]="ResourceMap",e instanceof Us)this.map=new Map(e.map),this.toKey=null!=t?t:Us.defaultToKey;else if(function(e){return Array.isArray(e)}(e)){this.map=new Map,this.toKey=null!=t?t:Us.defaultToKey;for(const[t,i]of e)this.set(t,i)}else this.map=new Map,this.toKey=null!=e?e:Us.defaultToKey}set(e,t){return this.map.set(this.toKey(e),new zs(e,t)),this}get(e){var t;return null===(t=this.map.get(this.toKey(e)))||void 0===t?void 0:t.value}has(e){return this.map.has(this.toKey(e))}get size(){return this.map.size}clear(){this.map.clear()}delete(e){return this.map.delete(this.toKey(e))}forEach(e,t){void 0!==t&&(e=e.bind(t));for(const[i,n]of this.map)e(n.value,n.uri,this)}*values(){for(const e of this.map.values())yield e.value}*keys(){for(const e of this.map.values())yield e.uri}*entries(){for(const e of this.map.values())yield[e.uri,e.value]}*[(Ws=Symbol.toStringTag,Symbol.iterator)](){for(const[,e]of this.map)yield[e.uri,e.value]}}Us.defaultToKey=e=>e.toString();class Ks{constructor(){this[Vs]="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(){var e;return null===(e=this._head)||void 0===e?void 0:e.value}get last(){var e;return null===(e=this._tail)||void 0===e?void 0:e.value}has(e){return this._map.has(e)}get(e,t=0){const i=this._map.get(e);if(i)return 0!==t&&this.touch(i,t),i.value}set(e,t,i=0){let n=this._map.get(e);if(n)n.value=t,0!==i&&this.touch(n,i);else{switch(n={key:e,value:t,next:void 0,previous:void 0},i){case 0:case 2:default:this.addItemLast(n);break;case 1:this.addItemFirst(n)}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,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:i.key,done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}values(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:i.value,done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}entries(){const e=this,t=this._state;let i=this._head;const n={[Symbol.iterator]:()=>n,next(){if(e._state!==t)throw new Error("LinkedMap got modified during iteration.");if(i){const e={value:[i.key,i.value],done:!1};return i=i.next,e}return{value:void 0,done:!0}}};return n}[(Vs=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(0===e)return void this.clear();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){if(!this._head)throw new Error("Invalid list");e.next=this._head,this._head.previous=e}else this._tail=e;this._head=e,this._state++}addItemLast(e){if(this._head||this._tail){if(!this._tail)throw new Error("Invalid list");e.previous=this._tail,this._tail.next=e}else this._head=e;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(1===t||2===t)if(1===t){if(e===this._head)return;const t=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(t.previous=i,i.next=t),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++}else if(2===t){if(e===this._tail)return;const t=e.next,i=e.previous;e===this._head?(t.previous=void 0,this._head=t):(t.previous=i,i.next=t),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)}}class js extends Ks{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(e,t=2){return super.get(e,t)}peek(e){return super.get(e,0)}set(e,t){return super.set(e,t,2),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}class qs{constructor(e){if(this._m1=new Map,this._m2=new Map,e)for(const[t,i]of e)this.set(t,i)}clear(){this._m1.clear(),this._m2.clear()}set(e,t){this._m1.set(e,t),this._m2.set(t,e)}get(e){return this._m1.get(e)}getKey(e){return this._m2.get(e)}delete(e){const t=this._m1.get(e);return void 0!==t&&(this._m1.delete(e),this._m2.delete(t),!0)}keys(){return this._m1.keys()}values(){return this._m1.values()}}class $s{constructor(){this.map=new Map}add(e,t){let i=this.map.get(e);i||(i=new Set,this.map.set(e,i)),i.add(t)}delete(e,t){const i=this.map.get(e);i&&(i.delete(t),0===i.size&&this.map.delete(e))}forEach(e,t){const i=this.map.get(e);i&&i.forEach(t)}get(e){const t=this.map.get(e);return t||new Set}}class Gs{get cachedValues(){return this._map}constructor(e){this.fn=e,this._map=new Map}get(e){if(this._map.has(e))return this._map.get(e);const t=this.fn(e);return this._map.set(e,t),t}}class Zs{constructor(e){this.executor=e,this._didRun=!1}get value(){if(!this._didRun)try{this._value=this.executor()}catch(e){this._error=e}finally{this._didRun=!0}if(this._error)throw this._error;return this._value}get rawValue(){return this._value}}function Ys(e){return!e||"string"!=typeof e||0===e.trim().length}const Xs=/{(\d+)}/g;function Qs(e,...t){return 0===t.length?e:e.replace(Xs,(function(e,i){const n=parseInt(i,10);return isNaN(n)||n<0||n>=t.length?e:t[n]}))}function Js(e){return e.replace(/[<>&]/g,(function(e){switch(e){case"<":return"<";case">":return">";case"&":return"&";default:return e}}))}function eo(e){return e.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function to(e,t=" "){return no(io(e,t),t)}function io(e,t){if(!e||!t)return e;const i=t.length;if(0===i||0===e.length)return e;let n=0;for(;e.indexOf(t,n)===n;)n+=i;return e.substring(n)}function no(e,t){if(!e||!t)return e;const i=t.length,n=e.length;if(0===i||0===n)return e;let s=n,o=-1;for(;o=e.lastIndexOf(t,s-1),-1!==o&&o+i===s;){if(0===o)return"";s=o}return e.substring(0,s)}function so(e,t,i={}){if(!e)throw new Error("Cannot create regex from empty string");t||(e=eo(e)),i.wholeWord&&(/\B/.test(e.charAt(0))||(e="\\b"+e),/\B/.test(e.charAt(e.length-1))||(e+="\\b"));let n="";return i.global&&(n+="g"),i.matchCase||(n+="i"),i.multiline&&(n+="m"),i.unicode&&(n+="u"),new RegExp(e,n)}function oo(e){return e.split(/\r\n|\r|\n/)}function ro(e){for(let t=0,i=e.length;t=0;i--){const t=e.charCodeAt(i);if(32!==t&&9!==t)return i}return-1}function ho(e,t){return et?1:0}function co(e,t,i=0,n=e.length,s=0,o=t.length){for(;io)return 1}const r=n-i,a=o-s;return ra?1:0}function uo(e,t){return go(e,t,0,e.length,0,t.length)}function go(e,t,i=0,n=e.length,s=0,o=t.length){for(;i=128||a>=128)return co(e.toLowerCase(),t.toLowerCase(),i,n,s,o);mo(r)&&(r-=32),mo(a)&&(a-=32);const l=r-a;if(0!==l)return l}const r=n-i,a=o-s;return ra?1:0}function po(e){return e>=48&&e<=57}function mo(e){return e>=97&&e<=122}function fo(e){return e>=65&&e<=90}function _o(e,t){return e.length===t.length&&0===go(e,t)}function vo(e,t){const i=t.length;return!(t.length>e.length)&&0===go(e,t,0,i)}function bo(e,t){const i=Math.min(e.length,t.length);let n;for(n=0;n1){const n=e.charCodeAt(t-2);if(wo(n))return So(n,i)}return i}(this._str,this._offset);return this._offset-=e>=65536?2:1,e}nextCodePoint(){const e=Lo(this._str,this._len,this._offset);return this._offset+=e>=65536?2:1,e}eol(){return this._offset>=this._len}}class Do{get offset(){return this._iterator.offset}constructor(e,t=0){this._iterator=new ko(e,t)}nextGraphemeLength(){const e=Ho.getInstance(),t=this._iterator,i=t.offset;let n=e.getGraphemeBreakType(t.nextCodePoint());for(;!t.eol();){const i=t.offset,s=e.getGraphemeBreakType(t.nextCodePoint());if(Vo(n,s)){t.setOffset(i);break}n=s}return t.offset-i}prevGraphemeLength(){const e=Ho.getInstance(),t=this._iterator,i=t.offset;let n=e.getGraphemeBreakType(t.prevCodePoint());for(;t.offset>0;){const i=t.offset,s=e.getGraphemeBreakType(t.prevCodePoint());if(Vo(s,n)){t.setOffset(i);break}n=s}return i-t.offset}eol(){return this._iterator.eol()}}function xo(e,t){return new Do(e,t).nextGraphemeLength()}function No(e,t){return new Do(e,t).prevGraphemeLength()}let Eo;function Io(e){return Eo||(Eo=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA\u07FE-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u088E\u08A0-\u08C9\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDC7\uFDF0-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE35\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDD23\uDE80-\uDEA9\uDEAD-\uDF45\uDF51-\uDF81\uDF86-\uDFF6]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD4B-\uDFFF]|\uD83B[\uDC00-\uDEBB])/),Eo.test(e)}const Mo=/^[\t\n\r\x20-\x7E]*$/;function To(e){return Mo.test(e)}const Ro=/[\u2028\u2029]/;function Ao(e){return Ro.test(e)}function Oo(e){return e>=11904&&e<=55215||e>=63744&&e<=64255||e>=65281&&e<=65374}function Po(e){return e>=127462&&e<=127487||8986===e||8987===e||9200===e||9203===e||e>=9728&&e<=10175||11088===e||11093===e||e>=127744&&e<=128591||e>=128640&&e<=128764||e>=128992&&e<=129008||e>=129280&&e<=129535||e>=129648&&e<=129782}const Fo=String.fromCharCode(65279);function Bo(e){return!!(e&&e.length>0&&65279===e.charCodeAt(0))}function Wo(e){return(e%=52)<26?String.fromCharCode(97+e):String.fromCharCode(65+e-26)}function Vo(e,t){return 0===e?5!==t&&7!==t:(2!==e||3!==t)&&(4===e||2===e||3===e||(4===t||2===t||3===t||(8!==e||8!==t&&9!==t&&11!==t&&12!==t)&&((11!==e&&9!==e||9!==t&&10!==t)&&((12!==e&&10!==e||10!==t)&&(5!==t&&13!==t&&(7!==t&&(1!==e&&((13!==e||14!==t)&&(6!==e||6!==t)))))))))}class Ho{static getInstance(){return Ho._INSTANCE||(Ho._INSTANCE=new Ho),Ho._INSTANCE}constructor(){this._data=JSON.parse("[0,0,0,51229,51255,12,44061,44087,12,127462,127487,6,7083,7085,5,47645,47671,12,54813,54839,12,128678,128678,14,3270,3270,5,9919,9923,14,45853,45879,12,49437,49463,12,53021,53047,12,71216,71218,7,128398,128399,14,129360,129374,14,2519,2519,5,4448,4519,9,9742,9742,14,12336,12336,14,44957,44983,12,46749,46775,12,48541,48567,12,50333,50359,12,52125,52151,12,53917,53943,12,69888,69890,5,73018,73018,5,127990,127990,14,128558,128559,14,128759,128760,14,129653,129655,14,2027,2035,5,2891,2892,7,3761,3761,5,6683,6683,5,8293,8293,4,9825,9826,14,9999,9999,14,43452,43453,5,44509,44535,12,45405,45431,12,46301,46327,12,47197,47223,12,48093,48119,12,48989,49015,12,49885,49911,12,50781,50807,12,51677,51703,12,52573,52599,12,53469,53495,12,54365,54391,12,65279,65279,4,70471,70472,7,72145,72147,7,119173,119179,5,127799,127818,14,128240,128244,14,128512,128512,14,128652,128652,14,128721,128722,14,129292,129292,14,129445,129450,14,129734,129743,14,1476,1477,5,2366,2368,7,2750,2752,7,3076,3076,5,3415,3415,5,4141,4144,5,6109,6109,5,6964,6964,5,7394,7400,5,9197,9198,14,9770,9770,14,9877,9877,14,9968,9969,14,10084,10084,14,43052,43052,5,43713,43713,5,44285,44311,12,44733,44759,12,45181,45207,12,45629,45655,12,46077,46103,12,46525,46551,12,46973,46999,12,47421,47447,12,47869,47895,12,48317,48343,12,48765,48791,12,49213,49239,12,49661,49687,12,50109,50135,12,50557,50583,12,51005,51031,12,51453,51479,12,51901,51927,12,52349,52375,12,52797,52823,12,53245,53271,12,53693,53719,12,54141,54167,12,54589,54615,12,55037,55063,12,69506,69509,5,70191,70193,5,70841,70841,7,71463,71467,5,72330,72342,5,94031,94031,5,123628,123631,5,127763,127765,14,127941,127941,14,128043,128062,14,128302,128317,14,128465,128467,14,128539,128539,14,128640,128640,14,128662,128662,14,128703,128703,14,128745,128745,14,129004,129007,14,129329,129330,14,129402,129402,14,129483,129483,14,129686,129704,14,130048,131069,14,173,173,4,1757,1757,1,2200,2207,5,2434,2435,7,2631,2632,5,2817,2817,5,3008,3008,5,3201,3201,5,3387,3388,5,3542,3542,5,3902,3903,7,4190,4192,5,6002,6003,5,6439,6440,5,6765,6770,7,7019,7027,5,7154,7155,7,8205,8205,13,8505,8505,14,9654,9654,14,9757,9757,14,9792,9792,14,9852,9853,14,9890,9894,14,9937,9937,14,9981,9981,14,10035,10036,14,11035,11036,14,42654,42655,5,43346,43347,7,43587,43587,5,44006,44007,7,44173,44199,12,44397,44423,12,44621,44647,12,44845,44871,12,45069,45095,12,45293,45319,12,45517,45543,12,45741,45767,12,45965,45991,12,46189,46215,12,46413,46439,12,46637,46663,12,46861,46887,12,47085,47111,12,47309,47335,12,47533,47559,12,47757,47783,12,47981,48007,12,48205,48231,12,48429,48455,12,48653,48679,12,48877,48903,12,49101,49127,12,49325,49351,12,49549,49575,12,49773,49799,12,49997,50023,12,50221,50247,12,50445,50471,12,50669,50695,12,50893,50919,12,51117,51143,12,51341,51367,12,51565,51591,12,51789,51815,12,52013,52039,12,52237,52263,12,52461,52487,12,52685,52711,12,52909,52935,12,53133,53159,12,53357,53383,12,53581,53607,12,53805,53831,12,54029,54055,12,54253,54279,12,54477,54503,12,54701,54727,12,54925,54951,12,55149,55175,12,68101,68102,5,69762,69762,7,70067,70069,7,70371,70378,5,70720,70721,7,71087,71087,5,71341,71341,5,71995,71996,5,72249,72249,7,72850,72871,5,73109,73109,5,118576,118598,5,121505,121519,5,127245,127247,14,127568,127569,14,127777,127777,14,127872,127891,14,127956,127967,14,128015,128016,14,128110,128172,14,128259,128259,14,128367,128368,14,128424,128424,14,128488,128488,14,128530,128532,14,128550,128551,14,128566,128566,14,128647,128647,14,128656,128656,14,128667,128673,14,128691,128693,14,128715,128715,14,128728,128732,14,128752,128752,14,128765,128767,14,129096,129103,14,129311,129311,14,129344,129349,14,129394,129394,14,129413,129425,14,129466,129471,14,129511,129535,14,129664,129666,14,129719,129722,14,129760,129767,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2307,2307,7,2382,2383,7,2497,2500,5,2563,2563,7,2677,2677,5,2763,2764,7,2879,2879,5,2914,2915,5,3021,3021,5,3142,3144,5,3263,3263,5,3285,3286,5,3398,3400,7,3530,3530,5,3633,3633,5,3864,3865,5,3974,3975,5,4155,4156,7,4229,4230,5,5909,5909,7,6078,6085,7,6277,6278,5,6451,6456,7,6744,6750,5,6846,6846,5,6972,6972,5,7074,7077,5,7146,7148,7,7222,7223,5,7416,7417,5,8234,8238,4,8417,8417,5,9000,9000,14,9203,9203,14,9730,9731,14,9748,9749,14,9762,9763,14,9776,9783,14,9800,9811,14,9831,9831,14,9872,9873,14,9882,9882,14,9900,9903,14,9929,9933,14,9941,9960,14,9974,9974,14,9989,9989,14,10006,10006,14,10062,10062,14,10160,10160,14,11647,11647,5,12953,12953,14,43019,43019,5,43232,43249,5,43443,43443,5,43567,43568,7,43696,43696,5,43765,43765,7,44013,44013,5,44117,44143,12,44229,44255,12,44341,44367,12,44453,44479,12,44565,44591,12,44677,44703,12,44789,44815,12,44901,44927,12,45013,45039,12,45125,45151,12,45237,45263,12,45349,45375,12,45461,45487,12,45573,45599,12,45685,45711,12,45797,45823,12,45909,45935,12,46021,46047,12,46133,46159,12,46245,46271,12,46357,46383,12,46469,46495,12,46581,46607,12,46693,46719,12,46805,46831,12,46917,46943,12,47029,47055,12,47141,47167,12,47253,47279,12,47365,47391,12,47477,47503,12,47589,47615,12,47701,47727,12,47813,47839,12,47925,47951,12,48037,48063,12,48149,48175,12,48261,48287,12,48373,48399,12,48485,48511,12,48597,48623,12,48709,48735,12,48821,48847,12,48933,48959,12,49045,49071,12,49157,49183,12,49269,49295,12,49381,49407,12,49493,49519,12,49605,49631,12,49717,49743,12,49829,49855,12,49941,49967,12,50053,50079,12,50165,50191,12,50277,50303,12,50389,50415,12,50501,50527,12,50613,50639,12,50725,50751,12,50837,50863,12,50949,50975,12,51061,51087,12,51173,51199,12,51285,51311,12,51397,51423,12,51509,51535,12,51621,51647,12,51733,51759,12,51845,51871,12,51957,51983,12,52069,52095,12,52181,52207,12,52293,52319,12,52405,52431,12,52517,52543,12,52629,52655,12,52741,52767,12,52853,52879,12,52965,52991,12,53077,53103,12,53189,53215,12,53301,53327,12,53413,53439,12,53525,53551,12,53637,53663,12,53749,53775,12,53861,53887,12,53973,53999,12,54085,54111,12,54197,54223,12,54309,54335,12,54421,54447,12,54533,54559,12,54645,54671,12,54757,54783,12,54869,54895,12,54981,55007,12,55093,55119,12,55243,55291,10,66045,66045,5,68325,68326,5,69688,69702,5,69817,69818,5,69957,69958,7,70089,70092,5,70198,70199,5,70462,70462,5,70502,70508,5,70750,70750,5,70846,70846,7,71100,71101,5,71230,71230,7,71351,71351,5,71737,71738,5,72000,72000,7,72160,72160,5,72273,72278,5,72752,72758,5,72882,72883,5,73031,73031,5,73461,73462,7,94192,94193,7,119149,119149,7,121403,121452,5,122915,122916,5,126980,126980,14,127358,127359,14,127535,127535,14,127759,127759,14,127771,127771,14,127792,127793,14,127825,127867,14,127897,127899,14,127945,127945,14,127985,127986,14,128000,128007,14,128021,128021,14,128066,128100,14,128184,128235,14,128249,128252,14,128266,128276,14,128335,128335,14,128379,128390,14,128407,128419,14,128444,128444,14,128481,128481,14,128499,128499,14,128526,128526,14,128536,128536,14,128543,128543,14,128556,128556,14,128564,128564,14,128577,128580,14,128643,128645,14,128649,128649,14,128654,128654,14,128660,128660,14,128664,128664,14,128675,128675,14,128686,128689,14,128695,128696,14,128705,128709,14,128717,128719,14,128725,128725,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129009,129023,14,129160,129167,14,129296,129304,14,129320,129327,14,129340,129342,14,129356,129356,14,129388,129392,14,129399,129400,14,129404,129407,14,129432,129442,14,129454,129455,14,129473,129474,14,129485,129487,14,129648,129651,14,129659,129660,14,129671,129679,14,129709,129711,14,129728,129730,14,129751,129753,14,129776,129782,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2274,2274,1,2363,2363,7,2377,2380,7,2402,2403,5,2494,2494,5,2507,2508,7,2558,2558,5,2622,2624,7,2641,2641,5,2691,2691,7,2759,2760,5,2786,2787,5,2876,2876,5,2881,2884,5,2901,2902,5,3006,3006,5,3014,3016,7,3072,3072,5,3134,3136,5,3157,3158,5,3260,3260,5,3266,3266,5,3274,3275,7,3328,3329,5,3391,3392,7,3405,3405,5,3457,3457,5,3536,3537,7,3551,3551,5,3636,3642,5,3764,3772,5,3895,3895,5,3967,3967,7,3993,4028,5,4146,4151,5,4182,4183,7,4226,4226,5,4253,4253,5,4957,4959,5,5940,5940,7,6070,6070,7,6087,6088,7,6158,6158,4,6432,6434,5,6448,6449,7,6679,6680,5,6742,6742,5,6754,6754,5,6783,6783,5,6912,6915,5,6966,6970,5,6978,6978,5,7042,7042,7,7080,7081,5,7143,7143,7,7150,7150,7,7212,7219,5,7380,7392,5,7412,7412,5,8203,8203,4,8232,8232,4,8265,8265,14,8400,8412,5,8421,8432,5,8617,8618,14,9167,9167,14,9200,9200,14,9410,9410,14,9723,9726,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9774,14,9786,9786,14,9794,9794,14,9823,9823,14,9828,9828,14,9833,9850,14,9855,9855,14,9875,9875,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9935,9935,14,9939,9939,14,9962,9962,14,9972,9972,14,9978,9978,14,9986,9986,14,9997,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10133,10135,14,10548,10549,14,11093,11093,14,12330,12333,5,12441,12442,5,42608,42610,5,43010,43010,5,43045,43046,5,43188,43203,7,43302,43309,5,43392,43394,5,43446,43449,5,43493,43493,5,43571,43572,7,43597,43597,7,43703,43704,5,43756,43757,5,44003,44004,7,44009,44010,7,44033,44059,12,44089,44115,12,44145,44171,12,44201,44227,12,44257,44283,12,44313,44339,12,44369,44395,12,44425,44451,12,44481,44507,12,44537,44563,12,44593,44619,12,44649,44675,12,44705,44731,12,44761,44787,12,44817,44843,12,44873,44899,12,44929,44955,12,44985,45011,12,45041,45067,12,45097,45123,12,45153,45179,12,45209,45235,12,45265,45291,12,45321,45347,12,45377,45403,12,45433,45459,12,45489,45515,12,45545,45571,12,45601,45627,12,45657,45683,12,45713,45739,12,45769,45795,12,45825,45851,12,45881,45907,12,45937,45963,12,45993,46019,12,46049,46075,12,46105,46131,12,46161,46187,12,46217,46243,12,46273,46299,12,46329,46355,12,46385,46411,12,46441,46467,12,46497,46523,12,46553,46579,12,46609,46635,12,46665,46691,12,46721,46747,12,46777,46803,12,46833,46859,12,46889,46915,12,46945,46971,12,47001,47027,12,47057,47083,12,47113,47139,12,47169,47195,12,47225,47251,12,47281,47307,12,47337,47363,12,47393,47419,12,47449,47475,12,47505,47531,12,47561,47587,12,47617,47643,12,47673,47699,12,47729,47755,12,47785,47811,12,47841,47867,12,47897,47923,12,47953,47979,12,48009,48035,12,48065,48091,12,48121,48147,12,48177,48203,12,48233,48259,12,48289,48315,12,48345,48371,12,48401,48427,12,48457,48483,12,48513,48539,12,48569,48595,12,48625,48651,12,48681,48707,12,48737,48763,12,48793,48819,12,48849,48875,12,48905,48931,12,48961,48987,12,49017,49043,12,49073,49099,12,49129,49155,12,49185,49211,12,49241,49267,12,49297,49323,12,49353,49379,12,49409,49435,12,49465,49491,12,49521,49547,12,49577,49603,12,49633,49659,12,49689,49715,12,49745,49771,12,49801,49827,12,49857,49883,12,49913,49939,12,49969,49995,12,50025,50051,12,50081,50107,12,50137,50163,12,50193,50219,12,50249,50275,12,50305,50331,12,50361,50387,12,50417,50443,12,50473,50499,12,50529,50555,12,50585,50611,12,50641,50667,12,50697,50723,12,50753,50779,12,50809,50835,12,50865,50891,12,50921,50947,12,50977,51003,12,51033,51059,12,51089,51115,12,51145,51171,12,51201,51227,12,51257,51283,12,51313,51339,12,51369,51395,12,51425,51451,12,51481,51507,12,51537,51563,12,51593,51619,12,51649,51675,12,51705,51731,12,51761,51787,12,51817,51843,12,51873,51899,12,51929,51955,12,51985,52011,12,52041,52067,12,52097,52123,12,52153,52179,12,52209,52235,12,52265,52291,12,52321,52347,12,52377,52403,12,52433,52459,12,52489,52515,12,52545,52571,12,52601,52627,12,52657,52683,12,52713,52739,12,52769,52795,12,52825,52851,12,52881,52907,12,52937,52963,12,52993,53019,12,53049,53075,12,53105,53131,12,53161,53187,12,53217,53243,12,53273,53299,12,53329,53355,12,53385,53411,12,53441,53467,12,53497,53523,12,53553,53579,12,53609,53635,12,53665,53691,12,53721,53747,12,53777,53803,12,53833,53859,12,53889,53915,12,53945,53971,12,54001,54027,12,54057,54083,12,54113,54139,12,54169,54195,12,54225,54251,12,54281,54307,12,54337,54363,12,54393,54419,12,54449,54475,12,54505,54531,12,54561,54587,12,54617,54643,12,54673,54699,12,54729,54755,12,54785,54811,12,54841,54867,12,54897,54923,12,54953,54979,12,55009,55035,12,55065,55091,12,55121,55147,12,55177,55203,12,65024,65039,5,65520,65528,4,66422,66426,5,68152,68154,5,69291,69292,5,69633,69633,5,69747,69748,5,69811,69814,5,69826,69826,5,69932,69932,7,70016,70017,5,70079,70080,7,70095,70095,5,70196,70196,5,70367,70367,5,70402,70403,7,70464,70464,5,70487,70487,5,70709,70711,7,70725,70725,7,70833,70834,7,70843,70844,7,70849,70849,7,71090,71093,5,71103,71104,5,71227,71228,7,71339,71339,5,71344,71349,5,71458,71461,5,71727,71735,5,71985,71989,7,71998,71998,5,72002,72002,7,72154,72155,5,72193,72202,5,72251,72254,5,72281,72283,5,72344,72345,5,72766,72766,7,72874,72880,5,72885,72886,5,73023,73029,5,73104,73105,5,73111,73111,5,92912,92916,5,94095,94098,5,113824,113827,4,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,125252,125258,5,127183,127183,14,127340,127343,14,127377,127386,14,127491,127503,14,127548,127551,14,127744,127756,14,127761,127761,14,127769,127769,14,127773,127774,14,127780,127788,14,127796,127797,14,127820,127823,14,127869,127869,14,127894,127895,14,127902,127903,14,127943,127943,14,127947,127950,14,127972,127972,14,127988,127988,14,127992,127994,14,128009,128011,14,128019,128019,14,128023,128041,14,128064,128064,14,128102,128107,14,128174,128181,14,128238,128238,14,128246,128247,14,128254,128254,14,128264,128264,14,128278,128299,14,128329,128330,14,128348,128359,14,128371,128377,14,128392,128393,14,128401,128404,14,128421,128421,14,128433,128434,14,128450,128452,14,128476,128478,14,128483,128483,14,128495,128495,14,128506,128506,14,128519,128520,14,128528,128528,14,128534,128534,14,128538,128538,14,128540,128542,14,128544,128549,14,128552,128555,14,128557,128557,14,128560,128563,14,128565,128565,14,128567,128576,14,128581,128591,14,128641,128642,14,128646,128646,14,128648,128648,14,128650,128651,14,128653,128653,14,128655,128655,14,128657,128659,14,128661,128661,14,128663,128663,14,128665,128666,14,128674,128674,14,128676,128677,14,128679,128685,14,128690,128690,14,128694,128694,14,128697,128702,14,128704,128704,14,128710,128714,14,128716,128716,14,128720,128720,14,128723,128724,14,128726,128727,14,128733,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129008,129008,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129661,129663,14,129667,129670,14,129680,129685,14,129705,129708,14,129712,129718,14,129723,129727,14,129731,129733,14,129744,129750,14,129754,129759,14,129768,129775,14,129783,129791,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2192,2193,1,2250,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3132,3132,5,3137,3140,7,3146,3149,5,3170,3171,5,3202,3203,7,3262,3262,7,3264,3265,7,3267,3268,7,3271,3272,7,3276,3277,5,3298,3299,5,3330,3331,7,3390,3390,5,3393,3396,5,3402,3404,7,3406,3406,1,3426,3427,5,3458,3459,7,3535,3535,5,3538,3540,5,3544,3550,7,3570,3571,7,3635,3635,7,3655,3662,5,3763,3763,7,3784,3789,5,3893,3893,5,3897,3897,5,3953,3966,5,3968,3972,5,3981,3991,5,4038,4038,5,4145,4145,7,4153,4154,5,4157,4158,5,4184,4185,5,4209,4212,5,4228,4228,7,4237,4237,5,4352,4447,8,4520,4607,10,5906,5908,5,5938,5939,5,5970,5971,5,6068,6069,5,6071,6077,5,6086,6086,5,6089,6099,5,6155,6157,5,6159,6159,5,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6862,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7679,5,8204,8204,5,8206,8207,4,8233,8233,4,8252,8252,14,8288,8292,4,8294,8303,4,8413,8416,5,8418,8420,5,8482,8482,14,8596,8601,14,8986,8987,14,9096,9096,14,9193,9196,14,9199,9199,14,9201,9202,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9729,14,9732,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9775,9775,14,9784,9785,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9874,14,9876,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9934,14,9936,9936,14,9938,9938,14,9940,9940,14,9961,9961,14,9963,9967,14,9970,9971,14,9973,9973,14,9975,9977,14,9979,9980,14,9982,9985,14,9987,9988,14,9992,9996,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10083,14,10085,10087,14,10145,10145,14,10175,10175,14,11013,11015,14,11088,11088,14,11503,11505,5,11744,11775,5,12334,12335,5,12349,12349,14,12951,12951,14,42607,42607,5,42612,42621,5,42736,42737,5,43014,43014,5,43043,43044,7,43047,43047,7,43136,43137,7,43204,43205,5,43263,43263,5,43335,43345,5,43360,43388,8,43395,43395,7,43444,43445,7,43450,43451,7,43454,43456,7,43561,43566,5,43569,43570,5,43573,43574,5,43596,43596,5,43644,43644,5,43698,43700,5,43710,43711,5,43755,43755,7,43758,43759,7,43766,43766,5,44005,44005,5,44008,44008,5,44012,44012,7,44032,44032,11,44060,44060,11,44088,44088,11,44116,44116,11,44144,44144,11,44172,44172,11,44200,44200,11,44228,44228,11,44256,44256,11,44284,44284,11,44312,44312,11,44340,44340,11,44368,44368,11,44396,44396,11,44424,44424,11,44452,44452,11,44480,44480,11,44508,44508,11,44536,44536,11,44564,44564,11,44592,44592,11,44620,44620,11,44648,44648,11,44676,44676,11,44704,44704,11,44732,44732,11,44760,44760,11,44788,44788,11,44816,44816,11,44844,44844,11,44872,44872,11,44900,44900,11,44928,44928,11,44956,44956,11,44984,44984,11,45012,45012,11,45040,45040,11,45068,45068,11,45096,45096,11,45124,45124,11,45152,45152,11,45180,45180,11,45208,45208,11,45236,45236,11,45264,45264,11,45292,45292,11,45320,45320,11,45348,45348,11,45376,45376,11,45404,45404,11,45432,45432,11,45460,45460,11,45488,45488,11,45516,45516,11,45544,45544,11,45572,45572,11,45600,45600,11,45628,45628,11,45656,45656,11,45684,45684,11,45712,45712,11,45740,45740,11,45768,45768,11,45796,45796,11,45824,45824,11,45852,45852,11,45880,45880,11,45908,45908,11,45936,45936,11,45964,45964,11,45992,45992,11,46020,46020,11,46048,46048,11,46076,46076,11,46104,46104,11,46132,46132,11,46160,46160,11,46188,46188,11,46216,46216,11,46244,46244,11,46272,46272,11,46300,46300,11,46328,46328,11,46356,46356,11,46384,46384,11,46412,46412,11,46440,46440,11,46468,46468,11,46496,46496,11,46524,46524,11,46552,46552,11,46580,46580,11,46608,46608,11,46636,46636,11,46664,46664,11,46692,46692,11,46720,46720,11,46748,46748,11,46776,46776,11,46804,46804,11,46832,46832,11,46860,46860,11,46888,46888,11,46916,46916,11,46944,46944,11,46972,46972,11,47000,47000,11,47028,47028,11,47056,47056,11,47084,47084,11,47112,47112,11,47140,47140,11,47168,47168,11,47196,47196,11,47224,47224,11,47252,47252,11,47280,47280,11,47308,47308,11,47336,47336,11,47364,47364,11,47392,47392,11,47420,47420,11,47448,47448,11,47476,47476,11,47504,47504,11,47532,47532,11,47560,47560,11,47588,47588,11,47616,47616,11,47644,47644,11,47672,47672,11,47700,47700,11,47728,47728,11,47756,47756,11,47784,47784,11,47812,47812,11,47840,47840,11,47868,47868,11,47896,47896,11,47924,47924,11,47952,47952,11,47980,47980,11,48008,48008,11,48036,48036,11,48064,48064,11,48092,48092,11,48120,48120,11,48148,48148,11,48176,48176,11,48204,48204,11,48232,48232,11,48260,48260,11,48288,48288,11,48316,48316,11,48344,48344,11,48372,48372,11,48400,48400,11,48428,48428,11,48456,48456,11,48484,48484,11,48512,48512,11,48540,48540,11,48568,48568,11,48596,48596,11,48624,48624,11,48652,48652,11,48680,48680,11,48708,48708,11,48736,48736,11,48764,48764,11,48792,48792,11,48820,48820,11,48848,48848,11,48876,48876,11,48904,48904,11,48932,48932,11,48960,48960,11,48988,48988,11,49016,49016,11,49044,49044,11,49072,49072,11,49100,49100,11,49128,49128,11,49156,49156,11,49184,49184,11,49212,49212,11,49240,49240,11,49268,49268,11,49296,49296,11,49324,49324,11,49352,49352,11,49380,49380,11,49408,49408,11,49436,49436,11,49464,49464,11,49492,49492,11,49520,49520,11,49548,49548,11,49576,49576,11,49604,49604,11,49632,49632,11,49660,49660,11,49688,49688,11,49716,49716,11,49744,49744,11,49772,49772,11,49800,49800,11,49828,49828,11,49856,49856,11,49884,49884,11,49912,49912,11,49940,49940,11,49968,49968,11,49996,49996,11,50024,50024,11,50052,50052,11,50080,50080,11,50108,50108,11,50136,50136,11,50164,50164,11,50192,50192,11,50220,50220,11,50248,50248,11,50276,50276,11,50304,50304,11,50332,50332,11,50360,50360,11,50388,50388,11,50416,50416,11,50444,50444,11,50472,50472,11,50500,50500,11,50528,50528,11,50556,50556,11,50584,50584,11,50612,50612,11,50640,50640,11,50668,50668,11,50696,50696,11,50724,50724,11,50752,50752,11,50780,50780,11,50808,50808,11,50836,50836,11,50864,50864,11,50892,50892,11,50920,50920,11,50948,50948,11,50976,50976,11,51004,51004,11,51032,51032,11,51060,51060,11,51088,51088,11,51116,51116,11,51144,51144,11,51172,51172,11,51200,51200,11,51228,51228,11,51256,51256,11,51284,51284,11,51312,51312,11,51340,51340,11,51368,51368,11,51396,51396,11,51424,51424,11,51452,51452,11,51480,51480,11,51508,51508,11,51536,51536,11,51564,51564,11,51592,51592,11,51620,51620,11,51648,51648,11,51676,51676,11,51704,51704,11,51732,51732,11,51760,51760,11,51788,51788,11,51816,51816,11,51844,51844,11,51872,51872,11,51900,51900,11,51928,51928,11,51956,51956,11,51984,51984,11,52012,52012,11,52040,52040,11,52068,52068,11,52096,52096,11,52124,52124,11,52152,52152,11,52180,52180,11,52208,52208,11,52236,52236,11,52264,52264,11,52292,52292,11,52320,52320,11,52348,52348,11,52376,52376,11,52404,52404,11,52432,52432,11,52460,52460,11,52488,52488,11,52516,52516,11,52544,52544,11,52572,52572,11,52600,52600,11,52628,52628,11,52656,52656,11,52684,52684,11,52712,52712,11,52740,52740,11,52768,52768,11,52796,52796,11,52824,52824,11,52852,52852,11,52880,52880,11,52908,52908,11,52936,52936,11,52964,52964,11,52992,52992,11,53020,53020,11,53048,53048,11,53076,53076,11,53104,53104,11,53132,53132,11,53160,53160,11,53188,53188,11,53216,53216,11,53244,53244,11,53272,53272,11,53300,53300,11,53328,53328,11,53356,53356,11,53384,53384,11,53412,53412,11,53440,53440,11,53468,53468,11,53496,53496,11,53524,53524,11,53552,53552,11,53580,53580,11,53608,53608,11,53636,53636,11,53664,53664,11,53692,53692,11,53720,53720,11,53748,53748,11,53776,53776,11,53804,53804,11,53832,53832,11,53860,53860,11,53888,53888,11,53916,53916,11,53944,53944,11,53972,53972,11,54000,54000,11,54028,54028,11,54056,54056,11,54084,54084,11,54112,54112,11,54140,54140,11,54168,54168,11,54196,54196,11,54224,54224,11,54252,54252,11,54280,54280,11,54308,54308,11,54336,54336,11,54364,54364,11,54392,54392,11,54420,54420,11,54448,54448,11,54476,54476,11,54504,54504,11,54532,54532,11,54560,54560,11,54588,54588,11,54616,54616,11,54644,54644,11,54672,54672,11,54700,54700,11,54728,54728,11,54756,54756,11,54784,54784,11,54812,54812,11,54840,54840,11,54868,54868,11,54896,54896,11,54924,54924,11,54952,54952,11,54980,54980,11,55008,55008,11,55036,55036,11,55064,55064,11,55092,55092,11,55120,55120,11,55148,55148,11,55176,55176,11,55216,55238,9,64286,64286,5,65056,65071,5,65438,65439,5,65529,65531,4,66272,66272,5,68097,68099,5,68108,68111,5,68159,68159,5,68900,68903,5,69446,69456,5,69632,69632,7,69634,69634,7,69744,69744,5,69759,69761,5,69808,69810,7,69815,69816,7,69821,69821,1,69837,69837,1,69927,69931,5,69933,69940,5,70003,70003,5,70018,70018,7,70070,70078,5,70082,70083,1,70094,70094,7,70188,70190,7,70194,70195,7,70197,70197,7,70206,70206,5,70368,70370,7,70400,70401,5,70459,70460,5,70463,70463,7,70465,70468,7,70475,70477,7,70498,70499,7,70512,70516,5,70712,70719,5,70722,70724,5,70726,70726,5,70832,70832,5,70835,70840,5,70842,70842,5,70845,70845,5,70847,70848,5,70850,70851,5,71088,71089,7,71096,71099,7,71102,71102,7,71132,71133,5,71219,71226,5,71229,71229,5,71231,71232,5,71340,71340,7,71342,71343,7,71350,71350,7,71453,71455,5,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,118528,118573,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123566,123566,5,125136,125142,5,126976,126979,14,126981,127182,14,127184,127231,14,127279,127279,14,127344,127345,14,127374,127374,14,127405,127461,14,127489,127490,14,127514,127514,14,127538,127546,14,127561,127567,14,127570,127743,14,127757,127758,14,127760,127760,14,127762,127762,14,127766,127768,14,127770,127770,14,127772,127772,14,127775,127776,14,127778,127779,14,127789,127791,14,127794,127795,14,127798,127798,14,127819,127819,14,127824,127824,14,127868,127868,14,127870,127871,14,127892,127893,14,127896,127896,14,127900,127901,14,127904,127940,14,127942,127942,14,127944,127944,14,127946,127946,14,127951,127955,14,127968,127971,14,127973,127984,14,127987,127987,14,127989,127989,14,127991,127991,14,127995,127999,5,128008,128008,14,128012,128014,14,128017,128018,14,128020,128020,14,128022,128022,14,128042,128042,14,128063,128063,14,128065,128065,14,128101,128101,14,128108,128109,14,128173,128173,14,128182,128183,14,128236,128237,14,128239,128239,14,128245,128245,14,128248,128248,14,128253,128253,14,128255,128258,14,128260,128263,14,128265,128265,14,128277,128277,14,128300,128301,14,128326,128328,14,128331,128334,14,128336,128347,14,128360,128366,14,128369,128370,14,128378,128378,14,128391,128391,14,128394,128397,14,128400,128400,14,128405,128406,14,128420,128420,14,128422,128423,14,128425,128432,14,128435,128443,14,128445,128449,14,128453,128464,14,128468,128475,14,128479,128480,14,128482,128482,14,128484,128487,14,128489,128494,14,128496,128498,14,128500,128505,14,128507,128511,14,128513,128518,14,128521,128525,14,128527,128527,14,128529,128529,14,128533,128533,14,128535,128535,14,128537,128537,14]")}getGraphemeBreakType(e){if(e<32)return 10===e?3:13===e?2:4;if(e<127)return 0;const t=this._data,i=t.length/3;let n=1;for(;n<=i;)if(et[3*n+1]))return t[3*n+2];n=2*n+1}return 0}}function zo(e,t){if(0===e)return 0;const i=function(e,t){const i=new ko(t,e);let n=i.prevCodePoint();for(;Uo(n)||65039===n||8419===n;){if(0===i.offset)return;n=i.prevCodePoint()}if(!Po(n))return;let s=i.offset;if(s>0){8205===i.prevCodePoint()&&(s=i.offset)}return s}(e,t);if(void 0!==i)return i;const n=new ko(t,e);return n.prevCodePoint(),n.offset}function Uo(e){return 127995<=e&&e<=127999}Ho._INSTANCE=null;class Ko{static getInstance(e){return Hs.cache.get(Array.from(e))}static getLocales(){return Hs._locales.value}constructor(e){this.confusableDictionary=e}isAmbiguous(e){return this.confusableDictionary.has(e)}getPrimaryConfusable(e){return this.confusableDictionary.get(e)}getConfusableCodePoints(){return new Set(this.confusableDictionary.keys())}}Hs=Ko,Ko.ambiguousCharacterData=new Zs((()=>JSON.parse('{"_common":[8232,32,8233,32,5760,32,8192,32,8193,32,8194,32,8195,32,8196,32,8197,32,8198,32,8200,32,8201,32,8202,32,8287,32,8199,32,8239,32,2042,95,65101,95,65102,95,65103,95,8208,45,8209,45,8210,45,65112,45,1748,45,8259,45,727,45,8722,45,10134,45,11450,45,1549,44,1643,44,8218,44,184,44,42233,44,894,59,2307,58,2691,58,1417,58,1795,58,1796,58,5868,58,65072,58,6147,58,6153,58,8282,58,1475,58,760,58,42889,58,8758,58,720,58,42237,58,451,33,11601,33,660,63,577,63,2429,63,5038,63,42731,63,119149,46,8228,46,1793,46,1794,46,42510,46,68176,46,1632,46,1776,46,42232,46,1373,96,65287,96,8219,96,8242,96,1370,96,1523,96,8175,96,65344,96,900,96,8189,96,8125,96,8127,96,8190,96,697,96,884,96,712,96,714,96,715,96,756,96,699,96,701,96,700,96,702,96,42892,96,1497,96,2036,96,2037,96,5194,96,5836,96,94033,96,94034,96,65339,91,10088,40,10098,40,12308,40,64830,40,65341,93,10089,41,10099,41,12309,41,64831,41,10100,123,119060,123,10101,125,65342,94,8270,42,1645,42,8727,42,66335,42,5941,47,8257,47,8725,47,8260,47,9585,47,10187,47,10744,47,119354,47,12755,47,12339,47,11462,47,20031,47,12035,47,65340,92,65128,92,8726,92,10189,92,10741,92,10745,92,119311,92,119355,92,12756,92,20022,92,12034,92,42872,38,708,94,710,94,5869,43,10133,43,66203,43,8249,60,10094,60,706,60,119350,60,5176,60,5810,60,5120,61,11840,61,12448,61,42239,61,8250,62,10095,62,707,62,119351,62,5171,62,94015,62,8275,126,732,126,8128,126,8764,126,65372,124,65293,45,120784,50,120794,50,120804,50,120814,50,120824,50,130034,50,42842,50,423,50,1000,50,42564,50,5311,50,42735,50,119302,51,120785,51,120795,51,120805,51,120815,51,120825,51,130035,51,42923,51,540,51,439,51,42858,51,11468,51,1248,51,94011,51,71882,51,120786,52,120796,52,120806,52,120816,52,120826,52,130036,52,5070,52,71855,52,120787,53,120797,53,120807,53,120817,53,120827,53,130037,53,444,53,71867,53,120788,54,120798,54,120808,54,120818,54,120828,54,130038,54,11474,54,5102,54,71893,54,119314,55,120789,55,120799,55,120809,55,120819,55,120829,55,130039,55,66770,55,71878,55,2819,56,2538,56,2666,56,125131,56,120790,56,120800,56,120810,56,120820,56,120830,56,130040,56,547,56,546,56,66330,56,2663,57,2920,57,2541,57,3437,57,120791,57,120801,57,120811,57,120821,57,120831,57,130041,57,42862,57,11466,57,71884,57,71852,57,71894,57,9082,97,65345,97,119834,97,119886,97,119938,97,119990,97,120042,97,120094,97,120146,97,120198,97,120250,97,120302,97,120354,97,120406,97,120458,97,593,97,945,97,120514,97,120572,97,120630,97,120688,97,120746,97,65313,65,119808,65,119860,65,119912,65,119964,65,120016,65,120068,65,120120,65,120172,65,120224,65,120276,65,120328,65,120380,65,120432,65,913,65,120488,65,120546,65,120604,65,120662,65,120720,65,5034,65,5573,65,42222,65,94016,65,66208,65,119835,98,119887,98,119939,98,119991,98,120043,98,120095,98,120147,98,120199,98,120251,98,120303,98,120355,98,120407,98,120459,98,388,98,5071,98,5234,98,5551,98,65314,66,8492,66,119809,66,119861,66,119913,66,120017,66,120069,66,120121,66,120173,66,120225,66,120277,66,120329,66,120381,66,120433,66,42932,66,914,66,120489,66,120547,66,120605,66,120663,66,120721,66,5108,66,5623,66,42192,66,66178,66,66209,66,66305,66,65347,99,8573,99,119836,99,119888,99,119940,99,119992,99,120044,99,120096,99,120148,99,120200,99,120252,99,120304,99,120356,99,120408,99,120460,99,7428,99,1010,99,11429,99,43951,99,66621,99,128844,67,71922,67,71913,67,65315,67,8557,67,8450,67,8493,67,119810,67,119862,67,119914,67,119966,67,120018,67,120174,67,120226,67,120278,67,120330,67,120382,67,120434,67,1017,67,11428,67,5087,67,42202,67,66210,67,66306,67,66581,67,66844,67,8574,100,8518,100,119837,100,119889,100,119941,100,119993,100,120045,100,120097,100,120149,100,120201,100,120253,100,120305,100,120357,100,120409,100,120461,100,1281,100,5095,100,5231,100,42194,100,8558,68,8517,68,119811,68,119863,68,119915,68,119967,68,120019,68,120071,68,120123,68,120175,68,120227,68,120279,68,120331,68,120383,68,120435,68,5024,68,5598,68,5610,68,42195,68,8494,101,65349,101,8495,101,8519,101,119838,101,119890,101,119942,101,120046,101,120098,101,120150,101,120202,101,120254,101,120306,101,120358,101,120410,101,120462,101,43826,101,1213,101,8959,69,65317,69,8496,69,119812,69,119864,69,119916,69,120020,69,120072,69,120124,69,120176,69,120228,69,120280,69,120332,69,120384,69,120436,69,917,69,120492,69,120550,69,120608,69,120666,69,120724,69,11577,69,5036,69,42224,69,71846,69,71854,69,66182,69,119839,102,119891,102,119943,102,119995,102,120047,102,120099,102,120151,102,120203,102,120255,102,120307,102,120359,102,120411,102,120463,102,43829,102,42905,102,383,102,7837,102,1412,102,119315,70,8497,70,119813,70,119865,70,119917,70,120021,70,120073,70,120125,70,120177,70,120229,70,120281,70,120333,70,120385,70,120437,70,42904,70,988,70,120778,70,5556,70,42205,70,71874,70,71842,70,66183,70,66213,70,66853,70,65351,103,8458,103,119840,103,119892,103,119944,103,120048,103,120100,103,120152,103,120204,103,120256,103,120308,103,120360,103,120412,103,120464,103,609,103,7555,103,397,103,1409,103,119814,71,119866,71,119918,71,119970,71,120022,71,120074,71,120126,71,120178,71,120230,71,120282,71,120334,71,120386,71,120438,71,1292,71,5056,71,5107,71,42198,71,65352,104,8462,104,119841,104,119945,104,119997,104,120049,104,120101,104,120153,104,120205,104,120257,104,120309,104,120361,104,120413,104,120465,104,1211,104,1392,104,5058,104,65320,72,8459,72,8460,72,8461,72,119815,72,119867,72,119919,72,120023,72,120179,72,120231,72,120283,72,120335,72,120387,72,120439,72,919,72,120494,72,120552,72,120610,72,120668,72,120726,72,11406,72,5051,72,5500,72,42215,72,66255,72,731,105,9075,105,65353,105,8560,105,8505,105,8520,105,119842,105,119894,105,119946,105,119998,105,120050,105,120102,105,120154,105,120206,105,120258,105,120310,105,120362,105,120414,105,120466,105,120484,105,618,105,617,105,953,105,8126,105,890,105,120522,105,120580,105,120638,105,120696,105,120754,105,1110,105,42567,105,1231,105,43893,105,5029,105,71875,105,65354,106,8521,106,119843,106,119895,106,119947,106,119999,106,120051,106,120103,106,120155,106,120207,106,120259,106,120311,106,120363,106,120415,106,120467,106,1011,106,1112,106,65322,74,119817,74,119869,74,119921,74,119973,74,120025,74,120077,74,120129,74,120181,74,120233,74,120285,74,120337,74,120389,74,120441,74,42930,74,895,74,1032,74,5035,74,5261,74,42201,74,119844,107,119896,107,119948,107,120000,107,120052,107,120104,107,120156,107,120208,107,120260,107,120312,107,120364,107,120416,107,120468,107,8490,75,65323,75,119818,75,119870,75,119922,75,119974,75,120026,75,120078,75,120130,75,120182,75,120234,75,120286,75,120338,75,120390,75,120442,75,922,75,120497,75,120555,75,120613,75,120671,75,120729,75,11412,75,5094,75,5845,75,42199,75,66840,75,1472,108,8739,73,9213,73,65512,73,1633,108,1777,73,66336,108,125127,108,120783,73,120793,73,120803,73,120813,73,120823,73,130033,73,65321,73,8544,73,8464,73,8465,73,119816,73,119868,73,119920,73,120024,73,120128,73,120180,73,120232,73,120284,73,120336,73,120388,73,120440,73,65356,108,8572,73,8467,108,119845,108,119897,108,119949,108,120001,108,120053,108,120105,73,120157,73,120209,73,120261,73,120313,73,120365,73,120417,73,120469,73,448,73,120496,73,120554,73,120612,73,120670,73,120728,73,11410,73,1030,73,1216,73,1493,108,1503,108,1575,108,126464,108,126592,108,65166,108,65165,108,1994,108,11599,73,5825,73,42226,73,93992,73,66186,124,66313,124,119338,76,8556,76,8466,76,119819,76,119871,76,119923,76,120027,76,120079,76,120131,76,120183,76,120235,76,120287,76,120339,76,120391,76,120443,76,11472,76,5086,76,5290,76,42209,76,93974,76,71843,76,71858,76,66587,76,66854,76,65325,77,8559,77,8499,77,119820,77,119872,77,119924,77,120028,77,120080,77,120132,77,120184,77,120236,77,120288,77,120340,77,120392,77,120444,77,924,77,120499,77,120557,77,120615,77,120673,77,120731,77,1018,77,11416,77,5047,77,5616,77,5846,77,42207,77,66224,77,66321,77,119847,110,119899,110,119951,110,120003,110,120055,110,120107,110,120159,110,120211,110,120263,110,120315,110,120367,110,120419,110,120471,110,1400,110,1404,110,65326,78,8469,78,119821,78,119873,78,119925,78,119977,78,120029,78,120081,78,120185,78,120237,78,120289,78,120341,78,120393,78,120445,78,925,78,120500,78,120558,78,120616,78,120674,78,120732,78,11418,78,42208,78,66835,78,3074,111,3202,111,3330,111,3458,111,2406,111,2662,111,2790,111,3046,111,3174,111,3302,111,3430,111,3664,111,3792,111,4160,111,1637,111,1781,111,65359,111,8500,111,119848,111,119900,111,119952,111,120056,111,120108,111,120160,111,120212,111,120264,111,120316,111,120368,111,120420,111,120472,111,7439,111,7441,111,43837,111,959,111,120528,111,120586,111,120644,111,120702,111,120760,111,963,111,120532,111,120590,111,120648,111,120706,111,120764,111,11423,111,4351,111,1413,111,1505,111,1607,111,126500,111,126564,111,126596,111,65259,111,65260,111,65258,111,65257,111,1726,111,64428,111,64429,111,64427,111,64426,111,1729,111,64424,111,64425,111,64423,111,64422,111,1749,111,3360,111,4125,111,66794,111,71880,111,71895,111,66604,111,1984,79,2534,79,2918,79,12295,79,70864,79,71904,79,120782,79,120792,79,120802,79,120812,79,120822,79,130032,79,65327,79,119822,79,119874,79,119926,79,119978,79,120030,79,120082,79,120134,79,120186,79,120238,79,120290,79,120342,79,120394,79,120446,79,927,79,120502,79,120560,79,120618,79,120676,79,120734,79,11422,79,1365,79,11604,79,4816,79,2848,79,66754,79,42227,79,71861,79,66194,79,66219,79,66564,79,66838,79,9076,112,65360,112,119849,112,119901,112,119953,112,120005,112,120057,112,120109,112,120161,112,120213,112,120265,112,120317,112,120369,112,120421,112,120473,112,961,112,120530,112,120544,112,120588,112,120602,112,120646,112,120660,112,120704,112,120718,112,120762,112,120776,112,11427,112,65328,80,8473,80,119823,80,119875,80,119927,80,119979,80,120031,80,120083,80,120187,80,120239,80,120291,80,120343,80,120395,80,120447,80,929,80,120504,80,120562,80,120620,80,120678,80,120736,80,11426,80,5090,80,5229,80,42193,80,66197,80,119850,113,119902,113,119954,113,120006,113,120058,113,120110,113,120162,113,120214,113,120266,113,120318,113,120370,113,120422,113,120474,113,1307,113,1379,113,1382,113,8474,81,119824,81,119876,81,119928,81,119980,81,120032,81,120084,81,120188,81,120240,81,120292,81,120344,81,120396,81,120448,81,11605,81,119851,114,119903,114,119955,114,120007,114,120059,114,120111,114,120163,114,120215,114,120267,114,120319,114,120371,114,120423,114,120475,114,43847,114,43848,114,7462,114,11397,114,43905,114,119318,82,8475,82,8476,82,8477,82,119825,82,119877,82,119929,82,120033,82,120189,82,120241,82,120293,82,120345,82,120397,82,120449,82,422,82,5025,82,5074,82,66740,82,5511,82,42211,82,94005,82,65363,115,119852,115,119904,115,119956,115,120008,115,120060,115,120112,115,120164,115,120216,115,120268,115,120320,115,120372,115,120424,115,120476,115,42801,115,445,115,1109,115,43946,115,71873,115,66632,115,65331,83,119826,83,119878,83,119930,83,119982,83,120034,83,120086,83,120138,83,120190,83,120242,83,120294,83,120346,83,120398,83,120450,83,1029,83,1359,83,5077,83,5082,83,42210,83,94010,83,66198,83,66592,83,119853,116,119905,116,119957,116,120009,116,120061,116,120113,116,120165,116,120217,116,120269,116,120321,116,120373,116,120425,116,120477,116,8868,84,10201,84,128872,84,65332,84,119827,84,119879,84,119931,84,119983,84,120035,84,120087,84,120139,84,120191,84,120243,84,120295,84,120347,84,120399,84,120451,84,932,84,120507,84,120565,84,120623,84,120681,84,120739,84,11430,84,5026,84,42196,84,93962,84,71868,84,66199,84,66225,84,66325,84,119854,117,119906,117,119958,117,120010,117,120062,117,120114,117,120166,117,120218,117,120270,117,120322,117,120374,117,120426,117,120478,117,42911,117,7452,117,43854,117,43858,117,651,117,965,117,120534,117,120592,117,120650,117,120708,117,120766,117,1405,117,66806,117,71896,117,8746,85,8899,85,119828,85,119880,85,119932,85,119984,85,120036,85,120088,85,120140,85,120192,85,120244,85,120296,85,120348,85,120400,85,120452,85,1357,85,4608,85,66766,85,5196,85,42228,85,94018,85,71864,85,8744,118,8897,118,65366,118,8564,118,119855,118,119907,118,119959,118,120011,118,120063,118,120115,118,120167,118,120219,118,120271,118,120323,118,120375,118,120427,118,120479,118,7456,118,957,118,120526,118,120584,118,120642,118,120700,118,120758,118,1141,118,1496,118,71430,118,43945,118,71872,118,119309,86,1639,86,1783,86,8548,86,119829,86,119881,86,119933,86,119985,86,120037,86,120089,86,120141,86,120193,86,120245,86,120297,86,120349,86,120401,86,120453,86,1140,86,11576,86,5081,86,5167,86,42719,86,42214,86,93960,86,71840,86,66845,86,623,119,119856,119,119908,119,119960,119,120012,119,120064,119,120116,119,120168,119,120220,119,120272,119,120324,119,120376,119,120428,119,120480,119,7457,119,1121,119,1309,119,1377,119,71434,119,71438,119,71439,119,43907,119,71919,87,71910,87,119830,87,119882,87,119934,87,119986,87,120038,87,120090,87,120142,87,120194,87,120246,87,120298,87,120350,87,120402,87,120454,87,1308,87,5043,87,5076,87,42218,87,5742,120,10539,120,10540,120,10799,120,65368,120,8569,120,119857,120,119909,120,119961,120,120013,120,120065,120,120117,120,120169,120,120221,120,120273,120,120325,120,120377,120,120429,120,120481,120,5441,120,5501,120,5741,88,9587,88,66338,88,71916,88,65336,88,8553,88,119831,88,119883,88,119935,88,119987,88,120039,88,120091,88,120143,88,120195,88,120247,88,120299,88,120351,88,120403,88,120455,88,42931,88,935,88,120510,88,120568,88,120626,88,120684,88,120742,88,11436,88,11613,88,5815,88,42219,88,66192,88,66228,88,66327,88,66855,88,611,121,7564,121,65369,121,119858,121,119910,121,119962,121,120014,121,120066,121,120118,121,120170,121,120222,121,120274,121,120326,121,120378,121,120430,121,120482,121,655,121,7935,121,43866,121,947,121,8509,121,120516,121,120574,121,120632,121,120690,121,120748,121,1199,121,4327,121,71900,121,65337,89,119832,89,119884,89,119936,89,119988,89,120040,89,120092,89,120144,89,120196,89,120248,89,120300,89,120352,89,120404,89,120456,89,933,89,978,89,120508,89,120566,89,120624,89,120682,89,120740,89,11432,89,1198,89,5033,89,5053,89,42220,89,94019,89,71844,89,66226,89,119859,122,119911,122,119963,122,120015,122,120067,122,120119,122,120171,122,120223,122,120275,122,120327,122,120379,122,120431,122,120483,122,7458,122,43923,122,71876,122,66293,90,71909,90,65338,90,8484,90,8488,90,119833,90,119885,90,119937,90,119989,90,120041,90,120197,90,120249,90,120301,90,120353,90,120405,90,120457,90,918,90,120493,90,120551,90,120609,90,120667,90,120725,90,5059,90,42204,90,71849,90,65282,34,65284,36,65285,37,65286,38,65290,42,65291,43,65294,46,65295,47,65296,48,65297,49,65298,50,65299,51,65300,52,65301,53,65302,54,65303,55,65304,56,65305,57,65308,60,65309,61,65310,62,65312,64,65316,68,65318,70,65319,71,65324,76,65329,81,65330,82,65333,85,65334,86,65335,87,65343,95,65346,98,65348,100,65350,102,65355,107,65357,109,65358,110,65361,113,65362,114,65364,116,65365,117,65367,119,65370,122,65371,123,65373,125,119846,109],"_default":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"cs":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"de":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"es":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"fr":[65374,126,65306,58,65281,33,8216,96,8245,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"it":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ja":[8211,45,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65292,44,65307,59],"ko":[8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pl":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"pt-BR":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"qps-ploc":[160,32,8211,45,65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"ru":[65374,126,65306,58,65281,33,8216,96,8217,96,8245,96,180,96,12494,47,305,105,921,73,1009,112,215,120,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"tr":[160,32,8211,45,65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65288,40,65289,41,65292,44,65307,59,65311,63],"zh-hans":[65374,126,65306,58,65281,33,8245,96,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65288,40,65289,41],"zh-hant":[8211,45,65374,126,180,96,12494,47,1047,51,1073,54,1072,97,1040,65,1068,98,1042,66,1089,99,1057,67,1077,101,1045,69,1053,72,305,105,1050,75,921,73,1052,77,1086,111,1054,79,1009,112,1088,112,1056,80,1075,114,1058,84,215,120,1093,120,1061,88,1091,121,1059,89,65283,35,65307,59]}'))),Ko.cache=new class{constructor(e){this.fn=e,this.lastCache=void 0,this.lastArgKey=void 0}get(e){const t=JSON.stringify(e);return this.lastArgKey!==t&&(this.lastArgKey=t,this.lastCache=this.fn(e)),this.lastCache}}((e=>{function t(e){const t=new Map;for(let i=0;i!e.startsWith("_")&&e in n));0===o.length&&(o=["_default"]);for(const a of o){s=i(s,t(n[a]))}const r=function(e,t){const i=new Map(e);for(const[n,s]of t)i.set(n,s);return i}(t(n._common),s);return new Hs(r)})),Ko._locales=new Zs((()=>Object.keys(Hs.ambiguousCharacterData.value).filter((e=>!e.startsWith("_")))));class jo{static getRawData(){return JSON.parse("[9,10,11,12,13,32,127,160,173,847,1564,4447,4448,6068,6069,6155,6156,6157,6158,7355,7356,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8203,8204,8205,8206,8207,8234,8235,8236,8237,8238,8239,8287,8288,8289,8290,8291,8292,8293,8294,8295,8296,8297,8298,8299,8300,8301,8302,8303,10240,12288,12644,65024,65025,65026,65027,65028,65029,65030,65031,65032,65033,65034,65035,65036,65037,65038,65039,65279,65440,65520,65521,65522,65523,65524,65525,65526,65527,65528,65532,78844,119155,119156,119157,119158,119159,119160,119161,119162,917504,917505,917506,917507,917508,917509,917510,917511,917512,917513,917514,917515,917516,917517,917518,917519,917520,917521,917522,917523,917524,917525,917526,917527,917528,917529,917530,917531,917532,917533,917534,917535,917536,917537,917538,917539,917540,917541,917542,917543,917544,917545,917546,917547,917548,917549,917550,917551,917552,917553,917554,917555,917556,917557,917558,917559,917560,917561,917562,917563,917564,917565,917566,917567,917568,917569,917570,917571,917572,917573,917574,917575,917576,917577,917578,917579,917580,917581,917582,917583,917584,917585,917586,917587,917588,917589,917590,917591,917592,917593,917594,917595,917596,917597,917598,917599,917600,917601,917602,917603,917604,917605,917606,917607,917608,917609,917610,917611,917612,917613,917614,917615,917616,917617,917618,917619,917620,917621,917622,917623,917624,917625,917626,917627,917628,917629,917630,917631,917760,917761,917762,917763,917764,917765,917766,917767,917768,917769,917770,917771,917772,917773,917774,917775,917776,917777,917778,917779,917780,917781,917782,917783,917784,917785,917786,917787,917788,917789,917790,917791,917792,917793,917794,917795,917796,917797,917798,917799,917800,917801,917802,917803,917804,917805,917806,917807,917808,917809,917810,917811,917812,917813,917814,917815,917816,917817,917818,917819,917820,917821,917822,917823,917824,917825,917826,917827,917828,917829,917830,917831,917832,917833,917834,917835,917836,917837,917838,917839,917840,917841,917842,917843,917844,917845,917846,917847,917848,917849,917850,917851,917852,917853,917854,917855,917856,917857,917858,917859,917860,917861,917862,917863,917864,917865,917866,917867,917868,917869,917870,917871,917872,917873,917874,917875,917876,917877,917878,917879,917880,917881,917882,917883,917884,917885,917886,917887,917888,917889,917890,917891,917892,917893,917894,917895,917896,917897,917898,917899,917900,917901,917902,917903,917904,917905,917906,917907,917908,917909,917910,917911,917912,917913,917914,917915,917916,917917,917918,917919,917920,917921,917922,917923,917924,917925,917926,917927,917928,917929,917930,917931,917932,917933,917934,917935,917936,917937,917938,917939,917940,917941,917942,917943,917944,917945,917946,917947,917948,917949,917950,917951,917952,917953,917954,917955,917956,917957,917958,917959,917960,917961,917962,917963,917964,917965,917966,917967,917968,917969,917970,917971,917972,917973,917974,917975,917976,917977,917978,917979,917980,917981,917982,917983,917984,917985,917986,917987,917988,917989,917990,917991,917992,917993,917994,917995,917996,917997,917998,917999]")}static getData(){return this._data||(this._data=new Set(jo.getRawData())),this._data}static isInvisibleCharacter(e){return jo.getData().has(e)}static get codePoints(){return jo.getData()}}function qo(...e){return function(t,i){for(let n=0,s=e.length;n0?[{start:0,end:t.length}]:[]:null}function Zo(e,t){const i=t.toLowerCase().indexOf(e.toLowerCase());return-1===i?null:[{start:i,end:i+e.length}]}function Yo(e,t){return Xo(e.toLowerCase(),t.toLowerCase(),0,0)}function Xo(e,t,i,n){if(i===e.length)return[];if(n===t.length)return null;if(e[i]===t[n]){let s=null;return(s=Xo(e,t,i+1,n+1))?or({start:n,end:n+1},s):null}return Xo(e,t,i,n+1)}function Qo(e){return 97<=e&&e<=122}function Jo(e){return 65<=e&&e<=90}function er(e){return 48<=e&&e<=57}function tr(e){return 32===e||9===e||10===e||13===e}const ir=new Set;function nr(e){return tr(e)||ir.has(e)}function sr(e){return Qo(e)||Jo(e)||er(e)}function or(e,t){return 0===t.length?t=[e]:e.end===t[0].start?t[0].start=e.start:t.unshift(e),t}function rr(e,t){for(let i=t;i0&&!sr(e.charCodeAt(i-1)))return i}return e.length}function ar(e,t,i,n){if(i===e.length)return[];if(n===t.length)return null;if(e[i]!==t[n].toLowerCase())return null;{let s=null,o=n+1;for(s=ar(e,t,i+1,n+1);!s&&(o=rr(t,o))60)return null;const i=function(e){let t=0,i=0,n=0,s=0,o=0;for(let r=0;r.2&&t<.8&&n>.6&&s<.2}(i)){if(!function(e){const{upperPercent:t,lowerPercent:i}=e;return 0===i&&t>.6}(i))return null;t=t.toLowerCase()}let n=null,s=0;for(e=e.toLowerCase();s0&&nr(e.charCodeAt(i-1)))return i;return e.length}"()[]{}<>`'\"-/;:,.?!".split("").forEach((e=>ir.add(e.charCodeAt(0))));const cr=qo($o,lr,Zo),ur=qo($o,lr,Yo),gr=new js(1e4);function pr(e,t,i=!1){if("string"!=typeof e||"string"!=typeof t)return null;let n=gr.get(e);n||(n=new RegExp(e.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*"),"i"),gr.set(e,n));const s=n.exec(t);return s?[{start:s.index,end:s.index+s[0].length}]:i?ur(e,t):cr(e,t)}function mr(e,t){const i=Rr(e,e.toLowerCase(),0,t,t.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return i?_r(i):null}function fr(e,t,i,n,s,o){const r=Math.min(13,e.length);for(;i1;n--){const s=e[n]+i,o=t[t.length-1];o&&o.end===s?o.end=s+1:t.push({start:s,end:s+1})}return t}const vr=128;function br(){const e=[],t=[];for(let i=0;i<=vr;i++)t[i]=0;for(let i=0;i<=vr;i++)e.push(t.slice(0));return e}function Cr(e){const t=[];for(let i=0;i<=e;i++)t[i]=0;return t}const wr=Cr(2*vr),yr=Cr(2*vr),Sr=br(),Lr=br(),kr=br(),Dr=!1;function xr(e,t,i,n,s){function o(e,t,i=" "){for(;e.lengtho(e,3))).join("|")}\n`;for(let a=0;a<=i;a++)r+=0===a?" |":`${t[a-1]}|`,r+=e[a].slice(0,s+1).map((e=>o(e.toString(),3))).join("|")+"\n";return r}function Nr(e,t){if(t<0||t>=e.length)return!1;const i=e.codePointAt(t);switch(i){case 95:case 45:case 46:case 32:case 47:case 92:case 39:case 34:case 58:case 36:case 60:case 62:case 40:case 41:case 91:case 93:case 123:case 125:return!0;case void 0:return!1;default:return!!Po(i)}}function Er(e,t){if(t<0||t>=e.length)return!1;switch(e.charCodeAt(t)){case 32:case 9:return!0;default:return!1}}function Ir(e,t,i){return t[e]!==i[e]}var Mr;!function(e){e.Default=[-100,0],e.isDefault=function(e){return!e||2===e.length&&-100===e[0]&&0===e[1]}}(Mr||(Mr={}));class Tr{constructor(e,t){this.firstMatchCanBeWeak=e,this.boostFullMatch=t}}function Rr(e,t,i,n,s,o,r=Tr.default){const a=e.length>vr?vr:e.length,l=n.length>vr?vr:n.length;if(i>=a||o>=l||a-i>l-o)return;if(!function(e,t,i,n,s,o,r=!1){for(;t=i&&a>=n;)s[r]===o[a]&&(yr[r]=a,r--),a--}(a,l,i,o,t,s);let h=1,d=1,c=i,u=o;const g=[!1];for(h=1,c=i;cr,v=_?Lr[h][d-1]+(Sr[h][d-1]>0?-5:0):0,b=u>r+1&&Sr[h][d-1]>0,C=b?Lr[h][d-2]+(Sr[h][d-2]>0?-5:0):0;if(b&&(!_||C>=v)&&(!m||C>=f))Lr[h][d]=C,kr[h][d]=3,Sr[h][d]=0;else if(_&&(!m||v>=f))Lr[h][d]=v,kr[h][d]=2,Sr[h][d]=0;else{if(!m)throw new Error("not possible");Lr[h][d]=f,kr[h][d]=1,Sr[h][d]=Sr[h-1][d-1]+1}}}if(Dr&&function(e,t,i,n){e=e.substr(t),i=i.substr(n),console.log(xr(Lr,e,e.length,i,i.length)),console.log(xr(kr,e,e.length,i,i.length)),console.log(xr(Sr,e,e.length,i,i.length))}(e,i,n,o),!g[0]&&!r.firstMatchCanBeWeak)return;h--,d--;const p=[Lr[h][d],o];let m=0,f=0;for(;h>=1;){let e=d;do{const t=kr[h][e];if(3===t)e-=2;else{if(2!==t)break;e-=1}}while(e>=1);m>1&&t[i+h-1]===s[o+d-1]&&!Ir(e+o-1,n,s)&&m+1>Sr[h][e]&&(e=d),e===d?m++:m=1,f||(f=e),h--,d=e-1,p.push(d)}l===a&&r.boostFullMatch&&(p[0]+=2);const _=f-a;return p[0]-=_,p}function Ar(e,t,i,n,s,o,r,a,l,h,d){if(t[i]!==o[r])return Number.MIN_SAFE_INTEGER;let c=1,u=!1;return r===i-n?c=e[i]===s[r]?7:5:!Ir(r,s,o)||0!==r&&Ir(r-1,s,o)?!Nr(o,r)||0!==r&&Nr(o,r-1)?(Nr(o,r-1)||Er(o,r-1))&&(c=5,u=!0):c=5:(c=e[i]===s[r]?7:5,u=!0),c>1&&i===n&&(d[0]=!0),u||(u=Ir(r,s,o)||Nr(o,r-1)||Er(o,r-1)),i===n?r>l&&(c-=u?3:5):c+=h?u?2:0:u?0:1,r+1===a&&(c-=u?3:5),c}function Or(e,t,i,n,s,o,r){return function(e,t,i,n,s,o,r,a){let l=Rr(e,t,i,n,s,o,a);if(l&&!r)return l;if(e.length>=3){const t=Math.min(7,e.length-1);for(let r=i+1;rl[0])&&(l=e))}}}return l}(e,t,i,n,s,o,!0,r)}function Pr(e,t){if(t+1>=e.length)return;const i=e[t],n=e[t+1];return i!==n?e.slice(0,t)+n+i+e.slice(t+2):void 0}function Fr(e){return"string"==typeof e}function Br(e){return!("object"!=typeof e||null===e||Array.isArray(e)||e instanceof RegExp||e instanceof Date)}function Wr(e){const t=Object.getPrototypeOf(Uint8Array);return"object"==typeof e&&e instanceof t}function Vr(e){return"number"==typeof e&&!isNaN(e)}function Hr(e){return!!e&&"function"==typeof e[Symbol.iterator]}function zr(e){return!0===e||!1===e}function Ur(e){return void 0===e}function Kr(e){return!jr(e)}function jr(e){return Ur(e)||null===e}function qr(e,t){if(!e)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function $r(e){if(jr(e))throw new Error("Assertion Failed: argument is undefined or null");return e}function Gr(e){return"function"==typeof e}function Zr(e,t){if(Fr(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Gr(t)){try{if(e instanceof t)return}catch(ge){}if(!jr(e)&&e.constructor===t)return;if(1===t.length&&!0===t.call(void 0,e))return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}Tr.default={boostFullMatch:!0,firstMatchCanBeWeak:!1};const Yr=Object.create(null);function Xr(e,t){if(Fr(t)){const i=Yr[t];if(void 0===i)throw new Error(`${e} references an unknown codicon: ${t}`);t=i}return Yr[e]=t,{id:e}}function Qr(){return Yr}const Jr={add:Xr("add",6e4),plus:Xr("plus",6e4),gistNew:Xr("gist-new",6e4),repoCreate:Xr("repo-create",6e4),lightbulb:Xr("lightbulb",60001),lightBulb:Xr("light-bulb",60001),repo:Xr("repo",60002),repoDelete:Xr("repo-delete",60002),gistFork:Xr("gist-fork",60003),repoForked:Xr("repo-forked",60003),gitPullRequest:Xr("git-pull-request",60004),gitPullRequestAbandoned:Xr("git-pull-request-abandoned",60004),recordKeys:Xr("record-keys",60005),keyboard:Xr("keyboard",60005),tag:Xr("tag",60006),tagAdd:Xr("tag-add",60006),tagRemove:Xr("tag-remove",60006),gitPullRequestLabel:Xr("git-pull-request-label",60006),person:Xr("person",60007),personFollow:Xr("person-follow",60007),personOutline:Xr("person-outline",60007),personFilled:Xr("person-filled",60007),gitBranch:Xr("git-branch",60008),gitBranchCreate:Xr("git-branch-create",60008),gitBranchDelete:Xr("git-branch-delete",60008),sourceControl:Xr("source-control",60008),mirror:Xr("mirror",60009),mirrorPublic:Xr("mirror-public",60009),star:Xr("star",60010),starAdd:Xr("star-add",60010),starDelete:Xr("star-delete",60010),starEmpty:Xr("star-empty",60010),comment:Xr("comment",60011),commentAdd:Xr("comment-add",60011),alert:Xr("alert",60012),warning:Xr("warning",60012),search:Xr("search",60013),searchSave:Xr("search-save",60013),logOut:Xr("log-out",60014),signOut:Xr("sign-out",60014),logIn:Xr("log-in",60015),signIn:Xr("sign-in",60015),eye:Xr("eye",60016),eyeUnwatch:Xr("eye-unwatch",60016),eyeWatch:Xr("eye-watch",60016),circleFilled:Xr("circle-filled",60017),primitiveDot:Xr("primitive-dot",60017),closeDirty:Xr("close-dirty",60017),debugBreakpoint:Xr("debug-breakpoint",60017),debugBreakpointDisabled:Xr("debug-breakpoint-disabled",60017),debugHint:Xr("debug-hint",60017),primitiveSquare:Xr("primitive-square",60018),edit:Xr("edit",60019),pencil:Xr("pencil",60019),info:Xr("info",60020),issueOpened:Xr("issue-opened",60020),gistPrivate:Xr("gist-private",60021),gitForkPrivate:Xr("git-fork-private",60021),lock:Xr("lock",60021),mirrorPrivate:Xr("mirror-private",60021),close:Xr("close",60022),removeClose:Xr("remove-close",60022),x:Xr("x",60022),repoSync:Xr("repo-sync",60023),sync:Xr("sync",60023),clone:Xr("clone",60024),desktopDownload:Xr("desktop-download",60024),beaker:Xr("beaker",60025),microscope:Xr("microscope",60025),vm:Xr("vm",60026),deviceDesktop:Xr("device-desktop",60026),file:Xr("file",60027),fileText:Xr("file-text",60027),more:Xr("more",60028),ellipsis:Xr("ellipsis",60028),kebabHorizontal:Xr("kebab-horizontal",60028),mailReply:Xr("mail-reply",60029),reply:Xr("reply",60029),organization:Xr("organization",60030),organizationFilled:Xr("organization-filled",60030),organizationOutline:Xr("organization-outline",60030),newFile:Xr("new-file",60031),fileAdd:Xr("file-add",60031),newFolder:Xr("new-folder",60032),fileDirectoryCreate:Xr("file-directory-create",60032),trash:Xr("trash",60033),trashcan:Xr("trashcan",60033),history:Xr("history",60034),clock:Xr("clock",60034),folder:Xr("folder",60035),fileDirectory:Xr("file-directory",60035),symbolFolder:Xr("symbol-folder",60035),logoGithub:Xr("logo-github",60036),markGithub:Xr("mark-github",60036),github:Xr("github",60036),terminal:Xr("terminal",60037),console:Xr("console",60037),repl:Xr("repl",60037),zap:Xr("zap",60038),symbolEvent:Xr("symbol-event",60038),error:Xr("error",60039),stop:Xr("stop",60039),variable:Xr("variable",60040),symbolVariable:Xr("symbol-variable",60040),array:Xr("array",60042),symbolArray:Xr("symbol-array",60042),symbolModule:Xr("symbol-module",60043),symbolPackage:Xr("symbol-package",60043),symbolNamespace:Xr("symbol-namespace",60043),symbolObject:Xr("symbol-object",60043),symbolMethod:Xr("symbol-method",60044),symbolFunction:Xr("symbol-function",60044),symbolConstructor:Xr("symbol-constructor",60044),symbolBoolean:Xr("symbol-boolean",60047),symbolNull:Xr("symbol-null",60047),symbolNumeric:Xr("symbol-numeric",60048),symbolNumber:Xr("symbol-number",60048),symbolStructure:Xr("symbol-structure",60049),symbolStruct:Xr("symbol-struct",60049),symbolParameter:Xr("symbol-parameter",60050),symbolTypeParameter:Xr("symbol-type-parameter",60050),symbolKey:Xr("symbol-key",60051),symbolText:Xr("symbol-text",60051),symbolReference:Xr("symbol-reference",60052),goToFile:Xr("go-to-file",60052),symbolEnum:Xr("symbol-enum",60053),symbolValue:Xr("symbol-value",60053),symbolRuler:Xr("symbol-ruler",60054),symbolUnit:Xr("symbol-unit",60054),activateBreakpoints:Xr("activate-breakpoints",60055),archive:Xr("archive",60056),arrowBoth:Xr("arrow-both",60057),arrowDown:Xr("arrow-down",60058),arrowLeft:Xr("arrow-left",60059),arrowRight:Xr("arrow-right",60060),arrowSmallDown:Xr("arrow-small-down",60061),arrowSmallLeft:Xr("arrow-small-left",60062),arrowSmallRight:Xr("arrow-small-right",60063),arrowSmallUp:Xr("arrow-small-up",60064),arrowUp:Xr("arrow-up",60065),bell:Xr("bell",60066),bold:Xr("bold",60067),book:Xr("book",60068),bookmark:Xr("bookmark",60069),debugBreakpointConditionalUnverified:Xr("debug-breakpoint-conditional-unverified",60070),debugBreakpointConditional:Xr("debug-breakpoint-conditional",60071),debugBreakpointConditionalDisabled:Xr("debug-breakpoint-conditional-disabled",60071),debugBreakpointDataUnverified:Xr("debug-breakpoint-data-unverified",60072),debugBreakpointData:Xr("debug-breakpoint-data",60073),debugBreakpointDataDisabled:Xr("debug-breakpoint-data-disabled",60073),debugBreakpointLogUnverified:Xr("debug-breakpoint-log-unverified",60074),debugBreakpointLog:Xr("debug-breakpoint-log",60075),debugBreakpointLogDisabled:Xr("debug-breakpoint-log-disabled",60075),briefcase:Xr("briefcase",60076),broadcast:Xr("broadcast",60077),browser:Xr("browser",60078),bug:Xr("bug",60079),calendar:Xr("calendar",60080),caseSensitive:Xr("case-sensitive",60081),check:Xr("check",60082),checklist:Xr("checklist",60083),chevronDown:Xr("chevron-down",60084),dropDownButton:Xr("drop-down-button",60084),chevronLeft:Xr("chevron-left",60085),chevronRight:Xr("chevron-right",60086),chevronUp:Xr("chevron-up",60087),chromeClose:Xr("chrome-close",60088),chromeMaximize:Xr("chrome-maximize",60089),chromeMinimize:Xr("chrome-minimize",60090),chromeRestore:Xr("chrome-restore",60091),circle:Xr("circle",60092),circleOutline:Xr("circle-outline",60092),debugBreakpointUnverified:Xr("debug-breakpoint-unverified",60092),circleSlash:Xr("circle-slash",60093),circuitBoard:Xr("circuit-board",60094),clearAll:Xr("clear-all",60095),clippy:Xr("clippy",60096),closeAll:Xr("close-all",60097),cloudDownload:Xr("cloud-download",60098),cloudUpload:Xr("cloud-upload",60099),code:Xr("code",60100),collapseAll:Xr("collapse-all",60101),colorMode:Xr("color-mode",60102),commentDiscussion:Xr("comment-discussion",60103),compareChanges:Xr("compare-changes",60157),creditCard:Xr("credit-card",60105),dash:Xr("dash",60108),dashboard:Xr("dashboard",60109),database:Xr("database",60110),debugContinue:Xr("debug-continue",60111),debugDisconnect:Xr("debug-disconnect",60112),debugPause:Xr("debug-pause",60113),debugRestart:Xr("debug-restart",60114),debugStart:Xr("debug-start",60115),debugStepInto:Xr("debug-step-into",60116),debugStepOut:Xr("debug-step-out",60117),debugStepOver:Xr("debug-step-over",60118),debugStop:Xr("debug-stop",60119),debug:Xr("debug",60120),deviceCameraVideo:Xr("device-camera-video",60121),deviceCamera:Xr("device-camera",60122),deviceMobile:Xr("device-mobile",60123),diffAdded:Xr("diff-added",60124),diffIgnored:Xr("diff-ignored",60125),diffModified:Xr("diff-modified",60126),diffRemoved:Xr("diff-removed",60127),diffRenamed:Xr("diff-renamed",60128),diff:Xr("diff",60129),discard:Xr("discard",60130),editorLayout:Xr("editor-layout",60131),emptyWindow:Xr("empty-window",60132),exclude:Xr("exclude",60133),extensions:Xr("extensions",60134),eyeClosed:Xr("eye-closed",60135),fileBinary:Xr("file-binary",60136),fileCode:Xr("file-code",60137),fileMedia:Xr("file-media",60138),filePdf:Xr("file-pdf",60139),fileSubmodule:Xr("file-submodule",60140),fileSymlinkDirectory:Xr("file-symlink-directory",60141),fileSymlinkFile:Xr("file-symlink-file",60142),fileZip:Xr("file-zip",60143),files:Xr("files",60144),filter:Xr("filter",60145),flame:Xr("flame",60146),foldDown:Xr("fold-down",60147),foldUp:Xr("fold-up",60148),fold:Xr("fold",60149),folderActive:Xr("folder-active",60150),folderOpened:Xr("folder-opened",60151),gear:Xr("gear",60152),gift:Xr("gift",60153),gistSecret:Xr("gist-secret",60154),gist:Xr("gist",60155),gitCommit:Xr("git-commit",60156),gitCompare:Xr("git-compare",60157),gitMerge:Xr("git-merge",60158),githubAction:Xr("github-action",60159),githubAlt:Xr("github-alt",60160),globe:Xr("globe",60161),grabber:Xr("grabber",60162),graph:Xr("graph",60163),gripper:Xr("gripper",60164),heart:Xr("heart",60165),home:Xr("home",60166),horizontalRule:Xr("horizontal-rule",60167),hubot:Xr("hubot",60168),inbox:Xr("inbox",60169),issueClosed:Xr("issue-closed",60324),issueReopened:Xr("issue-reopened",60171),issues:Xr("issues",60172),italic:Xr("italic",60173),jersey:Xr("jersey",60174),json:Xr("json",60175),bracket:Xr("bracket",60175),kebabVertical:Xr("kebab-vertical",60176),key:Xr("key",60177),law:Xr("law",60178),lightbulbAutofix:Xr("lightbulb-autofix",60179),linkExternal:Xr("link-external",60180),link:Xr("link",60181),listOrdered:Xr("list-ordered",60182),listUnordered:Xr("list-unordered",60183),liveShare:Xr("live-share",60184),loading:Xr("loading",60185),location:Xr("location",60186),mailRead:Xr("mail-read",60187),mail:Xr("mail",60188),markdown:Xr("markdown",60189),megaphone:Xr("megaphone",60190),mention:Xr("mention",60191),milestone:Xr("milestone",60192),gitPullRequestMilestone:Xr("git-pull-request-milestone",60192),mortarBoard:Xr("mortar-board",60193),move:Xr("move",60194),multipleWindows:Xr("multiple-windows",60195),mute:Xr("mute",60196),noNewline:Xr("no-newline",60197),note:Xr("note",60198),octoface:Xr("octoface",60199),openPreview:Xr("open-preview",60200),package:Xr("package",60201),paintcan:Xr("paintcan",60202),pin:Xr("pin",60203),play:Xr("play",60204),run:Xr("run",60204),plug:Xr("plug",60205),preserveCase:Xr("preserve-case",60206),preview:Xr("preview",60207),project:Xr("project",60208),pulse:Xr("pulse",60209),question:Xr("question",60210),quote:Xr("quote",60211),radioTower:Xr("radio-tower",60212),reactions:Xr("reactions",60213),references:Xr("references",60214),refresh:Xr("refresh",60215),regex:Xr("regex",60216),remoteExplorer:Xr("remote-explorer",60217),remote:Xr("remote",60218),remove:Xr("remove",60219),replaceAll:Xr("replace-all",60220),replace:Xr("replace",60221),repoClone:Xr("repo-clone",60222),repoForcePush:Xr("repo-force-push",60223),repoPull:Xr("repo-pull",60224),repoPush:Xr("repo-push",60225),report:Xr("report",60226),requestChanges:Xr("request-changes",60227),rocket:Xr("rocket",60228),rootFolderOpened:Xr("root-folder-opened",60229),rootFolder:Xr("root-folder",60230),rss:Xr("rss",60231),ruby:Xr("ruby",60232),saveAll:Xr("save-all",60233),saveAs:Xr("save-as",60234),save:Xr("save",60235),screenFull:Xr("screen-full",60236),screenNormal:Xr("screen-normal",60237),searchStop:Xr("search-stop",60238),server:Xr("server",60240),settingsGear:Xr("settings-gear",60241),settings:Xr("settings",60242),shield:Xr("shield",60243),smiley:Xr("smiley",60244),sortPrecedence:Xr("sort-precedence",60245),splitHorizontal:Xr("split-horizontal",60246),splitVertical:Xr("split-vertical",60247),squirrel:Xr("squirrel",60248),starFull:Xr("star-full",60249),starHalf:Xr("star-half",60250),symbolClass:Xr("symbol-class",60251),symbolColor:Xr("symbol-color",60252),symbolCustomColor:Xr("symbol-customcolor",60252),symbolConstant:Xr("symbol-constant",60253),symbolEnumMember:Xr("symbol-enum-member",60254),symbolField:Xr("symbol-field",60255),symbolFile:Xr("symbol-file",60256),symbolInterface:Xr("symbol-interface",60257),symbolKeyword:Xr("symbol-keyword",60258),symbolMisc:Xr("symbol-misc",60259),symbolOperator:Xr("symbol-operator",60260),symbolProperty:Xr("symbol-property",60261),wrench:Xr("wrench",60261),wrenchSubaction:Xr("wrench-subaction",60261),symbolSnippet:Xr("symbol-snippet",60262),tasklist:Xr("tasklist",60263),telescope:Xr("telescope",60264),textSize:Xr("text-size",60265),threeBars:Xr("three-bars",60266),thumbsdown:Xr("thumbsdown",60267),thumbsup:Xr("thumbsup",60268),tools:Xr("tools",60269),triangleDown:Xr("triangle-down",60270),triangleLeft:Xr("triangle-left",60271),triangleRight:Xr("triangle-right",60272),triangleUp:Xr("triangle-up",60273),twitter:Xr("twitter",60274),unfold:Xr("unfold",60275),unlock:Xr("unlock",60276),unmute:Xr("unmute",60277),unverified:Xr("unverified",60278),verified:Xr("verified",60279),versions:Xr("versions",60280),vmActive:Xr("vm-active",60281),vmOutline:Xr("vm-outline",60282),vmRunning:Xr("vm-running",60283),watch:Xr("watch",60284),whitespace:Xr("whitespace",60285),wholeWord:Xr("whole-word",60286),window:Xr("window",60287),wordWrap:Xr("word-wrap",60288),zoomIn:Xr("zoom-in",60289),zoomOut:Xr("zoom-out",60290),listFilter:Xr("list-filter",60291),listFlat:Xr("list-flat",60292),listSelection:Xr("list-selection",60293),selection:Xr("selection",60293),listTree:Xr("list-tree",60294),debugBreakpointFunctionUnverified:Xr("debug-breakpoint-function-unverified",60295),debugBreakpointFunction:Xr("debug-breakpoint-function",60296),debugBreakpointFunctionDisabled:Xr("debug-breakpoint-function-disabled",60296),debugStackframeActive:Xr("debug-stackframe-active",60297),circleSmallFilled:Xr("circle-small-filled",60298),debugStackframeDot:Xr("debug-stackframe-dot",60298),debugStackframe:Xr("debug-stackframe",60299),debugStackframeFocused:Xr("debug-stackframe-focused",60299),debugBreakpointUnsupported:Xr("debug-breakpoint-unsupported",60300),symbolString:Xr("symbol-string",60301),debugReverseContinue:Xr("debug-reverse-continue",60302),debugStepBack:Xr("debug-step-back",60303),debugRestartFrame:Xr("debug-restart-frame",60304),callIncoming:Xr("call-incoming",60306),callOutgoing:Xr("call-outgoing",60307),menu:Xr("menu",60308),expandAll:Xr("expand-all",60309),feedback:Xr("feedback",60310),gitPullRequestReviewer:Xr("git-pull-request-reviewer",60310),groupByRefType:Xr("group-by-ref-type",60311),ungroupByRefType:Xr("ungroup-by-ref-type",60312),account:Xr("account",60313),gitPullRequestAssignee:Xr("git-pull-request-assignee",60313),bellDot:Xr("bell-dot",60314),debugConsole:Xr("debug-console",60315),library:Xr("library",60316),output:Xr("output",60317),runAll:Xr("run-all",60318),syncIgnored:Xr("sync-ignored",60319),pinned:Xr("pinned",60320),githubInverted:Xr("github-inverted",60321),debugAlt:Xr("debug-alt",60305),serverProcess:Xr("server-process",60322),serverEnvironment:Xr("server-environment",60323),pass:Xr("pass",60324),stopCircle:Xr("stop-circle",60325),playCircle:Xr("play-circle",60326),record:Xr("record",60327),debugAltSmall:Xr("debug-alt-small",60328),vmConnect:Xr("vm-connect",60329),cloud:Xr("cloud",60330),merge:Xr("merge",60331),exportIcon:Xr("export",60332),graphLeft:Xr("graph-left",60333),magnet:Xr("magnet",60334),notebook:Xr("notebook",60335),redo:Xr("redo",60336),checkAll:Xr("check-all",60337),pinnedDirty:Xr("pinned-dirty",60338),passFilled:Xr("pass-filled",60339),circleLargeFilled:Xr("circle-large-filled",60340),circleLarge:Xr("circle-large",60341),circleLargeOutline:Xr("circle-large-outline",60341),combine:Xr("combine",60342),gather:Xr("gather",60342),table:Xr("table",60343),variableGroup:Xr("variable-group",60344),typeHierarchy:Xr("type-hierarchy",60345),typeHierarchySub:Xr("type-hierarchy-sub",60346),typeHierarchySuper:Xr("type-hierarchy-super",60347),gitPullRequestCreate:Xr("git-pull-request-create",60348),runAbove:Xr("run-above",60349),runBelow:Xr("run-below",60350),notebookTemplate:Xr("notebook-template",60351),debugRerun:Xr("debug-rerun",60352),workspaceTrusted:Xr("workspace-trusted",60353),workspaceUntrusted:Xr("workspace-untrusted",60354),workspaceUnspecified:Xr("workspace-unspecified",60355),terminalCmd:Xr("terminal-cmd",60356),terminalDebian:Xr("terminal-debian",60357),terminalLinux:Xr("terminal-linux",60358),terminalPowershell:Xr("terminal-powershell",60359),terminalTmux:Xr("terminal-tmux",60360),terminalUbuntu:Xr("terminal-ubuntu",60361),terminalBash:Xr("terminal-bash",60362),arrowSwap:Xr("arrow-swap",60363),copy:Xr("copy",60364),personAdd:Xr("person-add",60365),filterFilled:Xr("filter-filled",60366),wand:Xr("wand",60367),debugLineByLine:Xr("debug-line-by-line",60368),inspect:Xr("inspect",60369),layers:Xr("layers",60370),layersDot:Xr("layers-dot",60371),layersActive:Xr("layers-active",60372),compass:Xr("compass",60373),compassDot:Xr("compass-dot",60374),compassActive:Xr("compass-active",60375),azure:Xr("azure",60376),issueDraft:Xr("issue-draft",60377),gitPullRequestClosed:Xr("git-pull-request-closed",60378),gitPullRequestDraft:Xr("git-pull-request-draft",60379),debugAll:Xr("debug-all",60380),debugCoverage:Xr("debug-coverage",60381),runErrors:Xr("run-errors",60382),folderLibrary:Xr("folder-library",60383),debugContinueSmall:Xr("debug-continue-small",60384),beakerStop:Xr("beaker-stop",60385),graphLine:Xr("graph-line",60386),graphScatter:Xr("graph-scatter",60387),pieChart:Xr("pie-chart",60388),bracketDot:Xr("bracket-dot",60389),bracketError:Xr("bracket-error",60390),lockSmall:Xr("lock-small",60391),azureDevops:Xr("azure-devops",60392),verifiedFilled:Xr("verified-filled",60393),newLine:Xr("newline",60394),layout:Xr("layout",60395),layoutActivitybarLeft:Xr("layout-activitybar-left",60396),layoutActivitybarRight:Xr("layout-activitybar-right",60397),layoutPanelLeft:Xr("layout-panel-left",60398),layoutPanelCenter:Xr("layout-panel-center",60399),layoutPanelJustify:Xr("layout-panel-justify",60400),layoutPanelRight:Xr("layout-panel-right",60401),layoutPanel:Xr("layout-panel",60402),layoutSidebarLeft:Xr("layout-sidebar-left",60403),layoutSidebarRight:Xr("layout-sidebar-right",60404),layoutStatusbar:Xr("layout-statusbar",60405),layoutMenubar:Xr("layout-menubar",60406),layoutCentered:Xr("layout-centered",60407),layoutSidebarRightOff:Xr("layout-sidebar-right-off",60416),layoutPanelOff:Xr("layout-panel-off",60417),layoutSidebarLeftOff:Xr("layout-sidebar-left-off",60418),target:Xr("target",60408),indent:Xr("indent",60409),recordSmall:Xr("record-small",60410),errorSmall:Xr("error-small",60411),arrowCircleDown:Xr("arrow-circle-down",60412),arrowCircleLeft:Xr("arrow-circle-left",60413),arrowCircleRight:Xr("arrow-circle-right",60414),arrowCircleUp:Xr("arrow-circle-up",60415),heartFilled:Xr("heart-filled",60420),map:Xr("map",60421),mapFilled:Xr("map-filled",60422),circleSmall:Xr("circle-small",60423),bellSlash:Xr("bell-slash",60424),bellSlashDot:Xr("bell-slash-dot",60425),commentUnresolved:Xr("comment-unresolved",60426),gitPullRequestGoToChanges:Xr("git-pull-request-go-to-changes",60427),gitPullRequestNewChanges:Xr("git-pull-request-new-changes",60428),searchFuzzy:Xr("search-fuzzy",60429),commentDraft:Xr("comment-draft",60430),send:Xr("send",60431),sparkle:Xr("sparkle",60432),insert:Xr("insert",60433),mic:Xr("mic",60434),dialogError:Xr("dialog-error","error"),dialogWarning:Xr("dialog-warning","warning"),dialogInfo:Xr("dialog-info","info"),dialogClose:Xr("dialog-close","close"),treeItemExpanded:Xr("tree-item-expanded","chevron-down"),treeFilterOnTypeOn:Xr("tree-filter-on-type-on","list-filter"),treeFilterOnTypeOff:Xr("tree-filter-on-type-off","list-selection"),treeFilterClear:Xr("tree-filter-clear","close"),treeItemLoading:Xr("tree-item-loading","loading"),menuSelection:Xr("menu-selection","check"),menuSubmenu:Xr("menu-submenu","chevron-right"),menuBarMore:Xr("menubar-more","more"),scrollbarButtonLeft:Xr("scrollbar-button-left","triangle-left"),scrollbarButtonRight:Xr("scrollbar-button-right","triangle-right"),scrollbarButtonUp:Xr("scrollbar-button-up","triangle-up"),scrollbarButtonDown:Xr("scrollbar-button-down","triangle-down"),toolBarMore:Xr("toolbar-more","more"),quickInputBack:Xr("quick-input-back","arrow-left")};var ea,ta;!function(e){e.isThemeColor=function(e){return e&&"object"==typeof e&&"string"==typeof e.id}}(ea||(ea={})),function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9-]+",e.iconModifierExpression="~[A-Za-z]+",e.iconNameCharacter="[A-Za-z0-9~-]";const t=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function i(e){const n=t.exec(e.id);if(!n)return i(Jr.error);const[,s,o]=n,r=["codicon","codicon-"+s];return o&&r.push("codicon-modifier-"+o.substring(1)),r}e.asClassNameArray=i,e.asClassName=function(e){return i(e).join(" ")},e.asCSSSelector=function(e){return"."+i(e).join(".")},e.isThemeIcon=function(e){return e&&"object"==typeof e&&"string"==typeof e.id&&(void 0===e.color||ea.isThemeColor(e.color))};const n=new RegExp(`^\\$\\((${e.iconNameExpression}(?:${e.iconModifierExpression})?)\\)$`);e.fromString=function(e){const t=n.exec(e);if(!t)return;const[,i]=t;return{id:i}},e.fromId=function(e){return{id:e}},e.modify=function(e,t){let i=e.id;const n=i.lastIndexOf("~");return-1!==n&&(i=i.substring(0,n)),t&&(i=`${i}~${t}`),{id:i}},e.getModifier=function(e){const t=e.id.lastIndexOf("~");if(-1!==t)return e.id.substring(t+1)},e.isEqual=function(e,t){var i,n;return e.id===t.id&&(null===(i=e.color)||void 0===i?void 0:i.id)===(null===(n=t.color)||void 0===n?void 0:n.id)}}(ta||(ta={}));const ia="$(",na=new RegExp(`\\$\\(${ta.iconNameExpression}(?:${ta.iconModifierExpression})?\\)`,"g"),sa=new RegExp(`(\\\\)?${na.source}`,"g");const oa=new RegExp(`\\\\${na.source}`,"g");const ra=new RegExp(`(\\s)?(\\\\)?${na.source}(\\s)?`,"g");function aa(e){return-1===e.indexOf(ia)?e:e.replace(ra,((e,t,i,n)=>i?e:t||n||""))}const la=new RegExp(`\\$\\(${ta.iconNameCharacter}+\\)`,"g");function ha(e){la.lastIndex=0;let t="";const i=[];let n=0;for(;;){const s=la.lastIndex,o=la.exec(e),r=e.substring(s,null==o?void 0:o.index);if(r.length>0){t+=r;for(let e=0;ee.length)return!1;if(i){if(!vo(e,t))return!1;if(t.length===e.length)return!0;let i=t.length;return t.charAt(t.length-1)===n&&i--,e.charAt(i)===n}return t.charAt(t.length-1)!==n&&(t+=n),0===e.indexOf(t)}function ma(e){return e>=65&&e<=90||e>=97&&e<=122}function fa(e){return gn(e,!0)}class _a{constructor(e){this._ignorePathCasing=e}compare(e,t,i=!1){return e===t?0:ho(this.getComparisonKey(e,i),this.getComparisonKey(t,i))}isEqual(e,t,i=!1){return e===t||!(!e||!t)&&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()}isEqualOrParent(e,t,i=!1){if(e.scheme===t.scheme){if(e.scheme===vn.file)return pa(fa(e),fa(t),this._ignorePathCasing(e))&&e.query===t.query&&(i||e.fragment===t.fragment);if(Na(e.authority,t.authority))return pa(e.path,t.path,this._ignorePathCasing(e),"/")&&e.query===t.query&&(i||e.fragment===t.fragment)}return!1}joinPath(e,...t){return an.joinPath(e,...t)}basenameOrAuthority(e){return wa(e)||e.authority}basename(e){return qi.basename(e.path)}extname(e){return qi.extname(e.path)}dirname(e){if(0===e.path.length)return e;let t;return e.scheme===vn.file?t=an.file(Yi(fa(e))).path:(t=qi.dirname(e.path),e.authority&&t.length&&47!==t.charCodeAt(0)&&(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 t=e.scheme===vn.file?an.file($i(fa(e))).path:qi.normalize(e.path),e.with({path:t})}relativePath(e,t){if(e.scheme!==t.scheme||!Na(e.authority,t.authority))return;if(e.scheme===vn.file){const i=Zi(fa(e),fa(t));return Oe?ua(i):i}let i=e.path||"/";const n=t.path||"/";if(this._ignorePathCasing(e)){let e=0;for(const t=Math.min(i.length,n.length);ega(i).length&&i[i.length-1]===t}{const t=e.path;return t.length>1&&47===t.charCodeAt(t.length-1)&&!/^[a-zA-Z]:(\/$|\\$)/.test(e.fsPath)}}removeTrailingPathSeparator(e,t=Ji){return Ea(e,t)?e.with({path:e.path.substr(0,e.path.length-1)}):e}addTrailingPathSeparator(e,t=Ji){let i=!1;if(e.scheme===vn.file){const n=fa(e);i=void 0!==n&&n.length===ga(n).length&&n[n.length-1]===t}else{t="/";const n=e.path;i=1===n.length&&47===n.charCodeAt(n.length-1)}return i||Ea(e,t)?e:e.with({path:e.path+"/"})}}const va=new _a((()=>!1)),ba=(new _a((e=>e.scheme!==vn.file||!Fe)),new _a((e=>!0)),va.isEqual.bind(va)),Ca=(va.isEqualOrParent.bind(va),va.getComparisonKey.bind(va),va.basenameOrAuthority.bind(va)),wa=va.basename.bind(va),ya=va.extname.bind(va),Sa=va.dirname.bind(va),La=va.joinPath.bind(va),ka=va.normalizePath.bind(va),Da=va.relativePath.bind(va),xa=va.resolvePath.bind(va),Na=(va.isAbsolutePath.bind(va),va.isEqualAuthority.bind(va)),Ea=va.hasTrailingPathSeparator.bind(va);va.removeTrailingPathSeparator.bind(va),va.addTrailingPathSeparator.bind(va);var Ia,Ma;!function(e){e.META_DATA_LABEL="label",e.META_DATA_DESCRIPTION="description",e.META_DATA_SIZE="size",e.META_DATA_MIME="mime",e.parseMetaData=function(t){const i=new Map;t.path.substring(t.path.indexOf(";")+1,t.path.lastIndexOf(";")).split(";").forEach((e=>{const[t,n]=e.split(":");t&&n&&i.set(t,n)}));const n=t.path.substring(0,t.path.indexOf(";"));return n&&i.set(e.META_DATA_MIME,n),i}}(Ia||(Ia={}));class Ta{constructor(e="",t=!1){var i,n,s;if(this.value=e,"string"!=typeof this.value)throw u("value");"boolean"==typeof t?(this.isTrusted=t,this.supportThemeIcons=!1,this.supportHtml=!1):(this.isTrusted=null!==(i=t.isTrusted)&&void 0!==i?i:void 0,this.supportThemeIcons=null!==(n=t.supportThemeIcons)&&void 0!==n&&n,this.supportHtml=null!==(s=t.supportHtml)&&void 0!==s&&s)}appendText(e,t=0){var i;return this.value+=function(e){return e.replace(/[\\`*_{}[\]()#+\-!~]/g,"\\$&")}(this.supportThemeIcons?(i=e,i.replace(sa,((e,t)=>t?e:`\\${e}`))):e).replace(/([ \t]+)/g,((e,t)=>" ".repeat(t.length))).replace(/\>/gm,"\\>").replace(/\n/g,1===t?"\\\n":"\n\n"),this}appendMarkdown(e){return this.value+=e,this}appendCodeblock(e,t){return this.value+="\n```",this.value+=e,this.value+="\n",this.value+=t,this.value+="\n```\n",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(eo(t),"g");return e.replace(i,((t,i)=>"\\"!==e.charAt(i-1)?`\\${t}`:t))}}function Ra(e){return Aa(e)?!e.value:!Array.isArray(e)||e.every(Ra)}function Aa(e){return e instanceof Ta||!(!e||"object"!=typeof e)&&!("string"!=typeof e.value||"boolean"!=typeof e.isTrusted&&"object"!=typeof e.isTrusted&&void 0!==e.isTrusted||"boolean"!=typeof e.supportThemeIcons&&void 0!==e.supportThemeIcons)}function Oa(e){return e.replace(/"/g,""")}function Pa(e){return e?e.replace(/\\([\\`*_{}[\]()#+\-.!~])/g,"$1"):e}!function(e){e.serviceIds=new Map,e.DI_TARGET="$di$target",e.DI_DEPENDENCIES="$di$dependencies",e.getServiceDependencies=function(t){return t[e.DI_DEPENDENCIES]||[]}}(Ma||(Ma={}));const Fa=Ba("instantiationService");function Ba(e){if(Ma.serviceIds.has(e))return Ma.serviceIds.get(e);const t=function(e,i,n){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");!function(e,t,i){t[Ma.DI_TARGET]===t?t[Ma.DI_DEPENDENCIES].push({id:e,index:i}):(t[Ma.DI_DEPENDENCIES]=[{id:e,index:i}],t[Ma.DI_TARGET]=t)}(t,e,n)};return t.toString=()=>e,Ma.serviceIds.set(e,t),t}const Wa=Ba("codeEditorService");class Va{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 Va(e,t)}delta(e=0,t=0){return this.with(this.lineNumber+e,this.column+t)}equals(e){return Va.equals(this,e)}static equals(e,t){return!e&&!t||!!e&&!!t&&e.lineNumber===t.lineNumber&&e.column===t.column}isBefore(e){return Va.isBefore(this,e)}static isBefore(e,t){return e.lineNumberUa(this,void 0,void 0,(function*(){return e.run(...t)})),tooltip:e.label}}Ga.ID="vs.actions.empty";const Ya=Ba("commandService"),Xa=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new U,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,t){if(!e)throw new Error("invalid command");if("string"==typeof e){if(!t)throw new Error("invalid command");return this.registerCommand({id:e,handler:t})}if(e.description){const t=[];for(const n of e.description.args)t.push(n.constraint);const i=e.handler;e.handler=function(e,...n){return function(e,t){const i=Math.min(e.length,t.length);for(let n=0;n{s();const e=this._commands.get(i);(null==e?void 0:e.isEmpty())&&this._commands.delete(i)}));return this._onDidRegisterCommand.fire(i),o}registerCommandAlias(e,t){return Xa.registerCommand(e,((e,...i)=>e.get(Ya).executeCommand(t,...i)))}getCommand(e){const t=this._commands.get(e);if(t&&!t.isEmpty())return v.first(t)}getCommands(){const e=new Map;for(const t of this._commands.keys()){const i=this.getCommand(t);i&&e.set(t,i)}return e}};function Qa(...e){switch(e.length){case 1:return ue(0,"Did you mean {0}?",e[0]);case 2:return ue(0,"Did you mean {0} or {1}?",e[0],e[1]);case 3:return ue(0,"Did you mean {0}, {1} or {2}?",e[0],e[1],e[2]);default:return}}Xa.registerCommand("noop",(()=>{}));const Ja=ue(0,"Did you forget to open or close the quote?"),el=ue(0,"Did you forget to escape the '/' (slash) character? Put two backslashes before it to escape, e.g., '\\\\/'.");class tl{constructor(){this._input="",this._start=0,this._current=0,this._tokens=[],this._errors=[],this.stringRe=/[a-zA-Z0-9_<>\-\./\\:\*\?\+\[\]\^,#@;"%\$\p{L}-]+/uy}static getLexeme(e){switch(e.type){case 0:return"(";case 1:return")";case 2:return"!";case 3:return e.isTripleEq?"===":"==";case 4:return e.isTripleEq?"!==":"!=";case 5:return"<";case 6:return"<=";case 7:case 8:return">=";case 9:return"=~";case 10:case 17:case 18:case 19:return e.lexeme;case 11:return"true";case 12:return"false";case 13:return"in";case 14:return"not";case 15:return"&&";case 16:return"||";case 20:return"EOF";default:throw g(`unhandled token type: ${JSON.stringify(e)}; have you forgotten to add a case?`)}}reset(e){return this._input=e,this._start=0,this._current=0,this._tokens=[],this._errors=[],this}scan(){for(;!this._isAtEnd();){this._start=this._current;switch(this._advance()){case 40:this._addToken(0);break;case 41:this._addToken(1);break;case 33:if(this._match(61)){const e=this._match(61);this._tokens.push({type:4,offset:this._start,isTripleEq:e})}else this._addToken(2);break;case 39:this._quotedString();break;case 47:this._regex();break;case 61:if(this._match(61)){const e=this._match(61);this._tokens.push({type:3,offset:this._start,isTripleEq:e})}else this._match(126)?this._addToken(9):this._error(Qa("==","=~"));break;case 60:this._addToken(this._match(61)?6:5);break;case 62:this._addToken(this._match(61)?8:7);break;case 38:this._match(38)?this._addToken(15):this._error(Qa("&&"));break;case 124:this._match(124)?this._addToken(16):this._error(Qa("||"));break;case 32:case 13:case 9:case 10:case 160:break;default:this._string()}}return this._start=this._current,this._addToken(20),Array.from(this._tokens)}_match(e){return!this._isAtEnd()&&(this._input.charCodeAt(this._current)===e&&(this._current++,!0))}_advance(){return this._input.charCodeAt(this._current++)}_peek(){return this._isAtEnd()?0:this._input.charCodeAt(this._current)}_addToken(e){this._tokens.push({type:e,offset:this._start})}_error(e){const t=this._start,i=this._input.substring(this._start,this._current),n={type:19,offset:this._start,lexeme:i};this._errors.push({offset:t,lexeme:i,additionalInfo:e}),this._tokens.push(n)}_string(){this.stringRe.lastIndex=this._start;const e=this.stringRe.exec(this._input);if(e){this._current=this._start+e[0].length;const t=this._input.substring(this._start,this._current),i=tl._keywords.get(t);i?this._addToken(i):this._tokens.push({type:17,lexeme:t,offset:this._start})}}_quotedString(){for(;39!==this._peek()&&!this._isAtEnd();)this._advance();this._isAtEnd()?this._error(Ja):(this._advance(),this._tokens.push({type:18,lexeme:this._input.substring(this._start+1,this._current-1),offset:this._start+1}))}_regex(){let e=this._current,t=!1,i=!1;for(;;){if(e>=this._input.length)return this._current=e,void this._error(el);const n=this._input.charCodeAt(e);if(t)t=!1;else{if(47===n&&!i){e++;break}91===n?i=!0:92===n?t=!0:93===n&&(i=!1)}e++}for(;e=this._input.length}}tl._regexFlags=new Set(["i","g","s","m","y","u"].map((e=>e.charCodeAt(0)))),tl._keywords=new Map([["not",14],["in",13],["false",12],["true",11]]);const il=new Map;il.set("false",!1),il.set("true",!0),il.set("isMac",Pe),il.set("isLinux",Fe),il.set("isWindows",Oe),il.set("isWeb",We),il.set("isMacNative",Pe&&!We),il.set("isEdge",et),il.set("isFirefox",Qe),il.set("isChrome",Xe),il.set("isSafari",Je);const nl=Object.prototype.hasOwnProperty,sl={regexParsingWithErrorRecovery:!0},ol=ue(0,"Empty context key expression"),rl=ue(0,"Did you forget to write an expression? You can also put 'false' or 'true' to always evaluate to false or true, respectively."),al=ue(0,"'in' after 'not'."),ll=ue(0,"closing parenthesis ')'"),hl=ue(0,"Unexpected token"),dl=ue(0,"Did you forget to put && or || before the token?"),cl=ue(0,"Unexpected end of expression"),ul=ue(0,"Did you forget to put a context key?");class gl{constructor(e=sl){this._config=e,this._scanner=new tl,this._tokens=[],this._current=0,this._parsingErrors=[],this._flagsGYRe=/g|y/g}parse(e){if(""!==e){this._tokens=this._scanner.reset(e).scan(),this._current=0,this._parsingErrors=[];try{const e=this._expr();if(!this._isAtEnd()){const e=this._peek(),t=17===e.type?dl:void 0;throw this._parsingErrors.push({message:hl,offset:e.offset,lexeme:tl.getLexeme(e),additionalInfo:t}),gl._parseError}return e}catch(Mre){if(Mre!==gl._parseError)throw Mre;return}}else this._parsingErrors.push({message:ol,offset:0,lexeme:"",additionalInfo:rl})}_expr(){return this._or()}_or(){const e=[this._and()];for(;this._matchOne(16);){const t=this._and();e.push(t)}return 1===e.length?e[0]:pl.or(...e)}_and(){const e=[this._term()];for(;this._matchOne(15);){const t=this._term();e.push(t)}return 1===e.length?e[0]:pl.and(...e)}_term(){if(this._matchOne(2)){const e=this._peek();switch(e.type){case 11:return this._advance(),fl.INSTANCE;case 12:return this._advance(),_l.INSTANCE;case 0:{this._advance();const e=this._expr();return this._consume(1,ll),null==e?void 0:e.negate()}case 17:return this._advance(),Sl.create(e.lexeme);default:throw this._errExpectedButGot("KEY | true | false | '(' expression ')'",e)}}return this._primary()}_primary(){const e=this._peek();switch(e.type){case 11:return this._advance(),pl.true();case 12:return this._advance(),pl.false();case 0:{this._advance();const e=this._expr();return this._consume(1,ll),e}case 17:{const t=e.lexeme;if(this._advance(),this._matchOne(9)){const e=this._peek();if(!this._config.regexParsingWithErrorRecovery){if(this._advance(),10!==e.type)throw this._errExpectedButGot("REGEX",e);const i=e.lexeme,n=i.lastIndexOf("/"),s=n===i.length-1?void 0:this._removeFlagsGY(i.substring(n+1));let o;try{o=new RegExp(i.substring(1,n),s)}catch(Mre){throw this._errExpectedButGot("REGEX",e)}return El.create(t,o)}switch(e.type){case 10:case 19:{const i=[e.lexeme];this._advance();let n=this._peek(),s=0;for(let t=0;t=0){const o=i.slice(t+1,s),r="i"===i[s+1]?"i":"";try{n=new RegExp(o,r)}catch(VU){throw this._errExpectedButGot("REGEX",e)}}}if(null===n)throw this._errExpectedButGot("REGEX",e);return El.create(t,n)}default:throw this._errExpectedButGot("REGEX",this._peek())}}if(this._matchOne(14)){this._consume(13,al);const e=this._value();return pl.notIn(t,e)}switch(this._peek().type){case 3:{this._advance();const e=this._value();if(18===this._previous().type)return pl.equals(t,e);switch(e){case"true":return pl.has(t);case"false":return pl.not(t);default:return pl.equals(t,e)}}case 4:{this._advance();const e=this._value();if(18===this._previous().type)return pl.notEquals(t,e);switch(e){case"true":return pl.not(t);case"false":return pl.has(t);default:return pl.notEquals(t,e)}}case 5:return this._advance(),xl.create(t,this._value());case 6:return this._advance(),Nl.create(t,this._value());case 7:return this._advance(),kl.create(t,this._value());case 8:return this._advance(),Dl.create(t,this._value());case 13:return this._advance(),pl.in(t,this._value());default:return pl.has(t)}}case 20:throw this._parsingErrors.push({message:cl,offset:e.offset,lexeme:"",additionalInfo:ul}),gl._parseError;default:throw this._errExpectedButGot("true | false | KEY \n\t| KEY '=~' REGEX \n\t| KEY ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value",this._peek())}}_value(){const e=this._peek();switch(e.type){case 17:case 18:return this._advance(),e.lexeme;case 11:return this._advance(),"true";case 12:return this._advance(),"false";case 13:return this._advance(),"in";default:return""}}_removeFlagsGY(e){return e.replaceAll(this._flagsGYRe,"")}_previous(){return this._tokens[this._current-1]}_matchOne(e){return!!this._check(e)&&(this._advance(),!0)}_advance(){return this._isAtEnd()||this._current++,this._previous()}_consume(e,t){if(this._check(e))return this._advance();throw this._errExpectedButGot(t,this._peek())}_errExpectedButGot(e,t,i){const n=ue(0,"Expected: {0}\nReceived: '{1}'.",e,tl.getLexeme(t)),s=t.offset,o=tl.getLexeme(t);return this._parsingErrors.push({message:n,offset:s,lexeme:o,additionalInfo:i}),gl._parseError}_check(e){return this._peek().type===e}_peek(){return this._tokens[this._current]}_isAtEnd(){return 20===this._peek().type}}gl._parseError=new Error;class pl{static false(){return fl.INSTANCE}static true(){return _l.INSTANCE}static has(e){return vl.create(e)}static equals(e,t){return bl.create(e,t)}static notEquals(e,t){return yl.create(e,t)}static regex(e,t){return El.create(e,t)}static in(e,t){return Cl.create(e,t)}static notIn(e,t){return wl.create(e,t)}static not(e){return Sl.create(e)}static and(...e){return Tl.create(e,null,!0)}static or(...e){return Rl.create(e,null,!0)}static deserialize(e){if(null==e)return;return this._parser.parse(e)}}function ml(e,t){return e.cmp(t)}pl._parser=new gl({regexParsingWithErrorRecovery:!1});class fl{constructor(){this.type=0}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!1}serialize(){return"false"}keys(){return[]}negate(){return _l.INSTANCE}}fl.INSTANCE=new fl;class _l{constructor(){this.type=1}cmp(e){return this.type-e.type}equals(e){return e.type===this.type}substituteConstants(){return this}evaluate(e){return!0}serialize(){return"true"}keys(){return[]}negate(){return fl.INSTANCE}}_l.INSTANCE=new _l;class vl{static create(e,t=null){const i=il.get(e);return"boolean"==typeof i?i?_l.INSTANCE:fl.INSTANCE:new vl(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=2}cmp(e){return e.type!==this.type?this.type-e.type:Pl(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=il.get(this.key);return"boolean"==typeof e?e?_l.INSTANCE:fl.INSTANCE:this}evaluate(e){return!!e.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=Sl.create(this.key,this)),this.negated}}class bl{static create(e,t,i=null){if("boolean"==typeof t)return t?vl.create(e,i):Sl.create(e,i);const n=il.get(e);if("boolean"==typeof n){return t===(n?"true":"false")?_l.INSTANCE:fl.INSTANCE}return new bl(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=4}cmp(e){return e.type!==this.type?this.type-e.type:Fl(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){const e=il.get(this.key);if("boolean"==typeof e){const t=e?"true":"false";return this.value===t?_l.INSTANCE:fl.INSTANCE}return this}evaluate(e){return e.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=yl.create(this.key,this.value,this)),this.negated}}class Cl{static create(e,t){return new Cl(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=10,this.negated=null}cmp(e){return e.type!==this.type?this.type-e.type:Fl(this.key,this.valueKey,e.key,e.valueKey)}equals(e){return e.type===this.type&&(this.key===e.key&&this.valueKey===e.valueKey)}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.valueKey),i=e.getValue(this.key);return Array.isArray(t)?t.includes(i):"string"==typeof i&&"object"==typeof t&&null!==t&&nl.call(t,i)}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=wl.create(this.key,this.valueKey)),this.negated}}class wl{static create(e,t){return new wl(e,t)}constructor(e,t){this.key=e,this.valueKey=t,this.type=11,this._negated=Cl.create(e,t)}cmp(e){return e.type!==this.type?this.type-e.type:this._negated.cmp(e._negated)}equals(e){return e.type===this.type&&this._negated.equals(e._negated)}substituteConstants(){return this}evaluate(e){return!this._negated.evaluate(e)}serialize(){return`${this.key} not in '${this.valueKey}'`}keys(){return this._negated.keys()}negate(){return this._negated}}class yl{static create(e,t,i=null){if("boolean"==typeof t)return t?Sl.create(e,i):vl.create(e,i);const n=il.get(e);if("boolean"==typeof n){return t===(n?"true":"false")?fl.INSTANCE:_l.INSTANCE}return new yl(e,t,i)}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=5}cmp(e){return e.type!==this.type?this.type-e.type:Fl(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){const e=il.get(this.key);if("boolean"==typeof e){const t=e?"true":"false";return this.value===t?fl.INSTANCE:_l.INSTANCE}return this}evaluate(e){return e.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=bl.create(this.key,this.value,this)),this.negated}}class Sl{static create(e,t=null){const i=il.get(e);return"boolean"==typeof i?i?fl.INSTANCE:_l.INSTANCE:new Sl(e,t)}constructor(e,t){this.key=e,this.negated=t,this.type=3}cmp(e){return e.type!==this.type?this.type-e.type:Pl(this.key,e.key)}equals(e){return e.type===this.type&&this.key===e.key}substituteConstants(){const e=il.get(this.key);return"boolean"==typeof e?e?fl.INSTANCE:_l.INSTANCE:this}evaluate(e){return!e.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=vl.create(this.key,this)),this.negated}}function Ll(e,t){if("string"==typeof e){const t=parseFloat(e);isNaN(t)||(e=t)}return"string"==typeof e||"number"==typeof e?t(e):fl.INSTANCE}class kl{static create(e,t,i=null){return Ll(t,(t=>new kl(e,t,i)))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=12}cmp(e){return e.type!==this.type?this.type-e.type:Fl(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Nl.create(this.key,this.value,this)),this.negated}}class Dl{static create(e,t,i=null){return Ll(t,(t=>new Dl(e,t,i)))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=13}cmp(e){return e.type!==this.type?this.type-e.type:Fl(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=xl.create(this.key,this.value,this)),this.negated}}class xl{static create(e,t,i=null){return Ll(t,(t=>new xl(e,t,i)))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=14}cmp(e){return e.type!==this.type?this.type-e.type:Fl(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))new Nl(e,t,i)))}constructor(e,t,i){this.key=e,this.value=t,this.negated=i,this.type=15}cmp(e){return e.type!==this.type?this.type-e.type:Fl(this.key,this.value,e.key,e.value)}equals(e){return e.type===this.type&&(this.key===e.key&&this.value===e.value)}substituteConstants(){return this}evaluate(e){return"string"!=typeof this.value&&parseFloat(e.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=kl.create(this.key,this.value,this)),this.negated}}class El{static create(e,t){return new El(e,t)}constructor(e,t){this.key=e,this.regexp=t,this.type=7,this.negated=null}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.keye.key)return 1;const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return ti?1:0}equals(e){if(e.type===this.type){const t=this.regexp?this.regexp.source:"",i=e.regexp?e.regexp.source:"";return this.key===e.key&&t===i}return!1}substituteConstants(){return this}evaluate(e){const t=e.getValue(this.key);return!!this.regexp&&this.regexp.test(t)}serialize(){const e=this.regexp?`/${this.regexp.source}/${this.regexp.flags}`:"/invalid/";return`${this.key} =~ ${e}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=Il.create(this)),this.negated}}class Il{static create(e){return new Il(e)}constructor(e){this._actual=e,this.type=8}cmp(e){return e.type!==this.type?this.type-e.type:this._actual.cmp(e._actual)}equals(e){return e.type===this.type&&this._actual.equals(e._actual)}substituteConstants(){return this}evaluate(e){return!this._actual.evaluate(e)}serialize(){return`!(${this._actual.serialize()})`}keys(){return this._actual.keys()}negate(){return this._actual}}function Ml(e){let t=null;for(let i=0,n=e.length;ie.expr.length)return 1;for(let t=0,i=this.expr.length;t1;){const e=n[n.length-1];if(9!==e.type)break;n.pop();const t=n.pop(),s=0===n.length,o=Rl.create(e.expr.map((e=>Tl.create([e,t],null,i))),null,s);o&&(n.push(o),n.sort(ml))}if(1===n.length)return n[0];if(i){for(let e=0;ee.serialize())).join(" && ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());this.negated=Rl.create(e,this,!0)}return this.negated}}class Rl{static create(e,t,i){return Rl._normalizeArr(e,t,i)}constructor(e,t){this.expr=e,this.negated=t,this.type=9}cmp(e){if(e.type!==this.type)return this.type-e.type;if(this.expr.lengthe.expr.length)return 1;for(let t=0,i=this.expr.length;te.serialize())).join(" || ")}keys(){const e=[];for(const t of this.expr)e.push(...t.keys());return e}negate(){if(!this.negated){const e=[];for(const t of this.expr)e.push(t.negate());for(;e.length>1;){const t=e.shift(),i=e.shift(),n=[];for(const e of Vl(t))for(const t of Vl(i))n.push(Tl.create([e,t],null,!1));e.unshift(Rl.create(n,null,!1))}this.negated=Rl.create(e,this,!0)}return this.negated}}class Al extends vl{static all(){return Al._info.values()}constructor(e,t,i){super(e,null),this._defaultValue=t,"object"==typeof i?Al._info.push(Object.assign(Object.assign({},i),{key:e})):!0!==i&&Al._info.push({key:e,description:i,type:null!=t?typeof t:void 0})}bindTo(e){return e.createKey(this.key,this._defaultValue)}getValue(e){return e.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(e){return bl.create(this.key,e)}}Al._info=[];const Ol=Ba("contextKeyService");function Pl(e,t){return et?1:0}function Fl(e,t,i,n){return ei?1:tn?1:0}function Bl(e,t){if(0===e.type||1===t.type)return!0;if(9===e.type)return 9===t.type&&Wl(e.expr,t.expr);if(9===t.type){for(const i of t.expr)if(Bl(e,i))return!0;return!1}if(6===e.type){if(6===t.type)return Wl(t.expr,e.expr);for(const i of e.expr)if(Bl(i,t))return!0;return!1}return e.equals(t)}function Wl(e,t){let i=0,n=0;for(;i{r(),this._cachedMergedKeybindings=null}))}getDefaultKeybindings(){return this._cachedMergedKeybindings||(this._cachedMergedKeybindings=Array.from(this._coreKeybindings).concat(this._extensionKeybindings),this._cachedMergedKeybindings.sort(Gl)),this._cachedMergedKeybindings.slice(0)}}const $l=new ql;function Gl(e,t){if(e.weight1!==t.weight1)return e.weight1-t.weight1;if(e.command&&t.command){if(e.commandt.command)return 1}return e.weight2-t.weight2}jl.add("platform.keybindingsRegistry",$l);var Zl,Yl=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Xl=function(e,t){return function(i,n){t(i,n,e)}},Ql=function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var s=0;for(n=Object.getOwnPropertySymbols(e);st===e}}ih._all=new Map;const nh=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new $({merge:ih.merge}),this.onDidChangeMenu=this._onDidChangeMenu.event}addCommand(e){return this._commands.set(e.id,e),this._onDidChangeMenu.fire(ih.for(eh.CommandPalette)),x((()=>{this._commands.delete(e.id)&&this._onDidChangeMenu.fire(ih.for(eh.CommandPalette))}))}getCommand(e){return this._commands.get(e)}getCommands(){const e=new Map;return this._commands.forEach(((t,i)=>e.set(i,t))),e}appendMenuItem(e,t){let i=this._menuItems.get(e);i||(i=new O,this._menuItems.set(e,i));const n=i.push(t);return this._onDidChangeMenu.fire(ih.for(e)),x((()=>{n(),this._onDidChangeMenu.fire(ih.for(e))}))}appendMenuItems(e){const t=new N;for(const{id:i,item:n}of e)t.add(this.appendMenuItem(i,n));return t}getMenuItems(e){let t;return t=this._menuItems.has(e)?[...this._menuItems.get(e)]:[],e===eh.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(e){const t=new Set;for(const i of e)Jl(i)&&(t.add(i.command.id),i.alt&&t.add(i.alt.id));this._commands.forEach(((i,n)=>{t.has(n)||e.push({command:i})}))}};class sh extends $a{constructor(e,t,i){super(`submenuitem.${e.submenu.id}`,"string"==typeof e.title?e.title:e.title.value,i,"submenu"),this.item=e,this.hideActions=t}}let oh=Zl=class{static label(e,t){return(null==t?void 0:t.renderShortTitle)&&e.shortTitle?"string"==typeof e.shortTitle?e.shortTitle:e.shortTitle.value:"string"==typeof e.title?e.title:e.title.value}constructor(e,t,i,n,s,o){var r,a;let l;if(this.hideActions=n,this._commandService=o,this.id=e.id,this.label=Zl.label(e,i),this.tooltip=null!==(a="string"==typeof e.tooltip?e.tooltip:null===(r=e.tooltip)||void 0===r?void 0:r.value)&&void 0!==a?a:"",this.enabled=!e.precondition||s.contextMatchesRules(e.precondition),this.checked=void 0,e.toggled){const t=e.toggled.condition?e.toggled:{condition:e.toggled};this.checked=s.contextMatchesRules(t.condition),this.checked&&t.tooltip&&(this.tooltip="string"==typeof t.tooltip?t.tooltip:t.tooltip.value),this.checked&&ta.isThemeIcon(t.icon)&&(l=t.icon),this.checked&&t.title&&(this.label="string"==typeof t.title?t.title:t.title.value)}l||(l=ta.isThemeIcon(e.icon)?e.icon:void 0),this.item=e,this.alt=t?new Zl(t,void 0,i,n,s,o):void 0,this._options=i,this.class=l&&ta.asClassName(l)}run(...e){var t,i;let n=[];return(null===(t=this._options)||void 0===t?void 0:t.arg)&&(n=[...n,this._options.arg]),(null===(i=this._options)||void 0===i?void 0:i.shouldForwardArgs)&&(n=[...n,...e]),this._commandService.executeCommand(this.id,...n)}};oh=Zl=Yl([Xl(4,Ol),Xl(5,Ya)],oh);class rh{constructor(e){this.desc=e}}function ah(e){const t=new N,i=new e,n=i.desc,{f1:s,menu:o,keybinding:r,description:a}=n,l=Ql(n,["f1","menu","keybinding","description"]);if(t.add(Xa.registerCommand({id:l.id,handler:(e,...t)=>i.run(e,...t),description:a})),Array.isArray(o))for(const h of o)t.add(nh.appendMenuItem(h.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:null===h.precondition?void 0:l.precondition})},h)));else o&&t.add(nh.appendMenuItem(o.id,Object.assign({command:Object.assign(Object.assign({},l),{precondition:null===o.precondition?void 0:l.precondition})},o)));if(s&&(t.add(nh.appendMenuItem(eh.CommandPalette,{command:l,when:l.precondition})),t.add(nh.addCommand(l))),Array.isArray(r))for(const h of r)t.add($l.registerKeybindingRule(Object.assign(Object.assign({},h),{id:l.id,when:l.precondition?pl.and(l.precondition,h.when):h.when})));else r&&t.add($l.registerKeybindingRule(Object.assign(Object.assign({},r),{id:l.id,when:l.precondition?pl.and(l.precondition,r.when):r.when})));return t}const lh=Ba("telemetryService"),hh=Ba("logService");var dh;!function(e){e[e.Off=0]="Off",e[e.Trace=1]="Trace",e[e.Debug=2]="Debug",e[e.Info=3]="Info",e[e.Warning=4]="Warning",e[e.Error=5]="Error"}(dh||(dh={}));const ch=dh.Info;class uh extends E{constructor(){super(...arguments),this.level=ch,this._onDidChangeLogLevel=this._register(new U),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!==dh.Off&&this.level<=e}}class gh extends uh{constructor(e=ch,t=!0){super(),this.useColors=t,this.setLevel(e)}trace(e,...t){this.checkLogLevel(dh.Trace)&&(this.useColors?console.log("%cTRACE","color: #888",e,...t):console.log(e,...t))}debug(e,...t){this.checkLogLevel(dh.Debug)&&(this.useColors?console.log("%cDEBUG","background: #eee; color: #888",e,...t):console.log(e,...t))}info(e,...t){this.checkLogLevel(dh.Info)&&(this.useColors?console.log("%c INFO","color: #33f",e,...t):console.log(e,...t))}warn(e,...t){this.checkLogLevel(dh.Warning)&&(this.useColors?console.log("%c WARN","color: #993",e,...t):console.log(e,...t))}error(e,...t){this.checkLogLevel(dh.Error)&&(this.useColors?console.log("%c ERR","color: #f33",e,...t):console.error(e,...t))}dispose(){}}class ph extends uh{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)}dispose(){for(const e of this.loggers)e.dispose()}}new Al("logLevel",function(e){switch(e){case dh.Trace:return"trace";case dh.Debug:return"debug";case dh.Info:return"info";case dh.Warning:return"warn";case dh.Error:return"error";case dh.Off:return"off"}}(dh.Info));class mh{constructor(e){this.id=e.id,this.precondition=e.precondition,this._kbOpts=e.kbOpts,this._menuOpts=e.menuOpts,this._description=e.description}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 e=t.kbExpr;this.precondition&&(e=e?pl.and(e,this.precondition):this.precondition);const i={id:this.id,weight:t.weight,args:t.args,when:e,primary:t.primary,secondary:t.secondary,win:t.win,linux:t.linux,mac:t.mac};$l.registerKeybindingRule(i)}}Xa.registerCommand({id:this.id,handler:(e,t)=>this.runCommand(e,t),description:this._description})}_registerMenuItem(e){nh.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 fh extends mh{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(((e,t)=>t.priority-e.priority)),{dispose:()=>{for(let e=0;e{if(e.get(Ol).contextMatchesRules(null!=i?i:void 0))return n(e,o,t)}))}runCommand(e,t){return vh.runEditorCommand(e,t,this.precondition,((e,t,i)=>this.runEditorCommand(e,t,i)))}}class bh extends vh{static convertOptions(e){let t;function i(t){return t.menuId||(t.menuId=eh.EditorContext),t.title||(t.title=e.label),t.when=pl.and(e.precondition,t.when),t}return t=Array.isArray(e.menuOpts)?e.menuOpts:e.menuOpts?[e.menuOpts]:[],Array.isArray(e.contextMenuOpts)?t.push(...e.contextMenuOpts.map(i)):e.contextMenuOpts&&t.push(i(e.contextMenuOpts)),e.menuOpts=t,e}constructor(e){super(bh.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(lh).publicLog2("editorActionInvoked",{name:this.label,id:this.id})}}class Ch extends bh{constructor(){super(...arguments),this._implementations=[]}addImplementation(e,t){return this._implementations.push([e,t]),this._implementations.sort(((e,t)=>t[0]-e[0])),{dispose:()=>{for(let e=0;e{var i,s;const o=e.get(Ol),r=e.get(hh);if(o.contextMatchesRules(null!==(i=this.desc.precondition)&&void 0!==i?i:void 0))return this.runEditorCommand(e,n,...t);r.debug("[EditorAction2] NOT running command because its precondition is FALSE",this.desc.id,null===(s=this.desc.precondition)||void 0===s?void 0:s.serialize())}))}}function yh(e,t){Xa.registerCommand(e,(function(e,...i){const n=e.get(Fa),[s,o]=i;qr(an.isUri(s)),qr(Va.isIPosition(o));const r=e.get(Ha).getModel(s);if(r){const e=Va.lift(o);return n.invokeFunction(t,r,e,...i.slice(2))}return e.get(za).createModelReference(s).then((e=>new Promise(((s,r)=>{try{s(n.invokeFunction(t,e.object.textEditorModel,Va.lift(o),i.slice(2)))}catch(a){r(a)}})).finally((()=>{e.dispose()}))))}))}function Sh(e){return Nh.INSTANCE.registerEditorCommand(e),e}function Lh(e){const t=new e;return Nh.INSTANCE.registerEditorAction(t),t}function kh(e){return Nh.INSTANCE.registerEditorAction(e),e}function Dh(e,t,i){Nh.INSTANCE.registerEditorContribution(e,t,i)}var xh;!function(e){e.getEditorCommand=function(e){return Nh.INSTANCE.getEditorCommand(e)},e.getEditorActions=function(){return Nh.INSTANCE.getEditorActions()},e.getEditorContributions=function(){return Nh.INSTANCE.getEditorContributions()},e.getSomeEditorContributions=function(e){return Nh.INSTANCE.getEditorContributions().filter((t=>e.indexOf(t.id)>=0))},e.getDiffEditorContributions=function(){return Nh.INSTANCE.getDiffEditorContributions()}}(xh||(xh={}));class Nh{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)}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}}function Eh(e){return e.register(),e}Nh.INSTANCE=new Nh,jl.add("editor.contributions",Nh.INSTANCE);const Ih=Eh(new fh({id:"undo",precondition:void 0,kbOpts:{weight:0,primary:2104},menuOpts:[{menuId:eh.MenubarEditMenu,group:"1_do",title:ue(0,"&&Undo"),order:1},{menuId:eh.CommandPalette,group:"",title:ue(0,"Undo"),order:1}]}));Eh(new _h(Ih,{id:"default:undo",precondition:void 0}));const Mh=Eh(new fh({id:"redo",precondition:void 0,kbOpts:{weight:0,primary:2103,secondary:[3128],mac:{primary:3128}},menuOpts:[{menuId:eh.MenubarEditMenu,group:"1_do",title:ue(0,"&&Redo"),order:2},{menuId:eh.CommandPalette,group:"",title:ue(0,"Redo"),order:1}]}));Eh(new _h(Mh,{id:"default:redo",precondition:void 0}));const Th=Eh(new fh({id:"editor.action.selectAll",precondition:void 0,kbOpts:{weight:0,kbExpr:null,primary:2079},menuOpts:[{menuId:eh.MenubarSelectionMenu,group:"1_basic",title:ue(0,"&&Select All"),order:1},{menuId:eh.CommandPalette,group:"",title:ue(0,"Select All"),order:1}]}));class Rh{constructor(e,t,i,n){e>i||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 Rh.isEmpty(this)}static isEmpty(e){return e.startLineNumber===e.endLineNumber&&e.startColumn===e.endColumn}containsPosition(e){return Rh.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 Rh.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 Rh.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 Rh.plusRange(this,e)}static plusRange(e,t){let i,n,s,o;return t.startLineNumbere.endLineNumber?(s=t.endLineNumber,o=t.endColumn):t.endLineNumber===e.endLineNumber?(s=t.endLineNumber,o=Math.max(t.endColumn,e.endColumn)):(s=e.endLineNumber,o=e.endColumn),new Rh(i,n,s,o)}intersectRanges(e){return Rh.intersectRanges(this,e)}static intersectRanges(e,t){let i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,o=e.endColumn;const r=t.startLineNumber,a=t.startColumn,l=t.endLineNumber,h=t.endColumn;return il?(s=l,o=h):s===l&&(o=Math.min(o,h)),i>s||i===s&&n>o?null:new Rh(i,n,s,o)}equalsRange(e){return Rh.equalsRange(this,e)}static equalsRange(e,t){return!e&&!t||!!e&&!!t&&e.startLineNumber===t.startLineNumber&&e.startColumn===t.startColumn&&e.endLineNumber===t.endLineNumber&&e.endColumn===t.endColumn}getEndPosition(){return Rh.getEndPosition(this)}static getEndPosition(e){return new Va(e.endLineNumber,e.endColumn)}getStartPosition(){return Rh.getStartPosition(this)}static getStartPosition(e){return new Va(e.startLineNumber,e.startColumn)}toString(){return"["+this.startLineNumber+","+this.startColumn+" -> "+this.endLineNumber+","+this.endColumn+"]"}setEndPosition(e,t){return new Rh(this.startLineNumber,this.startColumn,e,t)}setStartPosition(e,t){return new Rh(e,t,this.endLineNumber,this.endColumn)}collapseToStart(){return Rh.collapseToStart(this)}static collapseToStart(e){return new Rh(e.startLineNumber,e.startColumn,e.startLineNumber,e.startColumn)}collapseToEnd(){return Rh.collapseToEnd(this)}static collapseToEnd(e){return new Rh(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn)}delta(e){return new Rh(this.startLineNumber+e,this.startColumn,this.endLineNumber+e,this.endColumn)}static fromPositions(e,t=e){return new Rh(e.lineNumber,e.column,t.lineNumber,t.column)}static lift(e){return e?new Rh(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):null}static isIRange(e){return e&&"number"==typeof e.startLineNumber&&"number"==typeof e.startColumn&&"number"==typeof e.endLineNumber&&"number"==typeof e.endColumn}static areIntersectingOrTouching(e,t){return!(e.endLineNumbere.startLineNumber}toJSON(){return this}}class Ah extends Rh{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 Ah.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?0:1}setEndPosition(e,t){return 0===this.getDirection()?new Ah(this.startLineNumber,this.startColumn,e,t):new Ah(e,t,this.startLineNumber,this.startColumn)}getPosition(){return new Va(this.positionLineNumber,this.positionColumn)}getSelectionStart(){return new Va(this.selectionStartLineNumber,this.selectionStartColumn)}setStartPosition(e,t){return 0===this.getDirection()?new Ah(e,t,this.endLineNumber,this.endColumn):new Ah(this.endLineNumber,this.endColumn,e,t)}static fromPositions(e,t=e){return new Ah(e.lineNumber,e.column,t.lineNumber,t.column)}static fromRange(e,t){return 0===t?new Ah(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn):new Ah(e.endLineNumber,e.endColumn,e.startLineNumber,e.startColumn)}static liftSelection(e){return new Ah(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=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Bh=function(e,t){return function(i,n){t(i,n,e)}},Wh=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Vh=new Al("selectionAnchorSet",!1);let Hh=Ph=class{static get(e){return e.getContribution(Ph.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=Vh.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(Ah.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:(new Ta).appendText(ue(0,"Selection Anchor")),className:"selection-anchor"})})),this.selectionAnchorSetContextKey.set(!!this.decorationId),Ps(ue(0,"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(Ah.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()}};Hh.ID="editor.contrib.selectionAnchorController",Hh=Ph=Fh([Bh(1,Ol)],Hh);Dh(Hh.ID,Hh,4),Lh(class extends bh{constructor(){super({id:"editor.action.setSelectionAnchor",label:ue(0,"Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2080),weight:100}})}run(e,t){var i;return Wh(this,void 0,void 0,(function*(){null===(i=Hh.get(t))||void 0===i||i.setSelectionAnchor()}))}}),Lh(class extends bh{constructor(){super({id:"editor.action.goToSelectionAnchor",label:ue(0,"Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:Vh})}run(e,t){var i;return Wh(this,void 0,void 0,(function*(){null===(i=Hh.get(t))||void 0===i||i.goToSelectionAnchor()}))}}),Lh(class extends bh{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:ue(0,"Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:Vh,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2089),weight:100}})}run(e,t){var i;return Wh(this,void 0,void 0,(function*(){null===(i=Hh.get(t))||void 0===i||i.selectFromAnchorToCursor()}))}}),Lh(class extends bh{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:ue(0,"Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:Vh,kbOpts:{kbExpr:Oh.editorTextFocus,primary:9,weight:100}})}run(e,t){var i;return Wh(this,void 0,void 0,(function*(){null===(i=Hh.get(t))||void 0===i||i.cancelSelectionAnchor()}))}});const zh=Object.freeze((function(e,t){const i=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(i)}}}));var Uh;!function(e){e.isCancellationToken=function(t){return t===e.None||t===e.Cancelled||(t instanceof Kh||!(!t||"object"!=typeof t)&&("boolean"==typeof t.isCancellationRequested&&"function"==typeof t.onCancellationRequested))},e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:B.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:zh})}(Uh||(Uh={}));class Kh{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?zh:(this._emitter||(this._emitter=new U),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}}class jh{constructor(e){this._token=void 0,this._parentListener=void 0,this._parentListener=e&&e.onCancellationRequested(this.cancel,this)}get token(){return this._token||(this._token=new Kh),this._token}cancel(){this._token?this._token instanceof Kh&&this._token.cancel():this._token=Uh.Cancelled}dispose(e=!1){var t;e&&this.cancel(),null===(t=this._parentListener)||void 0===t||t.dispose(),this._token?this._token instanceof Kh&&this._token.dispose():this._token=Uh.None}}const qh=Symbol("MicrotaskDelay");var $h=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))},Gh=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=e[i]&&function(t){return new Promise((function(n,s){(function(e,t,i,n){Promise.resolve(n).then((function(t){e({value:t,done:i})}),t)})(n,s,(t=e[i](t)).done,t.value)}))}}};function Zh(e){return!!e&&"function"==typeof e.then}function Yh(e){const t=new jh,i=e(t.token),n=new Promise(((e,n)=>{const s=t.token.onCancellationRequested((()=>{s.dispose(),t.dispose(),n(new c)}));Promise.resolve(i).then((i=>{s.dispose(),t.dispose(),e(i)}),(e=>{s.dispose(),t.dispose(),n(e)}))}));return new class{cancel(){t.cancel()}then(e,t){return n.then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return n.finally(e)}}}function Xh(e,t,i){return new Promise(((n,s)=>{const o=t.onCancellationRequested((()=>{o.dispose(),n(i)}));e.then(n,s).finally((()=>o.dispose()))}))}class Qh{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 e=()=>{if(this.queuedPromise=null,this.isDisposed)return;const e=this.queue(this.queuedPromiseFactory);return this.queuedPromiseFactory=null,e};this.queuedPromise=new Promise((t=>{this.activePromise.then(e,e).then(t)}))}return new Promise(((e,t)=>{this.queuedPromise.then(e,t)}))}return this.activePromise=e(),new Promise(((e,t)=>{this.activePromise.then((t=>{this.activePromise=null,e(t)}),(e=>{this.activePromise=null,t(e)}))}))}dispose(){this.isDisposed=!0}}class Jh{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(((e,t)=>{this.doResolve=e,this.doReject=t})).then((()=>{if(this.completionPromise=null,this.doResolve=null,this.task){const e=this.task;return this.task=null,e()}})));const i=()=>{var e;this.deferred=null,null===(e=this.doResolve)||void 0===e||e.call(this,null)};return this.deferred=t===qh?(e=>{let t=!0;return queueMicrotask((()=>{t&&(t=!1,e())})),{isTriggered:()=>t,dispose:()=>{t=!1}}})(i):((e,t)=>{let i=!0;const n=setTimeout((()=>{i=!1,t()}),e);return{isTriggered:()=>i,dispose:()=>{clearTimeout(n),i=!1}}})(t,i),this.completionPromise}isTriggered(){var e;return!!(null===(e=this.deferred)||void 0===e?void 0:e.isTriggered())}cancel(){var e;this.cancelTimeout(),this.completionPromise&&(null===(e=this.doReject)||void 0===e||e.call(this,new c),this.completionPromise=null)}cancelTimeout(){var e;null===(e=this.deferred)||void 0===e||e.dispose(),this.deferred=null}dispose(){this.cancel()}}class ed{constructor(e){this.delayer=new Jh(e),this.throttler=new Qh}trigger(e,t){return this.delayer.trigger((()=>this.throttler.queue(e)),t)}cancel(){this.delayer.cancel()}dispose(){this.delayer.dispose(),this.throttler.dispose()}}function td(e,t){return t?new Promise(((i,n)=>{const s=setTimeout((()=>{o.dispose(),i()}),e),o=t.onCancellationRequested((()=>{clearTimeout(s),o.dispose(),n(new c)}))})):Yh((t=>td(e,t)))}function id(e,t=0,i){const n=setTimeout((()=>{e(),i&&s.dispose()}),t),s=x((()=>{clearTimeout(n),null==i||i.deleteAndLeak(s)}));return null==i||i.add(s),s}function nd(e,t=e=>!!e,i=null){let n=0;const s=e.length,o=()=>{if(n>=s)return Promise.resolve(i);const r=e[n++];return Promise.resolve(r()).then((e=>t(e)?Promise.resolve(e):o()))};return o()}class sd{constructor(e,t){this._token=-1,"function"==typeof e&&"number"==typeof t&&this.setIfNotSet(e,t)}dispose(){this.cancel()}cancel(){-1!==this._token&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setTimeout((()=>{this._token=-1,e()}),t)}setIfNotSet(e,t){-1===this._token&&(this._token=setTimeout((()=>{this._token=-1,e()}),t))}}class od{constructor(){this._token=-1}dispose(){this.cancel()}cancel(){-1!==this._token&&(clearInterval(this._token),this._token=-1)}cancelAndSet(e,t){this.cancel(),this._token=setInterval((()=>{e()}),t)}}class rd{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-1!==this.timeoutToken}onTimeout(){this.timeoutToken=-1,this.runner&&this.doRun()}doRun(){var e;null===(e=this.runner)||void 0===e||e.call(this)}}let ad;ad="function"!=typeof requestIdleCallback||"function"!=typeof cancelIdleCallback?e=>{qe((()=>{if(t)return;const i=Date.now()+15;e(Object.freeze({didTimeout:!0,timeRemaining:()=>Math.max(0,i-Date.now())}))}));let t=!1;return{dispose(){t||(t=!0)}}}:(e,t)=>{const i=requestIdleCallback(e,"number"==typeof t?{timeout:t}:void 0);let n=!1;return{dispose(){n||(n=!0,cancelIdleCallback(i))}}};class ld{constructor(e){this._didRun=!1,this._executor=()=>{try{this._value=e()}catch(t){this._error=t}finally{this._didRun=!0}},this._handle=ad((()=>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 hd{get isRejected(){var e;return 1===(null===(e=this.outcome)||void 0===e?void 0:e.outcome)}get isSettled(){return!!this.outcome}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:0,value:e},t()}))}error(e){return new Promise((t=>{this.errorCallback(e),this.outcome={outcome:1,value:e},t()}))}cancel(){return this.error(new c)}}var dd;!function(e){e.settled=function(e){return $h(this,void 0,void 0,(function*(){let t;const i=yield Promise.all(e.map((e=>e.then((e=>e),(e=>{t||(t=e)})))));if(void 0!==t)throw t;return i}))},e.withAsyncBody=function(e){return new Promise(((t,i)=>$h(this,void 0,void 0,(function*(){try{yield e(t,i)}catch(n){i(n)}}))))}}(dd||(dd={}));class cd{static fromArray(e){return new cd((t=>{t.emitMany(e)}))}static fromPromise(e){return new cd((t=>$h(this,void 0,void 0,(function*(){t.emitMany(yield e)}))))}static fromPromises(e){return new cd((t=>$h(this,void 0,void 0,(function*(){yield Promise.all(e.map((e=>$h(this,void 0,void 0,(function*(){return t.emitOne(yield e)})))))}))))}static merge(e){return new cd((t=>$h(this,void 0,void 0,(function*(){yield Promise.all(e.map((e=>{var i,n,s;return $h(this,void 0,void 0,(function*(){var o,r,a,l;try{for(i=!0,n=Gh(e);!(o=(s=yield n.next()).done);i=!0){l=s.value,i=!1;const e=l;t.emitOne(e)}}catch(h){r={error:h}}finally{try{i||o||!(a=n.return)||(yield a.call(n))}finally{if(r)throw r.error}}}))})))}))))}constructor(e){this._state=0,this._results=[],this._error=null,this._onStateChanged=new U,queueMicrotask((()=>$h(this,void 0,void 0,(function*(){const t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{yield Promise.resolve(e(t)),this.resolve()}catch(i){this.reject(i)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}}))))}[Symbol.asyncIterator](){let e=0;return{next:()=>$h(this,void 0,void 0,(function*(){for(;;){if(2===this._state)throw this._error;if(e$h(this,void 0,void 0,(function*(){var n,s,o,r;try{for(var a,l=!0,h=Gh(e);!(n=(a=yield h.next()).done);l=!0){r=a.value,l=!1;const e=r;i.emitOne(t(e))}}catch(d){s={error:d}}finally{try{l||n||!(o=h.return)||(yield o.call(h))}finally{if(s)throw s.error}}}))))}map(e){return cd.map(this,e)}static filter(e,t){return new cd((i=>$h(this,void 0,void 0,(function*(){var n,s,o,r;try{for(var a,l=!0,h=Gh(e);!(n=(a=yield h.next()).done);l=!0){r=a.value,l=!1;const e=r;t(e)&&i.emitOne(e)}}catch(d){s={error:d}}finally{try{l||n||!(o=h.return)||(yield o.call(h))}finally{if(s)throw s.error}}}))))}filter(e){return cd.filter(this,e)}static coalesce(e){return cd.filter(e,(e=>!!e))}coalesce(){return cd.coalesce(this)}static toPromise(e){var t,i,n,s,o,r,a;return $h(this,void 0,void 0,(function*(){const l=[];try{for(t=!0,i=Gh(e);n=yield i.next(),!(s=n.done);t=!0){a=n.value,t=!1;const e=a;l.push(e)}}catch(h){o={error:h}}finally{try{t||s||!(r=i.return)||(yield r.call(i))}finally{if(o)throw o.error}}return l}))}toPromise(){return cd.toPromise(this)}emitOne(e){0===this._state&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){0===this._state&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){0===this._state&&(this._state=1,this._onStateChanged.fire())}reject(e){0===this._state&&(this._state=2,this._error=e,this._onStateChanged.fire())}}cd.EMPTY=cd.fromArray([]);class ud extends cd{constructor(e,t){super(t),this._source=e}cancel(){this._source.cancel()}}function gd(e){if(!e||"object"!=typeof e)return e;if(e instanceof RegExp)return e;const t=Array.isArray(e)?[]:{};return Object.entries(e).forEach((([e,i])=>{t[e]=i&&"object"==typeof i?gd(i):i})),t}const pd=Object.prototype.hasOwnProperty;function md(e,t){return fd(e,t,new Set)}function fd(e,t,i){if(jr(e))return e;const n=t(e);if(void 0!==n)return n;if(Array.isArray(e)){const n=[];for(const s of e)n.push(fd(s,t,i));return n}if(Br(e)){if(i.has(e))throw new Error("Cannot clone recursive data-structure");i.add(e);const n={};for(const s in e)pd.call(e,s)&&(n[s]=fd(e[s],t,i));return i.delete(e),n}return e}function _d(e,t,i=!0){return Br(e)?(Br(t)&&Object.keys(t).forEach((n=>{n in e?i&&(Br(e[n])&&Br(t[n])?_d(e[n],t[n],i):e[n]=t[n]):e[n]=t[n]})),e):t}function vd(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;if(Array.isArray(e)!==Array.isArray(t))return!1;let i,n;if(Array.isArray(e)){if(e.length!==t.length)return!1;for(i=0;ie===t){if(e===t)return!0;if(!e||!t)return!1;if(e.length!==t.length)return!1;for(let n=0,s=e.length;n0))return e;n=e-1}}return-(i+1)}(e.length,(n=>i(e[n],t)))}function Ad(e,t,i){if((e|=0)>=t.length)throw new TypeError("invalid index");const n=t[Math.floor(t.length*Math.random())],s=[],o=[],r=[];for(const a of t){const e=i(a,n);e<0?s.push(a):e>0?o.push(a):r.push(a)}return e!!e))}function Wd(e){let t=0;for(let i=0;i0}function zd(e,t=e=>e){const i=new Set;return e.filter((e=>{const n=t(e);return!i.has(n)&&(i.add(n),!0)}))}function Ud(e,t){return e.length>0?e[0]:t}function Kd(e,t){let i="number"==typeof t?e:0;"number"==typeof t?i=e:(i=0,t=e);const n=[];if(i<=t)for(let s=i;st;s--)n.push(s);return n}function jd(e,t,i){const n=e.slice(0,t),s=e.slice(t);return n.concat(i,s)}function qd(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.unshift(t))}function $d(e,t){const i=e.indexOf(t);i>-1&&(e.splice(i,1),e.push(t))}function Gd(e,t){for(const i of t)e.push(i)}function Zd(e){return Array.isArray(e)?e:[e]}function Yd(e,t,i,n){const s=Xd(e,t);let o=e.splice(s,i);return void 0===o&&(o=[]),function(e,t,i){const n=Xd(e,t),s=e.length,o=i.length;e.length=s+o;for(let r=s-1;r>=n;r--)e[r+o]=e[r];for(let r=0;rt(e(i),e(n))}!function(e){e.isLessThan=function(e){return e<0},e.isLessThanOrEqual=function(e){return e<=0},e.isGreaterThan=function(e){return e>0},e.isNeitherLessOrGreaterThan=function(e){return 0===e},e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0}(Ld||(Ld={}));const Jd=(e,t)=>e-t,ec=(e,t)=>Jd(e?1:0,t?1:0);function tc(e){return(t,i)=>-e(t,i)}class ic{constructor(e){this.items=e,this.firstIdx=0,this.lastIdx=this.items.length-1}get length(){return this.lastIdx-this.firstIdx+1}takeWhile(e){let t=this.firstIdx;for(;t=0&&e(this.items[t]);)t--;const i=t===this.lastIdx?null:this.items.slice(t+1,this.lastIdx+1);return this.lastIdx=t,i}peek(){if(0!==this.length)return this.items[this.firstIdx]}dequeue(){const e=this.items[this.firstIdx];return this.firstIdx++,e}takeCount(e){const t=this.items.slice(this.firstIdx,this.firstIdx+e);return this.firstIdx+=e,t}}class nc{constructor(e){this.iterate=e}toArray(){const e=[];return this.iterate((t=>(e.push(t),!0))),e}filter(e){return new nc((t=>this.iterate((i=>!e(i)||t(i)))))}map(e){return new nc((t=>this.iterate((i=>t(e(i))))))}findLast(e){let t;return this.iterate((i=>(e(i)&&(t=i),!0))),t}findLastMaxBy(e){let t,i=!0;return this.iterate((n=>((i||Ld.isGreaterThan(e(n,t)))&&(i=!1,t=n),!0))),t}}function sc(e,t){const i=Math.pow(10,t);return Math.round(e*i)/i}nc.empty=new nc((e=>{}));class oc{constructor(e,t,i,n=1){this._rgbaBrand=void 0,this.r=0|Math.min(255,Math.max(0,e)),this.g=0|Math.min(255,Math.max(0,t)),this.b=0|Math.min(255,Math.max(0,i)),this.a=sc(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 rc{constructor(e,t,i,n){this._hslaBrand=void 0,this.h=0|Math.max(Math.min(360,e),0),this.s=sc(Math.max(Math.min(1,t),0),3),this.l=sc(Math.max(Math.min(1,i),0),3),this.a=sc(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,s=e.a,o=Math.max(t,i,n),r=Math.min(t,i,n);let a=0,l=0;const h=(r+o)/2,d=o-r;if(d>0){switch(l=Math.min(h<=.5?d/(2*h):d/(2-2*h),1),o){case t:a=(i-n)/d+(i1&&(i-=1),i<1/6?e+6*(t-e)*i:i<.5?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:s}=e;let o,r,a;if(0===i)o=r=a=n;else{const e=n<.5?n*(1+i):n+i-n*i,s=2*n-e;o=rc._hue2rgb(s,e,t+1/3),r=rc._hue2rgb(s,e,t),a=rc._hue2rgb(s,e,t-1/3)}return new oc(Math.round(255*o),Math.round(255*r),Math.round(255*a),s)}}class ac{constructor(e,t,i,n){this._hsvaBrand=void 0,this.h=0|Math.max(Math.min(360,e),0),this.s=sc(Math.max(Math.min(1,t),0),3),this.v=sc(Math.max(Math.min(1,i),0),3),this.a=sc(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,s=Math.max(t,i,n),o=s-Math.min(t,i,n),r=0===s?0:o/s;let a;return a=0===o?0:s===t?((i-n)/o%6+6)%6:s===i?(n-t)/o+2:(t-i)/o+4,new ac(Math.round(60*a),r,s,e.a)}static toRGBA(e){const{h:t,s:i,v:n,a:s}=e,o=n*i,r=o*(1-Math.abs(t/60%2-1)),a=n-o;let[l,h,d]=[0,0,0];return t<60?(l=o,h=r):t<120?(l=r,h=o):t<180?(h=o,d=r):t<240?(h=r,d=o):t<300?(l=r,d=o):t<=360&&(l=o,d=r),l=Math.round(255*(l+a)),h=Math.round(255*(h+a)),d=Math.round(255*(d+a)),new oc(l,h,d,s)}}class lc{static fromHex(e){return lc.Format.CSS.parseHex(e)||lc.red}static equals(e,t){return!e&&!t||!(!e||!t)&&e.equals(t)}get hsla(){return this._hsla?this._hsla:rc.fromRGBA(this.rgba)}get hsva(){return this._hsva?this._hsva:ac.fromRGBA(this.rgba)}constructor(e){if(!e)throw new Error("Color needs a value");if(e instanceof oc)this.rgba=e;else if(e instanceof rc)this._hsla=e,this.rgba=rc.toRGBA(e);else{if(!(e instanceof ac))throw new Error("Invalid color ctor argument");this._hsva=e,this.rgba=ac.toRGBA(e)}}equals(e){return!!e&&oc.equals(this.rgba,e.rgba)&&rc.equals(this.hsla,e.hsla)&&ac.equals(this.hsva,e.hsva)}getRelativeLuminance(){return sc(.2126*lc._relativeLuminanceForComponent(this.rgba.r)+.7152*lc._relativeLuminanceForComponent(this.rgba.g)+.0722*lc._relativeLuminanceForComponent(this.rgba.b),4)}static _relativeLuminanceForComponent(e){const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)}isLighter(){return(299*this.rgba.r+587*this.rgba.g+114*this.rgba.b)/1e3>=128}isLighterThan(e){return this.getRelativeLuminance()>e.getRelativeLuminance()}isDarkerThan(e){return this.getRelativeLuminance()=t){return l-tt))return new uc(e,t)}static ofLength(e){return new uc(0,e)}constructor(e,t){if(this.start=e,this.endExclusive=t,e>t)throw new f(`Invalid range: ${this.toString()}`)}get isEmpty(){return this.start===this.endExclusive}delta(e){return new uc(this.start+e,this.endExclusive+e)}deltaStart(e){return new uc(this.start+e,this.endExclusive)}deltaEnd(e){return new uc(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=this.endExclusive?this.start+(e-this.start)%this.length:e}forEach(e){for(let t=this.start;te.toString())).join(", ")}intersectsStrict(e){let t=0;for(;te+t.length),0)}}function pc(e,t,i){const n=function(e,t,i=e.length-1){for(let n=i;n>=0;n--){if(t(e[n]))return n}return-1}(e,t);if(-1!==n)return e[n]}function mc(e,t){const i=fc(e,t);return-1===i?void 0:e[i]}function fc(e,t,i=0,n=e.length){let s=i,o=n;for(;s0&&(i=s)}return i}function Cc(e,t){if(0===e.length)return-1;let i=0;for(let n=1;n0&&(i=n)}return i}vc.assertInvariants=!1;class wc{static fromRange(e){return new wc(e.startLineNumber,e.endLineNumber)}static joinMany(e){if(0===e.length)return[];let t=new yc(e[0].slice());for(let i=1;it)throw new f(`startLineNumber ${e} cannot be after endLineNumberExclusive ${t}`);this.startLineNumber=e,this.endLineNumberExclusive=t}contains(e){return this.startLineNumber<=e&&et.endLineNumberExclusive>=e.startLineNumber)),i=fc(this._normalizedRanges,(t=>t.startLineNumber<=e.endLineNumberExclusive))+1;if(t===i)this._normalizedRanges.splice(t,0,e);else if(t===i-1){const i=this._normalizedRanges[t];this._normalizedRanges[t]=i.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=mc(this._normalizedRanges,(t=>t.startLineNumber<=e));return!!t&&t.endLineNumberExclusive>e}getUnion(e){if(0===this._normalizedRanges.length)return e;if(0===e._normalizedRanges.length)return this;const t=[];let i=0,n=0,s=null;for(;i=o.startLineNumber?s=new wc(s.startLineNumber,Math.max(s.endLineNumberExclusive,o.endLineNumberExclusive)):(t.push(s),s=o)}return null!==s&&t.push(s),new yc(t)}subtractFrom(e){const t=_c(this._normalizedRanges,(t=>t.endLineNumberExclusive>=e.startLineNumber)),i=fc(this._normalizedRanges,(t=>t.startLineNumber<=e.endLineNumberExclusive))+1;if(t===i)return new yc([e]);const n=[];let s=e.startLineNumber;for(let o=t;os&&n.push(new wc(s,e.startLineNumber)),s=e.endLineNumberExclusive}return se.toString())).join(", ")}getIntersection(e){const t=[];let i=0,n=0;for(;it.delta(e))))}}const Sc={tabSize:4,indentSize:4,insertSpaces:!0,detectIndentation:!0,trimAutoWhitespace:!0,largeFileOptimizations:!0,bracketPairColorizationOptions:{enabled:!0,independentColorPoolPerBracketType:!1}},Lc=Ba("languageService"),kc="`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?";const Dc=function(e=""){let t="(-?\\d*\\.\\d\\w*)|([^";for(const i of kc)e.indexOf(i)>=0||(t+="\\"+i);return t+="\\s]+)",new RegExp(t,"g")}();function xc(e){let t=Dc;if(e&&e instanceof RegExp)if(e.global)t=e;else{let i="g";e.ignoreCase&&(i+="i"),e.multiline&&(i+="m"),e.unicode&&(i+="u"),t=new RegExp(e.source,i)}return t.lastIndex=0,t}const Nc=new O;function Ec(e,t,i,n,s){if(s||(s=v.first(Nc)),i.length>s.maxLen){let o=e-s.maxLen/2;return o<0?o=0:n+=o,Ec(e,t,i=i.substring(o,e+s.maxLen/2),n,s)}const o=Date.now(),r=e-1-n;let a=-1,l=null;for(let h=1;!(Date.now()-o>=s.timeBudget);h++){const e=r-s.windowSize*h;t.lastIndex=Math.max(0,e);const n=Ic(t,i,r,a);if(!n&&l)break;if(l=n,e<=0)break;a=e}if(l){const e={word:l[0],startColumn:n+1+l.index,endColumn:n+1+l.index+l[0].length};return t.lastIndex=0,e}return null}function Ic(e,t,i,n){let s;for(;s=e.exec(t);){const t=s.index||0;if(t<=i&&e.lastIndex>=i)return s;if(n>0&&t>n)return null}return null}var Mc;Nc.unshift({maxLen:1e3,windowSize:15,timeBudget:150}),function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"}(Mc||(Mc={}));class Tc{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;t0&&e.getLanguageId(r-1)===s;)r--;return new Pc(e,s,r,o+1,e.getStartOffset(r),e.getEndOffset(o))}class Pc{constructor(e,t,i,n,s,o){this._scopedLineTokensBrand=void 0,this._actual=e,this.languageId=t,this._firstTokenIndex=i,this._lastTokenIndex=n,this.firstCharOffset=s,this._lastCharOffset=o}getLineContent(){return this._actual.getLineContent().substring(this.firstCharOffset,this._lastCharOffset)}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)}}function Fc(e){return!!(3&e)}class Bc{constructor(e){if(e.autoClosingPairs?this._autoClosingPairs=e.autoClosingPairs.map((e=>new Tc(e))):e.brackets?this._autoClosingPairs=e.brackets.map((e=>new Tc({open:e[0],close:e[1]}))):this._autoClosingPairs=[],e.__electricCharacterSupport&&e.__electricCharacterSupport.docComment){const t=e.__electricCharacterSupport.docComment;this._autoClosingPairs.push(new Tc({open:t.open,close:t.close||""}))}this._autoCloseBeforeForQuotes="string"==typeof e.autoCloseBefore?e.autoCloseBefore:Bc.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES,this._autoCloseBeforeForBrackets="string"==typeof e.autoCloseBefore?e.autoCloseBefore:Bc.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}}Bc.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_QUOTES=";:.,=}])> \n\t",Bc.DEFAULT_AUTOCLOSE_BEFORE_LANGUAGE_DEFINED_BRACKETS="'\"`;:.,=}])> \n\t";const Wc="undefined"!=typeof Buffer;new Zs((()=>new Uint8Array(256)));let Vc,Hc,zc,Uc;class Kc{static wrap(e){return Wc&&!Buffer.isBuffer(e)&&(e=Buffer.from(e.buffer,e.byteOffset,e.byteLength)),new Kc(e)}constructor(e){this.buffer=e,this.byteLength=this.buffer.byteLength}toString(){return Wc?this.buffer.toString():(Vc||(Vc=new TextDecoder),Vc.decode(this.buffer))}}function jc(e,t){return(e[t+0]|0)>>>0|e[t+1]<<8>>>0}function qc(e,t,i){e[i+0]=255&t,t>>>=8,e[i+1]=255&t}function $c(e,t){return e[t]*Math.pow(2,24)+e[t+1]*Math.pow(2,16)+e[t+2]*Math.pow(2,8)+e[t+3]}function Gc(e,t,i){e[i+3]=t,t>>>=8,e[i+2]=t,t>>>=8,e[i+1]=t,t>>>=8,e[i]=t}function Zc(e,t){return e[t]}function Yc(e,t,i){e[i]=t}function Xc(){return Hc||(Hc=new TextDecoder("UTF-16LE")),Hc}function Qc(){return Uc||(Uc=Ye()?Xc():(zc||(zc=new TextDecoder("UTF-16BE")),zc)),Uc}function Jc(e,t,i){const n=new Uint16Array(e.buffer,t,i);return i>0&&(65279===n[0]||65534===n[0])?function(e,t,i){const n=[];let s=0;for(let o=0;o=this._capacity)return this._flushBuffer(),void(this._completedStrings[this._completedStrings.length]=e);for(let i=0;i[e[0].toLowerCase(),e[1].toLowerCase()]));const i=[];for(let r=0;r{const[i,n]=e,[s,o]=t;return i===s||i===o||n===s||n===o},s=(e,n)=>{const s=Math.min(e,n),o=Math.max(e,n);for(let r=0;r0&&o.push({open:n,close:s})}return o}(t);this.brackets=i.map(((t,n)=>new tu(e,n,t.open,t.close,function(e,t,i,n){let s=[];s=s.concat(e),s=s.concat(t);for(let o=0,r=s.length;o=0&&n.push(t);for(const t of o.close)t.indexOf(e)>=0&&n.push(t)}}function su(e,t){return e.length-t.length}function ou(e){if(e.length<=1)return e;const t=[],i=new Set;for(const n of e)i.has(n)||(t.push(n),i.add(n));return t}function ru(e){const t=/^[\w ]+$/.test(e);return e=eo(e),t?`\\b${e}\\b`:e}function au(e){return so(`(${e.map(ru).join(")|(")})`,!0)}const lu=function(){let e=null,t=null;return function(i){return e!==i&&(e=i,t=function(e){const t=new Uint16Array(e.length);let i=0;for(let n=e.length-1;n>=0;n--)t[i++]=e.charCodeAt(n);return Qc().decode(t)}(e)),t}}();class hu{static _findPrevBracketInText(e,t,i,n){const s=i.match(e);if(!s)return null;const o=i.length-(s.index||0),r=s[0].length,a=n+o;return new Rh(t,a-r+1,t,a+1)}static findPrevBracketInRange(e,t,i,n,s){const o=lu(i).substring(i.length-s,i.length-n);return this._findPrevBracketInText(e,t,o,n)}static findNextBracketInText(e,t,i,n){const s=i.match(e);if(!s)return null;const o=s.index||0,r=s[0].length;if(0===r)return null;const a=n+o;return new Rh(t,a+1,t,a+1+r)}static findNextBracketInRange(e,t,i,n,s){const o=i.substring(n,s);return this.findNextBracketInText(e,t,o,n)}}class du{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 t=i.charAt(i.length-1);e.push(t)}return zd(e)}onElectricCharacter(e,t,i){if(!this._richEditBrackets||0===this._richEditBrackets.brackets.length)return null;const n=t.findTokenIndexAtOffset(i-1);if(Fc(t.getStandardTokenType(n)))return null;const s=this._richEditBrackets.reversedRegex,o=t.getLineContent().substring(0,i-1)+e,r=hu.findPrevBracketInRange(s,1,o,0,o.length);if(!r)return null;const a=o.substring(r.startColumn-1,r.endColumn-1).toLowerCase();if(this._richEditBrackets.textIsOpenBracket[a])return null;const l=t.getActualLineContentBefore(r.startColumn-1);return/^\s*$/.test(l)?{matchOpenBracket:a}:null}}function cu(e){return e.global&&(e.lastIndex=0),!0}class uu{constructor(e){this._indentationRules=e}shouldIncrease(e){return!!(this._indentationRules&&this._indentationRules.increaseIndentPattern&&cu(this._indentationRules.increaseIndentPattern)&&this._indentationRules.increaseIndentPattern.test(e))}shouldDecrease(e){return!!(this._indentationRules&&this._indentationRules.decreaseIndentPattern&&cu(this._indentationRules.decreaseIndentPattern)&&this._indentationRules.decreaseIndentPattern.test(e))}shouldIndentNextLine(e){return!!(this._indentationRules&&this._indentationRules.indentNextLinePattern&&cu(this._indentationRules.indentNextLinePattern)&&this._indentationRules.indentNextLinePattern.test(e))}shouldIgnore(e){return!!(this._indentationRules&&this._indentationRules.unIndentedLinePattern&&cu(this._indentationRules.unIndentedLinePattern)&&this._indentationRules.unIndentedLinePattern.test(e))}getIndentMetadata(e){let t=0;return this.shouldIncrease(e)&&(t+=1),this.shouldDecrease(e)&&(t+=2),this.shouldIndentNextLine(e)&&(t+=4),this.shouldIgnore(e)&&(t+=8),t}}class gu{constructor(e){(e=e||{}).brackets=e.brackets||[["(",")"],["{","}"],["[","]"]],this._brackets=[],e.brackets.forEach((e=>{const t=gu._createOpenBracketRegExp(e[0]),i=gu._createCloseBracketRegExp(e[1]);t&&i&&this._brackets.push({open:e[0],openRegExp:t,close:e[1],closeRegExp:i})})),this._regExpRules=e.onEnterRules||[]}onEnter(e,t,i,n){if(e>=3)for(let s=0,o=this._regExpRules.length;s!e.reg||(e.reg.lastIndex=0,e.reg.test(e.text)))))return e.action}if(e>=2&&i.length>0&&n.length>0)for(let s=0,o=this._brackets.length;s=2&&i.length>0)for(let s=0,o=this._brackets.length;s0&&"#"===i.charAt(i.length-1)?i.substring(0,i.length-1):i)]=t,this._onDidChangeSchema.fire(e)}notifySchemaChanged(e){this._onDidChangeSchema.fire(e)}};jl.add(ku,Du);const xu="base.contributions.configuration",Nu={properties:{},patternProperties:{}},Eu={properties:{},patternProperties:{}},Iu={properties:{},patternProperties:{}},Mu={properties:{},patternProperties:{}},Tu={properties:{},patternProperties:{}},Ru={properties:{},patternProperties:{}},Au="vscode://schemas/settings/resourceLanguage",Ou=jl.as(ku);const Pu="\\[([^\\]]+)\\]",Fu=new RegExp(Pu,"g"),Bu=`^(${Pu})+$`,Wu=new RegExp(Bu);function Vu(e){const t=[];if(Wu.test(e)){let i=Fu.exec(e);for(;null==i?void 0:i.length;){const n=i[1].trim();n&&t.push(n),i=Fu.exec(e)}}return zd(t)}const Hu=new class{constructor(){this.overrideIdentifiers=new Set,this._onDidSchemaChange=new U,this._onDidUpdateConfiguration=new U,this.configurationDefaultsOverrides=new Map,this.defaultLanguageConfigurationOverridesNode={id:"defaultOverrides",title:ue(0,"Default Language Configuration Overrides"),properties:{}},this.configurationContributors=[this.defaultLanguageConfigurationOverridesNode],this.resourceLanguageSettingsSchema={properties:{},patternProperties:{},additionalProperties:!0,allowTrailingCommas:!0,allowComments:!0},this.configurationProperties={},this.policyConfigurations=new Map,this.excludedConfigurationProperties={},Ou.registerSchema(Au,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),Ou.registerSchema(Au,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){var i;const n=[];for(const{overrides:s,source:o}of e)for(const e in s)if(t.add(e),Wu.test(e)){const t=this.configurationDefaultsOverrides.get(e),r=null!==(i=null==t?void 0:t.valuesSources)&&void 0!==i?i:new Map;if(o)for(const i of Object.keys(s[e]))r.set(i,o);const a=Object.assign(Object.assign({},(null==t?void 0:t.value)||{}),s[e]);this.configurationDefaultsOverrides.set(e,{source:o,value:a,valuesSources:r});const l={type:"object",default:a,description:ue(0,"Configure settings to be overridden for the {0} language.",e.replace(/[\[\]]/g,"")),$ref:Au,defaultDefaultValue:a,source:Fr(o)?void 0:o,defaultValueSource:o};n.push(...Vu(e)),this.configurationProperties[e]=l,this.defaultLanguageConfigurationOverridesNode.properties[e]=l}else{this.configurationDefaultsOverrides.set(e,{value:s[e],source:o});const t=this.configurationProperties[e];t&&(this.updatePropertyDefaultValue(e,t),this.updateSchema(e,t))}this.doRegisterOverrideIdentifiers(n)}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((e=>{this.validateAndRegisterProperties(e,t,e.extensionInfo,e.restrictedProperties,void 0,i),this.configurationContributors.push(e),this.registerJSONConfiguration(e)}))}validateAndRegisterProperties(e,t=!0,i,n,s=3,o){var r;s=jr(e.scope)?s:e.scope;const a=e.properties;if(a)for(const h in a){const e=a[h];t&&zu(h,e)?delete a[h]:(e.source=i,e.defaultDefaultValue=a[h].default,this.updatePropertyDefaultValue(h,e),Wu.test(h)?e.scope=void 0:(e.scope=jr(e.scope)?s:e.scope,e.restricted=jr(e.restricted)?!!(null==n?void 0:n.includes(h)):e.restricted),!a[h].hasOwnProperty("included")||a[h].included?(this.configurationProperties[h]=a[h],(null===(r=a[h].policy)||void 0===r?void 0:r.name)&&this.policyConfigurations.set(a[h].policy.name,h),!a[h].deprecationMessage&&a[h].markdownDeprecationMessage&&(a[h].deprecationMessage=a[h].markdownDeprecationMessage),o.add(h)):(this.excludedConfigurationProperties[h]=a[h],delete a[h]))}const l=e.allOf;if(l)for(const h of l)this.validateAndRegisterProperties(h,t,i,n,s,o)}getConfigurationProperties(){return this.configurationProperties}getPolicyConfigurations(){return this.policyConfigurations}registerJSONConfiguration(e){const t=e=>{const i=e.properties;if(i)for(const t in i)this.updateSchema(t,i[t]);const n=e.allOf;null==n||n.forEach(t)};t(e)}updateSchema(e,t){switch(Nu.properties[e]=t,t.scope){case 1:Eu.properties[e]=t;break;case 2:Iu.properties[e]=t;break;case 6:Mu.properties[e]=t;break;case 3:Tu.properties[e]=t;break;case 4:Ru.properties[e]=t;break;case 5:Ru.properties[e]=t,this.resourceLanguageSettingsSchema.properties[e]=t}}updateOverridePropertyPatternKey(){for(const e of this.overrideIdentifiers.values()){const t=`[${e}]`,i={type:"object",description:ue(0,"Configure editor settings to be overridden for a language."),errorMessage:ue(0,"This setting does not support per-language configuration."),$ref:Au};this.updatePropertyDefaultValue(t,i),Nu.properties[t]=i,Eu.properties[t]=i,Iu.properties[t]=i,Mu.properties[t]=i,Tu.properties[t]=i,Ru.properties[t]=i}}registerOverridePropertyPatternKey(){const e={type:"object",description:ue(0,"Configure editor settings to be overridden for a language."),errorMessage:ue(0,"This setting does not support per-language configuration."),$ref:Au};Nu.patternProperties[Bu]=e,Eu.patternProperties[Bu]=e,Iu.patternProperties[Bu]=e,Mu.patternProperties[Bu]=e,Tu.patternProperties[Bu]=e,Ru.patternProperties[Bu]=e,this._onDidSchemaChange.fire()}updatePropertyDefaultValue(e,t){const i=this.configurationDefaultsOverrides.get(e);let n=null==i?void 0:i.value,s=null==i?void 0:i.source;Ur(n)&&(n=t.defaultDefaultValue,s=void 0),Ur(n)&&(n=function(e){switch(Array.isArray(e)?e[0]:e){case"boolean":return!1;case"integer":case"number":return 0;case"string":return"";case"array":return[];case"object":return{};default:return null}}(t.type)),t.default=n,t.defaultValueSource=s}};function zu(e,t){var i,n,s,o;return e.trim()?Wu.test(e)?ue(0,"Cannot register '{0}'. This matches property pattern '\\\\[.*\\\\]$' for describing language specific editor settings. Use 'configurationDefaults' contribution.",e):void 0!==Hu.getConfigurationProperties()[e]?ue(0,"Cannot register '{0}'. This property is already registered.",e):(null===(i=t.policy)||void 0===i?void 0:i.name)&&void 0!==Hu.getPolicyConfigurations().get(null===(n=t.policy)||void 0===n?void 0:n.name)?ue(0,"Cannot register '{0}'. The associated policy {1} is already registered with {2}.",e,null===(s=t.policy)||void 0===s?void 0:s.name,Hu.getPolicyConfigurations().get(null===(o=t.policy)||void 0===o?void 0:o.name)):null:ue(0,"Cannot register an empty property")}jl.add(xu,Hu);const Uu=new class{constructor(){this._onDidChangeLanguages=new U,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 t=new Set;return{info:new Gu(this,e,t),closing:t}})),s=new Gs((e=>{const t=new Set,i=new Set;return{info:new Zu(this,e,t,i),opening:t,openingColorized:i}}));for(const[r,a]of i){const e=n.get(r),t=s.get(a);e.closing.add(t.info),t.opening.add(e.info)}const o=t.colorizedBracketPairs?qu(t.colorizedBracketPairs):i.filter((e=>!("<"===e[0]&&">"===e[1])));for(const[r,a]of o){const e=n.get(r),t=s.get(a);e.closing.add(t.info),t.openingColorized.add(e.info),t.opening.add(e.info)}this._openingBrackets=new Map([...n.cachedValues].map((([e,t])=>[e,t.info]))),this._closingBrackets=new Map([...s.cachedValues].map((([e,t])=>[e,t.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)}}function qu(e){return e.filter((([e,t])=>""!==e&&""!==t))}class $u{constructor(e,t){this.config=e,this.bracketText=t}get languageId(){return this.config.languageId}}class Gu extends $u{constructor(e,t,i){super(e,t),this.openedBrackets=i,this.isOpeningBracket=!0}}class Zu extends $u{constructor(e,t,i,n){super(e,t),this.openingBrackets=i,this.openingColorizedBrackets=n,this.isOpeningBracket=!1}closes(e){return e.config===this.config&&this.openingBrackets.has(e)}closesColorized(e){return e.config===this.config&&this.openingColorizedBrackets.has(e)}getOpeningBrackets(){return[...this.openingBrackets]}}var Yu=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Xu=function(e,t){return function(i,n){t(i,n,e)}};class Qu{constructor(e){this.languageId=e}affects(e){return!this.languageId||this.languageId===e}}const Ju=Ba("languageConfigurationService");let eg=class extends E{constructor(e,t){super(),this.configurationService=e,this.languageService=t,this._registry=this._register(new hg),this.onDidChangeEmitter=this._register(new U),this.onDidChange=this.onDidChangeEmitter.event,this.configurations=new Map;const i=new Set(Object.values(tg));this._register(this.configurationService.onDidChangeConfiguration((e=>{const t=e.change.keys.some((e=>i.has(e))),n=e.change.overrides.filter((([e,t])=>t.some((e=>i.has(e))))).map((([e])=>e));if(t)this.configurations.clear(),this.onDidChangeEmitter.fire(new Qu(void 0));else for(const i of n)this.languageService.isRegisteredLanguageId(i)&&(this.configurations.delete(i),this.onDidChangeEmitter.fire(new Qu(i)))}))),this._register(this._registry.onDidChange((e=>{this.configurations.delete(e.languageId),this.onDidChangeEmitter.fire(new Qu(e.languageId))})))}register(e,t,i){return this._registry.register(e,t,i)}getLanguageConfiguration(e){let t=this.configurations.get(e);return t||(t=function(e,t,i,n){let s=t.getLanguageConfiguration(e);if(!s){if(!n.isRegisteredLanguageId(e))return new dg(e,{});s=new dg(e,{})}const o=function(e,t){const i=t.getValue(tg.brackets,{overrideIdentifier:e}),n=t.getValue(tg.colorizedBracketPairs,{overrideIdentifier:e});return{brackets:ig(i),colorizedBracketPairs:ig(n)}}(s.languageId,i),r=rg([s.underlyingConfig,o]);return new dg(s.languageId,r)}(e,this._registry,this.configurationService,this.languageService),this.configurations.set(e,t)),t}};eg=Yu([Xu(0,pu),Xu(1,Lc)],eg);const tg={brackets:"editor.language.brackets",colorizedBracketPairs:"editor.language.colorizedBracketPairs"};function ig(e){if(Array.isArray(e))return e.map((e=>{if(Array.isArray(e)&&2===e.length)return[e[0],e[1]]})).filter((e=>!!e))}function ng(e,t,i){let n=ao(e.getLineContent(t));return n.length>i-1&&(n=n.substring(0,i-1)),n}function sg(e,t,i){e.tokenization.forceTokenization(t);return Oc(e.tokenization.getLineTokens(t),void 0===i?e.getLineMaxColumn(t)-1:i-1)}class og{constructor(e){this.languageId=e,this._resolved=null,this._entries=[],this._order=0,this._resolved=null}register(e,t){const i=new ag(e,t,++this._order);return this._entries.push(i),this._resolved=null,x((()=>{for(let e=0;ee.configuration))))}}function rg(e){let t={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 i of e)t={comments:i.comments||t.comments,brackets:i.brackets||t.brackets,wordPattern:i.wordPattern||t.wordPattern,indentationRules:i.indentationRules||t.indentationRules,onEnterRules:i.onEnterRules||t.onEnterRules,autoClosingPairs:i.autoClosingPairs||t.autoClosingPairs,surroundingPairs:i.surroundingPairs||t.surroundingPairs,autoCloseBefore:i.autoCloseBefore||t.autoCloseBefore,folding:i.folding||t.folding,colorizedBracketPairs:i.colorizedBracketPairs||t.colorizedBracketPairs,__electricCharacterSupport:i.__electricCharacterSupport||t.__electricCharacterSupport};return t}class ag{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 lg{constructor(e){this.languageId=e}}class hg extends E{constructor(){super(),this._entries=new Map,this._onDidChange=this._register(new U),this.onDidChange=this._onDidChange.event,this._register(this.register(Ku,{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 og(e),this._entries.set(e,n));const s=n.register(t,i);return this._onDidChange.fire(new lg(e)),x((()=>{s.dispose(),this._onDidChange.fire(new lg(e))}))}getLanguageConfiguration(e){const t=this._entries.get(e);return(null==t?void 0:t.getResolvedConfiguration())||null}}class dg{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 gu(this.underlyingConfig):null,this.comments=dg._handleComments(this.underlyingConfig),this.characterPair=new Bc(this.underlyingConfig),this.wordDefinition=this.underlyingConfig.wordPattern||Dc,this.indentationRules=this.underlyingConfig.indentationRules,this.underlyingConfig.indentationRules?this.indentRulesSupport=new uu(this.underlyingConfig.indentationRules):this.indentRulesSupport=null,this.foldingRules=this.underlyingConfig.folding||{},this.bracketsNew=new ju(e,this.underlyingConfig)}getWordDefinition(){return xc(this.wordDefinition)}get brackets(){return!this._brackets&&this.underlyingConfig.brackets&&(this._brackets=new iu(this.languageId,this.underlyingConfig.brackets)),this._brackets}get electricCharacter(){return this._electricCharacter||(this._electricCharacter=new du(this.brackets)),this._electricCharacter}onEnter(e,t,i,n){return this._onEnterSupport?this._onEnterSupport.onEnter(e,t,i,n):null}getAutoClosingPairs(){return new Rc(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[e,n]=t.blockComment;i.blockCommentStartToken=e,i.blockCommentEndToken=n}return i}}yu(Ju,eg,1);class cg{constructor(e,t,i,n){this.range=e,this.nestingLevel=t,this.nestingLevelOfEqualBracketType=i,this.isInvalid=n}}class ug{constructor(e,t,i,n,s,o){this.range=e,this.openingBracketRange=t,this.closingBracketRange=i,this.nestingLevel=n,this.nestingLevelOfEqualBracketType=s,this.bracketPairNode=o}get openingBracketInfo(){return this.bracketPairNode.openingBracket.bracketInfo}}class gg extends ug{constructor(e,t,i,n,s,o,r){super(e,t,i,n,s,o),this.minVisibleColumnIndentation=r}}class pg{constructor(e,t){this.lineCount=e,this.columnCount=t}toString(){return`${this.lineCount},${this.columnCount}`}}pg.zero=new pg(0,0);const mg=0;function fg(e){return 0===e}const _g=Math.pow(2,26);function vg(e,t){return e*_g+t}function bg(e){const t=e,i=Math.floor(t/_g);return new pg(i,t-i*_g)}function Cg(e,t){let i=e+t;return t>=_g&&(i-=e%_g),i}function wg(e,t){return e.reduce(((e,i)=>Cg(e,t(i))),mg)}function yg(e,t){return e===t}function Sg(e,t){const i=e,n=t;if(n-i<=0)return mg;const s=Math.floor(i/_g),o=Math.floor(n/_g),r=n-o*_g;if(s===o){return vg(0,r-(i-s*_g))}return vg(o-s,r)}function Lg(e,t){return e=t}function xg(e){return vg(e.lineNumber-1,e.column-1)}function Ng(e,t){const i=e,n=Math.floor(i/_g),s=i-n*_g,o=t,r=Math.floor(o/_g);return new Rh(n+1,s+1,r+1,o-r*_g+1)}class Eg{static fromModelContentChanges(e){const t=e.map((e=>{const t=Rh.lift(e.range);return new Eg(xg(t.getStartPosition()),xg(t.getEndPosition()),function(e){const t=oo(e);return vg(t.length-1,t[t.length-1].length)}(e.text))})).reverse();return t}constructor(e,t,i){this.startOffset=e,this.endOffset=t,this.newLength=i}toString(){return`[${bg(this.startOffset)}...${bg(this.endOffset)}) -> ${bg(this.newLength)}`}}class Ig{constructor(e){this.nextEditIdx=0,this.deltaOldToNewLineCount=0,this.deltaOldToNewColumnCount=0,this.deltaLineIdxInOld=-1,this.edits=e.map((e=>Mg.from(e)))}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 null===i?null:Sg(e,i)}translateOldToCur(e){return e.lineCount===this.deltaLineIdxInOld?vg(e.lineCount+this.deltaOldToNewLineCount,e.columnCount+this.deltaOldToNewColumnCount):vg(e.lineCount+this.deltaOldToNewLineCount,e.columnCount)}translateCurToOld(e){const t=bg(e);return t.lineCount-this.deltaOldToNewLineCount===this.deltaLineIdxInOld?vg(t.lineCount-this.deltaOldToNewLineCount,t.columnCount-this.deltaOldToNewColumnCount):vg(t.lineCount-this.deltaOldToNewLineCount,t.columnCount)}adjustNextEdit(e){for(;this.nextEditIdx>5;if(0===n){const e=1<e};class Og{constructor(){this.items=new Map}getKey(e){let t=this.items.get(e);return void 0===t&&(t=this.items.size,this.items.set(e,t)),t}}class Pg{get length(){return this._length}constructor(e){this._length=e}}class Fg extends Pg{static create(e,t,i){let n=e.length;return t&&(n=Cg(n,t.length)),i&&(n=Cg(n,i.length)),new Fg(n,e,t,i,t?t.missingOpeningBracketIds:Rg.getEmpty())}get kind(){return 2}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,s){super(e),this.openingBracket=t,this.child=i,this.closingBracket=n,this.missingOpeningBracketIds=s}canBeReused(e){return null!==this.closingBracket&&!e.intersects(this.missingOpeningBracketIds)}deepClone(){return new Fg(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(Cg(e,this.openingBracket.length),t):Number.MAX_SAFE_INTEGER}}class Bg extends Pg{static create23(e,t,i,n=!1){let s=e.length,o=e.missingOpeningBracketIds;if(e.listHeight!==t.listHeight)throw new Error("Invalid list heights");if(s=Cg(s,t.length),o=o.merge(t.missingOpeningBracketIds),i){if(e.listHeight!==i.listHeight)throw new Error("Invalid list heights");s=Cg(s,i.length),o=o.merge(i.missingOpeningBracketIds)}return n?new Vg(s,e.listHeight+1,e,t,i,o):new Wg(s,e.listHeight+1,e,t,i,o)}static getEmpty(){return new zg(mg,0,[],Rg.getEmpty())}get kind(){return 4}get missingOpeningBracketIds(){return this._missingOpeningBracketIds}constructor(e,t,i){super(e),this.listHeight=t,this._missingOpeningBracketIds=i,this.cachedMinIndentation=-1}throwIfImmutable(){}makeLastElementMutable(){this.throwIfImmutable();const e=this.childrenLength;if(0===e)return;const t=this.getChild(e-1),i=4===t.kind?t.toMutable():t;return t!==i&&this.setChild(e-1,i),i}makeFirstElementMutable(){this.throwIfImmutable();if(0===this.childrenLength)return;const e=this.getChild(0),t=4===e.kind?e.toMutable():e;return e!==t&&this.setChild(0,t),t}canBeReused(e){if(e.intersects(this.missingOpeningBracketIds))return!1;if(0===this.childrenLength)return!1;let t=this;for(;4===t.kind;){const e=t.childrenLength;if(0===e)throw new f;t=t.getChild(e-1)}return t.canBeReused(e)}handleChildrenChanged(){this.throwIfImmutable();const e=this.childrenLength;let t=this.getChild(0).length,i=this.getChild(0).missingOpeningBracketIds;for(let n=1;n>>0}static getTokenType(e){return(768&e)>>>8}static containsBalancedBrackets(e){return!!(1024&e)}static getFontStyle(e){return(30720&e)>>>11}static getForeground(e){return(16744448&e)>>>15}static getBackground(e){return(4278190080&e)>>>24}static getClassNameFromMetadata(e){let t="mtk"+this.getForeground(e);const i=this.getFontStyle(e);return 1&i&&(t+=" mtki"),2&i&&(t+=" mtkb"),4&i&&(t+=" mtku"),8&i&&(t+=" mtks"),t}static getInlineStyleFromMetadata(e,t){const i=this.getForeground(e),n=this.getFontStyle(e);let s=`color: ${t[i]};`;1&n&&(s+="font-style: italic;"),2&n&&(s+="font-weight: bold;");let o="";return 4&n&&(o+=" underline"),8&n&&(o+=" line-through"),o&&(s+=`text-decoration:${o};`),s}static getPresentationFromMetadata(e){const t=this.getForeground(e),i=this.getFontStyle(e);return{foreground:t,italic:Boolean(1&i),bold:Boolean(2&i),underline:Boolean(4&i),strikethrough:Boolean(8&i)}}}class Zg{constructor(e,t,i,n,s){this.length=e,this.kind=t,this.bracketId=i,this.bracketIds=n,this.astNode=s}}class Yg{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.reader=new Xg(this.textModel,this.bracketTokens),this._offset=mg,this.didPeek=!1,this.peeked=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}get offset(){return this._offset}get length(){return vg(this.textBufferLineCount-1,this.textBufferLastLineLength)}skip(e){this.didPeek=!1,this._offset=Cg(this._offset,e);const t=bg(this._offset);this.reader.setPosition(t.lineCount,t.columnCount)}read(){let e;return this.peeked?(this.didPeek=!1,e=this.peeked):e=this.reader.read(),e&&(this._offset=Cg(this._offset,e.length)),e}peek(){return this.didPeek||(this.peeked=this.reader.read(),this.didPeek=!0),this.peeked}}class Xg{constructor(e,t){this.textModel=e,this.bracketTokens=t,this.lineIdx=0,this.line=null,this.lineCharOffset=0,this.lineTokens=null,this.lineTokenOffset=0,this.peekedToken=null,this.textBufferLineCount=e.getLineCount(),this.textBufferLastLineLength=e.getLineLength(this.textBufferLineCount)}setPosition(e,t){e===this.lineIdx?(this.lineCharOffset=t,null!==this.line&&(this.lineTokenOffset=0===this.lineCharOffset?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset))):(this.lineIdx=e,this.lineCharOffset=t,this.line=null),this.peekedToken=null}read(){if(this.peekedToken){const e=this.peekedToken;return this.peekedToken=null,this.lineCharOffset+=e.length,e}if(this.lineIdx>this.textBufferLineCount-1||this.lineIdx===this.textBufferLineCount-1&&this.lineCharOffset>=this.textBufferLastLineLength)return null;null===this.line&&(this.lineTokens=this.textModel.tokenization.getLineTokens(this.lineIdx+1),this.line=this.lineTokens.getLineContent(),this.lineTokenOffset=0===this.lineCharOffset?0:this.lineTokens.findTokenIndexAtOffset(this.lineCharOffset));const e=this.lineIdx,t=this.lineCharOffset;let i=0;for(;;){const n=this.lineTokens,s=n.getCount();let o=null;if(this.lineTokenOffset1e3)break}if(i>1500)break}const n=(s=e,o=t,r=this.lineIdx,a=this.lineCharOffset,s!==r?vg(r-s,a):vg(0,a-o));var s,o,r,a;return new Zg(n,0,-1,Rg.getEmpty(),new jg(n))}}class Qg{constructor(e,t){this.text=e,this._offset=mg,this.idx=0;const i=t.getRegExpStr(),n=i?new RegExp(i+"|\n","gi"):null,s=[];let o,r=0,a=0,l=0,h=0;const d=[];for(let g=0;g<60;g++)d.push(new Zg(vg(0,g),0,-1,Rg.getEmpty(),new jg(vg(0,g))));const c=[];for(let g=0;g<60;g++)c.push(new Zg(vg(1,g),0,-1,Rg.getEmpty(),new jg(vg(1,g))));if(n)for(n.lastIndex=0;null!==(o=n.exec(e));){const e=o.index,i=o[0];if("\n"===i)r++,a=e+1;else{if(l!==e){let t;if(h===r){const i=e-l;if(ifunction(e){let t=eo(e);/^[\w ]+/.test(e)&&(t=`\\b${t}`);/[\w ]+$/.test(e)&&(t=`${t}\\b`);return t}(e))).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(2===i.kind&&i.bracketIds.intersects(e))return t}get isEmpty(){return 0===this.map.size}}class ep{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=Jg.createFromLanguage(this.getLanguageConfiguration(e),this.denseKeyProvider),this.languageIdToBracketTokens.set(e,t)),t}}function tp(e,t=!1){if(0===e.length)return null;if(1===e.length)return e[0];let i=e.length;for(;i>3;){const n=i>>1;for(let s=0;s=3?e[2]:null,t)}function ip(e,t){return Math.abs(e.listHeight-t.listHeight)}function np(e,t){return e.listHeight===t.listHeight?Bg.create23(e,t,null,!1):e.listHeight>t.listHeight?function(e,t){let i=e=e.toMutable();const n=[];let s;for(;;){if(t.listHeight===i.listHeight){s=t;break}if(4!==i.kind)throw new Error("unexpected");n.push(i),i=i.makeLastElementMutable()}for(let o=n.length-1;o>=0;o--){const e=n[o];s?e.childrenLength>=3?s=Bg.create23(e.unappendChild(),s,null,!1):(e.appendChildOfSameHeight(s),s=void 0):e.handleChildrenChanged()}return s?Bg.create23(e,s,null,!1):e}(e,t):function(e,t){let i=e=e.toMutable();const n=[];for(;t.listHeight!==i.listHeight;){if(4!==i.kind)throw new Error("unexpected");n.push(i),i=i.makeFirstElementMutable()}let s=t;for(let o=n.length-1;o>=0;o--){const e=n[o];s?e.childrenLength>=3?s=Bg.create23(s,e.unprependChild(),null,!1):(e.prependChildOfSameHeight(s),s=void 0):e.handleChildrenChanged()}return s?Bg.create23(s,e,null,!1):e}(t,e)}class sp{constructor(e){this.lastOffset=mg,this.nextNodes=[e],this.offsets=[mg],this.idxs=[]}readLongestNodeAt(e,t){if(Lg(e,this.lastOffset))throw new Error("Invalid offset");for(this.lastOffset=e;;){const i=rp(this.nextNodes);if(!i)return;const n=rp(this.offsets);if(Lg(e,n))return;if(Lg(n,e))if(Cg(n,i.length)<=e)this.nextNodeAfterCurrent();else{const e=op(i);-1!==e?(this.nextNodes.push(i.getChild(e)),this.offsets.push(n),this.idxs.push(e)):this.nextNodeAfterCurrent()}else{if(t(i))return this.nextNodeAfterCurrent(),i;{const e=op(i);if(-1===e)return void this.nextNodeAfterCurrent();this.nextNodes.push(i.getChild(e)),this.offsets.push(n),this.idxs.push(e)}}}}nextNodeAfterCurrent(){for(;;){const e=rp(this.offsets),t=rp(this.nextNodes);if(this.nextNodes.pop(),this.offsets.pop(),0===this.idxs.length)break;const i=rp(this.nextNodes),n=op(i,this.idxs[this.idxs.length-1]);if(-1!==n){this.nextNodes.push(i.getChild(n)),this.offsets.push(Cg(e,t.length)),this.idxs[this.idxs.length-1]=n;break}this.idxs.pop()}}}function op(e,t=-1){for(;;){if(++t>=e.childrenLength)return-1;if(e.getChild(t))return t}}function rp(e){return e.length>0?e[e.length-1]:void 0}function ap(e,t,i,n){return new lp(e,t,i,n).parseDocument()}class lp{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 sp(i):void 0,this.positionMapper=new Ig(t)}parseDocument(){this._itemsConstructed=0,this._itemsFromCache=0;let e=this.parseList(Rg.getEmpty(),0);return e||(e=Bg.getEmpty()),e}parseList(e,t){const i=[];for(;;){let n=this.tryReadChildFromCache(e);if(!n){const i=this.tokenizer.peek();if(!i||2===i.kind&&i.bracketIds.intersects(e))break;n=this.parseChild(e,t+1)}4===n.kind&&0===n.childrenLength||i.push(n)}const n=this.oldNodeReader?function(e){if(0===e.length)return null;if(1===e.length)return e[0];let t=0;function i(){if(t>=e.length)return null;const i=t,n=e[i].listHeight;for(t++;t=2?tp(0===i&&t===e.length?e:e.slice(i,t),!1):e[i]}let n=i(),s=i();if(!s)return n;for(let o=i();o;o=i())ip(n,s)<=ip(s,o)?(n=np(n,s),s=o):s=np(s,o);return np(n,s)}(i):tp(i,this.createImmutableLists);return n}tryReadChildFromCache(e){if(this.oldNodeReader){const t=this.positionMapper.getDistanceToNextChange(this.tokenizer.offset);if(null===t||!fg(t)){const i=this.oldNodeReader.readLongestNodeAt(this.positionMapper.getOffsetBeforeChange(this.tokenizer.offset),(i=>{if(null!==t&&!Lg(i.length,t))return!1;return i.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 2:return new $g(i.bracketIds,i.length);case 0:return i.astNode;case 1:{if(t>300)return new jg(i.length);const n=e.merge(i.bracketIds),s=this.parseList(n,t+1),o=this.tokenizer.peek();return o&&2===o.kind&&(o.bracketId===i.bracketId||o.bracketIds.intersects(i.bracketIds))?(this.tokenizer.read(),Fg.create(i.astNode,s,o.astNode)):Fg.create(i.astNode,s,null)}default:throw new Error("unexpected")}}}function hp(e,t){if(0===e.length)return t;if(0===t.length)return e;const i=new ic(cp(e)),n=cp(t);n.push({modified:!1,lengthBefore:void 0,lengthAfter:void 0});let s=i.dequeue();function o(e){if(void 0===e){const e=i.takeWhile((e=>!0))||[];return s&&e.unshift(s),e}const t=[];for(;s&&!fg(e);){const[n,o]=s.splitAt(e);t.push(n),e=Sg(n.lengthAfter,e),s=null!=o?o:i.dequeue()}return fg(e)||t.push(new dp(!1,e,e)),t}const r=[];function a(e,t,i){if(r.length>0&&yg(r[r.length-1].endOffset,e)){const e=r[r.length-1];r[r.length-1]=new Eg(e.startOffset,t,Cg(e.newLength,i))}else r.push({startOffset:e,endOffset:t,newLength:i})}let l=mg;for(const h of n){const e=o(h.lengthBefore);if(h.modified){const t=Cg(l,wg(e,(e=>e.lengthBefore)));a(l,t,h.lengthAfter),l=t}else for(const t of e){const e=l;l=Cg(l,t.lengthBefore),t.modified&&a(e,l,t.lengthAfter)}}return r}class dp{constructor(e,t,i){this.modified=e,this.lengthBefore=t,this.lengthAfter=i}splitAt(e){const t=Sg(e,this.lengthAfter);return yg(t,mg)?[this,void 0]:this.modified?[new dp(this.modified,this.lengthBefore,e),new dp(this.modified,mg,t)]:[new dp(this.modified,e,e),new dp(this.modified,t,t)]}toString(){return`${this.modified?"M":"U"}:${bg(this.lengthBefore)} -> ${bg(this.lengthAfter)}`}}function cp(e){const t=[];let i=mg;for(const n of e){const e=Sg(i,n.startOffset);fg(e)||t.push(new dp(!1,e,e));const s=Sg(n.startOffset,n.endOffset);t.push(new dp(!0,s,n.newLength)),i=n.endOffset}return t}class up extends E{didLanguageChange(e){return this.brackets.didLanguageChange(e)}constructor(e,t){if(super(),this.textModel=e,this.getLanguageConfiguration=t,this.didChangeEmitter=new U,this.denseKeyProvider=new Og,this.brackets=new ep(this.denseKeyProvider,this.getLanguageConfiguration),this.onDidChange=this.didChangeEmitter.event,this.queuedTextEditsForInitialAstWithoutTokens=[],this.queuedTextEdits=[],e.tokenization.hasTokens)2===e.tokenization.backgroundTokenizationState?(this.initialAstWithoutTokens=void 0,this.astWithTokens=this.parseDocumentFromTextBuffer([],void 0,!1)):(this.initialAstWithoutTokens=this.parseDocumentFromTextBuffer([],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens);else{const e=this.brackets.getSingleLanguageBracketTokens(this.textModel.getLanguageId()),t=new Qg(this.textModel.getValue(),e);this.initialAstWithoutTokens=ap(t,[],void 0,!0),this.astWithTokens=this.initialAstWithoutTokens}}handleDidChangeBackgroundTokenizationState(){if(2===this.textModel.tokenization.backgroundTokenizationState){const e=void 0===this.initialAstWithoutTokens;this.initialAstWithoutTokens=void 0,e||this.didChangeEmitter.fire()}}handleDidChangeTokens({ranges:e}){const t=e.map((e=>new Eg(vg(e.fromLineNumber-1,0),vg(e.toLineNumber,0),vg(e.toLineNumber-e.fromLineNumber+1,0))));this.handleEdits(t,!0),this.initialAstWithoutTokens||this.didChangeEmitter.fire()}handleContentChanged(e){const t=Eg.fromModelContentChanges(e.changes);this.handleEdits(t,!1)}handleEdits(e,t){const i=hp(this.queuedTextEdits,e);this.queuedTextEdits=i,this.initialAstWithoutTokens&&!t&&(this.queuedTextEditsForInitialAstWithoutTokens=hp(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;return ap(new Yg(this.textModel,this.brackets),e,n,i)}getBracketsInRange(e,t){this.flushQueue();const i=vg(e.startLineNumber-1,e.startColumn-1),n=vg(e.endLineNumber-1,e.endColumn-1);return new nc((e=>{const s=this.initialAstWithoutTokens||this.astWithTokens;mp(s,mg,s.length,i,n,e,0,0,new Map,t)}))}getBracketPairsInRange(e,t){this.flushQueue();const i=xg(e.getStartPosition()),n=xg(e.getEndPosition());return new nc((e=>{const s=this.initialAstWithoutTokens||this.astWithTokens,o=new fp(e,t,this.textModel);_p(s,mg,s.length,i,n,o,0,new Map)}))}getFirstBracketAfter(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return pp(t,mg,t.length,xg(e))}getFirstBracketBefore(e){this.flushQueue();const t=this.initialAstWithoutTokens||this.astWithTokens;return gp(t,mg,t.length,xg(e))}}function gp(e,t,i,n){if(4===e.kind||2===e.kind){const s=[];for(const n of e.children)i=Cg(t,n.length),s.push({nodeOffsetStart:t,nodeOffsetEnd:i}),t=i;for(let t=s.length-1;t>=0;t--){const{nodeOffsetStart:i,nodeOffsetEnd:o}=s[t];if(Lg(i,n)){const s=gp(e.children[t],i,o,n);if(s)return s}}return null}if(3===e.kind)return null;if(1===e.kind){const n=Ng(t,i);return{bracketInfo:e.bracketInfo,range:n}}return null}function pp(e,t,i,n){if(4===e.kind||2===e.kind){for(const s of e.children){if(Lg(n,i=Cg(t,s.length))){const e=pp(s,t,i,n);if(e)return e}t=i}return null}if(3===e.kind)return null;if(1===e.kind){const n=Ng(t,i);return{bracketInfo:e.bracketInfo,range:n}}return null}function mp(e,t,i,n,s,o,r,a,l,h,d=!1){if(r>200)return!0;e:for(;;)switch(e.kind){case 4:{const a=e.childrenLength;for(let d=0;d200)return!0;let h=!0;if(2===e.kind){let d=0;if(a){let t=a.get(e.openingBracket.text);void 0===t&&(t=0),d=t,t++,a.set(e.openingBracket.text,t)}const c=Cg(t,e.openingBracket.length);let u=-1;if(o.includeMinIndentation&&(u=e.computeMinIndentation(t,o.textModel)),h=o.push(new gg(Ng(t,i),Ng(t,c),e.closingBracket?Ng(Cg(c,(null===(l=e.child)||void 0===l?void 0:l.length)||mg),i):void 0,r,d,e,u)),t=c,h&&e.child){const l=e.child;if(i=Cg(t,l.length),kg(t,s)&&Dg(i,n)&&(h=_p(l,t,i,n,s,o,r+1,a),!h))return!1}null==a||a.set(e.openingBracket.text,d)}else{let i=t;for(const t of e.children){const e=i;if(i=Cg(i,t.length),kg(e,s)&&kg(n,i)&&(h=_p(t,e,i,n,s,o,r,a),!h))return!1}}return h}class vp extends E{get canBuildAST(){return this.textModel.getValueLength()<=5e6}constructor(e,t){super(),this.textModel=e,this.languageConfigurationService=t,this.bracketPairsTree=this._register(new I),this.onDidChangeEmitter=new U,this.onDidChange=this.onDidChangeEmitter.event,this.bracketsRequested=!1,this._register(this.languageConfigurationService.onDidChange((e=>{var t;e.languageId&&!(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.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){var t;null===(t=this.bracketPairsTree.value)||void 0===t||t.object.handleContentChanged(e)}handleDidChangeBackgroundTokenizationState(){var e;null===(e=this.bracketPairsTree.value)||void 0===e||e.object.handleDidChangeBackgroundTokenizationState()}handleDidChangeTokens(e){var t;null===(t=this.bracketPairsTree.value)||void 0===t||t.object.handleDidChangeTokens(e)}updateBracketPairsTree(){if(this.bracketsRequested&&this.canBuildAST){if(!this.bracketPairsTree.value){const i=new N;this.bracketPairsTree.value=(e=i.add(new up(this.textModel,(e=>this.languageConfigurationService.getLanguageConfiguration(e)))),t=i,{object:e,dispose:()=>null==t?void 0:t.dispose()}),i.add(this.bracketPairsTree.value.object.onDidChange((e=>this.onDidChangeEmitter.fire(e)))),this.onDidChangeEmitter.fire()}}else this.bracketPairsTree.value&&(this.bracketPairsTree.clear(),this.onDidChangeEmitter.fire());var e,t}getBracketPairsInRange(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getBracketPairsInRange(e,!1))||nc.empty}getBracketPairsInRangeWithMinIndentation(e){var t;return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getBracketPairsInRange(e,!0))||nc.empty}getBracketsInRange(e,t=!1){var i;return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(i=this.bracketPairsTree.value)||void 0===i?void 0:i.object.getBracketsInRange(e,t))||nc.empty}findMatchingBracketUp(e,t,i){const n=this.textModel.validatePosition(t),s=this.textModel.getLanguageIdAtPosition(n.lineNumber,n.column);if(this.canBuildAST){const i=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew.getClosingBracketInfo(e);if(!i)return null;const n=this.getBracketPairsInRange(Rh.fromPositions(t,t)).findLast((e=>i.closes(e.openingBracketInfo)));return n?n.openingBracketRange:null}{const t=e.toLowerCase(),o=this.languageConfigurationService.getLanguageConfiguration(s).brackets;if(!o)return null;const r=o.textIsBracket[t];return r?wp(this._findMatchingBracketUp(r,n,bp(i))):null}}matchBracket(e,t){if(this.canBuildAST){const t=this.getBracketPairsInRange(Rh.fromPositions(e,e)).filter((t=>void 0!==t.closingBracketRange&&(t.openingBracketRange.containsPosition(e)||t.closingBracketRange.containsPosition(e)))).findLastMaxBy(Qd((t=>t.openingBracketRange.containsPosition(e)?t.openingBracketRange:t.closingBracketRange),Rh.compareRangesUsingStarts));return t?[t.openingBracketRange,t.closingBracketRange]:null}{const i=bp(t);return this._matchBracket(this.textModel.validatePosition(e),i)}}_establishBracketSearchOffsets(e,t,i,n){const s=t.getCount(),o=t.getLanguageId(n);let r=Math.max(0,e.column-1-i.maxBracketLength);for(let l=n-1;l>=0;l--){const e=t.getEndOffset(l);if(e<=r)break;if(Fc(t.getStandardTokenType(l))||t.getLanguageId(l)!==o){r=e;break}}let a=Math.min(t.getLineContent().length,e.column-1+i.maxBracketLength);for(let l=n+1;l=a)break;if(Fc(t.getStandardTokenType(l))||t.getLanguageId(l)!==o){a=e;break}}return{searchStartOffset:r,searchEndOffset:a}}_matchBracket(e,t){const i=e.lineNumber,n=this.textModel.tokenization.getLineTokens(i),s=this.textModel.getLineContent(i),o=n.findTokenIndexAtOffset(e.column-1);if(o<0)return null;const r=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(o)).brackets;if(r&&!Fc(n.getStandardTokenType(o))){let{searchStartOffset:a,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,r,o),h=null;for(;;){const n=hu.findNextBracketInRange(r.forwardRegex,i,s,a,l);if(!n)break;if(n.startColumn<=e.column&&e.column<=n.endColumn){const e=s.substring(n.startColumn-1,n.endColumn-1).toLowerCase(),i=this._matchFoundBracket(n,r.textIsBracket[e],r.textIsOpenBracket[e],t);if(i){if(i instanceof Cp)return null;h=i}}a=n.endColumn-1}if(h)return h}if(o>0&&n.getStartOffset(o)===e.column-1){const r=o-1,a=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId(r)).brackets;if(a&&!Fc(n.getStandardTokenType(r))){const{searchStartOffset:o,searchEndOffset:l}=this._establishBracketSearchOffsets(e,n,a,r),h=hu.findPrevBracketInRange(a.reversedRegex,i,s,o,l);if(h&&h.startColumn<=e.column&&e.column<=h.endColumn){const e=s.substring(h.startColumn-1,h.endColumn-1).toLowerCase(),i=this._matchFoundBracket(h,a.textIsBracket[e],a.textIsOpenBracket[e],t);if(i)return i instanceof Cp?null:i}}}return null}_matchFoundBracket(e,t,i,n){if(!t)return null;const s=i?this._findMatchingBracketDown(t,e.getEndPosition(),n):this._findMatchingBracketUp(t,e.getStartPosition(),n);return s?s instanceof Cp?s:[e,s]:null}_findMatchingBracketUp(e,t,i){const n=e.languageId,s=e.reversedRegex;let o=-1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return Cp.INSTANCE;const h=hu.findPrevBracketInRange(s,t,n,a,l);if(!h)break;const d=n.substring(h.startColumn-1,h.endColumn-1).toLowerCase();if(e.isOpen(d)?o++:e.isClose(d)&&o--,0===o)return h;l=h.startColumn-1}return null};for(let l=t.lineNumber;l>=1;l--){const e=this.textModel.tokenization.getLineTokens(l),i=e.getCount(),s=this.textModel.getLineContent(l);let o=i-1,r=s.length,h=s.length;l===t.lineNumber&&(o=e.findTokenIndexAtOffset(t.column-1),r=t.column-1,h=t.column-1);let d=!0;for(;o>=0;o--){const t=e.getLanguageId(o)===n&&!Fc(e.getStandardTokenType(o));if(t)d?r=e.getStartOffset(o):(r=e.getStartOffset(o),h=e.getEndOffset(o));else if(d&&r!==h){const e=a(l,s,r,h);if(e)return e}d=t}if(d&&r!==h){const e=a(l,s,r,h);if(e)return e}}return null}_findMatchingBracketDown(e,t,i){const n=e.languageId,s=e.forwardRegex;let o=1,r=0;const a=(t,n,a,l)=>{for(;;){if(i&&++r%100==0&&!i())return Cp.INSTANCE;const h=hu.findNextBracketInRange(s,t,n,a,l);if(!h)break;const d=n.substring(h.startColumn-1,h.endColumn-1).toLowerCase();if(e.isOpen(d)?o++:e.isClose(d)&&o--,0===o)return h;a=h.endColumn-1}return null},l=this.textModel.getLineCount();for(let h=t.lineNumber;h<=l;h++){const e=this.textModel.tokenization.getLineTokens(h),i=e.getCount(),s=this.textModel.getLineContent(h);let o=0,r=0,l=0;h===t.lineNumber&&(o=e.findTokenIndexAtOffset(t.column-1),r=t.column-1,l=t.column-1);let d=!0;for(;o=1;r--){const e=this.textModel.tokenization.getLineTokens(r),t=e.getCount(),a=this.textModel.getLineContent(r);let l=t-1,h=a.length,d=a.length;if(r===i.lineNumber){l=e.findTokenIndexAtOffset(i.column-1),h=i.column-1,d=i.column-1;const t=e.getLanguageId(l);n!==t&&(n=t,s=this.languageConfigurationService.getLanguageConfiguration(n).brackets,o=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew)}let c=!0;for(;l>=0;l--){const t=e.getLanguageId(l);if(n!==t){if(s&&o&&c&&h!==d){const e=hu.findPrevBracketInRange(s.reversedRegex,r,a,h,d);if(e)return this._toFoundBracket(o,e);c=!1}n=t,s=this.languageConfigurationService.getLanguageConfiguration(n).brackets,o=this.languageConfigurationService.getLanguageConfiguration(n).bracketsNew}const i=!!s&&!Fc(e.getStandardTokenType(l));if(i)c?h=e.getStartOffset(l):(h=e.getStartOffset(l),d=e.getEndOffset(l));else if(o&&s&&c&&h!==d){const e=hu.findPrevBracketInRange(s.reversedRegex,r,a,h,d);if(e)return this._toFoundBracket(o,e)}c=i}if(o&&s&&c&&h!==d){const e=hu.findPrevBracketInRange(s.reversedRegex,r,a,h,d);if(e)return this._toFoundBracket(o,e)}}return null}findNextBracket(e){var t;const i=this.textModel.validatePosition(e);if(this.canBuildAST)return this.bracketsRequested=!0,this.updateBracketPairsTree(),(null===(t=this.bracketPairsTree.value)||void 0===t?void 0:t.object.getFirstBracketAfter(i))||null;const n=this.textModel.getLineCount();let s=null,o=null,r=null;for(let a=i.lineNumber;a<=n;a++){const e=this.textModel.tokenization.getLineTokens(a),t=e.getCount(),n=this.textModel.getLineContent(a);let l=0,h=0,d=0;if(a===i.lineNumber){l=e.findTokenIndexAtOffset(i.column-1),h=i.column-1,d=i.column-1;const t=e.getLanguageId(l);s!==t&&(s=t,o=this.languageConfigurationService.getLanguageConfiguration(s).brackets,r=this.languageConfigurationService.getLanguageConfiguration(s).bracketsNew)}let c=!0;for(;lvoid 0!==t.closingBracketRange&&t.range.strictContainsRange(e)));return t?[t.openingBracketRange,t.closingBracketRange]:null}const n=bp(t),s=this.textModel.getLineCount(),o=new Map;let r=[];const a=(e,t)=>{if(!o.has(e)){const i=[];for(let e=0,n=t?t.brackets.length:0;e{for(;;){if(n&&++l%100==0&&!n())return Cp.INSTANCE;const a=hu.findNextBracketInRange(e.forwardRegex,t,i,s,o);if(!a)break;const h=i.substring(a.startColumn-1,a.endColumn-1).toLowerCase(),d=e.textIsBracket[h];if(d&&(d.isOpen(h)?r[d.index]++:d.isClose(h)&&r[d.index]--,-1===r[d.index]))return this._matchFoundBracket(a,d,!1,n);s=a.endColumn-1}return null};let d=null,c=null;for(let u=i.lineNumber;u<=s;u++){const e=this.textModel.tokenization.getLineTokens(u),t=e.getCount(),n=this.textModel.getLineContent(u);let s=0,o=0,r=0;if(u===i.lineNumber){s=e.findTokenIndexAtOffset(i.column-1),o=i.column-1,r=i.column-1;const t=e.getLanguageId(s);d!==t&&(d=t,c=this.languageConfigurationService.getLanguageConfiguration(d).brackets,a(d,c))}let l=!0;for(;s!0;{const t=Date.now();return()=>Date.now()-t<=e}}class Cp{constructor(){this._searchCanceledBrand=void 0}}function wp(e){return e instanceof Cp?null:e}function yp(e){return`--vscode-${e.replace(/\./g,"-")}`}function Sp(e){return`var(${yp(e)})`}Cp.INSTANCE=new Cp;const Lp="base.contributions.colors";const kp=new class{constructor(){this._onDidChangeSchema=new U,this.onDidChangeSchema=this._onDidChangeSchema.event,this.colorSchema={type:"object",properties:{}},this.colorReferenceSchema={type:"string",enum:[],enumDescriptions:[]},this.colorsById={}}registerColor(e,t,i,n=!1,s){const o={id:e,description:i,defaults:t,needsTransparency:n,deprecationMessage:s};this.colorsById[e]=o;const r={type:"string",description:i,format:"color-hex",defaultSnippets:[{body:"${1:#ff0000}"}]};return s&&(r.deprecationMessage=s),this.colorSchema.properties[e]=r,this.colorReferenceSchema.enum.push(e),this.colorReferenceSchema.enumDescriptions.push(i),this._onDidChangeSchema.fire(),e}getColors(){return Object.keys(this.colorsById).map((e=>this.colorsById[e]))}resolveDefaultColor(e,t){const i=this.colorsById[e];if(i&&i.defaults){return E_(i.defaults[t.type],t)}}getColorSchema(){return this.colorSchema}toString(){return Object.keys(this.colorsById).sort(((e,t)=>{const i=-1===e.indexOf(".")?0:1,n=-1===t.indexOf(".")?0:1;return i!==n?i-n:e.localeCompare(t)})).map((e=>`- \`${e}\`: ${this.colorsById[e].description}`)).join("\n")}};function Dp(e,t,i,n,s){return kp.registerColor(e,t,i,n,s)}jl.add(Lp,kp);const xp=Dp("foreground",{dark:"#CCCCCC",light:"#616161",hcDark:"#FFFFFF",hcLight:"#292929"},ue(0,"Overall foreground color. This color is only used if not overridden by a component.")),Np=(Dp("disabledForeground",{dark:"#CCCCCC80",light:"#61616180",hcDark:"#A5A5A5",hcLight:"#7F7F7F"},ue(0,"Overall foreground for disabled elements. This color is only used if not overridden by a component.")),Dp("errorForeground",{dark:"#F48771",light:"#A1260D",hcDark:"#F48771",hcLight:"#B5200D"},ue(0,"Overall foreground color for error messages. This color is only used if not overridden by a component."))),Ep=(Dp("descriptionForeground",{light:"#717171",dark:D_(xp,.7),hcDark:D_(xp,.7),hcLight:D_(xp,.7)},ue(0,"Foreground color for description text providing additional information, for example for a label.")),Dp("icon.foreground",{dark:"#C5C5C5",light:"#424242",hcDark:"#FFFFFF",hcLight:"#292929"},ue(0,"The default color for icons in the workbench."))),Ip=Dp("focusBorder",{dark:"#007FD4",light:"#0090F1",hcDark:"#F38518",hcLight:"#006BBD"},ue(0,"Overall border color for focused elements. This color is only used if not overridden by a component.")),Mp=Dp("contrastBorder",{light:null,dark:null,hcDark:"#6FC3DF",hcLight:"#0F4A85"},ue(0,"An extra border around elements to separate them from others for greater contrast.")),Tp=Dp("contrastActiveBorder",{light:null,dark:null,hcDark:Ip,hcLight:Ip},ue(0,"An extra border around active elements to separate them from others for greater contrast.")),Rp=(Dp("selection.background",{light:null,dark:null,hcDark:null,hcLight:null},ue(0,"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.")),Dp("textSeparator.foreground",{light:"#0000002e",dark:"#ffffff2e",hcDark:lc.black,hcLight:"#292929"},ue(0,"Color for text separators.")),Dp("textLink.foreground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},ue(0,"Foreground color for links in text."))),Ap=(Dp("textLink.activeForeground",{light:"#006AB1",dark:"#3794FF",hcDark:"#3794FF",hcLight:"#0F4A85"},ue(0,"Foreground color for links in text when clicked on and on mouse hover.")),Dp("textPreformat.foreground",{light:"#A31515",dark:"#D7BA7D",hcDark:"#D7BA7D",hcLight:"#292929"},ue(0,"Foreground color for preformatted text segments.")),Dp("textBlockQuote.background",{light:"#7f7f7f1a",dark:"#7f7f7f1a",hcDark:null,hcLight:"#F2F2F2"},ue(0,"Background color for block quotes in text.")),Dp("textBlockQuote.border",{light:"#007acc80",dark:"#007acc80",hcDark:lc.white,hcLight:"#292929"},ue(0,"Border color for block quotes in text.")),Dp("textCodeBlock.background",{light:"#dcdcdc66",dark:"#0a0a0a66",hcDark:lc.black,hcLight:"#F2F2F2"},ue(0,"Background color for code blocks in text.")),Dp("widget.shadow",{dark:D_(lc.black,.36),light:D_(lc.black,.16),hcDark:null,hcLight:null},ue(0,"Shadow color of widgets such as find/replace inside the editor."))),Op=Dp("widget.border",{dark:null,light:null,hcDark:Mp,hcLight:Mp},ue(0,"Border color of widgets such as find/replace inside the editor.")),Pp=Dp("input.background",{dark:"#3C3C3C",light:lc.white,hcDark:lc.black,hcLight:lc.white},ue(0,"Input box background.")),Fp=Dp("input.foreground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"Input box foreground.")),Bp=Dp("input.border",{dark:null,light:null,hcDark:Mp,hcLight:Mp},ue(0,"Input box border.")),Wp=Dp("inputOption.activeBorder",{dark:"#007ACC",light:"#007ACC",hcDark:Mp,hcLight:Mp},ue(0,"Border color of activated options in input fields.")),Vp=(Dp("inputOption.hoverBackground",{dark:"#5a5d5e80",light:"#b8b8b850",hcDark:null,hcLight:null},ue(0,"Background color of activated options in input fields.")),Dp("inputOption.activeBackground",{dark:D_(Ip,.4),light:D_(Ip,.2),hcDark:lc.transparent,hcLight:lc.transparent},ue(0,"Background hover color of options in input fields."))),Hp=Dp("inputOption.activeForeground",{dark:lc.white,light:lc.black,hcDark:xp,hcLight:xp},ue(0,"Foreground color of activated options in input fields.")),zp=(Dp("input.placeholderForeground",{light:D_(xp,.5),dark:D_(xp,.5),hcDark:D_(xp,.7),hcLight:D_(xp,.7)},ue(0,"Input box foreground color for placeholder text.")),Dp("inputValidation.infoBackground",{dark:"#063B49",light:"#D6ECF2",hcDark:lc.black,hcLight:lc.white},ue(0,"Input validation background color for information severity."))),Up=Dp("inputValidation.infoForeground",{dark:null,light:null,hcDark:null,hcLight:xp},ue(0,"Input validation foreground color for information severity.")),Kp=Dp("inputValidation.infoBorder",{dark:"#007acc",light:"#007acc",hcDark:Mp,hcLight:Mp},ue(0,"Input validation border color for information severity.")),jp=Dp("inputValidation.warningBackground",{dark:"#352A05",light:"#F6F5D2",hcDark:lc.black,hcLight:lc.white},ue(0,"Input validation background color for warning severity.")),qp=Dp("inputValidation.warningForeground",{dark:null,light:null,hcDark:null,hcLight:xp},ue(0,"Input validation foreground color for warning severity.")),$p=Dp("inputValidation.warningBorder",{dark:"#B89500",light:"#B89500",hcDark:Mp,hcLight:Mp},ue(0,"Input validation border color for warning severity.")),Gp=Dp("inputValidation.errorBackground",{dark:"#5A1D1D",light:"#F2DEDE",hcDark:lc.black,hcLight:lc.white},ue(0,"Input validation background color for error severity.")),Zp=Dp("inputValidation.errorForeground",{dark:null,light:null,hcDark:null,hcLight:xp},ue(0,"Input validation foreground color for error severity.")),Yp=Dp("inputValidation.errorBorder",{dark:"#BE1100",light:"#BE1100",hcDark:Mp,hcLight:Mp},ue(0,"Input validation border color for error severity.")),Xp=Dp("dropdown.background",{dark:"#3C3C3C",light:lc.white,hcDark:lc.black,hcLight:lc.white},ue(0,"Dropdown background.")),Qp=Dp("dropdown.listBackground",{dark:null,light:null,hcDark:lc.black,hcLight:lc.white},ue(0,"Dropdown list background.")),Jp=Dp("dropdown.foreground",{dark:"#F0F0F0",light:xp,hcDark:lc.white,hcLight:xp},ue(0,"Dropdown foreground.")),em=Dp("dropdown.border",{dark:Xp,light:"#CECECE",hcDark:Mp,hcLight:Mp},ue(0,"Dropdown border.")),tm=Dp("button.foreground",{dark:lc.white,light:lc.white,hcDark:lc.white,hcLight:lc.white},ue(0,"Button foreground color.")),im=Dp("button.separator",{dark:D_(tm,.4),light:D_(tm,.4),hcDark:D_(tm,.4),hcLight:D_(tm,.4)},ue(0,"Button separator color.")),nm=Dp("button.background",{dark:"#0E639C",light:"#007ACC",hcDark:null,hcLight:"#0F4A85"},ue(0,"Button background color.")),sm=Dp("button.hoverBackground",{dark:k_(nm,.2),light:L_(nm,.2),hcDark:nm,hcLight:nm},ue(0,"Button background color when hovering.")),om=Dp("button.border",{dark:Mp,light:Mp,hcDark:Mp,hcLight:Mp},ue(0,"Button border color.")),rm=Dp("button.secondaryForeground",{dark:lc.white,light:lc.white,hcDark:lc.white,hcLight:xp},ue(0,"Secondary button foreground color.")),am=Dp("button.secondaryBackground",{dark:"#3A3D41",light:"#5F6A79",hcDark:null,hcLight:lc.white},ue(0,"Secondary button background color.")),lm=Dp("button.secondaryHoverBackground",{dark:k_(am,.2),light:L_(am,.2),hcDark:null,hcLight:null},ue(0,"Secondary button background color when hovering.")),hm=Dp("badge.background",{dark:"#4D4D4D",light:"#C4C4C4",hcDark:lc.black,hcLight:"#0F4A85"},ue(0,"Badge background color. Badges are small information labels, e.g. for search results count.")),dm=Dp("badge.foreground",{dark:lc.white,light:"#333",hcDark:lc.white,hcLight:lc.white},ue(0,"Badge foreground color. Badges are small information labels, e.g. for search results count.")),cm=Dp("scrollbar.shadow",{dark:"#000000",light:"#DDDDDD",hcDark:null,hcLight:null},ue(0,"Scrollbar shadow to indicate that the view is scrolled.")),um=Dp("scrollbarSlider.background",{dark:lc.fromHex("#797979").transparent(.4),light:lc.fromHex("#646464").transparent(.4),hcDark:D_(Mp,.6),hcLight:D_(Mp,.4)},ue(0,"Scrollbar slider background color.")),gm=Dp("scrollbarSlider.hoverBackground",{dark:lc.fromHex("#646464").transparent(.7),light:lc.fromHex("#646464").transparent(.7),hcDark:D_(Mp,.8),hcLight:D_(Mp,.8)},ue(0,"Scrollbar slider background color when hovering.")),pm=Dp("scrollbarSlider.activeBackground",{dark:lc.fromHex("#BFBFBF").transparent(.4),light:lc.fromHex("#000000").transparent(.6),hcDark:Mp,hcLight:Mp},ue(0,"Scrollbar slider background color when clicked on.")),mm=Dp("progressBar.background",{dark:lc.fromHex("#0E70C0"),light:lc.fromHex("#0E70C0"),hcDark:Mp,hcLight:Mp},ue(0,"Background color of the progress bar that can show for long running operations.")),fm=(Dp("editorError.background",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Background color of error text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Dp("editorError.foreground",{dark:"#F14C4C",light:"#E51400",hcDark:"#F48771",hcLight:"#B5200D"},ue(0,"Foreground color of error squigglies in the editor."))),_m=Dp("editorError.border",{dark:null,light:null,hcDark:lc.fromHex("#E47777").transparent(.8),hcLight:"#B5200D"},ue(0,"If set, color of double underlines for errors in the editor.")),vm=(Dp("editorWarning.background",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Background color of warning text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Dp("editorWarning.foreground",{dark:"#CCA700",light:"#BF8803",hcDark:"#FFD370",hcLight:"#895503"},ue(0,"Foreground color of warning squigglies in the editor."))),bm=Dp("editorWarning.border",{dark:null,light:null,hcDark:lc.fromHex("#FFCC00").transparent(.8),hcLight:lc.fromHex("#FFCC00").transparent(.8)},ue(0,"If set, color of double underlines for warnings in the editor.")),Cm=(Dp("editorInfo.background",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Background color of info text in the editor. The color must not be opaque so as not to hide underlying decorations."),!0),Dp("editorInfo.foreground",{dark:"#3794FF",light:"#1a85ff",hcDark:"#3794FF",hcLight:"#1a85ff"},ue(0,"Foreground color of info squigglies in the editor."))),wm=Dp("editorInfo.border",{dark:null,light:null,hcDark:lc.fromHex("#3794FF").transparent(.8),hcLight:"#292929"},ue(0,"If set, color of double underlines for infos in the editor.")),ym=Dp("editorHint.foreground",{dark:lc.fromHex("#eeeeee").transparent(.7),light:"#6c6c6c",hcDark:null,hcLight:null},ue(0,"Foreground color of hint squigglies in the editor.")),Sm=(Dp("editorHint.border",{dark:null,light:null,hcDark:lc.fromHex("#eeeeee").transparent(.8),hcLight:"#292929"},ue(0,"If set, color of double underlines for hints in the editor.")),Dp("sash.hoverBorder",{dark:Ip,light:Ip,hcDark:Ip,hcLight:Ip},ue(0,"Border color of active sashes.")),Dp("editor.background",{light:"#ffffff",dark:"#1E1E1E",hcDark:lc.black,hcLight:lc.white},ue(0,"Editor background color."))),Lm=Dp("editor.foreground",{light:"#333333",dark:"#BBBBBB",hcDark:lc.white,hcLight:xp},ue(0,"Editor default foreground color.")),km=(Dp("editorStickyScroll.background",{light:Sm,dark:Sm,hcDark:Sm,hcLight:Sm},ue(0,"Sticky scroll background color for the editor")),Dp("editorStickyScrollHover.background",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:null,hcLight:lc.fromHex("#0F4A85").transparent(.1)},ue(0,"Sticky scroll on hover background color for the editor")),Dp("editorWidget.background",{dark:"#252526",light:"#F3F3F3",hcDark:"#0C141F",hcLight:lc.white},ue(0,"Background color of editor widgets, such as find/replace."))),Dm=Dp("editorWidget.foreground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"Foreground color of editor widgets, such as find/replace.")),xm=Dp("editorWidget.border",{dark:"#454545",light:"#C8C8C8",hcDark:Mp,hcLight:Mp},ue(0,"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.")),Nm=Dp("editorWidget.resizeBorder",{light:null,dark:null,hcDark:null,hcLight:null},ue(0,"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.")),Em=Dp("quickInput.background",{dark:km,light:km,hcDark:km,hcLight:km},ue(0,"Quick picker background color. The quick picker widget is the container for pickers like the command palette.")),Im=Dp("quickInput.foreground",{dark:Dm,light:Dm,hcDark:Dm,hcLight:Dm},ue(0,"Quick picker foreground color. The quick picker widget is the container for pickers like the command palette.")),Mm=Dp("quickInputTitle.background",{dark:new lc(new oc(255,255,255,.105)),light:new lc(new oc(0,0,0,.06)),hcDark:"#000000",hcLight:lc.white},ue(0,"Quick picker title background color. The quick picker widget is the container for pickers like the command palette.")),Tm=Dp("pickerGroup.foreground",{dark:"#3794FF",light:"#0066BF",hcDark:lc.white,hcLight:"#0F4A85"},ue(0,"Quick picker color for grouping labels.")),Rm=Dp("pickerGroup.border",{dark:"#3F3F46",light:"#CCCEDB",hcDark:lc.white,hcLight:"#0F4A85"},ue(0,"Quick picker color for grouping borders.")),Am=Dp("keybindingLabel.background",{dark:new lc(new oc(128,128,128,.17)),light:new lc(new oc(221,221,221,.4)),hcDark:lc.transparent,hcLight:lc.transparent},ue(0,"Keybinding label background color. The keybinding label is used to represent a keyboard shortcut.")),Om=Dp("keybindingLabel.foreground",{dark:lc.fromHex("#CCCCCC"),light:lc.fromHex("#555555"),hcDark:lc.white,hcLight:xp},ue(0,"Keybinding label foreground color. The keybinding label is used to represent a keyboard shortcut.")),Pm=Dp("keybindingLabel.border",{dark:new lc(new oc(51,51,51,.6)),light:new lc(new oc(204,204,204,.4)),hcDark:new lc(new oc(111,195,223)),hcLight:Mp},ue(0,"Keybinding label border color. The keybinding label is used to represent a keyboard shortcut.")),Fm=Dp("keybindingLabel.bottomBorder",{dark:new lc(new oc(68,68,68,.6)),light:new lc(new oc(187,187,187,.4)),hcDark:new lc(new oc(111,195,223)),hcLight:xp},ue(0,"Keybinding label border bottom color. The keybinding label is used to represent a keyboard shortcut.")),Bm=Dp("editor.selectionBackground",{light:"#ADD6FF",dark:"#264F78",hcDark:"#f3f518",hcLight:"#0F4A85"},ue(0,"Color of the editor selection.")),Wm=Dp("editor.selectionForeground",{light:null,dark:null,hcDark:"#000000",hcLight:lc.white},ue(0,"Color of the selected text for high contrast.")),Vm=Dp("editor.inactiveSelectionBackground",{light:D_(Bm,.5),dark:D_(Bm,.5),hcDark:D_(Bm,.7),hcLight:D_(Bm,.5)},ue(0,"Color of the selection in an inactive editor. The color must not be opaque so as not to hide underlying decorations."),!0),Hm=Dp("editor.selectionHighlightBackground",{light:N_(Bm,Sm,.3,.6),dark:N_(Bm,Sm,.3,.6),hcDark:null,hcLight:null},ue(0,"Color for regions with the same content as the selection. The color must not be opaque so as not to hide underlying decorations."),!0),zm=(Dp("editor.selectionHighlightBorder",{light:null,dark:null,hcDark:Tp,hcLight:Tp},ue(0,"Border color for regions with the same content as the selection.")),Dp("editor.findMatchBackground",{light:"#A8AC94",dark:"#515C6A",hcDark:null,hcLight:null},ue(0,"Color of the current search match."))),Um=Dp("editor.findMatchHighlightBackground",{light:"#EA5C0055",dark:"#EA5C0055",hcDark:null,hcLight:null},ue(0,"Color of the other search matches. The color must not be opaque so as not to hide underlying decorations."),!0),Km=Dp("editor.findRangeHighlightBackground",{dark:"#3a3d4166",light:"#b4b4b44d",hcDark:null,hcLight:null},ue(0,"Color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),jm=Dp("editor.findMatchBorder",{light:null,dark:null,hcDark:Tp,hcLight:Tp},ue(0,"Border color of the current search match.")),qm=Dp("editor.findMatchHighlightBorder",{light:null,dark:null,hcDark:Tp,hcLight:Tp},ue(0,"Border color of the other search matches.")),$m=Dp("editor.findRangeHighlightBorder",{dark:null,light:null,hcDark:D_(Tp,.4),hcLight:D_(Tp,.4)},ue(0,"Border color of the range limiting the search. The color must not be opaque so as not to hide underlying decorations."),!0),Gm=(Dp("searchEditor.findMatchBackground",{light:D_(Um,.66),dark:D_(Um,.66),hcDark:Um,hcLight:Um},ue(0,"Color of the Search Editor query matches.")),Dp("searchEditor.findMatchBorder",{light:D_(qm,.66),dark:D_(qm,.66),hcDark:qm,hcLight:qm},ue(0,"Border color of the Search Editor query matches.")),Dp("search.resultsInfoForeground",{light:xp,dark:D_(xp,.65),hcDark:xp,hcLight:xp},ue(0,"Color of the text in the search viewlet's completion message.")),Dp("editor.hoverHighlightBackground",{light:"#ADD6FF26",dark:"#264f7840",hcDark:"#ADD6FF26",hcLight:null},ue(0,"Highlight below the word for which a hover is shown. The color must not be opaque so as not to hide underlying decorations."),!0),Dp("editorHoverWidget.background",{light:km,dark:km,hcDark:km,hcLight:km},ue(0,"Background color of the editor hover."))),Zm=(Dp("editorHoverWidget.foreground",{light:Dm,dark:Dm,hcDark:Dm,hcLight:Dm},ue(0,"Foreground color of the editor hover.")),Dp("editorHoverWidget.border",{light:xm,dark:xm,hcDark:xm,hcLight:xm},ue(0,"Border color of the editor hover."))),Ym=(Dp("editorHoverWidget.statusBarBackground",{dark:k_(Gm,.2),light:L_(Gm,.05),hcDark:km,hcLight:km},ue(0,"Background color of the editor hover status bar.")),Dp("editorLink.activeForeground",{dark:"#4E94CE",light:lc.blue,hcDark:lc.cyan,hcLight:"#292929"},ue(0,"Color of active links."))),Xm=Dp("editorInlayHint.foreground",{dark:"#969696",light:"#969696",hcDark:lc.white,hcLight:lc.black},ue(0,"Foreground color of inline hints")),Qm=Dp("editorInlayHint.background",{dark:D_(hm,.1),light:D_(hm,.1),hcDark:D_(lc.white,.1),hcLight:D_(hm,.1)},ue(0,"Background color of inline hints")),Jm=Dp("editorInlayHint.typeForeground",{dark:Xm,light:Xm,hcDark:Xm,hcLight:Xm},ue(0,"Foreground color of inline hints for types")),ef=Dp("editorInlayHint.typeBackground",{dark:Qm,light:Qm,hcDark:Qm,hcLight:Qm},ue(0,"Background color of inline hints for types")),tf=Dp("editorInlayHint.parameterForeground",{dark:Xm,light:Xm,hcDark:Xm,hcLight:Xm},ue(0,"Foreground color of inline hints for parameters")),nf=Dp("editorInlayHint.parameterBackground",{dark:Qm,light:Qm,hcDark:Qm,hcLight:Qm},ue(0,"Background color of inline hints for parameters")),sf=(Dp("editorLightBulb.foreground",{dark:"#FFCC00",light:"#DDB100",hcDark:"#FFCC00",hcLight:"#007ACC"},ue(0,"The color used for the lightbulb actions icon.")),Dp("editorLightBulbAutoFix.foreground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},ue(0,"The color used for the lightbulb auto fix actions icon.")),new lc(new oc(155,185,85,.2))),of=new lc(new oc(255,0,0,.2)),rf=Dp("diffEditor.insertedTextBackground",{dark:"#9ccc2c33",light:"#9ccc2c40",hcDark:null,hcLight:null},ue(0,"Background color for text that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),af=Dp("diffEditor.removedTextBackground",{dark:"#ff000033",light:"#ff000033",hcDark:null,hcLight:null},ue(0,"Background color for text that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),lf=(Dp("diffEditor.insertedLineBackground",{dark:sf,light:sf,hcDark:null,hcLight:null},ue(0,"Background color for lines that got inserted. The color must not be opaque so as not to hide underlying decorations."),!0),Dp("diffEditor.removedLineBackground",{dark:of,light:of,hcDark:null,hcLight:null},ue(0,"Background color for lines that got removed. The color must not be opaque so as not to hide underlying decorations."),!0),Dp("diffEditorGutter.insertedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Background color for the margin where lines got inserted.")),Dp("diffEditorGutter.removedLineBackground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Background color for the margin where lines got removed.")),Dp("diffEditorOverview.insertedForeground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Diff overview ruler foreground for inserted content."))),hf=Dp("diffEditorOverview.removedForeground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Diff overview ruler foreground for removed content.")),df=(Dp("diffEditor.insertedTextBorder",{dark:null,light:null,hcDark:"#33ff2eff",hcLight:"#374E06"},ue(0,"Outline color for the text that got inserted.")),Dp("diffEditor.removedTextBorder",{dark:null,light:null,hcDark:"#FF008F",hcLight:"#AD0707"},ue(0,"Outline color for text that got removed.")),Dp("diffEditor.border",{dark:null,light:null,hcDark:Mp,hcLight:Mp},ue(0,"Border color between the two text editors.")),Dp("diffEditor.diagonalFill",{dark:"#cccccc33",light:"#22222233",hcDark:null,hcLight:null},ue(0,"Color of the diff editor's diagonal fill. The diagonal fill is used in side-by-side diff views.")),Dp("diffEditor.unchangedRegionBackground",{dark:"#3e3e3e",light:"#e4e4e4",hcDark:null,hcLight:null},ue(0,"The background color of unchanged blocks in the diff editor.")),Dp("diffEditor.unchangedRegionForeground",{dark:"#a3a2a2",light:"#4d4c4c",hcDark:null,hcLight:null},ue(0,"The foreground color of unchanged blocks in the diff editor.")),Dp("diffEditor.unchangedCodeBackground",{dark:"#74747429",light:"#b8b8b829",hcDark:null,hcLight:null},ue(0,"The background color of unchanged code in the diff editor.")),Dp("list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"List/Tree background color for the focused item when the list/tree is active. An active list/tree has keyboard focus, an inactive does not."))),cf=Dp("list.focusForeground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"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.")),uf=Dp("list.focusOutline",{dark:Ip,light:Ip,hcDark:Tp,hcLight:Tp},ue(0,"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.")),gf=Dp("list.focusAndSelectionOutline",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"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.")),pf=Dp("list.activeSelectionBackground",{dark:"#04395E",light:"#0060C0",hcDark:null,hcLight:lc.fromHex("#0F4A85").transparent(.1)},ue(0,"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.")),mf=Dp("list.activeSelectionForeground",{dark:lc.white,light:lc.white,hcDark:null,hcLight:null},ue(0,"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.")),ff=Dp("list.activeSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"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.")),_f=Dp("list.inactiveSelectionBackground",{dark:"#37373D",light:"#E4E6F1",hcDark:null,hcLight:lc.fromHex("#0F4A85").transparent(.1)},ue(0,"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.")),vf=Dp("list.inactiveSelectionForeground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"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.")),bf=Dp("list.inactiveSelectionIconForeground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"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.")),Cf=Dp("list.inactiveFocusBackground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"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.")),wf=Dp("list.inactiveFocusOutline",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"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.")),yf=Dp("list.hoverBackground",{dark:"#2A2D2E",light:"#F0F0F0",hcDark:lc.white.transparent(.1),hcLight:lc.fromHex("#0F4A85").transparent(.1)},ue(0,"List/Tree background when hovering over items using the mouse.")),Sf=Dp("list.hoverForeground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"List/Tree foreground when hovering over items using the mouse.")),Lf=Dp("list.dropBackground",{dark:"#062F4A",light:"#D6EBFF",hcDark:null,hcLight:null},ue(0,"List/Tree drag and drop background when moving items around using the mouse.")),kf=Dp("list.highlightForeground",{dark:"#2AAAFF",light:"#0066BF",hcDark:Ip,hcLight:Ip},ue(0,"List/Tree foreground color of the match highlights when searching inside the list/tree.")),Df=Dp("list.focusHighlightForeground",{dark:kf,light:(xf=pf,Nf=kf,Ef="#BBE7FF",{op:6,if:xf,then:Nf,else:Ef}),hcDark:kf,hcLight:kf},ue(0,"List/Tree foreground color of the match highlights on actively focused items when searching inside the list/tree."));var xf,Nf,Ef;Dp("list.invalidItemForeground",{dark:"#B89500",light:"#B89500",hcDark:"#B89500",hcLight:"#B5200D"},ue(0,"List/Tree foreground color for invalid items, for example an unresolved root in explorer.")),Dp("list.errorForeground",{dark:"#F88070",light:"#B01011",hcDark:null,hcLight:null},ue(0,"Foreground color of list items containing errors.")),Dp("list.warningForeground",{dark:"#CCA700",light:"#855F00",hcDark:null,hcLight:null},ue(0,"Foreground color of list items containing warnings."));const If=Dp("listFilterWidget.background",{light:L_(km,0),dark:k_(km,0),hcDark:km,hcLight:km},ue(0,"Background color of the type filter widget in lists and trees.")),Mf=Dp("listFilterWidget.outline",{dark:lc.transparent,light:lc.transparent,hcDark:"#f38518",hcLight:"#007ACC"},ue(0,"Outline color of the type filter widget in lists and trees.")),Tf=Dp("listFilterWidget.noMatchesOutline",{dark:"#BE1100",light:"#BE1100",hcDark:Mp,hcLight:Mp},ue(0,"Outline color of the type filter widget in lists and trees, when there are no matches.")),Rf=Dp("listFilterWidget.shadow",{dark:Ap,light:Ap,hcDark:Ap,hcLight:Ap},ue(0,"Shadow color of the type filter widget in lists and trees.")),Af=(Dp("list.filterMatchBackground",{dark:Um,light:Um,hcDark:null,hcLight:null},ue(0,"Background color of the filtered match.")),Dp("list.filterMatchBorder",{dark:qm,light:qm,hcDark:Mp,hcLight:Tp},ue(0,"Border color of the filtered match.")),Dp("tree.indentGuidesStroke",{dark:"#585858",light:"#a9a9a9",hcDark:"#a9a9a9",hcLight:"#a5a5a5"},ue(0,"Tree stroke color for the indentation guides."))),Of=Dp("tree.inactiveIndentGuidesStroke",{dark:D_(Af,.4),light:D_(Af,.4),hcDark:D_(Af,.4),hcLight:D_(Af,.4)},ue(0,"Tree stroke color for the indentation guides that are not active.")),Pf=Dp("tree.tableColumnsBorder",{dark:"#CCCCCC20",light:"#61616120",hcDark:null,hcLight:null},ue(0,"Table border color between columns.")),Ff=Dp("tree.tableOddRowsBackground",{dark:D_(xp,.04),light:D_(xp,.04),hcDark:null,hcLight:null},ue(0,"Background color for odd table rows.")),Bf=(Dp("list.deemphasizedForeground",{dark:"#8C8C8C",light:"#8E8E90",hcDark:"#A7A8A9",hcLight:"#666666"},ue(0,"List/Tree foreground color for items that are deemphasized. ")),Dp("checkbox.background",{dark:Xp,light:Xp,hcDark:Xp,hcLight:Xp},ue(0,"Background color of checkbox widget."))),Wf=(Dp("checkbox.selectBackground",{dark:km,light:km,hcDark:km,hcLight:km},ue(0,"Background color of checkbox widget when the element it's in is selected.")),Dp("checkbox.foreground",{dark:Jp,light:Jp,hcDark:Jp,hcLight:Jp},ue(0,"Foreground color of checkbox widget."))),Vf=Dp("checkbox.border",{dark:em,light:em,hcDark:em,hcLight:em},ue(0,"Border color of checkbox widget.")),Hf=(Dp("checkbox.selectBorder",{dark:Ep,light:Ep,hcDark:Ep,hcLight:Ep},ue(0,"Border color of checkbox widget when the element it's in is selected.")),Dp("quickInput.list.focusBackground",{dark:null,light:null,hcDark:null,hcLight:null},"",void 0,ue(0,"Please use quickInputList.focusBackground instead"))),zf=Dp("quickInputList.focusForeground",{dark:mf,light:mf,hcDark:mf,hcLight:mf},ue(0,"Quick picker foreground color for the focused item.")),Uf=Dp("quickInputList.focusIconForeground",{dark:ff,light:ff,hcDark:ff,hcLight:ff},ue(0,"Quick picker icon foreground color for the focused item.")),Kf=Dp("quickInputList.focusBackground",{dark:x_(Hf,pf),light:x_(Hf,pf),hcDark:null,hcLight:null},ue(0,"Quick picker background color for the focused item.")),jf=Dp("menu.border",{dark:null,light:null,hcDark:Mp,hcLight:Mp},ue(0,"Border color of menus.")),qf=Dp("menu.foreground",{dark:Jp,light:Jp,hcDark:Jp,hcLight:Jp},ue(0,"Foreground color of menu items.")),$f=Dp("menu.background",{dark:Xp,light:Xp,hcDark:Xp,hcLight:Xp},ue(0,"Background color of menu items.")),Gf=Dp("menu.selectionForeground",{dark:mf,light:mf,hcDark:mf,hcLight:mf},ue(0,"Foreground color of the selected menu item in menus.")),Zf=Dp("menu.selectionBackground",{dark:pf,light:pf,hcDark:pf,hcLight:pf},ue(0,"Background color of the selected menu item in menus.")),Yf=Dp("menu.selectionBorder",{dark:null,light:null,hcDark:Tp,hcLight:Tp},ue(0,"Border color of the selected menu item in menus.")),Xf=Dp("menu.separatorBackground",{dark:"#606060",light:"#D4D4D4",hcDark:Mp,hcLight:Mp},ue(0,"Color of a separator menu item in menus.")),Qf=Dp("toolbar.hoverBackground",{dark:"#5a5d5e50",light:"#b8b8b850",hcDark:null,hcLight:null},ue(0,"Toolbar background when hovering over actions using the mouse")),Jf=(Dp("toolbar.hoverOutline",{dark:null,light:null,hcDark:Tp,hcLight:Tp},ue(0,"Toolbar outline when hovering over actions using the mouse")),Dp("toolbar.activeBackground",{dark:k_(Qf,.1),light:L_(Qf,.1),hcDark:null,hcLight:null},ue(0,"Toolbar background when holding the mouse over actions")),Dp("editor.snippetTabstopHighlightBackground",{dark:new lc(new oc(124,124,124,.3)),light:new lc(new oc(10,50,100,.2)),hcDark:new lc(new oc(124,124,124,.3)),hcLight:new lc(new oc(10,50,100,.2))},ue(0,"Highlight background color of a snippet tabstop.")),Dp("editor.snippetTabstopHighlightBorder",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Highlight border color of a snippet tabstop.")),Dp("editor.snippetFinalTabstopHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Highlight background color of the final tabstop of a snippet.")),Dp("editor.snippetFinalTabstopHighlightBorder",{dark:"#525252",light:new lc(new oc(10,50,100,.5)),hcDark:"#525252",hcLight:"#292929"},ue(0,"Highlight border color of the final tabstop of a snippet.")),Dp("breadcrumb.foreground",{light:D_(xp,.8),dark:D_(xp,.8),hcDark:D_(xp,.8),hcLight:D_(xp,.8)},ue(0,"Color of focused breadcrumb items."))),e_=Dp("breadcrumb.background",{light:Sm,dark:Sm,hcDark:Sm,hcLight:Sm},ue(0,"Background color of breadcrumb items.")),t_=Dp("breadcrumb.focusForeground",{light:L_(xp,.2),dark:k_(xp,.1),hcDark:k_(xp,.1),hcLight:k_(xp,.1)},ue(0,"Color of focused breadcrumb items.")),i_=Dp("breadcrumb.activeSelectionForeground",{light:L_(xp,.2),dark:k_(xp,.1),hcDark:k_(xp,.1),hcLight:k_(xp,.1)},ue(0,"Color of selected breadcrumb items.")),n_=(Dp("breadcrumbPicker.background",{light:km,dark:km,hcDark:km,hcLight:km},ue(0,"Background color of breadcrumb item picker.")),lc.fromHex("#40C8AE").transparent(.5)),s_=lc.fromHex("#40A6FF").transparent(.5),o_=lc.fromHex("#606060").transparent(.4),r_=.4,a_=Dp("merge.currentHeaderBackground",{dark:n_,light:n_,hcDark:null,hcLight:null},ue(0,"Current header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),l_=(Dp("merge.currentContentBackground",{dark:D_(a_,r_),light:D_(a_,r_),hcDark:D_(a_,r_),hcLight:D_(a_,r_)},ue(0,"Current content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),Dp("merge.incomingHeaderBackground",{dark:s_,light:s_,hcDark:null,hcLight:null},ue(0,"Incoming header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0)),h_=(Dp("merge.incomingContentBackground",{dark:D_(l_,r_),light:D_(l_,r_),hcDark:D_(l_,r_),hcLight:D_(l_,r_)},ue(0,"Incoming content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),Dp("merge.commonHeaderBackground",{dark:o_,light:o_,hcDark:null,hcLight:null},ue(0,"Common ancestor header background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0)),d_=(Dp("merge.commonContentBackground",{dark:D_(h_,r_),light:D_(h_,r_),hcDark:D_(h_,r_),hcLight:D_(h_,r_)},ue(0,"Common ancestor content background in inline merge-conflicts. The color must not be opaque so as not to hide underlying decorations."),!0),Dp("merge.border",{dark:null,light:null,hcDark:"#C3DF6F",hcLight:"#007ACC"},ue(0,"Border color on headers and the splitter in inline merge-conflicts."))),c_=(Dp("editorOverviewRuler.currentContentForeground",{dark:D_(a_,1),light:D_(a_,1),hcDark:d_,hcLight:d_},ue(0,"Current overview ruler foreground for inline merge-conflicts.")),Dp("editorOverviewRuler.incomingContentForeground",{dark:D_(l_,1),light:D_(l_,1),hcDark:d_,hcLight:d_},ue(0,"Incoming overview ruler foreground for inline merge-conflicts.")),Dp("editorOverviewRuler.commonContentForeground",{dark:D_(h_,1),light:D_(h_,1),hcDark:d_,hcLight:d_},ue(0,"Common ancestor overview ruler foreground for inline merge-conflicts.")),Dp("editorOverviewRuler.findMatchForeground",{dark:"#d186167e",light:"#d186167e",hcDark:"#AB5A00",hcLight:""},ue(0,"Overview ruler marker color for find matches. The color must not be opaque so as not to hide underlying decorations."),!0)),u_=Dp("editorOverviewRuler.selectionHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},ue(0,"Overview ruler marker color for selection highlights. The color must not be opaque so as not to hide underlying decorations."),!0),g_=Dp("minimap.findMatchHighlight",{light:"#d18616",dark:"#d18616",hcDark:"#AB5A00",hcLight:"#0F4A85"},ue(0,"Minimap marker color for find matches."),!0),p_=Dp("minimap.selectionOccurrenceHighlight",{light:"#c9c9c9",dark:"#676767",hcDark:"#ffffff",hcLight:"#0F4A85"},ue(0,"Minimap marker color for repeating editor selections."),!0),m_=Dp("minimap.selectionHighlight",{light:"#ADD6FF",dark:"#264F78",hcDark:"#ffffff",hcLight:"#0F4A85"},ue(0,"Minimap marker color for the editor selection."),!0),f_=Dp("minimap.infoHighlight",{dark:Cm,light:Cm,hcDark:wm,hcLight:wm},ue(0,"Minimap marker color for infos.")),__=Dp("minimap.warningHighlight",{dark:vm,light:vm,hcDark:bm,hcLight:bm},ue(0,"Minimap marker color for warnings.")),v_=Dp("minimap.errorHighlight",{dark:new lc(new oc(255,18,18,.7)),light:new lc(new oc(255,18,18,.7)),hcDark:new lc(new oc(255,50,50,1)),hcLight:"#B5200D"},ue(0,"Minimap marker color for errors.")),b_=Dp("minimap.background",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Minimap background color.")),C_=Dp("minimap.foregroundOpacity",{dark:lc.fromHex("#000f"),light:lc.fromHex("#000f"),hcDark:lc.fromHex("#000f"),hcLight:lc.fromHex("#000f")},ue(0,'Opacity of foreground elements rendered in the minimap. For example, "#000000c0" will render the elements with 75% opacity.')),w_=(Dp("minimapSlider.background",{light:D_(um,.5),dark:D_(um,.5),hcDark:D_(um,.5),hcLight:D_(um,.5)},ue(0,"Minimap slider background color.")),Dp("minimapSlider.hoverBackground",{light:D_(gm,.5),dark:D_(gm,.5),hcDark:D_(gm,.5),hcLight:D_(gm,.5)},ue(0,"Minimap slider background color when hovering.")),Dp("minimapSlider.activeBackground",{light:D_(pm,.5),dark:D_(pm,.5),hcDark:D_(pm,.5),hcLight:D_(pm,.5)},ue(0,"Minimap slider background color when clicked on.")),Dp("problemsErrorIcon.foreground",{dark:fm,light:fm,hcDark:fm,hcLight:fm},ue(0,"The color used for the problems error icon."))),y_=Dp("problemsWarningIcon.foreground",{dark:vm,light:vm,hcDark:vm,hcLight:vm},ue(0,"The color used for the problems warning icon.")),S_=Dp("problemsInfoIcon.foreground",{dark:Cm,light:Cm,hcDark:Cm,hcLight:Cm},ue(0,"The color used for the problems info icon."));Dp("charts.foreground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color used in charts.")),Dp("charts.lines",{dark:D_(xp,.5),light:D_(xp,.5),hcDark:D_(xp,.5),hcLight:D_(xp,.5)},ue(0,"The color used for horizontal lines in charts.")),Dp("charts.red",{dark:fm,light:fm,hcDark:fm,hcLight:fm},ue(0,"The red color used in chart visualizations.")),Dp("charts.blue",{dark:Cm,light:Cm,hcDark:Cm,hcLight:Cm},ue(0,"The blue color used in chart visualizations.")),Dp("charts.yellow",{dark:vm,light:vm,hcDark:vm,hcLight:vm},ue(0,"The yellow color used in chart visualizations.")),Dp("charts.orange",{dark:g_,light:g_,hcDark:g_,hcLight:g_},ue(0,"The orange color used in chart visualizations.")),Dp("charts.green",{dark:"#89D185",light:"#388A34",hcDark:"#89D185",hcLight:"#374e06"},ue(0,"The green color used in chart visualizations.")),Dp("charts.purple",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},ue(0,"The purple color used in chart visualizations."));function L_(e,t){return{op:0,value:e,factor:t}}function k_(e,t){return{op:1,value:e,factor:t}}function D_(e,t){return{op:2,value:e,factor:t}}function x_(...e){return{op:4,values:e}}function N_(e,t,i,n){return{op:5,value:e,background:t,factor:i,transparency:n}}function E_(e,t){if(null!==e)return"string"==typeof e?"#"===e[0]?lc.fromHex(e):t.getColor(e):e instanceof lc?e:"object"==typeof e?function(e,t){var i,n,s,o;switch(e.op){case 0:return null===(i=E_(e.value,t))||void 0===i?void 0:i.darken(e.factor);case 1:return null===(n=E_(e.value,t))||void 0===n?void 0:n.lighten(e.factor);case 2:return null===(s=E_(e.value,t))||void 0===s?void 0:s.transparent(e.factor);case 3:{const i=E_(e.background,t);return i?null===(o=E_(e.value,t))||void 0===o?void 0:o.makeOpaque(i):E_(e.value,t)}case 4:for(const i of e.values){const e=E_(i,t);if(e)return e}return;case 6:return E_(t.defines(e.if)?e.then:e.else,t);case 5:{const i=E_(e.value,t);if(!i)return;const n=E_(e.background,t);return n?i.isDarkerThan(n)?lc.getLighterColor(i,n,e.factor).transparent(e.transparency):lc.getDarkerColor(i,n,e.factor).transparent(e.transparency):i.transparent(e.factor*e.transparency)}default:throw zl()}}(e,t):void 0}const I_="vscode://schemas/workbench-colors",M_=jl.as(ku);M_.registerSchema(I_,kp.getColorSchema());const T_=new rd((()=>M_.notifySchemaChanged(I_)),200);var R_;function A_(e){return e===R_.HIGH_CONTRAST_DARK||e===R_.HIGH_CONTRAST_LIGHT}function O_(e){return e===R_.DARK||e===R_.HIGH_CONTRAST_DARK}kp.onDidChangeSchema((()=>{T_.isScheduled()||T_.schedule()})),function(e){e.DARK="dark",e.LIGHT="light",e.HIGH_CONTRAST_DARK="hcDark",e.HIGH_CONTRAST_LIGHT="hcLight"}(R_||(R_={}));const P_=Ba("themeService");function F_(e){return{id:e}}function B_(e){switch(e){case R_.DARK:return"vs-dark";case R_.HIGH_CONTRAST_DARK:return"hc-black";case R_.HIGH_CONTRAST_LIGHT:return"hc-light";default:return"vs"}}const W_="base.contributions.theming";const V_=new class{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new U}onColorThemeChange(e){return this.themingParticipants.push(e),this.onThemingParticipantAddedEmitter.fire(e),x((()=>{const t=this.themingParticipants.indexOf(e);this.themingParticipants.splice(t,1)}))}getThemingParticipants(){return this.themingParticipants}};function H_(e){return V_.onColorThemeChange(e)}jl.add(W_,V_);class z_ extends E{constructor(e){super(),this.themeService=e,this.theme=e.getColorTheme(),this._register(this.themeService.onDidColorThemeChange((e=>this.onThemeChange(e))))}onThemeChange(e){this.theme=e,this.updateStyles()}updateStyles(){}}const U_=Dp("editor.lineHighlightBackground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Background color for the highlight of line at the cursor position.")),K_=Dp("editor.lineHighlightBorder",{dark:"#282828",light:"#eeeeee",hcDark:"#f38518",hcLight:Mp},ue(0,"Background color for the border around the line at the cursor position.")),j_=(Dp("editor.rangeHighlightBackground",{dark:"#ffffff0b",light:"#fdff0033",hcDark:null,hcLight:null},ue(0,"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),Dp("editor.rangeHighlightBorder",{dark:null,light:null,hcDark:Tp,hcLight:Tp},ue(0,"Background color of the border around highlighted ranges."),!0),Dp("editor.symbolHighlightBackground",{dark:Um,light:Um,hcDark:null,hcLight:null},ue(0,"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),Dp("editor.symbolHighlightBorder",{dark:null,light:null,hcDark:Tp,hcLight:Tp},ue(0,"Background color of the border around highlighted symbols."),!0),Dp("editorCursor.foreground",{dark:"#AEAFAD",light:lc.black,hcDark:lc.white,hcLight:"#0F4A85"},ue(0,"Color of the editor cursor."))),q_=Dp("editorCursor.background",null,ue(0,"The background color of the editor cursor. Allows customizing the color of a character overlapped by a block cursor.")),$_=Dp("editorWhitespace.foreground",{dark:"#e3e4e229",light:"#33333333",hcDark:"#e3e4e229",hcLight:"#CCCCCC"},ue(0,"Color of whitespace characters in the editor.")),G_=Dp("editorLineNumber.foreground",{dark:"#858585",light:"#237893",hcDark:lc.white,hcLight:"#292929"},ue(0,"Color of editor line numbers.")),Z_=Dp("editorIndentGuide.background",{dark:$_,light:$_,hcDark:$_,hcLight:$_},ue(0,"Color of the editor indentation guides."),!1,ue(0,"'editorIndentGuide.background' is deprecated. Use 'editorIndentGuide.background1' instead.")),Y_=Dp("editorIndentGuide.activeBackground",{dark:$_,light:$_,hcDark:$_,hcLight:$_},ue(0,"Color of the active editor indentation guides."),!1,ue(0,"'editorIndentGuide.activeBackground' is deprecated. Use 'editorIndentGuide.activeBackground1' instead.")),X_=Dp("editorIndentGuide.background1",{dark:Z_,light:Z_,hcDark:Z_,hcLight:Z_},ue(0,"Color of the editor indentation guides (1).")),Q_=Dp("editorIndentGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Color of the editor indentation guides (2).")),J_=Dp("editorIndentGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Color of the editor indentation guides (3).")),ev=Dp("editorIndentGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Color of the editor indentation guides (4).")),tv=Dp("editorIndentGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Color of the editor indentation guides (5).")),iv=Dp("editorIndentGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Color of the editor indentation guides (6).")),nv=Dp("editorIndentGuide.activeBackground1",{dark:Y_,light:Y_,hcDark:Y_,hcLight:Y_},ue(0,"Color of the active editor indentation guides (1).")),sv=Dp("editorIndentGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Color of the active editor indentation guides (2).")),ov=Dp("editorIndentGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Color of the active editor indentation guides (3).")),rv=Dp("editorIndentGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Color of the active editor indentation guides (4).")),av=Dp("editorIndentGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Color of the active editor indentation guides (5).")),lv=Dp("editorIndentGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Color of the active editor indentation guides (6).")),hv=Dp("editorActiveLineNumber.foreground",{dark:"#c6c6c6",light:"#0B216F",hcDark:Tp,hcLight:Tp},ue(0,"Color of editor active line number"),!1,ue(0,"Id is deprecated. Use 'editorLineNumber.activeForeground' instead.")),dv=(Dp("editorLineNumber.activeForeground",{dark:hv,light:hv,hcDark:hv,hcLight:hv},ue(0,"Color of editor active line number")),Dp("editorLineNumber.dimmedForeground",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Color of the final editor line when editor.renderFinalNewline is set to dimmed."))),cv=(Dp("editorRuler.foreground",{dark:"#5A5A5A",light:lc.lightgrey,hcDark:lc.white,hcLight:"#292929"},ue(0,"Color of the editor rulers.")),Dp("editorCodeLens.foreground",{dark:"#999999",light:"#919191",hcDark:"#999999",hcLight:"#292929"},ue(0,"Foreground color of editor CodeLens")),Dp("editorBracketMatch.background",{dark:"#0064001a",light:"#0064001a",hcDark:"#0064001a",hcLight:"#0000"},ue(0,"Background color behind matching brackets")),Dp("editorBracketMatch.border",{dark:"#888",light:"#B9B9B9",hcDark:Mp,hcLight:Mp},ue(0,"Color for matching brackets boxes")),Dp("editorOverviewRuler.border",{dark:"#7f7f7f4d",light:"#7f7f7f4d",hcDark:"#7f7f7f4d",hcLight:"#666666"},ue(0,"Color of the overview ruler border."))),uv=Dp("editorOverviewRuler.background",null,ue(0,"Background color of the editor overview ruler.")),gv=(Dp("editorGutter.background",{dark:Sm,light:Sm,hcDark:Sm,hcLight:Sm},ue(0,"Background color of the editor gutter. The gutter contains the glyph margins and the line numbers.")),Dp("editorUnnecessaryCode.border",{dark:null,light:null,hcDark:lc.fromHex("#fff").transparent(.8),hcLight:Mp},ue(0,"Border color of unnecessary (unused) source code in the editor.")),Dp("editorUnnecessaryCode.opacity",{dark:lc.fromHex("#000a"),light:lc.fromHex("#0007"),hcDark:null,hcLight:null},ue(0,"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."))),pv=(Dp("editorGhostText.border",{dark:null,light:null,hcDark:lc.fromHex("#fff").transparent(.8),hcLight:lc.fromHex("#292929").transparent(.8)},ue(0,"Border color of ghost text in the editor.")),Dp("editorGhostText.foreground",{dark:lc.fromHex("#ffffff56"),light:lc.fromHex("#0007"),hcDark:null,hcLight:null},ue(0,"Foreground color of the ghost text in the editor.")),Dp("editorGhostText.background",{dark:null,light:null,hcDark:null,hcLight:null},ue(0,"Background color of the ghost text in the editor.")),new lc(new oc(0,122,204,.6))),mv=Dp("editorOverviewRuler.rangeHighlightForeground",{dark:pv,light:pv,hcDark:pv,hcLight:pv},ue(0,"Overview ruler marker color for range highlights. The color must not be opaque so as not to hide underlying decorations."),!0),fv=Dp("editorOverviewRuler.errorForeground",{dark:new lc(new oc(255,18,18,.7)),light:new lc(new oc(255,18,18,.7)),hcDark:new lc(new oc(255,50,50,1)),hcLight:"#B5200D"},ue(0,"Overview ruler marker color for errors.")),_v=Dp("editorOverviewRuler.warningForeground",{dark:vm,light:vm,hcDark:bm,hcLight:bm},ue(0,"Overview ruler marker color for warnings.")),vv=Dp("editorOverviewRuler.infoForeground",{dark:Cm,light:Cm,hcDark:wm,hcLight:wm},ue(0,"Overview ruler marker color for infos.")),bv=Dp("editorBracketHighlight.foreground1",{dark:"#FFD700",light:"#0431FAFF",hcDark:"#FFD700",hcLight:"#0431FAFF"},ue(0,"Foreground color of brackets (1). Requires enabling bracket pair colorization.")),Cv=Dp("editorBracketHighlight.foreground2",{dark:"#DA70D6",light:"#319331FF",hcDark:"#DA70D6",hcLight:"#319331FF"},ue(0,"Foreground color of brackets (2). Requires enabling bracket pair colorization.")),wv=Dp("editorBracketHighlight.foreground3",{dark:"#179FFF",light:"#7B3814FF",hcDark:"#87CEFA",hcLight:"#7B3814FF"},ue(0,"Foreground color of brackets (3). Requires enabling bracket pair colorization.")),yv=Dp("editorBracketHighlight.foreground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Foreground color of brackets (4). Requires enabling bracket pair colorization.")),Sv=Dp("editorBracketHighlight.foreground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Foreground color of brackets (5). Requires enabling bracket pair colorization.")),Lv=Dp("editorBracketHighlight.foreground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Foreground color of brackets (6). Requires enabling bracket pair colorization.")),kv=Dp("editorBracketHighlight.unexpectedBracket.foreground",{dark:new lc(new oc(255,18,18,.8)),light:new lc(new oc(255,18,18,.8)),hcDark:new lc(new oc(255,50,50,1)),hcLight:""},ue(0,"Foreground color of unexpected brackets.")),Dv=Dp("editorBracketPairGuide.background1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Background color of inactive bracket pair guides (1). Requires enabling bracket pair guides.")),xv=Dp("editorBracketPairGuide.background2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Background color of inactive bracket pair guides (2). Requires enabling bracket pair guides.")),Nv=Dp("editorBracketPairGuide.background3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Background color of inactive bracket pair guides (3). Requires enabling bracket pair guides.")),Ev=Dp("editorBracketPairGuide.background4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Background color of inactive bracket pair guides (4). Requires enabling bracket pair guides.")),Iv=Dp("editorBracketPairGuide.background5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Background color of inactive bracket pair guides (5). Requires enabling bracket pair guides.")),Mv=Dp("editorBracketPairGuide.background6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Background color of inactive bracket pair guides (6). Requires enabling bracket pair guides.")),Tv=Dp("editorBracketPairGuide.activeBackground1",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Background color of active bracket pair guides (1). Requires enabling bracket pair guides.")),Rv=Dp("editorBracketPairGuide.activeBackground2",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Background color of active bracket pair guides (2). Requires enabling bracket pair guides.")),Av=Dp("editorBracketPairGuide.activeBackground3",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Background color of active bracket pair guides (3). Requires enabling bracket pair guides.")),Ov=Dp("editorBracketPairGuide.activeBackground4",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Background color of active bracket pair guides (4). Requires enabling bracket pair guides.")),Pv=Dp("editorBracketPairGuide.activeBackground5",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Background color of active bracket pair guides (5). Requires enabling bracket pair guides.")),Fv=Dp("editorBracketPairGuide.activeBackground6",{dark:"#00000000",light:"#00000000",hcDark:"#00000000",hcLight:"#00000000"},ue(0,"Background color of active bracket pair guides (6). Requires enabling bracket pair guides."));Dp("editorUnicodeHighlight.border",{dark:"#BD9B03",light:"#CEA33D",hcDark:"#ff0000",hcLight:"#CEA33D"},ue(0,"Border color used to highlight unicode characters.")),Dp("editorUnicodeHighlight.background",{dark:"#bd9b0326",light:"#cea33d14",hcDark:"#00000000",hcLight:"#cea33d14"},ue(0,"Background color used to highlight unicode characters."));H_(((e,t)=>{const i=e.getColor(Sm),n=e.getColor(U_),s=n&&!n.isTransparent()?n:i;s&&t.addRule(`.monaco-editor .inputarea.ime-input { background-color: ${s}; }`)}));class Bv extends E{constructor(e){super(),this.textModel=e,this.colorProvider=new Wv,this.onDidChangeEmitter=new U,this.onDidChange=this.onDidChangeEmitter.event,this.colorizationOptions=e.getOptions().bracketPairColorizationOptions,this._register(e.bracketPairs.onDidChange((e=>{this.onDidChangeEmitter.fire()})))}handleDidChangeOptions(e){this.colorizationOptions=this.textModel.getOptions().bracketPairColorizationOptions}getDecorationsInRange(e,t,i,n){if(n)return[];if(void 0===t)return[];if(!this.colorizationOptions.enabled)return[];return this.textModel.bracketPairs.getBracketsInRange(e,!0).map((e=>({id:`bracket${e.range.toString()}-${e.nestingLevel}`,options:{description:"BracketPairColorization",inlineClassName:this.colorProvider.getInlineClassName(e,this.colorizationOptions.independentColorPoolPerBracketType)},ownerId:0,range:e.range}))).toArray()}getAllDecorations(e,t){return void 0===e?[]:this.colorizationOptions.enabled?this.getDecorationsInRange(new Rh(1,1,this.textModel.getLineCount(),1),e,t):[]}}class Wv{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}}function Vv(e){return e.replace(/\n/g,"\\n").replace(/\r/g,"\\r")}H_(((e,t)=>{const i=[bv,Cv,wv,yv,Sv,Lv],n=new Wv;t.addRule(`.monaco-editor .${n.unexpectedClosingBracketClassName} { color: ${e.getColor(kv)}; }`);const s=i.map((t=>e.getColor(t))).filter((e=>!!e)).filter((e=>!e.isTransparent()));for(let o=0;o<30;o++){const e=s[o%s.length];t.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(o)} { color: ${e}; }`)}}));class Hv{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 0===this.oldText.length?`(insert@${this.oldPosition} "${Vv(this.newText)}")`:0===this.newText.length?`(delete@${this.oldPosition} "${Vv(this.oldText)}")`:`(replace@${this.oldPosition} "${Vv(this.oldText)}" with "${Vv(this.newText)}")`}static _writeStringSize(e){return 4+2*e.length}static _writeString(e,t,i){const n=t.length;Gc(e,n,i),i+=4;for(let s=0;s0&&(this.changes=(o=this.changes,r=t,null===o||0===o.length?r:new zv(o,r).compress())),this.afterEOL=i,this.afterVersionId=n,this.afterCursorState=s}static _writeSelectionsSize(e){return 4+16*(e?e.length:0)}static _writeSelections(e,t,i){if(Gc(e,t?t.length:0,i),i+=4,t)for(const n of t)Gc(e,n.selectionStartLineNumber,i),i+=4,Gc(e,n.selectionStartColumn,i),i+=4,Gc(e,n.positionLineNumber,i),i+=4,Gc(e,n.positionColumn,i),i+=4;return i}static _readSelections(e,t,i){const n=$c(e,t);t+=4;for(let s=0;se.toString())).join(", ")}matchesResource(e){return(an.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 Kv}append(e,t,i,n,s){this._data instanceof Kv&&this._data.append(e,t,i,n,s)}close(){this._data instanceof Kv&&(this._data=this._data.serialize())}open(){this._data instanceof Kv||(this._data=Kv.deserialize(this._data))}undo(){if(an.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Kv&&(this._data=this._data.serialize());const e=Kv.deserialize(this._data);this.model._applyUndo(e.changes,e.beforeEOL,e.beforeVersionId,e.beforeCursorState)}redo(){if(an.isUri(this.model))throw new Error("Invalid SingleModelEditStackElement");this._data instanceof Kv&&(this._data=this._data.serialize());const e=Kv.deserialize(this._data);this.model._applyRedo(e.changes,e.afterEOL,e.afterVersionId,e.afterCursorState)}heapSize(){return this._data instanceof Kv&&(this._data=this._data.serialize()),this._data.byteLength+168}}class qv{get resources(){return this._editStackElementsArr.map((e=>e.resource))}constructor(e,t,i){this.label=e,this.code=t,this.type=1,this._isOpen=!0,this._editStackElementsArr=i.slice(0),this._editStackElementsMap=new Map;for(const n of this._editStackElementsArr){const e=Uv(n.resource);this._editStackElementsMap.set(e,n)}this._delegate=null}prepareUndoRedo(){if(this._delegate)return this._delegate.prepareUndoRedo(this)}matchesResource(e){const t=Uv(e);return this._editStackElementsMap.has(t)}setModel(e){const t=Uv(an.isUri(e)?e:e.uri);this._editStackElementsMap.has(t)&&this._editStackElementsMap.get(t).setModel(e)}canAppend(e){if(!this._isOpen)return!1;const t=Uv(e.uri);if(this._editStackElementsMap.has(t)){return this._editStackElementsMap.get(t).canAppend(e)}return!1}append(e,t,i,n,s){const o=Uv(e.uri);this._editStackElementsMap.get(o).append(e,t,i,n,s)}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=Uv(e);if(this._editStackElementsMap.has(t)){return this._editStackElementsMap.get(t).heapSize()}return 0}split(){return this._editStackElementsArr}toString(){const e=[];for(const t of this._editStackElementsArr)e.push(`${wa(t.resource)}: ${t}`);return`{${e.join(", ")}}`}}function $v(e){return"\n"===e.getEOL()?0:1}function Gv(e){return!!e&&(e instanceof jv||e instanceof qv)}class Zv{constructor(e,t){this._model=e,this._undoRedoService=t}pushStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Gv(e)&&e.close()}popStackElement(){const e=this._undoRedoService.getLastElement(this._model.uri);Gv(e)&&e.open()}clear(){this._undoRedoService.removeElements(this._model.uri)}_getOrCreateEditStackElement(e,t){const i=this._undoRedoService.getLastElement(this._model.uri);if(Gv(i)&&i.canAppend(this._model))return i;const n=new jv(ue(0,"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,[],$v(this._model),this._model.getAlternativeVersionId(),null)}pushEditOperation(e,t,i,n){const s=this._getOrCreateEditStackElement(e,n),o=this._model.applyEdits(t,!0),r=Zv._computeCursorState(i,o),a=o.map(((e,t)=>({index:t,textChange:e.textChange})));return a.sort(((e,t)=>e.textChange.oldPosition===t.textChange.oldPosition?e.index-t.index:e.textChange.oldPosition-t.textChange.oldPosition)),s.append(this._model,a.map((e=>e.textChange)),$v(this._model),this._model.getAlternativeVersionId(),r),r}static _computeCursorState(e,t){try{return e?e(t):null}catch(Mre){return r(Mre),null}}}class Yv extends E{constructor(){super(...arguments),this._isDisposed=!1}dispose(){super.dispose(),this._isDisposed=!0}assertNotDisposed(){if(this._isDisposed)throw new Error("TextModelPart is disposed!")}}function Xv(e,t){let i=0,n=0;const s=e.length;for(;nn)throw new f("Illegal value for lineNumber");const s=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,o=Boolean(s&&s.offSide);let r=-2,a=-1,l=-2,h=-1;const d=e=>{if(-1!==r&&(-2===r||r>e-1)){r=-1,a=-1;for(let t=e-2;t>=0;t--){const e=this._computeIndentLevel(t);if(e>=0){r=t,a=e;break}}}if(-2===l){l=-1,h=-1;for(let t=e;t=0){l=t,h=e;break}}}};let c=-2,u=-1,g=-2,p=-1;const m=e=>{if(-2===c){c=-1,u=-1;for(let t=e-2;t>=0;t--){const e=this._computeIndentLevel(t);if(e>=0){c=t,u=e;break}}}if(-1!==g&&(-2===g||g=0){g=t,p=e;break}}}};let _=0,v=!0,b=0,C=!0,w=0,y=0;for(let f=0;v||C;f++){const s=e-f,r=e+f;f>1&&(s<1||s1&&(r>n||r>i)&&(C=!1),f>5e4&&(v=!1,C=!1);let g=-1;if(v&&s>=1){const e=this._computeIndentLevel(s-1);e>=0?(l=s-1,h=e,g=Math.ceil(e/this.textModel.getOptions().indentSize)):(d(s),g=this._getIndentLevelForWhitespaceLine(o,a,h))}let S=-1;if(C&&r<=n){const e=this._computeIndentLevel(r-1);e>=0?(c=r-1,u=e,S=Math.ceil(e/this.textModel.getOptions().indentSize)):(m(r),S=this._getIndentLevelForWhitespaceLine(o,u,p))}if(0!==f){if(1===f){if(r<=n&&S>=0&&y+1===S){v=!1,_=r,b=r,w=S;continue}if(s>=1&&g>=0&&g-1===y){C=!1,_=s,b=s,w=g;continue}if(_=e,b=e,w=y,0===w)return{startLineNumber:_,endLineNumber:b,indent:w}}v&&(g>=w?_=s:v=!1),C&&(S>=w?b=r:C=!1)}else y=g}return{startLineNumber:_,endLineNumber:b,indent:w}}getLinesBracketGuides(e,t,i,n){var s;const o=[];for(let c=e;c<=t;c++)o.push([]);const r=!0,a=this.textModel.bracketPairs.getBracketPairsInRangeWithMinIndentation(new Rh(e,1,t,this.textModel.getLineMaxColumn(t))).toArray();let l;if(i&&a.length>0){l=null===(s=pc((e<=i.lineNumber&&i.lineNumber<=t?a:this.textModel.bracketPairs.getBracketPairsInRange(Rh.fromPositions(i)).toArray()).filter((e=>Rh.strictContainsPosition(e.range,i))),(e=>r)))||void 0===s?void 0:s.range}const h=this.textModel.getOptions().bracketPairColorizationOptions.independentColorPoolPerBracketType,d=new ib;for(const c of a){if(!c.closingBracketRange)continue;const i=l&&c.range.equalsRange(l);if(!i&&!n.includeInactive)continue;const s=d.getInlineClassName(c.nestingLevel,c.nestingLevelOfEqualBracketType,h)+(n.highlightActive&&i?" "+d.activeClassName:""),r=c.openingBracketRange.getStartPosition(),a=c.closingBracketRange.getStartPosition(),u=n.horizontalGuides===Qv.Enabled||n.horizontalGuides===Qv.EnabledForActive&&i;if(c.range.startLineNumber===c.range.endLineNumber){u&&o[c.range.startLineNumber-e].push(new Jv(-1,c.openingBracketRange.getEndPosition().column,s,new eb(!1,a.column),-1,-1));continue}const g=this.getVisibleColumnFromPosition(a),p=this.getVisibleColumnFromPosition(c.openingBracketRange.getStartPosition()),m=Math.min(p,g,c.minVisibleColumnIndentation+1);let f=!1;ro(this.textModel.getLineContent(c.closingBracketRange.startLineNumber))=e&&p>m&&o[r.lineNumber-e].push(new Jv(m,-1,s,new eb(!1,r.column),-1,-1)),a.lineNumber<=t&&g>m&&o[a.lineNumber-e].push(new Jv(m,-1,s,new eb(!f,a.column),-1,-1)))}for(const c of o)c.sort(((e,t)=>e.visibleColumn-t.visibleColumn));return o}getVisibleColumnFromPosition(e){return dc.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(),s=this.getLanguageConfiguration(this.textModel.getLanguageId()).foldingRules,o=Boolean(s&&s.offSide),r=new Array(t-e+1);let a=-2,l=-1,h=-2,d=-1;for(let c=e;c<=t;c++){const t=c-e,s=this._computeIndentLevel(c-1);if(s>=0)a=c-1,l=s,r[t]=Math.ceil(s/n.indentSize);else{if(-2===a){a=-1,l=-1;for(let e=c-2;e>=0;e--){const t=this._computeIndentLevel(e);if(t>=0){a=e,l=t;break}}}if(-1!==h&&(-2===h||h=0){h=e,d=t;break}}}r[t]=this._getIndentLevelForWhitespaceLine(o,l,d)}}return r}_getIndentLevelForWhitespaceLine(e,t,i){const n=this.textModel.getOptions();return-1===t||-1===i?0:t0&&a>0)return;if(l>0&&h>0)return;const d=Math.abs(a-h),c=Math.abs(r-l);if(0===d)return s.spacesDiff=c,void(c>0&&0<=l-1&&l-10?s++:m>1&&o++,sb(r,a,l,p,d),d.looksLikeAlignment&&(!i||t!==d.spacesDiff))continue;const _=d.spacesDiff;_<=8&&h[_]++,r=l,a=p}let c=i;s!==o&&(c=s{const i=h[t];i>e&&(e=i,u=t)})),4===u&&h[4]>0&&h[2]>0&&h[2]>=h[4]/2&&(u=2)}return{insertSpaces:c,tabSize:u}}function rb(e){return(1&e.metadata)>>>0}function ab(e,t){e.metadata=254&e.metadata|t}function lb(e){return(2&e.metadata)>>>1==1}function hb(e,t){e.metadata=253&e.metadata|(t?1:0)<<1}function db(e){return(4&e.metadata)>>>2==1}function cb(e,t){e.metadata=251&e.metadata|(t?1:0)<<2}function ub(e){return(64&e.metadata)>>>6==1}function gb(e,t){e.metadata=191&e.metadata|(t?1:0)<<6}function pb(e,t){e.metadata=231&e.metadata|t<<3}function mb(e,t){e.metadata=223&e.metadata|(t?1:0)<<5}class fb{constructor(e,t,i){this.metadata=0,this.parent=this,this.left=this,this.right=this,ab(this,1),this.start=t,this.end=i,this.delta=0,this.maxEnd=i,this.id=e,this.ownerId=0,this.options=null,cb(this,!1),gb(this,!1),pb(this,1),mb(this,!1),this.cachedVersionId=0,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=null,hb(this,!1)}reset(e,t,i,n){this.start=t,this.end=i,this.maxEnd=i,this.cachedVersionId=e,this.cachedAbsoluteStart=t,this.cachedAbsoluteEnd=i,this.range=n}setOptions(e){this.options=e;const t=this.options.className;cb(this,"squiggly-error"===t||"squiggly-warning"===t||"squiggly-info"===t),gb(this,null!==this.options.glyphMarginClassName),pb(this,this.options.stickiness),mb(this,this.options.collapseOnReplaceEdit)}setCachedOffsets(e,t,i){this.cachedVersionId!==i&&(this.range=null),this.cachedVersionId=i,this.cachedAbsoluteStart=e,this.cachedAbsoluteEnd=t}detach(){this.parent=null,this.left=null,this.right=null}}const _b=new fb(null,0,0);_b.parent=_b,_b.left=_b,_b.right=_b,ab(_b,0);class vb{constructor(){this.root=_b,this.requestNormalizeDelta=!1}intervalSearch(e,t,i,n,s,o){return this.root===_b?[]:function(e,t,i,n,s,o,r){let a=e.root,l=0,h=0,d=0,c=0;const u=[];let g=0;for(;a!==_b;)if(lb(a))hb(a.left,!1),hb(a.right,!1),a===a.parent.right&&(l-=a.parent.delta),a=a.parent;else{if(!lb(a.left)){if(h=l+a.maxEnd,hi)hb(a,!0);else{if(c=l+a.end,c>=t){a.setCachedOffsets(d,c,o);let e=!0;n&&a.ownerId&&a.ownerId!==n&&(e=!1),s&&db(a)&&(e=!1),r&&!ub(a)&&(e=!1),e&&(u[g++]=a)}hb(a,!0),a.right===_b||lb(a.right)||(l+=a.delta,a=a.right)}}return hb(e.root,!1),u}(this,e,t,i,n,s,o)}search(e,t,i,n){return this.root===_b?[]:function(e,t,i,n,s){let o=e.root,r=0,a=0,l=0;const h=[];let d=0;for(;o!==_b;){if(lb(o)){hb(o.left,!1),hb(o.right,!1),o===o.parent.right&&(r-=o.parent.delta),o=o.parent;continue}if(o.left!==_b&&!lb(o.left)){o=o.left;continue}a=r+o.start,l=r+o.end,o.setCachedOffsets(a,l,n);let e=!0;t&&o.ownerId&&o.ownerId!==t&&(e=!1),i&&db(o)&&(e=!1),s&&!ub(o)&&(e=!1),e&&(h[d++]=o),hb(o,!0),o.right===_b||lb(o.right)||(r+=o.delta,o=o.right)}return hb(e.root,!1),h}(this,e,t,i,n)}collectNodesFromOwner(e){return function(e,t){let i=e.root;const n=[];let s=0;for(;i!==_b;)lb(i)?(hb(i.left,!1),hb(i.right,!1),i=i.parent):i.left===_b||lb(i.left)?(i.ownerId===t&&(n[s++]=i),hb(i,!0),i.right===_b||lb(i.right)||(i=i.right)):i=i.left;return hb(e.root,!1),n}(this,e)}collectNodesPostOrder(){return function(e){let t=e.root;const i=[];let n=0;for(;t!==_b;)lb(t)?(hb(t.left,!1),hb(t.right,!1),t=t.parent):t.left===_b||lb(t.left)?t.right===_b||lb(t.right)?(i[n++]=t,hb(t,!0)):t=t.right:t=t.left;return hb(e.root,!1),i}(this)}insert(e){wb(this,e),this._normalizeDeltaIfNecessary()}delete(e){yb(this,e),this._normalizeDeltaIfNecessary()}resolveNode(e,t){const i=e;let n=0;for(;e!==this.root;)e===e.parent.right&&(n+=e.parent.delta),e=e.parent;const s=i.start+n,o=i.end+n;i.setCachedOffsets(s,o,t)}acceptReplace(e,t,i,n){const s=function(e,t,i){let n=e.root,s=0,o=0,r=0,a=0;const l=[];let h=0;for(;n!==_b;)if(lb(n))hb(n.left,!1),hb(n.right,!1),n===n.parent.right&&(s-=n.parent.delta),n=n.parent;else{if(!lb(n.left)){if(o=s+n.maxEnd,oi?hb(n,!0):(a=s+n.end,a>=t&&(n.setCachedOffsets(r,a,0),l[h++]=n),hb(n,!0),n.right===_b||lb(n.right)||(s+=n.delta,n=n.right))}return hb(e.root,!1),l}(this,e,e+t);for(let o=0,r=s.length;oi?(s.start+=l,s.end+=l,s.delta+=l,(s.delta<-1073741824||s.delta>1073741824)&&(e.requestNormalizeDelta=!0),hb(s,!0)):(hb(s,!0),s.right===_b||lb(s.right)||(o+=s.delta,s=s.right))}hb(e.root,!1)}(this,e,e+t,i),this._normalizeDeltaIfNecessary();for(let o=0,r=s.length;oi)&&(1!==n&&(2===n||t))}function Cb(e,t,i,n,s){const o=function(e){return(24&e.metadata)>>>3}(e),r=0===o||2===o,a=1===o||2===o,l=i-t,h=n,d=Math.min(l,h),c=e.start;let u=!1;const g=e.end;let p=!1;t<=c&&g<=i&&function(e){return(32&e.metadata)>>>5==1}(e)&&(e.start=t,u=!0,e.end=t,p=!0);{const e=s?1:l>0?2:0;!u&&bb(c,r,t,e)&&(u=!0),!p&&bb(g,a,t,e)&&(p=!0)}if(d>0&&!s){const e=l>h?2:0;!u&&bb(c,r,t+d,e)&&(u=!0),!p&&bb(g,a,t+d,e)&&(p=!0)}{const n=s?1:0;!u&&bb(c,r,i,n)&&(e.start=t+h,u=!0),!p&&bb(g,a,i,n)&&(e.end=t+h,p=!0)}const m=h-l;u||(e.start=Math.max(0,c+m)),p||(e.end=Math.max(0,g+m)),e.start>e.end&&(e.end=e.start)}function wb(e,t){if(e.root===_b)return t.parent=_b,t.left=_b,t.right=_b,ab(t,0),e.root=t,e.root;!function(e,t){let i=0,n=e.root;const s=t.start,o=t.end;for(;;){if(Eb(s,o,n.start+i,n.end+i)<0){if(n.left===_b){t.start-=i,t.end-=i,t.maxEnd-=i,n.left=t;break}n=n.left}else{if(n.right===_b){t.start-=i+n.delta,t.end-=i+n.delta,t.maxEnd-=i+n.delta,n.right=t;break}i+=n.delta,n=n.right}}t.parent=n,t.left=_b,t.right=_b,ab(t,1)}(e,t),Nb(t.parent);let i=t;for(;i!==e.root&&1===rb(i.parent);)if(i.parent===i.parent.parent.left){const t=i.parent.parent.right;1===rb(t)?(ab(i.parent,0),ab(t,0),ab(i.parent.parent,1),i=i.parent.parent):(i===i.parent.right&&(i=i.parent,Lb(e,i)),ab(i.parent,0),ab(i.parent.parent,1),kb(e,i.parent.parent))}else{const t=i.parent.parent.left;1===rb(t)?(ab(i.parent,0),ab(t,0),ab(i.parent.parent,1),i=i.parent.parent):(i===i.parent.left&&(i=i.parent,kb(e,i)),ab(i.parent,0),ab(i.parent.parent,1),Lb(e,i.parent.parent))}return ab(e.root,0),t}function yb(e,t){let i,n;if(t.left===_b?(i=t.right,n=t,i.delta+=t.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start+=t.delta,i.end+=t.delta):t.right===_b?(i=t.left,n=t):(n=function(e){for(;e.left!==_b;)e=e.left;return e}(t.right),i=n.right,i.start+=n.delta,i.end+=n.delta,i.delta+=n.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),n.start+=t.delta,n.end+=t.delta,n.delta=t.delta,(n.delta<-1073741824||n.delta>1073741824)&&(e.requestNormalizeDelta=!0)),n===e.root)return e.root=i,ab(i,0),t.detach(),Sb(),xb(i),void(e.root.parent=_b);const s=1===rb(n);if(n===n.parent.left?n.parent.left=i:n.parent.right=i,n===t?i.parent=n.parent:(n.parent===t?i.parent=n:i.parent=n.parent,n.left=t.left,n.right=t.right,n.parent=t.parent,ab(n,rb(t)),t===e.root?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left!==_b&&(n.left.parent=n),n.right!==_b&&(n.right.parent=n)),t.detach(),s)return Nb(i.parent),n!==t&&(Nb(n),Nb(n.parent)),void Sb();let o;for(Nb(i),Nb(i.parent),n!==t&&(Nb(n),Nb(n.parent));i!==e.root&&0===rb(i);)i===i.parent.left?(o=i.parent.right,1===rb(o)&&(ab(o,0),ab(i.parent,1),Lb(e,i.parent),o=i.parent.right),0===rb(o.left)&&0===rb(o.right)?(ab(o,1),i=i.parent):(0===rb(o.right)&&(ab(o.left,0),ab(o,1),kb(e,o),o=i.parent.right),ab(o,rb(i.parent)),ab(i.parent,0),ab(o.right,0),Lb(e,i.parent),i=e.root)):(o=i.parent.left,1===rb(o)&&(ab(o,0),ab(i.parent,1),kb(e,i.parent),o=i.parent.left),0===rb(o.left)&&0===rb(o.right)?(ab(o,1),i=i.parent):(0===rb(o.left)&&(ab(o.right,0),ab(o,1),Lb(e,o),o=i.parent.left),ab(o,rb(i.parent)),ab(i.parent,0),ab(o.left,0),kb(e,i.parent),i=e.root));ab(i,0),Sb()}function Sb(){_b.parent=_b,_b.delta=0,_b.start=0,_b.end=0}function Lb(e,t){const i=t.right;i.delta+=t.delta,(i.delta<-1073741824||i.delta>1073741824)&&(e.requestNormalizeDelta=!0),i.start+=t.delta,i.end+=t.delta,t.right=i.left,i.left!==_b&&(i.left.parent=t),i.parent=t.parent,t.parent===_b?e.root=i:t===t.parent.left?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i,xb(t),xb(i)}function kb(e,t){const i=t.left;t.delta-=i.delta,(t.delta<-1073741824||t.delta>1073741824)&&(e.requestNormalizeDelta=!0),t.start-=i.delta,t.end-=i.delta,t.left=i.right,i.right!==_b&&(i.right.parent=t),i.parent=t.parent,t.parent===_b?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i,xb(t),xb(i)}function Db(e){let t=e.end;if(e.left!==_b){const i=e.left.maxEnd;i>t&&(t=i)}if(e.right!==_b){const i=e.right.maxEnd+e.delta;i>t&&(t=i)}return t}function xb(e){e.maxEnd=Db(e)}function Nb(e){for(;e!==_b;){const t=Db(e);if(e.maxEnd===t)return;e.maxEnd=t,e=e.parent}}function Eb(e,t,i,n){return e===i?t-n:e-i}class Ib{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!==Mb)return Tb(this.right);let e=this;for(;e.parent!==Mb&&e.parent.left!==e;)e=e.parent;return e.parent===Mb?Mb:e.parent}prev(){if(this.left!==Mb)return Rb(this.left);let e=this;for(;e.parent!==Mb&&e.parent.right!==e;)e=e.parent;return e.parent===Mb?Mb:e.parent}detach(){this.parent=null,this.left=null,this.right=null}}const Mb=new Ib(null,0);function Tb(e){for(;e.left!==Mb;)e=e.left;return e}function Rb(e){for(;e.right!==Mb;)e=e.right;return e}function Ab(e){return e===Mb?0:e.size_left+e.piece.length+Ab(e.right)}function Ob(e){return e===Mb?0:e.lf_left+e.piece.lineFeedCnt+Ob(e.right)}function Pb(){Mb.parent=Mb}function Fb(e,t){const i=t.right;i.size_left+=t.size_left+(t.piece?t.piece.length:0),i.lf_left+=t.lf_left+(t.piece?t.piece.lineFeedCnt:0),t.right=i.left,i.left!==Mb&&(i.left.parent=t),i.parent=t.parent,t.parent===Mb?e.root=i:t.parent.left===t?t.parent.left=i:t.parent.right=i,i.left=t,t.parent=i}function Bb(e,t){const i=t.left;t.left=i.right,i.right!==Mb&&(i.right.parent=t),i.parent=t.parent,t.size_left-=i.size_left+(i.piece?i.piece.length:0),t.lf_left-=i.lf_left+(i.piece?i.piece.lineFeedCnt:0),t.parent===Mb?e.root=i:t===t.parent.right?t.parent.right=i:t.parent.left=i,i.right=t,t.parent=i}function Wb(e,t){let i,n;if(t.left===Mb?(n=t,i=n.right):t.right===Mb?(n=t,i=n.left):(n=Tb(t.right),i=n.right),n===e.root)return e.root=i,i.color=0,t.detach(),Pb(),void(e.root.parent=Mb);const s=1===n.color;if(n===n.parent.left?n.parent.left=i:n.parent.right=i,n===t?(i.parent=n.parent,zb(e,i)):(n.parent===t?i.parent=n:i.parent=n.parent,zb(e,i),n.left=t.left,n.right=t.right,n.parent=t.parent,n.color=t.color,t===e.root?e.root=n:t===t.parent.left?t.parent.left=n:t.parent.right=n,n.left!==Mb&&(n.left.parent=n),n.right!==Mb&&(n.right.parent=n),n.size_left=t.size_left,n.lf_left=t.lf_left,zb(e,n)),t.detach(),i.parent.left===i){const t=Ab(i),n=Ob(i);if(t!==i.parent.size_left||n!==i.parent.lf_left){const s=t-i.parent.size_left,o=n-i.parent.lf_left;i.parent.size_left=t,i.parent.lf_left=n,Hb(e,i.parent,s,o)}}if(zb(e,i.parent),s)return void Pb();let o;for(;i!==e.root&&0===i.color;)i===i.parent.left?(o=i.parent.right,1===o.color&&(o.color=0,i.parent.color=1,Fb(e,i.parent),o=i.parent.right),0===o.left.color&&0===o.right.color?(o.color=1,i=i.parent):(0===o.right.color&&(o.left.color=0,o.color=1,Bb(e,o),o=i.parent.right),o.color=i.parent.color,i.parent.color=0,o.right.color=0,Fb(e,i.parent),i=e.root)):(o=i.parent.left,1===o.color&&(o.color=0,i.parent.color=1,Bb(e,i.parent),o=i.parent.left),0===o.left.color&&0===o.right.color?(o.color=1,i=i.parent):(0===o.left.color&&(o.right.color=0,o.color=1,Fb(e,o),o=i.parent.left),o.color=i.parent.color,i.parent.color=0,o.left.color=0,Bb(e,i.parent),i=e.root));i.color=0,Pb()}function Vb(e,t){for(zb(e,t);t!==e.root&&1===t.parent.color;)if(t.parent===t.parent.parent.left){const i=t.parent.parent.right;1===i.color?(t.parent.color=0,i.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.right&&Fb(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,Bb(e,t.parent.parent))}else{const i=t.parent.parent.left;1===i.color?(t.parent.color=0,i.color=0,t.parent.parent.color=1,t=t.parent.parent):(t===t.parent.left&&Bb(e,t=t.parent),t.parent.color=0,t.parent.parent.color=1,Fb(e,t.parent.parent))}e.root.color=0}function Hb(e,t,i,n){for(;t!==e.root&&t!==Mb;)t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}function zb(e,t){let i=0,n=0;if(t!==e.root){for(;t!==e.root&&t===t.parent.right;)t=t.parent;if(t!==e.root)for(i=Ab((t=t.parent).left)-t.size_left,n=Ob(t.left)-t.lf_left,t.size_left+=i,t.lf_left+=n;t!==e.root&&(0!==i||0!==n);)t.parent.left===t&&(t.parent.size_left+=i,t.parent.lf_left+=n),t=t.parent}}function Ub(e){return e<0?0:e>255?255:0|e}function Kb(e){return e<0?0:e>4294967295?4294967295:0|e}Mb.parent=Mb,Mb.left=Mb,Mb.right=Mb,Mb.color=0;class jb{constructor(e){const t=Ub(e);this._defaultValue=t,this._asciiMap=jb._createAsciiMap(t),this._map=new Map}static _createAsciiMap(e){const t=new Uint8Array(256);return t.fill(e),t}set(e,t){const i=Ub(t);e>=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()}}class qb{constructor(){this._actual=new jb(0)}add(e){this._actual.set(e,1)}has(e){return 1===this._actual.get(e)}clear(){return this._actual.clear()}}class $b extends jb{constructor(e){super(0);for(let t=0,i=e.length;t(t.hasOwnProperty(i)||(t[i]=e(i)),t[i])}((e=>new $b(e)));class Zb{constructor(e,t,i,n){this.searchString=e,this.isRegex=t,this.matchCase=i,this.wordSeparators=n}parseSearchRequest(){if(""===this.searchString)return null;let e;e=this.isRegex?function(e){if(!e||0===e.length)return!1;for(let t=0,i=e.length;t=i)break;const n=e.charCodeAt(t);if(110===n||114===n||87===n)return!0}}return!1}(this.searchString):this.searchString.indexOf("\n")>=0;let t=null;try{t=so(this.searchString,this.isRegex,{matchCase:this.matchCase,wholeWord:!1,multiline:e,global:!0,unicode:!0})}catch(n){return null}if(!t)return null;let i=!this.isRegex&&!e;return i&&this.searchString.toLowerCase()!==this.searchString.toUpperCase()&&(i=this.matchCase),new Nd(t,this.wordSeparators?Gb(this.wordSeparators):null,i?this.searchString:null)}}function Yb(e,t,i){if(!i)return new Dd(e,null);const n=[];for(let s=0,o=t.length;s=e?n=s-1:t[s+1]>=e?(i=s,n=s):i=s+1}return i+1}}class Qb{static findMatches(e,t,i,n,s){const o=t.parseSearchRequest();return o?o.regex.multiline?this._doFindMatchesMultiline(e,i,new eC(o.wordSeparators,o.regex),n,s):this._doFindMatchesLineByLine(e,i,o,n,s):[]}static _getMultilineMatchRange(e,t,i,n,s,o){let r,a,l=0;if(n?(l=n.findLineFeedCountBeforeOffset(s),r=t+s+l):r=t+s,n){const e=n.findLineFeedCountBeforeOffset(s+o.length)-l;a=r+o.length+e}else a=r+o.length;const h=e.getPositionAt(r),d=e.getPositionAt(a);return new Rh(h.lineNumber,h.column,d.lineNumber,d.column)}static _doFindMatchesMultiline(e,t,i,n,s){const o=e.getOffsetAt(t.getStartPosition()),r=e.getValueInRange(t,1),a="\r\n"===e.getEOL()?new Xb(r):null,l=[];let h,d=0;for(i.reset(0);h=i.next(r);)if(l[d++]=Yb(this._getMultilineMatchRange(e,o,r,a,h.index,h[0]),h,n),d>=s)return l;return l}static _doFindMatchesLineByLine(e,t,i,n,s){const o=[];let r=0;if(t.startLineNumber===t.endLineNumber){const a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1,t.endColumn-1);return r=this._findMatchesInLine(i,a,t.startLineNumber,t.startColumn-1,r,o,n,s),o}const a=e.getLineContent(t.startLineNumber).substring(t.startColumn-1);r=this._findMatchesInLine(i,a,t.startLineNumber,t.startColumn-1,r,o,n,s);for(let l=t.startLineNumber+1;l=a))return s;return s}const h=new eC(e.wordSeparators,e.regex);let d;h.reset(0);do{if(d=h.next(t),d&&(o[s++]=Yb(new Rh(i,d.index+1+n,i,d.index+1+d[0].length+n),d,r),s>=a))return s}while(d);return s}static findNextMatch(e,t,i,n){const s=t.parseSearchRequest();if(!s)return null;const o=new eC(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindNextMatchMultiline(e,i,o,n):this._doFindNextMatchLineByLine(e,i,o,n)}static _doFindNextMatchMultiline(e,t,i,n){const s=new Va(t.lineNumber,1),o=e.getOffsetAt(s),r=e.getLineCount(),a=e.getValueInRange(new Rh(s.lineNumber,s.column,r,e.getLineMaxColumn(r)),1),l="\r\n"===e.getEOL()?new Xb(a):null;i.reset(t.column-1);const h=i.next(a);return h?Yb(this._getMultilineMatchRange(e,o,a,l,h.index,h[0]),h,n):1!==t.lineNumber||1!==t.column?this._doFindNextMatchMultiline(e,new Va(1,1),i,n):null}static _doFindNextMatchLineByLine(e,t,i,n){const s=e.getLineCount(),o=t.lineNumber,r=e.getLineContent(o),a=this._findFirstMatchInLine(i,r,o,t.column,n);if(a)return a;for(let l=1;l<=s;l++){const t=(o+l-1)%s,r=e.getLineContent(t+1),a=this._findFirstMatchInLine(i,r,t+1,1,n);if(a)return a}return null}static _findFirstMatchInLine(e,t,i,n,s){e.reset(n-1);const o=e.next(t);return o?Yb(new Rh(i,o.index+1,i,o.index+1+o[0].length),o,s):null}static findPreviousMatch(e,t,i,n){const s=t.parseSearchRequest();if(!s)return null;const o=new eC(s.wordSeparators,s.regex);return s.regex.multiline?this._doFindPreviousMatchMultiline(e,i,o,n):this._doFindPreviousMatchLineByLine(e,i,o,n)}static _doFindPreviousMatchMultiline(e,t,i,n){const s=this._doFindMatchesMultiline(e,new Rh(1,1,t.lineNumber,t.column),i,n,9990);if(s.length>0)return s[s.length-1];const o=e.getLineCount();return t.lineNumber!==o||t.column!==e.getLineMaxColumn(o)?this._doFindPreviousMatchMultiline(e,new Va(o,e.getLineMaxColumn(o)),i,n):null}static _doFindPreviousMatchLineByLine(e,t,i,n){const s=e.getLineCount(),o=t.lineNumber,r=e.getLineContent(o).substring(0,t.column-1),a=this._findLastMatchInLine(i,r,o,n);if(a)return a;for(let l=1;l<=s;l++){const t=(s+o-l-1)%s,r=e.getLineContent(t+1),a=this._findLastMatchInLine(i,r,t+1,n);if(a)return a}return null}static _findLastMatchInLine(e,t,i,n){let s,o=null;for(e.reset(0);s=e.next(t);)o=Yb(new Rh(i,s.index+1,i,s.index+1+s[0].length),s,n);return o}}function Jb(e,t,i,n,s){return function(e,t,i,n,s){if(0===n)return!0;const o=t.charCodeAt(n-1);if(0!==e.get(o))return!0;if(13===o||10===o)return!0;if(s>0){const i=t.charCodeAt(n);if(0!==e.get(i))return!0}return!1}(e,t,0,n,s)&&function(e,t,i,n,s){if(n+s===i)return!0;const o=t.charCodeAt(n+s);if(0!==e.get(o))return!0;if(13===o||10===o)return!0;if(s>0){const i=t.charCodeAt(n+s-1);if(0!==e.get(i))return!0}return!1}(e,t,i,n,s)}class eC{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)return null;if(i=this._searchRegex.exec(e),!i)return null;const n=i.index,s=i[0].length;if(n===this._prevMatchStartIndex&&s===this._prevMatchLength){if(0===s){Lo(e,t,this._searchRegex.lastIndex)>65535?this._searchRegex.lastIndex+=2:this._searchRegex.lastIndex+=1;continue}return null}if(this._prevMatchStartIndex=n,this._prevMatchLength=s,!this._wordSeparators||Jb(this._wordSeparators,e,t,n,s))return i}while(i);return null}}const tC=65535;function iC(e){let t;return t=e[e.length-1]<65536?new Uint16Array(e.length):new Uint32Array(e.length),t.set(e,0),t}class nC{constructor(e,t,i,n,s){this.lineStarts=e,this.cr=t,this.lf=i,this.crlf=n,this.isBasicASCII=s}}function sC(e,t=!0){const i=[0];let n=1;for(let s=0,o=e.length;s(e!==Mb&&this._pieces.push(e.piece),!0)))}read(){return 0===this._pieces.length?0===this._index?(this._index++,this._BOM):null:this._index>this._pieces.length-1?null:0===this._index?this._BOM+this._tree.getPieceContent(this._pieces[this._index++]):this._tree.getPieceContent(this._pieces[this._index++])}}class lC{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)}if(t){const e=[];for(const t of i)null!==t&&e.push(t);this._cache=e}}}class hC{constructor(e,t,i){this.create(e,t,i)}create(e,t,i){this._buffers=[new rC("",[0])],this._lastChangeBufferPos={line:0,column:0},this.root=Mb,this._lineCnt=1,this._length=0,this._EOL=t,this._EOLLength=t.length,this._EOLNormalized=i;let n=null;for(let s=0,o=e.length;s0){e[s].lineStarts||(e[s].lineStarts=sC(e[s].buffer));const t=new oC(s+1,{line:0,column:0},{line:e[s].lineStarts.length-1,column:e[s].buffer.length-e[s].lineStarts[e[s].lineStarts.length-1]},e[s].lineStarts.length-1,e[s].buffer.length);this._buffers.push(e[s]),n=this.rbInsertRight(n,t)}this._searchCache=new lC(1),this._lastVisitedLine={lineNumber:0,value:""},this.computeBufferMetadata()}normalizeEOL(e){const t=tC,i=t-Math.floor(21845),n=2*i;let s="",o=0;const r=[];if(this.iterate(this.root,(t=>{const a=this.getNodeContent(t),l=a.length;if(o<=i||o+l0){const t=s.replace(/\r\n|\r|\n/g,e);r.push(new rC(t,sC(t)))}this.create(r,e,!0)}getEOL(){return this._EOL}setEOL(e){this._EOL=e,this._EOLLength=this._EOL.length,this.normalizeEOL(e)}createSnapshot(e){return new aC(this,e)}getOffsetAt(e,t){let i=0,n=this.root;for(;n!==Mb;)if(n.left!==Mb&&n.lf_left+1>=e)n=n.left;else{if(n.lf_left+n.piece.lineFeedCnt+1>=e){i+=n.size_left;return i+(this.getAccumulatedValue(n,e-n.lf_left-2)+t-1)}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!==Mb;)if(0!==t.size_left&&t.size_left>=e)t=t.left;else{if(t.size_left+t.piece.length>=e){const s=this.getIndexOf(t,e-t.size_left);if(i+=t.lf_left+s.index,0===s.index){const e=this.getOffsetAt(i+1,1);return new Va(i+1,n-e+1)}return new Va(i+1,s.remainder+1)}if(e-=t.size_left+t.piece.length,i+=t.lf_left+t.piece.lineFeedCnt,t.right===Mb){const t=this.getOffsetAt(i+1,1);return new Va(i+1,n-e-t+1)}t=t.right}return new Va(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),s=this.getValueInRange2(i,n);return t?t===this._EOL&&this._EOLNormalized&&t===this.getEOL()&&this._EOLNormalized?s:s.replace(/\r\n|\r|\n/g,t):s}getValueInRange2(e,t){if(e.node===t.node){const i=e.node,n=this._buffers[i.piece.bufferIndex].buffer,s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n.substring(s+e.remainder,s+t.remainder)}let i=e.node;const n=this._buffers[i.piece.bufferIndex].buffer,s=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);let o=n.substring(s+e.remainder,s+i.piece.length);for(i=i.next();i!==Mb;){const e=this._buffers[i.piece.bufferIndex].buffer,n=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);if(i===t.node){o+=e.substring(n,n+t.remainder);break}o+=e.substr(n,i.piece.length),i=i.next()}return o}getLinesContent(){const e=[];let t=0,i="",n=!1;return this.iterate(this.root,(s=>{if(s===Mb)return!0;const o=s.piece;let r=o.length;if(0===r)return!0;const a=this._buffers[o.bufferIndex].buffer,l=this._buffers[o.bufferIndex].lineStarts,h=o.start.line,d=o.end.line;let c=l[h]+o.start.column;if(n&&(10===a.charCodeAt(c)&&(c++,r--),e[t++]=i,i="",n=!1,0===r))return!0;if(h===d)return this._EOLNormalized||13!==a.charCodeAt(c+r-1)?i+=a.substr(c,r):(n=!0,i+=a.substr(c,r-1)),!0;i+=this._EOLNormalized?a.substring(c,Math.max(c,l[h+1]-this._EOLLength)):a.substring(c,l[h+1]).replace(/(\r\n|\r|\n)$/,""),e[t++]=i;for(let n=h+1;ne+g,t.reset(0)):(_=c.buffer,v=e=>e,t.reset(g));do{if(m=t.next(_),m){if(v(m.index)>=p)return h;this.positionInBuffer(e,v(m.index)-u,f);const t=this.getLineFeedCnt(e.piece.bufferIndex,s,f),o=f.line===s.line?f.column-s.column+n:f.column+1,r=o+m[0].length;if(d[h++]=Yb(new Rh(i+t,o,i+t,r),m,a),v(m.index)+m[0].length>=p)return h;if(h>=l)return h}}while(m);return h}findMatchesLineByLine(e,t,i,n){const s=[];let o=0;const r=new eC(t.wordSeparators,t.regex);let a=this.nodeAt2(e.startLineNumber,e.startColumn);if(null===a)return[];const l=this.nodeAt2(e.endLineNumber,e.endColumn);if(null===l)return[];let h=this.positionInBuffer(a.node,a.remainder);const d=this.positionInBuffer(l.node,l.remainder);if(a.node===l.node)return this.findMatchesInNode(a.node,r,e.startLineNumber,e.startColumn,h,d,t,i,n,o,s),s;let c=e.startLineNumber,u=a.node;for(;u!==l.node;){const l=this.getLineFeedCnt(u.piece.bufferIndex,h,u.piece.end);if(l>=1){const a=this._buffers[u.piece.bufferIndex].lineStarts,d=this.offsetInBuffer(u.piece.bufferIndex,u.piece.start),g=a[h.line+l],p=c===e.startLineNumber?e.startColumn:1;if(o=this.findMatchesInNode(u,r,c,p,h,this.positionInBuffer(u,g-d),t,i,n,o,s),o>=n)return s;c+=l}const d=c===e.startLineNumber?e.startColumn-1:0;if(c===e.endLineNumber){const a=this.getLineContent(c).substring(d,e.endColumn-1);return o=this._findMatchesInLine(t,r,a,e.endLineNumber,d,o,s,i,n),s}if(o=this._findMatchesInLine(t,r,this.getLineContent(c).substr(d),c,d,o,s,i,n),o>=n)return s;c++,a=this.nodeAt2(c,1),u=a.node,h=this.positionInBuffer(a.node,a.remainder)}if(c===e.endLineNumber){const a=c===e.startLineNumber?e.startColumn-1:0,l=this.getLineContent(c).substring(a,e.endColumn-1);return o=this._findMatchesInLine(t,r,l,e.endLineNumber,a,o,s,i,n),s}const g=c===e.startLineNumber?e.startColumn:1;return o=this.findMatchesInNode(l.node,r,c,g,h,d,t,i,n,o,s),s}_findMatchesInLine(e,t,i,n,s,o,r,a,l){const h=e.wordSeparators;if(!a&&e.simpleSearch){const t=e.simpleSearch,a=t.length,d=i.length;let c=-a;for(;-1!==(c=i.indexOf(t,c+a));)if((!h||Jb(h,i,d,c,a))&&(r[o++]=new Dd(new Rh(n,c+1+s,n,c+1+a+s),null),o>=l))return o;return o}let d;t.reset(0);do{if(d=t.next(i),d&&(r[o++]=Yb(new Rh(n,d.index+1+s,n,d.index+1+d[0].length+s),d,a),o>=l))return o}while(d);return o}insert(e,t,i=!1){if(this._EOLNormalized=this._EOLNormalized&&i,this._lastVisitedLine.lineNumber=0,this._lastVisitedLine.value="",this.root!==Mb){const{node:i,remainder:n,nodeStartOffset:s}=this.nodeAt(e),o=i.piece,r=o.bufferIndex,a=this.positionInBuffer(i,n);if(0===i.piece.bufferIndex&&o.end.line===this._lastChangeBufferPos.line&&o.end.column===this._lastChangeBufferPos.column&&s+o.length===e&&t.lengthe){const e=[];let s=new oC(o.bufferIndex,a,o.end,this.getLineFeedCnt(o.bufferIndex,a,o.end),this.offsetInBuffer(r,o.end)-this.offsetInBuffer(r,a));if(this.shouldCheckCRLF()&&this.endWithCR(t)){if(10===this.nodeCharCodeAt(i,n)){const e={line:s.start.line+1,column:0};s=new oC(s.bufferIndex,e,s.end,this.getLineFeedCnt(s.bufferIndex,e,s.end),s.length-1),t+="\n"}}if(this.shouldCheckCRLF()&&this.startWithLF(t)){if(13===this.nodeCharCodeAt(i,n-1)){const s=this.positionInBuffer(i,n-1);this.deleteNodeTail(i,s),t="\r"+t,0===i.piece.length&&e.push(i)}else this.deleteNodeTail(i,a)}else this.deleteNodeTail(i,a);const l=this.createNewPieces(t);s.length>0&&this.rbInsertRight(i,s);let h=i;for(let t=0;t=0;o--)s=this.rbInsertLeft(s,n[o]);this.validateCRLFWithPrevNode(s),this.deleteNodes(i)}insertContentToNodeRight(e,t){this.adjustCarriageReturnFromNext(e,t)&&(e+="\n");const i=this.createNewPieces(e),n=this.rbInsertRight(t,i[0]);let s=n;for(let o=1;o=d))break;a=h+1}return i?(i.line=h,i.column=r-c,null):{line:h,column:r-c}}getLineFeedCnt(e,t,i){if(0===i.column)return i.line-t.line;const n=this._buffers[e].lineStarts;if(i.line===n.length-1)return i.line-t.line;const s=n[i.line+1],o=n[i.line]+i.column;if(s>o+1)return i.line-t.line;const r=o-1;return 13===this._buffers[e].buffer.charCodeAt(r)?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;ttC){const t=[];for(;e.length>tC;){const i=e.charCodeAt(65534);let n;13===i||i>=55296&&i<=56319?(n=e.substring(0,65534),e=e.substring(65534)):(n=e.substring(0,tC),e=e.substring(tC));const s=sC(n);t.push(new oC(this._buffers.length,{line:0,column:0},{line:s.length-1,column:n.length-s[s.length-1]},s.length-1,n.length)),this._buffers.push(new rC(n,s))}const i=sC(e);return t.push(new oC(this._buffers.length,{line:0,column:0},{line:i.length-1,column:e.length-i[i.length-1]},i.length-1,e.length)),this._buffers.push(new rC(e,i)),t}let t=this._buffers[0].buffer.length;const i=sC(e,!1);let n=this._lastChangeBufferPos;if(this._buffers[0].lineStarts[this._buffers[0].lineStarts.length-1]===t&&0!==t&&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 e=0;e=e-1)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt>e-1){const n=this.getAccumulatedValue(i,e-i.lf_left-2),r=this.getAccumulatedValue(i,e-i.lf_left-1),a=this._buffers[i.piece.bufferIndex].buffer,l=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return s+=i.size_left,this._searchCache.set({node:i,nodeStartOffset:s,nodeStartLineNumber:o-(e-1-i.lf_left)}),a.substring(l+n,l+r-t)}if(i.lf_left+i.piece.lineFeedCnt===e-1){const t=this.getAccumulatedValue(i,e-i.lf_left-2),s=this._buffers[i.piece.bufferIndex].buffer,o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n=s.substring(o+t,o+i.piece.length);break}e-=i.lf_left+i.piece.lineFeedCnt,s+=i.size_left+i.piece.length,i=i.right}}for(i=i.next();i!==Mb;){const e=this._buffers[i.piece.bufferIndex].buffer;if(i.piece.lineFeedCnt>0){const s=this.getAccumulatedValue(i,0),o=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);return n+=e.substring(o,o+s-t),n}{const t=this.offsetInBuffer(i.piece.bufferIndex,i.piece.start);n+=e.substr(t,i.piece.length)}i=i.next()}return n}computeBufferMetadata(){let e=this.root,t=1,i=0;for(;e!==Mb;)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),s=n.line-i.start.line;if(this.offsetInBuffer(i.bufferIndex,i.end)-this.offsetInBuffer(i.bufferIndex,i.start)===t){const t=this.getLineFeedCnt(e.piece.bufferIndex,i.start,n);if(t!==s)return{index:t,remainder:0}}return{index:s,remainder:n.column}}getAccumulatedValue(e,t){if(t<0)return 0;const i=e.piece,n=this._buffers[i.bufferIndex].lineStarts,s=i.start.line+t+1;return s>i.end.line?n[i.end.line]+i.end.column-n[i.start.line]-i.start.column:n[s]-n[i.start.line]-i.start.column}deleteNodeTail(e,t){const i=e.piece,n=i.lineFeedCnt,s=this.offsetInBuffer(i.bufferIndex,i.end),o=t,r=this.offsetInBuffer(i.bufferIndex,o),a=this.getLineFeedCnt(i.bufferIndex,i.start,o),l=a-n,h=r-s,d=i.length+h;e.piece=new oC(i.bufferIndex,i.start,o,a,d),Hb(this,e,h,l)}deleteNodeHead(e,t){const i=e.piece,n=i.lineFeedCnt,s=this.offsetInBuffer(i.bufferIndex,i.start),o=t,r=this.getLineFeedCnt(i.bufferIndex,o,i.end),a=r-n,l=s-this.offsetInBuffer(i.bufferIndex,o),h=i.length+l;e.piece=new oC(i.bufferIndex,o,i.end,r,h),Hb(this,e,l,a)}shrinkNode(e,t,i){const n=e.piece,s=n.start,o=n.end,r=n.length,a=n.lineFeedCnt,l=t,h=this.getLineFeedCnt(n.bufferIndex,n.start,l),d=this.offsetInBuffer(n.bufferIndex,t)-this.offsetInBuffer(n.bufferIndex,s);e.piece=new oC(n.bufferIndex,n.start,l,h,d),Hb(this,e,d-r,h-a);const c=new oC(n.bufferIndex,i,o,this.getLineFeedCnt(n.bufferIndex,i,o),this.offsetInBuffer(n.bufferIndex,o)-this.offsetInBuffer(n.bufferIndex,i)),u=this.rbInsertRight(e,c);this.validateCRLFWithPrevNode(u)}appendToNode(e,t){this.adjustCarriageReturnFromNext(t,e)&&(t+="\n");const i=this.shouldCheckCRLF()&&this.startWithLF(t)&&this.endWithCR(e),n=this._buffers[0].buffer.length;this._buffers[0].buffer+=t;const s=sC(t,!1);for(let c=0;ce)t=t.left;else{if(t.size_left+t.piece.length>=e){n+=t.size_left;const i={node:t,remainder:e-t.size_left,nodeStartOffset:n};return this._searchCache.set(i),i}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!==Mb;)if(i.left!==Mb&&i.lf_left>=e-1)i=i.left;else{if(i.lf_left+i.piece.lineFeedCnt>e-1){const s=this.getAccumulatedValue(i,e-i.lf_left-2),o=this.getAccumulatedValue(i,e-i.lf_left-1);return n+=i.size_left,{node:i,remainder:Math.min(s+t-1,o),nodeStartOffset:n}}if(i.lf_left+i.piece.lineFeedCnt===e-1){const s=this.getAccumulatedValue(i,e-i.lf_left-2);if(s+t-1<=i.piece.length)return{node:i,remainder:s+t-1,nodeStartOffset:n};t-=i.piece.length-s;break}e-=i.lf_left+i.piece.lineFeedCnt,n+=i.size_left+i.piece.length,i=i.right}for(i=i.next();i!==Mb;){if(i.piece.lineFeedCnt>0){const e=this.getAccumulatedValue(i,0),n=this.offsetOfNode(i);return{node:i,remainder:Math.min(t-1,e),nodeStartOffset:n}}if(i.piece.length>=t-1){return{node:i,remainder:t-1,nodeStartOffset:this.offsetOfNode(i)}}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&&"\n"===this._EOL)}startWithLF(e){if("string"==typeof e)return 10===e.charCodeAt(0);if(e===Mb||0===e.piece.lineFeedCnt)return!1;const t=e.piece,i=this._buffers[t.bufferIndex].lineStarts,n=t.start.line,s=i[n]+t.start.column;if(n===i.length-1)return!1;return!(i[n+1]>s+1)&&10===this._buffers[t.bufferIndex].buffer.charCodeAt(s)}endWithCR(e){return"string"==typeof e?13===e.charCodeAt(e.length-1):e!==Mb&&0!==e.piece.lineFeedCnt&&13===this.nodeCharCodeAt(e,e.piece.length-1)}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 s;s=0===e.piece.end.column?{line:e.piece.end.line-1,column:n[e.piece.end.line]-n[e.piece.end.line-1]-1}:{line:e.piece.end.line,column:e.piece.end.column-1};const o=e.piece.length-1,r=e.piece.lineFeedCnt-1;e.piece=new oC(e.piece.bufferIndex,e.piece.start,s,r,o),Hb(this,e,-1,-1),0===e.piece.length&&i.push(e);const a={line:t.piece.start.line+1,column:0},l=t.piece.length-1,h=this.getLineFeedCnt(t.piece.bufferIndex,a,t.piece.end);t.piece=new oC(t.piece.bufferIndex,a,t.piece.end,h,l),Hb(this,t,-1,-1),0===t.piece.length&&i.push(t);const d=this.createNewPieces("\r\n");this.rbInsertRight(e,d[0]);for(let c=0;ce.sortIndex-t.sortIndex))}this._mightContainRTL=n,this._mightContainUnusualLineTerminators=s,this._mightContainNonBasicASCII=o;const u=this._doApplyEdits(a);let g=null;if(t&&d.length>0){d.sort(((e,t)=>t.lineNumber-e.lineNumber)),g=[];for(let e=0,t=d.length;e0&&d[e-1].lineNumber===t)continue;const i=d[e].oldContent,n=this.getLineContent(t);0!==n.length&&n!==i&&-1===ro(n)&&g.push(t)}}return this._onDidChangeContent.fire(),new Ed(c,u,g)}_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,s=new Rh(i.startLineNumber,i.startColumn,n.endLineNumber,n.endColumn);let o=i.startLineNumber,r=i.startColumn;const a=[];for(let u=0,g=e.length;u0&&a.push(i.text),o=n.endLineNumber,r=n.endColumn}const l=a.join(""),[h,d,c]=hc(l);return{sortIndex:0,identifier:e[0].identifier,range:s,rangeOffset:this.getOffsetAt(s.startLineNumber,s.startColumn),rangeLength:this.getValueLengthInRange(s,0),text:l,eolCount:h,firstLineLength:d,lastLineLength:c,forceMoveMarkers:t,isAutoWhitespaceEdit:!1}}_doApplyEdits(e){e.sort(dC._sortOpsDescending);const t=[];for(let i=0;i0){const e=r.eolCount+1;h=1===e?new Rh(a,l,a,l+r.firstLineLength):new Rh(a,l,a+e-1,r.lastLineLength+1)}else h=new Rh(a,l,a,l);i=h.endLineNumber,n=h.endColumn,t.push(h),s=r}return t}static _sortOpsAscending(e,t){const i=Rh.compareRangesUsingEnds(e.range,t.range);return 0===i?e.sortIndex-t.sortIndex:i}static _sortOpsDescending(e,t){const i=Rh.compareRangesUsingEnds(e.range,t.range);return 0===i?t.sortIndex-e.sortIndex:-i}}class cC{constructor(e,t,i,n,s,o,r,a,l){this._chunks=e,this._bom=t,this._cr=i,this._lf=n,this._crlf=s,this._containsRTL=o,this._containsUnusualLineTerminators=r,this._isBasicASCII=a,this._normalizeEOL=l}_getEOL(e){const t=this._cr+this._lf+this._crlf,i=this._cr+this._crlf;return 0===t?1===e?"\n":"\r\n":i>t/2?"\r\n":"\n"}create(e){const t=this._getEOL(e),i=this._chunks;if(this._normalizeEOL&&("\r\n"===t&&(this._cr>0||this._lf>0)||"\n"===t&&(this._cr>0||this._crlf>0)))for(let s=0,o=i.length;s=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||0!==e.length)&&(this._hasPreviousChar?this._acceptChunk2(String.fromCharCode(this._previousChar)+e):this._acceptChunk2(e))}_acceptChunk2(e){const t=function(e,t){e.length=0,e[0]=0;let i=1,n=0,s=0,o=0,r=!0;for(let l=0,h=t.length;l126)&&(r=!1)}const a=new nC(iC(e),n,s,o,r);return e.length=0,a}(this._tmpLineStarts,e);this.chunks.push(new rC(e,t.lineStarts)),this.cr+=t.cr,this.lf+=t.lf,this.crlf+=t.crlf,t.isBasicASCII||(this.isBasicASCII=!1,this.containsRTL||(this.containsRTL=Io(e)),this.containsUnusualLineTerminators||(this.containsUnusualLineTerminators=Ao(e)))}finish(e=!0){return this._finish(),new cC(this.chunks,this.BOM,this.cr,this.lf,this.crlf,this.containsRTL,this.containsUnusualLineTerminators,this.isBasicASCII,e)}_finish(){if(0===this.chunks.length&&this._acceptChunk1("",!0),this._hasPreviousChar){this._hasPreviousChar=!1;const e=this.chunks[this.chunks.length-1];e.buffer+=String.fromCharCode(this._previousChar);const t=sC(e.buffer);e.lineStarts=t,13===this._previousChar&&this.cr++}}}var gC,pC,mC,fC,_C=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class vC extends E{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()}resolve(){return _C(this,void 0,void 0,(function*(){return this._resolvePromise||(this._resolvePromise=this._create()),this._resolvePromise}))}_create(){return _C(this,void 0,void 0,(function*(){const e=yield this._factory.tokenizationSupport;this._isResolved=!0,e&&!this._isDisposed&&this._register(this._registry.register(this._languageId,e))}))}}class bC{constructor(e,t,i){this.offset=e,this.type=t,this.language=i,this._tokenBrand=void 0}toString(){return"("+this.offset+", "+this.type+")"}}class CC{constructor(e,t){this.tokens=e,this.endState=t,this._tokenizationResultBrand=void 0}}class wC{constructor(e,t){this.tokens=e,this.endState=t,this._encodedTokenizationResultBrand=void 0}}!function(e){const t=new Map;t.set(0,Jr.symbolMethod),t.set(1,Jr.symbolFunction),t.set(2,Jr.symbolConstructor),t.set(3,Jr.symbolField),t.set(4,Jr.symbolVariable),t.set(5,Jr.symbolClass),t.set(6,Jr.symbolStruct),t.set(7,Jr.symbolInterface),t.set(8,Jr.symbolModule),t.set(9,Jr.symbolProperty),t.set(10,Jr.symbolEvent),t.set(11,Jr.symbolOperator),t.set(12,Jr.symbolUnit),t.set(13,Jr.symbolValue),t.set(15,Jr.symbolEnum),t.set(14,Jr.symbolConstant),t.set(15,Jr.symbolEnum),t.set(16,Jr.symbolEnumMember),t.set(17,Jr.symbolKeyword),t.set(27,Jr.symbolSnippet),t.set(18,Jr.symbolText),t.set(19,Jr.symbolColor),t.set(20,Jr.symbolFile),t.set(21,Jr.symbolReference),t.set(22,Jr.symbolCustomColor),t.set(23,Jr.symbolFolder),t.set(24,Jr.symbolTypeParameter),t.set(25,Jr.account),t.set(26,Jr.issues),e.toIcon=function(e){let i=t.get(e);return i||(console.info("No codicon found for CompletionItemKind "+e),i=Jr.symbolProperty),i};const i=new Map;i.set("method",0),i.set("function",1),i.set("constructor",2),i.set("field",3),i.set("variable",4),i.set("class",5),i.set("struct",6),i.set("interface",7),i.set("module",8),i.set("property",9),i.set("event",10),i.set("operator",11),i.set("unit",12),i.set("value",13),i.set("constant",14),i.set("enum",15),i.set("enum-member",16),i.set("enumMember",16),i.set("keyword",17),i.set("snippet",27),i.set("text",18),i.set("color",19),i.set("file",20),i.set("reference",21),i.set("customcolor",22),i.set("folder",23),i.set("type-parameter",24),i.set("typeParameter",24),i.set("account",25),i.set("issue",26),e.fromString=function(e,t){let n=i.get(e);return void 0!==n||t||(n=9),n}}(gC||(gC={})),function(e){e[e.Automatic=0]="Automatic",e[e.Explicit=1]="Explicit"}(pC||(pC={}));class yC{constructor(e,t,i,n){this.range=e,this.text=t,this.completionKind=i,this.isSnippetText=n}equals(e){return Rh.lift(this.range).equalsRange(e.range)&&this.text===e.text&&this.completionKind===e.completionKind&&this.isSnippetText===e.isSnippetText}}!function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(mC||(mC={})),function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}(fC||(fC={}));const SC={17:ue(0,"array"),16:ue(0,"boolean"),4:ue(0,"class"),13:ue(0,"constant"),8:ue(0,"constructor"),9:ue(0,"enumeration"),21:ue(0,"enumeration member"),23:ue(0,"event"),7:ue(0,"field"),0:ue(0,"file"),11:ue(0,"function"),10:ue(0,"interface"),19:ue(0,"key"),5:ue(0,"method"),1:ue(0,"module"),2:ue(0,"namespace"),20:ue(0,"null"),15:ue(0,"number"),18:ue(0,"object"),24:ue(0,"operator"),3:ue(0,"package"),6:ue(0,"property"),14:ue(0,"string"),22:ue(0,"struct"),25:ue(0,"type parameter"),12:ue(0,"variable")};var LC,kC,DC;!function(e){const t=new Map;t.set(0,Jr.symbolFile),t.set(1,Jr.symbolModule),t.set(2,Jr.symbolNamespace),t.set(3,Jr.symbolPackage),t.set(4,Jr.symbolClass),t.set(5,Jr.symbolMethod),t.set(6,Jr.symbolProperty),t.set(7,Jr.symbolField),t.set(8,Jr.symbolConstructor),t.set(9,Jr.symbolEnum),t.set(10,Jr.symbolInterface),t.set(11,Jr.symbolFunction),t.set(12,Jr.symbolVariable),t.set(13,Jr.symbolConstant),t.set(14,Jr.symbolString),t.set(15,Jr.symbolNumber),t.set(16,Jr.symbolBoolean),t.set(17,Jr.symbolArray),t.set(18,Jr.symbolObject),t.set(19,Jr.symbolKey),t.set(20,Jr.symbolNull),t.set(21,Jr.symbolEnumMember),t.set(22,Jr.symbolStruct),t.set(23,Jr.symbolEvent),t.set(24,Jr.symbolOperator),t.set(25,Jr.symbolTypeParameter),e.toIcon=function(e){let i=t.get(e);return i||(console.info("No codicon found for SymbolKind "+e),i=Jr.symbolProperty),i}}(LC||(LC={}));class xC{static fromValue(e){switch(e){case"comment":return xC.Comment;case"imports":return xC.Imports;case"region":return xC.Region}return new xC(e)}constructor(e){this.value=e}}xC.Comment=new xC("comment"),xC.Imports=new xC("imports"),xC.Region=new xC("region"),function(e){e.is=function(e){return!(!e||"object"!=typeof e)&&("string"==typeof e.id&&"string"==typeof e.title)}}(kC||(kC={})),function(e){e[e.Type=1]="Type",e[e.Parameter=2]="Parameter"}(DC||(DC={}));class NC{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 EC=new class{constructor(){this._tokenizationSupports=new Map,this._factories=new Map,this._onDidChange=new U,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]),x((()=>{this._tokenizationSupports.get(e)===t&&(this._tokenizationSupports.delete(e),this.handleChange([e]))}))}get(e){return this._tokenizationSupports.get(e)||null}registerFactory(e,t){var i;null===(i=this._factories.get(e))||void 0===i||i.dispose();const n=new vC(this,e,t);return this._factories.set(e,n),x((()=>{const t=this._factories.get(e);t&&t===n&&(this._factories.delete(e),t.dispose())}))}getOrCreate(e){return _C(this,void 0,void 0,(function*(){const t=this.get(e);if(t)return t;const i=this._factories.get(e);return!i||i.isResolved?null:(yield i.resolve(),this.get(e))}))}isResolved(e){if(this.get(e))return!0;const t=this._factories.get(e);return!(t&&!t.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>2?this._colorMap[2]:null}},IC=new class{clone(){return this}equals(e){return this===e}};function MC(e,t){return new CC([new bC(0,"",e)],t)}function TC(e,t){const i=new Uint32Array(2);return i[0]=0,i[1]=(32768|e|2<<24)>>>0,new wC(i,null===t?IC:t)}class RC{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(0===t)return void this.insert(e,i);if(0===i)return void this.delete(e,t);const n=this._store.slice(0,e),s=this._store.slice(e+t),o=function(e,t){const i=[];for(let n=0;n=this._store.length||this._store.splice(e,t)}insert(e,t){if(0===t||e>=this._store.length)return;const i=[];for(let n=0;n0){const i=this._tokens[this._tokens.length-1];if(i.endLineNumber+1===e)return void i.appendLineTokens(t)}this._tokens.push(new AC(e,[t]))}finalize(){return this._tokens}}class PC{static createEmpty(e,t){const i=PC.defaultTokenMetadata,n=new Uint32Array(2);return n[0]=e.length,n[1]=i,new PC(n,e,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 PC&&this.slicedEquals(e,0,this._tokensCount)}slicedEquals(e,t,i){if(this._text!==e._text)return!1;if(this._tokensCount!==e._tokensCount)return!1;const n=t<<1,s=n+(i<<1);for(let o=n;o0?this._tokens[e-1<<1]:0}getMetadata(e){return this._tokens[1+(e<<1)]}getLanguageId(e){const t=this._tokens[1+(e<<1)],i=Gg.getLanguageId(t);return this._languageIdCodec.decodeLanguageId(i)}getStandardTokenType(e){const t=this._tokens[1+(e<<1)];return Gg.getTokenType(t)}getForeground(e){const t=this._tokens[1+(e<<1)];return Gg.getForeground(t)}getClassName(e){const t=this._tokens[1+(e<<1)];return Gg.getClassNameFromMetadata(t)}getInlineStyle(e,t){const i=this._tokens[1+(e<<1)];return Gg.getInlineStyleFromMetadata(i,t)}getPresentation(e){const t=this._tokens[1+(e<<1)];return Gg.getPresentationFromMetadata(t)}getEndOffset(e){return this._tokens[e<<1]}findTokenIndexAtOffset(e){return PC.findIndexInTokensArray(this._tokens,e)}inflate(){return this}sliceAndInflate(e,t,i){return new FC(this,e,t,i)}static convertToEndOffset(e,t){const i=(e.length>>>1)-1;for(let n=0;n>>1)-1;for(;it&&(n=s)}return i}withInserted(e){if(0===e.length)return this;let t=0,i=0,n="";const s=new Array;let o=0;for(;;){const r=to){n+=this._text.substring(o,a.offset);const e=this._tokens[1+(t<<1)];s.push(n.length,e),o=a.offset}n+=a.text,s.push(n.length,a.tokenMetadata),i++}}return new PC(new Uint32Array(s),n,this._languageIdCodec)}}PC.defaultTokenMetadata=33587200;class FC{constructor(e,t,i,n){this._source=e,this._startOffset=t,this._endOffset=i,this._deltaOffset=n,this._firstTokenIndex=e.findTokenIndexAtOffset(t),this._tokensCount=0;for(let s=this._firstTokenIndex,o=e.getCount();s=i)break;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 FC&&(this._startOffset===e._startOffset&&this._endOffset===e._endOffset&&this._deltaOffset===e._deltaOffset&&this._source.slicedEquals(e._source,this._firstTokenIndex,this._tokensCount))}getCount(){return this._tokensCount}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}}class BC{constructor(e,t){this.tokenizationSupport=t,this.initialState=this.tokenizationSupport.getInitialState(),this.store=new VC(e)}getStartState(e){return this.store.getStartState(e,this.initialState)}getFirstInvalidLine(){return this.store.getFirstInvalidLine(this.initialState)}}class WC extends BC{constructor(e,t,i,n){super(e,t),this._textModel=i,this._languageIdCodec=n}updateTokensUntilLine(e,t){const i=this._textModel.getLanguageId();for(;;){const n=this.getFirstInvalidLine();if(!n||n.lineNumber>t)break;const s=this._textModel.getLineContent(n.lineNumber),o=UC(this._languageIdCodec,i,this.tokenizationSupport,s,!0,n.startState);e.add(n.lineNumber,o.tokens),this.store.setEndState(n.lineNumber,o.endState)}}getTokenTypeIfInsertingCharacter(e,t){const i=this.getStartState(e.lineNumber);if(!i)return 0;const n=this._textModel.getLanguageId(),s=this._textModel.getLineContent(e.lineNumber),o=s.substring(0,e.column-1)+t+s.substring(e.column-1),r=UC(this._languageIdCodec,n,this.tokenizationSupport,o,!0,i),a=new PC(r.tokens,o,this._languageIdCodec);if(0===a.getCount())return 0;const l=a.findTokenIndexAtOffset(e.column-1);return a.getStandardTokenType(l)}tokenizeLineWithEdit(e,t,i){const n=e.lineNumber,s=e.column,o=this.getStartState(n);if(!o)return null;const r=this._textModel.getLineContent(n),a=r.substring(0,s-1)+i+r.substring(s-1+t),l=this._textModel.getLanguageIdAtPosition(n,0),h=UC(this._languageIdCodec,l,this.tokenizationSupport,a,!0,o);return new PC(h.tokens,a,this._languageIdCodec)}isCheapToTokenize(e){const t=this.store.getFirstInvalidEndStateLineNumberOrMax();return e1&&r>=1;r--){const e=this._textModel.getLineFirstNonWhitespaceColumn(r);if(0!==e&&(e0&&i>0&&(i--,t--),this._lineEndStates.replace(e.startLineNumber,i,t)}}class zC{constructor(){this._ranges=[]}get min(){return 0===this._ranges.length?null:this._ranges[0].start}delete(e){const t=this._ranges.findIndex((t=>t.contains(e)));if(-1!==t){const i=this._ranges[t];i.start===e?i.endExclusive===e+1?this._ranges.splice(t,1):this._ranges[t]=new uc(e+1,i.endExclusive):i.endExclusive===e+1?this._ranges[t]=new uc(i.start,e):this._ranges.splice(t,1,new uc(i.start,e),new uc(e+1,i.endExclusive))}}addRange(e){uc.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 UC(e,t,i,n,s,o){let a=null;if(i)try{a=i.tokenizeEncoded(n,s,o.clone())}catch(Mre){r(Mre)}return a||(a=TC(e.encodeLanguageId(t),o)),PC.convertToEndOffset(a.tokens,n.length),a}class KC{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,ad((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)break;if(this._tokenizeOneInvalidLine(t)>=e)break}while(this._hasLinesToTokenize());this._backgroundTokenStore.setTokens(t.finalize()),this.checkFinished()}_hasLinesToTokenize(){return!!this._tokenizerWithStateStore&&!this._tokenizerWithStateStore.store.allStatesValid()}_tokenizeOneInvalidLine(e){var t;const i=null===(t=this._tokenizerWithStateStore)||void 0===t?void 0:t.getFirstInvalidLine();return i?(this._tokenizerWithStateStore.updateTokensUntilLine(e,i.lineNumber),i.lineNumber):this._tokenizerWithStateStore._textModel.getLineCount()+1}checkFinished(){this._isDisposed||this._tokenizerWithStateStore.store.allStatesValid()&&this._backgroundTokenStore.backgroundTokenizationFinished()}requestTokens(e,t){this._tokenizerWithStateStore.store.invalidateEndStateRange(new wc(e,t))}}const jC=new Uint32Array(0).buffer;class qC{static deleteBeginning(e,t){return null===e||e===jC?e:qC.delete(e,0,t)}static deleteEnding(e,t){if(null===e||e===jC)return e;const i=$C(e),n=i[i.length-2];return qC.delete(e,t,n)}static delete(e,t,i){if(null===e||e===jC||t===i)return e;const n=$C(e),s=n.length>>>1;if(0===t&&n[n.length-2]===i)return jC;const o=PC.findIndexInTokensArray(n,t),r=o>0?n[o-1<<1]:0;if(il&&(n[a++]=e,n[a++]=n[1+(c<<1)],l=e)}if(a===n.length)return e;const d=new Uint32Array(a);return d.set(n.subarray(0,a),0),d.buffer}static append(e,t){if(t===jC)return e;if(e===jC)return t;if(null===e)return e;if(null===t)return null;const i=$C(e),n=$C(t),s=n.length>>>1,o=new Uint32Array(i.length+n.length);o.set(i,0);let r=i.length;const a=i[i.length-2];for(let l=0;l>>1;let o=PC.findIndexInTokensArray(n,t);if(o>0){n[o-1<<1]===t&&o--}for(let r=o;r0}getTokens(e,t,i){let n=null;if(t1&&(t=Gg.getLanguageId(n[1])!==e),!t)return jC}if(!n||0===n.length){const i=new Uint32Array(2);return i[0]=t,i[1]=ZC(e),i.buffer}return n[n.length-2]=t,0===n.byteOffset&&n.byteLength===n.buffer.byteLength?n.buffer:n}_ensureLine(e){for(;e>=this._len;)this._lineTokens[this._len]=null,this._len++}_deleteLines(e,t){0!==t&&(e+t>this._len&&(t=this._len-e),this._lineTokens.splice(e,t),this._len-=t)}_insertLines(e,t){if(0===t)return;const i=[];for(let n=0;n=this._len)return;if(e.startLineNumber===e.endLineNumber){if(e.startColumn===e.endColumn)return;return void(this._lineTokens[t]=qC.delete(this._lineTokens[t],e.startColumn-1,e.endColumn-1))}this._lineTokens[t]=qC.deleteEnding(this._lineTokens[t],e.startColumn-1);const i=e.endLineNumber-1;let n=null;i=this._len||(0!==t?(this._lineTokens[n]=qC.deleteEnding(this._lineTokens[n],e.column-1),this._lineTokens[n]=qC.insert(this._lineTokens[n],e.column-1,i),this._insertLines(e.lineNumber,t)):this._lineTokens[n]=qC.insert(this._lineTokens[n],e.column-1,i))}setMultilineTokens(e,t){if(0===e.length)return{changes:[]};const i=[];for(let n=0,s=e.length;n>>0}class YC{constructor(e){this._pieces=[],this._isComplete=!1,this._languageIdCodec=e}flush(){this._pieces=[],this._isComplete=!1}isEmpty(){return 0===this._pieces.length}set(e,t){this._pieces=e||[],this._isComplete=t}setPartial(e,t){let i=e;if(t.length>0){const n=t[0].getRange(),s=t[t.length-1].getRange();if(!n||!s)return e;i=e.plusRange(n).plusRange(s)}let n=null;for(let s=0,o=this._pieces.length;si.endLineNumber){n=n||{index:s};break}if(e.removeTokens(i),e.isEmpty()){this._pieces.splice(s,1),s--,o--;continue}if(e.endLineNumberi.endLineNumber){n=n||{index:s};continue}const[t,r]=e.split(i);t.isEmpty()?n=n||{index:s}:r.isEmpty()||(this._pieces.splice(s,1,t,r),s++,o++,n=n||{index:s})}return n=n||{index:this._pieces.length},t.length>0&&(this._pieces=jd(this._pieces,n.index,t)),i}isComplete(){return this._isComplete}addSparseTokens(e,t){if(0===t.getLineContent().length)return t;const i=this._pieces;if(0===i.length)return t;const n=i[YC._findFirstPieceWithLine(i,e)].getLineTokens(e);if(!n)return t;const s=t.getCount(),o=n.getCount();let r=0;const a=[];let l=0,h=0;const d=(e,t)=>{e!==h&&(h=e,a[l++]=e,a[l++]=t)};for(let c=0;c>>0,l=~a>>>0;for(;rt)){for(;s>i&&e[s-1].startLineNumber<=t&&t<=e[s-1].endLineNumber;)s--;return s}n=s-1}}return i}acceptEdit(e,t,i,n,s){for(const o of this._pieces)o.acceptEdit(e,t,i,n,s)}}class XC extends Yv{constructor(e,t,i,n,s,o){super(),this._languageService=e,this._languageConfigurationService=t,this._textModel=i,this._bracketPairsTextModelPart=n,this._languageId=s,this._attachedViews=o,this._semanticTokens=new YC(this._languageService.languageIdCodec),this._onDidChangeLanguage=this._register(new U),this.onDidChangeLanguage=this._onDidChangeLanguage.event,this._onDidChangeLanguageConfiguration=this._register(new U),this.onDidChangeLanguageConfiguration=this._onDidChangeLanguageConfiguration.event,this._onDidChangeTokens=this._register(new U),this.onDidChangeTokens=this._onDidChangeTokens.event,this.grammarTokens=this._register(new QC(this._languageService.languageIdCodec,this._textModel,(()=>this._languageId),this._attachedViews)),this._register(this._languageConfigurationService.onDidChange((e=>{e.affects(this._languageId)&&this._onDidChangeLanguageConfiguration.fire({})}))),this._register(this.grammarTokens.onDidChangeTokens((e=>{this._emitModelTokensChangedEvent(e)}))),this._register(this.grammarTokens.onDidChangeBackgroundTokenizationState((e=>{this._bracketPairsTextModelPart.handleDidChangeBackgroundTokenizationState()})))}handleDidChangeContent(e){if(e.isFlush)this._semanticTokens.flush();else if(!e.isEolChange)for(const t of e.changes){const[e,i,n]=hc(t.text);this._semanticTokens.acceptEdit(t.range,e,i,n,t.text.length>0?t.text.charCodeAt(0):0)}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 f("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)}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:null!==e,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),s=n.findTokenIndexAtOffset(t.column-1),[o,r]=XC._findLanguageBoundaries(n,s),a=Ec(t.column,this.getLanguageConfiguration(n.getLanguageId(s)).getWordDefinition(),i.substring(o,r),o);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a;if(s>0&&o===t.column-1){const[o,r]=XC._findLanguageBoundaries(n,s-1),a=Ec(t.column,this.getLanguageConfiguration(n.getLanguageId(s-1)).getWordDefinition(),i.substring(o,r),o);if(a&&a.startColumn<=e.column&&e.column<=a.endColumn)return a}return null}getLanguageConfiguration(e){return this._languageConfigurationService.getLanguageConfiguration(e)}static _findLanguageBoundaries(e,t){const i=e.getLanguageId(t);let n=0;for(let o=t;o>=0&&e.getLanguageId(o)===i;o--)n=e.getStartOffset(o);let s=e.getLineContent().length;for(let o=t,r=e.getCount();o{const t=this.getLanguageId();-1!==e.changedLanguages.indexOf(t)&&this.resetTokenization()}))),this.resetTokenization(),this._register(n.onDidChangeVisibleRanges((({view:e,state:t})=>{if(t){let i=this._attachedViewStates.get(e);i||(i=new JC((()=>this.refreshRanges(i.lineRanges))),this._attachedViewStates.set(e,i)),i.handleStateChange(t)}else this._attachedViewStates.deleteAndDispose(e)})))}resetTokenization(e=!0){var t;this._tokens.flush(),null===(t=this._debugBackgroundTokens)||void 0===t||t.flush(),this._debugBackgroundStates&&(this._debugBackgroundStates=new VC(this._textModel.getLineCount())),e&&this._onDidChangeTokens.fire({semanticTokensApplied:!1,ranges:[{fromLineNumber:1,toLineNumber:this._textModel.getLineCount()}]});const[i,n]=(()=>{if(this._textModel.isTooLargeForTokenization())return[null,null];const e=EC.get(this.getLanguageId());if(!e)return[null,null];let t;try{t=e.getInitialState()}catch(Mre){return r(Mre),[null,null]}return[e,t]})();if(this._tokenizer=i&&n?new WC(this._textModel.getLineCount(),i,this._textModel,this._languageIdCodec):null,this._backgroundTokenizer.clear(),this._defaultBackgroundTokenizer=null,this._tokenizer){const e={setTokens:e=>{this.setTokens(e)},backgroundTokenizationFinished:()=>{if(2===this._backgroundTokenizationState)return;this._backgroundTokenizationState=2,this._onDidChangeBackgroundTokenizationState.fire()},setEndState:(e,t)=>{var i;if(!this._tokenizer)return;const n=this._tokenizer.store.getFirstInvalidEndStateLineNumber();null!==n&&e>=n&&(null===(i=this._tokenizer)||void 0===i||i.store.setEndState(e,t))}};i&&i.createBackgroundTokenizer&&!i.backgroundTokenizerShouldOnlyVerifyTokens&&(this._backgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,e)),this._backgroundTokenizer.value||(this._backgroundTokenizer.value=this._defaultBackgroundTokenizer=new KC(this._tokenizer,e),this._defaultBackgroundTokenizer.handleChanges()),(null==i?void 0:i.backgroundTokenizerShouldOnlyVerifyTokens)&&i.createBackgroundTokenizer?(this._debugBackgroundTokens=new GC(this._languageIdCodec),this._debugBackgroundStates=new VC(this._textModel.getLineCount()),this._debugBackgroundTokenizer.clear(),this._debugBackgroundTokenizer.value=i.createBackgroundTokenizer(this._textModel,{setTokens:e=>{var t;null===(t=this._debugBackgroundTokens)||void 0===t||t.setMultilineTokens(e,this._textModel)},backgroundTokenizationFinished(){},setEndState:(e,t)=>{var i;null===(i=this._debugBackgroundStates)||void 0===i||i.setEndState(e,t)}})):(this._debugBackgroundTokens=void 0,this._debugBackgroundStates=void 0,this._debugBackgroundTokenizer.value=void 0)}this.refreshAllVisibleLineTokens()}handleDidChangeAttached(){var e;null===(e=this._defaultBackgroundTokenizer)||void 0===e||e.handleChanges()}handleDidChangeContent(e){var t,i,n;if(e.isFlush)this.resetTokenization(!1);else if(!e.isEolChange){for(const i of e.changes){const[e,n]=hc(i.text);this._tokens.acceptEdit(i.range,e,n),null===(t=this._debugBackgroundTokens)||void 0===t||t.acceptEdit(i.range,e,n)}null===(i=this._debugBackgroundStates)||void 0===i||i.acceptChanges(e.changes),this._tokenizer&&this._tokenizer.store.acceptChanges(e.changes),null===(n=this._defaultBackgroundTokenizer)||void 0===n||n.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=wc.joinMany([...this._attachedViewStates].map((([e,t])=>t.lineRanges)));this.refreshRanges(e)}refreshRanges(e){for(const t of e)this.refreshRange(t.startLineNumber,t.endLineNumberExclusive-1)}refreshRange(e,t){var i,n;if(!this._tokenizer)return;e=Math.max(1,Math.min(this._textModel.getLineCount(),e)),t=Math.min(this._textModel.getLineCount(),t);const s=new OC,{heuristicTokens:o}=this._tokenizer.tokenizeHeuristically(s,e,t),r=this.setTokens(s.finalize());if(o)for(const a of r.changes)null===(i=this._backgroundTokenizer.value)||void 0===i||i.requestTokens(a.fromLineNumber,a.toLineNumber+1);null===(n=this._defaultBackgroundTokenizer)||void 0===n||n.checkFinished()}forceTokenization(e){var t,i;const n=new OC;null===(t=this._tokenizer)||void 0===t||t.updateTokensUntilLine(n,e),this.setTokens(n.finalize()),null===(i=this._defaultBackgroundTokenizer)||void 0===i||i.checkFinished()}isCheapToTokenize(e){return!this._tokenizer||this._tokenizer.isCheapToTokenize(e)}tokenizeIfCheap(e){this.isCheapToTokenize(e)&&this.forceTokenization(e)}getLineTokens(e){var t;const i=this._textModel.getLineContent(e),n=this._tokens.getTokens(this._textModel.getLanguageId(),e-1,i);if(this._debugBackgroundTokens&&this._debugBackgroundStates&&this._tokenizer&&this._debugBackgroundStates.getFirstInvalidEndStateLineNumberOrMax()>e&&this._tokenizer.store.getFirstInvalidEndStateLineNumberOrMax()>e){const s=this._debugBackgroundTokens.getTokens(this._textModel.getLanguageId(),e-1,i);!n.equals(s)&&(null===(t=this._debugBackgroundTokenizer.value)||void 0===t?void 0:t.reportMismatchingTokens)&&this._debugBackgroundTokenizer.value.reportMismatchingTokens(e)}return n}getTokenTypeIfInsertingCharacter(e,t,i){if(!this._tokenizer)return 0;const n=this._textModel.validatePosition(new Va(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 JC extends E{get lineRanges(){return this._lineRanges}constructor(e){super(),this._refreshTokens=e,this.runner=this._register(new rd((()=>this.update()),50)),this._computedLineRanges=[],this._lineRanges=[]}update(){Td(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()}}class ew{constructor(){this.changeType=1}}class tw{static applyInjectedText(e,t){if(!t||0===t.length)return e;let i="",n=0;for(const s of t)i+=e.substring(n,s.column-1),n=s.column-1,i+=s.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 tw(i.ownerId,i.range.startLineNumber,i.range.startColumn,i.options.before,0)),i.options.after&&i.options.after.content.length>0&&t.push(new tw(i.ownerId,i.range.endLineNumber,i.range.endColumn,i.options.after,1));return t.sort(((e,t)=>e.lineNumber===t.lineNumber?e.column===t.column?e.order-t.order:e.column-t.column:e.lineNumber-t.lineNumber)),t}constructor(e,t,i,n,s){this.ownerId=e,this.lineNumber=t,this.column=i,this.options=n,this.order=s}}class iw{constructor(e,t,i){this.changeType=2,this.lineNumber=e,this.detail=t,this.injectedText=i}}class nw{constructor(e,t){this.changeType=3,this.fromLineNumber=e,this.toLineNumber=t}}class sw{constructor(e,t,i,n){this.changeType=4,this.injectedTexts=n,this.fromLineNumber=e,this.toLineNumber=t,this.detail=i}}class ow{constructor(){this.changeType=5}}class rw{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;t=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},mw=function(e,t){return function(i,n){t(i,n,e)}};function fw(e,t){let i;var n;return"string"==typeof e?i=function(e){const t=new uC;return t.acceptChunk(e),t.finish()}(e):i=(n=e)&&"function"==typeof n.read?function(e){const t=new uC;let i;for(;"string"==typeof(i=e.read());)t.acceptChunk(i);return t.finish()}(e):e,i.create(t)}let _w=0;class vw{constructor(e){this._source=e,this._eos=!1}read(){if(this._eos)return null;const e=[];let t=0,i=0;for(;;){const n=this._source.read();if(null===n)return this._eos=!0,0===t?null:e.join("");if(n.length>0&&(e[t++]=n,i+=n.length),i>=65536)return e.join("")}}}const bw=()=>{throw new Error("Invalid change accessor")};let Cw=gw=class extends E{static resolveOptions(e,t){if(t.detectIndentation){const i=ob(e,t.tabSize,t.insertSpaces);return new kd({tabSize:i.tabSize,indentSize:"tabSize",insertSpaces:i.insertSpaces,trimAutoWhitespace:t.trimAutoWhitespace,defaultEOL:t.defaultEOL,bracketPairColorizationOptions:t.bracketPairColorizationOptions})}return new kd(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 D(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,s,o,r){super(),this._undoRedoService=s,this._languageService=o,this._languageConfigurationService=r,this._onWillDispose=this._register(new U),this.onWillDispose=this._onWillDispose.event,this._onDidChangeDecorations=this._register(new Rw((e=>this.handleBeforeFireDecorationsChangedEvent(e)))),this.onDidChangeDecorations=this._onDidChangeDecorations.event,this._onDidChangeOptions=this._register(new U),this.onDidChangeOptions=this._onDidChangeOptions.event,this._onDidChangeAttached=this._register(new U),this.onDidChangeAttached=this._onDidChangeAttached.event,this._onDidChangeInjectedText=this._register(new U),this._eventEmitter=this._register(new Aw),this._languageSelectionListener=this._register(new I),this._deltaDecorationCallCnt=0,this._attachedViews=new Ow,_w++,this.id="$model"+_w,this.isForSimpleWidget=i.isForSimpleWidget,this._associatedResource=null==n?an.parse("inmemory://model/"+_w):n,this._attachedEditorCount=0;const{textBuffer:a,disposable:l}=fw(e,i.defaultEOL);this._buffer=a,this._bufferDisposable=l,this._options=gw.resolveOptions(this._buffer,i);const h="string"==typeof t?t:t.languageId;"string"!=typeof t&&(this._languageSelectionListener.value=t.onDidChange((()=>this._setLanguage(t.languageId)))),this._bracketPairs=this._register(new vp(this,this._languageConfigurationService)),this._guidesTextModelPart=this._register(new tb(this,this._languageConfigurationService)),this._decorationProvider=this._register(new Bv(this)),this._tokenizationTextModelPart=new XC(this._languageService,this._languageConfigurationService,this,this._bracketPairs,h,this._attachedViews);const d=this._buffer.getLineCount(),c=this._buffer.getValueLengthInRange(new Rh(1,1,d,this._buffer.getLineLength(d)+1),0);i.largeFileOptimizations?(this._isTooLargeForTokenization=c>gw.LARGE_FILE_SIZE_THRESHOLD||d>gw.LARGE_FILE_LINE_COUNT_THRESHOLD,this._isTooLargeForHeapOperation=c>gw.LARGE_FILE_HEAP_OPERATION_THRESHOLD):(this._isTooLargeForTokenization=!1,this._isTooLargeForHeapOperation=!1),this._isTooLargeForSyncing=c>gw._MODEL_SYNC_LIMIT,this._versionId=1,this._alternativeVersionId=1,this._initialUndoRedoSnapshot=null,this._isDisposed=!1,this.__isDisposing=!1,this._instanceId=Wo(_w),this._lastDecorationId=0,this._decorations=Object.create(null),this._decorationsTree=new Sw,this._commandManager=new Zv(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(h)}dispose(){this.__isDisposing=!0,this._onWillDispose.fire(),this._tokenizationTextModelPart.dispose(),this._isDisposed=!0,super.dispose(),this._bufferDisposable.dispose(),this.__isDisposing=!1;const e=new dC([],"","\n",!1,!1,!0,!0);e.dispose(),this._buffer=e,this._bufferDisposable=E.None}_assertNotDisposed(){if(this._isDisposed)throw new Error("Model is disposed!")}_emitContentChangedEvent(e,t){this.__isDisposing||(this._tokenizationTextModelPart.handleDidChangeContent(t),this._bracketPairs.handleDidChangeContent(t),this._eventEmitter.fire(new lw(e,t)))}setValue(e){if(this._assertNotDisposed(),null==e)throw u();const{textBuffer:t,disposable:i}=fw(e,this._options.defaultEOL);this._setValueFromTextBuffer(t,i)}_createContentChanged2(e,t,i,n,s,o,r,a){return{changes:[{range:e,rangeOffset:t,rangeLength:i,text:n}],eol:this._buffer.getEOL(),isEolChange:a,versionId:this.getVersionId(),isUndoing:s,isRedoing:o,isFlush:r}}_setValueFromTextBuffer(e,t){this._assertNotDisposed();const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),s=this.getLineCount(),o=this.getLineMaxColumn(s);this._buffer=e,this._bufferDisposable.dispose(),this._bufferDisposable=t,this._increaseVersionId(),this._decorations=Object.create(null),this._decorationsTree=new Sw,this._commandManager.clear(),this._trimAutoWhitespaceLines=null,this._emitContentChangedEvent(new rw([new ew],this._versionId,!1,!1),this._createContentChanged2(new Rh(1,1,s,o),0,n,this.getValue(),!1,!1,!0,!1))}setEOL(e){this._assertNotDisposed();const t=1===e?"\r\n":"\n";if(this._buffer.getEOL()===t)return;const i=this.getFullModelRange(),n=this.getValueLengthInRange(i),s=this.getLineCount(),o=this.getLineMaxColumn(s);this._onBeforeEOLChange(),this._buffer.setEOL(t),this._increaseVersionId(),this._onAfterEOLChange(),this._emitContentChangedEvent(new rw([new ow],this._versionId,!1,!1),this._createContentChanged2(new Rh(1,1,s,o),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 i=this._buffer.getLineLength(n);i>=1e4?t+=i:e+=i}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=void 0!==e.tabSize?e.tabSize:this._options.tabSize,i=void 0!==e.indentSize?e.indentSize:this._options.originalIndentSize,n=void 0!==e.insertSpaces?e.insertSpaces:this._options.insertSpaces,s=void 0!==e.trimAutoWhitespace?e.trimAutoWhitespace:this._options.trimAutoWhitespace,o=void 0!==e.bracketColorizationOptions?e.bracketColorizationOptions:this._options.bracketPairColorizationOptions,r=new kd({tabSize:t,indentSize:i,insertSpaces:n,defaultEOL:this._options.defaultEOL,trimAutoWhitespace:s,bracketPairColorizationOptions:o});if(this._options.equals(r))return;const a=this._options.createChangeEvent(r);this._options=r,this._bracketPairs.handleDidChangeOptions(a),this._decorationProvider.handleDidChangeOptions(a),this._onDidChangeOptions.fire(a)}detectIndentation(e,t){this._assertNotDisposed();const i=ob(this._buffer,t,e);this.updateOptions({insertSpaces:i.insertSpaces,tabSize:i.tabSize,indentSize:i.tabSize})}normalizeIndentation(e){return this._assertNotDisposed(),cc(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(Ro.source,!1,!0,!1,null,!1,1073741824);this._buffer.resetMightContainUnusualLineTerminators(),this.pushEditOperations(e,t.map((e=>({range:e.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,0);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 f("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 vw(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=0){return this._assertNotDisposed(),this._buffer.getValueInRange(this.validateRange(e),t)}getValueLengthInRange(e,t=0){return this._assertNotDisposed(),this._buffer.getValueLengthInRange(this.validateRange(e),t)}getCharacterCountInRange(e,t=0){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 f("Illegal value for lineNumber");return this._buffer.getLineContent(e)}getLineLength(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new f("Illegal value for lineNumber");return this._buffer.getLineLength(e)}getLinesContent(){if(this._assertNotDisposed(),this.isTooLargeForHeapOperation())throw new f("Operation would exceed heap memory limits");return this._buffer.getLinesContent()}getEOL(){return this._assertNotDisposed(),this._buffer.getEOL()}getEndOfLineSequence(){return this._assertNotDisposed(),"\n"===this._buffer.getEOL()?0:1}getLineMinColumn(e){return this._assertNotDisposed(),1}getLineMaxColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new f("Illegal value for lineNumber");return this._buffer.getLineLength(e)+1}getLineFirstNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new f("Illegal value for lineNumber");return this._buffer.getLineFirstNonWhitespaceColumn(e)}getLineLastNonWhitespaceColumn(e){if(this._assertNotDisposed(),e<1||e>this.getLineCount())throw new f("Illegal value for lineNumber");return this._buffer.getLineLastNonWhitespaceColumn(e)}_validateRangeRelaxedNoAllocations(e){const t=this._buffer.getLineCount(),i=e.startLineNumber,n=e.startColumn;let s=Math.floor("number"!=typeof i||isNaN(i)?1:i),o=Math.floor("number"!=typeof n||isNaN(n)?1:n);if(s<1)s=1,o=1;else if(s>t)s=t,o=this.getLineMaxColumn(s);else if(o<=1)o=1;else{const e=this.getLineMaxColumn(s);o>=e&&(o=e)}const r=e.endLineNumber,a=e.endColumn;let l=Math.floor("number"!=typeof r||isNaN(r)?1:r),h=Math.floor("number"!=typeof a||isNaN(a)?1:a);if(l<1)l=1,h=1;else if(l>t)l=t,h=this.getLineMaxColumn(l);else if(h<=1)h=1;else{const e=this.getLineMaxColumn(l);h>=e&&(h=e)}return i===s&&n===o&&r===l&&a===h&&e instanceof Rh&&!(e instanceof Ah)?e:new Rh(s,o,l,h)}_isValidPosition(e,t,i){if("number"!=typeof e||"number"!=typeof t)return!1;if(isNaN(e)||isNaN(t))return!1;if(e<1||t<1)return!1;if((0|e)!==e||(0|t)!==t)return!1;if(e>this._buffer.getLineCount())return!1;if(1===t)return!0;if(t>this.getLineMaxColumn(e))return!1;if(1===i){if(wo(this._buffer.getLineCharCode(e,t-2)))return!1}return!0}_validatePosition(e,t,i){const n=Math.floor("number"!=typeof e||isNaN(e)?1:e),s=Math.floor("number"!=typeof t||isNaN(t)?1:t),o=this._buffer.getLineCount();if(n<1)return new Va(1,1);if(n>o)return new Va(o,this.getLineMaxColumn(o));if(s<=1)return new Va(n,1);const r=this.getLineMaxColumn(n);if(s>=r)return new Va(n,r);if(1===i){if(wo(this._buffer.getLineCharCode(n,s-2)))return new Va(n,s-1)}return new Va(n,s)}validatePosition(e){return this._assertNotDisposed(),e instanceof Va&&this._isValidPosition(e.lineNumber,e.column,1)?e:this._validatePosition(e.lineNumber,e.column,1)}_isValidRange(e,t){const i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,o=e.endColumn;if(!this._isValidPosition(i,n,0))return!1;if(!this._isValidPosition(s,o,0))return!1;if(1===t){const e=n>1?this._buffer.getLineCharCode(i,n-2):0,t=o>1&&o<=this._buffer.getLineLength(s)?this._buffer.getLineCharCode(s,o-2):0,r=wo(e),a=wo(t);return!r&&!a}return!0}validateRange(e){if(this._assertNotDisposed(),e instanceof Rh&&!(e instanceof Ah)&&this._isValidRange(e,1))return e;const t=this._validatePosition(e.startLineNumber,e.startColumn,0),i=this._validatePosition(e.endLineNumber,e.endColumn,0),n=t.lineNumber,s=t.column,o=i.lineNumber,r=i.column;{const e=s>1?this._buffer.getLineCharCode(n,s-2):0,t=r>1&&r<=this._buffer.getLineLength(o)?this._buffer.getLineCharCode(o,r-2):0,i=wo(e),a=wo(t);return i||a?n===o&&s===r?new Rh(n,s-1,o,r-1):i&&a?new Rh(n,s-1,o,r+1):i?new Rh(n,s-1,o,r):new Rh(n,s,o,r+1):new Rh(n,s,o,r)}}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 Rh(1,1,e,this.getLineMaxColumn(e))}findMatchesLineByLine(e,t,i,n){return this._buffer.findMatchesLineByLine(e,t,i,n)}findMatches(e,t,i,n,s,o,r=999){this._assertNotDisposed();let a=null;null!==t&&(Array.isArray(t)||(t=[t]),t.every((e=>Rh.isIRange(e)))&&(a=t.map((e=>this.validateRange(e))))),null===a&&(a=[this.getFullModelRange()]),a=a.sort(((e,t)=>e.startLineNumber-t.startLineNumber||e.startColumn-t.startColumn));const l=[];let h;if(l.push(a.reduce(((e,t)=>Rh.areIntersecting(e,t)?e.plusRange(t):(l.push(e),t)))),!i&&e.indexOf("\n")<0){const t=new Zb(e,i,n,s).parseSearchRequest();if(!t)return[];h=e=>this.findMatchesLineByLine(e,t,o,r)}else h=t=>Qb.findMatches(this,new Zb(e,i,n,s),t,o,r);return l.map(h).reduce(((e,t)=>e.concat(t)),[])}findNextMatch(e,t,i,n,s,o){this._assertNotDisposed();const r=this.validatePosition(t);if(!i&&e.indexOf("\n")<0){const t=new Zb(e,i,n,s).parseSearchRequest();if(!t)return null;const a=this.getLineCount();let l=new Rh(r.lineNumber,r.column,a,this.getLineMaxColumn(a)),h=this.findMatchesLineByLine(l,t,o,1);return Qb.findNextMatch(this,new Zb(e,i,n,s),r,o),h.length>0?h[0]:(l=new Rh(1,1,r.lineNumber,this.getLineMaxColumn(r.lineNumber)),h=this.findMatchesLineByLine(l,t,o,1),h.length>0?h[0]:null)}return Qb.findNextMatch(this,new Zb(e,i,n,s),r,o)}findPreviousMatch(e,t,i,n,s,o){this._assertNotDisposed();const r=this.validatePosition(t);return Qb.findPreviousMatch(this,new Zb(e,i,n,s),r,o)}pushStackElement(){this._commandManager.pushStackElement()}popStackElement(){this._commandManager.popStackElement()}pushEOL(e){if(("\n"===this.getEOL()?0:1)!==e)try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEOL(e)}finally{this._eventEmitter.endDeferredEmit(),this._onDidChangeDecorations.endDeferredEmit()}}_validateEditOperation(e){return e instanceof xd?e:new xd(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(e.range),text:e.text})));let n=!0;if(e)for(let t=0,s=e.length;ts.endLineNumber,r=s.startLineNumber>t.endLineNumber;if(!n&&!r){o=!0;break}}if(!o){n=!1;break}}if(n)for(let e=0,s=this._trimAutoWhitespaceLines.length;et.endLineNumber)&&!(n===t.startLineNumber&&t.startColumn===s&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(0)||n===t.startLineNumber&&1===t.startColumn&&t.isEmpty()&&r&&r.length>0&&"\n"===r.charAt(r.length-1))){o=!1;break}}if(o){const e=new Rh(n,1,n,s);t.push(new xd(null,e,null,!1,!1,!1))}}this._trimAutoWhitespaceLines=null}return null===this._initialUndoRedoSnapshot&&(this._initialUndoRedoSnapshot=this._undoRedoService.createSnapshot(this.uri)),this._commandManager.pushEditOperation(e,t,i,n)}_applyUndo(e,t,i,n){const s=e.map((e=>{const t=this.getPositionAt(e.newPosition),i=this.getPositionAt(e.newEnd);return{range:new Rh(t.lineNumber,t.column,i.lineNumber,i.column),text:e.oldText}}));this._applyUndoRedoEdits(s,t,!0,!1,i,n)}_applyRedo(e,t,i,n){const s=e.map((e=>{const t=this.getPositionAt(e.oldPosition),i=this.getPositionAt(e.oldEnd);return{range:new Rh(t.lineNumber,t.column,i.lineNumber,i.column),text:e.newText}}));this._applyUndoRedoEdits(s,t,!1,!0,i,n)}_applyUndoRedoEdits(e,t,i,n,s,o){try{this._onDidChangeDecorations.beginDeferredEmit(),this._eventEmitter.beginDeferredEmit(),this._isUndoing=i,this._isRedoing=n,this.applyEdits(e,!1),this.setEOL(t),this._overwriteAlternativeVersionId(s)}finally{this._isUndoing=!1,this._isRedoing=!1,this._eventEmitter.endDeferredEmit(o),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),s=this._buffer.getLineCount(),o=n.changes;if(this._trimAutoWhitespaceLines=n.trimAutoWhitespaceLineNumbers,0!==o.length){for(let i=0,n=o.length;i=0;t--){const i=a+t,n=g+t;v.takeFromEndWhile((e=>e.lineNumber>n));const s=v.takeFromEndWhile((e=>e.lineNumber===n));e.push(new iw(i,this.getLineContent(n),s))}if(ce.lineNumbere.lineNumber===t))}e.push(new sw(n+1,a+d,h,l))}t+=u}this._emitContentChangedEvent(new rw(e,this.getVersionId(),this._isUndoing,this._isRedoing),{changes:o,eol:this._buffer.getEOL(),isEolChange:!1,versionId:this.getVersionId(),isUndoing:this._isUndoing,isRedoing:this._isRedoing,isFlush:!1})}return null===n.reverseEdits?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(null===e||0===e.size)return;const t=Array.from(e).map((e=>new iw(e,this.getLineContent(e),this._getInjectedTextInLine(e))));this._onDidChangeInjectedText.fire(new aw(t))}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:(t,i)=>this._deltaDecorationsImpl(e,[],[{range:t,options:i}])[0],changeDecoration:(e,t)=>{this._changeDecorationImpl(e,t)},changeDecorationOptions:(e,t)=>{this._changeDecorationOptionsImpl(e,Tw(t))},removeDecoration:t=>{this._deltaDecorationsImpl(e,[t],[])},deltaDecorations:(t,i)=>0===t.length&&0===i.length?[]:this._deltaDecorationsImpl(e,t,i)};let n=null;try{n=t(i)}catch(Mre){r(Mre)}return i.addDecoration=bw,i.changeDecoration=bw,i.changeDecorationOptions=bw,i.removeDecoration=bw,i.deltaDecorations=bw,n}deltaDecorations(e,t,i=0){if(this._assertNotDisposed(),e||(e=[]),0===e.length&&0===t.length)return[];try{return this._deltaDecorationCallCnt++,this._deltaDecorationCallCnt>1&&(console.warn("Invoking deltaDecorations recursively could lead to leaking decorations."),r(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:Mw[i]}],!0)[0]:null;if(!t)return this._decorationsTree.delete(n),delete this._decorations[n.id],null;const s=this._validateRangeRelaxedNoAllocations(t),o=this._buffer.getOffsetAt(s.startLineNumber,s.startColumn),r=this._buffer.getOffsetAt(s.endLineNumber,s.endColumn);return this._decorationsTree.delete(n),n.reset(this.getVersionId(),o,r,s),n.setOptions(Mw[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,s=!1){const o=this.getLineCount(),r=Math.min(o,Math.max(1,e)),a=Math.min(o,Math.max(1,t)),l=this.getLineMaxColumn(a),h=new Rh(r,1,a,l),d=this._getDecorationsInRange(h,i,n,s);return Gd(d,this._decorationProvider.getDecorationsInRange(h,i,n)),d}getDecorationsInRange(e,t=0,i=!1,n=!1,s=!1){const o=this.validateRange(e),r=this._getDecorationsInRange(o,t,i,s);return Gd(r,this._decorationProvider.getDecorationsInRange(o,t,i,n)),r}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 tw.fromDecorations(n).filter((t=>t.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 s=this._buffer.getOffsetAt(e.startLineNumber,e.startColumn),o=this._buffer.getOffsetAt(e.endLineNumber,e.endColumn);return this._decorationsTree.getAllInInterval(this,s,o,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 t=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(t.endLineNumber)}if(i.options.before){const t=this.getDecorationRange(e);this._onDidChangeDecorations.recordLineAffectedByInjectedText(t.startLineNumber)}const n=this._validateRangeRelaxedNoAllocations(t),s=this._buffer.getOffsetAt(n.startLineNumber,n.startColumn),o=this._buffer.getOffsetAt(n.endLineNumber,n.endColumn);this._decorationsTree.delete(i),i.reset(this.getVersionId(),s,o,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),s=!(!t.overviewRuler||!t.overviewRuler.color);if(this._onDidChangeDecorations.checkAffectedAndFire(i.options),this._onDidChangeDecorations.checkAffectedAndFire(t),i.options.after||t.after){const e=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.endLineNumber)}if(i.options.before||t.before){const e=this._decorationsTree.getNodeRange(this,i);this._onDidChangeDecorations.recordLineAffectedByInjectedText(e.startLineNumber)}n!==s?(this._decorationsTree.delete(i),i.setOptions(t),this._decorationsTree.insert(i)):i.setOptions(t)}_deltaDecorationsImpl(e,t,i,n=!1){const s=this.getVersionId(),o=t.length;let r=0;const a=i.length;let l=0;this._onDidChangeDecorations.beginDeferredEmit();try{const h=new Array(a);for(;rthis._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 function(e){let t=0;for(const i of e){if(" "!==i&&"\t"!==i)break;t++}return t}(this.getLineContent(e))+1}};function ww(e){return!(!e.options.overviewRuler||!e.options.overviewRuler.color)}function yw(e){return!!e.options.after||!!e.options.before}Cw._MODEL_SYNC_LIMIT=52428800,Cw.LARGE_FILE_SIZE_THRESHOLD=20971520,Cw.LARGE_FILE_LINE_COUNT_THRESHOLD=3e5,Cw.LARGE_FILE_HEAP_OPERATION_THRESHOLD=268435456,Cw.DEFAULT_CREATION_OPTIONS={isForSimpleWidget:!1,tabSize:Sc.tabSize,indentSize:Sc.indentSize,insertSpaces:Sc.insertSpaces,detectIndentation:!1,defaultEOL:1,trimAutoWhitespace:Sc.trimAutoWhitespace,largeFileOptimizations:Sc.largeFileOptimizations,bracketPairColorizationOptions:Sc.bracketPairColorizationOptions},Cw=gw=pw([mw(4,hw),mw(5,Lc),mw(6,Ju)],Cw);class Sw{constructor(){this._decorationsTree0=new vb,this._decorationsTree1=new vb,this._injectedTextDecorationsTree=new vb}ensureAllNodesHaveRanges(e){this.getAll(e,0,!1,!1,!1)}_ensureNodesHaveRanges(e,t){for(const i of t)null===i.range&&(i.range=e.getRangeAt(i.cachedAbsoluteStart,i.cachedAbsoluteEnd));return t}getAllInInterval(e,t,i,n,s,o){const r=e.getVersionId(),a=this._intervalSearch(t,i,n,s,r,o);return this._ensureNodesHaveRanges(e,a)}_intervalSearch(e,t,i,n,s,o){const r=this._decorationsTree0.intervalSearch(e,t,i,n,s,o),a=this._decorationsTree1.intervalSearch(e,t,i,n,s,o),l=this._injectedTextDecorationsTree.intervalSearch(e,t,i,n,s,o);return r.concat(a).concat(l)}getInjectedTextInInterval(e,t,i,n){const s=e.getVersionId(),o=this._injectedTextDecorationsTree.intervalSearch(t,i,n,!1,s,!1);return this._ensureNodesHaveRanges(e,o).filter((e=>e.options.showIfCollapsed||!e.range.isEmpty()))}getAllInjectedText(e,t){const i=e.getVersionId(),n=this._injectedTextDecorationsTree.search(t,!1,i,!1);return this._ensureNodesHaveRanges(e,n).filter((e=>e.options.showIfCollapsed||!e.range.isEmpty()))}getAll(e,t,i,n,s){const o=e.getVersionId(),r=this._search(t,i,n,o,s);return this._ensureNodesHaveRanges(e,r)}_search(e,t,i,n,s){if(i)return this._decorationsTree1.search(e,t,n,s);{const i=this._decorationsTree0.search(e,t,n,s),o=this._decorationsTree1.search(e,t,n,s),r=this._injectedTextDecorationsTree.search(e,t,n,s);return i.concat(o).concat(r)}}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){yw(e)?this._injectedTextDecorationsTree.insert(e):ww(e)?this._decorationsTree1.insert(e):this._decorationsTree0.insert(e)}delete(e){yw(e)?this._injectedTextDecorationsTree.delete(e):ww(e)?this._decorationsTree1.delete(e):this._decorationsTree0.delete(e)}getNodeRange(e,t){const i=e.getVersionId();return t.cachedVersionId!==i&&this._resolveNode(t,i),null===t.range&&(t.range=e.getRangeAt(t.cachedAbsoluteStart,t.cachedAbsoluteEnd)),t.range}_resolveNode(e,t){yw(e)?this._injectedTextDecorationsTree.resolveNode(e,t):ww(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 Lw(e){return e.replace(/[^a-z0-9\-_]/gi," ")}class kw{constructor(e){this.color=e.color||"",this.darkColor=e.darkColor||""}}class Dw extends kw{constructor(e){super(e),this._resolvedColor=null,this.position="number"==typeof e.position?e.position:Cd.Center}getColor(e){return this._resolvedColor||("light"!==e.type&&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("string"==typeof e)return e;const i=e?t.getColor(e.id):null;return i?i.toString():""}}class xw{constructor(e){var t;this.position=null!==(t=null==e?void 0:e.position)&&void 0!==t?t:wd.Left}}class Nw extends kw{constructor(e){super(e),this.position=e.position}getColor(e){return this._resolvedColor||("light"!==e.type&&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"string"==typeof e?lc.fromHex(e):t.getColor(e.id)}}class Ew{static from(e){return e instanceof Ew?e:new Ew(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 Iw{static register(e){return new Iw(e)}static createDynamic(e){return new Iw(e)}constructor(e){var t,i,n,s,o,r;this.description=e.description,this.blockClassName=e.blockClassName?Lw(e.blockClassName):null,this.blockDoesNotCollapse=null!==(t=e.blockDoesNotCollapse)&&void 0!==t?t:null,this.blockIsAfterEnd=null!==(i=e.blockIsAfterEnd)&&void 0!==i?i:null,this.blockPadding=null!==(n=e.blockPadding)&&void 0!==n?n:null,this.stickiness=e.stickiness||0,this.zIndex=e.zIndex||0,this.className=e.className?Lw(e.className):null,this.shouldFillLineOnLineBreak=null!==(s=e.shouldFillLineOnLineBreak)&&void 0!==s?s:null,this.hoverMessage=e.hoverMessage||null,this.glyphMarginHoverMessage=e.glyphMarginHoverMessage||null,this.isWholeLine=e.isWholeLine||!1,this.showIfCollapsed=e.showIfCollapsed||!1,this.collapseOnReplaceEdit=e.collapseOnReplaceEdit||!1,this.overviewRuler=e.overviewRuler?new Dw(e.overviewRuler):null,this.minimap=e.minimap?new Nw(e.minimap):null,this.glyphMargin=e.glyphMarginClassName?new xw(e.glyphMargin):null,this.glyphMarginClassName=e.glyphMarginClassName?Lw(e.glyphMarginClassName):null,this.linesDecorationsClassName=e.linesDecorationsClassName?Lw(e.linesDecorationsClassName):null,this.firstLineDecorationClassName=e.firstLineDecorationClassName?Lw(e.firstLineDecorationClassName):null,this.marginClassName=e.marginClassName?Lw(e.marginClassName):null,this.inlineClassName=e.inlineClassName?Lw(e.inlineClassName):null,this.inlineClassNameAffectsLetterSpacing=e.inlineClassNameAffectsLetterSpacing||!1,this.beforeContentClassName=e.beforeContentClassName?Lw(e.beforeContentClassName):null,this.afterContentClassName=e.afterContentClassName?Lw(e.afterContentClassName):null,this.after=e.after?Ew.from(e.after):null,this.before=e.before?Ew.from(e.before):null,this.hideInCommentTokens=null!==(o=e.hideInCommentTokens)&&void 0!==o&&o,this.hideInStringTokens=null!==(r=e.hideInStringTokens)&&void 0!==r&&r}}Iw.EMPTY=Iw.register({description:"empty"});const Mw=[Iw.register({description:"tracked-range-always-grows-when-typing-at-edges",stickiness:0}),Iw.register({description:"tracked-range-never-grows-when-typing-at-edges",stickiness:1}),Iw.register({description:"tracked-range-grows-only-when-typing-before",stickiness:2}),Iw.register({description:"tracked-range-grows-only-when-typing-after",stickiness:3})];function Tw(e){return e instanceof Iw?e:Iw.createDynamic(e)}class Rw extends E{constructor(e){super(),this.handleBeforeFire=e,this._actual=this._register(new U),this.event=this._actual.event,this._affectedInjectedTextLines=null,this._deferredCnt=0,this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(){var e;this._deferredCnt--,0===this._deferredCnt&&(this._shouldFireDeferred&&this.doFire(),null===(e=this._affectedInjectedTextLines)||void 0===e||e.clear(),this._affectedInjectedTextLines=null)}recordLineAffectedByInjectedText(e){this._affectedInjectedTextLines||(this._affectedInjectedTextLines=new Set),this._affectedInjectedTextLines.add(e)}checkAffectedAndFire(e){this._affectsMinimap||(this._affectsMinimap=!(!e.minimap||!e.minimap.position)),this._affectsOverviewRuler||(this._affectsOverviewRuler=!(!e.overviewRuler||!e.overviewRuler.color)),this._affectsGlyphMargin||(this._affectsGlyphMargin=!!e.glyphMarginClassName),this.tryFire()}fire(){this._affectsMinimap=!0,this._affectsOverviewRuler=!0,this._affectsGlyphMargin=!0,this.tryFire()}tryFire(){0===this._deferredCnt?this.doFire():this._shouldFireDeferred=!0}doFire(){this.handleBeforeFire(this._affectedInjectedTextLines);const e={affectsMinimap:this._affectsMinimap,affectsOverviewRuler:this._affectsOverviewRuler,affectsGlyphMargin:this._affectsGlyphMargin};this._shouldFireDeferred=!1,this._affectsMinimap=!1,this._affectsOverviewRuler=!1,this._affectsGlyphMargin=!1,this._actual.fire(e)}}class Aw extends E{constructor(){super(),this._fastEmitter=this._register(new U),this.fastEvent=this._fastEmitter.event,this._slowEmitter=this._register(new U),this.slowEvent=this._slowEmitter.event,this._deferredCnt=0,this._deferredEvent=null}beginDeferredEmit(){this._deferredCnt++}endDeferredEmit(e=null){if(this._deferredCnt--,0===this._deferredCnt&&null!==this._deferredEvent){this._deferredEvent.rawContentChangedEvent.resultingSelection=e;const t=this._deferredEvent;this._deferredEvent=null,this._fastEmitter.fire(t),this._slowEmitter.fire(t)}}fire(e){this._deferredCnt>0?this._deferredEvent?this._deferredEvent=this._deferredEvent.merge(e):this._deferredEvent=e:(this._fastEmitter.fire(e),this._slowEmitter.fire(e))}}class Ow{constructor(){this._onDidChangeVisibleRanges=new U,this.onDidChangeVisibleRanges=this._onDidChangeVisibleRanges.event,this._views=new Set}attachView(){const e=new Pw((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 Pw{constructor(e){this.handleStateChange=e}setVisibleLines(e,t){const i=e.map((e=>new wc(e.startLineNumber,e.endLineNumber+1)));this.handleStateChange({visibleLineRanges:i,stabilized:t})}}const Fw=Dp("editorOverviewRuler.bracketMatchForeground",{dark:"#A0A0A0",light:"#A0A0A0",hcDark:"#A0A0A0",hcLight:"#A0A0A0"},ue(0,"Overview ruler marker color for matching brackets."));class Bw{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}class Ww extends E{static get(e){return e.getContribution(Ww.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new rd((()=>this._updateBrackets()),50)),this._matchBrackets=this._editor.getOption(71),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition((e=>{"never"!==this._matchBrackets&&this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeModelContent((e=>{this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeModel((e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeModelLanguageConfiguration((e=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()}))),this._register(e.onDidChangeConfiguration((e=>{e.hasChanged(71)&&(this._matchBrackets=this._editor.getOption(71),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((t=>{const i=t.getStartPosition(),n=e.bracketPairs.matchBracket(i);let s=null;if(n)n[0].containsPosition(i)&&!n[1].containsPosition(i)?s=n[1].getStartPosition():n[1].containsPosition(i)&&(s=n[0].getStartPosition());else{const t=e.bracketPairs.findEnclosingBrackets(i);if(t)s=t[1].getStartPosition();else{const t=e.bracketPairs.findNextBracket(i);t&&t.range&&(s=t.range.getStartPosition())}}return s?new Ah(s.lineNumber,s.column,s.lineNumber,s.column):new Ah(i.lineNumber,i.column,i.lineNumber,i.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 s=n.getStartPosition();let o=t.bracketPairs.matchBracket(s);if(!o&&(o=t.bracketPairs.findEnclosingBrackets(s),!o)){const e=t.bracketPairs.findNextBracket(s);e&&e.range&&(o=t.bracketPairs.matchBracket(e.range.getStartPosition()))}let r=null,a=null;if(o){o.sort(Rh.compareRangesUsingStarts);const[t,i]=o;if(r=e?t.getStartPosition():t.getEndPosition(),a=e?i.getEndPosition():i.getStartPosition(),i.containsPosition(s)){const e=r;r=a,a=e}}r&&a&&i.push(new Ah(r.lineNumber,r.column,a.lineNumber,a.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 s=t.bracketPairs.matchBracket(n);s||(s=t.bracketPairs.findEnclosingBrackets(n)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[1],text:""}]),this._editor.pushUndoStop())}))}_updateBrackets(){if("never"===this._matchBrackets)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())return this._lastBracketsData=[],void(this._lastVersionId=0);const e=this._editor.getSelections();if(e.length>100)return this._lastBracketsData=[],void(this._lastVersionId=0);const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const s=[];let o=0;for(let d=0,c=e.length;d1&&s.sort(Va.compare);const r=[];let a=0,l=0;const h=n.length;for(let d=0,c=s.length;d!0,Hw=()=>!1,zw=e=>" "===e||"\t"===e;class Uw{static shouldRecreate(e){return e.hasChanged(143)||e.hasChanged(129)||e.hasChanged(37)||e.hasChanged(76)||e.hasChanged(78)||e.hasChanged(79)||e.hasChanged(6)||e.hasChanged(7)||e.hasChanged(11)||e.hasChanged(9)||e.hasChanged(10)||e.hasChanged(14)||e.hasChanged(127)||e.hasChanged(50)||e.hasChanged(90)}constructor(e,t,i,n){var s;this.languageConfigurationService=n,this._cursorMoveConfigurationBrand=void 0,this._languageId=e;const o=i.options,r=o.get(143),a=o.get(50);this.readOnly=o.get(90),this.tabSize=t.tabSize,this.indentSize=t.indentSize,this.insertSpaces=t.insertSpaces,this.stickyTabStops=o.get(115),this.lineHeight=a.lineHeight,this.typicalHalfwidthCharacterWidth=a.typicalHalfwidthCharacterWidth,this.pageSize=Math.max(1,Math.floor(r.height/this.lineHeight)-2),this.useTabStops=o.get(127),this.wordSeparators=o.get(129),this.emptySelectionClipboard=o.get(37),this.copyWithSyntaxHighlighting=o.get(25),this.multiCursorMergeOverlapping=o.get(76),this.multiCursorPaste=o.get(78),this.multiCursorLimit=o.get(79),this.autoClosingBrackets=o.get(6),this.autoClosingComments=o.get(7),this.autoClosingQuotes=o.get(11),this.autoClosingDelete=o.get(9),this.autoClosingOvertype=o.get(10),this.autoSurround=o.get(14),this.autoIndent=o.get(12),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 l=this.languageConfigurationService.getLanguageConfiguration(e).getSurroundingPairs();if(l)for(const d of l)this.surroundingPairs[d.open]=d.close;const h=this.languageConfigurationService.getLanguageConfiguration(e).comments;this.blockCommentStartToken=null!==(s=null==h?void 0:h.blockCommentStartToken)&&void 0!==s?s:null}get electricChars(){var e;if(!this._electricChars){this._electricChars={};const t=null===(e=this.languageConfigurationService.getLanguageConfiguration(this._languageId).electricCharacter)||void 0===e?void 0:e.getElectricCharacters();if(t)for(const e of t)this._electricChars[e]=!0}return this._electricChars}onElectricCharacter(e,t,i){const n=Oc(t,i-1),s=this.languageConfigurationService.getLanguageConfiguration(n.languageId).electricCharacter;return s?s.onElectricCharacter(e,n,i-n.firstCharOffset):null}normalizeIndentation(e){return cc(e,this.indentSize,this.insertSpaces)}_getShouldAutoClose(e,t,i){switch(t){case"beforeWhitespace":return zw;case"languageDefined":return this._getLanguageDefinedShouldAutoClose(e,i);case"always":return Vw;case"never":return Hw}}_getLanguageDefinedShouldAutoClose(e,t){const i=this.languageConfigurationService.getLanguageConfiguration(e).getAutoCloseBeforeSet(t);return e=>-1!==i.indexOf(e)}visibleColumnFromColumn(e,t){return dc.visibleColumnFromColumn(e.getLineContent(t.lineNumber),t.column,this.tabSize)}columnFromVisibleColumn(e,t,i){const n=dc.columnFromVisibleColumn(e.getLineContent(t),i,this.tabSize),s=e.getLineMinColumn(t);if(no?o:n}}class Kw{static fromModelState(e){return new jw(e)}static fromViewState(e){return new qw(e)}static fromModelSelection(e){const t=Ah.liftSelection(e),i=new $w(Rh.fromPositions(t.getSelectionStart()),0,0,t.getPosition(),0);return Kw.fromModelState(i)}static fromModelSelections(e){const t=[];for(let i=0,n=e.length;is,l=n>o,h=no)continue;if(pn)continue;if(g0&&n--,Yw.columnSelect(e,t,i.fromViewLineNumber,i.fromViewVisualColumn,i.toViewLineNumber,n)}static columnSelectRight(e,t,i){let n=0;const s=Math.min(i.fromViewLineNumber,i.toViewLineNumber),o=Math.max(i.fromViewLineNumber,i.toViewLineNumber);for(let a=s;a<=o;a++){const i=t.getLineMaxColumn(a),s=e.visibleColumnFromColumn(t,new Va(a,i));n=Math.max(n,s)}let r=i.toViewVisualColumn;return re.getLineMinColumn(t.lineNumber))return t.delta(void 0,-No(e.getLineContent(t.lineNumber),t.column-1));if(t.lineNumber>1){const i=t.lineNumber-1;return new Va(i,e.getLineMaxColumn(i))}return t}static leftPositionAtomicSoftTabs(e,t,i){if(t.column<=e.getLineIndentColumn(t.lineNumber)){const n=e.getLineMinColumn(t.lineNumber),s=e.getLineContent(t.lineNumber),o=iy.atomicPosition(s,t.column-1,i,0);if(-1!==o&&o+1>=n)return new Va(t.lineNumber,o+1)}return this.leftPosition(e,t)}static left(e,t,i){const n=e.stickyTabStops?sy.leftPositionAtomicSoftTabs(t,i,e.tabSize):sy.leftPosition(t,i);return new ny(n.lineNumber,n.column,0)}static moveLeft(e,t,i,n,s){let o,r;if(i.hasSelection()&&!n)o=i.selection.startLineNumber,r=i.selection.startColumn;else{const n=i.position.delta(void 0,-(s-1)),a=t.normalizePosition(sy.clipPositionColumn(n,t),0),l=sy.left(e,t,a);o=l.lineNumber,r=l.column}return i.move(n,o,r,0)}static clipPositionColumn(e,t){return new Va(e.lineNumber,sy.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 ih?(i=h,n=r?t.getLineMaxColumn(i):Math.min(t.getLineMaxColumn(i),n)):n=e.columnFromVisibleColumn(t,i,l),s=u?0:l-dc.visibleColumnFromColumn(t.getLineContent(i),n,e.tabSize),void 0!==a){const e=new Va(i,n),o=t.normalizePosition(e,a);s+=n-o.column,i=o.lineNumber,n=o.column}return new ny(i,n,s)}static down(e,t,i,n,s,o,r){return this.vertical(e,t,i,n,s,i+o,r,4)}static moveDown(e,t,i,n,s){let o,r;i.hasSelection()&&!n?(o=i.selection.endLineNumber,r=i.selection.endColumn):(o=i.position.lineNumber,r=i.position.column);let a,l=0;do{a=sy.down(e,t,o+l,r,i.leftoverVisibleColumns,s,!0);if(t.normalizePosition(new Va(a.lineNumber,a.column),2).lineNumber>o)break}while(l++<10&&o+l1&&this._isBlankLine(t,s);)s--;for(;s>1&&!this._isBlankLine(t,s);)s--;return i.move(n,s,t.getLineMinColumn(s),0)}static moveToNextBlankLine(e,t,i,n){const s=t.getLineCount();let o=i.position.lineNumber;for(;o=d.length+1)return!1;const c=d.charAt(h.column-2),u=n.get(c);if(!u)return!1;if(Zw(c)){if("never"===i)return!1}else if("never"===t)return!1;const g=d.charAt(h.column-1);let p=!1;for(const e of u)e.open===c&&e.close===g&&(p=!0);if(!p)return!1;if("auto"===e){let e=!1;for(let t=0,i=r.length;t1){const e=t.getLineContent(n.lineNumber),s=ro(e),o=-1===s?e.length+1:s+1;if(n.column<=o){const e=i.visibleColumnFromColumn(t,n),s=dc.prevIndentTabStop(e,i.indentSize),o=i.columnFromVisibleColumn(t,n.lineNumber,s);return new Rh(n.lineNumber,o,n.lineNumber,n.column)}}return Rh.fromPositions(oy.getPositionAfterDeleteLeft(n,t),n)}static getPositionAfterDeleteLeft(e,t){if(e.column>1){const i=zo(e.column-1,t.getLineContent(e.lineNumber));return e.with(void 0,i+1)}if(e.lineNumber>1){const i=e.lineNumber-1;return new Va(i,t.getLineMaxColumn(i))}return e}static cut(e,t,i){const n=[];let s=null;i.sort(((e,t)=>Va.compare(e.getStartPosition(),t.getEndPosition())));for(let o=0,r=i.length;o1&&(null==s?void 0:s.endLineNumber)!==e.lineNumber?(i=e.lineNumber-1,a=t.getLineMaxColumn(e.lineNumber-1),l=e.lineNumber,h=t.getLineMaxColumn(e.lineNumber)):(i=e.lineNumber,a=1,l=e.lineNumber,h=t.getLineMaxColumn(e.lineNumber));const d=new Rh(i,a,l,h);s=d,d.isEmpty()?n[o]=null:n[o]=new Xw(d,"")}else n[o]=null;else n[o]=new Xw(r,"")}return new Gw(0,n,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!0})}}class ry{static _createWord(e,t,i,n,s){return{start:n,end:s,wordType:t,nextCharClass:i}}static _findPreviousWordOnLine(e,t,i){const n=t.getLineContent(i.lineNumber);return this._doFindPreviousWordOnLine(n,e,i)}static _doFindPreviousWordOnLine(e,t,i){let n=0;for(let s=i.column-2;s>=0;s--){const i=e.charCodeAt(s),o=t.get(i);if(0===o){if(2===n)return this._createWord(e,n,o,s+1,this._findEndOfWord(e,t,n,s+1));n=1}else if(2===o){if(1===n)return this._createWord(e,n,o,s+1,this._findEndOfWord(e,t,n,s+1));n=2}else if(1===o&&0!==n)return this._createWord(e,n,o,s+1,this._findEndOfWord(e,t,n,s+1))}return 0!==n?this._createWord(e,n,1,0,this._findEndOfWord(e,t,n,0)):null}static _findEndOfWord(e,t,i,n){const s=e.length;for(let o=n;o=0;s--){const n=e.charCodeAt(s),o=t.get(n);if(1===o)return s+1;if(1===i&&2===o)return s+1;if(2===i&&0===o)return s+1}return 0}static moveWordLeft(e,t,i,n){let s=i.lineNumber,o=i.column;1===o&&s>1&&(s-=1,o=t.getLineMaxColumn(s));let r=ry._findPreviousWordOnLine(e,t,new Va(s,o));if(0===n)return new Va(s,r?r.start+1:1);if(1===n)return r&&2===r.wordType&&r.end-r.start==1&&0===r.nextCharClass&&(r=ry._findPreviousWordOnLine(e,t,new Va(s,r.start+1))),new Va(s,r?r.start+1:1);if(3===n){for(;r&&2===r.wordType;)r=ry._findPreviousWordOnLine(e,t,new Va(s,r.start+1));return new Va(s,r?r.start+1:1)}return r&&o<=r.end+1&&(r=ry._findPreviousWordOnLine(e,t,new Va(s,r.start+1))),new Va(s,r?r.end+1:1)}static _moveWordPartLeft(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(1===t.column)return i>1?new Va(i-1,e.getLineMaxColumn(i-1)):t;const s=e.getLineContent(i);for(let o=t.column-1;o>1;o--){const e=s.charCodeAt(o-2),t=s.charCodeAt(o-1);if(95===e&&95!==t)return new Va(i,o);if(45===e&&45!==t)return new Va(i,o);if((mo(e)||po(e))&&fo(t))return new Va(i,o);if(fo(e)&&fo(t)&&o+1=a.start+1&&(a=ry._findNextWordOnLine(e,t,new Va(s,a.end+1))),o=a?a.start+1:t.getLineMaxColumn(s);return new Va(s,o)}static _moveWordPartRight(e,t){const i=t.lineNumber,n=e.getLineMaxColumn(i);if(t.column===n)return i1?l=1:(a--,l=n.getLineMaxColumn(a)):(h&&l<=h.end+1&&(h=ry._findPreviousWordOnLine(i,n,new Va(a,h.start+1))),h?l=h.end+1:l>1?l=1:(a--,l=n.getLineMaxColumn(a))),new Rh(a,l,r.lineNumber,r.column)}static deleteInsideWord(e,t,i){if(!i.isEmpty())return i;const n=new Va(i.positionLineNumber,i.positionColumn),s=this._deleteInsideWordWhitespace(t,n);return s||this._deleteInsideWordDetermineDeleteRange(e,t,n)}static _charAtIsWhitespace(e,t){const i=e.charCodeAt(t);return 32===i||9===i}static _deleteInsideWordWhitespace(e,t){const i=e.getLineContent(t.lineNumber),n=i.length;if(0===n)return null;let s=Math.max(t.column-2,0);if(!this._charAtIsWhitespace(i,s))return null;let o=Math.min(t.column-1,n-1);if(!this._charAtIsWhitespace(i,o))return null;for(;s>0&&this._charAtIsWhitespace(i,s-1);)s--;for(;o+11?new Rh(i.lineNumber-1,t.getLineMaxColumn(i.lineNumber-1),i.lineNumber,1):i.lineNumbere.start+1<=i.column&&i.column<=e.end+1,r=(e,t)=>(e=Math.min(e,i.column),t=Math.max(t,i.column),new Rh(i.lineNumber,e,i.lineNumber,t)),a=e=>{let t=e.start+1,i=e.end+1,o=!1;for(;i-11&&this._charAtIsWhitespace(n,t-2);)t--;return r(t,i)},l=ry._findPreviousWordOnLine(e,t,i);if(l&&o(l))return a(l);const h=ry._findNextWordOnLine(e,t,i);return h&&o(h)?a(h):l&&h?r(l.end+1,h.start+1):l?r(l.start+1,l.end+1):h?r(h.start+1,h.end+1):r(1,s+1)}static _deleteWordPartLeft(e,t){if(!t.isEmpty())return t;const i=t.getPosition(),n=ry._moveWordPartLeft(e,i);return new Rh(i.lineNumber,i.column,n.lineNumber,n.column)}static _findFirstNonWhitespaceChar(e,t){const i=e.length;for(let n=t;n=c.start+1&&(c=ry._findNextWordOnLine(i,n,new Va(a,c.end+1))),c?l=c.start+1:lBoolean(e)))}class hy{static addCursorDown(e,t,i){const n=[];let s=0;for(let o=0,r=t.length;ot&&(i=t,n=e.model.getLineMaxColumn(i)),Kw.fromModelState(new $w(new Rh(o.lineNumber,1,i,n),2,0,new Va(i,n),0))}const a=t.modelState.selectionStart.getStartPosition().lineNumber;if(o.lineNumbera){const i=e.getLineCount();let n=r.lineNumber+1,s=1;return n>i&&(n=i,s=e.getLineMaxColumn(n)),Kw.fromViewState(t.viewState.move(!0,n,s,0))}{const e=t.modelState.selectionStart.getEndPosition();return Kw.fromModelState(t.modelState.move(!0,e.lineNumber,e.column,0))}}static word(e,t,i,n){const s=e.model.validatePosition(n);return Kw.fromModelState(ry.word(e.cursorConfig,e.model,t.modelState,i,s))}static cancelSelection(e,t){if(!t.modelState.hasSelection())return new Kw(t.modelState,t.viewState);const i=t.viewState.position.lineNumber,n=t.viewState.position.column;return Kw.fromViewState(new $w(new Rh(i,n,i,n),0,0,new Va(i,n),0))}static moveTo(e,t,i,n,s){if(i){if(1===t.modelState.selectionStartKind)return this.word(e,t,i,n);if(2===t.modelState.selectionStartKind)return this.line(e,t,i,n,s)}const o=e.model.validatePosition(n),r=s?e.coordinatesConverter.validateViewPosition(new Va(s.lineNumber,s.column),o):e.coordinatesConverter.convertModelPositionToViewPosition(o);return Kw.fromViewState(t.viewState.move(i,r.lineNumber,r.column,0))}static simpleMove(e,t,i,n,s,o){switch(i){case 0:return 4===o?this._moveHalfLineLeft(e,t,n):this._moveLeft(e,t,n,s);case 1:return 4===o?this._moveHalfLineRight(e,t,n):this._moveRight(e,t,n,s);case 2:return 2===o?this._moveUpByViewLines(e,t,n,s):this._moveUpByModelLines(e,t,n,s);case 3:return 2===o?this._moveDownByViewLines(e,t,n,s):this._moveDownByModelLines(e,t,n,s);case 4:return 2===o?t.map((t=>Kw.fromViewState(sy.moveToPrevBlankLine(e.cursorConfig,e,t.viewState,n)))):t.map((t=>Kw.fromModelState(sy.moveToPrevBlankLine(e.cursorConfig,e.model,t.modelState,n))));case 5:return 2===o?t.map((t=>Kw.fromViewState(sy.moveToNextBlankLine(e.cursorConfig,e,t.viewState,n)))):t.map((t=>Kw.fromModelState(sy.moveToNextBlankLine(e.cursorConfig,e.model,t.modelState,n))));case 6:return this._moveToViewMinColumn(e,t,n);case 7:return this._moveToViewFirstNonWhitespaceColumn(e,t,n);case 8:return this._moveToViewCenterColumn(e,t,n);case 9:return this._moveToViewMaxColumn(e,t,n);case 10:return this._moveToViewLastNonWhitespaceColumn(e,t,n);default:return null}}static viewportMove(e,t,i,n,s){const o=e.getCompletelyVisibleViewRange(),r=e.coordinatesConverter.convertViewRangeToModelRange(o);switch(i){case 11:{const i=this._firstLineNumberInRange(e.model,r,s),o=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,o)]}case 13:{const i=this._lastLineNumberInRange(e.model,r,s),o=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,o)]}case 12:{const i=Math.round((r.startLineNumber+r.endLineNumber)/2),s=e.model.getLineFirstNonWhitespaceColumn(i);return[this._moveToModelPosition(e,t[0],n,i,s)]}case 14:{const i=[];for(let s=0,r=t.length;si.endLineNumber-1?i.endLineNumber-1:sKw.fromViewState(sy.moveLeft(e.cursorConfig,e,t.viewState,i,n))))}static _moveHalfLineLeft(e,t,i){const n=[];for(let s=0,o=t.length;sKw.fromViewState(sy.moveRight(e.cursorConfig,e,t.viewState,i,n))))}static _moveHalfLineRight(e,t,i){const n=[];for(let s=0,o=t.length;s1&&0===s.firstCharOffset){const e=sg(t,i.startLineNumber-1);e.languageId===s.languageId&&(h=e.getLineContent())}const d=o.onEnter(e,h,a,l);if(!d)return null;const c=d.indentAction;let u=d.appendText;const g=d.removeText||0;u?c===Mc.Indent&&(u="\t"+u):u=c===Mc.Indent||c===Mc.IndentOutdent?"\t":"";let p=ng(t,i.startLineNumber,i.startColumn);return g&&(p=p.substring(0,p.length-g)),{indentAction:c,appendText:u,removeText:g,indentation:p}}!function(e){e.description={description:"Move cursor to a logical position in the view",args:[{name:"Cursor move argument object",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t* 'to': A mandatory logical position value providing where to move the cursor.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'left', 'right', 'up', 'down', 'prevBlankLine', 'nextBlankLine',\n\t\t\t\t\t\t'wrappedLineStart', 'wrappedLineEnd', 'wrappedLineColumnCenter'\n\t\t\t\t\t\t'wrappedLineFirstNonWhitespaceCharacter', 'wrappedLineLastNonWhitespaceCharacter'\n\t\t\t\t\t\t'viewPortTop', 'viewPortCenter', 'viewPortBottom', 'viewPortIfOutside'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'by': Unit to move. Default is computed based on 'to' value.\n\t\t\t\t\t\t```\n\t\t\t\t\t\t'line', 'wrappedLine', 'character', 'halfLine'\n\t\t\t\t\t\t```\n\t\t\t\t\t* 'value': Number of units to move. Default is '1'.\n\t\t\t\t\t* 'select': If 'true' makes the selection. Default is 'false'.\n\t\t\t\t",constraint:function(e){if(!Br(e))return!1;const t=e;return!!Fr(t.to)&&(!(!Ur(t.select)&&!zr(t.select))&&(!(!Ur(t.by)&&!Fr(t.by))&&!(!Ur(t.value)&&!Vr(t.value))))},schema:{type:"object",required:["to"],properties:{to:{type:"string",enum:["left","right","up","down","prevBlankLine","nextBlankLine","wrappedLineStart","wrappedLineEnd","wrappedLineColumnCenter","wrappedLineFirstNonWhitespaceCharacter","wrappedLineLastNonWhitespaceCharacter","viewPortTop","viewPortCenter","viewPortBottom","viewPortIfOutside"]},by:{type:"string",enum:["line","wrappedLine","character","halfLine"]},value:{type:"number",default:1},select:{type:"boolean",default:!1}}}}]},e.RawDirection={Left:"left",Right:"right",Up:"up",Down:"down",PrevBlankLine:"prevBlankLine",NextBlankLine:"nextBlankLine",WrappedLineStart:"wrappedLineStart",WrappedLineFirstNonWhitespaceCharacter:"wrappedLineFirstNonWhitespaceCharacter",WrappedLineColumnCenter:"wrappedLineColumnCenter",WrappedLineEnd:"wrappedLineEnd",WrappedLineLastNonWhitespaceCharacter:"wrappedLineLastNonWhitespaceCharacter",ViewPortTop:"viewPortTop",ViewPortCenter:"viewPortCenter",ViewPortBottom:"viewPortBottom",ViewPortIfOutside:"viewPortIfOutside"},e.RawUnit={Line:"line",WrappedLine:"wrappedLine",Character:"character",HalfLine:"halfLine"},e.parse=function(t){if(!t.to)return null;let i;switch(t.to){case e.RawDirection.Left:i=0;break;case e.RawDirection.Right:i=1;break;case e.RawDirection.Up:i=2;break;case e.RawDirection.Down:i=3;break;case e.RawDirection.PrevBlankLine:i=4;break;case e.RawDirection.NextBlankLine:i=5;break;case e.RawDirection.WrappedLineStart:i=6;break;case e.RawDirection.WrappedLineFirstNonWhitespaceCharacter:i=7;break;case e.RawDirection.WrappedLineColumnCenter:i=8;break;case e.RawDirection.WrappedLineEnd:i=9;break;case e.RawDirection.WrappedLineLastNonWhitespaceCharacter:i=10;break;case e.RawDirection.ViewPortTop:i=11;break;case e.RawDirection.ViewPortBottom:i=13;break;case e.RawDirection.ViewPortCenter:i=12;break;case e.RawDirection.ViewPortIfOutside:i=14;break;default:return null}let n=0;switch(t.by){case e.RawUnit.Line:n=1;break;case e.RawUnit.WrappedLine:n=2;break;case e.RawUnit.Character:n=3;break;case e.RawUnit.HalfLine:n=4}return{direction:i,unit:n,select:!!t.select,value:t.value||1}}}(dy||(dy={}));var uy,gy=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},py=function(e,t){return function(i,n){t(i,n,e)}};const my=Object.create(null);function fy(e,t){if(t<=0)return"";my[e]||(my[e]=["",e]);const i=my[e];for(let n=i.length;n<=t;n++)i[n]=i[n-1]+e;return i[t]}let _y=uy=class{static unshiftIndent(e,t,i,n,s){const o=dc.visibleColumnFromColumn(e,t,i);if(s){const e=fy(" ",n);return fy(e,dc.prevIndentTabStop(o,n)/n)}return fy("\t",dc.prevRenderTabStop(o,i)/i)}static shiftIndent(e,t,i,n,s){const o=dc.visibleColumnFromColumn(e,t,i);if(s){const e=fy(" ",n);return fy(e,dc.nextIndentTabStop(o,n)/n)}return fy("\t",dc.nextRenderTabStop(o,i)/i)}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;1===this._selection.endColumn&&i!==n&&(n-=1);const{tabSize:s,indentSize:o,insertSpaces:r}=this._opts,a=i===n;if(this._opts.useTabStops){this._selection.isEmpty()&&/^\s*$/.test(e.getLineContent(i))&&(this._useLastEditRangeForCursorEndPosition=!0);let l=0,h=0;for(let d=i;d<=n;d++,l=h){h=0;const n=e.getLineContent(d);let c,u=ro(n);if((!this._opts.isUnshift||0!==n.length&&0!==u)&&(a||this._opts.isUnshift||0!==n.length)){if(-1===u&&(u=n.length),d>1){if(dc.visibleColumnFromColumn(n,u+1,s)%o!=0&&e.tokenization.isCheapToTokenize(d-1)){const t=cy(this._opts.autoIndent,e,new Rh(d-1,e.getLineMaxColumn(d-1),d-1,e.getLineMaxColumn(d-1)),this._languageConfigurationService);if(t){if(h=l,t.appendText)for(let e=0,i=t.appendText.length;e0&&""===t.getLineContent(l);l--)if(1===l)return{indentation:"",action:null};const r=function(e,t,i){const n=e.tokenization.getLanguageIdAtPosition(t,0);if(t>1){let s,o=-1;for(s=t-1;s>=1;s--){if(e.tokenization.getLanguageIdAtPosition(s,0)!==n)return o;const t=e.getLineContent(s);if(!i.shouldIgnore(t)&&!/^\s+$/.test(t)&&""!==t)return s;o=s}}return-1}(t,i,o);if(r<0)return null;if(r<1)return{indentation:"",action:null};const a=t.getLineContent(r);if(o.shouldIncrease(a)||o.shouldIndentNextLine(a))return{indentation:ao(a),action:Mc.Indent,line:r};if(o.shouldDecrease(a))return{indentation:ao(a),action:null,line:r};{if(1===r)return{indentation:ao(t.getLineContent(r)),action:null,line:r};const e=r-1,i=o.getIndentMetadata(t.getLineContent(e));if(!(3&i)&&4&i){let i=0;for(let n=e-1;n>0;n--)if(!o.shouldIndentNextLine(t.getLineContent(n))){i=n;break}return{indentation:ao(t.getLineContent(i+1)),action:null,line:i+1}}if(n)return{indentation:ao(t.getLineContent(r)),action:null,line:r};for(let n=r;n>0;n--){const e=t.getLineContent(n);if(o.shouldIncrease(e))return{indentation:ao(e),action:Mc.Indent,line:n};if(o.shouldIndentNextLine(e)){let e=0;for(let i=n-1;i>0;i--)if(!o.shouldIndentNextLine(t.getLineContent(n))){e=i;break}return{indentation:ao(t.getLineContent(e+1)),action:null,line:e+1}}if(o.shouldDecrease(e))return{indentation:ao(e),action:null,line:n}}return{indentation:ao(t.getLineContent(1)),action:null,line:1}}}function wy(e,t,i,n,s,o){if(e<4)return null;const r=o.getLanguageConfiguration(i);if(!r)return null;const a=o.getLanguageConfiguration(i).indentRulesSupport;if(!a)return null;const l=Cy(e,t,n,void 0,o),h=t.getLineContent(n);if(l){const i=l.line;if(void 0!==i){let o=!0;for(let e=i;ee.getLineCount()?null:n.getIndentMetadata(e.getLineContent(t)):null}class Sy{static indent(e,t,i){if(null===t||null===i)return[];const n=[];for(let s=0,o=i.length;s1){let n;for(n=i-1;n>=1;n--){if(lo(t.getLineContent(n))>=0)break}if(n<1)return null;const o=t.getLineMaxColumn(n),r=cy(e.autoIndent,t,new Rh(n,o,n,o),e.languageConfigurationService);r&&(s=r.indentation+r.appendText)}return n&&(n===Mc.Indent&&(s=Sy.shiftIndent(e,s)),n===Mc.Outdent&&(s=Sy.unshiftIndent(e,s)),s=e.normalizeIndentation(s)),s||null}static _replaceJumpToNextIndent(e,t,i,n){let s="";const o=i.getStartPosition();if(e.insertSpaces){const i=e.visibleColumnFromColumn(t,o),n=e.indentSize,r=n-i%n;for(let e=0;ethis._compositionType(i,e,s,o,r,a)));return new Gw(4,l,{shouldPushStackElementBefore:xy(e,4),shouldPushStackElementAfter:!1})}static _compositionType(e,t,i,n,s,o){if(!t.isEmpty())return null;const r=t.getPosition(),a=Math.max(1,r.column-n),l=Math.min(e.getLineMaxColumn(r.lineNumber),r.column+s),h=new Rh(r.lineNumber,a,r.lineNumber,l);return e.getValueInRange(h)===i&&0===o?null:new ey(h,i,0,o)}static _typeCommand(e,t,i){return i?new Jw(e,t,!0):new Xw(e,t,!0)}static _enter(e,t,i,n){if(0===e.autoIndent)return Sy._typeCommand(n,"\n",i);if(!t.tokenization.isCheapToTokenize(n.getStartPosition().lineNumber)||1===e.autoIndent){const s=ao(t.getLineContent(n.startLineNumber)).substring(0,n.startColumn-1);return Sy._typeCommand(n,"\n"+e.normalizeIndentation(s),i)}const s=cy(e.autoIndent,t,n,e.languageConfigurationService);if(s){if(s.indentAction===Mc.None)return Sy._typeCommand(n,"\n"+e.normalizeIndentation(s.indentation+s.appendText),i);if(s.indentAction===Mc.Indent)return Sy._typeCommand(n,"\n"+e.normalizeIndentation(s.indentation+s.appendText),i);if(s.indentAction===Mc.IndentOutdent){const t=e.normalizeIndentation(s.indentation),o=e.normalizeIndentation(s.indentation+s.appendText),r="\n"+o+"\n"+t;return i?new Jw(n,r,!0):new ey(n,r,-1,o.length-t.length,!0)}if(s.indentAction===Mc.Outdent){const t=Sy.unshiftIndent(e,s.indentation);return Sy._typeCommand(n,"\n"+e.normalizeIndentation(t+s.appendText),i)}}const o=ao(t.getLineContent(n.startLineNumber)).substring(0,n.startColumn-1);if(e.autoIndent>=4){const s=function(e,t,i,n,s){if(e<4)return null;t.tokenization.forceTokenization(i.startLineNumber);const o=t.tokenization.getLineTokens(i.startLineNumber),r=Oc(o,i.startColumn-1),a=r.getLineContent();let l,h,d=!1;r.firstCharOffset>0&&o.getLanguageId(0)!==r.languageId?(d=!0,l=a.substr(0,i.startColumn-1-r.firstCharOffset)):l=o.getLineContent().substring(0,i.startColumn-1),h=i.isEmpty()?a.substr(i.startColumn-1-r.firstCharOffset):sg(t,i.endLineNumber,i.endColumn).getLineContent().substr(i.endColumn-1-r.firstCharOffset);const c=s.getLanguageConfiguration(r.languageId).indentRulesSupport;if(!c)return null;const u=l,g=ao(l),p={tokenization:{getLineTokens:e=>t.tokenization.getLineTokens(e),getLanguageId:()=>t.getLanguageId(),getLanguageIdAtPosition:(e,i)=>t.getLanguageIdAtPosition(e,i)},getLineContent:e=>e===i.startLineNumber?u:t.getLineContent(e)},m=ao(o.getLineContent()),f=Cy(e,p,i.startLineNumber+1,void 0,s);if(!f){const e=d?m:g;return{beforeEnter:e,afterEnter:e}}let _=d?m:f.indentation;return f.action===Mc.Indent&&(_=n.shiftIndent(_)),c.shouldDecrease(h)&&(_=n.unshiftIndent(_)),{beforeEnter:d?m:g,afterEnter:_}}(e.autoIndent,t,n,{unshiftIndent:t=>Sy.unshiftIndent(e,t),shiftIndent:t=>Sy.shiftIndent(e,t),normalizeIndentation:t=>e.normalizeIndentation(t)},e.languageConfigurationService);if(s){let o=e.visibleColumnFromColumn(t,n.getEndPosition());const r=n.endColumn,a=ro(t.getLineContent(n.endLineNumber));if(n=a>=0?n.setEndPosition(n.endLineNumber,Math.max(n.endColumn,a+1)):n.setEndPosition(n.endLineNumber,t.getLineMaxColumn(n.endLineNumber)),i)return new Jw(n,"\n"+e.normalizeIndentation(s.afterEnter),!0);{let t=0;return r<=a+1&&(e.insertSpaces||(o=Math.ceil(o/e.indentSize)),t=Math.min(o+1-e.normalizeIndentation(s.afterEnter).length-1,0)),new ey(n,"\n"+e.normalizeIndentation(s.afterEnter),0,t,!0)}}}return Sy._typeCommand(n,"\n"+e.normalizeIndentation(o),i)}static _isAutoIndentType(e,t,i){if(e.autoIndent<4)return!1;for(let n=0,s=i.length;nSy.shiftIndent(e,t),unshiftIndent:t=>Sy.unshiftIndent(e,t)},e.languageConfigurationService);if(null===o)return null;if(o!==e.normalizeIndentation(s)){const s=t.getLineFirstNonWhitespaceColumn(i.startLineNumber);return 0===s?Sy._typeCommand(new Rh(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(o)+n,!1):Sy._typeCommand(new Rh(i.startLineNumber,1,i.endLineNumber,i.endColumn),e.normalizeIndentation(o)+t.getLineContent(i.startLineNumber).substring(s-1,i.startColumn-1)+n,!1)}return null}static _isAutoClosingOvertype(e,t,i,n,s){if("never"===e.autoClosingOvertype)return!1;if(!e.autoClosingPairs.autoClosingPairsCloseSingleChar.has(s))return!1;for(let o=0,r=i.length;o2?l.charCodeAt(a.column-2):0)&&h)return!1;if("auto"===e.autoClosingOvertype){let e=!1;for(let t=0,i=n.length;tt.startsWith(e.open))),r=s.some((e=>t.startsWith(e.close)));return!o&&r}static _findAutoClosingPairOpen(e,t,i,n){const s=e.autoClosingPairs.autoClosingPairsOpenByEnd.get(n);if(!s)return null;let o=null;for(const r of s)if(null===o||r.open.length>o.open.length){let e=!0;for(const s of i){if(t.getValueInRange(new Rh(s.lineNumber,s.column-r.open.length+1,s.lineNumber,s.column))+n!==r.open){e=!1;break}}e&&(o=r)}return o}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 s=null;for(const o of n)o.open!==t.open&&t.open.includes(o.open)&&t.close.endsWith(o.close)&&(!s||o.open.length>s.open.length)&&(s=o);return s}static _getAutoClosingPairClose(e,t,i,n,s){for(const u of i)if(!u.isEmpty())return null;const o=i.map((e=>{const t=e.getPosition();return s?{lineNumber:t.lineNumber,beforeColumn:t.column-n.length,afterColumn:t.column}:{lineNumber:t.lineNumber,beforeColumn:t.column,afterColumn:t.column}})),r=this._findAutoClosingPairOpen(e,t,o.map((e=>new Va(e.lineNumber,e.beforeColumn))),n);if(!r)return null;let a,l;if(Zw(n))a=e.autoClosingQuotes,l=e.shouldAutoCloseBefore.quote;else{!!e.blockCommentStartToken&&r.open.includes(e.blockCommentStartToken)?(a=e.autoClosingComments,l=e.shouldAutoCloseBefore.comment):(a=e.autoClosingBrackets,l=e.shouldAutoCloseBefore.bracket)}if("never"===a)return null;const h=this._findContainedAutoClosingPair(e,r),d=h?h.close:"";let c=!0;for(const u of o){const{lineNumber:i,beforeColumn:s,afterColumn:o}=u,h=t.getLineContent(i),g=h.substring(0,s-1),p=h.substring(o-1);if(p.startsWith(d)||(c=!1),p.length>0){const t=p.charAt(0);if(!Sy._isBeforeClosingBrace(e,p)&&!l(t))return null}if(1===r.open.length&&("'"===n||'"'===n)&&"always"!==a){const t=Gb(e.wordSeparators);if(g.length>0){const e=g.charCodeAt(g.length-1);if(0===t.get(e))return null}}if(!t.tokenization.isCheapToTokenize(i))return null;t.tokenization.forceTokenization(i);const m=Oc(t.tokenization.getLineTokens(i),s-1);if(!r.shouldAutoClose(m,s-m.firstCharOffset))return null;const f=r.findNeutralCharacter();if(f){const e=t.tokenization.getTokenTypeIfInsertingCharacter(i,s,f);if(!r.isOK(e))return null}}return c?r.close.substring(0,r.close.length-d.length):r.close}static _runAutoClosingOpenCharType(e,t,i,n,s,o,r){const a=[];for(let l=0,h=n.length;lnew Xw(new Rh(e.positionLineNumber,e.positionColumn,e.positionLineNumber,e.positionColumn+1),"",!1)));return new Gw(4,e,{shouldPushStackElementBefore:!0,shouldPushStackElementAfter:!1})}const h=this._getAutoClosingPairClose(t,i,s,a,!0);return null!==h?this._runAutoClosingOpenCharType(e,t,i,s,a,!0,h):null}static typeWithInterceptors(e,t,i,n,s,o,r){if(!e&&"\n"===r){const e=[];for(let t=0,o=s.length;t{const i=e.get(Wa).getFocusedCodeEditor();return!(!i||!i.hasTextFocus())&&this._runEditorCommand(e,i,t)})),e.addImplementation(1e3,"generic-dom-input-textarea",((e,t)=>{const i=Xn();return!!(i&&["input","textarea"].indexOf(i.tagName.toLowerCase())>=0)&&(this.runDOMCommand(i),!0)})),e.addImplementation(0,"generic-dom",((e,t)=>{const i=e.get(Wa).getActiveCodeEditor();return!!i&&(i.focus(),this._runEditorCommand(e,i,t))}))}_runEditorCommand(e,t,i){const n=this.runEditorCommand(e,t,i);return n||!0}}!function(e){class t extends Iy{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode}runCoreEditorCommand(e,t){if(!t.position)return;e.model.pushStackElement();e.setCursorStates(t.source,3,[hy.moveTo(e,e.getPrimaryCursorState(),this._inSelectionMode,t.position,t.viewPosition)])&&2!==t.revealType&&e.revealPrimaryCursor(t.source,!0,!0)}}e.MoveTo=Sh(new t({id:"_moveTo",inSelectionMode:!1,precondition:void 0})),e.MoveToSelect=Sh(new t({id:"_moveToSelect",inSelectionMode:!0,precondition:void 0}));class i extends Iy{runCoreEditorCommand(e,t){e.model.pushStackElement();const i=this._getColumnSelectResult(e,e.getPrimaryCursorState(),e.getCursorColumnSelectData(),t);null!==i&&(e.setCursorStates(t.source,3,i.viewStates.map((e=>Kw.fromViewState(e)))),e.setCursorColumnSelectData({isReal:!0,fromViewLineNumber:i.fromLineNumber,fromViewVisualColumn:i.fromVisualColumn,toViewLineNumber:i.toLineNumber,toViewVisualColumn:i.toVisualColumn}),i.reversed?e.revealTopMostCursor(t.source):e.revealBottomMostCursor(t.source))}}e.ColumnSelect=Sh(new class extends i{constructor(){super({id:"columnSelect",precondition:void 0})}_getColumnSelectResult(e,t,i,n){if(void 0===n.position||void 0===n.viewPosition||void 0===n.mouseColumn)return null;const s=e.model.validatePosition(n.position),o=e.coordinatesConverter.validateViewPosition(new Va(n.viewPosition.lineNumber,n.viewPosition.column),s),r=n.doColumnSelect?i.fromViewLineNumber:o.lineNumber,a=n.doColumnSelect?i.fromViewVisualColumn:n.mouseColumn-1;return Yw.columnSelect(e.cursorConfig,e,r,a,o.lineNumber,n.mouseColumn-1)}}),e.CursorColumnSelectLeft=Sh(new class extends i{constructor(){super({id:"cursorColumnSelectLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:3599,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return Yw.columnSelectLeft(e.cursorConfig,e,i)}}),e.CursorColumnSelectRight=Sh(new class extends i{constructor(){super({id:"cursorColumnSelectRight",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:3601,linux:{primary:0}}})}_getColumnSelectResult(e,t,i,n){return Yw.columnSelectRight(e.cursorConfig,e,i)}});class n extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return Yw.columnSelectUp(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectUp=Sh(new n({isPaged:!1,id:"cursorColumnSelectUp",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:3600,linux:{primary:0}}})),e.CursorColumnSelectPageUp=Sh(new n({isPaged:!0,id:"cursorColumnSelectPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:3595,linux:{primary:0}}}));class s extends i{constructor(e){super(e),this._isPaged=e.isPaged}_getColumnSelectResult(e,t,i,n){return Yw.columnSelectDown(e.cursorConfig,e,i,this._isPaged)}}e.CursorColumnSelectDown=Sh(new s({isPaged:!1,id:"cursorColumnSelectDown",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:3602,linux:{primary:0}}})),e.CursorColumnSelectPageDown=Sh(new s({isPaged:!0,id:"cursorColumnSelectPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:3596,linux:{primary:0}}}));class o extends Iy{constructor(){super({id:"cursorMove",precondition:void 0,description:dy.description})}runCoreEditorCommand(e,t){const i=dy.parse(t);i&&this._runCursorMove(e,t.source,i)}_runCursorMove(e,t,i){e.model.pushStackElement(),e.setCursorStates(t,3,o._move(e,e.getCursorStates(),i)),e.revealPrimaryCursor(t,!0)}static _move(e,t,i){const n=i.select,s=i.value;switch(i.direction){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return hy.simpleMove(e,t,i.direction,n,s,i.unit);case 11:case 13:case 12:case 14:return hy.viewportMove(e,t,i.direction,n,s);default:return null}}}e.CursorMoveImpl=o,e.CursorMove=Sh(new o);class r extends Iy{constructor(e){super(e),this._staticArgs=e.args}runCoreEditorCommand(e,t){let i=this._staticArgs;-1===this._staticArgs.value&&(i={direction:this._staticArgs.direction,unit:this._staticArgs.unit,select:this._staticArgs.select,value:t.pageSize||e.cursorConfig.pageSize}),e.model.pushStackElement(),e.setCursorStates(t.source,3,hy.simpleMove(e,e.getCursorStates(),i.direction,i.select,i.value,i.unit)),e.revealPrimaryCursor(t.source,!0)}}e.CursorLeft=Sh(new r({args:{direction:0,unit:0,select:!1,value:1},id:"cursorLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:15,mac:{primary:15,secondary:[288]}}})),e.CursorLeftSelect=Sh(new r({args:{direction:0,unit:0,select:!0,value:1},id:"cursorLeftSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:1039}})),e.CursorRight=Sh(new r({args:{direction:1,unit:0,select:!1,value:1},id:"cursorRight",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:17,mac:{primary:17,secondary:[292]}}})),e.CursorRightSelect=Sh(new r({args:{direction:1,unit:0,select:!0,value:1},id:"cursorRightSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:1041}})),e.CursorUp=Sh(new r({args:{direction:2,unit:2,select:!1,value:1},id:"cursorUp",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:16,mac:{primary:16,secondary:[302]}}})),e.CursorUpSelect=Sh(new r({args:{direction:2,unit:2,select:!0,value:1},id:"cursorUpSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:1040,secondary:[3088],mac:{primary:1040},linux:{primary:1040}}})),e.CursorPageUp=Sh(new r({args:{direction:2,unit:2,select:!1,value:-1},id:"cursorPageUp",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:11}})),e.CursorPageUpSelect=Sh(new r({args:{direction:2,unit:2,select:!0,value:-1},id:"cursorPageUpSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:1035}})),e.CursorDown=Sh(new r({args:{direction:3,unit:2,select:!1,value:1},id:"cursorDown",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:18,mac:{primary:18,secondary:[300]}}})),e.CursorDownSelect=Sh(new r({args:{direction:3,unit:2,select:!0,value:1},id:"cursorDownSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:1042,secondary:[3090],mac:{primary:1042},linux:{primary:1042}}})),e.CursorPageDown=Sh(new r({args:{direction:3,unit:2,select:!1,value:-1},id:"cursorPageDown",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:12}})),e.CursorPageDownSelect=Sh(new r({args:{direction:3,unit:2,select:!0,value:-1},id:"cursorPageDownSelect",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:1036}})),e.CreateCursor=Sh(new class extends Iy{constructor(){super({id:"createCursor",precondition:void 0})}runCoreEditorCommand(e,t){if(!t.position)return;let i;i=t.wholeLine?hy.line(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition):hy.moveTo(e,e.getPrimaryCursorState(),!1,t.position,t.viewPosition);const n=e.getCursorStates();if(n.length>1){const s=i.modelState?i.modelState.position:null,o=i.viewState?i.viewState.position:null;for(let i=0,r=n.length;io&&(s=o);const r=new Rh(s,1,s,e.model.getLineMaxColumn(s));let a=0;if(i.at)switch(i.at){case Ty.RawAtArgument.Top:a=3;break;case Ty.RawAtArgument.Center:a=1;break;case Ty.RawAtArgument.Bottom:a=4}const l=e.coordinatesConverter.convertModelRangeToViewRange(r);e.revealRange(t.source,!1,l,a,0)}}),e.SelectAll=new class extends Ay{constructor(){super(Th)}runDOMCommand(e){ne&&(e.focus(),e.select()),e.ownerDocument.execCommand("selectAll")}runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditorCommand(n,i)}runCoreEditorCommand(e,t){e.model.pushStackElement(),e.setCursorStates("keyboard",3,[hy.selectAll(e,e.getPrimaryCursorState())])}},e.SetSelection=Sh(new class extends Iy{constructor(){super({id:"setSelection",precondition:void 0})}runCoreEditorCommand(e,t){t.selection&&(e.model.pushStackElement(),e.setCursorStates(t.source,3,[Kw.fromModelSelection(t.selection)]))}})}(Ry||(Ry={}));const Oy=pl.and(Oh.textInputFocus,Oh.columnSelection);function Py(e,t){$l.registerKeybindingRule({id:e,primary:t,when:Oy,weight:1})}function Fy(e){return e.register(),e}var By,Wy;Py(Ry.CursorColumnSelectLeft.id,1039),Py(Ry.CursorColumnSelectRight.id,1041),Py(Ry.CursorColumnSelectUp.id,1040),Py(Ry.CursorColumnSelectPageUp.id,1035),Py(Ry.CursorColumnSelectDown.id,1042),Py(Ry.CursorColumnSelectPageDown.id,1036),function(e){class t extends vh{runEditorCommand(e,t,i){const n=t._getViewModel();n&&this.runCoreEditingCommand(t,n,i||{})}}e.CoreEditingCommand=t,e.LineBreakInsert=Sh(new class extends t{constructor(){super({id:"lineBreakInsert",precondition:Oh.writable,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:0,mac:{primary:301}}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,Sy.lineBreakInsert(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection))))}}),e.Outdent=Sh(new class extends t{constructor(){super({id:"outdent",precondition:Oh.writable,kbOpts:{weight:0,kbExpr:pl.and(Oh.editorTextFocus,Oh.tabDoesNotMoveFocus),primary:1026}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,Sy.outdent(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)))),e.pushUndoStop()}}),e.Tab=Sh(new class extends t{constructor(){super({id:"tab",precondition:Oh.writable,kbOpts:{weight:0,kbExpr:pl.and(Oh.editorTextFocus,Oh.tabDoesNotMoveFocus),primary:2}})}runCoreEditingCommand(e,t,i){e.pushUndoStop(),e.executeCommands(this.id,Sy.tab(t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)))),e.pushUndoStop()}}),e.DeleteLeft=Sh(new class extends t{constructor(){super({id:"deleteLeft",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:1,secondary:[1025],mac:{primary:1,secondary:[1025,294,257]}}})}runCoreEditingCommand(e,t,i){const[n,s]=oy.deleteLeft(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)),t.getCursorAutoClosedCharacters());n&&e.pushUndoStop(),e.executeCommands(this.id,s),t.setPrevEditOperationType(2)}}),e.DeleteRight=Sh(new class extends t{constructor(){super({id:"deleteRight",precondition:void 0,kbOpts:{weight:0,kbExpr:Oh.textInputFocus,primary:20,mac:{primary:20,secondary:[290,276]}}})}runCoreEditingCommand(e,t,i){const[n,s]=oy.deleteRight(t.getPrevEditOperationType(),t.cursorConfig,t.model,t.getCursorStates().map((e=>e.modelState.selection)));n&&e.pushUndoStop(),e.executeCommands(this.id,s),t.setPrevEditOperationType(3)}}),e.Undo=new class extends Ay{constructor(){super(Ih)}runDOMCommand(e){e.ownerDocument.execCommand("undo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(90))return t.getModel().undo()}},e.Redo=new class extends Ay{constructor(){super(Mh)}runDOMCommand(e){e.ownerDocument.execCommand("redo")}runEditorCommand(e,t,i){if(t.hasModel()&&!0!==t.getOption(90))return t.getModel().redo()}}}(By||(By={}));class Vy extends mh{constructor(e,t,i){super({id:e,precondition:void 0,description:i}),this._handlerId=t}runCommand(e,t){const i=e.get(Wa).getFocusedCodeEditor();i&&i.trigger("keyboard",this._handlerId,t)}}function Hy(e,t){Fy(new Vy("default:"+e,e)),Fy(new Vy(e,e,t))}Hy("type",{description:"Type",args:[{name:"args",schema:{type:"object",required:["text"],properties:{text:{type:"string"}}}}]}),Hy("replacePreviousChar"),Hy("compositionType"),Hy("compositionStart"),Hy("compositionEnd"),Hy("paste"),Hy("cut");class zy{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,s=this._selection.endColumn;if((!this._isMovingLeft||1!==n)&&(this._isMovingLeft||s!==e.getLineMaxColumn(i)))if(this._isMovingLeft){const o=new Rh(i,n-1,i,n),r=e.getValueInRange(o);t.addEditOperation(o,null),t.addEditOperation(new Rh(i,s,i,s),r)}else{const o=new Rh(i,s,i,s+1),r=e.getValueInRange(o);t.addEditOperation(o,null),t.addEditOperation(new Rh(i,n,i,n),r)}}computeCursorState(e,t){return this._isMovingLeft?new Ah(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new Ah(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class Uy extends bh{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const s of n)i.push(new zy(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}Lh(class extends Uy{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:ue(0,"Move Selected Text Left"),alias:"Move Selected Text Left",precondition:Oh.writable})}}),Lh(class extends Uy{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:ue(0,"Move Selected Text Right"),alias:"Move Selected Text Right",precondition:Oh.writable})}});Lh(class extends bh{constructor(){super({id:"editor.action.transposeLetters",label:ue(0,"Transpose Letters"),alias:"Transpose Letters",precondition:Oh.writable,kbOpts:{kbExpr:Oh.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],s=t.getSelections();for(const o of s){if(!o.isEmpty())continue;const e=o.startLineNumber,t=o.startColumn,s=i.getLineMaxColumn(e);if(1===e&&(1===t||2===t&&2===s))continue;const r=t===s?o.getPosition():sy.rightPosition(i,o.getPosition().lineNumber,o.getPosition().column),a=sy.leftPosition(i,r),l=sy.leftPosition(i,a),h=i.getValueInRange(Rh.fromPositions(l,a)),d=i.getValueInRange(Rh.fromPositions(a,r)),c=Rh.fromPositions(l,r);n.push(new Xw(c,d+h))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}});class Ky{get event(){return this.emitter.event}constructor(e,t,i){const n=e=>this.emitter.fire(e);this.emitter=new U({onWillAddFirstListener:()=>e.addEventListener(t,n,i),onDidRemoveLastListener:()=>e.removeEventListener(t,n,i)})}dispose(){this.emitter.dispose()}}!function(e){const t={total:0,min:Number.MAX_VALUE,max:0},i=Object.assign({},t),n=Object.assign({},t),s=Object.assign({},t);let o=0;const r={keydown:0,input:0,render:0};function a(){1===r.keydown&&(performance.mark("keydown/end"),r.keydown=2)}function l(){performance.mark("input/start"),r.input=1,c()}function h(){1===r.input&&(performance.mark("input/end"),r.input=2)}function d(){1===r.render&&(performance.mark("render/end"),r.render=2)}function c(){setTimeout(u)}function u(){2===r.keydown&&2===r.input&&2===r.render&&(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"),g("keydown",t),g("input",i),g("render",n),g("inputlatency",s),o++,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"),r.keydown=0,r.input=0,r.render=0)}function g(e,t){const i=performance.getEntriesByName(e)[0].duration;t.total+=i,t.min=Math.min(t.min,i),t.max=Math.max(t.max,i)}function p(e){return{average:e.total/o,max:e.max,min:e.min}}function m(e){e.total=0,e.min=Number.MAX_VALUE,e.max=0}e.onKeyDown=function(){u(),performance.mark("inputlatency/start"),performance.mark("keydown/start"),r.keydown=1,queueMicrotask(a)},e.onBeforeInput=l,e.onInput=function(){0===r.input&&l(),queueMicrotask(h)},e.onKeyUp=function(){u()},e.onSelectionChange=function(){u()},e.onRenderStart=function(){2===r.keydown&&2===r.input&&0===r.render&&(performance.mark("render/start"),r.render=1,queueMicrotask(d),c())},e.getAndClearMeasurements=function(){if(0===o)return;const e={keydown:p(t),input:p(i),render:p(n),total:p(s),sampleCount:o};return m(t),m(i),m(n),m(s),o=0,e}}(Wy||(Wy={}));class jy{constructor(e,t,i,n,s){this.value=e,this.selectionStart=t,this.selectionEnd=i,this.selection=n,this.newlineCountBeforeSelection=s}toString(){return`[ <${this.value}>, selectionStart: ${this.selectionStart}, selectionEnd: ${this.selectionEnd}]`}static readFromTextArea(e,t){const i=e.getValue(),n=e.getSelectionStart(),s=e.getSelectionEnd();let o;if(t){i.substring(0,n)===t.value.substring(0,t.selectionStart)&&(o=t.newlineCountBeforeSelection)}return new jy(i,n,s,null,o)}collapseSelection(){return this.selectionStart===this.value.length?this:new jy(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){var t,i,n,s,o,r,a,l;if(e<=this.selectionStart){const n=this.value.substring(e,this.selectionStart);return this._finishDeduceEditorPosition(null!==(i=null===(t=this.selection)||void 0===t?void 0:t.getStartPosition())&&void 0!==i?i:null,n,-1)}if(e>=this.selectionEnd){const t=this.value.substring(this.selectionEnd,e);return this._finishDeduceEditorPosition(null!==(s=null===(n=this.selection)||void 0===n?void 0:n.getEndPosition())&&void 0!==s?s:null,t,1)}const h=this.value.substring(this.selectionStart,e);if(-1===h.indexOf(String.fromCharCode(8230)))return this._finishDeduceEditorPosition(null!==(r=null===(o=this.selection)||void 0===o?void 0:o.getStartPosition())&&void 0!==r?r:null,h,1);const d=this.value.substring(e,this.selectionEnd);return this._finishDeduceEditorPosition(null!==(l=null===(a=this.selection)||void 0===a?void 0:a.getEndPosition())&&void 0!==l?l:null,d,-1)}_finishDeduceEditorPosition(e,t,i){let n=0,s=-1;for(;-1!==(s=t.indexOf("\n",s+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(bo(e.value,t.value),e.selectionStart,t.selectionStart),s=Math.min(Co(e.value,t.value),e.value.length-e.selectionEnd,t.value.length-t.selectionEnd),o=(e.value.substring(n,e.value.length-s),t.value.substring(n,t.value.length-s)),r=e.selectionStart-n,a=e.selectionEnd-n,l=t.selectionStart-n,h=t.selectionEnd-n;if(l===h){const t=e.selectionStart-n;return{text:o,replacePrevCharCnt:t,replaceNextCharCnt:0,positionDelta:0}}return{text:o,replacePrevCharCnt:a-r,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(bo(e.value,t.value),e.selectionEnd),n=Math.min(Co(e.value,t.value),e.value.length-e.selectionEnd),s=e.value.substring(i,e.value.length-n),o=t.value.substring(i,t.value.length-n),r=(e.selectionStart,e.selectionEnd-i),a=(t.selectionStart,t.selectionEnd-i);return{text:o,replacePrevCharCnt:r,replaceNextCharCnt:s.length-r,positionDelta:a-o.length}}}jy.EMPTY=new jy("",0,0,null,void 0);class qy{static _getPageOfLine(e,t){return Math.floor((e-1)/t)}static _getRangeForPage(e,t){const i=e*t;return new Rh(i+1,1,i+t+1,1)}static fromEditorSelection(e,t,i,n){const s=500,o=qy._getPageOfLine(t.startLineNumber,i),r=qy._getRangeForPage(o,i),a=qy._getPageOfLine(t.endLineNumber,i),l=qy._getRangeForPage(a,i);let h=r.intersectRanges(new Rh(1,1,t.startLineNumber,t.startColumn));if(n&&e.getValueLengthInRange(h,1)>s){const t=e.modifyPosition(h.getEndPosition(),-500);h=Rh.fromPositions(t,h.getEndPosition())}const d=e.getValueInRange(h,1),c=e.getLineCount(),u=e.getLineMaxColumn(c);let g=l.intersectRanges(new Rh(t.endLineNumber,t.endColumn,c,u));if(n&&e.getValueLengthInRange(g,1)>s){const t=e.modifyPosition(g.getStartPosition(),s);g=Rh.fromPositions(g.getStartPosition(),t)}const p=e.getValueInRange(g,1);let m;if(o===a||o+1===a)m=e.getValueInRange(t,1);else{const i=r.intersectRanges(t),n=l.intersectRanges(t);m=e.getValueInRange(i,1)+String.fromCharCode(8230)+e.getValueInRange(n,1)}return n&&m.length>1e3&&(m=m.substring(0,s)+String.fromCharCode(8230)+m.substring(m.length-s,m.length)),new jy(d+m+p,d.length,d.length+m.length,t,h.endLineNumber-h.startLineNumber)}}var $y;!function(e){e.Tap="-monaco-textarea-synthetic-tap"}($y||($y={}));const Gy={forceCopyWithSyntaxHighlighting:!1};class Zy{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)}}Zy.INSTANCE=new Zy;class Yy{constructor(){this._lastTypeTextLength=0}handleCompositionUpdate(e){const t={text:e=e||"",replacePrevCharCnt:this._lastTypeTextLength,replaceNextCharCnt:0,positionDelta:0};return this._lastTypeTextLength=e.length,t}}class Xy extends E{get textAreaState(){return this._textAreaState}constructor(e,t,i,n){super(),this._host=e,this._textArea=t,this._OS=i,this._browser=n,this._onFocus=this._register(new U),this.onFocus=this._onFocus.event,this._onBlur=this._register(new U),this.onBlur=this._onBlur.event,this._onKeyDown=this._register(new U),this.onKeyDown=this._onKeyDown.event,this._onKeyUp=this._register(new U),this.onKeyUp=this._onKeyUp.event,this._onCut=this._register(new U),this.onCut=this._onCut.event,this._onPaste=this._register(new U),this.onPaste=this._onPaste.event,this._onType=this._register(new U),this.onType=this._onType.event,this._onCompositionStart=this._register(new U),this.onCompositionStart=this._onCompositionStart.event,this._onCompositionUpdate=this._register(new U),this.onCompositionUpdate=this._onCompositionUpdate.event,this._onCompositionEnd=this._register(new U),this.onCompositionEnd=this._onCompositionEnd.event,this._onSelectionChangeRequest=this._register(new U),this.onSelectionChangeRequest=this._onSelectionChangeRequest.event,this._asyncTriggerCut=this._register(new rd((()=>this._onCut.fire()),0)),this._asyncFocusGainWriteScreenReaderContent=this._register(new rd((()=>this.writeScreenReaderContent("asyncFocusGain")),0)),this._textAreaState=jy.EMPTY,this._selectionChangeListener=null,this.writeScreenReaderContent("ctor"),this._hasFocus=!1,this._currentComposition=null;let s=null;this._register(this._textArea.onKeyDown((e=>{const t=new St(e);(114===t.keyCode||this._currentComposition&&1===t.keyCode)&&t.stopPropagation(),t.equals(9)&&t.preventDefault(),s=t,this._onKeyDown.fire(t)}))),this._register(this._textArea.onKeyUp((e=>{const t=new St(e);this._onKeyUp.fire(t)}))),this._register(this._textArea.onCompositionStart((e=>{const t=new Yy;if(this._currentComposition)this._currentComposition=t;else{if(this._currentComposition=t,2===this._OS&&s&&s.equals(114)&&this._textAreaState.selectionStart===this._textAreaState.selectionEnd&&this._textAreaState.selectionStart>0&&this._textAreaState.value.substr(this._textAreaState.selectionStart-1,1)===e.data&&("ArrowRight"===s.code||"ArrowLeft"===s.code))return t.handleCompositionUpdate("x"),void this._onCompositionStart.fire({data:e.data});this._browser.isAndroid,this._onCompositionStart.fire({data:e.data})}}))),this._register(this._textArea.onCompositionUpdate((e=>{const t=this._currentComposition;if(!t)return;if(this._browser.isAndroid){const t=jy.readFromTextArea(this._textArea,this._textAreaState),i=jy.deduceAndroidCompositionInput(this._textAreaState,t);return this._textAreaState=t,this._onType.fire(i),void this._onCompositionUpdate.fire(e)}const i=t.handleCompositionUpdate(e.data);this._textAreaState=jy.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(i),this._onCompositionUpdate.fire(e)}))),this._register(this._textArea.onCompositionEnd((e=>{const t=this._currentComposition;if(!t)return;if(this._currentComposition=null,this._browser.isAndroid){const e=jy.readFromTextArea(this._textArea,this._textAreaState),t=jy.deduceAndroidCompositionInput(this._textAreaState,e);return this._textAreaState=e,this._onType.fire(t),void this._onCompositionEnd.fire()}const i=t.handleCompositionUpdate(e.data);this._textAreaState=jy.readFromTextArea(this._textArea,this._textAreaState),this._onType.fire(i),this._onCompositionEnd.fire()}))),this._register(this._textArea.onInput((e=>{if(this._textArea.setIgnoreSelectionChangeTime("received input event"),this._currentComposition)return;const t=jy.readFromTextArea(this._textArea,this._textAreaState),i=jy.deduceInput(this._textAreaState,t,2===this._OS);(0!==i.replacePrevCharCnt||1!==i.text.length||!wo(i.text.charCodeAt(0))&&127!==i.text.charCodeAt(0))&&(this._textAreaState=t,""===i.text&&0===i.replacePrevCharCnt&&0===i.replaceNextCharCnt&&0===i.positionDelta||this._onType.fire(i))}))),this._register(this._textArea.onCut((e=>{this._textArea.setIgnoreSelectionChangeTime("received cut event"),this._ensureClipboardGetsEditorSelection(e),this._asyncTriggerCut.schedule()}))),this._register(this._textArea.onCopy((e=>{this._ensureClipboardGetsEditorSelection(e)}))),this._register(this._textArea.onPaste((e=>{if(this._textArea.setIgnoreSelectionChangeTime("received paste event"),e.preventDefault(),!e.clipboardData)return;let[t,i]=Qy.getTextData(e.clipboardData);t&&(i=i||Zy.INSTANCE.get(t),this._onPaste.fire({text:t,metadata:i}))}))),this._register(this._textArea.onFocus((()=>{const e=this._hasFocus;this._setHasFocus(!0),this._browser.isSafari&&!e&&this._hasFocus&&this._asyncFocusGainWriteScreenReaderContent.schedule()}))),this._register(this._textArea.onBlur((()=>{this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("blurWithoutCompositionEnd"),this._onCompositionEnd.fire()),this._setHasFocus(!1)}))),this._register(this._textArea.onSyntheticTap((()=>{this._browser.isAndroid&&this._currentComposition&&(this._currentComposition=null,this.writeScreenReaderContent("tapWithoutCompositionEnd"),this._onCompositionEnd.fire())})))}_installSelectionChangeListener(){let e=0;return En(this._textArea.ownerDocument,"selectionchange",(t=>{if(Wy.onSelectionChange(),!this._hasFocus)return;if(this._currentComposition)return;if(!this._browser.isChrome)return;const i=Date.now(),n=i-e;if(e=i,n<5)return;const s=i-this._textArea.getIgnoreSelectionChangeTime();if(this._textArea.resetSelectionChangeTime(),s<100)return;if(!this._textAreaState.selection)return;const o=this._textArea.getValue();if(this._textAreaState.value!==o)return;const r=this._textArea.getSelectionStart(),a=this._textArea.getSelectionEnd();if(this._textAreaState.selectionStart===r&&this._textAreaState.selectionEnd===a)return;const l=this._textAreaState.deduceEditorPosition(r),h=this._host.deduceModelPosition(l[0],l[1],l[2]),d=this._textAreaState.deduceEditorPosition(a),c=this._host.deduceModelPosition(d[0],d[1],d[2]),u=new Ah(h.lineNumber,h.column,c.lineNumber,c.column);this._onSelectionChangeRequest.fire(u)}))}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.writeScreenReaderContent("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}writeScreenReaderContent(e){this._currentComposition||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};Zy.INSTANCE.set(this._browser.isFirefox?t.text.replace(/\r\n/g,"\n"):t.text,i),e.preventDefault(),e.clipboardData&&Qy.setTextData(e.clipboardData,t.text,t.html,i)}}const Qy={getTextData(e){const t=e.getData(Lu.text);let i=null;const n=e.getData("vscode-editor-data");if("string"==typeof n)try{i=JSON.parse(n),1!==i.version&&(i=null)}catch(s){}if(0===t.length&&null===i&&e.files.length>0){return[Array.prototype.slice.call(e.files,0).map((e=>e.name)).join("\n"),null]}return[t,i]},setTextData(e,t,i,n){e.setData(Lu.text,t),"string"==typeof i&&e.setData("text/html",i),e.setData("vscode-editor-data",JSON.stringify(n))}};class Jy extends E{get ownerDocument(){return this._actual.ownerDocument}constructor(e){super(),this._actual=e,this.onKeyDown=this._register(new Ky(this._actual,"keydown")).event,this.onKeyUp=this._register(new Ky(this._actual,"keyup")).event,this.onCompositionStart=this._register(new Ky(this._actual,"compositionstart")).event,this.onCompositionUpdate=this._register(new Ky(this._actual,"compositionupdate")).event,this.onCompositionEnd=this._register(new Ky(this._actual,"compositionend")).event,this.onBeforeInput=this._register(new Ky(this._actual,"beforeinput")).event,this.onInput=this._register(new Ky(this._actual,"input")).event,this.onCut=this._register(new Ky(this._actual,"cut")).event,this.onCopy=this._register(new Ky(this._actual,"copy")).event,this.onPaste=this._register(new Ky(this._actual,"paste")).event,this.onFocus=this._register(new Ky(this._actual,"focus")).event,this.onBlur=this._register(new Ky(this._actual,"blur")).event,this._onSyntheticTap=this._register(new U),this.onSyntheticTap=this._onSyntheticTap.event,this._ignoreSelectionChangeTime=0,this._register(this.onKeyDown((()=>Wy.onKeyDown()))),this._register(this.onBeforeInput((()=>Wy.onBeforeInput()))),this._register(this.onInput((()=>Wy.onInput()))),this._register(this.onKeyUp((()=>Wy.onKeyUp()))),this._register(En(this._actual,$y.Tap,(()=>this._onSyntheticTap.fire())))}hasFocus(){const e=Yn(this._actual);return e?e.activeElement===this._actual:!!xn(this._actual)&&this._actual.ownerDocument.activeElement===this._actual}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"backward"===this._actual.selectionDirection?this._actual.selectionEnd:this._actual.selectionStart}getSelectionEnd(){return"backward"===this._actual.selectionDirection?this._actual.selectionStart:this._actual.selectionEnd}setSelectionRange(e,t,i){const n=this._actual;let s=null;const o=Yn(n);s=o?o.activeElement:n.ownerDocument.activeElement;const r=s===n,a=n.selectionStart,l=n.selectionEnd;if(r&&a===t&&l===i)ne&&window.parent!==window&&n.focus();else{if(r)return this.setIgnoreSelectionChangeTime("setSelectionRange"),n.setSelectionRange(t,i),void(ne&&window.parent!==window&&n.focus());try{const e=function(e){const t=[];for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)t[i]=e.scrollTop,e=e.parentNode;return t}(n);this.setIgnoreSelectionChangeTime("setSelectionRange"),n.focus(),n.setSelectionRange(t,i),function(e,t){for(let i=0;e&&e.nodeType===e.ELEMENT_NODE;i++)e.scrollTop!==t[i]&&(e.scrollTop=t[i]),e=e.parentNode}(n,e)}catch(Mre){}}}}const eS=Ba("clipboardService");var tS=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const iS="9_cutcopypaste",nS=Be||document.queryCommandSupported("cut"),sS=Be||document.queryCommandSupported("copy"),oS=void 0!==navigator.clipboard&&!ne||document.queryCommandSupported("paste");function rS(e){return e.register(),e}const aS=nS?rS(new fh({id:"editor.action.clipboardCutAction",precondition:void 0,kbOpts:Be?{primary:2102,win:{primary:2102,secondary:[1044]},weight:100}:void 0,menuOpts:[{menuId:eh.MenubarEditMenu,group:"2_ccp",title:ue(0,"Cu&&t"),order:1},{menuId:eh.EditorContext,group:iS,title:ue(0,"Cut"),when:Oh.writable,order:1},{menuId:eh.CommandPalette,group:"",title:ue(0,"Cut"),order:1},{menuId:eh.SimpleEditorContext,group:iS,title:ue(0,"Cut"),when:Oh.writable,order:1}]})):void 0,lS=sS?rS(new fh({id:"editor.action.clipboardCopyAction",precondition:void 0,kbOpts:Be?{primary:2081,win:{primary:2081,secondary:[2067]},weight:100}:void 0,menuOpts:[{menuId:eh.MenubarEditMenu,group:"2_ccp",title:ue(0,"&&Copy"),order:2},{menuId:eh.EditorContext,group:iS,title:ue(0,"Copy"),order:2},{menuId:eh.CommandPalette,group:"",title:ue(0,"Copy"),order:1},{menuId:eh.SimpleEditorContext,group:iS,title:ue(0,"Copy"),order:2}]})):void 0;nh.appendMenuItem(eh.MenubarEditMenu,{submenu:eh.MenubarCopy,title:{value:ue(0,"Copy As"),original:"Copy As"},group:"2_ccp",order:3}),nh.appendMenuItem(eh.EditorContext,{submenu:eh.EditorContextCopy,title:{value:ue(0,"Copy As"),original:"Copy As"},group:iS,order:3}),nh.appendMenuItem(eh.EditorContext,{submenu:eh.EditorContextShare,title:{value:ue(0,"Share"),original:"Share"},group:"11_share",order:-1,when:pl.and(pl.notEquals("resourceScheme","output"),Oh.editorTextFocus)}),nh.appendMenuItem(eh.EditorTitleContext,{submenu:eh.EditorTitleContextShare,title:{value:ue(0,"Share"),original:"Share"},group:"11_share",order:-1}),nh.appendMenuItem(eh.ExplorerContext,{submenu:eh.ExplorerContextShare,title:{value:ue(0,"Share"),original:"Share"},group:"11_share",order:-1});const hS=oS?rS(new fh({id:"editor.action.clipboardPasteAction",precondition:void 0,kbOpts:Be?{primary:2100,win:{primary:2100,secondary:[1043]},linux:{primary:2100,secondary:[1043]},weight:100}:void 0,menuOpts:[{menuId:eh.MenubarEditMenu,group:"2_ccp",title:ue(0,"&&Paste"),order:4},{menuId:eh.EditorContext,group:iS,title:ue(0,"Paste"),when:Oh.writable,order:4},{menuId:eh.CommandPalette,group:"",title:ue(0,"Paste"),order:1},{menuId:eh.SimpleEditorContext,group:iS,title:ue(0,"Paste"),when:Oh.writable,order:4}]})):void 0;class dS extends bh{constructor(){super({id:"editor.action.clipboardCopyWithSyntaxHighlightingAction",label:ue(0,"Copy With Syntax Highlighting"),alias:"Copy With Syntax Highlighting",precondition:void 0,kbOpts:{kbExpr:Oh.textInputFocus,primary:0,weight:100}})}run(e,t){if(!t.hasModel())return;!t.getOption(37)&&t.getSelection().isEmpty()||(Gy.forceCopyWithSyntaxHighlighting=!0,t.focus(),t.getContainerDomNode().ownerDocument.execCommand("copy"),Gy.forceCopyWithSyntaxHighlighting=!1)}}function cS(e,t){e&&(e.addImplementation(1e4,"code-editor",((e,i)=>{const n=e.get(Wa).getFocusedCodeEditor();if(n&&n.hasTextFocus()){const e=n.getOption(37),i=n.getSelection();return i&&i.isEmpty()&&!e||n.getContainerDomNode().ownerDocument.execCommand(t),!0}return!1})),e.addImplementation(0,"generic-dom",((e,i)=>(Qn().execCommand(t),!0))))}cS(aS,"cut"),cS(lS,"copy"),hS&&(hS.addImplementation(1e4,"code-editor",((e,t)=>{const i=e.get(Wa),n=e.get(eS),s=i.getFocusedCodeEditor();if(s&&s.hasTextFocus()){return!(!s.getContainerDomNode().ownerDocument.execCommand("paste")&&We)||tS(void 0,void 0,void 0,(function*(){const e=yield n.readText();if(""!==e){const t=Zy.INSTANCE.get(e);let i=!1,n=null,o=null;t&&(i=s.getOption(37)&&!!t.isFromEmptySelection,n=void 0!==t.multicursorText?t.multicursorText:null,o=t.mode),s.trigger("keyboard","paste",{text:e,pasteOnNewLine:i,multicursorText:n,mode:o})}}))}return!1})),hS.addImplementation(0,"generic-dom",((e,t)=>(Qn().execCommand("paste"),!0)))),sS&&Lh(dS);const uS={enableSplitViewResizing:!0,splitViewDefaultRatio:.5,renderSideBySide:!0,renderMarginRevertIcon:!0,maxComputationTime:5e3,maxFileSize:50,ignoreTrimWhitespace:!0,renderIndicators:!0,originalEditable:!1,diffCodeLens:!1,renderOverviewRuler:!0,diffWordWrap:"inherit",diffAlgorithm:"advanced",accessibilityVerbose:!1,experimental:{showMoves:!1,showEmptyDecorations:!0},hideUnchangedRegions:{enabled:!1,contextLineCount:3,minimumLineCount:3,revealLineCount:20},isInEmbeddedEditor:!1,onlyShowAccessibleDiffViewer:!1,renderSideBySideInlineBreakpoint:900,useInlineViewWhenSpaceIsLimited:!0};class gS{constructor(e){this._values=e}hasChanged(e){return this._values[e]}}class pS{constructor(){this.stableMinimapLayoutInput=null,this.stableFitMaxMinimapScale=0,this.stableFitRemainingWidth=0}}class mS{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return _S(e,t)}compute(e,t,i){return i}}class fS{constructor(e,t){this.newValue=e,this.didChange=t}}function _S(e,t){if("object"!=typeof e||"object"!=typeof t||!e||!t)return new fS(t,e!==t);if(Array.isArray(e)||Array.isArray(t)){const i=Array.isArray(e)&&Array.isArray(t)&&Td(e,t);return new fS(t,!i)}let i=!1;for(const n in t)if(t.hasOwnProperty(n)){const s=_S(e[n],t[n]);s.didChange&&(e[n]=s.newValue,i=!0)}return new fS(e,i)}class vS{constructor(e){this.schema=void 0,this.id=e,this.name="_never_",this.defaultValue=void 0}applyUpdate(e,t){return _S(e,t)}validate(e){return this.defaultValue}}class bS{constructor(e,t,i,n){this.id=e,this.name=t,this.defaultValue=i,this.schema=n}applyUpdate(e,t){return _S(e,t)}validate(e){return void 0===e?this.defaultValue:e}compute(e,t,i){return i}}function CS(e,t){return void 0===e?t:"false"!==e&&Boolean(e)}class wS extends bS{constructor(e,t,i,n=void 0){void 0!==n&&(n.type="boolean",n.default=i),super(e,t,i,n)}validate(e){return CS(e,this.defaultValue)}}function yS(e,t,i,n){if(void 0===e)return t;let s=parseInt(e,10);return isNaN(s)?t:(s=Math.max(i,s),s=Math.min(n,s),0|s)}class SS extends bS{static clampedInt(e,t,i,n){return yS(e,t,i,n)}constructor(e,t,i,n,s,o=void 0){void 0!==o&&(o.type="integer",o.default=i,o.minimum=n,o.maximum=s),super(e,t,i,o),this.minimum=n,this.maximum=s}validate(e){return SS.clampedInt(e,this.defaultValue,this.minimum,this.maximum)}}function LS(e,t,i,n){if(void 0===e)return t;const s=kS.float(e,t);return kS.clamp(s,i,n)}class kS extends bS{static clamp(e,t,i){return ei?i:e}static float(e,t){if("number"==typeof e)return e;if(void 0===e)return t;const i=parseFloat(e);return isNaN(i)?t:i}constructor(e,t,i,n,s){void 0!==s&&(s.type="number",s.default=i),super(e,t,i,s),this.validationFn=n}validate(e){return this.validationFn(kS.float(e,this.defaultValue))}}class DS extends bS{static string(e,t){return"string"!=typeof e?t:e}constructor(e,t,i,n=void 0){void 0!==n&&(n.type="string",n.default=i),super(e,t,i,n)}validate(e){return DS.string(e,this.defaultValue)}}function xS(e,t,i,n){return"string"!=typeof e?t:n&&e in n?n[e]:-1===i.indexOf(e)?t:e}class NS extends bS{constructor(e,t,i,n,s=void 0){void 0!==s&&(s.type="string",s.enum=n,s.default=i),super(e,t,i,s),this._allowedValues=n}validate(e){return xS(e,this.defaultValue,this._allowedValues)}}class ES extends mS{constructor(e,t,i,n,s,o,r=void 0){void 0!==r&&(r.type="string",r.enum=s,r.default=n),super(e,t,i,r),this._allowedValues=s,this._convert=o}validate(e){return"string"!=typeof e||-1===this._allowedValues.indexOf(e)?this.defaultValue:this._convert(e)}}var IS;!function(e){e[e.Line=1]="Line",e[e.Block=2]="Block",e[e.Underline=3]="Underline",e[e.LineThin=4]="LineThin",e[e.BlockOutline=5]="BlockOutline",e[e.UnderlineThin=6]="UnderlineThin"}(IS||(IS={}));class MS extends mS{constructor(){super(51,"fontLigatures",MS.OFF,{anyOf:[{type:"boolean",description:ue(0,"Enables/Disables font ligatures ('calt' and 'liga' font features). Change this to a string for fine-grained control of the 'font-feature-settings' CSS property.")},{type:"string",description:ue(0,"Explicit 'font-feature-settings' CSS property. A boolean can be passed instead if one only needs to turn on/off ligatures.")}],description:ue(0,"Configures font ligatures or font features. Can be either a boolean to enable/disable ligatures or a string for the value of the CSS 'font-feature-settings' property."),default:!1})}validate(e){return void 0===e?this.defaultValue:"string"==typeof e?"false"===e?MS.OFF:"true"===e?MS.ON:e:Boolean(e)?MS.ON:MS.OFF}}MS.OFF='"liga" off, "calt" off',MS.ON='"liga" on, "calt" on';class TS extends mS{constructor(){super(54,"fontVariations",TS.OFF,{anyOf:[{type:"boolean",description:ue(0,"Enables/Disables the translation from font-weight to font-variation-settings. Change this to a string for fine-grained control of the 'font-variation-settings' CSS property.")},{type:"string",description:ue(0,"Explicit 'font-variation-settings' CSS property. A boolean can be passed instead if one only needs to translate font-weight to font-variation-settings.")}],description:ue(0,"Configures font variations. Can be either a boolean to enable/disable the translation from font-weight to font-variation-settings or a string for the value of the CSS 'font-variation-settings' property."),default:!1})}validate(e){return void 0===e?this.defaultValue:"string"==typeof e?"false"===e?TS.OFF:"true"===e?TS.TRANSLATE:e:Boolean(e)?TS.TRANSLATE:TS.OFF}compute(e,t,i){return e.fontInfo.fontVariationSettings}}TS.OFF="normal",TS.TRANSLATE="translate";class RS extends mS{constructor(){super(53,"fontWeight",qS.fontWeight,{anyOf:[{type:"number",minimum:RS.MINIMUM_VALUE,maximum:RS.MAXIMUM_VALUE,errorMessage:ue(0,'Only "normal" and "bold" keywords or numbers between 1 and 1000 are allowed.')},{type:"string",pattern:"^(normal|bold|1000|[1-9][0-9]{0,2})$"},{enum:RS.SUGGESTION_VALUES}],default:qS.fontWeight,description:ue(0,'Controls the font weight. Accepts "normal" and "bold" keywords or numbers between 1 and 1000.')})}validate(e){return"normal"===e||"bold"===e?e:String(SS.clampedInt(e,qS.fontWeight,RS.MINIMUM_VALUE,RS.MAXIMUM_VALUE))}}RS.SUGGESTION_VALUES=["normal","bold","100","200","300","400","500","600","700","800","900"],RS.MINIMUM_VALUE=1,RS.MAXIMUM_VALUE=1e3;class AS extends vS{constructor(){super(143)}compute(e,t,i){return AS.computeLayout(t,{memory:e.memory,outerWidth:e.outerWidth,outerHeight:e.outerHeight,isDominatedByLongLines:e.isDominatedByLongLines,lineHeight:e.fontInfo.lineHeight,viewLineCount:e.viewLineCount,lineNumbersDigitCount:e.lineNumbersDigitCount,typicalHalfwidthCharacterWidth:e.fontInfo.typicalHalfwidthCharacterWidth,maxDigitWidth:e.fontInfo.maxDigitWidth,pixelRatio:e.pixelRatio,glyphMarginDecorationLaneCount:e.glyphMarginDecorationLaneCount})}static computeContainedMinimapLineCount(e){const t=e.height/e.lineHeight,i=Math.floor(e.paddingTop/e.lineHeight);let n=Math.floor(e.paddingBottom/e.lineHeight);e.scrollBeyondLastLine&&(n=Math.max(n,t-1));const s=(i+e.viewLineCount+n)/(e.pixelRatio*e.height);return{typicalViewportLineCount:t,extraLinesBeforeFirstLine:i,extraLinesBeyondLastLine:n,desiredRatio:s,minimapLineCount:Math.floor(e.viewLineCount/s)}}static _computeMinimapLayout(e,t){const i=e.outerWidth,n=e.outerHeight,s=e.pixelRatio;if(!e.minimap.enabled)return{renderMinimap:0,minimapLeft:0,minimapWidth:0,minimapHeightIsEditorHeight:!1,minimapIsSampling:!1,minimapScale:1,minimapLineHeight:1,minimapCanvasInnerWidth:0,minimapCanvasInnerHeight:Math.floor(s*n),minimapCanvasOuterWidth:0,minimapCanvasOuterHeight:n};const o=t.stableMinimapLayoutInput,r=o&&e.outerHeight===o.outerHeight&&e.lineHeight===o.lineHeight&&e.typicalHalfwidthCharacterWidth===o.typicalHalfwidthCharacterWidth&&e.pixelRatio===o.pixelRatio&&e.scrollBeyondLastLine===o.scrollBeyondLastLine&&e.paddingTop===o.paddingTop&&e.paddingBottom===o.paddingBottom&&e.minimap.enabled===o.minimap.enabled&&e.minimap.side===o.minimap.side&&e.minimap.size===o.minimap.size&&e.minimap.showSlider===o.minimap.showSlider&&e.minimap.renderCharacters===o.minimap.renderCharacters&&e.minimap.maxColumn===o.minimap.maxColumn&&e.minimap.scale===o.minimap.scale&&e.verticalScrollbarWidth===o.verticalScrollbarWidth&&e.isViewportWrapping===o.isViewportWrapping,a=e.lineHeight,l=e.typicalHalfwidthCharacterWidth,h=e.scrollBeyondLastLine,d=e.minimap.renderCharacters;let c=s>=2?Math.round(2*e.minimap.scale):e.minimap.scale;const u=e.minimap.maxColumn,g=e.minimap.size,p=e.minimap.side,m=e.verticalScrollbarWidth,f=e.viewLineCount,_=e.remainingWidth,v=e.isViewportWrapping,b=d?2:3;let C=Math.floor(s*n);const w=C/s;let y=!1,S=!1,L=b*c,k=c/s,D=1;if("fill"===g||"fit"===g){const{typicalViewportLineCount:i,extraLinesBeforeFirstLine:o,extraLinesBeyondLastLine:l,desiredRatio:d,minimapLineCount:u}=AS.computeContainedMinimapLineCount({viewLineCount:f,scrollBeyondLastLine:h,paddingTop:e.paddingTop,paddingBottom:e.paddingBottom,height:n,lineHeight:a,pixelRatio:s});if(f/u>1)y=!0,S=!0,c=1,L=1,k=c/s;else{let n=!1,h=c+1;if("fit"===g){const e=Math.ceil((o+f+l)*L);v&&r&&_<=t.stableFitRemainingWidth?(n=!0,h=t.stableFitMaxMinimapScale):n=e>C}if("fill"===g||n){y=!0;const n=c;L=Math.min(a*s,Math.max(1,Math.floor(1/d))),v&&r&&_<=t.stableFitRemainingWidth&&(h=t.stableFitMaxMinimapScale),c=Math.min(h,Math.max(1,Math.floor(L/b))),c>n&&(D=Math.min(2,c/n)),k=c/s/D,C=Math.ceil(Math.max(i,o+f+l)*L),v?(t.stableMinimapLayoutInput=e,t.stableFitRemainingWidth=_,t.stableFitMaxMinimapScale=c):(t.stableMinimapLayoutInput=null,t.stableFitRemainingWidth=0)}}}const x=Math.floor(u*k),N=Math.min(x,Math.max(0,Math.floor((_-m-2)*k/(l+k)))+8);let E=Math.floor(s*N);const I=E/s;E=Math.floor(E*D);return{renderMinimap:d?1:2,minimapLeft:"left"===p?0:i-N-m,minimapWidth:N,minimapHeightIsEditorHeight:y,minimapIsSampling:S,minimapScale:c,minimapLineHeight:L,minimapCanvasInnerWidth:E,minimapCanvasInnerHeight:C,minimapCanvasOuterWidth:I,minimapCanvasOuterHeight:w}}static computeLayout(e,t){const i=0|t.outerWidth,n=0|t.outerHeight,s=0|t.lineHeight,o=0|t.lineNumbersDigitCount,r=t.typicalHalfwidthCharacterWidth,a=t.maxDigitWidth,l=t.pixelRatio,h=t.viewLineCount,d=e.get(135),c="inherit"===d?e.get(134):d,u="inherit"===c?e.get(130):c,g=e.get(133),p=t.isDominatedByLongLines,m=e.get(57),f=0!==e.get(67).renderType,_=e.get(68),v=e.get(104),b=e.get(83),C=e.get(72),w=e.get(102),y=w.verticalScrollbarSize,S=w.verticalHasArrows,L=w.arrowSize,k=w.horizontalScrollbarSize,D=e.get(43),x="never"!==e.get(109);let N=e.get(65);D&&x&&(N+=16);let E=0;if(f){const e=Math.max(o,_);E=Math.round(e*a)}let I=0;m&&(I=s*t.glyphMarginDecorationLaneCount);let M=0,T=M+I,R=T+E,A=R+N;const O=i-I-E-N;let P=!1,F=!1,B=-1;"inherit"===c&&p?(P=!0,F=!0):"on"===u||"bounded"===u?F=!0:"wordWrapColumn"===u&&(B=g);const W=AS._computeMinimapLayout({outerWidth:i,outerHeight:n,lineHeight:s,typicalHalfwidthCharacterWidth:r,pixelRatio:l,scrollBeyondLastLine:v,paddingTop:b.top,paddingBottom:b.bottom,minimap:C,verticalScrollbarWidth:y,viewLineCount:h,remainingWidth:O,isViewportWrapping:F},t.memory||new pS);0!==W.renderMinimap&&0===W.minimapLeft&&(M+=W.minimapWidth,T+=W.minimapWidth,R+=W.minimapWidth,A+=W.minimapWidth);const V=O-W.minimapWidth,H=Math.max(1,Math.floor((V-y-2)/r)),z=S?L:0;return F&&(B=Math.max(1,H),"bounded"===u&&(B=Math.min(B,g))),{width:i,height:n,glyphMarginLeft:M,glyphMarginWidth:I,glyphMarginDecorationLaneCount:t.glyphMarginDecorationLaneCount,lineNumbersLeft:T,lineNumbersWidth:E,decorationsLeft:R,decorationsWidth:N,contentLeft:A,contentWidth:V,minimap:W,viewportColumn:H,isWordWrapMinified:P,isViewportWrapping:F,wrappingColumn:B,verticalScrollbarWidth:y,horizontalScrollbarHeight:k,overviewRuler:{top:z,width:y,height:n-2*z,right:0}}}}function OS(e){const t=e.get(97);return"editable"===t?e.get(90):"on"!==t}function PS(e,t){if("string"!=typeof e)return t;switch(e){case"hidden":return 2;case"visible":return 3;default:return 1}}const FS="inUntrustedWorkspace",BS="editor.unicodeHighlight.allowedCharacters",WS="editor.unicodeHighlight.invisibleCharacters",VS="editor.unicodeHighlight.nonBasicASCII",HS="editor.unicodeHighlight.ambiguousCharacters",zS="editor.unicodeHighlight.includeComments",US="editor.unicodeHighlight.includeStrings",KS="editor.unicodeHighlight.allowedLocales";function jS(e,t,i){const n=i.indexOf(e);return-1===n?t:i[n]}const qS={fontFamily:Pe?"Menlo, Monaco, 'Courier New', monospace":Fe?"'Droid Sans Mono', 'monospace', monospace":"Consolas, 'Courier New', monospace",fontWeight:"normal",fontSize:Pe?12:14,lineHeight:0,letterSpacing:0},$S=[];function GS(e){return $S[e.id]=e,e}const ZS={acceptSuggestionOnCommitCharacter:GS(new wS(0,"acceptSuggestionOnCommitCharacter",!0,{markdownDescription:ue(0,"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:GS(new NS(1,"acceptSuggestionOnEnter","on",["on","smart","off"],{markdownEnumDescriptions:["",ue(0,"Only accept a suggestion with `Enter` when it makes a textual change."),""],markdownDescription:ue(0,"Controls whether suggestions should be accepted on `Enter`, in addition to `Tab`. Helps to avoid ambiguity between inserting new lines or accepting suggestions.")})),accessibilitySupport:GS(new class extends mS{constructor(){super(2,"accessibilitySupport",0,{type:"string",enum:["auto","on","off"],enumDescriptions:[ue(0,"Use platform APIs to detect when a Screen Reader is attached"),ue(0,"Optimize for usage with a Screen Reader"),ue(0,"Assume a screen reader is not attached")],default:"auto",tags:["accessibility"],description:ue(0,"Controls if the UI should run in a mode where it is optimized for screen readers.")})}validate(e){switch(e){case"auto":return 0;case"off":return 1;case"on":return 2}return this.defaultValue}compute(e,t,i){return 0===i?e.accessibilitySupport:i}}),accessibilityPageSize:GS(new SS(3,"accessibilityPageSize",10,1,1073741824,{description:ue(0,"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:GS(new DS(4,"ariaLabel",ue(0,"Editor content"))),ariaRequired:GS(new wS(5,"ariaRequired",!1,void 0)),screenReaderAnnounceInlineSuggestion:GS(new wS(8,"screenReaderAnnounceInlineSuggestion",!0,{description:ue(0,"Control whether inline suggestions are announced by a screen reader."),tags:["accessibility"]})),autoClosingBrackets:GS(new NS(6,"autoClosingBrackets","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",ue(0,"Use language configurations to determine when to autoclose brackets."),ue(0,"Autoclose brackets only when the cursor is to the left of whitespace."),""],description:ue(0,"Controls whether the editor should automatically close brackets after the user adds an opening bracket.")})),autoClosingComments:GS(new NS(7,"autoClosingComments","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",ue(0,"Use language configurations to determine when to autoclose comments."),ue(0,"Autoclose comments only when the cursor is to the left of whitespace."),""],description:ue(0,"Controls whether the editor should automatically close comments after the user adds an opening comment.")})),autoClosingDelete:GS(new NS(9,"autoClosingDelete","auto",["always","auto","never"],{enumDescriptions:["",ue(0,"Remove adjacent closing quotes or brackets only if they were automatically inserted."),""],description:ue(0,"Controls whether the editor should remove adjacent closing quotes or brackets when deleting.")})),autoClosingOvertype:GS(new NS(10,"autoClosingOvertype","auto",["always","auto","never"],{enumDescriptions:["",ue(0,"Type over closing quotes or brackets only if they were automatically inserted."),""],description:ue(0,"Controls whether the editor should type over closing quotes or brackets.")})),autoClosingQuotes:GS(new NS(11,"autoClosingQuotes","languageDefined",["always","languageDefined","beforeWhitespace","never"],{enumDescriptions:["",ue(0,"Use language configurations to determine when to autoclose quotes."),ue(0,"Autoclose quotes only when the cursor is to the left of whitespace."),""],description:ue(0,"Controls whether the editor should automatically close quotes after the user adds an opening quote.")})),autoIndent:GS(new ES(12,"autoIndent",4,"full",["none","keep","brackets","advanced","full"],(function(e){switch(e){case"none":return 0;case"keep":return 1;case"brackets":return 2;case"advanced":return 3;case"full":return 4}}),{enumDescriptions:[ue(0,"The editor will not insert indentation automatically."),ue(0,"The editor will keep the current line's indentation."),ue(0,"The editor will keep the current line's indentation and honor language defined brackets."),ue(0,"The editor will keep the current line's indentation, honor language defined brackets and invoke special onEnterRules defined by languages."),ue(0,"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:ue(0,"Controls whether the editor should automatically adjust the indentation when users type, paste, move or indent lines.")})),automaticLayout:GS(new wS(13,"automaticLayout",!1)),autoSurround:GS(new NS(14,"autoSurround","languageDefined",["languageDefined","quotes","brackets","never"],{enumDescriptions:[ue(0,"Use language configurations to determine when to automatically surround selections."),ue(0,"Surround with quotes but not brackets."),ue(0,"Surround with brackets but not quotes."),""],description:ue(0,"Controls whether the editor should automatically surround selections when typing quotes or brackets.")})),bracketPairColorization:GS(new class extends mS{constructor(){const e={enabled:Sc.bracketPairColorizationOptions.enabled,independentColorPoolPerBracketType:Sc.bracketPairColorizationOptions.independentColorPoolPerBracketType};super(15,"bracketPairColorization",e,{"editor.bracketPairColorization.enabled":{type:"boolean",default:e.enabled,markdownDescription:ue(0,"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:ue(0,"Controls whether each bracket type has its own independent color pool.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:CS(t.enabled,this.defaultValue.enabled),independentColorPoolPerBracketType:CS(t.independentColorPoolPerBracketType,this.defaultValue.independentColorPoolPerBracketType)}}}),bracketPairGuides:GS(new class extends mS{constructor(){const e={bracketPairs:!1,bracketPairsHorizontal:"active",highlightActiveBracketPair:!0,indentation:!0,highlightActiveIndentation:!0};super(16,"guides",e,{"editor.guides.bracketPairs":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[ue(0,"Enables bracket pair guides."),ue(0,"Enables bracket pair guides only for the active bracket pair."),ue(0,"Disables bracket pair guides.")],default:e.bracketPairs,description:ue(0,"Controls whether bracket pair guides are enabled or not.")},"editor.guides.bracketPairsHorizontal":{type:["boolean","string"],enum:[!0,"active",!1],enumDescriptions:[ue(0,"Enables horizontal guides as addition to vertical bracket pair guides."),ue(0,"Enables horizontal guides only for the active bracket pair."),ue(0,"Disables horizontal bracket pair guides.")],default:e.bracketPairsHorizontal,description:ue(0,"Controls whether horizontal bracket pair guides are enabled or not.")},"editor.guides.highlightActiveBracketPair":{type:"boolean",default:e.highlightActiveBracketPair,description:ue(0,"Controls whether the editor should highlight the active bracket pair.")},"editor.guides.indentation":{type:"boolean",default:e.indentation,description:ue(0,"Controls whether the editor should render indent guides.")},"editor.guides.highlightActiveIndentation":{type:["boolean","string"],enum:[!0,"always",!1],enumDescriptions:[ue(0,"Highlights the active indent guide."),ue(0,"Highlights the active indent guide even if bracket guides are highlighted."),ue(0,"Do not highlight the active indent guide.")],default:e.highlightActiveIndentation,description:ue(0,"Controls whether the editor should highlight the active indent guide.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{bracketPairs:jS(t.bracketPairs,this.defaultValue.bracketPairs,[!0,!1,"active"]),bracketPairsHorizontal:jS(t.bracketPairsHorizontal,this.defaultValue.bracketPairsHorizontal,[!0,!1,"active"]),highlightActiveBracketPair:CS(t.highlightActiveBracketPair,this.defaultValue.highlightActiveBracketPair),indentation:CS(t.indentation,this.defaultValue.indentation),highlightActiveIndentation:jS(t.highlightActiveIndentation,this.defaultValue.highlightActiveIndentation,[!0,!1,"always"])}}}),stickyTabStops:GS(new wS(115,"stickyTabStops",!1,{description:ue(0,"Emulate selection behavior of tab characters when using spaces for indentation. Selection will stick to tab stops.")})),codeLens:GS(new wS(17,"codeLens",!0,{description:ue(0,"Controls whether the editor shows CodeLens.")})),codeLensFontFamily:GS(new DS(18,"codeLensFontFamily","",{description:ue(0,"Controls the font family for CodeLens.")})),codeLensFontSize:GS(new SS(19,"codeLensFontSize",0,0,100,{type:"number",default:0,minimum:0,maximum:100,markdownDescription:ue(0,"Controls the font size in pixels for CodeLens. When set to 0, 90% of `#editor.fontSize#` is used.")})),colorDecorators:GS(new wS(20,"colorDecorators",!0,{description:ue(0,"Controls whether the editor should render the inline color decorators and color picker.")})),colorDecoratorActivatedOn:GS(new NS(146,"colorDecoratorsActivatedOn","clickAndHover",["clickAndHover","hover","click"],{enumDescriptions:[ue(0,"Make the color picker appear both on click and hover of the color decorator"),ue(0,"Make the color picker appear on hover of the color decorator"),ue(0,"Make the color picker appear on click of the color decorator")],description:ue(0,"Controls the condition to make a color picker appear from a color decorator")})),colorDecoratorsLimit:GS(new SS(21,"colorDecoratorsLimit",500,1,1e6,{markdownDescription:ue(0,"Controls the max number of color decorators that can be rendered in an editor at once.")})),columnSelection:GS(new wS(22,"columnSelection",!1,{description:ue(0,"Enable that the selection with the mouse and keys is doing column selection.")})),comments:GS(new class extends mS{constructor(){const e={insertSpace:!0,ignoreEmptyLines:!0};super(23,"comments",e,{"editor.comments.insertSpace":{type:"boolean",default:e.insertSpace,description:ue(0,"Controls whether a space character is inserted when commenting.")},"editor.comments.ignoreEmptyLines":{type:"boolean",default:e.ignoreEmptyLines,description:ue(0,"Controls if empty lines should be ignored with toggle, add or remove actions for line comments.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{insertSpace:CS(t.insertSpace,this.defaultValue.insertSpace),ignoreEmptyLines:CS(t.ignoreEmptyLines,this.defaultValue.ignoreEmptyLines)}}}),contextmenu:GS(new wS(24,"contextmenu",!0)),copyWithSyntaxHighlighting:GS(new wS(25,"copyWithSyntaxHighlighting",!0,{description:ue(0,"Controls whether syntax highlighting should be copied into the clipboard.")})),cursorBlinking:GS(new ES(26,"cursorBlinking",1,"blink",["blink","smooth","phase","expand","solid"],(function(e){switch(e){case"blink":return 1;case"smooth":return 2;case"phase":return 3;case"expand":return 4;case"solid":return 5}}),{description:ue(0,"Control the cursor animation style.")})),cursorSmoothCaretAnimation:GS(new NS(27,"cursorSmoothCaretAnimation","off",["off","explicit","on"],{enumDescriptions:[ue(0,"Smooth caret animation is disabled."),ue(0,"Smooth caret animation is enabled only when the user moves the cursor with an explicit gesture."),ue(0,"Smooth caret animation is always enabled.")],description:ue(0,"Controls whether the smooth caret animation should be enabled.")})),cursorStyle:GS(new ES(28,"cursorStyle",IS.Line,"line",["line","block","underline","line-thin","block-outline","underline-thin"],(function(e){switch(e){case"line":return IS.Line;case"block":return IS.Block;case"underline":return IS.Underline;case"line-thin":return IS.LineThin;case"block-outline":return IS.BlockOutline;case"underline-thin":return IS.UnderlineThin}}),{description:ue(0,"Controls the cursor style.")})),cursorSurroundingLines:GS(new SS(29,"cursorSurroundingLines",0,0,1073741824,{description:ue(0,"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:GS(new NS(30,"cursorSurroundingLinesStyle","default",["default","all"],{enumDescriptions:[ue(0,"`cursorSurroundingLines` is enforced only when triggered via the keyboard or API."),ue(0,"`cursorSurroundingLines` is enforced always.")],markdownDescription:ue(0,"Controls when `#cursorSurroundingLines#` should be enforced.")})),cursorWidth:GS(new SS(31,"cursorWidth",0,0,1073741824,{markdownDescription:ue(0,"Controls the width of the cursor when `#editor.cursorStyle#` is set to `line`.")})),disableLayerHinting:GS(new wS(32,"disableLayerHinting",!1)),disableMonospaceOptimizations:GS(new wS(33,"disableMonospaceOptimizations",!1)),domReadOnly:GS(new wS(34,"domReadOnly",!1)),dragAndDrop:GS(new wS(35,"dragAndDrop",!0,{description:ue(0,"Controls whether the editor should allow moving selections via drag and drop.")})),emptySelectionClipboard:GS(new class extends wS{constructor(){super(37,"emptySelectionClipboard",!0,{description:ue(0,"Controls whether copying without a selection copies the current line.")})}compute(e,t,i){return i&&e.emptySelectionClipboard}}),dropIntoEditor:GS(new class extends mS{constructor(){const e={enabled:!0,showDropSelector:"afterDrop"};super(36,"dropIntoEditor",e,{"editor.dropIntoEditor.enabled":{type:"boolean",default:e.enabled,markdownDescription:ue(0,"Controls whether you can drag and drop a file into a text editor by holding down `shift` (instead of opening the file in an editor).")},"editor.dropIntoEditor.showDropSelector":{type:"string",markdownDescription:ue(0,"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:[ue(0,"Show the drop selector widget after a file is dropped into the editor."),ue(0,"Never show the drop selector widget. Instead the default drop provider is always used.")],default:"afterDrop"}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:CS(t.enabled,this.defaultValue.enabled),showDropSelector:xS(t.showDropSelector,this.defaultValue.showDropSelector,["afterDrop","never"])}}}),stickyScroll:GS(new class extends mS{constructor(){const e={enabled:!1,maxLineCount:5,defaultModel:"outlineModel",scrollWithEditor:!0};super(114,"stickyScroll",e,{"editor.stickyScroll.enabled":{type:"boolean",default:e.enabled,description:ue(0,"Shows the nested current scopes during the scroll at the top of the editor.")},"editor.stickyScroll.maxLineCount":{type:"number",default:e.maxLineCount,minimum:1,maximum:10,description:ue(0,"Defines the maximum number of sticky lines to show.")},"editor.stickyScroll.defaultModel":{type:"string",enum:["outlineModel","foldingProviderModel","indentationModel"],default:e.defaultModel,description:ue(0,"Defines the model to use for determining which lines to stick. If the outline model does not exist, it will fall back on the folding provider model which falls back on the indentation model. This order is respected in all three cases.")},"editor.stickyScroll.scrollWithEditor":{type:"boolean",default:e.scrollWithEditor,description:ue(0,"Enable scrolling of the sticky scroll widget with the editor's horizontal scrollbar.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:CS(t.enabled,this.defaultValue.enabled),maxLineCount:SS.clampedInt(t.maxLineCount,this.defaultValue.maxLineCount,1,10),defaultModel:xS(t.defaultModel,this.defaultValue.defaultModel,["outlineModel","foldingProviderModel","indentationModel"]),scrollWithEditor:CS(t.scrollWithEditor,this.defaultValue.scrollWithEditor)}}}),experimentalWhitespaceRendering:GS(new NS(38,"experimentalWhitespaceRendering","svg",["svg","font","off"],{enumDescriptions:[ue(0,"Use a new rendering method with svgs."),ue(0,"Use a new rendering method with font characters."),ue(0,"Use the stable rendering method.")],description:ue(0,"Controls whether whitespace is rendered with a new, experimental method.")})),extraEditorClassName:GS(new DS(39,"extraEditorClassName","")),fastScrollSensitivity:GS(new kS(40,"fastScrollSensitivity",5,(e=>e<=0?5:e),{markdownDescription:ue(0,"Scrolling speed multiplier when pressing `Alt`.")})),find:GS(new class extends mS{constructor(){const e={cursorMoveOnType:!0,seedSearchStringFromSelection:"always",autoFindInSelection:"never",globalFindClipboard:!1,addExtraSpaceOnTop:!0,loop:!0};super(41,"find",e,{"editor.find.cursorMoveOnType":{type:"boolean",default:e.cursorMoveOnType,description:ue(0,"Controls whether the cursor should jump to find matches while typing.")},"editor.find.seedSearchStringFromSelection":{type:"string",enum:["never","always","selection"],default:e.seedSearchStringFromSelection,enumDescriptions:[ue(0,"Never seed search string from the editor selection."),ue(0,"Always seed search string from the editor selection, including word at cursor position."),ue(0,"Only seed search string from the editor selection.")],description:ue(0,"Controls whether the search string in the Find Widget is seeded from the editor selection.")},"editor.find.autoFindInSelection":{type:"string",enum:["never","always","multiline"],default:e.autoFindInSelection,enumDescriptions:[ue(0,"Never turn on Find in Selection automatically (default)."),ue(0,"Always turn on Find in Selection automatically."),ue(0,"Turn on Find in Selection automatically when multiple lines of content are selected.")],description:ue(0,"Controls the condition for turning on Find in Selection automatically.")},"editor.find.globalFindClipboard":{type:"boolean",default:e.globalFindClipboard,description:ue(0,"Controls whether the Find Widget should read or modify the shared find clipboard on macOS."),included:Pe},"editor.find.addExtraSpaceOnTop":{type:"boolean",default:e.addExtraSpaceOnTop,description:ue(0,"Controls whether the Find Widget should add extra lines on top of the editor. When true, you can scroll beyond the first line when the Find Widget is visible.")},"editor.find.loop":{type:"boolean",default:e.loop,description:ue(0,"Controls whether the search automatically restarts from the beginning (or the end) when no further matches can be found.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{cursorMoveOnType:CS(t.cursorMoveOnType,this.defaultValue.cursorMoveOnType),seedSearchStringFromSelection:"boolean"==typeof e.seedSearchStringFromSelection?e.seedSearchStringFromSelection?"always":"never":xS(t.seedSearchStringFromSelection,this.defaultValue.seedSearchStringFromSelection,["never","always","selection"]),autoFindInSelection:"boolean"==typeof e.autoFindInSelection?e.autoFindInSelection?"always":"never":xS(t.autoFindInSelection,this.defaultValue.autoFindInSelection,["never","always","multiline"]),globalFindClipboard:CS(t.globalFindClipboard,this.defaultValue.globalFindClipboard),addExtraSpaceOnTop:CS(t.addExtraSpaceOnTop,this.defaultValue.addExtraSpaceOnTop),loop:CS(t.loop,this.defaultValue.loop)}}}),fixedOverflowWidgets:GS(new wS(42,"fixedOverflowWidgets",!1)),folding:GS(new wS(43,"folding",!0,{description:ue(0,"Controls whether the editor has code folding enabled.")})),foldingStrategy:GS(new NS(44,"foldingStrategy","auto",["auto","indentation"],{enumDescriptions:[ue(0,"Use a language-specific folding strategy if available, else the indentation-based one."),ue(0,"Use the indentation-based folding strategy.")],description:ue(0,"Controls the strategy for computing folding ranges.")})),foldingHighlight:GS(new wS(45,"foldingHighlight",!0,{description:ue(0,"Controls whether the editor should highlight folded ranges.")})),foldingImportsByDefault:GS(new wS(46,"foldingImportsByDefault",!1,{description:ue(0,"Controls whether the editor automatically collapses import ranges.")})),foldingMaximumRegions:GS(new SS(47,"foldingMaximumRegions",5e3,10,65e3,{description:ue(0,"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:GS(new wS(48,"unfoldOnClickAfterEndOfLine",!1,{description:ue(0,"Controls whether clicking on the empty content after a folded line will unfold the line.")})),fontFamily:GS(new DS(49,"fontFamily",qS.fontFamily,{description:ue(0,"Controls the font family.")})),fontInfo:GS(new class extends vS{constructor(){super(50)}compute(e,t,i){return e.fontInfo}}),fontLigatures2:GS(new MS),fontSize:GS(new class extends bS{constructor(){super(52,"fontSize",qS.fontSize,{type:"number",minimum:6,maximum:100,default:qS.fontSize,description:ue(0,"Controls the font size in pixels.")})}validate(e){const t=kS.float(e,this.defaultValue);return 0===t?qS.fontSize:kS.clamp(t,6,100)}compute(e,t,i){return e.fontInfo.fontSize}}),fontWeight:GS(new RS),fontVariations:GS(new TS),formatOnPaste:GS(new wS(55,"formatOnPaste",!1,{description:ue(0,"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:GS(new wS(56,"formatOnType",!1,{description:ue(0,"Controls whether the editor should automatically format the line after typing.")})),glyphMargin:GS(new wS(57,"glyphMargin",!0,{description:ue(0,"Controls whether the editor should render the vertical glyph margin. Glyph margin is mostly used for debugging.")})),gotoLocation:GS(new class extends mS{constructor(){const e={multiple:"peek",multipleDefinitions:"peek",multipleTypeDefinitions:"peek",multipleDeclarations:"peek",multipleImplementations:"peek",multipleReferences:"peek",alternativeDefinitionCommand:"editor.action.goToReferences",alternativeTypeDefinitionCommand:"editor.action.goToReferences",alternativeDeclarationCommand:"editor.action.goToReferences",alternativeImplementationCommand:"",alternativeReferenceCommand:""},t={type:"string",enum:["peek","gotoAndPeek","goto"],default:e.multiple,enumDescriptions:[ue(0,"Show Peek view of the results (default)"),ue(0,"Go to the primary result and show a Peek view"),ue(0,"Go to the primary result and enable Peek-less navigation to others")]},i=["","editor.action.referenceSearch.trigger","editor.action.goToReferences","editor.action.peekImplementation","editor.action.goToImplementation","editor.action.peekTypeDefinition","editor.action.goToTypeDefinition","editor.action.peekDeclaration","editor.action.revealDeclaration","editor.action.peekDefinition","editor.action.revealDefinitionAside","editor.action.revealDefinition"];super(58,"gotoLocation",e,{"editor.gotoLocation.multiple":{deprecationMessage:ue(0,"This setting is deprecated, please use separate settings like 'editor.editor.gotoLocation.multipleDefinitions' or 'editor.editor.gotoLocation.multipleImplementations' instead.")},"editor.gotoLocation.multipleDefinitions":Object.assign({description:ue(0,"Controls the behavior the 'Go to Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleTypeDefinitions":Object.assign({description:ue(0,"Controls the behavior the 'Go to Type Definition'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleDeclarations":Object.assign({description:ue(0,"Controls the behavior the 'Go to Declaration'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleImplementations":Object.assign({description:ue(0,"Controls the behavior the 'Go to Implementations'-command when multiple target locations exist.")},t),"editor.gotoLocation.multipleReferences":Object.assign({description:ue(0,"Controls the behavior the 'Go to References'-command when multiple target locations exist.")},t),"editor.gotoLocation.alternativeDefinitionCommand":{type:"string",default:e.alternativeDefinitionCommand,enum:i,description:ue(0,"Alternative command id that is being executed when the result of 'Go to Definition' is the current location.")},"editor.gotoLocation.alternativeTypeDefinitionCommand":{type:"string",default:e.alternativeTypeDefinitionCommand,enum:i,description:ue(0,"Alternative command id that is being executed when the result of 'Go to Type Definition' is the current location.")},"editor.gotoLocation.alternativeDeclarationCommand":{type:"string",default:e.alternativeDeclarationCommand,enum:i,description:ue(0,"Alternative command id that is being executed when the result of 'Go to Declaration' is the current location.")},"editor.gotoLocation.alternativeImplementationCommand":{type:"string",default:e.alternativeImplementationCommand,enum:i,description:ue(0,"Alternative command id that is being executed when the result of 'Go to Implementation' is the current location.")},"editor.gotoLocation.alternativeReferenceCommand":{type:"string",default:e.alternativeReferenceCommand,enum:i,description:ue(0,"Alternative command id that is being executed when the result of 'Go to Reference' is the current location.")}})}validate(e){var t,i,n,s,o;if(!e||"object"!=typeof e)return this.defaultValue;const r=e;return{multiple:xS(r.multiple,this.defaultValue.multiple,["peek","gotoAndPeek","goto"]),multipleDefinitions:null!==(t=r.multipleDefinitions)&&void 0!==t?t:xS(r.multipleDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleTypeDefinitions:null!==(i=r.multipleTypeDefinitions)&&void 0!==i?i:xS(r.multipleTypeDefinitions,"peek",["peek","gotoAndPeek","goto"]),multipleDeclarations:null!==(n=r.multipleDeclarations)&&void 0!==n?n:xS(r.multipleDeclarations,"peek",["peek","gotoAndPeek","goto"]),multipleImplementations:null!==(s=r.multipleImplementations)&&void 0!==s?s:xS(r.multipleImplementations,"peek",["peek","gotoAndPeek","goto"]),multipleReferences:null!==(o=r.multipleReferences)&&void 0!==o?o:xS(r.multipleReferences,"peek",["peek","gotoAndPeek","goto"]),alternativeDefinitionCommand:DS.string(r.alternativeDefinitionCommand,this.defaultValue.alternativeDefinitionCommand),alternativeTypeDefinitionCommand:DS.string(r.alternativeTypeDefinitionCommand,this.defaultValue.alternativeTypeDefinitionCommand),alternativeDeclarationCommand:DS.string(r.alternativeDeclarationCommand,this.defaultValue.alternativeDeclarationCommand),alternativeImplementationCommand:DS.string(r.alternativeImplementationCommand,this.defaultValue.alternativeImplementationCommand),alternativeReferenceCommand:DS.string(r.alternativeReferenceCommand,this.defaultValue.alternativeReferenceCommand)}}}),hideCursorInOverviewRuler:GS(new wS(59,"hideCursorInOverviewRuler",!1,{description:ue(0,"Controls whether the cursor should be hidden in the overview ruler.")})),hover:GS(new class extends mS{constructor(){const e={enabled:!0,delay:300,hidingDelay:300,sticky:!0,above:!0};super(60,"hover",e,{"editor.hover.enabled":{type:"boolean",default:e.enabled,description:ue(0,"Controls whether the hover is shown.")},"editor.hover.delay":{type:"number",default:e.delay,minimum:0,maximum:1e4,description:ue(0,"Controls the delay in milliseconds after which the hover is shown.")},"editor.hover.sticky":{type:"boolean",default:e.sticky,description:ue(0,"Controls whether the hover should remain visible when mouse is moved over it.")},"editor.hover.hidingDelay":{type:"integer",minimum:0,default:e.hidingDelay,description:ue(0,"Controls the delay in milliseconds after thich the hover is hidden. Requires `editor.hover.sticky` to be enabled.")},"editor.hover.above":{type:"boolean",default:e.above,description:ue(0,"Prefer showing hovers above the line, if there's space.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:CS(t.enabled,this.defaultValue.enabled),delay:SS.clampedInt(t.delay,this.defaultValue.delay,0,1e4),sticky:CS(t.sticky,this.defaultValue.sticky),hidingDelay:SS.clampedInt(t.hidingDelay,this.defaultValue.hidingDelay,0,6e5),above:CS(t.above,this.defaultValue.above)}}}),inDiffEditor:GS(new wS(61,"inDiffEditor",!1)),letterSpacing:GS(new kS(63,"letterSpacing",qS.letterSpacing,(e=>kS.clamp(e,-5,20)),{description:ue(0,"Controls the letter spacing in pixels.")})),lightbulb:GS(new class extends mS{constructor(){const e={enabled:!0};super(64,"lightbulb",e,{"editor.lightbulb.enabled":{type:"boolean",default:e.enabled,description:ue(0,"Enables the Code Action lightbulb in the editor.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;return{enabled:CS(e.enabled,this.defaultValue.enabled)}}}),lineDecorationsWidth:GS(new class extends mS{constructor(){super(65,"lineDecorationsWidth",10)}validate(e){if("string"==typeof e&&/^\d+(\.\d+)?ch$/.test(e)){return-parseFloat(e.substring(0,e.length-2))}return SS.clampedInt(e,this.defaultValue,0,1e3)}compute(e,t,i){return i<0?SS.clampedInt(-i*e.fontInfo.typicalHalfwidthCharacterWidth,this.defaultValue,0,1e3):i}}),lineHeight:GS(new class extends kS{constructor(){super(66,"lineHeight",qS.lineHeight,(e=>kS.clamp(e,0,150)),{markdownDescription:ue(0,"Controls the line height. \n - Use 0 to automatically compute the line height from the font size.\n - Values between 0 and 8 will be used as a multiplier with the font size.\n - Values greater than or equal to 8 will be used as effective values.")})}compute(e,t,i){return e.fontInfo.lineHeight}}),lineNumbers:GS(new class extends mS{constructor(){super(67,"lineNumbers",{renderType:1,renderFn:null},{type:"string",enum:["off","on","relative","interval"],enumDescriptions:[ue(0,"Line numbers are not rendered."),ue(0,"Line numbers are rendered as absolute number."),ue(0,"Line numbers are rendered as distance in lines to cursor position."),ue(0,"Line numbers are rendered every 10 lines.")],default:"on",description:ue(0,"Controls the display of line numbers.")})}validate(e){let t=this.defaultValue.renderType,i=this.defaultValue.renderFn;return void 0!==e&&("function"==typeof e?(t=4,i=e):t="interval"===e?3:"relative"===e?2:"on"===e?1:0),{renderType:t,renderFn:i}}}),lineNumbersMinChars:GS(new SS(68,"lineNumbersMinChars",5,1,300)),linkedEditing:GS(new wS(69,"linkedEditing",!1,{description:ue(0,"Controls whether the editor has linked editing enabled. Depending on the language, related symbols such as HTML tags, are updated while editing.")})),links:GS(new wS(70,"links",!0,{description:ue(0,"Controls whether the editor should detect links and make them clickable.")})),matchBrackets:GS(new NS(71,"matchBrackets","always",["always","near","never"],{description:ue(0,"Highlight matching brackets.")})),minimap:GS(new class extends mS{constructor(){const e={enabled:!0,size:"proportional",side:"right",showSlider:"mouseover",autohide:!1,renderCharacters:!0,maxColumn:120,scale:1};super(72,"minimap",e,{"editor.minimap.enabled":{type:"boolean",default:e.enabled,description:ue(0,"Controls whether the minimap is shown.")},"editor.minimap.autohide":{type:"boolean",default:e.autohide,description:ue(0,"Controls whether the minimap is hidden automatically.")},"editor.minimap.size":{type:"string",enum:["proportional","fill","fit"],enumDescriptions:[ue(0,"The minimap has the same size as the editor contents (and might scroll)."),ue(0,"The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),ue(0,"The minimap will shrink as necessary to never be larger than the editor (no scrolling).")],default:e.size,description:ue(0,"Controls the size of the minimap.")},"editor.minimap.side":{type:"string",enum:["left","right"],default:e.side,description:ue(0,"Controls the side where to render the minimap.")},"editor.minimap.showSlider":{type:"string",enum:["always","mouseover"],default:e.showSlider,description:ue(0,"Controls when the minimap slider is shown.")},"editor.minimap.scale":{type:"number",default:e.scale,minimum:1,maximum:3,enum:[1,2,3],description:ue(0,"Scale of content drawn in the minimap: 1, 2 or 3.")},"editor.minimap.renderCharacters":{type:"boolean",default:e.renderCharacters,description:ue(0,"Render the actual characters on a line as opposed to color blocks.")},"editor.minimap.maxColumn":{type:"number",default:e.maxColumn,description:ue(0,"Limit the width of the minimap to render at most a certain number of columns.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:CS(t.enabled,this.defaultValue.enabled),autohide:CS(t.autohide,this.defaultValue.autohide),size:xS(t.size,this.defaultValue.size,["proportional","fill","fit"]),side:xS(t.side,this.defaultValue.side,["right","left"]),showSlider:xS(t.showSlider,this.defaultValue.showSlider,["always","mouseover"]),renderCharacters:CS(t.renderCharacters,this.defaultValue.renderCharacters),scale:SS.clampedInt(t.scale,1,1,3),maxColumn:SS.clampedInt(t.maxColumn,this.defaultValue.maxColumn,1,1e4)}}}),mouseStyle:GS(new NS(73,"mouseStyle","text",["text","default","copy"])),mouseWheelScrollSensitivity:GS(new kS(74,"mouseWheelScrollSensitivity",1,(e=>0===e?1:e),{markdownDescription:ue(0,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")})),mouseWheelZoom:GS(new wS(75,"mouseWheelZoom",!1,{markdownDescription:ue(0,"Zoom the font of the editor when using mouse wheel and holding `Ctrl`.")})),multiCursorMergeOverlapping:GS(new wS(76,"multiCursorMergeOverlapping",!0,{description:ue(0,"Merge multiple cursors when they are overlapping.")})),multiCursorModifier:GS(new ES(77,"multiCursorModifier","altKey","alt",["ctrlCmd","alt"],(function(e){return"ctrlCmd"===e?Pe?"metaKey":"ctrlKey":"altKey"}),{markdownEnumDescriptions:[ue(0,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),ue(0,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],markdownDescription:ue(0,"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:GS(new NS(78,"multiCursorPaste","spread",["spread","full"],{markdownEnumDescriptions:[ue(0,"Each cursor pastes a single line of the text."),ue(0,"Each cursor pastes the full text.")],markdownDescription:ue(0,"Controls pasting when the line count of the pasted text matches the cursor count.")})),multiCursorLimit:GS(new SS(79,"multiCursorLimit",1e4,1,1e5,{markdownDescription:ue(0,"Controls the max number of cursors that can be in an active editor at once.")})),occurrencesHighlight:GS(new wS(80,"occurrencesHighlight",!0,{description:ue(0,"Controls whether the editor should highlight semantic symbol occurrences.")})),overviewRulerBorder:GS(new wS(81,"overviewRulerBorder",!0,{description:ue(0,"Controls whether a border should be drawn around the overview ruler.")})),overviewRulerLanes:GS(new SS(82,"overviewRulerLanes",3,0,3)),padding:GS(new class extends mS{constructor(){super(83,"padding",{top:0,bottom:0},{"editor.padding.top":{type:"number",default:0,minimum:0,maximum:1e3,description:ue(0,"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:ue(0,"Controls the amount of space between the bottom edge of the editor and the last line.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{top:SS.clampedInt(t.top,0,0,1e3),bottom:SS.clampedInt(t.bottom,0,0,1e3)}}}),pasteAs:GS(new class extends mS{constructor(){const e={enabled:!0,showPasteSelector:"afterPaste"};super(84,"pasteAs",e,{"editor.pasteAs.enabled":{type:"boolean",default:e.enabled,markdownDescription:ue(0,"Controls whether you can paste content in different ways.")},"editor.pasteAs.showPasteSelector":{type:"string",markdownDescription:ue(0,"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:[ue(0,"Show the paste selector widget after content is pasted into the editor."),ue(0,"Never show the paste selector widget. Instead the default pasting behavior is always used.")],default:"afterPaste"}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:CS(t.enabled,this.defaultValue.enabled),showPasteSelector:xS(t.showPasteSelector,this.defaultValue.showPasteSelector,["afterPaste","never"])}}}),parameterHints:GS(new class extends mS{constructor(){const e={enabled:!0,cycle:!0};super(85,"parameterHints",e,{"editor.parameterHints.enabled":{type:"boolean",default:e.enabled,description:ue(0,"Enables a pop-up that shows parameter documentation and type information as you type.")},"editor.parameterHints.cycle":{type:"boolean",default:e.cycle,description:ue(0,"Controls whether the parameter hints menu cycles or closes when reaching the end of the list.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:CS(t.enabled,this.defaultValue.enabled),cycle:CS(t.cycle,this.defaultValue.cycle)}}}),peekWidgetDefaultFocus:GS(new NS(86,"peekWidgetDefaultFocus","tree",["tree","editor"],{enumDescriptions:[ue(0,"Focus the tree when opening peek"),ue(0,"Focus the editor when opening peek")],description:ue(0,"Controls whether to focus the inline editor or the tree in the peek widget.")})),definitionLinkOpensInPeek:GS(new wS(87,"definitionLinkOpensInPeek",!1,{description:ue(0,"Controls whether the Go to Definition mouse gesture always opens the peek widget.")})),quickSuggestions:GS(new class extends mS{constructor(){const e={other:"on",comments:"off",strings:"off"},t=[{type:"boolean"},{type:"string",enum:["on","inline","off"],enumDescriptions:[ue(0,"Quick suggestions show inside the suggest widget"),ue(0,"Quick suggestions show as ghost text"),ue(0,"Quick suggestions are disabled")]}];super(88,"quickSuggestions",e,{type:"object",additionalProperties:!1,properties:{strings:{anyOf:t,default:e.strings,description:ue(0,"Enable quick suggestions inside strings.")},comments:{anyOf:t,default:e.comments,description:ue(0,"Enable quick suggestions inside comments.")},other:{anyOf:t,default:e.other,description:ue(0,"Enable quick suggestions outside of strings and comments.")}},default:e,markdownDescription:ue(0,"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("boolean"==typeof e){const t=e?"on":"off";return{comments:t,strings:t,other:t}}if(!e||"object"!=typeof e)return this.defaultValue;const{other:t,comments:i,strings:n}=e,s=["on","inline","off"];let o,r,a;return o="boolean"==typeof t?t?"on":"off":xS(t,this.defaultValue.other,s),r="boolean"==typeof i?i?"on":"off":xS(i,this.defaultValue.comments,s),a="boolean"==typeof n?n?"on":"off":xS(n,this.defaultValue.strings,s),{other:o,comments:r,strings:a}}}),quickSuggestionsDelay:GS(new SS(89,"quickSuggestionsDelay",10,0,1073741824,{description:ue(0,"Controls the delay in milliseconds after which quick suggestions will show up.")})),readOnly:GS(new wS(90,"readOnly",!1)),readOnlyMessage:GS(new class extends mS{constructor(){super(91,"readOnlyMessage",undefined)}validate(e){return e&&"object"==typeof e?e:this.defaultValue}}),renameOnType:GS(new wS(92,"renameOnType",!1,{description:ue(0,"Controls whether the editor auto renames on type."),markdownDeprecationMessage:ue(0,"Deprecated, use `editor.linkedEditing` instead.")})),renderControlCharacters:GS(new wS(93,"renderControlCharacters",!0,{description:ue(0,"Controls whether the editor should render control characters."),restricted:!0})),renderFinalNewline:GS(new NS(94,"renderFinalNewline",Fe?"dimmed":"on",["off","on","dimmed"],{description:ue(0,"Render last line number when the file ends with a newline.")})),renderLineHighlight:GS(new NS(95,"renderLineHighlight","line",["none","gutter","line","all"],{enumDescriptions:["","","",ue(0,"Highlights both the gutter and the current line.")],description:ue(0,"Controls how the editor should render the current line highlight.")})),renderLineHighlightOnlyWhenFocus:GS(new wS(96,"renderLineHighlightOnlyWhenFocus",!1,{description:ue(0,"Controls if the editor should render the current line highlight only when the editor is focused.")})),renderValidationDecorations:GS(new NS(97,"renderValidationDecorations","editable",["editable","on","off"])),renderWhitespace:GS(new NS(98,"renderWhitespace","selection",["none","boundary","selection","trailing","all"],{enumDescriptions:["",ue(0,"Render whitespace characters except for single spaces between words."),ue(0,"Render whitespace characters only on selected text."),ue(0,"Render only trailing whitespace characters."),""],description:ue(0,"Controls how the editor should render whitespace characters.")})),revealHorizontalRightPadding:GS(new SS(99,"revealHorizontalRightPadding",15,0,1e3)),roundedSelection:GS(new wS(100,"roundedSelection",!0,{description:ue(0,"Controls whether selections should have rounded corners.")})),rulers:GS(new class extends mS{constructor(){const e=[],t={type:"number",description:ue(0,"Number of monospace characters at which this editor ruler will render.")};super(101,"rulers",e,{type:"array",items:{anyOf:[t,{type:["object"],properties:{column:t,color:{type:"string",description:ue(0,"Color of this editor ruler."),format:"color-hex"}}}]},default:e,description:ue(0,"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("number"==typeof i)t.push({column:SS.clampedInt(i,0,0,1e4),color:null});else if(i&&"object"==typeof i){const e=i;t.push({column:SS.clampedInt(e.column,0,0,1e4),color:e.color})}return t.sort(((e,t)=>e.column-t.column)),t}return this.defaultValue}}),scrollbar:GS(new class extends mS{constructor(){const e={vertical:1,horizontal:1,arrowSize:11,useShadows:!0,verticalHasArrows:!1,horizontalHasArrows:!1,horizontalScrollbarSize:12,horizontalSliderSize:12,verticalScrollbarSize:14,verticalSliderSize:14,handleMouseWheel:!0,alwaysConsumeMouseWheel:!0,scrollByPage:!1};super(102,"scrollbar",e,{"editor.scrollbar.vertical":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[ue(0,"The vertical scrollbar will be visible only when necessary."),ue(0,"The vertical scrollbar will always be visible."),ue(0,"The vertical scrollbar will always be hidden.")],default:"auto",description:ue(0,"Controls the visibility of the vertical scrollbar.")},"editor.scrollbar.horizontal":{type:"string",enum:["auto","visible","hidden"],enumDescriptions:[ue(0,"The horizontal scrollbar will be visible only when necessary."),ue(0,"The horizontal scrollbar will always be visible."),ue(0,"The horizontal scrollbar will always be hidden.")],default:"auto",description:ue(0,"Controls the visibility of the horizontal scrollbar.")},"editor.scrollbar.verticalScrollbarSize":{type:"number",default:e.verticalScrollbarSize,description:ue(0,"The width of the vertical scrollbar.")},"editor.scrollbar.horizontalScrollbarSize":{type:"number",default:e.horizontalScrollbarSize,description:ue(0,"The height of the horizontal scrollbar.")},"editor.scrollbar.scrollByPage":{type:"boolean",default:e.scrollByPage,description:ue(0,"Controls whether clicks scroll by page or jump to click position.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e,i=SS.clampedInt(t.horizontalScrollbarSize,this.defaultValue.horizontalScrollbarSize,0,1e3),n=SS.clampedInt(t.verticalScrollbarSize,this.defaultValue.verticalScrollbarSize,0,1e3);return{arrowSize:SS.clampedInt(t.arrowSize,this.defaultValue.arrowSize,0,1e3),vertical:PS(t.vertical,this.defaultValue.vertical),horizontal:PS(t.horizontal,this.defaultValue.horizontal),useShadows:CS(t.useShadows,this.defaultValue.useShadows),verticalHasArrows:CS(t.verticalHasArrows,this.defaultValue.verticalHasArrows),horizontalHasArrows:CS(t.horizontalHasArrows,this.defaultValue.horizontalHasArrows),handleMouseWheel:CS(t.handleMouseWheel,this.defaultValue.handleMouseWheel),alwaysConsumeMouseWheel:CS(t.alwaysConsumeMouseWheel,this.defaultValue.alwaysConsumeMouseWheel),horizontalScrollbarSize:i,horizontalSliderSize:SS.clampedInt(t.horizontalSliderSize,i,0,1e3),verticalScrollbarSize:n,verticalSliderSize:SS.clampedInt(t.verticalSliderSize,n,0,1e3),scrollByPage:CS(t.scrollByPage,this.defaultValue.scrollByPage)}}}),scrollBeyondLastColumn:GS(new SS(103,"scrollBeyondLastColumn",4,0,1073741824,{description:ue(0,"Controls the number of extra characters beyond which the editor will scroll horizontally.")})),scrollBeyondLastLine:GS(new wS(104,"scrollBeyondLastLine",!0,{description:ue(0,"Controls whether the editor will scroll beyond the last line.")})),scrollPredominantAxis:GS(new wS(105,"scrollPredominantAxis",!0,{description:ue(0,"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:GS(new wS(106,"selectionClipboard",!0,{description:ue(0,"Controls whether the Linux primary clipboard should be supported."),included:Fe})),selectionHighlight:GS(new wS(107,"selectionHighlight",!0,{description:ue(0,"Controls whether the editor should highlight matches similar to the selection.")})),selectOnLineNumbers:GS(new wS(108,"selectOnLineNumbers",!0)),showFoldingControls:GS(new NS(109,"showFoldingControls","mouseover",["always","never","mouseover"],{enumDescriptions:[ue(0,"Always show the folding controls."),ue(0,"Never show the folding controls and reduce the gutter size."),ue(0,"Only show the folding controls when the mouse is over the gutter.")],description:ue(0,"Controls when the folding controls on the gutter are shown.")})),showUnused:GS(new wS(110,"showUnused",!0,{description:ue(0,"Controls fading out of unused code.")})),showDeprecated:GS(new wS(138,"showDeprecated",!0,{description:ue(0,"Controls strikethrough deprecated variables.")})),inlayHints:GS(new class extends mS{constructor(){const e={enabled:"on",fontSize:0,fontFamily:"",padding:!1};super(139,"inlayHints",e,{"editor.inlayHints.enabled":{type:"string",default:e.enabled,description:ue(0,"Enables the inlay hints in the editor."),enum:["on","onUnlessPressed","offUnlessPressed","off"],markdownEnumDescriptions:[ue(0,"Inlay hints are enabled"),ue(0,"Inlay hints are showing by default and hide when holding {0}",Pe?"Ctrl+Option":"Ctrl+Alt"),ue(0,"Inlay hints are hidden by default and show when holding {0}",Pe?"Ctrl+Option":"Ctrl+Alt"),ue(0,"Inlay hints are disabled")]},"editor.inlayHints.fontSize":{type:"number",default:e.fontSize,markdownDescription:ue(0,"Controls font size of inlay hints in the editor. As default the {0} is used when the configured value is less than {1} or greater than the editor font size.","`#editor.fontSize#`","`5`")},"editor.inlayHints.fontFamily":{type:"string",default:e.fontFamily,markdownDescription:ue(0,"Controls font family of inlay hints in the editor. When set to empty, the {0} is used.","`#editor.fontFamily#`")},"editor.inlayHints.padding":{type:"boolean",default:e.padding,description:ue(0,"Enables the padding around the inlay hints in the editor.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return"boolean"==typeof t.enabled&&(t.enabled=t.enabled?"on":"off"),{enabled:xS(t.enabled,this.defaultValue.enabled,["on","off","offUnlessPressed","onUnlessPressed"]),fontSize:SS.clampedInt(t.fontSize,this.defaultValue.fontSize,0,100),fontFamily:DS.string(t.fontFamily,this.defaultValue.fontFamily),padding:CS(t.padding,this.defaultValue.padding)}}}),snippetSuggestions:GS(new NS(111,"snippetSuggestions","inline",["top","bottom","inline","none"],{enumDescriptions:[ue(0,"Show snippet suggestions on top of other suggestions."),ue(0,"Show snippet suggestions below other suggestions."),ue(0,"Show snippets suggestions with other suggestions."),ue(0,"Do not show snippet suggestions.")],description:ue(0,"Controls whether snippets are shown with other suggestions and how they are sorted.")})),smartSelect:GS(new class extends mS{constructor(){super(112,"smartSelect",{selectLeadingAndTrailingWhitespace:!0,selectSubwords:!0},{"editor.smartSelect.selectLeadingAndTrailingWhitespace":{description:ue(0,"Whether leading and trailing whitespace should always be selected."),default:!0,type:"boolean"},"editor.smartSelect.selectSubwords":{description:ue(0,"Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),default:!0,type:"boolean"}})}validate(e){return e&&"object"==typeof e?{selectLeadingAndTrailingWhitespace:CS(e.selectLeadingAndTrailingWhitespace,this.defaultValue.selectLeadingAndTrailingWhitespace),selectSubwords:CS(e.selectSubwords,this.defaultValue.selectSubwords)}:this.defaultValue}}),smoothScrolling:GS(new wS(113,"smoothScrolling",!1,{description:ue(0,"Controls whether the editor will scroll using an animation.")})),stopRenderingLineAfter:GS(new SS(116,"stopRenderingLineAfter",1e4,-1,1073741824)),suggest:GS(new class extends mS{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(117,"suggest",e,{"editor.suggest.insertMode":{type:"string",enum:["insert","replace"],enumDescriptions:[ue(0,"Insert suggestion without overwriting text right of the cursor."),ue(0,"Insert suggestion and overwrite text right of the cursor.")],default:e.insertMode,description:ue(0,"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:ue(0,"Controls whether filtering and sorting suggestions accounts for small typos.")},"editor.suggest.localityBonus":{type:"boolean",default:e.localityBonus,description:ue(0,"Controls whether sorting favors words that appear close to the cursor.")},"editor.suggest.shareSuggestSelections":{type:"boolean",default:e.shareSuggestSelections,markdownDescription:ue(0,"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:[ue(0,"Always select a suggestion when automatically triggering IntelliSense."),ue(0,"Never select a suggestion when automatically triggering IntelliSense."),ue(0,"Select a suggestion only when triggering IntelliSense from a trigger character."),ue(0,"Select a suggestion only when triggering IntelliSense as you type.")],default:e.selectionMode,markdownDescription:ue(0,"Controls whether a suggestion is selected when the widget shows. Note that this only applies to automatically triggered suggestions (`#editor.quickSuggestions#` and `#editor.suggestOnTriggerCharacters#`) and that a suggestion is always selected when explicitly invoked, e.g via `Ctrl+Space`.")},"editor.suggest.snippetsPreventQuickSuggestions":{type:"boolean",default:e.snippetsPreventQuickSuggestions,description:ue(0,"Controls whether an active snippet prevents quick suggestions.")},"editor.suggest.showIcons":{type:"boolean",default:e.showIcons,description:ue(0,"Controls whether to show or hide icons in suggestions.")},"editor.suggest.showStatusBar":{type:"boolean",default:e.showStatusBar,description:ue(0,"Controls the visibility of the status bar at the bottom of the suggest widget.")},"editor.suggest.preview":{type:"boolean",default:e.preview,description:ue(0,"Controls whether to preview the suggestion outcome in the editor.")},"editor.suggest.showInlineDetails":{type:"boolean",default:e.showInlineDetails,description:ue(0,"Controls whether suggest details show inline with the label or only in the details widget.")},"editor.suggest.maxVisibleSuggestions":{type:"number",deprecationMessage:ue(0,"This setting is deprecated. The suggest widget can now be resized.")},"editor.suggest.filteredTypes":{type:"object",deprecationMessage:ue(0,"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:ue(0,"When enabled IntelliSense shows `method`-suggestions.")},"editor.suggest.showFunctions":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `function`-suggestions.")},"editor.suggest.showConstructors":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `constructor`-suggestions.")},"editor.suggest.showDeprecated":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `deprecated`-suggestions.")},"editor.suggest.matchOnWordStartOnly":{type:"boolean",default:!0,markdownDescription:ue(0,"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:ue(0,"When enabled IntelliSense shows `field`-suggestions.")},"editor.suggest.showVariables":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `variable`-suggestions.")},"editor.suggest.showClasses":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `class`-suggestions.")},"editor.suggest.showStructs":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `struct`-suggestions.")},"editor.suggest.showInterfaces":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `interface`-suggestions.")},"editor.suggest.showModules":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `module`-suggestions.")},"editor.suggest.showProperties":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `property`-suggestions.")},"editor.suggest.showEvents":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `event`-suggestions.")},"editor.suggest.showOperators":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `operator`-suggestions.")},"editor.suggest.showUnits":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `unit`-suggestions.")},"editor.suggest.showValues":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `value`-suggestions.")},"editor.suggest.showConstants":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `constant`-suggestions.")},"editor.suggest.showEnums":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `enum`-suggestions.")},"editor.suggest.showEnumMembers":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `enumMember`-suggestions.")},"editor.suggest.showKeywords":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `keyword`-suggestions.")},"editor.suggest.showWords":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `text`-suggestions.")},"editor.suggest.showColors":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `color`-suggestions.")},"editor.suggest.showFiles":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `file`-suggestions.")},"editor.suggest.showReferences":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `reference`-suggestions.")},"editor.suggest.showCustomcolors":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `customcolor`-suggestions.")},"editor.suggest.showFolders":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `folder`-suggestions.")},"editor.suggest.showTypeParameters":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `typeParameter`-suggestions.")},"editor.suggest.showSnippets":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `snippet`-suggestions.")},"editor.suggest.showUsers":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `user`-suggestions.")},"editor.suggest.showIssues":{type:"boolean",default:!0,markdownDescription:ue(0,"When enabled IntelliSense shows `issues`-suggestions.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{insertMode:xS(t.insertMode,this.defaultValue.insertMode,["insert","replace"]),filterGraceful:CS(t.filterGraceful,this.defaultValue.filterGraceful),snippetsPreventQuickSuggestions:CS(t.snippetsPreventQuickSuggestions,this.defaultValue.filterGraceful),localityBonus:CS(t.localityBonus,this.defaultValue.localityBonus),shareSuggestSelections:CS(t.shareSuggestSelections,this.defaultValue.shareSuggestSelections),selectionMode:xS(t.selectionMode,this.defaultValue.selectionMode,["always","never","whenQuickSuggestion","whenTriggerCharacter"]),showIcons:CS(t.showIcons,this.defaultValue.showIcons),showStatusBar:CS(t.showStatusBar,this.defaultValue.showStatusBar),preview:CS(t.preview,this.defaultValue.preview),previewMode:xS(t.previewMode,this.defaultValue.previewMode,["prefix","subword","subwordSmart"]),showInlineDetails:CS(t.showInlineDetails,this.defaultValue.showInlineDetails),showMethods:CS(t.showMethods,this.defaultValue.showMethods),showFunctions:CS(t.showFunctions,this.defaultValue.showFunctions),showConstructors:CS(t.showConstructors,this.defaultValue.showConstructors),showDeprecated:CS(t.showDeprecated,this.defaultValue.showDeprecated),matchOnWordStartOnly:CS(t.matchOnWordStartOnly,this.defaultValue.matchOnWordStartOnly),showFields:CS(t.showFields,this.defaultValue.showFields),showVariables:CS(t.showVariables,this.defaultValue.showVariables),showClasses:CS(t.showClasses,this.defaultValue.showClasses),showStructs:CS(t.showStructs,this.defaultValue.showStructs),showInterfaces:CS(t.showInterfaces,this.defaultValue.showInterfaces),showModules:CS(t.showModules,this.defaultValue.showModules),showProperties:CS(t.showProperties,this.defaultValue.showProperties),showEvents:CS(t.showEvents,this.defaultValue.showEvents),showOperators:CS(t.showOperators,this.defaultValue.showOperators),showUnits:CS(t.showUnits,this.defaultValue.showUnits),showValues:CS(t.showValues,this.defaultValue.showValues),showConstants:CS(t.showConstants,this.defaultValue.showConstants),showEnums:CS(t.showEnums,this.defaultValue.showEnums),showEnumMembers:CS(t.showEnumMembers,this.defaultValue.showEnumMembers),showKeywords:CS(t.showKeywords,this.defaultValue.showKeywords),showWords:CS(t.showWords,this.defaultValue.showWords),showColors:CS(t.showColors,this.defaultValue.showColors),showFiles:CS(t.showFiles,this.defaultValue.showFiles),showReferences:CS(t.showReferences,this.defaultValue.showReferences),showFolders:CS(t.showFolders,this.defaultValue.showFolders),showTypeParameters:CS(t.showTypeParameters,this.defaultValue.showTypeParameters),showSnippets:CS(t.showSnippets,this.defaultValue.showSnippets),showUsers:CS(t.showUsers,this.defaultValue.showUsers),showIssues:CS(t.showIssues,this.defaultValue.showIssues)}}}),inlineSuggest:GS(new class extends mS{constructor(){const e={enabled:!0,mode:"subwordSmart",showToolbar:"onHover",suppressSuggestions:!1,keepOnBlur:!1};super(62,"inlineSuggest",e,{"editor.inlineSuggest.enabled":{type:"boolean",default:e.enabled,description:ue(0,"Controls whether to automatically show inline suggestions in the editor.")},"editor.inlineSuggest.showToolbar":{type:"string",default:e.showToolbar,enum:["always","onHover"],enumDescriptions:[ue(0,"Show the inline suggestion toolbar whenever an inline suggestion is shown."),ue(0,"Show the inline suggestion toolbar when hovering over an inline suggestion.")],description:ue(0,"Controls when to show the inline suggestion toolbar.")},"editor.inlineSuggest.suppressSuggestions":{type:"boolean",default:e.suppressSuggestions,description:ue(0,"Controls how inline suggestions interact with the suggest widget. If enabled, the suggest widget is not shown automatically when inline suggestions are available.")}})}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{enabled:CS(t.enabled,this.defaultValue.enabled),mode:xS(t.mode,this.defaultValue.mode,["prefix","subword","subwordSmart"]),showToolbar:xS(t.showToolbar,this.defaultValue.showToolbar,["always","onHover"]),suppressSuggestions:CS(t.suppressSuggestions,this.defaultValue.suppressSuggestions),keepOnBlur:CS(t.keepOnBlur,this.defaultValue.keepOnBlur)}}}),inlineCompletionsAccessibilityVerbose:GS(new wS(147,"inlineCompletionsAccessibilityVerbose",!1,{description:ue(0,"Controls whether the accessibility hint should be provided to screen reader users when an inline completion is shown.")})),suggestFontSize:GS(new SS(118,"suggestFontSize",0,0,1e3,{markdownDescription:ue(0,"Font size for the suggest widget. When set to {0}, the value of {1} is used.","`0`","`#editor.fontSize#`")})),suggestLineHeight:GS(new SS(119,"suggestLineHeight",0,0,1e3,{markdownDescription:ue(0,"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:GS(new wS(120,"suggestOnTriggerCharacters",!0,{description:ue(0,"Controls whether suggestions should automatically show up when typing trigger characters.")})),suggestSelection:GS(new NS(121,"suggestSelection","first",["first","recentlyUsed","recentlyUsedByPrefix"],{markdownEnumDescriptions:[ue(0,"Always select the first suggestion."),ue(0,"Select recent suggestions unless further typing selects one, e.g. `console.| -> console.log` because `log` has been completed recently."),ue(0,"Select suggestions based on previous prefixes that have completed those suggestions, e.g. `co -> console` and `con -> const`.")],description:ue(0,"Controls how suggestions are pre-selected when showing the suggest list.")})),tabCompletion:GS(new NS(122,"tabCompletion","off",["on","off","onlySnippets"],{enumDescriptions:[ue(0,"Tab complete will insert the best matching suggestion when pressing tab."),ue(0,"Disable tab completions."),ue(0,"Tab complete snippets when their prefix match. Works best when 'quickSuggestions' aren't enabled.")],description:ue(0,"Enables tab completions.")})),tabIndex:GS(new SS(123,"tabIndex",0,-1,1073741824)),unicodeHighlight:GS(new class extends mS{constructor(){const e={nonBasicASCII:FS,invisibleCharacters:!0,ambiguousCharacters:!0,includeComments:FS,includeStrings:!0,allowedCharacters:{},allowedLocales:{_os:!0,_vscode:!0}};super(124,"unicodeHighlight",e,{[VS]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,FS],default:e.nonBasicASCII,description:ue(0,"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.")},[WS]:{restricted:!0,type:"boolean",default:e.invisibleCharacters,description:ue(0,"Controls whether characters that just reserve space or have no width at all are highlighted.")},[HS]:{restricted:!0,type:"boolean",default:e.ambiguousCharacters,description:ue(0,"Controls whether characters are highlighted that can be confused with basic ASCII characters, except those that are common in the current user locale.")},[zS]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,FS],default:e.includeComments,description:ue(0,"Controls whether characters in comments should also be subject to Unicode highlighting.")},[US]:{restricted:!0,type:["boolean","string"],enum:[!0,!1,FS],default:e.includeStrings,description:ue(0,"Controls whether characters in strings should also be subject to Unicode highlighting.")},[BS]:{restricted:!0,type:"object",default:e.allowedCharacters,description:ue(0,"Defines allowed characters that are not being highlighted."),additionalProperties:{type:"boolean"}},[KS]:{restricted:!0,type:"object",additionalProperties:{type:"boolean"},default:e.allowedLocales,description:ue(0,"Unicode characters that are common in allowed locales are not being highlighted.")}})}applyUpdate(e,t){let i=!1;t.allowedCharacters&&e&&(vd(e.allowedCharacters,t.allowedCharacters)||(e=Object.assign(Object.assign({},e),{allowedCharacters:t.allowedCharacters}),i=!0)),t.allowedLocales&&e&&(vd(e.allowedLocales,t.allowedLocales)||(e=Object.assign(Object.assign({},e),{allowedLocales:t.allowedLocales}),i=!0));const n=super.applyUpdate(e,t);return i?new fS(n.newValue,!0):n}validate(e){if(!e||"object"!=typeof e)return this.defaultValue;const t=e;return{nonBasicASCII:jS(t.nonBasicASCII,FS,[!0,!1,FS]),invisibleCharacters:CS(t.invisibleCharacters,this.defaultValue.invisibleCharacters),ambiguousCharacters:CS(t.ambiguousCharacters,this.defaultValue.ambiguousCharacters),includeComments:jS(t.includeComments,FS,[!0,!1,FS]),includeStrings:jS(t.includeStrings,FS,[!0,!1,FS]),allowedCharacters:this.validateBooleanMap(e.allowedCharacters,this.defaultValue.allowedCharacters),allowedLocales:this.validateBooleanMap(e.allowedLocales,this.defaultValue.allowedLocales)}}validateBooleanMap(e,t){if("object"!=typeof e||!e)return t;const i={};for(const[n,s]of Object.entries(e))!0===s&&(i[n]=!0);return i}}),unusualLineTerminators:GS(new NS(125,"unusualLineTerminators","prompt",["auto","off","prompt"],{enumDescriptions:[ue(0,"Unusual line terminators are automatically removed."),ue(0,"Unusual line terminators are ignored."),ue(0,"Unusual line terminators prompt to be removed.")],description:ue(0,"Remove unusual line terminators that might cause problems.")})),useShadowDOM:GS(new wS(126,"useShadowDOM",!0)),useTabStops:GS(new wS(127,"useTabStops",!0,{description:ue(0,"Inserting and deleting whitespace follows tab stops.")})),wordBreak:GS(new NS(128,"wordBreak","normal",["normal","keepAll"],{markdownEnumDescriptions:[ue(0,"Use the default line break rule."),ue(0,"Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.")],description:ue(0,"Controls the word break rules used for Chinese/Japanese/Korean (CJK) text.")})),wordSeparators:GS(new DS(129,"wordSeparators",kc,{description:ue(0,"Characters that will be used as word separators when doing word related navigations or operations.")})),wordWrap:GS(new NS(130,"wordWrap","off",["off","on","wordWrapColumn","bounded"],{markdownEnumDescriptions:[ue(0,"Lines will never wrap."),ue(0,"Lines will wrap at the viewport width."),ue(0,"Lines will wrap at `#editor.wordWrapColumn#`."),ue(0,"Lines will wrap at the minimum of viewport and `#editor.wordWrapColumn#`.")],description:ue(0,"Controls how lines should wrap.")})),wordWrapBreakAfterCharacters:GS(new DS(131,"wordWrapBreakAfterCharacters"," \t})]?|/&.,;\xa2\xb0\u2032\u2033\u2030\u2103\u3001\u3002\uff61\uff64\uffe0\uff0c\uff0e\uff1a\uff1b\uff1f\uff01\uff05\u30fb\uff65\u309d\u309e\u30fd\u30fe\u30fc\u30a1\u30a3\u30a5\u30a7\u30a9\u30c3\u30e3\u30e5\u30e7\u30ee\u30f5\u30f6\u3041\u3043\u3045\u3047\u3049\u3063\u3083\u3085\u3087\u308e\u3095\u3096\u31f0\u31f1\u31f2\u31f3\u31f4\u31f5\u31f6\u31f7\u31f8\u31f9\u31fa\u31fb\u31fc\u31fd\u31fe\u31ff\u3005\u303b\uff67\uff68\uff69\uff6a\uff6b\uff6c\uff6d\uff6e\uff6f\uff70\u201d\u3009\u300b\u300d\u300f\u3011\u3015\uff09\uff3d\uff5d\uff63")),wordWrapBreakBeforeCharacters:GS(new DS(132,"wordWrapBreakBeforeCharacters","([{\u2018\u201c\u3008\u300a\u300c\u300e\u3010\u3014\uff08\uff3b\uff5b\uff62\xa3\xa5\uff04\uffe1\uffe5+\uff0b")),wordWrapColumn:GS(new SS(133,"wordWrapColumn",80,1,1073741824,{markdownDescription:ue(0,"Controls the wrapping column of the editor when `#editor.wordWrap#` is `wordWrapColumn` or `bounded`.")})),wordWrapOverride1:GS(new NS(134,"wordWrapOverride1","inherit",["off","on","inherit"])),wordWrapOverride2:GS(new NS(135,"wordWrapOverride2","inherit",["off","on","inherit"])),editorClassName:GS(new class extends vS{constructor(){super(140)}compute(e,t,i){const n=["monaco-editor"];return t.get(39)&&n.push(t.get(39)),e.extraEditorClassName&&n.push(e.extraEditorClassName),"default"===t.get(73)?n.push("mouse-default"):"copy"===t.get(73)&&n.push("mouse-copy"),t.get(110)&&n.push("showUnused"),t.get(138)&&n.push("showDeprecated"),n.join(" ")}}),defaultColorDecorators:GS(new wS(145,"defaultColorDecorators",!1,{markdownDescription:ue(0,"Controls whether inline color decorations should be shown using the default document color provider")})),pixelRatio:GS(new class extends vS{constructor(){super(141)}compute(e,t,i){return e.pixelRatio}}),tabFocusMode:GS(new wS(142,"tabFocusMode",!1,{markdownDescription:ue(0,"Controls whether the editor receives tabs or defers them to the workbench for navigation.")})),layoutInfo:GS(new AS),wrappingInfo:GS(new class extends vS{constructor(){super(144)}compute(e,t,i){const n=t.get(143);return{isDominatedByLongLines:e.isDominatedByLongLines,isWordWrapMinified:n.isWordWrapMinified,isViewportWrapping:n.isViewportWrapping,wrappingColumn:n.wrappingColumn}}}),wrappingIndent:GS(new class extends mS{constructor(){super(136,"wrappingIndent",1,{"editor.wrappingIndent":{type:"string",enum:["none","same","indent","deepIndent"],enumDescriptions:[ue(0,"No indentation. Wrapped lines begin at column 1."),ue(0,"Wrapped lines get the same indentation as the parent."),ue(0,"Wrapped lines get +1 indentation toward the parent."),ue(0,"Wrapped lines get +2 indentation toward the parent.")],description:ue(0,"Controls the indentation of wrapped lines."),default:"same"}})}validate(e){switch(e){case"none":return 0;case"same":return 1;case"indent":return 2;case"deepIndent":return 3}return 1}compute(e,t,i){return 2===t.get(2)?0:i}}),wrappingStrategy:GS(new class extends mS{constructor(){super(137,"wrappingStrategy","simple",{"editor.wrappingStrategy":{enumDescriptions:[ue(0,"Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width."),ue(0,"Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.")],type:"string",enum:["simple","advanced"],default:"simple",description:ue(0,"Controls the algorithm that computes wrapping points. Note that when in accessibility mode, advanced will be used for the best experience.")}})}validate(e){return xS(e,"simple",["simple","advanced"])}compute(e,t,i){return 2===t.get(2)?"advanced":i}})},YS=Object.freeze({id:"editor",order:5,type:"object",title:ue(0,"Editor"),scope:5}),XS=Object.assign(Object.assign({},YS),{properties:{"editor.tabSize":{type:"number",default:Sc.tabSize,minimum:1,markdownDescription:ue(0,"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:ue(0,'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:Sc.insertSpaces,markdownDescription:ue(0,"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:Sc.detectIndentation,markdownDescription:ue(0,"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:Sc.trimAutoWhitespace,description:ue(0,"Remove trailing auto inserted whitespace.")},"editor.largeFileOptimizations":{type:"boolean",default:Sc.largeFileOptimizations,description:ue(0,"Special handling for large files to disable certain memory intensive features.")},"editor.wordBasedSuggestions":{type:"boolean",default:!0,description:ue(0,"Controls whether completions should be computed based on words in the document.")},"editor.wordBasedSuggestionsMode":{enum:["currentDocument","matchingDocuments","allDocuments"],default:"matchingDocuments",enumDescriptions:[ue(0,"Only suggest words from the active document."),ue(0,"Suggest words from all open documents of the same language."),ue(0,"Suggest words from all open documents.")],description:ue(0,"Controls from which documents word based completions are computed.")},"editor.semanticHighlighting.enabled":{enum:[!0,!1,"configuredByTheme"],enumDescriptions:[ue(0,"Semantic highlighting enabled for all color themes."),ue(0,"Semantic highlighting disabled for all color themes."),ue(0,"Semantic highlighting is configured by the current color theme's `semanticHighlighting` setting.")],default:"configuredByTheme",description:ue(0,"Controls whether the semanticHighlighting is shown for the languages that support it.")},"editor.stablePeek":{type:"boolean",default:!1,markdownDescription:ue(0,"Keep peek editors open even when double-clicking their content or when hitting `Escape`.")},"editor.maxTokenizationLineLength":{type:"integer",default:2e4,description:ue(0,"Lines above this length will not be tokenized for performance reasons")},"editor.experimental.asyncTokenization":{type:"boolean",default:!1,description:ue(0,"Controls whether the tokenization should happen asynchronously on a web worker."),tags:["experimental"]},"editor.experimental.asyncTokenizationLogging":{type:"boolean",default:!1,description:ue(0,"Controls whether async tokenization should be logged. For debugging only.")},"editor.experimental.asyncTokenizationVerification":{type:"boolean",default:!1,description:ue(0,"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:ue(0,"Defines the bracket symbols that increase or decrease the indentation."),items:{type:"array",items:[{type:"string",description:ue(0,"The opening bracket character or string sequence.")},{type:"string",description:ue(0,"The closing bracket character or string sequence.")}]}},"editor.language.colorizedBracketPairs":{type:["array","null"],default:null,description:ue(0,"Defines the bracket pairs that are colorized by their nesting level if bracket pair colorization is enabled."),items:{type:"array",items:[{type:"string",description:ue(0,"The opening bracket character or string sequence.")},{type:"string",description:ue(0,"The closing bracket character or string sequence.")}]}},"diffEditor.maxComputationTime":{type:"number",default:uS.maxComputationTime,description:ue(0,"Timeout in milliseconds after which diff computation is cancelled. Use 0 for no timeout.")},"diffEditor.maxFileSize":{type:"number",default:uS.maxFileSize,description:ue(0,"Maximum file size in MB for which to compute diffs. Use 0 for no limit.")},"diffEditor.renderSideBySide":{type:"boolean",default:uS.renderSideBySide,description:ue(0,"Controls whether the diff editor shows the diff side by side or inline.")},"diffEditor.renderSideBySideInlineBreakpoint":{type:"number",default:uS.renderSideBySideInlineBreakpoint,description:ue(0,"If the diff editor width is smaller than this value, the inline view is used.")},"diffEditor.useInlineViewWhenSpaceIsLimited":{type:"boolean",default:uS.useInlineViewWhenSpaceIsLimited,description:ue(0,"If enabled and the editor width is too small, the inline view is used.")},"diffEditor.renderMarginRevertIcon":{type:"boolean",default:uS.renderMarginRevertIcon,description:ue(0,"When enabled, the diff editor shows arrows in its glyph margin to revert changes.")},"diffEditor.ignoreTrimWhitespace":{type:"boolean",default:uS.ignoreTrimWhitespace,description:ue(0,"When enabled, the diff editor ignores changes in leading or trailing whitespace.")},"diffEditor.renderIndicators":{type:"boolean",default:uS.renderIndicators,description:ue(0,"Controls whether the diff editor shows +/- indicators for added/removed changes.")},"diffEditor.codeLens":{type:"boolean",default:uS.diffCodeLens,description:ue(0,"Controls whether the editor shows CodeLens.")},"diffEditor.wordWrap":{type:"string",enum:["off","on","inherit"],default:uS.diffWordWrap,markdownEnumDescriptions:[ue(0,"Lines will never wrap."),ue(0,"Lines will wrap at the viewport width."),ue(0,"Lines will wrap according to the {0} setting.","`#editor.wordWrap#`")]},"diffEditor.diffAlgorithm":{type:"string",enum:["legacy","advanced"],default:uS.diffAlgorithm,markdownEnumDescriptions:[ue(0,"Uses the legacy diffing algorithm."),ue(0,"Uses the advanced diffing algorithm.")],tags:["experimental"]},"diffEditor.hideUnchangedRegions.enabled":{type:"boolean",default:uS.hideUnchangedRegions.enabled,markdownDescription:ue(0,"Controls whether the diff editor shows unchanged regions.")},"diffEditor.hideUnchangedRegions.revealLineCount":{type:"integer",default:uS.hideUnchangedRegions.revealLineCount,markdownDescription:ue(0,"Controls how many lines are used for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.minimumLineCount":{type:"integer",default:uS.hideUnchangedRegions.minimumLineCount,markdownDescription:ue(0,"Controls how many lines are used as a minimum for unchanged regions."),minimum:1},"diffEditor.hideUnchangedRegions.contextLineCount":{type:"integer",default:uS.hideUnchangedRegions.contextLineCount,markdownDescription:ue(0,"Controls how many lines are used as context when comparing unchanged regions."),minimum:1},"diffEditor.experimental.showMoves":{type:"boolean",default:uS.experimental.showMoves,markdownDescription:ue(0,"Controls whether the diff editor should show detected code moves.")},"diffEditor.experimental.showEmptyDecorations":{type:"boolean",default:uS.experimental.showEmptyDecorations,description:ue(0,"Controls whether the diff editor shows empty decorations to see where characters got inserted or deleted.")}}});for(const Tre of $S){const e=Tre.schema;if(void 0!==e)if(void 0!==(QS=e).type||void 0!==QS.anyOf)XS.properties[`editor.${Tre.name}`]=e;else for(const t in e)Object.hasOwnProperty.call(e,t)&&(XS.properties[t]=e[t])}var QS;let JS=null;function eL(){return null===JS&&(JS=Object.create(null),Object.keys(XS.properties).forEach((e=>{JS[e]=!0}))),JS}jl.as(xu).registerConfiguration(XS);const tL=Ba("IWorkspaceEditService");class iL{constructor(e){this.metadata=e}static convert(e){return e.edits.map((e=>{if(nL.is(e))return nL.lift(e);if(sL.is(e))return sL.lift(e);throw new Error("Unsupported edit")}))}}class nL extends iL{static is(e){return e instanceof nL||Br(e)&&an.isUri(e.resource)&&Br(e.textEdit)}static lift(e){return e instanceof nL?e:new nL(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 sL extends iL{static is(e){return e instanceof sL||Br(e)&&(Boolean(e.newResource)||Boolean(e.oldResource))}static lift(e){return e instanceof sL?e:new sL(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=Ba("ILanguageFeaturesService"),rL=Ba("IEditorCancelService"),aL=new Al("cancellableOperation",!1,ue(0,"Whether the editor runs a cancellable operation, e.g. like 'Peek References'"));yu(rL,class{constructor(){this._tokens=new WeakMap}add(e,t){let i,n=this._tokens.get(e);return n||(n=e.invokeWithinContext((e=>({key:aL.bindTo(e.get(Ol)),tokens:new O}))),this._tokens.set(e,n)),n.key.set(!0),i=n.tokens.push(t),()=>{i&&(i(),n.key.set(!n.tokens.isEmpty()),i=void 0)}}cancel(e){const t=this._tokens.get(e);if(!t)return;const i=t.tokens.pop();i&&(i.cancel(),t.key.set(!t.tokens.isEmpty()))}},1);class lL extends jh{constructor(e,t){super(t),this.editor=e,this._unregister=e.invokeWithinContext((t=>t.get(rL).add(e,this)))}dispose(){this._unregister(),super.dispose()}}Sh(new class extends vh{constructor(){super({id:"editor.cancelOperation",kbOpts:{weight:100,primary:9},precondition:aL})}runEditorCommand(e,t){e.get(rL).cancel(t)}});class hL{constructor(e,t){if(this.flags=t,1&this.flags){const t=e.getModel();this.modelVersionId=t?Qs("{0}#{1}",t.uri.toString(),t.getVersionId()):null}else this.modelVersionId=null;4&this.flags?this.position=e.getPosition():this.position=null,2&this.flags?this.selection=e.getSelection():this.selection=null,8&this.flags?(this.scrollLeft=e.getScrollLeft(),this.scrollTop=e.getScrollTop()):(this.scrollLeft=-1,this.scrollTop=-1)}_equals(e){if(!(e instanceof hL))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 hL(e,this.flags))}}class dL extends lL{constructor(e,t,i,n){super(e,n),this._listener=new N,4&t&&this._listener.add(e.onDidChangeCursorPosition((e=>{i&&Rh.containsPosition(i,e.position)||this.cancel()}))),2&t&&this._listener.add(e.onDidChangeCursorSelection((e=>{i&&Rh.containsRange(i,e.selection)||this.cancel()}))),8&t&&this._listener.add(e.onDidScrollChange((e=>this.cancel()))),1&t&&(this._listener.add(e.onDidChangeModel((e=>this.cancel()))),this._listener.add(e.onDidChangeModelContent((e=>this.cancel()))))}dispose(){this._listener.dispose(),super.dispose()}}class cL extends jh{constructor(e,t){super(t),this._listener=e.onDidChangeContent((()=>this.cancel()))}dispose(){this._listener.dispose(),super.dispose()}}var uL;!function(e){e[e.Ignore=0]="Ignore",e[e.Info=1]="Info",e[e.Warning=2]="Warning",e[e.Error=3]="Error"}(uL||(uL={})),function(e){const t="error",i="warning",n="info";e.fromValue=function(s){return s?_o(t,s)?e.Error:_o(i,s)||_o("warn",s)?e.Warning:_o(n,s)?e.Info:e.Ignore:e.Ignore},e.toString=function(s){switch(s){case e.Error:return t;case e.Warning:return i;case e.Info:return n;default:return"ignore"}}}(uL||(uL={}));const gL=uL;var pL=gL;const mL=Ba("notificationService");const fL=Ba("progressService");Object.freeze({total(){},worked(){},done(){}});class _L{constructor(e,t){this.callback=e,this.report=(null==t?void 0:t.async)?this._reportAsync.bind(this):this._reportSync.bind(this)}_reportSync(e){this._value=e,this.callback(this._value)}_reportAsync(e){Promise.resolve(this._lastTask).finally((()=>{this._value=e;const t=this.callback(this._value);this._lastTask=Promise.resolve(t).finally((()=>this._lastTask=void 0))}))}}_L.None=Object.freeze({report(){}});const vL=Ba("editorProgressService");var bL,CL=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class wL{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+wL.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(e){return new wL(this.value+wL.sep+e)}}function yL(e,t,i){return!!t.contains(e)&&(!i||!t.contains(i))}wL.sep=".",wL.None=new wL("@@none@@"),wL.Empty=new wL(""),wL.QuickFix=new wL("quickfix"),wL.Refactor=new wL("refactor"),wL.RefactorExtract=wL.Refactor.append("extract"),wL.RefactorInline=wL.Refactor.append("inline"),wL.RefactorMove=wL.Refactor.append("move"),wL.RefactorRewrite=wL.Refactor.append("rewrite"),wL.Notebook=new wL("notebook"),wL.Source=new wL("source"),wL.SourceOrganizeImports=wL.Source.append("organizeImports"),wL.SourceFixAll=wL.Source.append("fixAll"),wL.SurroundWith=wL.Refactor.append("surround"),function(e){e.Refactor="refactor",e.RefactorPreview="refactor preview",e.Lightbulb="lightbulb",e.Default="other (default)",e.SourceAction="source action",e.QuickFix="quick fix action",e.FixAll="fix all",e.OrganizeImports="organize imports",e.AutoFix="auto fix",e.QuickFixHover="quick fix hover window",e.OnSave="save participants",e.ProblemsView="problems view"}(bL||(bL={}));class SL{static fromUser(e,t){return e&&"object"==typeof e?new SL(SL.getKindFromUser(e,t.kind),SL.getApplyFromUser(e,t.apply),SL.getPreferredUser(e)):new SL(t.kind,t.apply,!1)}static getApplyFromUser(e,t){switch("string"==typeof e.apply?e.apply.toLowerCase():""){case"first":return"first";case"never":return"never";case"ifsingle":return"ifSingle";default:return t}}static getKindFromUser(e,t){return"string"==typeof e.kind?new wL(e.kind):t}static getPreferredUser(e){return"boolean"==typeof e.preferred&&e.preferred}constructor(e,t,i){this.kind=e,this.apply=t,this.preferred=i}}class LL{constructor(e,t,i){this.action=e,this.provider=t,this.highlightRange=i}resolve(e){var t;return CL(this,void 0,void 0,(function*(){if((null===(t=this.provider)||void 0===t?void 0:t.resolveCodeAction)&&!this.action.edit){let t;try{t=yield this.provider.resolveCodeAction(this.action,e)}catch(i){a(i)}t&&(this.action.edit=t.edit)}return this}))}}var kL=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const DL="editor.action.codeAction",xL="editor.action.quickFix",NL="editor.action.autoFix",EL="editor.action.refactor",IL="editor.action.sourceAction",ML="editor.action.organizeImports",TL="editor.action.fixAll";class RL extends E{static codeActionsPreferredComparator(e,t){return e.isPreferred&&!t.isPreferred?-1:!e.isPreferred&&t.isPreferred?1:0}static codeActionsComparator({action:e},{action:t}){return Hd(e.diagnostics)?Hd(t.diagnostics)?RL.codeActionsPreferredComparator(e,t):-1:Hd(t.diagnostics)?1:RL.codeActionsPreferredComparator(e,t)}constructor(e,t,i){super(),this.documentation=t,this._register(i),this.allActions=[...e].sort(RL.codeActionsComparator),this.validActions=this.allActions.filter((({action:e})=>!e.disabled))}get hasAutoFix(){return this.validActions.some((({action:e})=>!!e.kind&&wL.QuickFix.contains(new wL(e.kind))&&!!e.isPreferred))}}const AL={actions:[],documentation:void 0};function OL(e,t,i,n,s,o){var r;return kL(this,void 0,void 0,(function*(){const l=n.filter||{},h=Object.assign(Object.assign({},l),{excludes:[...l.excludes||[],wL.Notebook]}),c={only:null===(r=l.include)||void 0===r?void 0:r.value,trigger:n.type},u=new cL(t,o),g=2===n.type,p=function(e,t,i){return e.all(t).filter((e=>!e.providedCodeActionKinds||e.providedCodeActionKinds.some((e=>function(e,t){return!(e.include&&!e.include.intersects(t)||e.excludes&&e.excludes.some((i=>yL(t,i,e.include)))||!e.includeSourceActions&&wL.Source.contains(t))}(i,new wL(e))))))}(e,t,g?h:l),m=new N,f=p.map((e=>kL(this,void 0,void 0,(function*(){try{s.report(e);const n=yield e.provideCodeActions(t,i,c,u.token);if(n&&m.add(n),u.token.isCancellationRequested)return AL;const o=((null==n?void 0:n.actions)||[]).filter((e=>e&&function(e,t){const i=t.kind?new wL(t.kind):void 0;return!(!(!e.include||i&&e.include.contains(i))||e.excludes&&i&&e.excludes.some((t=>yL(i,t,e.include)))||!e.includeSourceActions&&i&&wL.Source.contains(i)||e.onlyIncludePreferredActions&&!t.isPreferred)}(l,e))),r=function(e,t,i){if(!e.documentation)return;const n=e.documentation.map((e=>({kind:new wL(e.kind),command:e.command})));if(i){let e;for(const t of n)t.kind.contains(i)&&(e?e.kind.contains(t.kind)&&(e=t):e=t);if(e)return null==e?void 0:e.command}for(const s of t)if(s.kind)for(const e of n)if(e.kind.contains(new wL(s.kind)))return e.command;return}(e,o,l.include);return{actions:o.map((t=>new LL(t,e))),documentation:r}}catch(n){if(d(n))throw n;return a(n),AL}})))),_=e.onDidChange((()=>{Td(e.all(t),p)||u.cancel()}));try{const i=yield Promise.all(f),s=i.map((e=>e.actions)).flat(),o=[...Bd(i.map((e=>e.documentation))),...PL(e,t,n,s)];return new RL(s,o,m)}finally{_.dispose(),u.dispose()}}))}function*PL(e,t,i,n){var s,o,r;if(t&&n.length)for(const a of e.all(t))a._getAdditionalMenuItems&&(yield*null===(s=a._getAdditionalMenuItems)||void 0===s?void 0:s.call(a,{trigger:i.type,only:null===(r=null===(o=i.filter)||void 0===o?void 0:o.include)||void 0===r?void 0:r.value},n.map((e=>e.action))))}var FL;function BL(e,t,i,n,s=Uh.None){var o;return kL(this,void 0,void 0,(function*(){const r=e.get(tL),a=e.get(Ya),l=e.get(lh),h=e.get(mL);if(l.publicLog2("codeAction.applyCodeAction",{codeActionTitle:t.action.title,codeActionKind:t.action.kind,codeActionIsPreferred:!!t.action.isPreferred,reason:i}),yield t.resolve(s),!s.isCancellationRequested){if(null===(o=t.action.edit)||void 0===o?void 0:o.edits.length){if(!(yield r.apply(t.action.edit,{editor:null==n?void 0:n.editor,label:t.action.title,quotableLabel:t.action.title,code:"undoredo.codeAction",respectAutoSaveConfig:i!==FL.OnSave,showPreview:null==n?void 0:n.preview})).isApplied)return}if(t.action.command)try{yield a.executeCommand(t.action.command.id,...t.action.command.arguments||[])}catch(d){const e=function(e){return"string"==typeof e?e:e instanceof Error&&"string"==typeof e.message?e.message:void 0}(d);h.error("string"==typeof e?e:ue(0,"An unknown error occurred while applying the code action"))}}}))}!function(e){e.OnSave="onSave",e.FromProblemsView="fromProblemsView",e.FromCodeActions="fromCodeActions"}(FL||(FL={})),Xa.registerCommand("_executeCodeActionProvider",(function(e,t,i,n,s){return kL(this,void 0,void 0,(function*(){if(!(t instanceof an))throw u();const{codeActionProvider:o}=e.get(oL),r=e.get(Ha).getModel(t);if(!r)throw u();const a=Ah.isISelection(i)?Ah.liftSelection(i):Rh.isIRange(i)?r.validateRange(i):void 0;if(!a)throw u();const l="string"==typeof n?new wL(n):void 0,h=yield OL(o,r,a,{type:1,triggerAction:bL.Default,filter:{includeSourceActions:!0,include:l}},_L.None,Uh.None),d=[],c=Math.min(h.validActions.length,"number"==typeof s?s:0);for(let e=0;ee.action))}finally{setTimeout((()=>h.dispose()),100)}}))}));const WL=Ba("keybindingService");var VL,HL=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},zL=function(e,t){return function(i,n){t(i,n,e)}};let UL=VL=class{constructor(e){this.keybindingService=e}getResolver(){const e=new Zs((()=>this.keybindingService.getKeybindings().filter((e=>VL.codeActionCommands.indexOf(e.command)>=0)).filter((e=>e.resolvedKeybinding)).map((e=>{let t=e.commandArgs;return e.command===ML?t={kind:wL.SourceOrganizeImports.value}:e.command===TL&&(t={kind:wL.SourceFixAll.value}),Object.assign({resolvedKeybinding:e.resolvedKeybinding},SL.fromUser(t,{kind:wL.None,apply:"never"}))}))));return t=>{if(t.kind){const i=this.bestKeybindingForCodeAction(t,e.value);return null==i?void 0:i.resolvedKeybinding}}}bestKeybindingForCodeAction(e,t){if(!e.kind)return;const i=new wL(e.kind);return t.filter((e=>e.kind.contains(i))).filter((t=>!t.preferred||e.isPreferred)).reduceRight(((e,t)=>e?e.kind.contains(t.kind)?t:e:t),void 0)}};UL.codeActionCommands=[EL,DL,IL,ML,TL],UL=VL=HL([zL(0,WL)],UL);Dp("symbolIcon.arrayForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for array symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.booleanForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for boolean symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.classForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},ue(0,"The foreground color for class symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.colorForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for color symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.constantForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for constant symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.constructorForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},ue(0,"The foreground color for constructor symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.enumeratorForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},ue(0,"The foreground color for enumerator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.enumeratorMemberForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},ue(0,"The foreground color for enumerator member symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.eventForeground",{dark:"#EE9D28",light:"#D67E00",hcDark:"#EE9D28",hcLight:"#D67E00"},ue(0,"The foreground color for event symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.fieldForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},ue(0,"The foreground color for field symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.fileForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for file symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.folderForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for folder symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.functionForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},ue(0,"The foreground color for function symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.interfaceForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},ue(0,"The foreground color for interface symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.keyForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for key symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.keywordForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for keyword symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.methodForeground",{dark:"#B180D7",light:"#652D90",hcDark:"#B180D7",hcLight:"#652D90"},ue(0,"The foreground color for method symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.moduleForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for module symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.namespaceForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for namespace symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.nullForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for null symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.numberForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for number symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.objectForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for object symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.operatorForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for operator symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.packageForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for package symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.propertyForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for property symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.referenceForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for reference symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.snippetForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for snippet symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.stringForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for string symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.structForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for struct symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.textForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for text symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.typeParameterForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for type parameter symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.unitForeground",{dark:xp,light:xp,hcDark:xp,hcLight:xp},ue(0,"The foreground color for unit symbols. These symbols appear in the outline, breadcrumb, and suggest widget.")),Dp("symbolIcon.variableForeground",{dark:"#75BEFF",light:"#007ACC",hcDark:"#75BEFF",hcLight:"#007ACC"},ue(0,"The foreground color for variable symbols. These symbols appear in the outline, breadcrumb, and suggest widget."));const KL=Object.freeze({kind:wL.Empty,title:ue(0,"More Actions...")}),jL=Object.freeze([{kind:wL.QuickFix,title:ue(0,"Quick Fix")},{kind:wL.RefactorExtract,title:ue(0,"Extract"),icon:Jr.wrench},{kind:wL.RefactorInline,title:ue(0,"Inline"),icon:Jr.wrench},{kind:wL.RefactorRewrite,title:ue(0,"Rewrite"),icon:Jr.wrench},{kind:wL.RefactorMove,title:ue(0,"Move"),icon:Jr.wrench},{kind:wL.SurroundWith,title:ue(0,"Surround With"),icon:Jr.symbolSnippet},{kind:wL.Source,title:ue(0,"Source Action"),icon:Jr.symbolFile},KL]);function qL(e,t,i){let n=null,s=null;if("function"==typeof i.value?(n="value",s=i.value,0!==s.length&&console.warn("Memoize should only be used in functions with zero parameters")):"function"==typeof i.get&&(n="get",s=i.get),!s)throw new Error("not supported");const o=`$memoize$${t}`;i[n]=function(...e){return this.hasOwnProperty(o)||Object.defineProperty(this,o,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,e)}),this[o]}}var $L,GL=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};!function(e){e.Tap="-monaco-gesturetap",e.Change="-monaco-gesturechange",e.Start="-monaco-gesturestart",e.End="-monaco-gesturesend",e.Contextmenu="-monaco-gesturecontextmenu"}($L||($L={}));class ZL extends E{constructor(){super(),this.dispatched=!1,this.targets=new O,this.ignoreTargets=new O,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(En(document,"touchstart",(e=>this.onTouchStart(e)),{passive:!1})),this._register(En(document,"touchend",(e=>this.onTouchEnd(e)))),this._register(En(document,"touchmove",(e=>this.onTouchMove(e)),{passive:!1}))}static addTarget(e){if(!ZL.isTouchDevice())return E.None;ZL.INSTANCE||(ZL.INSTANCE=S(new ZL));return x(ZL.INSTANCE.targets.push(e))}static ignoreTarget(e){if(!ZL.isTouchDevice())return E.None;ZL.INSTANCE||(ZL.INSTANCE=S(new ZL));return x(ZL.INSTANCE.ignoreTargets.push(e))}static isTouchDevice(){return"ontouchstart"in window||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(o.initialPageX-Md(o.rollingPageX))<30&&Math.abs(o.initialPageY-Md(o.rollingPageY))<30){const e=this.newGestureEvent($L.Contextmenu,o.initialTarget);e.pageX=Md(o.rollingPageX),e.pageY=Md(o.rollingPageY),this.dispatchEvent(e)}else if(1===i){const e=Md(o.rollingPageX),i=Md(o.rollingPageY),n=Md(o.rollingTimestamps)-o.rollingTimestamps[0],s=e-o.rollingPageX[0],r=i-o.rollingPageY[0],a=[...this.targets].filter((e=>o.initialTarget instanceof Node&&e.contains(o.initialTarget)));this.inertia(a,t,Math.abs(s)/n,s>0?1:-1,e,Math.abs(r)/n,r>0?1:-1,i)}this.dispatchEvent(this.newGestureEvent($L.End,o.initialTarget)),delete this.activeTouches[s.identifier]}this.dispatched&&(e.preventDefault(),e.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===$L.Tap){const t=(new Date).getTime();let i=0;i=t-this._lastSetTapCountTime>ZL.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=t,e.tapCount=i}else e.type!==$L.Change&&e.type!==$L.Contextmenu||(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(const t of this.ignoreTargets)if(t.contains(e.initialTarget))return;for(const t of this.targets)t.contains(e.initialTarget)&&(t.dispatchEvent(e),this.dispatched=!0)}}inertia(e,t,i,n,s,o,r,a){this.handle=An((()=>{const l=Date.now(),h=l-t;let d=0,c=0,u=!0;i+=ZL.SCROLL_FRICTION*h,o+=ZL.SCROLL_FRICTION*h,i>0&&(u=!1,d=n*i*h),o>0&&(u=!1,c=r*o*h);const g=this.newGestureEvent($L.Change);g.translationX=d,g.translationY=c,e.forEach((e=>e.dispatchEvent(g))),u||this.inertia(e,l,i,n,s+d,o,r,a+c)}))}onTouchMove(e){const t=Date.now();for(let i=0,n=e.changedTouches.length;i3&&(s.rollingPageX.shift(),s.rollingPageY.shift(),s.rollingTimestamps.shift()),s.rollingPageX.push(n.pageX),s.rollingPageY.push(n.pageY),s.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,GL([qL],ZL,"isTouchDevice",null);var YL,XL,QL=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},JL=function(e,t){return function(i,n){t(i,n,e)}};!function(e){e.Hidden={type:0};e.Showing=class{constructor(e,t,i,n){this.actions=e,this.trigger=t,this.editorPosition=i,this.widgetPosition=n,this.type=1}}}(XL||(XL={}));let ek=YL=class extends E{constructor(e,t){super(),this._editor=e,this._onClick=this._register(new U),this.onClick=this._onClick.event,this._state=XL.Hidden,this._domNode=fs("div.lightBulbWidget"),this._register(ZL.ignoreTarget(this._domNode)),this._editor.addContentWidget(this),this._register(this._editor.onDidChangeModelContent((e=>{const t=this._editor.getModel();(1!==this.state.type||!t||this.state.editorPosition.lineNumber>=t.getLineCount())&&this.hide()}))),this._register(Tn(this._domNode,(e=>{if(1!==this.state.type)return;this._editor.focus(),e.preventDefault();const{top:t,height:i}=Hn(this._domNode),n=this._editor.getOption(66);let s=Math.floor(n/3);null!==this.state.widgetPosition.position&&this.state.widgetPosition.position.lineNumber{1&~e.buttons||this.hide()}))),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(64)&&!this._editor.getOption(64).enabled&&this.hide()}))),this._register(B.runAndSubscribe(t.onDidUpdateKeybindings,(()=>{var e,i,n,s;this._preferredKbLabel=null!==(i=null===(e=t.lookupKeybinding(NL))||void 0===e?void 0:e.getLabel())&&void 0!==i?i:void 0,this._quickFixKbLabel=null!==(s=null===(n=t.lookupKeybinding(xL))||void 0===n?void 0:n.getLabel())&&void 0!==s?s:void 0,this._updateLightBulbTitleAndIcon()})))}dispose(){super.dispose(),this._editor.removeContentWidget(this)}getId(){return"LightBulbWidget"}getDomNode(){return this._domNode}getPosition(){return 1===this._state.type?this._state.widgetPosition:null}update(e,t,i){if(e.validActions.length<=0)return this.hide();const n=this._editor.getOptions();if(!n.get(64).enabled)return this.hide();const s=this._editor.getModel();if(!s)return this.hide();const{lineNumber:o,column:r}=s.validatePosition(i),a=s.getOptions().tabSize,l=n.get(50),h=Xv(s.getLineContent(o),a),d=e=>e>2&&this._editor.getTopForLineNumber(e)===this._editor.getTopForLineNumber(e-1);let c=o;if(!(l.spaceWidth*h>22))if(o>1&&!d(o-1))c-=1;else if(d(o+1)){if(r*l.spaceWidth<22)return this.hide()}else c+=1;this.state=new XL.Showing(e,t,i,{position:{lineNumber:c,column:1},preference:YL._posPref}),this._editor.layoutContentWidget(this)}hide(){this.state!==XL.Hidden&&(this.state=XL.Hidden,this._editor.layoutContentWidget(this))}get state(){return this._state}set state(e){this._state=e,this._updateLightBulbTitleAndIcon()}_updateLightBulbTitleAndIcon(){1===this.state.type&&this.state.actions.hasAutoFix&&(this._domNode.classList.remove(...ta.asClassNameArray(Jr.lightBulb)),this._domNode.classList.add(...ta.asClassNameArray(Jr.lightbulbAutofix)),this._preferredKbLabel)?this.title=ue(0,"Show Code Actions. Preferred Quick Fix Available ({0})",this._preferredKbLabel):(this._domNode.classList.remove(...ta.asClassNameArray(Jr.lightbulbAutofix)),this._domNode.classList.add(...ta.asClassNameArray(Jr.lightBulb)),this._quickFixKbLabel?this.title=ue(0,"Show Code Actions ({0})",this._quickFixKbLabel):this.title=ue(0,"Show Code Actions"))}set title(e){this._domNode.title=e}};function tk(e,t={}){const i=ik(t);return sk(i,function(e,t){const i={type:1,children:[]};let n=0,s=i;const o=[],r=new nk(e);for(;!r.eos();){let e=r.next();const i="\\"===e&&0!==rk(r.peek(),t);if(i&&(e=r.next()),!i&&ok(e,t)&&e===r.peek()){r.advance(),2===s.type&&(s=o.pop());const i=rk(e,t);if(s.type===i||5===s.type&&6===i)s=o.pop();else{const e={type:i,children:[]};5===i&&(e.index=n,n++),s.children.push(e),o.push(s),s=e}}else if("\n"===e)2===s.type&&(s=o.pop()),s.children.push({type:8});else if(2!==s.type){const t={type:2,content:e};s.children.push(t),o.push(s),s=t}else s.content+=e}2===s.type&&(s=o.pop());o.length;return i}(e,!!t.renderCodeSegments),t.actionHandler,t.renderCodeSegments),i}function ik(e){const t=e.inline?"span":"div",i=document.createElement(t);return e.className&&(i.className=e.className),i}ek.ID="editor.contrib.lightbulbWidget",ek._posPref=[0],ek=YL=QL([JL(1,WL)],ek);class nk{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++}}function sk(e,t,i,n){let s;if(2===t.type)s=document.createTextNode(t.content||"");else if(3===t.type)s=document.createElement("b");else if(4===t.type)s=document.createElement("i");else if(7===t.type&&n)s=document.createElement("code");else if(5===t.type&&i){const e=document.createElement("a");i.disposables.add(Mn(e,"click",(e=>{i.callback(String(t.index),e)}))),s=e}else 8===t.type?s=document.createElement("br"):1===t.type&&(s=e);s&&e!==s&&e.appendChild(s),s&&Array.isArray(t.children)&&t.children.forEach((e=>{sk(s,e,i,n)}))}function ok(e,t){return 0!==rk(e,t)}function rk(e,t){switch(e){case"*":return 3;case"_":return 4;case"[":return 5;case"]":return 6;case"`":return t?7:0;default:return 0}}const ak=new RegExp(`(\\\\)?\\$\\((${ta.iconNameExpression}(?:${ta.iconModifierExpression})?)\\)`,"g");function lk(e){const t=new Array;let i,n=0,s=0;for(;null!==(i=ak.exec(e));){s=i.index||0,ne.length)&&(t=e.length);for(var i=0,n=new Array(t);i=e.length?{done:!0}:{done:!1,value:e[s++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function s(){return{async:!1,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}}e.defaults={async:!1,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};var o=/[&<>"']/,r=/[&<>"']/g,a=/[<>"']|&(?!#?\w+;)/,l=/[<>"']|&(?!#?\w+;)/g,h={"&":"&","<":"<",">":">",'"':""","'":"'"},d=function(e){return h[e]};function c(e,t){if(t){if(o.test(e))return e.replace(r,d)}else if(a.test(e))return e.replace(l,d);return e}var u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function g(e){return e.replace(u,(function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))}var p=/(^|[^\[])\^/g;function m(e,t){e="string"==typeof e?e:e.source,t=t||"";var i={replace:function(t,n){return n=(n=n.source||n).replace(p,"$1"),e=e.replace(t,n),i},getRegex:function(){return new RegExp(e,t)}};return i}var f=/[^\w:]/g,_=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function v(e,t,i){if(e){var n;try{n=decodeURIComponent(g(i)).replace(f,"").toLowerCase()}catch(Mre){return null}if(0===n.indexOf("javascript:")||0===n.indexOf("vbscript:")||0===n.indexOf("data:"))return null}t&&!_.test(i)&&(i=function(e,t){b[" "+e]||(C.test(e)?b[" "+e]=e+"/":b[" "+e]=D(e,"/",!0));var i=-1===(e=b[" "+e]).indexOf(":");return"//"===t.substring(0,2)?i?t:e.replace(w,"$1")+t:"/"===t.charAt(0)?i?t:e.replace(y,"$1")+t:e+t}(t,i));try{i=encodeURI(i).replace(/%25/g,"%")}catch(Mre){return null}return i}var b={},C=/^[^:]+:\/*[^/]*$/,w=/^([^:]+:)[\s\S]*$/,y=/^([^:]+:\/*[^/]*)[\s\S]*$/,S={exec:function(){}};function L(e){for(var t,i,n=1;n=0&&"\\"===i[s];)n=!n;return n?"|":" |"})).split(/ \|/),n=0;if(i[0].trim()||i.shift(),i.length>0&&!i[i.length-1].trim()&&i.pop(),i.length>t)i.splice(t);else for(;i.length1;)1&t&&(i+=e),t>>=1,e+=e;return i+e}function E(e,t,i,n){var s=t.href,o=t.title?c(t.title):null,r=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){n.state.inLink=!0;var a={type:"link",raw:i,href:s,title:o,text:r,tokens:n.inlineTokens(r)};return n.state.inLink=!1,a}return{type:"image",raw:i,href:s,title:o,text:c(r)}}var I=function(){function t(t){this.options=t||e.defaults}var i=t.prototype;return i.space=function(e){var t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}},i.code=function(e){var t=this.rules.block.code.exec(e);if(t){var i=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?i:D(i,"\n")}}},i.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var i=t[0],n=function(e,t){var i=e.match(/^(\s+)(?:```)/);if(null===i)return t;var n=i[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:t[0].length>=n.length?e.slice(n.length):e})).join("\n")}(i,t[3]||"");return{type:"code",raw:i,lang:t[2]?t[2].trim():t[2],text:n}}},i.heading=function(e){var t=this.rules.block.heading.exec(e);if(t){var i=t[2].trim();if(/#$/.test(i)){var n=D(i,"#");this.options.pedantic?i=n.trim():n&&!/ $/.test(n)||(i=n.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:i,tokens:this.lexer.inline(i)}}},i.hr=function(e){var t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}},i.blockquote=function(e){var t=this.rules.block.blockquote.exec(e);if(t){var i=t[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(i,[]),text:i}}},i.list=function(e){var t=this.rules.block.list.exec(e);if(t){var i,s,o,r,a,l,h,d,c,u,g,p,m=t[1].trim(),f=m.length>1,_={type:"list",raw:"",ordered:f,start:f?+m.slice(0,-1):"",loose:!1,items:[]};m=f?"\\d{1,9}\\"+m.slice(-1):"\\"+m,this.options.pedantic&&(m=f?m:"[*+-]");for(var v=new RegExp("^( {0,3}"+m+")((?:[\t ][^\\n]*)?(?:\\n|$))");e&&(p=!1,t=v.exec(e))&&!this.rules.block.hr.test(e);){if(i=t[0],e=e.substring(i.length),d=t[2].split("\n",1)[0],c=e.split("\n",1)[0],this.options.pedantic?(r=2,g=d.trimLeft()):(r=(r=t[2].search(/[^ ]/))>4?1:r,g=d.slice(r),r+=t[1].length),l=!1,!d&&/^ *$/.test(c)&&(i+=c+"\n",e=e.substring(c.length+1),p=!0),!p)for(var b=new RegExp("^ {0,"+Math.min(3,r-1)+"}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))"),C=new RegExp("^ {0,"+Math.min(3,r-1)+"}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)"),w=new RegExp("^ {0,"+Math.min(3,r-1)+"}(?:```|~~~)"),y=new RegExp("^ {0,"+Math.min(3,r-1)+"}#");e&&(d=u=e.split("\n",1)[0],this.options.pedantic&&(d=d.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!w.test(d))&&!y.test(d)&&!b.test(d)&&!C.test(e);){if(d.search(/[^ ]/)>=r||!d.trim())g+="\n"+d.slice(r);else{if(l)break;g+="\n"+d}l||d.trim()||(l=!0),i+=u+"\n",e=e.substring(u.length+1)}_.loose||(h?_.loose=!0:/\n *\n *$/.test(i)&&(h=!0)),this.options.gfm&&(s=/^\[[ xX]\] /.exec(g))&&(o="[ ] "!==s[0],g=g.replace(/^\[[ xX]\] +/,"")),_.items.push({type:"list_item",raw:i,task:!!s,checked:o,loose:!1,text:g}),_.raw+=i}_.items[_.items.length-1].raw=i.trimRight(),_.items[_.items.length-1].text=g.trimRight(),_.raw=_.raw.trimRight();var S=_.items.length;for(a=0;a1)return!0;return!1}));!_.loose&&L.length&&k&&(_.loose=!0,_.items[a].loose=!0)}return _}},i.html=function(e){var t=this.rules.block.html.exec(e);if(t){var i={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};if(this.options.sanitize){var n=this.options.sanitizer?this.options.sanitizer(t[0]):c(t[0]);i.type="paragraph",i.text=n,i.tokens=this.lexer.inline(n)}return i}},i.def=function(e){var 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]}},i.table=function(e){var t=this.rules.block.table.exec(e);if(t){var i={type:"table",header:k(t[1]).map((function(e){return{text:e}})),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(i.header.length===i.align.length){i.raw=t[0];var n,s,o,r,a=i.align.length;for(n=0;n/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]):c(t[0]):t[0]}},i.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var i=t[2].trim();if(!this.options.pedantic&&/^$/.test(i))return;var n=D(i.slice(0,-1),"\\");if((i.length-n.length)%2==0)return}else{var s=function(e,t){if(-1===e.indexOf(t[1]))return-1;for(var i=e.length,n=0,s=0;s-1){var o=(0===t[0].indexOf("!")?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,o).trim(),t[3]=""}}var r=t[2],a="";if(this.options.pedantic){var l=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r);l&&(r=l[1],a=l[3])}else a=t[3]?t[3].slice(1,-1):"";return r=r.trim(),/^$/.test(i)?r.slice(1):r.slice(1,-1)),E(t,{href:r?r.replace(this.rules.inline._escapes,"$1"):r,title:a?a.replace(this.rules.inline._escapes,"$1"):a},t[0],this.lexer)}},i.reflink=function(e,t){var i;if((i=this.rules.inline.reflink.exec(e))||(i=this.rules.inline.nolink.exec(e))){var n=(i[2]||i[1]).replace(/\s+/g," ");if(!(n=t[n.toLowerCase()])||!n.href){var s=i[0].charAt(0);return{type:"text",raw:s,text:s}}return E(i,n,i[0],this.lexer)}},i.emStrong=function(e,t,i){void 0===i&&(i="");var n=this.rules.inline.emStrong.lDelim.exec(e);if(n&&(!n[3]||!i.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var s=n[1]||n[2]||"";if(!s||s&&(""===i||this.rules.inline.punctuation.exec(i))){var o,r,a=n[0].length-1,l=a,h=0,d="*"===n[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+a);null!=(n=d.exec(t));)if(o=n[1]||n[2]||n[3]||n[4]||n[5]||n[6])if(r=o.length,n[3]||n[4])l+=r;else if(!((n[5]||n[6])&&a%3)||(a+r)%3){if(!((l-=r)>0)){if(r=Math.min(r,r+l+h),Math.min(a,r)%2){var c=e.slice(1,a+n.index+r);return{type:"em",raw:e.slice(0,a+n.index+r+1),text:c,tokens:this.lexer.inlineTokens(c)}}var u=e.slice(2,a+n.index+r-1);return{type:"strong",raw:e.slice(0,a+n.index+r+1),text:u,tokens:this.lexer.inlineTokens(u)}}}else h+=r}}},i.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var i=t[2].replace(/\n/g," "),n=/[^ ]/.test(i),s=/^ /.test(i)&&/ $/.test(i);return n&&s&&(i=i.substring(1,i.length-1)),i=c(i,!0),{type:"codespan",raw:t[0],text:i}}},i.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}},i.del=function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}},i.autolink=function(e,t){var i,n,s=this.rules.inline.autolink.exec(e);if(s)return n="@"===s[2]?"mailto:"+(i=c(this.options.mangle?t(s[1]):s[1])):i=c(s[1]),{type:"link",raw:s[0],text:i,href:n,tokens:[{type:"text",raw:i,text:i}]}},i.url=function(e,t){var i;if(i=this.rules.inline.url.exec(e)){var n,s;if("@"===i[2])s="mailto:"+(n=c(this.options.mangle?t(i[0]):i[0]));else{var o;do{o=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])[0]}while(o!==i[0]);n=c(i[0]),s="www."===i[1]?"http://"+n:n}return{type:"link",raw:i[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}},i.inlineText=function(e,t){var i,n=this.rules.inline.text.exec(e);if(n)return i=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):c(n[0]):n[0]:c(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:i}},t}(),M={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}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\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:S,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};M.def=m(M.def).replace("label",M._label).replace("title",M._title).getRegex(),M.bullet=/(?:[*+-]|\d{1,9}[.)])/,M.listItemStart=m(/^( *)(bull) */).replace("bull",M.bullet).getRegex(),M.list=m(M.list).replace(/bull/g,M.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+M.def.source+")").getRegex(),M._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",M._comment=/|$)/,M.html=m(M.html,"i").replace("comment",M._comment).replace("tag",M._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),M.paragraph=m(M._paragraph).replace("hr",M.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",M._tag).getRegex(),M.blockquote=m(M.blockquote).replace("paragraph",M.paragraph).getRegex(),M.normal=L({},M),M.gfm=L({},M.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),M.gfm.table=m(M.gfm.table).replace("hr",M.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",M._tag).getRegex(),M.gfm.paragraph=m(M._paragraph).replace("hr",M.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",M.gfm.table).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",M._tag).getRegex(),M.pedantic=L({},M.normal,{html:m("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",M._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:S,paragraph:m(M.normal._paragraph).replace("hr",M.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",M.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var T={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:S,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,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:S,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\.5&&(i="x"+i.toString(16)),n+="&#"+i+";";return n}T._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",T.punctuation=m(T.punctuation).replace(/punctuation/g,T._punctuation).getRegex(),T.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,T.escapedEmSt=/\\\*|\\_/g,T._comment=m(M._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),T.emStrong.lDelim=m(T.emStrong.lDelim).replace(/punct/g,T._punctuation).getRegex(),T.emStrong.rDelimAst=m(T.emStrong.rDelimAst,"g").replace(/punct/g,T._punctuation).getRegex(),T.emStrong.rDelimUnd=m(T.emStrong.rDelimUnd,"g").replace(/punct/g,T._punctuation).getRegex(),T._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,T._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,T._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])?)+(?![-_])/,T.autolink=m(T.autolink).replace("scheme",T._scheme).replace("email",T._email).getRegex(),T._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,T.tag=m(T.tag).replace("comment",T._comment).replace("attribute",T._attribute).getRegex(),T._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,T._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,T._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,T.link=m(T.link).replace("label",T._label).replace("href",T._href).replace("title",T._title).getRegex(),T.reflink=m(T.reflink).replace("label",T._label).replace("ref",M._label).getRegex(),T.nolink=m(T.nolink).replace("ref",M._label).getRegex(),T.reflinkSearch=m(T.reflinkSearch,"g").replace("reflink",T.reflink).replace("nolink",T.nolink).getRegex(),T.normal=L({},T),T.pedantic=L({},T.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:m(/^!?\[(label)\]\((.*?)\)/).replace("label",T._label).getRegex(),reflink:m(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",T._label).getRegex()}),T.gfm=L({},T.normal,{escape:m(T.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]*?(?:(?=[\\0?t[t.length-1].raw+="\n":t.push(i);else if(i=this.tokenizer.code(e))e=e.substring(i.raw.length),!(n=t[t.length-1])||"paragraph"!==n.type&&"text"!==n.type?t.push(i):(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(i=this.tokenizer.fences(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.heading(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.hr(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.blockquote(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.list(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.html(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.def(e))e=e.substring(i.raw.length),!(n=t[t.length-1])||"paragraph"!==n.type&&"text"!==n.type?this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title}):(n.raw+="\n"+i.raw,n.text+="\n"+i.raw,this.inlineQueue[this.inlineQueue.length-1].src=n.text);else if(i=this.tokenizer.table(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.lheading(e))e=e.substring(i.raw.length),t.push(i);else if(s=e,this.options.extensions&&this.options.extensions.startBlock&&function(){var t=1/0,i=e.slice(1),n=void 0;r.options.extensions.startBlock.forEach((function(e){"number"==typeof(n=e.call({lexer:this},i))&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}(),this.state.top&&(i=this.tokenizer.paragraph(s)))n=t[t.length-1],o&&"paragraph"===n.type?(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i),o=s.length!==e.length,e=e.substring(i.raw.length);else if(i=this.tokenizer.text(e))e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===n.type?(n.raw+="\n"+i.raw,n.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=n.text):t.push(i);else if(e){var a="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(a);break}throw new Error(a)}return this.state.top=!0,t},r.inline=function(e,t){return void 0===t&&(t=[]),this.inlineQueue.push({src:e,tokens:t}),t},r.inlineTokens=function(e,t){var i,n,s,o=this;void 0===t&&(t=[]);var r,a,l,h=e;if(this.tokens.links){var d=Object.keys(this.tokens.links);if(d.length>0)for(;null!=(r=this.tokenizer.rules.inline.reflinkSearch.exec(h));)d.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(h=h.slice(0,r.index)+"["+N("a",r[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(r=this.tokenizer.rules.inline.blockSkip.exec(h));)h=h.slice(0,r.index)+"["+N("a",r[0].length-2)+"]"+h.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(r=this.tokenizer.rules.inline.escapedEmSt.exec(h));)h=h.slice(0,r.index)+"++"+h.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(a||(l=""),a=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((function(n){return!!(i=n.call({lexer:o},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)}))))if(i=this.tokenizer.escape(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.tag(e))e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(i=this.tokenizer.link(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(i.raw.length),(n=t[t.length-1])&&"text"===i.type&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(i=this.tokenizer.emStrong(e,h,l))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.codespan(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.br(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.del(e))e=e.substring(i.raw.length),t.push(i);else if(i=this.tokenizer.autolink(e,A))e=e.substring(i.raw.length),t.push(i);else if(this.state.inLink||!(i=this.tokenizer.url(e,A))){if(s=e,this.options.extensions&&this.options.extensions.startInline&&function(){var t=1/0,i=e.slice(1),n=void 0;o.options.extensions.startInline.forEach((function(e){"number"==typeof(n=e.call({lexer:this},i))&&n>=0&&(t=Math.min(t,n))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}(),i=this.tokenizer.inlineText(s,R))e=e.substring(i.raw.length),"_"!==i.raw.slice(-1)&&(l=i.raw.slice(-1)),a=!0,(n=t[t.length-1])&&"text"===n.type?(n.raw+=i.raw,n.text+=i.text):t.push(i);else if(e){var c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}}else e=e.substring(i.raw.length),t.push(i);return t},n=i,o=[{key:"rules",get:function(){return{block:M,inline:T}}}],(s=null)&&t(n.prototype,s),o&&t(n,o),Object.defineProperty(n,"prototype",{writable:!1}),i}(),P=function(){function t(t){this.options=t||e.defaults}var i=t.prototype;return i.code=function(e,t,i){var n=(t||"").match(/\S*/)[0];if(this.options.highlight){var s=this.options.highlight(e,n);null!=s&&s!==e&&(i=!0,e=s)}return e=e.replace(/\n$/,"")+"\n",n?'
    '+(i?e:c(e,!0))+"
    \n":"
    "+(i?e:c(e,!0))+"
    \n"},i.blockquote=function(e){return"
    \n"+e+"
    \n"},i.html=function(e){return e},i.heading=function(e,t,i,n){return this.options.headerIds?"'+e+"\n":""+e+"\n"},i.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},i.list=function(e,t,i){var n=t?"ol":"ul";return"<"+n+(t&&1!==i?' start="'+i+'"':"")+">\n"+e+"\n"},i.listitem=function(e){return"
  • "+e+"
  • \n"},i.checkbox=function(e){return" "},i.paragraph=function(e){return"

    "+e+"

    \n"},i.table=function(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"},i.tablerow=function(e){return"\n"+e+"\n"},i.tablecell=function(e,t){var i=t.header?"th":"td";return(t.align?"<"+i+' align="'+t.align+'">':"<"+i+">")+e+"\n"},i.strong=function(e){return""+e+""},i.em=function(e){return""+e+""},i.codespan=function(e){return""+e+""},i.br=function(){return this.options.xhtml?"
    ":"
    "},i.del=function(e){return""+e+""},i.link=function(e,t,i){if(null===(e=v(this.options.sanitize,this.options.baseUrl,e)))return i;var n='"},i.image=function(e,t,i){if(null===(e=v(this.options.sanitize,this.options.baseUrl,e)))return i;var n=''+i+'":">"},i.text=function(e){return e},t}(),F=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,i){return""+i},t.image=function(e,t,i){return""+i},t.br=function(){return""},e}(),B=function(){function e(){this.seen={}}var t=e.prototype;return t.serialize=function(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},t.getNextSafeSlug=function(e,t){var i=e,n=0;if(this.seen.hasOwnProperty(i)){n=this.seen[e];do{i=e+"-"+ ++n}while(this.seen.hasOwnProperty(i))}return t||(this.seen[e]=n,this.seen[i]=0),i},t.slug=function(e,t){void 0===t&&(t={});var i=this.serialize(e);return this.getNextSafeSlug(i,t.dryrun)},e}(),W=function(){function t(t){this.options=t||e.defaults,this.options.renderer=this.options.renderer||new P,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new F,this.slugger=new B}t.parse=function(e,i){return new t(i).parse(e)},t.parseInline=function(e,i){return new t(i).parseInline(e)};var i=t.prototype;return i.parse=function(e,t){void 0===t&&(t=!0);var i,n,s,o,r,a,l,h,d,c,u,p,m,f,_,v,b,C,w,y="",S=e.length;for(i=0;i0&&"paragraph"===_.tokens[0].type?(_.tokens[0].text=C+" "+_.tokens[0].text,_.tokens[0].tokens&&_.tokens[0].tokens.length>0&&"text"===_.tokens[0].tokens[0].type&&(_.tokens[0].tokens[0].text=C+" "+_.tokens[0].tokens[0].text)):_.tokens.unshift({type:"text",text:C}):f+=C),f+=this.parse(_.tokens,m),d+=this.renderer.listitem(f,b,v);y+=this.renderer.list(d,u,p);continue;case"html":y+=this.renderer.html(c.text);continue;case"paragraph":y+=this.renderer.paragraph(this.parseInline(c.tokens));continue;case"text":for(d=c.tokens?this.parseInline(c.tokens):c.text;i+1An error occurred:

    "+c(e.message+"",!0)+"
    ";throw e}try{var l=O.lex(e,t);if(t.walkTokens){if(t.async)return Promise.all(V.walkTokens(l,t.walkTokens)).then((function(){return W.parse(l,t)})).catch(a);V.walkTokens(l,t.walkTokens)}return W.parse(l,t)}catch(Mre){a(Mre)}}V.options=V.setOptions=function(t){var i;return L(V.defaults,t),i=V.defaults,e.defaults=i,V},V.getDefaults=s,V.defaults=e.defaults,V.use=function(){for(var e=arguments.length,t=new Array(e),i=0;iAn error occurred:

    "+c(Mre.message+"",!0)+"
    ";throw Mre}},V.Parser=W,V.parser=W.parse,V.Renderer=P,V.TextRenderer=F,V.Lexer=O,V.lexer=O.lex,V.Tokenizer=I,V.Slugger=B,V.parse=V;var H=V.options,z=V.setOptions,U=V.use,K=V.walkTokens,j=V.parseInline,q=V,$=W.parse,G=O.lex;e.Lexer=O,e.Parser=W,e.Renderer=P,e.Slugger=B,e.TextRenderer=F,e.Tokenizer=I,e.getDefaults=s,e.lexer=G,e.marked=V,e.options=H,e.parse=q,e.parseInline=j,e.parser=$,e.setOptions=z,e.use=U,e.walkTokens=K,Object.defineProperty(e,"__esModule",{value:!0})},e.amd?e(0,i):"object"==typeof exports?i(exports):i((t="undefined"!=typeof globalThis?globalThis:t||self).marked={})}();uk.Lexer||exports.Lexer,uk.Parser||exports.Parser,uk.Renderer||exports.Renderer,uk.Slugger||exports.Slugger,uk.TextRenderer||exports.TextRenderer,uk.Tokenizer||exports.Tokenizer,uk.getDefaults||exports.getDefaults,uk.lexer||exports.lexer;var gk=uk.marked||exports.marked;uk.options||exports.options,uk.parse||exports.parse,uk.parseInline||exports.parseInline,uk.parser||exports.parser,uk.setOptions||exports.setOptions,uk.use||exports.use,uk.walkTokens||exports.walkTokens;function pk(e){let t=JSON.parse(e);return t=fk(t),t}function mk(e,t){return t instanceof RegExp?{$mid:2,source:t.source,flags:t.flags}:t}function fk(e,t=0){if(!e||t>200)return e;if("object"==typeof e){switch(e.$mid){case 1:return an.revive(e);case 2:return new RegExp(e.source,e.flags);case 17:return new Date(e.source)}if(e instanceof Kc||e instanceof Uint8Array)return e;if(Array.isArray(e))for(let i=0;i{let n=[],s=[];return e&&(({href:e,dimensions:n}=function(e){const t=[],i=e.split("|").map((e=>e.trim()));e=i[0];const n=i[1];if(n){const e=/height=(\d+)/.exec(n),i=/width=(\d+)/.exec(n),s=e?e[1]:"",o=i?i[1]:"",r=isFinite(parseInt(o)),a=isFinite(parseInt(s));r&&t.push(`width="${o}"`),a&&t.push(`height="${s}"`)}return{href:e,dimensions:t}}(e)),s.push(`src="${Oa(e)}"`)),i&&s.push(`alt="${Oa(i)}"`),t&&s.push(`title="${Oa(t)}"`),n.length&&(s=s.concat(n)),""},paragraph:e=>`

    ${e}

    `,link:(e,t,i)=>"string"!=typeof e?"":(e===i&&(i=Pa(i)),t="string"==typeof t?Oa(Pa(t)):"",`
    /g,">").replace(/"/g,""").replace(/'/g,"'")}" title="${t||e}">${i}`)});function vk(e,t={},i={}){var n,s;const o=new N;let a=!1;const l=ik(t),h=function(t){let i;try{i=pk(decodeURIComponent(t))}catch(Mre){}return i?(i=md(i,(t=>e.uris&&e.uris[t]?an.revive(e.uris[t]):void 0)),encodeURIComponent(JSON.stringify(i))):t},d=function(t,i){const n=e.uris&&e.uris[t];let s=an.revive(n);return i?t.startsWith(vn.data+":")?t:(s||(s=an.parse(t)),wn.uriToBrowserUri(s).toString(!0)):s?an.parse(t).toString()===s.toString()?t:(s.query&&(s=s.with({query:h(s.query)})),s.toString()):t},c=new gk.Renderer;c.image=_k.image,c.link=_k.link,c.paragraph=_k.paragraph;const u=[],g=[];if(t.codeBlockRendererSync?c.code=(e,i)=>{const n=ck.nextId(),s=t.codeBlockRendererSync(bk(i),e);return g.push([n,s]),`
    ${Js(e)}
    `}:t.codeBlockRenderer&&(c.code=(e,i)=>{const n=ck.nextId(),s=t.codeBlockRenderer(bk(i),e);return u.push(s.then((e=>[n,e]))),`
    ${Js(e)}
    `}),t.actionHandler){const i=function(i){let n=i.target;if("A"===n.tagName||(n=n.parentElement,n&&"A"===n.tagName))try{let s=n.dataset.href;s&&(e.baseUri&&(s=Ck(an.from(e.baseUri),s)),t.actionHandler.callback(s,i))}catch(s){r(s)}finally{i.preventDefault()}},n=t.actionHandler.disposables.add(new Ky(l,"click")),s=t.actionHandler.disposables.add(new Ky(l,"auxclick"));t.actionHandler.disposables.add(B.any(n.event,s.event)((e=>{const t=new Nt(e);(t.leftButton||t.middleButton)&&i(t)}))),t.actionHandler.disposables.add(En(l,"keydown",(e=>{const t=new St(e);(t.equals(10)||t.equals(3))&&i(t)})))}e.supportHtml||(i.sanitizer=t=>(e.isTrusted?t.match(/^(]+>)|(<\/\s*span>)$/):void 0)?t:"",i.sanitize=!0,i.silent=!0),i.renderer=c;let p=null!==(n=e.value)&&void 0!==n?n:"";let m;if(p.length>1e5&&(p=`${p.substr(0,1e5)}\u2026`),e.supportThemeIcons&&(p=p.replace(oa,(e=>`\\${e}`))),t.fillInIncompleteTokens){const e=Object.assign(Object.assign({},gk.defaults),i),t=function(e){let t,i;for(t=0;t"string"==typeof e?e:e.outerHTML)).join("")}const f=(new DOMParser).parseFromString(wk(e,m),"text/html");if(f.body.querySelectorAll("img").forEach((t=>{const i=t.getAttribute("src");if(i){let s=i;try{e.baseUri&&(s=Ck(an.from(e.baseUri),s))}catch(n){}t.src=d(s,!0)}})),f.body.querySelectorAll("a").forEach((t=>{const i=t.getAttribute("href");if(t.setAttribute("href",""),!i||/^data:|javascript:/i.test(i)||/^command:/i.test(i)&&!e.isTrusted||/^command:(\/\/\/)?_workbench\.downloadResource/i.test(i))t.replaceWith(...t.childNodes);else{let n=d(i,!1);e.baseUri&&(n=Ck(an.from(e.baseUri),i)),t.dataset.href=n}})),l.innerHTML=wk(e,f.body.innerHTML),u.length>0)Promise.all(u).then((e=>{var i,n;if(a)return;const s=new Map(e),o=l.querySelectorAll("div[data-code]");for(const t of o){const e=s.get(null!==(i=t.dataset.code)&&void 0!==i?i:"");e&&us(t,e)}null===(n=t.asyncRenderCallback)||void 0===n||n.call(t)}));else if(g.length>0){const e=new Map(g),t=l.querySelectorAll("div[data-code]");for(const i of t){const t=e.get(null!==(s=i.dataset.code)&&void 0!==s?s:"");t&&us(i,t)}}if(t.asyncRenderCallback)for(const r of l.getElementsByTagName("img")){const e=o.add(En(r,"load",(()=>{e.dispose(),t.asyncRenderCallback()})))}return{element:l,dispose:()=>{a=!0,o.dispose()}}}function bk(e){if(!e)return"";const t=e.split(/[\s+|:|,|\{|\?]/,1);return t.length?t[0]:e}function Ck(e,t){return/^\w[\w\d+.-]*:/.test(t)?t:e.path.endsWith("/")?xa(e,t).toString():xa(Sa(e),t).toString()}function wk(e,t){const{config:i,allowedSchemes:n}=function(e){const t=[vn.http,vn.https,vn.mailto,vn.data,vn.file,vn.vscodeFileResource,vn.vscodeRemote,vn.vscodeRemoteResource];e.isTrusted&&t.push(vn.command);return{config:{ALLOWED_TAGS:[...Ls],ALLOWED_ATTR:yk,ALLOW_UNKNOWN_PROTOCOLS:!0},allowedSchemes:t}}(e);Di("uponSanitizeAttribute",((e,t)=>{if("style"!==t.attrName&&"class"!==t.attrName);else{if("SPAN"===e.tagName){if("style"===t.attrName)return void(t.keepAttr=/^(color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?(background-color\:(#[0-9a-fA-F]+|var\(--vscode(-[a-zA-Z]+)+\));)?$/.test(t.attrValue));if("class"===t.attrName)return void(t.keepAttr=/^codicon codicon-[a-z\-]+( codicon-modifier-[a-z\-]+)?$/.test(t.attrValue))}t.keepAttr=!1}}));const s=function(e,t=!1){const i=document.createElement("a");return Di("afterSanitizeAttributes",(n=>{for(const s of["href","src"])if(n.hasAttribute(s)){const o=n.getAttribute(s);if("href"===s&&o.startsWith("#"))continue;if(i.href=o,!e.includes(i.protocol.replace(/:$/,""))){if(t&&"src"===s&&i.href.startsWith("data:"))continue;n.removeAttribute(s)}}})),x((()=>{xi("afterSanitizeAttributes")}))}(n);try{return ki(t,Object.assign(Object.assign({},i),{RETURN_TRUSTED_TYPE:!0}))}finally{xi("uponSanitizeAttribute"),s.dispose()}}const yk=["align","autoplay","alt","class","controls","data-code","data-href","height","href","loop","muted","playsinline","poster","src","style","target","title","width","start"];function Sk(e){return"string"==typeof e?e:function(e){var t;let i=null!==(t=e.value)&&void 0!==t?t:"";i.length>1e5&&(i=`${i.substr(0,1e5)}\u2026`);const n=gk.parse(i,{renderer:kk.value}).replace(/&(#\d+|[a-zA-Z]+);/g,(e=>{var t;return null!==(t=Lk.get(e))&&void 0!==t?t:e}));return wk({isTrusted:!1},n).toString()}(e)}const Lk=new Map([[""",'"'],[" "," "],["&","&"],["'","'"],["<","<"],[">",">"]]),kk=new Zs((()=>{const e=new gk.Renderer;return e.code=e=>e,e.blockquote=e=>e,e.html=e=>"",e.heading=(e,t,i)=>e+"\n",e.hr=()=>"",e.list=(e,t)=>e,e.listitem=e=>e+"\n",e.paragraph=e=>e+"\n",e.table=(e,t)=>e+t+"\n",e.tablerow=e=>e,e.tablecell=(e,t)=>e+" ",e.strong=e=>e,e.em=e=>e,e.codespan=e=>e,e.br=()=>"\n",e.del=e=>e,e.image=(e,t,i)=>"",e.text=e=>e,e.link=(e,t,i)=>i,e}));function Dk(e){let t="";return e.forEach((e=>{t+=e.raw})),t}function xk(e){for(const t of e.tokens)if("text"===t.type){const i=t.raw.split("\n"),n=i[i.length-1];if(n.includes("`"))return Ek(e);if(n.includes("**"))return Ok(e,"**");if(n.match(/\*\w/))return Ik(e);if(n.match(/(^|\s)__\w/))return Ak(e);if(n.match(/(^|\s)_\w/))return Mk(e);if(n.match(/(^|\s)\[.*\]\(\w*/))return Tk(e);if(n.match(/(^|\s)\[\w/))return Rk(e)}}function Nk(e){const t=Dk(e);return gk.lexer(t+"\n```")}function Ek(e){return Ok(e,"`")}function Ik(e){return Ok(e,"*")}function Mk(e){return Ok(e,"_")}function Tk(e){return Ok(e,")")}function Rk(e){return Ok(e,"](about:blank)")}function Ak(e){return Ok(e,"__")}function Ok(e,t){const i=Dk(Array.isArray(e)?e:[e]);return gk.lexer(i+t)[0]}function Pk(e){const t=Dk(e),i=t.split("\n");let n,s=!1;for(let o=0;o0){const e=s?i.slice(0,-1).join("\n"):t,o=!!e.match(/\|\s*$/),r=e+(o?"":"|")+`\n|${" --- |".repeat(n)}`;return gk.lexer(r)}}function Fk(e,t){var i;const n=globalThis.MonacoEnvironment;if(null==n?void 0:n.createTrustedTypesPolicy)try{return n.createTrustedTypesPolicy(e,t)}catch(s){return void r(s)}try{return null===(i=window.trustedTypes)||void 0===i?void 0:i.createPolicy(e,t)}catch(s){return void r(s)}}class Bk{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingLeft="",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=Wk(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){const t=Wk(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){const t=Wk(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){const t=Wk(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){const t=Wk(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){const t=Wk(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){const t=Wk(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingLeft(e){const t=Wk(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}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=Wk(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=Wk(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){const t=Wk(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 Wk(e){return"number"==typeof e?`${e}px`:e}function Vk(e){return new Bk(e)}function Hk(e,t){e instanceof Bk?(e.setFontFamily(t.getMassagedFontFamily()),e.setFontWeight(t.fontWeight),e.setFontSize(t.fontSize),e.setFontFeatureSettings(t.fontFeatureSettings),e.setFontVariationSettings(t.fontVariationSettings),e.setLineHeight(t.lineHeight),e.setLetterSpacing(t.letterSpacing)):(e.style.fontFamily=t.getMassagedFontFamily(),e.style.fontWeight=t.fontWeight,e.style.fontSize=t.fontSize+"px",e.style.fontFeatureSettings=t.fontFeatureSettings,e.style.fontVariationSettings=t.fontVariationSettings,e.style.lineHeight=t.lineHeight+"px",e.style.letterSpacing=t.letterSpacing+"px")}var zk=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Uk={getInitialState:()=>IC,tokenizeEncoded:(e,t,i)=>TC(0,i)};function Kk(e,t,i,n,s,o,r){let a="
    ",l=n,h=0,d=!0;for(let c=0,u=t.getCount();c0;)r&&d?(g+=" ",d=!1):(g+=" ",d=!0),e--;break}case 60:g+="<",d=!1;break;case 62:g+=">",d=!1;break;case 38:g+="&",d=!1;break;case 0:g+="�",d=!1;break;case 65279:case 8232:case 8233:case 133:g+="\ufffd",d=!1;break;case 13:g+="​",d=!1;break;case 32:r&&d?(g+=" ",d=!1):(g+=" ",d=!0);break;default:g+=String.fromCharCode(t),d=!1}}if(a+=`${g}`,u>s||l>=s)break}return a+="
    ",a}function jk(e,t,i){let n='
    ';const s=oo(e);let o=i.getInitialState();for(let r=0,a=s.length;r0&&(n+="
    ");const a=i.tokenizeEncoded(e,!0,o);PC.convertToEndOffset(a.tokens,e.length);const l=new PC(a.tokens,e,t).inflate();let h=0;for(let t=0,i=l.getCount();t${Js(e.substring(h,s))}`,h=s}o=a.endState}return n+="
    ",n}const qk=Ba("openerService");function $k(e,t){return an.isUri(e)?_o(e.scheme,t):vo(e,t+":")}function Gk(e,...t){return t.some((t=>$k(e,t)))}var Zk,Yk=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Xk=function(e,t){return function(i,n){t(i,n,e)}},Qk=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let Jk=Zk=class{constructor(e,t,i){this._options=e,this._languageService=t,this._openerService=i,this._onDidRenderAsync=new U,this.onDidRenderAsync=this._onDidRenderAsync.event}dispose(){this._onDidRenderAsync.dispose()}render(e,t,i){if(!e){return{element:document.createElement("span"),dispose:()=>{}}}const n=new N,s=n.add(vk(e,Object.assign(Object.assign({},this._getRenderOptions(e,n)),t),i));return s.element.classList.add("rendered-markdown"),{element:s.element,dispose:()=>n.dispose()}}_getRenderOptions(e,t){return{codeBlockRenderer:(e,t)=>Qk(this,void 0,void 0,(function*(){var i,n,s;let o;e?o=this._languageService.getLanguageIdByLanguageName(e):this._options.editor&&(o=null===(i=this._options.editor.getModel())||void 0===i?void 0:i.getLanguageId()),o||(o=Ku);const r=yield function(e,t,i){return zk(this,void 0,void 0,(function*(){if(!i)return jk(t,e.languageIdCodec,Uk);const n=yield EC.getOrCreate(i);return jk(t,e.languageIdCodec,n||Uk)}))}(this._languageService,t,o),a=document.createElement("span");if(a.innerHTML=null!==(s=null===(n=Zk._ttpTokenizer)||void 0===n?void 0:n.createHTML(r))&&void 0!==s?s:r,this._options.editor){Hk(a,this._options.editor.getOption(50))}else this._options.codeBlockFontFamily&&(a.style.fontFamily=this._options.codeBlockFontFamily);return void 0!==this._options.codeBlockFontSize&&(a.style.fontSize=this._options.codeBlockFontSize),a})),asyncRenderCallback:()=>this._onDidRenderAsync.fire(),actionHandler:{callback:t=>eD(this._openerService,t,e.isTrusted),disposables:t}}}};function eD(e,t,i){return Qk(this,void 0,void 0,(function*(){try{return yield e.open(t,{fromUserGesture:!0,allowContributedOpeners:!0,allowCommands:tD(i)})}catch(Mre){return r(Mre),!1}}))}function tD(e){return!0===e||!(!e||!Array.isArray(e.enabledCommands))&&e.enabledCommands}Jk._ttpTokenizer=Fk("tokenizeToString",{createHTML:e=>e}),Jk=Zk=Yk([Xk(1,Lc),Xk(2,qk)],Jk);var iD,nD=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},sD=function(e,t){return function(i,n){t(i,n,e)}};let oD=iD=class{static get(e){return e.getContribution(iD.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new I,this._messageListeners=new N,this._mouseOverMessage=!1,this._editor=e,this._visible=iD.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;null===(e=this._message)||void 0===e||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){let i;Ps(Aa(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=Aa(e)?vk(e,{actionHandler:{callback:t=>eD(this._openerService,t,Aa(e)?e.isTrusted:void 0),disposables:this._messageListeners}}):void 0,this._messageWidget.value=new rD(this._editor,t,"string"==typeof e?e:this._message.element),this._messageListeners.add(B.debounce(this._editor.onDidBlurEditorText,((e,t)=>t),0)((()=>{this._mouseOverMessage||this._messageWidget.value&&qn(Xn(),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(En(this._messageWidget.value.getDomNode(),os.MOUSE_ENTER,(()=>this._mouseOverMessage=!0),!0)),this._messageListeners.add(En(this._messageWidget.value.getDomNode(),os.MOUSE_LEAVE,(()=>this._mouseOverMessage=!1),!0)),this._messageListeners.add(this._editor.onMouseMove((e=>{e.target.position&&(i?i.containsPosition(e.target.position)||this.closeMessage():i=new Rh(t.lineNumber-3,1,e.target.position.lineNumber+3,1))})))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(rD.fadeOut(this._messageWidget.value))}};oD.ID="editor.contrib.messageController",oD.MESSAGE_VISIBLE=new Al("messageVisible",!1,ue(0,"Whether the editor is currently showing an inline message")),oD=iD=nD([sD(1,Ol),sD(2,qk)],oD);Sh(new(vh.bindToContribution(oD.get))({id:"leaveEditorMessage",precondition:oD.MESSAGE_VISIBLE,handler:e=>e.closeMessage(),kbOpts:{weight:130,primary:9}}));class rD{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,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const s=document.createElement("div");s.classList.add("anchor","top"),this._domNode.appendChild(s);const o=document.createElement("div");"string"==typeof n?(o.classList.add("message"),o.textContent=n):(n.classList.add("message"),o.appendChild(n)),this._domNode.appendChild(o);const r=document.createElement("div");r.classList.add("anchor","below"),this._domNode.appendChild(r),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:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",2===e)}}Dh(oD.ID,oD,4);const aD={RESOURCES:"ResourceURLs",DOWNLOAD_URL:"DownloadURL",FILES:"Files",TEXT:Lu.text,INTERNAL_URI_LIST:"application/vnd.code.uri-list"};var lD=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class hD{constructor(e,t,i){this.hoverDelegate=e,this.target=t,this.fadeInAnimation=i}update(e,t,i){var n;return lD(this,void 0,void 0,(function*(){if(this._cancellationTokenSource&&(this._cancellationTokenSource.dispose(!0),this._cancellationTokenSource=void 0),this.isDisposed)return;let s;if(void 0===e||Fr(e)||e instanceof HTMLElement)s=e;else if(Gr(e.markdown)){this._hoverWidget||this.show(ue(0,"Loading..."),t),this._cancellationTokenSource=new jh;const i=this._cancellationTokenSource.token;if(s=yield e.markdown(i),void 0===s&&(s=e.markdownNotSupportedFallback),this.isDisposed||i.isCancellationRequested)return}else s=null!==(n=e.markdown)&&void 0!==n?n:e.markdownNotSupportedFallback;this.show(s,t,i)}))}show(e,t,i){const n=this._hoverWidget;if(this.hasContent(e)){const s=Object.assign({content:e,target:this.target,showPointer:"element"===this.hoverDelegate.placement,hoverPosition:2,skipFadeInAnimation:!this.fadeInAnimation||!!n},i);this._hoverWidget=this.hoverDelegate.showHover(s,t)}null==n||n.dispose()}hasContent(e){return!!e&&(!Aa(e)||!!e.value)}get isDisposed(){var e;return null===(e=this._hoverWidget)||void 0===e?void 0:e.isDisposed}dispose(){var e,t;null===(e=this._hoverWidget)||void 0===e||e.dispose(),null===(t=this._cancellationTokenSource)||void 0===t||t.dispose(!0),this._cancellationTokenSource=void 0}}function dD(e,t,i,n){let s,o;const r=(t,i)=>{var n;const r=void 0!==o;t&&(null==o||o.dispose(),o=void 0),i&&(null==s||s.dispose(),s=void 0),r&&(null===(n=e.onDidHideHover)||void 0===n||n.call(e))},a=(s,r,a)=>new sd((()=>lD(this,void 0,void 0,(function*(){o&&!o.isDisposed||(o=new hD(e,a||t,s>0),yield o.update(i,r,n))}))),s),l=En(t,os.MOUSE_OVER,(()=>{if(s)return;const i=new N;i.add(En(t,os.MOUSE_LEAVE,(e=>r(!1,e.fromElement===t)),!0));i.add(En(t,os.MOUSE_DOWN,(()=>r(!0,!0)),!0));const n={targetElements:[t],dispose:()=>{}};if(void 0===e.placement||"mouse"===e.placement){const e=e=>{n.x=e.x+10,e.target instanceof HTMLElement&&e.target.classList.contains("action-label")&&r(!0,!0)};i.add(En(t,os.MOUSE_MOVE,e,!0))}i.add(a(e.delay,!1,n)),s=i}),!0);return{show:e=>{r(!1,!0),a(0,e)},hide:()=>{r(!0,!0)},update:(e,t)=>lD(this,void 0,void 0,(function*(){i=e,yield null==o?void 0:o.update(i,void 0,t)})),dispose:()=>{l.dispose(),r(!0,!0)}}}class cD{constructor(e){this.spliceables=e}splice(e,t,i){this.spliceables.forEach((n=>n.splice(e,t,i)))}}function uD(e,t,i){return Math.min(Math.max(e,t),i)}class gD{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 pD{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{try{e.releasePointerCapture(t)}catch(i){}})))}catch(r){o=window}this._hooks.add(En(o,os.POINTER_MOVE,(e=>{e.buttons===i?(e.preventDefault(),this._pointerMoveCallback(e)):this.stopMonitoring(!0)}))),this._hooks.add(En(o,os.POINTER_UP,(e=>this.stopMonitoring(!0))))}}class _D extends E{onclick(e,t){this._register(En(e,os.CLICK,(e=>t(new Nt(e)))))}onmousedown(e,t){this._register(En(e,os.MOUSE_DOWN,(e=>t(new Nt(e)))))}onmouseover(e,t){this._register(En(e,os.MOUSE_OVER,(e=>t(new Nt(e)))))}onmouseleave(e,t){this._register(En(e,os.MOUSE_LEAVE,(e=>t(new Nt(e)))))}onkeydown(e,t){this._register(En(e,os.KEY_DOWN,(e=>t(new St(e)))))}onkeyup(e,t){this._register(En(e,os.KEY_UP,(e=>t(new St(e)))))}oninput(e,t){this._register(En(e,os.INPUT,t))}onblur(e,t){this._register(En(e,os.BLUR,t))}onfocus(e,t){this._register(En(e,os.FOCUS,t))}ignoreGesture(e){return ZL.ignoreTarget(e)}}const vD=11;class bD extends _D{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",void 0!==e.top&&(this.bgDomNode.style.top="0px"),void 0!==e.left&&(this.bgDomNode.style.left="0px"),void 0!==e.bottom&&(this.bgDomNode.style.bottom="0px"),void 0!==e.right&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.classList.add(...ta.asClassNameArray(e.icon)),this.domNode.style.position="absolute",this.domNode.style.width="11px",this.domNode.style.height="11px",void 0!==e.top&&(this.domNode.style.top=e.top+"px"),void 0!==e.left&&(this.domNode.style.left=e.left+"px"),void 0!==e.bottom&&(this.domNode.style.bottom=e.bottom+"px"),void 0!==e.right&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new fD),this._register(Mn(this.bgDomNode,os.POINTER_DOWN,(e=>this._arrowPointerDown(e)))),this._register(Mn(this.domNode,os.POINTER_DOWN,(e=>this._arrowPointerDown(e)))),this._pointerdownRepeatTimer=this._register(new od),this._pointerdownScheduleRepeatTimer=this._register(new sd)}_arrowPointerDown(e){if(!(e.target&&e.target instanceof Element))return;this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet((()=>{this._pointerdownRepeatTimer.cancelAndSet((()=>this._onActivate()),1e3/24)}),200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,(e=>{}),(()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()})),e.preventDefault()}}class CD extends E{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 sd)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return 2!==this._visibility&&(3===this._visibility||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(){this._isNeeded?this._shouldBeVisible?this._reveal():this._hide(!0):this._hide(!1)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet((()=>{var e;null===(e=this._domNode)||void 0===e||e.setClassName(this._visibleClassName)}),0))}_hide(e){var t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,null===(t=this._domNode)||void 0===t||t.setClassName(this._invisibleClassName+(e?" fade":"")))}}class wD extends _D{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 CD(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new fD),this._shouldRender=!0,this.domNode=Vk(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(En(this.domNode.domNode,os.POINTER_DOWN,(e=>this._domNodePointerDown(e))))}_createArrow(e){const t=this._register(new bD(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,n){this.slider=Vk(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),"number"==typeof i&&this.slider.setWidth(i),"number"==typeof n&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(En(this.slider.domNode,os.POINTER_DOWN,(e=>{0===e.button&&(e.preventDefault(),this._sliderPointerDown(e))}))),this.onclick(this.slider.domNode,(e=>{e.leftButton&&e.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(),s=this._sliderPointerPosition(e);i<=s&&s<=n?0===e.button&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&"number"==typeof e.offsetX&&"number"==typeof e.offsetY)t=e.offsetX,i=e.offsetY;else{const n=Hn(this.domNode.domNode);t=e.pageX-n.left,i=e.pageY-n.top}const n=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),0===e.button&&(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,(e=>{const s=this._sliderOrthogonalPointerPosition(e),o=Math.abs(s-i);if(Oe&&o>140)return void this._setDesiredScrollPositionNow(n.getScrollPosition());const r=this._sliderPointerPosition(e)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(r))}),(()=>{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()}}class yD{constructor(e,t,i,n,s,o){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(i),this._arrowSize=Math.round(e),this._visibleSize=n,this._scrollSize=s,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new yD(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)}setScrollSize(e){const t=Math.round(e);return this._scrollSize!==t&&(this._scrollSize=t,this._refreshComputedValues(),!0)}setScrollPosition(e){const t=Math.round(e);return this._scrollPosition!==t&&(this._scrollPosition=t,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,i,n,s){const o=Math.max(0,i-e),r=Math.max(0,o-2*t),a=n>0&&n>i;if(!a)return{computedAvailableSize:Math.round(o),computedIsNeeded:a,computedSliderSize:Math.round(r),computedSliderRatio:0,computedSliderPosition:0};const l=Math.round(Math.max(20,Math.floor(i*r/n))),h=(r-l)/(n-i),d=s*h;return{computedAvailableSize:Math.round(o),computedIsNeeded:a,computedSliderSize:Math.round(l),computedSliderRatio:h,computedSliderPosition:Math.round(d)}}_refreshComputedValues(){const e=yD._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 Et(null,1,0))}),this._createArrow({className:"scra",icon:Jr.scrollbarButtonRight,top:i,left:void 0,bottom:void 0,right:e,bgWidth:t.arrowSize,bgHeight:t.horizontalScrollbarSize,onActivate:()=>this._host.onMouseWheel(new Et(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(2===e.horizontal?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(2===e.vertical?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}}class LD extends wD{constructor(e,t,i){const n=e.getScrollDimensions(),s=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:i,scrollbarState:new yD(t.verticalHasArrows?t.arrowSize:0,2===t.vertical?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,s.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows){const e=(t.arrowSize-vD)/2,i=(t.verticalScrollbarSize-vD)/2;this._createArrow({className:"scra",icon:Jr.scrollbarButtonUp,top:e,left:i,bottom:void 0,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Et(null,0,1))}),this._createArrow({className:"scra",icon:Jr.scrollbarButtonDown,top:void 0,left:i,bottom:e,right:void 0,bgWidth:t.verticalScrollbarSize,bgHeight:t.arrowSize,onActivate:()=>this._host.onMouseWheel(new Et(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(2===e.vertical?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}}class kD{constructor(e,t,i,n,s,o,r){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t|=0,i|=0,n|=0,s|=0,o|=0,r|=0),this.rawScrollLeft=n,this.rawScrollTop=r,t<0&&(t=0),n+t>i&&(n=i-t),n<0&&(n=0),s<0&&(s=0),r+s>o&&(r=o-s),r<0&&(r=0),this.width=t,this.scrollWidth=i,this.scrollLeft=n,this.height=s,this.scrollHeight=o,this.scrollTop=r}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,t){return new kD(this._forceIntegerValues,void 0!==e.width?e.width:this.width,void 0!==e.scrollWidth?e.scrollWidth:this.scrollWidth,t?this.rawScrollLeft:this.scrollLeft,void 0!==e.height?e.height:this.height,void 0!==e.scrollHeight?e.scrollHeight:this.scrollHeight,t?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new kD(this._forceIntegerValues,this.width,this.scrollWidth,void 0!==e.scrollLeft?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,void 0!==e.scrollTop?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){const i=this.width!==e.width,n=this.scrollWidth!==e.scrollWidth,s=this.scrollLeft!==e.scrollLeft,o=this.height!==e.height,r=this.scrollHeight!==e.scrollHeight,a=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:i,scrollWidthChanged:n,scrollLeftChanged:s,heightChanged:o,scrollHeightChanged:r,scrollTopChanged:a}}}class DD extends E{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new U),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new kD(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var i;const n=this._state.withScrollDimensions(e,t);this._setState(n,Boolean(this._smoothScrolling)),null===(i=this._smoothScrolling)||void 0===i||i.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){const t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(0===this._smoothScrollDuration)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:void 0===e.scrollLeft?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:void 0===e.scrollTop?this._smoothScrolling.to.scrollTop:e.scrollTop};const i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let n;n=t?new ED(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{const t=this._state.withScrollPosition(e);this._smoothScrolling=ED.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())}))}hasPendingScrollAnimation(){return Boolean(this._smoothScrolling)}_performSmoothScrolling(){if(!this._smoothScrolling)return;const e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);return this._setState(t,!0),this._smoothScrolling?e.isDone?(this._smoothScrolling.dispose(),void(this._smoothScrolling=null)):void(this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame((()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())}))):void 0}_setState(e,t){const i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}}class xD{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}}function ND(e,t){const i=t-e;return function(t){return e+i*(1-function(e){return Math.pow(e,3)}(1-t))}}class ED{constructor(e,t,i,n){this.from=e,this.to=t,this.duration=n,this.startTime=i,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,i){if(Math.abs(e-t)>2.5*i){let r,a;return e0&&Math.abs(e.deltaY)>0)return 1;let t=.5;-1===this._front&&-1===this._rear||this._memory[this._rear];return this._isAlmostInt(e.deltaX)&&this._isAlmostInt(e.deltaY)||(t+=.25),Math.min(Math.max(t,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}}MD.INSTANCE=new MD;class TD extends _D{get options(){return this._options}constructor(e,t,i){super(),this._onScroll=this._register(new U),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new U),e.style.overflow="hidden",this._options=function(e){const t={lazyRender:void 0!==e.lazyRender&&e.lazyRender,className:void 0!==e.className?e.className:"",useShadows:void 0===e.useShadows||e.useShadows,handleMouseWheel:void 0===e.handleMouseWheel||e.handleMouseWheel,flipAxes:void 0!==e.flipAxes&&e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:void 0!==e.consumeMouseWheelIfScrollbarIsNeeded&&e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:void 0!==e.alwaysConsumeMouseWheel&&e.alwaysConsumeMouseWheel,scrollYToX:void 0!==e.scrollYToX&&e.scrollYToX,mouseWheelScrollSensitivity:void 0!==e.mouseWheelScrollSensitivity?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:void 0!==e.fastScrollSensitivity?e.fastScrollSensitivity:5,scrollPredominantAxis:void 0===e.scrollPredominantAxis||e.scrollPredominantAxis,mouseWheelSmoothScroll:void 0===e.mouseWheelSmoothScroll||e.mouseWheelSmoothScroll,arrowSize:void 0!==e.arrowSize?e.arrowSize:11,listenOnDomNode:void 0!==e.listenOnDomNode?e.listenOnDomNode:null,horizontal:void 0!==e.horizontal?e.horizontal:1,horizontalScrollbarSize:void 0!==e.horizontalScrollbarSize?e.horizontalScrollbarSize:10,horizontalSliderSize:void 0!==e.horizontalSliderSize?e.horizontalSliderSize:0,horizontalHasArrows:void 0!==e.horizontalHasArrows&&e.horizontalHasArrows,vertical:void 0!==e.vertical?e.vertical:1,verticalScrollbarSize:void 0!==e.verticalScrollbarSize?e.verticalScrollbarSize:10,verticalHasArrows:void 0!==e.verticalHasArrows&&e.verticalHasArrows,verticalSliderSize:void 0!==e.verticalSliderSize?e.verticalSliderSize:0,scrollByPage:void 0!==e.scrollByPage&&e.scrollByPage};t.horizontalSliderSize=void 0!==e.horizontalSliderSize?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=void 0!==e.verticalSliderSize?e.verticalSliderSize:t.verticalScrollbarSize,Pe&&(t.className+=" mac");return t}(t),this._scrollable=i,this._register(this._scrollable.onScroll((e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)})));const n={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new LD(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new SD(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=Vk(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=Vk(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=Vk(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,(e=>this._onMouseOver(e))),this.onmouseleave(this._listenOnDomNode,(e=>this._onMouseLeave(e))),this._hideTimeout=this._register(new sd),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}dispose(){this._mouseWheelToDispose=k(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,Pe&&(this._options.className+=" mac"),this._domNode.className="monaco-scrollable-element "+this._options.className}updateOptions(e){void 0!==e.handleMouseWheel&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),void 0!==e.mouseWheelScrollSensitivity&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),void 0!==e.fastScrollSensitivity&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),void 0!==e.scrollPredominantAxis&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),void 0!==e.horizontal&&(this._options.horizontal=e.horizontal),void 0!==e.vertical&&(this._options.vertical=e.vertical),void 0!==e.horizontalScrollbarSize&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),void 0!==e.verticalScrollbarSize&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),void 0!==e.scrollByPage&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Et(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=k(this._mouseWheelToDispose),e)){const e=e=>{this._onMouseWheel(new Et(e))};this._mouseWheelToDispose.push(En(this._listenOnDomNode,os.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(e){var t;if(null===(t=e.browserEvent)||void 0===t?void 0:t.defaultPrevented)return;const i=MD.INSTANCE;i.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let t=e.deltaY*this._options.mouseWheelScrollSensitivity,s=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&s+t===0?s=t=0:Math.abs(t)>=Math.abs(s)?s=0:t=0),this._options.flipAxes&&([t,s]=[s,t]);const o=!Pe&&e.browserEvent&&e.browserEvent.shiftKey;!this._options.scrollYToX&&!o||s||(s=t,t=0),e.browserEvent&&e.browserEvent.altKey&&(s*=this._options.fastScrollSensitivity,t*=this._options.fastScrollSensitivity);const r=this._scrollable.getFutureScrollPosition();let a={};if(t){const e=50*t,i=r.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(a,i)}if(s){const e=50*s,t=r.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(a,t)}if(a=this._scrollable.validateScrollPosition(a),r.scrollLeft!==a.scrollLeft||r.scrollTop!==a.scrollTop){this._options.mouseWheelSmoothScroll&&i.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(a):this._scrollable.setScrollPositionNow(a),n=!0}}let s=n;!s&&this._options.alwaysConsumeMouseWheel&&(s=!0),!s&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(s=!0),s&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){const e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,n=i?" left":"",s=t?" top":"",o=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${s}`),this._topLeftShadowDomNode.setClassName(`shadow${o}${s}${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()),500)}}class RD extends TD{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;const i=new DD({forceIntegerValues:!0,smoothScrollDuration:0,scheduleAtNextAnimationFrame:e=>An(e)});super(e,t,i),this._register(i)}setScrollPosition(e){this._scrollable.setScrollPositionNow(e)}}class AD extends TD{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 OD extends TD{constructor(e,t){(t=t||{}).mouseWheelSmoothScroll=!1;const i=new DD({forceIntegerValues:!1,smoothScrollDuration:0,scheduleAtNextAnimationFrame:e=>An(e)});super(e,t,i),this._register(i),this._element=e,this._register(this.onScroll((e=>{e.scrollTopChanged&&(this._element.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this._element.scrollLeft=e.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})}}var PD;function FD(e,t){const i=[];for(const n of t){if(e.start>=n.range.end)continue;if(e.end=t.end||t.start>=e.end)return{start:0,end:0};const i=Math.max(e.start,t.start),n=Math.min(e.end,t.end);return n-i<=0?{start:0,end:0}:{start:i,end:n}}function i(e){return e.end-e.start<=0}e.intersect=t,e.isEmpty=i,e.intersects=function(e,n){return!i(t(e,n))},e.relativeComplement=function(e,t){const n=[],s={start:e.start,end:Math.min(t.start,e.end)},o={start:Math.max(t.end,e.start),end:e.end};return i(s)||n.push(s),i(o)||n.push(o),n}}(PD||(PD={}));class WD{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=null!=e?e:0,this._size=this._paddingTop}splice(e,t,i=[]){const n=i.length-t,s=FD({start:0,end:e},this.groups),o=FD({start:e+t,end:Number.POSITIVE_INFINITY},this.groups).map((e=>({range:BD(e.range,n),size:e.size}))),r=i.map(((t,i)=>({range:{start:e+i,end:e+i+1},size:t.size})));this.groups=function(...e){return function(e){const t=[];let i=null;for(const n of e){const e=n.range.start,s=n.range.end,o=n.size;i&&o===i.size?i.range.end=s:(i={range:{start:e,end:s},size:o},t.push(i))}return t}(e.reduce(((e,t)=>e.concat(t)),[]))}(s,r,o),this._size=this._paddingTop+this.groups.reduce(((e,t)=>e+t.size*(t.range.end-t.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}}var HD=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};const zD={CurrentDragAndDropData:void 0},UD={useShadows:!0,verticalScrollMode:1,setRowLineHeight:!0,setRowHeight:!0,supportDynamicHeights:!1,dnd:{getDragElements:e=>[e],getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){},dispose(){}},horizontalScrolling:!1,transformOptimization:!0,alwaysConsumeMouseWheel:!0};class KD{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class jD{constructor(e){this.elements=e}update(){}getData(){return this.elements}}class qD{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;ti,(null==e?void 0:e.getPosInSet)?this.getPosInSet=e.getPosInSet.bind(e):this.getPosInSet=(e,t)=>t+1,(null==e?void 0:e.getRole)?this.getRole=e.getRole.bind(e):this.getRole=e=>"listitem",(null==e?void 0:e.isChecked)?this.isChecked=e.isChecked.bind(e):this.isChecked=e=>{}}}class GD{get contentHeight(){return this.rangeMap.size}get onDidScroll(){return this.scrollableElement.onScroll}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 e of this.items)this.measureItemWidth(e);this.updateScrollWidth(),this.scrollableElement.setScrollDimensions({width:Un(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=UD){var s,o,r,a,l,h,d,c,u,g,p,m,f;if(this.virtualDelegate=t,this.domId="list_id_"+ ++GD.InstanceCount,this.renderers=new Map,this.renderWidth=0,this._scrollHeight=0,this.scrollableElementUpdateDisposable=null,this.scrollableElementWidthDelayer=new Jh(50),this.splicing=!1,this.dragOverAnimationStopDisposable=E.None,this.dragOverMouseY=0,this.canDrop=!1,this.currentDragFeedbackDisposable=E.None,this.onDragLeaveTimeout=E.None,this.disposables=new N,this._onDidChangeContentHeight=new U,this._onDidChangeContentWidth=new U,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=new WD(null!==(s=n.paddingTop)&&void 0!==s?s:0);for(const _ of i)this.renderers.set(_.templateId,_);this.cache=this.disposables.add(new VD(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","boolean"!=typeof n.mouseSupport||n.mouseSupport),this._horizontalScrolling=null!==(o=n.horizontalScrolling)&&void 0!==o?o:UD.horizontalScrolling,this.domNode.classList.toggle("horizontal-scrolling",this._horizontalScrolling),this.paddingBottom=void 0===n.paddingBottom?0:n.paddingBottom,this.accessibilityProvider=new $D(n.accessibilityProvider),this.rowsContainer=document.createElement("div"),this.rowsContainer.className="monaco-list-rows";(null!==(r=n.transformOptimization)&&void 0!==r?r:UD.transformOptimization)&&(this.rowsContainer.style.transform="translate3d(0px, 0px, 0px)",this.rowsContainer.style.overflow="hidden",this.rowsContainer.style.contain="strict"),this.disposables.add(ZL.addTarget(this.rowsContainer)),this.scrollable=this.disposables.add(new DD({forceIntegerValues:!0,smoothScrollDuration:null!==(a=n.smoothScrolling)&&void 0!==a&&a?125:0,scheduleAtNextAnimationFrame:e=>An(e)})),this.scrollableElement=this.disposables.add(new AD(this.rowsContainer,{alwaysConsumeMouseWheel:null!==(l=n.alwaysConsumeMouseWheel)&&void 0!==l?l:UD.alwaysConsumeMouseWheel,horizontal:1,vertical:null!==(h=n.verticalScrollMode)&&void 0!==h?h:UD.verticalScrollMode,useShadows:null!==(d=n.useShadows)&&void 0!==d?d:UD.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(En(this.rowsContainer,$L.Change,(e=>this.onTouchChange(e)))),this.disposables.add(En(this.scrollableElement.getDomNode(),"scroll",(e=>e.target.scrollTop=0))),this.disposables.add(En(this.domNode,"dragover",(e=>this.onDragOver(this.toDragEvent(e))))),this.disposables.add(En(this.domNode,"drop",(e=>this.onDrop(this.toDragEvent(e))))),this.disposables.add(En(this.domNode,"dragleave",(e=>this.onDragLeave(this.toDragEvent(e))))),this.disposables.add(En(this.domNode,"dragend",(e=>this.onDragEnd(e)))),this.setRowLineHeight=null!==(c=n.setRowLineHeight)&&void 0!==c?c:UD.setRowLineHeight,this.setRowHeight=null!==(u=n.setRowHeight)&&void 0!==u?u:UD.setRowHeight,this.supportDynamicHeights=null!==(g=n.supportDynamicHeights)&&void 0!==g?g:UD.supportDynamicHeights,this.dnd=null!==(p=n.dnd)&&void 0!==p?p:this.disposables.add(UD.dnd),this.layout(null===(m=n.initialSize)||void 0===m?void 0:m.height,null===(f=n.initialSize)||void 0===f?void 0:f.width)}updateOptions(e){let t;if(void 0!==e.paddingBottom&&(this.paddingBottom=e.paddingBottom,this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight})),void 0!==e.smoothScrolling&&this.scrollable.setSmoothScrollDuration(e.smoothScrolling?125:0),void 0!==e.horizontalScrolling&&(this.horizontalScrolling=e.horizontalScrolling),void 0!==e.scrollByPage&&(t=Object.assign(Object.assign({},null!=t?t:{}),{scrollByPage:e.scrollByPage})),void 0!==e.mouseWheelScrollSensitivity&&(t=Object.assign(Object.assign({},null!=t?t:{}),{mouseWheelScrollSensitivity:e.mouseWheelScrollSensitivity})),void 0!==e.fastScrollSensitivity&&(t=Object.assign(Object.assign({},null!=t?t:{}),{fastScrollSensitivity:e.fastScrollSensitivity})),t&&this.scrollableElement.updateOptions(t),void 0!==e.paddingTop&&e.paddingTop!==this.rangeMap.paddingTop){const t=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),i=e.paddingTop-this.rangeMap.paddingTop;this.rangeMap.paddingTop=e.paddingTop,this.render(t,Math.max(0,this.lastRenderTop+i),this.lastRenderHeight,void 0,void 0,!0),this.setScrollTop(this.lastRenderTop),this.eventuallyUpdateScrollDimensions(),this.supportDynamicHeights&&this._rerender(this.lastRenderTop,this.lastRenderHeight)}}splice(e,t,i=[]){if(this.splicing)throw new Error("Can't run recursive splices.");this.splicing=!0;try{return this._splice(e,t,i)}finally{this.splicing=!1,this._onDidChangeContentHeight.fire(this.contentHeight)}}_splice(e,t,i=[]){const n=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),s={start:e,end:e+t},o=PD.intersect(n,s),r=new Map;for(let C=o.end-1;C>=o.start;C--){const e=this.items[C];if(e.dragStartDisposable.dispose(),e.checkedDisposable.dispose(),e.row){let t=r.get(e.templateId);t||(t=[],r.set(e.templateId,t));const i=this.renderers.get(e.templateId);i&&i.disposeElement&&i.disposeElement(e.element,C,e.row.templateData,e.size),t.push(e.row)}e.row=null}const a={start:e+t,end:this.items.length},l=PD.intersect(a,n),h=PD.relativeComplement(a,n),d=i.map((e=>({id:String(this.itemId++),element:e,templateId:this.virtualDelegate.getTemplateId(e),size:this.virtualDelegate.getHeight(e),width:void 0,hasDynamicHeight:!!this.virtualDelegate.hasDynamicHeight&&this.virtualDelegate.hasDynamicHeight(e),lastDynamicHeightWidth:void 0,row:null,uri:void 0,dropTarget:!1,dragStartDisposable:E.None,checkedDisposable:E.None})));let c;0===e&&t>=this.items.length?(this.rangeMap=new WD(this.rangeMap.paddingTop),this.rangeMap.splice(0,0,d),c=this.items,this.items=d):(this.rangeMap.splice(e,t,d),c=this.items.splice(e,t,...d));const u=i.length-t,g=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),p=BD(l,u),m=PD.intersect(g,p);for(let C=m.start;CBD(e,u))),v=[{start:e,end:e+i.length},..._].map((e=>PD.intersect(g,e))),b=this.getNextToLastElement(v);for(const C of v)for(let e=C.start;ee.element))}eventuallyUpdateScrollDimensions(){this._scrollHeight=this.contentHeight,this.rowsContainer.style.height=`${this._scrollHeight}px`,this.scrollableElementUpdateDisposable||(this.scrollableElementUpdateDisposable=An((()=>{this.scrollableElement.setScrollDimensions({scrollHeight:this.scrollHeight}),this.updateScrollWidth(),this.scrollableElementUpdateDisposable=null})))}eventuallyUpdateScrollWidth(){this.horizontalScrolling?this.scrollableElementWidthDelayer.trigger((()=>this.updateScrollWidth())):this.scrollableElementWidthDelayer.cancel()}updateScrollWidth(){if(!this.horizontalScrolling)return;let e=0;for(const t of this.items)void 0!==t.width&&(e=Math.max(e,t.width));this.scrollWidth=e,this.scrollableElement.setScrollDimensions({scrollWidth:0===e?0:e+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(){const e=this.getRenderRange(this.lastRenderTop,this.lastRenderHeight),t=this.rangeMap.positionAt(e.start),i=this.rangeMap.positionAt(e.start+1);if(-1!==i){if((i-t)/2+t{for(const e of l)for(let t=e.start;tn.row.domNode.setAttribute("aria-checked",String(!!e));e(r.value),n.checkedDisposable=r.onDidChange(e)}!s&&n.row.domNode.parentElement||(t?this.rowsContainer.insertBefore(n.row.domNode,t):this.rowsContainer.appendChild(n.row.domNode)),this.updateItemInDOM(n,e);const a=this.renderers.get(n.templateId);if(!a)throw new Error(`No renderer found for template id ${n.templateId}`);null==a||a.renderElement(n.element,e,n.row.templateData,n.size);const l=this.dnd.getDragURI(n.element);n.dragStartDisposable.dispose(),n.row.domNode.draggable=!!l,l&&(n.dragStartDisposable=En(n.row.domNode,"dragstart",(e=>this.onDragStart(n.element,l,e)))),this.horizontalScrolling&&(this.measureItemWidth(n),this.eventuallyUpdateScrollWidth())}measureItemWidth(e){if(!e.row||!e.row.domNode)return;e.row.domNode.style.width="fit-content",e.width=Un(e.row.domNode);const t=window.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})}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 B.map(this.disposables.add(new Ky(this.domNode,"click")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onMouseDblClick(){return B.map(this.disposables.add(new Ky(this.domNode,"dblclick")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onMouseMiddleClick(){return B.filter(B.map(this.disposables.add(new Ky(this.domNode,"auxclick")).event,(e=>this.toMouseEvent(e)),this.disposables),(e=>1===e.browserEvent.button),this.disposables)}get onMouseDown(){return B.map(this.disposables.add(new Ky(this.domNode,"mousedown")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onMouseOver(){return B.map(this.disposables.add(new Ky(this.domNode,"mouseover")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onMouseOut(){return B.map(this.disposables.add(new Ky(this.domNode,"mouseout")).event,(e=>this.toMouseEvent(e)),this.disposables)}get onContextMenu(){return B.any(B.map(this.disposables.add(new Ky(this.domNode,"contextmenu")).event,(e=>this.toMouseEvent(e)),this.disposables),B.map(this.disposables.add(new Ky(this.domNode,$L.Contextmenu)).event,(e=>this.toGestureEvent(e)),this.disposables))}get onTouchStart(){return B.map(this.disposables.add(new Ky(this.domNode,"touchstart")).event,(e=>this.toTouchEvent(e)),this.disposables)}get onTap(){return B.map(this.disposables.add(new Ky(this.rowsContainer,$L.Tap)).event,(e=>this.toGestureEvent(e)),this.disposables)}toMouseEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toTouchEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toGestureEvent(e){const t=this.getItemIndexFromEventTarget(e.initialTarget||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}toDragEvent(e){const t=this.getItemIndexFromEventTarget(e.target||null),i=void 0===t?void 0:this.items[t];return{browserEvent:e,index:t,element:i&&i.element}}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){var n,s;if(!i.dataTransfer)return;const o=this.dnd.getDragElements(e);if(i.dataTransfer.effectAllowed="copyMove",i.dataTransfer.setData(aD.TEXT,t),i.dataTransfer.setDragImage){let e;this.dnd.getDragLabel&&(e=this.dnd.getDragLabel(o,i)),void 0===e&&(e=String(o.length));const t=fs(".monaco-drag-image");t.textContent=e;const n=(e=>{for(;e&&!e.classList.contains("monaco-workbench");)e=e.parentElement;return e||document.body})(this.domNode);n.appendChild(t),i.dataTransfer.setDragImage(t,-10,-10),setTimeout((()=>n.removeChild(t)),0)}this.domNode.classList.add("dragging"),this.currentDragData=new KD(o),zD.CurrentDragAndDropData=new jD(o),null===(s=(n=this.dnd).onDragStart)||void 0===s||s.call(n,this.currentDragData,i)}onDragOver(e){var t;if(e.browserEvent.preventDefault(),this.onDragLeaveTimeout.dispose(),zD.CurrentDragAndDropData&&"vscode-ui"===zD.CurrentDragAndDropData.getData())return!1;if(this.setupDragAndDropScrollTopAnimation(e.browserEvent),!e.browserEvent.dataTransfer)return!1;if(!this.currentDragData)if(zD.CurrentDragAndDropData)this.currentDragData=zD.CurrentDragAndDropData;else{if(!e.browserEvent.dataTransfer.types)return!1;this.currentDragData=new qD}const i=this.dnd.onDragOver(this.currentDragData,e.element,e.index,e.browserEvent);if(this.canDrop="boolean"==typeof i?i:i.accept,!this.canDrop)return this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),!1;let n;if(e.browserEvent.dataTransfer.dropEffect="boolean"!=typeof i&&0===i.effect?"copy":"move",n="boolean"!=typeof i&&i.feedback?i.feedback:void 0===e.index?[-1]:[e.index],n=zd(n).filter((e=>e>=-1&&ee-t)),n=-1===n[0]?[-1]:n,s=this.currentDragFeedback,o=n,Array.isArray(s)&&Array.isArray(o)?Td(s,o):s===o)return!0;var s,o;if(this.currentDragFeedback=n,this.currentDragFeedbackDisposable.dispose(),-1===n[0])this.domNode.classList.add("drop-target"),this.rowsContainer.classList.add("drop-target"),this.currentDragFeedbackDisposable=x((()=>{this.domNode.classList.remove("drop-target"),this.rowsContainer.classList.remove("drop-target")}));else{for(const e of n){const i=this.items[e];i.dropTarget=!0,null===(t=i.row)||void 0===t||t.domNode.classList.add("drop-target")}this.currentDragFeedbackDisposable=x((()=>{var e;for(const t of n){const i=this.items[t];i.dropTarget=!1,null===(e=i.row)||void 0===e||e.domNode.classList.remove("drop-target")}}))}return!0}onDragLeave(e){var t,i;this.onDragLeaveTimeout.dispose(),this.onDragLeaveTimeout=id((()=>this.clearDragOverFeedback()),100,this.disposables),this.currentDragData&&(null===(i=(t=this.dnd).onDragLeave)||void 0===i||i.call(t,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,zD.CurrentDragAndDropData=void 0,t&&e.browserEvent.dataTransfer&&(e.browserEvent.preventDefault(),t.update(e.browserEvent.dataTransfer),this.dnd.drop(t,e.element,e.index,e.browserEvent))}onDragEnd(e){var t,i;this.canDrop=!1,this.teardownDragAndDropScrollTopAnimation(),this.clearDragOverFeedback(),this.domNode.classList.remove("dragging"),this.currentDragData=void 0,zD.CurrentDragAndDropData=void 0,null===(i=(t=this.dnd).onDragEnd)||void 0===i||i.call(t,e)}clearDragOverFeedback(){this.currentDragFeedback=void 0,this.currentDragFeedbackDisposable.dispose(),this.currentDragFeedbackDisposable=E.None}setupDragAndDropScrollTopAnimation(e){if(!this.dragOverAnimationDisposable){const e=Vn(this.domNode).top;this.dragOverAnimationDisposable=function(e){const t=()=>{e(),i=An(t)};let i=An(t);return x((()=>i.dispose()))}(this.animateDragAndDropScrollTop.bind(this,e))}this.dragOverAnimationStopDisposable.dispose(),this.dragOverAnimationStopDisposable=id((()=>{this.dragOverAnimationDisposable&&(this.dragOverAnimationDisposable.dispose(),this.dragOverAnimationDisposable=void 0)}),1e3,this.disposables),this.dragOverMouseY=e.pageY}animateDragAndDropScrollTop(e){if(void 0===this.dragOverMouseY)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)}getItemIndexFromEventTarget(e){const t=this.scrollableElement.getDomNode();let i=e;for(;i instanceof HTMLElement&&i!==this.rowsContainer&&t.contains(i);){const e=i.getAttribute("data-index");if(e){const t=Number(e);if(!isNaN(t))return t}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 s,o;e===this.elementTop(n.start)?(s=n.start,o=0):n.end-n.start>1&&(s=n.start+1,o=this.elementTop(s)-e);let r=0;for(;;){const a=this.getRenderRange(e,t);let l=!1;for(let e=a.start;e=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},QD=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class JD{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((e=>e.templateData===i));if(n>=0){const e=this.renderedElements[n];this.trait.unrender(i),e.index=t}else{const e={index:t,templateData:i};this.renderedElements.push(e)}this.trait.renderIndex(t,i)}splice(e,t,i){const n=[];for(const s of this.renderedElements)s.index=e+t&&n.push({index:s.index+i-t,templateData:s.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((t=>t.templateData===e));t<0||this.renderedElements.splice(t,1)}}class ex{get name(){return this._trait}get renderer(){return new JD(this)}constructor(e){this._trait=e,this.length=0,this.indexes=[],this.sortedIndexes=[],this._onChange=new U,this.onChange=this._onChange.event}splice(e,t,i){var n;t=Math.max(0,Math.min(t,this.length-e));const s=i.length-t,o=e+t,r=[];let a=0;for(;a=o;)r.push(this.sortedIndexes[a++]+s);const l=this.length+s;if(this.sortedIndexes.length>0&&0===r.length&&l>0){const t=null!==(n=this.sortedIndexes.find((t=>t>=e)))&&void 0!==n?n:l-1;r.push(Math.min(t,l-1))}this.renderer.splice(e,t,i.length),this._set(r,r),this.length=l}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(vx),t)}_set(e,t,i){const n=this.indexes,s=this.sortedIndexes;this.indexes=e,this.sortedIndexes=t;const o=_x(s,e);return this.renderer.renderIndexes(o),this._onChange.fire({indexes:e,browserEvent:i}),n}get(){return this.indexes}contains(e){return Rd(this.sortedIndexes,e,vx)>=0}dispose(){k(this._onChange)}}XD([qL],ex.prototype,"renderer",null);class tx extends ex{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 ix{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((e=>this.identityProvider.getId(this.view.element(e)).toString()));if(0===n.length)return this.trait.splice(e,t,new Array(i.length).fill(!1));const s=new Set(n),o=i.map((e=>s.has(this.identityProvider.getId(e).toString())));this.trait.splice(e,t,o)}}function nx(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName}function sx(e){return!!e.classList.contains("monaco-editor")||!e.classList.contains("monaco-list")&&(!!e.parentElement&&sx(e.parentElement))}function ox(e){return!!("A"===e.tagName&&e.classList.contains("monaco-button")||"DIV"===e.tagName&&e.classList.contains("monaco-button-dropdown"))||!e.classList.contains("monaco-list")&&(!!e.parentElement&&ox(e.parentElement))}class rx{get onKeyDown(){return B.chain(this.disposables.add(new Ky(this.view.domNode,"keydown")).event,(e=>e.filter((e=>!nx(e.target))).map((e=>new St(e)))))}constructor(e,t,i){this.list=e,this.view=t,this.disposables=new N,this.multipleSelectionDisposables=new N,this.multipleSelectionSupport=i.multipleSelectionSupport,this.disposables.add(this.onKeyDown((e=>{switch(e.keyCode){case 3:return this.onEnter(e);case 16:return this.onUpArrow(e);case 18:return this.onDownArrow(e);case 11:return this.onPageUpArrow(e);case 12:return this.onPageDownArrow(e);case 9:return this.onEscape(e);case 31:this.multipleSelectionSupport&&(Pe?e.metaKey:e.ctrlKey)&&this.onCtrlA(e)}})))}updateOptions(e){void 0!==e.multipleSelectionSupport&&(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(Kd(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()}}XD([qL],rx.prototype,"onKeyDown",null),function(e){e[e.Automatic=0]="Automatic",e[e.Trigger=1]="Trigger"}(ZD||(ZD={})),function(e){e[e.Idle=0]="Idle",e[e.Typing=1]="Typing"}(YD||(YD={}));const ax=new class{mightProducePrintableCharacter(e){return!(e.ctrlKey||e.metaKey||e.altKey)&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30||e.keyCode>=98&&e.keyCode<=107||e.keyCode>=85&&e.keyCode<=95)}};class lx{constructor(e,t,i,n,s){this.list=e,this.view=t,this.keyboardNavigationLabelProvider=i,this.keyboardNavigationEventFilter=n,this.delegate=s,this.enabled=!1,this.state=YD.Idle,this.mode=ZD.Automatic,this.triggered=!1,this.previouslyFocused=-1,this.enabledDisposables=new N,this.disposables=new N,this.updateOptions(e.options)}updateOptions(e){var t,i;null===(t=e.typeNavigationEnabled)||void 0===t||t?this.enable():this.disable(),this.mode=null!==(i=e.typeNavigationMode)&&void 0!==i?i:ZD.Automatic}enable(){if(this.enabled)return;let e=!1;const t=B.chain(this.enabledDisposables.add(new Ky(this.view.domNode,"keydown")).event,(t=>t.filter((e=>!nx(e.target))).filter((()=>this.mode===ZD.Automatic||this.triggered)).map((e=>new St(e))).filter((t=>e||this.keyboardNavigationEventFilter(t))).filter((e=>this.delegate.mightProducePrintableCharacter(e))).forEach((e=>as(e,!0))).map((e=>e.browserEvent.key)))),i=B.debounce(t,(()=>null),800,void 0,void 0,void 0,this.enabledDisposables);B.reduce(B.any(t,i),((e,t)=>null===t?null:(e||"")+t),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(){var e;const t=this.list.getFocus();if(t.length>0&&t[0]===this.previouslyFocused){const i=null===(e=this.list.options.accessibilityProvider)||void 0===e?void 0:e.getAriaLabel(this.list.element(t[0]));i&&Ps(i)}this.previouslyFocused=-1}onInput(e){if(!e)return this.state=YD.Idle,void(this.triggered=!1);const t=this.list.getFocus(),i=t.length>0?t[0]:0,n=this.state===YD.Idle?1:0;this.state=YD.Typing;for(let s=0;s1&&1===n.length)return this.previouslyFocused=i,this.list.setFocus([t]),void this.list.reveal(t)}}}else if(void 0===r||$o(e,r))return this.previouslyFocused=i,this.list.setFocus([t]),void this.list.reveal(t)}}dispose(){this.disable(),this.enabledDisposables.dispose(),this.disposables.dispose()}}class hx{constructor(e,t){this.list=e,this.view=t,this.disposables=new N;const i=B.chain(this.disposables.add(new Ky(t.domNode,"keydown")).event,(e=>e.filter((e=>!nx(e.target))).map((e=>new St(e))))),n=B.chain(i,(e=>e.filter((e=>!(2!==e.keyCode||e.ctrlKey||e.metaKey||e.shiftKey||e.altKey)))));n(this.onTab,this,this.disposables)}onTab(e){if(e.target!==this.view.domNode)return;const t=this.list.getFocus();if(0===t.length)return;const i=this.view.domElement(t[0]);if(!i)return;const n=i.querySelector("[tabIndex]");if(!(n&&n instanceof HTMLElement&&-1!==n.tabIndex))return;const s=window.getComputedStyle(n);"hidden"!==s.visibility&&"none"!==s.display&&(e.preventDefault(),e.stopPropagation(),n.focus())}dispose(){this.disposables.dispose()}}function dx(e){return Pe?e.browserEvent.metaKey:e.browserEvent.ctrlKey}function cx(e){return e.browserEvent.shiftKey}const ux={isSelectionSingleChangeEvent:dx,isSelectionRangeChangeEvent:cx};class gx{constructor(e){this.list=e,this.disposables=new N,this._onPointer=new U,this.onPointer=this._onPointer.event,!1!==e.options.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||ux),this.mouseSupport=void 0===e.options.mouseSupport||!!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(ZL.addTarget(e.getHTMLElement()))),B.any(e.onMouseClick,e.onMouseMiddleClick,e.onTap)(this.onViewPointer,this,this.disposables)}updateOptions(e){void 0!==e.multipleSelectionSupport&&(this.multipleSelectionController=void 0,e.multipleSelectionSupport&&(this.multipleSelectionController=this.list.options.multipleSelectionController||ux))}isSelectionSingleChangeEvent(e){return!!this.multipleSelectionController&&this.multipleSelectionController.isSelectionSingleChangeEvent(e)}isSelectionRangeChangeEvent(e){return!!this.multipleSelectionController&&this.multipleSelectionController.isSelectionRangeChangeEvent(e)}isSelectionChangeEvent(e){return this.isSelectionSingleChangeEvent(e)||this.isSelectionRangeChangeEvent(e)}onMouseDown(e){sx(e.browserEvent.target)||document.activeElement!==e.browserEvent.target&&this.list.domFocus()}onContextMenu(e){if(nx(e.browserEvent.target)||sx(e.browserEvent.target))return;const t=void 0===e.index?[]:[e.index];this.list.setFocus(t,e.browserEvent)}onViewPointer(e){if(!this.mouseSupport)return;if(nx(e.browserEvent.target)||sx(e.browserEvent.target))return;if(e.browserEvent.isHandledByList)return;e.browserEvent.isHandledByList=!0;const t=e.index;return void 0===t?(this.list.setFocus([],e.browserEvent),this.list.setSelection([],e.browserEvent),void this.list.setAnchor(void 0)):this.isSelectionChangeEvent(e)?this.changeSelection(e):(this.list.setFocus([t],e.browserEvent),this.list.setAnchor(t),(i=e.browserEvent)instanceof MouseEvent&&2===i.button||this.list.setSelection([t],e.browserEvent),void this._onPointer.fire(e));var i}onDoubleClick(e){if(nx(e.browserEvent.target)||sx(e.browserEvent.target))return;if(this.isSelectionChangeEvent(e))return;if(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)){if(void 0===i){const e=this.list.getFocus()[0];i=null!=e?e:t,this.list.setAnchor(i)}const n=Kd(Math.min(i,t),Math.max(i,t)+1),s=this.list.getSelection(),o=function(e,t){const i=e.indexOf(t);if(-1===i)return[];const n=[];let s=i-1;for(;s>=0&&e[s]===t-(i-s);)n.push(e[s--]);n.reverse(),s=i;for(;s=e.length)i.push(t[s++]);else if(s>=t.length)i.push(e[n++]);else{if(e[n]===t[s]){n++,s++;continue}e[n]e!==t));this.list.setFocus([t]),this.list.setAnchor(t),i.length===n.length?this.list.setSelection([...n,t],e.browserEvent):this.list.setSelection(n,e.browserEvent)}}dispose(){this.disposables.dispose()}}class px{constructor(e,t){this.styleElement=e,this.selectorSuffix=t}style(e){var t,i;const n=this.selectorSuffix&&`.${this.selectorSuffix}`,s=[];e.listBackground&&s.push(`.monaco-list${n} .monaco-list-rows { background: ${e.listBackground}; }`),e.listFocusBackground&&(s.push(`.monaco-list${n}:focus .monaco-list-row.focused { background-color: ${e.listFocusBackground}; }`),s.push(`.monaco-list${n}:focus .monaco-list-row.focused:hover { background-color: ${e.listFocusBackground}; }`)),e.listFocusForeground&&s.push(`.monaco-list${n}:focus .monaco-list-row.focused { color: ${e.listFocusForeground}; }`),e.listActiveSelectionBackground&&(s.push(`.monaco-list${n}:focus .monaco-list-row.selected { background-color: ${e.listActiveSelectionBackground}; }`),s.push(`.monaco-list${n}:focus .monaco-list-row.selected:hover { background-color: ${e.listActiveSelectionBackground}; }`)),e.listActiveSelectionForeground&&s.push(`.monaco-list${n}:focus .monaco-list-row.selected { color: ${e.listActiveSelectionForeground}; }`),e.listActiveSelectionIconForeground&&s.push(`.monaco-list${n}:focus .monaco-list-row.selected .codicon { color: ${e.listActiveSelectionIconForeground}; }`),e.listFocusAndSelectionBackground&&s.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${n}:focus .monaco-list-row.selected.focused { background-color: ${e.listFocusAndSelectionBackground}; }\n\t\t\t`),e.listFocusAndSelectionForeground&&s.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${n}:focus .monaco-list-row.selected.focused { color: ${e.listFocusAndSelectionForeground}; }\n\t\t\t`),e.listInactiveFocusForeground&&(s.push(`.monaco-list${n} .monaco-list-row.focused { color: ${e.listInactiveFocusForeground}; }`),s.push(`.monaco-list${n} .monaco-list-row.focused:hover { color: ${e.listInactiveFocusForeground}; }`)),e.listInactiveSelectionIconForeground&&s.push(`.monaco-list${n} .monaco-list-row.focused .codicon { color: ${e.listInactiveSelectionIconForeground}; }`),e.listInactiveFocusBackground&&(s.push(`.monaco-list${n} .monaco-list-row.focused { background-color: ${e.listInactiveFocusBackground}; }`),s.push(`.monaco-list${n} .monaco-list-row.focused:hover { background-color: ${e.listInactiveFocusBackground}; }`)),e.listInactiveSelectionBackground&&(s.push(`.monaco-list${n} .monaco-list-row.selected { background-color: ${e.listInactiveSelectionBackground}; }`),s.push(`.monaco-list${n} .monaco-list-row.selected:hover { background-color: ${e.listInactiveSelectionBackground}; }`)),e.listInactiveSelectionForeground&&s.push(`.monaco-list${n} .monaco-list-row.selected { color: ${e.listInactiveSelectionForeground}; }`),e.listHoverBackground&&s.push(`.monaco-list${n}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { background-color: ${e.listHoverBackground}; }`),e.listHoverForeground&&s.push(`.monaco-list${n}:not(.drop-target):not(.dragging) .monaco-list-row:hover:not(.selected):not(.focused) { color: ${e.listHoverForeground}; }`);const o=Ss(e.listFocusAndSelectionOutline,Ss(e.listSelectionOutline,null!==(t=e.listFocusOutline)&&void 0!==t?t:""));o&&s.push(`.monaco-list${n}:focus .monaco-list-row.focused.selected { outline: 1px solid ${o}; outline-offset: -1px;}`),e.listFocusOutline&&s.push(`\n\t\t\t\t.monaco-drag-image,\n\t\t\t\t.monaco-list${n}:focus .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }\n\t\t\t\t.monaco-workbench.context-menu-visible .monaco-list${n}.last-focused .monaco-list-row.focused { outline: 1px solid ${e.listFocusOutline}; outline-offset: -1px; }\n\t\t\t`);const r=Ss(e.listSelectionOutline,null!==(i=e.listInactiveFocusOutline)&&void 0!==i?i:"");r&&s.push(`.monaco-list${n} .monaco-list-row.focused.selected { outline: 1px dotted ${r}; outline-offset: -1px; }`),e.listSelectionOutline&&s.push(`.monaco-list${n} .monaco-list-row.selected { outline: 1px dotted ${e.listSelectionOutline}; outline-offset: -1px; }`),e.listInactiveFocusOutline&&s.push(`.monaco-list${n} .monaco-list-row.focused { outline: 1px dotted ${e.listInactiveFocusOutline}; outline-offset: -1px; }`),e.listHoverOutline&&s.push(`.monaco-list${n} .monaco-list-row:hover { outline: 1px dashed ${e.listHoverOutline}; outline-offset: -1px; }`),e.listDropBackground&&s.push(`\n\t\t\t\t.monaco-list${n}.drop-target,\n\t\t\t\t.monaco-list${n} .monaco-list-rows.drop-target,\n\t\t\t\t.monaco-list${n} .monaco-list-row.drop-target { background-color: ${e.listDropBackground} !important; color: inherit !important; }\n\t\t\t`),e.tableColumnsBorder&&s.push(`\n\t\t\t\t.monaco-table > .monaco-split-view2,\n\t\t\t\t.monaco-table > .monaco-split-view2 .monaco-sash.vertical::before,\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2,\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table:hover > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\t\t\tborder-color: ${e.tableColumnsBorder};\n\t\t\t\t}\n\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2,\n\t\t\t\t.monaco-workbench:not(.reduce-motion) .monaco-table > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\t\t\tborder-color: transparent;\n\t\t\t\t}\n\t\t\t`),e.tableOddRowsBackgroundColor&&s.push(`\n\t\t\t\t.monaco-table .monaco-list-row[data-parity=odd]:not(.focused):not(.selected):not(:hover) .monaco-table-tr,\n\t\t\t\t.monaco-table .monaco-list:not(:focus) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr,\n\t\t\t\t.monaco-table .monaco-list:not(.focused) .monaco-list-row[data-parity=odd].focused:not(.selected):not(:hover) .monaco-table-tr {\n\t\t\t\t\tbackground-color: ${e.tableOddRowsBackgroundColor};\n\t\t\t\t}\n\t\t\t`),this.styleElement.textContent=s.join("\n")}}const mx={listFocusBackground:"#7FB0D0",listActiveSelectionBackground:"#0E639C",listActiveSelectionForeground:"#FFFFFF",listActiveSelectionIconForeground:"#FFFFFF",listFocusAndSelectionOutline:"#90C2F9",listFocusAndSelectionBackground:"#094771",listFocusAndSelectionForeground:"#FFFFFF",listInactiveSelectionBackground:"#3F3F46",listInactiveSelectionIconForeground:"#FFFFFF",listHoverBackground:"#2A2D2E",listDropBackground:"#383B3D",treeIndentGuidesStroke:"#a9a9a9",treeInactiveIndentGuidesStroke:lc.fromHex("#a9a9a9").transparent(.4).toString(),tableColumnsBorder:lc.fromHex("#cccccc").transparent(.2).toString(),tableOddRowsBackgroundColor:lc.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},fx={keyboardSupport:!0,mouseSupport:!0,multipleSelectionSupport:!0,dnd:{getDragURI:()=>null,onDragStart(){},onDragOver:()=>!1,drop(){},dispose(){}}};function _x(e,t){const i=[];let n=0,s=0;for(;n=e.length)i.push(t[s++]);else if(s>=t.length)i.push(e[n++]);else{if(e[n]===t[s]){i.push(e[n]),n++,s++;continue}e[n]e-t;class bx{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 s=0;for(const o of this.renderers)o.renderElement(e,t,i[s++],n)}disposeElement(e,t,i,n){var s;let o=0;for(const r of this.renderers)null===(s=r.disposeElement)||void 0===s||s.call(r,e,t,i[o],n),o+=1}disposeTemplate(e){let t=0;for(const i of this.renderers)i.disposeTemplate(e[t++])}}class Cx{constructor(e){this.accessibilityProvider=e,this.templateId="a18n"}renderTemplate(e){return e}renderElement(e,t,i){const n=this.accessibilityProvider.getAriaLabel(e);n?i.setAttribute("aria-label",n):i.removeAttribute("aria-label");const s=this.accessibilityProvider.getAriaLevel&&this.accessibilityProvider.getAriaLevel(e);"number"==typeof s?i.setAttribute("aria-level",`${s}`):i.removeAttribute("aria-level")}disposeTemplate(e){}}class wx{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){var i,n;null===(n=(i=this.dnd).onDragStart)||void 0===n||n.call(i,e,t)}onDragOver(e,t,i,n){return this.dnd.onDragOver(e,t,i,n)}onDragLeave(e,t,i,n){var s,o;null===(o=(s=this.dnd).onDragLeave)||void 0===o||o.call(s,e,t,i,n)}onDragEnd(e){var t,i;null===(i=(t=this.dnd).onDragEnd)||void 0===i||i.call(t,e)}drop(e,t,i,n){this.dnd.drop(e,t,i,n)}dispose(){this.dnd.dispose()}}class yx{get onDidChangeFocus(){return B.map(this.eventBufferer.wrapEvent(this.focus.onChange),(e=>this.toListEvent(e)),this.disposables)}get onDidChangeSelection(){return B.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 onMouseDown(){return this.view.onMouseDown}get onMouseOver(){return this.view.onMouseOver}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=B.chain(this.disposables.add(new Ky(this.view.domNode,"keydown")).event,(t=>t.map((e=>new St(e))).filter((t=>e=58===t.keyCode||t.shiftKey&&68===t.keyCode)).map((e=>as(e,!0))).filter((()=>!1)))),i=B.chain(this.disposables.add(new Ky(this.view.domNode,"keyup")).event,(t=>t.forEach((()=>e=!1)).map((e=>new St(e))).filter((e=>58===e.keyCode||e.shiftKey&&68===e.keyCode)).map((e=>as(e,!0))).map((({browserEvent:e})=>{const t=this.getFocus(),i=t.length?t[0]:void 0;return{index:i,element:void 0!==i?this.view.element(i):void 0,anchor:void 0!==i?this.view.domElement(i):this.view.domNode,browserEvent:e}})))),n=B.chain(this.view.onContextMenu,(t=>t.filter((t=>!e)).map((({element:e,index:t,browserEvent:i})=>({element:e,index:t,anchor:new Nt(i),browserEvent:i})))));return B.any(t,i,n)}get onKeyDown(){return this.disposables.add(new Ky(this.view.domNode,"keydown")).event}get onDidFocus(){return B.signal(this.disposables.add(new Ky(this.view.domNode,"focus",!0)).event)}constructor(e,t,i,n,s=fx){var o,r,a,l;this.user=e,this._options=s,this.focus=new ex("focused"),this.anchor=new ex("anchor"),this.eventBufferer=new Z,this._ariaLabel="",this.disposables=new N,this._onDidDispose=new U,this.onDidDispose=this._onDidDispose.event;const h=this._options.accessibilityProvider&&this._options.accessibilityProvider.getWidgetRole?null===(o=this._options.accessibilityProvider)||void 0===o?void 0:o.getWidgetRole():"list";this.selection=new tx("listbox"!==h);const d=[this.focus.renderer,this.selection.renderer];this.accessibilityProvider=s.accessibilityProvider,this.accessibilityProvider&&(d.push(new Cx(this.accessibilityProvider)),null===(a=(r=this.accessibilityProvider).onDidChangeActiveDescendant)||void 0===a||a.call(r,this.onDidChangeActiveDescendant,this,this.disposables)),n=n.map((e=>new bx(e.templateId,[...d,e])));const c=Object.assign(Object.assign({},s),{dnd:s.dnd&&new wx(this,s.dnd)});if(this.view=this.createListView(t,i,n,c),this.view.domNode.setAttribute("role",h),s.styleController)this.styleController=s.styleController(this.view.domId);else{const e=Jn(this.view.domNode);this.styleController=new px(e,this.view.domId)}if(this.spliceable=new cD([new ix(this.focus,this.view,s.identityProvider),new ix(this.selection,this.view,s.identityProvider),new ix(this.anchor,this.view,s.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 hx(this,this.view)),("boolean"!=typeof s.keyboardSupport||s.keyboardSupport)&&(this.keyboardController=new rx(this,this.view,s),this.disposables.add(this.keyboardController)),s.keyboardNavigationLabelProvider){const e=s.keyboardNavigationDelegate||ax;this.typeNavigationController=new lx(this,this.view,s.keyboardNavigationLabelProvider,null!==(l=s.keyboardNavigationEventFilter)&&void 0!==l?l:()=>!0,e),this.disposables.add(this.typeNavigationController)}this.mouseController=this.createMouseController(s),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()),!1!==this._options.multipleSelectionSupport&&this.view.domNode.setAttribute("aria-multiselectable","true")}createListView(e,t,i,n){return new GD(e,t,i,n)}createMouseController(e){return new gx(this)}updateOptions(e={}){var t,i;this._options=Object.assign(Object.assign({},this._options),e),null===(t=this.typeNavigationController)||void 0===t||t.updateOptions(this._options),void 0!==this._options.multipleSelectionController&&(this._options.multipleSelectionSupport?this.view.domNode.setAttribute("aria-multiselectable","true"):this.view.domNode.removeAttribute("aria-multiselectable")),this.mouseController.updateOptions(e),null===(i=this.keyboardController)||void 0===i||i.updateOptions(e),this.view.updateOptions(e)}get options(){return this._options}splice(e,t,i=[]){if(e<0||e>this.view.length)throw new mD(this.user,`Invalid start index: ${e}`);if(t<0)throw new mD(this.user,`Invalid delete count: ${t}`);0===t&&0===i.length||this.eventBufferer.bufferEvents((()=>this.spliceable.splice(e,t,i)))}rerender(){this.view.rerender()}element(e){return this.view.element(e)}get length(){return this.view.length}get contentHeight(){return this.view.contentHeight}get scrollTop(){return this.view.getScrollTop()}set scrollTop(e){this.view.setScrollTop(e)}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}get firstVisibleIndex(){return this.view.firstVisibleIndex}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)}setSelection(e,t){for(const i of e)if(i<0||i>=this.length)throw new mD(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(void 0!==e){if(e<0||e>=this.length)throw new mD(this.user,`Invalid index ${e}`);this.anchor.set([e])}else this.anchor.set([])}getAnchor(){return Ud(this.anchor.get(),void 0)}getAnchorElement(){const e=this.getAnchor();return void 0===e?void 0:this.element(e)}setFocus(e,t){for(const i of e)if(i<0||i>=this.length)throw new mD(this.user,`Invalid index ${i}`);this.focus.set(e,t)}focusNext(e=1,t=!1,i,n){if(0===this.length)return;const s=this.focus.get(),o=this.findNextIndex(s.length>0?s[0]+e:0,t,n);o>-1&&this.setFocus([o],i)}focusPrevious(e=1,t=!1,i,n){if(0===this.length)return;const s=this.focus.get(),o=this.findPreviousIndex(s.length>0?s[0]-e:0,t,n);o>-1&&this.setFocus([o],i)}focusNextPage(e,t){return QD(this,void 0,void 0,(function*(){let i=this.view.indexAt(this.view.getScrollTop()+this.view.renderHeight);i=0===i?0:i-1;const n=this.getFocus()[0];if(n!==i&&(void 0===n||i>n)){const s=this.findPreviousIndex(i,!1,t);s>-1&&n!==s?this.setFocus([s],e):this.setFocus([i],e)}else{const s=this.view.getScrollTop();let o=s+this.view.renderHeight;i>n&&(o-=this.view.elementHeight(i)),this.view.setScrollTop(o),this.view.getScrollTop()!==s&&(this.setFocus([]),yield td(0),yield this.focusNextPage(e,t))}}))}focusPreviousPage(e,t){return QD(this,void 0,void 0,(function*(){let i;const n=this.view.getScrollTop();i=0===n?this.view.indexAt(n):this.view.indexAfter(n-1);const s=this.getFocus()[0];if(s!==i&&(void 0===s||s>=i)){const n=this.findNextIndex(i,!1,t);n>-1&&s!==n?this.setFocus([n],e):this.setFocus([i],e)}else{const i=n;this.view.setScrollTop(n-this.view.renderHeight),this.view.getScrollTop()!==i&&(this.setFocus([]),yield td(0),yield this.focusPreviousPage(e,t))}}))}focusLast(e,t){if(0===this.length)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(0===this.length)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%=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){if(e<0||e>=this.length)throw new mD(this.user,`Invalid index ${e}`);const i=this.view.getScrollTop(),n=this.view.elementTop(e),s=this.view.elementHeight(e);if(Vr(t)){const e=s-this.view.renderHeight;this.view.setScrollTop(e*uD(t,0,1)+n)}else{const e=n+s,t=i+this.view.renderHeight;n=t||(n=t&&s>=this.view.renderHeight?this.view.setScrollTop(n):e>=t&&this.view.setScrollTop(e-this.view.renderHeight))}}getHTMLElement(){return this.view.domNode}getElementID(e){return this.view.getElementDomId(e)}style(e){this.styleController.style(e)}toListEvent({indexes:e,browserEvent:t}){return{indexes:e,elements:e.map((e=>this.view.element(e))),browserEvent:t}}_onFocusChange(){const e=this.focus.get();this.view.domNode.classList.toggle("element-focused",e.length>0),this.onDidChangeActiveDescendant()}onDidChangeActiveDescendant(){var e;const t=this.focus.get();if(t.length>0){let i;(null===(e=this.accessibilityProvider)||void 0===e?void 0:e.getActiveDescendantId)&&(i=this.accessibilityProvider.getActiveDescendantId(this.view.element(t[0]))),this.view.domNode.setAttribute("aria-activedescendant",i||this.view.getElementDomId(t[0]))}else this.view.domNode.removeAttribute("aria-activedescendant")}_onSelectionChange(){const e=this.selection.get();this.view.domNode.classList.toggle("selection-none",0===e.length),this.view.domNode.classList.toggle("selection-single",1===e.length),this.view.domNode.classList.toggle("selection-multiple",e.length>1)}dispose(){this._onDidDispose.fire(),this.disposables.dispose(),this._onDidDispose.dispose()}}XD([qL],yx.prototype,"onDidChangeFocus",null),XD([qL],yx.prototype,"onDidChangeSelection",null),XD([qL],yx.prototype,"onContextMenu",null),XD([qL],yx.prototype,"onKeyDown",null),XD([qL],yx.prototype,"onDidFocus",null);const Sx=fs,Lx="selectOption.entry.template";class kx{get templateId(){return Lx}renderTemplate(e){const t=Object.create(null);return t.root=e,t.text=ds(e,Sx(".option-text")),t.detail=ds(e,Sx(".option-detail")),t.decoratorRight=ds(e,Sx(".option-decorator-right")),t}renderElement(e,t,i){const n=i,s=e.text,o=e.detail,r=e.decoratorRight,a=e.isDisabled;n.text.textContent=s,n.detail.textContent=o||"",n.decoratorRight.innerText=r||"",a?n.root.classList.add("option-disabled"):n.root.classList.remove("option-disabled")}disposeTemplate(e){}}class Dx extends E{constructor(e,t,i,n,s){super(),this.options=[],this._currentSelection=0,this._hasDetails=!1,this._skipLayout=!1,this._sticky=!1,this._isVisible=!1,this.styles=n,this.selectBoxOptions=s||Object.create(null),"number"!=typeof this.selectBoxOptions.minBottomMargin?this.selectBoxOptions.minBottomMargin=Dx.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","string"==typeof this.selectBoxOptions.ariaLabel&&this.selectElement.setAttribute("aria-label",this.selectBoxOptions.ariaLabel),"string"==typeof this.selectBoxOptions.ariaDescription&&this.selectElement.setAttribute("aria-description",this.selectBoxOptions.ariaDescription),this._onDidSelect=new U,this._register(this._onDidSelect),this.registerListeners(),this.constructSelectDropDown(i),this.selected=t||0,e&&this.setOptions(e,t),this.initStyleSheet()}getHeight(){return 22}getTemplateId(){return Lx}constructSelectDropDown(e){this.contextViewProvider=e,this.selectDropDownContainer=fs(".monaco-select-box-dropdown-container"),this.selectDropDownContainer.classList.add("monaco-select-box-dropdown-padding"),this.selectionDetailsPane=ds(this.selectDropDownContainer,Sx(".select-box-details-pane"));const t=ds(this.selectDropDownContainer,Sx(".select-box-dropdown-container-width-control")),i=ds(t,Sx(".width-control-div"));this.widthControlElement=document.createElement("span"),this.widthControlElement.className="option-text-width-control",ds(i,this.widthControlElement),this._dropDownPosition=0,this.styleElement=Jn(this.selectDropDownContainer),this.selectDropDownContainer.setAttribute("draggable","true"),this._register(En(this.selectDropDownContainer,os.DRAG_START,(e=>{as(e,!0)})))}registerListeners(){let e;this._register(Mn(this.selectElement,"change",(e=>{this.selected=e.target.selectedIndex,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value}),this.options[this.selected]&&this.options[this.selected].text&&(this.selectElement.title=this.options[this.selected].text)}))),this._register(En(this.selectElement,os.CLICK,(e=>{as(e),this._isVisible?this.hideSelectDropDown(!0):this.showSelectDropDown()}))),this._register(En(this.selectElement,os.MOUSE_DOWN,(e=>{as(e)}))),this._register(En(this.selectElement,"touchstart",(t=>{e=this._isVisible}))),this._register(En(this.selectElement,"touchend",(t=>{as(t),e?this.hideSelectDropDown(!0):this.showSelectDropDown()}))),this._register(En(this.selectElement,os.KEY_DOWN,(e=>{const t=new St(e);let i=!1;Pe?18!==t.keyCode&&16!==t.keyCode&&10!==t.keyCode&&3!==t.keyCode||(i=!0):(18===t.keyCode&&t.altKey||16===t.keyCode&&t.altKey||10===t.keyCode||3===t.keyCode)&&(i=!0),i&&(this.showSelectDropDown(),as(e,!0))})))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){Td(this.options,e)||(this.options=e,this.selectElement.options.length=0,this._hasDetails=!1,this._cachedMaxDetailsHeight=void 0,this.options.forEach(((e,t)=>{this.selectElement.add(this.createOption(e.text,t,e.isDisabled)),"string"==typeof e.description&&(this._hasDetails=!0)}))),void 0!==t&&(this.select(t),this._currentSelection=this.selected)}setOptionsList(){var e;null===(e=this.selectList)||void 0===e||e.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.selectElement.title=this.options[this.selected].text)}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("\n")}styleSelectElement(){var e,t,i;const n=null!==(e=this.styles.selectBackground)&&void 0!==e?e:"",s=null!==(t=this.styles.selectForeground)&&void 0!==t?t:"",o=null!==(i=this.styles.selectBorder)&&void 0!==i?i:"";this.selectElement.style.backgroundColor=n,this.selectElement.style.color=s,this.selectElement.style.borderColor=o}styleList(){var e,t;const i=null!==(e=this.styles.selectBackground)&&void 0!==e?e:"",n=Ss(this.styles.selectListBackground,i);this.selectDropDownListContainer.style.backgroundColor=n,this.selectionDetailsPane.style.backgroundColor=n;const s=null!==(t=this.styles.focusBorder)&&void 0!==t?t:"";this.selectDropDownContainer.style.outlineColor=s,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:()=>{try{e.removeChild(this.selectDropDownContainer)}catch(t){}}}}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=Hn(this.selectElement),i=getComputedStyle(this.selectElement),n=parseFloat(i.getPropertyValue("--dropdown-padding-top"))+parseFloat(i.getPropertyValue("--dropdown-padding-bottom")),s=window.innerHeight-t.top-t.height-(this.selectBoxOptions.minBottomMargin||0),o=t.top-Dx.DEFAULT_DROPDOWN_MINIMUM_TOP_MARGIN,r=this.selectElement.offsetWidth,a=this.setWidthControlElement(this.widthControlElement),l=Math.max(a,Math.round(r)).toString()+"px";this.selectDropDownContainer.style.width=l,this.selectList.getHTMLElement().style.height="",this.selectList.layout();let h=this.selectList.contentHeight;this._hasDetails&&void 0===this._cachedMaxDetailsHeight&&(this._cachedMaxDetailsHeight=this.measureMaxDetailsHeight());const d=this._hasDetails?this._cachedMaxDetailsHeight:0,c=h+n+d,u=Math.floor((s-n-d)/this.getHeight()),g=Math.floor((o-n-d)/this.getHeight());if(e)return!(t.top+t.height>window.innerHeight-22||t.topu&&this.options.length>u?(this._dropDownPosition=1,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectionDetailsPane.classList.remove("border-top"),this.selectionDetailsPane.classList.add("border-bottom")):(this._dropDownPosition=0,this.selectDropDownContainer.removeChild(this.selectDropDownListContainer),this.selectDropDownContainer.removeChild(this.selectionDetailsPane),this.selectDropDownContainer.appendChild(this.selectDropDownListContainer),this.selectDropDownContainer.appendChild(this.selectionDetailsPane),this.selectionDetailsPane.classList.remove("border-bottom"),this.selectionDetailsPane.classList.add("border-top")),!0);if(t.top+t.height>window.innerHeight-22||t.tops&&(h=u*this.getHeight())}else c>o&&(h=g*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+n+"px",this.selectDropDownContainer.style.height=""):this.selectDropDownContainer.style.height=h+n+"px",this.updateDetail(this.selected),this.selectDropDownContainer.style.width=l,this.selectDropDownListContainer.setAttribute("tabindex","0"),this.selectElement.classList.add("synthetic-focus"),this.selectDropDownContainer.classList.add("synthetic-focus"),!0}return!1}setWidthControlElement(e){let t=0;if(e){let i=0,n=0;this.options.forEach(((e,t)=>{const s=e.detail?e.detail.length:0,o=e.decoratorRight?e.decoratorRight.length:0,r=e.text.length+s+o;r>n&&(i=t,n=r)})),e.textContent=this.options[i].text+(this.options[i].decoratorRight?this.options[i].decoratorRight+" ":""),t=zn(e)}return t}createSelectList(e){if(this.selectList)return;this.selectDropDownListContainer=ds(e,Sx(".select-box-dropdown-list-container")),this.listRenderer=new kx,this.selectList=new yx("SelectBoxCustom",this.selectDropDownListContainer,this,[this.listRenderer],{useShadows:!1,verticalScrollMode:3,keyboardSupport:!1,mouseSupport:!1,accessibilityProvider:{getAriaLabel:e=>{let t=e.text;return e.detail&&(t+=`. ${e.detail}`),e.decoratorRight&&(t+=`. ${e.decoratorRight}`),e.description&&(t+=`. ${e.description}`),t},getWidgetAriaLabel:()=>ue(0,"Select Box"),getRole:()=>Pe?"":"option",getWidgetRole:()=>"listbox"}}),this.selectBoxOptions.ariaLabel&&(this.selectList.ariaLabel=this.selectBoxOptions.ariaLabel);const t=this._register(new Ky(this.selectDropDownListContainer,"keydown")),i=B.chain(t.event,(e=>e.filter((()=>this.selectList.length>0)).map((e=>new St(e)))));this._register(B.chain(i,(e=>e.filter((e=>3===e.keyCode))))(this.onEnter,this)),this._register(B.chain(i,(e=>e.filter((e=>2===e.keyCode))))(this.onEnter,this)),this._register(B.chain(i,(e=>e.filter((e=>9===e.keyCode))))(this.onEscape,this)),this._register(B.chain(i,(e=>e.filter((e=>16===e.keyCode))))(this.onUpArrow,this)),this._register(B.chain(i,(e=>e.filter((e=>18===e.keyCode))))(this.onDownArrow,this)),this._register(B.chain(i,(e=>e.filter((e=>12===e.keyCode))))(this.onPageDown,this)),this._register(B.chain(i,(e=>e.filter((e=>11===e.keyCode))))(this.onPageUp,this)),this._register(B.chain(i,(e=>e.filter((e=>14===e.keyCode))))(this.onHome,this)),this._register(B.chain(i,(e=>e.filter((e=>13===e.keyCode))))(this.onEnd,this)),this._register(B.chain(i,(e=>e.filter((e=>e.keyCode>=21&&e.keyCode<=56||e.keyCode>=85&&e.keyCode<=113))))(this.onCharacter,this)),this._register(En(this.selectList.getHTMLElement(),os.POINTER_UP,(e=>this.onPointerUp(e)))),this._register(this.selectList.onMouseOver((e=>void 0!==e.index&&this.selectList.setFocus([e.index])))),this._register(this.selectList.onDidChangeFocus((e=>this.onListFocus(e)))),this._register(En(this.selectDropDownContainer,os.FOCUS_OUT,(e=>{this._isVisible&&!qn(e.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;as(e);const t=e.target;if(!t)return;if(t.classList.contains("slider"))return;const i=t.closest(".monaco-list-row");if(!i)return;const n=Number(i.getAttribute("data-index")),s=i.classList.contains("option-disabled");n>=0&&n{for(let t=0;tthis.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){if(this.selected>0){as(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){as(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){as(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){as(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=gt.toString(e.keyCode);let i=-1;for(let n=0;n{this._register(En(this.selectElement,e,(e=>{this.selectElement.focus()})))})),this._register(Mn(this.selectElement,"click",(e=>{as(e,!0)}))),this._register(Mn(this.selectElement,"change",(e=>{this.selectElement.title=e.target.value,this._onDidSelect.fire({index:e.target.selectedIndex,selected:e.target.value})}))),this._register(Mn(this.selectElement,"keydown",(e=>{let t=!1;Pe?18!==e.keyCode&&16!==e.keyCode&&10!==e.keyCode||(t=!0):(18===e.keyCode&&e.altKey||10===e.keyCode||3===e.keyCode)&&(t=!0),t&&e.stopPropagation()})))}get onDidSelect(){return this._onDidSelect.event}setOptions(e,t){this.options&&Td(this.options,e)||(this.options=e,this.selectElement.options.length=0,this.options.forEach(((e,t)=>{this.selectElement.add(this.createOption(e.text,t,e.isDisabled))}))),void 0!==t&&this.select(t)}select(e){0===this.options.length?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(e)})))}handleActionChangeEvent(e){void 0!==e.enabled&&this.updateEnabled(),void 0!==e.checked&&this.updateChecked(),void 0!==e.class&&this.updateClass(),void 0!==e.label&&(this.updateLabel(),this.updateTooltip()),void 0!==e.tooltip&&this.updateTooltip()}get actionRunner(){return this._actionRunner||(this._actionRunner=this._register(new ja)),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(ZL.addTarget(e));const i=this.options&&this.options.draggable;i&&(e.draggable=!0,ne&&this._register(En(e,os.DRAG_START,(e=>{var t;return null===(t=e.dataTransfer)||void 0===t?void 0:t.setData(aD.TEXT,this._action.label)})))),this._register(En(t,$L.Tap,(e=>this.onClick(e,!0)))),this._register(En(t,os.MOUSE_DOWN,(e=>{i||as(e,!0),this._action.enabled&&0===e.button&&t.classList.add("active")}))),Pe&&this._register(En(t,os.CONTEXT_MENU,(e=>{0===e.button&&!0===e.ctrlKey&&this.onClick(e)}))),this._register(En(t,os.CLICK,(e=>{as(e,!0),this.options&&this.options.isMenu||this.onClick(e)}))),this._register(En(t,os.DBLCLICK,(e=>{as(e,!0)}))),[os.MOUSE_UP,os.MOUSE_OUT].forEach((e=>{this._register(En(t,e,(e=>{as(e),t.classList.remove("active")})))}))}onClick(e,t=!1){var i;as(e,!0);const n=jr(this._context)?(null===(i=this.options)||void 0===i?void 0:i.useEventAsContext)?e:{preserveFocus:t}:this._context;this.actionRunner.run(this._action,n)}focus(){this.element&&(this.element.tabIndex=0,this.element.focus(),this.element.classList.add("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(){}getTooltip(){return this.action.tooltip}updateTooltip(){var e;if(!this.element)return;const t=null!==(e=this.getTooltip())&&void 0!==e?e:"";this.updateAriaLabel(),this.options.hoverDelegate?(this.element.title="",this.customHover?this.customHover.update(t):(this.customHover=dD(this.options.hoverDelegate,this.element,t),this._store.add(this.customHover))):this.element.title=t}updateAriaLabel(){var e;if(this.element){const t=null!==(e=this.getTooltip())&&void 0!==e?e:"";this.element.setAttribute("aria-label",t)}}updateClass(){}updateChecked(){}dispose(){this.element&&(this.element.remove(),this.element=void 0),this._context=void 0,super.dispose()}}class Ix extends Ex{constructor(e,t,i){super(e,t,i),this.options=i,this.options.icon=void 0!==i.icon&&i.icon,this.options.label=void 0===i.label||i.label,this.cssClass=""}render(e){super.render(e),this.element&&(this.label=ds(this.element,fs("a.action-label"))),this.label&&this.label.setAttribute("role",this.getDefaultAriaRole()),this.options.label&&this.options.keybinding&&this.element&&(ds(this.element,fs("span.keybinding")).textContent=this.options.keybinding),this.updateClass(),this.updateLabel(),this.updateTooltip(),this.updateEnabled(),this.updateChecked()}getDefaultAriaRole(){return this._action.id===qa.ID?"presentation":this.options.isMenu?"menuitem":"button"}focus(){this.label&&(this.label.tabIndex=0,this.label.focus())}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=ue(0,"{0} ({1})",e,this.options.keybinding))),null!=e?e:void 0}updateClass(){var e;this.cssClass&&this.label&&this.label.classList.remove(...this.cssClass.split(" ")),this.options.icon?(this.cssClass=this.action.class,this.label&&(this.label.classList.add("codicon"),this.cssClass&&this.label.classList.add(...this.cssClass.split(" "))),this.updateEnabled()):null===(e=this.label)||void 0===e||e.classList.remove("codicon")}updateEnabled(){var e,t;this.action.enabled?(this.label&&(this.label.removeAttribute("aria-disabled"),this.label.classList.remove("disabled")),null===(e=this.element)||void 0===e||e.classList.remove("disabled")):(this.label&&(this.label.setAttribute("aria-disabled","true"),this.label.classList.add("disabled")),null===(t=this.element)||void 0===t||t.classList.add("disabled"))}updateAriaLabel(){var e;if(this.label){const t=null!==(e=this.getTooltip())&&void 0!==e?e:"";this.label.setAttribute("aria-label",t)}}updateChecked(){this.label&&(void 0!==this.action.checked?(this.label.classList.toggle("checked",this.action.checked),this.label.setAttribute("aria-checked",this.action.checked?"true":"false"),this.label.setAttribute("role","checkbox")):(this.label.classList.remove("checked"),this.label.setAttribute("aria-checked",""),this.label.setAttribute("role",this.getDefaultAriaRole())))}}class Mx extends Ex{constructor(e,t,i,n,s,o,r){super(e,t),this.selectBox=new Nx(i,n,s,o,r),this.selectBox.setFocusable(!1),this._register(this.selectBox),this.registerListeners()}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(){var e;null===(e=this.selectBox)||void 0===e||e.focus()}blur(){var e;null===(e=this.selectBox)||void 0===e||e.blur()}render(e){this.selectBox.render(e)}}var Tx=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Rx extends E{constructor(e,t={}){var i,n,s,o,r,a;let l,h;switch(super(),this._actionRunnerDisposables=this._register(new N),this.viewItemDisposables=this._register(new R),this.triggerKeyDown=!1,this.focusable=!0,this._onDidBlur=this._register(new U),this.onDidBlur=this._onDidBlur.event,this._onDidCancel=this._register(new U({onWillAddFirstListener:()=>this.cancelHasListener=!0})),this.onDidCancel=this._onDidCancel.event,this.cancelHasListener=!1,this._onDidRun=this._register(new U),this.onDidRun=this._onDidRun.event,this._onWillRun=this._register(new U),this.onWillRun=this._onWillRun.event,this.options=t,this._context=null!==(i=t.context)&&void 0!==i?i:null,this._orientation=null!==(n=this.options.orientation)&&void 0!==n?n:0,this._triggerKeys={keyDown:null!==(o=null===(s=this.options.triggerKeys)||void 0===s?void 0:s.keyDown)&&void 0!==o&&o,keys:null!==(a=null===(r=this.options.triggerKeys)||void 0===r?void 0:r.keys)&&void 0!==a?a:[3,10]},this.options.actionRunner?this._actionRunner=this.options.actionRunner:(this._actionRunner=new ja,this._actionRunnerDisposables.add(this._actionRunner)),this._actionRunnerDisposables.add(this._actionRunner.onDidRun((e=>this._onDidRun.fire(e)))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun((e=>this._onWillRun.fire(e)))),this.viewItems=[],this.focusedItem=void 0,this.domNode=document.createElement("div"),this.domNode.className="monaco-action-bar",!1!==t.animated&&this.domNode.classList.add("animated"),this._orientation){case 0:l=[15],h=[17];break;case 1:l=[16],h=[18],this.domNode.className+=" vertical"}this._register(En(this.domNode,os.KEY_DOWN,(e=>{const t=new St(e);let i=!0;const n="number"==typeof this.focusedItem?this.viewItems[this.focusedItem]:void 0;l&&(t.equals(l[0])||t.equals(l[1]))?i=this.focusPrevious():h&&(t.equals(h[0])||t.equals(h[1]))?i=this.focusNext():t.equals(9)&&this.cancelHasListener?this._onDidCancel.fire():t.equals(14)?i=this.focusFirst():t.equals(13)?i=this.focusLast():t.equals(2)&&n instanceof Ex&&n.trapsArrowNavigation?i=this.focusNext():this.isTriggerKeyEvent(t)?this._triggerKeys.keyDown?this.doTrigger(t):this.triggerKeyDown=!0:i=!1,i&&(t.preventDefault(),t.stopPropagation())}))),this._register(En(this.domNode,os.KEY_UP,(e=>{const t=new St(e);this.isTriggerKeyEvent(t)?(!this._triggerKeys.keyDown&&this.triggerKeyDown&&(this.triggerKeyDown=!1,this.doTrigger(t)),t.preventDefault(),t.stopPropagation()):(t.equals(2)||t.equals(1026))&&this.updateFocusedItem()}))),this.focusTracker=this._register(hs(this.domNode)),this._register(this.focusTracker.onDidBlur((()=>{Xn()!==this.domNode&&qn(Xn(),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()>=2?this.actionsList.setAttribute("role",this.options.ariaRole||"toolbar"):this.actionsList.setAttribute("role","presentation")}setFocusable(e){if(this.focusable=e,this.focusable){const e=this.viewItems.find((e=>e instanceof Ex&&e.isEnabled()));e instanceof Ex&&e.setFocusable(!0)}else this.viewItems.forEach((e=>{e instanceof Ex&&e.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((e=>this._onDidRun.fire(e)))),this._actionRunnerDisposables.add(this._actionRunner.onWillRun((e=>this._onWillRun.fire(e)))),this.viewItems.forEach((t=>t.actionRunner=e))}getContainer(){return this.domNode}getAction(e){var t;if("number"==typeof e)return null===(t=this.viewItems[e])||void 0===t?void 0:t.action;if(e instanceof HTMLElement){for(;e.parentElement!==this.actionsList;){if(!e.parentElement)return;e=e.parentElement}for(let t=0;t{const i=document.createElement("li");let s;i.className="action-item",i.setAttribute("role","presentation");const o=Object.assign({hoverDelegate:this.options.hoverDelegate},t);this.options.actionViewItemProvider&&(s=this.options.actionViewItemProvider(e,o)),s||(s=new Ix(this.context,e,o)),this.options.allowContextMenu||this.viewItemDisposables.set(s,En(i,os.CONTEXT_MENU,(e=>{as(e,!0)}))),s.actionRunner=this._actionRunner,s.setActionContext(this.context),s.render(i),this.focusable&&s instanceof Ex&&0===this.viewItems.length&&s.setFocusable(!0),null===n||n<0||n>=this.actionsList.children.length?(this.actionsList.appendChild(i),this.viewItems.push(s)):(this.actionsList.insertBefore(i,this.actionsList.children[n]),this.viewItems.splice(n,0,s),n++)})),"number"==typeof this.focusedItem&&this.focus(this.focusedItem),this.refreshRole()}clear(){this.isEmpty()||(this.viewItems=k(this.viewItems),this.viewItemDisposables.clearAndDisposeAll(),Dn(this.actionsList),this.refreshRole())}length(){return this.viewItems.length}isEmpty(){return 0===this.viewItems.length}focus(e){let t,i=!1;if(void 0===e?i=!0:"number"==typeof e?t=e:"boolean"==typeof e&&(i=e),i&&void 0===this.focusedItem){const e=this.viewItems.findIndex((e=>e.isEnabled()));this.focusedItem=-1===e?void 0:e,this.updateFocus(void 0,void 0,!0)}else void 0!==t&&(this.focusedItem=t),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(void 0===this.focusedItem)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===qa.ID));return this.updateFocus(),!0}focusPrevious(e){if(void 0===this.focusedItem)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===qa.ID));return this.updateFocus(!0),!0}updateFocus(e,t,i=!1){var n;void 0===this.focusedItem&&this.actionsList.focus({preventScroll:t}),void 0!==this.previouslyFocusedItem&&this.previouslyFocusedItem!==this.focusedItem&&(null===(n=this.viewItems[this.previouslyFocusedItem])||void 0===n||n.blur());const s=void 0!==this.focusedItem&&this.viewItems[this.focusedItem];if(s){let n=!0;Gr(s.focus)||(n=!1),this.options.focusOnlyEnabledItems&&Gr(s.isEnabled)&&!s.isEnabled()&&(n=!1),s.action.id===qa.ID&&(n=!1),n?(i||this.previouslyFocusedItem!==this.focusedItem)&&(s.focus(e),this.previouslyFocusedItem=this.focusedItem):(this.actionsList.focus({preventScroll:t}),this.previouslyFocusedItem=void 0)}}doTrigger(e){if(void 0===this.focusedItem)return;const t=this.viewItems[this.focusedItem];if(t instanceof Ex){const i=null===t._context||void 0===t._context?e:t._context;this.run(t._action,i)}}run(e,t){return Tx(this,void 0,void 0,(function*(){yield this._actionRunner.run(e,t)}))}dispose(){this._context=void 0,this.viewItems=k(this.viewItems),this.getContainer().remove(),super.dispose()}}class Ax{constructor(e,t,i=t){this.modifierLabels=[null],this.modifierLabels[2]=e,this.modifierLabels[1]=t,this.modifierLabels[3]=i}toLabel(e,t,i){if(0===t.length)return null;const n=[];for(let s=0,o=t.length;s=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},oN=function(e,t){return function(i,n){t(i,n,e)}},rN=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const aN="acceptSelectedCodeAction",lN="previewSelectedCodeAction";class hN{get templateId(){return"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){var n,s;i.text.textContent=null!==(s=null===(n=e.group)||void 0===n?void 0:n.title)&&void 0!==s?s:""}disposeTemplate(e){}}let dN=class{get templateId(){return"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);return{container:e,icon:t,text:i,keybinding:new zx(e,$e)}}renderElement(e,t,i){var n,s,o;if((null===(n=e.group)||void 0===n?void 0:n.icon)?(i.icon.className=ta.asClassName(e.group.icon),e.group.icon.color&&(i.icon.style.color=Sp(e.group.icon.color.id))):(i.icon.className=ta.asClassName(Jr.lightBulb),i.icon.style.color="var(--vscode-editorLightBulb-foreground)"),!e.item||!e.label)return;i.text.textContent=mN(e.label),i.keybinding.set(e.keybinding),function(e,...t){e?_s(...t):vs(...t)}(!!e.keybinding,i.keybinding.element);const r=null===(s=this._keybindingService.lookupKeybinding(aN))||void 0===s?void 0:s.getLabel(),a=null===(o=this._keybindingService.lookupKeybinding(lN))||void 0===o?void 0:o.getLabel();i.container.classList.toggle("option-disabled",e.disabled),e.disabled?i.container.title=e.label:r&&a?this._supportsPreview&&e.canPreview?i.container.title=ue(0,"{0} to apply, {1} to preview",r,a):i.container.title=ue(0,"{0} to apply",r):i.container.title=""}disposeTemplate(e){}};dN=sN([oN(1,WL)],dN);class cN extends UIEvent{constructor(){super("acceptSelectedAction")}}class uN extends UIEvent{constructor(){super("previewSelectedAction")}}function gN(e){if("action"===e.kind)return e.label}let pN=class extends E{constructor(e,t,i,n,s,o){super(),this._delegate=n,this._contextViewService=s,this._keybindingService=o,this._actionLineHeight=24,this._headerLineHeight=26,this.cts=this._register(new jh),this.domNode=document.createElement("div"),this.domNode.classList.add("actionList");const r={getHeight:e=>"header"===e.kind?this._headerLineHeight:this._actionLineHeight,getTemplateId:e=>e.kind};this._list=this._register(new yx(e,this.domNode,r,[new dN(t,this._keybindingService),new hN],{keyboardSupport:!1,typeNavigationEnabled:!0,keyboardNavigationLabelProvider:{getKeyboardNavigationLabel:gN},accessibilityProvider:{getAriaLabel:e=>{if("action"===e.kind){let t=e.label?mN(null==e?void 0:e.label):"";return e.disabled&&(t=ue(0,"{0}, Disabled Reason: {1}",t,e.disabled)),t}return null},getWidgetAriaLabel:()=>ue(0,"Action Widget"),getRole:e=>"action"===e.kind?"option":"separator",getWidgetRole:()=>"listbox"}})),this._list.style(Qx),this._register(this._list.onMouseClick((e=>this.onListClick(e)))),this._register(this._list.onMouseOver((e=>this.onListHover(e)))),this._register(this._list.onDidChangeFocus((()=>this.onFocus()))),this._register(this._list.onDidChangeSelection((e=>this.onListSelection(e)))),this._allMenuItems=i,this._list.splice(0,this._list.length,this._allMenuItems),this._list.length&&this.focusNext()}focusCondition(e){return!e.disabled&&"action"===e.kind}hide(e){this._delegate.onHide(e),this.cts.cancel(),this._contextViewService.hideContextView()}layout(e){const t=this._allMenuItems.filter((e=>"header"===e.kind)).length,i=this._allMenuItems.length*this._actionLineHeight+t*this._headerLineHeight-t*this._actionLineHeight;this._list.layout(i);const n=this._allMenuItems.map(((e,t)=>{const i=document.getElementById(this._list.getElementID(t));if(i){i.style.width="auto";const e=i.getBoundingClientRect().width;return i.style.width="",e}return 0})),s=Math.max(...n,e),o=Math.min(i,.7*document.body.clientHeight);return this._list.layout(o,s),this.domNode.style.height=`${o}px`,this._list.domFocus(),s}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(0===t.length)return;const i=t[0],n=this._list.element(i);if(!this.focusCondition(n))return;const s=e?new uN:new cN;this._list.setSelection([i],s)}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 uN):this._list.setSelection([])}onFocus(){var e,t;this._list.domFocus();const i=this._list.getFocus();if(0===i.length)return;const n=i[0],s=this._list.element(n);null===(t=(e=this._delegate).onFocus)||void 0===t||t.call(e,s.item)}onListHover(e){return rN(this,void 0,void 0,(function*(){const t=e.element;if(t&&t.item&&this.focusCondition(t)){if(this._delegate.onHover&&!t.disabled&&"action"===t.kind){const e=yield this._delegate.onHover(t.item,this.cts.token);t.canPreview=e?e.canPreview:void 0}e.index&&this._list.splice(e.index,1,[t])}this._list.setFocus("number"==typeof e.index?[e.index]:[])}))}onListClick(e){e.element&&this.focusCondition(e.element)&&this._list.setFocus([])}};function mN(e){return e.replace(/\r\n|\r|\n/g," ")}pN=sN([oN(4,Ux),oN(5,WL)],pN);var fN=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},_N=function(e,t){return function(i,n){t(i,n,e)}};Dp("actionBar.toggledBackground",{dark:Vp,light:Vp,hcDark:Vp,hcLight:Vp},ue(0,"Background color for toggled action items in action bar."));const vN={Visible:new Al("codeActionMenuVisible",!1,ue(0,"Whether the action widget list is visible"))},bN=Ba("actionWidgetService");let CN=class extends E{get isVisible(){return vN.Visible.getValue(this._contextKeyService)||!1}constructor(e,t,i){super(),this._contextViewService=e,this._contextKeyService=t,this._instantiationService=i,this._list=this._register(new I)}show(e,t,i,n,s,o,r){const a=vN.Visible.bindTo(this._contextKeyService),l=this._instantiationService.createInstance(pN,e,t,i,n);this._contextViewService.showContextView({getAnchor:()=>s,render:e=>(a.set(!0),this._renderWidget(e,l,null!=r?r:[])),onHide:e=>{a.reset(),this._onWidgetClosed(e)}},o,!1)}acceptSelected(e){var t;null===(t=this._list.value)||void 0===t||t.acceptSelected(e)}focusPrevious(){var e,t;null===(t=null===(e=this._list)||void 0===e?void 0:e.value)||void 0===t||t.focusPrevious()}focusNext(){var e,t;null===(t=null===(e=this._list)||void 0===e?void 0:e.value)||void 0===t||t.focusNext()}hide(){var e;null===(e=this._list.value)||void 0===e||e.hide(),this._list.clear()}_renderWidget(e,t,i){var n;const s=document.createElement("div");if(s.classList.add("action-widget"),e.appendChild(s),this._list.value=t,!this._list.value)throw new Error("List has no value");s.appendChild(this._list.value.domNode);const o=new N,r=document.createElement("div"),a=e.appendChild(r);a.classList.add("context-view-block"),o.add(En(a,os.MOUSE_DOWN,(e=>e.stopPropagation())));const l=document.createElement("div"),h=e.appendChild(l);h.classList.add("context-view-pointerBlock"),o.add(En(h,os.POINTER_MOVE,(()=>h.remove()))),o.add(En(h,os.MOUSE_DOWN,(()=>h.remove())));let d=0;if(i.length){const e=this._createActionBar(".action-widget-action-bar",i);e&&(s.appendChild(e.getContainer().parentElement),o.add(e),d=e.getContainer().offsetWidth)}const c=null===(n=this._list.value)||void 0===n?void 0:n.layout(d);s.style.width=`${c}px`;const u=o.add(hs(e));return o.add(u.onDidBlur((()=>this.hide()))),o}_createActionBar(e,t){if(!t.length)return;const i=fs(e),n=new Rx(i);return n.push(t,{icon:!1,label:!0}),n}_onWidgetClosed(e){var t;null===(t=this._list.value)||void 0===t||t.hide(e)}};CN=fN([_N(0,Ux),_N(1,Ol),_N(2,Fa)],CN),yu(bN,CN,1);const wN=1100;var yN,SN;ah(class extends rh{constructor(){super({id:"hideCodeActionWidget",title:{value:ue(0,"Hide action widget"),original:"Hide action widget"},precondition:vN.Visible,keybinding:{weight:wN,primary:9,secondary:[1033]}})}run(e){e.get(bN).hide()}}),ah(class extends rh{constructor(){super({id:"selectPrevCodeAction",title:{value:ue(0,"Select previous action"),original:"Select previous action"},precondition:vN.Visible,keybinding:{weight:wN,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})}run(e){const t=e.get(bN);t instanceof CN&&t.focusPrevious()}}),ah(class extends rh{constructor(){super({id:"selectNextCodeAction",title:{value:ue(0,"Select next action"),original:"Select next action"},precondition:vN.Visible,keybinding:{weight:wN,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})}run(e){const t=e.get(bN);t instanceof CN&&t.focusNext()}}),ah(class extends rh{constructor(){super({id:aN,title:{value:ue(0,"Accept selected action"),original:"Accept selected action"},precondition:vN.Visible,keybinding:{weight:wN,primary:3,secondary:[2137]}})}run(e){const t=e.get(bN);t instanceof CN&&t.acceptSelected()}}),ah(class extends rh{constructor(){super({id:lN,title:{value:ue(0,"Preview selected action"),original:"Preview selected action"},precondition:vN.Visible,keybinding:{weight:wN,primary:2051}})}run(e){const t=e.get(bN);t instanceof CN&&t.acceptSelected(!0)}}),function(e){e[e.Hint=1]="Hint",e[e.Info=2]="Info",e[e.Warning=4]="Warning",e[e.Error=8]="Error"}(yN||(yN={})),function(e){e.compare=function(e,t){return t-e};const t=Object.create(null);t[e.Error]=ue(0,"Error"),t[e.Warning]=ue(0,"Warning"),t[e.Info]=ue(0,"Info"),e.toString=function(e){return t[e]||""},e.fromSeverity=function(t){switch(t){case gL.Error:return e.Error;case gL.Warning:return e.Warning;case gL.Info:return e.Info;case gL.Ignore:return e.Hint}},e.toSeverity=function(t){switch(t){case e.Error:return gL.Error;case e.Warning:return gL.Warning;case e.Info:return gL.Info;case e.Hint:return gL.Ignore}}}(yN||(yN={})),function(e){const t="";function i(e,i){const n=[t];return e.source?n.push(e.source.replace("\xa6","\\\xa6")):n.push(t),e.code?"string"==typeof e.code?n.push(e.code.replace("\xa6","\\\xa6")):n.push(e.code.value.replace("\xa6","\\\xa6")):n.push(t),void 0!==e.severity&&null!==e.severity?n.push(yN.toString(e.severity)):n.push(t),e.message&&i?n.push(e.message.replace("\xa6","\\\xa6")):n.push(t),void 0!==e.startLineNumber&&null!==e.startLineNumber?n.push(e.startLineNumber.toString()):n.push(t),void 0!==e.startColumn&&null!==e.startColumn?n.push(e.startColumn.toString()):n.push(t),void 0!==e.endLineNumber&&null!==e.endLineNumber?n.push(e.endLineNumber.toString()):n.push(t),void 0!==e.endColumn&&null!==e.endColumn?n.push(e.endColumn.toString()):n.push(t),n.push(t),n.join("\xa6")}e.makeKey=function(e){return i(e,!0)},e.makeKeyOptionalMessage=i}(SN||(SN={}));const LN=Ba("markerService");var kN=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const DN=new Al("supportedCodeAction","");class xN extends E{constructor(e,t,i,n=250){super(),this._editor=e,this._markerService=t,this._signalChange=i,this._delay=n,this._autoTriggerTimer=this._register(new sd),this._register(this._markerService.onMarkerChanged((e=>this._onMarkerChanges(e)))),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((e=>ba(e,t.uri)))&&this._tryAutoTrigger()}_tryAutoTrigger(){this._autoTriggerTimer.cancelAndSet((()=>{this.trigger({type:2,triggerAction:bL.Default})}),this._delay)}_getRangeOfSelectionUnlessWhitespaceEnclosed(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=this._editor.getSelection();if(i.isEmpty()&&2===e.type){const{lineNumber:e,column:n}=i.getPosition(),s=t.getLineContent(e);if(0===s.length)return;if(1===n){if(/\s/.test(s[0]))return}else if(n===t.getLineMaxColumn(e)){if(/\s/.test(s[s.length-1]))return}else if(/\s/.test(s[n-2])&&/\s/.test(s[n-1]))return}return i}}var NN;!function(e){e.Empty={type:0};e.Triggered=class{constructor(e,t,i){this.trigger=e,this.position=t,this._cancellablePromise=i,this.type=1,this.actions=i.catch((e=>{if(d(e))return EN;throw e}))}cancel(){this._cancellablePromise.cancel()}}}(NN||(NN={}));const EN=Object.freeze({allActions:[],validActions:[],dispose:()=>{},documentation:[],hasAutoFix:!1});class IN extends E{constructor(e,t,i,n,s,o){super(),this._editor=e,this._registry=t,this._markerService=i,this._progressService=s,this._configurationService=o,this._codeActionOracle=this._register(new I),this._state=NN.Empty,this._onDidChangeState=this._register(new U),this.onDidChangeState=this._onDidChangeState.event,this._disposed=!1,this._supportedCodeActions=DN.bindTo(n),this._register(this._editor.onDidChangeModel((()=>this._update()))),this._register(this._editor.onDidChangeModelLanguage((()=>this._update()))),this._register(this._registry.onDidChange((()=>this._update()))),this._update()}dispose(){this._disposed||(this._disposed=!0,super.dispose(),this.setState(NN.Empty,!0))}_settingEnabledNearbyQuickfixes(){var e;const t=null===(e=this._editor)||void 0===e?void 0:e.getModel();return!!this._configurationService&&this._configurationService.getValue("editor.codeActionWidget.includeNearbyQuickfixes",{resource:null==t?void 0:t.uri})}_update(){if(this._disposed)return;this._codeActionOracle.value=void 0,this.setState(NN.Empty);const e=this._editor.getModel();if(e&&this._registry.has(e)&&!this._editor.getOption(90)){const t=this._registry.all(e).flatMap((e=>{var t;return null!==(t=e.providedCodeActionKinds)&&void 0!==t?t:[]}));this._supportedCodeActions.set(t.join(" ")),this._codeActionOracle.value=new xN(this._editor,this._markerService,(t=>{var i;if(!t)return void this.setState(NN.Empty);const n=t.selection.getStartPosition(),s=Yh((i=>kN(this,void 0,void 0,(function*(){var n,s,o,r,a,l;if(this._settingEnabledNearbyQuickfixes()&&1===t.trigger.type&&(t.trigger.triggerAction===bL.QuickFix||(null===(s=null===(n=t.trigger.filter)||void 0===n?void 0:n.include)||void 0===s?void 0:s.contains(wL.QuickFix)))){const n=yield OL(this._registry,e,t.selection,t.trigger,_L.None,i);if(i.isCancellationRequested)return EN;if(!(null===(o=n.validActions)||void 0===o?void 0:o.some((e=>!!e.action.kind&&wL.QuickFix.contains(new wL(e.action.kind)))))){const s=this._markerService.read({resource:e.uri});if(s.length>0){const o=t.selection.getPosition();let h=o,d=Number.MAX_VALUE,c=!1;for(const e of s){const t=e.endColumn,i=e.endLineNumber,n=e.startLineNumber;(i===o.lineNumber||n===o.lineNumber)&&Math.abs(o.column-t){e.highlightRange=e.action.isPreferred})),c.push(...d.validActions)),{validActions:c,allActions:n.allActions,documentation:n.documentation,hasAutoFix:n.hasAutoFix,dispose:()=>{n.dispose()}}}}}}return OL(this._registry,e,t.selection,t.trigger,_L.None,i)}))));1===t.trigger.type&&(null===(i=this._progressService)||void 0===i||i.showWhile(s,250)),this.setState(new NN.Triggered(t.trigger,n,s))}),void 0),this._codeActionOracle.value.trigger({type:2,triggerAction:bL.Default})}else this._supportedCodeActions.reset()}trigger(e){var t;null===(t=this._codeActionOracle.value)||void 0===t||t.trigger(e)}setState(e,t){e!==this._state&&(1===this._state.type&&this._state.cancel(),this._state=e,t||this._disposed||this._onDidChangeState.fire(e))}}var MN,TN=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},RN=function(e,t){return function(i,n){t(i,n,e)}},AN=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let ON=MN=class extends E{static get(e){return e.getContribution(MN.ID)}constructor(e,t,i,n,s,o,r,a,l,h){super(),this._commandService=r,this._configurationService=a,this._actionWidgetService=l,this._instantiationService=h,this._activeCodeActions=this._register(new I),this._showDisabled=!1,this._disposed=!1,this._editor=e,this._model=this._register(new IN(this._editor,s.codeActionProvider,t,i,o,a)),this._register(this._model.onDidChangeState((e=>this.update(e)))),this._lightBulbWidget=new Zs((()=>{const e=this._editor.getContribution(ek.ID);return e&&this._register(e.onClick((e=>this.showCodeActionList(e.actions,e,{includeDisabledActions:!1,fromLightbulb:!0})))),e})),this._resolver=n.createInstance(UL),this._register(this._editor.onDidLayoutChange((()=>this._actionWidgetService.hide())))}dispose(){this._disposed=!0,super.dispose()}showCodeActions(e,t,i){return this.showCodeActionList(t,i,{includeDisabledActions:!1,fromLightbulb:!1})}manualTriggerAtCurrentPosition(e,t,i,n){var s;if(!this._editor.hasModel())return;null===(s=oD.get(this._editor))||void 0===s||s.closeMessage();const o=this._editor.getPosition();this._trigger({type:1,triggerAction:t,filter:i,autoApply:n,context:{notAvailableMessage:e,position:o}})}_trigger(e){return this._model.trigger(e)}_applyCodeAction(e,t,i){return AN(this,void 0,void 0,(function*(){try{yield this._instantiationService.invokeFunction(BL,e,FL.FromCodeActions,{preview:i,editor:this._editor})}finally{t&&this._trigger({type:2,triggerAction:bL.QuickFix,filter:{}})}}))}update(e){var t,i,n,s,o,a,l;return AN(this,void 0,void 0,(function*(){if(1!==e.type)return void(null===(t=this._lightBulbWidget.rawValue)||void 0===t||t.hide());let h;try{h=yield e.actions}catch(Mre){return void r(Mre)}if(!this._disposed)if(null===(i=this._lightBulbWidget.value)||void 0===i||i.update(h,e.trigger,e.position),1===e.trigger.type){if(null===(n=e.trigger.filter)||void 0===n?void 0:n.include){const t=this.tryGetValidActionToApply(e.trigger,h);if(t){try{null===(s=this._lightBulbWidget.value)||void 0===s||s.hide(),yield this._applyCodeAction(t,!1,!1)}finally{h.dispose()}return}if(e.trigger.context){const t=this.getInvalidActionThatWouldHaveBeenApplied(e.trigger,h);if(t&&t.action.disabled)return null===(o=oD.get(this._editor))||void 0===o||o.showMessage(t.action.disabled,e.trigger.context.position),void h.dispose()}}const t=!!(null===(a=e.trigger.filter)||void 0===a?void 0:a.include);if(e.trigger.context&&(!h.allActions.length||!t&&!h.validActions.length))return null===(l=oD.get(this._editor))||void 0===l||l.showMessage(e.trigger.context.notAvailableMessage,e.trigger.context.position),this._activeCodeActions.value=h,void h.dispose();this._activeCodeActions.value=h,this.showCodeActionList(h,this.toCoords(e.position),{includeDisabledActions:t,fromLightbulb:!1})}else this._actionWidgetService.isVisible?h.dispose():this._activeCodeActions.value=h}))}getInvalidActionThatWouldHaveBeenApplied(e,t){if(t.allActions.length)return"first"===e.autoApply&&0===t.validActions.length||"ifSingle"===e.autoApply&&1===t.allActions.length?t.allActions.find((({action:e})=>e.disabled)):void 0}tryGetValidActionToApply(e,t){if(t.validActions.length)return"first"===e.autoApply&&t.validActions.length>0||"ifSingle"===e.autoApply&&1===t.validActions.length?t.validActions[0]:void 0}showCodeActionList(e,t,i){return AN(this,void 0,void 0,(function*(){const n=this._editor.createDecorationsCollection(),s=this._editor.getDomNode();if(!s)return;const o=i.includeDisabledActions&&(this._showDisabled||0===e.validActions.length)?e.allActions:e.validActions;if(!o.length)return;const r=Va.isIPosition(t)?this.toCoords(t):t,a={onSelect:(e,t)=>AN(this,void 0,void 0,(function*(){this._applyCodeAction(e,!0,!!t),this._actionWidgetService.hide(),n.clear()})),onHide:()=>{var e;null===(e=this._editor)||void 0===e||e.focus(),n.clear()},onHover:(e,t)=>AN(this,void 0,void 0,(function*(){var i;if(yield e.resolve(t),!t.isCancellationRequested)return{canPreview:!!(null===(i=e.action.edit)||void 0===i?void 0:i.edits.length)}})),onFocus:e=>{var t,i;if(e&&e.highlightRange&&e.action.diagnostics){const s=[{range:e.action.diagnostics[0],options:MN.DECORATION}];n.set(s);const o=e.action.diagnostics[0];Fs(ue(0,"Context: {0} at line {1} and column {2}.",null===(i=null===(t=this._editor.getModel())||void 0===t?void 0:t.getWordAtPosition({lineNumber:o.startLineNumber,column:o.startColumn}))||void 0===i?void 0:i.word,o.startLineNumber,o.startColumn))}else n.clear()}};this._actionWidgetService.show("codeActionWidget",!0,function(e,t,i){if(!t)return e.map((e=>{var t;return{kind:"action",item:e,group:KL,disabled:!!e.action.disabled,label:e.action.disabled||e.action.title,canPreview:!!(null===(t=e.action.edit)||void 0===t?void 0:t.edits.length)}}));const n=jL.map((e=>({group:e,actions:[]})));for(const o of e){const e=o.action.kind?new wL(o.action.kind):wL.None;for(const t of n)if(t.group.kind.contains(e)){t.actions.push(o);break}}const s=[];for(const o of n)if(o.actions.length){s.push({kind:"header",group:o.group});for(const e of o.actions)s.push({kind:"action",item:e,group:o.group,label:e.action.title,disabled:!!e.action.disabled,keybinding:i(e.action)})}return s}(o,this._shouldShowHeaders(),this._resolver.getResolver()),a,r,s,this._getActionBarActions(e,t,i))}))}toCoords(e){if(!this._editor.hasModel())return{x:0,y:0};this._editor.revealPosition(e,1),this._editor.render();const t=this._editor.getScrolledVisiblePosition(e),i=Hn(this._editor.getDomNode());return{x:i.left+t.left,y:i.top+t.top+t.height}}_shouldShowHeaders(){var e;const t=null===(e=this._editor)||void 0===e?void 0:e.getModel();return this._configurationService.getValue("editor.codeActionWidget.showHeaders",{resource:null==t?void 0:t.uri})}_getActionBarActions(e,t,i){if(i.fromLightbulb)return[];const n=e.documentation.map((e=>{var t;return{id:e.id,label:e.title,tooltip:null!==(t=e.tooltip)&&void 0!==t?t:"",class:void 0,enabled:!0,run:()=>{var t;return this._commandService.executeCommand(e.id,...null!==(t=e.arguments)&&void 0!==t?t:[])}}}));return i.includeDisabledActions&&e.validActions.length>0&&e.allActions.length!==e.validActions.length&&n.push(this._showDisabled?{id:"hideMoreActions",label:ue(0,"Hide Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!1,this.showCodeActionList(e,t,i))}:{id:"showMoreActions",label:ue(0,"Show Disabled"),enabled:!0,tooltip:"",class:void 0,run:()=>(this._showDisabled=!0,this.showCodeActionList(e,t,i))}),n}};function PN(e){return pl.regex(DN.keys()[0],new RegExp("(\\s|^)"+eo(e.value)+"\\b"))}ON.ID="editor.contrib.codeActionController",ON.DECORATION=Iw.register({description:"quickfix-highlight",className:"quickfix-edit-highlight"}),ON=MN=TN([RN(1,LN),RN(2,Ol),RN(3,Fa),RN(4,oL),RN(5,vL),RN(6,Ya),RN(7,pu),RN(8,bN),RN(9,Fa)],ON),H_(((e,t)=>{((e,i)=>{i&&t.addRule(`.monaco-editor ${e} { background-color: ${i}; }`)})(".quickfix-edit-highlight",e.getColor(Um));const i=e.getColor(qm);i&&t.addRule(`.monaco-editor .quickfix-edit-highlight { border: 1px ${A_(e.type)?"dotted":"solid"} ${i}; box-sizing: border-box; }`)}));const FN={type:"object",defaultSnippets:[{body:{kind:""}}],properties:{kind:{type:"string",description:ue(0,"Kind of the code action to run.")},apply:{type:"string",description:ue(0,"Controls when the returned actions are applied."),default:"ifSingle",enum:["first","ifSingle","never"],enumDescriptions:[ue(0,"Always apply the first returned code action."),ue(0,"Apply the first returned code action if it is the only one."),ue(0,"Do not apply the returned code actions.")]},preferred:{type:"boolean",default:!1,description:ue(0,"Controls if only preferred code actions should be returned.")}}};function BN(e,t,i,n,s=bL.Default){if(e.hasModel()){const o=ON.get(e);null==o||o.manualTriggerAtCurrentPosition(t,s,i,n)}}Dh(ON.ID,ON,3),Dh(ek.ID,ek,4),Lh(class extends bh{constructor(){super({id:xL,label:ue(0,"Quick Fix..."),alias:"Quick Fix...",precondition:pl.and(Oh.writable,Oh.hasCodeActionsProvider),kbOpts:{kbExpr:Oh.textInputFocus,primary:2137,weight:100}})}run(e,t){return BN(t,ue(0,"No code actions available"),void 0,void 0,bL.QuickFix)}}),Lh(class extends bh{constructor(){super({id:EL,label:ue(0,"Refactor..."),alias:"Refactor...",precondition:pl.and(Oh.writable,Oh.hasCodeActionsProvider),kbOpts:{kbExpr:Oh.textInputFocus,primary:3120,mac:{primary:1328},weight:100},contextMenuOpts:{group:"1_modification",order:2,when:pl.and(Oh.writable,PN(wL.Refactor))},description:{description:"Refactor...",args:[{name:"args",schema:FN}]}})}run(e,t,i){const n=SL.fromUser(i,{kind:wL.Refactor,apply:"never"});return BN(t,"string"==typeof(null==i?void 0:i.kind)?n.preferred?ue(0,"No preferred refactorings for '{0}' available",i.kind):ue(0,"No refactorings for '{0}' available",i.kind):n.preferred?ue(0,"No preferred refactorings available"):ue(0,"No refactorings available"),{include:wL.Refactor.contains(n.kind)?n.kind:wL.None,onlyIncludePreferredActions:n.preferred},n.apply,bL.Refactor)}}),Lh(class extends bh{constructor(){super({id:IL,label:ue(0,"Source Action..."),alias:"Source Action...",precondition:pl.and(Oh.writable,Oh.hasCodeActionsProvider),contextMenuOpts:{group:"1_modification",order:2.1,when:pl.and(Oh.writable,PN(wL.Source))},description:{description:"Source Action...",args:[{name:"args",schema:FN}]}})}run(e,t,i){const n=SL.fromUser(i,{kind:wL.Source,apply:"never"});return BN(t,"string"==typeof(null==i?void 0:i.kind)?n.preferred?ue(0,"No preferred source actions for '{0}' available",i.kind):ue(0,"No source actions for '{0}' available",i.kind):n.preferred?ue(0,"No preferred source actions available"):ue(0,"No source actions available"),{include:wL.Source.contains(n.kind)?n.kind:wL.None,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply,bL.SourceAction)}}),Lh(class extends bh{constructor(){super({id:ML,label:ue(0,"Organize Imports"),alias:"Organize Imports",precondition:pl.and(Oh.writable,PN(wL.SourceOrganizeImports)),kbOpts:{kbExpr:Oh.textInputFocus,primary:1581,weight:100}})}run(e,t){return BN(t,ue(0,"No organize imports action available"),{include:wL.SourceOrganizeImports,includeSourceActions:!0},"ifSingle",bL.OrganizeImports)}}),Lh(class extends bh{constructor(){super({id:NL,label:ue(0,"Auto Fix..."),alias:"Auto Fix...",precondition:pl.and(Oh.writable,PN(wL.QuickFix)),kbOpts:{kbExpr:Oh.textInputFocus,primary:1625,mac:{primary:2649},weight:100}})}run(e,t){return BN(t,ue(0,"No auto fixes available"),{include:wL.QuickFix,onlyIncludePreferredActions:!0},"ifSingle",bL.AutoFix)}}),Lh(class extends bh{constructor(){super({id:TL,label:ue(0,"Fix All"),alias:"Fix All",precondition:pl.and(Oh.writable,PN(wL.SourceFixAll))})}run(e,t){return BN(t,ue(0,"No fix all action available"),{include:wL.SourceFixAll,includeSourceActions:!0},"ifSingle",bL.FixAll)}}),Sh(new class extends vh{constructor(){super({id:DL,precondition:pl.and(Oh.writable,Oh.hasCodeActionsProvider),description:{description:"Trigger a code action",args:[{name:"args",schema:FN}]}})}runEditorCommand(e,t,i){const n=SL.fromUser(i,{kind:wL.Empty,apply:"ifSingle"});return BN(t,"string"==typeof(null==i?void 0:i.kind)?n.preferred?ue(0,"No preferred code actions for '{0}' available",i.kind):ue(0,"No code actions for '{0}' available",i.kind):n.preferred?ue(0,"No preferred code actions available"):ue(0,"No code actions available"),{include:n.kind,includeSourceActions:!0,onlyIncludePreferredActions:n.preferred},n.apply)}}),jl.as(xu).registerConfiguration(Object.assign(Object.assign({},YS),{properties:{"editor.codeActionWidget.showHeaders":{type:"boolean",scope:5,description:ue(0,"Enable/disable showing group headers in the Code Action menu."),default:!0}}})),jl.as(xu).registerConfiguration(Object.assign(Object.assign({},YS),{properties:{"editor.codeActionWidget.includeNearbyQuickfixes":{type:"boolean",scope:5,description:ue(0,"Enable/disable showing nearest quickfix within a line when not currently on a diagnostic."),default:!1}}}));class WN{static capture(e){if(0===e.getScrollTop()||e.hasPendingScrollAnimation())return new WN(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 s=e.getTopForPosition(t.lineNumber,t.column);i=e.getScrollTop()-s}return new WN(e.getScrollTop(),e.getContentHeight(),t,i,e.getPosition())}constructor(e,t,i,n,s){this._initialScrollTop=e,this._initialContentHeight=t,this._visiblePosition=i,this._visiblePositionScrollDelta=n,this._cursorPosition=s}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)}}var VN=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class HN{constructor(){this.lenses=[],this._disposables=new N}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})}}function zN(e,t,i){return VN(this,void 0,void 0,(function*(){const n=e.ordered(t),s=new Map,o=new HN,r=n.map(((e,n)=>VN(this,void 0,void 0,(function*(){s.set(e,n);try{const n=yield Promise.resolve(e.provideCodeLenses(t,i));n&&o.add(n,e)}catch(r){a(r)}}))));return yield Promise.all(r),o.lenses=o.lenses.sort(((e,t)=>e.symbol.range.startLineNumbert.symbol.range.startLineNumber?1:s.get(e.provider)s.get(t.provider)?1:e.symbol.range.startColumnt.symbol.range.startColumn?1:0)),o}))}Xa.registerCommand("_executeCodeLensProvider",(function(e,...t){let[i,n]=t;qr(an.isUri(i)),qr("number"==typeof n||!n);const{codeLensProvider:s}=e.get(oL),o=e.get(Ha).getModel(i);if(!o)throw u();const r=[],a=new N;return zN(s,o,Uh.None).then((e=>{a.add(e);const t=[];for(const i of e.lenses)null==n||Boolean(i.symbol.command)?r.push(i.symbol):n-- >0&&i.provider.resolveCodeLens&&t.push(Promise.resolve(i.provider.resolveCodeLens(o,i.symbol,Uh.None)).then((e=>r.push(e||i.symbol))));return Promise.all(t)})).then((()=>r)).finally((()=>{setTimeout((()=>a.dispose()),100)}))}));var UN,KN,jN=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};!function(e){e[e.STORAGE_DOES_NOT_EXIST=0]="STORAGE_DOES_NOT_EXIST",e[e.STORAGE_IN_MEMORY=1]="STORAGE_IN_MEMORY"}(UN||(UN={})),function(e){e[e.None=0]="None",e[e.Initialized=1]="Initialized",e[e.Closed=2]="Closed"}(KN||(KN={}));class qN extends E{constructor(e,t=Object.create(null)){super(),this.database=e,this.options=t,this._onDidChangeStorage=this._register(new j),this.onDidChangeStorage=this._onDidChangeStorage.event,this.state=KN.None,this.cache=new Map,this.flushDelayer=this._register(new ed(qN.DEFAULT_FLUSH_DELAY)),this.pendingDeletes=new Set,this.pendingInserts=new Map,this.whenFlushedCallbacks=[],this.registerListeners()}registerListeners(){this._register(this.database.onDidChangeItemsExternal((e=>this.onDidChangeItemsExternal(e))))}onDidChangeItemsExternal(e){var t,i;this._onDidChangeStorage.pause();try{null===(t=e.changed)||void 0===t||t.forEach(((e,t)=>this.acceptExternal(t,e))),null===(i=e.deleted)||void 0===i||i.forEach((e=>this.acceptExternal(e,void 0)))}finally{this._onDidChangeStorage.resume()}}acceptExternal(e,t){if(this.state===KN.Closed)return;let i=!1;if(jr(t))i=this.cache.delete(e);else{this.cache.get(e)!==t&&(this.cache.set(e,t),i=!0)}i&&this._onDidChangeStorage.fire({key:e,external:!0})}get(e,t){const i=this.cache.get(e);return jr(i)?t:i}getBoolean(e,t){const i=this.get(e);return jr(i)?t:"true"===i}getNumber(e,t){const i=this.get(e);return jr(i)?t:parseInt(i,10)}set(e,t,i=!1){return jN(this,void 0,void 0,(function*(){if(this.state===KN.Closed)return;if(jr(t))return this.delete(e,i);const n=Br(t)||Array.isArray(t)?(s=t,JSON.stringify(s,mk)):String(t);var s;return this.cache.get(e)!==n?(this.cache.set(e,n),this.pendingInserts.set(e,n),this.pendingDeletes.delete(e),this._onDidChangeStorage.fire({key:e,external:i}),this.doFlush()):void 0}))}delete(e,t=!1){return jN(this,void 0,void 0,(function*(){if(this.state===KN.Closed)return;return this.cache.delete(e)?(this.pendingDeletes.has(e)||this.pendingDeletes.add(e),this.pendingInserts.delete(e),this._onDidChangeStorage.fire({key:e,external:t}),this.doFlush()):void 0}))}get hasPending(){return this.pendingInserts.size>0||this.pendingDeletes.size>0}flushPending(){return jN(this,void 0,void 0,(function*(){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((()=>{var e;if(!this.hasPending)for(;this.whenFlushedCallbacks.length;)null===(e=this.whenFlushedCallbacks.pop())||void 0===e||e()}))}))}doFlush(e){return jN(this,void 0,void 0,(function*(){return this.options.hint===UN.STORAGE_IN_MEMORY?this.flushPending():this.flushDelayer.trigger((()=>this.flushPending()),e)}))}}qN.DEFAULT_FLUSH_DELAY=100;class $N{constructor(){this.onDidChangeItemsExternal=B.None,this.items=new Map}updateItems(e){var t,i;return jN(this,void 0,void 0,(function*(){null===(t=e.insert)||void 0===t||t.forEach(((e,t)=>this.items.set(t,e))),null===(i=e.delete)||void 0===i||i.forEach((e=>this.items.delete(e)))}))}}const GN="__$__targetStorageMarker",ZN=Ba("storageService");var YN;!function(e){e[e.NONE=0]="NONE",e[e.SHUTDOWN=1]="SHUTDOWN"}(YN||(YN={}));class XN extends E{constructor(e={flushInterval:XN.DEFAULT_FLUSH_INTERVAL}){super(),this.options=e,this._onDidChangeValue=this._register(new j),this._onDidChangeTarget=this._register(new j),this._onWillSaveState=this._register(new U),this.onWillSaveState=this._onWillSaveState.event,this._workspaceKeyTargets=void 0,this._profileKeyTargets=void 0,this._applicationKeyTargets=void 0}onDidChangeValue(e,t,i){return B.filter(this._onDidChangeValue.event,(i=>i.scope===e&&(void 0===t||i.key===t)),i)}emitDidChangeValue(e,t){const{key:i,external:n}=t;if(i===GN){switch(e){case-1:this._applicationKeyTargets=void 0;break;case 0:this._profileKeyTargets=void 0;break;case 1:this._workspaceKeyTargets=void 0}this._onDidChangeTarget.fire({scope:e})}else this._onDidChangeValue.fire({scope:e,key:i,target:this.getKeyTargets(e)[i],external:n})}get(e,t,i){var n;return null===(n=this.getStorage(t))||void 0===n?void 0:n.get(e,i)}getBoolean(e,t,i){var n;return null===(n=this.getStorage(t))||void 0===n?void 0:n.getBoolean(e,i)}getNumber(e,t,i){var n;return null===(n=this.getStorage(t))||void 0===n?void 0:n.getNumber(e,i)}store(e,t,i,n,s=!1){jr(t)?this.remove(e,i,s):this.withPausedEmitters((()=>{var o;this.updateKeyTarget(e,i,n),null===(o=this.getStorage(i))||void 0===o||o.set(e,t,s)}))}remove(e,t,i=!1){this.withPausedEmitters((()=>{var n;this.updateKeyTarget(e,t,void 0),null===(n=this.getStorage(t))||void 0===n||n.delete(e,i)}))}withPausedEmitters(e){this._onDidChangeValue.pause(),this._onDidChangeTarget.pause();try{e()}finally{this._onDidChangeValue.resume(),this._onDidChangeTarget.resume()}}updateKeyTarget(e,t,i,n=!1){var s,o;const r=this.getKeyTargets(t);"number"==typeof i?r[e]!==i&&(r[e]=i,null===(s=this.getStorage(t))||void 0===s||s.set(GN,JSON.stringify(r),n)):"number"==typeof r[e]&&(delete r[e],null===(o=this.getStorage(t))||void 0===o||o.set(GN,JSON.stringify(r),n))}get workspaceKeyTargets(){return this._workspaceKeyTargets||(this._workspaceKeyTargets=this.loadKeyTargets(1)),this._workspaceKeyTargets}get profileKeyTargets(){return this._profileKeyTargets||(this._profileKeyTargets=this.loadKeyTargets(0)),this._profileKeyTargets}get applicationKeyTargets(){return this._applicationKeyTargets||(this._applicationKeyTargets=this.loadKeyTargets(-1)),this._applicationKeyTargets}getKeyTargets(e){switch(e){case-1:return this.applicationKeyTargets;case 0:return this.profileKeyTargets;default:return this.workspaceKeyTargets}}loadKeyTargets(e){const t=this.getStorage(e);return t?function(e){const t=e.get(GN);if(t)try{return JSON.parse(t)}catch(i){}return Object.create(null)}(t):Object.create(null)}}XN.DEFAULT_FLUSH_INTERVAL=6e4;var QN=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},JN=function(e,t){return function(i,n){t(i,n,e)}};const eE=Ba("ICodeLensCache");class tE{constructor(e,t){this.lineCount=e,this.data=t}}let iE=class{constructor(e){this._fakeProvider=new class{provideCodeLenses(){throw new Error("not supported")}},this._cache=new js(20,.75);ad((()=>e.remove("codelens/cache",1)));const t="codelens/cache2",i=e.get(t,1,"{}");this._deserialize(i),B.once(e.onWillSaveState)((i=>{i.reason===YN.SHUTDOWN&&e.store(t,this._serialize(),1,1)}))}put(e,t){const i=t.lenses.map((e=>{var t;return{range:e.symbol.range,command:e.symbol.command&&{id:"",title:null===(t=e.symbol.command)||void 0===t?void 0:t.title}}})),n=new HN;n.add({lenses:i,dispose:()=>{}},this._fakeProvider);const s=new tE(e.getLineCount(),n);this._cache.set(e.uri.toString(),s)}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 e of i.data.lenses)n.add(e.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 e in t){const i=t[e],n=[];for(const e of i.lines)n.push({range:new Rh(e,1,e,11)});const s=new HN;s.add({lenses:n,dispose(){}},this._fakeProvider),this._cache.set(e,new tE(i.lineCount,s))}}catch(ge){}}};iE=QN([JN(0,ZN)],iE),yu(eE,iE,1);class nE{constructor(e,t,i){this.afterColumn=1073741824,this.afterLineNumber=e,this.heightInPx=t,this._onHeight=i,this.suppressMouseDown=!0,this.domNode=document.createElement("div")}onComputedHeight(e){void 0===this._lastHeight?this._lastHeight=e:this._lastHeight!==e&&(this._lastHeight=e,this._onHeight())}isVisible(){return 0!==this._lastHeight&&this.domNode.hasAttribute("monaco-visible-view-zone")}}class sE{constructor(e,t){this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this._commands=new Map,this._isEmpty=!0,this._editor=e,this._id="codelens.widget-"+sE._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 s=0;s{e.symbol.command&&a.push(e.symbol),i.addDecoration({range:e.symbol.range,options:rE},(e=>this._decorationIds[t]=e)),r=r?Rh.plusRange(r,e.symbol.range):Rh.lift(e.symbol.range)})),this._viewZone=new nE(r.startLineNumber-1,s,o),this._viewZoneId=n.addZone(this._viewZone),a.length>0&&(this._createContentWidgetIfNecessary(),this._contentWidget.withCommands(a,!1))}_createContentWidgetIfNecessary(){this._contentWidget?this._editor.layoutContentWidget(this._contentWidget):(this._contentWidget=new sE(this._editor,this._viewZone.afterLineNumber+1),this._editor.addContentWidget(this._contentWidget))}dispose(e,t){this._decorationIds.forEach(e.removeDecoration,e),this._decorationIds=[],null==t||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||Rh.isEmpty(n.range)!==i.isEmpty())}))}updateCodeLensSymbols(e,t){this._decorationIds.forEach(t.removeDecoration,t),this._decorationIds=[],this._data=e,this._data.forEach(((e,i)=>{t.addDecoration({range:e.symbol.range,options:rE},(e=>this._decorationIds[i]=e))}))}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;tgE(t,e)),n)):function(e,t){return t=pE(181387,t),Object.keys(e).sort().reduce(((t,i)=>(t=mE(i,t),gE(e[i],t))),t)}(e,t);case"string":return mE(e,t);case"boolean":return function(e,t){return pE(e?433:863,t)}(e,t);case"number":return pE(e,t);case"undefined":return pE(937,t);default:return pE(617,t)}var i,n}function pE(e,t){return(t<<5)-t+e|0}function mE(e,t){t=pE(149417,t);for(let i=0,n=e.length;i>>n)>>>0}function _E(e,t=0,i=e.byteLength,n=0){for(let s=0;se.toString(16).padStart(2,"0"))).join(""):function(e,t,i="0"){for(;e.length>>0).toString(16),t/4)}class bE{constructor(){this._h0=1732584193,this._h1=4023233417,this._h2=2562383102,this._h3=271733878,this._h4=3285377520,this._buff=new Uint8Array(67),this._buffDV=new DataView(this._buff.buffer),this._buffLen=0,this._totalLen=0,this._leftoverHighSurrogate=0,this._finished=!1}update(e){const t=e.length;if(0===t)return;const i=this._buff;let n,s,o=this._buffLen,r=this._leftoverHighSurrogate;for(0!==r?(n=r,s=-1,r=0):(n=e.charCodeAt(0),s=0);;){let a=n;if(wo(n)){if(!(s+1>>6,e[t++]=128|(63&i)>>>0):i<65536?(e[t++]=224|(61440&i)>>>12,e[t++]=128|(4032&i)>>>6,e[t++]=128|(63&i)>>>0):(e[t++]=240|(1835008&i)>>>18,e[t++]=128|(258048&i)>>>12,e[t++]=128|(4032&i)>>>6,e[t++]=128|(63&i)>>>0),t>=64&&(this._step(),t-=64,this._totalLen+=64,e[0]=e[64],e[1]=e[65],e[2]=e[66]),t}digest(){return this._finished||(this._finished=!0,this._leftoverHighSurrogate&&(this._leftoverHighSurrogate=0,this._buffLen=this._push(this._buff,this._buffLen,65533)),this._totalLen+=this._buffLen,this._wrapUp()),vE(this._h0)+vE(this._h1)+vE(this._h2)+vE(this._h3)+vE(this._h4)}_wrapUp(){this._buff[this._buffLen++]=128,_E(this._buff,this._buffLen),this._buffLen>56&&(this._step(),_E(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=bE._bigBlock32,t=this._buffDV;for(let d=0;d<64;d+=4)e.setUint32(d,t.getUint32(d,!1),!1);for(let d=64;d<320;d+=4)e.setUint32(d,fE(e.getUint32(d-12,!1)^e.getUint32(d-32,!1)^e.getUint32(d-56,!1)^e.getUint32(d-64,!1),1),!1);let i,n,s,o=this._h0,r=this._h1,a=this._h2,l=this._h3,h=this._h4;for(let d=0;d<80;d++)d<20?(i=r&a|~r&l,n=1518500249):d<40?(i=r^a^l,n=1859775393):d<60?(i=r&a|r&l|a&l,n=2400959708):(i=r^a^l,n=3395469782),s=fE(o,5)+i+h+n+e.getUint32(4*d,!1)&4294967295,h=l,l=a,a=fE(r,30),r=o,o=s;this._h0=this._h0+o&4294967295,this._h1=this._h1+r&4294967295,this._h2=this._h2+a&4294967295,this._h3=this._h3+l&4294967295,this._h4=this._h4+h&4294967295}}bE._bigBlock32=new DataView(new ArrayBuffer(320));const CE=Ba("environmentService");var wE=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},yE=function(e,t){return function(i,n){t(i,n,e)}};const SE=Ba("ILanguageFeatureDebounceService");var LE;!function(e){const t=new WeakMap;let i=0;e.of=function(e){let n=t.get(e);return void 0===n&&(n=++i,t.set(e,n)),n}}(LE||(LE={}));class kE{constructor(e){this._default=e}get(e){return this._default}update(e,t){return this._default}default(){return this._default}}class DE{constructor(e,t,i,n,s,o){this._logService=e,this._name=t,this._registry=i,this._default=n,this._min=s,this._max=o,this._cache=new js(50,.7)}_key(e){return e.id+this._registry.all(e).reduce(((e,t)=>gE(LE.of(t),e)),0)}get(e){const t=this._key(e),i=this._cache.get(t);return i?uD(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 pD(6),this._cache.set(i,n));const s=uD(n.update(t),this._min,this._max);return $k(e.uri,"output")||this._logService.trace(`[DEBOUNCE: ${this._name}] for ${e.uri.toString()} is ${s}ms`),s}_overall(){const e=new gD;for(const[,t]of this._cache)e.update(t.value);return e.value}default(){return uD(0|this._overall()||this._default,this._min,this._max)}}let xE=class{constructor(e,t){this._logService=e,this._data=new Map,this._isDev=t.isExtensionDevelopment||!t.isBuilt}for(e,t,i){var n,s,o;const r=null!==(n=null==i?void 0:i.min)&&void 0!==n?n:50,a=null!==(s=null==i?void 0:i.max)&&void 0!==s?s:Math.pow(r,2),l=null!==(o=null==i?void 0:i.key)&&void 0!==o?o:void 0,h=`${LE.of(e)},${r}${l?","+l:""}`;let d=this._data.get(h);return d||(this._isDev?d=new DE(this._logService,t,e,0|this._overallAverage()||1.5*r,r,a):(this._logService.debug(`[DEBOUNCE: ${t}] is disabled in developed mode`),d=new kE(1.5*r)),this._data.set(h,d)),d}_overallAverage(){const e=new gD;for(const t of this._data.values())e.update(t.default());return e.value}};xE=wE([yE(0,hh),yE(1,CE)],xE),yu(SE,xE,1);var NE=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},EE=function(e,t){return function(i,n){t(i,n,e)}},IE=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let ME=class{constructor(e,t,i,n,s,o){this._editor=e,this._languageFeaturesService=t,this._commandService=n,this._notificationService=s,this._codeLensCache=o,this._disposables=new N,this._localToDispose=new N,this._lenses=[],this._oldCodeLensModels=new N,this._provideCodeLensDebounce=i.for(t.codeLensProvider,"CodeLensProvide",{min:250}),this._resolveCodeLensesDebounce=i.for(t.codeLensProvider,"CodeLensResolve",{min:250,salt:"resolve"}),this._resolveCodeLensesScheduler=new rd((()=>this._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((e=>{(e.hasChanged(50)||e.hasChanged(19)||e.hasChanged(18))&&this._updateLensStyle(),e.hasChanged(17)&&this._onModelChange()}))),this._disposables.add(t.codeLensProvider.onDidChange(this._onModelChange,this)),this._onModelChange(),this._updateLensStyle()}dispose(){var e;this._localDispose(),this._disposables.dispose(),this._oldCodeLensModels.dispose(),null===(e=this._currentCodeLensModel)||void 0===e||e.dispose()}_getLayoutInfo(){const e=Math.max(1.3,this._editor.getOption(66)/this._editor.getOption(52));let t=this._editor.getOption(19);return(!t||t<5)&&(t=.9*this._editor.getOption(52)|0),{fontSize:t,codeLensHeight:t*e|0}}_updateLensStyle(){const{codeLensHeight:e,fontSize:t}=this._getLayoutInfo(),i=this._editor.getOption(18),n=this._editor.getOption(50),{style:s}=this._editor.getContainerDomNode();s.setProperty("--vscode-editorCodeLens-lineHeight",`${e}px`),s.setProperty("--vscode-editorCodeLens-fontSize",`${t}px`),s.setProperty("--vscode-editorCodeLens-fontFeatureSettings",n.fontFeatureSettings),i&&(s.setProperty("--vscode-editorCodeLens-fontFamily",i),s.setProperty("--vscode-editorCodeLens-fontFamilyDefault",qS.fontFamily)),this._editor.changeViewZones((t=>{for(const i of this._lenses)i.updateHeight(e,t)}))}_localDispose(){var e,t,i;null===(e=this._getCodeLensModelPromise)||void 0===e||e.cancel(),this._getCodeLensModelPromise=void 0,null===(t=this._resolveCodeLensesPromise)||void 0===t||t.cancel(),this._resolveCodeLensesPromise=void 0,this._localToDispose.clear(),this._oldCodeLensModels.clear(),null===(i=this._currentCodeLensModel)||void 0===i||i.dispose()}_onModelChange(){this._localDispose();const e=this._editor.getModel();if(!e)return;if(!this._editor.getOption(17)||e.isTooLargeForTokenization())return;const t=this._codeLensCache.get(e);if(t&&this._renderCodeLensSymbols(t),!this._languageFeaturesService.codeLensProvider.has(e))return void(t&&this._localToDispose.add(id((()=>{const i=this._codeLensCache.get(e);t===i&&(this._codeLensCache.delete(e),this._onModelChange())}),3e4)));for(const n of this._languageFeaturesService.codeLensProvider.all(e))if("function"==typeof n.onDidChange){const e=n.onDidChange((()=>i.schedule()));this._localToDispose.add(e)}const i=new rd((()=>{var t;const n=Date.now();null===(t=this._getCodeLensModelPromise)||void 0===t||t.cancel(),this._getCodeLensModelPromise=Yh((t=>zN(this._languageFeaturesService.codeLensProvider,e,t))),this._getCodeLensModelPromise.then((t=>{this._currentCodeLensModel&&this._oldCodeLensModels.add(this._currentCodeLensModel),this._currentCodeLensModel=t,this._codeLensCache.put(e,t);const s=this._provideCodeLensDebounce.update(e,Date.now()-n);i.delay=s,this._renderCodeLensSymbols(t),this._resolveCodeLensesInViewportSoon()}),r)}),this._provideCodeLensDebounce.get(e));this._localToDispose.add(i),this._localToDispose.add(x((()=>this._resolveCodeLensesScheduler.cancel()))),this._localToDispose.add(this._editor.onDidChangeModelContent((()=>{var e;this._editor.changeDecorations((e=>{this._editor.changeViewZones((t=>{const i=[];let n=-1;this._lenses.forEach((e=>{e.isValid()&&n!==e.getLineNumber()?(e.update(t),n=e.getLineNumber()):i.push(e)}));const s=new oE;i.forEach((e=>{e.dispose(s,t),this._lenses.splice(this._lenses.indexOf(e),1)})),s.commit(e)}))})),i.schedule(),this._resolveCodeLensesScheduler.cancel(),null===(e=this._resolveCodeLensesPromise)||void 0===e||e.cancel(),this._resolveCodeLensesPromise=void 0}))),this._localToDispose.add(this._editor.onDidFocusEditorWidget((()=>{i.schedule()}))),this._localToDispose.add(this._editor.onDidBlurEditorText((()=>{i.cancel()}))),this._localToDispose.add(this._editor.onDidScrollChange((e=>{e.scrollTopChanged&&this._lenses.length>0&&this._resolveCodeLensesInViewportSoon()}))),this._localToDispose.add(this._editor.onDidLayoutChange((()=>{this._resolveCodeLensesInViewportSoon()}))),this._localToDispose.add(x((()=>{if(this._editor.getModel()){const e=WN.capture(this._editor);this._editor.changeDecorations((e=>{this._editor.changeViewZones((t=>{this._disposeAllLenses(e,t)}))})),e.restore(this._editor)}else this._disposeAllLenses(void 0,void 0)}))),this._localToDispose.add(this._editor.onMouseDown((e=>{if(9!==e.target.type)return;let t=e.target.element;if("SPAN"===(null==t?void 0:t.tagName)&&(t=t.parentElement),"A"===(null==t?void 0:t.tagName))for(const i of this._lenses){const e=i.getCommand(t);if(e){this._commandService.executeCommand(e.id,...e.arguments||[]).catch((e=>this._notificationService.error(e)));break}}}))),i.schedule()}_disposeAllLenses(e,t){const i=new oE;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 r of e.lenses){const e=r.symbol.range.startLineNumber;e<1||e>t||(n&&n[n.length-1].symbol.range.startLineNumber===e?n.push(r):(n=[r],i.push(n)))}if(!i.length&&!this._lenses.length)return;const s=WN.capture(this._editor),o=this._getLayoutInfo();this._editor.changeDecorations((e=>{this._editor.changeViewZones((t=>{const n=new oE;let s=0,r=0;for(;rthis._resolveCodeLensesInViewportSoon()))),s++,r++)}for(;sthis._resolveCodeLensesInViewportSoon()))),r++;n.commit(e)}))})),s.restore(this._editor)}_resolveCodeLensesInViewportSoon(){this._editor.getModel()&&this._resolveCodeLensesScheduler.schedule()}_resolveCodeLensesInViewport(){var e;null===(e=this._resolveCodeLensesPromise)||void 0===e||e.cancel(),this._resolveCodeLensesPromise=void 0;const t=this._editor.getModel();if(!t)return;const i=[],n=[];if(this._lenses.forEach((e=>{const s=e.computeIfNecessary(t);s&&(i.push(s),n.push(e))})),0===i.length)return;const s=Date.now(),o=Yh((e=>{const s=i.map(((i,s)=>{const o=new Array(i.length),r=i.map(((i,n)=>i.symbol.command||"function"!=typeof i.provider.resolveCodeLens?(o[n]=i.symbol,Promise.resolve(void 0)):Promise.resolve(i.provider.resolveCodeLens(t,i.symbol,e)).then((e=>{o[n]=e}),a)));return Promise.all(r).then((()=>{e.isCancellationRequested||n[s].isDisposed()||n[s].updateCommands(o)}))}));return Promise.all(s)}));this._resolveCodeLensesPromise=o,this._resolveCodeLensesPromise.then((()=>{const e=this._resolveCodeLensesDebounce.update(t,Date.now()-s);this._resolveCodeLensesScheduler.delay=e,this._currentCodeLensModel&&this._codeLensCache.put(t,this._currentCodeLensModel),this._oldCodeLensModels.clear(),o===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)}),(e=>{r(e),o===this._resolveCodeLensesPromise&&(this._resolveCodeLensesPromise=void 0)}))}getModel(){var e;return IE(this,void 0,void 0,(function*(){return yield this._getCodeLensModelPromise,yield this._resolveCodeLensesPromise,(null===(e=this._currentCodeLensModel)||void 0===e?void 0:e.isDisposed)?void 0:this._currentCodeLensModel}))}};ME.ID="css.editor.codeLens",ME=NE([EE(1,oL),EE(2,SE),EE(3,Ya),EE(4,mL),EE(5,eE)],ME),Dh(ME.ID,ME,1),Lh(class extends bh{constructor(){super({id:"codelens.showLensesInCurrentLine",precondition:Oh.hasCodeLensProvider,label:ue(0,"Show CodeLens Commands For Current Line"),alias:"Show CodeLens Commands For Current Line"})}run(e,t){return IE(this,void 0,void 0,(function*(){if(!t.hasModel())return;const i=e.get(cE),n=e.get(Ya),s=e.get(mL),o=t.getSelection().positionLineNumber,r=t.getContribution(ME.ID);if(!r)return;const a=yield r.getModel();if(!a)return;const l=[];for(const e of a.lenses)e.symbol.command&&e.symbol.range.startLineNumber===o&&l.push({label:e.symbol.command.title,command:e.symbol.command});if(0===l.length)return;const h=yield i.pick(l,{canPickMany:!1,placeHolder:ue(0,"Select a command")});if(!h)return;let d=h.command;if(a.isDisposed){const e=yield r.getModel(),t=null==e?void 0:e.lenses.find((e=>{var t;return e.symbol.range.startLineNumber===o&&(null===(t=e.symbol.command)||void 0===t?void 0:t.title)===d.title}));if(!t||!t.symbol.command)return;d=t.symbol.command}try{yield n.executeCommand(d.id,...d.arguments||[])}catch(c){s.error(c)}}))}});class TE{constructor(e,t){this.x=e,this.y=t,this._pageCoordinatesBrand=void 0}toClientCoordinates(){return new RE(this.x-window.scrollX,this.y-window.scrollY)}}class RE{constructor(e,t){this.clientX=e,this.clientY=t,this._clientCoordinatesBrand=void 0}toPageCoordinates(){return new TE(this.clientX+window.scrollX,this.clientY+window.scrollY)}}class AE{constructor(e,t,i,n){this.x=e,this.y=t,this.width=i,this.height=n,this._editorPagePositionBrand=void 0}}class OE{constructor(e,t){this.x=e,this.y=t,this._positionRelativeToEditorBrand=void 0}}function PE(e){const t=Hn(e);return new AE(t.left,t.top,t.width,t.height)}function FE(e,t,i){const n=t.width/e.offsetWidth,s=t.height/e.offsetHeight,o=(i.x-t.x)/n,r=(i.y-t.y)/s;return new OE(o,r)}class BE extends Nt{constructor(e,t,i){super(e),this._editorMouseEventBrand=void 0,this.isFromPointerCapture=t,this.pos=new TE(this.posx,this.posy),this.editorPos=PE(i),this.relativePos=FE(i,this.editorPos,this.pos)}}class WE{constructor(e){this._editorViewDomNode=e}_create(e){return new BE(e,!1,this._editorViewDomNode)}onContextMenu(e,t){return En(e,"contextmenu",(e=>{t(this._create(e))}))}onMouseUp(e,t){return En(e,"mouseup",(e=>{t(this._create(e))}))}onMouseDown(e,t){return En(e,os.MOUSE_DOWN,(e=>{t(this._create(e))}))}onPointerDown(e,t){return En(e,os.POINTER_DOWN,(e=>{t(this._create(e),e.pointerId)}))}onMouseLeave(e,t){return En(e,os.MOUSE_LEAVE,(e=>{t(this._create(e))}))}onMouseMove(e,t){return En(e,"mousemove",(e=>t(this._create(e))))}}class VE{constructor(e){this._editorViewDomNode=e}_create(e){return new BE(e,!1,this._editorViewDomNode)}onPointerUp(e,t){return En(e,"pointerup",(e=>{t(this._create(e))}))}onPointerDown(e,t){return En(e,os.POINTER_DOWN,(e=>{t(this._create(e),e.pointerId)}))}onPointerLeave(e,t){return En(e,os.POINTER_LEAVE,(e=>{t(this._create(e))}))}onPointerMove(e,t){return En(e,"pointermove",(e=>t(this._create(e))))}}class HE extends E{constructor(e){super(),this._editorViewDomNode=e,this._globalPointerMoveMonitor=this._register(new fD),this._keydownListener=null}startMonitoring(e,t,i,n,s){this._keydownListener=Mn(e.ownerDocument,"keydown",(e=>{e.toKeyCodeChord().isModifierKey()||this._globalPointerMoveMonitor.stopMonitoring(!0,e.browserEvent)}),!0),this._globalPointerMoveMonitor.startMonitoring(e,t,i,(e=>{n(new BE(e,!0,this._editorViewDomNode))}),(e=>{this._keydownListener.dispose(),s(e)}))}stopMonitoring(){this._globalPointerMoveMonitor.stopMonitoring(!0)}}class zE{constructor(e){this._editor=e,this._instanceId=++zE._idPool,this._counter=0,this._rules=new Map,this._garbageCollectionScheduler=new rd((()=>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 UE(t,`dyn-rule-${this._instanceId}-${n}`,Zn(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())}}zE._idPool=0;class UE{constructor(e,t,i,n){this.key=e,this.className=t,this.properties=n,this._referenceCount=0,this._styleElement=Jn(i),this._styleElement.textContent=this.getCssText(this.className,this.properties)}getCssText(e,t){let i=`.${e} {`;for(const n in t){const e=t[n];let s;s="object"==typeof e?Sp(e.id):e;i+=`\n\t${KE(n)}: ${s};`}return i+="\n}",i}dispose(){this._styleElement.remove()}increaseRefCount(){this._referenceCount++}decreaseRefCount(){this._referenceCount--}hasReferences(){return this._referenceCount>0}}function KE(e){return e.replace(/(^[A-Z])/,(([e])=>e.toLowerCase())).replace(/([A-Z])/g,(([e])=>`-${e.toLowerCase()}`))}const jE="$initialize";let qE=!1;function $E(e){We&&(qE||(qE=!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(e.message))}class GE{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.method=i,this.args=n,this.type=0}}class ZE{constructor(e,t,i,n){this.vsWorker=e,this.seq=t,this.res=i,this.err=n,this.type=1}}class YE{constructor(e,t,i,n){this.vsWorker=e,this.req=t,this.eventName=i,this.arg=n,this.type=2}}class XE{constructor(e,t,i){this.vsWorker=e,this.req=t,this.event=i,this.type=3}}class QE{constructor(e,t){this.vsWorker=e,this.req=t,this.type=4}}class JE{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,s)=>{this._pendingReplies[i]={resolve:n,reject:s},this._send(new GE(this._workerId,i,e,t))}))}listen(e,t){let i=null;const n=new U({onWillAddFirstListener:()=>{i=String(++this._lastSentReq),this._pendingEmitters.set(i,n),this._send(new YE(this._workerId,i,e,t))},onDidRemoveLastListener:()=>{this._pendingEmitters.delete(i),this._send(new QE(this._workerId,i)),i=null}});return n.event}handleMessage(e){e&&e.vsWorker&&(-1!==this._workerId&&e.vsWorker!==this._workerId||this._handleMessage(e))}_handleMessage(e){switch(e.type){case 1:return this._handleReplyMessage(e);case 0:return this._handleRequestMessage(e);case 2:return this._handleSubscribeEventMessage(e);case 3:return this._handleEventMessage(e);case 4:return this._handleUnsubscribeEventMessage(e)}}_handleReplyMessage(e){if(!this._pendingReplies[e.seq])return void console.warn("Got reply to unknown seq");const t=this._pendingReplies[e.seq];if(delete this._pendingReplies[e.seq],e.err){let i=e.err;return e.err.$isError&&(i=new Error,i.name=e.err.name,i.message=e.err.message,i.stack=e.err.stack),void t.reject(i)}t.resolve(e.res)}_handleRequestMessage(e){const t=e.req;this._handler.handleMessage(e.method,e.args).then((e=>{this._send(new ZE(this._workerId,t,e,void 0))}),(e=>{e.detail instanceof Error&&(e.detail=l(e.detail)),this._send(new ZE(this._workerId,t,void 0,l(e)))}))}_handleSubscribeEventMessage(e){const t=e.req,i=this._handler.handleEvent(e.eventName,e.arg)((e=>{this._send(new XE(this._workerId,t,e))}));this._pendingEvents.set(t,i)}_handleEventMessage(e){this._pendingEmitters.has(e.req)?this._pendingEmitters.get(e.req).fire(e.event):console.warn("Got event for unknown req")}_handleUnsubscribeEventMessage(e){this._pendingEvents.has(e.req)?(this._pendingEvents.get(e.req).dispose(),this._pendingEvents.delete(e.req)):console.warn("Got unsubscribe for unknown req")}_send(e){const t=[];if(0===e.type)for(let i=0;i{this._protocol.handleMessage(e)}),(e=>{null==n||n(e)}))),this._protocol=new JE({sendMessage:(e,t)=>{this._worker.postMessage(e,t)},handleMessage:(e,t)=>{if("function"!=typeof i[e])return Promise.reject(new Error("Missing method "+e+" on main thread host."));try{return Promise.resolve(i[e].apply(i,t))}catch(Mre){return Promise.reject(Mre)}},handleEvent:(e,t)=>{if(iI(e)){const n=i[e].call(i,t);if("function"!=typeof n)throw new Error(`Missing dynamic event ${e} on main thread host.`);return n}if(tI(e)){const t=i[e];if("function"!=typeof t)throw new Error(`Missing event ${e} on main thread host.`);return t}throw new Error(`Malformed event name ${e}`)}}),this._protocol.setWorkerId(this._worker.getId());let s=null;const o=globalThis.require;void 0!==o&&"function"==typeof o.getConfig?s=o.getConfig():void 0!==globalThis.requirejs&&(s=globalThis.requirejs.s.contexts._.config);const r=bd(i);this._onModuleLoaded=this._protocol.sendMessage(jE,[this._worker.getId(),JSON.parse(JSON.stringify(s)),t,r]);const a=(e,t)=>this._request(e,t),l=(e,t)=>this._protocol.listen(e,t);this._lazyProxy=new Promise(((e,i)=>{n=i,this._onModuleLoaded.then((t=>{e(nI(t,a,l))}),(e=>{i(e),this._onError("Worker failed to load "+t,e)}))}))}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 tI(e){return"o"===e[0]&&"n"===e[1]&&fo(e.charCodeAt(2))}function iI(e){return/^onDynamic/.test(e)&&fo(e.charCodeAt(9))}function nI(e,t,i){const n=e=>function(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)},s=e=>function(t){return i(e,t)},o={};for(const r of e)iI(r)?o[r]=s(r):tI(r)?o[r]=i(r,void 0):o[r]=n(r);return o}const sI=Fk("defaultWorkerFactory",{createScriptURL:e=>e});class oI{constructor(e,t,i,n,s){this.id=t,this.label=i;const o=function(e){const t=globalThis.MonacoEnvironment;if(t){if("function"==typeof t.getWorker)return t.getWorker("workerMain.js",e);if("function"==typeof t.getWorkerUrl){const i=t.getWorkerUrl("workerMain.js",e);return new Worker(sI?sI.createScriptURL(i):i,{name:e})}}throw new Error("You must define a function MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker")}(i);"function"==typeof o.then?this.worker=o:this.worker=Promise.resolve(o),this.postMessage(e,[]),this.worker.then((e=>{e.onmessage=function(e){n(e.data)},e.onmessageerror=s,"function"==typeof e.addEventListener&&e.addEventListener("error",s)}))}getId(){return this.id}postMessage(e,t){var i;null===(i=this.worker)||void 0===i||i.then((i=>{try{i.postMessage(e,t)}catch(n){r(n),r(new Error(`FAILED to post message to '${this.label}'-worker`,{cause:n}))}}))}dispose(){var e;null===(e=this.worker)||void 0===e||e.then((e=>e.terminate())),this.worker=null}}class rI{constructor(e){this._label=e,this._webWorkerFailedBeforeError=!1}create(e,t,i){const n=++rI.LAST_WORKER_ID;if(this._webWorkerFailedBeforeError)throw this._webWorkerFailedBeforeError;return new oI(e,n,this._label||"anonymous"+n,t,(e=>{$E(e),this._webWorkerFailedBeforeError=e,i(e)}))}}rI.LAST_WORKER_ID=0;class aI{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 lI{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 aI(this.m_originalStart,this.m_originalCount,this.m_modifiedStart,this.m_modifiedCount)),this.m_originalCount=0,this.m_modifiedCount=0,this.m_originalStart=1073741824,this.m_modifiedStart=1073741824}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 gI{constructor(e,t,i=null){this.ContinueProcessingPredicate=i,this._originalSequence=e,this._modifiedSequence=t;const[n,s,o]=gI._getElements(e),[r,a,l]=gI._getElements(t);this._hasStrings=o&&l,this._originalStringElements=n,this._originalElementsOrHash=s,this._modifiedStringElements=r,this._modifiedElementsOrHash=a,this.m_forwardHistory=[],this.m_reverseHistory=[]}static _isStringArray(e){return e.length>0&&"string"==typeof e[0]}static _getElements(e){const t=e.getElements();if(gI._isStringArray(t)){const e=new Int32Array(t.length);for(let i=0,n=t.length;i=e&&n>=i&&this.ElementsAreEqual(t,n);)t--,n--;if(e>t||i>n){let s;return i<=n?(dI.Assert(e===t+1,"originalStart should only be one more than originalEnd"),s=[new aI(e,0,i,n-i+1)]):e<=t?(dI.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),s=[new aI(e,t-e+1,i,0)]):(dI.Assert(e===t+1,"originalStart should only be one more than originalEnd"),dI.Assert(i===n+1,"modifiedStart should only be one more than modifiedEnd"),s=[]),s}const o=[0],r=[0],a=this.ComputeRecursionPoint(e,t,i,n,o,r,s),l=o[0],h=r[0];if(null!==a)return a;if(!s[0]){const o=this.ComputeDiffRecursive(e,l,i,h,s);let r=[];return r=s[0]?[new aI(l+1,t-(l+1)+1,h+1,n-(h+1)+1)]:this.ComputeDiffRecursive(l+1,t,h+1,n,s),this.ConcatenateChanges(o,r)}return[new aI(e,t-e+1,i,n-i+1)]}WALKTRACE(e,t,i,n,s,o,r,a,l,h,d,c,u,g,p,m,f,_){let v=null,b=null,C=new uI,w=t,y=i,S=u[0]-m[0]-n,L=-1073741824,k=this.m_forwardHistory.length-1;do{const t=S+e;t===w||t=0&&(e=(l=this.m_forwardHistory[k])[0],w=1,y=l.length-1)}while(--k>=-1);if(v=C.getReverseChanges(),_[0]){let e=u[0]+1,t=m[0]+1;if(null!==v&&v.length>0){const i=v[v.length-1];e=Math.max(e,i.getOriginalEnd()),t=Math.max(t,i.getModifiedEnd())}b=[new aI(e,c-e+1,t,p-t+1)]}else{C=new uI,w=o,y=r,S=u[0]-m[0]-a,L=1073741824,k=f?this.m_reverseHistory.length-1:this.m_reverseHistory.length-2;do{const e=S+s;e===w||e=h[e+1]?(g=(d=h[e+1]-1)-S-a,d>L&&C.MarkNextChange(),L=d+1,C.AddOriginalElement(d+1,g+1),S=e+1-s):(g=(d=h[e-1])-S-a,d>L&&C.MarkNextChange(),L=d,C.AddModifiedElement(d+1,g+1),S=e-1-s),k>=0&&(s=(h=this.m_reverseHistory[k])[0],w=1,y=h.length-1)}while(--k>=-1);b=C.getChanges()}return this.ConcatenateChanges(v,b)}ComputeRecursionPoint(e,t,i,n,s,o,r){let a=0,l=0,h=0,d=0,c=0,u=0;e--,i--,s[0]=0,o[0]=0,this.m_forwardHistory=[],this.m_reverseHistory=[];const g=t-e+(n-i),p=g+1,m=new Int32Array(p),f=new Int32Array(p),_=n-i,v=t-e,b=e-i,C=t-n,w=(v-_)%2==0;m[_]=e,f[v]=t,r[0]=!1;for(let y=1;y<=g/2+1;y++){let g=0,S=0;h=this.ClipDiagonalBound(_-y,y,_,p),d=this.ClipDiagonalBound(_+y,y,_,p);for(let e=h;e<=d;e+=2){a=e===h||eg+S&&(g=a,S=l),!w&&Math.abs(e-v)<=y-1&&a>=f[e])return s[0]=a,o[0]=l,i<=f[e]&&y<=1448?this.WALKTRACE(_,h,d,b,v,c,u,C,m,f,a,t,s,l,n,o,w,r):null}const L=(g-e+(S-i)-y)/2;if(null!==this.ContinueProcessingPredicate&&!this.ContinueProcessingPredicate(g,L))return r[0]=!0,s[0]=g,o[0]=S,L>0&&y<=1448?this.WALKTRACE(_,h,d,b,v,c,u,C,m,f,a,t,s,l,n,o,w,r):(e++,i++,[new aI(e,t-e+1,i,n-i+1)]);c=this.ClipDiagonalBound(v-y,y,v,p),u=this.ClipDiagonalBound(v+y,y,v,p);for(let p=c;p<=u;p+=2){a=p===c||p=f[p+1]?f[p+1]-1:f[p-1],l=a-(p-v)-C;const g=a;for(;a>e&&l>i&&this.ElementsAreEqual(a,l);)a--,l--;if(f[p]=a,w&&Math.abs(p-_)<=y&&a<=m[p])return s[0]=a,o[0]=l,g>=m[p]&&y<=1448?this.WALKTRACE(_,h,d,b,v,c,u,C,m,f,a,t,s,l,n,o,w,r):null}if(y<=1447){let e=new Int32Array(d-h+2);e[0]=_-h+1,cI.Copy2(m,h,e,1,d-h+1),this.m_forwardHistory.push(e),e=new Int32Array(u-c+2),e[0]=v-c+1,cI.Copy2(f,c,e,1,u-c+1),this.m_reverseHistory.push(e)}}return this.WALKTRACE(_,h,d,b,v,c,u,C,m,f,a,t,s,l,n,o,w,r)}PrettifyChanges(e){for(let t=0;t0,r=i.modifiedLength>0;for(;i.originalStart+i.originalLength=0;t--){const i=e[t];let n=0,s=0;if(t>0){const i=e[t-1];n=i.originalStart+i.originalLength,s=i.modifiedStart+i.modifiedLength}const o=i.originalLength>0,r=i.modifiedLength>0;let a=0,l=this._boundaryScore(i.originalStart,i.originalLength,i.modifiedStart,i.modifiedLength);for(let e=1;;e++){const t=i.originalStart-e,h=i.modifiedStart-e;if(tl&&(l=d,a=e)}i.originalStart-=a,i.modifiedStart-=a;const h=[null];t>0&&this.ChangesOverlap(e[t-1],e[t],h)&&(e[t-1]=h[0],e.splice(t,1),t++)}if(this._hasStrings)for(let t=1,i=e.length;t0&&t>a&&(a=t,l=d,h=e)}return a>0?[l,h]:null}_contiguousSequenceScore(e,t,i){let n=0;for(let s=0;s=this._originalElementsOrHash.length-1||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||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){return(this._OriginalRegionIsBoundary(e,t)?1:0)+(this._ModifiedRegionIsBoundary(i,n)?1:0)}ConcatenateChanges(e,t){const i=[];if(0===e.length||0===t.length)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 cI.Copy(e,0,n,0,e.length-1),n[e.length-1]=i[0],cI.Copy(t,1,n,e.length,t.length-1),n}{const i=new Array(e.length+t.length);return cI.Copy(e,0,i,0,e.length),cI.Copy(t,0,i,e.length,t.length),i}}ChangesOverlap(e,t,i){if(dI.Assert(e.originalStart<=t.originalStart,"Left change is not less than or equal to right change"),dI.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 s=e.originalLength;const o=e.modifiedStart;let r=e.modifiedLength;return e.originalStart+e.originalLength>=t.originalStart&&(s=t.originalStart+t.originalLength-e.originalStart),e.modifiedStart+e.modifiedLength>=t.modifiedStart&&(r=t.modifiedStart+t.modifiedLength-e.modifiedStart),i[0]=new aI(n,s,o,r),!0}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=Kb(e),t=Kb(t),this.values[e]!==t&&(this.values[e]=t,e-1=i.length)return!1;const s=i.length-e;return t>=s&&(t=s),0!==t&&(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 0===this.values.length?0:this._getPrefixSum(this.values.length-1)}getPrefixSum(e){return e<0?0:(e=Kb(e),this._getPrefixSum(e))}_getPrefixSum(e){if(e<=this.prefixSumValidIndex[0])return this.prefixSum[e];let t=this.prefixSumValidIndex[0]+1;0===t&&(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,s=0,o=0;for(;t<=i;)if(n=t+(i-t)/2|0,s=this.prefixSum[n],o=s-this.values[n],e=s))break;t=n+1}return new fI(n,e-o)}}class mI{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(),0===e?0:this._prefixSum[e-1]}getIndexOf(e){this._ensureValid();const t=this._indexBySum[e],i=t>0?this._prefixSum[t-1]:0;return new fI(t,e-i)}removeValues(e,t){this._values.splice(e,t),this._invalidate(e)}insertValues(e,t){this._values=jd(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]=i+t;for(let n=0;nt&&(t=o),n>i&&(i=n),r>i&&(i=r)}t++,i++;const n=new vI(i,t,0);for(let s=0,o=e.length;s=this._maxCharCode?0:this._states.get(e,t)}}let CI=null;let wI=null;class yI{static _createLink(e,t,i,n,s){let o=s-1;do{const i=t.charCodeAt(o);if(2!==e.get(i))break;o--}while(o>n);if(n>0){const e=t.charCodeAt(n-1),i=t.charCodeAt(o);(40===e&&41===i||91===e&&93===i||123===e&&125===i)&&o--}return{range:{startLineNumber:i,startColumn:n+1,endLineNumber:i,endColumn:o+2},url:t.substring(n,o+1)}}static computeLinks(e,t=function(){return null===CI&&(CI=new bI([[1,104,2],[1,72,2],[1,102,6],[1,70,6],[2,116,3],[2,84,3],[3,116,4],[3,84,4],[4,112,5],[4,80,5],[5,115,9],[5,83,9],[5,58,10],[6,105,7],[6,73,7],[7,108,8],[7,76,8],[8,101,9],[8,69,9],[9,58,10],[10,47,11],[11,47,12]])),CI}()){const i=function(){if(null===wI){wI=new jb(0);const e=" \t<>'\"\u3001\u3002\uff61\uff64\uff0c\uff0e\uff1a\uff1b\u2018\u3008\u300c\u300e\u3014\uff08\uff3b\uff5b\uff62\uff63\uff5d\uff3d\uff09\u3015\u300f\u300d\u3009\u2019\uff40\uff5e\u2026";for(let i=0;i=0?(n+=i?1:-1,n<0?n=e.length-1:n%=e.length,e[n]):null}}var LI,kI,DI,xI,NI,EI,II,MI,TI,RI,AI,OI,PI,FI,BI,WI,VI,HI,zI,UI,KI,jI,qI,$I,GI,ZI,YI,XI,QI,JI,eM,tM,iM,nM,sM,oM,rM,aM,lM;SI.INSTANCE=new SI,function(e){e[e.Unknown=0]="Unknown",e[e.Disabled=1]="Disabled",e[e.Enabled=2]="Enabled"}(LI||(LI={})),function(e){e[e.Invoke=1]="Invoke",e[e.Auto=2]="Auto"}(kI||(kI={})),function(e){e[e.None=0]="None",e[e.KeepWhitespace=1]="KeepWhitespace",e[e.InsertAsSnippet=4]="InsertAsSnippet"}(DI||(DI={})),function(e){e[e.Method=0]="Method",e[e.Function=1]="Function",e[e.Constructor=2]="Constructor",e[e.Field=3]="Field",e[e.Variable=4]="Variable",e[e.Class=5]="Class",e[e.Struct=6]="Struct",e[e.Interface=7]="Interface",e[e.Module=8]="Module",e[e.Property=9]="Property",e[e.Event=10]="Event",e[e.Operator=11]="Operator",e[e.Unit=12]="Unit",e[e.Value=13]="Value",e[e.Constant=14]="Constant",e[e.Enum=15]="Enum",e[e.EnumMember=16]="EnumMember",e[e.Keyword=17]="Keyword",e[e.Text=18]="Text",e[e.Color=19]="Color",e[e.File=20]="File",e[e.Reference=21]="Reference",e[e.Customcolor=22]="Customcolor",e[e.Folder=23]="Folder",e[e.TypeParameter=24]="TypeParameter",e[e.User=25]="User",e[e.Issue=26]="Issue",e[e.Snippet=27]="Snippet"}(xI||(xI={})),function(e){e[e.Deprecated=1]="Deprecated"}(NI||(NI={})),function(e){e[e.Invoke=0]="Invoke",e[e.TriggerCharacter=1]="TriggerCharacter",e[e.TriggerForIncompleteCompletions=2]="TriggerForIncompleteCompletions"}(EI||(EI={})),function(e){e[e.EXACT=0]="EXACT",e[e.ABOVE=1]="ABOVE",e[e.BELOW=2]="BELOW"}(II||(II={})),function(e){e[e.NotSet=0]="NotSet",e[e.ContentFlush=1]="ContentFlush",e[e.RecoverFromMarkers=2]="RecoverFromMarkers",e[e.Explicit=3]="Explicit",e[e.Paste=4]="Paste",e[e.Undo=5]="Undo",e[e.Redo=6]="Redo"}(MI||(MI={})),function(e){e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(TI||(TI={})),function(e){e[e.Text=0]="Text",e[e.Read=1]="Read",e[e.Write=2]="Write"}(RI||(RI={})),function(e){e[e.None=0]="None",e[e.Keep=1]="Keep",e[e.Brackets=2]="Brackets",e[e.Advanced=3]="Advanced",e[e.Full=4]="Full"}(AI||(AI={})),function(e){e[e.acceptSuggestionOnCommitCharacter=0]="acceptSuggestionOnCommitCharacter",e[e.acceptSuggestionOnEnter=1]="acceptSuggestionOnEnter",e[e.accessibilitySupport=2]="accessibilitySupport",e[e.accessibilityPageSize=3]="accessibilityPageSize",e[e.ariaLabel=4]="ariaLabel",e[e.ariaRequired=5]="ariaRequired",e[e.autoClosingBrackets=6]="autoClosingBrackets",e[e.autoClosingComments=7]="autoClosingComments",e[e.screenReaderAnnounceInlineSuggestion=8]="screenReaderAnnounceInlineSuggestion",e[e.autoClosingDelete=9]="autoClosingDelete",e[e.autoClosingOvertype=10]="autoClosingOvertype",e[e.autoClosingQuotes=11]="autoClosingQuotes",e[e.autoIndent=12]="autoIndent",e[e.automaticLayout=13]="automaticLayout",e[e.autoSurround=14]="autoSurround",e[e.bracketPairColorization=15]="bracketPairColorization",e[e.guides=16]="guides",e[e.codeLens=17]="codeLens",e[e.codeLensFontFamily=18]="codeLensFontFamily",e[e.codeLensFontSize=19]="codeLensFontSize",e[e.colorDecorators=20]="colorDecorators",e[e.colorDecoratorsLimit=21]="colorDecoratorsLimit",e[e.columnSelection=22]="columnSelection",e[e.comments=23]="comments",e[e.contextmenu=24]="contextmenu",e[e.copyWithSyntaxHighlighting=25]="copyWithSyntaxHighlighting",e[e.cursorBlinking=26]="cursorBlinking",e[e.cursorSmoothCaretAnimation=27]="cursorSmoothCaretAnimation",e[e.cursorStyle=28]="cursorStyle",e[e.cursorSurroundingLines=29]="cursorSurroundingLines",e[e.cursorSurroundingLinesStyle=30]="cursorSurroundingLinesStyle",e[e.cursorWidth=31]="cursorWidth",e[e.disableLayerHinting=32]="disableLayerHinting",e[e.disableMonospaceOptimizations=33]="disableMonospaceOptimizations",e[e.domReadOnly=34]="domReadOnly",e[e.dragAndDrop=35]="dragAndDrop",e[e.dropIntoEditor=36]="dropIntoEditor",e[e.emptySelectionClipboard=37]="emptySelectionClipboard",e[e.experimentalWhitespaceRendering=38]="experimentalWhitespaceRendering",e[e.extraEditorClassName=39]="extraEditorClassName",e[e.fastScrollSensitivity=40]="fastScrollSensitivity",e[e.find=41]="find",e[e.fixedOverflowWidgets=42]="fixedOverflowWidgets",e[e.folding=43]="folding",e[e.foldingStrategy=44]="foldingStrategy",e[e.foldingHighlight=45]="foldingHighlight",e[e.foldingImportsByDefault=46]="foldingImportsByDefault",e[e.foldingMaximumRegions=47]="foldingMaximumRegions",e[e.unfoldOnClickAfterEndOfLine=48]="unfoldOnClickAfterEndOfLine",e[e.fontFamily=49]="fontFamily",e[e.fontInfo=50]="fontInfo",e[e.fontLigatures=51]="fontLigatures",e[e.fontSize=52]="fontSize",e[e.fontWeight=53]="fontWeight",e[e.fontVariations=54]="fontVariations",e[e.formatOnPaste=55]="formatOnPaste",e[e.formatOnType=56]="formatOnType",e[e.glyphMargin=57]="glyphMargin",e[e.gotoLocation=58]="gotoLocation",e[e.hideCursorInOverviewRuler=59]="hideCursorInOverviewRuler",e[e.hover=60]="hover",e[e.inDiffEditor=61]="inDiffEditor",e[e.inlineSuggest=62]="inlineSuggest",e[e.letterSpacing=63]="letterSpacing",e[e.lightbulb=64]="lightbulb",e[e.lineDecorationsWidth=65]="lineDecorationsWidth",e[e.lineHeight=66]="lineHeight",e[e.lineNumbers=67]="lineNumbers",e[e.lineNumbersMinChars=68]="lineNumbersMinChars",e[e.linkedEditing=69]="linkedEditing",e[e.links=70]="links",e[e.matchBrackets=71]="matchBrackets",e[e.minimap=72]="minimap",e[e.mouseStyle=73]="mouseStyle",e[e.mouseWheelScrollSensitivity=74]="mouseWheelScrollSensitivity",e[e.mouseWheelZoom=75]="mouseWheelZoom",e[e.multiCursorMergeOverlapping=76]="multiCursorMergeOverlapping",e[e.multiCursorModifier=77]="multiCursorModifier",e[e.multiCursorPaste=78]="multiCursorPaste",e[e.multiCursorLimit=79]="multiCursorLimit",e[e.occurrencesHighlight=80]="occurrencesHighlight",e[e.overviewRulerBorder=81]="overviewRulerBorder",e[e.overviewRulerLanes=82]="overviewRulerLanes",e[e.padding=83]="padding",e[e.pasteAs=84]="pasteAs",e[e.parameterHints=85]="parameterHints",e[e.peekWidgetDefaultFocus=86]="peekWidgetDefaultFocus",e[e.definitionLinkOpensInPeek=87]="definitionLinkOpensInPeek",e[e.quickSuggestions=88]="quickSuggestions",e[e.quickSuggestionsDelay=89]="quickSuggestionsDelay",e[e.readOnly=90]="readOnly",e[e.readOnlyMessage=91]="readOnlyMessage",e[e.renameOnType=92]="renameOnType",e[e.renderControlCharacters=93]="renderControlCharacters",e[e.renderFinalNewline=94]="renderFinalNewline",e[e.renderLineHighlight=95]="renderLineHighlight",e[e.renderLineHighlightOnlyWhenFocus=96]="renderLineHighlightOnlyWhenFocus",e[e.renderValidationDecorations=97]="renderValidationDecorations",e[e.renderWhitespace=98]="renderWhitespace",e[e.revealHorizontalRightPadding=99]="revealHorizontalRightPadding",e[e.roundedSelection=100]="roundedSelection",e[e.rulers=101]="rulers",e[e.scrollbar=102]="scrollbar",e[e.scrollBeyondLastColumn=103]="scrollBeyondLastColumn",e[e.scrollBeyondLastLine=104]="scrollBeyondLastLine",e[e.scrollPredominantAxis=105]="scrollPredominantAxis",e[e.selectionClipboard=106]="selectionClipboard",e[e.selectionHighlight=107]="selectionHighlight",e[e.selectOnLineNumbers=108]="selectOnLineNumbers",e[e.showFoldingControls=109]="showFoldingControls",e[e.showUnused=110]="showUnused",e[e.snippetSuggestions=111]="snippetSuggestions",e[e.smartSelect=112]="smartSelect",e[e.smoothScrolling=113]="smoothScrolling",e[e.stickyScroll=114]="stickyScroll",e[e.stickyTabStops=115]="stickyTabStops",e[e.stopRenderingLineAfter=116]="stopRenderingLineAfter",e[e.suggest=117]="suggest",e[e.suggestFontSize=118]="suggestFontSize",e[e.suggestLineHeight=119]="suggestLineHeight",e[e.suggestOnTriggerCharacters=120]="suggestOnTriggerCharacters",e[e.suggestSelection=121]="suggestSelection",e[e.tabCompletion=122]="tabCompletion",e[e.tabIndex=123]="tabIndex",e[e.unicodeHighlighting=124]="unicodeHighlighting",e[e.unusualLineTerminators=125]="unusualLineTerminators",e[e.useShadowDOM=126]="useShadowDOM",e[e.useTabStops=127]="useTabStops",e[e.wordBreak=128]="wordBreak",e[e.wordSeparators=129]="wordSeparators",e[e.wordWrap=130]="wordWrap",e[e.wordWrapBreakAfterCharacters=131]="wordWrapBreakAfterCharacters",e[e.wordWrapBreakBeforeCharacters=132]="wordWrapBreakBeforeCharacters",e[e.wordWrapColumn=133]="wordWrapColumn",e[e.wordWrapOverride1=134]="wordWrapOverride1",e[e.wordWrapOverride2=135]="wordWrapOverride2",e[e.wrappingIndent=136]="wrappingIndent",e[e.wrappingStrategy=137]="wrappingStrategy",e[e.showDeprecated=138]="showDeprecated",e[e.inlayHints=139]="inlayHints",e[e.editorClassName=140]="editorClassName",e[e.pixelRatio=141]="pixelRatio",e[e.tabFocusMode=142]="tabFocusMode",e[e.layoutInfo=143]="layoutInfo",e[e.wrappingInfo=144]="wrappingInfo",e[e.defaultColorDecorators=145]="defaultColorDecorators",e[e.colorDecoratorsActivatedOn=146]="colorDecoratorsActivatedOn",e[e.inlineCompletionsAccessibilityVerbose=147]="inlineCompletionsAccessibilityVerbose"}(OI||(OI={})),function(e){e[e.TextDefined=0]="TextDefined",e[e.LF=1]="LF",e[e.CRLF=2]="CRLF"}(PI||(PI={})),function(e){e[e.LF=0]="LF",e[e.CRLF=1]="CRLF"}(FI||(FI={})),function(e){e[e.Left=1]="Left",e[e.Right=2]="Right"}(BI||(BI={})),function(e){e[e.None=0]="None",e[e.Indent=1]="Indent",e[e.IndentOutdent=2]="IndentOutdent",e[e.Outdent=3]="Outdent"}(WI||(WI={})),function(e){e[e.Both=0]="Both",e[e.Right=1]="Right",e[e.Left=2]="Left",e[e.None=3]="None"}(VI||(VI={})),function(e){e[e.Type=1]="Type",e[e.Parameter=2]="Parameter"}(HI||(HI={})),function(e){e[e.Automatic=0]="Automatic",e[e.Explicit=1]="Explicit"}(zI||(zI={})),function(e){e[e.DependsOnKbLayout=-1]="DependsOnKbLayout",e[e.Unknown=0]="Unknown",e[e.Backspace=1]="Backspace",e[e.Tab=2]="Tab",e[e.Enter=3]="Enter",e[e.Shift=4]="Shift",e[e.Ctrl=5]="Ctrl",e[e.Alt=6]="Alt",e[e.PauseBreak=7]="PauseBreak",e[e.CapsLock=8]="CapsLock",e[e.Escape=9]="Escape",e[e.Space=10]="Space",e[e.PageUp=11]="PageUp",e[e.PageDown=12]="PageDown",e[e.End=13]="End",e[e.Home=14]="Home",e[e.LeftArrow=15]="LeftArrow",e[e.UpArrow=16]="UpArrow",e[e.RightArrow=17]="RightArrow",e[e.DownArrow=18]="DownArrow",e[e.Insert=19]="Insert",e[e.Delete=20]="Delete",e[e.Digit0=21]="Digit0",e[e.Digit1=22]="Digit1",e[e.Digit2=23]="Digit2",e[e.Digit3=24]="Digit3",e[e.Digit4=25]="Digit4",e[e.Digit5=26]="Digit5",e[e.Digit6=27]="Digit6",e[e.Digit7=28]="Digit7",e[e.Digit8=29]="Digit8",e[e.Digit9=30]="Digit9",e[e.KeyA=31]="KeyA",e[e.KeyB=32]="KeyB",e[e.KeyC=33]="KeyC",e[e.KeyD=34]="KeyD",e[e.KeyE=35]="KeyE",e[e.KeyF=36]="KeyF",e[e.KeyG=37]="KeyG",e[e.KeyH=38]="KeyH",e[e.KeyI=39]="KeyI",e[e.KeyJ=40]="KeyJ",e[e.KeyK=41]="KeyK",e[e.KeyL=42]="KeyL",e[e.KeyM=43]="KeyM",e[e.KeyN=44]="KeyN",e[e.KeyO=45]="KeyO",e[e.KeyP=46]="KeyP",e[e.KeyQ=47]="KeyQ",e[e.KeyR=48]="KeyR",e[e.KeyS=49]="KeyS",e[e.KeyT=50]="KeyT",e[e.KeyU=51]="KeyU",e[e.KeyV=52]="KeyV",e[e.KeyW=53]="KeyW",e[e.KeyX=54]="KeyX",e[e.KeyY=55]="KeyY",e[e.KeyZ=56]="KeyZ",e[e.Meta=57]="Meta",e[e.ContextMenu=58]="ContextMenu",e[e.F1=59]="F1",e[e.F2=60]="F2",e[e.F3=61]="F3",e[e.F4=62]="F4",e[e.F5=63]="F5",e[e.F6=64]="F6",e[e.F7=65]="F7",e[e.F8=66]="F8",e[e.F9=67]="F9",e[e.F10=68]="F10",e[e.F11=69]="F11",e[e.F12=70]="F12",e[e.F13=71]="F13",e[e.F14=72]="F14",e[e.F15=73]="F15",e[e.F16=74]="F16",e[e.F17=75]="F17",e[e.F18=76]="F18",e[e.F19=77]="F19",e[e.F20=78]="F20",e[e.F21=79]="F21",e[e.F22=80]="F22",e[e.F23=81]="F23",e[e.F24=82]="F24",e[e.NumLock=83]="NumLock",e[e.ScrollLock=84]="ScrollLock",e[e.Semicolon=85]="Semicolon",e[e.Equal=86]="Equal",e[e.Comma=87]="Comma",e[e.Minus=88]="Minus",e[e.Period=89]="Period",e[e.Slash=90]="Slash",e[e.Backquote=91]="Backquote",e[e.BracketLeft=92]="BracketLeft",e[e.Backslash=93]="Backslash",e[e.BracketRight=94]="BracketRight",e[e.Quote=95]="Quote",e[e.OEM_8=96]="OEM_8",e[e.IntlBackslash=97]="IntlBackslash",e[e.Numpad0=98]="Numpad0",e[e.Numpad1=99]="Numpad1",e[e.Numpad2=100]="Numpad2",e[e.Numpad3=101]="Numpad3",e[e.Numpad4=102]="Numpad4",e[e.Numpad5=103]="Numpad5",e[e.Numpad6=104]="Numpad6",e[e.Numpad7=105]="Numpad7",e[e.Numpad8=106]="Numpad8",e[e.Numpad9=107]="Numpad9",e[e.NumpadMultiply=108]="NumpadMultiply",e[e.NumpadAdd=109]="NumpadAdd",e[e.NUMPAD_SEPARATOR=110]="NUMPAD_SEPARATOR",e[e.NumpadSubtract=111]="NumpadSubtract",e[e.NumpadDecimal=112]="NumpadDecimal",e[e.NumpadDivide=113]="NumpadDivide",e[e.KEY_IN_COMPOSITION=114]="KEY_IN_COMPOSITION",e[e.ABNT_C1=115]="ABNT_C1",e[e.ABNT_C2=116]="ABNT_C2",e[e.AudioVolumeMute=117]="AudioVolumeMute",e[e.AudioVolumeUp=118]="AudioVolumeUp",e[e.AudioVolumeDown=119]="AudioVolumeDown",e[e.BrowserSearch=120]="BrowserSearch",e[e.BrowserHome=121]="BrowserHome",e[e.BrowserBack=122]="BrowserBack",e[e.BrowserForward=123]="BrowserForward",e[e.MediaTrackNext=124]="MediaTrackNext",e[e.MediaTrackPrevious=125]="MediaTrackPrevious",e[e.MediaStop=126]="MediaStop",e[e.MediaPlayPause=127]="MediaPlayPause",e[e.LaunchMediaPlayer=128]="LaunchMediaPlayer",e[e.LaunchMail=129]="LaunchMail",e[e.LaunchApp2=130]="LaunchApp2",e[e.Clear=131]="Clear",e[e.MAX_VALUE=132]="MAX_VALUE"}(UI||(UI={})),function(e){e[e.Hint=1]="Hint",e[e.Info=2]="Info",e[e.Warning=4]="Warning",e[e.Error=8]="Error"}(KI||(KI={})),function(e){e[e.Unnecessary=1]="Unnecessary",e[e.Deprecated=2]="Deprecated"}(jI||(jI={})),function(e){e[e.Inline=1]="Inline",e[e.Gutter=2]="Gutter"}(qI||(qI={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.TEXTAREA=1]="TEXTAREA",e[e.GUTTER_GLYPH_MARGIN=2]="GUTTER_GLYPH_MARGIN",e[e.GUTTER_LINE_NUMBERS=3]="GUTTER_LINE_NUMBERS",e[e.GUTTER_LINE_DECORATIONS=4]="GUTTER_LINE_DECORATIONS",e[e.GUTTER_VIEW_ZONE=5]="GUTTER_VIEW_ZONE",e[e.CONTENT_TEXT=6]="CONTENT_TEXT",e[e.CONTENT_EMPTY=7]="CONTENT_EMPTY",e[e.CONTENT_VIEW_ZONE=8]="CONTENT_VIEW_ZONE",e[e.CONTENT_WIDGET=9]="CONTENT_WIDGET",e[e.OVERVIEW_RULER=10]="OVERVIEW_RULER",e[e.SCROLLBAR=11]="SCROLLBAR",e[e.OVERLAY_WIDGET=12]="OVERLAY_WIDGET",e[e.OUTSIDE_EDITOR=13]="OUTSIDE_EDITOR"}($I||($I={})),function(e){e[e.TOP_RIGHT_CORNER=0]="TOP_RIGHT_CORNER",e[e.BOTTOM_RIGHT_CORNER=1]="BOTTOM_RIGHT_CORNER",e[e.TOP_CENTER=2]="TOP_CENTER"}(GI||(GI={})),function(e){e[e.Left=1]="Left",e[e.Center=2]="Center",e[e.Right=4]="Right",e[e.Full=7]="Full"}(ZI||(ZI={})),function(e){e[e.Left=0]="Left",e[e.Right=1]="Right",e[e.None=2]="None",e[e.LeftOfInjectedText=3]="LeftOfInjectedText",e[e.RightOfInjectedText=4]="RightOfInjectedText"}(YI||(YI={})),function(e){e[e.Off=0]="Off",e[e.On=1]="On",e[e.Relative=2]="Relative",e[e.Interval=3]="Interval",e[e.Custom=4]="Custom"}(XI||(XI={})),function(e){e[e.None=0]="None",e[e.Text=1]="Text",e[e.Blocks=2]="Blocks"}(QI||(QI={})),function(e){e[e.Smooth=0]="Smooth",e[e.Immediate=1]="Immediate"}(JI||(JI={})),function(e){e[e.Auto=1]="Auto",e[e.Hidden=2]="Hidden",e[e.Visible=3]="Visible"}(eM||(eM={})),function(e){e[e.LTR=0]="LTR",e[e.RTL=1]="RTL"}(tM||(tM={})),function(e){e[e.Invoke=1]="Invoke",e[e.TriggerCharacter=2]="TriggerCharacter",e[e.ContentChange=3]="ContentChange"}(iM||(iM={})),function(e){e[e.File=0]="File",e[e.Module=1]="Module",e[e.Namespace=2]="Namespace",e[e.Package=3]="Package",e[e.Class=4]="Class",e[e.Method=5]="Method",e[e.Property=6]="Property",e[e.Field=7]="Field",e[e.Constructor=8]="Constructor",e[e.Enum=9]="Enum",e[e.Interface=10]="Interface",e[e.Function=11]="Function",e[e.Variable=12]="Variable",e[e.Constant=13]="Constant",e[e.String=14]="String",e[e.Number=15]="Number",e[e.Boolean=16]="Boolean",e[e.Array=17]="Array",e[e.Object=18]="Object",e[e.Key=19]="Key",e[e.Null=20]="Null",e[e.EnumMember=21]="EnumMember",e[e.Struct=22]="Struct",e[e.Event=23]="Event",e[e.Operator=24]="Operator",e[e.TypeParameter=25]="TypeParameter"}(nM||(nM={})),function(e){e[e.Deprecated=1]="Deprecated"}(sM||(sM={})),function(e){e[e.Hidden=0]="Hidden",e[e.Blink=1]="Blink",e[e.Smooth=2]="Smooth",e[e.Phase=3]="Phase",e[e.Expand=4]="Expand",e[e.Solid=5]="Solid"}(oM||(oM={})),function(e){e[e.Line=1]="Line",e[e.Block=2]="Block",e[e.Underline=3]="Underline",e[e.LineThin=4]="LineThin",e[e.BlockOutline=5]="BlockOutline",e[e.UnderlineThin=6]="UnderlineThin"}(rM||(rM={})),function(e){e[e.AlwaysGrowsWhenTypingAtEdges=0]="AlwaysGrowsWhenTypingAtEdges",e[e.NeverGrowsWhenTypingAtEdges=1]="NeverGrowsWhenTypingAtEdges",e[e.GrowsOnlyWhenTypingBefore=2]="GrowsOnlyWhenTypingBefore",e[e.GrowsOnlyWhenTypingAfter=3]="GrowsOnlyWhenTypingAfter"}(aM||(aM={})),function(e){e[e.None=0]="None",e[e.Same=1]="Same",e[e.Indent=2]="Indent",e[e.DeepIndent=3]="DeepIndent"}(lM||(lM={}));class hM{static chord(e,t){return pt(e,t)}}function dM(){return{editor:void 0,languages:void 0,CancellationTokenSource:jh,Emitter:U,KeyCode:UI,KeyMod:hM,Position:Va,Range:Rh,Selection:Ah,SelectionDirection:tM,MarkerSeverity:KI,MarkerTag:jI,Uri:an,Token:bC}}hM.CtrlCmd=2048,hM.Shift=1024,hM.Alt=512,hM.WinCtrl=256;class cM{static computeUnicodeHighlights(e,t,i){const n=i?i.startLineNumber:1,s=i?i.endLineNumber:e.getLineCount(),o=new uM(t),r=o.getCandidateCodePoints();let a;a="allNonBasicAscii"===r?new RegExp("[^\\t\\n\\r\\x20-\\x7E]","g"):new RegExp(""+`[${eo(Array.from(r).map((e=>String.fromCodePoint(e))).join(""))}]`,"g");const l=new eC(null,a),h=[];let d,c=!1,u=0,g=0,p=0;e:for(let m=n,f=s;m<=f;m++){const t=e.getLineContent(m),i=t.length;l.reset(0);do{if(d=l.next(t),d){let e=d.index,n=d.index+d[0].length;if(e>0){wo(t.charCodeAt(e-1))&&e--}if(n+1=t){c=!0;break e}h.push(new Rh(m,e+1,m,n+1))}}}while(d)}return{ranges:h,hasMore:c,ambiguousCharacterCount:u,invisibleCharacterCount:g,nonBasicAsciiCharacterCount:p}}static computeUnicodeHighlightReason(e,t){const i=new uM(t);switch(i.shouldHighlightNonBasicASCII(e,null)){case 0:return null;case 2:return{kind:1};case 3:{const n=e.codePointAt(0),s=i.ambiguousCharacters.getPrimaryConfusable(n),o=Ko.getLocales().filter((e=>!Ko.getInstance(new Set([...t.allowedLocales,e])).isAmbiguous(n)));return{kind:0,confusableWith:String.fromCodePoint(s),notAmbiguousInLocales:o}}case 1:return{kind:2}}}}class uM{constructor(e){this.options=e,this.allowedCodePoints=new Set(e.allowedCodePoints),this.ambiguousCharacters=Ko.getInstance(new Set(e.allowedLocales))}getCandidateCodePoints(){if(this.options.nonBasicASCII)return"allNonBasicAscii";const e=new Set;if(this.options.invisibleCharacters)for(const t of jo.codePoints)gM(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 0;if(this.options.nonBasicASCII)return 1;let n=!1,s=!1;if(t)for(const o of t){const e=o.codePointAt(0),t=To(o);n=n||t,t||this.ambiguousCharacters.isAmbiguous(e)||jo.isInvisibleCharacter(e)||(s=!0)}return!n&&s?0:this.options.invisibleCharacters&&!gM(e)&&jo.isInvisibleCharacter(i)?2:this.options.ambiguousCharacters&&this.ambiguousCharacters.isAmbiguous(i)?3:0}}function gM(e){return" "===e||"\n"===e||"\t"===e}class pM{constructor(e,t,i){this.changes=e,this.moves=t,this.hitTimeout=i}}class mM{constructor(e,t){this.lineRangeMapping=e,this.changes=t}}class fM{static inverse(e,t,i){const n=[];let s=1,o=1;for(const a of e){const e=new _M(new wc(s,a.original.startLineNumber),new wc(o,a.modified.startLineNumber),void 0);e.modified.isEmpty||n.push(e),s=a.original.endLineNumberExclusive,o=a.modified.endLineNumberExclusive}const r=new _M(new wc(s,t+1),new wc(o,i+1),void 0);return r.modified.isEmpty||n.push(r),n}constructor(e,t){this.original=e,this.modified=t}toString(){return`{${this.original.toString()}->${this.modified.toString()}}`}flip(){return new fM(this.modified,this.original)}join(e){return new fM(this.original.join(e.original),this.modified.join(e.modified))}}class _M extends fM{constructor(e,t,i){super(e,t),this.innerChanges=i}flip(){var e;return new _M(this.modified,this.original,null===(e=this.innerChanges)||void 0===e?void 0:e.map((e=>e.flip())))}}class vM{constructor(e,t){this.originalRange=e,this.modifiedRange=t}toString(){return`{${this.originalRange.toString()}->${this.modifiedRange.toString()}}`}flip(){return new vM(this.modifiedRange,this.originalRange)}}class bM{computeDiff(e,t,i){var n;const s=new kM(e,t,{maxComputationTime:i.maxComputationTimeMs,shouldIgnoreTrimWhitespace:i.ignoreTrimWhitespace,shouldComputeCharChanges:!0,shouldMakePrettyDiff:!0,shouldPostProcessCharChanges:!0}).computeDiff(),o=[];let r=null;for(const a of s.changes){let e,t;e=0===a.originalEndLineNumber?new wc(a.originalStartLineNumber+1,a.originalStartLineNumber+1):new wc(a.originalStartLineNumber,a.originalEndLineNumber+1),t=0===a.modifiedEndLineNumber?new wc(a.modifiedStartLineNumber+1,a.modifiedStartLineNumber+1):new wc(a.modifiedStartLineNumber,a.modifiedEndLineNumber+1);let i=new _M(e,t,null===(n=a.charChanges)||void 0===n?void 0:n.map((e=>new vM(new Rh(e.originalStartLineNumber,e.originalStartColumn,e.originalEndLineNumber,e.originalEndColumn),new Rh(e.modifiedStartLineNumber,e.modifiedStartColumn,e.modifiedEndLineNumber,e.modifiedEndColumn)))));r&&(r.modified.endLineNumberExclusive!==i.modified.startLineNumber&&r.original.endLineNumberExclusive!==i.original.startLineNumber||(i=new _M(r.original.join(i.original),r.modified.join(i.modified),r.innerChanges&&i.innerChanges?r.innerChanges.concat(i.innerChanges):void 0),o.pop())),o.push(i),r=i}return Ul((()=>Kl(o,((e,t)=>t.original.startLineNumber-e.original.endLineNumberExclusive==t.modified.startLineNumber-e.modified.endLineNumberExclusive&&e.original.endLineNumberExclusive(10===e?"\\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-1===e?this.getStartLineNumber(e+1):(this._assertIndex(e,this._lineNumbers),10===this._charCodes[e]?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-1===e?this.getStartColumn(e+1):(this._assertIndex(e,this._columns),10===this._charCodes[e]?1:this._columns[e]+1)}}class SM{constructor(e,t,i,n,s,o,r,a){this.originalStartLineNumber=e,this.originalStartColumn=t,this.originalEndLineNumber=i,this.originalEndColumn=n,this.modifiedStartLineNumber=s,this.modifiedStartColumn=o,this.modifiedEndLineNumber=r,this.modifiedEndColumn=a}static createFromDiffChange(e,t,i){const n=t.getStartLineNumber(e.originalStart),s=t.getStartColumn(e.originalStart),o=t.getEndLineNumber(e.originalStart+e.originalLength-1),r=t.getEndColumn(e.originalStart+e.originalLength-1),a=i.getStartLineNumber(e.modifiedStart),l=i.getStartColumn(e.modifiedStart),h=i.getEndLineNumber(e.modifiedStart+e.modifiedLength-1),d=i.getEndColumn(e.modifiedStart+e.modifiedLength-1);return new SM(n,s,o,r,a,l,h,d)}}class LM{constructor(e,t,i,n,s){this.originalStartLineNumber=e,this.originalEndLineNumber=t,this.modifiedStartLineNumber=i,this.modifiedEndLineNumber=n,this.charChanges=s}static createFromDiffResult(e,t,i,n,s,o,r){let a,l,h,d,c;if(0===t.originalLength?(a=i.getStartLineNumber(t.originalStart)-1,l=0):(a=i.getStartLineNumber(t.originalStart),l=i.getEndLineNumber(t.originalStart+t.originalLength-1)),0===t.modifiedLength?(h=n.getStartLineNumber(t.modifiedStart)-1,d=0):(h=n.getStartLineNumber(t.modifiedStart),d=n.getEndLineNumber(t.modifiedStart+t.modifiedLength-1)),o&&t.originalLength>0&&t.originalLength<20&&t.modifiedLength>0&&t.modifiedLength<20&&s()){const o=i.createCharSequence(e,t.originalStart,t.originalStart+t.originalLength-1),a=n.createCharSequence(e,t.modifiedStart,t.modifiedStart+t.modifiedLength-1);if(o.getElements().length>0&&a.getElements().length>0){let e=CM(o,a,s,!0).changes;r&&(e=function(e){if(e.length<=1)return e;const t=[e[0]];let i=t[0];for(let n=1,s=e.length;n1&&r>1;){if(e.charCodeAt(i-2)!==t.charCodeAt(r-2))break;i--,r--}(i>1||r>1)&&this._pushTrimWhitespaceCharChange(n,s+1,1,i,o+1,1,r)}{let i=xM(e,1),r=xM(t,1);const a=e.length+1,l=t.length+1;for(;i!0;const t=Date.now();return()=>Date.now()-t{i.push(IM.fromOffsetPairs(e?e.getEndExclusives():MM.zero,n?n.getStarts():new MM(t,(e?e.seq2Range.endExclusive-e.seq1Range.endExclusive:0)+t)))})),i}static fromOffsetPairs(e,t){return new IM(new uc(e.offset1,t.offset1),new uc(e.offset2,t.offset2))}constructor(e,t){this.seq1Range=e,this.seq2Range=t}swap(){return new IM(this.seq2Range,this.seq1Range)}toString(){return`${this.seq1Range} <-> ${this.seq2Range}`}join(e){return new IM(this.seq1Range.join(e.seq1Range),this.seq2Range.join(e.seq2Range))}delta(e){return 0===e?this:new IM(this.seq1Range.delta(e),this.seq2Range.delta(e))}deltaStart(e){return 0===e?this:new IM(this.seq1Range.deltaStart(e),this.seq2Range.deltaStart(e))}deltaEnd(e){return 0===e?this:new IM(this.seq1Range.deltaEnd(e),this.seq2Range.deltaEnd(e))}intersect(e){const t=this.seq1Range.intersect(e.seq1Range),i=this.seq2Range.intersect(e.seq2Range);if(t&&i)return new IM(t,i)}getStarts(){return new MM(this.seq1Range.start,this.seq2Range.start)}getEndExclusives(){return new MM(this.seq1Range.endExclusive,this.seq2Range.endExclusive)}}class MM{constructor(e,t){this.offset1=e,this.offset2=t}toString(){return`${this.offset1} <-> ${this.offset2}`}}MM.zero=new MM(0,0),MM.max=new MM(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER);class TM{isValid(){return!0}}TM.instance=new TM;class RM{constructor(e){if(this.timeout=e,this.startTime=Date.now(),this.valid=!0,e<=0)throw new f("timeout must be positive")}isValid(){return!(Date.now()-this.startTime0&&a>0&&3===o.get(g-1,a-1)&&(d+=r.get(g-1,a-1)),d+=n?n(g,a):1):d=-1;const c=Math.max(l,h,d);if(c===d){const e=g>0&&a>0?r.get(g-1,a-1):0;r.set(g,a,e+1),o.set(g,a,3)}else c===l?(r.set(g,a,0),o.set(g,a,1)):c===h&&(r.set(g,a,0),o.set(g,a,2));s.set(g,a,c)}const a=[];let l=e.length,h=t.length;function d(e,t){e+1===l&&t+1===h||a.push(new IM(new uc(e+1,l),new uc(t+1,h))),l=e,h=t}let c=e.length-1,u=t.length-1;for(;c>=0&&u>=0;)3===o.get(c,u)?(d(c,u),c--,u--):1===o.get(c,u)?c--:u--;return d(-1,-1),a.reverse(),new EM(a,!1)}}class BM{compute(e,t,i=TM.instance){if(0===e.length||0===t.length)return EM.trivial(e,t);const n=e,s=t;function o(e,t){for(;en.length||u>s.length)continue;const g=o(c,u);a.set(h,g);const p=c===r?l.get(h+1):l.get(h-1);if(l.set(h,g!==c?new WM(p,c,u,g-c):p),a.get(h)===n.length&&a.get(h)-h===s.length)break e}}let d=l.get(h);const c=[];let u=n.length,g=s.length;for(;;){const e=d?d.x+d.length:0,t=d?d.y+d.length:0;if(e===u&&t===g||c.push(new IM(new uc(e,u),new uc(t,g))),!d)break;u=d.x,g=d.y,d=d.prev}return c.reverse(),new EM(c,!1)}}class WM{constructor(e,t,i,n){this.prev=e,this.x=t,this.y=i,this.length=n}}class VM{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)>=this.negativeArr.length){const e=this.negativeArr;this.negativeArr=new Int32Array(2*e.length),this.negativeArr.set(e)}this.negativeArr[e]=t}else{if(e>=this.positiveArr.length){const e=this.positiveArr;this.positiveArr=new Int32Array(2*e.length),this.positiveArr.set(e)}this.positiveArr[e]=t}}}class HM{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 zM{constructor(e,t,i){this.lines=e,this.considerWhitespaceChanges=i,this.elements=[],this.firstCharOffsetByLine=[],this.additionalOffsetByLine=[];let n=!1;t.start>0&&t.endExclusive>=e.length&&(t=new uc(t.start-1,t.endExclusive),n=!0),this.lineRange=t,this.firstCharOffsetByLine[0]=0;for(let s=this.lineRange.start;sString.fromCharCode(e))).join("")}getElement(e){return this.elements[e]}get length(){return this.elements.length}getBoundaryScore(e){const t=qM(e>0?this.elements[e-1]:-1),i=qM(et<=e));return new Va(this.lineRange.start+t+1,e-this.firstCharOffsetByLine[t]+this.additionalOffsetByLine[t]+1)}translateRange(e){return Rh.fromPositions(this.translateOffset(e.start),this.translateOffset(e.endExclusive))}findWordContaining(e){if(e<0||e>=this.elements.length)return;if(!UM(this.elements[e]))return;let t=e;for(;t>0&&UM(this.elements[t-1]);)t--;let i=e;for(;it<=e.start)))&&void 0!==t?t:0,s=null!==(i=function(e,t){const i=_c(e,t);return i===e.length?void 0:e[i]}(this.firstCharOffsetByLine,(t=>e.endExclusive<=t)))&&void 0!==i?i:this.elements.length;return new uc(n,s)}}function UM(e){return e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57}const KM={0:0,1:0,2:0,3:10,4:2,5:3,6:10,7:10};function jM(e){return KM[e]}function qM(e){return 10===e?7:13===e?6:OM(e)?5:e>=97&&e<=122?0:e>=65&&e<=90?1:e>=48&&e<=57?2:-1===e?3:4}function $M(e,t,i,n,s,o){let{moves:r,excludedChanges:a}=function(e,t,i,n){const s=[],o=e.filter((e=>e.modified.isEmpty&&e.original.length>=3)).map((e=>new PM(e.original,t,e))),r=new Set(e.filter((e=>e.original.isEmpty&&e.modified.length>=3)).map((e=>new PM(e.modified,i,e)))),a=new Set;for(const l of o){let e,t=-1;for(const i of r){const n=l.computeSimilarity(i);n>t&&(t=n,e=i)}if(t>.9&&e&&(r.delete(e),s.push(new fM(l.range,e.range)),a.add(l.source),a.add(e.source)),!n.isValid())return{moves:s,excludedChanges:a}}return{moves:s,excludedChanges:a}}(e,t,i,o);if(!o.isValid())return[];const l=function(e,t,i,n,s,o){const r=[],a=new $s;for(const u of e)for(let e=u.original.startLineNumber;ee.modified.startLineNumber),Jd));for(const u of e){let e=[];for(let t=u.modified.startLineNumber;t{for(const n of e)if(n.originalLineRange.endLineNumberExclusive+1===t.endLineNumberExclusive&&n.modifiedLineRange.endLineNumberExclusive+1===s.endLineNumberExclusive)return n.originalLineRange=new wc(n.originalLineRange.startLineNumber,t.endLineNumberExclusive),n.modifiedLineRange=new wc(n.modifiedLineRange.startLineNumber,s.endLineNumberExclusive),void o.push(n);const i={modifiedLineRange:s,originalLineRange:t};l.push(i),o.push(i)})),e=o}if(!o.isValid())return[]}l.sort(tc(Qd((e=>e.modifiedLineRange.length),Jd)));const h=new yc,d=new yc;for(const u of l){const e=u.modifiedLineRange.startLineNumber-u.originalLineRange.startLineNumber,t=h.subtractFrom(u.modifiedLineRange),i=d.subtractFrom(u.originalLineRange).getWithDelta(e),n=t.getIntersection(i);for(const s of n.ranges){if(s.length<3)continue;const t=s,i=s.delta(-e);r.push(new fM(i,t)),h.addRange(t),d.addRange(i)}}r.sort(Qd((e=>e.original.startLineNumber),Jd));const c=new vc(e);for(let u=0;ue.original.startLineNumber<=t.original.startLineNumber)),a=mc(e,(e=>e.modified.startLineNumber<=t.modified.startLineNumber)),l=Math.max(t.original.startLineNumber-i.original.startLineNumber,t.modified.startLineNumber-a.modified.startLineNumber),g=c.findLastMonotonous((e=>e.original.startLineNumbere.modified.startLineNumbern.length||i>s.length)break;if(h.contains(i)||d.contains(e))break;if(!GM(n[e-1],s[i-1],o))break}for(f>0&&(d.addRange(new wc(t.original.startLineNumber-f,t.original.startLineNumber)),h.addRange(new wc(t.modified.startLineNumber-f,t.modified.startLineNumber))),_=0;_n.length||i>s.length)break;if(h.contains(i)||d.contains(e))break;if(!GM(n[e-1],s[i-1],o))break}_>0&&(d.addRange(new wc(t.original.endLineNumberExclusive,t.original.endLineNumberExclusive+_)),h.addRange(new wc(t.modified.endLineNumberExclusive,t.modified.endLineNumberExclusive+_))),(f>0||_>0)&&(r[u]=new fM(new wc(t.original.startLineNumber-f,t.original.endLineNumberExclusive+_),new wc(t.modified.startLineNumber-f,t.modified.endLineNumberExclusive+_)))}return r}(e.filter((e=>!a.has(e))),n,s,t,i,o);return Gd(r,l),r=function(e){if(0===e.length)return e;e.sort(Qd((e=>e.original.startLineNumber),Jd));const t=[e[0]];for(let i=1;i=0&&r>=0&&o+r<=2?t[t.length-1]=n.join(s):t.push(s)}return t}(r),r=r.filter((e=>e.original.toOffsetRange().slice(t).map((e=>e.trim())).join("\n").length>=10)),r=function(e,t){const i=new vc(e);return t=t.filter((t=>(i.findLastMonotonous((e=>e.original.endLineNumberExclusivee.modified.endLineNumberExclusive300&&t.length>300)return!1;const n=(new BM).compute(new zM([e],new uc(0,1),!1),new zM([t],new uc(0,1),!1),i);let s=0;const o=IM.invert(n.diffs,e.length);for(const a of o)a.seq1Range.forEach((t=>{OM(e.charCodeAt(t))||s++}));const r=function(t){let i=0;for(let n=0;nt.length?e:t);return s/r>.6&&r>10}function ZM(e,t,i){let n=i;return n=function(e,t,i){if(0===i.length)return i;const n=[];n.push(i[0]);for(let o=1;o0&&(r=r.delta(a))}s.push(r)}n.length>0&&s.push(n[n.length-1]);return s}(e,t,n),n=function(e,t,i){if(!e.getBoundaryScore||!t.getBoundaryScore)return i;for(let n=0;n0?i[n-1]:void 0,o=i[n],r=n+1=n.start&&e.seq2Range.start-o>=s.start&&i.isStronglyEqual(e.seq2Range.start-o,e.seq2Range.endExclusive-o)&&o<100;)o++;o--;let r=0;for(;e.seq1Range.start+rl&&(l=r,a=h)}return e.delta(a)}class XM{constructor(e,t){this.trimmedHash=e,this.lines=t}getElement(e){return this.trimmedHash[e]}get length(){return this.trimmedHash.length}getBoundaryScore(e){return 1e3-((0===e?0:QM(this.lines[e-1]))+(e===this.lines.length?0:QM(this.lines[e])))}getText(e){return this.lines.slice(e.start,e.endExclusive).join("\n")}isStronglyEqual(e,t){return this.lines[e]===this.lines[t]}}function QM(e){let t=0;for(;te===t)))return new pM([],[],!1);if(1===e.length&&0===e[0].length||1===t.length&&0===t[0].length)return new pM([new _M(new wc(1,e.length+1),new wc(1,t.length+1),[new vM(new Rh(1,1,e.length,e[0].length+1),new Rh(1,1,t.length,t[0].length+1))])],[],!1);const n=0===i.maxComputationTimeMs?TM.instance:new RM(i.maxComputationTimeMs),s=!i.ignoreTrimWhitespace,o=new Map;function r(e){let t=o.get(e);return void 0===t&&(t=o.size,o.set(e,t)),t}const a=e.map((e=>r(e.trim()))),l=t.map((e=>r(e.trim()))),h=new XM(a,e),d=new XM(l,t),c=(()=>h.length+d.length<1700?this.dynamicProgrammingDiffing.compute(h,d,n,((i,n)=>e[i]===t[n]?0===t[n].length?.1:1+Math.log(1+t[n].length):.99)):this.myersDiffingAlgorithm.compute(h,d))();let u=c.diffs,g=c.hitTimeout;u=ZM(h,d,u),u=function(e,t,i){let n=i;if(0===n.length)return n;let s,o=0;do{s=!1;const r=[n[0]];for(let a=1;a5||i.seq1Range.length+i.seq2Range.length>5)}d(h,l)?(s=!0,r[r.length-1]=r[r.length-1].join(l)):r.push(l)}n=r}while(o++<10&&s);return n}(h,0,u);const p=[],m=i=>{if(s)for(let o=0;oC.seq1Range.start-f==C.seq2Range.start-_));m(C.seq1Range.start-f),f=C.seq1Range.endExclusive,_=C.seq2Range.endExclusive;const i=this.refineDiff(e,t,C,n,s);i.hitTimeout&&(g=!0);for(const e of i.mappings)p.push(e)}m(e.length-f);const v=eT(p,e,t);let b=[];return i.computeMoves&&(b=this.computeMoves(v,e,t,a,l,n,s)),Ul((()=>{function i(e,t){if(e.lineNumber<1||e.lineNumber>t.length)return!1;const i=t[e.lineNumber-1];return!(e.column<1||e.column>i.length+1)}function n(e,t){return!(e.startLineNumber<1||e.startLineNumber>t.length+1)&&!(e.endLineNumberExclusive<1||e.endLineNumberExclusive>t.length+1)}for(const s of v){if(!s.innerChanges)return!1;for(const n of s.innerChanges){if(!(i(n.modifiedRange.getStartPosition(),t)&&i(n.modifiedRange.getEndPosition(),t)&&i(n.originalRange.getStartPosition(),e)&&i(n.originalRange.getEndPosition(),e)))return!1}if(!n(s.modified,t)||!n(s.original,e))return!1}return!0})),new pM(v,b,g)}computeMoves(e,t,i,n,s,o,r){return $M(e,t,i,n,s,o).map((e=>{const n=eT(this.refineDiff(t,i,new IM(e.original.toOffsetRange(),e.modified.toOffsetRange()),o,r).mappings,t,i,!0);return new mM(e,n)}))}refineDiff(e,t,i,n,s){const o=new zM(e,i.seq1Range,s),r=new zM(t,i.seq2Range,s),a=o.length+r.length<500?this.dynamicProgrammingDiffing.compute(o,r,n):this.myersDiffingAlgorithm.compute(o,r,n);let l=a.diffs;l=ZM(o,r,l),l=function(e,t,i){const n=[];let s;function o(){if(!s)return;const e=s.s1Range.length-s.deleted;s.s2Range.length,s.added,Math.max(s.deleted,s.added)+(s.count-1)>e&&n.push(new IM(s.s1Range,s.s2Range)),s=void 0}for(const r of i){function a(e,t){var i,n,a,l;if(!s||!s.s1Range.containsRange(e)||!s.s2Range.containsRange(t))if(!s||s.s1Range.endExclusive0||t.length>0;){const n=e[0],s=t[0];let o;o=n&&(!s||n.seq1Range.start0&&i[i.length-1].seq1Range.endExclusive>=o.seq1Range.start?i[i.length-1]=i[i.length-1].join(o):i.push(o)}return i}(i,n)}(o,r,l),l=function(e,t,i){const n=[];for(const s of i){const e=n[n.length-1];e&&(s.seq1Range.start-e.seq1Range.endExclusive<=2||s.seq2Range.start-e.seq2Range.endExclusive<=2)?n[n.length-1]=new IM(e.seq1Range.join(s.seq1Range),e.seq2Range.join(s.seq2Range)):n.push(s)}return n}(0,0,l),l=function(e,t,i){let n=i;if(0===n.length)return n;let s,o=0;do{s=!1;const a=[n[0]];for(let l=1;l5||s.length>500)return!1;const o=e.getText(s).trim();if(o.length>20||o.split(/\r\n|\r|\n/).length>1)return!1;const r=e.countLinesIn(i.seq1Range),a=i.seq1Range.length,l=t.countLinesIn(i.seq2Range),c=i.seq2Range.length,u=e.countLinesIn(n.seq1Range),g=n.seq1Range.length,p=t.countLinesIn(n.seq2Range),m=n.seq2Range.length;function f(e){return Math.min(e,130)}return Math.pow(Math.pow(f(40*r+a),1.5)+Math.pow(f(40*l+c),1.5),1.5)+Math.pow(Math.pow(f(40*u+g),1.5)+Math.pow(f(40*p+m),1.5),1.5)>1.3*Math.pow(Math.pow(130,1.5),1.5)}c(d,h)?(s=!0,a[a.length-1]=a[a.length-1].join(h)):a.push(h)}n=a}while(o++<10&&s);const r=[];return function(e,t){for(let i=0;i{let s=i;function o(e){return e.length>0&&e.trim().length<=3&&i.seq1Range.length+i.seq2Range.length>100}const a=e.extendToFullLines(i.seq1Range),l=e.getText(new uc(a.start,i.seq1Range.start));o(l)&&(s=s.deltaStart(-l.length));const h=e.getText(new uc(i.seq1Range.endExclusive,a.endExclusive));o(h)&&(s=s.deltaEnd(h.length));const d=IM.fromOffsetPairs(t?t.getEndExclusives():MM.zero,n?n.getStarts():MM.max),c=s.intersect(d);r.push(c)})),r}(o,r,l);return{mappings:l.map((e=>new vM(o.translateRange(e.seq1Range),r.translateRange(e.seq2Range)))),hitTimeout:a.hitTimeout}}}function eT(e,t,i,n=!1){const s=[];for(const o of Pd(e.map((e=>function(e,t,i){let n=0,s=0;1===e.modifiedRange.endColumn&&1===e.originalRange.endColumn&&e.originalRange.startLineNumber+n<=e.originalRange.endLineNumber&&e.modifiedRange.startLineNumber+n<=e.modifiedRange.endLineNumber&&(s=-1);e.modifiedRange.startColumn-1>=i[e.modifiedRange.startLineNumber-1].length&&e.originalRange.startColumn-1>=t[e.originalRange.startLineNumber-1].length&&e.originalRange.startLineNumber<=e.originalRange.endLineNumber+s&&e.modifiedRange.startLineNumber<=e.modifiedRange.endLineNumber+s&&(n=1);const o=new wc(e.originalRange.startLineNumber+n,e.originalRange.endLineNumber+1+s),r=new wc(e.modifiedRange.startLineNumber+n,e.modifiedRange.endLineNumber+1+s);return new _M(o,r,[e])}(e,t,i))),((e,t)=>e.original.overlapOrTouch(t.original)||e.modified.overlapOrTouch(t.modified)))){const e=o[0],t=o[o.length-1];s.push(new _M(e.original.join(t.original),e.modified.join(t.modified),o.map((e=>e.innerChanges[0]))))}return Ul((()=>!(!n&&s.length>0&&s[0].original.startLineNumber!==s[0].modified.startLineNumber)&&Kl(s,((e,t)=>t.original.startLineNumber-e.original.endLineNumberExclusive==t.modified.startLineNumber-e.modified.endLineNumberExclusive&&e.original.endLineNumberExclusivenew bM,iT=()=>new JM;function nT(e){const t=[];for(const i of e){const e=Number(i);(e||0===e&&""!==i.replace(/\s/g,""))&&t.push(e)}return t}function sT(e,t,i,n){return{red:e/255,blue:i/255,green:t/255,alpha:n}}function oT(e,t){const i=t.index,n=t[0].length;if(!i)return;const s=e.positionAt(i);return{startLineNumber:s.lineNumber,startColumn:s.column,endLineNumber:s.lineNumber,endColumn:s.column+n}}function rT(e,t){if(!e)return;const i=lc.Format.CSS.parseHex(t);return i?{range:e,color:sT(i.rgba.r,i.rgba.g,i.rgba.b,i.rgba.a)}:void 0}function aT(e,t,i){if(!e||1!==t.length)return;const n=nT(t[0].values());return{range:e,color:sT(n[0],n[1],n[2],i?n[3]:1)}}function lT(e,t,i){if(!e||1!==t.length)return;const n=nT(t[0].values()),s=new lc(new rc(n[0],n[1]/100,n[2]/100,i?n[3]:1));return{range:e,color:sT(s.rgba.r,s.rgba.g,s.rgba.b,s.rgba.a)}}function hT(e,t){return"string"==typeof e?[...e.matchAll(t)]:e.findMatches(t)}function dT(e){return e&&"function"==typeof e.getValue&&"function"==typeof e.positionAt?function(e){const t=[],i=hT(e,/\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 i=n.filter((e=>void 0!==e)),s=i[1],o=i[2];if(!o)continue;let r;if("rgb"===s){const t=/^\(\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;r=aT(oT(e,n),hT(o,t),!1)}else if("rgba"===s){const t=/^\(\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;r=aT(oT(e,n),hT(o,t),!0)}else if("hsl"===s){const t=/^\(\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;r=lT(oT(e,n),hT(o,t),!1)}else if("hsla"===s){const t=/^\(\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;r=lT(oT(e,n),hT(o,t),!0)}else"#"===s&&(r=rT(oT(e,n),s+o));r&&t.push(r)}return t}(e):[]}var cT=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class uT extends _I{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 e=this._lines[t-1].length+1;i<1?(i=1,n=!0):i>e&&(i=e,n=!0)}return n?{lineNumber:t,column:i}:e}}class gT{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 uT(an.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]}computeUnicodeHighlights(e,t,i){return cT(this,void 0,void 0,(function*(){const n=this._getModel(e);return n?cM.computeUnicodeHighlights(n,t,i):{ranges:[],hasMore:!1,ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0}}))}computeDiff(e,t,i,n){return cT(this,void 0,void 0,(function*(){const s=this._getModel(e),o=this._getModel(t);return s&&o?gT.computeDiff(s,o,i,n):null}))}static computeDiff(e,t,i,n){const s="advanced"===n?iT():tT(),o=e.getLinesContent(),r=t.getLinesContent(),a=s.computeDiff(o,r,i);function l(e){return e.map((e=>{var t;return[e.original.startLineNumber,e.original.endLineNumberExclusive,e.modified.startLineNumber,e.modified.endLineNumberExclusive,null===(t=e.innerChanges)||void 0===t?void 0:t.map((e=>[e.originalRange.startLineNumber,e.originalRange.startColumn,e.originalRange.endLineNumber,e.originalRange.endColumn,e.modifiedRange.startLineNumber,e.modifiedRange.startColumn,e.modifiedRange.endLineNumber,e.modifiedRange.endColumn]))]}))}return{identical:!(a.changes.length>0)&&this._modelsAreIdentical(e,t),quitEarly:a.hitTimeout,changes:l(a.changes),moves:a.moves.map((e=>[e.lineRangeMapping.original.startLineNumber,e.lineRangeMapping.original.endLineNumberExclusive,e.lineRangeMapping.modified.startLineNumber,e.lineRangeMapping.modified.endLineNumberExclusive,l(e.changes)]))}}static _modelsAreIdentical(e,t){const i=e.getLineCount();if(i!==t.getLineCount())return!1;for(let n=1;n<=i;n++){if(e.getLineContent(n)!==t.getLineContent(n))return!1}return!0}computeMoreMinimalEdits(e,t,i){return cT(this,void 0,void 0,(function*(){const n=this._getModel(e);if(!n)return t;const s=[];let o;t=t.slice(0).sort(((e,t)=>{if(e.range&&t.range)return Rh.compareRangesUsingStarts(e.range,t.range);return(e.range?0:1)-(t.range?0:1)}));let r=0;for(let e=1;egT._diffLimit){s.push({range:e,text:a});continue}const r=hI(t,a,i),h=n.offsetAt(Rh.lift(e).getStartPosition());for(const e of r){const t=n.positionAt(h+e.originalStart),i=n.positionAt(h+e.originalStart+e.originalLength),o={text:a.substr(e.modifiedStart,e.modifiedLength),range:{startLineNumber:t.lineNumber,startColumn:t.column,endLineNumber:i.lineNumber,endColumn:i.column}};n.getValueInRange(o.range)!==o.text&&s.push(o)}}return"number"==typeof o&&s.push({eol:o,text:"",range:{startLineNumber:0,startColumn:0,endLineNumber:0,endColumn:0}}),s}))}computeLinks(e){return cT(this,void 0,void 0,(function*(){const t=this._getModel(e);return t?function(e){return e&&"function"==typeof e.getLineCount&&"function"==typeof e.getLineContent?yI.computeLinks(e):[]}(t):null}))}computeDefaultDocumentColors(e){return cT(this,void 0,void 0,(function*(){const t=this._getModel(e);return t?dT(t):null}))}textualSuggest(e,t,i,n){return cT(this,void 0,void 0,(function*(){const s=new F,o=new RegExp(i,n),r=new Set;e:for(const i of e){const e=this._getModel(i);if(e)for(const i of e.words(o))if(i!==t&&isNaN(Number(i))&&(r.add(i),r.size>gT._suggestionsLimit))break e}return{words:Array.from(r),duration:s.elapsed()}}))}computeWordRanges(e,t,i,n){return cT(this,void 0,void 0,(function*(){const s=this._getModel(e);if(!s)return Object.create(null);const o=new RegExp(i,n),r=Object.create(null);for(let e=t.startLineNumber;efunction(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)},n={};for(const s of e)n[s]=i(s);return n}(i,((e,t)=>this._host.fhr(e,t))),s={host:n,getMirrorModels:()=>this._getModels()};return this._foreignModuleFactory?(this._foreignModule=this._foreignModuleFactory(s,t),Promise.resolve(bd(this._foreignModule))):Promise.reject(new Error("Unexpected usage"))}fmr(e,t){if(!this._foreignModule||"function"!=typeof this._foreignModule[e])return Promise.reject(new Error("Missing requestHandler or method: "+e));try{return Promise.resolve(this._foreignModule[e].apply(this._foreignModule,t))}catch(Mre){return Promise.reject(Mre)}}}gT._diffLimit=1e5,gT._suggestionsLimit=1e4,"function"==typeof importScripts&&(globalThis.monaco=dM());const pT=Ba("textResourceConfigurationService"),mT=Ba("textResourcePropertiesService");var fT=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},_T=function(e,t){return function(i,n){t(i,n,e)}},vT=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const bT=3e5;function CT(e,t){const i=e.getModel(t);return!!i&&!i.isTooLargeForSyncing()}let wT=class extends E{constructor(e,t,i,n,s){super(),this._modelService=e,this._workerManager=this._register(new ST(this._modelService,n)),this._logService=i,this._register(s.linkProvider.register({language:"*",hasAccessToAllModels:!0},{provideLinks:(e,t)=>CT(this._modelService,e.uri)?this._workerManager.withWorker().then((t=>t.computeLinks(e.uri))).then((e=>e&&{links:e})):Promise.resolve({links:[]})})),this._register(s.completionProvider.register("*",new yT(this._workerManager,t,this._modelService,n)))}dispose(){super.dispose()}canComputeUnicodeHighlights(e){return CT(this._modelService,e)}computedUnicodeHighlights(e,t,i){return this._workerManager.withWorker().then((n=>n.computedUnicodeHighlights(e,t,i)))}computeDiff(e,t,i,n){return vT(this,void 0,void 0,(function*(){const s=yield this._workerManager.withWorker().then((s=>s.computeDiff(e,t,i,n)));if(!s)return null;return{identical:s.identical,quitEarly:s.quitEarly,changes:o(s.changes),moves:s.moves.map((e=>new mM(new fM(new wc(e[0],e[1]),new wc(e[2],e[3])),o(e[4]))))};function o(e){return e.map((e=>{var t;return new _M(new wc(e[0],e[1]),new wc(e[2],e[3]),null===(t=e[4])||void 0===t?void 0:t.map((e=>new vM(new Rh(e[0],e[1],e[2],e[3]),new Rh(e[4],e[5],e[6],e[7])))))}))}}))}computeMoreMinimalEdits(e,t,i=!1){if(Hd(t)){if(!CT(this._modelService,e))return Promise.resolve(t);const n=F.create(),s=this._workerManager.withWorker().then((n=>n.computeMoreMinimalEdits(e,t,i)));return s.finally((()=>this._logService.trace("FORMAT#computeMoreMinimalEdits",e.toString(!0),n.elapsed()))),Promise.race([s,td(1e3).then((()=>t))])}return Promise.resolve(void 0)}canNavigateValueSet(e){return CT(this._modelService,e)}navigateValueSet(e,t,i){return this._workerManager.withWorker().then((n=>n.navigateValueSet(e,t,i)))}canComputeWordRanges(e){return CT(this._modelService,e)}computeWordRanges(e,t){return this._workerManager.withWorker().then((i=>i.computeWordRanges(e,t)))}};wT=fT([_T(0,Ha),_T(1,pT),_T(2,hh),_T(3,Ju),_T(4,oL)],wT);class yT{constructor(e,t,i,n){this.languageConfigurationService=n,this._debugDisplayName="wordbasedCompletions",this._workerManager=e,this._configurationService=t,this._modelService=i}provideCompletionItems(e,t){return vT(this,void 0,void 0,(function*(){const i=this._configurationService.getValue(e.uri,t,"editor");if(!i.wordBasedSuggestions)return;const n=[];if("currentDocument"===i.wordBasedSuggestionsMode)CT(this._modelService,e.uri)&&n.push(e.uri);else for(const t of this._modelService.getModels())CT(this._modelService,t.uri)&&(t===e?n.unshift(t.uri):"allDocuments"!==i.wordBasedSuggestionsMode&&t.getLanguageId()!==e.getLanguageId()||n.push(t.uri));if(0===n.length)return;const s=this.languageConfigurationService.getLanguageConfiguration(e.getLanguageId()).getWordDefinition(),o=e.getWordAtPosition(t),r=o?new Rh(t.lineNumber,o.startColumn,t.lineNumber,o.endColumn):Rh.fromPositions(t),a=r.setEndPosition(t.lineNumber,t.column),l=yield this._workerManager.withWorker(),h=yield l.textualSuggest(n,null==o?void 0:o.word,s);return h?{duration:h.duration,suggestions:h.words.map((e=>({kind:18,label:e,insertText:e,range:{insert:a,replace:r}})))}:void 0}))}}class ST extends E{constructor(e,t){super(),this.languageConfigurationService=t,this._modelService=e,this._editorWorkerClient=null,this._lastWorkerUsedTime=(new Date).getTime();this._register(new od).cancelAndSet((()=>this._checkStopIdleWorker()),Math.round(15e4)),this._register(this._modelService.onModelRemoved((e=>this._checkStopEmptyWorker())))}dispose(){this._editorWorkerClient&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null),super.dispose()}_checkStopEmptyWorker(){if(!this._editorWorkerClient)return;0===this._modelService.getModels().length&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}_checkStopIdleWorker(){if(!this._editorWorkerClient)return;(new Date).getTime()-this._lastWorkerUsedTime>bT&&(this._editorWorkerClient.dispose(),this._editorWorkerClient=null)}withWorker(){return this._lastWorkerUsedTime=(new Date).getTime(),this._editorWorkerClient||(this._editorWorkerClient=new xT(this._modelService,!1,"editorWorkerService",this.languageConfigurationService)),Promise.resolve(this._editorWorkerClient)}}class LT extends E{constructor(e,t,i){if(super(),this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),this._proxy=e,this._modelService=t,!i){const e=new od;e.cancelAndSet((()=>this._checkStopModelSync()),Math.round(3e4)),this._register(e)}}dispose(){for(const e in this._syncedModels)k(this._syncedModels[e]);this._syncedModels=Object.create(null),this._syncedModelsLastUsedTime=Object.create(null),super.dispose()}ensureSyncedResources(e,t){for(const i of e){const e=i.toString();this._syncedModels[e]||this._beginModelSync(i,t),this._syncedModels[e]&&(this._syncedModelsLastUsedTime[e]=(new Date).getTime())}}_checkStopModelSync(){const e=(new Date).getTime(),t=[];for(const i in this._syncedModelsLastUsedTime){e-this._syncedModelsLastUsedTime[i]>6e4&&t.push(i)}for(const i of t)this._stopModelSync(i)}_beginModelSync(e,t){const i=this._modelService.getModel(e);if(!i)return;if(!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 s=new N;s.add(i.onDidChangeContent((e=>{this._proxy.acceptModelChanged(n.toString(),e)}))),s.add(i.onWillDispose((()=>{this._stopModelSync(n)}))),s.add(x((()=>{this._proxy.acceptRemovedModel(n)}))),this._syncedModels[n]=s}_stopModelSync(e){const t=this._syncedModels[e];delete this._syncedModels[e],delete this._syncedModelsLastUsedTime[e],k(t)}}class kT{constructor(e){this._instance=e,this._proxyObj=Promise.resolve(this._instance)}dispose(){this._instance.dispose()}getProxyObject(){return this._proxyObj}}class DT{constructor(e){this._workerClient=e}fhr(e,t){return this._workerClient.fhr(e,t)}}class xT extends E{constructor(e,t,i,n){super(),this.languageConfigurationService=n,this._disposed=!1,this._modelService=e,this._keepIdleModels=t,this._workerFactory=new rI(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 eI(this._workerFactory,"vs/editor/common/services/editorSimpleWorker",new DT(this)))}catch(e){$E(e),this._worker=new kT(new gT(new DT(this),null))}return this._worker}_getProxy(){return this._getOrCreateWorker().getProxyObject().then(void 0,(e=>($E(e),this._worker=new kT(new gT(new DT(this),null)),this._getOrCreateWorker().getProxyObject())))}_getOrCreateModelManager(e){return this._modelManager||(this._modelManager=this._register(new LT(e,this._modelService,this._keepIdleModels))),this._modelManager}_withSyncedResources(e,t=!1){return vT(this,void 0,void 0,(function*(){return this._disposed?Promise.reject(function(){const e=new Error(h);return e.name=e.message,e}()):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((s=>s.computeDiff(e.toString(),t.toString(),i,n)))}computeMoreMinimalEdits(e,t,i){return this._withSyncedResources([e]).then((n=>n.computeMoreMinimalEdits(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())))}textualSuggest(e,t,i){return vT(this,void 0,void 0,(function*(){const n=yield this._withSyncedResources(e),s=i.source,o=i.flags;return n.textualSuggest(e.map((e=>e.toString())),t,s,o)}))}computeWordRanges(e,t){return this._withSyncedResources([e]).then((i=>{const n=this._modelService.getModel(e);if(!n)return Promise.resolve(null);const s=this.languageConfigurationService.getLanguageConfiguration(n.getLanguageId()).getWordDefinition(),o=s.source,r=s.flags;return i.computeWordRanges(e.toString(),t,o,r)}))}navigateValueSet(e,t,i){return this._withSyncedResources([e]).then((n=>{const s=this._modelService.getModel(e);if(!s)return null;const o=this.languageConfigurationService.getLanguageConfiguration(s.getLanguageId()).getWordDefinition(),r=o.source,a=o.flags;return n.navigateValueSet(e.toString(),t,i,r,a)}))}dispose(){super.dispose(),this._disposed=!0}}const NT=[];function ET(e){NT.push(e)}function IT(){return NT.slice(0)}var MT=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},TT=function(e,t){return function(i,n){t(i,n,e)}},RT=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class AT{constructor(e,t){this._editorWorkerClient=new xT(e,!1,"editorWorkerService",t)}provideDocumentColors(e,t){return RT(this,void 0,void 0,(function*(){return this._editorWorkerClient.computeDefaultDocumentColors(e.uri)}))}provideColorPresentations(e,t,i){const n=t.range,s=t.color,o=s.alpha,r=new lc(new oc(Math.round(255*s.red),Math.round(255*s.green),Math.round(255*s.blue),o)),a=o?lc.Format.CSS.formatRGB(r):lc.Format.CSS.formatRGBA(r),l=o?lc.Format.CSS.formatHSL(r):lc.Format.CSS.formatHSLA(r),h=o?lc.Format.CSS.formatHex(r):lc.Format.CSS.formatHexA(r),d=[];return d.push({label:a,textEdit:{range:n,text:a}}),d.push({label:l,textEdit:{range:n,text:l}}),d.push({label:h,textEdit:{range:n,text:h}}),d}}let OT=class extends E{constructor(e,t,i){super(),this._register(i.colorProvider.register("*",new AT(e,t)))}};OT=MT([TT(0,Ha),TT(1,Ju),TT(2,oL)],OT),ET(OT);var PT=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function FT(e,t,i,n=!0){return PT(this,void 0,void 0,(function*(){return zT(new WT,e,t,i,n)}))}function BT(e,t,i,n){return Promise.resolve(i.provideColorPresentations(e,t,n))}class WT{constructor(){}compute(e,t,i,n){return PT(this,void 0,void 0,(function*(){const s=yield e.provideDocumentColors(t,i);if(Array.isArray(s))for(const t of s)n.push({colorInfo:t,provider:e});return Array.isArray(s)}))}}class VT{constructor(){}compute(e,t,i,n){return PT(this,void 0,void 0,(function*(){const s=yield e.provideDocumentColors(t,i);if(Array.isArray(s))for(const e of s)n.push({range:e.range,color:[e.color.red,e.color.green,e.color.blue,e.color.alpha]});return Array.isArray(s)}))}}class HT{constructor(e){this.colorInfo=e}compute(e,t,i,n){return PT(this,void 0,void 0,(function*(){const i=yield e.provideColorPresentations(t,this.colorInfo,Uh.None);return Array.isArray(i)&&n.push(...i),Array.isArray(i)}))}}function zT(e,t,i,n,s){return PT(this,void 0,void 0,(function*(){let o,r=!1;const l=[],h=t.ordered(i);for(let t=h.length-1;t>=0;t--){const s=h[t];if(s instanceof AT)o=s;else try{(yield e.compute(s,i,n,l))&&(r=!0)}catch(Mre){a(Mre)}}return r?l:o&&s?(yield e.compute(o,i,n,l),l):[]}))}function UT(e,t){const{colorProvider:i}=e.get(oL),n=e.get(Ha).getModel(t);if(!n)throw u();return{model:n,colorProviderRegistry:i,isDefaultColorDecoratorsEnabled:e.get(pu).getValue("editor.defaultColorDecorators",{resource:t})}}Xa.registerCommand("_executeDocumentColorProvider",(function(e,...t){const[i]=t;if(!(i instanceof an))throw u();const{model:n,colorProviderRegistry:s,isDefaultColorDecoratorsEnabled:o}=UT(e,i);return zT(new VT,s,n,Uh.None,o)})),Xa.registerCommand("_executeColorPresentationProvider",(function(e,...t){const[i,n]=t,{uri:s,range:o}=n;if(!(s instanceof an&&Array.isArray(i)&&4===i.length&&Rh.isIRange(o)))throw u();const{model:r,colorProviderRegistry:a,isDefaultColorDecoratorsEnabled:l}=UT(e,s),[h,d,c,g]=i;return zT(new HT({range:o,color:{red:h,green:d,blue:c,alpha:g}}),a,r,Uh.None,l)}));var KT,jT=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},qT=function(e,t){return function(i,n){t(i,n,e)}},$T=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const GT=Object.create({});let ZT=KT=class extends E{constructor(e,t,i,n){super(),this._editor=e,this._configurationService=t,this._languageFeaturesService=i,this._localToDispose=this._register(new N),this._decorationsIds=[],this._colorDatas=new Map,this._colorDecoratorIds=this._editor.createDecorationsCollection(),this._ruleFactory=new zE(this._editor),this._decoratorLimitReporter=new YT,this._colorDecorationClassRefs=this._register(new N),this._debounceInformation=n.for(i.colorProvider,"Document Colors",{min:KT.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((e=>{const t=this._isColorDecoratorsEnabled;this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145);const i=t!==this._isColorDecoratorsEnabled||e.hasChanged(21),n=e.hasChanged(145);(i||n)&&(this._isColorDecoratorsEnabled?this.updateColors():this.removeAllDecorations())}))),this._timeoutTimer=null,this._computePromise=null,this._isColorDecoratorsEnabled=this.isEnabled(),this._isDefaultColorDecoratorsEnabled=this._editor.getOption(145),this.updateColors()}isEnabled(){const e=this._editor.getModel();if(!e)return!1;const t=e.getLanguageId(),i=this._configurationService.getValue(t);if(i&&"object"==typeof i){const e=i.colorDecorators;if(e&&void 0!==e.enable&&!e.enable)return e.enable}return this._editor.getOption(20)}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 sd,this._timeoutTimer.cancelAndSet((()=>{this._timeoutTimer=null,this.beginCompute()}),this._debounceInformation.get(e)))}))),this.beginCompute())}beginCompute(){return $T(this,void 0,void 0,(function*(){this._computePromise=Yh((e=>$T(this,void 0,void 0,(function*(){const t=this._editor.getModel();if(!t)return[];const i=new F(!1),n=yield FT(this._languageFeaturesService.colorProvider,t,e,this._isDefaultColorDecoratorsEnabled);return this._debounceInformation.update(t,i.elapsed()),n}))));try{const e=yield this._computePromise;this.updateDecorations(e),this.updateColorDecorators(e),this._computePromise=null}catch(Mre){r(Mre)}}))}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((e=>({range:{startLineNumber:e.colorInfo.range.startLineNumber,startColumn:e.colorInfo.range.startColumn,endLineNumber:e.colorInfo.range.endLineNumber,endColumn:e.colorInfo.range.endColumn},options:Iw.EMPTY})));this._editor.changeDecorations((i=>{this._decorationsIds=i.deltaDecorations(this._decorationsIds,t),this._colorDatas=new Map,this._decorationsIds.forEach(((t,i)=>this._colorDatas.set(t,e[i])))}))}updateColorDecorators(e){this._colorDecorationClassRefs.clear();const t=[],i=this._editor.getOption(21);for(let s=0;sthis._colorDatas.has(e.id)));return 0===i.length?null:this._colorDatas.get(i[0].id)}isColorDecoration(e){return this._colorDecoratorIds.has(e)}};ZT.ID="editor.contrib.colorDetector",ZT.RECOMPUTE_TIME=1e3,ZT=KT=jT([qT(1,pu),qT(2,oL),qT(3,SE)],ZT);class YT{constructor(){this._onDidChange=new U,this._computed=0,this._limited=!1}update(e,t){e===this._computed&&t===this._limited||(this._computed=e,this._limited=t,this._onDidChange.fire())}}Dh(ZT.ID,ZT,1);class XT{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 U,this.onColorFlushed=this._onColorFlushed.event,this._onDidChangeColor=new U,this.onDidChangeColor=this._onDidChangeColor.event,this._onDidChangePresentation=new U,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({format:e.format,location:e.location.toString()})))}},e.fromJSONObject=function(e){const t=e=>Fr(e)?e:void 0;if(e&&Array.isArray(e.src)&&e.src.every((e=>Fr(e.format)&&Fr(e.location))))return{weight:t(e.weight),style:t(e.style),src:e.src.map((e=>({format:e.format,location:an.parse(e.location)})))}}}(JT||(JT={}));const eR=new class{constructor(){this._onDidChange=new U,this.onDidChange=this._onDidChange.event,this.iconSchema={definitions:{icons:{type:"object",properties:{fontId:{type:"string",description:ue(0,"The id of the font to use. If not set, the font that is defined first is used.")},fontCharacter:{type:"string",description:ue(0,"The font character associated with the icon definition.")}},additionalProperties:!1,defaultSnippets:[{body:{fontCharacter:"\\\\e030"}}]}},type:"object",properties:{}},this.iconReferenceSchema={type:"string",pattern:`^${ta.iconNameExpression}$`,enum:[],enumDescriptions:[]},this.iconsById={},this.iconFontsById={}}registerIcon(e,t,i,n){const s=this.iconsById[e];if(s){if(i&&!s.description){s.description=i,this.iconSchema.properties[e].markdownDescription=`${i} $(${e})`;const t=this.iconReferenceSchema.enum.indexOf(e);-1!==t&&(this.iconReferenceSchema.enumDescriptions[t]=i),this._onDidChange.fire()}return s}const o={id:e,description:i,defaults:t,deprecationMessage:n};this.iconsById[e]=o;const r={$ref:"#/definitions/icons"};return n&&(r.deprecationMessage=n),i&&(r.markdownDescription=`${i}: $(${e})`),this.iconSchema.properties[e]=r,this.iconReferenceSchema.enum.push(e),this.iconReferenceSchema.enumDescriptions.push(i||""),this._onDidChange.fire(),{id:e}}getIcons(){return Object.keys(this.iconsById).map((e=>this.iconsById[e]))}getIcon(e){return this.iconsById[e]}getIconSchema(){return this.iconSchema}toString(){const e=(e,t)=>e.id.localeCompare(t.id),t=e=>{for(;ta.isThemeIcon(e.defaults);)e=this.iconsById[e.defaults.id];return`codicon codicon-${e?e.id:""}`},i=[];i.push("| preview | identifier | default codicon ID | description"),i.push("| ----------- | --------------------------------- | --------------------------------- | --------------------------------- |");const n=Object.keys(this.iconsById).map((e=>this.iconsById[e]));for(const s of n.filter((e=>!!e.description)).sort(e))i.push(`||${s.id}|${ta.isThemeIcon(s.defaults)?s.defaults.id:s.id}|${s.description||""}|`);i.push("| preview | identifier "),i.push("| ----------- | --------------------------------- |");for(const s of n.filter((e=>!ta.isThemeIcon(e.defaults))).sort(e))i.push(`||${s.id}|`);return i.join("\n")}};function tR(e,t,i,n){return eR.registerIcon(e,t,i,n)}function iR(){return eR}jl.add("base.contributions.icons",eR),function(){const e=Qr();for(const t in e){const i="\\"+e[t].toString(16);eR.registerIcon(t,{fontCharacter:i})}}();const nR="vscode://schemas/icons",sR=jl.as(ku);sR.registerSchema(nR,eR.getIconSchema());const oR=new rd((()=>sR.notifySchemaChanged(nR)),200);eR.onDidChange((()=>{oR.isScheduled()||oR.schedule()}));const rR=tR("widget-close",Jr.close,ue(0,"Icon for the close action in widgets.")),aR=(tR("goto-previous-location",Jr.arrowUp,ue(0,"Icon for goto previous editor location.")),tR("goto-next-location",Jr.arrowDown,ue(0,"Icon for goto next editor location.")),ta.modify(Jr.sync,"spin"),ta.modify(Jr.loading,"spin"),fs);class lR extends E{constructor(e,t,i,n=!1){super(),this.model=t,this.showingStandaloneColorPicker=n,this._closeButton=null,this._domNode=aR(".colorpicker-header"),ds(e,this._domNode),this._pickedColorNode=ds(this._domNode,aR(".picked-color")),ds(this._pickedColorNode,aR("span.codicon.codicon-color-mode")),this._pickedColorPresentation=ds(this._pickedColorNode,document.createElement("span")),this._pickedColorPresentation.classList.add("picked-color-presentation");const s=ue(0,"Click to toggle color options (rgb/hsl/hex)");this._pickedColorNode.setAttribute("title",s),this._originalColorNode=ds(this._domNode,aR(".original-color")),this._originalColorNode.style.backgroundColor=lc.Format.CSS.format(this.model.originalColor)||"",this.backgroundColor=i.getColorTheme().getColor(Gm)||lc.white,this._register(i.onDidColorThemeChange((e=>{this.backgroundColor=e.getColor(Gm)||lc.white}))),this._register(En(this._pickedColorNode,os.CLICK,(()=>this.model.selectNextColorPresentation()))),this._register(En(this._originalColorNode,os.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=lc.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 hR(this._domNode)))}get closeButton(){return this._closeButton}get pickedColorNode(){return this._pickedColorNode}get originalColorNode(){return this._originalColorNode}onDidChangeColor(e){this._pickedColorNode.style.backgroundColor=lc.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 hR extends E{constructor(e){super(),this._onClicked=this._register(new U),this.onClicked=this._onClicked.event,this._button=document.createElement("div"),this._button.classList.add("close-button"),ds(e,this._button);const t=document.createElement("div");t.classList.add("close-button-inner-div"),ds(this._button,t);ds(t,aR(".button"+ta.asCSSSelector(tR("color-picker-close",Jr.close,ue(0,"Icon to close the color picker"))))).classList.add("close-icon"),this._button.onclick=()=>{this._onClicked.fire()}}}class dR extends E{constructor(e,t,i,n=!1){super(),this.model=t,this.pixelRatio=i,this._insertButton=null,this._domNode=aR(".colorpicker-body"),ds(e,this._domNode),this._saturationBox=new cR(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 gR(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 pR(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 mR(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 lc(new ac(i.h,e,t,i.a))}onDidOpacityChange(e){const t=this.model.color.hsva;this.model.color=new lc(new ac(t.h,t.s,t.v,e))}onDidHueChange(e){const t=this.model.color.hsva,i=360*(1-e);this.model.color=new lc(new ac(360===i?0:i,t.s,t.v,t.a))}get domNode(){return this._domNode}get saturationBox(){return this._saturationBox}get enterButton(){return this._insertButton}layout(){this._saturationBox.layout(),this._opacityStrip.layout(),this._hueStrip.layout()}}class cR extends E{constructor(e,t,i){super(),this.model=t,this.pixelRatio=i,this._onDidChange=new U,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new U,this.onColorFlushed=this._onColorFlushed.event,this._domNode=aR(".saturation-wrap"),ds(e,this._domNode),this._canvas=document.createElement("canvas"),this._canvas.className="saturation-box",ds(this._domNode,this._canvas),this.selection=aR(".saturation-selection"),ds(this._domNode,this.selection),this.layout(),this._register(En(this._domNode,os.POINTER_DOWN,(e=>this.onPointerDown(e)))),this._register(this.model.onDidChangeColor(this.onDidChangeColor,this)),this.monitor=null}get domNode(){return this._domNode}onPointerDown(e){if(!(e.target&&e.target instanceof Element))return;this.monitor=this._register(new fD);const t=Hn(this._domNode);e.target!==this.selection&&this.onDidChangePosition(e.offsetX,e.offsetY),this.monitor.startMonitoring(e.target,e.pointerId,e.buttons,(e=>this.onDidChangePosition(e.pageX-t.left,e.pageY-t.top)),(()=>null));const i=En(e.target.ownerDocument,os.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 lc(new ac(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 s=i.createLinearGradient(0,0,0,this._canvas.height);s.addColorStop(0,"rgba(0, 0, 0, 0)"),s.addColorStop(1,"rgba(0, 0, 0, 1)"),i.rect(0,0,this._canvas.width,this._canvas.height),i.fillStyle=lc.Format.CSS.format(t),i.fill(),i.fillStyle=n,i.fill(),i.fillStyle=s,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 uR extends E{constructor(e,t,i=!1){super(),this.model=t,this._onDidChange=new U,this.onDidChange=this._onDidChange.event,this._onColorFlushed=new U,this.onColorFlushed=this._onColorFlushed.event,i?(this.domNode=ds(e,aR(".standalone-strip")),this.overlay=ds(this.domNode,aR(".standalone-overlay"))):(this.domNode=ds(e,aR(".strip")),this.overlay=ds(this.domNode,aR(".overlay"))),this.slider=ds(this.domNode,aR(".slider")),this.slider.style.top="0px",this._register(En(this.domNode,os.POINTER_DOWN,(e=>this.onPointerDown(e)))),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 fD),i=Hn(this.domNode);this.domNode.classList.add("grabbing"),e.target!==this.slider&&this.onDidChangeTop(e.offsetY),t.startMonitoring(e.target,e.pointerId,e.buttons,(e=>this.onDidChangeTop(e.pageY-i.top)),(()=>null));const n=En(e.target.ownerDocument,os.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 gR extends uR{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,s=new lc(new oc(t,i,n,1)),o=new lc(new oc(t,i,n,0));this.overlay.style.background=`linear-gradient(to bottom, ${s} 0%, ${o} 100%)`}getValue(e){return e.hsva.a}}class pR extends uR{constructor(e,t,i=!1){super(e,t,i),this.domNode.classList.add("hue-strip")}getValue(e){return 1-e.hsva.h/360}}class mR extends E{constructor(e){super(),this._onClicked=this._register(new U),this.onClicked=this._onClicked.event,this._button=ds(e,document.createElement("button")),this._button.classList.add("insert-button"),this._button.textContent="Insert",this._button.onclick=e=>{this._onClicked.fire()}}get button(){return this._button}}class fR extends _D{constructor(e,t,i,n,s=!1){super(),this.model=t,this.pixelRatio=i,this._register(te.onDidChange((()=>this.layout())));const o=aR(".colorpicker-widget");e.appendChild(o),this.header=this._register(new lR(o,this.model,n,s)),this.body=this._register(new dR(o,this.model,this.pixelRatio,s))}layout(){this.body.layout()}}var _R=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},vR=function(e,t){return function(i,n){t(i,n,e)}},bR=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class CR{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n,this.forceShowAtRange=!0}isValidForHoverAnchor(e){return 1===e.type&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let wR=class{constructor(e,t){this._editor=e,this._themeService=t,this.hoverOrdinal=2}computeSync(e,t){return[]}computeAsync(e,t,i){return cd.fromPromise(this._computeAsync(e,t,i))}_computeAsync(e,t,i){return bR(this,void 0,void 0,(function*(){if(!this._editor.hasModel())return[];const e=ZT.get(this._editor);if(!e)return[];for(const i of t){if(!e.isColorDecoration(i))continue;const t=e.getColorData(i.range.getStartPosition());if(t){return[yield LR(this,this._editor.getModel(),t.colorInfo,t.provider)]}}return[]}))}renderHoverParts(e,t){return kR(this,this._editor,this._themeService,t,e)}};wR=_R([vR(1,P_)],wR);class yR{constructor(e,t,i,n){this.owner=e,this.range=t,this.model=i,this.provider=n}}let SR=class{constructor(e,t){this._editor=e,this._themeService=t,this._color=null}createColorHover(e,t,i){return bR(this,void 0,void 0,(function*(){if(!this._editor.hasModel())return null;if(!ZT.get(this._editor))return null;const n=yield FT(i,this._editor.getModel(),Uh.None);let s=null,o=null;for(const t of n){const i=t.colorInfo;Rh.containsRange(i.range,e.range)&&(s=i,o=t.provider)}const r=null!=s?s:e,a=null!=o?o:t,l=!!s;return{colorHover:yield LR(this,this._editor.getModel(),r,a),foundInEditor:l}}))}updateEditorModel(e){return bR(this,void 0,void 0,(function*(){if(!this._editor.hasModel())return;const t=e.model;let i=new Rh(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn);this._color&&(yield xR(this._editor.getModel(),t,this._color,i,e),i=DR(this._editor,i,t))}))}renderHoverParts(e,t){return kR(this,this._editor,this._themeService,t,e)}set color(e){this._color=e}get color(){return this._color}};function LR(e,t,i,n){return bR(this,void 0,void 0,(function*(){const s=t.getValueInRange(i.range),{red:o,green:r,blue:a,alpha:l}=i.color,h=new oc(Math.round(255*o),Math.round(255*r),Math.round(255*a),l),d=new lc(h),c=yield BT(t,i,n,Uh.None),u=new XT(d,[],0);return u.colorPresentations=c||[],u.guessColorPresentation(d,s),e instanceof wR?new CR(e,Rh.lift(i.range),u,n):new yR(e,Rh.lift(i.range),u,n)}))}function kR(e,t,i,n,s){if(0===n.length||!t.hasModel())return E.None;if(s.setMinimumDimensions){const e=t.getOption(66)+8;s.setMinimumDimensions(new Wn(302,e))}const o=new N,r=n[0],a=t.getModel(),l=r.model,h=o.add(new fR(s.fragment,l,t.getOption(141),i,e instanceof SR));s.setColorPicker(h);let d=!1,c=new Rh(r.range.startLineNumber,r.range.startColumn,r.range.endLineNumber,r.range.endColumn);if(e instanceof SR){const t=n[0].model.color;e.color=t,xR(a,l,t,c,r),o.add(l.onColorFlushed((t=>{e.color=t})))}else o.add(l.onColorFlushed((e=>bR(this,void 0,void 0,(function*(){yield xR(a,l,e,c,r),d=!0,c=DR(t,c,l,s)})))));return o.add(l.onDidChangeColor((e=>{xR(a,l,e,c,r)}))),o.add(t.onDidChangeModelContent((e=>{d?d=!1:(s.hide(),t.focus())}))),o}function DR(e,t,i,n){let s,o;if(i.presentation.textEdit){s=[i.presentation.textEdit],o=new Rh(i.presentation.textEdit.range.startLineNumber,i.presentation.textEdit.range.startColumn,i.presentation.textEdit.range.endLineNumber,i.presentation.textEdit.range.endColumn);const t=e.getModel()._setTrackedRange(null,o,3);e.pushUndoStop(),e.executeEdits("colorpicker",s),o=e.getModel()._getTrackedRange(t)||o}else s=[{range:t,text:i.presentation.label,forceMoveMarkers:!1}],o=t.setEndPosition(t.endLineNumber,t.startColumn+i.presentation.label.length),e.pushUndoStop(),e.executeEdits("colorpicker",s);return i.presentation.additionalTextEdits&&(s=[...i.presentation.additionalTextEdits],e.executeEdits("colorpicker",s),n&&n.hide()),e.pushUndoStop(),o}function xR(e,t,i,n,s){return bR(this,void 0,void 0,(function*(){const o=yield BT(e,{range:n,color:{red:i.rgba.r/255,green:i.rgba.g/255,blue:i.rgba.b/255,alpha:i.rgba.a}},s.provider,Uh.None);t.colorPresentations=o||[]}))}function NR(e,t){return!!e[t]}SR=_R([vR(1,P_)],SR);class ER{constructor(e,t){this.target=e.target,this.isLeftClick=e.event.leftButton,this.isMiddleClick=e.event.middleButton,this.isRightClick=e.event.rightButton,this.hasTriggerModifier=NR(e.event,t.triggerModifier),this.hasSideBySideModifier=NR(e.event,t.triggerSideBySideModifier),this.isNoneOrSingleMouseDown=e.event.detail<=1}}class IR{constructor(e,t){this.keyCodeIsTriggerKey=e.keyCode===t.triggerKey,this.keyCodeIsSideBySideKey=e.keyCode===t.triggerSideBySideKey,this.hasTriggerModifier=NR(e,t.triggerModifier)}}class MR{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 TR(e){return"altKey"===e?Pe?new MR(57,"metaKey",6,"altKey"):new MR(5,"ctrlKey",6,"altKey"):Pe?new MR(6,"altKey",57,"metaKey"):new MR(6,"altKey",5,"ctrlKey")}class RR extends E{constructor(e,t){var i;super(),this._onMouseMoveOrRelevantKeyDown=this._register(new U),this.onMouseMoveOrRelevantKeyDown=this._onMouseMoveOrRelevantKeyDown.event,this._onExecute=this._register(new U),this.onExecute=this._onExecute.event,this._onCancel=this._register(new U),this.onCancel=this._onCancel.event,this._editor=e,this._extractLineNumberFromMouseEvent=null!==(i=null==t?void 0:t.extractLineNumberFromMouseEvent)&&void 0!==i?i:e=>e.target.position?e.target.position.lineNumber:0,this._opts=TR(this._editor.getOption(77)),this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._register(this._editor.onDidChangeConfiguration((e=>{if(e.hasChanged(77)){const e=TR(this._editor.getOption(77));if(this._opts.equals(e))return;this._opts=e,this._lastMouseMoveEvent=null,this._hasTriggerKeyOnMouseDown=!1,this._lineNumberOnMouseDown=0,this._onCancel.fire()}}))),this._register(this._editor.onMouseMove((e=>this._onEditorMouseMove(new ER(e,this._opts))))),this._register(this._editor.onMouseDown((e=>this._onEditorMouseDown(new ER(e,this._opts))))),this._register(this._editor.onMouseUp((e=>this._onEditorMouseUp(new ER(e,this._opts))))),this._register(this._editor.onKeyDown((e=>this._onEditorKeyDown(new IR(e,this._opts))))),this._register(this._editor.onKeyUp((e=>this._onEditorKeyUp(new IR(e,this._opts))))),this._register(this._editor.onMouseDrag((()=>this._resetHandler()))),this._register(this._editor.onDidChangeCursorSelection((e=>this._onDidChangeCursorSelection(e)))),this._register(this._editor.onDidChangeModel((e=>this._resetHandler()))),this._register(this._editor.onDidChangeModelContent((()=>this._resetHandler()))),this._register(this._editor.onDidScrollChange((e=>{(e.scrollTopChanged||e.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()}}const AR=Ba("markerDecorationsService");var OR=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},PR=function(e,t){return function(i,n){t(i,n,e)}};let FR=class{constructor(e,t){}dispose(){}};FR.ID="editor.contrib.markerDecorations",FR=OR([PR(1,AR)],FR),Dh(FR.ID,FR,0);class BR extends E{constructor(e,t){super(),this._onDidChange=this._register(new U),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 s=()=>{if(i&&!n)try{i=!1,n=!0,t()}finally{requestAnimationFrame((()=>{n=!1,s()}))}};this._resizeObserver=new ResizeObserver((t=>{e=t&&t[0]&&t[0].contentRect?t[0].contentRect:null,i=!0,s()})),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())}}class WR{constructor(e,t){this.chr=e,this.type=t,this.width=0}fulfill(e){this.width=e}}class VR{constructor(e,t){this._bareFontInfo=e,this._requests=t,this._container=null,this._testElements=null}read(){this._createDomElements(),document.body.appendChild(this._container),this._readFromDomElements(),document.body.removeChild(this._container),this._container=null,this._testElements=null}_createDomElements(){const e=document.createElement("div");e.style.position="absolute",e.style.top="-50000px",e.style.width="50000px";const t=document.createElement("div");Hk(t,this._bareFontInfo),e.appendChild(t);const i=document.createElement("div");Hk(i,this._bareFontInfo),i.style.fontWeight="bold",e.appendChild(i);const n=document.createElement("div");Hk(n,this._bareFontInfo),n.style.fontStyle="italic",e.appendChild(n);const s=[];for(const o of this._requests){let e;0===o.type&&(e=t),2===o.type&&(e=i),1===o.type&&(e=n),e.appendChild(document.createElement("br"));const r=document.createElement("span");VR._render(r,o),e.appendChild(r),s.push(r)}this._container=e,this._testElements=s}static _render(e,t){if(" "===t.chr){let t="\xa0";for(let e=0;e<8;e++)t+=t;e.innerText=t}else{let i=t.chr;for(let e=0;e<8;e++)i+=i;e.textContent=i}}_readFromDomElements(){for(let e=0,t=this._requests.length;ethis._values[e]))}}const qR=new class extends E{constructor(){super(),this._onDidChange=this._register(new U),this.onDidChange=this._onDidChange.event,this._cache=new jR,this._evictUntrustedReadingsTimeout=-1}dispose(){-1!==this._evictUntrustedReadingsTimeout&&(window.clearTimeout(this._evictUntrustedReadingsTimeout),this._evictUntrustedReadingsTimeout=-1),super.dispose()}clearAllFontInfos(){this._cache=new jR,this._onDidChange.fire()}_writeToCache(e,t){this._cache.put(e,t),t.isTrusted||-1!==this._evictUntrustedReadingsTimeout||(this._evictUntrustedReadingsTimeout=window.setTimeout((()=>{this._evictUntrustedReadingsTimeout=-1,this._evictUntrustedReadings()}),5e3))}_evictUntrustedReadings(){const e=this._cache.getValues();let t=!1;for(const i of e)i.isTrusted||(t=!0,this._cache.remove(i));t&&this._onDidChange.fire()}readFontInfo(e){if(!this._cache.has(e)){let t=this._actualReadFontInfo(e);(t.typicalHalfwidthCharacterWidth<=2||t.typicalFullwidthCharacterWidth<=2||t.spaceWidth<=2||t.maxDigitWidth<=2)&&(t=new KR({pixelRatio:te.value,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontSize:t.fontSize,fontFeatureSettings:t.fontFeatureSettings,fontVariationSettings:t.fontVariationSettings,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,isMonospace:t.isMonospace,typicalHalfwidthCharacterWidth:Math.max(t.typicalHalfwidthCharacterWidth,5),typicalFullwidthCharacterWidth:Math.max(t.typicalFullwidthCharacterWidth,5),canUseHalfwidthRightwardsArrow:t.canUseHalfwidthRightwardsArrow,spaceWidth:Math.max(t.spaceWidth,5),middotWidth:Math.max(t.middotWidth,5),wsmiddotWidth:Math.max(t.wsmiddotWidth,5),maxDigitWidth:Math.max(t.maxDigitWidth,5)},!1)),this._writeToCache(e,t)}return this._cache.get(e)}_createRequest(e,t,i,n){const s=new WR(e,t);return i.push(s),null==n||n.push(s),s}_actualReadFontInfo(e){const t=[],i=[],n=this._createRequest("n",0,t,i),s=this._createRequest("\uff4d",0,t,null),o=this._createRequest(" ",0,t,i),r=this._createRequest("0",0,t,i),a=this._createRequest("1",0,t,i),l=this._createRequest("2",0,t,i),h=this._createRequest("3",0,t,i),d=this._createRequest("4",0,t,i),c=this._createRequest("5",0,t,i),u=this._createRequest("6",0,t,i),g=this._createRequest("7",0,t,i),p=this._createRequest("8",0,t,i),m=this._createRequest("9",0,t,i),f=this._createRequest("\u2192",0,t,i),_=this._createRequest("\uffeb",0,t,null),v=this._createRequest("\xb7",0,t,i),b=this._createRequest(String.fromCharCode(11825),0,t,null),C="|/-_ilm%";for(let k=0,D=8;k.001){y=!1;break}}let L=!0;return y&&_.width!==S&&(L=!1),_.width>f.width&&(L=!1),new KR({pixelRatio:te.value,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontSize:e.fontSize,fontFeatureSettings:e.fontFeatureSettings,fontVariationSettings:e.fontVariationSettings,lineHeight:e.lineHeight,letterSpacing:e.letterSpacing,isMonospace:y,typicalHalfwidthCharacterWidth:n.width,typicalFullwidthCharacterWidth:s.width,canUseHalfwidthRightwardsArrow:L,spaceWidth:o.width,middotWidth:v.width,wsmiddotWidth:b.width,maxDigitWidth:w},!0)}};class $R{constructor(e,t){this.key=e,this.migrate=t}apply(e){const t=$R._read(e,this.key);this.migrate(t,(t=>$R._read(e,t)),((t,i)=>$R._write(e,t,i)))}static _read(e,t){if(void 0===e)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 s=t.substring(0,n);return e[s]=e[s]||{},void this._write(e[s],t.substring(n+1),i)}e[t]=i}}function GR(e,t){$R.items.push(new $R(e,t))}function ZR(e,t){GR(e,((i,n,s)=>{if(void 0!==i)for(const[o,r]of t)if(i===o)return void s(e,r)}))}$R.items=[],ZR("wordWrap",[[!0,"on"],[!1,"off"]]),ZR("lineNumbers",[[!0,"on"],[!1,"off"]]),ZR("cursorBlinking",[["visible","solid"]]),ZR("renderWhitespace",[[!0,"boundary"],[!1,"none"]]),ZR("renderLineHighlight",[[!0,"line"],[!1,"none"]]),ZR("acceptSuggestionOnEnter",[[!0,"on"],[!1,"off"]]),ZR("tabCompletion",[[!1,"off"],[!0,"onlySnippets"]]),ZR("hover",[[!0,{enabled:!0}],[!1,{enabled:!1}]]),ZR("parameterHints",[[!0,{enabled:!0}],[!1,{enabled:!1}]]),ZR("autoIndent",[[!1,"advanced"],[!0,"full"]]),ZR("matchBrackets",[[!0,"always"],[!1,"never"]]),ZR("renderFinalNewline",[[!0,"on"],[!1,"off"]]),ZR("cursorSmoothCaretAnimation",[[!0,"on"],[!1,"off"]]),GR("autoClosingBrackets",((e,t,i)=>{!1===e&&(i("autoClosingBrackets","never"),void 0===t("autoClosingQuotes")&&i("autoClosingQuotes","never"),void 0===t("autoSurround")&&i("autoSurround","never"))})),GR("renderIndentGuides",((e,t,i)=>{void 0!==e&&(i("renderIndentGuides",void 0),void 0===t("guides.indentation")&&i("guides.indentation",!!e))})),GR("highlightActiveIndentGuide",((e,t,i)=>{void 0!==e&&(i("highlightActiveIndentGuide",void 0),void 0===t("guides.highlightActiveIndentation")&&i("guides.highlightActiveIndentation",!!e))}));const YR={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"};GR("suggest.filteredTypes",((e,t,i)=>{if(e&&"object"==typeof e){for(const n of Object.entries(YR)){!1===e[n[0]]&&void 0===t(`suggest.${n[1]}`)&&i(`suggest.${n[1]}`,!1)}i("suggest.filteredTypes",void 0)}})),GR("quickSuggestions",((e,t,i)=>{if("boolean"==typeof e){const t=e?"on":"off";i("quickSuggestions",{comments:t,strings:t,other:t})}})),GR("experimental.stickyScroll.enabled",((e,t,i)=>{"boolean"==typeof e&&(i("experimental.stickyScroll.enabled",void 0),void 0===t("stickyScroll.enabled")&&i("stickyScroll.enabled",e))})),GR("experimental.stickyScroll.maxLineCount",((e,t,i)=>{"number"==typeof e&&(i("experimental.stickyScroll.maxLineCount",void 0),void 0===t("stickyScroll.maxLineCount")&&i("stickyScroll.maxLineCount",e))}));const XR=new class{constructor(){this._tabFocus=!1,this._onDidChangeTabFocus=new U,this.onDidChangeTabFocus=this._onDidChangeTabFocus.event}getTabFocusMode(){return this._tabFocus}setTabFocusMode(e){this._tabFocus=e,this._onDidChangeTabFocus.fire(this._tabFocus)}},QR=Ba("accessibilityService"),JR=new Al("accessibilityModeEnabled",!1);var eA=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},tA=function(e,t){return function(i,n){t(i,n,e)}};let iA=class extends E{constructor(e,t,i,n){super(),this._accessibilityService=n,this._onDidChange=this._register(new U),this.onDidChange=this._onDidChange.event,this._onDidChangeFast=this._register(new U),this.onDidChangeFast=this._onDidChangeFast.event,this._isDominatedByLongLines=!1,this._viewLineCount=1,this._lineNumbersDigitCount=1,this._reservedHeight=0,this._glyphMarginDecorationLaneCount=1,this._computeOptionsMemory=new pS,this.isSimpleWidget=e,this._containerObserver=this._register(new BR(i,t.dimension)),this._rawOptions=aA(t),this._validatedOptions=rA.validateOptions(this._rawOptions),this.options=this._computeOptions(),this.options.get(13)&&this._containerObserver.startObserving(),this._register(HR.onDidChangeZoomLevel((()=>this._recomputeOptions()))),this._register(XR.onDidChangeTabFocus((()=>this._recomputeOptions()))),this._register(this._containerObserver.onDidChange((()=>this._recomputeOptions()))),this._register(qR.onDidChange((()=>this._recomputeOptions()))),this._register(te.onDidChange((()=>this._recomputeOptions()))),this._register(this._accessibilityService.onDidChangeScreenReaderOptimized((()=>this._recomputeOptions())))}_recomputeOptions(){const e=this._computeOptions(),t=rA.checkEquals(this.options,e);null!==t&&(this.options=e,this._onDidChangeFast.fire(t),this._onDidChange.fire(t))}_computeOptions(){const e=this._readEnvConfiguration(),t=UR.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:XR.getTabFocusMode(),accessibilitySupport:e.accessibilitySupport,glyphMarginDecorationLaneCount:this._glyphMarginDecorationLaneCount};return rA.computeOptions(this._validatedOptions,n)}_readEnvConfiguration(){return{extraEditorClassName:nA(),outerWidth:this._containerObserver.getWidth(),outerHeight:this._containerObserver.getHeight(),emptySelectionClipboard:se||ne,pixelRatio:te.value,accessibilitySupport:this._accessibilityService.isScreenReaderOptimized()?2:this._accessibilityService.getAccessibilitySupport()}}_readFontInfo(e){return qR.readFontInfo(e)}getRawOptions(){return this._rawOptions}updateOptions(e){const t=aA(e);rA.applyUpdate(this._rawOptions,t)&&(this._validatedOptions=rA.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=function(e){let t=0;for(;e;)e=Math.floor(e/10),t++;return t||1}(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())}};function nA(){let e="";return re||ae||(e+="no-user-select "),re&&(e+="no-minimap-shadow ",e+="enable-user-select "),Pe&&(e+="mac "),e}iA=eA([tA(3,QR)],iA);class sA{constructor(){this._values=[]}_read(e){return this._values[e]}get(e){return this._values[e]}_write(e,t){this._values[e]=t}}class oA{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 rA{static validateOptions(e){const t=new sA;for(const i of $S){const n="_never_"===i.name?void 0:e[i.name];t._write(i.id,i.validate(n))}return t}static computeOptions(e,t){const i=new oA;for(const n of $S)i._write(n.id,n.compute(t,i,e._read(n.id)));return i}static _deepEquals(e,t){if("object"!=typeof e||"object"!=typeof t||!e||!t)return e===t;if(Array.isArray(e)||Array.isArray(t))return!(!Array.isArray(e)||!Array.isArray(t))&&Td(e,t);if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const i in e)if(!rA._deepEquals(e[i],t[i]))return!1;return!0}static checkEquals(e,t){const i=[];let n=!1;for(const s of $S){const o=!rA._deepEquals(e._read(s.id),t._read(s.id));i[s.id]=o,o&&(n=!0)}return n?new gS(i):null}static applyUpdate(e,t){let i=!1;for(const n of $S)if(t.hasOwnProperty(n.name)){const s=n.applyUpdate(e[n.name],t[n.name]);e[n.name]=s.newValue,i=i||s.didChange}return i}}function aA(e){const t=gd(e);return function(e){$R.items.forEach((t=>t.apply(e)))}(t),t}class lA extends E{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;i=o.left?n.width=Math.max(n.width,o.left+o.width-n.left):(t[i++]=n,n=o)}return t[i++]=n,t}static _createHorizontalRangesFromClientRects(e,t,i){if(!e||0===e.length)return null;const n=[];for(let s=0,o=e.length;sr)return null;if((t=Math.min(r,Math.max(0,t)))===(n=Math.min(r,Math.max(0,n)))&&i===s&&0===i&&!e.children[t].firstChild){const i=e.children[t].getClientRects();return o.markDidDomLayout(),this._createHorizontalRangesFromClientRects(i,o.clientRectDeltaLeft,o.clientRectScale)}t!==n&&n>0&&0===s&&(n--,s=1073741824);let a=e.children[t].firstChild,l=e.children[n].firstChild;if(a&&l||(!a&&0===i&&t>0&&(a=e.children[t-1].firstChild,i=1073741824),!l&&0===s&&n>0&&(l=e.children[n-1].firstChild,s=1073741824)),!a||!l)return null;i=Math.min(a.textContent.length,Math.max(0,i)),s=Math.min(l.textContent.length,Math.max(0,s));const h=this._readClientRects(a,i,l,s,o.endNode);return o.markDidDomLayout(),this._createHorizontalRangesFromClientRects(h,o.clientRectDeltaLeft,o.clientRectScale)}}class bA{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;if(i!==t.length)return!1;for(let n=0;n=s||(r[a++]=new bA(Math.max(1,l.startColumn-n+1),Math.min(o+1,l.endColumn-n+1),l.className,l.type));return r}static filter(e,t,i,n){if(0===e.length)return[];const s=[];let o=0;for(let r=0,a=e.length;rt)continue;if(l.isEmpty()&&(0===a.type||3===a.type))continue;const h=l.startLineNumber===t?l.startColumn:i,d=l.endLineNumber===t?l.endColumn:n;s[o++]=new bA(h,d,a.inlineClassName,a.type)}return s}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=bA._typeCompare(e.type,t.type);return 0!==i?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 yA{static normalize(e,t){if(0===t.length)return[];const i=[],n=new wA;let s=0;for(let o=0,r=t.length;o1){wo(e.charCodeAt(a-2))&&a--}if(l>1){wo(e.charCodeAt(l-2))&&l--}const c=a-1,u=l-2;s=n.consumeLowerThan(c,s,i),0===n.count&&(s=c),n.insert(u,h,d)}return n.consumeLowerThan(1073741824,s,i),i}}class SA{constructor(e,t,i,n){this.endIndex=e,this.type=t,this.metadata=i,this.containsRTL=n,this._linePartBrand=void 0}isWhitespace(){return!!(1&this.metadata)}isPseudoAfter(){return!!(4&this.metadata)}}class LA{constructor(e,t){this.startOffset=e,this.endOffset=t}equals(e){return this.startOffset===e.startOffset&&this.endOffset===e.endOffset}}class kA{constructor(e,t,i,n,s,o,r,a,l,h,d,c,u,g,p,m,f,_,v){this.useMonospaceOptimizations=e,this.canUseHalfwidthRightwardsArrow=t,this.lineContent=i,this.continuesWithWrappedLine=n,this.isBasicASCII=s,this.containsRTL=o,this.fauxIndentLength=r,this.lineTokens=a,this.lineDecorations=l.sort(bA.compare),this.tabSize=h,this.startVisibleColumn=d,this.spaceWidth=c,this.stopRenderingLineAfter=p,this.renderWhitespace="all"===m?4:"boundary"===m?1:"selection"===m?2:"trailing"===m?3:0,this.renderControlCharacters=f,this.fontLigatures=_,this.selectionsOnLine=v&&v.sort(((e,t)=>e.startOffset>>16}static getCharIndex(e){return(65535&e)>>>0}constructor(e,t){this.length=e,this._data=new Uint32Array(this.length),this._horizontalOffset=new Uint32Array(this.length)}setColumnInfo(e,t,i,n){const s=(t<<16|i)>>>0;this._data[e-1]=s,this._horizontalOffset[e-1]=n}getHorizontalOffset(e){return 0===this._horizontalOffset.length?0:this._horizontalOffset[e-1]}charOffsetToPartData(e){return 0===this.length?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=xA.getPartIndex(t),n=xA.getCharIndex(t);return new DA(i,n)}getColumn(e,t){return this.partDataToCharOffset(e.partIndex,t,e.charIndex)+1}partDataToCharOffset(e,t,i){if(0===this.length)return 0;const n=(e<<16|i)>>>0;let s=0,o=this.length-1;for(;s+1>>1,t=this._data[e];if(t===n)return e;t>n?o=e:s=e}if(s===o)return s;const r=this._data[s],a=this._data[o];if(r===n)return s;if(a===n)return o;const l=xA.getPartIndex(r),h=xA.getCharIndex(r);let d;d=l!==xA.getPartIndex(a)?t:xA.getCharIndex(a);return i-h<=d-i?s:o}}class NA{constructor(e,t,i){this._renderLineOutputBrand=void 0,this.characterMapping=e,this.containsRTL=t,this.containsForeignElements=i}}function EA(e,t){if(0===e.lineContent.length){if(e.lineDecorations.length>0){t.appendString("");let i=0,n=0,s=0;for(const r of e.lineDecorations)1!==r.type&&2!==r.type||(t.appendString(''),1===r.type&&(s|=1,i++),2===r.type&&(s|=2,n++));t.appendString("");const o=new xA(1,i+n);return o.setColumnInfo(1,i,0,0),new NA(o,!1,s)}return t.appendString(""),new NA(new xA(0,0),!1,0)}return function(e,t){const i=e.fontIsMonospace,n=e.canUseHalfwidthRightwardsArrow,s=e.containsForeignElements,o=e.lineContent,r=e.len,a=e.isOverflowing,l=e.overflowingCharCount,h=e.parts,d=e.fauxIndentLength,c=e.tabSize,u=e.startVisibleColumn,g=e.containsRTL,p=e.spaceWidth,m=e.renderSpaceCharCode,f=e.renderWhitespace,_=e.renderControlCharacters,v=new xA(r+1,h.length);let b=!1,C=0,w=u,y=0,S=0,L=0;g?t.appendString(''):t.appendString("");for(let k=0,D=h.length;k=d&&(i+=n)}}for(D&&(t.appendString(' style="width:'),t.appendString(String(p*e)),t.appendString('px"')),t.appendASCIICharCode(62);C1?t.appendCharCode(8594):t.appendCharCode(65515);for(let e=2;e<=i;e++)t.appendCharCode(160)}else e=2,i=1,t.appendCharCode(m),t.appendCharCode(8204);y+=e,S+=i,C>=d&&(w+=i)}}else for(t.appendASCIICharCode(62);C=d&&(w+=n)}x?L++:L=0,C>=r&&!b&&e.isPseudoAfter()&&(b=!0,v.setColumnInfo(C+1,k,y,S)),t.appendString("")}b||v.setColumnInfo(r+1,h.length-1,y,S);a&&(t.appendString(''),t.appendString(ue(0,"Show more ({0})",function(e){if(e<1024)return ue(0,"{0} chars",e);if(e<1048576)return`${(e/1024).toFixed(1)} KB`;return`${(e/1024/1024).toFixed(1)} MB`}(l))),t.appendString(""));return t.appendString(""),new NA(v,g,s)}(function(e){const t=e.lineContent;let i,n,s;-1!==e.stopRenderingLineAfter&&e.stopRenderingLineAfter0&&(o[r++]=new SA(n,"",0,!1));let a=n;for(let l=0,h=i.getCount();l=s){const i=!!t&&Io(e.substring(a,s));o[r++]=new SA(s,d,0,i);break}const c=!!t&&Io(e.substring(a,h));o[r++]=new SA(h,d,0,c),a=h}return o}(t,e.containsRTL,e.lineTokens,e.fauxIndentLength,s);e.renderControlCharacters&&!e.isBasicASCII&&(o=function(e,t){const i=[];let n=new SA(0,"",0,!1),s=0;for(const o of t){const t=o.endIndex;for(;sn.endIndex&&(n=new SA(s,o.type,o.metadata,o.containsRTL),i.push(n)),n=new SA(s+1,"mtkcontrol",o.metadata,!1),i.push(n))}s>n.endIndex&&(n=new SA(t,o.type,o.metadata,o.containsRTL),i.push(n))}return i}(t,o));(4===e.renderWhitespace||1===e.renderWhitespace||2===e.renderWhitespace&&e.selectionsOnLine||3===e.renderWhitespace&&!e.continuesWithWrappedLine)&&(o=function(e,t,i,n){const s=e.continuesWithWrappedLine,o=e.fauxIndentLength,r=e.tabSize,a=e.startVisibleColumn,l=e.useMonospaceOptimizations,h=e.selectionsOnLine,d=1===e.renderWhitespace,c=3===e.renderWhitespace,u=e.renderSpaceWidth!==e.spaceWidth,g=[];let p=0,m=0,f=n[m].type,_=n[m].containsRTL,v=n[m].endIndex;const b=n.length;let C,w=!1,y=ro(t);-1===y?(w=!0,y=i,C=i):C=lo(t);let S=!1,L=0,k=h&&h[L],D=a%r;for(let N=o;N=k.endOffset&&(L++,k=h&&h[L]),NC)s=!0;else if(9===e)s=!0;else if(32===e)if(d)if(S)s=!0;else{const e=N+1N),s&&c&&(s=w||N>C),s&&_&&N>=y&&N<=C&&(s=!1),S){if(!s||!l&&D>=r){if(u){for(let e=(p>0?g[p-1].endIndex:o)+1;e<=N;e++)g[p++]=new SA(e,"mtkw",1,!1)}else g[p++]=new SA(N,"mtkw",1,!1);D%=r}}else(N===v||s&&N>o)&&(g[p++]=new SA(N,f,0,_),D%=r);for(9===e?D=r:Oo(e)?D+=2:D++,S=s;N===v&&(m++,m0?t.charCodeAt(i-1):0,n=i>1?t.charCodeAt(i-2):0;32===e&&32!==n&&9!==n||(x=!0)}else x=!0;if(x)if(u){for(let e=(p>0?g[p-1].endIndex:o)+1;e<=i;e++)g[p++]=new SA(e,"mtkw",1,!1)}else g[p++]=new SA(i,"mtkw",1,!1);else g[p++]=new SA(i,f,0,_);return g}(e,t,s,o));let r=0;if(e.lineDecorations.length>0){for(let t=0,i=e.lineDecorations.length;th&&(h=e.startOffset,a[l++]=new SA(h,n,d,u)),!(e.endOffset+1<=t)){h=t,a[l++]=new SA(h,n+" "+e.className,d|e.metadata,u);break}h=e.endOffset+1,a[l++]=new SA(h,n+" "+e.className,d|e.metadata,u),r++}t>h&&(h=t,a[l++]=new SA(h,n,d,u))}const d=i[i.length-1].endIndex;if(r=50&&(s[o++]=new SA(h+1,t,r,l),d=h+1,h=-1);d!==a&&(s[o++]=new SA(a,t,r,l))}else s[o++]=i;n=a}else for(let r=0,a=t.length;r50){const t=e.type,r=e.metadata,l=e.containsRTL,h=Math.ceil(a/50);for(let e=1;e=8234&&e<=8238||e>=8294&&e<=8297||e>=8206&&e<=8207||1564===e)}function AA(e){return e.toString(16).toUpperCase().padStart(4,"0")}const OA=!!Be||!(Fe||ne||re);let PA=!0;class FA{constructor(e,t){this.themeType=t;const i=e.options,n=i.get(50),s=i.get(38);this.renderWhitespace="off"===s?i.get(98):"none",this.renderControlCharacters=i.get(93),this.spaceWidth=n.spaceWidth,this.middotWidth=n.middotWidth,this.wsmiddotWidth=n.wsmiddotWidth,this.useMonospaceOptimizations=n.isMonospace&&!i.get(33),this.canUseHalfwidthRightwardsArrow=n.canUseHalfwidthRightwardsArrow,this.lineHeight=i.get(66),this.stopRenderingLineAfter=i.get(116),this.fontLigatures=i.get(51)}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}}class BA{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)throw new Error("I have no rendered view line to set the dom node to...");this._renderedViewLine.domNode=Vk(e)}onContentChanged(){this._isMaybeInvalid=!0}onTokensChanged(){this._isMaybeInvalid=!0}onDecorationsChanged(){this._isMaybeInvalid=!0}onOptionsChanged(e){this._isMaybeInvalid=!0,this._options=e}onSelectionChanged(){return!(!A_(this._options.themeType)&&"selection"!==this._options.renderWhitespace)&&(this._isMaybeInvalid=!0,!0)}renderLine(e,t,i,n){if(!1===this._isMaybeInvalid)return!1;this._isMaybeInvalid=!1;const s=i.getViewLineRenderingData(e),o=this._options,r=bA.filter(s.inlineDecorations,e,s.minColumn,s.maxColumn);let a=null;if(A_(o.themeType)||"selection"===this._options.renderWhitespace){const t=i.selections;for(const i of t){if(i.endLineNumbere)continue;const t=i.startLineNumber===e?i.startColumn:s.minColumn,n=i.endLineNumber===e?i.endColumn:s.maxColumn;t');const h=EA(l,n);n.appendString("");let d=null;return PA&&OA&&s.isBasicASCII&&o.useMonospaceOptimizations&&0===h.containsForeignElements&&(d=new WA(this._renderedViewLine?this._renderedViewLine.domNode:null,l,h.characterMapping)),d||(d=zA(this._renderedViewLine?this._renderedViewLine.domNode:null,l,h.characterMapping,h.containsRTL,h.containsForeignElements)),this._renderedViewLine=d,!0}layoutLine(e,t){this._renderedViewLine&&this._renderedViewLine.domNode&&(this._renderedViewLine.domNode.setTop(t),this._renderedViewLine.domNode.setHeight(this._options.lineHeight))}getWidth(e){return this._renderedViewLine?this._renderedViewLine.getWidth(e):0}getWidthIsFast(){return!this._renderedViewLine||this._renderedViewLine.getWidthIsFast()}needsMonospaceFontCheck(){return!!this._renderedViewLine&&this._renderedViewLine instanceof WA}monospaceAssumptionsAreValid(){return this._renderedViewLine&&this._renderedViewLine instanceof WA?this._renderedViewLine.monospaceAssumptionsAreValid():PA}onMonospaceAssumptionsInvalidated(){this._renderedViewLine&&this._renderedViewLine instanceof WA&&(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 s=this._renderedViewLine.input.stopRenderingLineAfter;if(-1!==s&&t>s+1&&i>s+1)return new _A(!0,[new mA(this.getWidth(n),0)]);-1!==s&&t>s+1&&(t=s+1),-1!==s&&i>s+1&&(i=s+1);const o=this._renderedViewLine.getVisibleRangesForRange(e,t,i,n);return o&&o.length>0?new _A(!1,o):null}getColumnOfNodeOffset(e,t){return this._renderedViewLine?this._renderedViewLine.getColumnOfNodeOffset(e,t):1}}BA.CLASS_NAME="view-line";class WA{constructor(e,t,i){this._cachedWidth=-1,this.domNode=e,this.input=t;const n=Math.floor(t.lineContent.length/300);if(n>0){this._keyColumnPixelOffsetCache=new Float32Array(n);for(let e=0;e=2&&(console.warn("monospace assumptions have been violated, therefore disabling monospace optimizations!"),PA=!1)}return PA}toSlowRenderedLine(){return zA(this.domNode,this.input,this._characterMapping,!1,0)}getVisibleRangesForRange(e,t,i,n){const s=this._getColumnPixelOffset(e,t,n),o=this._getColumnPixelOffset(e,i,n);return[new mA(s,o-s)]}_getColumnPixelOffset(e,t,i){if(t<=300){const e=this._characterMapping.getHorizontalOffset(t);return this._charWidth*e}const n=Math.floor((t-1)/300)-1,s=300*(n+1)+1;let o=-1;if(this._keyColumnPixelOffsetCache&&(o=this._keyColumnPixelOffsetCache[n],-1===o&&(o=this._actualReadPixelOffset(e,s,i),this._keyColumnPixelOffsetCache[n]=o)),-1===o){const e=this._characterMapping.getHorizontalOffset(t);return this._charWidth*e}const r=this._characterMapping.getHorizontalOffset(s),a=this._characterMapping.getHorizontalOffset(t);return o+this._charWidth*(a-r)}_getReadingTarget(e){return e.domNode.firstChild}_actualReadPixelOffset(e,t,i){if(!this.domNode)return-1;const n=this._characterMapping.getDomPosition(t),s=vA.readHorizontalRanges(this._getReadingTarget(this.domNode),n.partIndex,n.charIndex,n.partIndex,n.charIndex,i);return s&&0!==s.length?s[0].left:-1}getColumnOfNodeOffset(e,t){return jA(this._characterMapping,e,t)}}class VA{constructor(e,t,i,n,s){if(this.domNode=e,this.input=t,this._characterMapping=i,this._isWhitespaceOnly=/^\s*$/.test(t.lineContent),this._containsForeignElements=s,this._cachedWidth=-1,this._pixelOffsetCache=null,!n||0===this._characterMapping.length){this._pixelOffsetCache=new Float32Array(Math.max(2,this._characterMapping.length+1));for(let e=0,t=this._characterMapping.length;e<=t;e++)this._pixelOffsetCache[e]=-1}}_getReadingTarget(e){return e.domNode.firstChild}getWidth(e){return this.domNode?(-1===this._cachedWidth&&(this._cachedWidth=this._getReadingTarget(this.domNode).offsetWidth,null==e||e.markDidDomLayout()),this._cachedWidth):0}getWidthIsFast(){return-1!==this._cachedWidth}getVisibleRangesForRange(e,t,i,n){if(!this.domNode)return null;if(null!==this._pixelOffsetCache){const s=this._readPixelOffset(this.domNode,e,t,n);if(-1===s)return null;const o=this._readPixelOffset(this.domNode,e,i,n);return-1===o?null:[new mA(s,o-s)]}return this._readVisibleRangesForRange(this.domNode,e,t,i,n)}_readVisibleRangesForRange(e,t,i,n,s){if(i===n){const n=this._readPixelOffset(e,t,i,s);return-1===n?null:[new mA(n,0)]}return this._readRawVisibleRangesForRange(e,i,n,s)}_readPixelOffset(e,t,i,n){if(0===this._characterMapping.length){if(0===this._containsForeignElements)return 0;if(2===this._containsForeignElements)return 0;if(1===this._containsForeignElements)return this.getWidth(n);const t=this._getReadingTarget(e);return t.firstChild?(n.markDidDomLayout(),t.firstChild.offsetWidth):0}if(null!==this._pixelOffsetCache){const s=this._pixelOffsetCache[i];if(-1!==s)return s;const o=this._actualReadPixelOffset(e,t,i,n);return this._pixelOffsetCache[i]=o,o}return this._actualReadPixelOffset(e,t,i,n)}_actualReadPixelOffset(e,t,i,n){if(0===this._characterMapping.length){const t=vA.readHorizontalRanges(this._getReadingTarget(e),0,0,0,0,n);return t&&0!==t.length?t[0].left:-1}if(i===this._characterMapping.length&&this._isWhitespaceOnly&&0===this._containsForeignElements)return this.getWidth(n);const s=this._characterMapping.getDomPosition(i),o=vA.readHorizontalRanges(this._getReadingTarget(e),s.partIndex,s.charIndex,s.partIndex,s.charIndex,n);if(!o||0===o.length)return-1;const r=o[0].left;if(this.input.isBasicASCII){const e=this._characterMapping.getHorizontalOffset(i),t=Math.round(this.input.spaceWidth*e);if(Math.abs(t-r)<=1)return t}return r}_readRawVisibleRangesForRange(e,t,i,n){if(1===t&&i===this._characterMapping.length)return[new mA(0,this.getWidth(n))];const s=this._characterMapping.getDomPosition(t),o=this._characterMapping.getDomPosition(i);return vA.readHorizontalRanges(this._getReadingTarget(e),s.partIndex,s.charIndex,o.partIndex,o.charIndex,n)}getColumnOfNodeOffset(e,t){return jA(this._characterMapping,e,t)}}class HA extends VA{_readVisibleRangesForRange(e,t,i,n,s){const o=super._readVisibleRangesForRange(e,t,i,n,s);if(!o||0===o.length||i===n||1===i&&n===this._characterMapping.length)return o;if(!this.input.containsRTL){const i=this._readPixelOffset(e,t,n,s);if(-1!==i){const e=o[o.length-1];e.left=4&&3===e[0]&&7===e[3]}static isStrictChildOfViewLines(e){return e.length>4&&3===e[0]&&7===e[3]}static isChildOfScrollableElement(e){return e.length>=2&&3===e[0]&&5===e[1]}static isChildOfMinimap(e){return e.length>=2&&3===e[0]&&8===e[1]}static isChildOfContentWidgets(e){return e.length>=4&&3===e[0]&&1===e[3]}static isChildOfOverflowGuard(e){return e.length>=1&&3===e[0]}static isChildOfOverflowingContentWidgets(e){return e.length>=1&&2===e[0]}static isChildOfOverlayWidgets(e){return e.length>=2&&3===e[0]&&4===e[1]}}class QA{constructor(e,t,i){this.viewModel=e.viewModel;const n=e.configuration.options;this.layoutInfo=n.get(143),this.viewDomNode=t.viewDomNode,this.lineHeight=n.get(66),this.stickyTabStops=n.get(115),this.typicalHalfwidthCharacterWidth=n.get(50).typicalHalfwidthCharacterWidth,this.lastRenderData=i,this._context=e,this._viewHelper=t}getZoneAtCoord(e){return QA.getZoneAtCoord(this._context,e)}static getZoneAtCoord(e,t){const i=e.viewLayout.getWhitespaceAtVerticalOffset(t);if(i){const n=i.verticalOffset+i.height/2,s=e.viewModel.getLineCount();let o,r=null,a=null;return i.afterLineNumber!==s&&(a=new Va(i.afterLineNumber+1,1)),i.afterLineNumber>0&&(r=new Va(i.afterLineNumber,e.viewModel.getLineMaxColumn(i.afterLineNumber))),o=null===a?r:null===r?a:t=e.layoutInfo.glyphMarginLeft,this.isInContentArea=!this.isInMarginArea,this.mouseColumn=Math.max(0,nO._getMouseColumn(this.mouseContentHorizontalOffset,e.typicalHalfwidthCharacterWidth))}}class eO extends JA{constructor(e,t,i,n,s){super(e,t,i,n),this._ctx=e,s?(this.target=s,this.targetPath=dA.collect(s,e.viewDomNode)):(this.target=null,this.targetPath=new Uint8Array(0))}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}\n\ttarget: ${this.target?this.target.outerHTML:null}`}_getMouseColumn(e=null){return e&&e.columno.contentLeft+o.width)continue;const i=e.getVerticalOffsetForLineNumber(o.position.lineNumber);if(i<=s&&s<=i+o.height)return t.fulfillContentText(o.position,null,{mightBeForeignElement:!1,injectedText:null})}}return null}static _hitTestViewZone(e,t){const i=e.getZoneAtCoord(t.mouseVerticalOffset);if(i){const e=t.isInContentArea?8:5;return t.fulfillViewZone(e,i.position,i)}return null}static _hitTestTextArea(e,t){return XA.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 s=Math.abs(t.relativePos.x);const o={isAfterLines:i.isAfterLines,glyphMarginLeft:e.layoutInfo.glyphMarginLeft,glyphMarginWidth:e.layoutInfo.glyphMarginWidth,lineNumbersWidth:e.layoutInfo.lineNumbersWidth,offsetX:s};return s-=e.layoutInfo.glyphMarginLeft,s<=e.layoutInfo.glyphMarginWidth?t.fulfillMargin(2,n,i.range,o):(s-=e.layoutInfo.glyphMarginWidth,s<=e.layoutInfo.lineNumbersWidth?t.fulfillMargin(3,n,i.range,o):(s-=e.layoutInfo.lineNumbersWidth,t.fulfillMargin(4,n,i.range,o)))}return null}static _hitTestViewLines(e,t,i){if(!XA.isChildOfViewLines(t.targetPath))return null;if(e.isInTopPadding(t.mouseVerticalOffset))return t.fulfillContentEmpty(new Va(1,1),tO);if(e.isAfterLines(t.mouseVerticalOffset)||e.isInBottomPadding(t.mouseVerticalOffset)){const i=e.viewModel.getLineCount(),n=e.viewModel.getLineMaxColumn(i);return t.fulfillContentEmpty(new Va(i,n),tO)}if(i){if(XA.isStrictChildOfViewLines(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset);if(0===e.viewModel.getLineLength(i)){const n=e.getLineWidth(i),s=iO(t.mouseContentHorizontalOffset-n);return t.fulfillContentEmpty(new Va(i,1),s)}const n=e.getLineWidth(i);if(t.mouseContentHorizontalOffset>=n){const s=iO(t.mouseContentHorizontalOffset-n),o=new Va(i,e.viewModel.getLineMaxColumn(i));return t.fulfillContentEmpty(o,s)}}return t.fulfillUnknown()}const n=nO._doHitTest(e,t);return 1===n.type?nO.createMouseTargetFromHitTestPosition(e,t,n.spanNode,n.position,n.injectedText):this._createMouseTarget(e,t.withTarget(n.hitTarget),!0)}static _hitTestMinimap(e,t){if(XA.isChildOfMinimap(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new Va(i,n))}return null}static _hitTestScrollbarSlider(e,t){if(XA.isChildOfScrollableElement(t.targetPath)&&t.target&&1===t.target.nodeType){const i=t.target.className;if(i&&/\b(slider|scrollbar)\b/.test(i)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new Va(i,n))}}return null}static _hitTestScrollbar(e,t){if(XA.isChildOfScrollableElement(t.targetPath)){const i=e.getLineNumberAtVerticalOffset(t.mouseVerticalOffset),n=e.viewModel.getLineMaxColumn(i);return t.fulfillScrollbar(new Va(i,n))}return null}getMouseColumn(e){const t=this._context.configuration.options,i=t.get(143),n=this._context.viewLayout.getCurrentScrollLeft()+e.x-i.contentLeft;return nO._getMouseColumn(n,t.get(50).typicalHalfwidthCharacterWidth)}static _getMouseColumn(e,t){if(e<0)return 1;return Math.round(e/t)+1}static createMouseTargetFromHitTestPosition(e,t,i,n,s){const o=n.lineNumber,r=n.column,a=e.getLineWidth(o);if(t.mouseContentHorizontalOffset>a){const e=iO(t.mouseContentHorizontalOffset-a);return t.fulfillContentEmpty(n,e)}const l=e.visibleRangeForPosition(o,r);if(!l)return t.fulfillUnknown(n);const h=l.left;if(Math.abs(t.mouseContentHorizontalOffset-h)<1)return t.fulfillContentText(n,null,{mightBeForeignElement:!!s,injectedText:s});const d=[];if(d.push({offset:l.left,column:r}),r>1){const t=e.visibleRangeForPosition(o,r-1);t&&d.push({offset:t.left,column:r-1})}if(re.offset-t.offset));const c=t.pos.toClientCoordinates(),u=i.getBoundingClientRect(),g=u.left<=c.clientX&&c.clientX<=u.right;let p=null;for(let m=1;ms)){const i=Math.floor((n+s)/2);let o=t.pos.y+(i-t.mouseVerticalOffset);o<=t.editorPos.y&&(o=t.editorPos.y+1),o>=t.editorPos.y+t.editorPos.height&&(o=t.editorPos.y+t.editorPos.height-1);const r=new TE(t.pos.x,o),a=this._actualDoHitTestWithCaretRangeFromPoint(e,r.toClientCoordinates());if(1===a.type)return a}return this._actualDoHitTestWithCaretRangeFromPoint(e,t.pos.toClientCoordinates())}static _actualDoHitTestWithCaretRangeFromPoint(e,t){const i=Yn(e.viewDomNode);let n;if(n=i?void 0===i.caretRangeFromPoint?function(e,t,i){const n=document.createRange();let s=e.elementFromPoint(t,i);if(null!==s){for(;s&&s.firstChild&&s.firstChild.nodeType!==s.firstChild.TEXT_NODE&&s.lastChild&&s.lastChild.firstChild;)s=s.lastChild;const e=s.getBoundingClientRect(),i=`${window.getComputedStyle(s,null).getPropertyValue("font-style")} ${window.getComputedStyle(s,null).getPropertyValue("font-variant")} ${window.getComputedStyle(s,null).getPropertyValue("font-weight")} ${window.getComputedStyle(s,null).getPropertyValue("font-size")}/${window.getComputedStyle(s,null).getPropertyValue("line-height")} ${window.getComputedStyle(s,null).getPropertyValue("font-family")}`,o=s.innerText;let r,a=e.left,l=0;if(t>e.left+e.width)l=o.length;else{const e=sO.getInstance();for(let n=0;nthis._createMouseTarget(e,t)),(e=>this._getMouseColumn(e)))),this.lastMouseLeaveTime=-1,this._height=this._context.configuration.options.get(143).height;const n=new WE(this.viewHelper.viewDomNode);this._register(n.onContextMenu(this.viewHelper.viewDomNode,(e=>this._onContextMenu(e,!0)))),this._register(n.onMouseMove(this.viewHelper.viewDomNode,(e=>{this._onMouseMove(e),this._mouseLeaveMonitor||(this._mouseLeaveMonitor=En(this.viewHelper.viewDomNode.ownerDocument,"mousemove",(e=>{this.viewHelper.viewDomNode.contains(e.target)||this._onMouseLeave(new BE(e,!1,this.viewHelper.viewDomNode))})))}))),this._register(n.onMouseUp(this.viewHelper.viewDomNode,(e=>this._onMouseUp(e)))),this._register(n.onMouseLeave(this.viewHelper.viewDomNode,(e=>this._onMouseLeave(e))));let s=0;this._register(n.onPointerDown(this.viewHelper.viewDomNode,((e,t)=>{s=t}))),this._register(En(this.viewHelper.viewDomNode,os.POINTER_UP,(e=>{this._mouseDownOperation.onPointerUp()}))),this._register(n.onMouseDown(this.viewHelper.viewDomNode,(e=>this._onMouseDown(e,s)))),this._setupMouseWheelZoomListener(),this._context.addEventHandler(this)}_setupMouseWheelZoomListener(){const e=MD.INSTANCE;let t=0,i=HR.getZoomLevel(),n=!1,s=0;function o(e){return Pe?(e.metaKey||e.ctrlKey)&&!e.shiftKey&&!e.altKey:e.ctrlKey&&!e.metaKey&&!e.shiftKey&&!e.altKey}this._register(En(this.viewHelper.viewDomNode,os.MOUSE_WHEEL,(r=>{if(this.viewController.emitMouseWheel(r),!this._context.configuration.options.get(75))return;const a=new Et(r);if(e.acceptStandardWheelEvent(a),e.isPhysicalMouseWheel()){if(o(r)){const e=HR.getZoomLevel(),t=a.deltaY>0?1:-1;HR.setZoomLevel(e+t),a.preventDefault(),a.stopPropagation()}}else Date.now()-t>50&&(i=HR.getZoomLevel(),n=o(r),s=0),t=Date.now(),s+=a.deltaY,n&&(HR.setZoomLevel(i+s/5),a.preventDefault(),a.stopPropagation())}),{capture:!0,passive:!1}))}dispose(){this._context.removeEventHandler(this),this._mouseLeaveMonitor&&(this._mouseLeaveMonitor.dispose(),this._mouseLeaveMonitor=null),super.dispose()}onConfigurationChanged(e){if(e.hasChanged(143)){const e=this._context.configuration.options.get(143).height;this._height!==e&&(this._height=e,this._mouseDownOperation.onHeightChanged())}return!1}onCursorStateChanged(e){return this._mouseDownOperation.onCursorStateChanged(e),!1}onFocusChanged(e){return!1}getTargetAtClientPoint(e,t){const i=new RE(e,t).toPageCoordinates(),n=PE(this.viewHelper.viewDomNode);if(i.yn.y+n.height||i.xn.x+n.width)return null;const s=FE(this.viewHelper.viewDomNode,n,i);return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),n,i,s,null)}_createMouseTarget(e,t){let i=e.target;if(!this.viewHelper.viewDomNode.contains(i)){const t=Yn(this.viewHelper.viewDomNode);t&&(i=t.elementsFromPoint(e.posx,e.posy).find((e=>this.viewHelper.viewDomNode.contains(e))))}return this.mouseTargetFactory.createMouseTarget(this.viewHelper.getLastRenderData(),e.editorPos,e.pos,e.relativePos,t?i:null)}_getMouseColumn(e){return this.mouseTargetFactory.getMouseColumn(e.relativePos)}_onContextMenu(e,t){this.viewController.emitContextMenu({event:e,target:this._createMouseTarget(e,t)})}_onMouseMove(e){if(this.mouseTargetFactory.mouseTargetIsWidget(e)||e.preventDefault(),this._mouseDownOperation.isActive())return;e.timestamp{e.preventDefault(),this.viewHelper.focusTextArea()};if(h&&(n||o&&r))d(),this._mouseDownOperation.start(i.type,e,t);else if(s)e.preventDefault();else if(a){const n=i.detail;h&&this.viewHelper.shouldSuppressMouseDownOnViewZone(n.viewZoneId)&&(d(),this._mouseDownOperation.start(i.type,e,t),e.preventDefault())}else l&&this.viewHelper.shouldSuppressMouseDownOnWidget(i.detail)&&(d(),e.preventDefault());this.viewController.emitMouseDown({event:e,target:i})}}class rO extends E{constructor(e,t,i,n,s,o){super(),this._context=e,this._viewController=t,this._viewHelper=i,this._mouseTargetFactory=n,this._createMouseTarget=s,this._getMouseColumn=o,this._mouseMoveMonitor=this._register(new HE(this._viewHelper.viewDomNode)),this._topBottomDragScrolling=this._register(new aO(this._context,this._viewHelper,this._mouseTargetFactory,((e,t,i)=>this._dispatchMouse(e,t,i)))),this._mouseState=new hO,this._currentSelection=new Ah(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}):13!==t.type||"above"!==t.outsidePosition&&"below"!==t.outsidePosition?(this._topBottomDragScrolling.stop(),this._dispatchMouse(t,!0,1)):this._topBottomDragScrolling.start(t,e))}start(e,t,i){this._lastMouseEvent=t,this._mouseState.setStartedOnLineNumbers(3===e),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 s=this._context.configuration.options;if(!s.get(90)&&s.get(35)&&!s.get(22)&&!this._mouseState.altKey&&t.detail<2&&!this._isActive&&!this._currentSelection.isEmpty()&&6===n.type&&n.position&&this._currentSelection.containsPosition(n.position))return this._mouseState.isDragAndDrop=!0,this._isActive=!0,void this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,(e=>this._onMouseDownThenMove(e)),(e=>{const t=this._findMousePosition(this._lastMouseEvent,!1);e&&e instanceof KeyboardEvent?this._viewController.emitMouseDropCanceled():this._viewController.emitMouseDrop({event:this._lastMouseEvent,target:t?this._createMouseTarget(this._lastMouseEvent,!0):null}),this._stop()}));this._mouseState.isDragAndDrop=!1,this._dispatchMouse(n,t.shiftKey,1),this._isActive||(this._isActive=!0,this._mouseMoveMonitor.startMonitoring(this._viewHelper.viewLinesDomNode,i,t.buttons,(e=>this._onMouseDownThenMove(e)),(()=>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,s=this._getMouseColumn(e);if(e.posyt.y+t.height){const o=e.posy-t.y-t.height,r=n.getCurrentScrollTop()+e.relativePos.y,a=QA.getZoneAtCoord(this._context,r);if(a){const e=this._helpPositionJumpOverViewZone(a);if(e)return YA.createOutsideEditor(s,e,"below",o)}const l=n.getLineNumberAtVerticalOffset(r);return YA.createOutsideEditor(s,new Va(l,i.getLineMaxColumn(l)),"below",o)}const o=n.getLineNumberAtVerticalOffset(n.getCurrentScrollTop()+e.relativePos.y);if(e.posxt.x+t.width){const n=e.posx-t.x-t.width;return YA.createOutsideEditor(s,new Va(o,i.getLineMaxColumn(o)),"right",n)}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(8===n.type||5===n.type){const e=this._helpPositionJumpOverViewZone(n.detail);if(e)return YA.createViewZone(n.type,n.element,n.mouseColumn,e,n.detail)}return n}_helpPositionJumpOverViewZone(e){const t=new Va(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:6===e.type&&null!==e.detail.injectedText})}}class aO extends E{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 lO(this._context,this._viewHelper,this._mouseTargetFactory,this._dispatchMouse,e,t)}stop(){this._operation&&(this._operation.dispose(),this._operation=null)}}class lO extends E{constructor(e,t,i,n,s,o){super(),this._context=e,this._viewHelper=t,this._mouseTargetFactory=i,this._dispatchMouse=n,this._position=s,this._mouseEvent=o,this._lastTime=Date.now(),this._animationFrameDisposable=An((()=>this._execute()))}dispose(){this._animationFrameDisposable.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(66),t=this._context.configuration.options.get(143).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(66),t=this._getScrollSpeed()*(this._tick()/1e3)*e,i="above"===this._position.outsidePosition?-t:t;this._context.viewModel.viewLayout.deltaScrollNow(0,i),this._viewHelper.renderNow();const n=this._context.viewLayout.getLinesViewportData(),s="above"===this._position.outsidePosition?n.startLineNumber:n.endLineNumber;let o;{const e=PE(this._viewHelper.viewDomNode),t=this._context.configuration.options.get(143).horizontalScrollbarHeight,i=new TE(this._mouseEvent.pos.x,e.y+e.height-t-.1),n=FE(this._viewHelper.viewDomNode,e,i);o=this._mouseTargetFactory.createMouseTarget(this._viewHelper.getLastRenderData(),e,i,n,null)}o.position&&o.position.lineNumber===s||(o="above"===this._position.outsidePosition?YA.createOutsideEditor(this._position.mouseColumn,new Va(s,1),"above",this._position.outsideDistance):YA.createOutsideEditor(this._position.mouseColumn,new Va(s,this._context.viewModel.getLineMaxColumn(s)),"below",this._position.outsideDistance)),this._dispatchMouse(o,!0,2),this._animationFrameDisposable=An((()=>this._execute()))}}class hO{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>hO.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)}}hO.CLEAR_MOUSE_DOWN_COUNT_TIME=400;class dO extends oO{constructor(e,t,i){super(e,t,i),this._register(ZL.addTarget(this.viewHelper.linesContentDomNode)),this._register(En(this.viewHelper.linesContentDomNode,$L.Tap,(e=>this.onTap(e)))),this._register(En(this.viewHelper.linesContentDomNode,$L.Change,(e=>this.onChange(e)))),this._register(En(this.viewHelper.linesContentDomNode,$L.Contextmenu,(e=>this._onContextMenu(new BE(e,!1,this.viewHelper.viewDomNode),!1)))),this._lastPointerType="mouse",this._register(En(this.viewHelper.linesContentDomNode,"pointerdown",(e=>{const t=e.pointerType;this._lastPointerType="mouse"!==t?"touch"===t?"touch":"pen":"mouse"})));const n=new VE(this.viewHelper.viewDomNode);this._register(n.onPointerMove(this.viewHelper.viewDomNode,(e=>this._onMouseMove(e)))),this._register(n.onPointerUp(this.viewHelper.viewDomNode,(e=>this._onMouseUp(e)))),this._register(n.onPointerLeave(this.viewHelper.viewDomNode,(e=>this._onMouseLeave(e)))),this._register(n.onPointerDown(this.viewHelper.viewDomNode,((e,t)=>this._onMouseDown(e,t))))}onTap(e){if(!e.initialTarget||!this.viewHelper.linesContentDomNode.contains(e.initialTarget))return;e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new BE(e,!1,this.viewHelper.viewDomNode),!1);t.position&&this.viewController.dispatchMouse({position:t.position,mouseColumn:t.position.column,startedOnLineNumbers:!1,revealType:1,mouseDownCount:e.tapCount,inSelectionMode:!1,altKey:!1,ctrlKey:!1,metaKey:!1,shiftKey:!1,leftButton:!1,middleButton:!1,onInjectedText:6===t.type&&null!==t.detail.injectedText})}onChange(e){"touch"===this._lastPointerType&&this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}_onMouseDown(e,t){"touch"!==e.browserEvent.pointerType&&super._onMouseDown(e,t)}}class cO extends oO{constructor(e,t,i){super(e,t,i),this._register(ZL.addTarget(this.viewHelper.linesContentDomNode)),this._register(En(this.viewHelper.linesContentDomNode,$L.Tap,(e=>this.onTap(e)))),this._register(En(this.viewHelper.linesContentDomNode,$L.Change,(e=>this.onChange(e)))),this._register(En(this.viewHelper.linesContentDomNode,$L.Contextmenu,(e=>this._onContextMenu(new BE(e,!1,this.viewHelper.viewDomNode),!1))))}onTap(e){e.preventDefault(),this.viewHelper.focusTextArea();const t=this._createMouseTarget(new BE(e,!1,this.viewHelper.viewDomNode),!1);if(t.position){const e=document.createEvent("CustomEvent");e.initEvent($y.Tap,!1,!0),this.viewHelper.dispatchTextAreaEvent(e),this.viewController.moveTo(t.position,1)}}onChange(e){this._context.viewModel.viewLayout.deltaScrollNow(-e.translationX,-e.translationY)}}class uO extends E{constructor(e,t,i){super(),He&&tt?this.handler=this._register(new dO(e,t,i)):window.TouchEvent?this.handler=this._register(new cO(e,t,i)):this.handler=this._register(new oO(e,t,i))}getTargetAtClientPoint(e,t){return this.handler.getTargetAtClientPoint(e,t)}}class gO extends lA{}class pO extends gO{constructor(e){super(),this._context=e,this._readConfig(),this._lastCursorModelPosition=new Va(1,1),this._renderResult=null,this._activeLineNumber=1,this._context.addEventHandler(this)}_readConfig(){const e=this._context.configuration.options;this._lineHeight=e.get(66);const t=e.get(67);this._renderLineNumbers=t.renderType,this._renderCustomLineNumbers=t.renderFn,this._renderFinalNewline=e.get(94);const i=e.get(143);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),2!==this._renderLineNumbers&&3!==this._renderLineNumbers||(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}_getLineRenderLineNumber(e){const t=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Va(e,1));if(1!==t.column)return"";const i=t.lineNumber;if(this._renderCustomLineNumbers)return this._renderCustomLineNumbers(i);if(2===this._renderLineNumbers){const e=Math.abs(this._lastCursorModelPosition.lineNumber-i);return 0===e?''+i+"":String(e)}return 3===this._renderLineNumbers?this._lastCursorModelPosition.lineNumber===i||i%10==0?String(i):"":String(i)}prepareRender(e){if(0===this._renderLineNumbers)return void(this._renderResult=null);const t=Fe?this._lineHeight%2==0?" lh-even":" lh-odd":"",i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,s=this._context.viewModel.getLineCount(),o=[];for(let r=i;r<=n;r++){const e=r-i,n=this._getLineRenderLineNumber(r);if(!n){o[e]="";continue}let a="";if(r===s&&0===this._context.viewModel.getLineLength(r)){if("off"===this._renderFinalNewline){o[e]="";continue}"dimmed"===this._renderFinalNewline&&(a=" dimmed-line-number")}r===this._activeLineNumber&&(a=" active-line-number"),o[e]=`
    ${n}
    `}this._renderResult=o}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}pO.CLASS_NAME="line-numbers",H_(((e,t)=>{const i=e.getColor(G_),n=e.getColor(dv);n?t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${n}; }`):i&&t.addRule(`.monaco-editor .line-numbers.dimmed-line-number { color: ${i.transparent(.4)}; }`)}));class mO extends hA{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._canUseLayerHinting=!t.get(32),this._contentLeft=i.contentLeft,this._glyphMarginLeft=i.glyphMarginLeft,this._glyphMarginWidth=i.glyphMarginWidth,this._domNode=Vk(document.createElement("div")),this._domNode.setClassName(mO.OUTER_CLASS_NAME),this._domNode.setPosition("absolute"),this._domNode.setAttribute("role","presentation"),this._domNode.setAttribute("aria-hidden","true"),this._glyphMarginBackgroundDomNode=Vk(document.createElement("div")),this._glyphMarginBackgroundDomNode.setClassName(mO.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(143);return this._canUseLayerHinting=!t.get(32),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)}}mO.CLASS_NAME="glyph-margin",mO.OUTER_CLASS_NAME="margin";const fO="monaco-mouse-cursor-text";const _O=new class{constructor(){this._onDidChange=new U,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()}};var vO=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},bO=function(e,t){return function(i,n){t(i,n,e)}};class CO{constructor(e,t,i,n,s){this._context=e,this.modelLineNumber=t,this.distanceToModelLineStart=i,this.widthOfHiddenLineTextBefore=n,this.distanceToModelLineEnd=s,this._visibleTextAreaBrand=void 0,this.startPosition=null,this.endPosition=null,this.visibleTextareaStart=null,this.visibleTextareaEnd=null,this._previousPresentation=null}prepareRender(e){const t=new Va(this.modelLineNumber,this.distanceToModelLineStart+1),i=new Va(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||(this._previousPresentation=e||{foreground:1,italic:!1,bold:!1,underline:!1,strikethrough:!1}),this._previousPresentation}}const wO=ne;let yO=class extends hA{constructor(e,t,i,n){super(e),this._keybindingService=n,this._primaryCursorPosition=new Va(1,1),this._primaryCursorVisibleRange=null,this._viewController=t,this._visibleRangeProvider=i,this._scrollLeft=0,this._scrollTop=0;const s=this._context.configuration.options,o=s.get(143);this._setAccessibilityOptions(s),this._contentLeft=o.contentLeft,this._contentWidth=o.contentWidth,this._contentHeight=o.height,this._fontInfo=s.get(50),this._lineHeight=s.get(66),this._emptySelectionClipboard=s.get(37),this._copyWithSyntaxHighlighting=s.get(25),this._visibleTextArea=null,this._selections=[new Ah(1,1,1,1)],this._modelSelections=[new Ah(1,1,1,1)],this._lastRenderPosition=null,this.textArea=Vk(document.createElement("textarea")),dA.write(this.textArea,6),this.textArea.setClassName(`inputarea ${fO}`),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off");const{tabSize:r}=this._context.viewModel.model.getOptions();this.textArea.domNode.style.tabSize=r*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(s)),this.textArea.setAttribute("aria-required",s.get(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(s.get(123))),this.textArea.setAttribute("role","textbox"),this.textArea.setAttribute("aria-roledescription",ue(0,"editor")),this.textArea.setAttribute("aria-multiline","true"),this.textArea.setAttribute("aria-autocomplete",s.get(90)?"none":"both"),this._ensureReadOnlyAttribute(),this.textAreaCover=Vk(document.createElement("div")),this.textAreaCover.setPosition("absolute");const a={getLineCount:()=>this._context.viewModel.getLineCount(),getLineMaxColumn:e=>this._context.viewModel.getLineMaxColumn(e),getValueInRange:(e,t)=>this._context.viewModel.getValueInRange(e,t),getValueLengthInRange:(e,t)=>this._context.viewModel.getValueLengthInRange(e,t),modifyPosition:(e,t)=>this._context.viewModel.modifyPosition(e,t)},l={getDataToCopy:()=>{const e=this._context.viewModel.getPlainTextToCopy(this._modelSelections,this._emptySelectionClipboard,Oe),t=this._context.viewModel.model.getEOL(),i=this._emptySelectionClipboard&&1===this._modelSelections.length&&this._modelSelections[0].isEmpty(),n=Array.isArray(e)?e:null,s=Array.isArray(e)?e.join(t):e;let o,r=null;if(Gy.forceCopyWithSyntaxHighlighting||this._copyWithSyntaxHighlighting&&s.length<65536){const e=this._context.viewModel.getRichTextToCopy(this._modelSelections,this._emptySelectionClipboard);e&&(o=e.html,r=e.mode)}return{isFromEmptySelection:i,multicursorText:n,text:s,html:o,mode:r}},getScreenReaderContent:()=>{if(1===this._accessibilitySupport){const e=this._selections[0];if(Pe&&e.isEmpty()){const t=e.getStartPosition();let i=this._getWordBeforePosition(t);if(0===i.length&&(i=this._getCharacterBeforePosition(t)),i.length>0)return new jy(i,i.length,i.length,Rh.fromPositions(t),0)}const t=500;if(Pe&&!e.isEmpty()&&a.getValueLengthInRange(e,0)0)return new jy(i,n,n,Rh.fromPositions(t),0)}return jy.EMPTY}return qy.fromEditorSelection(a,this._selections[0],this._accessibilityPageSize,0===this._accessibilitySupport)},deduceModelPosition:(e,t,i)=>this._context.viewModel.deduceModelPositionRelativeToViewPosition(e,t,i)},h=this._register(new Jy(this.textArea.domNode));this._textAreaInput=this._register(new Xy(l,h,$e,{isAndroid:le,isChrome:oe,isFirefox:ne,isSafari:re})),this._register(this._textAreaInput.onKeyDown((e=>{this._viewController.emitKeyDown(e)}))),this._register(this._textAreaInput.onKeyUp((e=>{this._viewController.emitKeyUp(e)}))),this._register(this._textAreaInput.onPaste((e=>{let t=!1,i=null,n=null;e.metadata&&(t=this._emptySelectionClipboard&&!!e.metadata.isFromEmptySelection,i=void 0!==e.metadata.multicursorText?e.metadata.multicursorText:null,n=e.metadata.mode),this._viewController.paste(e.text,t,i,n)}))),this._register(this._textAreaInput.onCut((()=>{this._viewController.cut()}))),this._register(this._textAreaInput.onType((e=>{e.replacePrevCharCnt||e.replaceNextCharCnt||e.positionDelta?this._viewController.compositionType(e.text,e.replacePrevCharCnt,e.replaceNextCharCnt,e.positionDelta):this._viewController.type(e.text)}))),this._register(this._textAreaInput.onSelectionChangeRequest((e=>{this._viewController.setSelection(e)}))),this._register(this._textAreaInput.onCompositionStart((e=>{const t=this.textArea.domNode,i=this._modelSelections[0],{distanceToModelLineStart:n,widthOfHiddenTextBefore:s}=(()=>{const e=t.value.substring(0,Math.min(t.selectionStart,t.selectionEnd)),n=e.lastIndexOf("\n"),s=e.substring(n+1),o=s.lastIndexOf("\t"),r=s.length-o-1,a=i.getStartPosition(),l=Math.min(a.column-1,r),h=a.column-1-l,d=s.substring(0,s.length-l),{tabSize:c}=this._context.viewModel.model.getOptions(),u=function(e,t,i,n){if(0===t.length)return 0;const s=e.createElement("div");s.style.position="absolute",s.style.top="-50000px",s.style.width="50000px";const o=e.createElement("span");Hk(o,i),o.style.whiteSpace="pre",o.style.tabSize=n*i.spaceWidth+"px",o.append(t),s.appendChild(o),e.body.appendChild(s);const r=o.offsetWidth;return e.body.removeChild(s),r}(this.textArea.domNode.ownerDocument,d,this._fontInfo,c);return{distanceToModelLineStart:h,widthOfHiddenTextBefore:u}})(),{distanceToModelLineEnd:o}=(()=>{const e=t.value.substring(Math.max(t.selectionStart,t.selectionEnd)),n=e.indexOf("\n"),s=-1===n?e:e.substring(0,n),o=s.indexOf("\t"),r=-1===o?s.length:s.length-o-1,a=i.getEndPosition(),l=Math.min(this._context.viewModel.model.getLineMaxColumn(a.lineNumber)-a.column,r);return{distanceToModelLineEnd:this._context.viewModel.model.getLineMaxColumn(a.lineNumber)-a.column-l}})();this._context.viewModel.revealRange("keyboard",!0,Rh.fromPositions(this._selections[0].getStartPosition()),0,1),this._visibleTextArea=new CO(this._context,i.startLineNumber,n,s,o),this.textArea.setAttribute("wrap",this._textAreaWrapping&&!this._visibleTextArea?"on":"off"),this._visibleTextArea.prepareRender(this._visibleRangeProvider),this._render(),this.textArea.setClassName(`inputarea ${fO} ime-input`),this._viewController.compositionStart(),this._context.viewModel.onCompositionStart()}))),this._register(this._textAreaInput.onCompositionUpdate((e=>{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 ${fO}`),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(_O.onDidChange((()=>{this._ensureReadOnlyAttribute()})))}writeScreenReaderContent(e){this._textAreaInput.writeScreenReaderContent(e)}dispose(){super.dispose()}_getAndroidWordAtPosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=Gb('`~!@#$%^&*()-=+[{]}\\|;:",.<>/?');let n=!0,s=e.column,o=!0,r=e.column,a=0;for(;a<50&&(n||o);){if(n&&s<=1&&(n=!1),n){const e=t.charCodeAt(s-2);0!==i.get(e)?n=!1:s--}if(o&&r>t.length&&(o=!1),o){const e=t.charCodeAt(r-1);0!==i.get(e)?o=!1:r++}a++}return[t.substring(s-1,r-1),e.column-s]}_getWordBeforePosition(e){const t=this._context.viewModel.getLineContent(e.lineNumber),i=Gb(this._context.configuration.options.get(129));let n=e.column,s=0;for(;n>1;){const o=t.charCodeAt(n-2);if(0!==i.get(o)||s>50)return t.substring(n-1,e.column-1);s++,n--}return t.substring(0,e.column-1)}_getCharacterBeforePosition(e){if(e.column>1){const t=this._context.viewModel.getLineContent(e.lineNumber).charAt(e.column-2);if(!wo(t.charCodeAt(0)))return t}return""}_getAriaLabel(e){var t,i,n;if(1===e.get(2)){const e=null===(t=this._keybindingService.lookupKeybinding("editor.action.toggleScreenReaderAccessibilityMode"))||void 0===t?void 0:t.getAriaLabel(),s=null===(i=this._keybindingService.lookupKeybinding("workbench.action.showCommands"))||void 0===i?void 0:i.getAriaLabel(),o=null===(n=this._keybindingService.lookupKeybinding("workbench.action.openGlobalKeybindings"))||void 0===n?void 0:n.getAriaLabel(),r=ue(0,"The editor is not accessible at this time.");return e?ue(0,"{0} To enable screen reader optimized mode, use {1}",r,e):s?ue(0,"{0} To enable screen reader optimized mode, open the quick pick with {1} and run the command Toggle Screen Reader Accessibility Mode, which is currently not triggerable via keyboard.",r,s):o?ue(0,"{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(4)}_setAccessibilityOptions(e){this._accessibilitySupport=e.get(2);const t=e.get(3);2===this._accessibilitySupport&&t===ZS.accessibilityPageSize.defaultValue?this._accessibilityPageSize=500:this._accessibilityPageSize=t;const i=e.get(143).wrappingColumn;if(-1!==i&&1!==this._accessibilitySupport){const t=e.get(50);this._textAreaWrapping=!0,this._textAreaWidth=Math.round(i*t.typicalHalfwidthCharacterWidth)}else this._textAreaWrapping=!1,this._textAreaWidth=wO?0:1}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);this._setAccessibilityOptions(t),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._contentHeight=i.height,this._fontInfo=t.get(50),this._lineHeight=t.get(66),this._emptySelectionClipboard=t.get(37),this._copyWithSyntaxHighlighting=t.get(25),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(5)?"true":"false"),this.textArea.setAttribute("tabindex",String(t.get(123))),(e.hasChanged(34)||e.hasChanged(90))&&this._ensureReadOnlyAttribute(),e.hasChanged(2)&&this._textAreaInput.writeScreenReaderContent("strategy changed"),!0}onCursorStateChanged(e){return this._selections=e.selections.slice(0),this._modelSelections=e.modelSelections.slice(0),this._textAreaInput.writeScreenReaderContent("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()}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;!_O.enabled||e.get(34)&&e.get(90)?this.textArea.setAttribute("readonly","true"):this.textArea.removeAttribute("readonly")}prepareRender(e){var t;this._primaryCursorPosition=new Va(this._selections[0].positionLineNumber,this._selections[0].positionColumn),this._primaryCursorVisibleRange=e.visibleRangeForPosition(this._primaryCursorPosition),null===(t=this._visibleTextArea)||void 0===t||t.prepareRender(e)}render(e){this._textAreaInput.writeScreenReaderContent("render"),this._render()}_render(){var e;if(this._visibleTextArea){const e=this._visibleTextArea.visibleTextareaStart,t=this._visibleTextArea.visibleTextareaEnd,i=this._visibleTextArea.startPosition,n=this._visibleTextArea.endPosition;if(i&&n&&e&&t&&t.left>=this._scrollLeft&&e.left<=this._scrollLeft+this._contentWidth){const s=this._context.viewLayout.getVerticalOffsetForLineNumber(this._primaryCursorPosition.lineNumber)-this._scrollTop,o=this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));let r=this._visibleTextArea.widthOfHiddenLineTextBefore,a=this._contentLeft+e.left-this._scrollLeft,l=t.left-e.left+1;if(athis._contentWidth&&(l=this._contentWidth);const h=this._context.viewModel.getViewLineData(i.lineNumber),d=h.tokens.findTokenIndexAtOffset(i.column-1),c=d===h.tokens.findTokenIndexAtOffset(n.column-1),u=this._visibleTextArea.definePresentation(c?h.tokens.getPresentation(d):null);this.textArea.domNode.scrollTop=o*this._lineHeight,this.textArea.domNode.scrollLeft=r,this._doRender({lastRenderPosition:null,top:s,left:a,width:l,height:this._lineHeight,useCover:!1,color:(EC.getColorMap()||[])[u.foreground],italic:u.italic,bold:u.bold,underline:u.underline,strikethrough:u.strikethrough})}return}if(!this._primaryCursorVisibleRange)return void this._renderAtTopLeft();const t=this._contentLeft+this._primaryCursorVisibleRange.left-this._scrollLeft;if(tthis._contentLeft+this._contentWidth)return void this._renderAtTopLeft();const i=this._context.viewLayout.getVerticalOffsetForLineNumber(this._selections[0].positionLineNumber)-this._scrollTop;if(i<0||i>this._contentHeight)this._renderAtTopLeft();else if(Pe){this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:this._lineHeight,useCover:!1}),this.textArea.domNode.scrollLeft=this._primaryCursorVisibleRange.left;const n=null!==(e=this._textAreaInput.textAreaState.newlineCountBeforeSelection)&&void 0!==e?e:this._newlinecount(this.textArea.domNode.value.substr(0,this.textArea.domNode.selectionStart));this.textArea.domNode.scrollTop=n*this._lineHeight}else this._doRender({lastRenderPosition:this._primaryCursorPosition,top:i,left:this._textAreaWrapping?this._contentLeft:t,width:this._textAreaWidth,height:wO?0:1,useCover:!1})}_newlinecount(e){let t=0,i=-1;for(;;){if(i=e.indexOf("\n",i+1),-1===i)break;t++}return t}_renderAtTopLeft(){this._doRender({lastRenderPosition:null,top:0,left:0,width:this._textAreaWidth,height:wO?0:1,useCover:!0})}_doRender(e){this._lastRenderPosition=e.lastRenderPosition;const t=this.textArea,i=this.textAreaCover;Hk(t,this._fontInfo),t.setTop(e.top),t.setLeft(e.left),t.setWidth(e.width),t.setHeight(e.height),t.setColor(e.color?lc.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(57)?i.setClassName("monaco-editor-background textAreaCover "+mO.OUTER_CLASS_NAME):0!==n.get(67).renderType?i.setClassName("monaco-editor-background textAreaCover "+pO.CLASS_NAME):i.setClassName("monaco-editor-background textAreaCover")}};yO=vO([bO(3,WL)],yO);class SO{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){Ry.SetSelection.runCoreEditorCommand(this.viewModel,{source:"keyboard",selection:e})}_validateViewColumn(e){const t=this.viewModel.getLineMinColumn(e.lineNumber);return e.column=4?this._selectAll():3===e.mouseDownCount?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):2===e.mouseDownCount?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||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){Ry.MoveTo.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_moveToSelect(e,t){Ry.MoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_columnSelect(e,t,i){e=this._validateViewColumn(e),Ry.ColumnSelect.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,mouseColumn:t,doColumnSelect:i})}_createCursor(e,t){e=this._validateViewColumn(e),Ry.CreateCursor.runCoreEditorCommand(this.viewModel,{source:"mouse",position:this._convertViewToModelPosition(e),viewPosition:e,wholeLine:t})}_lastCursorMoveToSelect(e,t){Ry.LastCursorMoveToSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelect(e,t){Ry.WordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_wordSelectDrag(e,t){Ry.WordSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorWordSelect(e,t){Ry.LastCursorWordSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelect(e,t){Ry.LineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lineSelectDrag(e,t){Ry.LineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelect(e,t){Ry.LastCursorLineSelect.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_lastCursorLineSelectDrag(e,t){Ry.LastCursorLineSelectDrag.runCoreEditorCommand(this.viewModel,this._usualArgs(e,t))}_selectAll(){Ry.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 LO{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){var t;null===(t=this.onKeyDown)||void 0===t||t.call(this,e)}emitKeyUp(e){var t;null===(t=this.onKeyUp)||void 0===t||t.call(this,e)}emitContextMenu(e){var t;null===(t=this.onContextMenu)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseMove(e){var t;null===(t=this.onMouseMove)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseLeave(e){var t;null===(t=this.onMouseLeave)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDown(e){var t;null===(t=this.onMouseDown)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseUp(e){var t;null===(t=this.onMouseUp)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrag(e){var t;null===(t=this.onMouseDrag)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDrop(e){var t;null===(t=this.onMouseDrop)||void 0===t||t.call(this,this._convertViewToModelMouseEvent(e))}emitMouseDropCanceled(){var e;null===(e=this.onMouseDropCanceled)||void 0===e||e.call(this)}emitMouseWheel(e){var t;null===(t=this.onMouseWheel)||void 0===t||t.call(this,e)}_convertViewToModelMouseEvent(e){return e.target?{event:e.event,target:this._convertViewToModelMouseTarget(e.target)}:e}_convertViewToModelMouseTarget(e){return LO.convertViewToModelMouseTarget(e,this._coordinatesConverter)}static convertViewToModelMouseTarget(e,t){const i=Object.assign({},e);return i.position&&(i.position=t.convertViewPositionToModelPosition(i.position)),i.range&&(i.range=t.convertViewRangeToModelRange(i.range)),5!==i.type&&8!==i.type||(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 Va(e.afterLineNumber,1)).lineNumber}}}class kO{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 f("Illegal value for lineNumber");return this._lines[t]}onLinesDeleted(e,t){if(0===this.getCount())return null;const i=this.getStartLineNumber(),n=this.getEndLineNumber();if(tn)return null;let s=0,o=0;for(let r=i;r<=n;r++){const i=r-this._rendLineNumberStart;e<=r&&r<=t&&(0===o?(s=i,o=1):o++)}if(e=n&&r<=s&&(this._lines[r-this._rendLineNumberStart].onContentChanged(),o=!0);return o}onLinesInserted(e,t){if(0===this.getCount())return null;const i=t-e+1,n=this.getStartLineNumber(),s=this.getEndLineNumber();if(e<=n)return this._rendLineNumberStart+=i,null;if(e>s)return null;if(i+e>s){return this._lines.splice(e-this._rendLineNumberStart,s-e+1)}const o=[];for(let d=0;di)continue;const r=Math.max(t,o.fromLineNumber),a=Math.min(i,o.toLineNumber);for(let e=r;e<=a;e++){const t=e-this._rendLineNumberStart;this._lines[t].onTokensChanged(),n=!0}}return n}}class DO{constructor(e){this._host=e,this.domNode=this._createDomNode(),this._linesCollection=new kO((()=>this._host.createVisibleLine()))}_createDomNode(){const e=Vk(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(143)}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 e=t,o=Math.min(i,s.rendLineNumberStart-1);e<=o&&(this._insertLinesBefore(s,e,o,n,t),s.linesLength+=o-e+1)}else if(s.rendLineNumberStart0&&(this._removeLinesBefore(s,e),s.linesLength-=e)}if(s.rendLineNumberStart=t,s.rendLineNumberStart+s.linesLength-1i){const e=Math.max(0,i-s.rendLineNumberStart+1),t=s.linesLength-1-e+1;t>0&&(this._removeLinesAfter(s,t),s.linesLength-=t)}return this._finishRendering(s,!1,n),s}_renderUntouchedLines(e,t,i,n,s){const o=e.rendLineNumberStart,r=e.lines;for(let a=t;a<=i;a++){const e=o+a;r[a].layoutLine(e,n[e-s])}}_insertLinesBefore(e,t,i,n,s){const o=[];let r=0;for(let a=t;a<=i;a++)o[r++]=this.host.createVisibleLine();e.lines=o.concat(e.lines)}_removeLinesBefore(e,t){for(let i=0;i=0;r--){const t=e.lines[r];n[r]&&(t.setDomNode(o),o=o.previousSibling)}}_finishRenderingInvalidLines(e,t,i){const n=document.createElement("div");xO._ttPolicy&&(t=xO._ttPolicy.createHTML(t)),n.innerHTML=t;for(let s=0;se}),xO._sb=new eu(1e5);class NO extends hA{constructor(e){super(e),this._visibleLines=new DO(this),this.domNode=this._visibleLines.domNode;const t=this._context.configuration.options.get(50);Hk(this.domNode,t),this._dynamicOverlays=[],this._isFocused=!1,this.domNode.setClassName("view-overlays")}shouldRender(){if(super.shouldRender())return!0;for(let e=0,t=this._dynamicOverlays.length;ee.shouldRender()));for(let i=0,n=t.length;i'),n.appendString(s),n.appendString(""),!0)}layoutLine(e,t){this._domNode&&(this._domNode.setTop(t),this._domNode.setHeight(this._lineHeight))}}class IO extends NO{constructor(e){super(e);const t=this._context.configuration.options.get(143);this._contentWidth=t.contentWidth,this.domNode.setHeight(0)}onConfigurationChanged(e){const t=this._context.configuration.options.get(143);return this._contentWidth=t.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 MO extends NO{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._contentLeft=i.contentLeft,this.domNode.setClassName("margin-view-overlays"),this.domNode.setWidth(1),Hk(this.domNode,t.get(50))}onConfigurationChanged(e){const t=this._context.configuration.options;Hk(this.domNode,t.get(50));const i=t.get(143);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 TO extends hA{constructor(e,t){super(e),this._viewDomNode=t,this._widgets={},this.domNode=Vk(document.createElement("div")),dA.write(this.domNode,1),this.domNode.setClassName("contentWidgets"),this.domNode.setPosition("absolute"),this.domNode.setTop(0),this.overflowingContentWidgetsDomNode=Vk(document.createElement("div")),dA.write(this.overflowingContentWidgetsDomNode,2),this.overflowingContentWidgetsDomNode.setClassName("overflowingContentWidgets")}dispose(){super.dispose(),this._widgets={}}onConfigurationChanged(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onConfigurationChanged(e);return!0}onDecorationsChanged(e){return!0}onFlushed(e){return!0}onLineMappingChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesChanged(e){return this._updateAnchorsViewPositions(),!0}onLinesDeleted(e){return this._updateAnchorsViewPositions(),!0}onLinesInserted(e){return this._updateAnchorsViewPositions(),!0}onScrollChanged(e){return!0}onZonesChanged(e){return!0}_updateAnchorsViewPositions(){const e=Object.keys(this._widgets);for(const t of e)this._widgets[t].updateAnchorViewPosition()}addWidget(e){const t=new RO(this._context,this._viewDomNode,e);this._widgets[t.id]=t,t.allowEditorOverflow?this.overflowingContentWidgetsDomNode.appendChild(t.domNode):this.domNode.appendChild(t.domNode),this.setShouldRender()}setWidgetPosition(e,t,i,n,s){this._widgets[e.getId()].setPosition(t,i,n,s),this.setShouldRender()}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t];delete this._widgets[t];const i=e.domNode.domNode;i.parentNode.removeChild(i),i.removeAttribute("monaco-visible-content-widget"),this.setShouldRender()}}shouldSuppressMouseDownOnWidget(e){return!!this._widgets.hasOwnProperty(e)&&this._widgets[e].suppressMouseDown}onBeforeRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].onBeforeRender(e)}prepareRender(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].prepareRender(e)}render(e){const t=Object.keys(this._widgets);for(const i of t)this._widgets[i].render(e)}}class RO{constructor(e,t,i){this._primaryAnchor=new AO(null,null),this._secondaryAnchor=new AO(null,null),this._context=e,this._viewDomNode=t,this._actual=i,this.domNode=Vk(this._actual.getDomNode()),this.id=this._actual.getId(),this.allowEditorOverflow=this._actual.allowEditorOverflow||!1,this.suppressMouseDown=this._actual.suppressMouseDown||!1;const n=this._context.configuration.options,s=n.get(143);this._fixedOverflowWidgets=n.get(42),this._contentWidth=s.contentWidth,this._contentLeft=s.contentLeft,this._lineHeight=n.get(66),this._affinity=null,this._preference=[],this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1,this._maxWidth=this._getMaxWidth(),this._isVisible=!1,this._renderData=null,this.domNode.setPosition(this._fixedOverflowWidgets&&this.allowEditorOverflow?"fixed":"absolute"),this.domNode.setDisplay("none"),this.domNode.setVisibility("hidden"),this.domNode.setAttribute("widgetId",this.id),this.domNode.setMaxWidth(this._maxWidth)}onConfigurationChanged(e){const t=this._context.configuration.options;if(this._lineHeight=t.get(66),e.hasChanged(143)){const e=t.get(143);this._contentLeft=e.contentLeft,this._contentWidth=e.contentWidth,this._maxWidth=this._getMaxWidth()}}updateAnchorViewPosition(){this._setPosition(this._affinity,this._primaryAnchor.modelPosition,this._secondaryAnchor.modelPosition)}_setPosition(e,t,i){function n(e,t,i){if(!e)return new AO(null,null);const n=t.model.validatePosition(e);if(t.coordinatesConverter.modelPositionIsVisible(n)){const s=t.coordinatesConverter.convertModelPositionToViewPosition(n,null!=i?i:void 0);return new AO(e,s)}return new AO(e,null)}this._affinity=e,this._primaryAnchor=n(t,this._context.viewModel,this._affinity),this._secondaryAnchor=n(i,this._context.viewModel,this._affinity)}_getMaxWidth(){const e=this.domNode.domNode.ownerDocument,t=e.defaultView;return this.allowEditorOverflow?(null==t?void 0:t.innerWidth)||e.documentElement.offsetWidth||e.body.offsetWidth:this._contentWidth}setPosition(e,t,i,n){this._setPosition(n,e,t),this._preference=i,this._primaryAnchor.viewPosition&&this._preference&&this._preference.length>0?this.domNode.setDisplay("block"):this.domNode.setDisplay("none"),this._cachedDomNodeOffsetWidth=-1,this._cachedDomNodeOffsetHeight=-1}_layoutBoxInViewport(e,t,i,n){const s=e.top,o=s,r=e.top+e.height,a=s-i,l=o>=i,h=r,d=n.viewportHeight-r>=i;let c=e.left;return c+t>n.scrollLeft+n.viewportWidth&&(c=n.scrollLeft+n.viewportWidth-t),cr){const e=l-(r-n);l-=e,i-=e}if(l=22,_=u+i<=g.height-22;return this._fixedOverflowWidgets?{fitsAbove:f,aboveTop:Math.max(c,22),fitsBelow:_,belowTop:u,left:m}:{fitsAbove:f,aboveTop:r,fitsBelow:_,belowTop:a,left:p}}_prepareRenderWidgetAtExactPositionOverflowing(e){return new OO(e.top,e.left+this._contentLeft)}_getAnchorsCoordinates(e){var t,i;return{primary:n(this._primaryAnchor.viewPosition,this._affinity,this._lineHeight),secondary:n((null===(t=this._secondaryAnchor.viewPosition)||void 0===t?void 0:t.lineNumber)===(null===(i=this._primaryAnchor.viewPosition)||void 0===i?void 0:i.lineNumber)?this._secondaryAnchor.viewPosition:null,this._affinity,this._lineHeight)};function n(t,i,n){if(!t)return null;const s=e.visibleRangeForPosition(t);if(!s)return null;const o=1===t.column&&3===i?0:s.left,r=e.getVerticalOffsetForLineNumber(t.lineNumber)-e.scrollTop;return new PO(r,o,n)}}_reduceAnchorCoordinates(e,t,i){if(!t)return e;const n=this._context.configuration.options.get(50);let s=t.left;return s=se.endLineNumber||this.domNode.setMaxWidth(this._maxWidth))}prepareRender(e){this._renderData=this._prepareRenderWidget(e)}render(e){if(!this._renderData)return this._isVisible&&(this.domNode.removeAttribute("monaco-visible-content-widget"),this._isVisible=!1,this.domNode.setVisibility("hidden")),void("function"==typeof this._actual.afterRender&&FO(this._actual.afterRender,this._actual,null));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),"function"==typeof this._actual.afterRender&&FO(this._actual.afterRender,this._actual,this._renderData.position)}}class AO{constructor(e,t){this.modelPosition=e,this.viewPosition=t}}class OO{constructor(e,t){this.top=e,this.left=t,this._coordinateBrand=void 0}}class PO{constructor(e,t,i){this.top=e,this.left=t,this.height=i,this._anchorCoordinateBrand=void 0}}function FO(e,t,...i){try{return e.call(t,...i)}catch(ge){return null}}class BO extends gO{constructor(e){super(),this._context=e;const t=this._context.configuration.options,i=t.get(143);this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),this._contentLeft=i.contentLeft,this._contentWidth=i.contentWidth,this._selectionIsEmpty=!0,this._focused=!1,this._cursorLineNumbers=[1],this._selections=[new Ah(1,1,1,1)],this._renderData=null,this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}_readFromSelections(){let e=!1;const t=this._selections.map((e=>e.positionLineNumber));t.sort(((e,t)=>e-t)),Td(this._cursorLineNumbers,t)||(this._cursorLineNumbers=t,e=!0);const i=this._selections.every((e=>e.isEmpty()));return this._selectionIsEmpty!==i&&(this._selectionIsEmpty=i,e=!0),e}onThemeChanged(e){return this._readFromSelections()}onConfigurationChanged(e){const t=this._context.configuration.options,i=t.get(143);return this._lineHeight=t.get(66),this._renderLineHighlight=t.get(95),this._renderLineHighlightOnlyWhenFocus=t.get(96),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)}prepareRender(e){if(!this._shouldRenderThis())return void(this._renderData=null);const t=this._renderOne(e),i=e.visibleRange.startLineNumber,n=e.visibleRange.endLineNumber,s=this._cursorLineNumbers.length;let o=0;const r=[];for(let a=i;a<=n;a++){const e=a-i;for(;o=this._renderData.length?"":this._renderData[i]}_shouldRenderInMargin(){return("gutter"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}_shouldRenderInContent(){return("line"===this._renderLineHighlight||"all"===this._renderLineHighlight)&&this._selectionIsEmpty&&(!this._renderLineHighlightOnlyWhenFocus||this._focused)}}class WO extends BO{_renderOne(e){return`
    `}_shouldRenderThis(){return this._shouldRenderInContent()}_shouldRenderOther(){return this._shouldRenderInMargin()}}class VO extends BO{_renderOne(e){return`
    `}_shouldRenderThis(){return!0}_shouldRenderOther(){return this._shouldRenderInContent()}}H_(((e,t)=>{const i=e.getColor(U_);if(i&&(t.addRule(`.monaco-editor .view-overlays .current-line { background-color: ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { background-color: ${i}; border: none; }`)),!i||i.isTransparent()||e.defines(K_)){const i=e.getColor(K_);i&&(t.addRule(`.monaco-editor .view-overlays .current-line { border: 2px solid ${i}; }`),t.addRule(`.monaco-editor .margin-view-overlays .current-line-margin { border: 2px solid ${i}; }`),A_(e.type)&&(t.addRule(".monaco-editor .view-overlays .current-line { border-width: 1px; }"),t.addRule(".monaco-editor .margin-view-overlays .current-line-margin { border-width: 1px; }")))}}));class HO extends gO{constructor(e){super(),this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=t.get(50).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._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=t.get(50).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 a=0,l=t.length;a{if(e.options.zIndext.options.zIndex)return 1;const i=e.options.className,n=t.options.className;return in?1:Rh.compareRangesUsingStarts(e.range,t.range)}));const s=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber,r=[];for(let a=s;a<=o;a++){r[a-s]=""}this._renderWholeLineDecorations(e,i,r),this._renderNormalDecorations(e,i,r),this._renderResult=r}_renderWholeLineDecorations(e,t,i){const n=String(this._lineHeight),s=e.visibleRange.startLineNumber,o=e.visibleRange.endLineNumber;for(let r=0,a=t.length;r',l=Math.max(e.range.startLineNumber,s),h=Math.min(e.range.endLineNumber,o);for(let t=l;t<=h;t++){i[t-s]+=a}}}_renderNormalDecorations(e,t,i){var n;const s=String(this._lineHeight),o=e.visibleRange.startLineNumber;let r=null,a=!1,l=null,h=!1;for(let d=0,c=t.length;d';a[t]+=d}}}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class zO extends hA{constructor(e,t,i,n){super(e);const s=this._context.configuration.options,o=s.get(102),r=s.get(74),a=s.get(40),l=s.get(105),h={listenOnDomNode:i.domNode,className:"editor-scrollable "+B_(e.theme.type),useShadows:!1,lazyRender:!0,vertical:o.vertical,horizontal:o.horizontal,verticalHasArrows:o.verticalHasArrows,horizontalHasArrows:o.horizontalHasArrows,verticalScrollbarSize:o.verticalScrollbarSize,verticalSliderSize:o.verticalSliderSize,horizontalScrollbarSize:o.horizontalScrollbarSize,horizontalSliderSize:o.horizontalSliderSize,handleMouseWheel:o.handleMouseWheel,alwaysConsumeMouseWheel:o.alwaysConsumeMouseWheel,arrowSize:o.arrowSize,mouseWheelScrollSensitivity:r,fastScrollSensitivity:a,scrollPredominantAxis:l,scrollByPage:o.scrollByPage};this.scrollbar=this._register(new AD(t.domNode,h,this._context.viewLayout.getScrollable())),dA.write(this.scrollbar.getDomNode(),5),this.scrollbarDomNode=Vk(this.scrollbar.getDomNode()),this.scrollbarDomNode.setPosition("absolute"),this._setLayout();const d=(e,t,i)=>{const n={};if(t){const t=e.scrollTop;t&&(n.scrollTop=this._context.viewLayout.getCurrentScrollTop()+t,e.scrollTop=0)}if(i){const t=e.scrollLeft;t&&(n.scrollLeft=this._context.viewLayout.getCurrentScrollLeft()+t,e.scrollLeft=0)}this._context.viewModel.viewLayout.setScrollPosition(n,1)};this._register(En(i.domNode,"scroll",(e=>d(i.domNode,!0,!0)))),this._register(En(t.domNode,"scroll",(e=>d(t.domNode,!0,!1)))),this._register(En(n.domNode,"scroll",(e=>d(n.domNode,!0,!1)))),this._register(En(this.scrollbarDomNode.domNode,"scroll",(e=>d(this.scrollbarDomNode.domNode,!0,!1))))}dispose(){super.dispose()}_setLayout(){const e=this._context.configuration.options,t=e.get(143);this.scrollbarDomNode.setLeft(t.contentLeft);"right"===e.get(72).side?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(102)||e.hasChanged(74)||e.hasChanged(40)){const e=this._context.configuration.options,t=e.get(102),i=e.get(74),n=e.get(40),s=e.get(105),o={vertical:t.vertical,horizontal:t.horizontal,verticalScrollbarSize:t.verticalScrollbarSize,horizontalScrollbarSize:t.horizontalScrollbarSize,scrollByPage:t.scrollByPage,handleMouseWheel:t.handleMouseWheel,mouseWheelScrollSensitivity:i,fastScrollSensitivity:n,scrollPredominantAxis:s};this.scrollbar.updateOptions(o)}return e.hasChanged(143)&&this._setLayout(),!0}onScrollChanged(e){return!0}onThemeChanged(e){return this.scrollbar.updateClassName("editor-scrollable "+B_(this._context.theme.type)),!0}prepareRender(e){}render(e){this.scrollbar.renderNow()}}class UO extends gO{constructor(e){super(),this._context=e,this._primaryPosition=null;const t=this._context.configuration.options,i=t.get(144),n=t.get(50);this._lineHeight=t.get(66),this._spaceWidth=n.spaceWidth,this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(16),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,i=t.get(144),n=t.get(50);return this._lineHeight=t.get(66),this._spaceWidth=n.spaceWidth,this._maxIndentLeft=-1===i.wrappingColumn?-1:i.wrappingColumn*n.typicalHalfwidthCharacterWidth,this._bracketPairGuideOptions=t.get(16),!0}onCursorStateChanged(e){var t;const i=e.selections[0].getPosition();return!(null===(t=this._primaryPosition)||void 0===t?void 0:t.equals(i))&&(this._primaryPosition=i,!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}onLanguageConfigurationChanged(e){return!0}prepareRender(e){var t,i,n,s;if(!this._bracketPairGuideOptions.indentation&&!1===this._bracketPairGuideOptions.bracketPairs)return void(this._renderResult=null);const o=e.visibleRange.startLineNumber,r=e.visibleRange.endLineNumber,a=e.scrollWidth,l=this._lineHeight,h=this._primaryPosition,d=this.getGuidesByLine(o,Math.min(r+1,this._context.viewModel.getLineCount()),h),c=[];for(let u=o;u<=r;u++){const r=u-o,h=d[r];let g="";const p=null!==(i=null===(t=e.visibleRangeForPosition(new Va(u,1)))||void 0===t?void 0:t.left)&&void 0!==i?i:0;for(const t of h){const i=-1===t.column?p+(t.visibleColumn-1)*this._spaceWidth:e.visibleRangeForPosition(new Va(u,t.column)).left;if(i>a||this._maxIndentLeft>0&&i>this._maxIndentLeft)break;const o=t.horizontalLine?t.horizontalLine.top?"horizontal-top":"horizontal-bottom":"vertical",r=t.horizontalLine?(null!==(s=null===(n=e.visibleRangeForPosition(new Va(u,t.horizontalLine.endColumn)))||void 0===n?void 0:n.left)&&void 0!==s?s:i+this._spaceWidth)-i:this._spaceWidth;g+=`
    `}c[r]=g}this._renderResult=c}getGuidesByLine(e,t,i){const n=!1!==this._bracketPairGuideOptions.bracketPairs?this._context.viewModel.getBracketGuidesInRangeByLine(e,t,i,{highlightActive:this._bracketPairGuideOptions.highlightActiveBracketPair,horizontalGuides:!0===this._bracketPairGuideOptions.bracketPairsHorizontal?Qv.Enabled:"active"===this._bracketPairGuideOptions.bracketPairsHorizontal?Qv.EnabledForActive:Qv.Disabled,includeInactive:!0===this._bracketPairGuideOptions.bracketPairs}):null,s=this._bracketPairGuideOptions.indentation?this._context.viewModel.getLinesIndentGuides(e,t):null;let o=0,r=0,a=0;if(!1!==this._bracketPairGuideOptions.highlightActiveIndentation&&i){const n=this._context.viewModel.getActiveIndentGuide(i.lineNumber,e,t);o=n.startLineNumber,r=n.endLineNumber,a=n.indent}const{indentSize:l}=this._context.viewModel.model.getOptions(),h=[];for(let d=e;d<=t;d++){const t=new Array;h.push(t);const i=n?n[d-e]:[],c=new ic(i),u=s?s[d-e]:0;for(let e=1;e<=u;e++){const n=(e-1)*l+1,s=("always"===this._bracketPairGuideOptions.highlightActiveIndentation||0===i.length)&&o<=d&&d<=r&&e===a;t.push(...c.takeWhile((e=>e.visibleColumn!0))||[])}return h}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function KO(e){if(!e||!e.isTransparent())return e}H_(((e,t)=>{const i=[{bracketColor:bv,guideColor:Dv,guideColorActive:Tv},{bracketColor:Cv,guideColor:xv,guideColorActive:Rv},{bracketColor:wv,guideColor:Nv,guideColorActive:Av},{bracketColor:yv,guideColor:Ev,guideColorActive:Ov},{bracketColor:Sv,guideColor:Iv,guideColorActive:Pv},{bracketColor:Lv,guideColor:Mv,guideColorActive:Fv}],n=new ib,s=[{indentColor:X_,indentColorActive:nv},{indentColor:Q_,indentColorActive:sv},{indentColor:J_,indentColorActive:ov},{indentColor:ev,indentColorActive:rv},{indentColor:tv,indentColorActive:av},{indentColor:iv,indentColorActive:lv}],o=i.map((t=>{var i,n;const s=e.getColor(t.bracketColor),o=e.getColor(t.guideColor),r=e.getColor(t.guideColorActive),a=KO(null!==(i=KO(o))&&void 0!==i?i:null==s?void 0:s.transparent(.3)),l=KO(null!==(n=KO(r))&&void 0!==n?n:s);if(a&&l)return{guideColor:a,guideColorActive:l}})).filter(Kr),r=s.map((t=>{const i=e.getColor(t.indentColor),n=e.getColor(t.indentColorActive),s=KO(i),o=KO(n);if(s&&o)return{indentColor:s,indentColorActive:o}})).filter(Kr);if(o.length>0){for(let e=0;e<30;e++){const i=o[e%o.length];t.addRule(`.monaco-editor .${n.getInlineClassNameOfLevel(e).replace(/ /g,".")} { --guide-color: ${i.guideColor}; --guide-color-active: ${i.guideColorActive}; }`)}t.addRule(".monaco-editor .vertical { box-shadow: 1px 0 0 0 var(--guide-color) inset; }"),t.addRule(".monaco-editor .horizontal-top { border-top: 1px solid var(--guide-color); }"),t.addRule(".monaco-editor .horizontal-bottom { border-bottom: 1px solid var(--guide-color); }"),t.addRule(`.monaco-editor .vertical.${n.activeClassName} { box-shadow: 1px 0 0 0 var(--guide-color-active) inset; }`),t.addRule(`.monaco-editor .horizontal-top.${n.activeClassName} { border-top: 1px solid var(--guide-color-active); }`),t.addRule(`.monaco-editor .horizontal-bottom.${n.activeClassName} { border-bottom: 1px solid var(--guide-color-active); }`)}if(r.length>0){for(let e=0;e<30;e++){const i=r[e%r.length];t.addRule(`.monaco-editor .lines-content .core-guide-indent.lvl-${e} { --indent-color: ${i.indentColor}; --indent-color-active: ${i.indentColorActive}; }`)}t.addRule(".monaco-editor .lines-content .core-guide-indent { box-shadow: 1px 0 0 0 var(--indent-color) inset; }"),t.addRule(".monaco-editor .lines-content .core-guide-indent.indent-active { box-shadow: 1px 0 0 0 var(--indent-color-active) inset; }")}}));class jO{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 qO{constructor(){this._currentVisibleRange=new Rh(1,1,1,1)}getCurrentVisibleRange(){return this._currentVisibleRange}setCurrentVisibleRange(e){this._currentVisibleRange=e}}class $O{constructor(e,t,i,n,s,o,r){this.minimalReveal=e,this.lineNumber=t,this.startColumn=i,this.endColumn=n,this.startScrollTop=s,this.stopScrollTop=o,this.scrollType=r,this.type="range",this.minLineNumber=t,this.maxLineNumber=t}}class GO{constructor(e,t,i,n,s){this.minimalReveal=e,this.selections=t,this.startScrollTop=i,this.stopScrollTop=n,this.scrollType=s,this.type="selections";let o=t[0].startLineNumber,r=t[0].endLineNumber;for(let a=1,l=t.length;a{this._updateLineWidthsSlow()}),200),this._asyncCheckMonospaceFontAssumptions=new rd((()=>{this._checkMonospaceFontAssumptions()}),2e3),this._lastRenderedData=new qO,this._horizontalRevealRequest=null,this._stickyScrollEnabled=n.get(114).enabled,this._maxNumberStickyLines=n.get(114).maxLineCount}dispose(){this._asyncUpdateLineWidths.dispose(),this._asyncCheckMonospaceFontAssumptions.dispose(),super.dispose()}getDomNode(){return this.domNode}createVisibleLine(){return new BA(this._viewLineOptions)}onConfigurationChanged(e){this._visibleLines.onConfigurationChanged(e),e.hasChanged(144)&&(this._maxLineWidth=0);const t=this._context.configuration.options,i=t.get(50),n=t.get(144);return this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._isViewportWrapping=n.isViewportWrapping,this._revealHorizontalRightPadding=t.get(99),this._cursorSurroundingLines=t.get(29),this._cursorSurroundingLinesStyle=t.get(30),this._canUseLayerHinting=!t.get(32),this._stickyScrollEnabled=t.get(114).enabled,this._maxNumberStickyLines=t.get(114).maxLineCount,Hk(this.domNode,i),this._onOptionsMaybeChanged(),e.hasChanged(143)&&(this._maxLineWidth=0),!0}_onOptionsMaybeChanged(){const e=this._context.configuration,t=new FA(e,this._context.theme.type);if(!this._viewLineOptions.equals(t)){this._viewLineOptions=t;const e=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();for(let t=e;t<=i;t++){this._visibleLines.getVisibleLine(t).onOptionsChanged(this._viewLineOptions)}return!0}return!1}onCursorStateChanged(e){const t=this._visibleLines.getStartLineNumber(),i=this._visibleLines.getEndLineNumber();let n=!1;for(let s=t;s<=i;s++)n=this._visibleLines.getVisibleLine(s).onSelectionChanged()||n;return n}onDecorationsChanged(e){{const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++)this._visibleLines.getVisibleLine(i).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(-1===t)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 $O(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 GO(e.minimalReveal,e.selections,this._context.viewLayout.getCurrentScrollTop(),i.scrollTop,e.scrollType)):this._horizontalRevealRequest=null;const n=Math.abs(this._context.viewLayout.getCurrentScrollTop()-i.scrollTop)<=this._lineHeight?1:e.scrollType;return this._context.viewModel.viewLayout.setScrollPosition(i,n),!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(null===i)return null;const n=this._getLineNumberFor(i);if(-1===n)return null;if(n<1||n>this._context.viewModel.getLineCount())return null;if(1===this._context.viewModel.getLineMaxColumn(n))return new Va(n,1);const s=this._visibleLines.getStartLineNumber(),o=this._visibleLines.getEndLineNumber();if(no)return null;let r=this._visibleLines.getVisibleLine(n).getColumnOfNodeOffset(e,t);const a=this._context.viewModel.getLineMinColumn(n);return ri)return-1;const n=new jO(this.domNode.domNode,this._textRangeRestingSpot),s=this._visibleLines.getVisibleLine(e).getWidth(n);return this._updateLineWidthsSlowIfDomDidLayout(n),s}linesVisibleRangesForRange(e,t){if(this.shouldRender())return null;const i=e.endLineNumber,n=Rh.intersectRanges(e,this._lastRenderedData.getCurrentVisibleRange());if(!n)return null;const s=[];let o=0;const r=new jO(this.domNode.domNode,this._textRangeRestingSpot);let a=0;t&&(a=this._context.viewModel.coordinatesConverter.convertViewPositionToModelPosition(new Va(n.startLineNumber,1)).lineNumber);const l=this._visibleLines.getStartLineNumber(),h=this._visibleLines.getEndLineNumber();for(let d=n.startLineNumber;d<=n.endLineNumber;d++){if(dh)continue;const e=d===n.startLineNumber?n.startColumn:1,c=d!==n.endLineNumber,u=c?this._context.viewModel.getLineMaxColumn(d):n.endColumn,g=this._visibleLines.getVisibleLine(d).getVisibleRangesForRange(d,e,u,r);if(g){if(t&&dthis._visibleLines.getEndLineNumber())return null;const n=new jO(this.domNode.domNode,this._textRangeRestingSpot),s=this._visibleLines.getVisibleLine(e).getVisibleRangesForRange(e,t,i,n);return this._updateLineWidthsSlowIfDomDidLayout(n),s}visibleRangeForPosition(e){const t=this._visibleRangesForLineRange(e.lineNumber,e.column,e.column);return t?new fA(t.outsideRenderedLine,t.ranges[0].left):null}_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,s=!0;for(let o=t;o<=i;o++){const t=this._visibleLines.getVisibleLine(o);!e||t.getWidthIsFast()?n=Math.max(n,t.getWidth(null)):s=!1}return s&&1===t&&i===this._context.viewModel.getLineCount()&&(this._maxLineWidth=0),this._ensureMaxLineWidth(n),s}_checkMonospaceFontAssumptions(){let e=-1,t=-1;const i=this._visibleLines.getStartLineNumber(),n=this._visibleLines.getEndLineNumber();for(let s=i;s<=n;s++){const i=this._visibleLines.getVisibleLine(s);if(i.needsMonospaceFontCheck()){const n=i.getWidth(null);n>t&&(t=n,e=s)}}if(-1!==e&&!this._visibleLines.getVisibleLine(e).monospaceAssumptionsAreValid())for(let s=i;s<=n;s++){this._visibleLines.getVisibleLine(s).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 t=this._horizontalRevealRequest;if(e.startLineNumber<=t.minLineNumber&&t.maxLineNumber<=e.endLineNumber){this._horizontalRevealRequest=null,this.onDidRender();const e=this._computeScrollLeftToReveal(t);e&&(this._isViewportWrapping||this._ensureMaxLineWidth(e.maxHorizontalOffset),this._context.viewModel.viewLayout.setScrollPosition({scrollLeft:e.scrollLeft},t.scrollType))}}if(this._updateLineWidthsFast()?this._asyncUpdateLineWidths.cancel():this._asyncUpdateLineWidths.schedule(),Fe&&!this._asyncCheckMonospaceFontAssumptions.isScheduled()){const e=this._visibleLines.getStartLineNumber(),t=this._visibleLines.getEndLineNumber();for(let i=e;i<=t;i++){if(this._visibleLines.getVisibleLine(i).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 e=s[0].startLineNumber,t=s[0].endLineNumber;for(let i=1,n=s.length;ia){if(!h)return-1;u=d}else if(5===o||6===o)if(6===o&&r<=d&&c<=l)u=r;else{const e=d-Math.max(5*this._lineHeight,.2*a),t=c-a;u=Math.max(t,e)}else if(1===o||2===o)if(2===o&&r<=d&&c<=l)u=r;else{const e=(d+c)/2;u=Math.max(0,e-a/2)}else u=this._computeMinimumScrolling(r,l,d,c,3===o,4===o);return u}_computeScrollLeftToReveal(e){const t=this._context.viewLayout.getCurrentViewport(),i=this._context.configuration.options.get(143),n=t.left,s=n+t.width-i.verticalScrollbarWidth;let o=1073741824,r=0;if("range"===e.type){const t=this._visibleRangesForLineRange(e.lineNumber,e.startColumn,e.endColumn);if(!t)return null;for(const e of t.ranges)o=Math.min(o,Math.round(e.left)),r=Math.max(r,Math.round(e.left+e.width))}else for(const a of e.selections){if(a.startLineNumber!==a.endLineNumber)return null;const e=this._visibleRangesForLineRange(a.startLineNumber,a.startColumn,a.endColumn);if(!e)return null;for(const t of e.ranges)o=Math.min(o,Math.round(t.left)),r=Math.max(r,Math.round(t.left+t.width))}if(e.minimalReveal||(o=Math.max(0,o-ZO.HORIZONTAL_EXTRA_PX),r+=this._revealHorizontalRightPadding),"selections"===e.type&&r-o>t.width)return null;return{scrollLeft:this._computeMinimumScrolling(n,s,o,r),maxHorizontalOffset:r}}_computeMinimumScrolling(e,t,i,n,s,o){s=!!s,o=!!o;const r=(t|=0)-(e|=0);return(n|=0)-(i|=0)t?Math.max(0,n-r):e:i}}ZO.HORIZONTAL_EXTRA_PX=30;class YO{constructor(e,t,i,n){this._decorationToRenderBrand=void 0,this.startLineNumber=+e,this.endLineNumber=+t,this.className=String(i),this.zIndex=null!=n?n:0}}class XO{constructor(e,t){this.className=e,this.zIndex=t}}class QO{constructor(){this.decorations=[]}add(e){this.decorations.push(e)}getDecorations(){return this.decorations}}class JO extends gO{_render(e,t,i){const n=[];for(let r=e;r<=t;r++){n[r-e]=new QO}if(0===i.length)return n;i.sort(((e,t)=>e.className===t.className?e.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber:e.classNamen)continue;const o=Math.max(e.startLineNumber,i),r=Math.min(s.preference.lane,this._glyphMarginDecorationLaneCount);t.push(new iP(o,r,s.preference.zIndex,s))}}_collectSortedGlyphRenderRequests(e){const t=[];return this._collectDecorationBasedGlyphRenderRequest(e,t),this._collectWidgetBasedGlyphRenderRequest(e,t),t.sort(((e,t)=>e.lineNumber===t.lineNumber?e.lane===t.lane?e.zIndex===t.zIndex?t.type===e.type?0===e.type&&0===t.type?e.className0;){const e=t.peek();if(!e)break;const n=t.takeWhile((t=>t.lineNumber===e.lineNumber&&t.lane===e.lane));if(!n||0===n.length)break;const s=n[0];if(0===s.type){const e=[];for(const t of n){if(t.zIndex!==s.zIndex||t.type!==s.type)break;0!==e.length&&e[e.length-1]===t.className||e.push(t.className)}i.push(s.accept(e.join(" ")))}else s.widget.renderInfo={lineNumber:s.lineNumber,lane:s.lane}}this._decorationGlyphsToRender=i}render(e){if(!this._glyphMargin){for(const e of Object.values(this._widgets))e.domNode.setDisplay("none");for(;this._managedDomNodes.length>0;){const e=this._managedDomNodes.pop();null==e||e.domNode.remove()}return}const t=Math.round(this._glyphMarginWidth/this._glyphMarginDecorationLaneCount);for(const i of Object.values(this._widgets))if(i.renderInfo){const n=e.viewportData.relativeVerticalOffset[i.renderInfo.lineNumber-e.viewportData.startLineNumber],s=this._glyphMarginLeft+(i.renderInfo.lane-1)*this._lineHeight;i.domNode.setDisplay("block"),i.domNode.setTop(n),i.domNode.setLeft(s),i.domNode.setWidth(t),i.domNode.setHeight(this._lineHeight)}else i.domNode.setDisplay("none");for(let i=0;ithis._decorationGlyphsToRender.length;){const e=this._managedDomNodes.pop();null==e||e.domNode.remove()}}}class tP{constructor(e,t,i,n){this.lineNumber=e,this.lane=t,this.zIndex=i,this.className=n,this.type=0}accept(e){return new nP(this.lineNumber,this.lane,e)}}class iP{constructor(e,t,i,n){this.lineNumber=e,this.lane=t,this.zIndex=i,this.widget=n,this.type=1}}class nP{constructor(e,t,i){this.lineNumber=e,this.lane=t,this.combinedClassName=i}}class sP extends JO{constructor(e){super(),this._context=e;const t=this._context.configuration.options.get(143);this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.decorationsWidth,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.get(143);return this._decorationsLeft=t.decorationsLeft,this._decorationsWidth=t.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 s=0,o=t.length;s',o=[];for(let r=t;r<=i;r++){const e=r-t,i=n[e].getDecorations();let a="";for(const t of i)a+='
    ';s[e]=r}this._renderResult=s}render(e,t){return this._renderResult?this._renderResult[t-e]:""}}class rP{constructor(e,t,i,n){this._rgba8Brand=void 0,this.r=rP._clamp(e),this.g=rP._clamp(t),this.b=rP._clamp(i),this.a=rP._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:0|e}}rP.Empty=new rP(0,0,0,0);class aP extends E{static getInstance(){return this._INSTANCE||(this._INSTANCE=S(new aP)),this._INSTANCE}constructor(){super(),this._onDidChange=new U,this.onDidChange=this._onDidChange.event,this._updateColorMap(),this._register(EC.onDidChange((e=>{e.changedColorMap&&this._updateColorMap()})))}_updateColorMap(){const e=EC.getColorMap();if(!e)return this._colors=[rP.Empty],void(this._backgroundIsLight=!0);this._colors=[rP.Empty];for(let i=1;i=.5,this._onDidChange.fire(void 0)}getColor(e){return(e<1||e>=this._colors.length)&&(e=2),this._colors[e]}backgroundIsLight(){return this._backgroundIsLight}}aP._INSTANCE=null;class lP{constructor(e,t,i,n){this._viewportBrand=void 0,this.top=0|e,this.left=0|t,this.width=0|i,this.height=0|n}}class hP{constructor(e,t){this.tabSize=e,this.data=t}}class dP{constructor(e,t,i,n,s,o,r){this._viewLineDataBrand=void 0,this.content=e,this.continuesWithWrappedLine=t,this.minColumn=i,this.maxColumn=n,this.startVisibleColumn=s,this.tokens=o,this.inlineDecorations=r}}class cP{constructor(e,t,i,n,s,o,r,a,l,h){this.minColumn=e,this.maxColumn=t,this.content=i,this.continuesWithWrappedLine=n,this.isBasicASCII=cP.isBasicASCII(i,o),this.containsRTL=cP.containsRTL(i,this.isBasicASCII,s),this.tokens=r,this.inlineDecorations=a,this.tabSize=l,this.startVisibleColumn=h}static isBasicASCII(e,t){return!t||To(e)}static containsRTL(e,t,i){return!(t||!i)&&Io(e)}}class uP{constructor(e,t,i){this.range=e,this.inlineClassName=t,this.type=i}}class gP{constructor(e,t,i,n){this.startOffset=e,this.endOffset=t,this.inlineClassName=i,this.inlineClassNameAffectsLetterSpacing=n}toInlineDecoration(e){return new uP(new Rh(e,this.startOffset+1,e,this.endOffset+1),this.inlineClassName,this.inlineClassNameAffectsLetterSpacing?3:0)}}class pP{constructor(e,t){this._viewModelDecorationBrand=void 0,this.range=e,this.options=t}}class mP{constructor(e,t,i){this.color=e,this.zIndex=t,this.data=i}static compareByRenderingProps(e,t){return e.zIndex===t.zIndex?e.colort.color?1:0:e.zIndex-t.zIndex}static equals(e,t){return e.color===t.color&&e.zIndex===t.zIndex&&Td(e.data,t.data)}static equalsArr(e,t){return Td(e,t,mP.equals)}}const fP=(()=>{const e=[];for(let t=32;t<=126;t++)e.push(t);return e.push(65533),e})();class _P{constructor(e,t){this.scale=t,this._minimapCharRendererBrand=void 0,this.charDataNormal=_P.soften(e,.8),this.charDataLight=_P.soften(e,50/60)}static soften(e,t){const i=new Uint8ClampedArray(e.length);for(let n=0,s=e.length;ne.width||i+g>e.height)return void console.warn("bad render request outside image data");const p=h?this.charDataLight:this.charDataNormal,m=((e,t)=>(e-=32)<0||e>96?t<=2?(e+96)%96:95:e)(n,l),f=4*e.width,_=r.r,v=r.g,b=r.b,C=s.r-_,w=s.g-v,y=s.b-b,S=Math.max(o,a),L=e.data;let k=m*c*u,D=i*f+4*t;for(let x=0;xe.width||i+d>e.height)return void console.warn("bad render request outside image data");const c=4*e.width,u=s/255*.5,g=o.r,p=o.g,m=o.b,f=g+(n.r-g)*u,_=p+(n.g-p)*u,v=m+(n.b-m)*u,b=Math.max(s,r),C=e.data;let w=i*c+4*t;for(let y=0;y{const t=new Uint8ClampedArray(e.length/2);for(let i=0;i>1]=vP[e[i]]<<4|15&vP[e[i+1]];return t},CP={1:_((()=>bP("0000511D6300CF609C709645A78432005642574171487021003C451900274D35D762755E8B629C5BA856AF57BA649530C167D1512A272A3F6038604460398526BCA2A968DB6F8957C768BE5FBE2FB467CF5D8D5B795DC7625B5DFF50DE64C466DB2FC47CD860A65E9A2EB96CB54CE06DA763AB2EA26860524D3763536601005116008177A8705E53AB738E6A982F88BAA35B5F5B626D9C636B449B737E5B7B678598869A662F6B5B8542706C704C80736A607578685B70594A49715A4522E792"))),2:_((()=>bP("000000000000000055394F383D2800008B8B1F210002000081B1CBCBCC820000847AAF6B9AAF2119BE08B8881AD60000A44FD07DCCF107015338130C00000000385972265F390B406E2437634B4B48031B12B8A0847000001E15B29A402F0000000000004B33460B00007A752C2A0000000000004D3900000084394B82013400ABA5CFC7AD9C0302A45A3E5A98AB000089A43382D97900008BA54AA087A70A0248A6A7AE6DBE0000BF6F94987EA40A01A06DCFA7A7A9030496C32F77891D0000A99FB1A0AFA80603B29AB9CA75930D010C0948354D3900000C0948354F37460D0028BE673D8400000000AF9D7B6E00002B007AA8933400007AA642675C2700007984CFB9C3985B768772A8A6B7B20000CAAECAAFC4B700009F94A6009F840009D09F9BA4CA9C0000CC8FC76DC87F0000C991C472A2000000A894A48CA7B501079BA2C9C69BA20000B19A5D3FA89000005CA6009DA2960901B0A7F0669FB200009D009E00B7890000DAD0F5D092820000D294D4C48BD10000B5A7A4A3B1A50402CAB6CBA6A2000000B5A7A4A3B1A8044FCDADD19D9CB00000B7778F7B8AAE0803C9AB5D3F5D3F00009EA09EA0BAB006039EA0989A8C7900009B9EF4D6B7C00000A9A7816CACA80000ABAC84705D3F000096DA635CDC8C00006F486F266F263D4784006124097B00374F6D2D6D2D6D4A3A95872322000000030000000000008D8939130000000000002E22A5C9CBC70600AB25C0B5C9B400061A2DB04CA67001082AA6BEBEBFC606002321DACBC19E03087AA08B6768380000282FBAC0B8CA7A88AD25BBA5A29900004C396C5894A6000040485A6E356E9442A32CD17EADA70000B4237923628600003E2DE9C1D7B500002F25BBA5A2990000231DB6AFB4A804023025C0B5CAB588062B2CBDBEC0C706882435A75CA20000002326BD6A82A908048B4B9A5A668000002423A09CB4BB060025259C9D8A7900001C1FCAB2C7C700002A2A9387ABA200002626A4A47D6E9D14333163A0C87500004B6F9C2D643A257049364936493647358A34438355497F1A0000A24C1D590000D38DFFBDD4CD3126")))};class wP{static create(e,t){if(this.lastCreated&&e===this.lastCreated.scale&&t===this.lastFontFamily)return this.lastCreated;let i;return i=CP[e]?new _P(CP[e](),e):wP.createFromSampleData(wP.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="16px",t.height=16,t.width=960,t.style.width="960px",i.fillStyle="#ffffff",i.font=`bold 16px ${e}`,i.textBaseline="middle";let n=0;for(const s of fP)i.fillText(String.fromCharCode(s),n,8),n+=10;return i.getImageData(0,0,960,16)}static createFromSampleData(e,t){if(61440!==e.length)throw new Error("Unexpected source in MinimapCharRenderer");const i=wP._downsample(e,t);return new _P(i,t)}static _downsampleChar(e,t,i,n,s){const o=1*s,r=2*s;let a=n,l=0;for(let h=0;h0){const e=255/a;for(let t=0;twP.create(this.fontScale,a.fontFamily))),this.defaultBackgroundColor=i.getColor(2),this.backgroundColor=yP._getMinimapBackground(t,this.defaultBackgroundColor),this.foregroundAlpha=yP._getMinimapForegroundOpacity(t)}static _getMinimapBackground(e,t){const i=e.getColor(b_);return i?new rP(i.rgba.r,i.rgba.g,i.rgba.b,Math.round(255*i.rgba.a)):t}static _getMinimapForegroundOpacity(e){const t=e.getColor(C_);return t?rP._clamp(Math.round(255*t.rgba.a)):255}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.defaultBackgroundColor&&this.defaultBackgroundColor.equals(e.defaultBackgroundColor)&&this.backgroundColor&&this.backgroundColor.equals(e.backgroundColor)&&this.foregroundAlpha===e.foregroundAlpha}}class SP{constructor(e,t,i,n,s,o,r,a,l){this.scrollTop=e,this.scrollHeight=t,this.sliderNeeded=i,this._computedSliderRatio=n,this.sliderTop=s,this.sliderHeight=o,this.topPaddingLineCount=r,this.startLineNumber=a,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,s,o,r,a,l,h,d){const c=e.pixelRatio,u=e.minimapLineHeight,g=Math.floor(e.canvasInnerHeight/u),p=e.lineHeight;if(e.minimapHeightIsEditorHeight){let t=a*e.lineHeight+e.paddingTop+e.paddingBottom;e.scrollBeyondLastLine&&(t+=Math.max(0,s-e.lineHeight-e.paddingBottom));const i=Math.max(1,Math.floor(s*s/t)),n=Math.max(0,e.minimapHeight-i),o=n/(h-s),d=l*o,c=n>0,u=Math.floor(e.canvasInnerHeight/e.minimapLineHeight),g=Math.floor(e.paddingTop/e.lineHeight);return new SP(l,h,c,o,d,i,g,1,Math.min(r,u))}let m;if(o&&i!==r){const e=i-t+1;m=Math.floor(e*u/c)}else{const e=s/p;m=Math.floor(e*u/c)}const f=Math.floor(e.paddingTop/p);let _,v=Math.floor(e.paddingBottom/p);if(e.scrollBeyondLastLine){const e=s/p;v=Math.max(v,e-1)}if(v>0){_=(f+r+v-s/p-1)*u/c}else _=Math.max(0,(f+r)*u/c-m);_=Math.min(e.minimapHeight-m,_);const b=_/(h-s),C=l*b;if(g>=f+r+v){return new SP(l,h,_>0,b,C,m,f,1,r)}{let i,s;i=t>1?t+f:Math.max(1,l/p);let o=Math.max(1,Math.floor(i-C*c/u));ol&&(o=Math.min(o,d.startLineNumber),s=Math.max(s,d.topPaddingLineCount)),d.scrollTop=e.paddingTop?(t-o+s+_)*u/c:l/e.paddingTop*(s+_)*u/c,new SP(l,h,!0,b,v,m,s,o,a)}}}class LP{constructor(e){this.dy=e}onContentChanged(){this.dy=-1}onTokensChanged(){this.dy=-1}}LP.INVALID=new LP(-1);class kP{constructor(e,t,i){this.renderedLayout=e,this._imageData=t,this._renderedLines=new kO((()=>LP.INVALID)),this._renderedLines._set(e.startLineNumber,i)}linesEquals(e){if(!this.scrollEquals(e))return!1;const t=this._renderedLines._get().lines;for(let i=0,n=t.length;i1){for(let t=0,i=n-1;t0&&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 s=this.minimapLines.length-1;s>=0&&!(this.minimapLines[s]=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=Boolean(this._samplingState),[t,i]=xP.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()}}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 s=0,o=t-e+1;s{e.preventDefault();if(0===this._model.options.renderMinimap)return;if(!this._lastRenderData)return;if("proportional"!==this._model.options.size){if(0===e.button&&this._lastRenderData){const t=Hn(this._slider.domNode),i=t.top+t.height/2;this._startSliderDragging(e,i,this._lastRenderData.renderedLayout)}return}const t=this._model.options.minimapLineHeight,i=this._model.options.canvasInnerHeight/this._model.options.canvasOuterHeight*e.offsetY;let n=Math.floor(i/t)+this._lastRenderData.renderedLayout.startLineNumber-this._lastRenderData.renderedLayout.topPaddingLineCount;n=Math.min(n,this._model.getLineCount()),this._model.revealLineNumber(n)})),this._sliderPointerMoveMonitor=new fD,this._sliderPointerDownListener=Mn(this._slider.domNode,os.POINTER_DOWN,(e=>{e.preventDefault(),e.stopPropagation(),0===e.button&&this._lastRenderData&&this._startSliderDragging(e,e.pageY,this._lastRenderData.renderedLayout)})),this._gestureDisposable=ZL.addTarget(this._domNode.domNode),this._sliderTouchStartListener=En(this._domNode.domNode,$L.Start,(e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&(this._slider.toggleClassName("active",!0),this._gestureInProgress=!0,this.scrollDueToTouchEvent(e))}),{passive:!1}),this._sliderTouchMoveListener=En(this._domNode.domNode,$L.Change,(e=>{e.preventDefault(),e.stopPropagation(),this._lastRenderData&&this._gestureInProgress&&this.scrollDueToTouchEvent(e)}),{passive:!1}),this._sliderTouchEndListener=Mn(this._domNode.domNode,$L.End,(e=>{e.preventDefault(),e.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 s=(e,s)=>{const o=Hn(this._domNode.domNode),r=Math.min(Math.abs(s-n),Math.abs(s-o.left),Math.abs(s-o.left-o.width));if(Oe&&r>140)return void this._model.setScrollTop(i.scrollTop);const a=e-t;this._model.setScrollTop(i.getDesiredScrollTopFromDelta(a))};e.pageY!==t&&s(e.pageY,n),this._sliderPointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,(e=>s(e.pageY,e.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"always"===this._model.options.showSlider?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 DP(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)}onLinesDeleted(e,t){var i;return null===(i=this._lastRenderData)||void 0===i||i.onLinesDeleted(e,t),!0}onLinesInserted(e,t){var i;return null===(i=this._lastRenderData)||void 0===i||i.onLinesInserted(e,t),!0}onScrollChanged(){return this._renderDecorations=!0,!0}onThemeChanged(){return this._selectionColor=this._theme.getColor(m_),this._renderDecorations=!0,!0}onTokensChanged(e){return!!this._lastRenderData&&this._lastRenderData.onTokensChanged(e)}onTokensColorsChanged(){return this._lastRenderData=null,this._buffers=null,!0}onZonesChanged(){return this._lastRenderData=null,!0}render(e){if(0===this._model.options.renderMinimap)return this._shadow.setClassName("minimap-shadow-hidden"),this._sliderHorizontal.setWidth(0),void this._sliderHorizontal.setHeight(0);e.scrollLeft+e.viewportWidth>=e.scrollWidth?this._shadow.setClassName("minimap-shadow-hidden"):this._shadow.setClassName("minimap-shadow-visible");const t=SP.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(t.sliderNeeded?"block":"none"),this._slider.setTop(t.sliderTop),this._slider.setHeight(t.sliderHeight),this._sliderHorizontal.setLeft(0),this._sliderHorizontal.setWidth(this._model.options.minimapWidth),this._sliderHorizontal.setTop(0),this._sliderHorizontal.setHeight(t.sliderHeight),this.renderDecorations(t),this._lastRenderData=this.renderLines(t)}renderDecorations(e){if(this._renderDecorations){this._renderDecorations=!1;const t=this._model.getSelections();t.sort(Rh.compareRangesUsingStarts);const i=this._model.getMinimapDecorationsInViewport(e.startLineNumber,e.endLineNumber);i.sort(((e,t)=>(e.options.zIndex||0)-(t.options.zIndex||0)));const{canvasInnerWidth:n,canvasInnerHeight:s}=this._model.options,o=this._model.options.minimapLineHeight,r=this._model.options.minimapCharWidth,a=this._model.getOptions().tabSize,l=this._decorationsCanvas.domNode.getContext("2d");l.clearRect(0,0,n,s);const h=new IP(e.startLineNumber,e.endLineNumber,!1);this._renderSelectionLineHighlights(l,t,h,e,o),this._renderDecorationsLineHighlights(l,i,h,e,o);const d=new IP(e.startLineNumber,e.endLineNumber,null);this._renderSelectionsHighlights(l,t,d,e,o,a,r,n),this._renderDecorationsHighlights(l,i,d,e,o,a,r,n)}}_renderSelectionLineHighlights(e,t,i,n,s){if(!this._selectionColor||this._selectionColor.isTransparent())return;e.fillStyle=this._selectionColor.transparent(.5).toString();let o=0,r=0;for(const a of t){const t=n.intersectWithViewport(a);if(!t)continue;const[l,h]=t;for(let e=l;e<=h;e++)i.set(e,!0);const d=n.getYForLineNumber(l,s),c=n.getYForLineNumber(h,s);r>=d||(r>o&&e.fillRect(8,o,e.canvas.width,r-o),o=d),r=c}r>o&&e.fillRect(8,o,e.canvas.width,r-o)}_renderDecorationsLineHighlights(e,t,i,n,s){const o=new Map;for(let r=t.length-1;r>=0;r--){const a=t[r],l=a.options.minimap;if(!l||l.position!==yd.Inline)continue;const h=n.intersectWithViewport(a.range);if(!h)continue;const[d,c]=h,u=l.getColor(this._theme.value);if(!u||u.isTransparent())continue;let g=o.get(u.toString());g||(g=u.transparent(.5).toString(),o.set(u.toString(),g)),e.fillStyle=g;for(let t=d;t<=c;t++){if(i.has(t))continue;i.set(t,!0);const o=n.getYForLineNumber(d,s);e.fillRect(8,o,e.canvas.width,s)}}}_renderSelectionsHighlights(e,t,i,n,s,o,r,a){if(this._selectionColor&&!this._selectionColor.isTransparent())for(const l of t){const t=n.intersectWithViewport(l);if(!t)continue;const[h,d]=t;for(let c=h;c<=d;c++)this.renderDecorationOnLine(e,i,l,this._selectionColor,n,c,s,s,o,r,a)}}_renderDecorationsHighlights(e,t,i,n,s,o,r,a){for(const l of t){const t=l.options.minimap;if(!t)continue;const h=n.intersectWithViewport(l.range);if(!h)continue;const[d,c]=h,u=t.getColor(this._theme.value);if(u&&!u.isTransparent())for(let g=d;g<=c;g++)switch(t.position){case yd.Inline:this.renderDecorationOnLine(e,i,l.range,u,n,g,s,s,o,r,a);continue;case yd.Gutter:{const t=n.getYForLineNumber(g,s),i=2;this.renderDecoration(e,u,i,t,2,s);continue}}}}renderDecorationOnLine(e,t,i,n,s,o,r,a,l,h,d){const c=s.getYForLineNumber(o,a);if(c+r<0||c>this._model.options.canvasInnerHeight)return;const{startLineNumber:u,endLineNumber:g}=i,p=u===o?i.startColumn:1,m=g===o?i.endColumn:this._model.getLineMaxColumn(o),f=this.getXOffsetForPosition(t,o,p,l,h,d),_=this.getXOffsetForPosition(t,o,m,l,h,d);this.renderDecoration(e,n,f,c,_-f,r)}getXOffsetForPosition(e,t,i,n,s,o){if(1===i)return 8;if((i-1)*s>=o)return o;let r=e.get(t);if(!r){const i=this._model.getLineContent(t);r=[8];let a=8;for(let e=1;e=o){r[e]=o;break}r[e]=l,a=l}e.set(t,r)}return i-1b?Math.floor((n-b)/2):0,w=c.a/255,y=new rP(Math.round((c.r-d.r)*w+d.r),Math.round((c.g-d.g)*w+d.g),Math.round((c.b-d.b)*w+d.b),255);let S=e.topPaddingLineCount*n;const L=[];for(let x=0,N=i-t+1;x=0&&t_)return;const r=m.charCodeAt(C);if(9===r){const e=c-(C+w)%c;w+=e-1,b+=e*o}else if(32===r)b+=o;else{const c=Oo(r)?2:1;for(let u=0;u_)return}}}}}class IP{constructor(e,t,i){this._startLineNumber=e,this._endLineNumber=t,this._defaultValue=i,this._values=[];for(let n=0,s=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]}}class MP extends hA{constructor(e){super(e);const t=this._context.configuration.options.get(143);this._widgets={},this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,this._domNode=Vk(document.createElement("div")),dA.write(this._domNode,4),this._domNode.setClassName("overlayWidgets")}dispose(){super.dispose(),this._widgets={}}getDomNode(){return this._domNode}onConfigurationChanged(e){const t=this._context.configuration.options.get(143);return this._verticalScrollbarWidth=t.verticalScrollbarWidth,this._minimapWidth=t.minimap.minimapWidth,this._horizontalScrollbarHeight=t.horizontalScrollbarHeight,this._editorHeight=t.height,this._editorWidth=t.width,!0}addWidget(e){const t=Vk(e.getDomNode());this._widgets[e.getId()]={widget:e,preference:null,domNode:t},t.setPosition("absolute"),t.setAttribute("widgetId",e.getId()),this._domNode.appendChild(t),this.setShouldRender(),this._updateMaxMinWidth()}setWidgetPosition(e,t){const i=this._widgets[e.getId()];return i.preference===t?(this._updateMaxMinWidth(),!1):(i.preference=t,this.setShouldRender(),this._updateMaxMinWidth(),!0)}removeWidget(e){const t=e.getId();if(this._widgets.hasOwnProperty(t)){const e=this._widgets[t].domNode.domNode;delete this._widgets[t],e.parentNode.removeChild(e),this.setShouldRender(),this._updateMaxMinWidth()}}_updateMaxMinWidth(){var e,t;let i=0;const n=Object.keys(this._widgets);for(let s=0,o=n.length;s=3){const t=Math.floor(n/3),i=Math.floor(n/3),s=n-t-i,o=e+t;return[[0,e,o,e,e+t+s,e,o,e],[0,t,s,t+s,i,t+s+i,s+i,t+s+i]]}if(2===i){const t=Math.floor(n/2),i=n-t;return[[0,e,e,e,e+t,e,e,e],[0,t,t,t,i,t+i,t+i,t+i]]}return[[0,e,e,e,e,e,e,e],[0,n,n,n,n,n,n,n]]}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.cursorColor===e.cursorColor&&this.themeType===e.themeType&&lc.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}}class RP extends hA{constructor(e){super(e),this._actualShouldRender=0,this._renderedDecorations=[],this._renderedCursorPositions=[],this._domNode=Vk(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=EC.onDidChange((e=>{e.changedColorMap&&this._updateSettings(!0)})),this._cursorPositions=[]}dispose(){super.dispose(),this._tokensColorTrackerListener.dispose()}_updateSettings(e){const t=new TP(this._context.configuration,this._context.theme);return(!this._settings||!this._settings.equals(t))&&(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=2,!0}_markRenderingIsMaybeNeeded(){return this._actualShouldRender=1,!0}onConfigurationChanged(e){return!!this._updateSettings(!1)&&this._markRenderingIsNeeded()}onCursorStateChanged(e){this._cursorPositions=[];for(let t=0,i=e.selections.length;te.lineNumber===t.lineNumber))||(this._actualShouldRender=2),1===this._actualShouldRender)return;this._renderedDecorations=t,this._renderedCursorPositions=this._cursorPositions,this._domNode.setDisplay("block");const i=this._settings.canvasWidth,n=this._settings.canvasHeight,s=this._settings.lineHeight,o=this._context.viewLayout,r=n/this._context.viewLayout.getScrollHeight(),a=6*this._settings.pixelRatio|0,l=a/2|0,h=this._domNode.domNode.getContext("2d");e?e.isOpaque()?(h.fillStyle=lc.Format.CSS.formatHexA(e),h.fillRect(0,0,i,n)):(h.clearRect(0,0,i,n),h.fillStyle=lc.Format.CSS.formatHexA(e),h.fillRect(0,0,i,n)):h.clearRect(0,0,i,n);const d=this._settings.x,c=this._settings.w;for(const u of t){const e=u.color,t=u.data;h.fillStyle=e;let i=0,g=0,p=0;for(let u=0,m=t.length/3;un&&(e=n-l),_=e-l,v=e+l}_>p+1||e!==i?(0!==u&&h.fillRect(d[i],g,c[i],p-g),i=e,g=_,p=v):v>p&&(p=v)}h.fillRect(d[i],g,c[i],p-g)}if(!this._settings.hideCursor&&this._settings.cursorColor){const e=2*this._settings.pixelRatio|0,t=e/2|0,i=this._settings.x[7],s=this._settings.w[7];h.fillStyle=this._settings.cursorColor;let a=-100,l=-100;for(let d=0,c=this._cursorPositions.length;dn&&(u=n-t);const g=u-t,p=g+e;g>l+1?(0!==d&&h.fillRect(i,a,s,l-a),a=g,l=p):p>l&&(l=p)}h.fillRect(i,a,s,l-a)}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.stroke(),h.moveTo(0,0),h.lineTo(i,0),h.stroke())}}class AP{constructor(e,t,i){this._colorZoneBrand=void 0,this.from=0|e,this.to=0|t,this.colorId=0|i}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 OP{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&&(u=i-g);const p=a.color;let m=this._color2Id[p];m||(m=++this._lastAssignedId,this._color2Id[p]=m,this._id2Color[m]=p);const f=new AP(u-g,u+g,m);a.setColorZone(f),o.push(f)}return this._colorZonesInvalid=!1,o.sort(AP.compare),o}}class FP extends lA{constructor(e,t){super(),this._context=e;const i=this._context.configuration.options;this._domNode=Vk(document.createElement("canvas")),this._domNode.setClassName(t),this._domNode.setPosition("absolute"),this._domNode.setLayerHinting(!0),this._domNode.setContain("strict"),this._zoneManager=new PP((e=>this._context.viewLayout.getVerticalOffsetForLineNumber(e))),this._zoneManager.setDOMWidth(0),this._zoneManager.setDOMHeight(0),this._zoneManager.setOuterHeight(this._context.viewLayout.getScrollHeight()),this._zoneManager.setLineHeight(i.get(66)),this._zoneManager.setPixelRatio(i.get(141)),this._context.addEventHandler(this)}dispose(){this._context.removeEventHandler(this),super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return e.hasChanged(66)&&(this._zoneManager.setLineHeight(t.get(66)),this._render()),e.hasChanged(141)&&(this._zoneManager.setPixelRatio(t.get(141)),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(0===this._zoneManager.getOuterHeight())return!1;const e=this._zoneManager.getCanvasWidth(),t=this._zoneManager.getCanvasHeight(),i=this._zoneManager.resolveColorZones(),n=this._zoneManager.getId2Color(),s=this._domNode.domNode.getContext("2d");return s.clearRect(0,0,e,t),i.length>0&&this._renderOneLane(s,i,n,e),!0}_renderOneLane(e,t,i,n){let s=0,o=0,r=0;for(const a of t){const t=a.colorId,l=a.from,h=a.to;t!==s?(e.fillRect(0,o,n,r-o),s=t,e.fillStyle=i[s],o=l,r=h):r>=l?r=Math.max(r,h):(e.fillRect(0,o,n,r-o),o=l,r=h)}e.fillRect(0,o,n,r-o)}}class BP extends hA{constructor(e){super(e),this.domNode=Vk(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(101),this._typicalHalfwidthCharacterWidth=t.get(50).typicalHalfwidthCharacterWidth}dispose(){super.dispose()}onConfigurationChanged(e){const t=this._context.configuration.options;return this._rulers=t.get(101),this._typicalHalfwidthCharacterWidth=t.get(50).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 e=Vk(document.createElement("div"));e.setClassName("view-ruler"),e.setWidth(n),this.domNode.appendChild(e),this._renderedRulers.push(e),s--}return}let i=e-t;for(;i>0;){const e=this._renderedRulers.pop();this.domNode.removeChild(e),i--}}render(e){this._ensureRulersCount();for(let t=0,i=this._rulers.length;t0;return this._shouldShow!==e&&(this._shouldShow=e,!0)}getDomNode(){return this._domNode}_updateWidth(){const e=this._context.configuration.options.get(143);0===e.minimap.renderMinimap||e.minimap.minimapWidth>0&&0===e.minimap.minimapLeft?this._width=e.width:this._width=e.width-e.verticalScrollbarWidth}onConfigurationChanged(e){const t=this._context.configuration.options.get(102);return this._useShadows=t.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":"")}}class VP{constructor(e){this.left=e.left,this.width=e.width,this.startStyle=null,this.endStyle=null}}class HP{constructor(e,t){this.lineNumber=e,this.ranges=t}}function zP(e){return new VP(e)}function UP(e){return new HP(e.lineNumber,e.ranges.map(zP))}class KP extends gO{constructor(e){super(),this._previousFrameVisibleRangesWithStyle=[],this._context=e;const t=this._context.configuration.options;this._lineHeight=t.get(66),this._roundedSelection=t.get(100),this._typicalHalfwidthCharacterWidth=t.get(50).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._lineHeight=t.get(66),this._roundedSelection=t.get(100),this._typicalHalfwidthCharacterWidth=t.get(50).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 s=null,o=null;if(i&&i.length>0&&t.length>0){const n=t[0].lineNumber;if(n===e.startLineNumber)for(let e=0;!s&&e=0;e--)i[e].lineNumber===r&&(o=i[e].ranges[0]);s&&!s.startStyle&&(s=null),o&&!o.startStyle&&(o=null)}for(let r=0,a=t.length;r0){const e=t[r-1].ranges[0].left,s=t[r-1].ranges[0].left+t[r-1].ranges[0].width;jP(i-e)e&&(h.top=1),jP(l-s)'}_actualRenderOneSelection(e,t,i,n){if(0===n.length)return;const s=!!n[0].ranges[0].startStyle,o=this._lineHeight.toString(),r=(this._lineHeight-1).toString(),a=n[0].lineNumber,l=n[n.length-1].lineNumber;for(let h=0,d=n.length;h1,r)}this._previousFrameVisibleRangesWithStyle=s,this._renderResult=t.map((([e,t])=>e+t))}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}function jP(e){return e<0?-e:e}KP.SELECTION_CLASS_NAME="selected-text",KP.SELECTION_TOP_LEFT="top-left-radius",KP.SELECTION_BOTTOM_LEFT="bottom-left-radius",KP.SELECTION_TOP_RIGHT="top-right-radius",KP.SELECTION_BOTTOM_RIGHT="bottom-right-radius",KP.EDITOR_BACKGROUND_CLASS_NAME="monaco-editor-background",KP.ROUNDED_PIECE_WIDTH=10,H_(((e,t)=>{const i=e.getColor(Wm);i&&!i.isTransparent()&&t.addRule(`.monaco-editor .view-line span.inline-selected-text { color: ${i}; }`)}));class qP{constructor(e,t,i,n,s,o,r){this.top=e,this.left=t,this.paddingLeft=i,this.width=n,this.height=s,this.textContent=o,this.textContentClassName=r}}class $P{constructor(e){this._context=e;const t=this._context.configuration.options,i=t.get(50);this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),this._isVisible=!0,this._domNode=Vk(document.createElement("div")),this._domNode.setClassName(`cursor ${fO}`),this._domNode.setHeight(this._lineHeight),this._domNode.setTop(0),this._domNode.setLeft(0),Hk(this._domNode,i),this._domNode.setDisplay("none"),this._position=new Va(1,1),this._lastRenderedContent="",this._renderData=null}getDomNode(){return this._domNode}getPosition(){return this._position}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(50);return this._cursorStyle=t.get(28),this._lineHeight=t.get(66),this._typicalHalfwidthCharacterWidth=i.typicalHalfwidthCharacterWidth,this._lineCursorWidth=Math.min(t.get(31),this._typicalHalfwidthCharacterWidth),Hk(this._domNode,i),!0}onCursorPositionChanged(e,t){return this._domNode.domNode.style.transitionProperty=t?"none":"",this._position=e,!0}_getGraphemeAwarePosition(){const{lineNumber:e,column:t}=this._position,i=this._context.viewModel.getLineContent(e),[n,s]=function(e,t){t>0&&yo(e.charCodeAt(t))&&t--;const i=t+xo(e,t);return[i-No(e,i),i]}(i,t-1);return[new Va(e,n+1),i.substring(n,s)]}_prepareRender(e){let t="",i="";const[n,s]=this._getGraphemeAwarePosition();if(this._cursorStyle===IS.Line||this._cursorStyle===IS.LineThin){const o=e.visibleRangeForPosition(n);if(!o||o.outsideRenderedLine)return null;let r;this._cursorStyle===IS.Line?(r=bs(this._lineCursorWidth>0?this._lineCursorWidth:2),r>2&&(t=s,i=this._getTokenClassName(n))):r=bs(1);let a=o.left,l=0;r>=2&&a>=1&&(l=1,a-=l);const h=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta;return new qP(h,a,l,r,this._lineHeight,t,i)}const o=e.linesVisibleRangesForRange(new Rh(n.lineNumber,n.column,n.lineNumber,n.column+s.length),!1);if(!o||0===o.length)return null;const r=o[0];if(r.outsideRenderedLine||0===r.ranges.length)return null;const a=r.ranges[0],l="\t"===s||a.width<1?this._typicalHalfwidthCharacterWidth:a.width;this._cursorStyle===IS.Block&&(t=s,i=this._getTokenClassName(n));let h=e.getVerticalOffsetForLineNumber(n.lineNumber)-e.bigNumbersDelta,d=this._lineHeight;return this._cursorStyle!==IS.Underline&&this._cursorStyle!==IS.UnderlineThin||(h+=this._lineHeight-2,d=2),new qP(h,a.left,0,l,d,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 ${fO} ${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)}}class GP extends hA{constructor(e){super(e);const t=this._context.configuration.options;this._readOnly=t.get(90),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._selectionIsEmpty=!0,this._isComposingInput=!1,this._isVisible=!1,this._primaryCursor=new $P(this._context),this._secondaryCursors=[],this._renderData=[],this._domNode=Vk(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 sd,this._cursorFlatBlinkInterval=new od,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(90),this._cursorBlinking=t.get(26),this._cursorStyle=t.get(28),this._cursorSmoothCaretAnimation=t.get(27),this._updateBlinking(),this._updateDomClassName(),this._primaryCursor.onConfigurationChanged(e);for(let i=0,n=this._secondaryCursors.length;it.length){const e=this._secondaryCursors.length-t.length;for(let t=0;t{for(let i=0,n=e.ranges.length;i{this._isVisible?this._hide():this._show()}),GP.BLINK_INTERVAL):this._startCursorBlinkAnimation.setIfNotSet((()=>{this._blinkingEnabled=!0,this._updateDomClassName()}),GP.BLINK_INTERVAL))}_updateDomClassName(){this._domNode.setClassName(this._getClassName())}_getClassName(){let e="cursors-layer";switch(this._selectionIsEmpty||(e+=" has-selection"),this._cursorStyle){case IS.Line:e+=" cursor-line-style";break;case IS.Block:e+=" cursor-block-style";break;case IS.Underline:e+=" cursor-underline-style";break;case IS.LineThin:e+=" cursor-line-thin-style";break;case IS.BlockOutline:e+=" cursor-block-outline-style";break;case IS.UnderlineThin:e+=" cursor-underline-thin-style";break;default:e+=" cursor-line-style"}if(this._blinkingEnabled)switch(this._getCursorBlinking()){case 1:e+=" cursor-blink";break;case 2:e+=" cursor-smooth";break;case 3:e+=" cursor-phase";break;case 4:e+=" cursor-expand";break;default:e+=" cursor-solid"}else e+=" cursor-solid";return"on"!==this._cursorSmoothCaretAnimation&&"explicit"!==this._cursorSmoothCaretAnimation||(e+=" cursor-smooth-caret-animation"),e}_show(){this._primaryCursor.show();for(let e=0,t=this._secondaryCursors.length;e{const i=e.getColor(j_);if(i){let n=e.getColor(q_);n||(n=i.opposite()),t.addRule(`.monaco-editor .cursors-layer .cursor { background-color: ${i}; border-color: ${i}; color: ${n}; }`),A_(e.type)&&t.addRule(`.monaco-editor .cursors-layer.has-selection .cursor { border-left: 1px solid ${n}; border-right: 1px solid ${n}; }`)}}));const ZP=()=>{throw new Error("Invalid change accessor")};class YP extends hA{constructor(e){super(e);const t=this._context.configuration.options,i=t.get(143);this._lineHeight=t.get(66),this._contentWidth=i.contentWidth,this._contentLeft=i.contentLeft,this.domNode=Vk(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=Vk(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((e=>{const n=Object.keys(this._zones);for(let s=0,o=n.length;s{const n={addZone:e=>(t=!0,this._addZone(i,e)),removeZone:e=>{e&&(t=this._removeZone(i,e)||t)},layoutZone:e=>{e&&(t=this._layoutZone(i,e)||t)}};!function(e,t){try{return e(t)}catch(Mre){r(Mre)}}(e,n),n.addZone=ZP,n.removeZone=ZP,n.layoutZone=ZP})),t}_addZone(e,t){const i=this._computeWhitespaceProps(t),n={whitespaceId:e.insertWhitespace(i.afterViewLineNumber,this._getZoneOrdinal(t),i.heightInPx,i.minWidthInPx),delegate:t,isInHiddenArea:i.isInHiddenArea,isVisible:!1,domNode:Vk(t.domNode),marginDomNode:t.marginDomNode?Vk(t.marginDomNode):null};return this._safeCallOnComputedHeight(n.delegate,i.heightInPx),n.domNode.setPosition("absolute"),n.domNode.domNode.style.width="100%",n.domNode.setDisplay("none"),n.domNode.setAttribute("monaco-view-zone",n.whitespaceId),this.domNode.appendChild(n.domNode),n.marginDomNode&&(n.marginDomNode.setPosition("absolute"),n.marginDomNode.domNode.style.width="100%",n.marginDomNode.setDisplay("none"),n.marginDomNode.setAttribute("monaco-view-zone",n.whitespaceId),this.marginDomNode.appendChild(n.marginDomNode)),this._zones[n.whitespaceId]=n,this.setShouldRender(),n.whitespaceId}_removeZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t];return delete this._zones[t],e.removeWhitespace(i.whitespaceId),i.domNode.removeAttribute("monaco-visible-view-zone"),i.domNode.removeAttribute("monaco-view-zone"),i.domNode.domNode.parentNode.removeChild(i.domNode.domNode),i.marginDomNode&&(i.marginDomNode.removeAttribute("monaco-visible-view-zone"),i.marginDomNode.removeAttribute("monaco-view-zone"),i.marginDomNode.domNode.parentNode.removeChild(i.marginDomNode.domNode)),this.setShouldRender(),!0}return!1}_layoutZone(e,t){if(this._zones.hasOwnProperty(t)){const i=this._zones[t],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){if(this._zones.hasOwnProperty(e)){const t=this._zones[e];return Boolean(t.delegate.suppressMouseDown)}return!1}_heightInPixels(e){return"number"==typeof e.heightInPx?e.heightInPx:"number"==typeof e.heightInLines?this._lineHeight*e.heightInLines:this._lineHeight}_minWidthInPixels(e){return"number"==typeof e.minWidthInPx?e.minWidthInPx:0}_safeCallOnComputedHeight(e,t){if("function"==typeof e.onComputedHeight)try{e.onComputedHeight(t)}catch(Mre){r(Mre)}}_safeCallOnDomNodeTop(e,t){if("function"==typeof e.onDomNodeTop)try{e.onDomNodeTop(t)}catch(Mre){r(Mre)}}prepareRender(e){}render(e){const t=e.viewportData.whitespaceViewportData,i={};let n=!1;for(const o of t)this._zones[o.id].isInHiddenArea||(i[o.id]=o,n=!0);const s=Object.keys(this._zones);for(let o=0,r=s.length;oo)continue;const e=t.startLineNumber===o?t.startColumn:i.minColumn,s=t.endLineNumber===o?t.endColumn:i.maxColumn;e=S.endOffset&&(y++,S=i&&i[y]),9!==n&&32!==n)continue;if(c&&!C&&k<=v)continue;if(d&&k>=w&&k<=v&&32===n){const e=k-1>=0?r.charCodeAt(k-1):0,t=k+1=0?r.charCodeAt(k-1):0;if(32===n&&32!==e&&9!==e)continue}if(i&&(!S||S.startOffset>k||S.endOffset<=k))continue;const s=e.visibleRangeForPosition(new Va(t,k+1));s&&(o?(L=Math.max(L,s.left),b+=9===n?this._renderArrow(u,m,s.left):``):b+=9===n?`
    ${_?String.fromCharCode(65515):String.fromCharCode(8594)}
    `:`
    ${String.fromCharCode(f)}
    `)}return o?(L=Math.round(L+m),``+b+""):b}_renderArrow(e,t,i){const n=e/2,s=i,o={x:0,y:t/7/2},r={x:.8*t,y:o.y},a={x:r.x-.2*r.x,y:r.y+.2*r.x},l={x:a.x+.1*r.x,y:a.y+.1*r.x},h={x:l.x+.35*r.x,y:l.y-.35*r.x};return``}render(e,t){if(!this._renderResult)return"";const i=t-e;return i<0||i>=this._renderResult.length?"":this._renderResult[i]}}class iF{constructor(e){const t=e.options,i=t.get(50),n=t.get(38);"off"===n?(this.renderWhitespace="none",this.renderWithSVG=!1):"svg"===n?(this.renderWhitespace=t.get(98),this.renderWithSVG=!0):(this.renderWhitespace=t.get(98),this.renderWithSVG=!1),this.spaceWidth=i.spaceWidth,this.middotWidth=i.middotWidth,this.wsmiddotWidth=i.wsmiddotWidth,this.canUseHalfwidthRightwardsArrow=i.canUseHalfwidthRightwardsArrow,this.lineHeight=t.get(66),this.stopRenderingLineAfter=t.get(116)}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}}var nF=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},sF=function(e,t){return function(i,n){t(i,n,e)}};let oF=class extends lA{constructor(e,t,i,n,s,o,r){super(),this._instantiationService=r,this._shouldRecomputeGlyphMarginLanes=!1,this._selections=[new Ah(1,1,1,1)],this._renderAnimationFrame=null;const a=new SO(t,n,s,e);this._context=new QP(t,i,n),this._context.addEventHandler(this),this._viewParts=[],this._textAreaHandler=this._instantiationService.createInstance(yO,this._context,a,this._createTextAreaHandlerHelper()),this._viewParts.push(this._textAreaHandler),this._linesContent=Vk(document.createElement("div")),this._linesContent.setClassName("lines-content monaco-editor-background"),this._linesContent.setPosition("absolute"),this.domNode=Vk(document.createElement("div")),this.domNode.setClassName(this._getEditorClassName()),this.domNode.setAttribute("role","code"),this._overflowGuardContainer=Vk(document.createElement("div")),dA.write(this._overflowGuardContainer,3),this._overflowGuardContainer.setClassName("overflow-guard"),this._scrollbar=new zO(this._context,this._linesContent,this.domNode,this._overflowGuardContainer),this._viewParts.push(this._scrollbar),this._viewLines=new ZO(this._context,this._linesContent),this._viewZones=new YP(this._context),this._viewParts.push(this._viewZones);const l=new RP(this._context);this._viewParts.push(l);const h=new WP(this._context);this._viewParts.push(h);const d=new IO(this._context);this._viewParts.push(d),d.addDynamicOverlay(new WO(this._context)),d.addDynamicOverlay(new KP(this._context)),d.addDynamicOverlay(new UO(this._context)),d.addDynamicOverlay(new HO(this._context)),d.addDynamicOverlay(new tF(this._context));const c=new MO(this._context);this._viewParts.push(c),c.addDynamicOverlay(new VO(this._context)),c.addDynamicOverlay(new oP(this._context)),c.addDynamicOverlay(new sP(this._context)),c.addDynamicOverlay(new pO(this._context)),this._glyphMarginWidgets=new eP(this._context),this._viewParts.push(this._glyphMarginWidgets);const u=new mO(this._context);u.getDomNode().appendChild(this._viewZones.marginDomNode),u.getDomNode().appendChild(c.getDomNode()),u.getDomNode().appendChild(this._glyphMarginWidgets.domNode),this._viewParts.push(u),this._contentWidgets=new TO(this._context,this.domNode),this._viewParts.push(this._contentWidgets),this._viewCursors=new GP(this._context),this._viewParts.push(this._viewCursors),this._overlayWidgets=new MP(this._context),this._viewParts.push(this._overlayWidgets);const g=new BP(this._context);this._viewParts.push(g);const p=new eF(this._context);this._viewParts.push(p);const m=new NP(this._context);if(this._viewParts.push(m),l){const e=this._scrollbar.getOverviewRulerLayoutInfo();e.parent.insertBefore(l.getDomNode(),e.insertBefore)}this._linesContent.appendChild(d.getDomNode()),this._linesContent.appendChild(g.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(u.getDomNode()),this._overflowGuardContainer.appendChild(this._scrollbar.getDomNode()),this._overflowGuardContainer.appendChild(h.getDomNode()),this._overflowGuardContainer.appendChild(this._textAreaHandler.textArea),this._overflowGuardContainer.appendChild(this._textAreaHandler.textAreaCover),this._overflowGuardContainer.appendChild(this._overlayWidgets.getDomNode()),this._overflowGuardContainer.appendChild(m.getDomNode()),this._overflowGuardContainer.appendChild(p.domNode),this.domNode.appendChild(this._overflowGuardContainer),o?o.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode.domNode):this.domNode.appendChild(this._contentWidgets.overflowingContentWidgetsDomNode),this._applyLayout(),this._pointerHandler=this._register(new uO(this._context,a,this._createPointerHandlerHelper()))}_flushAccumulatedAndRenderNow(){this._shouldRecomputeGlyphMarginLanes&&(this._shouldRecomputeGlyphMarginLanes=!1,this._context.configuration.setGlyphMarginDecorationLaneCount(this._computeGlyphMarginLaneCount())),Wy.onRenderStart(),this._renderNow()}_computeGlyphMarginLaneCount(){const e=this._context.viewModel.model;let t=[];t=t.concat(e.getAllMarginDecorations().map((e=>{var t,i;const n=null!==(i=null===(t=e.options.glyphMargin)||void 0===t?void 0:t.position)&&void 0!==i?i:wd.Left;return{range:e.range,lane:n}}))),t=t.concat(this._glyphMarginWidgets.getWidgets().map((t=>({range:e.validateRange(t.preference.range),lane:t.preference.lane})))),t.sort(((e,t)=>Rh.compareRangesUsingStarts(e.range,t.range)));let i=null,n=null;for(const s of t)if(s.lane===wd.Left&&(!i||Rh.compareRangesUsingEnds(i,s.range)<0)&&(i=s.range),s.lane===wd.Right&&(!n||Rh.compareRangesUsingEnds(n,s.range)<0)&&(n=s.range),i&&n){if(i.endLineNumber{this.focus()},dispatchTextAreaEvent:e=>{this._textAreaHandler.textArea.domNode.dispatchEvent(e)},getLastRenderData:()=>{const e=this._viewCursors.getLastRenderData()||[],t=this._textAreaHandler.getLastRenderData();return new ZA(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 Va(e,t))),getLineWidth:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.getLineWidth(e))}}_createTextAreaHandlerHelper(){return{visibleRangeForPosition:e=>(this._flushAccumulatedAndRenderNow(),this._viewLines.visibleRangeForPosition(e))}}_applyLayout(){const e=this._context.configuration.options.get(143);this.domNode.setWidth(e.width),this.domNode.setHeight(e.height),this._overflowGuardContainer.setWidth(e.width),this._overflowGuardContainer.setHeight(e.height),this._linesContent.setWidth(1e6),this._linesContent.setHeight(1e6)}_getEditorClassName(){const e=this._textAreaHandler.isFocused()?" focused":"";return this._context.configuration.options.get(140)+" "+B_(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(){null!==this._renderAnimationFrame&&(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(){null===this._renderAnimationFrame&&(this._renderAnimationFrame=Rn(this._onRenderScheduled.bind(this),100))}_onRenderScheduled(){this._renderAnimationFrame=null,this._flushAccumulatedAndRenderNow()}_renderNow(){!function(e){try{return e()}catch(Mre){r(Mre)}}((()=>this._actualRender()))}_getViewPartsToRender(){const e=[];let t=0;for(const i of this._viewParts)i.shouldRender()&&(e[t++]=i);return e}_actualRender(){if(!xn(this.domNode.domNode))return;let e=this._getViewPartsToRender();if(!this._viewLines.shouldRender()&&0===e.length)return;const t=this._context.viewLayout.getLinesViewportData();this._context.viewModel.setViewport(t.startLineNumber,t.endLineNumber,t.centeredLineNumber);const i=new JP(this._selections,t,this._context.viewLayout.getWhitespaceViewportData(),this._context.viewModel);this._contentWidgets.shouldRender()&&this._contentWidgets.onBeforeRender(i),this._viewLines.shouldRender()&&(this._viewLines.renderText(i),this._viewLines.onDidRender(),e=this._getViewPartsToRender());const n=new uA(this._context.viewLayout,i,this._viewLines);for(const s of e)s.prepareRender(n);for(const s of e)s.render(n),s.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},1),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 s=this._viewLines.visibleRangeForPosition(new Va(n.lineNumber,n.column));return s?s.left:-1}getTargetAtClientPoint(e,t){const i=this._pointerHandler.getTargetAtClientPoint(e,t);return i?LO.convertViewToModelMouseTarget(i,this._context.viewModel.coordinatesConverter):null}createOverviewRuler(e){return new FP(this._context,e)}change(e){this._viewZones.changeViewZones(e),this._scheduleRender()}render(e,t){if(t){this._viewLines.forceShouldRender();for(const e of this._viewParts)e.forceShouldRender()}e?this._flushAccumulatedAndRenderNow():this._scheduleRender()}writeScreenReaderContent(e){this._textAreaHandler.writeScreenReaderContent(e)}focus(){this._textAreaHandler.focusTextArea()}isFocused(){return this._textAreaHandler.isFocused()}setAriaOptions(e){this._textAreaHandler.setAriaOptions(e)}addContentWidget(e){this._contentWidgets.addWidget(e.widget),this.layoutContentWidget(e),this._scheduleRender()}layoutContentWidget(e){var t,i,n,s,o,r,a,l;this._contentWidgets.setWidgetPosition(e.widget,null!==(i=null===(t=e.position)||void 0===t?void 0:t.position)&&void 0!==i?i:null,null!==(s=null===(n=e.position)||void 0===n?void 0:n.secondaryPosition)&&void 0!==s?s:null,null!==(r=null===(o=e.position)||void 0===o?void 0:o.preference)&&void 0!==r?r:null,null!==(l=null===(a=e.position)||void 0===a?void 0:a.positionAffinity)&&void 0!==l?l: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){const t=e.position?e.position.preference:null;this._overlayWidgets.setWidgetPosition(e.widget,t)&&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()}};oF=nF([sF(6,Fa)],oF);class rF{constructor(e,t,i,n,s,o){this.id=e,this.label=t,this.alias=i,this._precondition=n,this._run=s,this._contextKeyService=o}isSupported(){return this._contextKeyService.contextMatchesRules(this._precondition)}run(e){return this.isSupported()?this._run(e):Promise.resolve(void 0)}}const aF={ICodeEditor:"vs.editor.ICodeEditor",IDiffEditor:"vs.editor.IDiffEditor"};class lF{constructor(e){this._selTrackedRange=null,this._trackSelection=!0,this._setState(e,new $w(new Rh(1,1,1,1),0,0,new Va(1,1),0),new $w(new Rh(1,1,1,1),0,0,new Va(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,0))}_removeTrackedRange(e){this._selTrackedRange=e.model._setTrackedRange(this._selTrackedRange,null,0)}asCursorState(){return new Kw(this.modelState,this.viewState)}readSelectionFromMarkers(e){const t=e.model._getTrackedRange(this._selTrackedRange);return this.modelState.selection.isEmpty()&&!t.isEmpty()?Ah.fromRange(t.collapseToEnd(),this.modelState.selection.getDirection()):Ah.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,2)}static _validateViewState(e,t){const i=t.position,n=t.selectionStart.getStartPosition(),s=t.selectionStart.getEndPosition(),o=e.normalizePosition(i,2),r=this._validatePositionWithCache(e,n,i,o),a=this._validatePositionWithCache(e,s,n,r);return i.equals(o)&&n.equals(r)&&s.equals(a)?t:new $w(Rh.fromPositions(r,a),t.selectionStartKind,t.selectionStartLeftoverVisibleColumns+n.column-r.column,o,t.leftoverVisibleColumns+i.column-o.column)}_setState(e,t,i){if(i&&(i=lF._validateViewState(e.viewModel,i)),t){const i=e.model.validateRange(t.selectionStart),n=t.selectionStart.equalsRange(i)?t.selectionStartLeftoverVisibleColumns:0,s=e.model.validatePosition(t.position),o=t.position.equals(s)?t.leftoverVisibleColumns:0;t=new $w(i,t.selectionStartKind,n,s,o)}else{if(!i)return;const n=e.model.validateRange(e.coordinatesConverter.convertViewRangeToModelRange(i.selectionStart)),s=e.model.validatePosition(e.coordinatesConverter.convertViewPositionToModelPosition(i.position));t=new $w(n,i.selectionStartKind,i.selectionStartLeftoverVisibleColumns,s,i.leftoverVisibleColumns)}if(i){const n=e.coordinatesConverter.validateViewRange(i.selectionStart,t.selectionStart),s=e.coordinatesConverter.validateViewPosition(i.position,t.position);i=new $w(n,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,s,t.leftoverVisibleColumns)}else{const n=e.coordinatesConverter.convertModelPositionToViewPosition(new Va(t.selectionStart.startLineNumber,t.selectionStart.startColumn)),s=e.coordinatesConverter.convertModelPositionToViewPosition(new Va(t.selectionStart.endLineNumber,t.selectionStart.endColumn)),o=new Rh(n.lineNumber,n.column,s.lineNumber,s.column),r=e.coordinatesConverter.convertModelPositionToViewPosition(t.position);i=new $w(o,t.selectionStartKind,t.selectionStartLeftoverVisibleColumns,r,t.leftoverVisibleColumns)}this.modelState=t,this.viewState=i,this._updateTrackedRange(e)}}class hF{constructor(e){this.context=e,this.cursors=[new lF(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 function(e,t){return bc(e,((e,i)=>-t(e,i)))}(this.cursors,Qd((e=>e.viewState.position),Va.compare)).viewState.position}getBottomMostViewPosition(){return function(e,t){if(0===e.length)return;let i=e[0];for(let n=1;n=0&&(i=s)}return i}(this.cursors,Qd((e=>e.viewState.position),Va.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(Kw.fromModelSelections(e))}getPrimaryCursor(){return this.cursors[0].asCursorState()}setStates(e){null!==e&&(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 e=t-i;for(let t=0;t=e+1&&this.lastAddedCursorIndex--,this.cursors[e+1].dispose(this.context),this.cursors.splice(e+1,1)}normalize(){if(1===this.cursors.length)return;const e=this.cursors.slice(0),t=[];for(let i=0,n=e.length;ie.selection),Rh.compareRangesUsingStarts));for(let i=0;ia&&e.index--;e.splice(a,1),t.splice(r,1),this._removeSecondaryCursor(a-1),i--}}}}class dF{constructor(e,t,i,n){this._cursorContextBrand=void 0,this.model=e,this.viewModel=t,this.coordinatesConverter=i,this.cursorConfig=n}}class cF{constructor(){this.type=0}}class uF{constructor(){this.type=1}}class gF{constructor(e){this.type=2,this._source=e}hasChanged(e){return this._source.hasChanged(e)}}class pF{constructor(e,t,i){this.selections=e,this.modelSelections=t,this.reason=i,this.type=3}}class mF{constructor(e){this.type=4,e?(this.affectsMinimap=e.affectsMinimap,this.affectsOverviewRuler=e.affectsOverviewRuler,this.affectsGlyphMargin=e.affectsGlyphMargin):(this.affectsMinimap=!0,this.affectsOverviewRuler=!0,this.affectsGlyphMargin=!0)}}class fF{constructor(){this.type=5}}class _F{constructor(e){this.type=6,this.isFocused=e}}class vF{constructor(){this.type=7}}class bF{constructor(){this.type=8}}class CF{constructor(e,t){this.fromLineNumber=e,this.count=t,this.type=9}}class wF{constructor(e,t){this.type=10,this.fromLineNumber=e,this.toLineNumber=t}}class yF{constructor(e,t){this.type=11,this.fromLineNumber=e,this.toLineNumber=t}}class SF{constructor(e,t,i,n,s,o,r){this.source=e,this.minimalReveal=t,this.range=i,this.selections=n,this.verticalType=s,this.revealHorizontal=o,this.scrollType=r,this.type=12}}class LF{constructor(e){this.type=13,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 kF{constructor(e){this.theme=e,this.type=14}}class DF{constructor(e){this.type=15,this.ranges=e}}class xF{constructor(){this.type=16}}class NF{constructor(){this.type=17}}class EF extends E{constructor(){super(),this._onEvent=this._register(new U),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 IF{constructor(){this.viewEvents=[],this.outgoingEvents=[]}emitViewEvent(e){this.viewEvents.push(e)}emitOutgoingEvent(e){this.outgoingEvents.push(e)}}class MF{constructor(e,t,i,n){this.kind=0,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 MF(this._oldContentWidth,this._oldContentHeight,e.contentWidth,e.contentHeight)}}class TF{constructor(e,t){this.kind=1,this.oldHasFocus=e,this.hasFocus=t}isNoOp(){return this.oldHasFocus===this.hasFocus}attemptToMerge(e){return e.kind!==this.kind?null:new TF(this.oldHasFocus,e.hasFocus)}}class RF{constructor(e,t,i,n,s,o,r,a){this.kind=2,this._oldScrollWidth=e,this._oldScrollLeft=t,this._oldScrollHeight=i,this._oldScrollTop=n,this.scrollWidth=s,this.scrollLeft=o,this.scrollHeight=r,this.scrollTop=a,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 RF(this._oldScrollWidth,this._oldScrollLeft,this._oldScrollHeight,this._oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop)}}class AF{constructor(){this.kind=3}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class OF{constructor(){this.kind=4}isNoOp(){return!1}attemptToMerge(e){return e.kind!==this.kind?null:this}}class PF{constructor(e,t,i,n,s,o,r){this.kind=6,this.oldSelections=e,this.selections=t,this.oldModelVersionId=i,this.modelVersionId=n,this.source=s,this.reason=o,this.reachedMaxCursorCount=r}static _selectionsAreEqual(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;const i=e.length;if(i!==t.length)return!1;for(let n=0;n0){const e=this._cursors.getSelections();for(let t=0;to&&(n=n.slice(0,o),s=!0);const r=jF.from(this._model,this);return this._cursors.setStates(n),this._cursors.normalize(),this._columnSelectData=null,this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(e,t,i,r,s)}setCursorColumnSelectData(e){this._columnSelectData=e}revealPrimary(e,t,i,n,s,o){const r=this._cursors.getViewPositions();let a=null,l=null;r.length>1?l=this._cursors.getViewSelections():a=Rh.fromPositions(r[0],r[0]),e.emitViewEvent(new SF(t,i,a,l,n,s,o))}saveState(){const e=[],t=this._cursors.getSelections();for(let i=0,n=t.length;i0){const t=Kw.fromModelSelections(i.resultingSelection);this.setStates(e,"modelChange",i.isUndoing?5:i.isRedoing?6:2,t)&&this.revealPrimary(e,"modelChange",!1,0,!0,0)}else{const t=this._cursors.readSelectionFromMarkers();this.setStates(e,"modelChange",2,Kw.fromModelSelections(t))}}}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()}setSelections(e,t,i,n){this.setStates(e,t,n,Kw.fromModelSelections(i))}getPrevEditOperationType(){return this._prevEditOperationType}setPrevEditOperationType(e){this._prevEditOperationType=e}_pushAutoClosedAction(e,t){const i=[],n=[];for(let r=0,a=e.length;r0&&this._pushAutoClosedAction(i,n),this._prevEditOperationType=e.type}e.shouldPushStackElementAfter&&this._model.pushStackElement()}_interpretCommandResult(e){e&&0!==e.length||(e=this._cursors.readSelectionFromMarkers()),this._columnSelectData=null,this._cursors.setSelections(e),this._cursors.normalize()}_emitStateChangedIfNecessary(e,t,i,n,s){const o=jF.from(this._model,this);if(o.equals(n))return!1;const r=this._cursors.getSelections(),a=this._cursors.getViewSelections();if(e.emitViewEvent(new pF(a,r,i)),!n||n.cursorState.length!==o.cursorState.length||o.cursorState.some(((e,t)=>!e.modelState.equals(n.cursorState[t].modelState)))){const a=n?n.cursorState.map((e=>e.modelState.selection)):null,l=n?n.modelVersionId:0;e.emitOutgoingEvent(new PF(a,r,l,o.modelVersionId,t||"keyboard",i,s))}return!0}_findAutoClosingPairs(e){if(!e.length)return null;const t=[];for(let i=0,n=e.length;i=0)return null;const s=n.text.match(/([)\]}>'"`])([^)\]}>'"`]*)$/);if(!s)return null;const o=s[1],r=this.context.cursorConfig.autoClosingPairs.autoClosingPairsCloseSingleChar.get(o);if(!r||1!==r.length)return null;const a=r[0].open,l=n.text.length-s[2].length-1,h=n.text.lastIndexOf(a,l-1);if(-1===h)return null;t.push([h,l])}return t}executeEdits(e,t,i,n){let s=null;"snippet"===t&&(s=this._findAutoClosingPairs(i)),s&&(i[0]._isTracked=!0);const o=[],r=[],a=this._model.pushEditOperations(this.getSelections(),i,(e=>{if(s)for(let i=0,n=s.length;i0&&this._pushAutoClosedAction(o,r)}_executeEdit(e,t,i,n=0){if(this.context.cursorConfig.readOnly)return;const s=jF.from(this._model,this);this._cursors.stopTrackingSelections(),this._isHandling=!0;try{this._cursors.ensureValidState(),e()}catch(o){r(o)}this._isHandling=!1,this._cursors.startTrackingSelections(),this._validateAutoClosedActions(),this._emitStateChangedIfNecessary(t,i,n,s,!1)&&this.revealPrimary(t,i,!1,0,!0,0)}getAutoClosedCharacters(){return qF.getAllAutoClosedCharacters(this._autoClosedActions)}startComposition(e){this._compositionState=new ZF(this._model,this.getSelections())}endComposition(e,t){const i=this._compositionState?this._compositionState.deduceOutcome(this._model,this.getSelections()):null;this._compositionState=null,this._executeEdit((()=>{"keyboard"===t&&this._executeEditOperation(Sy.compositionEndWithInterceptors(this._prevEditOperationType,this.context.cursorConfig,this._model,i,this.getSelections(),this.getAutoClosedCharacters()))}),e,t)}type(e,t,i){this._executeEdit((()=>{if("keyboard"===i){const e=t.length;let i=0;for(;i{this._executeEditOperation(Sy.compositionType(this._prevEditOperationType,this.context.cursorConfig,this._model,this.getSelections(),t,i,n,s))}),e,o);else if(0!==s){const t=this.getSelections().map((e=>{const t=e.getPosition();return new Ah(t.lineNumber,t.column+s,t.lineNumber,t.column+s)}));this.setSelections(e,o,t,0)}}paste(e,t,i,n,s){this._executeEdit((()=>{this._executeEditOperation(Sy.paste(this.context.cursorConfig,this._model,this.getSelections(),t,i,n||[]))}),e,s,4)}cut(e,t){this._executeEdit((()=>{this._executeEditOperation(oy.cut(this.context.cursorConfig,this._model,this.getSelections()))}),e,t)}executeCommand(e,t,i){this._executeEdit((()=>{this._cursors.killSecondaryCursors(),this._executeEditOperation(new Gw(0,[t],{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))}),e,i)}executeCommands(e,t,i){this._executeEdit((()=>{this._executeEditOperation(new Gw(0,t,{shouldPushStackElementBefore:!1,shouldPushStackElementAfter:!1}))}),e,i)}}class jF{static from(e,t){return new jF(e.getVersionId(),t.getCursorStates())}constructor(e,t){this.modelVersionId=e,this.cursorState=t}equals(e){if(!e)return!1;if(this.modelVersionId!==e.modelVersionId)return!1;if(this.cursorState.length!==e.cursorState.length)return!1;for(let t=0,i=this.cursorState.length;t=t.length)return!1;if(!t[i].strictContainsRange(e[i]))return!1}return!0}}class $F{static executeCommands(e,t,i){const n={model:e,selectionsBefore:t,trackedRanges:[],trackedRangesDirection:[]},s=this._innerExecuteCommands(n,i);for(let o=0,r=n.trackedRanges.length;o0&&(o[0]._isTracked=!0);let r=e.model.pushEditOperations(e.selectionsBefore,o,(i=>{const n=[];for(let t=0;te.identifier.minor-t.identifier.minor,o=[];for(let r=0;r0?(n[r].sort(s),o[r]=t[r].computeCursorState(e.model,{getInverseEditOperations:()=>n[r],getTrackedSelection:t=>{const i=parseInt(t,10),n=e.model._getTrackedRange(e.trackedRanges[i]);return 0===e.trackedRangesDirection[i]?new Ah(n.startLineNumber,n.startColumn,n.endLineNumber,n.endColumn):new Ah(n.endLineNumber,n.endColumn,n.startLineNumber,n.startColumn)}})):o[r]=e.selectionsBefore[r];return o}));r||(r=e.selectionsBefore);const a=[];for(const l in s)s.hasOwnProperty(l)&&a.push(parseInt(l,10));a.sort(((e,t)=>t-e));for(const l of a)r.splice(l,1);return r}static _arrayIsEmpty(e){for(let t=0,i=e.length;t{Rh.isEmpty(e)&&""===o||n.push({identifier:{major:t,minor:s++},range:e,text:o,forceMoveMarkers:r,isAutoWhitespaceEdit:i.insertsAutoWhitespace})};let a=!1;const l={addEditOperation:o,addTrackedEditOperation:(e,t,i)=>{a=!0,o(e,t,i)},trackSelection:(t,i)=>{const n=Ah.liftSelection(t);let s;if(n.isEmpty())if("boolean"==typeof i)s=i?2:3;else{const t=e.model.getLineMaxColumn(n.startLineNumber);s=n.startColumn===t?2:3}else s=1;const o=e.trackedRanges.length,r=e.model._setTrackedRange(null,n,s);return e.trackedRanges[o]=r,e.trackedRangesDirection[o]=n.getDirection(),o.toString()}};try{i.getEditOperations(e.model,l)}catch(Mre){return r(Mre),{operations:[],hadTrackedEditOperation:!1}}return{operations:n,hadTrackedEditOperation:a}}static _getLoserCursorMap(e){(e=e.slice(0)).sort(((e,t)=>-Rh.compareRangesUsingEnds(e.range,t.range)));const t={};for(let i=1;is.identifier.major?n.identifier.major:s.identifier.major,t[o.toString()]=!0;for(let t=0;t0&&i--}}return t}}class GF{constructor(e,t,i){this.text=e,this.startSelection=t,this.endSelection=i}}class ZF{static _capture(e,t){const i=[];for(const n of t){if(n.startLineNumber!==n.endLineNumber)return null;i.push(new GF(e.getLineContent(n.startLineNumber),n.startColumn-1,n.endColumn-1))}return i}constructor(e,t){this._original=ZF._capture(e,t)}deduceOutcome(e,t){if(!this._original)return null;const i=ZF._capture(e,t);if(!i)return null;if(this._original.length!==i.length)return null;const n=[];for(let s=0,o=this._original.length;s>>1;t===e[o].afterLineNumber?i{t=!0,e|=0,i|=0,n|=0,s|=0;const o=this._instanceId+ ++this._lastWhitespaceId;return this._pendingChanges.insert(new XF(o,e,i,n,s)),o},changeOneWhitespace:(e,i,n)=>{t=!0,i|=0,n|=0,this._pendingChanges.change({id:e,newAfterLineNumber:i,newHeight:n})},removeWhitespace:e=>{t=!0,this._pendingChanges.remove({id:e})}})}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 t of e)this._insertWhitespace(t);for(const e of t)this._changeOneWhitespace(e.id,e.newAfterLineNumber,e.newHeight);for(const e of i){const t=this._findWhitespaceIndex(e.id);-1!==t&&this._removeWhitespace(t)}return}const n=new Set;for(const a of i)n.add(a.id);const s=new Map;for(const a of t)s.set(a.id,a);const o=e=>{const t=[];for(const i of e)if(!n.has(i.id)){if(s.has(i.id)){const e=s.get(i.id);i.afterLineNumber=e.newAfterLineNumber,i.height=e.newHeight}t.push(i)}return t},r=o(this._arr).concat(o(e));r.sort(((e,t)=>e.afterLineNumber===t.afterLineNumber?e.ordinal-t.ordinal:e.afterLineNumber-t.afterLineNumber)),this._arr=r,this._prefixSumValidIndex=-1}_checkPendingChanges(){this._pendingChanges.mustCommit()&&this._pendingChanges.commit(this)}_insertWhitespace(e){const t=QF.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|=0,t|=0,this._lineCount+=t-e+1;for(let i=0,n=this._arr.length;i=t.length||t[s+1].afterLineNumber>=e)return s;i=s+1|0}else n=s-1|0}return-1}_findFirstWhitespaceAfterLineNumber(e){e|=0;const t=this._findLastWhitespaceBeforeLineNumber(e)+1;return t1?this._lineHeight*(e-1):0;return i+this.getWhitespaceAccumulatedHeightBeforeLineNumber(e-(t?1:0))+this._paddingTop}getVerticalOffsetAfterLineNumber(e,t=!1){this._checkPendingChanges(),e|=0;return this._lineHeight*e+this.getWhitespaceAccumulatedHeightBeforeLineNumber(e+(t?1:0))+this._paddingTop}getWhitespaceMinWidth(){if(this._checkPendingChanges(),-1===this._minWidth){let e=0;for(let t=0,i=this._arr.length;tthis.getLinesTotalHeight()}isInTopPadding(e){return 0!==this._paddingTop&&(this._checkPendingChanges(),e=this.getLinesTotalHeight()-this._paddingBottom}getLineNumberAtOrAfterVerticalOffset(e){if(this._checkPendingChanges(),(e|=0)<0)return 1;const t=0|this._lineCount,i=this._lineHeight;let n=1,s=t;for(;n=o+i)n=t+1;else{if(e>=o)return t;s=t}}return n>t?t:n}getLinesViewportData(e,t){this._checkPendingChanges(),e|=0,t|=0;const i=this._lineHeight,n=0|this.getLineNumberAtOrAfterVerticalOffset(e),s=0|this.getVerticalOffsetForLineNumber(n);let o=0|this._lineCount,r=0|this.getFirstWhitespaceIndexAfterLineNumber(n);const a=0|this.getWhitespacesCount();let l,h;-1===r?(r=a,h=o+1,l=0):(h=0|this.getAfterLineNumberForWhitespaceIndex(r),l=0|this.getHeightForWhitespaceIndex(r));let d=s,c=d;const u=5e5;let g=0;s>=u&&(g=Math.floor(s/u)*u,g=Math.floor(g/i)*i,c-=g);const p=[],m=e+(t-e)/2;let f=-1;for(let C=n;C<=o;C++){if(-1===f){(d<=m&&mm)&&(f=C)}for(d+=i,p[C-n]=c,c+=i;h===C;)c+=l,d+=l,r++,r>=a?h=o+1:(h=0|this.getAfterLineNumberForWhitespaceIndex(r),l=0|this.getHeightForWhitespaceIndex(r));if(d>=t){o=C;break}}-1===f&&(f=o);const _=0|this.getVerticalOffsetForLineNumber(o);let v=n,b=o;return vt&&b--,{bigNumbersDelta:g,startLineNumber:n,endLineNumber:o,relativeVerticalOffset:p,centeredLineNumber:f,completelyVisibleStartLineNumber:v,completelyVisibleEndLineNumber:b}}getVerticalOffsetForWhitespaceIndex(e){this._checkPendingChanges(),e|=0;const t=this.getAfterLineNumberForWhitespaceIndex(e);let i,n;return i=t>=1?this._lineHeight*t:0,n=e>0?this.getWhitespacesAccumulatedHeight(e-1):0,i+n+this._paddingTop}getWhitespaceIndexAtOrAfterVerticallOffset(e){this._checkPendingChanges(),e|=0;let t=0,i=this.getWhitespacesCount()-1;if(i<0)return-1;if(e>=this.getVerticalOffsetForWhitespaceIndex(i)+this.getHeightForWhitespaceIndex(i))return-1;for(;t=s+this.getHeightForWhitespaceIndex(n))t=n+1;else{if(e>=s)return n;i=n}}return t}getWhitespaceAtVerticalOffset(e){this._checkPendingChanges(),e|=0;const t=this.getWhitespaceIndexAtOrAfterVerticallOffset(e);if(t<0)return null;if(t>=this.getWhitespacesCount())return null;const i=this.getVerticalOffsetForWhitespaceIndex(t);if(i>e)return null;const n=this.getHeightForWhitespaceIndex(t);return{id:this.getIdForWhitespaceIndex(t),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(t),verticalOffset:i,height:n}}getWhitespaceViewportData(e,t){this._checkPendingChanges(),e|=0,t|=0;const i=this.getWhitespaceIndexAtOrAfterVerticallOffset(e),n=this.getWhitespacesCount()-1;if(i<0)return[];const s=[];for(let o=i;o<=n;o++){const e=this.getVerticalOffsetForWhitespaceIndex(o),i=this.getHeightForWhitespaceIndex(o);if(e>=t)break;s.push({id:this.getIdForWhitespaceIndex(o),afterLineNumber:this.getAfterLineNumberForWhitespaceIndex(o),verticalOffset:e,height:i})}return s}getWhitespaces(){return this._checkPendingChanges(),this._arr.slice(0)}getWhitespacesCount(){return this._checkPendingChanges(),this._arr.length}getIdForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].id}getAfterLineNumberForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].afterLineNumber}getHeightForWhitespaceIndex(e){return this._checkPendingChanges(),e|=0,this._arr[e].height}}QF.INSTANCE_COUNT=0;class JF{constructor(e,t,i,n){(e|=0)<0&&(e=0),(t|=0)<0&&(t=0),(i|=0)<0&&(i=0),(n|=0)<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 eB extends E{constructor(e,t){super(),this._onDidContentSizeChange=this._register(new U),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._dimensions=new JF(0,0,0,0),this._scrollable=this._register(new DD({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 MF(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 tB extends E{constructor(e,t,i){super(),this._configuration=e;const n=this._configuration.options,s=n.get(143),o=n.get(83);this._linesLayout=new QF(t,n.get(66),o.top,o.bottom),this._maxLineWidth=0,this._overlayWidgetsMinWidth=0,this._scrollable=this._register(new eB(0,i)),this._configureSmoothScrollDuration(),this._scrollable.setScrollDimensions(new JF(s.contentWidth,0,s.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(113)?125:0)}onConfigurationChanged(e){const t=this._configuration.options;if(e.hasChanged(66)&&this._linesLayout.setLineHeight(t.get(66)),e.hasChanged(83)){const e=t.get(83);this._linesLayout.setPadding(e.top,e.bottom)}if(e.hasChanged(143)){const e=t.get(143),i=e.contentWidth,n=e.height,s=this._scrollable.getScrollDimensions(),o=s.contentWidth;this._scrollable.setScrollDimensions(new JF(i,s.contentWidth,n,this._getContentHeight(i,n,o)))}else this._updateHeight();e.hasChanged(113)&&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 i=this._configuration.options.get(102);return 2===i.horizontal||e>=t?0:i.horizontalScrollbarSize}_getContentHeight(e,t,i){const n=this._configuration.options;let s=this._linesLayout.getLinesTotalHeight();return n.get(104)?s+=Math.max(0,t-n.get(66)-n.get(83).bottom):s+=this._getHorizontalScrollbarHeight(e,i),s}_updateHeight(){const e=this._scrollable.getScrollDimensions(),t=e.width,i=e.height,n=e.contentWidth;this._scrollable.setScrollDimensions(new JF(t,e.contentWidth,i,this._getContentHeight(t,i,n)))}getCurrentViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getCurrentScrollPosition();return new lP(t.scrollTop,t.scrollLeft,e.width,e.height)}getFutureViewport(){const e=this._scrollable.getScrollDimensions(),t=this._scrollable.getFutureScrollPosition();return new lP(t.scrollTop,t.scrollLeft,e.width,e.height)}_computeContentWidth(){const e=this._configuration.options,t=this._maxLineWidth,i=e.get(144),n=e.get(50),s=e.get(143);if(i.isViewportWrapping){const i=e.get(72);return t>s.contentWidth+n.typicalHalfwidthCharacterWidth&&i.enabled&&"right"===i.side?t+s.verticalScrollbarWidth:t}{const i=e.get(103)*n.typicalHalfwidthCharacterWidth,o=this._linesLayout.getWhitespaceMinWidth();return Math.max(t+i+s.verticalScrollbarWidth,o,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 JF(e.width,this._computeContentWidth(),e.height,e.contentHeight)),this._updateHeight()}saveState(){const e=this._scrollable.getFutureScrollPosition(),t=e.scrollTop,i=this._linesLayout.getLineNumberAtOrAfterVerticalOffset(t);return{scrollTop:t,scrollTopWithoutViewZones:t-this._linesLayout.getWhitespaceAccumulatedHeightBeforeLineNumber(i),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){1===t?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 iB{constructor(e,t,i,n,s){this.editorId=e,this.model=t,this.configuration=i,this._linesCollection=n,this._coordinatesConverter=s,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,s=e.options;let o;if(s.isWholeLine){const e=this._coordinatesConverter.convertModelPositionToViewPosition(new Va(n.startLineNumber,1),0,!1,!0),t=this._coordinatesConverter.convertModelPositionToViewPosition(new Va(n.endLineNumber,this.model.getLineMaxColumn(n.endLineNumber)),1);o=new Rh(e.lineNumber,e.column,t.lineNumber,t.column)}else o=this._coordinatesConverter.convertModelRangeToViewRange(n,1);i=new pP(o,s),this._decorationsCache[t]=i}return i}getMinimapDecorationsInRange(e){return this._getDecorationsInRange(e,!0,!1).decorations}getDecorationsViewportData(e){let t=null!==this._cachedModelDecorationsResolver;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 Rh(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,OS(this.configuration.options),t,i),s=e.startLineNumber,o=e.endLineNumber,r=[];let a=0;const l=[];for(let h=s;h<=o;h++)l[h-s]=[];for(let h=0,d=n.length;h1===e))}function oB(e,t){return rB(e,t.range,(e=>2===e))}function rB(e,t,i){for(let n=t.startLineNumber;n<=t.endLineNumber;n++){const s=e.tokenization.getLineTokens(n),o=n===t.startLineNumber,r=n===t.endLineNumber;let a=o?s.findTokenIndexAtOffset(t.startColumn-1):0;for(;at.endColumn-1)break}if(!i(s.getStandardTokenType(a)))return!1;a++}}return!0}function aB(e,t){return null===e?t?hB.INSTANCE:dB.INSTANCE:new lB(e,t)}class lB{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,s=this._projectionData.breakOffsets[i];let o;if(null!==this._projectionData.injectionOffsets){const i=this._projectionData.injectionOffsets.map(((e,t)=>new tw(0,0,e+1,this._projectionData.injectionOptions[t],0)));o=tw.applyInjectedText(e.getLineContent(t),i).substring(n,s)}else o=e.getValueInRange({startLineNumber:t,startColumn:n+1,endLineNumber:t,endColumn:s+1});return i>0&&(o=uB(this._projectionData.wrappedTextIndentLength)+o),o}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,s,o,r){this._assertVisible();const a=this._projectionData,l=a.injectionOffsets,h=a.injectionOptions;let d,c=null;if(l){c=[];let e=0,t=0;for(let i=0;i0?a.breakOffsets[i-1]:0,o=a.breakOffsets[i];for(;to)break;if(s0?a.wrappedTextIndentLength:0,r=t+Math.max(d-s,0),l=t+Math.min(c-s,o-s);r!==l&&n.push(new gP(r,l,e.inlineClassName,e.inlineClassNameAffectsLetterSpacing))}}if(!(c<=o))break;e+=r,t++}}}d=l?e.tokenization.getLineTokens(t).withInserted(l.map(((e,t)=>({offset:e,text:h[t].content,tokenMetadata:PC.defaultTokenMetadata})))):e.tokenization.getLineTokens(t);for(let u=i;u0?n.wrappedTextIndentLength:0,o=i>0?n.breakOffsets[i-1]:0,r=n.breakOffsets[i],a=e.sliceAndInflate(o,r,s);let l=a.getLineContent();i>0&&(l=uB(n.wrappedTextIndentLength)+l);const h=this._projectionData.getMinOutputOffset(i)+1,d=l.length+1,c=i+1=cB.length)for(let t=1;t<=e;t++)cB[t]=gB(t);return cB[e]}function gB(e){return new Array(e+1).join(" ")}class pB{constructor(e,t,i,n,s,o,r,a,l,h){this._editorId=e,this.model=t,this._validModelVersionId=-1,this._domLineBreaksComputerFactory=i,this._monospaceLineBreaksComputerFactory=n,this.fontInfo=s,this.tabSize=o,this.wrappingStrategy=r,this.wrappingColumn=a,this.wrappingIndent=l,this.wordBreak=h,this._constructLines(!0,null)}dispose(){this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,[])}createCoordinatesConverter(){return new _B(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),s=i.length,o=this.createLineBreaksComputer(),r=new ic(tw.fromDecorations(n));for(let p=0;pe.lineNumber===p+1));o.addRequest(i[p],e,t?t[p]:null)}const a=o.finalize(),l=[],h=this.hiddenAreasDecorationIds.map((e=>this.model.getDecorationRange(e))).sort(Rh.compareRangesUsingStarts);let d=1,c=0,u=-1,g=u+1=d&&e<=c,i=aB(a[p],!t);l[p]=i.getViewLineCount(),this.modelLineProjections[p]=i}this._validModelVersionId=this.model.getVersionId(),this.projectedModelLineLineCounts=new mI(l)}getHiddenAreas(){return this.hiddenAreasDecorationIds.map((e=>this.model.getDecorationRange(e)))}setHiddenAreas(e){const t=function(e){if(0===e.length)return[];const t=e.slice();t.sort(Rh.compareRangesUsingStarts);const i=[];let n=t[0].startLineNumber,s=t[0].endLineNumber;for(let o=1,r=t.length;os+1?(i.push(new Rh(n,1,s,1)),n=e.startLineNumber,s=e.endLineNumber):e.endLineNumber>s&&(s=e.endLineNumber)}return i.push(new Rh(n,1,s,1)),i}(e.map((e=>this.model.validateRange(e)))),i=this.hiddenAreasDecorationIds.map((e=>this.model.getDecorationRange(e))).sort(Rh.compareRangesUsingStarts);if(t.length===i.length){let e=!1;for(let n=0;n({range:e,options:Iw.EMPTY})));this.hiddenAreasDecorationIds=this.model.deltaDecorations(this.hiddenAreasDecorationIds,n);const s=t;let o=1,r=0,a=-1,l=a+1=o&&e<=r?this.modelLineProjections[d].isVisible()&&(this.modelLineProjections[d]=this.modelLineProjections[d].setVisible(!1),t=!0):(h=!0,this.modelLineProjections[d].isVisible()||(this.modelLineProjections[d]=this.modelLineProjections[d].setVisible(!0),t=!0)),t){const e=this.modelLineProjections[d].getViewLineCount();this.projectedModelLineLineCounts.setValue(d,e)}}return h||this.setHiddenAreas([]),!0}modelPositionIsVisible(e,t){return!(e<1||e>this.modelLineProjections.length)&&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&&(this.tabSize=e,this._constructLines(!1,null),!0)}setWrappingSettings(e,t,i,n,s){const o=this.fontInfo.equals(e),r=this.wrappingStrategy===t,a=this.wrappingColumn===i,l=this.wrappingIndent===n,h=this.wordBreak===s;if(o&&r&&a&&l&&h)return!1;const d=o&&r&&!a&&l&&h;this.fontInfo=e,this.wrappingStrategy=t,this.wrappingColumn=i,this.wrappingIndent=n,this.wordBreak=s;let c=null;if(d){c=[];for(let e=0,t=this.modelLineProjections.length;e2&&!this.modelLineProjections[t-2].isVisible(),o=1===t?1:this.projectedModelLineLineCounts.getPrefixSum(t-1)+1;let r=0;const a=[],l=[];for(let h=0,d=n.length;hr?(l=this.projectedModelLineLineCounts.getPrefixSum(t-1)+1,h=l+r-1,u=h+1,g=u+(s-r)-1,a=!0):st?t:0|e}getActiveIndentGuide(e,t,i){e=this._toValidViewLineNumber(e),t=this._toValidViewLineNumber(t),i=this._toValidViewLineNumber(i);const n=this.convertViewPositionToModelPosition(e,this.getViewLineMinColumn(e)),s=this.convertViewPositionToModelPosition(t,this.getViewLineMinColumn(t)),o=this.convertViewPositionToModelPosition(i,this.getViewLineMinColumn(i)),r=this.model.guides.getActiveIndentGuide(n.lineNumber,s.lineNumber,o.lineNumber),a=this.convertModelPositionToViewPosition(r.startLineNumber,1),l=this.convertModelPositionToViewPosition(r.endLineNumber,this.model.getLineMaxColumn(r.endLineNumber));return{startLineNumber:a.lineNumber,endLineNumber:l.lineNumber,indent:r.indent}}getViewLineInfo(e){e=this._toValidViewLineNumber(e);const t=this.projectedModelLineLineCounts.getIndexOf(e-1),i=t.index,n=t.remainder;return new mB(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 Va(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 Va(e.modelLineNumber,n)}getViewLineInfosGroupedByModelRanges(e,t){const i=this.getViewLineInfo(e),n=this.getViewLineInfo(t),s=new Array;let o=this.getModelStartPositionOfViewLine(i),r=new Array;for(let a=i.modelLineNumber;a<=n.modelLineNumber;a++){const e=this.modelLineProjections[a-1];if(e.isVisible()){const t=a===i.modelLineNumber?i.modelLineWrappedLineIdx:0,s=a===n.modelLineNumber?n.modelLineWrappedLineIdx+1:e.getViewLineCount();for(let e=t;e{if(-1!==e.forWrappedLinesAfterColumn){if(this.modelLineProjections[i.modelLineNumber-1].getViewPositionOfModelPosition(0,e.forWrappedLinesAfterColumn).lineNumber>=i.modelLineWrappedLineIdx)return}if(-1!==e.forWrappedLinesBeforeOrAtColumn){if(this.modelLineProjections[i.modelLineNumber-1].getViewPositionOfModelPosition(0,e.forWrappedLinesBeforeOrAtColumn).lineNumberi.modelLineWrappedLineIdx)return}const n=this.convertModelPositionToViewPosition(i.modelLineNumber,e.horizontalLine.endColumn),s=this.modelLineProjections[i.modelLineNumber-1].getViewPositionOfModelPosition(0,e.horizontalLine.endColumn);return s.lineNumber===i.modelLineWrappedLineIdx?new Jv(e.visibleColumn,t,e.className,new eb(e.horizontalLine.top,n.column),-1,-1):s.lineNumber!!e)))}}return o}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 s=[];const o=[],r=[],a=i.lineNumber-1,l=n.lineNumber-1;let h=null;for(let g=a;g<=l;g++){const e=this.modelLineProjections[g];if(e.isVisible()){const t=e.getViewLineNumberOfModelPosition(0,g===a?i.column:1),n=e.getViewLineNumberOfModelPosition(0,this.model.getLineMaxColumn(g+1)),s=n-t+1;let l=0;s>1&&1===e.getViewLineMinColumn(this.model,g+1,n)&&(l=0===t?1:2),o.push(s),r.push(l),null===h&&(h=new Va(g+1,0))}else null!==h&&(s=s.concat(this.model.guides.getLinesIndentGuides(h.lineNumber,g)),h=null)}null!==h&&(s=s.concat(this.model.guides.getLinesIndentGuides(h.lineNumber,n.lineNumber)),h=null);const d=t-e+1,c=new Array(d);let u=0;for(let g=0,p=s.length;gt&&(c=!0,d=t-s+1),n.getViewLinesData(this.model,l+1,h,d,s-e,i,a),s+=d,c)break}return a}validateViewPosition(e,t,i){e=this._toValidViewLineNumber(e);const n=this.projectedModelLineLineCounts.getIndexOf(e-1),s=n.index,o=n.remainder,r=this.modelLineProjections[s],a=r.getViewLineMinColumn(this.model,s+1,o),l=r.getViewLineMaxColumn(this.model,s+1,o);tl&&(t=l);const h=r.getModelColumnOfViewPosition(o,t);return this.model.validatePosition(new Va(s+1,h)).equals(i)?new Va(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 Rh(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 Va(i.modelLineNumber,n))}convertViewRangeToModelRange(e){const t=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),i=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);return new Rh(t.lineNumber,t.column,i.lineNumber,i.column)}convertModelPositionToViewPosition(e,t,i=2,n=!1,s=!1){const o=this.model.validatePosition(new Va(e,t)),r=o.lineNumber,a=o.column;let l=r-1,h=!1;if(s)for(;l0&&!this.modelLineProjections[l].isVisible();)l--,h=!0;if(0===l&&!this.modelLineProjections[l].isVisible())return new Va(n?0:1,1);const d=1+this.projectedModelLineLineCounts.getPrefixSum(l);let c;return c=h?s?this.modelLineProjections[l].getViewPositionOfModelPosition(d,1,i):this.modelLineProjections[l].getViewPositionOfModelPosition(d,this.model.getLineMaxColumn(l+1),i):this.modelLineProjections[r-1].getViewPositionOfModelPosition(d,a,i),c}convertModelRangeToViewRange(e,t=0){if(e.isEmpty()){const i=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,t);return Rh.fromPositions(i)}{const t=this.convertModelPositionToViewPosition(e.startLineNumber,e.startColumn,1),i=this.convertModelPositionToViewPosition(e.endLineNumber,e.endColumn,0);return new Rh(t.lineNumber,t.column,i.lineNumber,i.column)}}getViewLineNumberOfModelPosition(e,t){let i=e-1;if(this.modelLineProjections[i].isVisible()){const e=1+this.projectedModelLineLineCounts.getPrefixSum(i);return this.modelLineProjections[i].getViewLineNumberOfModelPosition(e,t)}for(;i>0&&!this.modelLineProjections[i].isVisible();)i--;if(0===i&&!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,s){const o=this.convertViewPositionToModelPosition(e.startLineNumber,e.startColumn),r=this.convertViewPositionToModelPosition(e.endLineNumber,e.endColumn);if(r.lineNumber-o.lineNumber<=e.endLineNumber-e.startLineNumber)return this.model.getDecorationsInRange(new Rh(o.lineNumber,1,r.lineNumber,r.column),t,i,n,s);let a=[];const l=o.lineNumber-1,h=r.lineNumber-1;let d=null;for(let p=l;p<=h;p++){if(this.modelLineProjections[p].isVisible())null===d&&(d=new Va(p+1,p===l?o.column:1));else if(null!==d){const e=this.model.getLineMaxColumn(p);a=a.concat(this.model.getDecorationsInRange(new Rh(d.lineNumber,d.column,p,e),t,i,n)),d=null}}null!==d&&(a=a.concat(this.model.getDecorationsInRange(new Rh(d.lineNumber,d.column,r.lineNumber,r.column),t,i,n)),d=null),a.sort(((e,t)=>{const i=Rh.compareRangesUsingStarts(e.range,t.range);return 0===i?e.idt.id?1:0:i}));const c=[];let u=0,g=null;for(const p of a){const e=p.id;g!==e&&(g=e,c[u++]=p)}return c}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 0===t.modelLineWrappedLineIdx?this.model.getLineIndentColumn(t.modelLineNumber):0}}class mB{constructor(e,t){this.modelLineNumber=e,this.modelLineWrappedLineIdx=t}}class fB{constructor(e,t){this.modelRange=e,this.viewLines=t}}class _B{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)}}class vB{constructor(e){this.model=e}dispose(){}createCoordinatesConverter(){return new bB(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 wF(t,i)}onModelLinesInserted(e,t,i,n){return new yF(t,i)}onModelLineChanged(e,t,i){return[!1,new CF(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 s=0;st)}getModelLineViewLineCount(e){return 1}getViewLineNumberOfModelPosition(e,t){return e}}class CB extends E{constructor(e,t,i,n,s,o,r,a,l){if(super(),this.languageConfigurationService=r,this._themeService=a,this._attachedView=l,this.hiddenAreasModel=new SB,this.previousHiddenAreas=[],this._editorId=e,this._configuration=t,this.model=i,this._eventDispatcher=new EF,this.onEvent=this._eventDispatcher.onEvent,this.cursorConfig=new Uw(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._updateConfigurationViewLineCount=this._register(new rd((()=>this._updateConfigurationViewLineCountNow()),0)),this._hasFocus=!1,this._viewportStart=wB.create(this.model),this.model.isTooLargeForTokenization())this._lines=new vB(this.model);else{const e=this._configuration.options,t=e.get(50),i=e.get(137),o=e.get(144),r=e.get(136),a=e.get(128);this._lines=new pB(this._editorId,this.model,n,s,t,this.model.getOptions().tabSize,i,o.wrappingColumn,r,a)}this.coordinatesConverter=this._lines.createCoordinatesConverter(),this._cursor=this._register(new KF(i,this,this.coordinatesConverter,this.cursorConfig)),this.viewLayout=this._register(new tB(this._configuration,this.getLineCount(),o)),this._register(this.viewLayout.onDidScroll((e=>{e.scrollTopChanged&&this._handleVisibleLinesChanged(),e.scrollTopChanged&&this._viewportStart.invalidate(),this._eventDispatcher.emitSingleViewEvent(new LF(e)),this._eventDispatcher.emitOutgoingEvent(new RF(e.oldScrollWidth,e.oldScrollLeft,e.oldScrollHeight,e.oldScrollTop,e.scrollWidth,e.scrollLeft,e.scrollHeight,e.scrollTop))}))),this._register(this.viewLayout.onDidContentSizeChange((e=>{this._eventDispatcher.emitOutgoingEvent(e)}))),this._decorations=new iB(this._editorId,this.model,this._configuration,this._lines,this.coordinatesConverter),this._registerModelEvents(),this._register(this._configuration.onDidChangeFast((e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();this._onConfigurationChanged(t,e)}finally{this._eventDispatcher.endEmitViewEvents()}}))),this._register(aP.getInstance().onDidChange((()=>{this._eventDispatcher.emitSingleViewEvent(new xF)}))),this._register(this._themeService.onDidColorThemeChange((e=>{this._invalidateDecorationsColorCache(),this._eventDispatcher.emitSingleViewEvent(new kF(e))}))),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 Rh(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 _F(e)),this._eventDispatcher.emitOutgoingEvent(new TF(!e,e))}onCompositionStart(){this._eventDispatcher.emitSingleViewEvent(new cF)}onCompositionEnd(){this._eventDispatcher.emitSingleViewEvent(new uF)}_captureStableViewport(){if(this._viewportStart.isValid&&this.viewLayout.getCurrentScrollTop()>0){const e=new Va(this._viewportStart.viewLineNumber,this.getLineMinColumn(this._viewportStart.viewLineNumber)),t=this.coordinatesConverter.convertViewPositionToModelPosition(e);return new kB(t,this._viewportStart.startLineDelta)}return new kB(null,0)}_onConfigurationChanged(e,t){const i=this._captureStableViewport(),n=this._configuration.options,s=n.get(50),o=n.get(137),r=n.get(144),a=n.get(136),l=n.get(128);this._lines.setWrappingSettings(s,o,r.wrappingColumn,a,l)&&(e.emitViewEvent(new fF),e.emitViewEvent(new bF),e.emitViewEvent(new mF(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this._updateConfigurationViewLineCount.schedule()),t.hasChanged(90)&&(this._decorations.reset(),e.emitViewEvent(new mF(null))),e.emitViewEvent(new gF(t)),this.viewLayout.onConfigurationChanged(t),i.recoverViewportStart(this.coordinatesConverter,this.viewLayout),Uw.shouldRecreate(t)&&(this.cursorConfig=new Uw(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig))}_registerModelEvents(){this._register(this.model.onDidChangeContentOrInjectedText((e=>{try{const t=this._eventDispatcher.beginEmitViewEvents();let i=!1,n=!1;const s=e instanceof lw?e.rawContentChangedEvent.changes:e.changes,o=e instanceof lw?e.rawContentChangedEvent.versionId:null,r=this._lines.createLineBreaksComputer();for(const e of s)switch(e.changeType){case 4:for(let t=0;t!e.ownerId||e.ownerId===this._editorId))),r.addRequest(i,n,null)}break;case 2:{let t=null;e.injectedText&&(t=e.injectedText.filter((e=>!e.ownerId||e.ownerId===this._editorId))),r.addRequest(e.detail,t,null);break}}const a=r.finalize(),l=new ic(a);for(const e of s)switch(e.changeType){case 1:this._lines.onModelFlushed(),t.emitViewEvent(new fF),this._decorations.reset(),this.viewLayout.onFlushed(this.getLineCount()),i=!0;break;case 3:{const n=this._lines.onModelLinesDeleted(o,e.fromLineNumber,e.toLineNumber);null!==n&&(t.emitViewEvent(n),this.viewLayout.onLinesDeleted(n.fromLineNumber,n.toLineNumber)),i=!0;break}case 4:{const n=l.takeCount(e.detail.length),s=this._lines.onModelLinesInserted(o,e.fromLineNumber,e.toLineNumber,n);null!==s&&(t.emitViewEvent(s),this.viewLayout.onLinesInserted(s.fromLineNumber,s.toLineNumber)),i=!0;break}case 2:{const i=l.dequeue(),[s,r,a,h]=this._lines.onModelLineChanged(o,e.lineNumber,i);n=s,r&&t.emitViewEvent(r),a&&(t.emitViewEvent(a),this.viewLayout.onLinesInserted(a.fromLineNumber,a.toLineNumber)),h&&(t.emitViewEvent(h),this.viewLayout.onLinesDeleted(h.fromLineNumber,h.toLineNumber));break}}null!==o&&this._lines.acceptVersionId(o),this.viewLayout.onHeightMaybeChanged(),!i&&n&&(t.emitViewEvent(new bF),t.emitViewEvent(new mF(null)),this._cursor.onLineMappingChanged(t),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 e=this.model._getTrackedRange(this._viewportStart.modelTrackedRange);if(e){const t=this.coordinatesConverter.convertModelPositionToViewPosition(e.getStartPosition()),i=this.viewLayout.getVerticalOffsetForLineNumber(t.lineNumber);this.viewLayout.setScrollPosition({scrollTop:i+this._viewportStart.startLineDelta},1)}}try{const t=this._eventDispatcher.beginEmitViewEvents();e instanceof lw&&t.emitOutgoingEvent(new HF(e.contentChangedEvent)),this._cursor.onModelContentChanged(t,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 vF),this.cursorConfig=new Uw(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new VF(e))}))),this._register(this.model.onDidChangeLanguage((e=>{this.cursorConfig=new Uw(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new WF(e))}))),this._register(this.model.onDidChangeOptions((e=>{if(this._lines.setTabSize(this.model.getOptions().tabSize)){try{const e=this._eventDispatcher.beginEmitViewEvents();e.emitViewEvent(new fF),e.emitViewEvent(new bF),e.emitViewEvent(new mF(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount())}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule()}this.cursorConfig=new Uw(this.model.getLanguageId(),this.model.getOptions(),this._configuration,this.languageConfigurationService),this._cursor.updateConfiguration(this.cursorConfig),this._eventDispatcher.emitOutgoingEvent(new zF(e))}))),this._register(this.model.onDidChangeDecorations((e=>{this._decorations.onModelDecorationsChanged(),this._eventDispatcher.emitSingleViewEvent(new mF(e)),this._eventDispatcher.emitOutgoingEvent(new BF(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 s=!1;try{const e=this._eventDispatcher.beginEmitViewEvents();s=this._lines.setHiddenAreas(i),s&&(e.emitViewEvent(new fF),e.emitViewEvent(new bF),e.emitViewEvent(new mF(null)),this._cursor.onLineMappingChanged(e),this._decorations.onLineMappingChanged(),this.viewLayout.onFlushed(this.getLineCount()),this.viewLayout.onHeightMaybeChanged()),n.recoverViewportStart(this.coordinatesConverter,this.viewLayout)}finally{this._eventDispatcher.endEmitViewEvents()}this._updateConfigurationViewLineCount.schedule(),s&&this._eventDispatcher.emitOutgoingEvent(new OF)}getVisibleRangesPlusViewportAboveBelow(){const e=this._configuration.options.get(143),t=this._configuration.options.get(66),i=Math.max(20,Math.round(e.height/t)),n=this.viewLayout.getLinesViewportData(),s=Math.max(1,n.completelyVisibleStartLineNumber-i),o=Math.min(this.getLineCount(),n.completelyVisibleEndLineNumber+i);return this._toModelVisibleRanges(new Rh(s,this.getLineMinColumn(s),o,this.getLineMaxColumn(o)))}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(0===i.length)return[t];const n=[];let s=0,o=t.startLineNumber,r=t.startColumn;const a=t.endLineNumber,l=t.endColumn;for(let h=0,d=i.length;ha||(ot.toInlineDecoration(e)))]),new cP(o.minColumn,o.maxColumn,o.content,o.continuesWithWrappedLine,i,n,o.tokens,t,s,o.startVisibleColumn)}getViewLineData(e){return this._lines.getViewLineData(e)}getMinimapLinesRenderingData(e,t,i){const n=this._lines.getViewLinesData(e,t,i);return new hP(this.getTabSize(),n)}getAllOverviewRulerDecorations(e){const t=this.model.getOverviewRulerDecorations(this._editorId,OS(this._configuration.options)),i=new yB;for(const n of t){const t=n.options,s=t.overviewRuler;if(!s)continue;const o=s.position;if(0===o)continue;const r=s.getColor(e.value),a=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.startLineNumber,n.range.startColumn),l=this.coordinatesConverter.getViewLineNumberOfModelPosition(n.range.endLineNumber,n.range.endColumn);i.accept(r,t.zIndex,a,l,o)}return i.asArray}_invalidateDecorationsColorCache(){const e=this.model.getOverviewRulerDecorations();for(const t of e){const e=t.options.overviewRuler;null==e||e.invalidateCachedColor();const i=t.options.minimap;null==i||i.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);return this.model.modifyPosition(i,t)}deduceModelPositionRelativeToViewPosition(e,t,i){const n=this.coordinatesConverter.convertViewPositionToModelPosition(e);2===this.model.getEOL().length&&(t<0?t-=i:t+=i);const s=this.model.getOffsetAt(n)+t;return this.model.getPositionAt(s)}getPlainTextToCopy(e,t,i){const n=i?"\r\n":this.model.getEOL();(e=e.slice(0)).sort(Rh.compareRangesUsingStarts);let s=!1,o=!1;for(const a of e)a.isEmpty()?s=!0:o=!0;if(!o){if(!t)return"";const i=e.map((e=>e.startLineNumber));let s="";for(let e=0;e0&&i[e-1]===i[e]||(s+=this.model.getLineContent(i[e])+n);return s}if(s&&t){const t=[];let n=0;for(const s of e){const e=s.startLineNumber;s.isEmpty()?e!==n&&t.push(this.model.getLineContent(e)):t.push(this.model.getValueInRange(s,i?2:0)),n=e}return 1===t.length?t[0]:t}const r=[];for(const a of e)a.isEmpty()||r.push(this.model.getValueInRange(a,i?2:0));return 1===r.length?r[0]:r}getRichTextToCopy(e,t){const i=this.model.getLanguageId();if(i===Ku)return null;if(1!==e.length)return null;let n=e[0];if(n.isEmpty()){if(!t)return null;const e=n.startLineNumber;n=new Rh(e,this.model.getLineMinColumn(e),e,this.model.getLineMaxColumn(e))}const s=this._configuration.options.get(50),o=this._getColorMap();let r;if(/[:;\\\/<>]/.test(s.fontFamily)||s.fontFamily===qS.fontFamily)r=qS.fontFamily;else{r=s.fontFamily,r=r.replace(/"/g,"'");if(!/[,']/.test(r)){/[+ ]/.test(r)&&(r=`'${r}'`)}r=`${r}, ${qS.fontFamily}`}return{mode:i,html:`
    `+this._getHTMLToCopy(n,o)+"
    "}}_getHTMLToCopy(e,t){const i=e.startLineNumber,n=e.startColumn,s=e.endLineNumber,o=e.endColumn,r=this.getTabSize();let a="";for(let l=i;l<=s;l++){const e=this.model.tokenization.getLineTokens(l),h=e.getLineContent(),d=l===i?n-1:0,c=l===s?o-1:h.length;a+=""===h?"
    ":Kk(h,e.inflate(),t,d,c,r,Oe)}return a}_getColorMap(){const e=EC.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=0){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){this._cursor.context.cursorConfig.readOnly?this._eventDispatcher.emitOutgoingEvent(new FF):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,s){this._executeCursorEdit((o=>this._cursor.compositionType(o,e,t,i,n,s)))}paste(e,t,i,n){this._executeCursorEdit((s=>this._cursor.paste(s,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)))}revealPrimaryCursor(e,t,i=!1){this._withViewEventsCollector((n=>this._cursor.revealPrimary(n,e,i,0,t,0)))}revealTopMostCursor(e){const t=this._cursor.getTopMostViewPosition(),i=new Rh(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector((t=>t.emitViewEvent(new SF(e,!1,i,null,0,!0,0))))}revealBottomMostCursor(e){const t=this._cursor.getBottomMostViewPosition(),i=new Rh(t.lineNumber,t.column,t.lineNumber,t.column);this._withViewEventsCollector((t=>t.emitViewEvent(new SF(e,!1,i,null,0,!0,0))))}revealRange(e,t,i,n,s){this._withViewEventsCollector((o=>o.emitViewEvent(new SF(e,!1,i,null,n,t,s))))}changeWhitespace(e){this.viewLayout.changeWhitespace(e)&&(this._eventDispatcher.emitSingleViewEvent(new NF),this._eventDispatcher.emitOutgoingEvent(new AF))}_withViewEventsCollector(e){try{return e(this._eventDispatcher.beginEmitViewEvents())}finally{this._eventDispatcher.endEmitViewEvents()}}normalizePosition(e,t){return this._lines.normalizePosition(e,t)}getLineIndentColumn(e){return this._lines.getLineIndentColumn(e)}}class wB{static create(e){const t=e._setTrackedRange(null,new Rh(1,1,1,1),1);return new wB(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,s){this._model=e,this._viewLineNumber=t,this._isValid=i,this._modelTrackedRange=n,this._startLineDelta=s}dispose(){this._model._setTrackedRange(this._modelTrackedRange,null,1)}update(e,t){const i=e.coordinatesConverter.convertViewPositionToModelPosition(new Va(t,e.getLineMinColumn(t))),n=e.model._setTrackedRange(this._modelTrackedRange,new Rh(i.lineNumber,i.column,i.lineNumber,i.column),1),s=e.viewLayout.getVerticalOffsetForLineNumber(t),o=e.viewLayout.getCurrentScrollTop();this._viewLineNumber=t,this._isValid=!0,this._modelTrackedRange=n,this._startLineDelta=o-s}invalidate(){this._isValid=!1}}class yB{constructor(){this._asMap=Object.create(null),this.asArray=[]}accept(e,t,i,n,s){const o=this._asMap[e];if(o){const e=o.data,t=e[e.length-3],r=e[e.length-1];if(t===s&&r+1>=i)return void(n>r&&(e[e.length-1]=n));e.push(s,i,n)}else{const o=new mP(e,t,[s,i,n]);this._asMap[e]=o,this.asArray.push(o)}}}class SB{constructor(){this.hiddenAreas=new Map,this.shouldRecompute=!1,this.ranges=[]}setHiddenAreas(e,t){const i=this.hiddenAreas.get(e);i&&LB(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(((e,t)=>function(e,t){const i=[];let n=0,s=0;for(;n0?this.wrappedTextIndentLength:0}getLineLength(e){const t=e>0?this.breakOffsets[e-1]:0;let i=this.breakOffsets[e]-t;return e>0&&(i+=this.wrappedTextIndentLength),i}getMaxOutputOffset(e){return this.getLineLength(e)}translateToInputOffset(e,t){e>0&&(t=Math.max(0,t-this.wrappedTextIndentLength));let i=0===e?t:this.breakOffsets[e-1]+t;if(null!==this.injectionOffsets)for(let n=0;nthis.injectionOffsets[n];n++)i0?this.breakOffsets[s-1]:0,0===t)if(e<=o)n=s-1;else{if(!(e>r))break;i=s+1}else if(e=r))break;i=s+1}}let r=e-o;return s>0&&(r+=this.wrappedTextIndentLength),new IB(s,r)}normalizeOutputPosition(e,t,i){if(null!==this.injectionOffsets){const n=this.outputPositionToOffsetInInputWithInjections(e,t),s=this.normalizeOffsetInInputWithInjectionsAroundInjections(n,i);if(s!==n)return this.offsetInInputWithInjectionsToOutputPosition(s,i)}if(0===i){if(e>0&&t===this.getMinOutputOffset(e))return new IB(e-1,this.getMaxOutputOffset(e-1))}else if(1===i){if(e0&&(t=Math.max(0,t-this.wrappedTextIndentLength));return(e>0?this.breakOffsets[e-1]:0)+t}normalizeOffsetInInputWithInjectionsAroundInjections(e,t){const i=this.getInjectedTextAtOffset(e);if(!i)return e;if(2===t){if(e===i.offsetInInputWithInjections+i.length&&NB(this.injectionOptions[i.injectedTextIndex].cursorStops))return i.offsetInInputWithInjections+i.length;{let e=i.offsetInInputWithInjections;if(EB(this.injectionOptions[i.injectedTextIndex].cursorStops))return e;let t=i.injectedTextIndex-1;for(;t>=0&&this.injectionOffsets[t]===this.injectionOffsets[i.injectedTextIndex]&&!NB(this.injectionOptions[t].cursorStops)&&(e-=this.injectionOptions[t].content.length,!EB(this.injectionOptions[t].cursorStops));)t--;return e}}if(1===t||4===t){let e=i.offsetInInputWithInjections+i.length,t=i.injectedTextIndex;for(;t+1=0&&this.injectionOffsets[t-1]===this.injectionOffsets[t];)e-=this.injectionOptions[t-1].content.length,t--;return e}zl()}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(null!==t){let n=0;for(let s=0;se)break;if(e<=a)return{injectedTextIndex:s,offsetInInputWithInjections:r,length:o};n+=o}}}}function NB(e){return null==e||(e===Sd.Right||e===Sd.Both)}function EB(e){return null==e||(e===Sd.Left||e===Sd.Both)}class IB{constructor(e,t){this.outputLineIndex=e,this.outputOffset=t}toString(){return`${this.outputLineIndex}:${this.outputOffset}`}toPosition(e){return new Va(e+this.outputLineIndex,this.outputOffset+1)}}class MB{static create(e){return new MB(e.get(132),e.get(131))}constructor(e,t){this.classifier=new TB(e,t)}createLineBreaksComputer(e,t,i,n,s){const o=[],r=[],a=[];return{addRequest:(e,t,i)=>{o.push(e),r.push(t),a.push(i)},finalize:()=>{const l=e.typicalFullwidthCharacterWidth/e.typicalHalfwidthCharacterWidth,h=[];for(let e=0,d=o.length;e=0&&e<256?this._asciiMap[e]:e>=12352&&e<=12543||e>=13312&&e<=19903||e>=19968&&e<=40959?3:this._map.get(e)||this._defaultValue}}let RB=[],AB=[];function OB(e,t,i,n,s,o,r,a){if(-1===s)return null;const l=i.length;if(l<=1)return null;const h="keepAll"===a,d=t.breakOffsets,c=t.breakOffsetsVisibleColumn,u=VB(i,n,s,o,r),g=s-u,p=RB,m=AB;let f=0,_=0,v=0,b=s;const C=d.length;let w=0;if(w>=0){let e=Math.abs(c[w]-b);for(;w+1=e)break;e=t,w++}}for(;wt&&(t=_,s=v);let r=0,a=0,u=0,y=0;if(s<=b){let v=s,C=0===t?0:i.charCodeAt(t-1),w=0===t?0:e.get(C),S=!0;for(let s=t;s_&&WB(C,w,l,d,h)&&(r=t,a=v),v+=c,v>b){t>_?(u=t,y=v-c):(u=s+1,y=v),v-a>g&&(r=0),S=!1;break}C=l,w=d}if(S){f>0&&(p[f]=d[d.length-1],m[f]=c[d.length-1],f++);break}}if(0===r){let l=s,d=i.charCodeAt(t),c=e.get(d),p=!1;for(let n=t-1;n>=_;n--){const t=n+1,s=i.charCodeAt(n);if(9===s){p=!0;break}let m,f;if(yo(s)?(n--,m=0,f=2):(m=e.get(s),f=Oo(s)?o:1),l<=b){if(0===u&&(u=t,y=l),l<=b-g)break;if(WB(s,m,d,c,h)){r=t,a=l;break}}l-=f,d=s,c=m}if(0!==r){const e=g-(y-a);if(e<=n){const t=i.charCodeAt(u);let s;s=wo(t)?2:FB(t,y,n,o),e-s<0&&(r=0)}}if(p){w--;continue}}if(0===r&&(r=u,a=y),r<=_){const e=i.charCodeAt(_);wo(e)?(r=_+2,a=v+2):(r=_+1,a=v+FB(e,v,n,o))}for(_=r,p[f]=r,v=a,m[f]=a,f++,b=a+g;w<0||w=S)break;S=e,w++}}return 0===f?null:(p.length=f,m.length=f,RB=t.breakOffsets,AB=t.breakOffsetsVisibleColumn,t.breakOffsets=p,t.breakOffsetsVisibleColumn=m,t.wrappedTextIndentLength=u,t)}function PB(e,t,i,n,s,o,r,a){const l=tw.applyInjectedText(t,i);let h,d;if(i&&i.length>0?(h=i.map((e=>e.options)),d=i.map((e=>e.column-1))):(h=null,d=null),-1===s)return h?new xB(d,h,[l.length],[],0):null;const c=l.length;if(c<=1)return h?new xB(d,h,[l.length],[],0):null;const u="keepAll"===a,g=VB(l,n,s,o,r),p=s-g,m=[],f=[];let _=0,v=0,b=0,C=s,w=l.charCodeAt(0),y=e.get(w),S=FB(w,0,n,o),L=1;wo(w)&&(S+=1,w=l.charCodeAt(1),y=e.get(w),L++);for(let k=L;kC&&((0===v||S-b>p)&&(v=t,b=S-r),m[_]=v,f[_]=b,_++,C=b+p,v=0),w=i,y=s}return 0!==_||i&&0!==i.length?(m[_]=c,f[_]=S,new xB(d,h,m,f,g)):null}function FB(e,t,i,n){return 9===e?i-t%i:Oo(e)||e<32?n:1}function BB(e,t){return t-e%t}function WB(e,t,i,n,s){return 32!==i&&(2===t&&2!==n||1!==t&&1===n||!s&&3===t&&2!==n||!s&&3===n&&1!==t)}function VB(e,t,i,n,s){let o=0;if(0!==s){const r=ro(e);if(-1!==r){for(let i=0;ii&&(o=0)}}return o}const HB=Fk("domLineBreaksComputer",{createHTML:e=>e});class zB{static create(){return new zB}constructor(){}createLineBreaksComputer(e,t,i,n,s){const o=[],r=[];return{addRequest:(e,t,i)=>{o.push(e),r.push(t)},finalize:()=>function(e,t,i,n,s,o,r){var a;function l(t){const i=r[t];if(i){const n=tw.applyInjectedText(e[t],i),s=i.map((e=>e.options)),o=i.map((e=>e.column-1));return new xB(o,s,[n.length],[],0)}return null}if(-1===n){const t=[];for(let i=0,n=e.length;ih?(o=0,a=0):l=h-e}const d=n.substr(o),c=UB(d,a,i,l,p,u);m[k]=o,f[k]=a,_[k]=d,v[k]=c[0],b[k]=c[1]}const C=p.build(),w=null!==(a=null==HB?void 0:HB.createHTML(C))&&void 0!==a?a:C;g.innerHTML=w,g.style.position="absolute",g.style.top="10000","keepAll"===o?(g.style.wordBreak="keep-all",g.style.overflowWrap="anywhere"):(g.style.wordBreak="inherit",g.style.overflowWrap="break-word");document.body.appendChild(g);const y=document.createRange(),S=Array.prototype.slice.call(g.children,0),L=[];for(let k=0;ke.options)),a=h.map((e=>e.column-1))):(o=null,a=null),L[k]=new xB(a,o,e,s,i)}return document.body.removeChild(g),L}(o,e,t,i,n,s,r)}}}function UB(e,t,i,n,s,o){if(0!==o){const e=String(o);s.appendString('
    ');const r=e.length;let a=t,l=0;const h=[],d=[];let c=0");for(let u=0;u"),h[u]=l,d[u]=a;const t=c;c=u+1"),h[e.length]=l,d[e.length]=a,s.appendString("
    "),[h,d]}function KB(e,t,i,n){if(i.length<=1)return null;const s=Array.prototype.slice.call(t.children,0),o=[];try{jB(e,s,n,0,null,i.length-1,null,o)}catch(r){return console.log(r),null}return 0===o.length?null:(o.push(i.length),o)}function jB(e,t,i,n,s,o,r,a){if(n===o)return;if(s=s||qB(e,t,i[n],i[n+1]),r=r||qB(e,t,i[o],i[o+1]),Math.abs(s[0].top-r[0].top)<=.1)return;if(n+1===o)return void a.push(o);const l=n+(o-n)/2|0,h=qB(e,t,i[l],i[l+1]);jB(e,t,i,n,s,l,h,a),jB(e,t,i,l,h,o,r,a)}function qB(e,t,i,n){return e.setStart(t[i/16384|0].firstChild,i%16384),e.setEnd(t[n/16384|0].firstChild,n%16384),e.getClientRects()}class $B extends E{constructor(){super(),this._editor=null,this._instantiationService=null,this._instances=this._register(new R),this._pending=new Map,this._finishedInstantiation=[],this._finishedInstantiation[0]=!1,this._finishedInstantiation[1]=!1,this._finishedInstantiation[2]=!1,this._finishedInstantiation[3]=!1}initialize(e,t,i){this._editor=e,this._instantiationService=i;for(const n of t)this._pending.has(n.id)?r(new Error(`Cannot have two contributions with the same id ${n.id}`)):this._pending.set(n.id,n);this._instantiateSome(0),this._register(ad((()=>{this._instantiateSome(1)}))),this._register(ad((()=>{this._instantiateSome(2)}))),this._register(ad((()=>{this._instantiateSome(3)}),5e3))}saveViewState(){const e={};for(const[t,i]of this._instances)"function"==typeof i.saveViewState&&(e[t]=i.saveViewState());return e}restoreViewState(e){for(const[t,i]of this._instances)"function"==typeof i.restoreViewState&&i.restoreViewState(e[t])}get(e){return this._instantiateById(e),this._instances.get(e)||null}onBeforeInteractionEvent(){this._instantiateSome(2)}onAfterModelAttached(){this._register(ad((()=>{this._instantiateSome(1)}),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 e=this._instantiationService.createInstance(t.ctor,this._editor);this._instances.set(t.id,e),"function"==typeof e.restoreViewState&&0!==t.instantiation&&console.warn(`Editor contribution '${t.id}' should be eager instantiated because it uses saveViewState / restoreViewState.`)}catch(i){r(i)}}}}var GB,ZB=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},YB=function(e,t){return function(i,n){t(i,n,e)}},XB=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let QB=0;class JB{constructor(e,t,i,n,s,o){this.model=e,this.viewModel=t,this.view=i,this.hasRealView=n,this.listenersToRemove=s,this.attachedView=o}dispose(){k(this.listenersToRemove),this.model.onBeforeDetached(this.attachedView),this.hasRealView&&this.view.dispose(),this.viewModel.dispose()}}let eW=GB=class extends E{get isSimpleWidget(){return this._configuration.isSimpleWidget}constructor(e,t,i,n,s,o,a,l,h,d,c,u){var g;super(),this.languageConfigurationService=c,this._deliveryQueue=new K,this._contributions=this._register(new $B),this._onDidDispose=this._register(new U),this.onDidDispose=this._onDidDispose.event,this._onDidChangeModelContent=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelContent=this._onDidChangeModelContent.event,this._onDidChangeModelLanguage=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguage=this._onDidChangeModelLanguage.event,this._onDidChangeModelLanguageConfiguration=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelLanguageConfiguration=this._onDidChangeModelLanguageConfiguration.event,this._onDidChangeModelOptions=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelOptions=this._onDidChangeModelOptions.event,this._onDidChangeModelDecorations=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelDecorations=this._onDidChangeModelDecorations.event,this._onDidChangeModelTokens=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidChangeModelTokens=this._onDidChangeModelTokens.event,this._onDidChangeConfiguration=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidChangeConfiguration=this._onDidChangeConfiguration.event,this._onDidChangeModel=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidChangeModel=this._onDidChangeModel.event,this._onDidChangeCursorPosition=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorPosition=this._onDidChangeCursorPosition.event,this._onDidChangeCursorSelection=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidChangeCursorSelection=this._onDidChangeCursorSelection.event,this._onDidAttemptReadOnlyEdit=this._register(new iW(this._contributions,this._deliveryQueue)),this.onDidAttemptReadOnlyEdit=this._onDidAttemptReadOnlyEdit.event,this._onDidLayoutChange=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidLayoutChange=this._onDidLayoutChange.event,this._editorTextFocus=this._register(new tW({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorText=this._editorTextFocus.onDidChangeToTrue,this.onDidBlurEditorText=this._editorTextFocus.onDidChangeToFalse,this._editorWidgetFocus=this._register(new tW({deliveryQueue:this._deliveryQueue})),this.onDidFocusEditorWidget=this._editorWidgetFocus.onDidChangeToTrue,this.onDidBlurEditorWidget=this._editorWidgetFocus.onDidChangeToFalse,this._onWillType=this._register(new iW(this._contributions,this._deliveryQueue)),this.onWillType=this._onWillType.event,this._onDidType=this._register(new iW(this._contributions,this._deliveryQueue)),this.onDidType=this._onDidType.event,this._onDidCompositionStart=this._register(new iW(this._contributions,this._deliveryQueue)),this.onDidCompositionStart=this._onDidCompositionStart.event,this._onDidCompositionEnd=this._register(new iW(this._contributions,this._deliveryQueue)),this.onDidCompositionEnd=this._onDidCompositionEnd.event,this._onDidPaste=this._register(new iW(this._contributions,this._deliveryQueue)),this.onDidPaste=this._onDidPaste.event,this._onMouseUp=this._register(new iW(this._contributions,this._deliveryQueue)),this.onMouseUp=this._onMouseUp.event,this._onMouseDown=this._register(new iW(this._contributions,this._deliveryQueue)),this.onMouseDown=this._onMouseDown.event,this._onMouseDrag=this._register(new iW(this._contributions,this._deliveryQueue)),this.onMouseDrag=this._onMouseDrag.event,this._onMouseDrop=this._register(new iW(this._contributions,this._deliveryQueue)),this.onMouseDrop=this._onMouseDrop.event,this._onMouseDropCanceled=this._register(new iW(this._contributions,this._deliveryQueue)),this.onMouseDropCanceled=this._onMouseDropCanceled.event,this._onDropIntoEditor=this._register(new iW(this._contributions,this._deliveryQueue)),this.onDropIntoEditor=this._onDropIntoEditor.event,this._onContextMenu=this._register(new iW(this._contributions,this._deliveryQueue)),this.onContextMenu=this._onContextMenu.event,this._onMouseMove=this._register(new iW(this._contributions,this._deliveryQueue)),this.onMouseMove=this._onMouseMove.event,this._onMouseLeave=this._register(new iW(this._contributions,this._deliveryQueue)),this.onMouseLeave=this._onMouseLeave.event,this._onMouseWheel=this._register(new iW(this._contributions,this._deliveryQueue)),this.onMouseWheel=this._onMouseWheel.event,this._onKeyUp=this._register(new iW(this._contributions,this._deliveryQueue)),this.onKeyUp=this._onKeyUp.event,this._onKeyDown=this._register(new iW(this._contributions,this._deliveryQueue)),this.onKeyDown=this._onKeyDown.event,this._onDidContentSizeChange=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidContentSizeChange=this._onDidContentSizeChange.event,this._onDidScrollChange=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidScrollChange=this._onDidScrollChange.event,this._onDidChangeViewZones=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidChangeViewZones=this._onDidChangeViewZones.event,this._onDidChangeHiddenAreas=this._register(new U({deliveryQueue:this._deliveryQueue})),this.onDidChangeHiddenAreas=this._onDidChangeHiddenAreas.event,this._actions=new Map,this._bannerDomNode=null,this._dropIntoEditorDecorations=this.createDecorationsCollection(),s.willCreateCodeEditor();const p=Object.assign({},t);let m;this._domElement=e,this._overflowWidgetsDomNode=p.overflowWidgetsDomNode,delete p.overflowWidgetsDomNode,this._id=++QB,this._decorationTypeKeysToIds={},this._decorationTypeSubtypes={},this._telemetryData=i.telemetryData,this._configuration=this._register(this._createConfiguration(i.isSimpleWidget||!1,p,d)),this._register(this._configuration.onDidChange((e=>{this._onDidChangeConfiguration.fire(e);const t=this._configuration.options;if(e.hasChanged(143)){const e=t.get(143);this._onDidLayoutChange.fire(e)}}))),this._contextKeyService=this._register(a.createScoped(this._domElement)),this._notificationService=h,this._codeEditorService=s,this._commandService=o,this._themeService=l,this._register(new nW(this,this._contextKeyService)),this._register(new sW(this,this._contextKeyService,u)),this._instantiationService=n.createChild(new DB([Ol,this._contextKeyService])),this._modelData=null,this._focusTracker=new oW(e),this._register(this._focusTracker.onChange((()=>{this._editorWidgetFocus.setValue(this._focusTracker.hasFocus())}))),this._contentWidgets={},this._overlayWidgets={},this._glyphMarginWidgets={},m=Array.isArray(i.contributions)?i.contributions:xh.getEditorContributions(),this._contributions.initialize(this,m,this._instantiationService);for(const _ of xh.getEditorActions()){if(this._actions.has(_.id)){r(new Error(`Cannot have two actions with the same id ${_.id}`));continue}const e=new rF(_.id,_.label,_.alias,null!==(g=_.precondition)&&void 0!==g?g:void 0,(()=>this._instantiationService.invokeFunction((e=>Promise.resolve(_.runEditorCommand(e,this,null))))),this._contextKeyService);this._actions.set(e.id,e)}const f=()=>!this._configuration.options.get(90)&&this._configuration.options.get(36).enabled;this._register(new Ds(this._domElement,{onDragEnter:()=>{},onDragOver:e=>{if(!f())return;const t=this.getTargetAtClientPoint(e.clientX,e.clientY);(null==t?void 0:t.position)&&this.showDropIndicatorAt(t.position)},onDrop:e=>XB(this,void 0,void 0,(function*(){if(!f())return;if(this.removeDropIndicator(),!e.dataTransfer)return;const t=this.getTargetAtClientPoint(e.clientX,e.clientY);(null==t?void 0:t.position)&&this._onDropIntoEditor.fire({position:t.position,event:e})})),onDragLeave:()=>{this.removeDropIndicator()},onDragEnd:()=>{this.removeDropIndicator()}})),this._codeEditorService.addCodeEditor(this)}writeScreenReaderContent(e){var t;null===(t=this._modelData)||void 0===t||t.view.writeScreenReaderContent(e)}_createConfiguration(e,t,i){return new iA(e,t,this._domElement,i)}getId(){return this.getEditorType()+":"+this._id}getEditorType(){return aF.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?ry.getWordAtPosition(this._modelData.model,this._configuration.options.get(129),e):null}getValue(e=null){if(!this._modelData)return"";const t=!(!e||!e.preserveBOM);let i=0;return e&&e.lineEnding&&"\n"===e.lineEnding?i=1:e&&e.lineEnding&&"\r\n"===e.lineEnding&&(i=2),this._modelData.model.getValue(i,t)}setValue(e){this._modelData&&this._modelData.model.setValue(e)}getModel(){return this._modelData?this._modelData.model:null}setModel(e=null){const t=e;if(null===this._modelData&&null===t)return;if(this._modelData&&this._modelData.model===t)return;const i=this.hasTextFocus(),n=this._detachModel();this._attachModel(t),i&&this.hasModel()&&this.focus();const s={oldModelUrl:n?n.uri:null,newModelUrl:t?t.uri:null};this._removeDecorationTypes(),this._onDidChangeModel.fire(s),this._postDetachModelCleanup(n),this._contributions.onAfterModelAttached()}_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 s=e.model.validatePosition({lineNumber:t,column:i}),o=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetAfterLineNumber(o.lineNumber,n)}getTopForLineNumber(e,t=!1){return this._modelData?GB._getVerticalOffsetForPosition(this._modelData,e,1,t):-1}getTopForPosition(e,t){return this._modelData?GB._getVerticalOffsetForPosition(this._modelData,e,t,!1):-1}static _getVerticalOffsetForPosition(e,t,i,n=!1){const s=e.model.validatePosition({lineNumber:t,column:i}),o=e.viewModel.coordinatesConverter.convertModelPositionToViewPosition(s);return e.viewModel.viewLayout.getVerticalOffsetForLineNumber(o.lineNumber,n)}getBottomForLineNumber(e,t=!1){return this._modelData?GB._getVerticalOffsetAfterPosition(this._modelData,e,1,t):-1}setHiddenAreas(e,t){var i;null===(i=this._modelData)||void 0===i||i.viewModel.setHiddenAreas(e.map((e=>Rh.lift(e))),t)}getVisibleColumnFromPosition(e){if(!this._modelData)return e.column;const t=this._modelData.model.validatePosition(e),i=this._modelData.model.getOptions().tabSize;return dc.visibleColumnFromColumn(this._modelData.model.getLineContent(t.lineNumber),t.column,i)+1}getPosition(){return this._modelData?this._modelData.viewModel.getPosition():null}setPosition(e,t="api"){if(this._modelData){if(!Va.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(!Rh.isIRange(e))throw new Error("Invalid arguments");const s=this._modelData.model.validateRange(e),o=this._modelData.viewModel.coordinatesConverter.convertModelRangeToViewRange(s);this._modelData.viewModel.revealRange("api",i,o,t,n)}revealLine(e,t=0){this._revealLine(e,0,t)}revealLineInCenter(e,t=0){this._revealLine(e,1,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._revealLine(e,2,t)}revealLineNearTop(e,t=0){this._revealLine(e,5,t)}_revealLine(e,t,i){if("number"!=typeof e)throw new Error("Invalid arguments");this._sendRevealRange(new Rh(e,1,e,1),t,!1,i)}revealPosition(e,t=0){this._revealPosition(e,0,!0,t)}revealPositionInCenter(e,t=0){this._revealPosition(e,1,!0,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._revealPosition(e,2,!0,t)}revealPositionNearTop(e,t=0){this._revealPosition(e,5,!0,t)}_revealPosition(e,t,i,n){if(!Va.isIPosition(e))throw new Error("Invalid arguments");this._sendRevealRange(new Rh(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=Ah.isISelection(e),n=Rh.isIRange(e);if(!i&&!n)throw new Error("Invalid arguments");if(i)this._setSelectionImpl(e,t);else if(n){const i={selectionStartLineNumber:e.startLineNumber,selectionStartColumn:e.startColumn,positionLineNumber:e.endLineNumber,positionColumn:e.endColumn};this._setSelectionImpl(i,t)}}_setSelectionImpl(e,t){if(!this._modelData)return;const i=new Ah(e.selectionStartLineNumber,e.selectionStartColumn,e.positionLineNumber,e.positionColumn);this._modelData.viewModel.setSelections(t,[i])}revealLines(e,t,i=0){this._revealLines(e,t,0,i)}revealLinesInCenter(e,t,i=0){this._revealLines(e,t,1,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._revealLines(e,t,2,i)}revealLinesNearTop(e,t,i=0){this._revealLines(e,t,5,i)}_revealLines(e,t,i,n){if("number"!=typeof e||"number"!=typeof t)throw new Error("Invalid arguments");this._sendRevealRange(new Rh(e,1,t,1),i,!1,n)}revealRange(e,t=0,i=!1,n=!0){this._revealRange(e,i?1:0,n,t)}revealRangeInCenter(e,t=0){this._revealRange(e,1,!0,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._revealRange(e,2,!0,t)}revealRangeNearTop(e,t=0){this._revealRange(e,5,!0,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._revealRange(e,6,!0,t)}revealRangeAtTop(e,t=0){this._revealRange(e,3,!0,t)}_revealRange(e,t,i,n){if(!Rh.isIRange(e))throw new Error("Invalid arguments");this._sendRevealRange(Rh.lift(e),t,i,n)}setSelections(e,t="api",i=0){if(this._modelData){if(!e||0===e.length)throw new Error("Invalid arguments");for(let t=0,i=e.length;t0&&this._modelData.viewModel.restoreCursorState(e):this._modelData.viewModel.restoreCursorState([e]),this._contributions.restoreViewState(t.contributionsState||{});const i=this._modelData.viewModel.reduceRestoreState(t.viewState);this._modelData.view.restoreState(i)}}handleInitialized(){var e;null===(e=this._getViewModel())||void 0===e||e.visibleLinesStabilized()}getContribution(e){return this._contributions.get(e)}getActions(){return Array.from(this._actions.values())}getSupportedActions(){let e=this.getActions();return e=e.filter((e=>e.isSupported())),e}getAction(e){return this._actions.get(e)||null}trigger(e,t,i){switch(i=i||{},t){case"compositionStart":return void this._startComposition();case"compositionEnd":return void this._endComposition(e);case"type":{const t=i;return void this._type(e,t.text||"")}case"replacePreviousChar":{const t=i;return void this._compositionType(e,t.text||"",t.replaceCharCnt||0,0,0)}case"compositionType":{const t=i;return void this._compositionType(e,t.text||"",t.replacePrevCharCnt||0,t.replaceNextCharCnt||0,t.positionDelta||0)}case"paste":{const t=i;return void this._paste(e,t.text||"",t.pasteOnNewLine||!1,t.multicursorText||null,t.mode||null)}case"cut":return void this._cut(e)}const n=this.getAction(t);n?Promise.resolve(n.run(i)).then(void 0,r):this._modelData&&(this._triggerEditorCommand(e,t,i)||this._triggerCommand(t,i))}_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&&0!==t.length&&("keyboard"===e&&this._onWillType.fire(t),this._modelData.viewModel.type(t,e),"keyboard"===e&&this._onDidType.fire(t))}_compositionType(e,t,i,n,s){this._modelData&&this._modelData.viewModel.compositionType(t,i,n,s,e)}_paste(e,t,i,n,s){if(!this._modelData||0===t.length)return;const o=this._modelData.viewModel,r=o.getSelection().getStartPosition();o.paste(t,i,n,e);const a=o.getSelection().getStartPosition();"keyboard"===e&&this._onDidPaste.fire({range:new Rh(r.lineNumber,r.column,a.lineNumber,a.column),languageId:s})}_cut(e){this._modelData&&this._modelData.viewModel.cut(e)}_triggerEditorCommand(e,t,i){const n=xh.getEditorCommand(t);return!!n&&((i=i||{}).source=e,this._instantiationService.invokeFunction((e=>{Promise.resolve(n.runEditorCommand(e,this,i)).then(void 0,r)})),!0)}_getViewModel(){return this._modelData?this._modelData.viewModel:null}pushUndoStop(){return!!this._modelData&&(!this._configuration.options.get(90)&&(this._modelData.model.pushStackElement(),!0))}popUndoStop(){return!!this._modelData&&(!this._configuration.options.get(90)&&(this._modelData.model.popStackElement(),!0))}executeEdits(e,t,i){if(!this._modelData)return!1;if(this._configuration.options.get(90))return!1;let n;return n=i?Array.isArray(i)?()=>i:i:()=>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 rW(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,OS(this._configuration.options)):null}getDecorationsInRange(e){return this._modelData?this._modelData.model.getDecorationsInRange(e,this._id,OS(this._configuration.options)):null}deltaDecorations(e,t){return this._modelData?0===e.length&&0===t.length?e:this._modelData.model.deltaDecorations(e,t,this._id):[]}removeDecorations(e){this._modelData&&0!==e.length&&this._modelData.model.changeDecorations((t=>{t.deltaDecorations(e,[])}))}removeDecorationsByType(e){const t=this._decorationTypeKeysToIds[e];t&&this.deltaDecorations(t,[]),this._decorationTypeKeysToIds.hasOwnProperty(e)&&delete this._decorationTypeKeysToIds[e],this._decorationTypeSubtypes.hasOwnProperty(e)&&delete this._decorationTypeSubtypes[e]}getLayoutInfo(){return this._configuration.options.get(143)}createOverviewRuler(e){return this._modelData&&this._modelData.hasRealView?this._modelData.view.createOverviewRuler(e):null}getContainerDomNode(){return this._domElement}getDomNode(){return this._modelData&&this._modelData.hasRealView?this._modelData.view.domNode.domNode:null}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){this._configuration.observeContainer(e),this.render()}focus(){this._modelData&&this._modelData.hasRealView&&this._modelData.view.focus()}hasTextFocus(){return!(!this._modelData||!this._modelData.hasRealView)&&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."),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 e=this._contentWidgets[t];delete this._contentWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeContentWidget(e)}}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 e=this._overlayWidgets[t];delete this._overlayWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeOverlayWidget(e)}}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 e=this._glyphMarginWidgets[t];delete this._glyphMarginWidgets[t],this._modelData&&this._modelData.hasRealView&&this._modelData.view.removeGlyphMarginWidget(e)}}changeViewZones(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.change(e)}getTargetAtClientPoint(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getTargetAtClientPoint(e,t):null}getScrolledVisiblePosition(e){if(!this._modelData||!this._modelData.hasRealView)return null;const t=this._modelData.model.validatePosition(e),i=this._configuration.options,n=i.get(143);return{top:GB._getVerticalOffsetForPosition(this._modelData,t.lineNumber,t.column)-this.getScrollTop(),left:this._modelData.view.getOffsetForColumn(t.lineNumber,t.column)+n.glyphMarginWidth+n.lineNumbersWidth+n.decorationsWidth-this.getScrollLeft(),height:i.get(66)}}getOffsetForColumn(e,t){return this._modelData&&this._modelData.hasRealView?this._modelData.view.getOffsetForColumn(e,t):-1}render(e=!1){this._modelData&&this._modelData.hasRealView&&this._modelData.view.render(!0,e)}setAriaOptions(e){this._modelData&&this._modelData.hasRealView&&this._modelData.view.setAriaOptions(e)}applyFontInfo(e){Hk(e,this._configuration.options.get(50))}setBanner(e,t){this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),this._bannerDomNode=e,this._configuration.setReservedHeight(e?t:0),this._bannerDomNode&&this._domElement.prepend(this._bannerDomNode)}_attachModel(e){if(!e)return void(this._modelData=null);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 CB(this._id,this._configuration,e,zB.create(),MB.create(this._configuration.options),(e=>An(e)),this.languageConfigurationService,this._themeService,i);t.push(e.onWillDispose((()=>this.setModel(null)))),t.push(n.onEvent((t=>{switch(t.kind){case 0:this._onDidContentSizeChange.fire(t);break;case 1:this._editorTextFocus.setValue(t.hasFocus);break;case 2:this._onDidScrollChange.fire(t);break;case 3:this._onDidChangeViewZones.fire();break;case 4:this._onDidChangeHiddenAreas.fire();break;case 5:this._onDidAttemptReadOnlyEdit.fire();break;case 6:{if(t.reachedMaxCursorCount){const e=ue(0,"The number of cursors has been limited to {0}. Consider using [find and replace](https://code.visualstudio.com/docs/editor/codebasics#_find-and-replace) for larger changes or increase the editor multi cursor limit setting.",this.getOption(79));this._notificationService.prompt(pL.Warning,e,[{label:"Find and Replace",run:()=>{this._commandService.executeCommand("editor.action.startFindReplaceAction")}},{label:ue(0,"Increase Multi Cursor Limit"),run:()=>{this._commandService.executeCommand("workbench.action.openSettings2",{query:"editor.multiCursorLimit"})}}])}const e=[];for(let s=0,o=t.selections.length;s{this._paste("keyboard",e,t,i,n)},type:e=>{this._type("keyboard",e)},compositionType:(e,t,i,n)=>{this._compositionType("keyboard",e,t,i,n)},startComposition:()=>{this._startComposition()},endComposition:()=>{this._endComposition("keyboard")},cut:()=>{this._cut("keyboard")}}:{paste:(e,t,i,n)=>{const s={text:e,pasteOnNewLine:t,multicursorText:i,mode:n};this._commandService.executeCommand("paste",s)},type:e=>{const t={text:e};this._commandService.executeCommand("type",t)},compositionType:(e,t,i,n)=>{if(i||n){const s={text:e,replacePrevCharCnt:t,replaceNextCharCnt:i,positionDelta:n};this._commandService.executeCommand("compositionType",s)}else{const i={text:e,replaceCharCnt:t};this._commandService.executeCommand("replacePreviousChar",i)}},startComposition:()=>{this._commandService.executeCommand("compositionStart",{})},endComposition:()=>{this._commandService.executeCommand("compositionEnd",{})},cut:()=>{this._commandService.executeCommand("cut",{})}};const i=new LO(e.coordinatesConverter);i.onKeyDown=e=>this._onKeyDown.fire(e),i.onKeyUp=e=>this._onKeyUp.fire(e),i.onContextMenu=e=>this._onContextMenu.fire(e),i.onMouseMove=e=>this._onMouseMove.fire(e),i.onMouseLeave=e=>this._onMouseLeave.fire(e),i.onMouseDown=e=>this._onMouseDown.fire(e),i.onMouseUp=e=>this._onMouseUp.fire(e),i.onMouseDrag=e=>this._onMouseDrag.fire(e),i.onMouseDrop=e=>this._onMouseDrop.fire(e),i.onMouseDropCanceled=e=>this._onMouseDropCanceled.fire(e),i.onMouseWheel=e=>this._onMouseWheel.fire(e);return[new oF(t,this._configuration,this._themeService.getColorTheme(),e,i,this._overflowWidgetsDomNode,this._instantiationService),!0]}_postDetachModelCleanup(e){null==e||e.removeAllDecorationsWithOwnerId(this._id)}_detachModel(){if(!this._modelData)return null;const e=this._modelData.model,t=this._modelData.hasRealView?this._modelData.view.domNode.domNode:null;return this._modelData.dispose(),this._modelData=null,this._domElement.removeAttribute("data-mode-id"),t&&this._domElement.contains(t)&&this._domElement.removeChild(t),this._bannerDomNode&&this._domElement.contains(this._bannerDomNode)&&this._domElement.removeChild(this._bannerDomNode),e}_removeDecorationType(e){this._codeEditorService.removeDecorationType(e)}hasModel(){return null!==this._modelData}showDropIndicatorAt(e){const t=[{range:new Rh(e.lineNumber,e.column,e.lineNumber,e.column),options:GB.dropIntoEditorDecorationOptions}];this._dropIntoEditorDecorations.set(t),this.revealPosition(e,1)}removeDropIndicator(){this._dropIntoEditorDecorations.clear()}setContextValue(e,t){this._contextKeyService.createKey(e,t)}};eW.dropIntoEditorDecorationOptions=Iw.register({description:"workbench-dnd-target",className:"dnd-target"}),eW=GB=ZB([YB(3,Fa),YB(4,Wa),YB(5,Ya),YB(6,Ol),YB(7,P_),YB(8,mL),YB(9,QR),YB(10,Ju),YB(11,oL)],eW);class tW extends E{constructor(e){super(),this._emitterOptions=e,this._onDidChangeToTrue=this._register(new U(this._emitterOptions)),this.onDidChangeToTrue=this._onDidChangeToTrue.event,this._onDidChangeToFalse=this._register(new U(this._emitterOptions)),this.onDidChangeToFalse=this._onDidChangeToFalse.event,this._value=0}setValue(e){const t=e?2:1;this._value!==t&&(this._value=t,2===this._value?this._onDidChangeToTrue.fire():1===this._value&&this._onDidChangeToFalse.fire())}}class iW extends U{constructor(e,t){super({deliveryQueue:t}),this._contributions=e}fire(e){this._contributions.onBeforeInteractionEvent(),super.fire(e)}}class nW extends E{constructor(e,t){super(),this._editor=e,t.createKey("editorId",e.getId()),this._editorSimpleInput=Oh.editorSimpleInput.bindTo(t),this._editorFocus=Oh.focus.bindTo(t),this._textInputFocus=Oh.textInputFocus.bindTo(t),this._editorTextFocus=Oh.editorTextFocus.bindTo(t),this._tabMovesFocus=Oh.tabMovesFocus.bindTo(t),this._editorReadonly=Oh.readOnly.bindTo(t),this._inDiffEditor=Oh.inDiffEditor.bindTo(t),this._editorColumnSelection=Oh.columnSelection.bindTo(t),this._hasMultipleSelections=Oh.hasMultipleSelections.bindTo(t),this._hasNonEmptySelection=Oh.hasNonEmptySelection.bindTo(t),this._canUndo=Oh.canUndo.bindTo(t),this._canRedo=Oh.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(XR.onDidChangeTabFocus((e=>this._tabMovesFocus.set(e)))),this._updateFromConfig(),this._updateFromSelection(),this._updateFromFocus(),this._updateFromModel(),this._editorSimpleInput.set(this._editor.isSimpleWidget)}_updateFromConfig(){const e=this._editor.getOptions();this._tabMovesFocus.set(XR.getTabFocusMode()),this._editorReadonly.set(e.get(90)),this._inDiffEditor.set(e.get(61)),this._editorColumnSelection.set(e.get(22))}_updateFromSelection(){const e=this._editor.getSelections();e?(this._hasMultipleSelections.set(e.length>1),this._hasNonEmptySelection.set(e.some((e=>!e.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(Boolean(e&&e.canUndo())),this._canRedo.set(Boolean(e&&e.canRedo()))}}class sW extends E{constructor(e,t,i){super(),this._editor=e,this._contextKeyService=t,this._languageFeaturesService=i,this._langId=Oh.languageId.bindTo(t),this._hasCompletionItemProvider=Oh.hasCompletionItemProvider.bindTo(t),this._hasCodeActionsProvider=Oh.hasCodeActionsProvider.bindTo(t),this._hasCodeLensProvider=Oh.hasCodeLensProvider.bindTo(t),this._hasDefinitionProvider=Oh.hasDefinitionProvider.bindTo(t),this._hasDeclarationProvider=Oh.hasDeclarationProvider.bindTo(t),this._hasImplementationProvider=Oh.hasImplementationProvider.bindTo(t),this._hasTypeDefinitionProvider=Oh.hasTypeDefinitionProvider.bindTo(t),this._hasHoverProvider=Oh.hasHoverProvider.bindTo(t),this._hasDocumentHighlightProvider=Oh.hasDocumentHighlightProvider.bindTo(t),this._hasDocumentSymbolProvider=Oh.hasDocumentSymbolProvider.bindTo(t),this._hasReferenceProvider=Oh.hasReferenceProvider.bindTo(t),this._hasRenameProvider=Oh.hasRenameProvider.bindTo(t),this._hasSignatureHelpProvider=Oh.hasSignatureHelpProvider.bindTo(t),this._hasInlayHintsProvider=Oh.hasInlayHintsProvider.bindTo(t),this._hasDocumentFormattingProvider=Oh.hasDocumentFormattingProvider.bindTo(t),this._hasDocumentSelectionFormattingProvider=Oh.hasDocumentSelectionFormattingProvider.bindTo(t),this._hasMultipleDocumentFormattingProvider=Oh.hasMultipleDocumentFormattingProvider.bindTo(t),this._hasMultipleDocumentSelectionFormattingProvider=Oh.hasMultipleDocumentSelectionFormattingProvider.bindTo(t),this._isInWalkThrough=Oh.isInWalkThroughSnippet.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._isInWalkThrough.reset()}))}_update(){const e=this._editor.getModel();e?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._isInWalkThrough.set(e.uri.scheme===vn.walkThroughSnippet)})):this.reset()}}class oW extends E{constructor(e){super(),this._onChange=this._register(new U),this.onChange=this._onChange.event,this._hasFocus=!1,this._domFocusTracker=this._register(hs(e)),this._register(this._domFocusTracker.onDidFocus((()=>{this._hasFocus=!0,this._onChange.fire(void 0)}))),this._register(this._domFocusTracker.onDidBlur((()=>{this._hasFocus=!1,this._onChange.fire(void 0)})))}hasFocus(){return this._hasFocus}}class rW{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((i=>{this._isChangingDecorations||e.call(t,i)}),i)}getRange(e){return this._editor.hasModel()?e>=this._decorationIds.length?null:this._editor.getModel().getDecorationRange(this._decorationIds[e]):null}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(){0!==this._decorationIds.length&&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}}const aW=encodeURIComponent("");function hW(e){return aW+encodeURIComponent(e.toString())+lW}const dW=encodeURIComponent('');H_(((e,t)=>{const i=e.getColor(fm);i&&t.addRule(`.monaco-editor .squiggly-error { background: url("data:image/svg+xml,${hW(i)}") repeat-x bottom left; }`);const n=e.getColor(vm);n&&t.addRule(`.monaco-editor .squiggly-warning { background: url("data:image/svg+xml,${hW(n)}") repeat-x bottom left; }`);const s=e.getColor(Cm);s&&t.addRule(`.monaco-editor .squiggly-info { background: url("data:image/svg+xml,${hW(s)}") repeat-x bottom left; }`);const o=e.getColor(ym);o&&t.addRule(`.monaco-editor .squiggly-hint { background: url("data:image/svg+xml,${function(e){return dW+encodeURIComponent(e.toString())+cW}(o)}") no-repeat bottom left; }`);const r=e.getColor(gv);r&&t.addRule(`.monaco-editor.showUnused .squiggly-inline-unnecessary { opacity: ${r.rgba.a}; }`)}));var uW=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},gW=function(e,t){return function(i,n){t(i,n,e)}};let pW=class extends eW{constructor(e,t,i,n,s,o,r,a,l,h,d,c,u){super(e,Object.assign(Object.assign({},n.getRawOptions()),{overflowWidgetsDomNode:n.getOverflowWidgetsDomNode()}),i,s,o,r,a,l,h,d,c,u),this._parentEditor=n,this._overwriteOptions=t,super.updateOptions(this._overwriteOptions),this._register(n.onDidChangeConfiguration((e=>this._onParentConfigurationChanged(e))))}getParentEditor(){return this._parentEditor}_onParentConfigurationChanged(e){super.updateOptions(this._parentEditor.getRawOptions()),super.updateOptions(this._overwriteOptions)}updateOptions(e){_d(this._overwriteOptions,e,!0),super.updateOptions(this._overwriteOptions)}};pW=uW([gW(4,Fa),gW(5,Wa),gW(6,Ya),gW(7,Ol),gW(8,P_),gW(9,mL),gW(10,QR),gW(11,Ju),gW(12,oL)],pW);var mW=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};var fW;!function(e){e.North="north",e.South="south",e.East="east",e.West="west"}(fW||(fW={}));const _W=new U;const vW=new U;class bW{constructor(){this.disposables=new N}get onPointerMove(){return this.disposables.add(new Ky(window,"mousemove")).event}get onPointerUp(){return this.disposables.add(new Ky(window,"mouseup")).event}dispose(){this.disposables.dispose()}}mW([qL],bW.prototype,"onPointerMove",null),mW([qL],bW.prototype,"onPointerUp",null);class CW{get onPointerMove(){return this.disposables.add(new Ky(this.el,$L.Change)).event}get onPointerUp(){return this.disposables.add(new Ky(this.el,$L.End)).event}constructor(e){this.el=e,this.disposables=new N}dispose(){this.disposables.dispose()}}mW([qL],CW.prototype,"onPointerMove",null),mW([qL],CW.prototype,"onPointerUp",null);class wW{get onPointerMove(){return this.factory.onPointerMove}get onPointerUp(){return this.factory.onPointerUp}constructor(e){this.factory=e}dispose(){}}mW([qL],wW.prototype,"onPointerMove",null),mW([qL],wW.prototype,"onPointerUp",null);const yW="pointer-events-disabled";class SW extends E{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",0===e),this.el.classList.toggle("minimum",1===e),this.el.classList.toggle("maximum",2===e),this._state=e,this.onDidEnablementChange.fire(e))}set orthogonalStartSash(e){if(this._orthogonalStartSash!==e){if(this.orthogonalStartDragHandleDisposables.clear(),this.orthogonalStartSashDisposables.clear(),e){const t=t=>{this.orthogonalStartDragHandleDisposables.clear(),0!==t&&(this._orthogonalStartDragHandle=ds(this.el,fs(".orthogonal-drag-handle.start")),this.orthogonalStartDragHandleDisposables.add(x((()=>this._orthogonalStartDragHandle.remove()))),this.orthogonalStartDragHandleDisposables.add(new Ky(this._orthogonalStartDragHandle,"mouseenter")).event((()=>SW.onMouseEnter(e)),void 0,this.orthogonalStartDragHandleDisposables),this.orthogonalStartDragHandleDisposables.add(new Ky(this._orthogonalStartDragHandle,"mouseleave")).event((()=>SW.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=t=>{this.orthogonalEndDragHandleDisposables.clear(),0!==t&&(this._orthogonalEndDragHandle=ds(this.el,fs(".orthogonal-drag-handle.end")),this.orthogonalEndDragHandleDisposables.add(x((()=>this._orthogonalEndDragHandle.remove()))),this.orthogonalEndDragHandleDisposables.add(new Ky(this._orthogonalEndDragHandle,"mouseenter")).event((()=>SW.onMouseEnter(e)),void 0,this.orthogonalEndDragHandleDisposables),this.orthogonalEndDragHandleDisposables.add(new Ky(this._orthogonalEndDragHandle,"mouseleave")).event((()=>SW.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=300,this.hoverDelayer=this._register(new Jh(this.hoverDelay)),this._state=3,this.onDidEnablementChange=this._register(new U),this._onDidStart=this._register(new U),this._onDidChange=this._register(new U),this._onDidReset=this._register(new U),this._onDidEnd=this._register(new U),this.orthogonalStartSashDisposables=this._register(new N),this.orthogonalStartDragHandleDisposables=this._register(new N),this.orthogonalEndSashDisposables=this._register(new N),this.orthogonalEndDragHandleDisposables=this._register(new N),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=ds(e,fs(".monaco-sash")),i.orthogonalEdge&&this.el.classList.add(`orthogonal-edge-${i.orthogonalEdge}`),Pe&&this.el.classList.add("mac");const n=this._register(new Ky(this.el,"mousedown")).event;this._register(n((e=>this.onPointerStart(e,new bW)),this));const s=this._register(new Ky(this.el,"dblclick")).event;this._register(s(this.onPointerDoublePress,this));const o=this._register(new Ky(this.el,"mouseenter")).event;this._register(o((()=>SW.onMouseEnter(this))));const r=this._register(new Ky(this.el,"mouseleave")).event;this._register(r((()=>SW.onMouseLeave(this)))),this._register(ZL.addTarget(this.el));const a=this._register(new Ky(this.el,$L.Start)).event;this._register(a((e=>this.onPointerStart(e,new CW(this.el))),this));const l=this._register(new Ky(this.el,$L.Tap)).event;let h;this._register(l((e=>{if(h)return clearTimeout(h),h=void 0,void this.onPointerDoublePress(e);clearTimeout(h),h=setTimeout((()=>h=void 0),250)}),this)),"number"==typeof i.size?(this.size=i.size,0===i.orientation?this.el.style.width=`${this.size}px`:this.el.style.height=`${this.size}px`):(this.size=4,this._register(_W.event((e=>{this.size=e,this.layout()})))),this._register(vW.event((e=>this.hoverDelay=e))),this.layoutProvider=t,this.orthogonalStartSash=i.orthogonalStartSash,this.orthogonalEndSash=i.orthogonalEndSash,this.orientation=i.orientation||0,1===this.orientation?(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",false),this.layout()}onPointerStart(e,t){as(e);let i=!1;if(!e.__orthogonalSashEvent){const n=this.getOrthogonalSash(e);n&&(i=!0,e.__orthogonalSashEvent=!0,n.onPointerStart(e,new wW(t)))}if(this.linkedSash&&!e.__linkedSashEvent&&(e.__linkedSashEvent=!0,this.linkedSash.onPointerStart(e,new wW(t))),!this.state)return;const n=document.getElementsByTagName("iframe");for(const c of n)c.classList.add(yW);const s=e.pageX,o=e.pageY,r=e.altKey,a={startX:s,currentX:s,startY:o,currentY:o,altKey:r};this.el.classList.add("active"),this._onDidStart.fire(a);const l=Jn(this.el),h=()=>{let e="";e=i?"all-scroll":1===this.orientation?1===this.state?"s-resize":2===this.state?"n-resize":Pe?"row-resize":"ns-resize":1===this.state?"e-resize":2===this.state?"w-resize":Pe?"col-resize":"ew-resize",l.textContent=`* { cursor: ${e} !important; }`},d=new N;h(),i||this.onDidEnablementChange.event(h,null,d);t.onPointerMove((e=>{as(e,!1);const t={startX:s,currentX:e.pageX,startY:o,currentY:e.pageY,altKey:r};this._onDidChange.fire(t)}),null,d),t.onPointerUp((e=>{as(e,!1),this.el.removeChild(l),this.el.classList.remove("active"),this._onDidEnd.fire(),d.dispose();for(const t of n)t.classList.remove(yW)}),null,d),d.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&&SW.onMouseEnter(e.linkedSash,!0)}static onMouseLeave(e,t=!1){e.hoverDelayer.cancel(),e.el.classList.remove("hover"),!t&&e.linkedSash&&SW.onMouseLeave(e.linkedSash,!0)}clearSashHoverState(){SW.onMouseLeave(this)}layout(){if(0===this.orientation){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){var t;const i=null!==(t=e.initialTarget)&&void 0!==t?t:e.target;if(i&&i instanceof HTMLElement)return i.classList.contains("orthogonal-drag-handle")?i.classList.contains("start")?this.orthogonalStartSash:this.orthogonalEndSash:void 0}dispose(){super.dispose(),this.el.remove()}}const LW=new lc(new oc(0,122,204)),kW={showArrow:!0,showFrame:!0,className:"",frameColor:LW,arrowColor:LW,keepEditorSelection:!1};class DW{constructor(e,t,i,n,s,o,r,a){this.id="",this.domNode=e,this.afterLineNumber=t,this.afterColumn=i,this.heightInLines=n,this.showInHiddenAreas=r,this.ordinal=a,this._onDomNodeTop=s,this._onComputedHeight=o}onDomNodeTop(e){this._onDomNodeTop(e)}onComputedHeight(e){this._onComputedHeight(e)}}class xW{constructor(e,t){this._id=e,this._domNode=t}getId(){return this._id}getDomNode(){return this._domNode}getPosition(){return null}}class NW{constructor(e){this._editor=e,this._ruleName=NW._IdGenerator.nextId(),this._decorations=this._editor.createDecorationsCollection(),this._color=null,this._height=-1}dispose(){this.hide(),ns(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(){ns(this._ruleName),is(`.monaco-editor ${this._ruleName}`,`border-style: solid; border-color: transparent; border-bottom-color: ${this._color}; border-width: ${this._height}px; bottom: -${this._height}px; margin-left: -${this._height}px; `)}show(e){1===e.column&&(e={lineNumber:e.lineNumber,column:2}),this._decorations.set([{range:Rh.fromPositions(e),options:{description:"zone-widget-arrow",className:this._ruleName,stickiness:1}}])}hide(){this._decorations.clear()}}NW._IdGenerator=new dk(".arrow-decoration-");class EW{constructor(e,t={}){this._arrow=null,this._overlayWidget=null,this._resizeSash=null,this._viewZone=null,this._disposables=new N,this.container=null,this._isShowing=!1,this.editor=e,this._positionMarkerId=this.editor.createDecorationsCollection(),this.options=gd(t),_d(this.options,kW,!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((e=>{const t=this._getWidth(e);this.domNode.style.width=t+"px",this.domNode.style.left=this._getLeft(e)+"px",this._onWidth(t)})))}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 NW(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&&0===e.minimap.minimapLeft?e.minimap.minimapWidth:0}_onViewZoneTop(e){this.domNode.style.top=e+"px"}_onViewZoneHeight(e){var t;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))}null===(t=this._resizeSash)||void 0===t||t.layout()}get position(){const e=this._positionMarkerId.getRange(0);if(e)return e.getStartPosition()}show(e,t){const i=Rh.isIRange(e)?Rh.lift(e):Rh.fromPositions(e);this._isShowing=!0,this._showImpl(i,t),this._isShowing=!1,this._positionMarkerId.set([{range:i,options:Iw.EMPTY}])}hide(){var e;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),null===(e=this._arrow)||void 0===e||e.hide(),this._positionMarkerId.clear()}_decoratingElementsHeight(){const e=this.editor.getOption(66);let t=0;if(this.options.showArrow){t+=2*Math.round(e/3)}if(this.options.showFrame){t+=2*Math.round(e/9)}return t}_showImpl(e,t){const i=e.getStartPosition(),n=this.editor.getLayoutInfo(),s=this._getWidth(n);this.domNode.style.width=`${s}px`,this.domNode.style.left=this._getLeft(n)+"px";const o=document.createElement("div");o.style.overflow="hidden";const r=this.editor.getOption(66);if(!this.options.allowUnlimitedHeight){const e=Math.max(12,this.editor.getLayoutInfo().height/r*.8);t=Math.min(t,e)}let a=0,l=0;if(this._arrow&&this.options.showArrow&&(a=Math.round(r/3),this._arrow.height=a,this._arrow.show(i)),this.options.showFrame&&(l=Math.round(r/9)),this.editor.changeViewZones((e=>{this._viewZone&&e.removeZone(this._viewZone.id),this._overlayWidget&&(this.editor.removeOverlayWidget(this._overlayWidget),this._overlayWidget=null),this.domNode.style.top="-1000px",this._viewZone=new DW(o,i.lineNumber,i.column,t,(e=>this._onViewZoneTop(e)),(e=>this._onViewZoneHeight(e)),this.options.showInHiddenAreas,this.options.ordinal),this._viewZone.id=e.addZone(this._viewZone),this._overlayWidget=new xW("vs.editor.contrib.zoneWidget"+this._viewZone.id,this.domNode),this.editor.addOverlayWidget(this._overlayWidget)})),this.container&&this.options.showFrame){const e=this.options.frameWidth?this.options.frameWidth:l;this.container.style.borderTopWidth=e+"px",this.container.style.borderBottomWidth=e+"px"}const h=t*r-this._decoratingElementsHeight();this.container&&(this.container.style.top=a+"px",this.container.style.height=h+"px",this.container.style.overflow="hidden"),this._doLayout(h,s),this.options.keepEditorSelection||this.editor.setSelection(e);const d=this.editor.getModel();if(d){const t=d.validateRange(new Rh(e.startLineNumber,1,e.endLineNumber+1,1));this.revealRange(t,t.startLineNumber===d.getLineCount())}}revealRange(e,t){t?this.editor.revealLineNearTop(e.endLineNumber,0):this.editor.revealRange(e,0)}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;let e;this._resizeSash=this._disposables.add(new SW(this.domNode,this,{orientation:1})),this.options.isResizeable||(this._resizeSash.state=0),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(66),n=i<0?Math.ceil(i):Math.floor(i),s=e.heightInLines+n;s>5&&s<35&&this._relayout(s)}})))}getHorizontalSashLeft(){return 0}getHorizontalSashTop(){return(null===this.domNode.style.height?0:parseInt(this.domNode.style.height))-this._decoratingElementsHeight()/2}getHorizontalSashWidth(){const e=this.editor.getLayoutInfo();return e.width-e.minimap.minimapWidth}}class IW extends ja{constructor(e,t){super(),this._onDidChangeVisibility=this._register(new U),this.onDidChangeVisibility=this._onDidChangeVisibility.event,this._element=ds(e,fs(".monaco-dropdown")),this._label=ds(this._element,fs(".dropdown-label"));let i=t.labelRenderer;i||(i=e=>(e.textContent=t.label||"",null));for(const s of[os.CLICK,os.MOUSE_DOWN,$L.Tap])this._register(En(this.element,s,(e=>as(e,!0))));for(const s of[os.MOUSE_DOWN,$L.Tap])this._register(En(this._label,s,(e=>{e instanceof MouseEvent&&(e.detail>1||0!==e.button)||(this.visible?this.hide():this.show())})));this._register(En(this._label,os.KEY_UP,(e=>{const t=new St(e);(t.equals(3)||t.equals(10))&&(as(e,!0),this.visible?this.hide():this.show())})));const n=i(this._label);n&&this._register(n),this._register(ZL.addTarget(this._label))}get element(){return this._element}show(){this.visible||(this.visible=!0,this._onDidChangeVisibility.fire(!0))}hide(){this.visible&&(this.visible=!1,this._onDidChangeVisibility.fire(!1))}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 MW extends IW{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:0,domForShadowRoot:this._options.menuAsChild?this.element:void 0,skipTelemetry:this._options.skipTelemetry})}hide(){super.hide()}onHide(){this.hide(),this.element.classList.remove("active")}}class TW extends Ex{constructor(e,t,i,n=Object.create(null)){super(null,e,n),this.actionItem=null,this._onDidChangeVisibility=this._register(new U),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=Array.isArray(this.menuActionsOrProvider),i={contextMenuProvider:this.contextMenuProvider,labelRenderer:e=>{this.element=ds(e,fs("a.action-label"));let t=[];return"string"==typeof this.options.classNames?t=this.options.classNames.split(/\s+/g).filter((e=>!!e)):this.options.classNames&&(t=this.options.classNames),t.find((e=>"icon"===e))||t.push("codicon"),this.element.classList.add(...t),this.element.setAttribute("role","button"),this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this.element.title=this._action.label||"",this.element.ariaLabel=this._action.label||"",null},menuAsChild:this.options.menuAsChild,actions:t?this.menuActionsOrProvider:void 0,actionProvider:t?void 0:this.menuActionsOrProvider,skipTelemetry:this.options.skipTelemetry};if(this.dropdownMenu=this._register(new MW(e,i)),this._register(this.dropdownMenu.onDidChangeVisibility((e=>{var t;null===(t=this.element)||void 0===t||t.setAttribute("aria-expanded",`${e}`),this._onDidChangeVisibility.fire(e)}))),this.dropdownMenu.menuOptions={actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,getKeyBinding:this.options.keybindingProvider,context:this._context},this.options.anchorAlignmentProvider){const e=this;this.dropdownMenu.menuOptions=Object.assign(Object.assign({},this.dropdownMenu.menuOptions),{get anchorAlignment(){return e.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),null!=e?e:void 0}setActionContext(e){super.setActionContext(e),this.dropdownMenu&&(this.dropdownMenu.menuOptions?this.dropdownMenu.menuOptions.context=e:this.dropdownMenu.menuOptions={context:e})}show(){var e;null===(e=this.dropdownMenu)||void 0===e||e.show()}updateEnabled(){var e,t;const i=!this.action.enabled;null===(e=this.actionItem)||void 0===e||e.classList.toggle("disabled",i),null===(t=this.element)||void 0===t||t.classList.toggle("disabled",i)}}var RW=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},AW=function(e,t){return function(i,n){t(i,n,e)}},OW=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function PW(e,t,i,n,s,o){FW(e.getActions(t),i,!1,"string"==typeof n?e=>e===n:n,s,o)}function FW(e,t,i,n=e=>"navigation"===e,s=()=>!1,o=!1){let r,a;Array.isArray(t)?(r=t,a=t):(r=t.primary,a=t.secondary);const l=new Set;for(const[h,d]of e){let e;n(h)?(e=r,e.length>0&&o&&e.push(new qa)):(e=a,e.length>0&&e.push(new qa));for(let t of d){i&&(t=t instanceof oh&&t.alt?t.alt:t);const n=e.push(t);t instanceof $a&&l.add({group:h,action:t,index:n-1})}}for(const{group:h,action:d,index:c}of l){const e=n(h)?r:a,t=d.actions;s(d,h,e.length)&&e.splice(c,1,...t)}}let BW=class extends Ix{constructor(e,t,i,n,s,o,r,a){super(void 0,e,{icon:!(!e.class&&!e.item.icon),label:!e.class&&!e.item.icon,draggable:null==t?void 0:t.draggable,keybinding:null==t?void 0:t.keybinding,hoverDelegate:null==t?void 0:t.hoverDelegate}),this._keybindingService=i,this._notificationService=n,this._contextKeyService=s,this._themeService=o,this._contextMenuService=r,this._accessibilityService=a,this._wantsAltCommand=!1,this._itemClassDispose=this._register(new I),this._altKey=ks.getInstance()}get _menuItemAction(){return this._action}get _commandAction(){return this._wantsAltCommand&&this._menuItemAction.alt||this._menuItemAction}onClick(e){return OW(this,void 0,void 0,(function*(){e.preventDefault(),e.stopPropagation();try{yield 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=()=>{var e;const i=!!(null===(e=this._menuItemAction.alt)||void 0===e?void 0:e.enabled)&&(!this._accessibilityService.isMotionReduced()||t)&&(this._altKey.keyStatus.altKey||this._altKey.keyStatus.shiftKey&&t);i!==this._wantsAltCommand&&(this._wantsAltCommand=i,this.updateLabel(),this.updateTooltip(),this.updateClass())};this._register(this._altKey.event(i)),this._register(En(e,"mouseleave",(e=>{t=!1,i()}))),this._register(En(e,"mouseenter",(e=>{t=!0,i()}))),i()}}updateLabel(){this.options.label&&this.label&&(this.label.textContent=this._commandAction.label)}getTooltip(){var e;const t=this._keybindingService.lookupKeybinding(this._commandAction.id,this._contextKeyService),i=t&&t.getLabel(),n=this._commandAction.tooltip||this._commandAction.label;let s=i?ue(0,"{0} ({1})",n,i):n;if(!this._wantsAltCommand&&(null===(e=this._menuItemAction.alt)||void 0===e?void 0:e.enabled)){const e=this._menuItemAction.alt.tooltip||this._menuItemAction.alt.label,t=this._keybindingService.lookupKeybinding(this._menuItemAction.alt.id,this._contextKeyService),i=t&&t.getLabel(),n=i?ue(0,"{0} ({1})",e,i):e;s=ue(0,"{0}\n[{1}] {2}",s,Ox.modifierLabels[$e].altKey,n)}return s}updateClass(){this.options.icon&&(this._commandAction!==this._menuItemAction?this._menuItemAction.alt&&this._updateItemClass(this._menuItemAction.alt.item):this._updateItemClass(this._menuItemAction.item))}_updateItemClass(e){this._itemClassDispose.value=void 0;const{element:t,label:i}=this;if(!t||!i)return;const n=this._commandAction.checked&&((s=e.toggled)&&void 0!==s.condition)&&e.toggled.icon?e.toggled.icon:e.icon;var s;if(n)if(ta.isThemeIcon(n)){const e=ta.asClassNameArray(n);i.classList.add(...e),this._itemClassDispose.value=x((()=>{i.classList.remove(...e)}))}else{const e=O_(this._themeService.getColorTheme().type)?ws(n.dark):ws(n.light),t=fs("span");t.style.webkitMask=t.style.mask=`${e} no-repeat 50% 50%`,t.style.background="var(--vscode-icon-foreground)",t.style.display="inline-block",t.style.width="100%",t.style.height="100%",i.appendChild(t),i.classList.add("icon"),this._itemClassDispose.value=D(x((()=>{i.classList.remove("icon"),us(i)})),this._themeService.onDidColorThemeChange((()=>{this.updateClass()})))}}};BW=RW([AW(2,WL),AW(3,mL),AW(4,Ol),AW(5,P_),AW(6,Kx),AW(7,QR)],BW);let WW=class extends TW{constructor(e,t,i,n,s){var o,r,a;const l=Object.assign(Object.assign({},t),{menuAsChild:null!==(o=null==t?void 0:t.menuAsChild)&&void 0!==o&&o,classNames:null!==(r=null==t?void 0:t.classNames)&&void 0!==r?r:ta.isThemeIcon(e.item.icon)?ta.asClassName(e.item.icon):void 0,keybindingProvider:null!==(a=null==t?void 0:t.keybindingProvider)&&void 0!==a?a:e=>i.lookupKeybinding(e.id)});super(e,{getActions:()=>e.actions},n,l),this._keybindingService=i,this._contextMenuService=n,this._themeService=s}render(e){super.render(e),qr(this.element),e.classList.add("menu-entry");const t=this._action,{icon:i}=t.item;if(i&&!ta.isThemeIcon(i)){this.element.classList.add("icon");const e=()=>{this.element&&(this.element.style.backgroundImage=O_(this._themeService.getColorTheme().type)?ws(i.dark):ws(i.light))};e(),this._register(this._themeService.onDidColorThemeChange((()=>{e()})))}}};WW=RW([AW(2,WL),AW(3,Kx),AW(4,P_)],WW);let VW=class extends Ex{constructor(e,t,i,n,s,o,r,a){var l,h,d;let c;super(null,e),this._keybindingService=i,this._notificationService=n,this._contextMenuService=s,this._menuService=o,this._instaService=r,this._storageService=a,this._container=null,this._options=t,this._storageKey=`${e.item.submenu.id}_lastActionId`;const u=(null==t?void 0:t.persistLastActionId)?a.get(this._storageKey,1):void 0;u&&(c=e.actions.find((e=>u===e.id))),c||(c=e.actions[0]),this._defaultAction=this._instaService.createInstance(BW,c,{keybinding:this._getDefaultActionKeybindingLabel(c)});const g=Object.assign(Object.assign({keybindingProvider:e=>this._keybindingService.lookupKeybinding(e.id)},t),{menuAsChild:null===(l=null==t?void 0:t.menuAsChild)||void 0===l||l,classNames:null!==(h=null==t?void 0:t.classNames)&&void 0!==h?h:["codicon","codicon-chevron-down"],actionRunner:null!==(d=null==t?void 0:t.actionRunner)&&void 0!==d?d:new ja});this._dropdown=new TW(e,e.actions,this._contextMenuService,g),this._dropdown.actionRunner.onDidRun((e=>{e.action instanceof oh&&this.update(e.action)}))}update(e){var t;(null===(t=this._options)||void 0===t?void 0:t.persistLastActionId)&&this._storageService.store(this._storageKey,e.id,1,1),this._defaultAction.dispose(),this._defaultAction=this._instaService.createInstance(BW,e,{keybinding:this._getDefaultActionKeybindingLabel(e)}),this._defaultAction.actionRunner=new class extends ja{runAction(e,t){return OW(this,void 0,void 0,(function*(){yield e.run(void 0)}))}},this._container&&this._defaultAction.render(cs(this._container,fs(".action-container")))}_getDefaultActionKeybindingLabel(e){var t;let i;if(null===(t=this._options)||void 0===t?void 0:t.renderKeybindingWithDefaultActionLabel){const t=this._keybindingService.lookupKeybinding(e.id);t&&(i=`(${t.getLabel()})`)}return i}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=fs(".action-container");this._defaultAction.render(ds(this._container,t)),this._register(En(t,os.KEY_DOWN,(e=>{const t=new St(e);t.equals(17)&&(this._defaultAction.element.tabIndex=-1,this._dropdown.focus(),t.stopPropagation())})));const i=fs(".dropdown-action-container");this._dropdown.render(ds(this._container,i)),this._register(En(i,os.KEY_DOWN,(e=>{var t;const i=new St(e);i.equals(15)&&(this._defaultAction.element.tabIndex=0,this._dropdown.setFocusable(!1),null===(t=this._defaultAction.element)||void 0===t||t.focus(),i.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()}};VW=RW([AW(2,WL),AW(3,mL),AW(4,Kx),AW(5,th),AW(6,Fa),AW(7,ZN)],VW);let HW=class extends Mx{constructor(e,t){super(null,e,e.actions.map((e=>({text:e.id===qa.ID?"\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500":e.label,isDisabled:!e.enabled}))),0,t,eN,{ariaLabel:e.tooltip,optionsAsChildren:!0}),this.select(Math.max(0,e.actions.findIndex((e=>e.checked))))}render(e){super.render(e),e.style.borderColor=Sp(em)}runAction(e,t){const i=this.action.actions[t];i&&this.actionRunner.run(i)}};function zW(e,t,i){return t instanceof oh?e.createInstance(BW,t,i):t instanceof sh?t.item.isSelection?e.createInstance(HW,t):t.item.rememberDefaultAction?e.createInstance(VW,t,Object.assign(Object.assign({},i),{persistLastActionId:!0})):e.createInstance(WW,t,i):void 0}HW=RW([AW(1,Ux)],HW);var UW=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},KW=function(e,t){return function(i,n){t(i,n,e)}};const jW=Ba("IPeekViewService");var qW;yu(jW,class{constructor(){this._widgets=new Map}addExclusiveWidget(e,t){const i=this._widgets.get(e);i&&(i.listener.dispose(),i.widget.dispose());this._widgets.set(e,{widget:t,listener:t.onDidClose((()=>{const i=this._widgets.get(e);i&&i.widget===t&&(i.listener.dispose(),this._widgets.delete(e))}))})}},1),function(e){e.inPeekEditor=new Al("inReferenceSearchEditor",!0,ue(0,"Whether the current code editor is embedded inside peek")),e.notInPeekEditor=e.inPeekEditor.toNegated()}(qW||(qW={}));let $W=class{constructor(e,t){e instanceof pW&&qW.inPeekEditor.bindTo(t)}dispose(){}};$W.ID="editor.contrib.referenceController",$W=UW([KW(1,Ol)],$W),Dh($W.ID,$W,0);const GW={headerBackgroundColor:lc.white,primaryHeadingColor:lc.fromHex("#333333"),secondaryHeadingColor:lc.fromHex("#6c6c6cb3")};let ZW=class extends EW{constructor(e,t,i){super(e,t),this.instantiationService=i,this._onDidClose=new U,this.onDidClose=this._onDidClose.event,_d(this.options,GW,!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=fs(".head"),this._bodyElement=fs(".body"),this._fillHead(this._headElement),this._fillBody(this._bodyElement),e.appendChild(this._headElement),e.appendChild(this._bodyElement)}_fillHead(e,t){this._titleElement=fs(".peekview-title"),this.options.supportOnTitleClick&&(this._titleElement.classList.add("clickable"),Mn(this._titleElement,"click",(e=>this._onTitleClick(e)))),ds(this._headElement,this._titleElement),this._fillTitleIcon(this._titleElement),this._primaryHeading=fs("span.filename"),this._secondaryHeading=fs("span.dirname"),this._metaHeading=fs("span.meta"),ds(this._titleElement,this._primaryHeading,this._secondaryHeading,this._metaHeading);const i=fs(".peekview-actions");ds(this._headElement,i);const n=this._getActionBarOptions();this._actionbarWidget=new Rx(i,n),this._disposables.add(this._actionbarWidget),t||this._actionbarWidget.push(new Ka("peekview.close",ue(0,"Close"),ta.asClassName(Jr.close),!0,(()=>(this.dispose(),Promise.resolve()))),{label:!1,icon:!0})}_fillTitleIcon(e){}_getActionBarOptions(){return{actionViewItemProvider:zW.bind(void 0,this.instantiationService),orientation:0}}_onTitleClick(e){}setTitle(e,t){this._primaryHeading&&this._secondaryHeading&&(this._primaryHeading.innerText=e,this._primaryHeading.setAttribute("title",e),t?this._secondaryHeading.innerText=t:Dn(this._secondaryHeading))}setMetaTitle(e){this._metaHeading&&(e?(this._metaHeading.innerText=e,_s(this._metaHeading)):vs(this._metaHeading))}_doLayout(e,t){if(!this._isShowing&&e<0)return void this.dispose();const i=Math.ceil(1.2*this.editor.getOption(66)),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`)}};ZW=UW([KW(2,Fa)],ZW);const YW=Dp("peekViewTitle.background",{dark:"#252526",light:"#F3F3F3",hcDark:lc.black,hcLight:lc.white},ue(0,"Background color of the peek view title area.")),XW=Dp("peekViewTitleLabel.foreground",{dark:lc.white,light:lc.black,hcDark:lc.white,hcLight:Lm},ue(0,"Color of the peek view title.")),QW=Dp("peekViewTitleDescription.foreground",{dark:"#ccccccb3",light:"#616161",hcDark:"#FFFFFF99",hcLight:"#292929"},ue(0,"Color of the peek view title info.")),JW=Dp("peekView.border",{dark:Cm,light:Cm,hcDark:Mp,hcLight:Mp},ue(0,"Color of the peek view borders and arrow.")),eV=Dp("peekViewResult.background",{dark:"#252526",light:"#F3F3F3",hcDark:lc.black,hcLight:lc.white},ue(0,"Background color of the peek view result list.")),tV=(Dp("peekViewResult.lineForeground",{dark:"#bbbbbb",light:"#646465",hcDark:lc.white,hcLight:Lm},ue(0,"Foreground color for line nodes in the peek view result list.")),Dp("peekViewResult.fileForeground",{dark:lc.white,light:"#1E1E1E",hcDark:lc.white,hcLight:Lm},ue(0,"Foreground color for file nodes in the peek view result list.")),Dp("peekViewResult.selectionBackground",{dark:"#3399ff33",light:"#3399ff33",hcDark:null,hcLight:null},ue(0,"Background color of the selected entry in the peek view result list.")),Dp("peekViewResult.selectionForeground",{dark:lc.white,light:"#6C6C6C",hcDark:lc.white,hcLight:Lm},ue(0,"Foreground color of the selected entry in the peek view result list.")),Dp("peekViewEditor.background",{dark:"#001F33",light:"#F2F8FC",hcDark:lc.black,hcLight:lc.white},ue(0,"Background color of the peek view editor.")));Dp("peekViewEditorGutter.background",{dark:tV,light:tV,hcDark:tV,hcLight:tV},ue(0,"Background color of the gutter in the peek view editor.")),Dp("peekViewEditorStickyScroll.background",{dark:tV,light:tV,hcDark:tV,hcLight:tV},ue(0,"Background color of sticky scroll in the peek view editor.")),Dp("peekViewResult.matchHighlightBackground",{dark:"#ea5c004d",light:"#ea5c004d",hcDark:null,hcLight:null},ue(0,"Match highlight color in the peek view result list.")),Dp("peekViewEditor.matchHighlightBackground",{dark:"#ff8f0099",light:"#f5d802de",hcDark:null,hcLight:null},ue(0,"Match highlight color in the peek view editor.")),Dp("peekViewEditor.matchHighlightBorder",{dark:null,light:null,hcDark:Tp,hcLight:Tp},ue(0,"Match highlight border in the peek view editor."));function iV(e){return!(!e||"function"!=typeof e.getEditorType)&&e.getEditorType()===aF.ICodeEditor}function nV(e){return!(!e||"function"!=typeof e.getEditorType)&&e.getEditorType()===aF.IDiffEditor}function sV(e){return iV(e)?e:nV(e)?e.getModifiedEditor():function(e){return!!e&&"object"==typeof e&&"function"==typeof e.onDidChangeActiveEditor}(e)&&iV(e.activeCodeEditor)?e.activeCodeEditor:null}class oV{get templateId(){return this.renderer.templateId}constructor(e,t){this.renderer=e,this.modelProvider=t}renderTemplate(e){return{data:this.renderer.renderTemplate(e),disposable:E.None}}renderElement(e,t,i,n){var s;if(null===(s=i.disposable)||void 0===s||s.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 jh,a=o.resolve(e,r.token);i.disposable={dispose:()=>r.cancel()},this.renderer.renderPlaceholder(e,i.data),a.then((t=>this.renderer.renderElement(t,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 rV{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}}class aV{constructor(e,t,i,n,s={}){const o=()=>this.model,r=n.map((e=>new oV(e,o)));this.list=new yx(e,t,i,r,function(e,t){return Object.assign(Object.assign({},t),{accessibilityProvider:t.accessibilityProvider&&new rV(e,t.accessibilityProvider)})}(o,s))}updateOptions(e){this.list.updateOptions(e)}getHTMLElement(){return this.list.getHTMLElement()}get onDidFocus(){return this.list.onDidFocus}get widget(){return this.list}get onDidDispose(){return this.list.onDidDispose}get onMouseDblClick(){return B.map(this.list.onMouseDblClick,(({element:e,index:t,browserEvent:i})=>({element:void 0===e?void 0:this._model.get(e),index:t,browserEvent:i})))}get onPointer(){return B.map(this.list.onPointer,(({element:e,index:t,browserEvent:i})=>({element:void 0===e?void 0:this._model.get(e),index:t,browserEvent:i})))}get onDidChangeSelection(){return B.map(this.list.onDidChangeSelection,(({elements:e,indexes:t,browserEvent:i})=>({elements:e.map((e=>this._model.get(e))),indexes:t,browserEvent:i})))}get model(){return this._model}set model(e){this._model=e,this.list.splice(0,this.list.length,Kd(e.length))}getFocus(){return this.list.getFocus()}getSelection(){return this.list.getSelection()}getSelectedElements(){return this.getSelection().map((e=>this.model.get(e)))}style(e){this.list.style(e)}dispose(){this.list.dispose()}}const lV={separatorBorder:lc.transparent};class hV{set size(e){this._size=e}get size(){return this._size}get visible(){return void 0===this._cachedVisibleSize}setVisible(e,t){var i,n;e!==this.visible&&(e?(this.size=uD(this._cachedVisibleSize,this.viewMinimumSize,this.viewMaximumSize),this._cachedVisibleSize=void 0):(this._cachedVisibleSize="number"==typeof t?t:this.size,this.size=0),this.container.classList.toggle("visible",e),null===(n=(i=this.view).setVisible)||void 0===n||n.call(i,e))}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(){var e;return null===(e=this.view.proportionalLayout)||void 0===e||e}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,"number"==typeof i?(this._size=i,this._cachedVisibleSize=void 0,e.classList.add("visible")):(this._size=0,this._cachedVisibleSize=i.cachedVisibleSize)}layout(e,t){this.layoutContainer(e),this.view.layout(this.size,e,t)}dispose(){this.disposable.dispose()}}class dV extends hV{layoutContainer(e){this.container.style.top=`${e}px`,this.container.style.height=`${this.size}px`}}class cV extends hV{layoutContainer(e){this.container.style.left=`${e}px`,this.container.style.width=`${this.size}px`}}var uV,gV;!function(e){e[e.Idle=0]="Idle",e[e.Busy=1]="Busy"}(uV||(uV={})),function(e){e.Distribute={type:"distribute"},e.Split=function(e){return{type:"split",index:e}},e.Auto=function(e){return{type:"auto",index:e}},e.Invisible=function(e){return{type:"invisible",cachedVisibleSize:e}}}(gV||(gV={}));class pV extends E{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}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={}){var i,n,s,o,r;super(),this.size=0,this.contentSize=0,this.proportions=void 0,this.viewItems=[],this.sashItems=[],this.state=uV.Idle,this._onDidSashChange=this._register(new U),this._onDidSashReset=this._register(new U),this._startSnappingEnabled=!0,this._endSnappingEnabled=!0,this.onDidSashChange=this._onDidSashChange.event,this.onDidSashReset=this._onDidSashReset.event,this.orientation=null!==(i=t.orientation)&&void 0!==i?i:0,this.inverseAltBehavior=null!==(n=t.inverseAltBehavior)&&void 0!==n&&n,this.proportionalLayout=null===(s=t.proportionalLayout)||void 0===s||s,this.getSashOrthogonalSize=t.getSashOrthogonalSize,this.el=document.createElement("div"),this.el.classList.add("monaco-split-view2"),this.el.classList.add(0===this.orientation?"vertical":"horizontal"),e.appendChild(this.el),this.sashContainer=ds(this.el,fs(".sash-container")),this.viewContainer=fs(".split-view-container"),this.scrollable=this._register(new DD({forceIntegerValues:!0,smoothScrollDuration:125,scheduleAtNextAnimationFrame:An})),this.scrollableElement=this._register(new AD(this.viewContainer,{vertical:0===this.orientation?null!==(o=t.scrollbarVisibility)&&void 0!==o?o:1:2,horizontal:1===this.orientation?null!==(r=t.scrollbarVisibility)&&void 0!==r?r:1:2},this.scrollable));const a=this._register(new Ky(this.viewContainer,"scroll")).event;this._register(a((e=>{const t=this.scrollableElement.getScrollPosition(),i=Math.abs(this.viewContainer.scrollLeft-t.scrollLeft)<=1?void 0:this.viewContainer.scrollLeft,n=Math.abs(this.viewContainer.scrollTop-t.scrollTop)<=1?void 0:this.viewContainer.scrollTop;void 0===i&&void 0===n||this.scrollableElement.setScrollPosition({scrollLeft:i,scrollTop:n})}))),this.onDidScroll=this.scrollableElement.onScroll,this._register(this.onDidScroll((e=>{e.scrollTopChanged&&(this.viewContainer.scrollTop=e.scrollTop),e.scrollLeftChanged&&(this.viewContainer.scrollLeft=e.scrollLeft)}))),ds(this.el,this.scrollableElement.getDomNode()),this.style(t.styles||lV),t.descriptor&&(this.size=t.descriptor.size,t.descriptor.views.forEach(((e,t)=>{const i=Ur(e.visible)||e.visible?e.size:{type:"invisible",cachedVisibleSize:e.size},n=e.view;this.doAddView(n,i,t,!0)})),this.contentSize=this.viewItems.reduce(((e,t)=>e+t.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)}layout(e,t){const i=Math.max(this.size,this.contentSize);if(this.size=e,this.layoutContext=t,this.proportions){let t=0;for(let i=0;i1===this.viewItems[e].priority)),s=t.filter((e=>2===this.viewItems[e].priority));this.resize(this.viewItems.length-1,e-i,void 0,n,s)}this.distributeEmptySpace(),this.layoutViews()}saveProportions(){this.proportionalLayout&&this.contentSize>0&&(this.proportions=this.viewItems.map((e=>e.proportionalLayout?e.size/this.contentSize:void 0)))}onSashStart({sash:e,start:t,alt:i}){for(const r of this.viewItems)r.enabled=!1;const n=this.sashItems.findIndex((t=>t.sash===e)),s=D(En(document.body,"keydown",(e=>o(this.sashDragState.current,e.altKey))),En(document.body,"keyup",(()=>o(this.sashDragState.current,!1)))),o=(e,t)=>{const i=this.viewItems.map((e=>e.size));let o,r,a=Number.NEGATIVE_INFINITY,l=Number.POSITIVE_INFINITY;if(this.inverseAltBehavior&&(t=!t),t){if(n===this.sashItems.length-1){const e=this.viewItems[n];a=(e.minimumSize-e.size)/2,l=(e.maximumSize-e.size)/2}else{const e=this.viewItems[n+1];a=(e.size-e.maximumSize)/2,l=(e.size-e.minimumSize)/2}}if(!t){const e=Kd(n,-1),t=Kd(n+1,this.viewItems.length),s=e.reduce(((e,t)=>e+(this.viewItems[t].minimumSize-i[t])),0),a=e.reduce(((e,t)=>e+(this.viewItems[t].viewMaximumSize-i[t])),0),l=0===t.length?Number.POSITIVE_INFINITY:t.reduce(((e,t)=>e+(i[t]-this.viewItems[t].minimumSize)),0),h=0===t.length?Number.NEGATIVE_INFINITY:t.reduce(((e,t)=>e+(i[t]-this.viewItems[t].viewMaximumSize)),0),d=Math.max(s,h),c=Math.min(l,a),u=this.findFirstSnapIndex(e),g=this.findFirstSnapIndex(t);if("number"==typeof u){const e=this.viewItems[u],t=Math.floor(e.viewMinimumSize/2);o={index:u,limitDelta:e.visible?d-t:d+t,size:e.size}}if("number"==typeof g){const e=this.viewItems[g],t=Math.floor(e.viewMinimumSize/2);r={index:g,limitDelta:e.visible?c+t:c-t,size:e.size}}}this.sashDragState={start:e,current:e,index:n,sizes:i,minDelta:a,maxDelta:l,alt:t,snapBefore:o,snapAfter:r,disposable:s}};o(t,i)}onSashChange({current:e}){const{index:t,start:i,sizes:n,alt:s,minDelta:o,maxDelta:r,snapBefore:a,snapAfter:l}=this.sashDragState;this.sashDragState.current=e;const h=e-i,d=this.resize(t,h,n,void 0,void 0,o,r,a,l);if(s){const e=t===this.sashItems.length-1,i=this.viewItems.map((e=>e.size)),n=e?t:t+1,s=this.viewItems[n],o=s.size-s.maximumSize,r=s.size-s.minimumSize,a=e?t-1:t+1;this.resize(a,-d,i,void 0,void 0,o,r)}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=uD(t="number"==typeof t?t:e.size,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(this.state!==uV.Idle)throw new Error("Cant modify splitview");if(this.state=uV.Busy,e<0||e>=this.viewItems.length)return;const i=Kd(this.viewItems.length).filter((t=>t!==e)),n=[...i.filter((e=>1===this.viewItems[e].priority)),e],s=i.filter((e=>2===this.viewItems[e].priority)),o=this.viewItems[e];t=uD(t=Math.round(t),o.minimumSize,Math.min(o.maximumSize,this.size)),o.size=t,this.relayout(n,s),this.state=uV.Idle}distributeViewSizes(){const e=[];let t=0;for(const r of this.viewItems)r.maximumSize-r.minimumSize>0&&(e.push(r),t+=r.size);const i=Math.floor(t/e.length);for(const r of e)r.size=uD(i,r.minimumSize,r.maximumSize);const n=Kd(this.viewItems.length),s=n.filter((e=>1===this.viewItems[e].priority)),o=n.filter((e=>2===this.viewItems[e].priority));this.relayout(s,o)}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!==uV.Idle)throw new Error("Cant modify splitview");this.state=uV.Busy;const s=fs(".split-view-view");i===this.viewItems.length?this.viewContainer.appendChild(s):this.viewContainer.insertBefore(s,this.viewContainer.children.item(i));const o=e.onDidChange((e=>this.onViewChange(l,e))),r=D(o,x((()=>this.viewContainer.removeChild(s))));let a;"number"==typeof t?a=t:("auto"===t.type&&(t=this.areViewsDistributed()?{type:"distribute"}:{type:"split",index:t.index}),a="split"===t.type?this.getViewSize(t.index)/2:"invisible"===t.type?{cachedVisibleSize:t.cachedVisibleSize}:e.minimumSize);const l=0===this.orientation?new dV(s,e,a,r):new cV(s,e,a,r);if(this.viewItems.splice(i,0,l),this.viewItems.length>1){const e={orthogonalStartSash:this.orthogonalStartSash,orthogonalEndSash:this.orthogonalEndSash},t=0===this.orientation?new SW(this.sashContainer,{getHorizontalSashTop:e=>this.getSashPosition(e),getHorizontalSashWidth:this.getSashOrthogonalSize},Object.assign(Object.assign({},e),{orientation:1})):new SW(this.sashContainer,{getVerticalSashLeft:e=>this.getSashPosition(e),getVerticalSashHeight:this.getSashOrthogonalSize},Object.assign(Object.assign({},e),{orientation:0})),n=0===this.orientation?e=>({sash:t,start:e.startY,current:e.currentY,alt:e.altKey}):e=>({sash:t,start:e.startX,current:e.currentX,alt:e.altKey}),s=B.map(t.onDidStart,n)(this.onSashStart,this),o=B.map(t.onDidChange,n)(this.onSashChange,this),r=B.map(t.onDidEnd,(()=>this.sashItems.findIndex((e=>e.sash===t)))),a=r(this.onSashEnd,this),l=t.onDidReset((()=>{const e=this.sashItems.findIndex((e=>e.sash===t)),i=Kd(e,-1),n=Kd(e+1,this.viewItems.length),s=this.findFirstSnapIndex(i),o=this.findFirstSnapIndex(n);("number"!=typeof s||this.viewItems[s].visible)&&("number"!=typeof o||this.viewItems[o].visible)&&this._onDidSashReset.fire(e)})),h=D(s,o,a,l,t),d={sash:t,disposable:h};this.sashItems.splice(i-1,0,d)}let h;s.appendChild(e.element),"number"!=typeof t&&"split"===t.type&&(h=[t.index]),n||this.relayout([i],h),this.state=uV.Idle,n||"number"==typeof t||"distribute"!==t.type||this.distributeViewSizes()}relayout(e,t){const i=this.viewItems.reduce(((e,t)=>e+t.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((e=>e.size)),n,s,o=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,a,l){if(e<0||e>=this.viewItems.length)return 0;const h=Kd(e,-1),d=Kd(e+1,this.viewItems.length);if(s)for(const y of s)qd(h,y),qd(d,y);if(n)for(const y of n)$d(h,y),$d(d,y);const c=h.map((e=>this.viewItems[e])),u=h.map((e=>i[e])),g=d.map((e=>this.viewItems[e])),p=d.map((e=>i[e])),m=h.reduce(((e,t)=>e+(this.viewItems[t].minimumSize-i[t])),0),f=h.reduce(((e,t)=>e+(this.viewItems[t].maximumSize-i[t])),0),_=0===d.length?Number.POSITIVE_INFINITY:d.reduce(((e,t)=>e+(i[t]-this.viewItems[t].minimumSize)),0),v=0===d.length?Number.NEGATIVE_INFINITY:d.reduce(((e,t)=>e+(i[t]-this.viewItems[t].maximumSize)),0),b=Math.max(m,v,o),C=Math.min(_,f,r);let w=!1;if(a){const e=this.viewItems[a.index],i=t>=a.limitDelta;w=i!==e.visible,e.setVisible(i,a.size)}if(!w&&l){const e=this.viewItems[l.index],i=te+t.size),0);let i=this.size-t;const n=Kd(this.viewItems.length-1,-1),s=n.filter((e=>1===this.viewItems[e].priority)),o=n.filter((e=>2===this.viewItems[e].priority));for(const r of o)qd(n,r);for(const r of s)$d(n,r);"number"==typeof e&&$d(n,e);for(let r=0;0!==i&&re+t.size),0);let e=0;for(const t of this.viewItems)t.layout(e,this.layoutContext),e+=t.size;this.sashItems.forEach((e=>e.sash.layout())),this.updateSashEnablement(),this.updateScrollableElement()}updateScrollableElement(){0===this.orientation?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((t=>e=t.size-t.minimumSize>0||e));e=!1;const i=this.viewItems.map((t=>e=t.maximumSize-t.size>0||e)),n=[...this.viewItems].reverse();e=!1;const s=n.map((t=>e=t.size-t.minimumSize>0||e)).reverse();e=!1;const o=n.map((t=>e=t.maximumSize-t.size>0||e)).reverse();let r=0;for(let a=0;a0||this.startSnappingEnabled)?e.state=1:d&&t[a]&&(r0)return;if(!e.visible&&e.snap)return t}}areViewsDistributed(){let e,t;for(const i of this.viewItems)if(e=void 0===e?i.size:Math.min(e,i.size),t=void 0===t?i.size:Math.max(t,i.size),t-e>2)return!1;return!0}dispose(){var e;null===(e=this.sashDragState)||void 0===e||e.disposable.dispose(),k(this.viewItems),this.viewItems=[],this.sashItems.forEach((e=>e.disposable.dispose())),this.sashItems=[],super.dispose()}}class mV{constructor(e,t,i){this.columns=e,this.getColumnSize=i,this.templateId=mV.TemplateId,this.renderedTemplates=new Set;const n=new Map(t.map((e=>[e.templateId,e])));this.renderers=[];for(const s of e){const e=n.get(s.templateId);if(!e)throw new Error(`Table cell renderer for template id ${s.templateId} not found.`);this.renderers.push(e)}}renderTemplate(e){const t=ds(e,fs(".monaco-table-tr")),i=[],n=[];for(let o=0;onew fV(e,t))),a={size:r.reduce(((e,t)=>e+t.column.weight),0),views:r.map((e=>({size:e.column.weight,view:e})))};this.splitview=this.disposables.add(new pV(this.domNode,{orientation:1,scrollbarVisibility:2,getSashOrthogonalSize:()=>this.cachedHeight,descriptor:a})),this.splitview.el.style.height=`${i.headerRowHeight}px`,this.splitview.el.style.lineHeight=`${i.headerRowHeight}px`;const l=new mV(n,s,(e=>this.splitview.getViewSize(e)));var h;this.list=this.disposables.add(new yx(e,this.domNode,(h=i,{getHeight:e=>h.getHeight(e),getTemplateId:()=>mV.TemplateId}),[l],o)),B.any(...r.map((e=>e.onDidLayout)))((([e,t])=>l.layoutColumn(e,t)),null,this.disposables),this.splitview.onDidSashReset((e=>{const t=n.reduce(((e,t)=>e+t.weight),0),i=n[e].weight/t*this.cachedWidth;this.splitview.resizeView(e,i)}),null,this.disposables),this.styleElement=Jn(this.domNode),this.style(mx)}updateOptions(e){this.list.updateOptions(e)}splice(e,t,i=[]){this.list.splice(e,t,i)}getHTMLElement(){return this.domNode}style(e){const t=[];t.push(`.monaco-table.${this.domId} > .monaco-split-view2 .monaco-sash.vertical::before {\n\t\t\ttop: ${this.virtualDelegate.headerRowHeight+1}px;\n\t\t\theight: calc(100% - ${this.virtualDelegate.headerRowHeight}px);\n\t\t}`),this.styleElement.textContent=t.join("\n"),this.list.style(e)}getSelectedElements(){return this.list.getSelectedElements()}getSelection(){return this.list.getSelection()}getFocus(){return this.list.getFocus()}dispose(){this.disposables.dispose()}}_V.InstanceCount=0;class vV extends _D{constructor(e){super(),this._onChange=this._register(new U),this.onChange=this._onChange.event,this._onKeyDown=this._register(new U),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(...ta.asClassNameArray(this._icon))),this._opts.actionClassName&&t.push(...this._opts.actionClassName.split(" ")),this._checked&&t.push("checked"),this.domNode=document.createElement("div"),this.domNode.title=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,(e=>{this.enabled&&(this.checked=!this._checked,this._onChange.fire(!1),e.preventDefault())})),this._register(this.ignoreGesture(this.domNode)),this.onkeydown(this.domNode,(e=>{if(10===e.keyCode||3===e.keyCode)return this.checked=!this._checked,this._onChange.fire(!0),e.preventDefault(),void e.stopPropagation();this._onKeyDown.fire(e)}))}get enabled(){return"true"!==this.domNode.getAttribute("aria-disabled")}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()}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))}}const bV=ue(0,"Match Case"),CV=ue(0,"Match Whole Word"),wV=ue(0,"Use Regular Expression");class yV extends vV{constructor(e){super({icon:Jr.caseSensitive,title:bV+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class SV extends vV{constructor(e){super({icon:Jr.wholeWord,title:CV+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class LV extends vV{constructor(e){super({icon:Jr.regex,title:wV+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class kV{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 DV{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 0!==this._currentPosition()?this._navigator.previous():null}current(){return this._navigator.current()}first(){return this._navigator.first()}last(){return this._navigator.last()}isLast(){return this._currentPosition()>=this._elements.length-1}isNowhere(){return null===this._navigator.current()}has(e){return this._history.has(e)}_onChange(){this._reduceToLimit();const e=this._elements;this._navigator=new kV(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}}const xV=fs;class NV extends _D{constructor(e,t,i){var n;super(),this.state="idle",this.maxHeight=Number.POSITIVE_INFINITY,this._onDidChange=this._register(new U),this.onDidChange=this._onDidChange.event,this._onDidHeightChange=this._register(new U),this.onDidHeightChange=this._onDidHeightChange.event,this.contextViewProvider=t,this.options=i,this.message=null,this.placeholder=this.options.placeholder||"",this.tooltip=null!==(n=this.options.tooltip)&&void 0!==n?n:this.placeholder||"",this.ariaLabel=this.options.ariaLabel||"",this.options.validationOptions&&(this.validation=this.options.validationOptions.validation),this.element=ds(e,xV(".monaco-inputbox.idle"));const s=this.options.flexibleHeight?"textarea":"input",o=ds(this.element,xV(".ibwrapper"));if(this.input=ds(o,xV(s+".input.empty")),this.input.setAttribute("autocorrect","off"),this.input.setAttribute("autocapitalize","off"),this.input.setAttribute("spellcheck","false"),this.onfocus(this.input,(()=>this.element.classList.add("synthetic-focus"))),this.onblur(this.input,(()=>this.element.classList.remove("synthetic-focus"))),this.options.flexibleHeight){this.maxHeight="number"==typeof this.options.flexibleMaxHeight?this.options.flexibleMaxHeight:Number.POSITIVE_INFINITY,this.mirror=ds(o,xV("div.mirror")),this.mirror.innerText="\xa0",this.scrollableElement=new RD(this.element,{vertical:1}),this.options.flexibleWidth&&(this.input.setAttribute("wrap","off"),this.mirror.style.whiteSpace="pre",this.mirror.style.wordWrap="initial"),ds(e,this.scrollableElement.getDomNode()),this._register(this.scrollableElement),this._register(this.scrollableElement.onScroll((e=>this.input.scrollTop=e.scrollTop)));const t=this._register(new Ky(document,"selectionchange")),i=B.filter(t.event,(()=>{const e=document.getSelection();return(null==e?void 0:e.anchorNode)===o}));this._register(i(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 Rx(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.input.title=e}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 height(){return"number"==typeof this.cachedHeight?this.cachedHeight:jn(this.element)}focus(){this.input.focus()}blur(){this.input.blur()}hasFocus(){return document.activeElement===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}enable(){this.input.removeAttribute("disabled")}disable(){this.blur(),this.input.disabled=!0,this._hideMessage()}set paddingRight(e){this.input.style.width=`calc(100% - ${e}px)`,this.mirror&&(this.mirror.style.paddingRight=e+"px")}updateScrollDimensions(){if("number"!=typeof this.cachedContentHeight||"number"!=typeof this.cachedHeight||!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("open"===this.state&&vd(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 ${Ss(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()}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())),null==e?void 0:e.type}stylesForType(e){const t=this.options.inputBoxStyles;switch(e){case 1:return{border:t.inputValidationInfoBorder,background:t.inputValidationInfoBackground,foreground:t.inputValidationInfoForeground};case 2: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 1:return"info";case 2:return"warning";default:return"error"}}_showMessage(){if(!this.contextViewProvider||!this.message)return;let e;const t=()=>e.style.width=zn(this.element)+"px";let i;this.contextViewProvider.showContextView({getAnchor:()=>this.element,anchorAlignment:1,render:i=>{var n,s;if(!this.message)return null;e=ds(i,xV(".monaco-inputbox-container")),t();const o={inline:!0,className:"monaco-inputbox-message"},r=this.message.formatContent?tk(this.message.content,o):function(e,t={}){const i=ik(t);return i.textContent=e,i}(this.message.content,o);r.classList.add(this.classForType(this.message.type));const a=this.stylesForType(this.message.type);return r.style.backgroundColor=null!==(n=a.background)&&void 0!==n?n:"",r.style.color=null!==(s=a.foreground)&&void 0!==s?s:"",r.style.border=a.border?`1px solid ${a.border}`:"",ds(e,r),null},onHide:()=>{this.state="closed"},layout:t}),i=3===this.message.type?ue(0,"Error: {0}",this.message.content):2===this.message.type?ue(0,"Warning: {0}",this.message.content):ue(0,"Info: {0}",this.message.content),Ps(i),this.state="open"}_hideMessage(){this.contextViewProvider&&("open"===this.state&&this.contextViewProvider.hideContextView(),this.state="idle")}onValueChange(){this._onDidChange.fire(this.value),this.validate(),this.updateMirror(),this.input.classList.toggle("empty",!this.value),"open"===this.state&&this.contextViewProvider&&this.contextViewProvider.layout()}updateMirror(){if(!this.mirror)return;const e=this.value,t=10===e.charCodeAt(e.length-1)?" ":"";(e+t).replace(/\u000c/g,"")?this.mirror.textContent=e+t:this.mirror.innerText="\xa0",this.layout()}applyStyles(){var e,t,i;const n=this.options.inputBoxStyles,s=null!==(e=n.inputBackground)&&void 0!==e?e:"",o=null!==(t=n.inputForeground)&&void 0!==t?t:"",r=null!==(i=n.inputBorder)&&void 0!==i?i:"";this.element.style.backgroundColor=s,this.element.style.color=o,this.input.style.backgroundColor="inherit",this.input.style.color=o,this.element.style.border=`1px solid ${Ss(r,"transparent")}`}layout(){if(!this.mirror)return;const e=this.cachedContentHeight;this.cachedContentHeight=jn(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,s=t.value;null!==i&&null!==n&&(this.value=s.substr(0,i)+e+s.substr(n),t.setSelectionRange(i+1,i+1),this.layout())}dispose(){var e;this._hideMessage(),this.message=null,null===(e=this.actionbar)||void 0===e||e.dispose(),super.dispose()}}class EV extends NV{constructor(e,t,i){const n=ue(0,"for history"),s=` or \u21c5 ${n}`,o=` (\u21c5 ${n})`;super(e,t,i),this._onDidFocus=this._register(new U),this.onDidFocus=this._onDidFocus.event,this._onDidBlur=this._register(new U),this.onDidBlur=this._onDidBlur.event,this.history=new DV(i.history,100);const r=()=>{if(i.showHistoryHint&&i.showHistoryHint()&&!this.placeholder.endsWith(s)&&!this.placeholder.endsWith(o)&&this.history.getHistory().length){const e=this.placeholder.endsWith(")")?s:o,t=this.placeholder+e;i.showPlaceholderOnFocus&&document.activeElement!==this.input?this.placeholder=t:this.setPlaceHolder(t)}};this.observer=new MutationObserver(((e,t)=>{e.forEach((e=>{e.target.textContent||r()}))})),this.observer.observe(this.input,{attributeFilter:["class"]}),this.onfocus(this.input,(()=>r())),this.onblur(this.input,(()=>{const e=e=>{if(this.placeholder.endsWith(e)){const t=this.placeholder.slice(0,this.placeholder.length-e.length);return i.showPlaceholderOnFocus?this.placeholder=t:this.setPlaceHolder(t),!0}return!1};e(o)||e(s)}))}dispose(){super.dispose(),this.observer&&(this.observer.disconnect(),this.observer=void 0)}addToHistory(e){this.value&&(e||this.value!==this.getCurrentValue())&&this.history.add(this.value)}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=null!=e?e:"",Fs(this.value?this.value:ue(0,"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,Fs(this.value))}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()}}const IV=ue(0,"input");class MV extends _D{constructor(e,t,i){super(),this.fixFocusOnOptionClickEnabled=!0,this.imeSessionInProgress=!1,this.additionalTogglesDisposables=this._register(new I),this.additionalToggles=[],this._onDidOptionChange=this._register(new U),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new U),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new U),this.onMouseDown=this._onMouseDown.event,this._onInput=this._register(new U),this._onKeyUp=this._register(new U),this._onCaseSensitiveKeyDown=this._register(new U),this.onCaseSensitiveKeyDown=this._onCaseSensitiveKeyDown.event,this._onRegexKeyDown=this._register(new U),this.onRegexKeyDown=this._onRegexKeyDown.event,this._lastHighlightFindOptions=0,this.placeholder=i.placeholder||"",this.validation=i.validation,this.label=i.label||IV,this.showCommonFindToggles=!!i.showCommonFindToggles;const n=i.appendCaseSensitiveLabel||"",s=i.appendWholeWordsLabel||"",o=i.appendRegexLabel||"",r=i.history||[],a=!!i.flexibleHeight,l=!!i.flexibleWidth,h=i.flexibleMaxHeight;if(this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new EV(this.domNode,t,{placeholder:this.placeholder||"",ariaLabel:this.label||"",validationOptions:{validation:this.validation},history:r,showHistoryHint:i.showHistoryHint,flexibleHeight:a,flexibleWidth:l,flexibleMaxHeight:h,inputBoxStyles:i.inputBoxStyles})),this.showCommonFindToggles){this.regex=this._register(new LV(Object.assign({appendTitle:o,isChecked:!1},i.toggleStyles))),this._register(this.regex.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this._register(this.regex.onKeyDown((e=>{this._onRegexKeyDown.fire(e)}))),this.wholeWords=this._register(new SV(Object.assign({appendTitle:s,isChecked:!1},i.toggleStyles))),this._register(this.wholeWords.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this.caseSensitive=this._register(new yV(Object.assign({appendTitle:n,isChecked:!1},i.toggleStyles))),this._register(this.caseSensitive.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this._register(this.caseSensitive.onKeyDown((e=>{this._onCaseSensitiveKeyDown.fire(e)})));const e=[this.caseSensitive.domNode,this.wholeWords.domNode,this.regex.domNode];this.onkeydown(this.domNode,(t=>{if(t.equals(15)||t.equals(17)||t.equals(9)){const i=e.indexOf(document.activeElement);if(i>=0){let n=-1;t.equals(17)?n=(i+1)%e.length:t.equals(15)&&(n=0===i?e.length-1:i-1),t.equals(9)?(e[i].blur(),this.inputBox.focus()):n>=0&&e[n].focus(),as(t,!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(null==i?void 0:i.additionalToggles),this.controls&&this.domNode.appendChild(this.controls),null==e||e.appendChild(this.domNode),this._register(En(this.inputBox.inputElement,"compositionstart",(e=>{this.imeSessionInProgress=!0}))),this._register(En(this.inputBox.inputElement,"compositionend",(e=>{this.imeSessionInProgress=!1,this._onInput.fire()}))),this.onkeydown(this.inputBox.inputElement,(e=>this._onKeyDown.fire(e))),this.onkeyup(this.inputBox.inputElement,(e=>this._onKeyUp.fire(e))),this.oninput(this.inputBox.inputElement,(e=>this._onInput.fire())),this.onmousedown(this.inputBox.inputElement,(e=>this._onMouseDown.fire(e)))}get onDidChange(){return this.inputBox.onDidChange}layout(e){this.inputBox.layout(),this.updateInputBoxPadding(e.collapsedFindWidget)}enable(){var e,t,i;this.domNode.classList.remove("disabled"),this.inputBox.enable(),null===(e=this.regex)||void 0===e||e.enable(),null===(t=this.wholeWords)||void 0===t||t.enable(),null===(i=this.caseSensitive)||void 0===i||i.enable();for(const n of this.additionalToggles)n.enable()}disable(){var e,t,i;this.domNode.classList.add("disabled"),this.inputBox.disable(),null===(e=this.regex)||void 0===e||e.disable(),null===(t=this.wholeWords)||void 0===t||t.disable(),null===(i=this.caseSensitive)||void 0===i||i.disable();for(const n of this.additionalToggles)n.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 N;for(const t of null!=e?e:[])this.additionalTogglesDisposables.value.add(t),this.controls.appendChild(t.domNode),this.additionalTogglesDisposables.value.add(t.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus()}))),this.additionalToggles.push(t);this.additionalToggles.length>0&&(this.controls.style.display=""),this.updateInputBoxPadding()}updateInputBoxPadding(e=!1){var t,i,n,s,o,r;this.inputBox.paddingRight=e?0:(null!==(i=null===(t=this.caseSensitive)||void 0===t?void 0:t.width())&&void 0!==i?i:0)+(null!==(s=null===(n=this.wholeWords)||void 0===n?void 0:n.width())&&void 0!==s?s:0)+(null!==(r=null===(o=this.regex)||void 0===o?void 0:o.width())&&void 0!==r?r:0)+this.additionalToggles.reduce(((e,t)=>e+t.width()),0)}getValue(){return this.inputBox.value}setValue(e){this.inputBox.value!==e&&(this.inputBox.value=e)}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getCaseSensitive(){var e,t;return null!==(t=null===(e=this.caseSensitive)||void 0===e?void 0:e.checked)&&void 0!==t&&t}setCaseSensitive(e){this.caseSensitive&&(this.caseSensitive.checked=e)}getWholeWords(){var e,t;return null!==(t=null===(e=this.wholeWords)||void 0===e?void 0:e.checked)&&void 0!==t&&t}setWholeWords(e){this.wholeWords&&(this.wholeWords.checked=e)}getRegex(){var e,t;return null!==(t=null===(e=this.regex)||void 0===e?void 0:e.checked)&&void 0!==t&&t}setRegex(e){this.regex&&(this.regex.checked=e,this.validate())}focusOnCaseSensitive(){var e;null===(e=this.caseSensitive)||void 0===e||e.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()}}var TV,RV;!function(e){e[e.Expanded=0]="Expanded",e[e.Collapsed=1]="Collapsed",e[e.PreserveOrExpanded=2]="PreserveOrExpanded",e[e.PreserveOrCollapsed=3]="PreserveOrCollapsed"}(TV||(TV={})),function(e){e[e.Unknown=0]="Unknown",e[e.Twistie=1]="Twistie",e[e.Element=2]="Element",e[e.Filter=3]="Filter"}(RV||(RV={}));class AV extends Error{constructor(e,t){super(`TreeError [${e}] ${t}`)}}class OV{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 PV(e){return"object"==typeof e&&"visibility"in e&&"data"in e}function FV(e){switch(e){case!0:return 1;case!1:return 0;default:return e}}function BV(e){return"boolean"==typeof e.collapsible}class WV{constructor(e,t,i,n={}){this.user=e,this.list=t,this.rootRef=[],this.eventBufferer=new Z,this._onDidChangeCollapseState=new U,this.onDidChangeCollapseState=this.eventBufferer.wrapEvent(this._onDidChangeCollapseState.event),this._onDidChangeRenderNodeCount=new U,this.onDidChangeRenderNodeCount=this.eventBufferer.wrapEvent(this._onDidChangeRenderNodeCount.event),this._onDidSplice=new U,this.onDidSplice=this._onDidSplice.event,this.refilterDelayer=new Jh(qh),this.collapseByDefault=void 0!==n.collapseByDefault&&n.collapseByDefault,this.filter=n.filter,this.autoExpandSingleChildren=void 0!==n.autoExpandSingleChildren&&n.autoExpandSingleChildren,this.root={parent:void 0,element:i,children:[],depth:0,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:!1,collapsed:!1,renderNodeCount:0,visibility:1,visible:!0,filterData:void 0}}splice(e,t,i=v.empty(),n={}){if(0===e.length)throw new AV(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,s,o){var r;void 0===n&&(n=v.empty()),void 0===o&&(o=null!==(r=s.diffDepth)&&void 0!==r?r:0);const{parentNode:a}=this.getParentNodeWithListIndex(t);if(!a.lastDiffIds)return this.spliceSimple(t,i,n,s);const l=[...n],h=t[t.length-1],d=new gI({getElements:()=>a.lastDiffIds},{getElements:()=>[...a.children.slice(0,h),...l,...a.children.slice(h+i)].map((t=>e.getId(t.element).toString()))}).ComputeDiff(!1);if(d.quitEarly)return a.lastDiffIds=void 0,this.spliceSimple(t,i,l,s);const c=t.slice(0,-1),u=(t,i,n)=>{if(o>0)for(let r=0;rt.originalStart-e.originalStart)))u(g,p,g-(m.originalStart+m.originalLength)),g=m.originalStart,p=m.modifiedStart-h,this.spliceSimple([...c,g],m.originalLength,v.slice(l,p,p+m.modifiedLength),s);u(g,p,g)}spliceSimple(e,t,i=v.empty(),{onDidCreateNode:n,onDidDeleteNode:s,diffIdentityProvider:o}){const{parentNode:r,listIndex:a,revealed:l,visible:h}=this.getParentNodeWithListIndex(e),d=[],c=v.map(i,(e=>this.createTreeNode(e,r,r.visible?1:0,l,d,n))),u=e[e.length-1],g=r.children.length>0;let p=0;for(let v=u;v>=0&&vo.getId(e.element).toString()))):r.lastDiffIds=r.children.map((e=>o.getId(e.element).toString())):r.lastDiffIds=void 0;let C=0;for(const v of b)v.visible&&C++;if(0!==C)for(let v=u+m.length;ve+(t.visible?t.renderNodeCount:0)),0);this._updateAncestorsRenderNodeCount(r,_-e),this.list.splice(a,e,d)}if(b.length>0&&s){const e=t=>{s(t),t.children.forEach(e)};b.forEach(e)}this._onDidSplice.fire({insertedNodes:m,deletedNodes:b});const w=r.children.length>0;g!==w&&this.setCollapsible(e.slice(0,-1),w);let y=r;for(;y;){if(2===y.visibility){this.refilterDelayer.trigger((()=>this.refilter()));break}y=y.parent}}rerender(e){if(0===e.length)throw new AV(this.user,"Invalid tree location");const{node:t,listIndex:i,revealed:n}=this.getTreeNodeWithListIndex(e);t.visible&&n&&this.list.splice(i,1,[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);void 0===t&&(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);void 0===t&&(t=!n.collapsed);const s={collapsed:t,recursive:i||!1};return this.eventBufferer.bufferEvents((()=>this._setCollapseState(e,s)))}_setCollapseState(e,t){const{node:i,listIndex:n,revealed:s}=this.getTreeNodeWithListIndex(e),o=this._setListNodeCollapseState(i,n,s,t);if(i!==this.root&&this.autoExpandSingleChildren&&o&&!BV(t)&&i.collapsible&&!i.collapsed&&!t.recursive){let n=-1;for(let e=0;e-1){n=-1;break}n=e}}n>-1&&this._setCollapseState([...e,n],t)}return o}_setListNodeCollapseState(e,t,i,n){const s=this._setNodeCollapseState(e,n,!1);if(!i||!e.visible||!s)return s;const o=e.renderNodeCount,r=this.updateNodeAfterCollapseChange(e),a=o-(-1===t?0:1);return this.list.splice(t+1,a,r.slice(1)),s}_setNodeCollapseState(e,t,i){let n;if(e===this.root?n=!1:(BV(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})),!BV(t)&&t.recursive)for(const s of e.children)n=this._setNodeCollapseState(s,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,s,o){const r={parent:t,element:e.element,children:[],depth:t.depth+1,visibleChildrenCount:0,visibleChildIndex:-1,collapsible:"boolean"==typeof e.collapsible?e.collapsible:void 0!==e.collapsed,collapsed:void 0===e.collapsed?this.collapseByDefault:e.collapsed,renderNodeCount:1,visibility:1,visible:!0,filterData:void 0},a=this._filterNode(r,i);r.visibility=a,n&&s.push(r);const l=e.children||v.empty(),h=n&&0!==a&&!r.collapsed;let d=0,c=1;for(const u of l){const e=this.createTreeNode(u,r,a,h,s,o);r.children.push(e),c+=e.renderNodeCount,e.visible&&(e.visibleChildIndex=d++)}return r.collapsible=r.collapsible||r.children.length>0,r.visibleChildrenCount=d,r.visible=2===a?d>0:1===a,r.visible?r.collapsed||(r.renderNodeCount=c):(r.renderNodeCount=0,n&&s.pop()),null==o||o(r),r}updateNodeAfterCollapseChange(e){const t=e.renderNodeCount,i=[];return this._updateNodeAfterCollapseChange(e,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterCollapseChange(e,t){if(!1===e.visible)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?1:0,i),this._updateAncestorsRenderNodeCount(e.parent,i.length-t),i}_updateNodeAfterFilterChange(e,t,i,n=!0){let s;if(e!==this.root){if(s=this._filterNode(e,t),0===s)return e.visible=!1,e.renderNodeCount=0,!1;n&&i.push(e)}const o=i.length;e.renderNodeCount=e===this.root?0:1;let r=!1;if(e.collapsed&&0===s)e.visibleChildrenCount=0;else{let t=0;for(const o of e.children)r=this._updateNodeAfterFilterChange(o,s,i,n&&!e.collapsed)||r,o.visible&&(o.visibleChildIndex=t++);e.visibleChildrenCount=t}return e!==this.root&&(e.visible=2===s?r:1===s,e.visibility=s),e.visible?e.collapsed||(e.renderNodeCount+=i.length-o):(e.renderNodeCount=0,n&&i.pop()),this._onDidChangeRenderNodeCount.fire(e),e.visible}_updateAncestorsRenderNodeCount(e,t){if(0!==t)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):1;return"boolean"==typeof i?(e.filterData=void 0,i?1:0):PV(i)?(e.filterData=i.data,FV(i.visibility)):(e.filterData=void 0,FV(i))}hasTreeNode(e,t=this.root){if(!e||0===e.length)return!0;const[i,...n]=e;return!(i<0||i>t.children.length)&&this.hasTreeNode(n,t.children[i])}getTreeNode(e,t=this.root){if(!e||0===e.length)return t;const[i,...n]=e;if(i<0||i>t.children.length)throw new AV(this.user,"Invalid tree location");return this.getTreeNode(n,t.children[i])}getTreeNodeWithListIndex(e){if(0===e.length)return{node:this.root,listIndex:-1,revealed:!0,visible:!1};const{parentNode:t,listIndex:i,revealed:n,visible:s}=this.getParentNodeWithListIndex(e),o=e[e.length-1];if(o<0||o>t.children.length)throw new AV(this.user,"Invalid tree location");const r=t.children[o];return{node:r,listIndex:i,revealed:n,visible:s&&r.visible}}getParentNodeWithListIndex(e,t=this.root,i=0,n=!0,s=!0){const[o,...r]=e;if(o<0||o>t.children.length)throw new AV(this.user,"Invalid tree location");for(let a=0;ae.element))),this.data=e}}function zV(e){return e instanceof KD?new HV(e):e}class UV{constructor(e,t){this.modelProvider=e,this.dnd=t,this.autoExpandDisposable=E.None,this.disposables=new N}getDragURI(e){return this.dnd.getDragURI(e.element)}getDragLabel(e,t){if(this.dnd.getDragLabel)return this.dnd.getDragLabel(e.map((e=>e.element)),t)}onDragStart(e,t){var i,n;null===(n=(i=this.dnd).onDragStart)||void 0===n||n.call(i,zV(e),t)}onDragOver(e,t,i,n,s=!0){const o=this.dnd.onDragOver(zV(e),t&&t.element,i,n),r=this.autoExpandNode!==t;if(r&&(this.autoExpandDisposable.dispose(),this.autoExpandNode=t),void 0===t)return o;if(r&&"boolean"!=typeof o&&o.autoExpand&&(this.autoExpandDisposable=id((()=>{const e=this.modelProvider(),i=e.getNodeLocation(t);e.isCollapsed(i)&&e.setCollapsed(i,!1),this.autoExpandNode=void 0}),500,this.disposables)),"boolean"==typeof o||!o.accept||void 0===o.bubble||o.feedback){if(!s){return{accept:"boolean"==typeof o?o:o.accept,effect:"boolean"==typeof o?void 0:o.effect,feedback:[i]}}return o}if(1===o.bubble){const i=this.modelProvider(),s=i.getNodeLocation(t),o=i.getParentNodeLocation(s),r=i.getNode(o),a=o&&i.getListIndex(o);return this.onDragOver(e,r,a,n,!1)}const a=this.modelProvider(),l=a.getNodeLocation(t),h=a.getListIndex(l),d=a.getListRenderCount(l);return Object.assign(Object.assign({},o),{feedback:Kd(h,h+d)})}drop(e,t,i,n){this.autoExpandDisposable.dispose(),this.autoExpandNode=void 0,this.dnd.drop(zV(e),t&&t.element,i,n)}onDragEnd(e){var t,i;null===(i=(t=this.dnd).onDragEnd)||void 0===i||i.call(t,e)}dispose(){this.disposables.dispose(),this.dnd.dispose()}}class KV{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){var i,n;null===(n=(i=this.delegate).setDynamicHeight)||void 0===n||n.call(i,e.element,t)}}!function(e){e.None="none",e.OnHover="onHover",e.Always="always"}(VV||(VV={}));class jV{get elements(){return this._elements}constructor(e,t=[]){this._elements=t,this.disposables=new N,this.onDidChange=B.forEach(e,(e=>this._elements=e),this.disposables)}dispose(){this.disposables.dispose()}}class qV{constructor(e,t,i,n,s,o={}){var r;this.renderer=e,this.modelProvider=t,this.activeNodes=n,this.renderedIndentGuides=s,this.renderedElements=new Map,this.renderedNodes=new Map,this.indent=qV.DefaultIndent,this.hideTwistiesOfChildlessElements=!1,this.shouldRenderIndentGuides=!1,this.activeIndentNodes=new Set,this.indentGuidesDisposable=E.None,this.disposables=new N,this.templateId=e.templateId,this.updateOptions(o),B.map(i,(e=>e.node))(this.onDidChangeNodeTwistieState,this,this.disposables),null===(r=e.onDidChangeTwistieState)||void 0===r||r.call(e,this.onDidChangeTwistieState,this,this.disposables)}updateOptions(e={}){if(void 0!==e.indent){const t=uD(e.indent,0,40);if(t!==this.indent){this.indent=t;for(const[e,t]of this.renderedNodes)this.renderTreeElement(e,t)}}if(void 0!==e.renderIndentGuides){const t=e.renderIndentGuides!==VV.None;if(t!==this.shouldRenderIndentGuides){this.shouldRenderIndentGuides=t;for(const[e,t]of this.renderedNodes)this._renderIndentGuides(e,t);if(this.indentGuidesDisposable.dispose(),t){const e=new N;this.activeNodes.onDidChange(this._onDidChangeActiveNodes,this,e),this.indentGuidesDisposable=e,this._onDidChangeActiveNodes(this.activeNodes.elements)}}}void 0!==e.hideTwistiesOfChildlessElements&&(this.hideTwistiesOfChildlessElements=e.hideTwistiesOfChildlessElements)}renderTemplate(e){const t=ds(e,fs(".monaco-tl-row")),i=ds(t,fs(".monaco-tl-indent")),n=ds(t,fs(".monaco-tl-twistie")),s=ds(t,fs(".monaco-tl-contents")),o=this.renderer.renderTemplate(s);return{container:e,indent:i,twistie:n,indentGuidesDisposable:E.None,templateData:o}}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){var s,o;i.indentGuidesDisposable.dispose(),null===(o=(s=this.renderer).disposeElement)||void 0===o||o.call(s,e,t,i.templateData,n),"number"==typeof n&&(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=qV.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(...ta.asClassNameArray(Jr.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(...ta.asClassNameArray(Jr.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(Dn(t.indent),t.indentGuidesDisposable.dispose(),!this.shouldRenderIndentGuides)return;const i=new N,n=this.modelProvider();for(;;){const s=n.getNodeLocation(e),o=n.getParentNodeLocation(s);if(!o)break;const r=n.getNode(o),a=fs(".indent-guide",{style:`width: ${this.indent}px`});this.activeIndentNodes.has(r)&&a.classList.add("active"),0===t.indent.childElementCount?t.indent.appendChild(a):t.indent.insertBefore(a,t.indent.firstElementChild),this.renderedIndentGuides.add(r,a),i.add(x((()=>this.renderedIndentGuides.delete(r,a)))),e=r}t.indentGuidesDisposable=i}_onDidChangeActiveNodes(e){if(!this.shouldRenderIndentGuides)return;const t=new Set,i=this.modelProvider();e.forEach((e=>{const n=i.getNodeLocation(e);try{const s=i.getParentNodeLocation(n);e.collapsible&&e.children.length>0&&!e.collapsed?t.add(e):s&&t.add(i.getNode(s))}catch(ge){}})),this.activeIndentNodes.forEach((e=>{t.has(e)||this.renderedIndentGuides.forEach(e,(e=>e.classList.remove("active")))})),t.forEach((e=>{this.activeIndentNodes.has(e)||this.renderedIndentGuides.forEach(e,(e=>e.classList.add("active")))})),this.activeIndentNodes=t}dispose(){this.renderedNodes.clear(),this.renderedElements.clear(),this.indentGuidesDisposable.dispose(),k(this.disposables)}}qV.DefaultIndent=8;class $V{get totalCount(){return this._totalCount}get matchCount(){return this._matchCount}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 N,e.onWillRefilter(this.reset,this,this.disposables)}filter(e,t){let i=1;if(this._filter){const n=this._filter.filter(e,t);if(i="boolean"==typeof n?n?1:0:PV(n)?FV(n.visibility):n,0===i)return!1}if(this._totalCount++,!this._pattern)return this._matchCount++,{data:Mr.Default,visibility:i};const n=this.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e),s=Array.isArray(n)?n:[n];for(const o of s){const e=o&&o.toString();if(void 0===e)return{data:Mr.Default,visibility:i};let t;if(this.tree.findMatchType===ZV.Contiguous){const i=e.toLowerCase().indexOf(this._lowercasePattern);if(i>-1){t=[Number.MAX_SAFE_INTEGER,0];for(let e=this._lowercasePattern.length;e>0;e--)t.push(i+e-1)}}else t=Rr(this._pattern,this._lowercasePattern,0,e,e.toLowerCase(),0,{firstMatchCanBeWeak:!0,boostFullMatch:!0});if(t)return this._matchCount++,1===s.length?{data:t,visibility:i}:{data:{label:e,score:t},visibility:i}}return this.tree.findMode===GV.Filter?"number"==typeof this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility:this.tree.options.defaultFindVisibility?this.tree.options.defaultFindVisibility(e):2:{data:Mr.Default,visibility:i}}reset(){this._totalCount=0,this._matchCount=0}dispose(){k(this.disposables)}}var GV,ZV;!function(e){e[e.Highlight=0]="Highlight",e[e.Filter=1]="Filter"}(GV||(GV={})),function(e){e[e.Fuzzy=0]="Fuzzy",e[e.Contiguous=1]="Contiguous"}(ZV||(ZV={}));class YV{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,s,o={}){var r,a;this.tree=e,this.view=i,this.filter=n,this.contextViewProvider=s,this.options=o,this._pattern="",this.width=0,this._onDidChangeMode=new U,this.onDidChangeMode=this._onDidChangeMode.event,this._onDidChangeMatchType=new U,this.onDidChangeMatchType=this._onDidChangeMatchType.event,this._onDidChangePattern=new U,this._onDidChangeOpenState=new U,this.onDidChangeOpenState=this._onDidChangeOpenState.event,this.enabledDisposables=new N,this.disposables=new N,this._mode=null!==(r=e.options.defaultFindMode)&&void 0!==r?r:GV.Highlight,this._matchType=null!==(a=e.options.defaultFindMatchType)&&void 0!==a?a:ZV.Fuzzy,t.onDidSplice(this.onDidSpliceModel,this,this.disposables)}updateOptions(e={}){void 0!==e.defaultFindMode&&(this.mode=e.defaultFindMode),void 0!==e.defaultFindMatchType&&(this.matchType=e.defaultFindMatchType)}onDidSpliceModel(){this.widget&&0!==this.pattern.length&&(this.tree.refilter(),this.render())}render(){var e,t,i,n;const s=this.filter.totalCount>0&&0===this.filter.matchCount;this.pattern&&s?null===(e=this.tree.options.showNotFoundMessage)||void 0===e||e?null===(t=this.widget)||void 0===t||t.showMessage({type:2,content:ue(0,"No elements found.")}):null===(i=this.widget)||void 0===i||i.showMessage({type:2}):null===(n=this.widget)||void 0===n||n.clearMessage()}shouldAllowFocus(e){return!this.widget||!this.pattern||this._mode===GV.Filter||(this.filter.totalCount>0&&this.filter.matchCount<=1||!Mr.isDefault(e.filterData))}layout(e){var t;this.width=e,null===(t=this.widget)||void 0===t||t.layout(e)}dispose(){this._history=void 0,this._onDidChangePattern.dispose(),this.enabledDisposables.dispose(),this.disposables.dispose()}}function XV(e){let t=RV.Unknown;return $n(e.browserEvent.target,"monaco-tl-twistie","monaco-tl-row")?t=RV.Twistie:$n(e.browserEvent.target,"monaco-tl-contents","monaco-tl-row")?t=RV.Element:$n(e.browserEvent.target,"monaco-tree-type-filter","monaco-list")&&(t=RV.Filter),{browserEvent:e.browserEvent,element:e.element?e.element.element:null,target:t}}function QV(e,t){t(e),e.children.forEach((e=>QV(e,t)))}class JV{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 U,this.onDidChange=this._onDidChange.event}set(e,t){!(null==t?void 0:t.__forceEvent)&&Td(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 e=this;this._onDidChange.fire({get elements(){return e.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 e=this.createNodeSet(),i=t=>e.delete(t);return t.forEach((e=>QV(e,i))),void this.set([...e.values()])}const i=new Set,n=e=>i.add(this.identityProvider.getId(e.element).toString());t.forEach((e=>QV(e,n)));const s=new Map,o=e=>s.set(this.identityProvider.getId(e.element).toString(),e);e.forEach((e=>QV(e,o)));const r=[];for(const a of this.nodes){const e=this.identityProvider.getId(a.element).toString();if(i.has(e)){const t=s.get(e);t&&t.visible&&r.push(t)}else r.push(a)}if(this.nodes.length>0&&0===r.length){const e=this.getFirstViewElementWithTrait();e&&r.push(e)}this._set(r,!0)}createNodeSet(){const e=new Set;for(const t of this.nodes)e.add(t);return e}}class eH extends gx{constructor(e,t){super(e),this.tree=t}onViewPointer(e){if(ox(e.browserEvent.target)||nx(e.browserEvent.target)||sx(e.browserEvent.target))return;if(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;let s=!1;if(s="function"==typeof this.tree.expandOnlyOnTwistieClick?this.tree.expandOnlyOnTwistieClick(t.element):!!this.tree.expandOnlyOnTwistieClick,s&&!n&&2!==e.browserEvent.detail)return super.onViewPointer(e);if(!this.tree.expandOnDoubleClick&&2===e.browserEvent.detail)return super.onViewPointer(e);if(t.collapsible){const i=this.tree.getNodeLocation(t),o=e.browserEvent.altKey;if(this.tree.setFocus([i]),this.tree.toggleCollapsed(i,o),s&&n)return void(e.browserEvent.isHandledByList=!0)}super.onViewPointer(e)}onDoubleClick(e){!e.browserEvent.target.classList.contains("monaco-tl-twistie")&&this.tree.expandOnDoubleClick&&(e.browserEvent.isHandledByList||super.onDoubleClick(e))}}class tH extends yx{constructor(e,t,i,n,s,o,r,a){super(e,t,i,n,a),this.focusTrait=s,this.selectionTrait=o,this.anchorTrait=r}createMouseController(e){return new eH(this,e.tree)}splice(e,t,i=[]){if(super.splice(e,t,i),0===i.length)return;const n=[],s=[];let o;i.forEach(((t,i)=>{this.focusTrait.has(t)&&n.push(e+i),this.selectionTrait.has(t)&&s.push(e+i),this.anchorTrait.has(t)&&(o=e+i)})),n.length>0&&super.setFocus(zd([...super.getFocus(),...n])),s.length>0&&super.setSelection(zd([...super.getSelection(),...s])),"number"==typeof o&&super.setAnchor(o)}setFocus(e,t,i=!1){super.setFocus(e,t),i||this.focusTrait.set(e.map((e=>this.element(e))),t)}setSelection(e,t,i=!1){super.setSelection(e,t),i||this.selectionTrait.set(e.map((e=>this.element(e))),t)}setAnchor(e,t=!1){super.setAnchor(e),t||(void 0===e?this.anchorTrait.set([]):this.anchorTrait.set([this.element(e)]))}}class iH{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 onMouseDblClick(){return B.filter(B.map(this.view.onMouseDblClick,XV),(e=>e.target!==RV.Filter))}get onPointer(){return B.map(this.view.onPointer,XV)}get onDidFocus(){return this.view.onDidFocus}get onDidChangeModel(){return B.signal(this.model.onDidSplice)}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get findMode(){var e,t;return null!==(t=null===(e=this.findController)||void 0===e?void 0:e.mode)&&void 0!==t?t:GV.Highlight}set findMode(e){this.findController&&(this.findController.mode=e)}get findMatchType(){var e,t;return null!==(t=null===(e=this.findController)||void 0===e?void 0:e.matchType)&&void 0!==t?t:ZV.Fuzzy}set findMatchType(e){this.findController&&(this.findController.matchType=e)}get expandOnDoubleClick(){return void 0===this._options.expandOnDoubleClick||this._options.expandOnDoubleClick}get expandOnlyOnTwistieClick(){return void 0===this._options.expandOnlyOnTwistieClick||this._options.expandOnlyOnTwistieClick}get onDidDispose(){return this.view.onDidDispose}constructor(e,t,i,n,s={}){var o;this._user=e,this._options=s,this.eventBufferer=new Z,this.onDidChangeFindOpenState=B.None,this.disposables=new N,this._onWillRefilter=new U,this.onWillRefilter=this._onWillRefilter.event,this._onDidUpdateOptions=new U;const r=new KV(i),a=new Y,l=new Y,h=this.disposables.add(new jV(l.event)),d=new $s;this.renderers=n.map((e=>new qV(e,(()=>this.model),a.event,h,d,s)));for(const m of this.renderers)this.disposables.add(m);let c;s.keyboardNavigationLabelProvider&&(c=new $V(this,s.keyboardNavigationLabelProvider,s.filter),s=Object.assign(Object.assign({},s),{filter:c}),this.disposables.add(c)),this.focus=new JV((()=>this.view.getFocusedElements()[0]),s.identityProvider),this.selection=new JV((()=>this.view.getSelectedElements()[0]),s.identityProvider),this.anchor=new JV((()=>this.view.getAnchorElement()),s.identityProvider),this.view=new tH(e,t,r,this.renderers,this.focus,this.selection,this.anchor,Object.assign(Object.assign({},function(e,t){return t&&Object.assign(Object.assign({},t),{identityProvider:t.identityProvider&&{getId:e=>t.identityProvider.getId(e.element)},dnd:t.dnd&&new UV(e,t.dnd),multipleSelectionController:t.multipleSelectionController&&{isSelectionSingleChangeEvent:e=>t.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},e),{element:e.element})),isSelectionRangeChangeEvent:e=>t.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},e),{element:e.element}))},accessibilityProvider:t.accessibilityProvider&&Object.assign(Object.assign({},t.accessibilityProvider),{getSetSize(t){const i=e(),n=i.getNodeLocation(t),s=i.getParentNodeLocation(n);return i.getNode(s).visibleChildrenCount},getPosInSet:e=>e.visibleChildIndex+1,isChecked:t.accessibilityProvider&&t.accessibilityProvider.isChecked?e=>t.accessibilityProvider.isChecked(e.element):void 0,getRole:t.accessibilityProvider&&t.accessibilityProvider.getRole?e=>t.accessibilityProvider.getRole(e.element):()=>"treeitem",getAriaLabel:e=>t.accessibilityProvider.getAriaLabel(e.element),getWidgetAriaLabel:()=>t.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:t.accessibilityProvider&&t.accessibilityProvider.getWidgetRole?()=>t.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:t.accessibilityProvider&&t.accessibilityProvider.getAriaLevel?e=>t.accessibilityProvider.getAriaLevel(e.element):e=>e.depth,getActiveDescendantId:t.accessibilityProvider.getActiveDescendantId&&(e=>t.accessibilityProvider.getActiveDescendantId(e.element))}),keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},t.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel:e=>t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(e.element)})})}((()=>this.model),s)),{tree:this})),this.model=this.createModel(e,this.view,s),a.input=this.model.onDidChangeCollapseState;const u=B.forEach(this.model.onDidSplice,(e=>{this.eventBufferer.bufferEvents((()=>{this.focus.onDidModelSplice(e),this.selection.onDidModelSplice(e)}))}),this.disposables);u((()=>null),null,this.disposables);const g=this.disposables.add(new U),p=this.disposables.add(new Jh(0));if(this.disposables.add(B.any(u,this.focus.onDidChange,this.selection.onDidChange)((()=>{p.trigger((()=>{const e=new Set;for(const t of this.focus.getNodes())e.add(t);for(const t of this.selection.getNodes())e.add(t);g.fire([...e.values()])}))}))),l.input=g.event,!1!==s.keyboardSupport){const e=B.chain(this.view.onKeyDown,(e=>e.filter((e=>!nx(e.target))).map((e=>new St(e)))));B.chain(e,(e=>e.filter((e=>15===e.keyCode))))(this.onLeftArrow,this,this.disposables),B.chain(e,(e=>e.filter((e=>17===e.keyCode))))(this.onRightArrow,this,this.disposables),B.chain(e,(e=>e.filter((e=>10===e.keyCode))))(this.onSpace,this,this.disposables)}if((null===(o=s.findWidgetEnabled)||void 0===o||o)&&s.keyboardNavigationLabelProvider&&s.contextViewProvider){const e=this.options.findWidgetStyles?{styles:this.options.findWidgetStyles}:void 0;this.findController=new YV(this,this.model,this.view,c,s.contextViewProvider,e),this.focusNavigationFilter=e=>this.findController.shouldAllowFocus(e),this.onDidChangeFindOpenState=this.findController.onDidChangeOpenState,this.disposables.add(this.findController),this.onDidChangeFindMode=this.findController.onDidChangeMode,this.onDidChangeFindMatchType=this.findController.onDidChangeMatchType}else this.onDidChangeFindMode=B.None,this.onDidChangeFindMatchType=B.None;this.styleElement=Jn(this.view.getHTMLElement()),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===VV.Always)}updateOptions(e={}){var t;this._options=Object.assign(Object.assign({},this._options),e);for(const i of this.renderers)i.updateOptions(e);this.view.updateOptions(this._options),null===(t=this.findController)||void 0===t||t.updateOptions(e),this._onDidUpdateOptions.fire(this._options),this.getHTMLElement().classList.toggle("always",this._options.renderIndentGuides===VV.Always)}get options(){return this._options}getHTMLElement(){return this.view.getHTMLElement()}get scrollTop(){return this.view.scrollTop}set scrollTop(e){this.view.scrollTop=e}get scrollHeight(){return this.view.scrollHeight}get renderHeight(){return this.view.renderHeight}domFocus(){this.view.domFocus()}layout(e,t){var i;this.view.layout(e,t),Vr(t)&&(null===(i=this.findController)||void 0===i||i.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}; }`)),this.styleElement.textContent=i.join("\n"),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)}isCollapsible(e){return this.model.isCollapsible(e)}setCollapsible(e,t){return this.model.setCollapsible(e,t)}isCollapsed(e){return this.model.isCollapsed(e)}refilter(){this._onWillRefilter.fire(void 0),this.model.refilter()}setSelection(e,t){const i=e.map((e=>this.model.getNode(e)));this.selection.set(i,t);const n=e.map((e=>this.model.getListIndex(e))).filter((e=>e>-1));this.view.setSelection(n,t,!0)}getSelection(){return this.selection.get()}setFocus(e,t){const i=e.map((e=>this.model.getNode(e)));this.focus.set(i,t);const n=e.map((e=>this.model.getListIndex(e))).filter((e=>e>-1));this.view.setFocus(n,t,!0)}getFocus(){return this.focus.get()}reveal(e,t){this.model.expandTo(e);const i=this.model.getListIndex(e);-1!==i&&this.view.reveal(i,t)}onLeftArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!0)){const e=this.model.getParentNodeLocation(n);if(!e)return;const t=this.model.getListIndex(e);this.view.reveal(t),this.view.setFocus([t])}}onRightArrow(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i);if(!this.model.setCollapsed(n,!1)){if(!i.children.some((e=>e.visible)))return;const[e]=this.view.getFocus(),t=e+1;this.view.reveal(t),this.view.setFocus([t])}}onSpace(e){e.preventDefault(),e.stopPropagation();const t=this.view.getFocusedElements();if(0===t.length)return;const i=t[0],n=this.model.getNodeLocation(i),s=e.browserEvent.altKey;this.model.setCollapsed(n,void 0,s)}dispose(){k(this.disposables),this.view.dispose()}}class nH{constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.nodesByIdentity=new Map,this.model=new WV(e,t,null,i),this.onDidSplice=this.model.onDidSplice,this.onDidChangeCollapseState=this.model.onDidChangeCollapseState,this.onDidChangeRenderNodeCount=this.model.onDidChangeRenderNodeCount,i.sorter&&(this.sorter={compare:(e,t)=>i.sorter.compare(e.element,t.element)}),this.identityProvider=i.identityProvider}setChildren(e,t=v.empty(),i={}){const n=this.getElementLocation(e);this._setChildren(n,this.preserveCollapseState(t),i)}_setChildren(e,t=v.empty(),i){const n=new Set,s=new Set;this.model.splice([...e,0],Number.MAX_VALUE,t,Object.assign(Object.assign({},i),{onDidCreateNode:e=>{var t;if(null===e.element)return;const o=e;if(n.add(o.element),this.nodes.set(o.element,o),this.identityProvider){const e=this.identityProvider.getId(o.element).toString();s.add(e),this.nodesByIdentity.set(e,o)}null===(t=i.onDidCreateNode)||void 0===t||t.call(i,o)},onDidDeleteNode:e=>{var t;if(null===e.element)return;const o=e;if(n.has(o.element)||this.nodes.delete(o.element),this.identityProvider){const e=this.identityProvider.getId(o.element).toString();s.has(e)||this.nodesByIdentity.delete(e)}null===(t=i.onDidDeleteNode)||void 0===t||t.call(i,o)}}))}preserveCollapseState(e=v.empty()){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),v.map(e,(e=>{let t=this.nodes.get(e.element);if(!t&&this.identityProvider){const i=this.identityProvider.getId(e.element).toString();t=this.nodesByIdentity.get(i)}if(!t){let t;return t=void 0===e.collapsed?void 0:e.collapsed===TV.Collapsed||e.collapsed===TV.PreserveOrCollapsed||e.collapsed!==TV.Expanded&&e.collapsed!==TV.PreserveOrExpanded&&Boolean(e.collapsed),Object.assign(Object.assign({},e),{children:this.preserveCollapseState(e.children),collapsed:t})}const i="boolean"==typeof e.collapsible?e.collapsible:t.collapsible;let n;return n=void 0===e.collapsed||e.collapsed===TV.PreserveOrCollapsed||e.collapsed===TV.PreserveOrExpanded?t.collapsed:e.collapsed===TV.Collapsed||e.collapsed!==TV.Expanded&&Boolean(e.collapsed),Object.assign(Object.assign({},e),{collapsible:i,collapsed:n,children:this.preserveCollapseState(e.children)})}))}rerender(e){const t=this.getElementLocation(e);this.model.rerender(t)}getFirstElementChild(e=null){const t=this.getElementLocation(e);return this.model.getFirstElementChild(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(null===e)return this.model.getNode(this.model.rootRef);const t=this.nodes.get(e);if(!t)throw new AV(this.user,`Tree element not found: ${e}`);return t}getNodeLocation(e){return e.element}getParentNodeLocation(e){if(null===e)throw new AV(this.user,"Invalid getParentNodeLocation call");const t=this.nodes.get(e);if(!t)throw new AV(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(null===e)return[];const t=this.nodes.get(e);if(!t)throw new AV(this.user,`Tree element not found: ${e}`);return this.model.getNodeLocation(t)}}function sH(e){return{element:{elements:[e.element],incompressible:e.incompressible||!1},children:v.map(v.from(e.children),sH),collapsible:e.collapsible,collapsed:e.collapsed}}function oH(e){const t=[e.element],i=e.incompressible||!1;let n,s;for(;[s,n]=v.consume(v.from(e.children),2),1===s.length&&!s[0].incompressible;)e=s[0],t.push(e.element);return{element:{elements:t,incompressible:i},children:v.map(v.concat(s,n),oH),collapsible:e.collapsible,collapsed:e.collapsed}}function rH(e,t=0){let i;return i=trH(e,0))),0===t&&e.element.incompressible?{element:e.element.elements[t],children:i,incompressible:!0,collapsible:e.collapsible,collapsed:e.collapsed}:{element:e.element.elements[t],children:i,collapsible:e.collapsible,collapsed:e.collapsed}}function aH(e){return rH(e,0)}function lH(e,t,i){return e.element===t?Object.assign(Object.assign({},e),{children:i}):Object.assign(Object.assign({},e),{children:v.map(v.from(e.children),(e=>lH(e,t,i)))})}class hH{get onDidSplice(){return this.model.onDidSplice}get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}get onDidChangeRenderNodeCount(){return this.model.onDidChangeRenderNodeCount}constructor(e,t,i={}){this.user=e,this.rootRef=null,this.nodes=new Map,this.model=new nH(e,t,i),this.enabled=void 0===i.compressionEnabled||i.compressionEnabled,this.identityProvider=i.identityProvider}setChildren(e,t=v.empty(),i){const n=i.diffIdentityProvider&&(s=i.diffIdentityProvider,{getId:e=>e.elements.map((e=>s.getId(e).toString())).join("\0")});var s;if(null===e){const e=v.map(t,this.enabled?oH:sH);return void this._setChildren(null,e,{diffIdentityProvider:n,diffDepth:1/0})}const o=this.nodes.get(e);if(!o)throw new AV(this.user,"Unknown compressed tree node");const r=this.model.getNode(o),a=this.model.getParentNodeLocation(o),l=this.model.getNode(a),h=lH(aH(r),e,t),d=(this.enabled?oH:sH)(h),c=i.diffIdentityProvider?(e,t)=>i.diffIdentityProvider.getId(e)===i.diffIdentityProvider.getId(t):void 0;if(Td(d.element.elements,r.element.elements,c))return void this._setChildren(o,d.children||v.empty(),{diffIdentityProvider:n,diffDepth:1});const u=l.children.map((e=>e===r?d:e));this._setChildren(l.element,u,{diffIdentityProvider:n,diffDepth:r.depth-l.depth})}setCompressionEnabled(e){if(e===this.enabled)return;this.enabled=e;const t=this.model.getNode().children,i=v.map(t,aH),n=v.map(i,e?oH:sH);this._setChildren(null,n,{diffIdentityProvider:this.identityProvider,diffDepth:1/0})}_setChildren(e,t,i){const n=new Set;this.model.setChildren(e,t,Object.assign(Object.assign({},i),{onDidCreateNode:e=>{for(const t of e.element.elements)n.add(t),this.nodes.set(t,e.element)},onDidDeleteNode:e=>{for(const t of e.element.elements)n.has(t)||this.nodes.delete(t)}}))}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(void 0===e)return this.model.getNode();const t=this.getCompressedNode(e);return this.model.getNode(t)}getNodeLocation(e){const t=this.model.getNodeLocation(e);return null===t?null:t.elements[t.elements.length-1]}getParentNodeLocation(e){const t=this.getCompressedNode(e),i=this.model.getParentNodeLocation(t);return null===i?null:i.elements[i.elements.length-1]}getFirstElementChild(e){const t=this.getCompressedNode(e);return this.model.getFirstElementChild(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)}refilter(){this.model.refilter()}getCompressedNode(e){if(null===e)return null;const t=this.nodes.get(e);if(!t)throw new AV(this.user,`Tree element not found: ${e}`);return t}}const dH=e=>e[e.length-1];class cH{get element(){return null===this.node.element?null:this.unwrapper(this.node.element)}get children(){return this.node.children.map((e=>new cH(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}}class uH{get onDidSplice(){return B.map(this.model.onDidSplice,(({insertedNodes:e,deletedNodes:t})=>({insertedNodes:e.map((e=>this.nodeMapper.map(e))),deletedNodes:t.map((e=>this.nodeMapper.map(e)))})))}get onDidChangeCollapseState(){return B.map(this.model.onDidChangeCollapseState,(({node:e,deep:t})=>({node:this.nodeMapper.map(e),deep:t})))}get onDidChangeRenderNodeCount(){return B.map(this.model.onDidChangeRenderNodeCount,(e=>this.nodeMapper.map(e)))}constructor(e,t,i={}){this.rootRef=null,this.elementMapper=i.elementMapper||dH;const n=e=>this.elementMapper(e.elements);this.nodeMapper=new OV((e=>new cH(n,e))),this.model=new hH(e,function(e,t){return{splice(i,n,s){t.splice(i,n,s.map((t=>e.map(t))))},updateElementHeight(e,i){t.updateElementHeight(e,i)}}}(this.nodeMapper,t),function(e,t){return Object.assign(Object.assign({},t),{identityProvider:t.identityProvider&&{getId:i=>t.identityProvider.getId(e(i))},sorter:t.sorter&&{compare:(e,i)=>t.sorter.compare(e.elements[0],i.elements[0])},filter:t.filter&&{filter:(i,n)=>t.filter.filter(e(i),n)}})}(n,i))}setChildren(e,t=v.empty(),i={}){this.model.setChildren(e,t,i)}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 null==t?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)}refilter(){return this.model.refilter()}getCompressedTreeNode(e=null){return this.model.getNode(e)}}var gH=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};class pH extends iH{get onDidChangeCollapseState(){return this.model.onDidChangeCollapseState}constructor(e,t,i,n,s={}){super(e,t,i,n,s),this.user=e}setChildren(e,t=v.empty(),i){this.model.setChildren(e,t,i)}rerender(e){void 0!==e?this.model.rerender(e):this.view.rerender()}hasElement(e){return this.model.has(e)}createModel(e,t,i){return new nH(e,t,i)}}class mH{get compressedTreeNodeProvider(){return this._compressedTreeNodeProvider()}constructor(e,t){this._compressedTreeNodeProvider=e,this.renderer=t,this.templateId=t.templateId,t.onDidChangeTwistieState&&(this.onDidChangeTwistieState=t.onDidChangeTwistieState)}renderTemplate(e){return{compressedTreeNode:void 0,data:this.renderer.renderTemplate(e)}}renderElement(e,t,i,n){const s=this.compressedTreeNodeProvider.getCompressedTreeNode(e.element);1===s.element.elements.length?(i.compressedTreeNode=void 0,this.renderer.renderElement(e,t,i.data,n)):(i.compressedTreeNode=s,this.renderer.renderCompressedElements(s,t,i.data,n))}disposeElement(e,t,i,n){var s,o,r,a;i.compressedTreeNode?null===(o=(s=this.renderer).disposeCompressedElements)||void 0===o||o.call(s,i.compressedTreeNode,t,i.data,n):null===(a=(r=this.renderer).disposeElement)||void 0===a||a.call(r,e,t,i.data,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.data)}renderTwistie(e,t){return!!this.renderer.renderTwistie&&this.renderer.renderTwistie(e,t)}}gH([qL],mH.prototype,"compressedTreeNodeProvider",null);class fH extends pH{constructor(e,t,i,n,s={}){const o=()=>this;super(e,t,i,n.map((e=>new mH(o,e))),function(e,t){return t&&Object.assign(Object.assign({},t),{keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&{getKeyboardNavigationLabel(i){let n;try{n=e().getCompressedTreeNode(i)}catch(ge){return t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i)}return 1===n.element.elements.length?t.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(i):t.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(n.element.elements)}}})}(o,s))}setChildren(e,t=v.empty(),i){this.model.setChildren(e,t,i)}createModel(e,t,i){return new uH(e,t,i)}updateOptions(e={}){super.updateOptions(e),void 0!==e.compressionEnabled&&this.model.setCompressionEnabled(e.compressionEnabled)}getCompressedTreeNode(e=null){return this.model.getCompressedTreeNode(e)}}var _H=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function vH(e){return Object.assign(Object.assign({},e),{children:[],refreshPromise:void 0,stale:!0,slow:!1,collapsedByDefault:void 0})}function bH(e,t){return!!t.parent&&(t.parent===e||bH(e,t.parent))}class CH{get element(){return this.node.element.element}get children(){return this.node.children.map((e=>new CH(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 wH{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(...ta.asClassNameArray(Jr.treeItemLoading)),!0):(t.classList.remove(...ta.asClassNameArray(Jr.treeItemLoading)),!1)}disposeElement(e,t,i,n){var s,o;null===(o=(s=this.renderer).disposeElement)||void 0===o||o.call(s,this.nodeMapper.map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear()}}function yH(e){return{browserEvent:e.browserEvent,elements:e.elements.map((e=>e.element))}}function SH(e){return{browserEvent:e.browserEvent,element:e.element&&e.element.element,target:e.target}}class LH extends KD{constructor(e){super(e.elements.map((e=>e.element))),this.data=e}}function kH(e){return e instanceof KD?new LH(e):e}class DH{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((e=>e.element)),t)}onDragStart(e,t){var i,n;null===(n=(i=this.dnd).onDragStart)||void 0===n||n.call(i,kH(e),t)}onDragOver(e,t,i,n,s=!0){return this.dnd.onDragOver(kH(e),t&&t.element,i,n)}drop(e,t,i,n){this.dnd.drop(kH(e),t&&t.element,i,n)}onDragEnd(e){var t,i;null===(i=(t=this.dnd).onDragEnd)||void 0===i||i.call(t,e)}dispose(){this.dnd.dispose()}}function xH(e){return e&&Object.assign(Object.assign({},e),{collapseByDefault:!0,identityProvider:e.identityProvider&&{getId:t=>e.identityProvider.getId(t.element)},dnd:e.dnd&&new DH(e.dnd),multipleSelectionController:e.multipleSelectionController&&{isSelectionSingleChangeEvent:t=>e.multipleSelectionController.isSelectionSingleChangeEvent(Object.assign(Object.assign({},t),{element:t.element})),isSelectionRangeChangeEvent:t=>e.multipleSelectionController.isSelectionRangeChangeEvent(Object.assign(Object.assign({},t),{element:t.element}))},accessibilityProvider:e.accessibilityProvider&&Object.assign(Object.assign({},e.accessibilityProvider),{getPosInSet:void 0,getSetSize:void 0,getRole:e.accessibilityProvider.getRole?t=>e.accessibilityProvider.getRole(t.element):()=>"treeitem",isChecked:e.accessibilityProvider.isChecked?t=>{var i;return!!(null===(i=e.accessibilityProvider)||void 0===i?void 0:i.isChecked(t.element))}:void 0,getAriaLabel:t=>e.accessibilityProvider.getAriaLabel(t.element),getWidgetAriaLabel:()=>e.accessibilityProvider.getWidgetAriaLabel(),getWidgetRole:e.accessibilityProvider.getWidgetRole?()=>e.accessibilityProvider.getWidgetRole():()=>"tree",getAriaLevel:e.accessibilityProvider.getAriaLevel&&(t=>e.accessibilityProvider.getAriaLevel(t.element)),getActiveDescendantId:e.accessibilityProvider.getActiveDescendantId&&(t=>e.accessibilityProvider.getActiveDescendantId(t.element))}),filter:e.filter&&{filter:(t,i)=>e.filter.filter(t.element,i)},keyboardNavigationLabelProvider:e.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},e.keyboardNavigationLabelProvider),{getKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getKeyboardNavigationLabel(t.element)}),sorter:void 0,expandOnlyOnTwistieClick:void 0===e.expandOnlyOnTwistieClick?void 0:"function"!=typeof e.expandOnlyOnTwistieClick?e.expandOnlyOnTwistieClick:t=>e.expandOnlyOnTwistieClick(t.element),defaultFindVisibility:t=>t.hasChildren&&t.stale?1:"number"==typeof e.defaultFindVisibility?e.defaultFindVisibility:void 0===e.defaultFindVisibility?2:e.defaultFindVisibility(t.element)})}function NH(e,t){t(e),e.children.forEach((e=>NH(e,t)))}class EH{get onDidScroll(){return this.tree.onDidScroll}get onDidChangeFocus(){return B.map(this.tree.onDidChangeFocus,yH)}get onDidChangeSelection(){return B.map(this.tree.onDidChangeSelection,yH)}get onMouseDblClick(){return B.map(this.tree.onMouseDblClick,SH)}get onPointer(){return B.map(this.tree.onPointer,SH)}get onDidFocus(){return this.tree.onDidFocus}get onDidChangeModel(){return this.tree.onDidChangeModel}get onDidChangeCollapseState(){return this.tree.onDidChangeCollapseState}get onDidChangeFindOpenState(){return this.tree.onDidChangeFindOpenState}get onDidDispose(){return this.tree.onDidDispose}constructor(e,t,i,n,s,o={}){this.user=e,this.dataSource=s,this.nodes=new Map,this.subTreeRefreshPromises=new Map,this.refreshPromises=new Map,this._onDidRender=new U,this._onDidChangeNodeSlowState=new U,this.nodeMapper=new OV((e=>new CH(e))),this.disposables=new N,this.identityProvider=o.identityProvider,this.autoExpandSingleChildren=void 0!==o.autoExpandSingleChildren&&o.autoExpandSingleChildren,this.sorter=o.sorter,this.collapseByDefault=o.collapseByDefault,this.tree=this.createTree(e,t,i,n,o),this.onDidChangeFindMode=this.tree.onDidChangeFindMode,this.root=vH({element:void 0,parent:null,hasChildren:!0}),this.identityProvider&&(this.root=Object.assign(Object.assign({},this.root),{id:null})),this.nodes.set(null,this.root),this.tree.onDidChangeCollapseState(this._onDidChangeCollapseState,this,this.disposables)}createTree(e,t,i,n,s){const o=new KV(i),r=n.map((e=>new wH(e,this.nodeMapper,this._onDidChangeNodeSlowState.event))),a=xH(s)||{};return new pH(e,t,o,r,a)}updateOptions(e={}){this.tree.updateOptions(e)}getHTMLElement(){return this.tree.getHTMLElement()}get scrollTop(){return this.tree.scrollTop}set scrollTop(e){this.tree.scrollTop=e}get scrollHeight(){return this.tree.scrollHeight}get renderHeight(){return this.tree.renderHeight}domFocus(){this.tree.domFocus()}layout(e,t){this.tree.layout(e,t)}style(e){this.tree.style(e)}getInput(){return this.root.element}setInput(e,t){return _H(this,void 0,void 0,(function*(){this.refreshPromises.forEach((e=>e.cancel())),this.refreshPromises.clear(),this.root.element=e;const i=t&&{viewState:t,focus:[],selection:[]};yield this._updateChildren(e,!0,!1,i),i&&(this.tree.setFocus(i.focus),this.tree.setSelection(i.selection)),t&&"number"==typeof t.scrollTop&&(this.scrollTop=t.scrollTop)}))}_updateChildren(e=this.root.element,t=!0,i=!1,n,s){return _H(this,void 0,void 0,(function*(){if(void 0===this.root.element)throw new AV(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield B.toPromise(this._onDidRender.event));const o=this.getDataNode(e);if(yield this.refreshAndRenderNode(o,t,n,s),i)try{this.tree.rerender(o)}catch(ge){}}))}rerender(e){if(void 0===e||e===this.root.element)return void this.tree.rerender();const t=this.getDataNode(e);this.tree.rerender(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)}expand(e,t=!1){return _H(this,void 0,void 0,(function*(){if(void 0===this.root.element)throw new AV(this.user,"Tree input not set");this.root.refreshPromise&&(yield this.root.refreshPromise,yield B.toPromise(this._onDidRender.event));const i=this.getDataNode(e);if(this.tree.hasElement(i)&&!this.tree.isCollapsible(i))return!1;if(i.refreshPromise&&(yield this.root.refreshPromise,yield B.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&&(yield this.root.refreshPromise,yield B.toPromise(this._onDidRender.event)),n}))}setSelection(e,t){const i=e.map((e=>this.getDataNode(e)));this.tree.setSelection(i,t)}getSelection(){return this.tree.getSelection().map((e=>e.element))}setFocus(e,t){const i=e.map((e=>this.getDataNode(e)));this.tree.setFocus(i,t)}getFocus(){return this.tree.getFocus().map((e=>e.element))}reveal(e,t){this.tree.reveal(this.getDataNode(e),t)}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 AV(this.user,`Data tree node not found: ${e}`);return t}refreshAndRenderNode(e,t,i,n){return _H(this,void 0,void 0,(function*(){yield this.refreshNode(e,t,i),this.render(e,i,n)}))}refreshNode(e,t,i){return _H(this,void 0,void 0,(function*(){let n;if(this.subTreeRefreshPromises.forEach(((s,o)=>{!n&&function(e,t){return e===t||bH(e,t)||bH(t,e)}(o,e)&&(n=s.then((()=>this.refreshNode(e,t,i))))})),n)return n;if(e!==this.root){if(this.tree.getNode(e).collapsed)return e.hasChildren=!!this.dataSource.hasChildren(e.element),void(e.stale=!0)}return this.doRefreshSubTree(e,t,i)}))}doRefreshSubTree(e,t,i){return _H(this,void 0,void 0,(function*(){let n;e.refreshPromise=new Promise((e=>n=e)),this.subTreeRefreshPromises.set(e,e.refreshPromise),e.refreshPromise.finally((()=>{e.refreshPromise=void 0,this.subTreeRefreshPromises.delete(e)}));try{const n=yield this.doRefreshNode(e,t,i);e.stale=!1,yield dd.settled(n.map((e=>this.doRefreshSubTree(e,t,i))))}finally{n()}}))}doRefreshNode(e,t,i){return _H(this,void 0,void 0,(function*(){let n;if(e.hasChildren=!!this.dataSource.hasChildren(e.element),e.hasChildren){const t=this.doGetChildren(e);if(Hr(t))n=Promise.resolve(t);else{const i=td(800);i.then((()=>{e.slow=!0,this._onDidChangeNodeSlowState.fire(e)}),(e=>null)),n=t.finally((()=>i.cancel()))}}else n=Promise.resolve(v.empty());try{const s=yield n;return this.setChildren(e,s,t,i)}catch(s){if(e!==this.root&&this.tree.hasElement(e)&&this.tree.collapse(e),d(s))return[];throw s}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 Hr(i)?this.processChildren(i):(t=Yh((()=>_H(this,void 0,void 0,(function*(){return this.processChildren(yield i)})))),this.refreshPromises.set(e,t),t.finally((()=>{this.refreshPromises.delete(e)})))}_onDidChangeCollapseState({node:e,deep:t}){null!==e.element&&!e.collapsed&&e.element.stale&&(t?this.collapse(e.element.element):this.refreshAndRenderNode(e.element,!1).catch(r))}setChildren(e,t,i,n){const s=[...t];if(0===e.children.length&&0===s.length)return[];const o=new Map,r=new Map;for(const h of e.children)if(o.set(h.element,h),this.identityProvider){const e=this.tree.isCollapsed(h);r.set(h.id,{node:h,collapsed:e})}const a=[],l=s.map((t=>{const s=!!this.dataSource.hasChildren(t);if(!this.identityProvider){const i=vH({element:t,parent:e,hasChildren:s});return s&&this.collapseByDefault&&!this.collapseByDefault(t)&&(i.collapsedByDefault=!1,a.push(i)),i}const l=this.identityProvider.getId(t).toString(),h=r.get(l);if(h){const e=h.node;return o.delete(e.element),this.nodes.delete(e.element),this.nodes.set(t,e),e.element=t,e.hasChildren=s,i?h.collapsed?(e.children.forEach((e=>NH(e,(e=>this.nodes.delete(e.element))))),e.children.splice(0,e.children.length),e.stale=!0):a.push(e):s&&this.collapseByDefault&&!this.collapseByDefault(t)&&(e.collapsedByDefault=!1,a.push(e)),e}const d=vH({element:t,parent:e,id:l,hasChildren:s});return n&&n.viewState.focus&&n.viewState.focus.indexOf(l)>-1&&n.focus.push(d),n&&n.viewState.selection&&n.viewState.selection.indexOf(l)>-1&&n.selection.push(d),n&&n.viewState.expanded&&n.viewState.expanded.indexOf(l)>-1?a.push(d):s&&this.collapseByDefault&&!this.collapseByDefault(t)&&(d.collapsedByDefault=!1,a.push(d)),d}));for(const h of o.values())NH(h,(e=>this.nodes.delete(e.element)));for(const h of l)this.nodes.set(h.element,h);return e.children.splice(0,e.children.length,...l),e!==this.root&&this.autoExpandSingleChildren&&1===l.length&&0===a.length&&(l[0].collapsedByDefault=!1,a.push(l[0])),a}render(e,t,i){const n=e.children.map((e=>this.asTreeElement(e,t))),s=i&&Object.assign(Object.assign({},i),{diffIdentityProvider:i.diffIdentityProvider&&{getId:e=>i.diffIdentityProvider.getId(e.element)}});this.tree.setChildren(e===this.root?null:e,n,s),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 i=!(t&&t.viewState.expanded&&e.id&&t.viewState.expanded.indexOf(e.id)>-1)&&e.collapsedByDefault,e.collapsedByDefault=void 0,{element:e,children:e.hasChildren?v.map(e.children,(e=>this.asTreeElement(e,t))):[],collapsible:e.hasChildren,collapsed:i}}processChildren(e){return this.sorter&&(e=[...e].sort(this.sorter.compare.bind(this.sorter))),e}dispose(){this.disposables.dispose(),this.tree.dispose()}}class IH{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 IH(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 MH{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(...ta.asClassNameArray(Jr.treeItemLoading)),!0):(t.classList.remove(...ta.asClassNameArray(Jr.treeItemLoading)),!1)}disposeElement(e,t,i,n){var s,o;null===(o=(s=this.renderer).disposeElement)||void 0===o||o.call(s,this.nodeMapper.map(e),t,i.templateData,n)}disposeCompressedElements(e,t,i,n){var s,o;null===(o=(s=this.renderer).disposeCompressedElements)||void 0===o||o.call(s,this.compressibleNodeMapperProvider().map(e),t,i.templateData,n)}disposeTemplate(e){this.renderer.disposeTemplate(e.templateData)}dispose(){this.renderedNodes.clear(),this.disposables=k(this.disposables)}}class TH extends EH{constructor(e,t,i,n,s,o,r={}){super(e,t,i,s,o,r),this.compressionDelegate=n,this.compressibleNodeMapper=new OV((e=>new IH(e))),this.filter=r.filter}createTree(e,t,i,n,s){const o=new KV(i),r=n.map((e=>new MH(e,this.nodeMapper,(()=>this.compressibleNodeMapper),this._onDidChangeNodeSlowState.event))),a=function(e){const t=e&&xH(e);return t&&Object.assign(Object.assign({},t),{keyboardNavigationLabelProvider:t.keyboardNavigationLabelProvider&&Object.assign(Object.assign({},t.keyboardNavigationLabelProvider),{getCompressedNodeKeyboardNavigationLabel:t=>e.keyboardNavigationLabelProvider.getCompressedNodeKeyboardNavigationLabel(t.map((e=>e.element)))})})}(s)||{};return new fH(e,t,o,r,a)}asTreeElement(e,t){return Object.assign({incompressible:this.compressionDelegate.isIncompressible(e.element)},super.asTreeElement(e,t))}updateOptions(e={}){this.tree.updateOptions(e)}render(e,t){if(!this.identityProvider)return super.render(e,t);const i=e=>this.identityProvider.getId(e).toString(),n=e=>{const t=new Set;for(const n of e){const e=this.tree.getCompressedTreeNode(n===this.root?null:n);if(e.element)for(const n of e.element.elements)t.add(i(n.element))}return t},s=n(this.tree.getSelection()),o=n(this.tree.getFocus());super.render(e,t);const r=this.getSelection();let a=!1;const l=this.getFocus();let h=!1;const d=e=>{const t=e.element;if(t)for(let n=0;n{const t=this.filter.filter(e,1),i="boolean"==typeof(n=t)?n?1:0:PV(n)?FV(n.visibility):FV(n);var n;if(2===i)throw new Error("Recursive tree visibility not supported in async data compressed trees");return 1===i}))),super.processChildren(e)}}class RH extends iH{constructor(e,t,i,n,s,o={}){super(e,t,i,n,o),this.user=e,this.dataSource=s,this.identityProvider=o.identityProvider}createModel(e,t,i){return new nH(e,t,i)}}new Al("isMac",Pe,ue(0,"Whether the operating system is macOS")),new Al("isLinux",Fe,ue(0,"Whether the operating system is Linux"));const AH=new Al("isWindows",Oe,ue(0,"Whether the operating system is Windows")),OH=new Al("isWeb",We,ue(0,"Whether the platform is a web browser")),PH=(new Al("isMacNative",Pe&&!We,ue(0,"Whether the operating system is macOS on a non-browser platform")),new Al("isIOS",He,ue(0,"Whether the operating system is iOS")),new Al("isMobile",ze,ue(0,"Whether the platform is a mobile web browser")),new Al("isDevelopment",!1,!0),new Al("productQualityType","",ue(0,"Quality type of VS Code")),"inputFocus");new Al(PH,!1,ue(0,"Whether keyboard focus is inside an input box"));var FH=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},BH=function(e,t){return function(i,n){t(i,n,e)}};const WH=Ba("listService");const VH=new Al("listScrollAtBoundary","none"),HH=(pl.or(VH.isEqualTo("top"),VH.isEqualTo("both")),pl.or(VH.isEqualTo("bottom"),VH.isEqualTo("both")),new Al("listFocus",!0)),zH=new Al("listSupportsMultiselect",!0),UH=pl.and(HH,pl.not(PH)),KH=new Al("listHasSelectionOrFocus",!1),jH=new Al("listDoubleSelection",!1),qH=new Al("listMultiSelection",!1),$H=new Al("listSelectionNavigation",!1),GH=new Al("listSupportsFind",!0),ZH=new Al("treeElementCanCollapse",!1),YH=new Al("treeElementHasParent",!1),XH=new Al("treeElementCanExpand",!1),QH=new Al("treeElementHasChild",!1),JH=new Al("treeFindOpen",!1),ez="listTypeNavigationMode",tz="listAutomaticKeyboardNavigation";function iz(e,t){const i=e.createScoped(t.getHTMLElement());return HH.bindTo(i),i}function nz(e,t){const i=VH.bindTo(e),n=()=>{const e=0===t.scrollTop,n=t.scrollHeight-t.renderHeight-t.scrollTop<1;e&&n?i.set("both"):e?i.set("top"):n?i.set("bottom"):i.set("none")};return n(),t.onDidScroll(n)}const sz="workbench.list.multiSelectModifier",oz="workbench.list.openMode",rz="workbench.list.horizontalScrolling",az="workbench.list.defaultFindMode",lz="workbench.list.typeNavigationMode",hz="workbench.list.keyboardNavigation",dz="workbench.list.scrollByPage",cz="workbench.list.defaultFindMatchType",uz="workbench.tree.indent",gz="workbench.tree.renderIndentGuides",pz="workbench.list.smoothScrolling",mz="workbench.list.mouseWheelScrollSensitivity",fz="workbench.list.fastScrollSensitivity",_z="workbench.tree.expandMode";function vz(e){return"alt"===e.getValue(sz)}class bz extends E{constructor(e){super(),this.configurationService=e,this.useAltAsMultipleSelectionModifier=vz(e),this.registerListeners()}registerListeners(){this._register(this.configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration(sz)&&(this.useAltAsMultipleSelectionModifier=vz(this.configurationService))})))}isSelectionSingleChangeEvent(e){return this.useAltAsMultipleSelectionModifier?e.browserEvent.altKey:dx(e)}isSelectionRangeChangeEvent(e){return cx(e)}}function Cz(e,t){var i;const n=e.get(pu),s=e.get(WL),o=new N;return[Object.assign(Object.assign({},t),{keyboardNavigationDelegate:{mightProducePrintableCharacter:e=>s.mightProducePrintableCharacter(e)},smoothScrolling:Boolean(n.getValue(pz)),mouseWheelScrollSensitivity:n.getValue(mz),fastScrollSensitivity:n.getValue(fz),multipleSelectionController:null!==(i=t.multipleSelectionController)&&void 0!==i?i:o.add(new bz(n)),keyboardNavigationEventFilter:Nz(s),scrollByPage:Boolean(n.getValue(dz))}),o]}let wz=class extends yx{constructor(e,t,i,n,s,o,r,a,l){const h=void 0!==s.horizontalScrolling?s.horizontalScrolling:Boolean(a.getValue(rz)),[d,c]=l.invokeFunction(Cz,s);super(e,t,i,n,Object.assign(Object.assign({keyboardSupport:!1},d),{horizontalScrolling:h})),this.disposables.add(c),this.contextKeyService=iz(o,this),this.disposables.add(nz(this.contextKeyService,this)),this.listSupportsMultiSelect=zH.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==s.multipleSelectionSupport);$H.bindTo(this.contextKeyService).set(Boolean(s.selectionNavigation)),this.listHasSelectionOrFocus=KH.bindTo(this.contextKeyService),this.listDoubleSelection=jH.bindTo(this.contextKeyService),this.listMultiSelection=qH.bindTo(this.contextKeyService),this.horizontalScrolling=s.horizontalScrolling,this._useAltAsMultipleSelectionModifier=vz(a),this.disposables.add(this.contextKeyService),this.disposables.add(r.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(this.onDidChangeSelection((()=>{const e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(2===e.length)}))}))),this.disposables.add(this.onDidChangeFocus((()=>{const e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)}))),this.disposables.add(a.onDidChangeConfiguration((e=>{e.affectsConfiguration(sz)&&(this._useAltAsMultipleSelectionModifier=vz(a));let t={};if(e.affectsConfiguration(rz)&&void 0===this.horizontalScrolling){const e=Boolean(a.getValue(rz));t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(dz)){const e=Boolean(a.getValue(dz));t=Object.assign(Object.assign({},t),{scrollByPage:e})}if(e.affectsConfiguration(pz)){const e=Boolean(a.getValue(pz));t=Object.assign(Object.assign({},t),{smoothScrolling:e})}if(e.affectsConfiguration(mz)){const e=a.getValue(mz);t=Object.assign(Object.assign({},t),{mouseWheelScrollSensitivity:e})}if(e.affectsConfiguration(fz)){const e=a.getValue(fz);t=Object.assign(Object.assign({},t),{fastScrollSensitivity:e})}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new kz(this,Object.assign({configurationService:a},s)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?Jx(e):Qx)}};wz=FH([BH(5,Ol),BH(6,WH),BH(7,pu),BH(8,Fa)],wz);let yz=class extends aV{constructor(e,t,i,n,s,o,r,a,l){const h=void 0!==s.horizontalScrolling?s.horizontalScrolling:Boolean(a.getValue(rz)),[d,c]=l.invokeFunction(Cz,s);super(e,t,i,n,Object.assign(Object.assign({keyboardSupport:!1},d),{horizontalScrolling:h})),this.disposables=new N,this.disposables.add(c),this.contextKeyService=iz(o,this),this.disposables.add(nz(this.contextKeyService,this.widget)),this.horizontalScrolling=s.horizontalScrolling,this.listSupportsMultiSelect=zH.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==s.multipleSelectionSupport);$H.bindTo(this.contextKeyService).set(Boolean(s.selectionNavigation)),this._useAltAsMultipleSelectionModifier=vz(a),this.disposables.add(this.contextKeyService),this.disposables.add(r.register(this)),this.updateStyles(s.overrideStyles),this.disposables.add(a.onDidChangeConfiguration((e=>{e.affectsConfiguration(sz)&&(this._useAltAsMultipleSelectionModifier=vz(a));let t={};if(e.affectsConfiguration(rz)&&void 0===this.horizontalScrolling){const e=Boolean(a.getValue(rz));t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(dz)){const e=Boolean(a.getValue(dz));t=Object.assign(Object.assign({},t),{scrollByPage:e})}if(e.affectsConfiguration(pz)){const e=Boolean(a.getValue(pz));t=Object.assign(Object.assign({},t),{smoothScrolling:e})}if(e.affectsConfiguration(mz)){const e=a.getValue(mz);t=Object.assign(Object.assign({},t),{mouseWheelScrollSensitivity:e})}if(e.affectsConfiguration(fz)){const e=a.getValue(fz);t=Object.assign(Object.assign({},t),{fastScrollSensitivity:e})}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new kz(this,Object.assign({configurationService:a},s)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?Jx(e):Qx)}dispose(){this.disposables.dispose(),super.dispose()}};yz=FH([BH(5,Ol),BH(6,WH),BH(7,pu),BH(8,Fa)],yz);let Sz=class extends _V{constructor(e,t,i,n,s,o,r,a,l,h){const d=void 0!==o.horizontalScrolling?o.horizontalScrolling:Boolean(l.getValue(rz)),[c,u]=h.invokeFunction(Cz,o);super(e,t,i,n,s,Object.assign(Object.assign({keyboardSupport:!1},c),{horizontalScrolling:d})),this.disposables.add(u),this.contextKeyService=iz(r,this),this.disposables.add(nz(this.contextKeyService,this)),this.listSupportsMultiSelect=zH.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==o.multipleSelectionSupport);$H.bindTo(this.contextKeyService).set(Boolean(o.selectionNavigation)),this.listHasSelectionOrFocus=KH.bindTo(this.contextKeyService),this.listDoubleSelection=jH.bindTo(this.contextKeyService),this.listMultiSelection=qH.bindTo(this.contextKeyService),this.horizontalScrolling=o.horizontalScrolling,this._useAltAsMultipleSelectionModifier=vz(l),this.disposables.add(this.contextKeyService),this.disposables.add(a.register(this)),this.updateStyles(o.overrideStyles),this.disposables.add(this.onDidChangeSelection((()=>{const e=this.getSelection(),t=this.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.listHasSelectionOrFocus.set(e.length>0||t.length>0),this.listMultiSelection.set(e.length>1),this.listDoubleSelection.set(2===e.length)}))}))),this.disposables.add(this.onDidChangeFocus((()=>{const e=this.getSelection(),t=this.getFocus();this.listHasSelectionOrFocus.set(e.length>0||t.length>0)}))),this.disposables.add(l.onDidChangeConfiguration((e=>{e.affectsConfiguration(sz)&&(this._useAltAsMultipleSelectionModifier=vz(l));let t={};if(e.affectsConfiguration(rz)&&void 0===this.horizontalScrolling){const e=Boolean(l.getValue(rz));t=Object.assign(Object.assign({},t),{horizontalScrolling:e})}if(e.affectsConfiguration(dz)){const e=Boolean(l.getValue(dz));t=Object.assign(Object.assign({},t),{scrollByPage:e})}if(e.affectsConfiguration(pz)){const e=Boolean(l.getValue(pz));t=Object.assign(Object.assign({},t),{smoothScrolling:e})}if(e.affectsConfiguration(mz)){const e=l.getValue(mz);t=Object.assign(Object.assign({},t),{mouseWheelScrollSensitivity:e})}if(e.affectsConfiguration(fz)){const e=l.getValue(fz);t=Object.assign(Object.assign({},t),{fastScrollSensitivity:e})}Object.keys(t).length>0&&this.updateOptions(t)}))),this.navigator=new Dz(this,Object.assign({configurationService:l},o)),this.disposables.add(this.navigator)}updateOptions(e){super.updateOptions(e),void 0!==e.overrideStyles&&this.updateStyles(e.overrideStyles),void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyles(e){this.style(e?Jx(e):Qx)}dispose(){this.disposables.dispose(),super.dispose()}};Sz=FH([BH(6,Ol),BH(7,WH),BH(8,pu),BH(9,Fa)],Sz);class Lz extends E{constructor(e,t){var i;super(),this.widget=e,this._onDidOpen=this._register(new U),this.onDidOpen=this._onDidOpen.event,this._register(B.filter(this.widget.onDidChangeSelection,(e=>e.browserEvent instanceof KeyboardEvent))((e=>this.onSelectionFromKeyboard(e)))),this._register(this.widget.onPointer((e=>this.onPointer(e.element,e.browserEvent)))),this._register(this.widget.onMouseDblClick((e=>this.onMouseDblClick(e.element,e.browserEvent)))),"boolean"!=typeof(null==t?void 0:t.openOnSingleClick)&&(null==t?void 0:t.configurationService)?(this.openOnSingleClick="doubleClick"!==(null==t?void 0:t.configurationService.getValue(oz)),this._register(null==t?void 0:t.configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration(oz)&&(this.openOnSingleClick="doubleClick"!==(null==t?void 0:t.configurationService.getValue(oz)))})))):this.openOnSingleClick=null===(i=null==t?void 0:t.openOnSingleClick)||void 0===i||i}onSelectionFromKeyboard(e){if(1!==e.elements.length)return;const t=e.browserEvent,i="boolean"!=typeof t.preserveFocus||t.preserveFocus,n="boolean"==typeof t.pinned?t.pinned:!i;this._open(this.getSelectedElement(),i,n,!1,e.browserEvent)}onPointer(e,t){if(!this.openOnSingleClick)return;if(2===t.detail)return;const i=1===t.button,n=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!0,i,n,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 n=t.ctrlKey||t.metaKey||t.altKey;this._open(e,!1,!0,n,t)}_open(e,t,i,n,s){e&&this._onDidOpen.fire({editorOptions:{preserveFocus:t,pinned:i,revealIfVisible:!0},sideBySide:n,element:e,browserEvent:s})}}class kz extends Lz{constructor(e,t){super(e,t),this.widget=e}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class Dz extends Lz{constructor(e,t){super(e,t)}getSelectedElement(){return this.widget.getSelectedElements()[0]}}class xz extends Lz{constructor(e,t){super(e,t)}getSelectedElement(){var e;return null!==(e=this.widget.getSelection()[0])&&void 0!==e?e:void 0}}function Nz(e){let t=!1;return i=>{if(i.toKeyCodeChord().isModifierKey())return!1;if(t)return t=!1,!1;const n=e.softDispatch(i,i.target);return 1===n.kind?(t=!0,!1):(t=!1,0===n.kind)}}let Ez=class extends pH{constructor(e,t,i,n,s,o,r,a,l){const{options:h,getTypeNavigationMode:d,disposable:c}=o.invokeFunction(Pz,s);super(e,t,i,n,h),this.disposables.add(c),this.internals=new Fz(this,s,d,s.overrideStyles,r,a,l),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};Ez=FH([BH(5,Fa),BH(6,Ol),BH(7,WH),BH(8,pu)],Ez);let Iz=class extends fH{constructor(e,t,i,n,s,o,r,a,l){const{options:h,getTypeNavigationMode:d,disposable:c}=o.invokeFunction(Pz,s);super(e,t,i,n,h),this.disposables.add(c),this.internals=new Fz(this,s,d,s.overrideStyles,r,a,l),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};Iz=FH([BH(5,Fa),BH(6,Ol),BH(7,WH),BH(8,pu)],Iz);let Mz=class extends RH{constructor(e,t,i,n,s,o,r,a,l,h){const{options:d,getTypeNavigationMode:c,disposable:u}=r.invokeFunction(Pz,o);super(e,t,i,n,s,d),this.disposables.add(u),this.internals=new Fz(this,o,c,o.overrideStyles,a,l,h),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),void 0!==e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};Mz=FH([BH(6,Fa),BH(7,Ol),BH(8,WH),BH(9,pu)],Mz);let Tz=class extends EH{get onDidOpen(){return this.internals.onDidOpen}constructor(e,t,i,n,s,o,r,a,l,h){const{options:d,getTypeNavigationMode:c,disposable:u}=r.invokeFunction(Pz,o);super(e,t,i,n,s,d),this.disposables.add(u),this.internals=new Fz(this,o,c,o.overrideStyles,a,l,h),this.disposables.add(this.internals)}updateOptions(e={}){super.updateOptions(e),e.overrideStyles&&this.internals.updateStyleOverrides(e.overrideStyles),this.internals.updateOptions(e)}};Tz=FH([BH(6,Fa),BH(7,Ol),BH(8,WH),BH(9,pu)],Tz);let Rz=class extends TH{constructor(e,t,i,n,s,o,r,a,l,h,d){const{options:c,getTypeNavigationMode:u,disposable:g}=a.invokeFunction(Pz,r);super(e,t,i,n,s,o,c),this.disposables.add(g),this.internals=new Fz(this,r,u,r.overrideStyles,l,h,d),this.disposables.add(this.internals)}updateOptions(e){super.updateOptions(e),this.internals.updateOptions(e)}};function Az(e){const t=e.getValue(az);if("highlight"===t)return GV.Highlight;if("filter"===t)return GV.Filter;const i=e.getValue(hz);return"simple"===i||"highlight"===i?GV.Highlight:"filter"===i?GV.Filter:void 0}function Oz(e){const t=e.getValue(cz);return"fuzzy"===t?ZV.Fuzzy:"contiguous"===t?ZV.Contiguous:void 0}function Pz(e,t){var i;const n=e.get(pu),s=e.get(Ux),o=e.get(Ol),r=e.get(Fa),a=void 0!==t.horizontalScrolling?t.horizontalScrolling:Boolean(n.getValue(rz)),[l,h]=r.invokeFunction(Cz,t),d=t.paddingBottom,c=void 0!==t.renderIndentGuides?t.renderIndentGuides:n.getValue(gz);return{getTypeNavigationMode:()=>{const e=o.getContextKeyValue(ez);if("automatic"===e)return ZD.Automatic;if("trigger"===e)return ZD.Trigger;if(!1===o.getContextKeyValue(tz))return ZD.Trigger;const t=n.getValue(lz);return"automatic"===t?ZD.Automatic:"trigger"===t?ZD.Trigger:void 0},disposable:h,options:Object.assign(Object.assign({keyboardSupport:!1},l),{indent:"number"==typeof n.getValue(uz)?n.getValue(uz):void 0,renderIndentGuides:c,smoothScrolling:Boolean(n.getValue(pz)),defaultFindMode:Az(n),defaultFindMatchType:Oz(n),horizontalScrolling:a,scrollByPage:Boolean(n.getValue(dz)),paddingBottom:d,hideTwistiesOfChildlessElements:t.hideTwistiesOfChildlessElements,expandOnlyOnTwistieClick:null!==(i=t.expandOnlyOnTwistieClick)&&void 0!==i?i:"doubleClick"===n.getValue(_z),contextViewProvider:s,findWidgetStyles:Yx})}}Rz=FH([BH(7,Fa),BH(8,Ol),BH(9,WH),BH(10,pu)],Rz);let Fz=class{get onDidOpen(){return this.navigator.onDidOpen}constructor(e,t,i,n,s,o,r){var a;this.tree=e,this.disposables=[],this.contextKeyService=iz(s,e),this.disposables.push(nz(this.contextKeyService,e)),this.listSupportsMultiSelect=zH.bindTo(this.contextKeyService),this.listSupportsMultiSelect.set(!1!==t.multipleSelectionSupport);$H.bindTo(this.contextKeyService).set(Boolean(t.selectionNavigation)),this.listSupportFindWidget=GH.bindTo(this.contextKeyService),this.listSupportFindWidget.set(null===(a=t.findWidgetEnabled)||void 0===a||a),this.hasSelectionOrFocus=KH.bindTo(this.contextKeyService),this.hasDoubleSelection=jH.bindTo(this.contextKeyService),this.hasMultiSelection=qH.bindTo(this.contextKeyService),this.treeElementCanCollapse=ZH.bindTo(this.contextKeyService),this.treeElementHasParent=YH.bindTo(this.contextKeyService),this.treeElementCanExpand=XH.bindTo(this.contextKeyService),this.treeElementHasChild=QH.bindTo(this.contextKeyService),this.treeFindOpen=JH.bindTo(this.contextKeyService),this._useAltAsMultipleSelectionModifier=vz(r),this.updateStyleOverrides(n);const l=()=>{const t=e.getFocus()[0];if(!t)return;const i=e.getNode(t);this.treeElementCanCollapse.set(i.collapsible&&!i.collapsed),this.treeElementHasParent.set(!!e.getParentElement(t)),this.treeElementCanExpand.set(i.collapsible&&i.collapsed),this.treeElementHasChild.set(!!e.getFirstElementChild(t))},h=new Set;h.add(ez),h.add(tz),this.disposables.push(this.contextKeyService,o.register(e),e.onDidChangeSelection((()=>{const t=e.getSelection(),i=e.getFocus();this.contextKeyService.bufferChangeEvents((()=>{this.hasSelectionOrFocus.set(t.length>0||i.length>0),this.hasMultiSelection.set(t.length>1),this.hasDoubleSelection.set(2===t.length)}))})),e.onDidChangeFocus((()=>{const t=e.getSelection(),i=e.getFocus();this.hasSelectionOrFocus.set(t.length>0||i.length>0),l()})),e.onDidChangeCollapseState(l),e.onDidChangeModel(l),e.onDidChangeFindOpenState((e=>this.treeFindOpen.set(e))),r.onDidChangeConfiguration((n=>{let s={};if(n.affectsConfiguration(sz)&&(this._useAltAsMultipleSelectionModifier=vz(r)),n.affectsConfiguration(uz)){const e=r.getValue(uz);s=Object.assign(Object.assign({},s),{indent:e})}if(n.affectsConfiguration(gz)&&void 0===t.renderIndentGuides){const e=r.getValue(gz);s=Object.assign(Object.assign({},s),{renderIndentGuides:e})}if(n.affectsConfiguration(pz)){const e=Boolean(r.getValue(pz));s=Object.assign(Object.assign({},s),{smoothScrolling:e})}if(n.affectsConfiguration(az)||n.affectsConfiguration(hz)){const e=Az(r);s=Object.assign(Object.assign({},s),{defaultFindMode:e})}if(n.affectsConfiguration(lz)||n.affectsConfiguration(hz)){const e=i();s=Object.assign(Object.assign({},s),{typeNavigationMode:e})}if(n.affectsConfiguration(cz)){const e=Oz(r);s=Object.assign(Object.assign({},s),{defaultFindMatchType:e})}if(n.affectsConfiguration(rz)&&void 0===t.horizontalScrolling){const e=Boolean(r.getValue(rz));s=Object.assign(Object.assign({},s),{horizontalScrolling:e})}if(n.affectsConfiguration(dz)){const e=Boolean(r.getValue(dz));s=Object.assign(Object.assign({},s),{scrollByPage:e})}if(n.affectsConfiguration(_z)&&void 0===t.expandOnlyOnTwistieClick&&(s=Object.assign(Object.assign({},s),{expandOnlyOnTwistieClick:"doubleClick"===r.getValue(_z)})),n.affectsConfiguration(mz)){const e=r.getValue(mz);s=Object.assign(Object.assign({},s),{mouseWheelScrollSensitivity:e})}if(n.affectsConfiguration(fz)){const e=r.getValue(fz);s=Object.assign(Object.assign({},s),{fastScrollSensitivity:e})}Object.keys(s).length>0&&e.updateOptions(s)})),this.contextKeyService.onDidChangeContext((t=>{t.affectsSome(h)&&e.updateOptions({typeNavigationMode:i()})}))),this.navigator=new xz(e,Object.assign({configurationService:r},t)),this.disposables.push(this.navigator)}updateOptions(e){void 0!==e.multipleSelectionSupport&&this.listSupportsMultiSelect.set(!!e.multipleSelectionSupport)}updateStyleOverrides(e){this.tree.style(e?Jx(e):Qx)}dispose(){this.disposables=k(this.disposables)}};Fz=FH([BH(4,Ol),BH(5,WH),BH(6,pu)],Fz);jl.as(xu).registerConfiguration({id:"workbench",order:7,title:ue(0,"Workbench"),type:"object",properties:{[sz]:{type:"string",enum:["ctrlCmd","alt"],markdownEnumDescriptions:[ue(0,"Maps to `Control` on Windows and Linux and to `Command` on macOS."),ue(0,"Maps to `Alt` on Windows and Linux and to `Option` on macOS.")],default:"ctrlCmd",description:ue(0,"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.")},[oz]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:ue(0,"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.")},[rz]:{type:"boolean",default:!1,description:ue(0,"Controls whether lists and trees support horizontal scrolling in the workbench. Warning: turning on this setting has a performance implication.")},[dz]:{type:"boolean",default:!1,description:ue(0,"Controls whether clicks in the scrollbar scroll page by page.")},[uz]:{type:"number",default:8,minimum:4,maximum:40,description:ue(0,"Controls tree indentation in pixels.")},[gz]:{type:"string",enum:["none","onHover","always"],default:"onHover",description:ue(0,"Controls whether the tree should render indent guides.")},[pz]:{type:"boolean",default:!1,description:ue(0,"Controls whether lists and trees have smooth scrolling.")},[mz]:{type:"number",default:1,markdownDescription:ue(0,"A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events.")},[fz]:{type:"number",default:5,markdownDescription:ue(0,"Scrolling speed multiplier when pressing `Alt`.")},[az]:{type:"string",enum:["highlight","filter"],enumDescriptions:[ue(0,"Highlight elements when searching. Further up and down navigation will traverse only the highlighted elements."),ue(0,"Filter elements when searching.")],default:"highlight",description:ue(0,"Controls the default find mode for lists and trees in the workbench.")},[hz]:{type:"string",enum:["simple","highlight","filter"],enumDescriptions:[ue(0,"Simple keyboard navigation focuses elements which match the keyboard input. Matching is done only on prefixes."),ue(0,"Highlight keyboard navigation highlights elements which match the keyboard input. Further up and down navigation will traverse only the highlighted elements."),ue(0,"Filter keyboard navigation will filter out and hide all the elements which do not match the keyboard input.")],default:"highlight",description:ue(0,"Controls the keyboard navigation style for lists and trees in the workbench. Can be simple, highlight and filter."),deprecated:!0,deprecationMessage:ue(0,"Please use 'workbench.list.defaultFindMode' and\t'workbench.list.typeNavigationMode' instead.")},[cz]:{type:"string",enum:["fuzzy","contiguous"],enumDescriptions:[ue(0,"Use fuzzy matching when searching."),ue(0,"Use contiguous matching when searching.")],default:"fuzzy",description:ue(0,"Controls the type of matching used when searching lists and trees in the workbench.")},[_z]:{type:"string",enum:["singleClick","doubleClick"],default:"singleClick",description:ue(0,"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.")},[lz]:{type:"string",enum:["automatic","trigger"],default:"automatic",markdownDescription:ue(0,"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 Bz=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class Wz{constructor(e,t,i,n){this.isProviderFirst=e,this.parent=t,this.link=i,this._rangeCallback=n,this.id=ck.nextId()}get uri(){return this.link.uri}get range(){var e,t;return null!==(t=null!==(e=this._range)&&void 0!==e?e:this.link.targetSelectionRange)&&void 0!==t?t:this.link.range}set range(e){this._range=e,this._rangeCallback(this)}get ariaMessage(){var e;const t=null===(e=this.parent.getPreview(this))||void 0===e?void 0:e.preview(this.range);return t?ue(0,"{0} in {1} on line {2} at column {3}",t.value,wa(this.uri),this.range.startLineNumber,this.range.startColumn):ue(0,"in {0} on line {1} at column {2}",wa(this.uri),this.range.startLineNumber,this.range.startColumn)}}class Vz{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:s,endLineNumber:o,endColumn:r}=e,a=i.getWordUntilPosition({lineNumber:n,column:s-t}),l=new Rh(n,a.startColumn,n,s),h=new Rh(o,r,o,1073741824),d=i.getValueInRange(l).replace(/^\s+/,""),c=i.getValueInRange(e);return{value:d+c+i.getValueInRange(h).replace(/\s+$/,""),highlight:{start:d.length,end:d.length+c.length}}}}class Hz{constructor(e,t){this.parent=e,this.uri=t,this.children=[],this._previews=new Us}dispose(){k(this._previews.values()),this._previews.clear()}getPreview(e){return this._previews.get(e.uri)}get ariaMessage(){const e=this.children.length;return 1===e?ue(0,"1 symbol in {0}, full path {1}",wa(this.uri),this.uri.fsPath):ue(0,"{0} symbols in {1}, full path {2}",e,wa(this.uri),this.uri.fsPath)}resolve(e){return Bz(this,void 0,void 0,(function*(){if(0!==this._previews.size)return this;for(const i of this.children)if(!this._previews.has(i.uri))try{const t=yield e.createModelReference(i.uri);this._previews.set(i.uri,new Vz(t))}catch(t){r(t)}return this}))}}class zz{constructor(e,t){this.groups=[],this.references=[],this._onDidChangeReferenceRange=new U,this.onDidChangeReferenceRange=this._onDidChangeReferenceRange.event,this._links=e,this._title=t;const[i]=e;let n;e.sort(zz._compareReferences);for(const s of e)if(n&&va.isEqual(n.uri,s.uri,!0)||(n=new Hz(this,s.uri),this.groups.push(n)),0===n.children.length||0!==zz._compareReferences(s,n.children[n.children.length-1])){const e=new Wz(i===s,n,s,(e=>this._onDidChangeReferenceRange.fire(e)));this.references.push(e),n.children.push(e)}}dispose(){k(this.groups),this._onDidChangeReferenceRange.dispose(),this.groups.length=0}clone(){return new zz(this._links,this._title)}get title(){return this._title}get isEmpty(){return 0===this.groups.length}get ariaMessage(){return this.isEmpty?ue(0,"No results found"):1===this.references.length?ue(0,"Found 1 symbol in {0}",this.references[0].uri.fsPath):1===this.groups.length?ue(0,"Found {0} symbols in {1}",this.references.length,this.groups[0].uri.fsPath):ue(0,"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 s=i.children.length,o=i.parent.groups.length;return 1===o||t&&n+10?(n=t?(n+1)%s:(n+s-1)%s,i.children[n]):(n=i.parent.groups.indexOf(i),t?(n=(n+1)%o,i.parent.groups[n].children[0]):(n=(n+o-1)%o,i.parent.groups[n].children[i.parent.groups[n].children.length-1]))}nearestReference(e,t){const i=this.references.map(((i,n)=>({idx:n,prefixLen:bo(i.uri.toString(),e.toString()),offsetDist:100*Math.abs(i.range.startLineNumber-t.lineNumber)+Math.abs(i.range.startColumn-t.column)}))).sort(((e,t)=>e.prefixLen>t.prefixLen?-1:e.prefixLent.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()&&Rh.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 va.compare(e.uri,t.uri)||Rh.compareRangesUsingStarts(e.range,t.range)}}class Uz{constructor(e,t,i){this.options=t,this.styles=i,this.count=0,this.element=ds(e,fs(".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()}setTitleFormat(e){this.titleFormat=e,this.render()}render(){var e,t;this.element.textContent=Qs(this.countFormat,this.count),this.element.title=Qs(this.titleFormat,this.count),this.element.style.backgroundColor=null!==(e=this.styles.badgeBackground)&&void 0!==e?e:"",this.element.style.color=null!==(t=this.styles.badgeForeground)&&void 0!==t?t:"",this.styles.badgeBorder&&(this.element.style.border=`1px solid ${this.styles.badgeBorder}`)}}class Kz{constructor(e,t){var i;this.text="",this.title="",this.highlights=[],this.didEverRender=!1,this.supportIcons=null!==(i=null==t?void 0:t.supportIcons)&&void 0!==i&&i,this.domNode=ds(e,fs("span.monaco-highlighted-label"))}get element(){return this.domNode}set(e,t=[],i="",n){e||(e=""),n&&(e=Kz.escapeNewLines(e,t)),this.didEverRender&&this.text===e&&this.title===i&&vd(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="\r\n"===e?-1:0,s+=i;for(const i of t)i.end<=s||(i.start>=s&&(i.start+=n),i.end>=s&&(i.end+=n));return i+=n,"\u23ce"}))}}class jz{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 qz extends E{constructor(e,t){super(),this.customHovers=new Map,this.creationOptions=t,this.domNode=this._register(new jz(ds(e,fs(".monaco-icon-label")))),this.labelContainer=ds(this.domNode.element,fs(".monaco-icon-label-container"));const i=ds(this.labelContainer,fs("span.monaco-icon-name-container"));(null==t?void 0:t.supportHighlights)||(null==t?void 0:t.supportIcons)?this.nameNode=new Gz(i,!!t.supportIcons):this.nameNode=new $z(i),this.hoverDelegate=null==t?void 0:t.hoverDelegate}get element(){return this.domNode.element}setLabel(e,t,i){const n=["monaco-icon-label"],s=["monaco-icon-label-container"];let o="";if(i&&(i.extraClasses&&n.push(...i.extraClasses),i.italic&&n.push("italic"),i.strikethrough&&n.push("strikethrough"),i.disabledCommand&&s.push("disabled"),i.title&&(o+=i.title)),this.domNode.className=n.join(" "),this.domNode.element.setAttribute("aria-label",o),this.labelContainer.className=s.join(" "),this.setupHover((null==i?void 0:i.descriptionTitle)?this.labelContainer:this.element,null==i?void 0:i.title),this.nameNode.setLabel(e,i),t||this.descriptionNode){const e=this.getOrCreateDescriptionNode();e instanceof Kz?(e.set(t||"",i?i.descriptionMatches:void 0,void 0,null==i?void 0:i.labelEscapeNewLines),this.setupHover(e.element,null==i?void 0:i.descriptionTitle)):(e.textContent=t&&(null==i?void 0:i.labelEscapeNewLines)?Kz.escapeNewLines(t,[]):t||"",this.setupHover(e.element,(null==i?void 0:i.descriptionTitle)||""),e.empty=!t)}}setupHover(e,t){const i=this.customHovers.get(e);if(i&&(i.dispose(),this.customHovers.delete(e)),t)if(this.hoverDelegate){const i=dD(this.hoverDelegate,e,t);i&&this.customHovers.set(e,i)}else!function(e,t){Fr(t)?e.title=aa(t):(null==t?void 0:t.markdownNotSupportedFallback)?e.title=t.markdownNotSupportedFallback:e.removeAttribute("title")}(e,t);else e.removeAttribute("title")}dispose(){super.dispose();for(const e of this.customHovers.values())e.dispose();this.customHovers.clear()}getOrCreateDescriptionNode(){var e;if(!this.descriptionNode){const t=this._register(new jz(ds(this.labelContainer,fs("span.monaco-icon-description-container"))));(null===(e=this.creationOptions)||void 0===e?void 0:e.supportDescriptionHighlights)?this.descriptionNode=new Kz(ds(t.element,fs("span.label-description")),{supportIcons:!!this.creationOptions.supportIcons}):this.descriptionNode=this._register(new jz(ds(t.element,fs("span.label-description"))))}return this.descriptionNode}}class $z{constructor(e){this.container=e,this.label=void 0,this.singleLabel=void 0}setLabel(e,t){if(this.label!==e||!vd(this.options,t))if(this.label=e,this.options=t,"string"==typeof e)this.singleLabel||(this.container.innerText="",this.container.classList.remove("multiple"),this.singleLabel=ds(this.container,fs("a.label-name",{id:null==t?void 0: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 s={start:n,end:n+e.length},o=i.map((e=>PD.intersect(s,e))).filter((e=>!PD.isEmpty(e))).map((({start:e,end:t})=>({start:e-n,end:t-n})));return n=s.end+t.length,o}))}(e,i,null==t?void 0:t.matches);for(let s=0;s=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Qz=function(e,t){return function(i,n){t(i,n,e)}};let Jz=class{constructor(e){this._resolverService=e}hasChildren(e){return e instanceof zz||e instanceof Hz}getChildren(e){if(e instanceof zz)return e.groups;if(e instanceof Hz)return e.resolve(this._resolverService).then((e=>e.children));throw new Error("bad tree")}};Jz=Xz([Qz(0,za)],Jz);class eU{getHeight(){return 23}getTemplateId(e){return e instanceof Hz?sU.id:rU.id}}let tU=class{constructor(e){this._keybindingService=e}getKeyboardNavigationLabel(e){var t;if(e instanceof Wz){const i=null===(t=e.parent.getPreview(e))||void 0===t?void 0:t.preview(e.range);if(i)return i.value}return wa(e.uri)}};tU=Xz([Qz(0,WL)],tU);class iU{getId(e){return e instanceof Wz?e.id:e.uri}}let nU=class extends E{constructor(e,t){super(),this._labelService=t;const i=document.createElement("div");i.classList.add("reference-file"),this.file=this._register(new qz(i,{supportHighlights:!0})),this.badge=new Uz(ds(i,fs(".count")),{},Xx),e.appendChild(i)}set(e,t){const i=Sa(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(ue(0,"{0} references",n)):this.badge.setTitleFormat(ue(0,"{0} reference",n))}};nU=Xz([Qz(1,Zz)],nU);let sU=Yz=class{constructor(e){this._instantiationService=e,this.templateId=Yz.id}renderTemplate(e){return this._instantiationService.createInstance(nU,e)}renderElement(e,t,i){i.set(e.element,_r(e.filterData))}disposeTemplate(e){e.dispose()}};sU.id="FileReferencesRenderer",sU=Yz=Xz([Qz(0,Fa)],sU);class oU{constructor(e){this.label=new Kz(e)}set(e,t){var i;const n=null===(i=e.parent.getPreview(e))||void 0===i?void 0:i.preview(e.range);if(n&&n.value){const{value:e,highlight:i}=n;t&&!Mr.isDefault(t)?(this.label.element.classList.toggle("referenceMatch",!1),this.label.set(e,_r(t))):(this.label.element.classList.toggle("referenceMatch",!0),this.label.set(e,[i]))}else this.label.set(`${wa(e.uri)}:${e.range.startLineNumber+1}:${e.range.startColumn+1}`)}}class rU{constructor(){this.templateId=rU.id}renderTemplate(e){return new oU(e)}renderElement(e,t,i){i.set(e.element,e.filterData)}disposeTemplate(){}}rU.id="OneReferenceRenderer";class aU{getWidgetAriaLabel(){return ue(0,"References")}getAriaLabel(e){return e.ariaMessage}}var lU=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},hU=function(e,t){return function(i,n){t(i,n,e)}},dU=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class cU{constructor(e,t){this._editor=e,this._model=t,this._decorations=new Map,this._decorationIgnoreSet=new Set,this._callOnDispose=new N,this._callOnModelChange=new N,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())return void this._addDecorations(t.parent)}_addDecorations(e){if(!this._editor.hasModel())return;this._callOnModelChange.add(this._editor.getModel().onDidChangeDecorations((()=>this._onDecorationChanged())));const t=[],i=[];for(let n=0,s=e.children.length;n{const s=n.deltaDecorations([],t);for(let t=0;t{e.equals(9)&&(this._keybindingService.dispatchEvent(e,e.target),e.stopPropagation())}),!0)),this._tree=this._instantiationService.createInstance(gU,"ReferencesWidget",this._treeContainer,new eU,[this._instantiationService.createInstance(sU),this._instantiationService.createInstance(rU)],this._instantiationService.createInstance(Jz),t),this._splitView.addView({onDidChange:B.None,element:this._previewContainer,minimumSize:200,maximumSize:Number.MAX_VALUE,layout:e=>{this._preview.layout({height:this._dim.height,width:e})}},gV.Distribute),this._splitView.addView({onDidChange:B.None,element:this._treeContainer,minimumSize:100,maximumSize:Number.MAX_VALUE,layout:e=>{this._treeContainer.style.height=`${this._dim.height}px`,this._treeContainer.style.width=`${e}px`,this._tree.layout(this._dim.height,e)}},gV.Distribute),this._disposables.add(this._splitView.onDidSashChange((()=>{this._dim.width&&(this.layoutData.ratio=this._splitView.getViewSize(0)/this._dim.width)}),void 0));const i=(e,t)=>{e instanceof Wz&&("show"===t&&this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:t,source:"tree"}))};this._tree.onDidOpen((e=>{e.sideBySide?i(e.element,"side"):e.editorOptions.pinned?i(e.element,"goto"):i(e.element,"show")})),vs(this._treeContainer)}_onWidth(e){this._dim&&this._doLayoutBody(this._dim.height,e)}_doLayoutBody(e,t){super._doLayoutBody(e,t),this._dim=new Wn(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=ue(0,"No results"),_s(this._messageContainer),Promise.resolve(void 0)):(vs(this._messageContainer),this._decorationsManager=new cU(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(2!==t.detail)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"),_s(this._treeContainer),_s(this._previewContainer),this._splitView.layout(this._dim.width),this.focusOnReferenceTree(),this._tree.setInput(1===this._model.groups.length?this._model.groups[0]:this._model)):Promise.resolve(void 0)}_getFocusedReference(){const[e]=this._tree.getFocus();return e instanceof Wz?e:e instanceof Hz&&e.children.length>0?e.children[0]:void 0}revealReference(e){return dU(this,void 0,void 0,(function*(){yield this._revealReference(e,!1),this._onDidSelectReference.fire({element:e,kind:"goto",source:"tree"})}))}_revealReference(e,t){return dU(this,void 0,void 0,(function*(){if(this._revealedReference===e)return;this._revealedReference=e,e.uri.scheme!==vn.inMemory?this.setTitle(Ca(e.uri),this._uriLabel.getUriLabel(Sa(e.uri))):this.setTitle(ue(0,"References"));const i=this._textModelResolverService.createModelReference(e.uri);this._tree.getInput()===e.parent||(t&&this._tree.reveal(e.parent),yield this._tree.expand(e.parent)),this._tree.reveal(e);const n=yield i;if(!this._model)return void n.dispose();k(this._previewModelReference);const s=n.object;if(s){const t=this._preview.getModel()===s.textEditorModel?0:1,i=Rh.lift(e.range).collapseToStart();this._previewModelReference=n,this._preview.setModel(s.textEditorModel),this._preview.setSelection(i),this._preview.revealRangeInCenter(i,t)}else this._preview.setModel(this._previewNotAvailableMessage),n.dispose()}))}};pU=lU([hU(3,P_),hU(4,za),hU(5,Fa),hU(6,jW),hU(7,Zz),hU(8,hw),hU(9,WL),hU(10,Lc),hU(11,Ju)],pU);var mU,fU=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},_U=function(e,t){return function(i,n){t(i,n,e)}},vU=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const bU=new Al("referenceSearchVisible",!1,ue(0,"Whether reference peek is visible, like 'Peek References' or 'Peek Definition'"));let CU=mU=class{static get(e){return e.getContribution(mU.ID)}constructor(e,t,i,n,s,o,r,a){this._defaultTreeKeyboardSupport=e,this._editor=t,this._editorService=n,this._notificationService=s,this._instantiationService=o,this._storageService=r,this._configurationService=a,this._disposables=new N,this._requestIdPool=0,this._ignoreModelChangeEvent=!1,this._referenceSearchVisible=bU.bindTo(i)}dispose(){var e,t;this._referenceSearchVisible.reset(),this._disposables.dispose(),null===(e=this._widget)||void 0===e||e.dispose(),null===(t=this._model)||void 0===t||t.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 s="peekViewLayout",o=uU.fromJSON(this._storageService.get(s,0,"{}"));this._widget=this._instantiationService.createInstance(pU,this._editor,this._defaultTreeKeyboardSupport,o),this._widget.setTitle(ue(0,"Loading...")),this._widget.show(e),this._disposables.add(this._widget.onDidClose((()=>{t.cancel(),this._widget&&(this._storageService.store(s,JSON.stringify(this._widget.layoutData),0,1),this._widget=void 0),this.closeWidget()}))),this._disposables.add(this._widget.onDidSelectReference((e=>{const{element:t,kind:n}=e;if(t)switch(n){case"open":"editor"===e.source&&this._configurationService.getValue("editor.stablePeek")||this.openReference(t,!1,!1);break;case"side":this.openReference(t,!0,!1);break;case"goto":i?this._gotoReference(t,!0):this.openReference(t,!1,!0)}})));const r=++this._requestIdPool;t.then((t=>{var i;if(r===this._requestIdPool&&this._widget)return null===(i=this._model)||void 0===i||i.dispose(),this._model=t,this._widget.setModel(this._model).then((()=>{if(this._widget&&this._model&&this._editor.hasModel()){this._model.isEmpty?this._widget.setMetaTitle(""):this._widget.setMetaTitle(ue(0,"{0} ({1})",this._model.title,this._model.references.length));const t=this._editor.getModel().uri,i=new Va(e.startLineNumber,e.startColumn),n=this._model.nearestReference(t,i);if(n)return this._widget.setSelection(n).then((()=>{this._widget&&"editor"===this._editor.getOption(86)&&this._widget.focusOnPreviewEditor()}))}}));t.dispose()}),(e=>{this._notificationService.error(e)}))}changeFocusBetweenPreviewAndReferences(){this._widget&&(this._widget.isPreviewEditorFocused()?this._widget.focusOnReferenceTree():this._widget.focusOnPreviewEditor())}goToNextOrPreviousReference(e){return vU(this,void 0,void 0,(function*(){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),s=this._editor.hasTextFocus(),o=this._widget.isPreviewEditorFocused();yield this._widget.setSelection(n),yield this._gotoReference(n,!1),s?this._editor.focus():this._widget&&o&&this._widget.focusOnPreviewEditor()}))}revealReference(e){return vU(this,void 0,void 0,(function*(){this._editor.hasModel()&&this._model&&this._widget&&(yield this._widget.revealReference(e))}))}closeWidget(e=!0){var t,i;null===(t=this._widget)||void 0===t||t.dispose(),null===(i=this._model)||void 0===i||i.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){var i;null===(i=this._widget)||void 0===i||i.hide(),this._ignoreModelChangeEvent=!0;const n=Rh.lift(e.range).collapseToStart();return this._editorService.openCodeEditor({resource:e.uri,options:{selection:n,selectionSource:"code.jump",pinned:t}},this._editor).then((e=>{var t;if(this._ignoreModelChangeEvent=!1,e&&this._widget)if(this._editor===e)this._widget.show(n),this._widget.focusOnReferenceTree();else{const i=mU.get(e),s=this._model.clone();this.closeWidget(),e.focus(),null==i||i.toggleWidget(n,Yh((e=>Promise.resolve(s))),null!==(t=this._peekMode)&&void 0!==t&&t)}else this.closeWidget()}),(e=>{this._ignoreModelChangeEvent=!1,r(e)}))}openReference(e,t,i){t||this.closeWidget();const{uri:n,range:s}=e;this._editorService.openCodeEditor({resource:n,options:{selection:s,selectionSource:"code.jump",pinned:i}},this._editor,t)}};function wU(e,t){const i=function(e){const t=e.get(Wa).getFocusedCodeEditor();return t instanceof pW?t.getParentEditor():t}(e);if(!i)return;const n=CU.get(i);n&&t(n)}CU.ID="editor.contrib.referencesController",CU=mU=fU([_U(2,Ol),_U(3,Wa),_U(4,mL),_U(5,Fa),_U(6,ZN),_U(7,pu)],CU),$l.registerCommandAndKeybindingRule({id:"togglePeekWidgetFocus",weight:100,primary:pt(2089,60),when:pl.or(bU,qW.inPeekEditor),handler(e){wU(e,(e=>{e.changeFocusBetweenPreviewAndReferences()}))}}),$l.registerCommandAndKeybindingRule({id:"goToNextReference",weight:90,primary:62,secondary:[70],when:pl.or(bU,qW.inPeekEditor),handler(e){wU(e,(e=>{e.goToNextOrPreviousReference(!0)}))}}),$l.registerCommandAndKeybindingRule({id:"goToPreviousReference",weight:90,primary:1086,secondary:[1094],when:pl.or(bU,qW.inPeekEditor),handler(e){wU(e,(e=>{e.goToNextOrPreviousReference(!1)}))}}),Xa.registerCommandAlias("goToNextReferenceFromEmbeddedEditor","goToNextReference"),Xa.registerCommandAlias("goToPreviousReferenceFromEmbeddedEditor","goToPreviousReference"),Xa.registerCommandAlias("closeReferenceSearchEditor","closeReferenceSearch"),Xa.registerCommand("closeReferenceSearch",(e=>wU(e,(e=>e.closeWidget())))),$l.registerKeybindingRule({id:"closeReferenceSearch",weight:-1,primary:9,secondary:[1033],when:pl.and(qW.inPeekEditor,pl.not("config.editor.stablePeek"))}),$l.registerKeybindingRule({id:"closeReferenceSearch",weight:250,primary:9,secondary:[1033],when:pl.and(bU,pl.not("config.editor.stablePeek"))}),$l.registerCommandAndKeybindingRule({id:"revealReference",weight:200,primary:3,mac:{primary:3,secondary:[2066]},when:pl.and(bU,UH,ZH.negate(),XH.negate()),handler(e){var t;const i=null===(t=e.get(WH).lastFocusedList)||void 0===t?void 0:t.getFocus();Array.isArray(i)&&i[0]instanceof Wz&&wU(e,(e=>e.revealReference(i[0])))}}),$l.registerCommandAndKeybindingRule({id:"openReferenceToSide",weight:100,primary:2051,mac:{primary:259},when:pl.and(bU,UH,ZH.negate(),XH.negate()),handler(e){var t;const i=null===(t=e.get(WH).lastFocusedList)||void 0===t?void 0:t.getFocus();Array.isArray(i)&&i[0]instanceof Wz&&wU(e,(e=>e.openReference(i[0],!0,!0)))}}),Xa.registerCommand("openReference",(e=>{var t;const i=null===(t=e.get(WH).lastFocusedList)||void 0===t?void 0:t.getFocus();Array.isArray(i)&&i[0]instanceof Wz&&wU(e,(e=>e.openReference(i[0],!1,!0)))}));var yU=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},SU=function(e,t){return function(i,n){t(i,n,e)}};const LU=new Al("hasSymbols",!1,ue(0,"Whether there are symbol locations that can be navigated via keyboard-only.")),kU=Ba("ISymbolNavigationService");let DU=class{constructor(e,t,i,n){this._editorService=t,this._notificationService=i,this._keybindingService=n,this._currentModel=void 0,this._currentIdx=-1,this._ignoreEditorChange=!1,this._ctxHasSymbols=LU.bindTo(e)}reset(){var e,t;this._ctxHasSymbols.reset(),null===(e=this._currentState)||void 0===e||e.dispose(),null===(t=this._currentMessage)||void 0===t||t.dispose(),this._currentModel=void 0,this._currentIdx=-1}put(e){const t=e.parent.parent;if(t.references.length<=1)return void this.reset();this._currentModel=t,this._currentIdx=t.references.indexOf(e),this._ctxHasSymbols.set(!0),this._showMessage();const i=new xU(this._editorService),n=i.onDidChange((e=>{if(this._ignoreEditorChange)return;const i=this._editorService.getActiveCodeEditor();if(!i)return;const n=i.getModel(),s=i.getPosition();if(!n||!s)return;let o=!1,r=!1;for(const a of t.references)if(ba(a.uri,n.uri))o=!0,r=r||Rh.containsPosition(a.range,s);else if(o)break;o&&r||this.reset()}));this._currentState=D(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:Rh.collapseToStart(t.range),selectionRevealType:3}},e).finally((()=>{this._ignoreEditorChange=!1}))}_showMessage(){var e;null===(e=this._currentMessage)||void 0===e||e.dispose();const t=this._keybindingService.lookupKeybinding("editor.gotoNextSymbolFromResult"),i=t?ue(0,"Symbol {0} of {1}, {2} for next",this._currentIdx+1,this._currentModel.references.length,t.getLabel()):ue(0,"Symbol {0} of {1}",this._currentIdx+1,this._currentModel.references.length);this._currentMessage=this._notificationService.status(i)}};DU=yU([SU(0,Ol),SU(1,Wa),SU(2,mL),SU(3,WL)],DU),yu(kU,DU,1),Sh(new class extends vh{constructor(){super({id:"editor.gotoNextSymbolFromResult",precondition:LU,kbOpts:{weight:100,primary:70}})}runEditorCommand(e,t){return e.get(kU).revealNext(t)}}),$l.registerCommandAndKeybindingRule({id:"editor.gotoNextSymbolFromResult.cancel",weight:100,when:LU,primary:9,handler(e){e.get(kU).reset()}});let xU=class{constructor(e){this._listener=new Map,this._disposables=new N,this._onDidChange=new U,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(),k(this._listener.values())}_onDidAddEditor(e){this._listener.set(e,D(e.onDidChangeCursorPosition((t=>this._onDidChange.fire({editor:e}))),e.onDidChangeModelContent((t=>this._onDidChange.fire({editor:e})))))}_onDidRemoveEditor(e){var t;null===(t=this._listener.get(e))||void 0===t||t.dispose(),this._listener.delete(e)}};xU=yU([SU(0,Wa)],xU);var NU=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function EU(e,t,i,n){return NU(this,void 0,void 0,(function*(){const s=i.ordered(e).map((i=>Promise.resolve(n(i,e,t)).then(void 0,(e=>{a(e)}))));return Bd((yield Promise.all(s)).flat())}))}function IU(e,t,i,n){return EU(t,i,e,((e,t,i)=>e.provideDefinition(t,i,n)))}function MU(e,t,i,n){return EU(t,i,e,((e,t,i)=>e.provideDeclaration(t,i,n)))}function TU(e,t,i,n){return EU(t,i,e,((e,t,i)=>e.provideImplementation(t,i,n)))}function RU(e,t,i,n){return EU(t,i,e,((e,t,i)=>e.provideTypeDefinition(t,i,n)))}function AU(e,t,i,n,s){return EU(t,i,e,((e,t,i)=>NU(this,void 0,void 0,(function*(){const o=yield e.provideReferences(t,i,{includeDeclaration:!0},s);if(!n||!o||2!==o.length)return o;const r=yield e.provideReferences(t,i,{includeDeclaration:!1},s);return r&&1===r.length?r:o}))))}function OU(e){return NU(this,void 0,void 0,(function*(){const t=yield e(),i=new zz(t,""),n=i.references.map((e=>e.link));return i.dispose(),n}))}yh("_executeDefinitionProvider",((e,t,i)=>{const n=IU(e.get(oL).definitionProvider,t,i,Uh.None);return OU((()=>n))})),yh("_executeTypeDefinitionProvider",((e,t,i)=>{const n=RU(e.get(oL).typeDefinitionProvider,t,i,Uh.None);return OU((()=>n))})),yh("_executeDeclarationProvider",((e,t,i)=>{const n=MU(e.get(oL).declarationProvider,t,i,Uh.None);return OU((()=>n))})),yh("_executeReferenceProvider",((e,t,i)=>{const n=AU(e.get(oL).referenceProvider,t,i,!1,Uh.None);return OU((()=>n))})),yh("_executeImplementationProvider",((e,t,i)=>{const n=TU(e.get(oL).implementationProvider,t,i,Uh.None);return OU((()=>n))}));var PU,FU,BU,WU,VU,HU,zU,UU,KU=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};nh.appendMenuItem(eh.EditorContext,{submenu:eh.EditorContextPeek,title:ue(0,"Peek"),group:"navigation",order:100});class jU{static is(e){return!(!e||"object"!=typeof e)&&(e instanceof jU||!(!Va.isIPosition(e.position)||!e.model))}constructor(e,t){this.model=e,this.position=t}}class qU extends wh{static all(){return qU._allSymbolNavigationCommands.values()}static _patchConfig(e){const t=Object.assign(Object.assign({},e),{f1:!0});if(t.menu)for(const i of v.wrap(t.menu))i.id!==eh.EditorContext&&i.id!==eh.EditorContextPeek||(i.when=pl.and(e.precondition,i.when));return t}constructor(e,t){super(qU._patchConfig(t)),this.configuration=e,qU._allSymbolNavigationCommands.set(t.id,this)}runEditorCommand(e,t,i,n){if(!t.hasModel())return Promise.resolve(void 0);const s=e.get(mL),o=e.get(Wa),r=e.get(vL),a=e.get(kU),l=e.get(oL),h=e.get(Fa),d=t.getModel(),c=t.getPosition(),u=jU.is(i)?i:new jU(d,c),g=new dL(t,5),p=Xh(this._getLocationModel(l,u.model,u.position,g.token),g.token).then((e=>KU(this,void 0,void 0,(function*(){var s;if(!e||g.token.isCancellationRequested)return;let r;if(Ps(e.ariaMessage),e.referenceAt(d.uri,c)){const e=this._getAlternativeCommand(t);!qU._activeAlternativeCommands.has(e)&&qU._allSymbolNavigationCommands.has(e)&&(r=qU._allSymbolNavigationCommands.get(e))}const l=e.references.length;if(0===l){if(!this.configuration.muteMessage){const e=d.getWordAtPosition(c);null===(s=oD.get(t))||void 0===s||s.showMessage(this._getNoResultFoundMessage(e),c)}}else{if(1!==l||!r)return this._onResult(o,a,t,e,n);qU._activeAlternativeCommands.add(this.desc.id),h.invokeFunction((e=>r.runEditorCommand(e,t,i,n).finally((()=>{qU._activeAlternativeCommands.delete(this.desc.id)}))))}}))),(e=>{s.error(e)})).finally((()=>{g.dispose()}));return r.showWhile(p,250),p}_onResult(e,t,i,n,s){return KU(this,void 0,void 0,(function*(){const o=this._getGoToPreference(i);if(i instanceof pW||!(this.configuration.openInPeek||"peek"===o&&n.references.length>1)){const r=n.firstReference(),a=n.references.length>1&&"gotoAndPeek"===o,l=yield this._openReference(i,e,r,this.configuration.openToSide,!a);a&&l?this._openInPeek(l,n,s):n.dispose(),"goto"===o&&t.put(r)}else this._openInPeek(i,n,s)}))}_openReference(e,t,i,n,s){return KU(this,void 0,void 0,(function*(){let o;var r;if((r=i)&&an.isUri(r.uri)&&Rh.isIRange(r.range)&&(Rh.isIRange(r.originSelectionRange)||Rh.isIRange(r.targetSelectionRange))&&(o=i.targetSelectionRange),o||(o=i.range),!o)return;const a=yield t.openCodeEditor({resource:i.uri,options:{selection:Rh.collapseToStart(o),selectionRevealType:3,selectionSource:"code.jump"}},e,n);if(a){if(s){const e=a.getModel(),t=a.createDecorationsCollection([{range:o,options:{description:"symbol-navigate-action-highlight",className:"symbolHighlight"}}]);setTimeout((()=>{a.getModel()===e&&t.clear()}),350)}return a}}))}_openInPeek(e,t,i){const n=CU.get(e);n&&e.hasModel()?n.toggleWidget(null!=i?i:e.getSelection(),Yh((e=>Promise.resolve(t))),this.configuration.openInPeek):t.dispose()}}qU._allSymbolNavigationCommands=new Map,qU._activeAlternativeCommands=new Set;class $U extends qU{_getLocationModel(e,t,i,n){return KU(this,void 0,void 0,(function*(){return new zz(yield IU(e.definitionProvider,t,i,n),ue(0,"Definitions"))}))}_getNoResultFoundMessage(e){return e&&e.word?ue(0,"No definition found for '{0}'",e.word):ue(0,"No definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleDefinitions}}ah(((PU=class extends $U{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:PU.id,title:{value:ue(0,"Go to Definition"),original:"Go to Definition",mnemonicTitle:ue(0,"Go to &&Definition")},precondition:pl.and(Oh.hasDefinitionProvider,Oh.isInWalkThroughSnippet.toNegated()),keybinding:[{when:Oh.editorTextFocus,primary:70,weight:100},{when:pl.and(Oh.editorTextFocus,OH),primary:2118,weight:100}],menu:[{id:eh.EditorContext,group:"navigation",order:1.1},{id:eh.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:2}]}),Xa.registerCommandAlias("editor.action.goToDeclaration",PU.id)}}).id="editor.action.revealDefinition",PU)),ah(((FU=class extends $U{constructor(){super({openToSide:!0,openInPeek:!1,muteMessage:!1},{id:FU.id,title:{value:ue(0,"Open Definition to the Side"),original:"Open Definition to the Side"},precondition:pl.and(Oh.hasDefinitionProvider,Oh.isInWalkThroughSnippet.toNegated()),keybinding:[{when:Oh.editorTextFocus,primary:pt(2089,70),weight:100},{when:pl.and(Oh.editorTextFocus,OH),primary:pt(2089,2118),weight:100}]}),Xa.registerCommandAlias("editor.action.openDeclarationToTheSide",FU.id)}}).id="editor.action.revealDefinitionAside",FU)),ah(((BU=class extends $U{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:BU.id,title:{value:ue(0,"Peek Definition"),original:"Peek Definition"},precondition:pl.and(Oh.hasDefinitionProvider,qW.notInPeekEditor,Oh.isInWalkThroughSnippet.toNegated()),keybinding:{when:Oh.editorTextFocus,primary:582,linux:{primary:3140},weight:100},menu:{id:eh.EditorContextPeek,group:"peek",order:2}}),Xa.registerCommandAlias("editor.action.previewDeclaration",BU.id)}}).id="editor.action.peekDefinition",BU));class GU extends qU{_getLocationModel(e,t,i,n){return KU(this,void 0,void 0,(function*(){return new zz(yield MU(e.declarationProvider,t,i,n),ue(0,"Declarations"))}))}_getNoResultFoundMessage(e){return e&&e.word?ue(0,"No declaration found for '{0}'",e.word):ue(0,"No declaration found")}_getAlternativeCommand(e){return e.getOption(58).alternativeDeclarationCommand}_getGoToPreference(e){return e.getOption(58).multipleDeclarations}}ah(((WU=class extends GU{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:WU.id,title:{value:ue(0,"Go to Declaration"),original:"Go to Declaration",mnemonicTitle:ue(0,"Go to &&Declaration")},precondition:pl.and(Oh.hasDeclarationProvider,Oh.isInWalkThroughSnippet.toNegated()),menu:[{id:eh.EditorContext,group:"navigation",order:1.3},{id:eh.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}_getNoResultFoundMessage(e){return e&&e.word?ue(0,"No declaration found for '{0}'",e.word):ue(0,"No declaration found")}}).id="editor.action.revealDeclaration",WU)),ah(class extends GU{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.peekDeclaration",title:{value:ue(0,"Peek Declaration"),original:"Peek Declaration"},precondition:pl.and(Oh.hasDeclarationProvider,qW.notInPeekEditor,Oh.isInWalkThroughSnippet.toNegated()),menu:{id:eh.EditorContextPeek,group:"peek",order:3}})}});class ZU extends qU{_getLocationModel(e,t,i,n){return KU(this,void 0,void 0,(function*(){return new zz(yield RU(e.typeDefinitionProvider,t,i,n),ue(0,"Type Definitions"))}))}_getNoResultFoundMessage(e){return e&&e.word?ue(0,"No type definition found for '{0}'",e.word):ue(0,"No type definition found")}_getAlternativeCommand(e){return e.getOption(58).alternativeTypeDefinitionCommand}_getGoToPreference(e){return e.getOption(58).multipleTypeDefinitions}}ah(((VU=class extends ZU{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:VU.ID,title:{value:ue(0,"Go to Type Definition"),original:"Go to Type Definition",mnemonicTitle:ue(0,"Go to &&Type Definition")},precondition:pl.and(Oh.hasTypeDefinitionProvider,Oh.isInWalkThroughSnippet.toNegated()),keybinding:{when:Oh.editorTextFocus,primary:0,weight:100},menu:[{id:eh.EditorContext,group:"navigation",order:1.4},{id:eh.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:3}]})}}).ID="editor.action.goToTypeDefinition",VU)),ah(((HU=class extends ZU{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:HU.ID,title:{value:ue(0,"Peek Type Definition"),original:"Peek Type Definition"},precondition:pl.and(Oh.hasTypeDefinitionProvider,qW.notInPeekEditor,Oh.isInWalkThroughSnippet.toNegated()),menu:{id:eh.EditorContextPeek,group:"peek",order:4}})}}).ID="editor.action.peekTypeDefinition",HU));class YU extends qU{_getLocationModel(e,t,i,n){return KU(this,void 0,void 0,(function*(){return new zz(yield TU(e.implementationProvider,t,i,n),ue(0,"Implementations"))}))}_getNoResultFoundMessage(e){return e&&e.word?ue(0,"No implementation found for '{0}'",e.word):ue(0,"No implementation found")}_getAlternativeCommand(e){return e.getOption(58).alternativeImplementationCommand}_getGoToPreference(e){return e.getOption(58).multipleImplementations}}ah(((zU=class extends YU{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:zU.ID,title:{value:ue(0,"Go to Implementations"),original:"Go to Implementations",mnemonicTitle:ue(0,"Go to &&Implementations")},precondition:pl.and(Oh.hasImplementationProvider,Oh.isInWalkThroughSnippet.toNegated()),keybinding:{when:Oh.editorTextFocus,primary:2118,weight:100},menu:[{id:eh.EditorContext,group:"navigation",order:1.45},{id:eh.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:4}]})}}).ID="editor.action.goToImplementation",zU)),ah(((UU=class extends YU{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:UU.ID,title:{value:ue(0,"Peek Implementations"),original:"Peek Implementations"},precondition:pl.and(Oh.hasImplementationProvider,qW.notInPeekEditor,Oh.isInWalkThroughSnippet.toNegated()),keybinding:{when:Oh.editorTextFocus,primary:3142,weight:100},menu:{id:eh.EditorContextPeek,group:"peek",order:5}})}}).ID="editor.action.peekImplementation",UU));class XU extends qU{_getNoResultFoundMessage(e){return e?ue(0,"No references found for '{0}'",e.word):ue(0,"No references found")}_getAlternativeCommand(e){return e.getOption(58).alternativeReferenceCommand}_getGoToPreference(e){return e.getOption(58).multipleReferences}}ah(class extends XU{constructor(){super({openToSide:!1,openInPeek:!1,muteMessage:!1},{id:"editor.action.goToReferences",title:{value:ue(0,"Go to References"),original:"Go to References",mnemonicTitle:ue(0,"Go to &&References")},precondition:pl.and(Oh.hasReferenceProvider,qW.notInPeekEditor,Oh.isInWalkThroughSnippet.toNegated()),keybinding:{when:Oh.editorTextFocus,primary:1094,weight:100},menu:[{id:eh.EditorContext,group:"navigation",order:1.45},{id:eh.MenubarGoMenu,precondition:null,group:"4_symbol_nav",order:5}]})}_getLocationModel(e,t,i,n){return KU(this,void 0,void 0,(function*(){return new zz(yield AU(e.referenceProvider,t,i,!0,n),ue(0,"References"))}))}}),ah(class extends XU{constructor(){super({openToSide:!1,openInPeek:!0,muteMessage:!1},{id:"editor.action.referenceSearch.trigger",title:{value:ue(0,"Peek References"),original:"Peek References"},precondition:pl.and(Oh.hasReferenceProvider,qW.notInPeekEditor,Oh.isInWalkThroughSnippet.toNegated()),menu:{id:eh.EditorContextPeek,group:"peek",order:6}})}_getLocationModel(e,t,i,n){return KU(this,void 0,void 0,(function*(){return new zz(yield AU(e.referenceProvider,t,i,!1,n),ue(0,"References"))}))}});class QU extends qU{constructor(e,t,i){super(e,{id:"editor.action.goToLocation",title:{value:ue(0,"Go to Any Symbol"),original:"Go to Any Symbol"},precondition:pl.and(qW.notInPeekEditor,Oh.isInWalkThroughSnippet.toNegated())}),this._references=t,this._gotoMultipleBehaviour=i}_getLocationModel(e,t,i,n){return KU(this,void 0,void 0,(function*(){return new zz(this._references,ue(0,"Locations"))}))}_getNoResultFoundMessage(e){return e&&ue(0,"No results for '{0}'",e.word)||""}_getGoToPreference(e){var t;return null!==(t=this._gotoMultipleBehaviour)&&void 0!==t?t:e.getOption(58).multipleReferences}_getAlternativeCommand(){return""}}Xa.registerCommand({id:"editor.action.goToLocations",description:{description:"Go to locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:an},{name:"position",description:"The position at which to start",constraint:Va.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:(e,t,i,n,s,o,r)=>KU(void 0,void 0,void 0,(function*(){qr(an.isUri(t)),qr(Va.isIPosition(i)),qr(Array.isArray(n)),qr(void 0===s||"string"==typeof s),qr(void 0===r||"boolean"==typeof r);const a=e.get(Wa),l=yield a.openCodeEditor({resource:t},a.getFocusedCodeEditor());if(iV(l))return l.setPosition(i),l.revealPositionInCenterIfOutsideViewport(i,0),l.invokeWithinContext((e=>{const t=new class extends QU{_getNoResultFoundMessage(e){return o||super._getNoResultFoundMessage(e)}}({muteMessage:!Boolean(o),openInPeek:Boolean(r),openToSide:!1},n,s);e.get(Fa).invokeFunction(t.run.bind(t),l)}))}))}),Xa.registerCommand({id:"editor.action.peekLocations",description:{description:"Peek locations from a position in a file",args:[{name:"uri",description:"The text document in which to start",constraint:an},{name:"position",description:"The position at which to start",constraint:Va.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:(e,t,i,n,s)=>KU(void 0,void 0,void 0,(function*(){e.get(Ya).executeCommand("editor.action.goToLocations",t,i,n,s,void 0,!0)}))}),Xa.registerCommand({id:"editor.action.findReferences",handler:(e,t,i)=>{qr(an.isUri(t)),qr(Va.isIPosition(i));const n=e.get(oL),s=e.get(Wa);return s.openCodeEditor({resource:t},s.getFocusedCodeEditor()).then((e=>{if(!iV(e)||!e.hasModel())return;const t=CU.get(e);if(!t)return;const s=Yh((t=>AU(n.referenceProvider,e.getModel(),Va.lift(i),!1,t).then((e=>new zz(e,ue(0,"References")))))),o=new Rh(i.lineNumber,i.column,i.lineNumber,i.column);return Promise.resolve(t.toggleWidget(o,s,!1))}))}}),Xa.registerCommandAlias("editor.action.showReferences","editor.action.peekLocations");var JU,eK=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},tK=function(e,t){return function(i,n){t(i,n,e)}},iK=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let nK=JU=class{constructor(e,t,i,n){this.textModelResolverService=t,this.languageService=i,this.languageFeaturesService=n,this.toUnhook=new N,this.toUnhookForKeyboard=new N,this.currentWordAtPosition=null,this.previousPromise=null,this.editor=e,this.linkDecorations=this.editor.createDecorationsCollection();const s=new RR(e);this.toUnhook.add(s),this.toUnhook.add(s.onMouseMoveOrRelevantKeyDown((([e,t])=>{this.startFindDefinitionFromMouse(e,null!=t?t:void 0)}))),this.toUnhook.add(s.onExecute((e=>{this.isEnabled(e)&&this.gotoDefinition(e.target.position,e.hasSideBySideModifier).catch((e=>{r(e)})).finally((()=>{this.removeLinkDecorations()}))}))),this.toUnhook.add(s.onCancel((()=>{this.removeLinkDecorations(),this.currentWordAtPosition=null})))}static get(e){return e.getContribution(JU.ID)}startFindDefinitionFromCursor(e){return iK(this,void 0,void 0,(function*(){yield this.startFindDefinition(e),this.toUnhookForKeyboard.add(this.editor.onDidChangeCursorPosition((()=>{this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear()}))),this.toUnhookForKeyboard.add(this.editor.onKeyDown((e=>{e&&(this.currentWordAtPosition=null,this.removeLinkDecorations(),this.toUnhookForKeyboard.clear())})))}))}startFindDefinitionFromMouse(e,t){if(9===e.target.type&&this.linkDecorations.length>0)return;if(!this.editor.hasModel()||!this.isEnabled(e,t))return this.currentWordAtPosition=null,void this.removeLinkDecorations();const i=e.target.position;this.startFindDefinition(i)}startFindDefinition(e){var t;return iK(this,void 0,void 0,(function*(){this.toUnhookForKeyboard.clear();const i=e?null===(t=this.editor.getModel())||void 0===t?void 0:t.getWordAtPosition(e):null;if(!i)return this.currentWordAtPosition=null,void this.removeLinkDecorations();if(this.currentWordAtPosition&&this.currentWordAtPosition.startColumn===i.startColumn&&this.currentWordAtPosition.endColumn===i.endColumn&&this.currentWordAtPosition.word===i.word)return;this.currentWordAtPosition=i;const n=new hL(this.editor,15);let s;this.previousPromise&&(this.previousPromise.cancel(),this.previousPromise=null),this.previousPromise=Yh((t=>this.findDefinition(e,t)));try{s=yield this.previousPromise}catch(a){return void r(a)}if(!s||!s.length||!n.validate(this.editor))return void this.removeLinkDecorations();const o=s[0].originSelectionRange?Rh.lift(s[0].originSelectionRange):new Rh(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn);if(s.length>1){let e=o;for(const{originSelectionRange:t}of s)t&&(e=Rh.plusRange(e,t));this.addDecoration(e,(new Ta).appendText(ue(0,"Click to show {0} definitions.",s.length)))}else{const e=s[0];if(!e.uri)return;this.textModelResolverService.createModelReference(e.uri).then((t=>{if(!t.object||!t.object.textEditorModel)return void t.dispose();const{object:{textEditorModel:i}}=t,{startLineNumber:n}=e.range;if(n<1||n>i.getLineCount())return void t.dispose();const s=this.getPreviewValue(i,n,e),r=this.languageService.guessLanguageIdByFilepathOrFirstLine(i.uri);this.addDecoration(o,s?(new Ta).appendCodeblock(r||"",s):void 0),t.dispose()}))}}))}getPreviewValue(e,t,i){let n=i.range;n.endLineNumber-n.startLineNumber>=JU.MAX_SOURCE_PREVIEW_LINES&&(n=this.getPreviewRangeBasedOnIndentation(e,t));return this.stripIndentationFromPreviewRange(e,t,n)}stripIndentationFromPreviewRange(e,t,i){let n=e.getLineFirstNonWhitespaceColumn(t);for(let s=t+1;s{const i=!t&&this.editor.getOption(87)&&!this.isInPeekEditor(e);return new $U({openToSide:t,openInPeek:i,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(e)}))}isInPeekEditor(e){const t=e.get(Ol);return qW.inPeekEditor.getValue(t)}dispose(){this.toUnhook.dispose(),this.toUnhookForKeyboard.dispose()}};nK.ID="editor.contrib.gotodefinitionatposition",nK.MAX_SOURCE_PREVIEW_LINES=8,nK=JU=eK([tK(1,za),tK(2,Lc),tK(3,oL)],nK),Dh(nK.ID,nK,2);const sK=fs;class oK extends E{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 OD(this.contentsDomNode,{consumeMouseWheelIfScrollbarIsNeeded:!0})),this.containerDomNode.appendChild(this.scrollbar.getDomNode())}onContentsChanged(){this.scrollbar.scanDomNode()}}class rK extends E{static render(e,t,i){return new rK(e,t,i)}constructor(e,t,i){super(),this.actionContainer=ds(e,sK("div.action-container")),this.actionContainer.setAttribute("tabindex","0"),this.action=ds(this.actionContainer,sK("a.action")),this.action.setAttribute("role","button"),t.iconClass&&ds(this.action,sK(`span.icon.${t.iconClass}`));ds(this.action,sK("span")).textContent=i?`${t.label} (${i})`:t.label,this._register(En(this.actionContainer,os.CLICK,(e=>{e.stopPropagation(),e.preventDefault(),t.run(this.actionContainer)}))),this._register(En(this.actionContainer,os.KEY_DOWN,(e=>{const i=new St(e);(i.equals(3)||i.equals(10))&&(e.stopPropagation(),e.preventDefault(),t.run(this.actionContainer))}))),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"))}}var aK=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))},lK=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=e[i]&&function(t){return new Promise((function(n,s){(function(e,t,i,n){Promise.resolve(n).then((function(t){e({value:t,done:i})}),t)})(n,s,(t=e[i](t)).done,t.value)}))}}};class hK{constructor(e,t,i){this.value=e,this.isComplete=t,this.hasLoadingMessage=i}}class dK extends E{constructor(e,t){super(),this._editor=e,this._computer=t,this._onResult=this._register(new U),this.onResult=this._onResult.event,this._firstWaitScheduler=this._register(new rd((()=>this._triggerAsyncComputation()),0)),this._secondWaitScheduler=this._register(new rd((()=>this._triggerSyncComputation()),0)),this._loadingMessageScheduler=this._register(new rd((()=>this._triggerLoadingMessage()),0)),this._state=0,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(60).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(2),this._secondWaitScheduler.schedule(this._secondWaitTime),this._computer.computeAsync?(this._asyncIterableDone=!1,this._asyncIterable=function(e){const t=new jh,i=e(t.token);return new ud(t,(e=>$h(this,void 0,void 0,(function*(){var n,s,o,r;const a=t.token.onCancellationRequested((()=>{a.dispose(),t.dispose(),e.reject(new c)}));try{try{for(var l,h=!0,d=Gh(i);!(n=(l=yield d.next()).done);h=!0){r=l.value,h=!1;const i=r;if(t.token.isCancellationRequested)return;e.emitOne(i)}}catch(u){s={error:u}}finally{try{h||n||!(o=d.return)||(yield o.call(d))}finally{if(s)throw s.error}}a.dispose(),t.dispose()}catch(g){a.dispose(),t.dispose(),e.reject(g)}}))))}((e=>this._computer.computeAsync(e))),(()=>{aK(this,void 0,void 0,(function*(){var e,t,i,n;try{try{for(var s,o=!0,a=lK(this._asyncIterable);!(e=(s=yield a.next()).done);o=!0){n=s.value,o=!1;const e=n;e&&(this._result.push(e),this._fireResult())}}catch(l){t={error:l}}finally{try{o||e||!(i=a.return)||(yield i.call(a))}finally{if(t)throw t.error}}this._asyncIterableDone=!0,3!==this._state&&4!==this._state||this._setState(0)}catch(Mre){r(Mre)}}))})()):this._asyncIterableDone=!0}_triggerSyncComputation(){this._computer.computeSync&&(this._result=this._result.concat(this._computer.computeSync())),this._setState(this._asyncIterableDone?0:3)}_triggerLoadingMessage(){3===this._state&&this._setState(4)}_fireResult(){if(1===this._state||2===this._state)return;const e=0===this._state,t=4===this._state;this._onResult.fire(new hK(this._result.slice(0),e,t))}start(e){if(0===e)0===this._state&&(this._setState(1),this._firstWaitScheduler.schedule(this._firstWaitTime),this._loadingMessageScheduler.schedule(this._loadingMessageTime));else switch(this._state){case 0:this._triggerAsyncComputation(),this._secondWaitScheduler.cancel(),this._triggerSyncComputation();break;case 2:this._secondWaitScheduler.cancel(),this._triggerSyncComputation()}}cancel(){this._firstWaitScheduler.cancel(),this._secondWaitScheduler.cancel(),this._loadingMessageScheduler.cancel(),this._asyncIterable&&(this._asyncIterable.cancel(),this._asyncIterable=null),this._result=[],this._setState(0,!1)}}class cK{constructor(e,t,i,n){this.priority=e,this.range=t,this.initialMousePosX=i,this.initialMousePosY=n,this.type=1}equals(e){return 1===e.type&&this.range.equalsRange(e.range)}canAdoptVisibleHover(e,t){return 1===e.type&&t.lineNumber===this.range.startLineNumber}}class uK{constructor(e,t,i,n,s,o){this.priority=e,this.owner=t,this.range=i,this.initialMousePosX=n,this.initialMousePosY=s,this.supportsMarkerHover=o,this.type=2}equals(e){return 2===e.type&&this.owner===e.owner}canAdoptVisibleHover(e,t){return 2===e.type&&this.owner===e.owner}}const gK=new class{constructor(){this._participants=[]}register(e){this._participants.push(e)}getAll(){return this._participants}};class pK{constructor(){let e;this._onDidWillResize=new U,this.onDidWillResize=this._onDidWillResize.event,this._onDidResize=new U,this.onDidResize=this._onDidResize.event,this._sashListener=new N,this._size=new Wn(0,0),this._minSize=new Wn(0,0),this._maxSize=new Wn(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER),this.domNode=document.createElement("div"),this._eastSash=new SW(this.domNode,{getVerticalSashLeft:()=>this._size.width},{orientation:0}),this._westSash=new SW(this.domNode,{getVerticalSashLeft:()=>0},{orientation:0}),this._northSash=new SW(this.domNode,{getHorizontalSashTop:()=>0},{orientation:1,orthogonalEdge:fW.North}),this._southSash=new SW(this.domNode,{getHorizontalSashTop:()=>this._size.height},{orientation:1,orthogonalEdge:fW.South}),this._northSash.orthogonalStartSash=this._westSash,this._northSash.orthogonalEndSash=this._eastSash,this._southSash.orthogonalStartSash=this._westSash,this._southSash.orthogonalEndSash=this._eastSash;let t=0,i=0;this._sashListener.add(B.any(this._northSash.onDidStart,this._eastSash.onDidStart,this._southSash.onDidStart,this._westSash.onDidStart)((()=>{void 0===e&&(this._onDidWillResize.fire(),e=this._size,t=0,i=0)}))),this._sashListener.add(B.any(this._northSash.onDidEnd,this._eastSash.onDidEnd,this._southSash.onDidEnd,this._westSash.onDidEnd)((()=>{void 0!==e&&(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(B.any(this._eastSash.onDidReset,this._westSash.onDidReset)((e=>{this._preferredSize&&(this.layout(this._size.height,this._preferredSize.width),this._onDidResize.fire({dimension:this._size,done:!0}))}))),this._sashListener.add(B.any(this._northSash.onDidReset,this._southSash.onDidReset)((e=>{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?3:0,this._eastSash.state=t?3:0,this._southSash.state=i?3:0,this._westSash.state=n?3:0}layout(e=this.size.height,t=this.size.width){const{height:i,width:n}=this._minSize,{height:s,width:o}=this._maxSize;e=Math.max(i,Math.min(s,e)),t=Math.max(n,Math.min(o,t));const r=new Wn(t,e);Wn.equals(r,this._size)||(this.domNode.style.height=e+"px",this.domNode.style.width=t+"px",this._size=r,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}}class mK extends E{constructor(e,t=new Wn(10,10)){super(),this._editor=e,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._resizableNode=this._register(new pK),this._contentPosition=null,this._isResizing=!1,this._resizableNode.domNode.style.position="absolute",this._resizableNode.minSize=Wn.lift(t),this._resizableNode.layout(t.height,t.width),this._resizableNode.enableSashes(!0,!0,!0,!0),this._register(this._resizableNode.onDidResize((e=>{this._resize(new Wn(e.dimension.width,e.dimension.height)),e.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(){var e;return(null===(e=this._contentPosition)||void 0===e?void 0:e.position)?Va.lift(this._contentPosition.position):void 0}_availableVerticalSpaceAbove(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;return Hn(t).top+i.top-30}_availableVerticalSpaceBelow(e){const t=this._editor.getDomNode(),i=this._editor.getScrolledVisiblePosition(e);if(!t||!i)return;const n=Hn(t),s=Fn(t.ownerDocument.body),o=n.top+i.top+i.height;return s.height-o-24}_findPositionPreference(e,t){var i,n;const s=Math.min(null!==(i=this._availableVerticalSpaceBelow(t))&&void 0!==i?i:1/0,e),o=Math.min(null!==(n=this._availableVerticalSpaceAbove(t))&&void 0!==n?n:1/0,e),r=Math.min(Math.max(o,s),e),a=Math.min(e,r);let l;return l=this._editor.getOption(60).above?a<=o?1:2:a<=s?2:1,1===l?this._resizableNode.enableSashes(!0,!0,!1,!1):this._resizableNode.enableSashes(!1,!0,!0,!1),l}_resize(e){this._resizableNode.layout(e.height,e.width)}}var fK,_K,vK=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},bK=function(e,t){return function(i,n){t(i,n,e)}};const CK=fs;let wK=fK=class extends E{constructor(e,t,i){super(),this._editor=e,this._instantiationService=t,this._keybindingService=i,this._currentResult=null,this._widget=this._register(this._instantiationService.createInstance(kK,this._editor)),this._participants=[];for(const n of gK.getAll())this._participants.push(this._instantiationService.createInstance(n,this._editor));this._participants.sort(((e,t)=>e.hoverOrdinal-t.hoverOrdinal)),this._computer=new xK(this._editor,this._participants),this._hoverOperation=this._register(new dK(this._editor,this._computer)),this._register(this._hoverOperation.onResult((e=>{if(!this._computer.anchor)return;const t=e.hasLoadingMessage?this._addLoadingMessage(e.value):e.value;this._withResult(new yK(this._computer.anchor,t,e.isComplete))}))),this._register(Mn(this._widget.getDomNode(),"keydown",(e=>{e.equals(9)&&this.hide()}))),this._register(EC.onDidChange((()=>{this._widget.position&&this._currentResult&&this._setCurrentResult(this._currentResult)})))}get widget(){return this._widget}maybeShowAt(e){if(this._widget.isResizing)return!0;const t=[];for(const n of this._participants)if(n.suggestHoverAnchor){const i=n.suggestHoverAnchor(e);i&&t.push(i)}const i=e.target;if(6===i.type&&t.push(new cK(0,i.range,e.event.posx,e.event.posy)),7===i.type){const n=this._editor.getOption(50).typicalHalfwidthCharacterWidth/2;!i.detail.isAfterLines&&"number"==typeof i.detail.horizontalDistanceToText&&i.detail.horizontalDistanceToTextt.priority-e.priority)),this._startShowingOrUpdateHover(t[0],0,0,!1,e))}startShowingAtRange(e,t,i,n){this._startShowingOrUpdateHover(new cK(0,e,void 0,void 0),t,i,n,null)}_startShowingOrUpdateHover(e,t,i,n,s){if(!this._widget.position||!this._currentResult)return!!e&&(this._startHoverOperationIfNecessary(e,t,i,n,!1),!0);return this._editor.getOption(60).sticky&&s&&this._widget.isMouseGettingCloser(s.event.posx,s.event.posy)?(e&&this._startHoverOperationIfNecessary(e,t,i,n,!0),!0):e?!(!e||!this._currentResult.anchor.equals(e))||(e.canAdoptVisibleHover(this._currentResult.anchor,this._widget.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,s){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=s,this._hoverOperation.start(t))}_setCurrentResult(e){this._currentResult!==e&&(e&&0===e.messages.length&&(e=null),this._currentResult=e,this._currentResult?this._renderMessages(this._currentResult.anchor,this._currentResult.messages):this._widget.hide())}hide(){this._computer.anchor=null,this._hoverOperation.cancel(),this._setCurrentResult(null)}get isColorPickerVisible(){return this._widget.isColorPickerVisible}get isVisibleFromKeyboard(){return this._widget.isVisibleFromKeyboard}get isVisible(){return this._widget.isVisible}get isFocused(){return this._widget.isFocused}get isResizing(){return this._widget.isResizing}containsNode(e){return!!e&&this._widget.getDomNode().contains(e)}_addLoadingMessage(e){if(this._computer.anchor)for(const t of this._participants)if(t.createLoadingMessage){const i=t.createLoadingMessage(this._computer.anchor);if(i)return e.slice(0).concat([i])}return e}_withResult(e){if(this._widget.position&&this._currentResult&&this._currentResult.isComplete){if(!e.isComplete)return;if(this._computer.insistOnKeepingHoverVisible&&0===e.messages.length)return}this._setCurrentResult(e)}_renderMessages(e,t){const{showAtPosition:i,showAtSecondaryPosition:n,highlightRange:s}=fK.computeHoverRanges(this._editor,e.range,t),o=new N,r=o.add(new DK(this._keybindingService)),a=document.createDocumentFragment();let l=null;const h={fragment:a,statusBar:r,setColorPicker:e=>l=e,onContentsChanged:()=>this._widget.onContentsChanged(),setMinimumDimensions:e=>this._widget.setMinimumDimensions(e),hide:()=>this.hide()};for(const c of this._participants){const e=t.filter((e=>e.owner===c));e.length>0&&o.add(c.renderHoverParts(h,e))}const d=t.some((e=>e.isBeforeContent));if(r.hasContent&&a.appendChild(r.hoverElement),a.hasChildNodes()){if(s){const e=this._editor.createDecorationsCollection();e.set([{range:s,options:fK._DECORATION_OPTIONS}]),o.add(x((()=>{e.clear()})))}this._widget.showAt(a,new LK(l,i,n,this._editor.getOption(60).above,this._computer.shouldFocus,this._computer.source,d,e.initialMousePosX,e.initialMousePosY,o))}else o.dispose()}static computeHoverRanges(e,t,i){let n=1;if(e.hasModel()){const i=e._getViewModel(),s=i.coordinatesConverter,o=s.convertModelRangeToViewRange(t),r=new Va(o.startLineNumber,i.getLineMinColumn(o.startLineNumber));n=s.convertViewPositionToModelPosition(r).column}const s=t.startLineNumber;let o=t.startColumn,r=i[0].range,a=null;for(const l of i)r=Rh.plusRange(r,l.range),l.range.startLineNumber===s&&l.range.endLineNumber===s&&(o=Math.max(Math.min(o,l.range.startColumn),n)),l.forceShowAtRange&&(a=l.range);return{showAtPosition:a?a.getStartPosition():new Va(s,t.startColumn),showAtSecondaryPosition:a?a.getStartPosition():new Va(s,o),highlightRange:r}}focus(){this._widget.focus()}scrollUp(){this._widget.scrollUp()}scrollDown(){this._widget.scrollDown()}scrollLeft(){this._widget.scrollLeft()}scrollRight(){this._widget.scrollRight()}pageUp(){this._widget.pageUp()}pageDown(){this._widget.pageDown()}goToTop(){this._widget.goToTop()}goToBottom(){this._widget.goToBottom()}};wK._DECORATION_OPTIONS=Iw.register({description:"content-hover-highlight",className:"hoverHighlight"}),wK=fK=vK([bK(1,Fa),bK(2,WL)],wK);class yK{constructor(e,t,i){this.anchor=e,this.messages=t,this.isComplete=i}filter(e){const t=this.messages.filter((t=>t.isValidForHoverAnchor(e)));return t.length===this.messages.length?this:new SK(this,this.anchor,t,this.isComplete)}}class SK extends yK{constructor(e,t,i,n){super(t,i,n),this.original=e}filter(e){return this.original.filter(e)}}class LK{constructor(e,t,i,n,s,o,r,a,l,h){this.colorPicker=e,this.showAtPosition=t,this.showAtSecondaryPosition=i,this.preferAbove=n,this.stoleFocus=s,this.source=o,this.isBeforeContent=r,this.initialMousePosX=a,this.initialMousePosY=l,this.disposables=h,this.closestMouseDistance=void 0}}let kK=_K=class extends mK{get isColorPickerVisible(){var e;return Boolean(null===(e=this._visibleData)||void 0===e?void 0:e.colorPicker)}get isVisibleFromKeyboard(){var e;return 1===(null===(e=this._visibleData)||void 0===e?void 0:e.source)}get isVisible(){var e;return null!==(e=this._hoverVisibleKey.get())&&void 0!==e&&e}get isFocused(){var e;return null!==(e=this._hoverFocusedKey.get())&&void 0!==e&&e}constructor(e,t,i,n,s){const o=e.getOption(66)+8,r=new Wn(150,o);super(e,r),this._configurationService=i,this._accessibilityService=n,this._keybindingService=s,this._hover=this._register(new oK),this._minimumSize=r,this._hoverVisibleKey=Oh.hoverVisible.bindTo(t),this._hoverFocusedKey=Oh.hoverFocused.bindTo(t),ds(this._resizableNode.domNode,this._hover.containerDomNode),this._resizableNode.domNode.style.zIndex="50",this._register(this._editor.onDidLayoutChange((()=>this._layout()))),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(50)&&this._updateFont()})));const a=this._register(hs(this._resizableNode.domNode));this._register(a.onDidFocus((()=>{this._hoverFocusedKey.set(!0)}))),this._register(a.onDidBlur((()=>{this._hoverFocusedKey.set(!1)}))),this._setHoverData(void 0),this._layout(),this._editor.addContentWidget(this)}dispose(){var e;super.dispose(),null===(e=this._visibleData)||void 0===e||e.disposables.dispose(),this._editor.removeContentWidget(this)}getId(){return _K.ID}static _applyDimensions(e,t,i){const n="number"==typeof t?`${t}px`:t,s="number"==typeof i?`${i}px`:i;e.style.width=n,e.style.height=s}_setContentsDomNodeDimensions(e,t){const i=this._hover.contentsDomNode;return _K._applyDimensions(i,e,t)}_setContainerDomNodeDimensions(e,t){const i=this._hover.containerDomNode;return _K._applyDimensions(i,e,t)}_setHoverWidgetDimensions(e,t){this._setContentsDomNodeDimensions(e,t),this._setContainerDomNodeDimensions(e,t),this._layoutContentWidget()}static _applyMaxDimensions(e,t,i){const n="number"==typeof t?`${t}px`:t,s="number"==typeof i?`${i}px`:i;e.style.maxWidth=n,e.style.maxHeight=s}_setHoverWidgetMaxDimensions(e,t){_K._applyMaxDimensions(this._hover.contentsDomNode,e,t),_K._applyMaxDimensions(this._hover.containerDomNode,e,t),this._hover.containerDomNode.style.setProperty("--vscode-hover-maxWidth","number"==typeof e?`${e}px`:e),this._layoutContentWidget()}_hasHorizontalScrollbar(){const e=this._hover.scrollbar.getScrollDimensions();return e.scrollWidth>e.width}_adjustContentsBottomPadding(){const e=this._hover.contentsDomNode,t=`${this._hover.scrollbar.options.horizontalScrollbarSize}px`;e.style.paddingBottom!==t&&(e.style.paddingBottom=t)}_setAdjustedHoverWidgetDimensions(e){this._setHoverWidgetMaxDimensions("none","none");const t=e.width,i=e.height;this._setHoverWidgetDimensions(t,i),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._setContentsDomNodeDimensions(t,i-10))}_updateResizableNodeMaxDimensions(){var e,t;const i=null!==(e=this._findMaximumRenderingWidth())&&void 0!==e?e:1/0,n=null!==(t=this._findMaximumRenderingHeight())&&void 0!==t?t:1/0;this._resizableNode.maxSize=new Wn(i,n),this._setHoverWidgetMaxDimensions(i,n)}_resize(e){var t,i;_K._lastDimensions=new Wn(e.width,e.height),this._setAdjustedHoverWidgetDimensions(e),this._resizableNode.layout(e.height,e.width),this._updateResizableNodeMaxDimensions(),this._hover.scrollbar.scanDomNode(),this._editor.layoutContentWidget(this),null===(i=null===(t=this._visibleData)||void 0===t?void 0:t.colorPicker)||void 0===i||i.layout()}_findAvailableSpaceVertically(){var e;const t=null===(e=this._visibleData)||void 0===e?void 0:e.showAtPosition;if(t)return 1===this._positionPreference?this._availableVerticalSpaceAbove(t):this._availableVerticalSpaceBelow(t)}_findMaximumRenderingHeight(){const e=this._findAvailableSpaceVertically();if(!e)return;let t=6;return Array.from(this._hover.contentsDomNode.children).forEach((e=>{t+=e.clientHeight})),this._hasHorizontalScrollbar()&&(t+=10),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((e=>e.scrollWidth>e.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=void 0===this._contentWidth?0:this._contentWidth-2;if(e||this._hover.containerDomNode.clientWidththis._visibleData.closestMouseDistance+4)&&(this._visibleData.closestMouseDistance=Math.min(this._visibleData.closestMouseDistance,n),!0)}_setHoverData(e){var t;null===(t=this._visibleData)||void 0===t||t.disposables.dispose(),this._visibleData=e,this._hoverVisibleKey.set(!!e),this._hover.containerDomNode.classList.toggle("hidden",!e)}_layout(){const{fontSize:e,lineHeight:t}=this._editor.getOption(50),i=this._hover.contentsDomNode;i.style.fontSize=`${e}px`,i.style.lineHeight=""+t/e,this._updateMaxDimensions()}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach((e=>this._editor.applyFontInfo(e)))}_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,_K._lastDimensions.height),t=Math.max(.66*this._editor.getLayoutInfo().width,500,_K._lastDimensions.width);this._setHoverWidgetMaxDimensions(t,e)}_render(e,t){this._setHoverData(t),this._updateFont(),this._updateContent(e),this._updateMaxDimensions(),this.onContentsChanged(),this._editor.render()}getPosition(){var e;return this._visibleData?{position:this._visibleData.showAtPosition,secondaryPosition:this._visibleData.showAtSecondaryPosition,positionAffinity:this._visibleData.isBeforeContent?3:void 0,preference:[null!==(e=this._positionPreference)&&void 0!==e?e:1]}:null}showAt(e,t){var i,n,s,o;if(!this._editor||!this._editor.hasModel())return;this._render(e,t);const r=jn(this._hover.containerDomNode),a=t.showAtPosition;this._positionPreference=null!==(i=this._findPositionPreference(r,a))&&void 0!==i?i:1,this.onContentsChanged(),t.stoleFocus&&this._hover.containerDomNode.focus(),null===(n=t.colorPicker)||void 0===n||n.layout();const l=(h=!0===this._configurationService.getValue("accessibility.verbosity.hover")&&this._accessibilityService.isScreenReaderOptimized(),d=null!==(o=null===(s=this._keybindingService.lookupKeybinding("editor.action.accessibleView"))||void 0===s?void 0:s.getAriaLabel())&&void 0!==o?o:"",h&&d?ue(0,"Inspect this in the accessible view with {0}.",d):h?ue(0,"Inspect this in the accessible view via the command Open Accessible View which is currently not triggerable via keybinding."):"");var h,d;l&&(this._hover.contentsDomNode.ariaLabel=this._hover.contentsDomNode.textContent+", "+l)}hide(){if(!this._visibleData)return;const e=this._visibleData.stoleFocus||this._hoverFocusedKey.get();this._setHoverData(void 0),this._resizableNode.maxSize=new Wn(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")}_adjustHoverHeightForScrollbar(e){var t;const i=this._hover.containerDomNode,n=this._hover.contentsDomNode,s=null!==(t=this._findMaximumRenderingHeight())&&void 0!==t?t:1/0;this._setContainerDomNodeDimensions(zn(i),Math.min(s,e)),this._setContentsDomNodeDimensions(zn(n),Math.min(s,e-10))}setMinimumDimensions(e){this._minimumSize=new Wn(Math.max(this._minimumSize.width,e.width),Math.max(this._minimumSize.height,e.height)),this._updateMinimumWidth()}_updateMinimumWidth(){const e=void 0===this._contentWidth?this._minimumSize.width:Math.min(this._contentWidth,this._minimumSize.width);this._resizableNode.minSize=new Wn(e,this._minimumSize.height)}onContentsChanged(){var e;this._removeConstraintsRenderNormally();const t=this._hover.containerDomNode;let i=jn(t),n=zn(t);if(this._resizableNode.layout(i,n),this._setHoverWidgetDimensions(n,i),i=jn(t),n=zn(t),this._contentWidth=n,this._updateMinimumWidth(),this._resizableNode.layout(i,n),this._hasHorizontalScrollbar()&&(this._adjustContentsBottomPadding(),this._adjustHoverHeightForScrollbar(i)),null===(e=this._visibleData)||void 0===e?void 0:e.showAtPosition){const e=jn(this._hover.containerDomNode);this._positionPreference=this._findPositionPreference(e,this._visibleData.showAtPosition)}this._layoutContentWidget()}focus(){this._hover.containerDomNode.focus()}scrollUp(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e-t.lineHeight})}scrollDown(){const e=this._hover.scrollbar.getScrollPosition().scrollTop,t=this._editor.getOption(50);this._hover.scrollbar.setScrollPosition({scrollTop:e+t.lineHeight})}scrollLeft(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e-30})}scrollRight(){const e=this._hover.scrollbar.getScrollPosition().scrollLeft;this._hover.scrollbar.setScrollPosition({scrollLeft:e+30})}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})}};kK.ID="editor.contrib.resizableContentHoverWidget",kK._lastDimensions=new Wn(0,0),kK=_K=vK([bK(1,Ol),bK(2,pu),bK(3,QR),bK(4,WL)],kK);let DK=class extends E{get hasContent(){return this._hasContent}constructor(e){super(),this._keybindingService=e,this._hasContent=!1,this.hoverElement=CK("div.hover-row.status-bar"),this.actionsElement=ds(this.hoverElement,CK("div.actions"))}addAction(e){const t=this._keybindingService.lookupKeybinding(e.commandId),i=t?t.getLabel():null;return this._hasContent=!0,this._register(rK.render(this.actionsElement,e,i))}append(e){const t=ds(this.actionsElement,e);return this._hasContent=!0,t}};DK=vK([bK(0,WL)],DK);class xK{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=0,this._insistOnKeepingHoverVisible=!1}static _getLineDecorations(e,t){if(1!==t.type&&!t.supportsMarkerHover)return[];const i=e.getModel(),n=t.range.startLineNumber;if(n>i.getLineCount())return[];const s=i.getLineMaxColumn(n);return e.getLineDecorations(n).filter((e=>{if(e.options.isWholeLine)return!0;const i=e.range.startLineNumber===n?e.range.startColumn:1,o=e.range.endLineNumber===n?e.range.endColumn:s;if(e.options.showIfCollapsed){if(i>t.range.startColumn+1||t.range.endColumn-1>o)return!1}else if(i>t.range.startColumn||t.range.endColumn>o)return!1;return!0}))}computeAsync(e){const t=this._anchor;if(!this._editor.hasModel()||!t)return cd.EMPTY;const i=xK._getLineDecorations(this._editor,t);return cd.merge(this._participants.map((n=>n.computeAsync?n.computeAsync(t,i,e):cd.EMPTY)))}computeSync(){if(!this._editor.hasModel()||!this._anchor)return[];const e=xK._getLineDecorations(this._editor,this._anchor);let t=[];for(const i of this._participants)t=t.concat(i.computeSync(this._anchor,e));return Bd(t)}}function NK(e,t,i,n,s,o){const r=i+s/2,a=n+o/2,l=Math.max(Math.abs(e-r)-s/2,0),h=Math.max(Math.abs(t-a)-o/2,0);return Math.sqrt(l*l+h*h)}const EK=fs;class IK extends E{constructor(e,t,i){super(),this._renderDisposeables=this._register(new N),this._editor=e,this._isVisible=!1,this._messages=[],this._hover=this._register(new oK),this._hover.containerDomNode.classList.toggle("hidden",!this._isVisible),this._markdownRenderer=this._register(new Jk({editor:this._editor},t,i)),this._computer=new MK(this._editor),this._hoverOperation=this._register(new dK(this._editor,this._computer)),this._register(this._hoverOperation.onResult((e=>{this._withResult(e.value)}))),this._register(this._editor.onDidChangeModelDecorations((()=>this._onModelDecorationsChanged()))),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(50)&&this._updateFont()}))),this._editor.addOverlayWidget(this)}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return IK.ID}getDomNode(){return this._hover.containerDomNode}getPosition(){return null}_updateFont(){Array.prototype.slice.call(this._hover.contentsDomNode.getElementsByClassName("code")).forEach((e=>this._editor.applyFontInfo(e)))}_onModelDecorationsChanged(){this._isVisible&&(this._hoverOperation.cancel(),this._hoverOperation.start(0))}startShowingAt(e){this._computer.lineNumber!==e&&(this._hoverOperation.cancel(),this.hide(),this._computer.lineNumber=e,this._hoverOperation.start(0))}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 e=EK("div.hover-row.markdown-hover"),t=ds(e,EK("div.hover-contents")),s=this._renderDisposeables.add(this._markdownRenderer.render(n.value));t.appendChild(s.element),i.appendChild(e)}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(),s=this._editor.getOption(66),o=i-n-(this._hover.containerDomNode.clientHeight-s)/2;this._hover.containerDomNode.style.left=`${t.glyphMarginLeft+t.glyphMarginWidth}px`,this._hover.containerDomNode.style.top=`${Math.max(Math.round(o),0)}px`}}IK.ID="editor.contrib.modesGlyphHoverWidget";class MK{get lineNumber(){return this._lineNumber}set lineNumber(e){this._lineNumber=e}constructor(e){this._editor=e,this._lineNumber=-1}computeSync(){const e=e=>({value:e}),t=this._editor.getLineDecorations(this._lineNumber),i=[];if(!t)return i;for(const n of t){if(!n.options.glyphMarginClassName)continue;const t=n.options.glyphMarginHoverMessage;t&&!Ra(t)&&i.push(...Zd(t).map(e))}return i}}var TK=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class RK{constructor(e,t,i){this.provider=e,this.hover=t,this.ordinal=i}}function AK(e,t,i,n){const s=e.ordered(t).map(((e,s)=>function(e,t,i,n,s){return TK(this,void 0,void 0,(function*(){try{const o=yield Promise.resolve(e.provideHover(i,n,s));if(o&&function(e){const t=void 0!==e.range,i=void 0!==e.contents&&e.contents&&e.contents.length>0;return t&&i}(o))return new RK(e,o,t)}catch(o){a(o)}}))}(e,s,t,i,n)));return cd.fromPromises(s).coalesce()}yh("_executeHoverProvider",((e,t,i)=>function(e,t,i,n){return AK(e,t,i,n).map((e=>e.hover)).toPromise()}(e.get(oL).hoverProvider,t,i,Uh.None)));var OK=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},PK=function(e,t){return function(i,n){t(i,n,e)}};const FK=fs;class BK{constructor(e,t,i,n,s){this.owner=e,this.range=t,this.contents=i,this.isBeforeContent=n,this.ordinal=s}isValidForHoverAnchor(e){return 1===e.type&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let WK=class{constructor(e,t,i,n,s){this._editor=e,this._languageService=t,this._openerService=i,this._configurationService=n,this._languageFeaturesService=s,this.hoverOrdinal=3}createLoadingMessage(e){return new BK(this,e.range,[(new Ta).appendText(ue(0,"Loading..."))],!1,2e3)}computeSync(e,t){if(!this._editor.hasModel()||1!==e.type)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,s=i.getLineMaxColumn(n),o=[];let r=1e3;const a=i.getLineLength(n),l=i.getLanguageIdAtPosition(e.range.startLineNumber,e.range.startColumn),h=this._editor.getOption(116),d=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:l});let c=!1;h>=0&&a>h&&e.range.startColumn>=h&&(c=!0,o.push(new BK(this,e.range,[{value:ue(0,"Rendering paused for long line for performance reasons. This can be configured via `editor.stopRenderingLineAfter`.")}],!1,r++))),!c&&"number"==typeof d&&a>=d&&o.push(new BK(this,e.range,[{value:ue(0,"Tokenization is skipped for long lines for performance reasons. This can be configured via `editor.maxTokenizationLineLength`.")}],!1,r++));let u=!1;for(const g of t){const t=g.range.startLineNumber===n?g.range.startColumn:1,i=g.range.endLineNumber===n?g.range.endColumn:s,a=g.options.hoverMessage;if(!a||Ra(a))continue;g.options.beforeContentClassName&&(u=!0);const l=new Rh(e.range.startLineNumber,t,e.range.startLineNumber,i);o.push(new BK(this,l,Zd(a),u,r++))}return o}computeAsync(e,t,i){if(!this._editor.hasModel()||1!==e.type)return cd.EMPTY;const n=this._editor.getModel();if(!this._languageFeaturesService.hoverProvider.has(n))return cd.EMPTY;const s=new Va(e.range.startLineNumber,e.range.startColumn);return AK(this._languageFeaturesService.hoverProvider,n,s,i).filter((e=>!Ra(e.hover.contents))).map((t=>{const i=t.hover.range?Rh.lift(t.hover.range):e.range;return new BK(this,i,t.hover.contents,!1,t.ordinal)}))}renderHoverParts(e,t){return VK(e,t,this._editor,this._languageService,this._openerService)}};function VK(e,t,i,n,s){t.sort(((e,t)=>e.ordinal-t.ordinal));const o=new N;for(const r of t)for(const t of r.contents){if(Ra(t))continue;const r=FK("div.hover-row.markdown-hover"),a=ds(r,FK("div.hover-contents")),l=o.add(new Jk({editor:i},n,s));o.add(l.onDidRenderAsync((()=>{a.className="hover-contents code-hover-contents",e.onContentsChanged()})));const h=o.add(l.render(t));a.appendChild(h.element),e.fragment.appendChild(r)}return o}WK=OK([PK(1,Lc),PK(2,qk),PK(3,pu),PK(4,oL)],WK);var HK=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},zK=function(e,t){return function(i,n){t(i,n,e)}};class UK{constructor(e,t,i){this.marker=e,this.index=t,this.total=i}}let KK=class{constructor(e,t,i){this._markerService=t,this._configService=i,this._onDidChange=new U,this.onDidChange=this._onDidChange.event,this._dispoables=new N,this._markers=[],this._nextIdx=-1,an.isUri(e)?this._resourceFilter=t=>t.toString()===e.toString():e&&(this._resourceFilter=e);const n=this._configService.getValue("problems.sortOrder"),s=(e,t)=>{let i=ho(e.resource.toString(),t.resource.toString());return 0===i&&(i="position"===n?Rh.compareRangesUsingStarts(e,t)||yN.compare(e.severity,t.severity):yN.compare(e.severity,t.severity)||Rh.compareRangesUsingStarts(e,t)),i},o=()=>{this._markers=this._markerService.read({resource:an.isUri(e)?e:void 0,severities:yN.Error|yN.Warning|yN.Info}),"function"==typeof e&&(this._markers=this._markers.filter((e=>this._resourceFilter(e.resource)))),this._markers.sort(s)};o(),this._dispoables.add(t.onMarkerChanged((e=>{this._resourceFilter&&!e.some((e=>this._resourceFilter(e)))||(o(),this._nextIdx=-1,this._onDidChange.fire())})))}dispose(){this._dispoables.dispose(),this._onDidChange.dispose()}matches(e){return!this._resourceFilter&&!e||!(!this._resourceFilter||!e)&&this._resourceFilter(e)}get selected(){const e=this._markers[this._nextIdx];return e&&new UK(e,this._nextIdx+1,this._markers.length)}_initIdx(e,t,i){let n=!1,s=this._markers.findIndex((t=>t.resource.toString()===e.uri.toString()));s<0&&(s=Rd(this._markers,{resource:e.uri},((e,t)=>ho(e.resource.toString(),t.resource.toString()))),s<0&&(s=~s));for(let o=s;ot.resource.toString()===e.toString()));if(!(i<0))for(;i=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},YK=function(e,t){return function(i,n){t(i,n,e)}};class XK{constructor(e,t,i,n,s){this._openerService=n,this._labelService=s,this._lines=0,this._longestLineLength=0,this._relatedDiagnostics=new WeakMap,this._disposables=new N,this._editor=t;const o=document.createElement("div");o.className="descriptioncontainer",this._messageBlock=document.createElement("div"),this._messageBlock.classList.add("message"),this._messageBlock.setAttribute("aria-live","assertive"),this._messageBlock.setAttribute("role","alert"),o.appendChild(this._messageBlock),this._relatedBlock=document.createElement("div"),o.appendChild(this._relatedBlock),this._disposables.add(Mn(this._relatedBlock,"click",(e=>{e.preventDefault();const t=this._relatedDiagnostics.get(e.target);t&&i(t)}))),this._scrollable=new RD(o,{horizontal:1,vertical:1,useShadows:!1,horizontalScrollbarSize:6,verticalScrollbarSize:6}),e.appendChild(this._scrollable.getDomNode()),this._disposables.add(this._scrollable.onScroll((e=>{o.style.left=`-${e.scrollLeft}px`,o.style.top=`-${e.scrollTop}px`}))),this._disposables.add(this._scrollable)}dispose(){k(this._disposables)}update(e){const{source:t,message:i,relatedInformation:n,code:s}=e;let o=((null==t?void 0:t.length)||0)+2;s&&(o+="string"==typeof s?s.length:s.value.length);const r=oo(i);this._lines=r.length,this._longestLineLength=0;for(const c of r)this._longestLineLength=Math.max(c.length+o,this._longestLineLength);Dn(this._messageBlock),this._messageBlock.setAttribute("aria-label",this.getAriaLabel(e)),this._editor.applyFontInfo(this._messageBlock);let a=this._messageBlock;for(const c of r)a=document.createElement("div"),a.innerText=c,""===c&&(a.style.height=this._messageBlock.style.lineHeight),this._messageBlock.appendChild(a);if(t||s){const e=document.createElement("span");if(e.classList.add("details"),a.appendChild(e),t){const i=document.createElement("span");i.innerText=t,i.classList.add("source"),e.appendChild(i)}if(s)if("string"==typeof s){const t=document.createElement("span");t.innerText=`(${s})`,t.classList.add("code"),e.appendChild(t)}else{this._codeLink=fs("a.code-link"),this._codeLink.setAttribute("href",`${s.target.toString()}`),this._codeLink.onclick=e=>{this._openerService.open(s.target,{allowCommands:!0}),e.preventDefault(),e.stopPropagation()};ds(this._codeLink,fs("span")).innerText=s.value,e.appendChild(this._codeLink)}}if(Dn(this._relatedBlock),this._editor.applyFontInfo(this._relatedBlock),Hd(n)){const e=this._relatedBlock.appendChild(document.createElement("div"));e.style.paddingTop=`${Math.floor(.66*this._editor.getOption(66))}px`,this._lines+=1;for(const t of n){const i=document.createElement("div"),n=document.createElement("a");n.classList.add("filename"),n.innerText=`${this._labelService.getUriBasenameLabel(t.resource)}(${t.startLineNumber}, ${t.startColumn}): `,n.title=this._labelService.getUriLabel(t.resource),this._relatedDiagnostics.set(n,t);const s=document.createElement("span");s.innerText=t.message,i.appendChild(n),i.appendChild(s),this._lines+=1,e.appendChild(i)}}const l=this._editor.getOption(50),h=Math.ceil(l.typicalFullwidthCharacterWidth*this._longestLineLength*.75),d=l.lineHeight*this._lines;this._scrollable.setScrollDimensions({scrollWidth:h,scrollHeight:d})}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 yN.Error:t=ue(0,"Error");break;case yN.Warning:t=ue(0,"Warning");break;case yN.Info:t=ue(0,"Info");break;case yN.Hint:t=ue(0,"Hint")}let i=ue(0,"{0} at {1}. ",t,e.startLineNumber+":"+e.startColumn);const n=this._editor.getModel();if(n&&e.startLineNumber<=n.getLineCount()&&e.startLineNumber>=1){i=`${n.getLineContent(e.startLineNumber)}, ${i}`}return i}}let QK=GK=class extends ZW{constructor(e,t,i,n,s,o,r){super(e,{showArrow:!0,showFrame:!0,isAccessible:!0,frameWidth:1},s),this._themeService=t,this._openerService=i,this._menuService=n,this._contextKeyService=o,this._labelService=r,this._callOnDispose=new N,this._onDidSelectRelatedInformation=new U,this.onDidSelectRelatedInformation=this._onDidSelectRelatedInformation.event,this._severity=yN.Warning,this._backgroundColor=lc.white,this._applyTheme(t.getColorTheme()),this._callOnDispose.add(t.onDidColorThemeChange(this._applyTheme.bind(this))),this.create()}_applyTheme(e){this._backgroundColor=e.getColor(lj);let t=ij,i=nj;this._severity===yN.Warning?(t=sj,i=oj):this._severity===yN.Info&&(t=rj,i=aj);const n=e.getColor(t),s=e.getColor(i);this.style({arrowColor:n,frameColor:n,headerBackgroundColor:s,primaryHeadingColor:e.getColor(XW),secondaryHeadingColor:e.getColor(QW)})}_applyStyles(){this._parentContainer&&(this._parentContainer.style.backgroundColor=this._backgroundColor?this._backgroundColor.toString():""),super._applyStyles()}dispose(){this._callOnDispose.dispose(),super.dispose()}_fillHead(e){super._fillHead(e),this._disposables.add(this._actionbarWidget.actionRunner.onWillRun((e=>this.editor.focus())));const t=[],i=this._menuService.createMenu(GK.TitleMenu,this._contextKeyService);PW(i,void 0,t),this._actionbarWidget.push(t,{label:!1,icon:!0,index:0}),i.dispose()}_fillTitleIcon(e){this._icon=ds(e,fs(""))}_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 XK(this._container,this.editor,(e=>this._onDidSelectRelatedInformation.fire(e)),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=Rh.lift(e),s=this.editor.getPosition(),o=s&&n.containsPosition(s)?s:n.getStartPosition();super.show(o,this.computeRequiredHeight());const r=this.editor.getModel();if(r){const e=ue(0,i>1?"{0} of {1} problems":"{0} of {1} problem",t,i);this.setTitle(wa(r.uri),e)}this._icon.className=`codicon ${$K.className(yN.toSeverity(this._severity))}`,this.editor.revealPositionNearTop(o,0),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()}};QK.TitleMenu=new eh("gotoErrorTitleMenu"),QK=GK=ZK([YK(1,P_),YK(2,qk),YK(3,th),YK(4,Fa),YK(5,Ol),YK(6,Zz)],QK);const JK=x_(fm,_m),ej=x_(vm,bm),tj=x_(Cm,wm),ij=Dp("editorMarkerNavigationError.background",{dark:JK,light:JK,hcDark:Mp,hcLight:Mp},ue(0,"Editor marker navigation widget error color.")),nj=Dp("editorMarkerNavigationError.headerBackground",{dark:D_(ij,.1),light:D_(ij,.1),hcDark:null,hcLight:null},ue(0,"Editor marker navigation widget error heading background.")),sj=Dp("editorMarkerNavigationWarning.background",{dark:ej,light:ej,hcDark:Mp,hcLight:Mp},ue(0,"Editor marker navigation widget warning color.")),oj=Dp("editorMarkerNavigationWarning.headerBackground",{dark:D_(sj,.1),light:D_(sj,.1),hcDark:"#0C141F",hcLight:D_(sj,.2)},ue(0,"Editor marker navigation widget warning heading background.")),rj=Dp("editorMarkerNavigationInfo.background",{dark:tj,light:tj,hcDark:Mp,hcLight:Mp},ue(0,"Editor marker navigation widget info color.")),aj=Dp("editorMarkerNavigationInfo.headerBackground",{dark:D_(rj,.1),light:D_(rj,.1),hcDark:null,hcLight:null},ue(0,"Editor marker navigation widget info heading background.")),lj=Dp("editorMarkerNavigation.background",{dark:Sm,light:Sm,hcDark:Sm,hcLight:Sm},ue(0,"Editor marker navigation widget background."));var hj,dj=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},cj=function(e,t){return function(i,n){t(i,n,e)}},uj=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let gj=hj=class{static get(e){return e.getContribution(hj.ID)}constructor(e,t,i,n,s){this._markerNavigationService=t,this._contextKeyService=i,this._editorService=n,this._instantiationService=s,this._sessionDispoables=new N,this._editor=e,this._widgetVisible=_j.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(QK,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((e=>{var t,i,n;(null===(t=this._model)||void 0===t?void 0:t.selected)&&Rh.containsPosition(null===(i=this._model)||void 0===i?void 0:i.selected.marker,e.position)||null===(n=this._model)||void 0===n||n.resetIndex()}))),this._sessionDispoables.add(this._model.onDidChange((()=>{if(!this._widget||!this._widget.position||!this._model)return;const e=this._model.find(this._editor.getModel().uri,this._widget.position);e?this._widget.updateMarker(e.marker):this._widget.showStale()}))),this._sessionDispoables.add(this._widget.onDidSelectRelatedInformation((e=>{this._editorService.openCodeEditor({resource:e.resource,options:{pinned:!0,revealIfOpened:!0,selection:Rh.lift(e).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 Va(e.startLineNumber,e.startColumn)),t.selected&&this._widget.showAtMarker(t.selected.marker,t.selected.index,t.selected.total)}}nagivate(e,t){var i,n;return uj(this,void 0,void 0,(function*(){if(this._editor.hasModel()){const s=this._getOrCreateModel(t?void 0:this._editor.getModel().uri);if(s.move(e,this._editor.getModel(),this._editor.getPosition()),!s.selected)return;if(s.selected.marker.resource.toString()!==this._editor.getModel().uri.toString()){this._cleanUp();const o=yield this._editorService.openCodeEditor({resource:s.selected.marker.resource,options:{pinned:!1,revealIfOpened:!0,selectionRevealType:2,selection:s.selected.marker}},this._editor);o&&(null===(i=hj.get(o))||void 0===i||i.close(),null===(n=hj.get(o))||void 0===n||n.nagivate(e,t))}else this._widget.showAtMarker(s.selected.marker,s.selected.index,s.selected.total)}}))}};gj.ID="editor.contrib.markerController",gj=hj=dj([cj(1,jK),cj(2,Ol),cj(3,Wa),cj(4,Fa)],gj);class pj extends bh{constructor(e,t,i){super(i),this._next=e,this._multiFile=t}run(e,t){var i;return uj(this,void 0,void 0,(function*(){t.hasModel()&&(null===(i=gj.get(t))||void 0===i||i.nagivate(this._next,this._multiFile))}))}}class mj extends pj{constructor(){super(!0,!1,{id:mj.ID,label:mj.LABEL,alias:"Go to Next Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:Oh.focus,primary:578,weight:100},menuOpts:{menuId:QK.TitleMenu,title:mj.LABEL,icon:tR("marker-navigation-next",Jr.arrowDown,ue(0,"Icon for goto next marker.")),group:"navigation",order:1}})}}mj.ID="editor.action.marker.next",mj.LABEL=ue(0,"Go to Next Problem (Error, Warning, Info)");class fj extends pj{constructor(){super(!1,!1,{id:fj.ID,label:fj.LABEL,alias:"Go to Previous Problem (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:Oh.focus,primary:1602,weight:100},menuOpts:{menuId:QK.TitleMenu,title:fj.LABEL,icon:tR("marker-navigation-previous",Jr.arrowUp,ue(0,"Icon for goto previous marker.")),group:"navigation",order:2}})}}fj.ID="editor.action.marker.prev",fj.LABEL=ue(0,"Go to Previous Problem (Error, Warning, Info)");Dh(gj.ID,gj,4),Lh(mj),Lh(fj),Lh(class extends pj{constructor(){super(!0,!0,{id:"editor.action.marker.nextInFiles",label:ue(0,"Go to Next Problem in Files (Error, Warning, Info)"),alias:"Go to Next Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:Oh.focus,primary:66,weight:100},menuOpts:{menuId:eh.MenubarGoMenu,title:ue(0,"Next &&Problem"),group:"6_problem_nav",order:1}})}}),Lh(class extends pj{constructor(){super(!1,!0,{id:"editor.action.marker.prevInFiles",label:ue(0,"Go to Previous Problem in Files (Error, Warning, Info)"),alias:"Go to Previous Problem in Files (Error, Warning, Info)",precondition:void 0,kbOpts:{kbExpr:Oh.focus,primary:1090,weight:100},menuOpts:{menuId:eh.MenubarGoMenu,title:ue(0,"Previous &&Problem"),group:"6_problem_nav",order:2}})}});const _j=new Al("markersNavigationVisible",!1);Sh(new(vh.bindToContribution(gj.get))({id:"closeMarkersNavigation",precondition:_j,handler:e=>e.close(),kbOpts:{weight:150,kbExpr:Oh.focus,primary:9,secondary:[1033]}}));var vj=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},bj=function(e,t){return function(i,n){t(i,n,e)}};const Cj=fs;class wj{constructor(e,t,i){this.owner=e,this.range=t,this.marker=i}isValidForHoverAnchor(e){return 1===e.type&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}const yj={type:1,filter:{include:wL.QuickFix},triggerAction:bL.QuickFixHover};let Sj,Lj,kj=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()||1!==e.type&&!e.supportsMarkerHover)return[];const i=this._editor.getModel(),n=e.range.startLineNumber,s=i.getLineMaxColumn(n),o=[];for(const r of t){const t=r.range.startLineNumber===n?r.range.startColumn:1,a=r.range.endLineNumber===n?r.range.endColumn:s,l=this._markerDecorationsService.getMarker(i.uri,r);if(!l)continue;const h=new Rh(e.range.startLineNumber,t,e.range.startLineNumber,a);o.push(new wj(this,h,l))}return o}renderHoverParts(e,t){if(!t.length)return E.None;const i=new N;t.forEach((t=>e.fragment.appendChild(this.renderMarkerHover(t,i))));const n=1===t.length?t[0]:t.sort(((e,t)=>yN.compare(e.marker.severity,t.marker.severity)))[0];return this.renderMarkerStatusbar(e,n,i),i}renderMarkerHover(e,t){const i=Cj("div.hover-row"),n=ds(i,Cj("div.marker.hover-contents")),{source:s,message:o,code:a,relatedInformation:l}=e.marker;this._editor.applyFontInfo(n);const h=ds(n,Cj("span"));if(h.style.whiteSpace="pre-wrap",h.innerText=o,s||a)if(a&&"string"!=typeof a){const e=Cj("span");if(s){ds(e,Cj("span")).innerText=s}const i=ds(e,Cj("a.code-link"));i.setAttribute("href",a.target.toString()),t.add(En(i,"click",(e=>{this._openerService.open(a.target,{allowCommands:!0}),e.preventDefault(),e.stopPropagation()})));ds(i,Cj("span")).innerText=a.value;const o=ds(n,e);o.style.opacity="0.6",o.style.paddingLeft="6px"}else{const e=ds(n,Cj("span"));e.style.opacity="0.6",e.style.paddingLeft="6px",e.innerText=s&&a?`${s}(${a})`:s||`(${a})`}if(Hd(l))for(const{message:d,resource:c,startLineNumber:u,startColumn:g}of l){const e=ds(n,Cj("div"));e.style.marginTop="8px";const i=ds(e,Cj("a"));i.innerText=`${wa(c)}(${u}, ${g}): `,i.style.cursor="pointer",t.add(En(i,"click",(e=>{e.stopPropagation(),e.preventDefault(),this._openerService&&this._openerService.open(c,{fromUserGesture:!0,editorOptions:{selection:{startLineNumber:u,startColumn:g}}}).catch(r)})));const s=ds(e,Cj("span"));s.innerText=d,this._editor.applyFontInfo(s)}return i}renderMarkerStatusbar(e,t,i){if(t.marker.severity!==yN.Error&&t.marker.severity!==yN.Warning&&t.marker.severity!==yN.Info||e.statusBar.addAction({label:ue(0,"View Problem"),commandId:mj.ID,run:()=>{var i;e.hide(),null===(i=gj.get(this._editor))||void 0===i||i.showAtMarker(t.marker),this._editor.focus()}}),!this._editor.getOption(90)){const n=e.statusBar.append(Cj("div"));this.recentMarkerCodeActionsInfo&&(SN.makeKey(this.recentMarkerCodeActionsInfo.marker)===SN.makeKey(t.marker)?this.recentMarkerCodeActionsInfo.hasCodeActions||(n.textContent=ue(0,"No quick fixes available")):this.recentMarkerCodeActionsInfo=void 0);const s=this.recentMarkerCodeActionsInfo&&!this.recentMarkerCodeActionsInfo.hasCodeActions?E.None:i.add(id((()=>n.textContent=ue(0,"Checking for quick fixes...")),200));n.textContent||(n.textContent=String.fromCharCode(160));const o=this.getCodeActions(t.marker);i.add(x((()=>o.cancel()))),o.then((o=>{if(s.dispose(),this.recentMarkerCodeActionsInfo={marker:t.marker,hasCodeActions:o.validActions.length>0},!this.recentMarkerCodeActionsInfo.hasCodeActions)return o.dispose(),void(n.textContent=ue(0,"No quick fixes available"));n.style.display="none";let r=!1;i.add(x((()=>{r||o.dispose()}))),e.statusBar.addAction({label:ue(0,"Quick Fix..."),commandId:xL,run:t=>{r=!0;const i=ON.get(this._editor),n=Hn(t);e.hide(),null==i||i.showCodeActions(yj,o,{x:n.left,y:n.top,width:n.width,height:n.height})}})}),r)}}getCodeActions(e){return Yh((t=>OL(this._languageFeaturesService.codeActionProvider,this._editor.getModel(),new Rh(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),yj,_L.None,t)))}};function Dj(){return Sj}kj=vj([bj(1,AR),bj(2,qk),bj(3,oL)],kj);class xj{get TChange(){return null}reportChanges(){this.get()}read(e){return e?e.readObservable(this):this.get()}map(e,t){const i=void 0===t?void 0:e,n=void 0===t?e:t;return Lj({owner:i,debugName:()=>{const e=Rj(n);if(void 0!==e)return e;const t=/^\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());return t?`${this.debugName}.${t[2]}`:i?void 0:`${this.debugName} (mapped)`}},(e=>n(this.read(e),e)))}}class Nj extends xj{constructor(){super(...arguments),this.observers=new Set}addObserver(e){const t=this.observers.size;this.observers.add(e),0===t&&this.onFirstObserverAdded()}removeObserver(e){this.observers.delete(e)&&0===this.observers.size&&this.onLastObserverRemoved()}onFirstObserverAdded(){}onLastObserverRemoved(){}}function Ej(e,t){const i=new Mj(e,t);try{e(i)}finally{i.finish()}}function Ij(e,t,i){e?t(e):Ej(t,i)}class Mj{constructor(e,t){var i;this._fn=e,this._getDebugName=t,this.updatingObservers=[],null===(i=Dj())||void 0===i||i.handleBeginTransaction(this)}getDebugName(){return this._getDebugName?this._getDebugName():Rj(this._fn)}updateObserver(e,t){this.updatingObservers.push({observer:e,observable:t}),e.beginUpdate(t)}finish(){var e;const t=this.updatingObservers;this.updatingObservers=null;for(const{observer:i,observable:n}of t)i.endUpdate(n);null===(e=Dj())||void 0===e||e.handleEndTransaction()}}function Tj(e,t,i,n){let s;if(void 0!==e){if("function"!=typeof e)return e;if(s=e(),void 0!==s)return s}if(void 0!==t&&(s=Rj(t),void 0!==s))return s;if(void 0!==i)for(const o in i)if(i[o]===n)return o}function Rj(e){const t=e.toString(),i=/\/\*\*\s*@description\s*([^*]*)\*\//.exec(t),n=i?i[1]:void 0;return null==n?void 0:n.trim()}function Aj(e,t){return"string"==typeof e?new Oj(void 0,e,t):new Oj(e,void 0,t)}class Oj extends Nj{get debugName(){var e;return null!==(e=Tj(this._debugName,void 0,this._owner,this))&&void 0!==e?e:"ObservableValue"}constructor(e,t,i){super(),this._owner=e,this._debugName=t,this._value=i}get(){return this._value}set(e,t,i){var n;if(this._value===e)return;let s;t||(t=s=new Mj((()=>{}),(()=>`Setting ${this.debugName}`)));try{const s=this._value;this._setValue(e),null===(n=Dj())||void 0===n||n.handleObservableChanged(this,{oldValue:s,newValue:e,change:i,didChange:!0,hadValue:!0});for(const e of this.observers)t.updateObserver(e,this),e.handleChange(this,i)}finally{s&&s.finish()}}toString(){return`${this.debugName}: ${this._value}`}_setValue(e){this._value=e}}function Pj(e,t){return"string"==typeof e?new Fj(void 0,e,t):new Fj(e,void 0,t)}class Fj extends Oj{_setValue(e){this._value!==e&&(this._value&&this._value.dispose(),this._value=e)}dispose(){var e;null===(e=this._value)||void 0===e||e.dispose()}}const Bj=(e,t)=>e===t;function Wj(e,t){return void 0!==t?new zj(e,void 0,t,void 0,void 0,void 0,Bj):new zj(void 0,void 0,e,void 0,void 0,void 0,Bj)}function Vj(e,t){var i;return new zj(e.owner,e.debugName,t,void 0,void 0,void 0,null!==(i=e.equalityComparer)&&void 0!==i?i:Bj)}function Hj(e,t){let i,n;void 0===t?(i=e,n=void 0):(n=e,i=t);const s=new N;return new zj(n,(()=>{var e;return null!==(e=Rj(i))&&void 0!==e?e:"(anonymous)"}),(e=>(s.clear(),i(e,s))),void 0,void 0,(()=>s.dispose()),Bj)}!function(e){Lj=e}(Wj);class zj extends Nj{get debugName(){var e;return null!==(e=Tj(this._debugName,this._computeFn,this._owner,this))&&void 0!==e?e:"(anonymous)"}constructor(e,t,i,n,s,o=void 0,r){var a,l;super(),this._owner=e,this._debugName=t,this._computeFn=i,this.createChangeSummary=n,this._handleChange=s,this._handleLastObserverRemoved=o,this._equalityComparator=r,this.state=0,this.value=void 0,this.updateCount=0,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=void 0,this.changeSummary=null===(a=this.createChangeSummary)||void 0===a?void 0:a.call(this),null===(l=Dj())||void 0===l||l.handleDerivedCreated(this)}onLastObserverRemoved(){var e;this.state=0,this.value=void 0;for(const t of this.dependencies)t.removeObserver(this);this.dependencies.clear(),null===(e=this._handleLastObserverRemoved)||void 0===e||e.call(this)}get(){var e;if(0===this.observers.size){const t=this._computeFn(this,null===(e=this.createChangeSummary)||void 0===e?void 0:e.call(this));return this.onLastObserverRemoved(),t}do{if(1===this.state)for(const e of this.dependencies)if(e.reportChanges(),2===this.state)break;1===this.state&&(this.state=3),this._recomputeIfNeeded()}while(3!==this.state);return this.value}_recomputeIfNeeded(){var e,t;if(3===this.state)return;const i=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=i;const n=0!==this.state,s=this.value;this.state=3;const o=this.changeSummary;this.changeSummary=null===(e=this.createChangeSummary)||void 0===e?void 0:e.call(this);try{this.value=this._computeFn(this,o)}finally{for(const e of this.dependenciesToBeRemoved)e.removeObserver(this);this.dependenciesToBeRemoved.clear()}const r=n&&!this._equalityComparator(s,this.value);if(null===(t=Dj())||void 0===t||t.handleDerivedRecomputed(this,{oldValue:s,newValue:this.value,change:void 0,didChange:r,hadValue:n}),r)for(const a of this.observers)a.handleChange(this,void 0)}toString(){return`LazyDerived<${this.debugName}>`}beginUpdate(e){this.updateCount++;const t=1===this.updateCount;if(3===this.state&&(this.state=1,!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--,0===this.updateCount){const e=[...this.observers];for(const t of e)t.endUpdate(this)}if(this.updateCount<0)throw new f}handlePossibleChange(e){if(3===this.state&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){this.state=1;for(const e of this.observers)e.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:t=>t===e},this.changeSummary),n=3===this.state;if(i&&(1===this.state||n)&&(this.state=2,n))for(const e of this.observers)e.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)}}function Uj(e,t){return new $j(e.debugName,t,void 0,void 0)}function Kj(e){return new $j(void 0,e,void 0,void 0)}function jj(e,t){return new $j(e.debugName,t,e.createEmptyChangeSummary,e.handleChange)}function qj(e){const t=new N,i=Uj({debugName:()=>Rj(e)||"(anonymous)"},(i=>{t.clear(),e(i,t)}));return x((()=>{i.dispose(),t.dispose()}))}class $j{get debugName(){if("string"==typeof this._debugName)return this._debugName;if("function"==typeof this._debugName){const e=this._debugName();if(void 0!==e)return e}const e=Rj(this._runFn);return void 0!==e?e:"(anonymous)"}constructor(e,t,i,n){var s,o;this._debugName=e,this._runFn=t,this.createChangeSummary=i,this._handleChange=n,this.state=2,this.updateCount=0,this.disposed=!1,this.dependencies=new Set,this.dependenciesToBeRemoved=new Set,this.changeSummary=null===(s=this.createChangeSummary)||void 0===s?void 0:s.call(this),null===(o=Dj())||void 0===o||o.handleAutorunCreated(this),this._runIfNeeded(),C(this)}dispose(){this.disposed=!0;for(const e of this.dependencies)e.removeObserver(this);this.dependencies.clear(),w(this)}_runIfNeeded(){var e,t,i;if(3===this.state)return;const n=this.dependenciesToBeRemoved;this.dependenciesToBeRemoved=this.dependencies,this.dependencies=n,this.state=3;try{if(!this.disposed){null===(e=Dj())||void 0===e||e.handleAutorunTriggered(this);const i=this.changeSummary;this.changeSummary=null===(t=this.createChangeSummary)||void 0===t?void 0:t.call(this),this._runFn(this,i)}}finally{null===(i=Dj())||void 0===i||i.handleAutorunFinished(this);for(const e of this.dependenciesToBeRemoved)e.removeObserver(this);this.dependenciesToBeRemoved.clear()}}toString(){return`Autorun<${this.debugName}>`}beginUpdate(){3===this.state&&(this.state=1),this.updateCount++}endUpdate(){if(1===this.updateCount)do{if(1===this.state){this.state=3;for(const e of this.dependencies)if(e.reportChanges(),2===this.state)break}this._runIfNeeded()}while(3!==this.state);this.updateCount--,Ul((()=>this.updateCount>=0))}handlePossibleChange(e){3===this.state&&this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)&&(this.state=1)}handleChange(e,t){if(this.dependencies.has(e)&&!this.dependenciesToBeRemoved.has(e)){(!this._handleChange||this._handleChange({changedObservable:e,change:t,didChange:t=>t===e},this.changeSummary))&&(this.state=2)}}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 Gj(e){return new Zj(e)}!function(e){e.Observer=$j}(Kj||(Kj={}));class Zj extends xj{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 Yj(e,t){return new Xj(e,t)}class Xj extends Nj{constructor(e,t){super(),this.event=e,this._getValue=t,this.hasValue=!1,this.handleEvent=e=>{var t;const i=this._getValue(e),n=!this.hasValue||this.value!==i;null===(t=Dj())||void 0===t||t.handleFromEventObservableTriggered(this,{oldValue:this.value,newValue:i,change:void 0,didChange:n,hadValue:this.hasValue}),n&&(this.value=i,this.hasValue&&Ej((e=>{for(const t of this.observers)e.updateObserver(t,this),t.handleChange(this,void 0)}),(()=>{const e=this.getDebugName();return"Event fired"+(e?`: ${e}`:"")})),this.hasValue=!0)}}getDebugName(){return Rj(this._getValue)}get debugName(){const e=this.getDebugName();return"From Event"+(e?`: ${e}`:"")}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0,this.hasValue=!1,this.value=void 0}get(){return this.subscription?(this.hasValue||this.handleEvent(void 0),this.value):this._getValue(void 0)}}function Qj(e,t){return new Jj(e,t)}!function(e){e.Observer=Xj}(Yj||(Yj={}));class Jj extends Nj{constructor(e,t){super(),this.debugName=e,this.event=t,this.handleEvent=()=>{Ej((e=>{for(const t of this.observers)e.updateObserver(t,this),t.handleChange(this,void 0)}),(()=>this.debugName))}}onFirstObserverAdded(){this.subscription=this.event(this.handleEvent)}onLastObserverRemoved(){this.subscription.dispose(),this.subscription=void 0}get(){}}function eq(e){return"string"==typeof e?new tq(e):new tq(void 0,e)}class tq extends Nj{get debugName(){var e;return null!==(e=Tj(this._debugName,void 0,this._owner,this))&&void 0!==e?e:"Observable Signal"}constructor(e,t){super(),this._debugName=e,this._owner=t}trigger(e,t){if(e)for(const i of this.observers)e.updateObserver(i,this),i.handleChange(this,t);else Ej((e=>{this.trigger(e,t)}),(()=>`Trigger signal ${this.debugName}`))}get(){}}function iq(e){const t=new nq(!0);return e.addObserver(t),e.reportChanges(),x((()=>{e.removeObserver(t)}))}class nq{constructor(e){this.forceRecompute=e,this.counter=0}beginUpdate(e){this.counter++}endUpdate(e){this.counter--,0===this.counter&&this.forceRecompute&&e.reportChanges()}handlePossibleChange(e){}handleChange(e,t){}}const sq="editor.action.inlineSuggest.commit",oq="editor.action.inlineSuggest.showPrevious",rq="editor.action.inlineSuggest.showNext";var aq=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class lq extends E{constructor(e,t,i={orientation:0}){super(),this.submenuActionViewItems=[],this.hasSecondaryActions=!1,this._onDidChangeDropdownVisibility=this._register(new G),this.onDidChangeDropdownVisibility=this._onDidChangeDropdownVisibility.event,this.disposables=this._register(new N),this.options=i,this.lookupKeybindings="function"==typeof this.options.getKeyBinding,this.toggleMenuAction=this._register(new hq((()=>{var e;return null===(e=this.toggleMenuActionViewItem)||void 0===e?void 0:e.show()}),i.toggleMenuTitle)),this.element=document.createElement("div"),this.element.className="monaco-toolbar",e.appendChild(this.element),this.actionBar=this._register(new Rx(this.element,{orientation:i.orientation,ariaLabel:i.ariaLabel,actionRunner:i.actionRunner,allowContextMenu:i.allowContextMenu,highlightToggledItems:i.highlightToggledItems,actionViewItemProvider:(e,n)=>{var s;if(e.id===hq.ID)return this.toggleMenuActionViewItem=new TW(e,e.menuActions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:ta.asClassNameArray(null!==(s=i.moreIcon)&&void 0!==s?s:Jr.toolBarMore),anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry}),this.toggleMenuActionViewItem.setActionContext(this.actionBar.context),this.disposables.add(this._onDidChangeDropdownVisibility.add(this.toggleMenuActionViewItem.onDidChangeVisibility)),this.toggleMenuActionViewItem;if(i.actionViewItemProvider){const t=i.actionViewItemProvider(e,n);if(t)return t}if(e instanceof $a){const i=new TW(e,e.actions,t,{actionViewItemProvider:this.options.actionViewItemProvider,actionRunner:this.actionRunner,keybindingProvider:this.options.getKeyBinding,classNames:e.class,anchorAlignmentProvider:this.options.anchorAlignmentProvider,menuAsChild:!!this.options.renderDropdownAsChildElement,skipTelemetry:this.options.skipTelemetry});return i.setActionContext(this.actionBar.context),this.submenuActionViewItems.push(i),this.disposables.add(this._onDidChangeDropdownVisibility.add(i.onDidChangeVisibility)),i}}}))}set actionRunner(e){this.actionBar.actionRunner=e}get actionRunner(){return this.actionBar.actionRunner}getElement(){return this.element}getItemAction(e){return this.actionBar.getAction(e)}setActions(e,t){this.clear();const i=e?e.slice(0):[];this.hasSecondaryActions=!!(t&&t.length>0),this.hasSecondaryActions&&t&&(this.toggleMenuAction.menuActions=t.slice(0),i.push(this.toggleMenuAction)),i.forEach((e=>{this.actionBar.push(e,{icon:!0,label:!1,keybinding:this.getKeybindingLabel(e)})}))}getKeybindingLabel(e){var t,i,n;const s=this.lookupKeybindings?null===(i=(t=this.options).getKeyBinding)||void 0===i?void 0:i.call(t,e):void 0;return null!==(n=null==s?void 0:s.getLabel())&&void 0!==n?n:void 0}clear(){this.submenuActionViewItems=[],this.disposables.clear(),this.actionBar.clear()}dispose(){this.clear(),this.disposables.dispose(),super.dispose()}}class hq extends Ka{constructor(e,t){t=t||ue(0,"More Actions..."),super(hq.ID,t,void 0,!0),this._menuActions=[],this.toggleDropdownMenu=e}run(){return aq(this,void 0,void 0,(function*(){this.toggleDropdownMenu()}))}get menuActions(){return this._menuActions}set menuActions(e){this._menuActions=e}}hq.ID="toolbar.toggle.more";var dq=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},cq=function(e,t){return function(i,n){t(i,n,e)}};let uq=class extends lq{constructor(e,t,i,n,s,o,r){super(e,s,Object.assign(Object.assign({getKeyBinding:e=>{var t;return null!==(t=o.lookupKeybinding(e.id))&&void 0!==t?t:void 0}},t),{allowContextMenu:!0,skipTelemetry:"string"==typeof(null==t?void 0:t.telemetrySource)})),this._options=t,this._menuService=i,this._contextKeyService=n,this._contextMenuService=s,this._sessionDisposables=this._store.add(new N);const a=null==t?void 0:t.telemetrySource;a&&this._store.add(this.actionBar.onDidRun((e=>r.publicLog2("workbenchActionExecuted",{id:e.action.id,from:a}))))}setActions(e,t=[],i){var n,s,o;this._sessionDisposables.clear();const r=e.slice(),a=t.slice(),l=[];let h=0;const d=[];let c=!1;if(-1!==(null===(n=this._options)||void 0===n?void 0:n.hiddenItemStrategy))for(let u=0;unull==e?void 0:e.id))),t=this._options.overflowBehavior.maxItems-e.size;let i=0;for(let n=0;n=t&&(r[n]=void 0,d[n]=s))}}Wd(r),Wd(d),super.setActions(r,qa.join(d,a)),l.length>0&&this._sessionDisposables.add(En(this.getElement(),"contextmenu",(e=>{var t,n,s,o,r;const a=new Nt(e),d=this.getItemAction(a.target);if(!d)return;a.preventDefault(),a.stopPropagation();let u,g=!1;if(1===h&&0===(null===(t=this._options)||void 0===t?void 0:t.hiddenItemStrategy)){g=!0;for(let e=0;ethis._menuService.resetHiddenStates(i)}))),this._contextMenuService.showContextMenu({getAnchor:()=>a,getActions:()=>p,menuId:null===(s=this._options)||void 0===s?void 0:s.contextMenu,menuActionOptions:Object.assign({renderShortTitle:!0},null===(o=this._options)||void 0===o?void 0:o.menuOptions),skipTelemetry:"string"==typeof(null===(r=this._options)||void 0===r?void 0:r.telemetrySource),contextKeyService:this._contextKeyService})})))}};uq=dq([cq(2,th),cq(3,Ol),cq(4,Kx),cq(5,WL),cq(6,lh)],uq);var gq,pq=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},mq=function(e,t){return function(i,n){t(i,n,e)}};let fq=class extends E{constructor(e,t,i){super(),this.editor=e,this.model=t,this.instantiationService=i,this.alwaysShowToolbar=Yj(this.editor.onDidChangeConfiguration,(()=>"always"===this.editor.getOption(62).showToolbar)),this.sessionPosition=void 0,this.position=Wj(this,(e=>{var t,i,n;const s=null===(t=this.model.read(e))||void 0===t?void 0:t.ghostText.read(e);if(!this.alwaysShowToolbar.read(e)||!s||0===s.parts.length)return this.sessionPosition=void 0,null;const o=s.parts[0].column;this.sessionPosition&&this.sessionPosition.lineNumber!==s.lineNumber&&(this.sessionPosition=void 0);const r=new Va(s.lineNumber,Math.min(o,null!==(n=null===(i=this.sessionPosition)||void 0===i?void 0:i.column)&&void 0!==n?n:Number.MAX_SAFE_INTEGER));return this.sessionPosition=r,r})),this._register(qj(((t,i)=>{const n=this.model.read(t);if(!n||!this.alwaysShowToolbar.read(t))return;const s=i.add(this.instantiationService.createInstance(bq,this.editor,!0,this.position,n.selectedInlineCompletionIndex,n.inlineCompletionsCount,n.selectedInlineCompletion.map((e=>{var t;return null!==(t=null==e?void 0:e.inlineCompletion.source.inlineCompletions.commands)&&void 0!==t?t:[]}))));e.addContentWidget(s),i.add(x((()=>e.removeContentWidget(s)))),i.add(Kj((e=>{this.position.read(e)&&n.lastTriggerKind.read(e)!==pC.Explicit&&n.triggerExplicitly()})))})))}};fq=pq([mq(2,Fa)],fq);const _q=tR("inline-suggestion-hints-next",Jr.chevronRight,ue(0,"Icon for show next parameter hint.")),vq=tR("inline-suggestion-hints-previous",Jr.chevronLeft,ue(0,"Icon for show previous parameter hint."));let bq=gq=class extends E{static get dropDownVisible(){return this._dropDownVisible}createCommandAction(e,t,i){const n=new Ka(e,t,i,!0,(()=>this._commandService.executeCommand(e))),s=this.keybindingService.lookupKeybinding(e,this._contextKeyService);let o=t;return s&&(o=ue(0,"{0} ({1})",t,s.getLabel())),n.tooltip=o,n}constructor(e,t,i,n,s,o,r,a,l,h,d){super(),this.editor=e,this.withBorder=t,this._position=i,this._currentSuggestionIdx=n,this._suggestionCount=s,this._extraCommands=o,this._commandService=r,this.keybindingService=l,this._contextKeyService=h,this._menuService=d,this.id="InlineSuggestionHintsContentWidget"+gq.id++,this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this.nodes=Ns("div.inlineSuggestionsHints",{className:this.withBorder?".withBorder":""},[Ns("div@toolBar")]),this.previousAction=this.createCommandAction(oq,ue(0,"Previous"),ta.asClassName(vq)),this.availableSuggestionCountAction=new Ka("inlineSuggestionHints.availableSuggestionCount","",void 0,!1),this.nextAction=this.createCommandAction(rq,ue(0,"Next"),ta.asClassName(_q)),this.inlineCompletionsActionsMenus=this._register(this._menuService.createMenu(eh.InlineCompletionsActions,this._contextKeyService)),this.clearAvailableSuggestionCountLabelDebounced=this._register(new rd((()=>{this.availableSuggestionCountAction.label=""}),100)),this.disableButtonsDebounced=this._register(new rd((()=>{this.previousAction.enabled=this.nextAction.enabled=!1}),100)),this.lastCommands=[],this.toolBar=this._register(a.createInstance(yq,this.nodes.toolBar,eh.InlineSuggestionToolbar,{menuOptions:{renderShortTitle:!0},toolbarOptions:{primaryGroup:e=>e.startsWith("primary")},actionViewItemProvider:(e,t)=>{if(e instanceof oh)return a.createInstance(wq,e,void 0);if(e===this.availableSuggestionCountAction){const t=new Cq(void 0,e,{label:!0,icon:!1});return t.setClass("availableSuggestionCount"),t}},telemetrySource:"InlineSuggestionToolbar"})),this.toolBar.setPrependedPrimaryActions([this.previousAction,this.availableSuggestionCountAction,this.nextAction]),this._register(this.toolBar.onDidChangeDropdownVisibility((e=>{gq._dropDownVisible=e}))),this._register(Kj((e=>{this._position.read(e),this.editor.layoutContentWidget(this)}))),this._register(Kj((e=>{const t=this._suggestionCount.read(e),i=this._currentSuggestionIdx.read(e);void 0!==t?(this.clearAvailableSuggestionCountLabelDebounced.cancel(),this.availableSuggestionCountAction.label=`${i+1}/${t}`):this.clearAvailableSuggestionCountLabelDebounced.schedule(),void 0!==t&&t>1?(this.disableButtonsDebounced.cancel(),this.previousAction.enabled=this.nextAction.enabled=!0):this.disableButtonsDebounced.schedule()}))),this._register(Kj((e=>{const t=this._extraCommands.read(e);if(Td(this.lastCommands,t))return;this.lastCommands=t;const i=t.map((e=>({class:void 0,id:e.id,enabled:!0,tooltip:e.tooltip||"",label:e.title,run:t=>this._commandService.executeCommand(e.id)})));for(const[n,s]of this.inlineCompletionsActionsMenus.getActions())for(const e of s)e instanceof oh&&i.push(e);i.length>0&&i.unshift(new qa),this.toolBar.setAdditionalSecondaryActions(i)})))}getId(){return this.id}getDomNode(){return this.nodes.root}getPosition(){return{position:this._position.get(),preference:[1,2],positionAffinity:3}}};bq._dropDownVisible=!1,bq.id=0,bq=gq=pq([mq(6,Ya),mq(7,Fa),mq(8,WL),mq(9,Ol),mq(10,th)],bq);class Cq extends Ix{constructor(){super(...arguments),this._className=void 0}setClass(e){this._className=e}render(e){super.render(e),this._className&&e.classList.add(this._className)}}class wq extends BW{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();if(this.label){const t=Ns("div.keybinding").root;new zx(t,$e,Object.assign({disableTitle:!0},Hx)).set(e),this.label.textContent=this._action.label,this.label.appendChild(t),this.label.classList.add("inlineSuggestionStatusBarItemLabel")}}}let yq=class extends uq{constructor(e,t,i,n,s,o,r,a){super(e,Object.assign({resetMenu:t},i),n,s,o,r,a),this.menuId=t,this.options2=i,this.menuService=n,this.contextKeyService=s,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(){var e,t,i,n,s,o,r;const a=[],l=[];PW(this.menu,null===(e=this.options2)||void 0===e?void 0:e.menuOptions,{primary:a,secondary:l},null===(i=null===(t=this.options2)||void 0===t?void 0:t.toolbarOptions)||void 0===i?void 0:i.primaryGroup,null===(s=null===(n=this.options2)||void 0===n?void 0:n.toolbarOptions)||void 0===s?void 0:s.shouldInlineSubmenu,null===(r=null===(o=this.options2)||void 0===o?void 0:o.toolbarOptions)||void 0===r?void 0:r.useSeparatorsInPrimaryActions),l.push(...this.additionalActions),a.unshift(...this.prependedPrimaryActions),this.setActions(a,l)}setPrependedPrimaryActions(e){Td(this.prependedPrimaryActions,e,((e,t)=>e===t))||(this.prependedPrimaryActions=e,this.updateToolbar())}setAdditionalSecondaryActions(e){Td(this.additionalActions,e,((e,t)=>e===t))||(this.additionalActions=e,this.updateToolbar())}};yq=pq([mq(3,th),mq(4,Ol),mq(5,Kx),mq(6,WL),mq(7,lh)],yq);var Sq,Lq=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},kq=function(e,t){return function(i,n){t(i,n,e)}};const Dq=!1;let xq=Sq=class extends E{static get(e){return e.getContribution(Sq.ID)}constructor(e,t,i,n,s){super(),this._editor=e,this._instantiationService=t,this._openerService=i,this._languageService=n,this._keybindingService=s,this._toUnhook=new N,this._hoverActivatedByColorDecoratorClick=!1,this._isMouseDown=!1,this._hoverClicked=!1,this._contentWidget=null,this._glyphWidget=null,this._reactToEditorMouseMoveRunner=this._register(new rd((()=>this._reactToEditorMouseMove(this._mouseMoveEvent)),0)),this._hookEvents(),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(60)&&(this._unhookEvents(),this._hookEvents())}))),this._register(this._editor.onMouseLeave((()=>{this._mouseMoveEvent=void 0,this._reactToEditorMouseMoveRunner.cancel()})))}_hookEvents(){const e=this._editor.getOption(60);this._isHoverEnabled=e.enabled,this._isHoverSticky=e.sticky,this._hidingDelay=e.hidingDelay,this._isHoverEnabled?(this._toUnhook.add(this._editor.onMouseDown((e=>this._onEditorMouseDown(e)))),this._toUnhook.add(this._editor.onMouseUp((e=>this._onEditorMouseUp(e)))),this._toUnhook.add(this._editor.onMouseMove((e=>this._onEditorMouseMove(e)))),this._toUnhook.add(this._editor.onKeyDown((e=>this._onKeyDown(e))))):(this._toUnhook.add(this._editor.onMouseMove((e=>this._onEditorMouseMove(e)))),this._toUnhook.add(this._editor.onKeyDown((e=>this._onKeyDown(e))))),this._toUnhook.add(this._editor.onMouseLeave((e=>this._onEditorMouseLeave(e)))),this._toUnhook.add(this._editor.onDidChangeModel((()=>this._hideWidgets()))),this._toUnhook.add(this._editor.onDidScrollChange((e=>this._onEditorScrollChanged(e))))}_unhookEvents(){this._toUnhook.clear()}_onEditorScrollChanged(e){(e.scrollTopChanged||e.scrollLeftChanged)&&this._hideWidgets()}_onEditorMouseDown(e){var t;this._isMouseDown=!0;const i=e.target;9!==i.type||i.detail!==kK.ID?12===i.type&&i.detail===IK.ID||(12!==i.type&&(this._hoverClicked=!1),(null===(t=this._contentWidget)||void 0===t?void 0:t.widget.isResizing)||this._hideWidgets()):this._hoverClicked=!0}_onEditorMouseUp(e){this._isMouseDown=!1}_onEditorMouseLeave(e){var t,i;const n=e.event.browserEvent.relatedTarget;(null===(t=this._contentWidget)||void 0===t?void 0:t.widget.isResizing)||(null===(i=this._contentWidget)||void 0===i?void 0:i.containsNode(n))||this._hideWidgets()}_isMouseOverWidget(e){var t,i,n,s,o;const r=e.target;return!(!this._isHoverSticky||9!==r.type||r.detail!==kK.ID)||(!(!this._isHoverSticky||!(null===(t=this._contentWidget)||void 0===t?void 0:t.containsNode(null===(i=e.event.browserEvent.view)||void 0===i?void 0:i.document.activeElement))||(null===(s=null===(n=e.event.browserEvent.view)||void 0===n?void 0:n.getSelection())||void 0===s?void 0:s.isCollapsed))||(!(this._isHoverSticky||9!==r.type||r.detail!==kK.ID||!(null===(o=this._contentWidget)||void 0===o?void 0:o.isColorPickerVisible))||!(!this._isHoverSticky||12!==r.type||r.detail!==IK.ID)))}_onEditorMouseMove(e){var t,i,n,s;if(this._mouseMoveEvent=e,(null===(t=this._contentWidget)||void 0===t?void 0:t.isFocused)||(null===(i=this._contentWidget)||void 0===i?void 0:i.isResizing))return;if(this._isMouseDown&&this._hoverClicked)return;if(this._isHoverSticky&&(null===(n=this._contentWidget)||void 0===n?void 0:n.isVisibleFromKeyboard))return;this._isMouseOverWidget(e)?this._reactToEditorMouseMoveRunner.cancel():(null===(s=this._contentWidget)||void 0===s?void 0:s.isVisible)&&this._isHoverSticky&&this._hidingDelay>0?this._reactToEditorMouseMoveRunner.isScheduled()||this._reactToEditorMouseMoveRunner.schedule(this._hidingDelay):this._reactToEditorMouseMove(e)}_reactToEditorMouseMove(e){var t,i,n;if(!e)return;const s=e.target,o=null===(t=s.element)||void 0===t?void 0:t.classList.contains("colorpicker-color-decoration"),r=this._editor.getOption(146);if(o&&("click"===r&&!this._hoverActivatedByColorDecoratorClick||"hover"===r&&!this._isHoverEnabled||"clickAndHover"===r&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)||!o&&!this._isHoverEnabled&&!this._hoverActivatedByColorDecoratorClick)return void this._hideWidgets();if(this._getOrCreateContentWidget().maybeShowAt(e))null===(i=this._glyphWidget)||void 0===i||i.hide();else{if(2===s.type&&s.position)return null===(n=this._contentWidget)||void 0===n||n.hide(),this._glyphWidget||(this._glyphWidget=new IK(this._editor,this._languageService,this._openerService)),void this._glyphWidget.startShowingAt(s.position.lineNumber);Dq,this._hideWidgets()}}_onKeyDown(e){var t;if(!this._editor.hasModel())return;const i=this._keybindingService.softDispatch(e,this._editor.getDomNode()),n=1===i.kind||2===i.kind&&"editor.action.showHover"===i.commandId&&(null===(t=this._contentWidget)||void 0===t?void 0:t.isVisible);5===e.keyCode||6===e.keyCode||57===e.keyCode||4===e.keyCode||n||this._hideWidgets()}_hideWidgets(){var e,t,i;this._isMouseDown&&this._hoverClicked&&(null===(e=this._contentWidget)||void 0===e?void 0:e.isColorPickerVisible)||bq.dropDownVisible||(this._hoverActivatedByColorDecoratorClick=!1,this._hoverClicked=!1,null===(t=this._glyphWidget)||void 0===t||t.hide(),null===(i=this._contentWidget)||void 0===i||i.hide())}_getOrCreateContentWidget(){return this._contentWidget||(this._contentWidget=this._instantiationService.createInstance(wK,this._editor)),this._contentWidget}showContentHover(e,t,i,n,s=!1){this._hoverActivatedByColorDecoratorClick=s,this._getOrCreateContentWidget().startShowingAtRange(e,t,i,n)}focus(){var e;null===(e=this._contentWidget)||void 0===e||e.focus()}scrollUp(){var e;null===(e=this._contentWidget)||void 0===e||e.scrollUp()}scrollDown(){var e;null===(e=this._contentWidget)||void 0===e||e.scrollDown()}scrollLeft(){var e;null===(e=this._contentWidget)||void 0===e||e.scrollLeft()}scrollRight(){var e;null===(e=this._contentWidget)||void 0===e||e.scrollRight()}pageUp(){var e;null===(e=this._contentWidget)||void 0===e||e.pageUp()}pageDown(){var e;null===(e=this._contentWidget)||void 0===e||e.pageDown()}goToTop(){var e;null===(e=this._contentWidget)||void 0===e||e.goToTop()}goToBottom(){var e;null===(e=this._contentWidget)||void 0===e||e.goToBottom()}get isColorPickerVisible(){var e;return null===(e=this._contentWidget)||void 0===e?void 0:e.isColorPickerVisible}get isHoverVisible(){var e;return null===(e=this._contentWidget)||void 0===e?void 0:e.isVisible}dispose(){var e,t;super.dispose(),this._unhookEvents(),this._toUnhook.dispose(),null===(e=this._glyphWidget)||void 0===e||e.dispose(),null===(t=this._contentWidget)||void 0===t||t.dispose()}};xq.ID="editor.contrib.hover",xq=Sq=Lq([kq(1,Fa),kq(2,qk),kq(3,Lc),kq(4,WL)],xq);Dh(xq.ID,xq,2),Lh(class extends bh{constructor(){super({id:"editor.action.showHover",label:ue(0,"Show or Focus Hover"),description:{description:"Show or Focus Hover",args:[{name:"args",schema:{type:"object",properties:{focus:{description:"Controls if when triggered with the keyboard, the hover should take focus immediately.",type:"boolean",default:!1}}}}]},alias:"Show or Focus Hover",precondition:void 0,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2087),weight:100}})}run(e,t,i){if(!t.hasModel())return;const n=xq.get(t);if(!n)return;const s=t.getPosition(),o=new Rh(s.lineNumber,s.column,s.lineNumber,s.column),r=2===t.getOption(2)||!!(null==i?void 0:i.focus);n.isHoverVisible?n.focus():n.showContentHover(o,1,1,r)}}),Lh(class extends bh{constructor(){super({id:"editor.action.showDefinitionPreviewHover",label:ue(0,"Show Definition Preview Hover"),alias:"Show Definition Preview Hover",precondition:void 0})}run(e,t){const i=xq.get(t);if(!i)return;const n=t.getPosition();if(!n)return;const s=new Rh(n.lineNumber,n.column,n.lineNumber,n.column),o=nK.get(t);if(!o)return;o.startFindDefinitionFromCursor(n).then((()=>{i.showContentHover(s,1,1,!0)}))}}),Lh(class extends bh{constructor(){super({id:"editor.action.scrollUpHover",label:ue(0,"Scroll Up Hover"),alias:"Scroll Up Hover",precondition:Oh.hoverFocused,kbOpts:{kbExpr:Oh.hoverFocused,primary:16,weight:100}})}run(e,t){const i=xq.get(t);i&&i.scrollUp()}}),Lh(class extends bh{constructor(){super({id:"editor.action.scrollDownHover",label:ue(0,"Scroll Down Hover"),alias:"Scroll Down Hover",precondition:Oh.hoverFocused,kbOpts:{kbExpr:Oh.hoverFocused,primary:18,weight:100}})}run(e,t){const i=xq.get(t);i&&i.scrollDown()}}),Lh(class extends bh{constructor(){super({id:"editor.action.scrollLeftHover",label:ue(0,"Scroll Left Hover"),alias:"Scroll Left Hover",precondition:Oh.hoverFocused,kbOpts:{kbExpr:Oh.hoverFocused,primary:15,weight:100}})}run(e,t){const i=xq.get(t);i&&i.scrollLeft()}}),Lh(class extends bh{constructor(){super({id:"editor.action.scrollRightHover",label:ue(0,"Scroll Right Hover"),alias:"Scroll Right Hover",precondition:Oh.hoverFocused,kbOpts:{kbExpr:Oh.hoverFocused,primary:17,weight:100}})}run(e,t){const i=xq.get(t);i&&i.scrollRight()}}),Lh(class extends bh{constructor(){super({id:"editor.action.pageUpHover",label:ue(0,"Page Up Hover"),alias:"Page Up Hover",precondition:Oh.hoverFocused,kbOpts:{kbExpr:Oh.hoverFocused,primary:11,secondary:[528],weight:100}})}run(e,t){const i=xq.get(t);i&&i.pageUp()}}),Lh(class extends bh{constructor(){super({id:"editor.action.pageDownHover",label:ue(0,"Page Down Hover"),alias:"Page Down Hover",precondition:Oh.hoverFocused,kbOpts:{kbExpr:Oh.hoverFocused,primary:12,secondary:[530],weight:100}})}run(e,t){const i=xq.get(t);i&&i.pageDown()}}),Lh(class extends bh{constructor(){super({id:"editor.action.goToTopHover",label:ue(0,"Go To Top Hover"),alias:"Go To Bottom Hover",precondition:Oh.hoverFocused,kbOpts:{kbExpr:Oh.hoverFocused,primary:14,secondary:[2064],weight:100}})}run(e,t){const i=xq.get(t);i&&i.goToTop()}}),Lh(class extends bh{constructor(){super({id:"editor.action.goToBottomHover",label:ue(0,"Go To Bottom Hover"),alias:"Go To Bottom Hover",precondition:Oh.hoverFocused,kbOpts:{kbExpr:Oh.hoverFocused,primary:13,secondary:[2066],weight:100}})}run(e,t){const i=xq.get(t);i&&i.goToBottom()}}),gK.register(WK),gK.register(kj),H_(((e,t)=>{const i=e.getColor(Zm);i&&(t.addRule(`.monaco-editor .monaco-hover .hover-row:not(:first-child):not(:empty) { border-top: 1px solid ${i.transparent(.5)}; }`),t.addRule(`.monaco-editor .monaco-hover hr { border-top: 1px solid ${i.transparent(.5)}; }`),t.addRule(`.monaco-editor .monaco-hover hr { border-bottom: 0px solid ${i.transparent(.5)}; }`))}));class Nq extends E{constructor(e){super(),this._editor=e,this._register(e.onMouseDown((e=>this.onMouseDown(e))))}dispose(){super.dispose()}onMouseDown(e){const t=this._editor.getOption(146);if("click"!==t&&"clickAndHover"!==t)return;const i=e.target;if(6!==i.type)return;if(!i.detail.injectedText)return;if(i.detail.injectedText.options.attachedData!==GT)return;if(!i.range)return;const n=this._editor.getContribution(xq.ID);if(n&&!n.isColorPickerVisible){const e=new Rh(i.range.startLineNumber,i.range.startColumn+1,i.range.endLineNumber,i.range.endColumn+1);n.showContentHover(e,1,0,!1,!0)}}}Nq.ID="editor.contrib.colorContribution",Dh(Nq.ID,Nq,2),gK.register(wR);var Eq,Iq,Mq=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Tq=function(e,t){return function(i,n){t(i,n,e)}},Rq=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let Aq=Eq=class extends E{constructor(e,t,i,n,s,o,r){super(),this._editor=e,this._modelService=i,this._keybindingService=n,this._instantiationService=s,this._languageFeatureService=o,this._languageConfigurationService=r,this._standaloneColorPickerWidget=null,this._standaloneColorPickerVisible=Oh.standaloneColorPickerVisible.bindTo(t),this._standaloneColorPickerFocused=Oh.standaloneColorPickerFocused.bindTo(t)}showOrFocus(){var e;this._editor.hasModel()&&(this._standaloneColorPickerVisible.get()?this._standaloneColorPickerFocused.get()||null===(e=this._standaloneColorPickerWidget)||void 0===e||e.focus():this._standaloneColorPickerWidget=new Oq(this._editor,this._standaloneColorPickerVisible,this._standaloneColorPickerFocused,this._instantiationService,this._modelService,this._keybindingService,this._languageFeatureService,this._languageConfigurationService))}hide(){var e;this._standaloneColorPickerFocused.set(!1),this._standaloneColorPickerVisible.set(!1),null===(e=this._standaloneColorPickerWidget)||void 0===e||e.hide(),this._editor.focus()}insertColor(){var e;null===(e=this._standaloneColorPickerWidget)||void 0===e||e.updateEditor(),this.hide()}static get(e){return e.getContribution(Eq.ID)}};Aq.ID="editor.contrib.standaloneColorPickerController",Aq=Eq=Mq([Tq(1,Ol),Tq(2,Ha),Tq(3,WL),Tq(4,Fa),Tq(5,oL),Tq(6,Ju)],Aq),Dh(Aq.ID,Aq,1);let Oq=Iq=class extends E{constructor(e,t,i,n,s,o,r,a){var l;super(),this._editor=e,this._standaloneColorPickerVisible=t,this._standaloneColorPickerFocused=i,this._modelService=s,this._keybindingService=o,this._languageFeaturesService=r,this._languageConfigurationService=a,this.allowEditorOverflow=!0,this._position=void 0,this._body=document.createElement("div"),this._colorHover=null,this._selectionSetInEditor=!1,this._onResult=this._register(new U),this.onResult=this._onResult.event,this._standaloneColorPickerVisible.set(!0),this._standaloneColorPickerParticipant=n.createInstance(SR,this._editor),this._position=null===(l=this._editor._getViewModel())||void 0===l?void 0:l.getPrimaryCursorState().modelState.position;const h=this._editor.getSelection(),d=h?{startLineNumber:h.startLineNumber,startColumn:h.startColumn,endLineNumber:h.endLineNumber,endColumn:h.endColumn}:{startLineNumber:0,endLineNumber:0,endColumn:0,startColumn:0},c=this._register(hs(this._body));this._register(c.onDidBlur((e=>{this.hide()}))),this._register(c.onDidFocus((e=>{this.focus()}))),this._register(this._editor.onDidChangeCursorPosition((()=>{this._selectionSetInEditor?this._selectionSetInEditor=!1:this.hide()}))),this._register(this._editor.onMouseMove((e=>{var t;const i=null===(t=e.target.element)||void 0===t?void 0:t.classList;i&&i.contains("colorpicker-color-decoration")&&this.hide()}))),this._register(this.onResult((e=>{this._render(e.value,e.foundInEditor)}))),this._start(d),this._body.style.zIndex="50",this._editor.addContentWidget(this)}updateEditor(){this._colorHover&&this._standaloneColorPickerParticipant.updateEditorModel(this._colorHover)}getId(){return Iq.ID}getDomNode(){return this._body}getPosition(){if(!this._position)return null;const e=this._editor.getOption(60).above;return{position:this._position,secondaryPosition:this._position,preference:e?[1,2]:[2,1],positionAffinity:2}}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()}_start(e){return Rq(this,void 0,void 0,(function*(){const t=yield this._computeAsync(e);t&&this._onResult.fire(new Pq(t.result,t.foundInEditor))}))}_computeAsync(e){return Rq(this,void 0,void 0,(function*(){if(!this._editor.hasModel())return null;const t={range:e,color:{red:0,green:0,blue:0,alpha:1}},i=yield this._standaloneColorPickerParticipant.createColorHover(t,new AT(this._modelService,this._languageConfigurationService),this._languageFeaturesService.colorProvider);return i?{result:i.colorHover,foundInEditor:i.foundInEditor}:null}))}_render(e,t){const i=document.createDocumentFragment();let n;const s={fragment:i,statusBar:this._register(new DK(this._keybindingService)),setColorPicker:e=>n=e,onContentsChanged:()=>{},hide:()=>this.hide()};if(this._colorHover=e,this._register(this._standaloneColorPickerParticipant.renderHoverParts(s,[e])),void 0===n)return;this._body.classList.add("standalone-colorpicker-body"),this._body.style.maxHeight=Math.max(this._editor.getLayoutInfo().height/4,250)+"px",this._body.style.maxWidth=Math.max(.66*this._editor.getLayoutInfo().width,500)+"px",this._body.tabIndex=0,this._body.appendChild(i),n.layout();const o=n.body,r=o.saturationBox.domNode.clientWidth,a=o.domNode.clientWidth-r-22-8,l=n.body.enterButton;null==l||l.onClicked((()=>{this.updateEditor(),this.hide()}));const h=n.header;h.pickedColorNode.style.width=r+8+"px";h.originalColorNode.style.width=a+"px";const d=n.header.closeButton;null==d||d.onClicked((()=>{this.hide()})),t&&(l&&(l.button.textContent="Replace"),this._selectionSetInEditor=!0,this._editor.setSelection(e.range)),this._editor.layoutContentWidget(this)}};Oq.ID="editor.contrib.standaloneColorPickerWidget",Oq=Iq=Mq([Tq(3,Fa),Tq(4,Ha),Tq(5,WL),Tq(6,oL),Tq(7,Ju)],Oq);class Pq{constructor(e,t){this.value=e,this.foundInEditor=t}}Lh(class extends bh{constructor(){super({id:"editor.action.hideColorPicker",label:ue(0,"Hide the Color Picker"),alias:"Hide the Color Picker",precondition:Oh.standaloneColorPickerVisible.isEqualTo(!0),kbOpts:{primary:9,weight:100}})}run(e,t){var i;null===(i=Aq.get(t))||void 0===i||i.hide()}}),Lh(class extends bh{constructor(){super({id:"editor.action.insertColorWithStandaloneColorPicker",label:ue(0,"Insert Color with Standalone Color Picker"),alias:"Insert Color with Standalone Color Picker",precondition:Oh.standaloneColorPickerFocused.isEqualTo(!0),kbOpts:{primary:3,weight:100}})}run(e,t){var i;null===(i=Aq.get(t))||void 0===i||i.insertColor()}}),ah(class extends wh{constructor(){super({id:"editor.action.showOrFocusStandaloneColorPicker",title:{value:ue(0,"Show or Focus Standalone Color Picker"),mnemonicTitle:ue(0,"&&Show or Focus Standalone Color Picker"),original:"Show or Focus Standalone Color Picker"},precondition:void 0,menu:[{id:eh.CommandPalette}]})}runEditorCommand(e,t){var i;null===(i=Aq.get(t))||void 0===i||i.showOrFocus()}});class Fq{static insert(e,t){return{range:new Rh(e.lineNumber,e.column,e.lineNumber,e.column),text:t,forceMoveMarkers:!0}}static delete(e){return{range:e,text:null}}static replace(e,t){return{range:e,text:t}}static replaceMove(e,t){return{range:e,text:t,forceMoveMarkers:!0}}}class Bq{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;if(i+n>e.length)return!1;for(let s=0;s=65&&n<=90&&n+32===o||o>=65&&o<=90&&o+32===n))return!1}return!0}_createOperationsForBlockComment(e,t,i,n,s,o){const r=e.startLineNumber,a=e.startColumn,l=e.endLineNumber,h=e.endColumn,d=s.getLineContent(r),c=s.getLineContent(l);let u,g=d.lastIndexOf(t,a-1+t.length),p=c.indexOf(i,h-1-i.length);if(-1!==g&&-1!==p)if(r===l){d.substring(g+t.length,p).indexOf(i)>=0&&(g=-1,p=-1)}else{const e=d.substring(g+t.length),n=c.substring(0,p);(e.indexOf(i)>=0||n.indexOf(i)>=0)&&(g=-1,p=-1)}-1!==g&&-1!==p?(n&&g+t.length0&&32===c.charCodeAt(p-1)&&(i=" "+i,p-=1),u=Bq._createRemoveBlockCommentOperations(new Rh(r,g+t.length+1,l,p+1),t,i)):(u=Bq._createAddBlockCommentOperations(e,t,i,this._insertSpace),this._usedEndToken=1===u.length?i:null);for(const m of u)o.addTrackedEditOperation(m.range,m.text)}static _createRemoveBlockCommentOperations(e,t,i){const n=[];return Rh.isEmpty(e)?n.push(Fq.delete(new Rh(e.startLineNumber,e.startColumn-t.length,e.endLineNumber,e.endColumn+i.length))):(n.push(Fq.delete(new Rh(e.startLineNumber,e.startColumn-t.length,e.startLineNumber,e.startColumn))),n.push(Fq.delete(new Rh(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn+i.length)))),n}static _createAddBlockCommentOperations(e,t,i,n){const s=[];return Rh.isEmpty(e)?s.push(Fq.replace(new Rh(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn),t+" "+i)):(s.push(Fq.insert(new Va(e.startLineNumber,e.startColumn),t+(n?" ":""))),s.push(Fq.insert(new Va(e.endLineNumber,e.endColumn),(n?" ":"")+i))),s}getEditOperations(e,t){const i=this._selection.startLineNumber,n=this._selection.startColumn;e.tokenization.tokenizeIfCheap(i);const s=e.getLanguageIdAtPosition(i,n),o=this.languageConfigurationService.getLanguageConfiguration(s).comments;o&&o.blockCommentStartToken&&o.blockCommentEndToken&&this._createOperationsForBlockComment(this._selection,o.blockCommentStartToken,o.blockCommentEndToken,this._insertSpace,e,t)}computeCursorState(e,t){const i=t.getInverseEditOperations();if(2===i.length){const e=i[0],t=i[1];return new Ah(e.range.endLineNumber,e.range.endColumn,t.range.startLineNumber,t.range.startColumn)}{const e=i[0].range,t=this._usedEndToken?-this._usedEndToken.length-1:0;return new Ah(e.endLineNumber,e.endColumn+t,e.endLineNumber,e.endColumn+t)}}}class Wq{constructor(e,t,i,n,s,o,r){this.languageConfigurationService=e,this._selection=t,this._tabSize=i,this._type=n,this._insertSpace=s,this._selectionId=null,this._deltaColumn=0,this._moveEndPositionDown=!1,this._ignoreEmptyLines=o,this._ignoreFirstLine=r||!1}static _gatherPreflightCommentStrings(e,t,i,n){e.tokenization.tokenizeIfCheap(t);const s=e.getLanguageIdAtPosition(t,1),o=n.getLanguageConfiguration(s).comments,r=o?o.lineCommentToken:null;if(!r)return null;const a=[];for(let l=0,h=i-t+1;lr?s-1:s}}}class Vq extends bh{constructor(e,t){super(t),this._type=e}run(e,t){const i=e.get(Ju);if(!t.hasModel())return;const n=[],s=t.getModel().getOptions(),o=t.getOption(23),r=t.getSelections().map(((e,t)=>({selection:e,index:t,ignoreFirstLine:!1})));r.sort(((e,t)=>Rh.compareRangesUsingStarts(e.selection,t.selection)));let a=r[0];for(let l=1;l=0;t--,this._valueLen--){const e=this._value.charCodeAt(t);if(!(47===e||this._splitOnBackslash&&92===e))break}return this.next()}hasNext(){return this._to!1,t=()=>!1){return new qq(new Kq(e,t))}static forStrings(){return new qq(new Hq)}static forConfigKeys(){return new qq(new zq)}constructor(e){this._iter=e}clear(){this._root=void 0}set(e,t){const i=this._iter.reset(e);let n;this._root||(this._root=new jq,this._root.segment=i.value());const s=[];for(n=this._root;;){const e=i.cmp(n.segment);if(e>0)n.left||(n.left=new jq,n.left.segment=i.value()),s.push([-1,n]),n=n.left;else if(e<0)n.right||(n.right=new jq,n.right.segment=i.value()),s.push([1,n]),n=n.right;else{if(!i.hasNext())break;i.next(),n.mid||(n.mid=new jq,n.mid.segment=i.value()),s.push([0,n]),n=n.mid}}const o=n.value;n.value=t,n.key=e;for(let r=s.length-1;r>=0;r--){const e=s[r][1];e.updateHeight();const t=e.balanceFactor();if(t<-1||t>1){const t=s[r][0],i=s[r+1][0];if(1===t&&1===i)s[r][1]=e.rotateLeft();else if(-1===t&&-1===i)s[r][1]=e.rotateRight();else if(1===t&&-1===i)e.right=s[r+1][1]=s[r+1][1].rotateRight(),s[r][1]=e.rotateLeft();else{if(-1!==t||1!==i)throw new Error;e.left=s[r+1][1]=s[r+1][1].rotateLeft(),s[r][1]=e.rotateRight()}if(r>0)switch(s[r-1][0]){case-1:s[r-1][1].left=s[r][1];break;case 1:s[r-1][1].right=s[r][1];break;case 0:s[r-1][1].mid=s[r][1]}else this._root=s[0][1]}}return o}get(e){var t;return null===(t=this._getNode(e))||void 0===t?void 0:t.value}_getNode(e){const t=this._iter.reset(e);let i=this._root;for(;i;){const e=t.cmp(i.segment);if(e>0)i=i.left;else if(e<0)i=i.right;else{if(!t.hasNext())break;t.next(),i=i.mid}}return i}has(e){const t=this._getNode(e);return!(void 0===(null==t?void 0:t.value)&&void 0===(null==t?void 0:t.mid))}delete(e){return this._delete(e,!1)}deleteSuperstr(e){return this._delete(e,!0)}_delete(e,t){var i;const n=this._iter.reset(e),s=[];let o=this._root;for(;o;){const e=n.cmp(o.segment);if(e>0)s.push([-1,o]),o=o.left;else if(e<0)s.push([1,o]),o=o.right;else{if(!n.hasNext())break;n.next(),s.push([0,o]),o=o.mid}}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 e=this._min(o.right);if(e.key){const{key:t,value:i,segment:n}=e;this._delete(e.key,!1),o.key=t,o.value=i,o.segment=n}}else{const e=null!==(i=o.left)&&void 0!==i?i:o.right;if(s.length>0){const[t,i]=s[s.length-1];switch(t){case-1:i.left=e;break;case 0:i.mid=e;break;case 1:i.right=e}}else this._root=e}for(let e=s.length-1;e>=0;e--){const t=s[e][1];t.updateHeight();const i=t.balanceFactor();if(i>1?(t.right.balanceFactor()>=0||(t.right=t.right.rotateRight()),s[e][1]=t.rotateLeft()):i<-1&&(t.left.balanceFactor()<=0||(t.left=t.left.rotateLeft()),s[e][1]=t.rotateRight()),e>0)switch(s[e-1][0]){case-1:s[e-1][1].left=s[e][1];break;case 1:s[e-1][1].right=s[e][1];break;case 0:s[e-1][1].mid=s[e][1]}else this._root=s[0][1]}}}_min(e){for(;e.left;)e=e.left;return e}findSubstr(e){const t=this._iter.reset(e);let i,n=this._root;for(;n;){const e=t.cmp(n.segment);if(e>0)n=n.left;else if(e<0)n=n.right;else{if(!t.hasNext())break;t.next(),i=n.value||i,n=n.mid}}return n&&n.value||i}findSuperstr(e){return this._findSuperstrOrElement(e,!1)}_findSuperstrOrElement(e,t){const i=this._iter.reset(e);let n=this._root;for(;n;){const e=i.cmp(n.segment);if(e>0)n=n.left;else if(e<0)n=n.right;else{if(!i.hasNext())return n.mid?this._entries(n.mid):t?n.value:void 0;i.next(),n=n.mid}}}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))}}const $q=Ba("contextService");function Gq(e){const t=e;return"string"==typeof(null==t?void 0:t.id)&&an.isUri(t.uri)}function Zq(e){const t=e;return"string"==typeof(null==t?void 0:t.id)&&!Gq(e)&&!function(e){const t=e;return"string"==typeof(null==t?void 0:t.id)&&an.isUri(t.configPath)}(e)}const Yq={id:"ext-dev"},Xq={id:"empty-window"};class Qq{constructor(e,t){this.raw=t,this.uri=e.uri,this.index=e.index,this.name=e.name}toJSON(){return{uri:this.uri,name:this.name,index:this.index}}}const Jq="code-workspace",e$=(ue(0,"Code Workspace"),"4064f6ec-cb38-4ad0-af64-ee6467e63c82");var t$,i$=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},n$=function(e,t){return function(i,n){t(i,n,e)}};let s$,o$=t$=class{static get(e){return e.getContribution(t$.ID)}constructor(e,t,i,n,s,o,r,a){this._contextMenuService=t,this._contextViewService=i,this._contextKeyService=n,this._keybindingService=s,this._menuService=o,this._configurationService=r,this._workspaceContextService=a,this._toDispose=new N,this._contextMenuIsBeingShownCount=0,this._editor=e,this._toDispose.add(this._editor.onContextMenu((e=>this._onContextMenu(e)))),this._toDispose.add(this._editor.onMouseWheel((e=>{if(this._contextMenuIsBeingShownCount>0){const t=this._contextViewService.getContextViewElement(),i=e.srcElement;i.shadowRoot&&Yn(t)===i.shadowRoot||this._contextViewService.hideContextView()}}))),this._toDispose.add(this._editor.onKeyDown((e=>{this._editor.getOption(24)&&58===e.keyCode&&(e.preventDefault(),e.stopPropagation(),this.showContextMenu())})))}_onContextMenu(e){if(!this._editor.hasModel())return;if(!this._editor.getOption(24))return this._editor.focus(),void(e.target.position&&!this._editor.getSelection().containsPosition(e.target.position)&&this._editor.setPosition(e.target.position));if(12===e.target.type)return;if(6===e.target.type&&e.target.detail.injectedText)return;if(e.event.preventDefault(),e.event.stopPropagation(),11===e.target.type)return this._showScrollbarContextMenu(e.event);if(6!==e.target.type&&7!==e.target.type&&1!==e.target.type)return;if(this._editor.focus(),e.target.position){let t=!1;for(const i of this._editor.getSelections())if(i.containsPosition(e.target.position)){t=!0;break}t||this._editor.setPosition(e.target.position)}let t=null;1!==e.target.type&&(t=e.event),this.showContextMenu(t)}showContextMenu(e){if(!this._editor.getOption(24))return;if(!this._editor.hasModel())return;const t=this._getMenuActions(this._editor.getModel(),this._editor.isSimpleWidget?eh.SimpleEditorContext:eh.EditorContext);t.length>0&&this._doShowContextMenu(t,e)}_getMenuActions(e,t){const i=[],n=this._menuService.createMenu(t,this._contextKeyService),s=n.getActions({arg:e.uri});n.dispose();for(const o of s){const[,t]=o;let n=0;for(const s of t)if(s instanceof sh){const t=this._getMenuActions(e,s.item.submenu);t.length>0&&(i.push(new $a(s.id,s.label,t)),n++)}else i.push(s),n++;n&&i.push(new qa)}return i.length&&i.pop(),i}_doShowContextMenu(e,t=null){if(!this._editor.hasModel())return;const i=this._editor.getOption(60);this._editor.updateOptions({hover:{enabled:!1}});let n=t;if(!n){this._editor.revealPosition(this._editor.getPosition(),1),this._editor.render();const e=this._editor.getScrolledVisiblePosition(this._editor.getPosition()),t=Hn(this._editor.getDomNode()),i=t.left+e.left,s=t.top+e.top+e.height;n={x:i,y:s}}const s=this._editor.getOption(126)&&!He;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:s?this._editor.getDomNode():void 0,getAnchor:()=>n,getActions:()=>e,getActionViewItem:e=>{const t=this._keybindingFor(e);if(t)return new Ix(e,e,{label:!0,keybinding:t.getLabel(),isMenu:!0});const i=e;return"function"==typeof i.getActionViewItem?i.getActionViewItem():new Ix(e,e,{icon:!0,label:!0,isMenu:!0})},getKeyBinding:e=>this._keybindingFor(e),onHide:e=>{this._contextMenuIsBeingShownCount--,this._editor.updateOptions({hover:i})}})}_showScrollbarContextMenu(e){if(!this._editor.hasModel())return;if(this._workspaceContextService.getWorkspace().id===e$)return;const t=this._editor.getOption(72);let i=0;const n=e=>({id:"menu-action-"+ ++i,label:e.label,tooltip:"",class:void 0,enabled:void 0===e.enabled||e.enabled,checked:e.checked,run:e.run}),s=(e,t,s,o,r)=>{if(!t)return n({label:e,enabled:t,run:()=>{}});const a=e=>()=>{this._configurationService.updateValue(s,e)},l=[];for(const i of r)l.push(n({label:i.label,checked:o===i.value,run:a(i.value)}));return((e,t)=>new $a("menu-action-"+ ++i,e,t,void 0))(e,l)},o=[];o.push(n({label:ue(0,"Minimap"),checked:t.enabled,run:()=>{this._configurationService.updateValue("editor.minimap.enabled",!t.enabled)}})),o.push(new qa),o.push(n({label:ue(0,"Render Characters"),enabled:t.enabled,checked:t.renderCharacters,run:()=>{this._configurationService.updateValue("editor.minimap.renderCharacters",!t.renderCharacters)}})),o.push(s(ue(0,"Vertical size"),t.enabled,"editor.minimap.size",t.size,[{label:ue(0,"Proportional"),value:"proportional"},{label:ue(0,"Fill"),value:"fill"},{label:ue(0,"Fit"),value:"fit"}])),o.push(s(ue(0,"Slider"),t.enabled,"editor.minimap.showSlider",t.showSlider,[{label:ue(0,"Mouse Over"),value:"mouseover"},{label:ue(0,"Always"),value:"always"}]));const r=this._editor.getOption(126)&&!He;this._contextMenuIsBeingShownCount++,this._contextMenuService.showContextMenu({domForShadowRoot:r?this._editor.getDomNode():void 0,getAnchor:()=>e,getActions:()=>o,onHide:e=>{this._contextMenuIsBeingShownCount--,this._editor.focus()}})}_keybindingFor(e){return this._keybindingService.lookupKeybinding(e.id)}dispose(){this._contextMenuIsBeingShownCount>0&&this._contextViewService.hideContextView(),this._toDispose.dispose()}};o$.ID="editor.contrib.contextmenu",o$=t$=i$([n$(1,Kx),n$(2,Ux),n$(3,Ol),n$(4,WL),n$(5,th),n$(6,pu),n$(7,$q)],o$);Dh(o$.ID,o$,2),Lh(class extends bh{constructor(){super({id:"editor.action.showContextMenu",label:ue(0,"Show Editor Context Menu"),alias:"Show Editor Context Menu",precondition:void 0,kbOpts:{kbExpr:Oh.textInputFocus,primary:1092,weight:100}})}run(e,t){var i;null===(i=o$.get(t))||void 0===i||i.showContextMenu()}});class r${constructor(e){this.selections=e}equals(e){const t=this.selections.length;if(t!==e.selections.length)return!1;for(let i=0;i{this._undoStack=[],this._redoStack=[]}))),this._register(e.onDidChangeModelContent((e=>{this._undoStack=[],this._redoStack=[]}))),this._register(e.onDidChangeCursorSelection((t=>{if(this._isCursorUndoRedo)return;if(!t.oldSelections)return;if(t.oldModelVersionId!==t.modelVersionId)return;const i=new r$(t.oldSelections);this._undoStack.length>0&&this._undoStack[this._undoStack.length-1].cursorState.equals(i)||(this._undoStack.push(new a$(i,e.getScrollTop(),e.getScrollLeft())),this._redoStack=[],this._undoStack.length>50&&this._undoStack.shift())})))}cursorUndo(){this._editor.hasModel()&&0!==this._undoStack.length&&(this._redoStack.push(new a$(new r$(this._editor.getSelections()),this._editor.getScrollTop(),this._editor.getScrollLeft())),this._applyState(this._undoStack.pop()))}cursorRedo(){this._editor.hasModel()&&0!==this._redoStack.length&&(this._undoStack.push(new a$(new r$(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}}l$.ID="editor.contrib.cursorUndoRedoController";function h$(){return!!Ii.VSCODE_DEV}function d$(e){if(h$()){const t=function(){s$||(s$=new Set);const e=globalThis;e.$hotReload_applyNewExports||(e.$hotReload_applyNewExports=e=>{for(const t of s$){const i=t(e);if(i)return i}});return s$}();return t.add(e),{dispose(){t.delete(e)}}}return{dispose(){}}}function c$(e,t){const i=new N,n=e.createDecorationsCollection();return i.add(Uj({debugName:()=>`Apply decorations from ${t.debugName}`},(e=>{const i=t.read(e);n.set(i)}))),i.add({dispose:()=>{n.clear()}}),i}function u$(e,t){return e.appendChild(t),x((()=>{e.removeChild(t)}))}Dh(l$.ID,l$,0),Lh(class extends bh{constructor(){super({id:"cursorUndo",label:ue(0,"Cursor Undo"),alias:"Cursor Undo",precondition:void 0,kbOpts:{kbExpr:Oh.textInputFocus,primary:2099,weight:100}})}run(e,t,i){var n;null===(n=l$.get(t))||void 0===n||n.cursorUndo()}}),Lh(class extends bh{constructor(){super({id:"cursorRedo",label:ue(0,"Cursor Redo"),alias:"Cursor Redo",precondition:void 0})}run(e,t,i){var n;null===(n=l$.get(t))||void 0===n||n.cursorRedo()}});class g$ extends E{get width(){return this._width}get height(){return this._height}constructor(e,t){super(),this.elementSizeObserver=this._register(new BR(e,t)),this._width=Aj(this,this.elementSizeObserver.getWidth()),this._height=Aj(this,this.elementSizeObserver.getHeight()),this._register(this.elementSizeObserver.onDidChange((e=>Ej((e=>{this._width.set(this.elementSizeObserver.getWidth(),e),this._height.set(this.elementSizeObserver.getHeight(),e)})))))}observe(e){this.elementSizeObserver.observe(e)}setAutomaticLayout(e){e?this.elementSizeObserver.startObserving():this.elementSizeObserver.stopObserving()}}function p$(e,t){let i=e.get(),n=i,s=i;const o=Aj("animatedValue",i);let r=-1;let a;function l(){const e=Date.now()-r;var t,h,d,c;s=Math.floor((h=n,d=i-n,(t=e)===(c=300)?h+d:d*(1-Math.pow(2,-10*t/c))+h)),e<300?a=requestAnimationFrame(l):s=i,o.set(s,void 0)}return t.add(jj({createEmptyChangeSummary:()=>({animate:!1}),handleChange:(t,i)=>(t.didChange(e)&&(i.animate=i.animate||t.change),!0)},((t,o)=>{void 0!==a&&(cancelAnimationFrame(a),a=void 0),n=s,i=e.read(t),r=Date.now()-(o.animate?0:300),l()}))),o}class m$ extends E{constructor(e,t,i){super(),this._register(new _$(e,i)),this._register(v$(i,{height:t.actualHeight,top:t.actualTop}))}}class f${get afterLineNumber(){return this._afterLineNumber.get()}constructor(e,t){this._afterLineNumber=e,this.heightInPx=t,this.domNode=document.createElement("div"),this._actualTop=Aj(this,void 0),this._actualHeight=Aj(this,void 0),this.actualTop=this._actualTop,this.actualHeight=this._actualHeight,this.showInHiddenAreas=!0,this.onChange=this._afterLineNumber,this.onDomNodeTop=e=>{this._actualTop.set(e,void 0)},this.onComputedHeight=e=>{this._actualHeight.set(e,void 0)}}}class _${constructor(e,t){this._editor=e,this._domElement=t,this._overlayWidgetId="managedOverlayWidget-"+_$._counter++,this._overlayWidget={getId:()=>this._overlayWidgetId,getDomNode:()=>this._domElement,getPosition:()=>null},this._editor.addOverlayWidget(this._overlayWidget)}dispose(){this._editor.removeOverlayWidget(this._overlayWidget)}}function v$(e,t){return Kj((i=>{for(let[n,s]of Object.entries(t))s&&"object"==typeof s&&"read"in s&&(s=s.read(i)),"number"==typeof s&&(s=`${s}px`),n=n.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase())),e.style[n]=s}))}function b$(e,t){return function(e,t){if(h$()){Qj("reload",(t=>d$((i=>{if([...Object.values(i)].some((t=>e.includes(t))))return e=>(t(void 0),!0)})))).read(t)}}([e],t),e}function C$(e,t,i){const n=new N,s=[];return n.add(Kj((o=>{const r=t.read(o),a=new Map,l=new Map;i&&i(!0),e.changeViewZones((e=>{for(const t of s)e.removeZone(t);s.length=0;for(const t of r){const i=e.addZone(t);s.push(i),a.set(t,i)}})),i&&i(!1),n.add(jj({createEmptyChangeSummary:()=>[],handleChange(e,t){const i=l.get(e.changedObservable);return void 0!==i&&t.push(i),!0}},((t,n)=>{for(const e of r)e.onChange&&(l.set(e.onChange,a.get(e)),e.onChange.read(t));i&&i(!0),e.changeViewZones((e=>{for(const t of n)e.layoutZone(t)})),i&&i(!1)})))}))),n.add({dispose(){i&&i(!0),e.changeViewZones((e=>{for(const t of s)e.removeZone(t)})),i&&i(!1)}}),n}_$._counter=0;class w$ extends jh{dispose(){super.dispose(!0)}}const y$=Ba("audioCue");class S${static register(e){return new S$(e.fileName)}constructor(e){this.fileName=e}}S$.error=S$.register({fileName:"error.mp3"}),S$.warning=S$.register({fileName:"warning.mp3"}),S$.foldedArea=S$.register({fileName:"foldedAreas.mp3"}),S$.break=S$.register({fileName:"break.mp3"}),S$.quickFixes=S$.register({fileName:"quickFixes.mp3"}),S$.taskCompleted=S$.register({fileName:"taskCompleted.mp3"}),S$.taskFailed=S$.register({fileName:"taskFailed.mp3"}),S$.terminalBell=S$.register({fileName:"terminalBell.mp3"}),S$.diffLineInserted=S$.register({fileName:"diffLineInserted.mp3"}),S$.diffLineDeleted=S$.register({fileName:"diffLineDeleted.mp3"}),S$.diffLineModified=S$.register({fileName:"diffLineModified.mp3"}),S$.chatRequestSent=S$.register({fileName:"chatRequestSent.mp3"}),S$.chatResponsePending=S$.register({fileName:"chatResponsePending.mp3"}),S$.chatResponseReceived1=S$.register({fileName:"chatResponseReceived1.mp3"}),S$.chatResponseReceived2=S$.register({fileName:"chatResponseReceived2.mp3"}),S$.chatResponseReceived3=S$.register({fileName:"chatResponseReceived3.mp3"}),S$.chatResponseReceived4=S$.register({fileName:"chatResponseReceived4.mp3"});class L${constructor(e){this.randomOneOf=e}}class k${static register(e){const t=new L$("randomOneOf"in e.sound?e.sound.randomOneOf:[e.sound]),i=new k$(t,e.name,e.settingsKey);return k$._audioCues.add(i),i}constructor(e,t,i){this.sound=e,this.name=t,this.settingsKey=i}}k$._audioCues=new Set,k$.error=k$.register({name:ue(0,"Error on Line"),sound:S$.error,settingsKey:"audioCues.lineHasError"}),k$.warning=k$.register({name:ue(0,"Warning on Line"),sound:S$.warning,settingsKey:"audioCues.lineHasWarning"}),k$.foldedArea=k$.register({name:ue(0,"Folded Area on Line"),sound:S$.foldedArea,settingsKey:"audioCues.lineHasFoldedArea"}),k$.break=k$.register({name:ue(0,"Breakpoint on Line"),sound:S$.break,settingsKey:"audioCues.lineHasBreakpoint"}),k$.inlineSuggestion=k$.register({name:ue(0,"Inline Suggestion on Line"),sound:S$.quickFixes,settingsKey:"audioCues.lineHasInlineSuggestion"}),k$.terminalQuickFix=k$.register({name:ue(0,"Terminal Quick Fix"),sound:S$.quickFixes,settingsKey:"audioCues.terminalQuickFix"}),k$.onDebugBreak=k$.register({name:ue(0,"Debugger Stopped on Breakpoint"),sound:S$.break,settingsKey:"audioCues.onDebugBreak"}),k$.noInlayHints=k$.register({name:ue(0,"No Inlay Hints on Line"),sound:S$.error,settingsKey:"audioCues.noInlayHints"}),k$.taskCompleted=k$.register({name:ue(0,"Task Completed"),sound:S$.taskCompleted,settingsKey:"audioCues.taskCompleted"}),k$.taskFailed=k$.register({name:ue(0,"Task Failed"),sound:S$.taskFailed,settingsKey:"audioCues.taskFailed"}),k$.terminalCommandFailed=k$.register({name:ue(0,"Terminal Command Failed"),sound:S$.error,settingsKey:"audioCues.terminalCommandFailed"}),k$.terminalBell=k$.register({name:ue(0,"Terminal Bell"),sound:S$.terminalBell,settingsKey:"audioCues.terminalBell"}),k$.notebookCellCompleted=k$.register({name:ue(0,"Notebook Cell Completed"),sound:S$.taskCompleted,settingsKey:"audioCues.notebookCellCompleted"}),k$.notebookCellFailed=k$.register({name:ue(0,"Notebook Cell Failed"),sound:S$.taskFailed,settingsKey:"audioCues.notebookCellFailed"}),k$.diffLineInserted=k$.register({name:ue(0,"Diff Line Inserted"),sound:S$.diffLineInserted,settingsKey:"audioCues.diffLineInserted"}),k$.diffLineDeleted=k$.register({name:ue(0,"Diff Line Deleted"),sound:S$.diffLineDeleted,settingsKey:"audioCues.diffLineDeleted"}),k$.diffLineModified=k$.register({name:ue(0,"Diff Line Modified"),sound:S$.diffLineModified,settingsKey:"audioCues.diffLineModified"}),k$.chatRequestSent=k$.register({name:ue(0,"Chat Request Sent"),sound:S$.chatRequestSent,settingsKey:"audioCues.chatRequestSent"}),k$.chatResponseReceived=k$.register({name:ue(0,"Chat Response Received"),settingsKey:"audioCues.chatResponseReceived",sound:{randomOneOf:[S$.chatResponseReceived1,S$.chatResponseReceived2,S$.chatResponseReceived3,S$.chatResponseReceived4]}}),k$.chatResponsePending=k$.register({name:ue(0,"Chat Response Pending"),sound:S$.chatResponsePending,settingsKey:"audioCues.chatResponsePending"});var D$=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},x$=function(e,t){return function(i,n){t(i,n,e)}},N$=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const E$=tR("diff-review-insert",Jr.add,ue(0,"Icon for 'Insert' in accessible diff viewer.")),I$=tR("diff-review-remove",Jr.remove,ue(0,"Icon for 'Remove' in accessible diff viewer.")),M$=tR("diff-review-close",Jr.close,ue(0,"Icon for 'Close' in accessible diff viewer."));let T$=class extends E{constructor(e,t,i,n,s,o,r,a,l){super(),this._parentNode=e,this._visible=t,this._setVisible=i,this._canClose=n,this._width=s,this._height=o,this._diffs=r,this._editors=a,this._instantiationService=l,this.model=Hj(this,((e,t)=>{const i=this._visible.read(e);if(this._parentNode.style.visibility=i?"visible":"hidden",!i)return null;const n=t.add(this._instantiationService.createInstance(R$,this._diffs,this._editors,this._setVisible,this._canClose));return{model:n,view:t.add(this._instantiationService.createInstance(H$,this._parentNode,n,this._width,this._height,this._editors))}})),this._register(iq(this.model))}next(){Ej((e=>{const t=this._visible.get();this._setVisible(!0,e),t&&this.model.get().model.nextGroup(e)}))}prev(){Ej((e=>{this._setVisible(!0,e),this.model.get().model.previousGroup(e)}))}close(){Ej((e=>{this._setVisible(!1,e)}))}};T$._ttPolicy=Fk("diffReview",{createHTML:e=>e}),T$=D$([x$(8,Fa)],T$);let R$=class extends E{constructor(e,t,i,n,s){super(),this._diffs=e,this._editors=t,this._setVisible=i,this.canClose=n,this._audioCueService=s,this._groups=Aj(this,[]),this._currentGroupIdx=Aj(this,0),this._currentElementIdx=Aj(this,0),this.groups=this._groups,this.currentGroup=this._currentGroupIdx.map(((e,t)=>this._groups.read(t)[e])),this.currentGroupIndex=this._currentGroupIdx,this.currentElement=this._currentElementIdx.map(((e,t)=>{var i;return null===(i=this.currentGroup.read(t))||void 0===i?void 0:i.lines[e]})),this._register(Kj((e=>{const t=this._diffs.read(e);if(!t)return void this._groups.set([],void 0);const i=function(e,t,i){const n=[];for(const s of Pd(e,((e,t)=>t.modified.startLineNumber-e.modified.endLineNumberExclusive<2*A$))){const e=[];e.push(new F$);const o=new wc(Math.max(1,s[0].original.startLineNumber-A$),Math.min(s[s.length-1].original.endLineNumberExclusive+A$,t+1)),r=new wc(Math.max(1,s[0].modified.startLineNumber-A$),Math.min(s[s.length-1].modified.endLineNumberExclusive+A$,i+1));Fd(s,((t,i)=>{const n=new wc(t?t.original.endLineNumberExclusive:o.startLineNumber,i?i.original.startLineNumber:o.endLineNumberExclusive),s=new wc(t?t.modified.endLineNumberExclusive:r.startLineNumber,i?i.modified.startLineNumber:r.endLineNumberExclusive);n.forEach((t=>{e.push(new V$(t,s.startLineNumber+(t-n.startLineNumber)))})),i&&(i.original.forEach((t=>{e.push(new B$(i,t))})),i.modified.forEach((t=>{e.push(new W$(i,t))})))}));const a=s[0].modified.join(s[s.length-1].modified),l=s[0].original.join(s[s.length-1].original);n.push(new P$(new fM(a,l),e))}return n}(t,this._editors.original.getModel().getLineCount(),this._editors.modified.getModel().getLineCount());Ej((e=>{const t=this._editors.modified.getPosition();if(t){const n=i.findIndex((e=>(null==t?void 0:t.lineNumber){const t=this.currentElement.read(e);(null==t?void 0:t.type)===O$.Deleted?this._audioCueService.playAudioCue(k$.diffLineDeleted,{source:"accessibleDiffViewer.currentElementChanged"}):(null==t?void 0:t.type)===O$.Added&&this._audioCueService.playAudioCue(k$.diffLineInserted,{source:"accessibleDiffViewer.currentElementChanged"})}))),this._register(Kj((e=>{var t;const i=this.currentElement.read(e);if(i&&i.type!==O$.Header){const e=null!==(t=i.modifiedLineNumber)&&void 0!==t?t:i.diff.modified.startLineNumber;this._editors.modified.setSelection(Rh.fromPositions(new Va(e,1)))}})))}_goToGroupDelta(e,t){const i=this.groups.get();!i||i.length<=1||Ij(t,(t=>{this._currentGroupIdx.set(uc.ofLength(i.length).clipCyclic(this._currentGroupIdx.get()+e),t),this._currentElementIdx.set(0,t)}))}nextGroup(e){this._goToGroupDelta(1,e)}previousGroup(e){this._goToGroupDelta(-1,e)}_goToLineDelta(e){const t=this.currentGroup.get();!t||t.lines.length<=1||Ej((i=>{this._currentElementIdx.set(uc.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);-1!==i&&Ej((e=>{this._currentElementIdx.set(i,e)}))}revealCurrentElementInEditor(){this._setVisible(!1,void 0);const e=this.currentElement.get();e&&(e.type===O$.Deleted?(this._editors.original.setSelection(Rh.fromPositions(new Va(e.originalLineNumber,1))),this._editors.original.revealLine(e.originalLineNumber),this._editors.original.focus()):(e.type!==O$.Header&&(this._editors.modified.setSelection(Rh.fromPositions(new Va(e.modifiedLineNumber,1))),this._editors.modified.revealLine(e.modifiedLineNumber)),this._editors.modified.focus()))}close(){this._setVisible(!1,void 0),this._editors.modified.focus()}};R$=D$([x$(4,y$)],R$);const A$=3;var O$;!function(e){e[e.Header=0]="Header",e[e.Unchanged=1]="Unchanged",e[e.Deleted=2]="Deleted",e[e.Added=3]="Added"}(O$||(O$={}));class P${constructor(e,t){this.range=e,this.lines=t}}class F${constructor(){this.type=O$.Header}}class B${constructor(e,t){this.diff=e,this.originalLineNumber=t,this.type=O$.Deleted,this.modifiedLineNumber=void 0}}class W${constructor(e,t){this.diff=e,this.modifiedLineNumber=t,this.type=O$.Added,this.originalLineNumber=void 0}}class V${constructor(e,t){this.originalLineNumber=e,this.modifiedLineNumber=t,this.type=O$.Unchanged}}let H$=class extends E{constructor(e,t,i,n,s,o){super(),this._element=e,this._model=t,this._width=i,this._height=n,this._editors=s,this._languageService=o,this.domNode=this._element,this.domNode.className="diff-review monaco-editor-background";const r=document.createElement("div");r.className="diff-review-actions",this._actionBar=this._register(new Rx(r)),this._register(Kj((e=>{this._actionBar.clear(),this._model.canClose.read(e)&&this._actionBar.push(new Ka("diffreview.close",ue(0,"Close"),"close-diff-review "+ta.asClassName(M$),!0,(()=>N$(this,void 0,void 0,(function*(){return 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 OD(this._content,{})),us(this.domNode,this._scrollbar.getDomNode(),r),this._register(x((()=>{us(this.domNode)}))),this._register(v$(this.domNode,{width:this._width,height:this._height})),this._register(v$(this._content,{width:this._width,height:this._height})),this._register(qj(((e,t)=>{this._model.currentGroup.read(e),this._render(t)}))),this._register(Mn(this.domNode,"keydown",(e=>{(e.equals(18)||e.equals(2066)||e.equals(530))&&(e.preventDefault(),this._model.goToNextLine()),(e.equals(16)||e.equals(2064)||e.equals(528))&&(e.preventDefault(),this._model.goToPreviousLine()),(e.equals(9)||e.equals(2057)||e.equals(521)||e.equals(1033))&&(e.preventDefault(),this._model.close()),(e.equals(10)||e.equals(3))&&(e.preventDefault(),this._model.revealCurrentElementInEditor())})))}_render(e){const t=this._editors.original.getOptions(),i=this._editors.modified.getOptions(),n=document.createElement("div");n.className="diff-review-table",n.setAttribute("role","list"),n.setAttribute("aria-label",ue(0,"Accessible Diff Viewer. Use arrow up and down to navigate.")),Hk(n,i.get(50)),us(this._content,n);const s=this._editors.original.getModel(),o=this._editors.modified.getModel();if(!s||!o)return;const r=s.getOptions(),a=o.getOptions(),l=i.get(66),h=this._model.currentGroup.get();for(const d of(null==h?void 0:h.lines)||[]){if(!h)break;let c;if(d.type===O$.Header){const e=document.createElement("div");e.className="diff-review-row",e.setAttribute("role","listitem");const t=h.range,i=this._model.currentGroupIndex.get(),n=this._model.groups.get().length,s=e=>0===e?ue(0,"no lines changed"):1===e?ue(0,"1 line changed"):ue(0,"{0} lines changed",e),o=s(t.original.length),r=s(t.modified.length);e.setAttribute("aria-label",ue(0,"Difference {0} of {1}: original line {2}, {3}, modified line {4}, {5}",i+1,n,t.original.startLineNumber,o,t.modified.startLineNumber,r));const a=document.createElement("div");a.className="diff-review-cell diff-review-summary",a.appendChild(document.createTextNode(`${i+1}/${n}: @@ -${t.original.startLineNumber},${t.original.length} +${t.modified.startLineNumber},${t.modified.length} @@`)),e.appendChild(a),c=e}else c=this._createRow(d,l,this._width.get(),t,s,r,i,o,a);n.appendChild(c);const u=Wj((e=>this._model.currentElement.read(e)===d));e.add(Kj((e=>{const t=u.read(e);c.tabIndex=t?0:-1,t&&c.focus()}))),e.add(En(c,"focus",(()=>{this._model.goToLine(d)})))}this._scrollbar.scanDomNode()}_createRow(e,t,i,n,s,o,r,a,l){const h=n.get(143),d=h.glyphMarginWidth+h.lineNumbersWidth,c=r.get(143),u=10+c.glyphMarginWidth+c.lineNumbersWidth;let g="diff-review-row",p="";let m=null;switch(e.type){case O$.Added:g="diff-review-row line-insert",p=" char-insert",m=E$;break;case O$.Deleted:g="diff-review-row line-delete",p=" char-delete",m=I$}const f=document.createElement("div");f.style.minWidth=i+"px",f.className=g,f.setAttribute("role","listitem"),f.ariaLevel="";const _=document.createElement("div");_.className="diff-review-cell",_.style.height=`${t}px`,f.appendChild(_);const v=document.createElement("span");v.style.width=d+"px",v.style.minWidth=d+"px",v.className="diff-review-line-number"+p,void 0!==e.originalLineNumber?v.appendChild(document.createTextNode(String(e.originalLineNumber))):v.innerText="\xa0",_.appendChild(v);const b=document.createElement("span");b.style.width=u+"px",b.style.minWidth=u+"px",b.style.paddingRight="10px",b.className="diff-review-line-number"+p,void 0!==e.modifiedLineNumber?b.appendChild(document.createTextNode(String(e.modifiedLineNumber))):b.innerText="\xa0",_.appendChild(b);const C=document.createElement("span");if(C.className="diff-review-spacer",m){const e=document.createElement("span");e.className=ta.asClassName(m),e.innerText="\xa0\xa0",C.appendChild(e)}else C.innerText="\xa0\xa0";let w;if(_.appendChild(C),void 0!==e.modifiedLineNumber){let t=this._getLineHtml(a,r,l.tabSize,e.modifiedLineNumber,this._languageService.languageIdCodec);T$._ttPolicy&&(t=T$._ttPolicy.createHTML(t)),_.insertAdjacentHTML("beforeend",t),w=a.getLineContent(e.modifiedLineNumber)}else{let t=this._getLineHtml(s,n,o.tabSize,e.originalLineNumber,this._languageService.languageIdCodec);T$._ttPolicy&&(t=T$._ttPolicy.createHTML(t)),_.insertAdjacentHTML("beforeend",t),w=s.getLineContent(e.originalLineNumber)}0===w.length&&(w=ue(0,"blank"));let y="";switch(e.type){case O$.Unchanged:y=e.originalLineNumber===e.modifiedLineNumber?ue(0,"{0} unchanged line {1}",w,e.originalLineNumber):ue(0,"{0} original line {1} modified line {2}",w,e.originalLineNumber,e.modifiedLineNumber);break;case O$.Added:y=ue(0,"+ {0} modified line {1}",w,e.modifiedLineNumber);break;case O$.Deleted:y=ue(0,"- {0} original line {1}",w,e.originalLineNumber)}return f.setAttribute("aria-label",y),f}_getLineHtml(e,t,i,n,s){const o=e.getLineContent(n),r=t.get(50),a=PC.createEmpty(o,s),l=cP.isBasicASCII(o,e.mightContainNonBasicASCII()),h=cP.containsRTL(o,l,e.mightContainRTL());return MA(new kA(r.isMonospace&&!t.get(33),r.canUseHalfwidthRightwardsArrow,o,!1,l,h,0,a,[],i,0,r.spaceWidth,r.middotWidth,r.wsmiddotWidth,t.get(116),t.get(98),t.get(93),t.get(51)!==MS.OFF,null)).html}};H$=D$([x$(5,Lc)],H$);const z$=tR("diff-insert",Jr.add,ue(0,"Line decoration for inserts in the diff editor.")),U$=tR("diff-remove",Jr.remove,ue(0,"Line decoration for removals in the diff editor.")),K$=Iw.register({className:"line-insert",description:"line-insert",isWholeLine:!0,linesDecorationsClassName:"insert-sign "+ta.asClassName(z$),marginClassName:"gutter-insert"}),j$=Iw.register({className:"line-delete",description:"line-delete",isWholeLine:!0,linesDecorationsClassName:"delete-sign "+ta.asClassName(U$),marginClassName:"gutter-delete"}),q$=Iw.register({className:"line-insert",description:"line-insert",isWholeLine:!0,marginClassName:"gutter-insert"}),$$=Iw.register({className:"line-delete",description:"line-delete",isWholeLine:!0,marginClassName:"gutter-delete"}),G$=Iw.register({className:"char-insert",description:"char-insert",shouldFillLineOnLineBreak:!0}),Z$=Iw.register({className:"char-insert",description:"char-insert",isWholeLine:!0}),Y$=Iw.register({className:"char-insert diff-range-empty",description:"char-insert diff-range-empty"}),X$=Iw.register({className:"char-delete",description:"char-delete",shouldFillLineOnLineBreak:!0}),Q$=Iw.register({className:"char-delete",description:"char-delete",isWholeLine:!0}),J$=Iw.register({className:"char-delete diff-range-empty",description:"char-delete diff-range-empty"}),eG=Iw.register({description:"diff-editor-arrow-revert-change",glyphMarginHoverMessage:new Ta(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(ue(0,"Click to revert change")),glyphMarginClassName:"arrow-revert-change "+ta.asClassName(Jr.arrowRight),zIndex:10001});class tG extends E{constructor(e,t,i,n,s){super(),this._rootElement=e,this._diffModel=t,this._originalEditorLayoutInfo=i,this._modifiedEditorLayoutInfo=n,this._editors=s,this._originalScrollTop=Yj(this._editors.original.onDidScrollChange,(()=>this._editors.original.getScrollTop())),this._modifiedScrollTop=Yj(this._editors.modified.onDidScrollChange,(()=>this._editors.modified.getScrollTop())),this._viewZonesChanged=Qj("onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this.width=Aj(this,0),this._modifiedViewZonesChangedSignal=Qj("modified.onDidChangeViewZones",this._editors.modified.onDidChangeViewZones),this._originalViewZonesChangedSignal=Qj("original.onDidChangeViewZones",this._editors.original.onDidChangeViewZones),this._state=Hj(((e,t)=>{var i;this._element.replaceChildren();const n=this._diffModel.read(e),s=null===(i=null==n?void 0:n.diff.read(e))||void 0===i?void 0:i.movedTexts;if(!s||0===s.length)return void this.width.set(0,void 0);this._viewZonesChanged.read(e);const o=this._originalEditorLayoutInfo.read(e),r=this._modifiedEditorLayoutInfo.read(e);if(!o||!r)return void this.width.set(0,void 0);this._modifiedViewZonesChangedSignal.read(e),this._originalViewZonesChangedSignal.read(e);const a=s.map((t=>{function i(e,t){return(t.getTopForLineNumber(e.startLineNumber,!0)+t.getTopForLineNumber(e.endLineNumberExclusive,!0))/2}const n=i(t.lineRangeMapping.original,this._editors.original),s=this._originalScrollTop.read(e),o=i(t.lineRangeMapping.modified,this._editors.modified),r=n-s,a=o-this._modifiedScrollTop.read(e),l=Math.min(n,o),h=Math.max(n,o);return{range:new uc(l,h),from:r,to:a,fromWithoutScroll:n,toWithoutScroll:o,move:t}}));a.sort(function(...e){return(t,i)=>{for(const n of e){const e=n(t,i);if(!Ld.isNeitherLessOrGreaterThan(e))return e}return Ld.neitherLessOrGreaterThan}}(Qd((e=>e.fromWithoutScroll>e.toWithoutScroll),ec),Qd((e=>e.fromWithoutScroll>e.toWithoutScroll?e.fromWithoutScroll:-e.toWithoutScroll),Jd)));const l=iG.compute(a.map((e=>e.range))),h=o.verticalScrollbarWidth,d=10*(l.getTrackCount()-1)+20,c=h+d+(r.contentLeft-tG.movedCodeBlockPadding);let u=0;for(const g of a){const e=h+10+10*l.getTrack(u),i=15,s=15,o=c,a=r.glyphMarginWidth+r.lineNumbersWidth,d=18,p=document.createElementNS("http://www.w3.org/2000/svg","rect");p.classList.add("arrow-rectangle"),p.setAttribute("x",""+(o-a)),p.setAttribute("y",""+(g.to-d/2)),p.setAttribute("width",`${a}`),p.setAttribute("height",`${d}`),this._element.appendChild(p);const m=document.createElementNS("http://www.w3.org/2000/svg","g"),f=document.createElementNS("http://www.w3.org/2000/svg","path");f.setAttribute("d",`M 0 ${g.from} L ${e} ${g.from} L ${e} ${g.to} L ${o-s} ${g.to}`),f.setAttribute("fill","none"),m.appendChild(f);const _=document.createElementNS("http://www.w3.org/2000/svg","polygon");_.classList.add("arrow"),t.add(Kj((e=>{f.classList.toggle("currentMove",g.move===n.activeMovedText.read(e)),_.classList.toggle("currentMove",g.move===n.activeMovedText.read(e))}))),_.setAttribute("points",`${o-s},${g.to-i/2} ${o},${g.to} ${o-s},${g.to+i/2}`),m.appendChild(_),this._element.appendChild(m),u++}this.width.set(d,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(x((()=>this._element.remove()))),this._register(Kj((e=>{const t=this._originalEditorLayoutInfo.read(e),i=this._modifiedEditorLayoutInfo.read(e);t&&i&&(this._element.style.left=t.width-t.verticalScrollbarWidth+"px",this._element.style.height=`${t.height}px`,this._element.style.width=`${t.verticalScrollbarWidth+t.contentLeft-tG.movedCodeBlockPadding+this.width.read(e)}px`)}))),this._register(iq(this._state));const o=Wj((e=>{const t=this._diffModel.read(e),i=null==t?void 0:t.diff.read(e);return i?i.movedTexts.map((e=>({move:e,original:new f$(Gj(e.lineRangeMapping.original.startLineNumber-1),18),modified:new f$(Gj(e.lineRangeMapping.modified.startLineNumber-1),18)}))):[]}));this._register(C$(this._editors.original,o.map((e=>e.map((e=>e.original)))))),this._register(C$(this._editors.modified,o.map((e=>e.map((e=>e.modified)))))),this._register(qj(((e,t)=>{const i=o.read(e);for(const n of i)t.add(new nG(this._editors.original,n.original,n.move,"original",this._diffModel.get())),t.add(new nG(this._editors.modified,n.modified,n.move,"modified",this._diffModel.get()))})));const r=Yj(this._editors.original.onDidChangeCursorPosition,(()=>this._editors.original.getPosition())),a=Yj(this._editors.modified.onDidChangeCursorPosition,(()=>this._editors.modified.getPosition())),l=Qj("original.onDidFocusEditorWidget",(e=>this._editors.original.onDidFocusEditorWidget((()=>setTimeout((()=>e(void 0)),0))))),h=Qj("modified.onDidFocusEditorWidget",(e=>this._editors.modified.onDidFocusEditorWidget((()=>setTimeout((()=>e(void 0)),0)))));let d="modified";this._register(jj({createEmptyChangeSummary:()=>{},handleChange:(e,t)=>(e.didChange(l)&&(d="original"),e.didChange(h)&&(d="modified"),!0)},(e=>{l.read(e),h.read(e);const t=this._diffModel.read(e);if(!t)return;const i=t.diff.read(e);let n;if(i&&"original"===d){const t=r.read(e);t&&(n=i.movedTexts.find((e=>e.lineRangeMapping.original.contains(t.lineNumber))))}if(i&&"modified"===d){const t=a.read(e);t&&(n=i.movedTexts.find((e=>e.lineRangeMapping.modified.contains(t.lineNumber))))}n!==t.movedTextToCompare.get()&&t.movedTextToCompare.set(void 0,void 0),t.setActiveMovedText(n)})))}}tG.movedCodeBlockPadding=4;class iG{static compute(e){const t=[],i=[];for(const n of e){let e=t.findIndex((e=>!e.intersectsStrict(n)));if(-1===e){const i=6;t.length>=i?e=Cc(t,Qd((e=>e.intersectWithRangeLength(n)),Jd)):(e=t.length,t.push(new gc))}t[e].addRange(n),i.push(e)}return new iG(t.length,i)}constructor(e,t){this._trackCount=e,this.trackPerLineIdx=t}getTrack(e){return this.trackPerLineIdx[e]}getTrackCount(){return this._trackCount}}class nG extends m${constructor(e,t,i,n,s){const o=Ns("div.diff-hidden-lines-widget");super(e,t,o.root),this._editor=e,this._move=i,this._kind=n,this._diffModel=s,this._nodes=Ns("div.diff-moved-code-block",{style:{marginRight:"4px"}},[Ns("div.text-content@textContent"),Ns("div.action-bar@actionBar")]),o.root.appendChild(this._nodes.root);const r=Yj(this._editor.onDidLayoutChange,(()=>this._editor.getLayoutInfo()));let a;this._register(v$(this._nodes.root,{paddingRight:r.map((e=>e.verticalScrollbarWidth))})),a=i.changes.length>0?"original"===this._kind?ue(0,"Code moved with changes to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):ue(0,"Code moved with changes from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1):"original"===this._kind?ue(0,"Code moved to line {0}-{1}",this._move.lineRangeMapping.modified.startLineNumber,this._move.lineRangeMapping.modified.endLineNumberExclusive-1):ue(0,"Code moved from line {0}-{1}",this._move.lineRangeMapping.original.startLineNumber,this._move.lineRangeMapping.original.endLineNumberExclusive-1);const l=this._register(new Rx(this._nodes.actionBar,{highlightToggledItems:!0})),h=new Ka("",a,"",!1);l.push(h,{icon:!1,label:!0});const d=new Ka("","Compare",ta.asClassName(Jr.compareChanges),!0,(()=>{this._editor.focus(),this._diffModel.movedTextToCompare.set(this._diffModel.movedTextToCompare.get()===i?void 0:this._move,void 0)}));this._register(Kj((e=>{const t=this._diffModel.movedTextToCompare.read(e)===i;d.checked=t}))),l.push(d,{icon:!1,label:!0})}}class sG extends E{constructor(e,t,i){super(),this._editors=e,this._diffModel=t,this._options=i,this._decorations=Wj(this,(e=>{var t;const i=null===(t=this._diffModel.read(e))||void 0===t?void 0:t.diff.read(e);if(!i)return null;const n=this._diffModel.read(e).movedTextToCompare.read(e),s=this._options.renderIndicators.read(e),o=this._options.showEmptyDecorations.read(e),r=[],a=[];if(!n)for(const h of i.mappings){if(h.lineRangeMapping.original.isEmpty||r.push({range:h.lineRangeMapping.original.toInclusiveRange(),options:s?j$:$$}),h.lineRangeMapping.modified.isEmpty||a.push({range:h.lineRangeMapping.modified.toInclusiveRange(),options:s?K$:q$}),h.lineRangeMapping.modified.isEmpty||h.lineRangeMapping.original.isEmpty)h.lineRangeMapping.original.isEmpty||r.push({range:h.lineRangeMapping.original.toInclusiveRange(),options:Q$}),h.lineRangeMapping.modified.isEmpty||a.push({range:h.lineRangeMapping.modified.toInclusiveRange(),options:Z$});else for(const e of h.lineRangeMapping.innerChanges||[])h.lineRangeMapping.original.contains(e.originalRange.startLineNumber)&&r.push({range:e.originalRange,options:e.originalRange.isEmpty()&&o?J$:X$}),h.lineRangeMapping.modified.contains(e.modifiedRange.startLineNumber)&&a.push({range:e.modifiedRange,options:e.modifiedRange.isEmpty()&&o?Y$:G$});h.lineRangeMapping.modified.isEmpty||!this._options.shouldRenderRevertArrows.read(e)||n||a.push({range:Rh.fromPositions(new Va(h.lineRangeMapping.modified.startLineNumber,1)),options:eG})}if(n)for(const h of n.changes){const e=h.original.toInclusiveRange();e&&r.push({range:e,options:s?j$:$$});const t=h.modified.toInclusiveRange();t&&a.push({range:t,options:s?K$:q$});for(const i of h.innerChanges||[])r.push({range:i.originalRange,options:X$}),a.push({range:i.modifiedRange,options:G$})}const l=this._diffModel.read(e).activeMovedText.read(e);for(const h of i.movedTexts)r.push({range:h.lineRangeMapping.original.toInclusiveRange(),options:{description:"moved",blockClassName:"movedOriginal"+(h===l?" currentMove":""),blockPadding:[tG.movedCodeBlockPadding,0,tG.movedCodeBlockPadding,tG.movedCodeBlockPadding]}}),a.push({range:h.lineRangeMapping.modified.toInclusiveRange(),options:{description:"moved",blockClassName:"movedModified"+(h===l?" currentMove":""),blockPadding:[4,0,4,4]}});return{originalDecorations:r,modifiedDecorations:a}})),this._register(c$(this._editors.original,this._decorations.map((e=>(null==e?void 0:e.originalDecorations)||[])))),this._register(c$(this._editors.modified,this._decorations.map((e=>(null==e?void 0:e.modifiedDecorations)||[]))))}}class oG extends E{constructor(e,t,i){super(),this._options=e,this._domNode=t,this._dimensions=i,this._sashRatio=Aj(this,void 0),this.sashLeft=Wj(this,(e=>{var t;const i=null!==(t=this._sashRatio.read(e))&&void 0!==t?t:this._options.splitViewDefaultRatio.read(e);return this._computeSashLeft(i,e)})),this._sash=this._register(new SW(this._domNode,{getVerticalSashTop:e=>0,getVerticalSashLeft:e=>this.sashLeft.get(),getVerticalSashHeight:e=>this._dimensions.height.get()},{orientation:0})),this._startSashPosition=void 0,this._register(this._sash.onDidStart((()=>{this._startSashPosition=this.sashLeft.get()}))),this._register(this._sash.onDidChange((e=>{const t=this._dimensions.width.get(),i=this._computeSashLeft((this._startSashPosition+(e.currentX-e.startX))/t,void 0);this._sashRatio.set(i/t,void 0)}))),this._register(this._sash.onDidEnd((()=>this._sash.layout()))),this._register(this._sash.onDidReset((()=>this._sashRatio.set(void 0,void 0)))),this._register(Kj((e=>{const t=this._options.enableSplitViewResizing.read(e);this._sash.state=t?3:0,this.sashLeft.read(e),this._dimensions.height.read(e),this._sash.layout()})))}setBoundarySashes(e){this._sash.orthogonalEndSash=e.bottom}_computeSashLeft(e,t){const i=this._dimensions.width.read(t),n=Math.floor(this._options.splitViewDefaultRatio.read(t)*i),s=this._options.enableSplitViewResizing.read(t)?Math.floor(e*i):n,o=100;return i<=200?n:si-o?i-o:s}}class rG{remove(){var e;null===(e=this.parent)||void 0===e||e.children.delete(this.id)}static findId(e,t){let i;"string"==typeof e?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,void 0!==t.children.get(i)&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let n=i;for(let s=0;void 0!==t.children.get(n);s++)n=`${i}_${s}`;return n}static empty(e){return 0===e.children.size}}class aG extends rG{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class lG extends rG{constructor(e,t,i,n){super(),this.id=e,this.parent=t,this.label=i,this.order=n,this.children=new Map}}class hG extends rG{static create(e,t,i){const n=new jh(i),s=new hG(t.uri),o=e.ordered(t),r=o.map(((e,i)=>{var o;const r=rG.findId(`provider_${i}`,s),l=new lG(r,s,null!==(o=e.displayName)&&void 0!==o?o:"Unknown Outline Provider",i);return Promise.resolve(e.provideDocumentSymbols(t,n.token)).then((e=>{for(const t of e||[])hG._makeOutlineElement(t,l);return l}),(e=>(a(e),l))).then((e=>{rG.empty(e)?e.remove():s._groups.set(r,e)}))})),l=e.onDidChange((()=>{Td(e.ordered(t),o)||n.cancel()}));return Promise.all(r).then((()=>n.token.isCancellationRequested&&!i.isCancellationRequested?hG.create(e,t,i):s._compact())).finally((()=>{n.dispose(),l.dispose()}))}static _makeOutlineElement(e,t){const i=rG.findId(e,t),n=new aG(i,t,e);if(e.children)for(const s of e.children)hG._makeOutlineElement(s,n);t.children.set(n.id,n)}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)0===i.children.size?this._groups.delete(t):e+=1;if(1!==e)this.children=this._groups;else{const e=v.first(this._groups.values());for(const[,t]of e.children)t.parent=this,this.children.set(t.id,t)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof aG?e.push(t.symbol):e.push(...v.map(t.children.values(),(e=>e.symbol)));return e.sort(((e,t)=>Rh.compareRangesUsingStarts(e.range,t.range)))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return hG._flattenDocumentSymbols(t,e,""),t.sort(((e,t)=>Va.compare(Rh.getStartPosition(e.range),Rh.getStartPosition(t.range))||Va.compare(Rh.getEndPosition(t.range),Rh.getEndPosition(e.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&&hG._flattenDocumentSymbols(e,n.children,n.name)}}var dG=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},cG=function(e,t){return function(i,n){t(i,n,e)}},uG=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let gG=class extends E{get isUpdatingViewZones(){return this._isUpdatingViewZones}constructor(e,t,i,n){super(),this._editors=e,this._diffModel=t,this._options=i,this._languageFeaturesService=n,this._isUpdatingViewZones=!1,this._modifiedOutlineSource=Hj(this,((e,t)=>{const i=this._editors.modifiedModel.read(e);if(i)return t.add(new pG(this._languageFeaturesService,i))})),this._register(this._editors.original.onDidChangeCursorPosition((e=>{if(3===e.reason){const e=this._diffModel.get();Ej((t=>{for(const i of this._editors.original.getSelections()||[])null==e||e.ensureOriginalLineIsVisible(i.getStartPosition().lineNumber,t),null==e||e.ensureOriginalLineIsVisible(i.getEndPosition().lineNumber,t)}))}}))),this._register(this._editors.modified.onDidChangeCursorPosition((e=>{if(3===e.reason){const e=this._diffModel.get();Ej((t=>{for(const i of this._editors.modified.getSelections()||[])null==e||e.ensureModifiedLineIsVisible(i.getStartPosition().lineNumber,t),null==e||e.ensureModifiedLineIsVisible(i.getEndPosition().lineNumber,t)}))}})));const s=this._diffModel.map(((e,t)=>{var i,n;return 0===(null===(i=null==e?void 0:e.diff.read(t))||void 0===i?void 0:i.mappings.length)?[]:null!==(n=null==e?void 0:e.unchangedRegions.read(t))&&void 0!==n?n:[]})),o=Hj(this,((e,t)=>{const i=this._modifiedOutlineSource.read(e);if(!i)return{origViewZones:[],modViewZones:[]};const n=[],o=[],r=this._options.renderSideBySide.read(e),a=s.read(e);for(const s of a)if(!s.shouldHideControls(e)){{const e=Wj((e=>s.getHiddenOriginalRange(e).startLineNumber-1)),o=new f$(e,24);n.push(o),t.add(new mG(this._editors.original,o,s,s.originalUnchangedRange,!r,i,(e=>this._diffModel.get().ensureModifiedLineIsVisible(e,void 0)),this._options))}{const e=Wj((e=>s.getHiddenModifiedRange(e).startLineNumber-1)),n=new f$(e,24);o.push(n),t.add(new mG(this._editors.modified,n,s,s.modifiedUnchangedRange,!1,i,(e=>this._diffModel.get().ensureModifiedLineIsVisible(e,void 0)),this._options))}}return{origViewZones:n,modViewZones:o}})),r={description:"unchanged lines",className:"diff-unchanged-lines",isWholeLine:!0},a={description:"Fold Unchanged",glyphMarginHoverMessage:new Ta(void 0,{isTrusted:!0,supportThemeIcons:!0}).appendMarkdown(ue(0,"Fold Unchanged Region")),glyphMarginClassName:"fold-unchanged "+ta.asClassName(Jr.fold),zIndex:10001};this._register(c$(this._editors.original,Wj((e=>{const t=s.read(e),i=t.map((e=>({range:e.originalUnchangedRange.toInclusiveRange(),options:r})));for(const n of t)n.shouldHideControls(e)&&i.push({range:Rh.fromPositions(new Va(n.originalLineNumber,1)),options:a});return i})))),this._register(c$(this._editors.modified,Wj((e=>{const t=s.read(e),i=t.map((e=>({range:e.modifiedUnchangedRange.toInclusiveRange(),options:r})));for(const n of t)n.shouldHideControls(e)&&i.push({range:wc.ofLength(n.modifiedLineNumber,1).toInclusiveRange(),options:a});return i})))),this._register(C$(this._editors.original,o.map((e=>e.origViewZones)),(e=>this._isUpdatingViewZones=e))),this._register(C$(this._editors.modified,o.map((e=>e.modViewZones)),(e=>this._isUpdatingViewZones=e))),this._register(Kj((e=>{const t=s.read(e);this._editors.original.setHiddenAreas(t.map((t=>t.getHiddenOriginalRange(e).toInclusiveRange())).filter(Kr)),this._editors.modified.setHiddenAreas(t.map((t=>t.getHiddenModifiedRange(e).toInclusiveRange())).filter(Kr))}))),this._register(this._editors.modified.onMouseUp((e=>{var t;if(!e.event.rightButton&&e.target.position&&(null===(t=e.target.element)||void 0===t?void 0:t.className.includes("fold-unchanged"))){const t=e.target.position.lineNumber,i=this._diffModel.get();if(!i)return;const n=i.unchangedRegions.get().find((e=>e.modifiedUnchangedRange.includes(t)));if(!n)return;n.collapseAll(void 0),e.event.stopPropagation(),e.event.preventDefault()}}))),this._register(this._editors.original.onMouseUp((e=>{var t;if(!e.event.rightButton&&e.target.position&&(null===(t=e.target.element)||void 0===t?void 0:t.className.includes("fold-unchanged"))){const t=e.target.position.lineNumber,i=this._diffModel.get();if(!i)return;const n=i.unchangedRegions.get().find((e=>e.originalUnchangedRange.includes(t)));if(!n)return;n.collapseAll(void 0),e.event.stopPropagation(),e.event.preventDefault()}})))}};gG=dG([cG(3,oL)],gG);let pG=class extends E{constructor(e,t){super(),this._languageFeaturesService=e,this._textModel=t,this._currentModel=Aj(this,void 0);const i=Qj("documentSymbolProvider.onDidChange",this._languageFeaturesService.documentSymbolProvider.onDidChange),n=Qj("_textModel.onDidChangeContent",B.debounce((e=>this._textModel.onDidChangeContent(e)),(()=>{}),100));this._register(qj(((e,t)=>uG(this,void 0,void 0,(function*(){i.read(e),n.read(e);const s=t.add(new w$),o=yield hG.create(this._languageFeaturesService.documentSymbolProvider,this._textModel,s.token);t.isDisposed||this._currentModel.set(o,void 0)})))))}getBreadcrumbItems(e,t){const i=this._currentModel.read(t);if(!i)return[];const n=i.asListOfDocumentSymbols().filter((t=>e.contains(t.range.startLineNumber)&&!e.contains(t.range.endLineNumber)));return n.sort(tc(Qd((e=>e.range.endLineNumber-e.range.startLineNumber),Jd))),n.map((e=>({name:e.name,kind:e.kind,startLineNumber:e.range.startLineNumber})))}};pG=dG([cG(0,oL)],pG);class mG extends m${constructor(e,t,i,n,s,o,r,a){const l=Ns("div.diff-hidden-lines-widget");super(e,t,l.root),this._editor=e,this._unchangedRegion=i,this._unchangedRegionRange=n,this.hide=s,this._modifiedOutlineSource=o,this._revealModifiedHiddenLine=r,this._options=a,this._nodes=Ns("div.diff-hidden-lines",[Ns("div.top@top",{title:ue(0,"Click or drag to show more above")}),Ns("div.center@content",{style:{display:"flex"}},[Ns("div@first",{style:{display:"flex",justifyContent:"center",alignItems:"center",flexShrink:"0"}},[fs("a",{title:ue(0,"Show all"),role:"button",onclick:()=>{this._unchangedRegion.showAll(void 0)}},...lk("$(unfold)"))]),Ns("div@others",{style:{display:"flex",justifyContent:"center",alignItems:"center"}})]),Ns("div.bottom@bottom",{title:ue(0,"Click or drag to show more below"),role:"button"})]),l.root.appendChild(this._nodes.root);const h=Yj(this._editor.onDidLayoutChange,(()=>this._editor.getLayoutInfo()));this.hide?us(this._nodes.first):this._register(v$(this._nodes.first,{width:h.map((e=>e.contentLeft))}));const d=this._editor;this._register(En(this._nodes.top,"mousedown",(e=>{if(0!==e.button)return;this._nodes.top.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),e.preventDefault();const t=e.clientY;let i=!1;const n=this._unchangedRegion.visibleLineCountTop.get();this._unchangedRegion.isDragged.set(!0,void 0);const s=En(window,"mousemove",(e=>{const s=e.clientY-t;i=i||Math.abs(s)>2;const o=Math.round(s/d.getOption(66)),r=Math.max(0,Math.min(n+o,this._unchangedRegion.getMaxVisibleLineCountTop()));this._unchangedRegion.visibleLineCountTop.set(r,void 0)})),o=En(window,"mouseup",(e=>{i||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(!1,void 0),s.dispose(),o.dispose()}))}))),this._register(En(this._nodes.bottom,"mousedown",(e=>{if(0!==e.button)return;this._nodes.bottom.classList.toggle("dragging",!0),this._nodes.root.classList.toggle("dragging",!0),e.preventDefault();const t=e.clientY;let i=!1;const n=this._unchangedRegion.visibleLineCountBottom.get();this._unchangedRegion.isDragged.set(!0,void 0);const s=En(window,"mousemove",(e=>{const s=e.clientY-t;i=i||Math.abs(s)>2;const o=Math.round(s/d.getOption(66)),r=Math.max(0,Math.min(n-o,this._unchangedRegion.getMaxVisibleLineCountBottom())),a=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.visibleLineCountBottom.set(r,void 0);const l=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(l-a))})),o=En(window,"mouseup",(e=>{if(this._unchangedRegion.isDragged.set(!1,void 0),!i){const e=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);this._unchangedRegion.showMoreBelow(this._options.hideUnchangedRegionsRevealLineCount.get(),void 0);const t=d.getTopForLineNumber(this._unchangedRegionRange.endLineNumberExclusive);d.setScrollTop(d.getScrollTop()+(t-e))}this._nodes.bottom.classList.toggle("dragging",!1),this._nodes.root.classList.toggle("dragging",!1),s.dispose(),o.dispose()}))}))),this._register(Kj((e=>{const t=[];if(!this.hide){const n=ue(0,"{0} hidden lines",i.getHiddenModifiedRange(e).length),s=fs("span",{title:ue(0,"Double click to unfold")},n);s.addEventListener("dblclick",(e=>{0===e.button&&(e.preventDefault(),this._unchangedRegion.showAll(void 0))})),t.push(s);const o=this._unchangedRegion.getHiddenModifiedRange(e),r=this._modifiedOutlineSource.getBreadcrumbItems(o,e);if(r.length>0){t.push(fs("span",void 0,"\xa0\xa0|\xa0\xa0"));for(let e=0;e{this._revealModifiedHiddenLine(i.startLineNumber)}}}}us(this._nodes.others,...t)})))}}const fG=Ba("editorWorkerService");var _G,vG=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},bG=function(e,t){return function(i,n){t(i,n,e)}},CG=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let wG=_G=class{constructor(e,t,i){this.editorWorkerService=t,this.telemetryService=i,this.onDidChangeEventEmitter=new U,this.onDidChange=this.onDidChangeEventEmitter.event,this.diffAlgorithm="advanced",this.diffAlgorithmOnDidChangeSubscription=void 0,this.setOptions(e)}dispose(){var e;null===(e=this.diffAlgorithmOnDidChangeSubscription)||void 0===e||e.dispose()}computeDiff(e,t,i,n){var s,o;return CG(this,void 0,void 0,(function*(){if("string"!=typeof this.diffAlgorithm)return this.diffAlgorithm.computeDiff(e,t,i,n);if(1===e.getLineCount()&&1===e.getLineMaxColumn(1))return 1===t.getLineCount()&&1===t.getLineMaxColumn(1)?{changes:[],identical:!0,quitEarly:!1,moves:[]}:{changes:[new _M(new wc(1,2),new wc(1,t.getLineCount()+1),[new vM(e.getFullModelRange(),t.getFullModelRange())])],identical:!1,quitEarly:!1,moves:[]};const r=JSON.stringify([e.uri.toString(),t.uri.toString()]),a=JSON.stringify([e.id,t.id,e.getAlternativeVersionId(),t.getAlternativeVersionId(),JSON.stringify(i)]),l=_G.diffCache.get(r);if(l&&l.context===a)return l.result;const h=F.create(),d=yield this.editorWorkerService.computeDiff(e.uri,t.uri,i,this.diffAlgorithm),c=h.elapsed();if(this.telemetryService.publicLog2("diffEditor.computeDiff",{timeMs:c,timedOut:null===(s=null==d?void 0:d.quitEarly)||void 0===s||s,detectedMoves:i.computeMoves?null!==(o=null==d?void 0:d.moves.length)&&void 0!==o?o:0:-1}),n.isCancellationRequested)return{changes:[],identical:!1,quitEarly:!0,moves:[]};if(!d)throw new Error("no diff result available");return _G.diffCache.size>10&&_G.diffCache.delete(_G.diffCache.keys().next().value),_G.diffCache.set(r,{result:d,context:a}),d}))}setOptions(e){var t;let i=!1;e.diffAlgorithm&&this.diffAlgorithm!==e.diffAlgorithm&&(null===(t=this.diffAlgorithmOnDidChangeSubscription)||void 0===t||t.dispose(),this.diffAlgorithmOnDidChangeSubscription=void 0,this.diffAlgorithm=e.diffAlgorithm,"string"!=typeof e.diffAlgorithm&&(this.diffAlgorithmOnDidChangeSubscription=e.diffAlgorithm.onDidChange((()=>this.onDidChangeEventEmitter.fire()))),i=!0),i&&this.onDidChangeEventEmitter.fire()}};wG.diffCache=new Map,wG=_G=vG([bG(1,fG),bG(2,lh)],wG);var yG=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},SG=function(e,t){return function(i,n){t(i,n,e)}};const LG=Ba("diffProviderFactoryService");let kG=class{constructor(e){this.instantiationService=e}createDiffProvider(e,t){return this.instantiationService.createInstance(wG,t)}};kG=yG([SG(0,Fa)],kG),yu(LG,kG,1);var DG=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},xG=function(e,t){return function(i,n){t(i,n,e)}},NG=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let EG=class extends E{setActiveMovedText(e){this._activeMovedText.set(e,void 0)}constructor(e,t,i,n){super(),this.model=e,this._options=t,this._editor=i,this._diffProviderFactoryService=n,this._isDiffUpToDate=Aj(this,!1),this.isDiffUpToDate=this._isDiffUpToDate,this._diff=Aj(this,void 0),this.diff=this._diff,this._unchangedRegions=Aj(this,{regions:[],originalDecorationIds:[],modifiedDecorationIds:[]}),this.unchangedRegions=Wj(this,(e=>this._options.hideUnchangedRegions.read(e)?this._unchangedRegions.read(e).regions:(Ej((e=>{for(const t of this._unchangedRegions.get().regions)t.collapseAll(e)})),[]))),this.movedTextToCompare=Aj(this,void 0),this._activeMovedText=Aj(this,void 0),this._hoveredMovedText=Aj(this,void 0),this.activeMovedText=Wj(this,(e=>{var t,i;return null!==(i=null!==(t=this.movedTextToCompare.read(e))&&void 0!==t?t:this._hoveredMovedText.read(e))&&void 0!==i?i:this._activeMovedText.read(e)})),this._cancellationTokenSource=new jh,this._diffProvider=Wj(this,(e=>{const t=this._diffProviderFactoryService.createDiffProvider(this._editor,{diffAlgorithm:this._options.diffAlgorithm.read(e)});return{diffProvider:t,onChangeSignal:Qj("onDidChange",t.onDidChange)}})),this._register(x((()=>this._cancellationTokenSource.cancel())));const s=eq("contentChangedSignal"),o=this._register(new rd((()=>s.trigger(void 0)),200)),r=(t,i,n)=>{const s=TG.fromDiffs(t.changes,e.original.getLineCount(),e.modified.getLineCount(),this._options.hideUnchangedRegionsMinimumLineCount.read(n),this._options.hideUnchangedRegionsContextLineCount.read(n)),o=this._unchangedRegions.get(),r=o.originalDecorationIds.map((t=>e.original.getDecorationRange(t))).filter((e=>!!e)).map((e=>wc.fromRange(e))),a=o.modifiedDecorationIds.map((t=>e.modified.getDecorationRange(t))).filter((e=>!!e)).map((e=>wc.fromRange(e))),l=e.original.deltaDecorations(o.originalDecorationIds,s.map((e=>({range:e.originalUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}})))),h=e.modified.deltaDecorations(o.modifiedDecorationIds,s.map((e=>({range:e.modifiedUnchangedRange.toInclusiveRange(),options:{description:"unchanged"}}))));for(const e of s)for(let t=0;t{if(this._diff.get()){const i=Eg.fromModelContentChanges(t.changes),n=AG(this._lastDiff,i,e.original,e.modified);n&&(this._lastDiff=n,Ej((e=>{this._diff.set(IG.fromDiffResult(this._lastDiff),e),r(n,e);const t=this.movedTextToCompare.get();this.movedTextToCompare.set(t?this._lastDiff.moves.find((e=>e.lineRangeMapping.modified.intersect(t.lineRangeMapping.modified))):void 0,e)})))}o.schedule()}))),this._register(e.original.onDidChangeContent((t=>{if(this._diff.get()){const i=Eg.fromModelContentChanges(t.changes),n=RG(this._lastDiff,i,e.original,e.modified);n&&(this._lastDiff=n,Ej((e=>{this._diff.set(IG.fromDiffResult(this._lastDiff),e),r(n,e);const t=this.movedTextToCompare.get();this.movedTextToCompare.set(t?this._lastDiff.moves.find((e=>e.lineRangeMapping.modified.intersect(t.lineRangeMapping.modified))):void 0,e)})))}o.schedule()}))),this._register(qj(((t,i)=>NG(this,void 0,void 0,(function*(){var n,a;this._options.hideUnchangedRegionsMinimumLineCount.read(t),this._options.hideUnchangedRegionsContextLineCount.read(t),o.cancel(),s.read(t);const l=this._diffProvider.read(t);l.onChangeSignal.read(t),b$(JM,t),b$(ZM,t),this._isDiffUpToDate.set(!1,void 0);let h=[];i.add(e.original.onDidChangeContent((e=>{const t=Eg.fromModelContentChanges(e.changes);h=hp(h,t)})));let d=[];i.add(e.modified.onDidChangeContent((e=>{const t=Eg.fromModelContentChanges(e.changes);d=hp(d,t)})));let c=yield l.diffProvider.computeDiff(e.original,e.modified,{ignoreTrimWhitespace:this._options.ignoreTrimWhitespace.read(t),maxComputationTimeMs:this._options.maxComputationTimeMs.read(t),computeMoves:this._options.showMoves.read(t)},this._cancellationTokenSource.token);var u,g,p;this._cancellationTokenSource.token.isCancellationRequested||(u=c,g=e.original,p=e.modified,c={changes:u.changes.map((e=>new _M(e.original,e.modified,e.innerChanges?e.innerChanges.map((e=>function(e,t,i){let n=e.originalRange,s=e.modifiedRange;return(1!==n.endColumn||1!==s.endColumn)&&n.endColumn===t.getLineMaxColumn(n.endLineNumber)&&s.endColumn===i.getLineMaxColumn(s.endLineNumber)&&n.endLineNumber{r(c,e),this._lastDiff=c;const t=IG.fromDiffResult(c);this._diff.set(t,e),this._isDiffUpToDate.set(!0,e);const i=this.movedTextToCompare.get();this.movedTextToCompare.set(i?this._lastDiff.moves.find((e=>e.lineRangeMapping.modified.intersect(i.lineRangeMapping.modified))):void 0,e)})))})))))}ensureModifiedLineIsVisible(e,t){var i;if(0===(null===(i=this.diff.get())||void 0===i?void 0:i.mappings.length))return;const n=this._unchangedRegions.get().regions;for(const s of n)if(s.getHiddenModifiedRange(void 0).contains(e))return void s.showModifiedLine(e,t)}ensureOriginalLineIsVisible(e,t){var i;if(0===(null===(i=this.diff.get())||void 0===i?void 0:i.mappings.length))return;const n=this._unchangedRegions.get().regions;for(const s of n)if(s.getHiddenOriginalRange(void 0).contains(e))return void s.showOriginalLine(e,t)}waitForDiff(){return NG(this,void 0,void 0,(function*(){var e,t;yield(e=this.isDiffUpToDate,t=e=>e,new Promise((i=>{let n=!1,s=!1;const o=Kj((r=>{const a=e.read(r);t(a)&&(n?o.dispose():s=!0,i(a))}));n=!0,s&&o.dispose()})))}))}serializeState(){return{collapsedRegions:this._unchangedRegions.get().regions.map((e=>({range:e.getHiddenModifiedRange(void 0).serialize()})))}}restoreSerializedState(e){const t=e.collapsedRegions.map((e=>wc.deserialize(e.range))),i=this._unchangedRegions.get();Ej((e=>{for(const n of i.regions)for(const i of t)if(n.modifiedUnchangedRange.intersect(i)){n.setHiddenModifiedRange(i,e);break}}))}};EG=DG([xG(3,LG)],EG);class IG{static fromDiffResult(e){return new IG(e.changes.map((e=>new MG(e))),e.moves||[],e.identical,e.quitEarly)}constructor(e,t,i,n){this.mappings=e,this.movedTexts=t,this.identical=i,this.quitEarly=n}}class MG{constructor(e){this.lineRangeMapping=e}}class TG{static fromDiffs(e,t,i,n,s){const o=_M.inverse(e,t,i),r=[];for(const a of o){let e=a.original.startLineNumber,o=a.modified.startLineNumber,l=a.original.length;const h=1===e&&1===o,d=e+l===t+1&&o+l===i+1;(h||d)&&l>=s+n?(h&&!d&&(l-=s),d&&!h&&(e+=s,o+=s,l-=s),r.push(new TG(e,o,l,0,0))):l>=2*s+n&&(e+=s,o+=s,l-=2*s,r.push(new TG(e,o,l,0,0)))}return r}get originalUnchangedRange(){return wc.ofLength(this.originalLineNumber,this.lineCount)}get modifiedUnchangedRange(){return wc.ofLength(this.modifiedLineNumber,this.lineCount)}constructor(e,t,i,n,s){this.originalLineNumber=e,this.modifiedLineNumber=t,this.lineCount=i,this._visibleLineCountTop=Aj(this,0),this.visibleLineCountTop=this._visibleLineCountTop,this._visibleLineCountBottom=Aj(this,0),this.visibleLineCountBottom=this._visibleLineCountBottom,this._shouldHideControls=Wj(this,(e=>this.visibleLineCountTop.read(e)+this.visibleLineCountBottom.read(e)===this.lineCount&&!this.isDragged.read(e))),this.isDragged=Aj(this,!1),this._visibleLineCountTop.set(n,void 0),this._visibleLineCountBottom.set(s,void 0)}shouldHideControls(e){return this._shouldHideControls.read(e)}getHiddenOriginalRange(e){return wc.ofLength(this.originalLineNumber+this._visibleLineCountTop.read(e),this.lineCount-this._visibleLineCountTop.read(e)-this._visibleLineCountBottom.read(e))}getHiddenModifiedRange(e){return wc.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){const i=e+1-(this.modifiedLineNumber+this._visibleLineCountTop.get()),n=this.modifiedLineNumber-this._visibleLineCountBottom.get()+this.lineCount-e;i{var s;this._contextMenuService.showContextMenu({domForShadowRoot:c&&null!==(s=i.getDomNode())&&void 0!==s?s:void 0,getAnchor:()=>({x:e,y:t}),getActions:()=>{const e=[],t=n.modified.isEmpty;e.push(new Ka("diff.clipboard.copyDeletedContent",t?n.original.length>1?ue(0,"Copy deleted lines"):ue(0,"Copy deleted line"):n.original.length>1?ue(0,"Copy changed lines"):ue(0,"Copy changed line"),void 0,!0,(()=>OG(this,void 0,void 0,(function*(){const e=this._originalTextModel.getValueInRange(n.original.toExclusiveRange());yield this._clipboardService.writeText(e)}))))),n.original.length>1&&e.push(new Ka("diff.clipboard.copyDeletedLineContent",ue(0,t?"Copy deleted line ({0})":"Copy changed line ({0})",n.original.startLineNumber+d),void 0,!0,(()=>OG(this,void 0,void 0,(function*(){let e=this._originalTextModel.getLineContent(n.original.startLineNumber+d);if(""===e){e=0===this._originalTextModel.getEndOfLineSequence()?"\n":"\r\n"}yield this._clipboardService.writeText(e)})))));return i.getOption(90)||e.push(new Ka("diff.inline.revertChange",ue(0,"Revert this change"),void 0,!0,(()=>OG(this,void 0,void 0,(function*(){this._editor.revert(this._diff)}))))),e},autoSelectFirstItem:!0})};this._register(Mn(this._diffActions,"mousedown",(e=>{const{top:t,height:i}=Hn(this._diffActions),n=Math.floor(h/3);e.preventDefault(),u(e.posx,t+i+n)}))),this._register(i.onMouseMove((e=>{8!==e.target.type&&5!==e.target.type||e.target.detail.viewZoneId!==this._getViewZoneId()?this.visibility=!1:(d=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,h),this.visibility=!0)}))),this._register(i.onMouseDown((e=>{if(e.event.rightButton&&(8===e.target.type||5===e.target.type)){e.target.detail.viewZoneId===this._getViewZoneId()&&(e.event.preventDefault(),d=this._updateLightBulbPosition(this._marginDomNode,e.event.browserEvent.y,h),u(e.event.posx,e.event.posy+h))}})))}_updateLightBulbPosition(e,t,i){const{top:n}=Hn(e),s=t-n,o=Math.floor(s/i),r=o*i;if(this._diffActions.style.top=`${r}px`,this._viewLineCounts){let e=0;for(let t=0;te});function BG(e,t,i,n){Hk(n,t.fontInfo);const s=i.length>0,o=new eu(1e4);let r=0,a=0;const l=[];for(let c=0;c');const l=t.getLineContent(),h=cP.isBasicASCII(l,s),d=cP.containsRTL(l,h,o),c=EA(new kA(r.fontInfo.isMonospace&&!r.disableMonospaceOptimizations,r.fontInfo.canUseHalfwidthRightwardsArrow,l,!1,h,d,0,t,i,r.tabSize,0,r.fontInfo.spaceWidth,r.fontInfo.middotWidth,r.fontInfo.wsmiddotWidth,r.stopRenderingLineAfter,r.renderWhitespace,r.renderControlCharacters,r.fontLigatures!==MS.OFF,null),a);return a.appendString(""),c.characterMapping.getHorizontalOffset(c.characterMapping.length)}var zG=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},UG=function(e,t){return function(i,n){t(i,n,e)}};let KG=class extends E{constructor(e,t,i,n,s,o,r){super(),this._editors=e,this._diffModel=t,this._options=i,this._diffEditorWidget=n,this._canIgnoreViewZoneUpdateEvent=s,this._clipboardService=o,this._contextMenuService=r,this._originalTopPadding=Aj(this,0),this._originalScrollOffset=Aj(this,0),this._originalScrollOffsetAnimated=p$(this._originalScrollOffset,this._store),this._modifiedTopPadding=Aj(this,0),this._modifiedScrollOffset=Aj(this,0),this._modifiedScrollOffsetAnimated=p$(this._modifiedScrollOffset,this._store);let a=!1;const l=Aj("state",0),h=this._register(new rd((()=>{l.set(l.get()+1,void 0)}),0));this._register(this._editors.original.onDidChangeViewZones((e=>{a||this._canIgnoreViewZoneUpdateEvent()||h.schedule()}))),this._register(this._editors.modified.onDidChangeViewZones((e=>{a||this._canIgnoreViewZoneUpdateEvent()||h.schedule()}))),this._register(this._editors.original.onDidChangeConfiguration((e=>{(e.hasChanged(144)||e.hasChanged(66))&&h.schedule()}))),this._register(this._editors.modified.onDidChangeConfiguration((e=>{(e.hasChanged(144)||e.hasChanged(66))&&h.schedule()})));const d=this._diffModel.map((e=>e?Yj(e.model.original.onDidChangeTokens,(()=>2===e.model.original.tokenization.backgroundTokenizationState)):void 0)).map(((e,t)=>null==e?void 0:e.read(t))),c=new Set,u=new Set,g=Wj((e=>{const t=this._diffModel.read(e),i=null==t?void 0:t.diff.read(e);if(!t||!i)return null;l.read(e);const n=this._options.renderSideBySide.read(e);return jG(this._editors.original,this._editors.modified,i.mappings,c,u,n)})),p=Wj((e=>{var t;const i=null===(t=this._diffModel.read(e))||void 0===t?void 0:t.movedTextToCompare.read(e);if(!i)return null;l.read(e);const n=i.changes.map((e=>new MG(e)));return jG(this._editors.original,this._editors.modified,n,c,u,!0)}));function m(){const e=document.createElement("div");return e.className="diagonal-fill",e}const f=this._register(new N),_=Wj((e=>{var t,i,n,s,o,r,a,l;f.clear();const h=g.read(e)||[],c=[],u=[],_=this._modifiedTopPadding.read(e);_>0&&u.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:_,showInHiddenAreas:!0,suppressMouseDown:!0});const v=this._originalTopPadding.read(e);v>0&&c.push({afterLineNumber:0,domNode:document.createElement("div"),heightInPx:v,showInHiddenAreas:!0,suppressMouseDown:!0});const b=this._options.renderSideBySide.read(e),C=b||null===(t=this._editors.modified._getViewModel())||void 0===t?void 0:t.createLineBreaksComputer();if(C)for(const N of h)if(N.diff)for(let E=N.originalRange.startLineNumber;Ethis._editors.original.getModel().tokenization.getLineTokens(e))),I.originalRange.mapToLineArray((e=>w[y++])),k,D),A=[];for(const B of I.diff.innerChanges||[])A.push(new uP(B.originalRange.delta(-(I.diff.original.startLineNumber-1)),X$.className,0));const O=BG(R,x,A,T),P=document.createElement("div");if(P.className="inline-deleted-margin-view-zone",Hk(P,x.fontInfo),this._options.renderIndicators.read(e))for(let W=0;W$r(F)),P,this._editors.modified,I.diff,this._diffEditorWidget,O.viewLineCounts,this._editors.original.getModel(),this._contextMenuService,this._clipboardService));for(let H=0;H1&&c.push({afterLineNumber:I.originalRange.startLineNumber+H,domNode:m(),heightInPx:(z-1)*S,showInHiddenAreas:!0,suppressMouseDown:!0})}u.push({afterLineNumber:I.modifiedRange.startLineNumber-1,domNode:T,heightInPx:O.heightInLines*S,minWidthInPx:O.minWidthInPx,marginDomNode:P,setZoneId(e){F=e},showInHiddenAreas:!0,suppressMouseDown:!0})}const M=document.createElement("div");M.className="gutter-delete",c.push({afterLineNumber:I.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:I.modifiedHeightInPx,marginDomNode:M,showInHiddenAreas:!0,suppressMouseDown:!0})}else{const U=I.modifiedHeightInPx-I.originalHeightInPx;if(U>0){if(null==L?void 0:L.lineRangeMapping.original.delta(-1).deltaLength(2).contains(I.originalRange.endLineNumberExclusive-1))continue;c.push({afterLineNumber:I.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:U,showInHiddenAreas:!0,suppressMouseDown:!0})}else{if(null==L?void 0:L.lineRangeMapping.modified.delta(-1).deltaLength(2).contains(I.modifiedRange.endLineNumberExclusive-1))continue;function K(){const e=document.createElement("div");return e.className="arrow-revert-change "+ta.asClassName(Jr.arrowRight),fs("div",{},e)}let j;I.diff&&I.diff.modified.isEmpty&&this._options.shouldRenderRevertArrows.read(e)&&(j=K()),u.push({afterLineNumber:I.modifiedRange.endLineNumberExclusive-1,domNode:m(),heightInPx:-U,marginDomNode:j,showInHiddenAreas:!0,suppressMouseDown:!0})}}for(const q of null!==(l=p.read(e))&&void 0!==l?l:[]){if(!(null==L?void 0:L.lineRangeMapping.original.intersect(q.originalRange))||!(null==L?void 0:L.lineRangeMapping.modified.intersect(q.modifiedRange)))continue;const $=q.modifiedHeightInPx-q.originalHeightInPx;$>0?c.push({afterLineNumber:q.originalRange.endLineNumberExclusive-1,domNode:m(),heightInPx:$,showInHiddenAreas:!0,suppressMouseDown:!0}):u.push({afterLineNumber:q.modifiedRange.endLineNumberExclusive-1,domNode:m(),heightInPx:-$,showInHiddenAreas:!0,suppressMouseDown:!0})}return{orig:c,mod:u}}));this._register(qj((e=>{const t=WN.capture(this._editors.modified),i=_.read(e);a=!0,this._editors.original.changeViewZones((e=>{for(const t of c)e.removeZone(t);c.clear();for(const t of i.orig){const i=e.addZone(t);t.setZoneId&&t.setZoneId(i),c.add(i)}})),this._editors.modified.changeViewZones((e=>{for(const t of u)e.removeZone(t);u.clear();for(const t of i.mod){const i=e.addZone(t);t.setZoneId&&t.setZoneId(i),u.add(i)}})),a=!1,t.restore(this._editors.modified)}))),this._register(x((()=>{this._editors.original.changeViewZones((e=>{for(const t of c)e.removeZone(t);c.clear()})),this._editors.modified.changeViewZones((e=>{for(const t of u)e.removeZone(t);u.clear()}))})));let v=!1;this._register(this._editors.original.onDidScrollChange((e=>{e.scrollLeftChanged&&!v&&(v=!0,this._editors.modified.setScrollLeft(e.scrollLeft),v=!1)}))),this._register(this._editors.modified.onDidScrollChange((e=>{e.scrollLeftChanged&&!v&&(v=!0,this._editors.original.setScrollLeft(e.scrollLeft),v=!1)}))),this._originalScrollTop=Yj(this._editors.original.onDidScrollChange,(()=>this._editors.original.getScrollTop())),this._modifiedScrollTop=Yj(this._editors.modified.onDidScrollChange,(()=>this._editors.modified.getScrollTop())),this._register(Kj((e=>{const t=this._originalScrollTop.read(e)-(this._originalScrollOffsetAnimated.get()-this._modifiedScrollOffsetAnimated.read(e))-(this._originalTopPadding.get()-this._modifiedTopPadding.read(e));t!==this._editors.modified.getScrollTop()&&this._editors.modified.setScrollTop(t,1)}))),this._register(Kj((e=>{const t=this._modifiedScrollTop.read(e)-(this._modifiedScrollOffsetAnimated.get()-this._originalScrollOffsetAnimated.read(e))-(this._modifiedTopPadding.get()-this._originalTopPadding.read(e));t!==this._editors.original.getScrollTop()&&this._editors.original.setScrollTop(t,1)}))),this._register(Kj((e=>{var t;const i=null===(t=this._diffModel.read(e))||void 0===t?void 0:t.movedTextToCompare.read(e);let n=0;if(i){const e=this._editors.original.getTopForLineNumber(i.lineRangeMapping.original.startLineNumber,!0)-this._originalTopPadding.get();n=this._editors.modified.getTopForLineNumber(i.lineRangeMapping.modified.startLineNumber,!0)-this._modifiedTopPadding.get()-e}n>0?(this._modifiedTopPadding.set(0,void 0),this._originalTopPadding.set(n,void 0)):n<0?(this._modifiedTopPadding.set(-n,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()-n,void 0,!0):this._modifiedScrollOffset.set(this._originalScrollOffset.get()+n,void 0,!0)})))}};function jG(e,t,i,n,s,o){const r=new ic(qG(e,n)),a=new ic(qG(t,s)),l=e.getOption(66),h=t.getOption(66),d=[];let c=0,u=0;function g(e,t){for(;;){let i=r.peek(),n=a.peek();if(i&&i.lineNumber>=e&&(i=void 0),n&&n.lineNumber>=t&&(n=void 0),!i&&!n)break;const s=i?i.lineNumber-c:Number.MAX_VALUE,o=n?n.lineNumber-u:Number.MAX_VALUE;so?(a.dequeue(),i={lineNumber:n.lineNumber-u+c,heightInPx:0}):(r.dequeue(),a.dequeue()),d.push({originalRange:wc.ofLength(i.lineNumber,1),modifiedRange:wc.ofLength(n.lineNumber,1),originalHeightInPx:l+i.heightInPx,modifiedHeightInPx:h+n.heightInPx,diff:void 0})}}for(const p of i){const m=p.lineRangeMapping;g(m.original.startLineNumber,m.modified.startLineNumber);let f=!0,_=m.modified.startLineNumber,v=m.original.startLineNumber;function b(e,t){var i,n,s,o;if(et.lineNumbere+t.heightInPx),0))&&void 0!==n?n:0,m=null!==(o=null===(s=a.takeWhile((e=>e.lineNumbere+t.heightInPx),0))&&void 0!==o?o:0;d.push({originalRange:c,modifiedRange:u,originalHeightInPx:c.length*l+g,modifiedHeightInPx:u.length*h+m,diff:p.lineRangeMapping}),v=e,_=t}if(o)for(const C of m.innerChanges||[])C.originalRange.startColumn>1&&C.modifiedRange.startColumn>1&&b(C.originalRange.startLineNumber,C.modifiedRange.startLineNumber),C.originalRange.endColumn1&&n.push({lineNumber:a,heightInPx:r*(e-1)})}for(const a of e.getWhitespaces()){if(t.has(a.id))continue;const e=0===a.afterLineNumber?0:o.convertViewPositionToModelPosition(new Va(a.afterLineNumber,1)).lineNumber;i.push({lineNumber:e,heightInPx:a.height})}return function(e,t,i,n){if(0===e.length)return t;if(0===t.length)return e;const s=[];let o=0,r=0;for(;od?(s.push(l),r++):(s.push(n(a,l)),o++,r++)}for(;oe.lineNumber),((e,t)=>({lineNumber:e.lineNumber,heightInPx:e.heightInPx+t.heightInPx})))}KG=zG([UG(5,eS),UG(6,Kx)],KG);var $G,GG=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},ZG=function(e,t){return function(i,n){t(i,n,e)}};let YG=$G=class extends E{constructor(e,t,i,n,s,o,r,a){super(),this._editors=e,this._rootElement=t,this._diffModel=i,this._rootWidth=n,this._rootHeight=s,this._modifiedEditorLayoutInfo=o,this._options=r,this._themeService=a;const l=Yj(this._themeService.onDidColorThemeChange,(()=>this._themeService.getColorTheme())),h=Wj((e=>{const t=l.read(e);return{insertColor:t.getColor(lf)||(t.getColor(rf)||sf).transparent(2),removeColor:t.getColor(hf)||(t.getColor(af)||of).transparent(2)}})),d=Yj(this._editors.modified.onDidScrollChange,(()=>this._editors.modified.getScrollTop())),c=Yj(this._editors.modified.onDidScrollChange,(()=>this._editors.modified.getScrollHeight()));this._register(qj(((e,t)=>{if(!this._options.renderOverviewRuler.read(e))return;const i=Vk(document.createElement("div"));i.setClassName("diffViewport"),i.setPosition("absolute");const n=Ns("div.diffOverview",{style:{position:"absolute",top:"0px",width:$G.ENTIRE_DIFF_OVERVIEW_WIDTH+"px"}}).root;t.add(u$(n,i.domNode)),t.add(Mn(n,os.POINTER_DOWN,(e=>{this._editors.modified.delegateVerticalScrollbarPointerDown(e)}))),t.add(En(n,os.MOUSE_WHEEL,(e=>{this._editors.modified.delegateScrollFromMouseWheelEvent(e)}),{passive:!1})),t.add(u$(this._rootElement,n)),t.add(qj(((e,t)=>{const s=this._diffModel.read(e),o=this._editors.original.createOverviewRuler("original diffOverviewRuler");o&&(t.add(o),t.add(u$(n,o.getDomNode())));const r=this._editors.modified.createOverviewRuler("modified diffOverviewRuler");if(r&&(t.add(r),t.add(u$(n,r.getDomNode()))),!o||!r)return;const a=Qj("viewZoneChanged",this._editors.original.onDidChangeViewZones),l=Qj("viewZoneChanged",this._editors.modified.onDidChangeViewZones),u=Qj("hiddenRangesChanged",this._editors.original.onDidChangeHiddenAreas),g=Qj("hiddenRangesChanged",this._editors.modified.onDidChangeHiddenAreas);t.add(Kj((e=>{var t;a.read(e),l.read(e),u.read(e),g.read(e);const i=h.read(e),n=null===(t=null==s?void 0:s.diff.read(e))||void 0===t?void 0:t.mappings;function d(e,t,i){const n=i._getViewModel();return n?e.filter((e=>e.length>0)).map((e=>{const i=n.coordinatesConverter.convertModelPositionToViewPosition(new Va(e.startLineNumber,1)),s=n.coordinatesConverter.convertModelPositionToViewPosition(new Va(e.endLineNumberExclusive,1)),o=s.lineNumber-i.lineNumber;return new OP(i.lineNumber,s.lineNumber,o,t.toString())})):[]}const c=d((n||[]).map((e=>e.lineRangeMapping.original)),i.removeColor,this._editors.original),p=d((n||[]).map((e=>e.lineRangeMapping.modified)),i.insertColor,this._editors.modified);null==o||o.setZones(c),null==r||r.setZones(p)}))),t.add(Kj((e=>{const t=this._rootHeight.read(e),s=this._rootWidth.read(e),a=this._modifiedEditorLayoutInfo.read(e);if(a){const n=$G.ENTIRE_DIFF_OVERVIEW_WIDTH-2*$G.ONE_OVERVIEW_WIDTH;o.setLayout({top:0,height:t,right:n+$G.ONE_OVERVIEW_WIDTH,width:$G.ONE_OVERVIEW_WIDTH}),r.setLayout({top:0,height:t,right:0,width:$G.ONE_OVERVIEW_WIDTH});const s=d.read(e),l=c.read(e),h=this._editors.modified.getOption(102),u=new yD(h.verticalHasArrows?h.arrowSize:0,h.verticalScrollbarSize,0,a.height,l,s);i.setTop(u.getSliderPosition()),i.setHeight(u.getSliderSize())}else i.setTop(0),i.setHeight(0);n.style.height=t+"px",n.style.left=s-$G.ENTIRE_DIFF_OVERVIEW_WIDTH+"px",i.setWidth($G.ENTIRE_DIFF_OVERVIEW_WIDTH)})))})))})))}};YG.ONE_OVERVIEW_WIDTH=15,YG.ENTIRE_DIFF_OVERVIEW_WIDTH=2*$G.ONE_OVERVIEW_WIDTH,YG=$G=GG([ZG(7,P_)],YG);Dp("diffEditor.move.border",{dark:"#8b8b8b9c",light:"#8b8b8b9c",hcDark:"#8b8b8b9c",hcLight:"#8b8b8b9c"},ue(0,"The border color for text that got moved in the diff editor.")),Dp("diffEditor.moveActive.border",{dark:"#FFA500",light:"#FFA500",hcDark:"#FFA500",hcLight:"#FFA500"},ue(0,"The active border color for text that got moved in the diff editor."));class XG extends E{constructor(){super(...arguments),this._id=++XG.idCounter,this._onDidDispose=this._register(new U),this.onDidDispose=this._onDidDispose.event}getId(){return this.getEditorType()+":v2:"+this._id}getVisibleColumnFromPosition(e){return this._targetEditor.getVisibleColumnFromPosition(e)}getPosition(){return this._targetEditor.getPosition()}setPosition(e,t="api"){this._targetEditor.setPosition(e,t)}revealLine(e,t=0){this._targetEditor.revealLine(e,t)}revealLineInCenter(e,t=0){this._targetEditor.revealLineInCenter(e,t)}revealLineInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealLineInCenterIfOutsideViewport(e,t)}revealLineNearTop(e,t=0){this._targetEditor.revealLineNearTop(e,t)}revealPosition(e,t=0){this._targetEditor.revealPosition(e,t)}revealPositionInCenter(e,t=0){this._targetEditor.revealPositionInCenter(e,t)}revealPositionInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealPositionInCenterIfOutsideViewport(e,t)}revealPositionNearTop(e,t=0){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=0){this._targetEditor.revealLines(e,t,i)}revealLinesInCenter(e,t,i=0){this._targetEditor.revealLinesInCenter(e,t,i)}revealLinesInCenterIfOutsideViewport(e,t,i=0){this._targetEditor.revealLinesInCenterIfOutsideViewport(e,t,i)}revealLinesNearTop(e,t,i=0){this._targetEditor.revealLinesNearTop(e,t,i)}revealRange(e,t=0,i=!1,n=!0){this._targetEditor.revealRange(e,t,i,n)}revealRangeInCenter(e,t=0){this._targetEditor.revealRangeInCenter(e,t)}revealRangeInCenterIfOutsideViewport(e,t=0){this._targetEditor.revealRangeInCenterIfOutsideViewport(e,t)}revealRangeNearTop(e,t=0){this._targetEditor.revealRangeNearTop(e,t)}revealRangeNearTopIfOutsideViewport(e,t=0){this._targetEditor.revealRangeNearTopIfOutsideViewport(e,t)}revealRangeAtTop(e,t=0){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)}}XG.idCounter=0;var QG=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},JG=function(e,t){return function(i,n){t(i,n,e)}};let eZ=class extends E{constructor(e,t,i,n,s,o,r){super(),this.originalEditorElement=e,this.modifiedEditorElement=t,this._options=i,this._createInnerEditor=s,this._instantiationService=o,this._keybindingService=r,this._onDidContentSizeChange=this._register(new U),this.original=this._register(this._createLeftHandSideEditor(i.editorOptions.get(),n.originalEditor||{})),this.modified=this._register(this._createRightHandSideEditor(i.editorOptions.get(),n.modifiedEditor||{})),this.modifiedModel=Yj(this.modified.onDidChangeModel,(()=>this.modified.getModel())),this._register(jj({createEmptyChangeSummary:()=>({}),handleChange:(e,t)=>(e.didChange(i.editorOptions)&&Object.assign(t,e.change.changedOptions),!0)},((e,t)=>{i.editorOptions.read(e),this._options.renderSideBySide.read(e),this.modified.updateOptions(this._adjustOptionsForRightHandSide(e,t)),this.original.updateOptions(this._adjustOptionsForLeftHandSide(e,t))})))}_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 s=this._createInnerEditor(e,t,i,n);return this._register(s.onDidContentSizeChange((e=>{const t=this.original.getContentWidth()+this.modified.getContentWidth()+YG.ENTIRE_DIFF_OVERVIEW_WIDTH,i=Math.max(this.modified.getContentHeight(),this.original.getContentHeight());this._onDidContentSizeChange.fire({contentHeight:i,contentWidth:t,contentHeightChanged:e.contentHeightChanged,contentWidthChanged:e.contentWidthChanged})}))),s}_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}),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=ZS.revealHorizontalRightPadding.defaultValue+YG.ENTIRE_DIFF_OVERVIEW_WIDTH,i.scrollbar.verticalHasArrows=!1,i.extraEditorClassName="modified-in-monaco-diff-editor",i}_adjustOptionsForSubEditor(e){const t=Object.assign(Object.assign({},e),{dimension:{height:0,width:0}});return t.inDiffEditor=!0,t.automaticLayout=!1,t.scrollbar=Object.assign({},t.scrollbar||{}),t.scrollbar.vertical="visible",t.folding=!1,t.codeLens=this._options.diffCodeLens.get(),t.fixedOverflowWidgets=!0,t.minimap=Object.assign({},t.minimap||{}),t.minimap.enabled=!1,this._options.hideUnchangedRegions.get()?t.stickyScroll={enabled:!1}:t.stickyScroll=this._options.editorOptions.get().stickyScroll,t}_updateAriaLabel(e){var t;e||(e="");const i=ue(0," use {0} to open the accessibility help.",null===(t=this._keybindingService.lookupKeybinding("editor.action.accessibilityHelp"))||void 0===t?void 0:t.getAriaLabel());return this._options.accessibilityVerbose.get()?e+i:e?e.replaceAll(i,""):""}};eZ=QG([JG(5,Fa),JG(6,WL)],eZ);class tZ{get editorOptions(){return this._options}constructor(e,t){this.diffEditorWidth=t,this.couldShowInlineViewBecauseOfSize=Wj(this,(e=>this._options.read(e).renderSideBySide&&this.diffEditorWidth.read(e)<=this._options.read(e).renderSideBySideInlineBreakpoint)),this.renderOverviewRuler=Wj(this,(e=>this._options.read(e).renderOverviewRuler)),this.renderSideBySide=Wj(this,(e=>this._options.read(e).renderSideBySide&&!(this._options.read(e).useInlineViewWhenSpaceIsLimited&&this.couldShowInlineViewBecauseOfSize.read(e)))),this.readOnly=Wj(this,(e=>this._options.read(e).readOnly)),this.shouldRenderRevertArrows=Wj(this,(e=>!!this._options.read(e).renderMarginRevertIcon&&(!!this.renderSideBySide.read(e)&&!this.readOnly.read(e)))),this.renderIndicators=Wj(this,(e=>this._options.read(e).renderIndicators)),this.enableSplitViewResizing=Wj(this,(e=>this._options.read(e).enableSplitViewResizing)),this.splitViewDefaultRatio=Wj(this,(e=>this._options.read(e).splitViewDefaultRatio)),this.ignoreTrimWhitespace=Wj(this,(e=>this._options.read(e).ignoreTrimWhitespace)),this.maxComputationTimeMs=Wj(this,(e=>this._options.read(e).maxComputationTime)),this.showMoves=Wj(this,(e=>this._options.read(e).experimental.showMoves&&this.renderSideBySide.read(e))),this.isInEmbeddedEditor=Wj(this,(e=>this._options.read(e).isInEmbeddedEditor)),this.diffWordWrap=Wj(this,(e=>this._options.read(e).diffWordWrap)),this.originalEditable=Wj(this,(e=>this._options.read(e).originalEditable)),this.diffCodeLens=Wj(this,(e=>this._options.read(e).diffCodeLens)),this.accessibilityVerbose=Wj(this,(e=>this._options.read(e).accessibilityVerbose)),this.diffAlgorithm=Wj(this,(e=>this._options.read(e).diffAlgorithm)),this.showEmptyDecorations=Wj(this,(e=>this._options.read(e).experimental.showEmptyDecorations)),this.onlyShowAccessibleDiffViewer=Wj(this,(e=>this._options.read(e).onlyShowAccessibleDiffViewer)),this.hideUnchangedRegions=Wj(this,(e=>this._options.read(e).hideUnchangedRegions.enabled)),this.hideUnchangedRegionsRevealLineCount=Wj(this,(e=>this._options.read(e).hideUnchangedRegions.revealLineCount)),this.hideUnchangedRegionsContextLineCount=Wj(this,(e=>this._options.read(e).hideUnchangedRegions.contextLineCount)),this.hideUnchangedRegionsMinimumLineCount=Wj(this,(e=>this._options.read(e).hideUnchangedRegions.minimumLineCount));const i=Object.assign(Object.assign({},e),iZ(e,uS));this._options=Aj(this,i)}updateOptions(e){const t=iZ(e,this._options.get()),i=Object.assign(Object.assign(Object.assign({},this._options.get()),e),t);this._options.set(i,void 0,{changedOptions:e})}}function iZ(e,t){var i,n,s,o,r,a,l,h;return{enableSplitViewResizing:CS(e.enableSplitViewResizing,t.enableSplitViewResizing),splitViewDefaultRatio:LS(e.splitViewDefaultRatio,.5,.1,.9),renderSideBySide:CS(e.renderSideBySide,t.renderSideBySide),renderMarginRevertIcon:CS(e.renderMarginRevertIcon,t.renderMarginRevertIcon),maxComputationTime:yS(e.maxComputationTime,t.maxComputationTime,0,1073741824),maxFileSize:yS(e.maxFileSize,t.maxFileSize,0,1073741824),ignoreTrimWhitespace:CS(e.ignoreTrimWhitespace,t.ignoreTrimWhitespace),renderIndicators:CS(e.renderIndicators,t.renderIndicators),originalEditable:CS(e.originalEditable,t.originalEditable),diffCodeLens:CS(e.diffCodeLens,t.diffCodeLens),renderOverviewRuler:CS(e.renderOverviewRuler,t.renderOverviewRuler),diffWordWrap:xS(e.diffWordWrap,t.diffWordWrap,["off","on","inherit"]),diffAlgorithm:xS(e.diffAlgorithm,t.diffAlgorithm,["legacy","advanced"],{smart:"legacy",experimental:"advanced"}),accessibilityVerbose:CS(e.accessibilityVerbose,t.accessibilityVerbose),experimental:{showMoves:CS(null===(i=e.experimental)||void 0===i?void 0:i.showMoves,t.experimental.showMoves),showEmptyDecorations:CS(null===(n=e.experimental)||void 0===n?void 0:n.showEmptyDecorations,t.experimental.showEmptyDecorations)},hideUnchangedRegions:{enabled:CS(null!==(o=null===(s=e.hideUnchangedRegions)||void 0===s?void 0:s.enabled)&&void 0!==o?o:null===(r=e.experimental)||void 0===r?void 0:r.collapseUnchangedRegions,t.hideUnchangedRegions.enabled),contextLineCount:yS(null===(a=e.hideUnchangedRegions)||void 0===a?void 0:a.contextLineCount,t.hideUnchangedRegions.contextLineCount,0,1073741824),minimumLineCount:yS(null===(l=e.hideUnchangedRegions)||void 0===l?void 0:l.minimumLineCount,t.hideUnchangedRegions.minimumLineCount,0,1073741824),revealLineCount:yS(null===(h=e.hideUnchangedRegions)||void 0===h?void 0:h.revealLineCount,t.hideUnchangedRegions.revealLineCount,0,1073741824)},isInEmbeddedEditor:CS(e.isInEmbeddedEditor,t.isInEmbeddedEditor),onlyShowAccessibleDiffViewer:CS(e.onlyShowAccessibleDiffViewer,t.onlyShowAccessibleDiffViewer),renderSideBySideInlineBreakpoint:yS(e.renderSideBySideInlineBreakpoint,t.renderSideBySideInlineBreakpoint,0,1073741824),useInlineViewWhenSpaceIsLimited:CS(e.useInlineViewWhenSpaceIsLimited,t.useInlineViewWhenSpaceIsLimited)}}var nZ=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},sZ=function(e,t){return function(i,n){t(i,n,e)}};let oZ=class extends XG{constructor(e,t,i,n,s,o,r,a){var l;super(),this._domElement=e,this._parentContextKeyService=n,this._parentInstantiationService=s,this._audioCueService=r,this._editorProgressService=a,this.elements=Ns("div.monaco-diff-editor.side-by-side",{style:{position:"relative",height:"100%"}},[Ns("div.noModificationsOverlay@overlay",{style:{position:"absolute",height:"100%",visibility:"hidden"}},[fs("span",{},"No Changes")]),Ns("div.editor.original@original",{style:{position:"absolute",height:"100%"}}),Ns("div.editor.modified@modified",{style:{position:"absolute",height:"100%"}}),Ns("div.accessibleDiffViewer@accessibleDiffViewer",{style:{position:"absolute",height:"100%"}})]),this._diffModel=this._register(Pj("diffModel",void 0)),this.onDidChangeModel=B.fromObservableLight(this._diffModel),this._contextKeyService=this._register(this._parentContextKeyService.createScoped(this._domElement)),this._instantiationService=this._parentInstantiationService.createChild(new DB([Ol,this._contextKeyService])),this._boundarySashes=Aj(this,void 0),this._accessibleDiffViewerShouldBeVisible=Aj(this,!1),this._accessibleDiffViewerVisible=Wj(this,(e=>!!this._options.onlyShowAccessibleDiffViewer.read(e)||this._accessibleDiffViewerShouldBeVisible.read(e))),this.movedBlocksLinesPart=Aj(this,void 0),this._layoutInfo=Wj(this,(e=>{var t,i,n;const s=this._rootSizeObserver.width.read(e),o=this._rootSizeObserver.height.read(e),r=null===(t=this._sash.read(e))||void 0===t?void 0:t.sashLeft.read(e),a=null!=r?r:Math.max(5,this._editors.original.getLayoutInfo().decorationsLeft),l=s-a-(this._options.renderOverviewRuler.read(e)?YG.ENTIRE_DIFF_OVERVIEW_WIDTH:0),h=a-(null!==(n=null===(i=this.movedBlocksLinesPart.read(e))||void 0===i?void 0:i.width.read(e))&&void 0!==n?n:0);return this.elements.original.style.width=h+"px",this.elements.original.style.left="0px",this.elements.modified.style.width=l+"px",this.elements.modified.style.left=a+"px",this._editors.original.layout({width:h,height:o}),this._editors.modified.layout({width:l,height:o}),{modifiedEditor:this._editors.modified.getLayoutInfo(),originalEditor:this._editors.original.getLayoutInfo()}})),this._diffValue=this._diffModel.map(((e,t)=>null==e?void 0:e.diff.read(t))),this.onDidUpdateDiff=B.fromObservableLight(this._diffValue),o.willCreateDiffEditor(),this._contextKeyService.createKey("isInDiffEditor",!0),this._domElement.appendChild(this.elements.root),this._register(x((()=>this._domElement.removeChild(this.elements.root)))),this._rootSizeObserver=this._register(new g$(this.elements.root,t.dimension)),this._rootSizeObserver.setAutomaticLayout(null!==(l=t.automaticLayout)&&void 0!==l&&l),this._options=new tZ(t,this._rootSizeObserver.width),this._contextKeyService.createKey(Oh.isEmbeddedDiffEditor.key,!1);const h=Oh.isEmbeddedDiffEditor.bindTo(this._contextKeyService);this._register(Kj((e=>{h.set(this._options.isInEmbeddedEditor.read(e))})));const d=Oh.comparingMovedCode.bindTo(this._contextKeyService);this._register(Kj((e=>{var t;d.set(!!(null===(t=this._diffModel.read(e))||void 0===t?void 0:t.movedTextToCompare.read(e)))})));const c=Oh.diffEditorRenderSideBySideInlineBreakpointReached.bindTo(this._contextKeyService);this._register(Kj((e=>{c.set(this._options.couldShowInlineViewBecauseOfSize.read(e))}))),this._editors=this._register(this._instantiationService.createInstance(eZ,this.elements.original,this.elements.modified,this._options,i,((e,t,i,n)=>this._createInnerEditor(e,t,i,n)))),this._sash=Hj(this,((e,t)=>{const i=this._options.renderSideBySide.read(e);if(this.elements.root.classList.toggle("side-by-side",i),!i)return;const n=t.add(new oG(this._options,this.elements.root,{height:this._rootSizeObserver.height,width:this._rootSizeObserver.width.map(((e,t)=>e-(this._options.renderOverviewRuler.read(t)?YG.ENTIRE_DIFF_OVERVIEW_WIDTH:0)))}));return t.add(Kj((e=>{const t=this._boundarySashes.read(e);t&&n.setBoundarySashes(t)}))),n})),this._register(iq(this._sash)),this._register(qj(((e,t)=>{this.unchangedRangesFeature=t.add(this._instantiationService.createInstance(b$(gG,e),this._editors,this._diffModel,this._options))}))),this._register(qj(((e,t)=>{t.add(new(b$(sG,e))(this._editors,this._diffModel,this._options))}))),this._register(qj(((e,t)=>{t.add(this._instantiationService.createInstance(b$(KG,e),this._editors,this._diffModel,this._options,this,(()=>this.unchangedRangesFeature.isUpdatingViewZones)))}))),this._register(qj(((e,t)=>{t.add(this._instantiationService.createInstance(b$(YG,e),this._editors,this.elements.root,this._diffModel,this._rootSizeObserver.width,this._rootSizeObserver.height,this._layoutInfo.map((e=>e.modifiedEditor)),this._options))}))),this._register(qj(((e,t)=>{this._accessibleDiffViewer=t.add(this._register(this._instantiationService.createInstance(b$(T$,e),this.elements.accessibleDiffViewer,this._accessibleDiffViewerVisible,((e,t)=>this._accessibleDiffViewerShouldBeVisible.set(e,t)),this._options.onlyShowAccessibleDiffViewer.map((e=>!e)),this._rootSizeObserver.width,this._rootSizeObserver.height,this._diffModel.map(((e,t)=>{var i;return null===(i=null==e?void 0:e.diff.read(t))||void 0===i?void 0:i.mappings.map((e=>e.lineRangeMapping))})),this._editors)))})));const u=this._accessibleDiffViewerVisible.map((e=>e?"hidden":"visible"));this._register(v$(this.elements.modified,{visibility:u})),this._register(v$(this.elements.original,{visibility:u})),this._createDiffEditorContributions(),o.addDiffEditor(this),this._register(iq(this._layoutInfo)),this._register(qj(((e,t)=>{this.movedBlocksLinesPart.set(t.add(new(b$(tG,e))(this.elements.root,this._diffModel,this._layoutInfo.map((e=>e.originalEditor)),this._layoutInfo.map((e=>e.modifiedEditor)),this._editors)),void 0)}))),this._register(v$(this.elements.overlay,{width:this._layoutInfo.map(((e,t)=>e.originalEditor.width+(this._options.renderSideBySide.read(t)?0:e.modifiedEditor.width))),visibility:Wj((e=>{var t,i;return this._options.hideUnchangedRegions.read(e)&&0===(null===(i=null===(t=this._diffModel.read(e))||void 0===t?void 0:t.diff.read(e))||void 0===i?void 0:i.mappings.length)?"visible":"hidden"}))})),this._register(this._editors.modified.onMouseDown((e=>{var t,i;if(!e.event.rightButton&&e.target.position&&(null===(t=e.target.element)||void 0===t?void 0:t.className.includes("arrow-revert-change"))){const t=e.target.position.lineNumber,n=e.target,s=this._diffModel.get();if(!s)return;const o=null===(i=s.diff.get())||void 0===i?void 0:i.mappings;if(!o)return;const r=o.find((e=>(null==n?void 0:n.detail.afterLineNumber)===e.lineRangeMapping.modified.startLineNumber-1||e.lineRangeMapping.modified.startLineNumber===t));if(!r)return;this.revert(r.lineRangeMapping),e.event.stopPropagation()}}))),this._register(B.runAndSubscribe(this._editors.modified.onDidChangeCursorPosition,(e=>{var t,i;if(3===(null==e?void 0:e.reason)){const n=null===(i=null===(t=this._diffModel.get())||void 0===t?void 0:t.diff.get())||void 0===i?void 0:i.mappings.find((t=>t.lineRangeMapping.modified.contains(e.position.lineNumber)));(null==n?void 0:n.lineRangeMapping.modified.isEmpty)?this._audioCueService.playAudioCue(k$.diffLineDeleted,{source:"diffEditor.cursorPositionChanged"}):(null==n?void 0:n.lineRangeMapping.original.isEmpty)?this._audioCueService.playAudioCue(k$.diffLineInserted,{source:"diffEditor.cursorPositionChanged"}):n&&this._audioCueService.playAudioCue(k$.diffLineModified,{source:"diffEditor.cursorPositionChanged"})}})));const g=this._diffModel.map(((e,t)=>null==e?void 0:e.isDiffUpToDate.read(t)));this._register(qj(((e,t)=>{if(!1===g.read(e)){const e=this._editorProgressService.show(!0,1e3);t.add(x((()=>e.done())))}})))}_createInnerEditor(e,t,i,n){return e.createInstance(eW,t,i,n)}_createDiffEditorContributions(){const e=xh.getDiffEditorContributions();for(const i of e)try{this._register(this._instantiationService.createInstance(i.ctor,this))}catch(t){r(t)}}get _targetEditor(){return this._editors.modified}getEditorType(){return aF.IDiffEditor}layout(e){this._rootSizeObserver.observe(e)}hasTextFocus(){return this._editors.original.hasTextFocus()||this._editors.modified.hasTextFocus()}saveViewState(){var e;return{original:this._editors.original.saveViewState(),modified:this._editors.modified.saveViewState(),modelState:null===(e=this._diffModel.get())||void 0===e?void 0:e.serializeState()}}restoreViewState(e){var t;if(e&&e.original&&e.modified){const i=e;this._editors.original.restoreViewState(i.original),this._editors.modified.restoreViewState(i.modified),i.modelState&&(null===(t=this._diffModel.get())||void 0===t||t.restoreSerializedState(i.modelState))}}createViewModel(e){return this._instantiationService.createInstance(EG,e,this._options,this)}getModel(){var e,t;return null!==(t=null===(e=this._diffModel.get())||void 0===e?void 0:e.model)&&void 0!==t?t:null}setModel(e){!e&&this._diffModel.get()&&this._accessibleDiffViewer.close();const t=e?"model"in e?e:this.createViewModel(e):void 0;this._editors.original.setModel(t?t.model.original:null),this._editors.modified.setModel(t?t.model.modified:null),Ej((e=>{this._diffModel.set(t,e)}))}updateOptions(e){this._options.updateOptions(e)}getContainerDomNode(){return this._domElement}getOriginalEditor(){return this._editors.original}getModifiedEditor(){return this._editors.modified}getLineChanges(){var e;const t=null===(e=this._diffModel.get())||void 0===e?void 0:e.diff.get();return t?t.mappings.map((e=>{const t=e.lineRangeMapping;let i,n,s,o,r=t.innerChanges;return t.original.isEmpty?(i=t.original.startLineNumber-1,n=0,r=void 0):(i=t.original.startLineNumber,n=t.original.endLineNumberExclusive-1),t.modified.isEmpty?(s=t.modified.startLineNumber-1,o=0,r=void 0):(s=t.modified.startLineNumber,o=t.modified.endLineNumberExclusive-1),{originalStartLineNumber:i,originalEndLineNumber:n,modifiedStartLineNumber:s,modifiedEndLineNumber:o,charChanges:null==r?void 0:r.map((e=>({originalStartLineNumber:e.originalRange.startLineNumber,originalStartColumn:e.originalRange.startColumn,originalEndLineNumber:e.originalRange.endLineNumber,originalEndColumn:e.originalRange.endColumn,modifiedStartLineNumber:e.modifiedRange.startLineNumber,modifiedStartColumn:e.modifiedRange.startColumn,modifiedEndLineNumber:e.modifiedRange.endLineNumber,modifiedEndColumn:e.modifiedRange.endColumn})))}})):null}revert(e){var t;const i=null===(t=this._diffModel.get())||void 0===t?void 0:t.model;if(!i)return;const n=e.innerChanges?e.innerChanges.map((e=>({range:e.modifiedRange,text:i.original.getValueInRange(e.originalRange)}))):[{range:e.modified.toExclusiveRange(),text:i.original.getValueInRange(e.original.toExclusiveRange())}];this._editors.modified.executeEdits("diffEditor",n)}accessibleDiffViewerNext(){this._accessibleDiffViewer.next()}accessibleDiffViewerPrev(){this._accessibleDiffViewer.prev()}mapToOtherSide(){var e,t;const i=this._editors.modified.hasWidgetFocus(),n=i?this._editors.modified:this._editors.original,s=i?this._editors.original:this._editors.modified;let o;const r=n.getSelection();if(r){const n=null===(t=null===(e=this._diffModel.get())||void 0===e?void 0:e.diff.get())||void 0===t?void 0:t.mappings.map((e=>i?e.lineRangeMapping.flip():e.lineRangeMapping));if(n){const e=rZ(r.getStartPosition(),n),t=rZ(r.getEndPosition(),n);o=Rh.plusRange(e,t)}}return{destination:s,destinationSelection:o}}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(){var e;const t=null===(e=this._diffModel.get())||void 0===e?void 0:e.unchangedRegions.get();t&&Ej((e=>{for(const i of t)i.collapseAll(e)}))}showAllUnchangedRegions(){var e;const t=null===(e=this._diffModel.get())||void 0===e?void 0:e.unchangedRegions.get();t&&Ej((e=>{for(const i of t)i.showAll(e)}))}};function rZ(e,t){const i=pc(t,(t=>t.original.startLineNumber<=e.lineNumber));if(!i)return Rh.fromPositions(e);if(i.original.endLineNumberExclusive<=e.lineNumber){const t=e.lineNumber-i.original.endLineNumberExclusive+i.modified.endLineNumberExclusive;return Rh.fromPositions(new Va(t,e.column))}if(!i.innerChanges)return Rh.fromPositions(new Va(i.modified.startLineNumber,1));const n=pc(i.innerChanges,(t=>t.originalRange.getStartPosition().isBeforeOrEqual(e)));if(!n){const t=e.lineNumber-i.original.startLineNumber+i.modified.startLineNumber;return Rh.fromPositions(new Va(t,e.column))}if(n.originalRange.containsPosition(e))return n.modifiedRange;{const t=(r=n.originalRange.getEndPosition(),a=e,r.lineNumber===a.lineNumber?new pg(0,a.column-r.column):new pg(a.lineNumber-r.lineNumber,a.column-1));return Rh.fromPositions((s=n.modifiedRange.getEndPosition(),0===(o=t).lineCount?new Va(s.lineNumber,s.column+o.columnCount):new Va(s.lineNumber+o.lineCount,o.columnCount+1)))}var s,o,r,a}oZ=nZ([sZ(3,Ol),sZ(4,Fa),sZ(5,Wa),sZ(6,y$),sZ(7,vL)],oZ);ah(class extends rh{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:{value:ue(0,"Toggle Collapse Unchanged Regions"),original:"Toggle Collapse Unchanged Regions"},icon:Jr.map,toggled:pl.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:pl.has("isInDiffEditor"),menu:{when:pl.has("isInDiffEditor"),id:eh.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(pu),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}});class aZ extends rh{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:{value:ue(0,"Toggle Show Moved Code Blocks"),original:"Toggle Show Moved Code Blocks"},precondition:pl.has("isInDiffEditor")})}run(e,...t){const i=e.get(pu),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}ah(aZ);class lZ extends rh{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:{value:ue(0,"Toggle Use Inline View When Space Is Limited"),original:"Toggle Use Inline View When Space Is Limited"},precondition:pl.has("isInDiffEditor")})}run(e,...t){const i=e.get(pu),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}ah(lZ),nh.appendMenuItem(eh.EditorTitle,{command:{id:(new lZ).desc.id,title:ue(0,"Use Inline View When Space Is Limited"),toggled:pl.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:pl.has("isInDiffEditor")},order:11,group:"1_diff",when:pl.and(Oh.diffEditorRenderSideBySideInlineBreakpointReached,pl.has("isInDiffEditor"))}),nh.appendMenuItem(eh.EditorTitle,{command:{id:(new aZ).desc.id,title:ue(0,"Show Moved Code Blocks"),icon:Jr.move,toggled:bl.create("config.diffEditor.experimental.showMoves",!0),precondition:pl.has("isInDiffEditor")},order:10,group:"1_diff",when:pl.has("isInDiffEditor")});const hZ={value:ue(0,"Diff Editor"),original:"Diff Editor"};ah(class extends wh{constructor(){super({id:"diffEditor.switchSide",title:{value:ue(0,"Switch Side"),original:"Switch Side"},icon:Jr.arrowSwap,precondition:pl.has("isInDiffEditor"),f1:!0,category:hZ})}runEditorCommand(e,t,i){const n=gZ(e);if(n instanceof oZ){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}});ah(class extends wh{constructor(){super({id:"diffEditor.exitCompareMove",title:{value:ue(0,"Exit Compare Move"),original:"Exit Compare Move"},icon:Jr.close,precondition:Oh.comparingMovedCode,f1:!1,category:hZ,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=gZ(e);n instanceof oZ&&n.exitCompareMove()}});ah(class extends wh{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:{value:ue(0,"Collapse All Unchanged Regions"),original:"Collapse All Unchanged Regions"},icon:Jr.fold,precondition:pl.has("isInDiffEditor"),f1:!0,category:hZ})}runEditorCommand(e,t,...i){const n=gZ(e);n instanceof oZ&&n.collapseAllUnchangedRegions()}});ah(class extends wh{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:{value:ue(0,"Show All Unchanged Regions"),original:"Show All Unchanged Regions"},icon:Jr.unfold,precondition:pl.has("isInDiffEditor"),f1:!0,category:hZ})}runEditorCommand(e,t,...i){const n=gZ(e);n instanceof oZ&&n.showAllUnchangedRegions()}});const dZ={value:ue(0,"Accessible Diff Viewer"),original:"Accessible Diff Viewer"};class cZ extends rh{constructor(){super({id:cZ.id,title:{value:ue(0,"Go to Next Difference"),original:"Go to Next Difference"},category:dZ,precondition:pl.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=gZ(e);null==t||t.accessibleDiffViewerNext()}}cZ.id="editor.action.accessibleDiffViewer.next",nh.appendMenuItem(eh.EditorTitle,{command:{id:cZ.id,title:ue(0,"Open Accessible Diff Viewer"),precondition:pl.has("isInDiffEditor")},order:10,group:"2_diff",when:pl.and(Oh.accessibleDiffViewerVisible.negate(),pl.has("isInDiffEditor"))});class uZ extends rh{constructor(){super({id:uZ.id,title:{value:ue(0,"Go to Previous Difference"),original:"Go to Previous Difference"},category:dZ,precondition:pl.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=gZ(e);null==t||t.accessibleDiffViewerPrev()}}function gZ(e){var t;const i=e.get(Wa),n=i.listDiffEditors(),s=null!==(t=i.getFocusedCodeEditor())&&void 0!==t?t:i.getActiveCodeEditor();if(!s)return null;for(let r=0,a=n.length;rthis.selection.endLineNumber?this.targetSelection=new Ah(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):this.targetPosition.lineNumberthis._onEditorMouseDown(e)))),this._register(this._editor.onMouseUp((e=>this._onEditorMouseUp(e)))),this._register(this._editor.onMouseDrag((e=>this._onEditorMouseDrag(e)))),this._register(this._editor.onMouseDrop((e=>this._onEditorMouseDrop(e)))),this._register(this._editor.onMouseDropCanceled((()=>this._onEditorMouseDropCanceled()))),this._register(this._editor.onKeyDown((e=>this.onEditorKeyDown(e)))),this._register(this._editor.onKeyUp((e=>this.onEditorKeyUp(e)))),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(35)&&!this._editor.getOption(22)&&(fZ(e)&&(this._modifierPressed=!0),this._mouseDown&&fZ(e)&&this._editor.updateOptions({mouseStyle:"copy"}))}onEditorKeyUp(e){this._editor.getOption(35)&&!this._editor.getOption(22)&&(fZ(e)&&(this._modifierPressed=!1),this._mouseDown&&e.keyCode===_Z.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(null===this._dragSelection){const e=(this._editor.getSelections()||[]).filter((e=>t.position&&e.containsPosition(t.position)));if(1!==e.length)return;this._dragSelection=e[0]}fZ(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 Va(e.target.position.lineNumber,e.target.position.column);if(null===this._dragSelection){let i=null;if(e.event.shiftKey){const e=this._editor.getSelection();if(e){const{selectionStartLineNumber:n,selectionStartColumn:s}=e;i=[new Ah(n,s,t.lineNumber,t.column)]}}else i=(this._editor.getSelections()||[]).map((e=>e.containsPosition(t)?new Ah(t.lineNumber,t.column,t.lineNumber,t.column):e));this._editor.setSelections(i||[],"mouse",3)}else(!this._dragSelection.containsPosition(t)||(fZ(e.event)||this._modifierPressed)&&(this._dragSelection.getEndPosition().equals(t)||this._dragSelection.getStartPosition().equals(t)))&&(this._editor.pushUndoStop(),this._editor.executeCommand(_Z.ID,new mZ(this._dragSelection,t,fZ(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 Rh(e.lineNumber,e.column,e.lineNumber,e.column),options:_Z._DECORATION_OPTIONS}]),this._editor.revealPosition(e,1)}_removeDecoration(){this._dndDecorationIds.clear()}_hitContent(e){return 6===e.type||7===e.type}_hitMargin(e){return 2===e.type||3===e.type||4===e.type}dispose(){this._removeDecoration(),this._dragSelection=null,this._mouseDown=!1,this._modifierPressed=!1,super.dispose()}}_Z.ID="editor.contrib.dragAndDrop",_Z.TRIGGER_KEY_VALUE=Pe?6:5,_Z._DECORATION_OPTIONS=Iw.register({description:"dnd-target",className:"dnd-target"}),Dh(_Z.ID,_Z,2);var vZ=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},bZ=function(e,t){return function(i,n){t(i,n,e)}},CZ=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class wZ{remove(){var e;null===(e=this.parent)||void 0===e||e.children.delete(this.id)}static findId(e,t){let i;"string"==typeof e?i=`${t.id}/${e}`:(i=`${t.id}/${e.name}`,void 0!==t.children.get(i)&&(i=`${t.id}/${e.name}_${e.range.startLineNumber}_${e.range.startColumn}`));let n=i;for(let s=0;void 0!==t.children.get(n);s++)n=`${i}_${s}`;return n}static empty(e){return 0===e.children.size}}class yZ extends wZ{constructor(e,t,i){super(),this.id=e,this.parent=t,this.symbol=i,this.children=new Map}}class SZ extends wZ{constructor(e,t,i,n){super(),this.id=e,this.parent=t,this.label=i,this.order=n,this.children=new Map}}class LZ extends wZ{static create(e,t,i){const n=new jh(i),s=new LZ(t.uri),o=e.ordered(t),r=o.map(((e,i)=>{var o;const r=wZ.findId(`provider_${i}`,s),l=new SZ(r,s,null!==(o=e.displayName)&&void 0!==o?o:"Unknown Outline Provider",i);return Promise.resolve(e.provideDocumentSymbols(t,n.token)).then((e=>{for(const t of e||[])LZ._makeOutlineElement(t,l);return l}),(e=>(a(e),l))).then((e=>{wZ.empty(e)?e.remove():s._groups.set(r,e)}))})),l=e.onDidChange((()=>{Td(e.ordered(t),o)||n.cancel()}));return Promise.all(r).then((()=>n.token.isCancellationRequested&&!i.isCancellationRequested?LZ.create(e,t,i):s._compact())).finally((()=>{n.dispose(),l.dispose(),n.dispose()}))}static _makeOutlineElement(e,t){const i=wZ.findId(e,t),n=new yZ(i,t,e);if(e.children)for(const s of e.children)LZ._makeOutlineElement(s,n);t.children.set(n.id,n)}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)0===i.children.size?this._groups.delete(t):e+=1;if(1!==e)this.children=this._groups;else{const e=v.first(this._groups.values());for(const[,t]of e.children)t.parent=this,this.children.set(t.id,t)}return this}getTopLevelSymbols(){const e=[];for(const t of this.children.values())t instanceof yZ?e.push(t.symbol):e.push(...v.map(t.children.values(),(e=>e.symbol)));return e.sort(((e,t)=>Rh.compareRangesUsingStarts(e.range,t.range)))}asListOfDocumentSymbols(){const e=this.getTopLevelSymbols(),t=[];return LZ._flattenDocumentSymbols(t,e,""),t.sort(((e,t)=>Va.compare(Rh.getStartPosition(e.range),Rh.getStartPosition(t.range))||Va.compare(Rh.getEndPosition(t.range),Rh.getEndPosition(e.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&&LZ._flattenDocumentSymbols(e,n.children,n.name)}}const kZ=Ba("IOutlineModelService");let DZ=class{constructor(e,t,i){this._languageFeaturesService=e,this._disposables=new N,this._cache=new js(10,.7),this._debounceInformation=t.for(e.documentSymbolProvider,"DocumentSymbols",{min:350}),this._disposables.add(i.onModelRemoved((e=>{this._cache.delete(e.id)})))}dispose(){this._disposables.dispose()}getOrCreate(e,t){return CZ(this,void 0,void 0,(function*(){const i=this._languageFeaturesService.documentSymbolProvider,n=i.ordered(e);let s=this._cache.get(e.id);if(!s||s.versionId!==e.getVersionId()||!Td(s.provider,n)){const t=new jh;s={versionId:e.getVersionId(),provider:n,promiseCnt:0,source:t,promise:LZ.create(i,e,t.token),model:void 0},this._cache.set(e.id,s);const o=Date.now();s.promise.then((t=>{s.model=t,this._debounceInformation.update(e,Date.now()-o)})).catch((t=>{this._cache.delete(e.id)}))}if(s.model)return s.model;s.promiseCnt+=1;const o=t.onCancellationRequested((()=>{0==--s.promiseCnt&&(s.source.cancel(),this._cache.delete(e.id))}));try{return yield s.promise}finally{o.dispose()}}))}};DZ=vZ([bZ(0,oL),bZ(1,SE),bZ(2,Ha)],DZ),yu(kZ,DZ,1);var xZ=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};Xa.registerCommand("_executeDocumentSymbolProvider",(function(e,...t){return xZ(this,void 0,void 0,(function*(){const[i]=t;qr(an.isUri(i));const n=e.get(kZ),s=e.get(za),o=yield s.createModelReference(i);try{return(yield n.getOrCreate(o.object.textEditorModel,Uh.None)).getTopLevelSymbols()}finally{o.dispose()}}))}));const NZ=function(){if("object"==typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID.bind(crypto);let e;e="object"==typeof crypto&&"function"==typeof crypto.getRandomValues?crypto.getRandomValues.bind(crypto):function(e){for(let t=0;tEZ(this,void 0,void 0,(function*(){return e})),asFile:()=>{},value:"string"==typeof e?e:void 0}}class MZ{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 v.some(this,(([e,t])=>t.asFile()))&&t.push("files"),AZ(TZ(e),t)}get(e){var t;return null===(t=this._entries.get(this.toKey(e)))||void 0===t?void 0:t[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 TZ(e)}}function TZ(e){return e.toLowerCase()}function RZ(e,t){return AZ(TZ(e),t.map(TZ))}function AZ(e,t){if("*/*"===e)return t.length>0;if(t.includes(e))return!0;const i=e.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!i)return!1;const[n,s,o]=i;return"*"===o&&t.some((e=>e.startsWith(s+"/")))}const OZ=Object.freeze({create:e=>zd(e.map((e=>e.toString()))).join("\r\n"),split:e=>e.split("\r\n"),parse:e=>OZ.split(e).filter((e=>!e.startsWith("#")))}),PZ="CodeEditors",FZ="CodeFiles";jl.add("workbench.contributions.dragAndDrop",new class{});class BZ{constructor(){}static getInstance(){return BZ.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}}BZ.INSTANCE=new BZ;var WZ=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function VZ(e){const t=new MZ;for(const i of e.items){const e=i.type;if("string"===i.kind){const n=new Promise((e=>i.getAsString(e)));t.append(e,IZ(n))}else if("file"===i.kind){const n=i.getAsFile();n&&t.append(e,HZ(n))}}return t}function HZ(e){const t=e.path?an.parse(e.path):void 0;return function(e,t,i){const n={id:NZ(),name:e,uri:t,data:i};return{asString:()=>EZ(this,void 0,void 0,(function*(){return""})),asFile:()=>n,value:void 0}}(e.name,t,(()=>WZ(this,void 0,void 0,(function*(){return new Uint8Array(yield e.arrayBuffer())}))))}const zZ=Object.freeze([PZ,FZ,aD.RESOURCES,aD.INTERNAL_URI_LIST]);function UZ(e,t=!1){const i=VZ(e),n=i.get(aD.INTERNAL_URI_LIST);if(n)i.replace(Lu.uriList,n);else if(t||!i.has(Lu.uriList)){const t=[];for(const i of e.items){const e=i.getAsFile();if(e){const i=e.path;try{i?t.push(an.file(i).toString()):t.push(an.parse(e.name,!0).toString())}catch(ge){}}}t.length&&i.replace(Lu.uriList,IZ(OZ.create(t)))}for(const s of zZ)i.delete(s);return i}function KZ(e){var t;function i(e,t){return"providerId"in e&&e.providerId===t.providerId||"mimeType"in e&&e.mimeType===t.handledMimeType}const n=new Map;for(const r of e)for(const s of null!==(t=r.yieldTo)&&void 0!==t?t:[])for(const t of e)if(t!==r&&i(s,t)){let e=n.get(r);e||(e=[],n.set(r,e)),e.push(t)}if(!n.size)return Array.from(e);const s=new Set,o=[];return function e(t){if(!t.length)return[];const i=t[0];if(o.includes(i))return console.warn(`Yield to cycle detected for ${i.providerId}`),t;if(s.has(i))return e(t.slice(1));let r=[];const a=n.get(i);return a&&(o.push(i),r=e(a),o.pop()),s.add(i),[...r,i,...e(t.slice(1))]}(Array.from(e))}var jZ=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},qZ=function(e,t){return function(i,n){t(i,n,e)}},$Z=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const GZ=Iw.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:"\xa0",inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}});class ZZ extends E{constructor(e,t,i,n,s){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=s,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=fs(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=fs("span.icon");this.domNode.append(t),t.classList.add(...ta.asClassNameArray(Jr.loading),"codicon-modifier-spin");const i=()=>{const e=this.editor.getOption(66);this.domNode.style.height=`${e}px`,this.domNode.style.width=`${Math.ceil(.8*e)}px`};i(),this._register(this.editor.onDidChangeConfiguration((e=>{(e.hasChanged(52)||e.hasChanged(66))&&i()}))),this._register(En(this.domNode,os.CLICK,(e=>{this.delegate.cancel()})))}getId(){return ZZ.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}}ZZ.baseId="editor.widget.inlineProgressWidget";let YZ=class extends E{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new I),this._currentWidget=new I,this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}showWhile(e,t,i){return $Z(this,void 0,void 0,(function*(){const n=this._operationIdPool++;this._currentOperation=n,this.clear(),this._showPromise.value=id((()=>{const n=Rh.fromPositions(e);this._currentDecorations.set([{range:n,options:GZ}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(ZZ,this.id,this._editor,n,t,i))}),this._showDelay);try{return yield i}finally{this._currentOperation===n&&(this.clear(),this._currentOperation=void 0)}}))}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};YZ=jZ([qZ(2,Fa)],YZ);lc.white.toString(),lc.white.toString();class XZ extends E{get onDidClick(){return this._onDidClick.event}constructor(e,t){super(),this._label="",this._onDidClick=this._register(new U),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")),e.appendChild(this._element),this._register(ZL.addTarget(this._element)),[os.CLICK,$L.Tap].forEach((e=>{this._register(En(this._element,e,(e=>{this.enabled?this._onDidClick.fire(e):as(e)})))})),this._register(En(this._element,os.KEY_DOWN,(e=>{const t=new St(e);let i=!1;this.enabled&&(t.equals(3)||t.equals(10))?(this._onDidClick.fire(e),i=!0):t.equals(9)&&(this._element.blur(),i=!0),i&&as(t,!0)}))),this._register(En(this._element,os.MOUSE_OVER,(e=>{this._element.classList.contains("disabled")||this.updateBackground(!0)}))),this._register(En(this._element,os.MOUSE_OUT,(e=>{this.updateBackground(!1)}))),this.focusTracker=this._register(hs(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 lk(e))if("string"==typeof i){if(i=i.trim(),""===i)continue;const e=document.createElement("span");e.textContent=i,t.push(e)}else t.push(i);return t}updateBackground(e){let t;t=this.options.secondary?e?this.options.buttonSecondaryHoverBackground:this.options.buttonSecondaryBackground:e?this.options.buttonHoverBackground:this.options.buttonBackground,t&&(this._element.style.backgroundColor=t)}get element(){return this._element}set label(e){var t,i,n;if(this._label===e)return;if(Aa(this._label)&&Aa(e)&&((i=this._label)===(n=e)||i&&n&&i.value===n.value&&i.isTrusted===n.isTrusted&&i.supportThemeIcons===n.supportThemeIcons&&i.supportHtml===n.supportHtml&&(i.baseUri===n.baseUri||i.baseUri&&n.baseUri&&ba(an.from(i.baseUri),an.from(n.baseUri)))))return;this._element.classList.add("monaco-text-button");const s=this.options.supportShortLabel?this._labelElement:this._element;if(Aa(e)){const i=vk(e,{inline:!0});i.dispose();const n=null===(t=i.element.querySelector("p"))||void 0===t?void 0:t.innerHTML;if(n){const e=ki(n,{ADD_TAGS:["b","i","u","code","span"],ALLOWED_ATTR:["class"],RETURN_TRUSTED_TYPE:!0});s.innerHTML=e}else us(s)}else this.options.supportIcons?us(s,...this.getContentElements(e)):s.textContent=e;"string"==typeof this.options.title?this._element.title=this.options.title:this.options.title&&(this._element.title=Sk(e)),this._label=e}get label(){return this._label}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")}}var QZ,JZ=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},eY=function(e,t){return function(i,n){t(i,n,e)}},tY=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let iY=QZ=class extends E{constructor(e,t,i,n,s,o,r,a,l,h){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=s,this.edits=o,this.onSelectNewEdit=r,this._contextMenuService=a,this._keybindingService=h,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(l),this.visibleContext.set(!0),this._register(x((()=>this.visibleContext.reset()))),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(x((()=>this.editor.removeContentWidget(this)))),this._register(this.editor.onDidChangeCursorPosition((e=>{s.containsPosition(e.position)||this.dispose()}))),this._register(B.runAndSubscribe(h.onDidUpdateKeybindings,(()=>{this._updateButtonTitle()})))}_updateButtonTitle(){var e;const t=null===(e=this._keybindingService.lookupKeybinding(this.showCommand.id))||void 0===e?void 0:e.getLabel();this.button.element.title=this.showCommand.label+(t?` (${t})`:"")}create(){this.domNode=fs(".post-edit-widget"),this.button=this._register(new XZ(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(En(this.domNode,os.CLICK,(()=>this.showSelector())))}getId(){return QZ.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=Hn(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map(((e,t)=>Za({id:"",label:e.label,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}})))})}};iY.baseId="editor.widget.postEditWidget",iY=QZ=JZ([eY(7,Kx),eY(8,Ol),eY(9,WL)],iY);let nY=class extends E{constructor(e,t,i,n,s,o){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._instantiationService=s,this._bulkEditService=o,this._currentWidget=this._register(new I),this._register(B.any(t.onDidChangeModel,t.onDidChangeModelContent)((()=>this.clear())))}applyEditAndShowIfNeeded(e,t,i,n){var s,o;return tY(this,void 0,void 0,(function*(){const r=this._editor.getModel();if(!r||!e.length)return;const a=t.allEdits[t.activeEditIndex];if(!a)return;let l=[];l=("string"==typeof a.insertText?""===a.insertText:""===a.insertText.snippet)?[]:e.map((e=>new nL(r.uri,"string"==typeof a.insertText?{range:e,text:a.insertText,insertAsSnippet:!1}:{range:e,text:a.insertText.snippet,insertAsSnippet:!0})));const h={edits:[...l,...null!==(o=null===(s=a.additionalEdit)||void 0===s?void 0:s.edits)&&void 0!==o?o:[]]},d=e[0],c=r.deltaDecorations([],[{range:d,options:{description:"paste-line-suffix",stickiness:0}}]);let u,g;try{u=yield this._bulkEditService.apply(h,{editor:this._editor,token:n}),g=r.getDecorationRange(c[0])}finally{r.deltaDecorations(c,[])}i&&u.isApplied&&t.allEdits.length>1&&this.show(null!=g?g:d,t,(s=>tY(this,void 0,void 0,(function*(){const o=this._editor.getModel();o&&(yield o.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:s,allEdits:t.allEdits},i,n))}))))}))}show(e,t,i){this.clear(),this._editor.hasModel()&&(this._currentWidget.value=this._instantiationService.createInstance(iY,this._id,this._editor,this._visibleContext,this._showCommand,e,t,i))}clear(){this._currentWidget.clear()}tryShowSelector(){var e;null===(e=this._currentWidget.value)||void 0===e||e.showSelector()}};nY=JZ([eY(4,Fa),eY(5,tL)],nY);var sY,oY=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},rY=function(e,t){return function(i,n){t(i,n,e)}},aY=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const lY="editor.changePasteType",hY=new Al("pasteWidgetVisible",!1,ue(0,"Whether the paste widget is showing")),dY="application/vnd.code.copyMetadata";let cY=sY=class extends E{static get(e){return e.getContribution(sY.ID)}constructor(e,t,i,n,s,o,r){super(),this._bulkEditService=i,this._clipboardService=n,this._languageFeaturesService=s,this._quickInputService=o,this._progressService=r,this._editor=e;const a=e.getContainerDomNode();this._register(En(a,"copy",(e=>this.handleCopy(e)))),this._register(En(a,"cut",(e=>this.handleCopy(e)))),this._register(En(a,"paste",(e=>this.handlePaste(e)),!0)),this._pasteProgressManager=this._register(new YZ("pasteIntoEditor",e,t)),this._postPasteWidgetManager=this._register(t.createInstance(nY,"pasteIntoEditor",e,hY,{id:lY,label:ue(0,"Show paste options...")}))}changePasteType(){this._postPasteWidgetManager.tryShowSelector()}pasteAs(e){this._editor.focus();try{this._pasteAsActionContext={preferredId:e},Qn().execCommand("paste")}finally{this._pasteAsActionContext=void 0}}isPasteAsEnabled(){return this._editor.getOption(84).enabled&&!this._editor.getOption(90)}handleCopy(e){var t,i;if(!this._editor.hasTextFocus())return;if(We&&this._clipboardService.writeResources([]),!e.clipboardData||!this.isPasteAsEnabled())return;const n=this._editor.getModel(),s=this._editor.getSelections();if(!n||!(null==s?void 0:s.length))return;const o=this._editor.getOption(37);let r=s;const a=1===s.length&&s[0].isEmpty();if(a){if(!o)return;r=[new Rh(r[0].startLineNumber,1,r[0].startLineNumber,1+n.getLineLength(r[0].startLineNumber))]}const l=null===(t=this._editor._getViewModel())||void 0===t?void 0:t.getPlainTextToCopy(s,o,Oe),h={multicursorText:Array.isArray(l)?l:null,pasteOnNewLine:a,mode:null},d=this._languageFeaturesService.documentPasteEditProvider.ordered(n).filter((e=>!!e.prepareDocumentPaste));if(!d.length)return void this.setCopyMetadata(e.clipboardData,{defaultPastePayload:h});const c=VZ(e.clipboardData),u=d.flatMap((e=>{var t;return null!==(t=e.copyMimeTypes)&&void 0!==t?t:[]})),g=NZ();this.setCopyMetadata(e.clipboardData,{id:g,providerCopyMimeTypes:u,defaultPastePayload:h});const p=Yh((e=>aY(this,void 0,void 0,(function*(){const t=Bd(yield Promise.all(d.map((t=>aY(this,void 0,void 0,(function*(){try{return yield t.prepareDocumentPaste(n,r,c,e)}catch(i){return void console.error(i)}}))))));t.reverse();for(const e of t)for(const[t,i]of e)c.replace(t,i);return c}))));null===(i=this._currentCopyOperation)||void 0===i||i.dataTransferPromise.cancel(),this._currentCopyOperation={handle:g,dataTransferPromise:p}}handlePaste(e){var t,i;return aY(this,void 0,void 0,(function*(){if(!e.clipboardData||!this._editor.hasTextFocus())return;null===(t=this._currentPasteOperation)||void 0===t||t.cancel(),this._currentPasteOperation=void 0;const n=this._editor.getModel(),s=this._editor.getSelections();if(!(null==s?void 0:s.length)||!n)return;if(!this.isPasteAsEnabled())return;const o=this.fetchCopyMetadata(e),r=UZ(e.clipboardData);r.delete(dY);const a=[...e.clipboardData.types,...null!==(i=null==o?void 0:o.providerCopyMimeTypes)&&void 0!==i?i:[],Lu.uriList],l=this._languageFeaturesService.documentPasteEditProvider.ordered(n).filter((e=>{var t;return null===(t=e.pasteMimeTypes)||void 0===t?void 0:t.some((e=>RZ(e,a)))}));l.length&&(e.preventDefault(),e.stopImmediatePropagation(),this._pasteAsActionContext?this.showPasteAsPick(this._pasteAsActionContext.preferredId,l,s,r,o):this.doPasteInline(l,s,r,o))}))}doPasteInline(e,t,i,n){const s=Yh((o=>aY(this,void 0,void 0,(function*(){const r=this._editor;if(!r.hasModel())return;const a=r.getModel(),l=new dL(r,3,void 0,o);try{if(yield this.mergeInDataFromCopy(i,n,l.token),l.token.isCancellationRequested)return;const s=e.filter((e=>uY(e,i)));if(!s.length||1===s.length&&"text"===s[0].id)return void(yield this.applyDefaultPasteHandler(i,n,l.token));const o=yield this.getPasteEdits(s,i,a,t,l.token);if(l.token.isCancellationRequested)return;if(1===o.length&&"text"===o[0].providerId)return void(yield this.applyDefaultPasteHandler(i,n,l.token));if(o.length){const e="afterPaste"===r.getOption(84).showPasteSelector;return this._postPasteWidgetManager.applyEditAndShowIfNeeded(t,{activeEditIndex:0,allEdits:o},e,l.token)}yield this.applyDefaultPasteHandler(i,n,l.token)}finally{l.dispose(),this._currentPasteOperation===s&&(this._currentPasteOperation=void 0)}}))));this._pasteProgressManager.showWhile(t[0].getEndPosition(),ue(0,"Running paste handlers. Click to cancel"),s),this._currentPasteOperation=s}showPasteAsPick(e,t,i,n,s){const o=Yh((r=>aY(this,void 0,void 0,(function*(){const a=this._editor;if(!a.hasModel())return;const l=a.getModel(),h=new dL(a,3,void 0,r);try{if(yield this.mergeInDataFromCopy(n,s,h.token),h.token.isCancellationRequested)return;let o=t.filter((e=>uY(e,n)));e&&(o=o.filter((t=>t.id===e)));const r=yield this.getPasteEdits(o,n,l,i,h.token);if(h.token.isCancellationRequested)return;if(!r.length)return;let a;if(e)a=r.at(0);else{const e=yield this._quickInputService.pick(r.map((e=>({label:e.label,description:e.providerId,detail:e.detail,edit:e}))),{placeHolder:ue(0,"Select Paste Action")});a=null==e?void 0:e.edit}if(!a)return;const d=function(e,t,i){var n,s;return{edits:[...t.map((t=>new nL(e,"string"==typeof i.insertText?{range:t,text:i.insertText,insertAsSnippet:!1}:{range:t,text:i.insertText.snippet,insertAsSnippet:!0}))),...null!==(s=null===(n=i.additionalEdit)||void 0===n?void 0:n.edits)&&void 0!==s?s:[]]}}(l.uri,i,a);yield this._bulkEditService.apply(d,{editor:this._editor})}finally{h.dispose(),this._currentPasteOperation===o&&(this._currentPasteOperation=void 0)}}))));this._progressService.withProgress({location:10,title:ue(0,"Running paste handlers")},(()=>o))}setCopyMetadata(e,t){e.setData(dY,JSON.stringify(t))}fetchCopyMetadata(e){var t;if(!e.clipboardData)return;const i=e.clipboardData.getData(dY);if(i)try{return JSON.parse(i)}catch(Vs){return}const[n,s]=Qy.getTextData(e.clipboardData);return s?{defaultPastePayload:{mode:s.mode,multicursorText:null!==(t=s.multicursorText)&&void 0!==t?t:null,pasteOnNewLine:!!s.isFromEmptySelection}}:void 0}mergeInDataFromCopy(e,t,i){var n;return aY(this,void 0,void 0,(function*(){if((null==t?void 0:t.id)&&(null===(n=this._currentCopyOperation)||void 0===n?void 0:n.handle)===t.id){const t=yield this._currentCopyOperation.dataTransferPromise;if(i.isCancellationRequested)return;for(const[i,n]of t)e.replace(i,n)}if(!e.has(Lu.uriList)){const t=yield this._clipboardService.readResources();if(i.isCancellationRequested)return;t.length&&e.append(Lu.uriList,IZ(OZ.create(t)))}}))}getPasteEdits(e,t,i,n,s){return aY(this,void 0,void 0,(function*(){const o=yield Xh(Promise.all(e.map((e=>aY(this,void 0,void 0,(function*(){var o;try{const r=yield null===(o=e.provideDocumentPasteEdits)||void 0===o?void 0:o.call(e,i,n,t,s);if(r)return Object.assign(Object.assign({},r),{providerId:e.id})}catch(r){console.error(r)}}))))),s);return KZ(Bd(null!=o?o:[]))}))}applyDefaultPasteHandler(e,t,i){var n,s,o;return aY(this,void 0,void 0,(function*(){const r=null!==(n=e.get(Lu.text))&&void 0!==n?n:e.get("text");if(!r)return;const a=yield r.asString();if(i.isCancellationRequested)return;const l={text:a,pasteOnNewLine:null!==(s=null==t?void 0:t.defaultPastePayload.pasteOnNewLine)&&void 0!==s&&s,multicursorText:null!==(o=null==t?void 0:t.defaultPastePayload.multicursorText)&&void 0!==o?o:null,mode:null};this._editor.trigger("keyboard","paste",l)}))}};function uY(e,t){var i;return Boolean(null===(i=e.pasteMimeTypes)||void 0===i?void 0:i.some((e=>t.matches(e))))}cY.ID="editor.contrib.copyPasteActionController",cY=sY=oY([rY(1,Fa),rY(2,tL),rY(3,eS),rY(4,oL),rY(5,cE),rY(6,fL)],cY);var gY=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},pY=function(e,t){return function(i,n){t(i,n,e)}},mY=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const fY=ue(0,"Built-in");class _Y{provideDocumentPasteEdits(e,t,i,n){return mY(this,void 0,void 0,(function*(){const e=yield this.getEdit(i,n);return e?{insertText:e.insertText,label:e.label,detail:e.detail,handledMimeType:e.handledMimeType,yieldTo:e.yieldTo}:void 0}))}provideDocumentOnDropEdits(e,t,i,n){return mY(this,void 0,void 0,(function*(){const e=yield this.getEdit(i,n);return e?{insertText:e.insertText,label:e.label,handledMimeType:e.handledMimeType,yieldTo:e.yieldTo}:void 0}))}}class vY extends _Y{constructor(){super(...arguments),this.id="text",this.dropMimeTypes=[Lu.text],this.pasteMimeTypes=[Lu.text]}getEdit(e,t){return mY(this,void 0,void 0,(function*(){const t=e.get(Lu.text);if(!t)return;if(e.has(Lu.uriList))return;const i=yield t.asString();return{handledMimeType:Lu.text,label:ue(0,"Insert Plain Text"),detail:fY,insertText:i}}))}}class bY extends _Y{constructor(){super(...arguments),this.id="uri",this.dropMimeTypes=[Lu.uriList],this.pasteMimeTypes=[Lu.uriList]}getEdit(e,t){return mY(this,void 0,void 0,(function*(){const i=yield wY(e);if(!i.length||t.isCancellationRequested)return;let n=0;const s=i.map((({uri:e,originalText:t})=>e.scheme===vn.file?e.fsPath:(n++,t))).join(" ");let o;return o=n>0?i.length>1?ue(0,"Insert Uris"):ue(0,"Insert Uri"):i.length>1?ue(0,"Insert Paths"):ue(0,"Insert Path"),{handledMimeType:Lu.uriList,insertText:s,label:o,detail:fY}}))}}let CY=class extends _Y{constructor(e){super(),this._workspaceContextService=e,this.id="relativePath",this.dropMimeTypes=[Lu.uriList],this.pasteMimeTypes=[Lu.uriList]}getEdit(e,t){return mY(this,void 0,void 0,(function*(){const i=yield wY(e);if(!i.length||t.isCancellationRequested)return;const n=Bd(i.map((({uri:e})=>{const t=this._workspaceContextService.getWorkspaceFolder(e);return t?Da(t.uri,e):void 0})));return n.length?{handledMimeType:Lu.uriList,insertText:n.join(" "),label:i.length>1?ue(0,"Insert Relative Paths"):ue(0,"Insert Relative Path"),detail:fY}:void 0}))}};function wY(e){return mY(this,void 0,void 0,(function*(){const t=e.get(Lu.uriList);if(!t)return[];const i=yield t.asString(),n=[];for(const e of OZ.parse(i))try{n.push({uri:an.parse(e),originalText:e})}catch(ge){}return n}))}CY=gY([pY(0,$q)],CY);let yY=class extends E{constructor(e,t){super(),this._register(e.documentOnDropEditProvider.register("*",new vY)),this._register(e.documentOnDropEditProvider.register("*",new bY)),this._register(e.documentOnDropEditProvider.register("*",new CY(t)))}};yY=gY([pY(0,oL),pY(1,$q)],yY);let SY=class extends E{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new vY)),this._register(e.documentPasteEditProvider.register("*",new bY)),this._register(e.documentPasteEditProvider.register("*",new CY(t)))}};SY=gY([pY(0,oL),pY(1,$q)],SY),Dh(cY.ID,cY,0),ET(SY),Sh(new class extends vh{constructor(){super({id:lY,precondition:hY,kbOpts:{weight:100,primary:2137}})}runEditorCommand(e,t,i){var n;return null===(n=cY.get(t))||void 0===n?void 0:n.changePasteType()}}),Lh(class extends bh{constructor(){super({id:"editor.action.pasteAs",label:ue(0,"Paste As..."),alias:"Paste As...",precondition:void 0,description:{description:"Paste as",args:[{name:"args",schema:{type:"object",properties:{id:{type:"string",description:ue(0,"The id of the paste edit to try applying. If not provided, the editor will show a picker.")}}}}]}})}run(e,t,i){var n;const s="string"==typeof(null==i?void 0:i.id)?i.id:void 0;return null===(n=cY.get(t))||void 0===n?void 0:n.pasteAs(s)}});class LY{constructor(e){this.identifier=e}}const kY=Ba("treeViewsDndService");yu(kY,class{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}}},1);var DY,xY=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},NY=function(e,t){return function(i,n){t(i,n,e)}},EY=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const IY="editor.experimental.dropIntoEditor.defaultProvider",MY="editor.changeDropType",TY=new Al("dropWidgetVisible",!1,ue(0,"Whether the drop widget is showing"));let RY=DY=class extends E{static get(e){return e.getContribution(DY.ID)}constructor(e,t,i,n,s){super(),this._configService=i,this._languageFeaturesService=n,this._treeViewsDragAndDropService=s,this.treeItemsTransfer=BZ.getInstance(),this._dropProgressManager=this._register(t.createInstance(YZ,"dropIntoEditor",e)),this._postDropWidgetManager=this._register(t.createInstance(nY,"dropIntoEditor",e,TY,{id:MY,label:ue(0,"Show drop options...")})),this._register(e.onDropIntoEditor((t=>this.onDropIntoEditor(e,t.position,t.event))))}changeDropType(){this._postDropWidgetManager.tryShowSelector()}onDropIntoEditor(e,t,i){var n;return EY(this,void 0,void 0,(function*(){if(!i.dataTransfer||!e.hasModel())return;null===(n=this._currentOperation)||void 0===n||n.cancel(),e.focus(),e.setPosition(t);const s=Yh((n=>EY(this,void 0,void 0,(function*(){const o=new dL(e,1,void 0,n);try{const s=yield this.extractDataTransferData(i);if(0===s.size||o.token.isCancellationRequested)return;const r=e.getModel();if(!r)return;const a=this._languageFeaturesService.documentOnDropEditProvider.ordered(r).filter((e=>!e.dropMimeTypes||e.dropMimeTypes.some((e=>s.matches(e))))),l=yield this.getDropEdits(a,r,t,s,o);if(o.token.isCancellationRequested)return;if(l.length){const i=this.getInitialActiveEditIndex(r,l),s="afterDrop"===e.getOption(36).showDropSelector;yield this._postDropWidgetManager.applyEditAndShowIfNeeded([Rh.fromPositions(t)],{activeEditIndex:i,allEdits:l},s,n)}}finally{o.dispose(),this._currentOperation===s&&(this._currentOperation=void 0)}}))));this._dropProgressManager.showWhile(t,ue(0,"Running drop handlers. Click to cancel"),s),this._currentOperation=s}))}getDropEdits(e,t,i,n,s){return EY(this,void 0,void 0,(function*(){const o=yield Xh(Promise.all(e.map((e=>EY(this,void 0,void 0,(function*(){try{const o=yield e.provideDocumentOnDropEdits(t,i,n,s.token);if(o)return Object.assign(Object.assign({},o),{providerId:e.id})}catch(o){console.error(o)}}))))),s.token);return KZ(Bd(null!=o?o:[]))}))}getInitialActiveEditIndex(e,t){const i=this._configService.getValue(IY,{resource:e.uri});for(const[n,s]of Object.entries(i)){const e=t.findIndex((e=>s===e.providerId&&e.handledMimeType&&RZ(n,[e.handledMimeType])));if(e>=0)return e}return 0}extractDataTransferData(e){return EY(this,void 0,void 0,(function*(){if(!e.dataTransfer)return new MZ;const t=UZ(e.dataTransfer);if(this.treeItemsTransfer.hasData(LY.prototype)){const e=this.treeItemsTransfer.getData(LY.prototype);if(Array.isArray(e))for(const i of e){const e=yield this._treeViewsDragAndDropService.removeDragOperationTransfer(i.identifier);if(e)for(const[i,n]of e)t.replace(i,n)}}return t}))}};RY.ID="editor.contrib.dropIntoEditorController",RY=DY=xY([NY(1,Fa),NY(2,pu),NY(3,oL),NY(4,kY)],RY),Dh(RY.ID,RY,2),Sh(new class extends vh{constructor(){super({id:MY,precondition:TY,kbOpts:{weight:100,primary:2137}})}runEditorCommand(e,t,i){var n;null===(n=RY.get(t))||void 0===n||n.changeDropType()}}),ET(yY),jl.as(xu).registerConfiguration(Object.assign(Object.assign({},YS),{properties:{[IY]:{type:"object",scope:5,description:ue(0,"Configures the default drop provider to use for content of a given mime type."),default:{},additionalProperties:{type:"string"}}}}));class AY{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((e=>this._editor.getModel().getDecorationRange(e))).filter((e=>!!e));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(null!==this._highlightedDecorationId&&(e.changeDecorationOptions(this._highlightedDecorationId,AY._FIND_MATCH_DECORATION),this._highlightedDecorationId=null),null!==t&&(this._highlightedDecorationId=t,e.changeDecorationOptions(this._highlightedDecorationId,AY._CURRENT_FIND_MATCH_DECORATION)),null!==this._rangeHighlightDecorationId&&(e.removeDecoration(this._rangeHighlightDecorationId),this._rangeHighlightDecorationId=null),null!==t){let i=this._editor.getModel().getDecorationRange(t);if(i.startLineNumber!==i.endLineNumber&&1===i.endColumn){const e=i.endLineNumber-1,t=this._editor.getModel().getLineMaxColumn(e);i=new Rh(i.startLineNumber,i.startColumn,e,t)}this._rangeHighlightDecorationId=e.addDecoration(i,AY._RANGE_HIGHLIGHT_DECORATION)}})),i}set(e,t){this._editor.changeDecorations((i=>{let n=AY._FIND_MATCH_DECORATION;const s=[];if(e.length>1e3){n=AY._FIND_MATCH_NO_OVERVIEW_DECORATION;const t=this._editor.getModel().getLineCount(),i=this._editor.getLayoutInfo().height/t,o=Math.max(2,Math.ceil(3/i));let r=e[0].range.startLineNumber,a=e[0].range.endLineNumber;for(let n=1,l=e.length;n=t.startLineNumber?t.endLineNumber>a&&(a=t.endLineNumber):(s.push({range:new Rh(r,1,a,1),options:AY._FIND_MATCH_ONLY_OVERVIEW_DECORATION}),r=t.startLineNumber,a=t.endLineNumber)}s.push({range:new Rh(r,1,a,1),options:AY._FIND_MATCH_ONLY_OVERVIEW_DECORATION})}const o=new Array(e.length);for(let t=0,r=e.length;ti.removeDecoration(e))),this._findScopeDecorationIds=[]),(null==t?void 0:t.length)&&(this._findScopeDecorationIds=t.map((e=>i.addDecoration(e,AY._FIND_SCOPE_DECORATION))))}))}matchBeforePosition(e){if(0===this._decorations.length)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(0===this._decorations.length)return null;for(let t=0,i=this._decorations.length;te.lineNumber)return n;if(!(n.startColumn0){const e=[];for(let t=0;tRh.compareRangesUsingStarts(e.range,t.range)));const i=[];let n=e[0];for(let t=1;t0?t[0].toUpperCase()+t.substr(1):e[0][0].toUpperCase()!==e[0][0]&&t.length>0?t[0].toLowerCase()+t.substr(1):t}return t}function FY(e,t,i){return-1!==e[0].indexOf(i)&&-1!==t.indexOf(i)&&e[0].split(i).length===t.split(i).length}function BY(e,t,i){const n=t.split(i),s=e[0].split(i);let o="";return n.forEach(((e,t)=>{o+=PY([s[t]],e)+i})),o.slice(0,-1)}class WY{constructor(e){this.staticValue=e,this.kind=0}}class VY{constructor(e){this.pieces=e,this.kind=1}}class HY{static fromStaticValue(e){return new HY([zY.staticValue(e)])}get hasReplacementPatterns(){return 1===this._state.kind}constructor(e){e&&0!==e.length?1===e.length&&null!==e[0].staticValue?this._state=new WY(e[0].staticValue):this._state=new VY(e):this._state=new WY("")}buildReplaceString(e,t){if(0===this._state.kind)return t?PY(e,this._state.staticValue):this._state.staticValue;let i="";for(let n=0,s=this._state.pieces.length;n0){const e=[],i=t.caseOps.length;let n=0;for(let o=0,r=s.length;o=i){e.push(s.slice(o));break}switch(t.caseOps[n]){case"U":e.push(s[o].toUpperCase());break;case"u":e.push(s[o].toUpperCase()),n++;break;case"L":e.push(s[o].toLowerCase());break;case"l":e.push(s[o].toLowerCase()),n++;break;default:e.push(s[o])}}s=e.join("")}i+=s}return i}static _substitute(e,t){if(null===t)return"";if(0===e)return t[0];let i="";for(;e>0;){if(ethis.research(!1)),100),this._toDispose.add(this._updateDecorationsScheduler),this._toDispose.add(this._editor.onDidChangeCursorPosition((e=>{3!==e.reason&&5!==e.reason&&6!==e.reason||this._decorations.setStartPosition(this._editor.getPosition())}))),this._ignoreModelContentChanged=!1,this._toDispose.add(this._editor.onDidChangeModelContent((e=>{this._ignoreModelContentChanged||(e.isFlush&&this._decorations.reset(),this._decorations.setStartPosition(this._editor.getPosition()),this._updateDecorationsScheduler.schedule())}))),this._toDispose.add(this._state.onFindReplaceStateChange((e=>this._onStateChanged(e)))),this.research(!1,this._state.searchScope)}dispose(){this._isDisposed=!0,k(this._startSearchingTimer),this._toDispose.dispose()}_onStateChanged(e){if(!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)}),240)):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;void 0!==t?null!==t&&(i=Array.isArray(t)?t:[t]):i=this._decorations.getFindScopes(),null!==i&&(i=i.map((e=>{if(e.startLineNumber!==e.endLineNumber){let t=e.endLineNumber;return 1===e.endColumn&&(t-=1),new Rh(e.startLineNumber,1,t,this._editor.getModel().getLineMaxColumn(t))}return e})));const n=this._findMatches(i,!1,fX);this._decorations.set(n,i);const s=this._editor.getSelection();let o=this._decorations.getCurrentMatchesPosition(s);if(0===o&&n.length>0){const e=_c(n.map((e=>e.range)),(e=>Rh.compareRangesUsingStarts(e,s)>=0));o=e>0?e-1+1:o}this._state.changeMatchInfo(o,this._decorations.getCount(),void 0),e&&this._editor.getOption(41).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,0),!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,0)}_prevSearchPosition(e){const t=this._state.isRegex&&(this._state.searchString.indexOf("^")>=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:n}=e;const s=this._editor.getModel();return t||1===n?(1===i?i=s.getLineCount():i--,n=s.getLineMaxColumn(i)):n--,new Va(i,n)}_moveToPrevMatch(e,t=!1){if(!this._state.canNavigateBack()){const t=this._decorations.matchAfterPosition(e);return void(t&&this._setCurrentFindMatch(t))}if(this._decorations.getCount()=0||this._state.searchString.indexOf("$")>=0);let{lineNumber:i,column:n}=e;const s=this._editor.getModel();return t||n===s.getLineMaxColumn(i)?(i===s.getLineCount()?i=1:i++,n=1):n++,new Va(i,n)}_moveToNextMatch(e){if(!this._state.canNavigateForward()){const t=this._decorations.matchBeforePosition(e);return void(t&&this._setCurrentFindMatch(t))}if(this._decorations.getCount()=s)break;const o=e.charCodeAt(n);if(36===o){i.emitUnchanged(n-1),i.emitStatic("$",n+1);continue}if(48===o||38===o){i.emitUnchanged(n-1),i.emitMatchIndex(0,n+1,t),t.length=0;continue}if(49<=o&&o<=57){let r=o-48;if(n+1=s)break;const o=e.charCodeAt(n);switch(o){case 92:i.emitUnchanged(n-1),i.emitStatic("\\",n+1);break;case 110:i.emitUnchanged(n-1),i.emitStatic("\n",n+1);break;case 116:i.emitUnchanged(n-1),i.emitStatic("\t",n+1);break;case 117:case 85:case 108:case 76:i.emitUnchanged(n-1),i.emitStatic("",n+1),t.push(String.fromCharCode(o))}}}return i.finalize()}(this._state.replaceString):HY.fromStaticValue(this._state.replaceString)}replace(){if(!this._hasMatches())return;const e=this._getReplacePattern(),t=this._editor.getSelection(),i=this._getNextMatch(t.getStartPosition(),!0,!1);if(i)if(t.equalsRange(i.range)){const n=e.buildReplaceString(i.matches,this._state.preserveCase),s=new Xw(t,n);this._executeEditorCommand("replace",s),this._decorations.setStartPosition(new Va(t.startLineNumber,t.startColumn+n.length)),this.research(!0)}else this._decorations.setStartPosition(this._editor.getPosition()),this._setCurrentFindMatch(i.range)}_findMatches(e,t,i){const n=(e||[null]).map((e=>_X._getSearchRange(this._editor.getModel(),e)));return this._editor.getModel().findMatches(this._state.searchString,n,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null,t,i)}replaceAll(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();null===e&&this._state.matchesCount>=fX?this._largeReplaceAll():this._regularReplaceAll(e),this.research(!1)}_largeReplaceAll(){const e=new Zb(this._state.searchString,this._state.isRegex,this._state.matchCase,this._state.wholeWord?this._editor.getOption(129):null).parseSearchRequest();if(!e)return;let t=e.regex;if(!t.multiline){let e="mu";t.ignoreCase&&(e+="i"),t.global&&(e+="g"),t=new RegExp(t.source,e)}const i=this._editor.getModel(),n=i.getValue(1),s=i.getFullModelRange(),o=this._getReplacePattern();let r;const a=this._state.preserveCase;r=o.hasReplacementPatterns||a?n.replace(t,(function(){return o.buildReplaceString(arguments,a)})):n.replace(t,o.buildReplaceString(null,a));const l=new ty(s,r,this._editor.getSelection());this._executeEditorCommand("replaceAll",l)}_regularReplaceAll(e){const t=this._getReplacePattern(),i=this._findMatches(e,t.hasReplacementPatterns||this._state.preserveCase,1073741824),n=[];for(let o=0,r=i.length;oe.range)),n);this._executeEditorCommand("replaceAll",s)}selectAllMatches(){if(!this._hasMatches())return;const e=this._decorations.getFindScopes();let t=this._findMatches(e,!1,1073741824).map((e=>new Ah(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn)));const i=this._editor.getSelection();for(let n=0,s=t.length;nthis._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:Sp(Wp),inputActiveOptionForeground:Sp(Hp),inputActiveOptionBackground:Sp(Vp)};this.caseSensitive=this._register(new yV(Object.assign({appendTitle:this._keybindingLabelFor(lX),isChecked:this._state.matchCase},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 SV(Object.assign({appendTitle:this._keybindingLabelFor(hX),isChecked:this._state.wholeWord},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 LV(Object.assign({appendTitle:this._keybindingLabelFor(dX),isChecked:this._state.isRegex},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((e=>{let t=!1;e.isRegex&&(this.regex.checked=this._state.isRegex,t=!0),e.wholeWord&&(this.wholeWords.checked=this._state.wholeWord,t=!0),e.matchCase&&(this.caseSensitive.checked=this._state.matchCase,t=!0),!this._state.isRevealed&&t&&this._revealTemporarily()}))),this._register(En(this._domNode,os.MOUSE_LEAVE,(e=>this._onMouseLeave()))),this._register(En(this._domNode,"mouseover",(e=>this._onMouseOver())))}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}dispose(){this._editor.removeOverlayWidget(this),super.dispose()}getId(){return vX.ID}getDomNode(){return this._domNode}getPosition(){return{preference:0}}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")}}function bX(e,t){return 1===e||2!==e&&t}vX.ID="editor.contrib.findOptionsWidget";class CX extends E{get searchString(){return this._searchString}get replaceString(){return this._replaceString}get isRevealed(){return this._isRevealed}get isReplaceRevealed(){return this._isReplaceRevealed}get isRegex(){return bX(this._isRegexOverride,this._isRegex)}get wholeWord(){return bX(this._wholeWordOverride,this._wholeWord)}get matchCase(){return bX(this._matchCaseOverride,this._matchCase)}get preserveCase(){return bX(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}constructor(){super(),this._onFindReplaceStateChange=this._register(new U),this.onFindReplaceStateChange=this._onFindReplaceStateChange.event,this._searchString="",this._replaceString="",this._isRevealed=!1,this._isReplaceRevealed=!1,this._isRegex=!1,this._isRegexOverride=0,this._wholeWord=!1,this._wholeWordOverride=0,this._matchCase=!1,this._matchCaseOverride=0,this._preserveCase=!1,this._preserveCaseOverride=0,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 s=!1;0===t&&(e=0),e>t&&(e=t),this._matchesPosition!==e&&(this._matchesPosition=e,n.matchesPosition=!0,s=!0),this._matchesCount!==t&&(this._matchesCount=t,n.matchesCount=!0,s=!0),void 0!==i&&(Rh.equalsRange(this._currentMatch,i)||(this._currentMatch=i,n.currentMatch=!0,s=!0)),s&&this._onFindReplaceStateChange.fire(n)}change(e,t,i=!0){var n;const s={moveCursor:t,updateHistory:i,searchString:!1,replaceString:!1,isRevealed:!1,isReplaceRevealed:!1,isRegex:!1,wholeWord:!1,matchCase:!1,preserveCase:!1,searchScope:!1,matchesPosition:!1,matchesCount:!1,currentMatch:!1,loop:!1,isSearching:!1,filters:!1};let o=!1;const r=this.isRegex,a=this.wholeWord,l=this.matchCase,h=this.preserveCase;void 0!==e.searchString&&this._searchString!==e.searchString&&(this._searchString=e.searchString,s.searchString=!0,o=!0),void 0!==e.replaceString&&this._replaceString!==e.replaceString&&(this._replaceString=e.replaceString,s.replaceString=!0,o=!0),void 0!==e.isRevealed&&this._isRevealed!==e.isRevealed&&(this._isRevealed=e.isRevealed,s.isRevealed=!0,o=!0),void 0!==e.isReplaceRevealed&&this._isReplaceRevealed!==e.isReplaceRevealed&&(this._isReplaceRevealed=e.isReplaceRevealed,s.isReplaceRevealed=!0,o=!0),void 0!==e.isRegex&&(this._isRegex=e.isRegex),void 0!==e.wholeWord&&(this._wholeWord=e.wholeWord),void 0!==e.matchCase&&(this._matchCase=e.matchCase),void 0!==e.preserveCase&&(this._preserveCase=e.preserveCase),void 0!==e.searchScope&&((null===(n=e.searchScope)||void 0===n?void 0:n.every((e=>{var t;return null===(t=this._searchScope)||void 0===t?void 0:t.some((t=>!Rh.equalsRange(t,e)))})))||(this._searchScope=e.searchScope,s.searchScope=!0,o=!0)),void 0!==e.loop&&this._loop!==e.loop&&(this._loop=e.loop,s.loop=!0,o=!0),void 0!==e.isSearching&&this._isSearching!==e.isSearching&&(this._isSearching=e.isSearching,s.isSearching=!0,o=!0),void 0!==e.filters&&(this._filters?this._filters.update(e.filters):this._filters=e.filters,s.filters=!0,o=!0),this._isRegexOverride=void 0!==e.isRegexOverride?e.isRegexOverride:0,this._wholeWordOverride=void 0!==e.wholeWordOverride?e.wholeWordOverride:0,this._matchCaseOverride=void 0!==e.matchCaseOverride?e.matchCaseOverride:0,this._preserveCaseOverride=void 0!==e.preserveCaseOverride?e.preserveCaseOverride:0,r!==this.isRegex&&(o=!0,s.isRegex=!0),a!==this.wholeWord&&(o=!0,s.wholeWord=!0),l!==this.matchCase&&(o=!0,s.matchCase=!0),h!==this.preserveCase&&(o=!0,s.preserveCase=!0),o&&this._onFindReplaceStateChange.fire(s)}canNavigateBack(){return this.canNavigateInLoop()||1!==this.matchesPosition}canNavigateForward(){return this.canNavigateInLoop()||this.matchesPosition=fX}}const wX=ue(0,"input"),yX=ue(0,"Preserve Case");class SX extends vV{constructor(e){super({icon:Jr.preserveCase,title:yX+e.appendTitle,isChecked:e.isChecked,inputActiveOptionBorder:e.inputActiveOptionBorder,inputActiveOptionForeground:e.inputActiveOptionForeground,inputActiveOptionBackground:e.inputActiveOptionBackground})}}class LX extends _D{constructor(e,t,i,n){super(),this._showOptionButtons=i,this.fixFocusOnOptionClickEnabled=!0,this.cachedOptionsWidth=0,this._onDidOptionChange=this._register(new U),this.onDidOptionChange=this._onDidOptionChange.event,this._onKeyDown=this._register(new U),this.onKeyDown=this._onKeyDown.event,this._onMouseDown=this._register(new U),this._onInput=this._register(new U),this._onKeyUp=this._register(new U),this._onPreserveCaseKeyDown=this._register(new U),this.onPreserveCaseKeyDown=this._onPreserveCaseKeyDown.event,this.contextViewProvider=t,this.placeholder=n.placeholder||"",this.validation=n.validation,this.label=n.label||wX;const s=n.appendPreserveCaseLabel||"",o=n.history||[],r=!!n.flexibleHeight,a=!!n.flexibleWidth,l=n.flexibleMaxHeight;this.domNode=document.createElement("div"),this.domNode.classList.add("monaco-findInput"),this.inputBox=this._register(new EV(this.domNode,this.contextViewProvider,{ariaLabel:this.label||"",placeholder:this.placeholder||"",validationOptions:{validation:this.validation},history:o,showHistoryHint:n.showHistoryHint,flexibleHeight:r,flexibleWidth:a,flexibleMaxHeight:l,inputBoxStyles:n.inputBoxStyles})),this.preserveCase=this._register(new SX(Object.assign({appendTitle:s,isChecked:!1},n.toggleStyles))),this._register(this.preserveCase.onChange((e=>{this._onDidOptionChange.fire(e),!e&&this.fixFocusOnOptionClickEnabled&&this.inputBox.focus(),this.validate()}))),this._register(this.preserveCase.onKeyDown((e=>{this._onPreserveCaseKeyDown.fire(e)}))),this._showOptionButtons?this.cachedOptionsWidth=this.preserveCase.width():this.cachedOptionsWidth=0;const h=[this.preserveCase.domNode];this.onkeydown(this.domNode,(e=>{if(e.equals(15)||e.equals(17)||e.equals(9)){const t=h.indexOf(document.activeElement);if(t>=0){let i=-1;e.equals(17)?i=(t+1)%h.length:e.equals(15)&&(i=0===t?h.length-1:t-1),e.equals(9)?(h[t].blur(),this.inputBox.focus()):i>=0&&h[i].focus(),as(e,!0)}}}));const d=document.createElement("div");d.className="controls",d.style.display=this._showOptionButtons?"block":"none",d.appendChild(this.preserveCase.domNode),this.domNode.appendChild(d),null==e||e.appendChild(this.domNode),this.onkeydown(this.inputBox.inputElement,(e=>this._onKeyDown.fire(e))),this.onkeyup(this.inputBox.inputElement,(e=>this._onKeyUp.fire(e))),this.oninput(this.inputBox.inputElement,(e=>this._onInput.fire())),this.onmousedown(this.inputBox.inputElement,(e=>this._onMouseDown.fire(e)))}enable(){this.domNode.classList.remove("disabled"),this.inputBox.enable(),this.preserveCase.enable()}disable(){this.domNode.classList.add("disabled"),this.inputBox.disable(),this.preserveCase.disable()}setEnabled(e){e?this.enable():this.disable()}select(){this.inputBox.select()}focus(){this.inputBox.focus()}getPreserveCase(){return this.preserveCase.checked}setPreserveCase(e){this.preserveCase.checked=e}focusOnPreserve(){this.preserveCase.focus()}validate(){var e;null===(e=this.inputBox)||void 0===e||e.validate()}set width(e){this.inputBox.paddingRight=this.cachedOptionsWidth,this.domNode.style.width=e+"px"}dispose(){super.dispose()}}var kX=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},DX=function(e,t){return function(i,n){t(i,n,e)}};const xX=new Al("suggestWidgetVisible",!1,ue(0,"Whether suggestion are visible")),NX="historyNavigationWidgetFocus",EX="historyNavigationForwardsEnabled",IX="historyNavigationBackwardsEnabled";let MX;const TX=[];function RX(e,t){if(TX.includes(t))throw new Error("Cannot register the same widget multiple times");TX.push(t);const i=new N,n=new Al(NX,!1).bindTo(e),s=new Al(EX,!0).bindTo(e),o=new Al(IX,!0).bindTo(e),r=()=>{n.set(!0),MX=t},a=()=>{n.set(!1),MX===t&&(MX=void 0)};return t.element===document.activeElement&&r(),i.add(t.onDidFocus((()=>r()))),i.add(t.onDidBlur((()=>a()))),i.add(x((()=>{TX.splice(TX.indexOf(t),1),a()}))),{historyNavigationForwardsEnablement:s,historyNavigationBackwardsEnablement:o,dispose(){i.dispose()}}}let AX=class extends MV{constructor(e,t,i,n){super(e,t,i);const s=this._register(n.createScoped(this.inputBox.element));this._register(RX(s,this.inputBox))}};AX=kX([DX(3,Ol)],AX);let OX=class extends LX{constructor(e,t,i,n,s=!1){super(e,t,s,i);const o=this._register(n.createScoped(this.inputBox.element));this._register(RX(o,this.inputBox))}};function PX(e){var t,i;return"Up"===(null===(t=e.lookupKeybinding("history.showPrevious"))||void 0===t?void 0:t.getElectronAccelerator())&&"Down"===(null===(i=e.lookupKeybinding("history.showNext"))||void 0===i?void 0:i.getElectronAccelerator())}OX=kX([DX(3,Ol)],OX),$l.registerCommandAndKeybindingRule({id:"history.showPrevious",weight:200,when:pl.and(pl.has(NX),pl.equals(IX,!0),pl.not("isComposing"),xX.isEqualTo(!1)),primary:16,secondary:[528],handler:e=>{null==MX||MX.showPreviousValue()}}),$l.registerCommandAndKeybindingRule({id:"history.showNext",weight:200,when:pl.and(pl.has(NX),pl.equals(EX,!0),pl.not("isComposing"),xX.isEqualTo(!1)),primary:18,secondary:[530],handler:e=>{null==MX||MX.showNextValue()}});var FX=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const BX=tR("find-selection",Jr.selection,ue(0,"Icon for 'Find in Selection' in the editor find widget.")),WX=tR("find-collapsed",Jr.chevronRight,ue(0,"Icon to indicate that the editor find widget is collapsed.")),VX=tR("find-expanded",Jr.chevronDown,ue(0,"Icon to indicate that the editor find widget is expanded.")),HX=tR("find-replace",Jr.replace,ue(0,"Icon for 'Replace' in the editor find widget.")),zX=tR("find-replace-all",Jr.replaceAll,ue(0,"Icon for 'Replace All' in the editor find widget.")),UX=tR("find-previous-match",Jr.arrowUp,ue(0,"Icon for 'Find Previous' in the editor find widget.")),KX=tR("find-next-match",Jr.arrowDown,ue(0,"Icon for 'Find Next' in the editor find widget.")),jX=ue(0,"Find / Replace"),qX=ue(0,"Find"),$X=ue(0,"Find"),GX=ue(0,"Previous Match"),ZX=ue(0,"Next Match"),YX=ue(0,"Find in Selection"),XX=ue(0,"Close"),QX=ue(0,"Replace"),JX=ue(0,"Replace"),eQ=ue(0,"Replace"),tQ=ue(0,"Replace All"),iQ=ue(0,"Toggle Replace"),nQ=ue(0,"Only the first {0} results are highlighted, but all find operations work on the entire text.",fX),sQ=ue(0,"{0} of {1}"),oQ=ue(0,"No results"),rQ=419;let aQ=69;const lQ="ctrlEnterReplaceAll.windows.donotask",hQ=Pe?256:2048;class dQ{constructor(e){this.afterLineNumber=e,this.heightInPx=33,this.suppressMouseDown=!1,this.domNode=document.createElement("div"),this.domNode.className="dock-find-viewzone"}}function cQ(e,t,i){const n=!!t.match(/\n/);i&&n&&i.selectionStart>0&&e.stopPropagation()}function uQ(e,t,i){const n=!!t.match(/\n/);i&&n&&i.selectionEndthis._updateHistoryDelayer.cancel()))),this._register(this._state.onFindReplaceStateChange((e=>this._onStateChanged(e)))),this._buildDomNode(),this._updateButtons(),this._tryUpdateWidgetWidth(),this._findInput.inputBox.layout(),this._register(this._codeEditor.onDidChangeConfiguration((e=>{if(e.hasChanged(90)&&(this._codeEditor.getOption(90)&&this._state.change({isReplaceRevealed:!1},!1),this._updateButtons()),e.hasChanged(143)&&this._tryUpdateWidgetWidth(),e.hasChanged(2)&&this.updateAccessibilitySupport(),e.hasChanged(41)){const e=this._codeEditor.getOption(41).loop;this._state.change({loop:e},!1);const t=this._codeEditor.getOption(41).addExtraSpaceOnTop;t&&!this._viewZone&&(this._viewZone=new dQ(0),this._showViewZone()),!t&&this._viewZone&&this._removeViewZone()}}))),this.updateAccessibilitySupport(),this._register(this._codeEditor.onDidChangeCursorSelection((()=>{this._isVisible&&this._updateToggleSelectionFindButton()}))),this._register(this._codeEditor.onDidFocusEditorWidget((()=>FX(this,void 0,void 0,(function*(){if(this._isVisible){const e=yield this._controller.getGlobalBufferTerm();e&&e!==this._state.searchString&&(this._state.change({searchString:e},!1),this._findInput.select())}}))))),this._findInputFocused=jY.bindTo(o),this._findFocusTracker=this._register(hs(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=qY.bindTo(o),this._replaceFocusTracker=this._register(hs(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(41).addExtraSpaceOnTop&&(this._viewZone=new dQ(0)),this._register(this._codeEditor.onDidChangeModel((()=>{this._isVisible&&(this._viewZoneId=void 0)}))),this._register(this._codeEditor.onDidScrollChange((e=>{e.scrollTopChanged?this._layoutViewZone():setTimeout((()=>{this._layoutViewZone()}),0)})))}getId(){return gQ.ID}getDomNode(){return this._domNode}getPosition(){return this._isVisible?{preference:0}: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(90)||this._isReplaceVisible||(this._isReplaceVisible=!0,this._replaceInput.width=zn(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 e=this._state.searchString.length>0&&0===this._state.matchesCount;this._domNode.classList.toggle("no-results",e),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,r)}_updateHistory(){this._state.searchString&&this._findInput.inputBox.addToHistory(),this._state.replaceString&&this._replaceInput.inputBox.addToHistory()}_updateMatchesCount(){let e;if(this._matchesCount.style.minWidth=aQ+"px",this._state.matchesCount>=fX?this._matchesCount.title=nQ:this._matchesCount.title="",this._matchesCount.firstChild&&this._matchesCount.removeChild(this._matchesCount.firstChild),this._state.matchesCount>0){let t=String(this._state.matchesCount);this._state.matchesCount>=fX&&(t+="+");let i=String(this._state.matchesPosition);"0"===i&&(i="?"),e=Qs(sQ,i,t)}else e=oQ;this._matchesCount.appendChild(document.createTextNode(e)),Ps(this._getAriaLabel(e,this._state.currentMatch,this._state.searchString)),aQ=Math.max(aQ,this._matchesCount.clientWidth)}_getAriaLabel(e,t,i){if(e===oQ)return""===i?ue(0,"{0} found",e):ue(0,"{0} found for '{1}'",e,i);if(t){const n=ue(0,"{0} found for '{1}', at {2}",e,i,t.startLineNumber+":"+t.startColumn),s=this._codeEditor.getModel();if(s&&t.startLineNumber<=s.getLineCount()&&t.startLineNumber>=1){return`${s.getLineContent(t.startLineNumber)}, ${n}`}return n}return ue(0,"{0} found for '{1}'",e,i)}_updateToggleSelectionFindButton(){const e=this._codeEditor.getSelection(),t=!!e&&(e.startLineNumber!==e.endLineNumber||e.startColumn!==e.endColumn),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(90);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(41).autoFindInSelection){case"always":this._toggleSelectionFind.checked=!0;break;case"never":this._toggleSelectionFind.checked=!1;break;case"multiline":{const t=!!e&&e.startLineNumber!==e.endLineNumber;this._toggleSelectionFind.checked=t;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(41).seedSearchStringFromSelection&&e){const i=this._codeEditor.getDomNode();if(i){const n=Hn(i),s=this._codeEditor.getScrolledVisiblePosition(e.getStartPosition()),o=n.left+(s?s.left:0),r=s?s.top:0;if(this._viewZone&&re.startLineNumber&&(t=!1);const i=Vn(this._domNode).left;o>i&&(t=!1);const s=this._codeEditor.getScrolledVisiblePosition(e.getEndPosition());n.left+(s?s.left:0)>i&&(t=!1)}}}this._showViewZone(t)}}_hide(e){this._revealTimeouts.forEach((e=>{clearTimeout(e)})),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(41).addExtraSpaceOnTop)return void this._removeViewZone();if(!this._isVisible)return;const t=this._viewZone;void 0===this._viewZoneId&&t&&this._codeEditor.changeViewZones((i=>{t.heightInPx=this._getHeight(),this._viewZoneId=i.addZone(t),this._codeEditor.setScrollTop(e||this._codeEditor.getScrollTop()+t.heightInPx)}))}_showViewZone(e=!0){if(!this._isVisible)return;if(!this._codeEditor.getOption(41).addExtraSpaceOnTop)return;void 0===this._viewZone&&(this._viewZone=new dQ(0));const t=this._viewZone;this._codeEditor.changeViewZones((i=>{if(void 0!==this._viewZoneId){const n=this._getHeight();if(n===t.heightInPx)return;const s=n-t.heightInPx;return t.heightInPx=n,i.layoutZone(this._viewZoneId),void(e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+s))}{let n=this._getHeight();if(n-=this._codeEditor.getOption(83).top,n<=0)return;t.heightInPx=n,this._viewZoneId=i.addZone(t),e&&this._codeEditor.setScrollTop(this._codeEditor.getScrollTop()+n)}}))}_removeViewZone(){this._codeEditor.changeViewZones((e=>{void 0!==this._viewZoneId&&(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)return;if(!xn(this._domNode))return;const e=this._codeEditor.getLayoutInfo();if(e.contentWidth<=0)return void this._domNode.classList.add("hiddenEditor");this._domNode.classList.contains("hiddenEditor")&&this._domNode.classList.remove("hiddenEditor");const t=e.width,i=e.minimap.minimapWidth;let n=!1,s=!1,o=!1;if(this._resized){if(zn(this._domNode)>rQ)return this._domNode.style.maxWidth=t-28-i-15+"px",void(this._replaceInput.width=zn(this._findInput.domNode))}if(447+i>=t&&(s=!0),447+i-aQ>=t&&(o=!0),447+i-aQ>=t+50&&(n=!0),this._domNode.classList.toggle("collapsed-find-widget",n),this._domNode.classList.toggle("narrow-find-widget",o),this._domNode.classList.toggle("reduced-find-widget",s),o||n||(this._domNode.style.maxWidth=t-28-i-15+"px"),this._findInput.layout({collapsedFindWidget:n,narrowFindWidget:o,reducedFindWidget:s}),this._resized){const e=this._findInput.inputBox.element.clientWidth;e>0&&(this._replaceInput.width=e)}else this._isReplaceVisible&&(this._replaceInput.width=zn(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(null===this._cachedHeight||this._cachedHeight!==e)&&(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((e=>{1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(e.endLineNumber-1)));const t=this._state.currentMatch;return e.startLineNumber===e.endLineNumber||Rh.equalsRange(e,t)?null:e})).filter((e=>!!e)),e.length&&this._state.change({searchScope:e},!0)}}_onFindInputMouseDown(e){e.middleButton&&e.stopPropagation()}_onFindInputKeyDown(e){return e.equals(3|hQ)?(this._keybindingService.dispatchEvent(e,e.target)||this._findInput.inputBox.insertAtCursor("\n"),void e.preventDefault()):e.equals(2)?(this._isReplaceVisible?this._replaceInput.focus():this._findInput.focusOnCaseSensitive(),void e.preventDefault()):e.equals(2066)?(this._codeEditor.focus(),void e.preventDefault()):e.equals(16)?cQ(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea")):e.equals(18)?uQ(e,this._findInput.getValue(),this._findInput.domNode.querySelector("textarea")):void 0}_onReplaceInputKeyDown(e){return e.equals(3|hQ)?(this._keybindingService.dispatchEvent(e,e.target)||(Oe&&Be&&!this._ctrlEnterReplaceAllWarningPrompted&&(this._notificationService.info(ue(0,"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(lQ,!0,0,0)),this._replaceInput.inputBox.insertAtCursor("\n")),void e.preventDefault()):e.equals(2)?(this._findInput.focusOnCaseSensitive(),void e.preventDefault()):e.equals(1026)?(this._findInput.focus(),void e.preventDefault()):e.equals(2066)?(this._codeEditor.focus(),void e.preventDefault()):e.equals(16)?cQ(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea")):e.equals(18)?uQ(e,this._replaceInput.inputBox.value,this._replaceInput.inputBox.element.querySelector("textarea")):void 0}getVerticalSashLeft(e){return 0}_keybindingLabelFor(e){const t=this._keybindingService.lookupKeybinding(e);return t?` (${t.getLabel()})`:""}_buildDomNode(){const e=!0,t=!0;this._findInput=this._register(new AX(null,this._contextViewProvider,{width:221,label:qX,placeholder:$X,appendCaseSensitiveLabel:this._keybindingLabelFor(lX),appendWholeWordsLabel:this._keybindingLabelFor(hX),appendRegexLabel:this._keybindingLabelFor(dX),validation:e=>{if(0===e.length||!this._findInput.getRegex())return null;try{return new RegExp(e,"gu"),null}catch(Mre){return{content:Mre.message}}},flexibleHeight:e,flexibleWidth:t,flexibleMaxHeight:118,showCommonFindToggles:!0,showHistoryHint:()=>PX(this._keybindingService),inputBoxStyles:Zx,toggleStyles:Gx},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((e=>this._onFindInputKeyDown(e)))),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((e=>{e.equals(1026)&&this._isReplaceVisible&&(this._replaceInput.focus(),e.preventDefault())}))),this._register(this._findInput.onRegexKeyDown((e=>{e.equals(2)&&this._isReplaceVisible&&(this._replaceInput.focusOnPreserve(),e.preventDefault())}))),this._register(this._findInput.inputBox.onDidHeightChange((e=>{this._tryUpdateHeight()&&this._showViewZone()}))),Fe&&this._register(this._findInput.onMouseDown((e=>this._onFindInputMouseDown(e)))),this._matchesCount=document.createElement("div"),this._matchesCount.className="matchesCount",this._updateMatchesCount(),this._prevBtn=this._register(new pQ({label:GX+this._keybindingLabelFor(iX),icon:UX,onTrigger:()=>{$r(this._codeEditor.getAction(iX)).run().then(void 0,r)}})),this._nextBtn=this._register(new pQ({label:ZX+this._keybindingLabelFor(tX),icon:KX,onTrigger:()=>{$r(this._codeEditor.getAction(tX)).run().then(void 0,r)}}));const i=document.createElement("div");i.className="find-part",i.appendChild(this._findInput.domNode);const n=document.createElement("div");n.className="find-actions",i.appendChild(n),n.appendChild(this._matchesCount),n.appendChild(this._prevBtn.domNode),n.appendChild(this._nextBtn.domNode),this._toggleSelectionFind=this._register(new vV({icon:BX,title:YX+this._keybindingLabelFor(cX),isChecked:!1,inputActiveOptionBackground:Sp(Vp),inputActiveOptionBorder:Sp(Wp),inputActiveOptionForeground:Sp(Hp)})),this._register(this._toggleSelectionFind.onChange((()=>{if(this._toggleSelectionFind.checked){if(this._codeEditor.hasModel()){const e=this._codeEditor.getSelections();e.map((e=>(1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._codeEditor.getModel().getLineMaxColumn(e.endLineNumber-1))),e.isEmpty()?null:e))).filter((e=>!!e)),e.length&&this._state.change({searchScope:e},!0)}}else this._state.change({searchScope:null},!0)}))),n.appendChild(this._toggleSelectionFind.domNode),this._closeBtn=this._register(new pQ({label:XX+this._keybindingLabelFor(aX),icon:rR,onTrigger:()=>{this._state.change({isRevealed:!1,searchScope:null},!1)},onKeyDown:e=>{e.equals(2)&&this._isReplaceVisible&&(this._replaceBtn.isEnabled()?this._replaceBtn.focus():this._codeEditor.focus(),e.preventDefault())}})),this._replaceInput=this._register(new OX(null,void 0,{label:QX,placeholder:JX,appendPreserveCaseLabel:this._keybindingLabelFor(uX),history:[],flexibleHeight:e,flexibleWidth:t,flexibleMaxHeight:118,showHistoryHint:()=>PX(this._keybindingService),inputBoxStyles:Zx,toggleStyles:Gx},this._contextKeyService,!0)),this._replaceInput.setPreserveCase(!!this._state.preserveCase),this._register(this._replaceInput.onKeyDown((e=>this._onReplaceInputKeyDown(e)))),this._register(this._replaceInput.inputBox.onDidChange((()=>{this._state.change({replaceString:this._replaceInput.inputBox.value},!1)}))),this._register(this._replaceInput.inputBox.onDidHeightChange((e=>{this._isReplaceVisible&&this._tryUpdateHeight()&&this._showViewZone()}))),this._register(this._replaceInput.onDidOptionChange((()=>{this._state.change({preserveCase:this._replaceInput.getPreserveCase()},!0)}))),this._register(this._replaceInput.onPreserveCaseKeyDown((e=>{e.equals(2)&&(this._prevBtn.isEnabled()?this._prevBtn.focus():this._nextBtn.isEnabled()?this._nextBtn.focus():this._toggleSelectionFind.enabled?this._toggleSelectionFind.focus():this._closeBtn.isEnabled()&&this._closeBtn.focus(),e.preventDefault())}))),this._replaceBtn=this._register(new pQ({label:eQ+this._keybindingLabelFor(gX),icon:HX,onTrigger:()=>{this._controller.replace()},onKeyDown:e=>{e.equals(1026)&&(this._closeBtn.focus(),e.preventDefault())}})),this._replaceAllBtn=this._register(new pQ({label:tQ+this._keybindingLabelFor(pX),icon:zX,onTrigger:()=>{this._controller.replaceAll()}}));const s=document.createElement("div");s.className="replace-part",s.appendChild(this._replaceInput.domNode);const o=document.createElement("div");o.className="replace-actions",s.appendChild(o),o.appendChild(this._replaceBtn.domNode),o.appendChild(this._replaceAllBtn.domNode),this._toggleReplaceBtn=this._register(new pQ({label:iQ,className:"codicon toggle left",onTrigger:()=>{this._state.change({isReplaceRevealed:!this._isReplaceVisible},!1),this._isReplaceVisible&&(this._replaceInput.width=zn(this._findInput.domNode),this._replaceInput.inputBox.layout()),this._showViewZone()}})),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=jX,this._domNode.role="dialog",this._domNode.style.width="419px",this._domNode.appendChild(this._toggleReplaceBtn.domNode),this._domNode.appendChild(i),this._domNode.appendChild(this._closeBtn.domNode),this._domNode.appendChild(s),this._resizeSash=new SW(this._domNode,this,{orientation:0,size:2}),this._resized=!1;let a=rQ;this._register(this._resizeSash.onDidStart((()=>{a=zn(this._domNode)}))),this._register(this._resizeSash.onDidChange((e=>{this._resized=!0;const t=a+e.startX-e.currentX;if(t(parseFloat(Pn(this._domNode).maxWidth)||0)||(this._domNode.style.width=`${t}px`,this._isReplaceVisible&&(this._replaceInput.width=zn(this._findInput.domNode)),this._findInput.inputBox.layout(),this._tryUpdateHeight())}))),this._register(this._resizeSash.onDidReset((()=>{const e=zn(this._domNode);if(e{this._opts.onTrigger(),e.preventDefault()})),this.onkeydown(this._domNode,(e=>{var t,i;if(e.equals(10)||e.equals(3))return this._opts.onTrigger(),void e.preventDefault();null===(i=(t=this._opts).onKeyDown)||void 0===i||i.call(t,e)}))}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(...ta.asClassNameArray(WX)),this._domNode.classList.add(...ta.asClassNameArray(VX))):(this._domNode.classList.remove(...ta.asClassNameArray(VX)),this._domNode.classList.add(...ta.asClassNameArray(WX)))}}H_(((e,t)=>{const i=(e,i)=>{i&&t.addRule(`.monaco-editor ${e} { background-color: ${i}; }`)};i(".findMatch",e.getColor(Um)),i(".currentFindMatch",e.getColor(zm)),i(".findScope",e.getColor(Km));i(".find-widget",e.getColor(km));const n=e.getColor(Ap);n&&t.addRule(`.monaco-editor .find-widget { box-shadow: 0 0 8px 2px ${n}; }`);const s=e.getColor(Op);s&&t.addRule(`.monaco-editor .find-widget { border-left: 1px solid ${s}; border-right: 1px solid ${s}; border-bottom: 1px solid ${s}; }`);const o=e.getColor(qm);o&&t.addRule(`.monaco-editor .findMatch { border: 1px ${A_(e.type)?"dotted":"solid"} ${o}; box-sizing: border-box; }`);const r=e.getColor(jm);r&&t.addRule(`.monaco-editor .currentFindMatch { border: 2px solid ${r}; padding: 1px; box-sizing: border-box; }`);const a=e.getColor($m);a&&t.addRule(`.monaco-editor .findScope { border: 1px ${A_(e.type)?"dashed":"solid"} ${a}; }`);const l=e.getColor(Mp);l&&t.addRule(`.monaco-editor .find-widget { border: 1px solid ${l}; }`);const h=e.getColor(Dm);h&&t.addRule(`.monaco-editor .find-widget { color: ${h}; }`);const d=e.getColor(Np);d&&t.addRule(`.monaco-editor .find-widget.no-results .matchesCount { color: ${d}; }`);const c=e.getColor(Nm);if(c)t.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${c}; }`);else{const i=e.getColor(xm);i&&t.addRule(`.monaco-editor .find-widget .monaco-sash { background-color: ${i}; }`)}const u=e.getColor(Qf);u&&t.addRule(`\n\t\t.monaco-editor .find-widget .button:not(.disabled):hover,\n\t\t.monaco-editor .find-widget .codicon-find-selection:hover {\n\t\t\tbackground-color: ${u} !important;\n\t\t}\n\t`);const g=e.getColor(Ip);g&&t.addRule(`.monaco-editor .find-widget .monaco-inputbox.synthetic-focus { outline-color: ${g}; }`)}));var mQ,fQ=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},_Q=function(e,t){return function(i,n){t(i,n,e)}},vQ=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function bQ(e,t="single",i=!1){if(!e.hasModel())return null;const n=e.getSelection();if("single"===t&&n.startLineNumber===n.endLineNumber||"multiple"===t)if(n.isEmpty()){const t=e.getConfiguredWordAtPosition(n.getStartPosition());if(t&&!1===i)return t.word}else if(e.getModel().getValueLengthInRange(n)<524288)return e.getModel().getValueInRange(n);return null}let CQ=mQ=class extends E{get editor(){return this._editor}static get(e){return e.getContribution(mQ.ID)}constructor(e,t,i,n,s){super(),this._editor=e,this._findWidgetVisible=KY.bindTo(t),this._contextKeyService=t,this._storageService=i,this._clipboardService=n,this._notificationService=s,this._updateHistoryDelayer=new Jh(500),this._state=this._register(new CX),this.loadQueryState(),this._register(this._state.onFindReplaceStateChange((e=>this._onStateChanged(e)))),this._model=null,this._register(this._editor.onDidChangeModel((()=>{const e=this._editor.getModel()&&this._state.isRevealed;this.disposeModel(),this._state.change({searchScope:null,matchCase:this._storageService.getBoolean("editor.matchCase",1,!1),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,!1),isRegex:this._storageService.getBoolean("editor.isRegex",1,!1),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,!1)},!1),e&&this._start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!1,updateSearchScope:!1,loop:this._editor.getOption(41).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,1,1),e.wholeWord&&this._storageService.store("editor.wholeWord",this._state.actualWholeWord,1,1),e.matchCase&&this._storageService.store("editor.matchCase",this._state.actualMatchCase,1,1),e.preserveCase&&this._storageService.store("editor.preserveCase",this._state.actualPreserveCase,1,1)}loadQueryState(){this._state.change({matchCase:this._storageService.getBoolean("editor.matchCase",1,this._state.matchCase),wholeWord:this._storageService.getBoolean("editor.wholeWord",1,this._state.wholeWord),isRegex:this._storageService.getBoolean("editor.isRegex",1,this._state.isRegex),preserveCase:this._storageService.getBoolean("editor.preserveCase",1,this._state.preserveCase)},!1)}isFindInputFocused(){return!!jY.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()){const e=this._editor.getSelections();e.map((e=>(1===e.endColumn&&e.endLineNumber>e.startLineNumber&&(e=e.setEndPosition(e.endLineNumber-1,this._editor.getModel().getLineMaxColumn(e.endLineNumber-1))),e.isEmpty()?null:e))).filter((e=>!!e)),e.length&&this._state.change({searchScope:e},!0)}}setSearchString(e){this._state.isRegex&&(e=eo(e)),this._state.change({searchString:e},!1)}highlightFindOptions(e=!1){}_start(e,t){return vQ(this,void 0,void 0,(function*(){if(this.disposeModel(),!this._editor.hasModel())return;const i=Object.assign(Object.assign({},t),{isRevealed:!0});if("single"===e.seedSearchStringFromSelection){const t=bQ(this._editor,e.seedSearchStringFromSelection,e.seedSearchStringFromNonEmptySelection);t&&(this._state.isRegex?i.searchString=eo(t):i.searchString=t)}else if("multiple"===e.seedSearchStringFromSelection&&!e.updateSearchScope){const t=bQ(this._editor,e.seedSearchStringFromSelection);t&&(i.searchString=t)}if(!i.searchString&&e.seedSearchStringFromGlobalClipboard){const e=yield this.getGlobalBufferTerm();if(!this._editor.hasModel())return;e&&(i.searchString=e)}if(e.forceRevealReplace||i.isReplaceRevealed?i.isReplaceRevealed=!0:this._findWidgetVisible.get()||(i.isReplaceRevealed=!1),e.updateSearchScope){const e=this._editor.getSelections();e.some((e=>!e.isEmpty()))&&(i.searchScope=e)}i.loop=e.loop,this._state.change(i,!1),this._model||(this._model=new _X(this._editor,this._state))}))}start(e,t){return this._start(e,t)}moveToNextMatch(){return!!this._model&&(this._model.moveToNextMatch(),!0)}moveToPrevMatch(){return!!this._model&&(this._model.moveToPrevMatch(),!0)}goToMatch(e){return!!this._model&&(this._model.moveToMatch(e),!0)}replace(){return!!this._model&&(this._model.replace(),!0)}replaceAll(){var e;return!!this._model&&((null===(e=this._editor.getModel())||void 0===e?void 0:e.isTooLargeForHeapOperation())?(this._notificationService.warn(ue(0,"The file is too large to perform a replace all operation.")),!1):(this._model.replaceAll(),!0))}selectAllMatches(){return!!this._model&&(this._model.selectAllMatches(),this._editor.focus(),!0)}getGlobalBufferTerm(){return vQ(this,void 0,void 0,(function*(){return this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()?this._clipboardService.readFindText():""}))}setGlobalBufferTerm(e){this._editor.getOption(41).globalFindClipboard&&this._editor.hasModel()&&!this._editor.getModel().isTooLargeForSyncing()&&this._clipboardService.writeFindText(e)}};CQ.ID="editor.contrib.findController",CQ=mQ=fQ([_Q(1,Ol),_Q(2,ZN),_Q(3,eS),_Q(4,mL)],CQ);let wQ=class extends CQ{constructor(e,t,i,n,s,o,r,a){super(e,i,r,a,o),this._contextViewService=t,this._keybindingService=n,this._themeService=s,this._widget=null,this._findOptionsWidget=null}_start(e,t){const i=Object.create(null,{_start:{get:()=>super._start}});return vQ(this,void 0,void 0,(function*(){this._widget||this._createFindWidget();const n=this._editor.getSelection();let s=!1;switch(this._editor.getOption(41).autoFindInSelection){case"always":s=!0;break;case"never":s=!1;break;case"multiline":s=!!n&&n.startLineNumber!==n.endLineNumber;break}e.updateSearchScope=e.updateSearchScope||s,yield i._start.call(this,e,t),this._widget&&(2===e.shouldFocus?this._widget.focusReplaceInput():1===e.shouldFocus&&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 gQ(this._editor,this,this._state,this._contextViewService,this._keybindingService,this._contextKeyService,this._themeService,this._storageService,this._notificationService)),this._findOptionsWidget=this._register(new vX(this._editor,this._state,this._keybindingService))}};wQ=fQ([_Q(1,Ux),_Q(2,Ol),_Q(3,WL),_Q(4,P_),_Q(5,mL),_Q(6,ZN),_Q(7,eS)],wQ);kh(new Ch({id:QY,label:ue(0,"Find"),alias:"Find",precondition:pl.or(Oh.focus,pl.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2084,weight:100},menuOpts:{menuId:eh.MenubarEditMenu,group:"3_find",title:ue(0,"&&Find"),order:1}})).addImplementation(0,((e,t,i)=>{const n=CQ.get(t);return!!n&&n.start({forceRevealReplace:!1,seedSearchStringFromSelection:"never"!==t.getOption(41).seedSearchStringFromSelection?"single":"none",seedSearchStringFromNonEmptySelection:"selection"===t.getOption(41).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:t.getOption(41).globalFindClipboard,shouldFocus:1,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop})}));const yQ={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"},regex:{type:"boolean"},regexOverride:{type:"number",description:ue(0,'Overrides "Use Regular Expression" flag.\nThe flag will not be saved for the future.\n0: Do Nothing\n1: True\n2: False')},wholeWord:{type:"boolean"},wholeWordOverride:{type:"number",description:ue(0,'Overrides "Match Whole Word" flag.\nThe flag will not be saved for the future.\n0: Do Nothing\n1: True\n2: False')},matchCase:{type:"boolean"},matchCaseOverride:{type:"number",description:ue(0,'Overrides "Math Case" flag.\nThe flag will not be saved for the future.\n0: Do Nothing\n1: True\n2: False')},preserveCase:{type:"boolean"},preserveCaseOverride:{type:"number",description:ue(0,'Overrides "Preserve Case" flag.\nThe flag will not be saved for the future.\n0: Do Nothing\n1: True\n2: False')},findInSelection:{type:"boolean"}}}}]};class SQ extends bh{run(e,t){return vQ(this,void 0,void 0,(function*(){const e=CQ.get(t);e&&!this._run(e)&&(yield e.start({forceRevealReplace:!1,seedSearchStringFromSelection:0===e.getState().searchString.length&&"never"!==t.getOption(41).seedSearchStringFromSelection?"single":"none",seedSearchStringFromNonEmptySelection:"selection"===t.getOption(41).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:!0,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(e))}))}}class LQ extends bh{run(e,t){return vQ(this,void 0,void 0,(function*(){const e=CQ.get(t);if(!e)return;const i=bQ(t,"single",!1);i&&e.setSearchString(i),this._run(e)||(yield e.start({forceRevealReplace:!1,seedSearchStringFromSelection:"none",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),this._run(e))}))}}kh(new Ch({id:rX,label:ue(0,"Replace"),alias:"Replace",precondition:pl.or(Oh.focus,pl.has("editorIsOpen")),kbOpts:{kbExpr:null,primary:2086,mac:{primary:2596},weight:100},menuOpts:{menuId:eh.MenubarEditMenu,group:"3_find",title:ue(0,"&&Replace"),order:2}})).addImplementation(0,((e,t,i)=>{if(!t.hasModel()||t.getOption(90))return!1;const n=CQ.get(t);if(!n)return!1;const s=t.getSelection(),o=n.isFindInputFocused(),r=!s.isEmpty()&&s.startLineNumber===s.endLineNumber&&"never"!==t.getOption(41).seedSearchStringFromSelection&&!o,a=o||r?2:1;return n.start({forceRevealReplace:!0,seedSearchStringFromSelection:r?"single":"none",seedSearchStringFromNonEmptySelection:"selection"===t.getOption(41).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:"never"!==t.getOption(41).seedSearchStringFromSelection,shouldFocus:a,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop})})),Dh(CQ.ID,wQ,0),Lh(class extends bh{constructor(){super({id:eX,label:ue(0,"Find With Arguments"),alias:"Find With Arguments",precondition:void 0,kbOpts:{kbExpr:null,primary:0,weight:100},description:yQ})}run(e,t,i){return vQ(this,void 0,void 0,(function*(){const e=CQ.get(t);if(e){const n=i?{searchString:i.searchString,replaceString:i.replaceString,isReplaceRevealed:void 0!==i.replaceString,isRegex:i.isRegex,wholeWord:i.matchWholeWord,matchCase:i.isCaseSensitive,preserveCase:i.preserveCase}:{};yield e.start({forceRevealReplace:!1,seedSearchStringFromSelection:0===e.getState().searchString.length&&"never"!==t.getOption(41).seedSearchStringFromSelection?"single":"none",seedSearchStringFromNonEmptySelection:"selection"===t.getOption(41).seedSearchStringFromSelection,seedSearchStringFromGlobalClipboard:!0,shouldFocus:1,shouldAnimate:!0,updateSearchScope:(null==i?void 0:i.findInSelection)||!1,loop:t.getOption(41).loop},n),e.setGlobalBufferTerm(e.getState().searchString)}}))}}),Lh(class extends bh{constructor(){super({id:JY,label:ue(0,"Find With Selection"),alias:"Find With Selection",precondition:void 0,kbOpts:{kbExpr:null,primary:0,mac:{primary:2083},weight:100}})}run(e,t){return vQ(this,void 0,void 0,(function*(){const e=CQ.get(t);e&&(yield e.start({forceRevealReplace:!1,seedSearchStringFromSelection:"multiple",seedSearchStringFromNonEmptySelection:!1,seedSearchStringFromGlobalClipboard:!1,shouldFocus:0,shouldAnimate:!0,updateSearchScope:!1,loop:t.getOption(41).loop}),e.setGlobalBufferTerm(e.getState().searchString))}))}}),Lh(class extends SQ{constructor(){super({id:tX,label:ue(0,"Find Next"),alias:"Find Next",precondition:void 0,kbOpts:[{kbExpr:Oh.focus,primary:61,mac:{primary:2085,secondary:[61]},weight:100},{kbExpr:pl.and(Oh.focus,jY),primary:3,weight:100}]})}_run(e){return!!e.moveToNextMatch()&&(e.editor.pushUndoStop(),!0)}}),Lh(class extends SQ{constructor(){super({id:iX,label:ue(0,"Find Previous"),alias:"Find Previous",precondition:void 0,kbOpts:[{kbExpr:Oh.focus,primary:1085,mac:{primary:3109,secondary:[1085]},weight:100},{kbExpr:pl.and(Oh.focus,jY),primary:1027,weight:100}]})}_run(e){return e.moveToPrevMatch()}}),Lh(class extends bh{constructor(){super({id:nX,label:ue(0,"Go to Match..."),alias:"Go to Match...",precondition:KY}),this._highlightDecorations=[]}run(e,t,i){const n=CQ.get(t);if(!n)return;const s=n.getState().matchesCount;if(s<1){return void e.get(mL).notify({severity:pL.Warning,message:ue(0,"No matches. Try searching for something else.")})}const o=e.get(cE).createInputBox();o.placeholder=ue(0,"Type a number to go to a specific match (between 1 and {0})",s);const r=e=>{const t=parseInt(e);if(isNaN(t))return;const i=n.getState().matchesCount;return t>0&&t<=i?t-1:t<0&&t>=-i?i+t:void 0},a=e=>{const i=r(e);if("number"==typeof i){o.validationMessage=void 0,n.goToMatch(i);const e=n.getState().currentMatch;e&&this.addDecorations(t,e)}else o.validationMessage=ue(0,"Please type a number between 1 and {0}",n.getState().matchesCount),this.clearDecorations(t)};o.onDidChangeValue((e=>{a(e)})),o.onDidAccept((()=>{const e=r(o.value);"number"==typeof e?(n.goToMatch(e),o.hide()):o.validationMessage=ue(0,"Please type a number between 1 and {0}",n.getState().matchesCount)})),o.onDidHide((()=>{this.clearDecorations(t),o.dispose()})),o.show()}clearDecorations(e){e.changeDecorations((e=>{this._highlightDecorations=e.deltaDecorations(this._highlightDecorations,[])}))}addDecorations(e,t){e.changeDecorations((e=>{this._highlightDecorations=e.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:F_(mv),position:Cd.Full}}}])}))}}),Lh(class extends LQ{constructor(){super({id:sX,label:ue(0,"Find Next Selection"),alias:"Find Next Selection",precondition:void 0,kbOpts:{kbExpr:Oh.focus,primary:2109,weight:100}})}_run(e){return e.moveToNextMatch()}}),Lh(class extends LQ{constructor(){super({id:oX,label:ue(0,"Find Previous Selection"),alias:"Find Previous Selection",precondition:void 0,kbOpts:{kbExpr:Oh.focus,primary:3133,weight:100}})}_run(e){return e.moveToPrevMatch()}});const kQ=vh.bindToContribution(CQ.get);Sh(new kQ({id:aX,precondition:KY,handler:e=>e.closeFindWidget(),kbOpts:{weight:105,kbExpr:pl.and(Oh.focus,pl.not("isComposing")),primary:9,secondary:[1033]}})),Sh(new kQ({id:lX,precondition:void 0,handler:e=>e.toggleCaseSensitive(),kbOpts:{weight:105,kbExpr:Oh.focus,primary:$Y.primary,mac:$Y.mac,win:$Y.win,linux:$Y.linux}})),Sh(new kQ({id:hX,precondition:void 0,handler:e=>e.toggleWholeWords(),kbOpts:{weight:105,kbExpr:Oh.focus,primary:GY.primary,mac:GY.mac,win:GY.win,linux:GY.linux}})),Sh(new kQ({id:dX,precondition:void 0,handler:e=>e.toggleRegex(),kbOpts:{weight:105,kbExpr:Oh.focus,primary:ZY.primary,mac:ZY.mac,win:ZY.win,linux:ZY.linux}})),Sh(new kQ({id:cX,precondition:void 0,handler:e=>e.toggleSearchScope(),kbOpts:{weight:105,kbExpr:Oh.focus,primary:YY.primary,mac:YY.mac,win:YY.win,linux:YY.linux}})),Sh(new kQ({id:uX,precondition:void 0,handler:e=>e.togglePreserveCase(),kbOpts:{weight:105,kbExpr:Oh.focus,primary:XY.primary,mac:XY.mac,win:XY.win,linux:XY.linux}})),Sh(new kQ({id:gX,precondition:KY,handler:e=>e.replace(),kbOpts:{weight:105,kbExpr:Oh.focus,primary:3094}})),Sh(new kQ({id:gX,precondition:KY,handler:e=>e.replace(),kbOpts:{weight:105,kbExpr:pl.and(Oh.focus,qY),primary:3}})),Sh(new kQ({id:pX,precondition:KY,handler:e=>e.replaceAll(),kbOpts:{weight:105,kbExpr:Oh.focus,primary:2563}})),Sh(new kQ({id:pX,precondition:KY,handler:e=>e.replaceAll(),kbOpts:{weight:105,kbExpr:pl.and(Oh.focus,qY),primary:void 0,mac:{primary:2051}}})),Sh(new kQ({id:mX,precondition:KY,handler:e=>e.selectAllMatches(),kbOpts:{weight:105,kbExpr:Oh.focus,primary:515}}));const DQ={0:" ",1:"u",2:"r"},xQ=16777215,NQ=4278190080;class EQ{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<65535)throw new Error("invalid startIndexes or endIndexes size");this._startIndexes=e,this._endIndexes=t,this._collapseStates=new EQ(e.length),this._userDefinedStates=new EQ(e.length),this._recoveredStates=new EQ(e.length),this._types=i,this._parentsComputed=!1}ensureParentIndices(){if(!this._parentsComputed){this._parentsComputed=!0;const e=[],t=(t,i)=>{const n=e[e.length-1];return this.getStartLineNumber(n)<=t&&this.getEndLineNumber(n)>=i};for(let i=0,n=this._startIndexes.length;ixQ||s>xQ)throw new Error("startLineNumber or endLineNumber must not exceed "+xQ);for(;e.length>0&&!t(n,s);)e.pop();const o=e.length>0?e[e.length-1]:-1;e.push(i),this._startIndexes[i]=n+((255&o)<<24),this._endIndexes[i]=s+((65280&o)<<16)}}}get length(){return this._startIndexes.length}getStartLineNumber(e){return this._startIndexes[e]&xQ}getEndLineNumber(e){return this._endIndexes[e]&xQ}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)?1:this.isRecovered(e)?2:0}setSource(e,t){1===t?(this.setUserDefined(e,!0),this.setRecovered(e,!1)):2===t?(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]&NQ)>>>16);return 65535===t?-1:t}contains(e,t){return this.getStartLineNumber(e)<=t&&this.getEndLineNumber(e)>=t}findIndex(e){let t=0,i=this._startIndexes.length;if(0===i)return-1;for(;t=0){if(this.getEndLineNumber(t)>=e)return t;for(t=this.getParentIndex(t);-1!==t;){if(this.contains(t,e))return t;t=this.getParentIndex(t)}}return-1}toString(){const e=[];for(let t=0;tArray.isArray(e)?i=>ii=h.startLineNumber))l&&l.startLineNumber===h.startLineNumber?(1===h.source?e=h:(e=l,e.isCollapsed=h.isCollapsed&&l.endLineNumber===h.endLineNumber,e.source=0),l=s(++r)):(e=h,h.isCollapsed&&0===h.source&&(e.source=2)),h=o(++a);else{let t=a,i=h;for(;;){if(!i||i.startLineNumber>l.endLineNumber){e=l;break}if(1===i.source&&i.endLineNumber>l.endLineNumber)break;i=o(++t)}l=s(++r)}if(e){for(;c&&c.endLineNumbere.startLineNumber&&e.startLineNumber>u&&e.endLineNumber<=i&&(!c||c.endLineNumber>=e.endLineNumber)&&(g.push(e),u=e.startLineNumber,c&&d.push(c),c=e)}}return g}}class MQ{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}}class TQ{get regions(){return this._regions}get textModel(){return this._textModel}constructor(e,t){this._updateEventEmitter=new U,this.onDidChange=this._updateEventEmitter.event,this._textModel=e,this._decorationProvider=t,this._regions=new IQ(new Uint32Array(0),new Uint32Array(0)),this._editorDecorationIds=[]}toggleCollapseState(e){if(!e.length)return;e=e.sort(((e,t)=>e.regionIndex-t.regionIndex));const t={};this._decorationProvider.changeDecorations((i=>{let n=0,s=-1,o=-1;const r=e=>{for(;no&&(o=e),n++}};for(const a of e){const e=a.regionIndex,i=this._editorDecorationIds[e];if(i&&!t[i]){t[i]=!0,r(e);const n=!this._regions.isCollapsed(e);this._regions.setCollapsed(e,n),s=Math.max(s,this._regions.getEndLineNumber(e))}}r(this._regions.length)})),this._updateEventEmitter.fire({model:this,collapseStateChanged:e})}removeManualRanges(e){const t=new Array,i=t=>{for(const i of e)if(!(i.startLineNumber>t.endLineNumber||t.startLineNumber>i.endLineNumber))return!0;return!1};for(let n=0;ni&&(i=o)}this._decorationProvider.changeDecorations((e=>this._editorDecorationIds=e.deltaDecorations(this._editorDecorationIds,t))),this._regions=e,this._updateEventEmitter.fire({model:this})}_currentFoldedOrManualRanges(e=[]){const t=(t,i)=>{for(const n of e)if(t=s.endLineNumber||s.startLineNumber<1||s.endLineNumber>i)continue;const o=this._getLinesChecksum(s.startLineNumber+1,s.endLineNumber);t.push({startLineNumber:s.startLineNumber,endLineNumber:s.endLineNumber,isCollapsed:s.isCollapsed,source:s.source,checksum:o})}return t.length>0?t:void 0}applyMemento(e){var t,i;if(!Array.isArray(e))return;const n=[],s=this._textModel.getLineCount();for(const r of e){if(r.startLineNumber>=r.endLineNumber||r.startLineNumber<1||r.endLineNumber>s)continue;const e=this._getLinesChecksum(r.startLineNumber+1,r.endLineNumber);r.checksum&&e!==r.checksum||n.push({startLineNumber:r.startLineNumber,endLineNumber:r.endLineNumber,type:void 0,isCollapsed:null===(t=r.isCollapsed)||void 0===t||t,source:null!==(i=r.source)&&void 0!==i?i:0})}const o=IQ.sanitizeAndMerge(this._regions,n,s);this.updatePost(IQ.fromFoldRanges(o))}_getLinesChecksum(e,t){return uE(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),s=1;for(;n>=0;){const e=this._regions.toRegion(n);t&&!t(e,s)||i.push(e),s++,n=e.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,s=e?e.endLineNumber:Number.MAX_VALUE;if(t&&2===t.length){const e=[];for(let o=n,r=this._regions.length;o0&&!n.containedBy(e[e.length-1]);)e.pop();e.push(n),t(n,e.length)&&i.push(n)}}else for(let o=n,r=this._regions.length;o1){const o=e.getRegionsInside(i,((e,i)=>e.isCollapsed!==s&&i0)for(const o of n){const n=e.getRegionAtLine(o);if(n&&(n.isCollapsed!==t&&s.push(n),i>1)){const o=e.getRegionsInside(n,((e,n)=>e.isCollapsed!==t&&ne.isCollapsed!==t&&ne.isCollapsed!==t&&n<=i));s.push(...n)}e.toggleCollapseState(s)}function PQ(e,t,i){const n=[];for(const o of i){const t=e.getAllRegionsAtLine(o,void 0);t.length>0&&n.push(t[0])}const s=e.getRegionsInside(null,(e=>n.every((t=>!t.containedBy(e)&&!e.containedBy(t)))&&e.isCollapsed!==t));e.toggleCollapseState(s)}function FQ(e,t,i){const n=e.textModel,s=e.regions,o=[];for(let r=s.length-1;r>=0;r--)if(i!==s.isCollapsed(r)){const e=s.getStartLineNumber(r);t.test(n.getLineContent(e))&&o.push(s.toRegion(r))}e.toggleCollapseState(o)}function BQ(e,t,i){const n=e.regions,s=[];for(let o=n.length-1;o>=0;o--)i!==n.isCollapsed(o)&&t===n.getType(o)&&s.push(n.toRegion(o));e.toggleCollapseState(s)}class WQ{get onDidChange(){return this._updateEventEmitter.event}get hiddenRanges(){return this._hiddenRanges}constructor(e){this._updateEventEmitter=new U,this._hasLineChanges=!1,this._foldingModel=e,this._foldingModelListener=e.onDidChange((e=>this.updateHiddenRanges())),this._hiddenRanges=[],e.regions.length&&this.updateHiddenRanges()}notifyChangeModelContent(e){this._hiddenRanges.length&&!this._hasLineChanges&&(this._hasLineChanges=e.changes.some((e=>e.range.endLineNumber!==e.range.startLineNumber||0!==hc(e.text)[0])))}updateHiddenRanges(){let e=!1;const t=[];let i=0,n=0,s=Number.MAX_VALUE,o=-1;const r=this._foldingModel.regions;for(;i0}isHidden(e){return null!==VQ(this._hiddenRanges,e)}adjustSelections(e){let t=!1;const i=this._foldingModel.textModel;let n=null;const s=e=>(n&&function(e,t){return e>=t.startLineNumber&&e<=t.endLineNumber}(e,n)||(n=VQ(this._hiddenRanges,e)),n?n.startLineNumber-1:null);for(let o=0,r=e.length;o0&&(this._hiddenRanges=[],this._updateEventEmitter.fire(this._hiddenRanges)),this._foldingModelListener&&(this._foldingModelListener.dispose(),this._foldingModelListener=null)}}function VQ(e,t){const i=_c(e,(e=>t=0&&e[i].endLineNumber>=t?e[i]:null}class HQ{constructor(e,t,i){this.editorModel=e,this.languageConfigurationService=t,this.foldingRangesLimit=i,this.id="indent"}dispose(){}compute(e){const t=this.languageConfigurationService.getLanguageConfiguration(this.editorModel.getLanguageId()).foldingRules,i=t&&!!t.offSide,n=t&&t.markers;return Promise.resolve(function(e,t,i,n=UQ){const s=e.getOptions().tabSize,o=new zQ(n);let r;i&&(r=new RegExp(`(${i.start.source})|(?:${i.end.source})`));const a=[],l=e.getLineCount()+1;a.push({indent:-1,endAbove:l,line:l});for(let h=e.getLineCount();h>0;h--){const i=e.getLineContent(h),n=Xv(i,s);let l,d=a[a.length-1];if(-1!==n){if(r&&(l=i.match(r))){if(!l[1]){a.push({indent:-2,endAbove:h,line:h});continue}{let e=a.length-1;for(;e>0&&-2!==a[e].indent;)e--;if(e>0){a.length=e+1,d=a[e],o.insertFirst(h,d.line,n),d.line=h,d.indent=n,d.endAbove=h;continue}}}if(d.indent>n){do{a.pop(),d=a[a.length-1]}while(d.indent>n);const e=d.endAbove-1;e-h>=1&&o.insertFirst(h,e,n)}d.indent===n?d.endAbove=h:a.push({indent:n,endAbove:h,line:h})}else t&&(d.endAbove=h)}return o.toIndentRanges(e)}(this.editorModel,i,n,this.foldingRangesLimit))}}class zQ{constructor(e){this._startIndexes=[],this._endIndexes=[],this._indentOccurrences=[],this._length=0,this._foldingRangesLimit=e}insertFirst(e,t,i){if(e>xQ||t>xQ)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 e=new Uint32Array(this._length),t=new Uint32Array(this._length);for(let i=this._length-1,n=0;i>=0;i--,n++)e[n]=this._startIndexes[i],t[n]=this._endIndexes[i];return new IQ(e,t)}{this._foldingRangesLimit.update(this._length,t);let i=0,n=this._indentOccurrences.length;for(let e=0;et){n=e;break}i+=s}}const s=e.getOptions().tabSize,o=new Uint32Array(t),r=new Uint32Array(t);for(let a=this._length-1,l=0;a>=0;a--){const h=this._startIndexes[a],d=Xv(e.getLineContent(h),s);(d{}};const KQ=Dp("editor.foldBackground",{light:D_(Bm,.3),dark:D_(Bm,.3),hcDark:null,hcLight:null},ue(0,"Background color behind folded ranges. The color must not be opaque so as not to hide underlying decorations."),!0);Dp("editorGutter.foldingControlForeground",{dark:Ep,light:Ep,hcDark:Ep,hcLight:Ep},ue(0,"Color of the folding control in the editor gutter."));const jQ=tR("folding-expanded",Jr.chevronDown,ue(0,"Icon for expanded ranges in the editor glyph margin.")),qQ=tR("folding-collapsed",Jr.chevronRight,ue(0,"Icon for collapsed ranges in the editor glyph margin.")),$Q=tR("folding-manual-collapsed",qQ,ue(0,"Icon for manually collapsed ranges in the editor glyph margin.")),GQ=tR("folding-manual-expanded",jQ,ue(0,"Icon for manually expanded ranges in the editor glyph margin.")),ZQ={color:F_(KQ),position:yd.Inline};class YQ{constructor(e){this.editor=e,this.showFoldingControls="mouseover",this.showFoldingHighlights=!0}getDecorationOption(e,t,i){return t?YQ.HIDDEN_RANGE_DECORATION:"never"===this.showFoldingControls?e?this.showFoldingHighlights?YQ.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION:YQ.NO_CONTROLS_COLLAPSED_RANGE_DECORATION:YQ.NO_CONTROLS_EXPANDED_RANGE_DECORATION:e?i?this.showFoldingHighlights?YQ.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:YQ.MANUALLY_COLLAPSED_VISUAL_DECORATION:this.showFoldingHighlights?YQ.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION:YQ.COLLAPSED_VISUAL_DECORATION:"mouseover"===this.showFoldingControls?i?YQ.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION:YQ.EXPANDED_AUTO_HIDE_VISUAL_DECORATION:i?YQ.MANUALLY_EXPANDED_VISUAL_DECORATION:YQ.EXPANDED_VISUAL_DECORATION}changeDecorations(e){return this.editor.changeDecorations(e)}removeDecorations(e){this.editor.removeDecorations(e)}}YQ.COLLAPSED_VISUAL_DECORATION=Iw.register({description:"folding-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:ta.asClassName(qQ)}),YQ.COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Iw.register({description:"folding-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:ZQ,isWholeLine:!0,firstLineDecorationClassName:ta.asClassName(qQ)}),YQ.MANUALLY_COLLAPSED_VISUAL_DECORATION=Iw.register({description:"folding-manually-collapsed-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0,firstLineDecorationClassName:ta.asClassName($Q)}),YQ.MANUALLY_COLLAPSED_HIGHLIGHTED_VISUAL_DECORATION=Iw.register({description:"folding-manually-collapsed-highlighted-visual-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:ZQ,isWholeLine:!0,firstLineDecorationClassName:ta.asClassName($Q)}),YQ.NO_CONTROLS_COLLAPSED_RANGE_DECORATION=Iw.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",isWholeLine:!0}),YQ.NO_CONTROLS_COLLAPSED_HIGHLIGHTED_RANGE_DECORATION=Iw.register({description:"folding-no-controls-range-decoration",stickiness:0,afterContentClassName:"inline-folded",className:"folded-background",minimap:ZQ,isWholeLine:!0}),YQ.EXPANDED_VISUAL_DECORATION=Iw.register({description:"folding-expanded-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+ta.asClassName(jQ)}),YQ.EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Iw.register({description:"folding-expanded-auto-hide-visual-decoration",stickiness:1,isWholeLine:!0,firstLineDecorationClassName:ta.asClassName(jQ)}),YQ.MANUALLY_EXPANDED_VISUAL_DECORATION=Iw.register({description:"folding-manually-expanded-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:"alwaysShowFoldIcons "+ta.asClassName(GQ)}),YQ.MANUALLY_EXPANDED_AUTO_HIDE_VISUAL_DECORATION=Iw.register({description:"folding-manually-expanded-auto-hide-visual-decoration",stickiness:0,isWholeLine:!0,firstLineDecorationClassName:ta.asClassName(GQ)}),YQ.NO_CONTROLS_EXPANDED_RANGE_DECORATION=Iw.register({description:"folding-no-controls-range-decoration",stickiness:0,isWholeLine:!0}),YQ.HIDDEN_RANGE_DECORATION=Iw.register({description:"folding-hidden-range-decoration",stickiness:1});const XQ={};class QQ{constructor(e,t,i,n,s){this.editorModel=e,this.providers=t,this.handleFoldingRangesChange=i,this.foldingRangesLimit=n,this.fallbackRangeProvider=s,this.id="syntax",this.disposables=new N,s&&this.disposables.add(s);for(const o of t)"function"==typeof o.onDidChange&&this.disposables.add(o.onDidChange(i))}compute(e){return function(e,t,i){let n=null;const s=e.map(((e,s)=>Promise.resolve(e.provideFoldingRanges(t,XQ,i)).then((e=>{if(!i.isCancellationRequested&&Array.isArray(e)){Array.isArray(n)||(n=[]);const i=t.getLineCount();for(const t of e)t.start>0&&t.end>t.start&&t.end<=i&&n.push({start:t.start,end:t.end,rank:s,kind:t.kind})}}),a)));return Promise.all(s).then((e=>n))}(this.providers,this.editorModel,e).then((t=>{var i,n;if(t){return function(e,t){const i=e.sort(((e,t)=>{let i=e.start-t.start;return 0===i&&(i=e.rank-t.rank),i})),n=new JQ(t);let s;const o=[];for(const r of i)if(s){if(r.start>s.start)if(r.end<=s.end)o.push(s),s=r,n.add(r.start,r.end,r.kind&&r.kind.value,o.length);else{if(r.start>s.end){do{s=o.pop()}while(s&&r.start>s.end);s&&o.push(s),s=r}n.add(r.start,r.end,r.kind&&r.kind.value,o.length)}}else s=r,n.add(r.start,r.end,r.kind&&r.kind.value,o.length);return n.toIndentRanges()}(t,this.foldingRangesLimit)}return null!==(n=null===(i=this.fallbackRangeProvider)||void 0===i?void 0:i.compute(e))&&void 0!==n?n:null}))}dispose(){this.disposables.dispose()}}class JQ{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>xQ||t>xQ)return;const s=this._length;this._startIndexes[s]=e,this._endIndexes[s]=t,this._nestingLevels[s]=n,this._types[s]=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 e=new Uint32Array(this._length),t=new Uint32Array(this._length);for(let i=0;ie){i=r;break}t+=n}}const n=new Uint32Array(e),s=new Uint32Array(e),o=[];for(let r=0,a=0;r=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},iJ=function(e,t){return function(i,n){t(i,n,e)}},nJ=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const sJ=new Al("foldingEnabled",!1);let oJ=eJ=class extends E{static get(e){return e.getContribution(eJ.ID)}static getFoldingRangeProviders(e,t){var i,n;const s=e.foldingRangeProvider.ordered(t);return null!==(n=null===(i=eJ._foldingRangeSelector)||void 0===i?void 0:i.call(eJ,s,t))&&void 0!==n?n:s}constructor(e,t,i,n,s,o){super(),this.contextKeyService=t,this.languageConfigurationService=i,this.languageFeaturesService=o,this.localToDispose=this._register(new N),this.editor=e,this._foldingLimitReporter=new rJ(e);const r=this.editor.getOptions();this._isEnabled=r.get(43),this._useFoldingProviders="indentation"!==r.get(44),this._unfoldOnClickAfterEndOfLine=r.get(48),this._restoringViewState=!1,this._currentModelHasFoldedImports=!1,this._foldingImportsByDefault=r.get(46),this.updateDebounceInfo=s.for(o.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 YQ(e),this.foldingDecorationProvider.showFoldingControls=r.get(109),this.foldingDecorationProvider.showFoldingHighlights=r.get(45),this.foldingEnabled=sJ.bindTo(this.contextKeyService),this.foldingEnabled.set(this._isEnabled),this._register(this.editor.onDidChangeModel((()=>this.onModelChanged()))),this._register(this.editor.onDidChangeConfiguration((e=>{if(e.hasChanged(43)&&(this._isEnabled=this.editor.getOptions().get(43),this.foldingEnabled.set(this._isEnabled),this.onModelChanged()),e.hasChanged(47)&&this.onModelChanged(),e.hasChanged(109)||e.hasChanged(45)){const e=this.editor.getOptions();this.foldingDecorationProvider.showFoldingControls=e.get(109),this.foldingDecorationProvider.showFoldingHighlights=e.get(45),this.triggerFoldingModelChanged()}e.hasChanged(44)&&(this._useFoldingProviders="indentation"!==this.editor.getOptions().get(44),this.onFoldingStrategyChanged()),e.hasChanged(48)&&(this._unfoldOnClickAfterEndOfLine=this.editor.getOptions().get(48)),e.hasChanged(46)&&(this._foldingImportsByDefault=this.editor.getOptions().get(46))}))),this.onModelChanged()}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 TQ(e,this.foldingDecorationProvider),this.localToDispose.add(this.foldingModel),this.hiddenRangeModel=new WQ(this.foldingModel),this.localToDispose.add(this.hiddenRangeModel),this.localToDispose.add(this.hiddenRangeModel.onDidChange((e=>this.onHiddenRangesChanges(e)))),this.updateScheduler=new Jh(this.updateDebounceInfo.get(e)),this.cursorChangedScheduler=new rd((()=>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((e=>this.onDidChangeModelContent(e)))),this.localToDispose.add(this.editor.onDidChangeCursorPosition((()=>this.onCursorPositionChanged()))),this.localToDispose.add(this.editor.onMouseDown((e=>this.onEditorMouseDown(e)))),this.localToDispose.add(this.editor.onMouseUp((e=>this.onEditorMouseUp(e)))),this.localToDispose.add({dispose:()=>{var e,t;this.foldingRegionPromise&&(this.foldingRegionPromise.cancel(),this.foldingRegionPromise=null),null===(e=this.updateScheduler)||void 0===e||e.cancel(),this.updateScheduler=null,this.foldingModel=null,this.foldingModelPromise=null,this.hiddenRangeModel=null,this.cursorChangedScheduler=null,null===(t=this.rangeProvider)||void 0===t||t.dispose(),this.rangeProvider=null}}),this.triggerFoldingModelChanged())}onFoldingStrategyChanged(){var e;null===(e=this.rangeProvider)||void 0===e||e.dispose(),this.rangeProvider=null,this.triggerFoldingModelChanged()}getRangeProvider(e){if(this.rangeProvider)return this.rangeProvider;const t=new HQ(e,this.languageConfigurationService,this._foldingLimitReporter);if(this.rangeProvider=t,this._useFoldingProviders&&this.foldingModel){const i=eJ.getFoldingRangeProviders(this.languageFeaturesService,e);i.length>0&&(this.rangeProvider=new QQ(e,i,(()=>this.triggerFoldingModelChanged()),this._foldingLimitReporter,t))}return this.rangeProvider}getFoldingModel(){return this.foldingModelPromise}onDidChangeModelContent(e){var t;null===(t=this.hiddenRangeModel)||void 0===t||t.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 F,i=this.getRangeProvider(e.textModel),n=this.foldingRegionPromise=Yh((e=>i.compute(e)));return n.then((i=>{if(i&&n===this.foldingRegionPromise){let n;if(this._foldingImportsByDefault&&!this._currentModelHasFoldedImports){const e=i.setCollapsedAllOfType(xC.Imports.value,!0);e&&(n=WN.capture(this.editor),this._currentModelHasFoldedImports=e)}const s=this.editor.getSelections(),o=s?s.map((e=>e.startLineNumber)):[];e.update(i,o),null==n||n.restore(this.editor);const r=this.updateDebounceInfo.update(e.textModel,t.elapsed());this.updateScheduler&&(this.updateScheduler.defaultDelay=r)}return e}))})).then(void 0,(e=>(r(e),null))))}onHiddenRangesChanges(e){if(this.hiddenRangeModel&&e.length&&!this._restoringViewState){const e=this.editor.getSelections();e&&this.hiddenRangeModel.adjustSelections(e)&&this.editor.setSelections(e)}this.editor.setHiddenAreas(e,this)}onCursorPositionChanged(){this.hiddenRangeModel&&this.hiddenRangeModel.hasRanges()&&this.cursorChangedScheduler.schedule()}revealCursor(){const e=this.getFoldingModel();e&&e.then((e=>{if(e){const t=this.editor.getSelections();if(t&&t.length>0){const i=[];for(const n of t){const t=n.selectionStartLineNumber;this.hiddenRangeModel&&this.hiddenRangeModel.isHidden(t)&&i.push(...e.getAllRegionsAtLine(t,(e=>e.isCollapsed&&t>e.startLineNumber)))}i.length&&(e.toggleCollapseState(i),this.reveal(t[0].getPosition()))}}})).then(void 0,r)}onEditorMouseDown(e){if(this.mouseDownInfo=null,!this.hiddenRangeModel||!e.target||!e.target.range)return;if(!e.event.leftButton&&!e.event.middleButton)return;const t=e.target.range;let i=!1;switch(e.target.type){case 4:{const t=e.target.detail,n=e.target.element.offsetLeft;if(t.offsetX-n<4)return;i=!0;break}case 7:if(this._unfoldOnClickAfterEndOfLine&&this.hiddenRangeModel.hasRanges()){if(!e.target.detail.isAfterLines)break}return;case 6:if(this.hiddenRangeModel.hasRanges()){const e=this.editor.getModel();if(e&&t.startColumn===e.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,s=e.target.range;if(!s||s.startLineNumber!==i)return;if(n){if(4!==e.target.type)return}else{const e=this.editor.getModel();if(!e||s.startColumn!==e.getLineMaxColumn(i))return}const o=t.getRegionAtLine(i);if(o&&o.startLineNumber===i){const s=o.isCollapsed;if(n||s){let n=[];if(e.event.altKey){const e=e=>!e.containedBy(o)&&!o.containedBy(e),i=t.getRegionsInside(null,e);for(const t of i)t.isCollapsed&&n.push(t);0===n.length&&(n=i)}else{const i=e.event.middleButton||e.event.shiftKey;if(i)for(const e of t.getRegionsInside(o))e.isCollapsed===s&&n.push(e);!s&&i&&0!==n.length||n.push(o)}t.toggleCollapseState(n),this.reveal({lineNumber:i,column:1})}}}reveal(e){this.editor.revealPositionInCenterIfOutsideViewport(e,0)}};oJ.ID="editor.contrib.folding",oJ=eJ=tJ([iJ(1,Ol),iJ(2,Ju),iJ(3,mL),iJ(4,SE),iJ(5,oL)],oJ);class rJ{constructor(e){this.editor=e,this._onDidChange=new U,this._computed=0,this._limited=!1}get limit(){return this.editor.getOptions().get(47)}update(e,t){e===this._computed&&t===this._limited||(this._computed=e,this._limited=t,this._onDidChange.fire())}}class aJ extends bh{runEditorCommand(e,t,i){const n=e.get(Ju),s=oJ.get(t);if(!s)return;const o=s.getFoldingModel();return o?(this.reportTelemetry(e,t),o.then((e=>{if(e){this.invoke(s,e,t,i,n);const o=t.getSelection();o&&s.reveal(o.getStartPosition())}}))):void 0}getSelectedLines(e){const t=e.getSelections();return t?t.map((e=>e.startLineNumber)):[]}getLineNumbers(e,t){return e&&e.selectionLines?e.selectionLines.map((e=>e+1)):this.getSelectedLines(t)}run(e,t){}}function lJ(e){if(!Ur(e)){if(!Br(e))return!1;const t=e;if(!Ur(t.levels)&&!Vr(t.levels))return!1;if(!Ur(t.direction)&&!Fr(t.direction))return!1;if(!(Ur(t.selectionLines)||Array.isArray(t.selectionLines)&&t.selectionLines.every(Vr)))return!1}return!0}class hJ extends aJ{getFoldingLevel(){return parseInt(this.id.substr(hJ.ID_PREFIX.length))}invoke(e,t,i){!function(e,t,i,n){const s=e.getRegionsInside(null,((e,s)=>s===t&&e.isCollapsed!==i&&!n.some((t=>e.containsLine(t)))));e.toggleCollapseState(s)}(t,this.getFoldingLevel(),!0,this.getSelectedLines(i))}}hJ.ID_PREFIX="editor.foldLevel",hJ.ID=e=>hJ.ID_PREFIX+e;Dh(oJ.ID,oJ,0),Lh(class extends aJ{constructor(){super({id:"editor.unfold",label:ue(0,"Unfold"),alias:"Unfold",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:3166,mac:{primary:2654},weight:100},description:{description:"Unfold the content in the editor",args:[{name:"Unfold editor argument",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t\t* 'levels': Number of levels to unfold. If not set, defaults to 1.\n\t\t\t\t\t\t* 'direction': If 'up', unfold given number of levels up otherwise unfolds down.\n\t\t\t\t\t\t* '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.\n\t\t\t\t\t\t",constraint:lJ,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 s=n&&n.levels||1,o=this.getLineNumbers(n,i);n&&"up"===n.direction?OQ(t,!1,s,o):AQ(t,!1,s,o)}}),Lh(class extends aJ{constructor(){super({id:"editor.unfoldRecursively",label:ue(0,"Unfold Recursively"),alias:"Unfold Recursively",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2142),weight:100}})}invoke(e,t,i,n){AQ(t,!1,Number.MAX_VALUE,this.getSelectedLines(i))}}),Lh(class extends aJ{constructor(){super({id:"editor.fold",label:ue(0,"Fold"),alias:"Fold",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:3164,mac:{primary:2652},weight:100},description:{description:"Fold the content in the editor",args:[{name:"Fold editor argument",description:"Property-value pairs that can be passed through this argument:\n\t\t\t\t\t\t\t* 'levels': Number of levels to fold.\n\t\t\t\t\t\t\t* 'direction': If 'up', folds given number of levels up otherwise folds down.\n\t\t\t\t\t\t\t* '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.\n\t\t\t\t\t\t\tIf no levels or direction is set, folds the region at the locations or if already collapsed, the first uncollapsed parent instead.\n\t\t\t\t\t\t",constraint:lJ,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 s=this.getLineNumbers(n,i),o=n&&n.levels,r=n&&n.direction;"number"!=typeof o&&"string"!=typeof r?function(e,t,i){const n=[];for(const s of i){const i=e.getAllRegionsAtLine(s,(e=>e.isCollapsed!==t));i.length>0&&n.push(i[0])}e.toggleCollapseState(n)}(t,!0,s):"up"===r?OQ(t,!0,o||1,s):AQ(t,!0,o||1,s)}}),Lh(class extends aJ{constructor(){super({id:"editor.foldRecursively",label:ue(0,"Fold Recursively"),alias:"Fold Recursively",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2140),weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);AQ(t,!0,Number.MAX_VALUE,n)}}),Lh(class extends aJ{constructor(){super({id:"editor.foldAll",label:ue(0,"Fold All"),alias:"Fold All",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2069),weight:100}})}invoke(e,t,i){AQ(t,!0)}}),Lh(class extends aJ{constructor(){super({id:"editor.unfoldAll",label:ue(0,"Unfold All"),alias:"Unfold All",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2088),weight:100}})}invoke(e,t,i){AQ(t,!1)}}),Lh(class extends aJ{constructor(){super({id:"editor.foldAllBlockComments",label:ue(0,"Fold All Block Comments"),alias:"Fold All Block Comments",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2138),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())BQ(t,xC.Comment.value,!0);else{const e=i.getModel();if(!e)return;const n=s.getLanguageConfiguration(e.getLanguageId()).comments;if(n&&n.blockCommentStartToken){FQ(t,new RegExp("^\\s*"+eo(n.blockCommentStartToken)),!0)}}}}),Lh(class extends aJ{constructor(){super({id:"editor.foldAllMarkerRegions",label:ue(0,"Fold All Regions"),alias:"Fold All Regions",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2077),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())BQ(t,xC.Region.value,!0);else{const e=i.getModel();if(!e)return;const n=s.getLanguageConfiguration(e.getLanguageId()).foldingRules;if(n&&n.markers&&n.markers.start){FQ(t,new RegExp(n.markers.start),!0)}}}}),Lh(class extends aJ{constructor(){super({id:"editor.unfoldAllMarkerRegions",label:ue(0,"Unfold All Regions"),alias:"Unfold All Regions",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2078),weight:100}})}invoke(e,t,i,n,s){if(t.regions.hasTypes())BQ(t,xC.Region.value,!1);else{const e=i.getModel();if(!e)return;const n=s.getLanguageConfiguration(e.getLanguageId()).foldingRules;if(n&&n.markers&&n.markers.start){FQ(t,new RegExp(n.markers.start),!1)}}}}),Lh(class extends aJ{constructor(){super({id:"editor.foldAllExcept",label:ue(0,"Fold All Except Selected"),alias:"Fold All Except Selected",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2136),weight:100}})}invoke(e,t,i){PQ(t,!0,this.getSelectedLines(i))}}),Lh(class extends aJ{constructor(){super({id:"editor.unfoldAllExcept",label:ue(0,"Unfold All Except Selected"),alias:"Unfold All Except Selected",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2134),weight:100}})}invoke(e,t,i){PQ(t,!1,this.getSelectedLines(i))}}),Lh(class extends aJ{constructor(){super({id:"editor.toggleFold",label:ue(0,"Toggle Fold"),alias:"Toggle Fold",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2090),weight:100}})}invoke(e,t,i){RQ(t,1,this.getSelectedLines(i))}}),Lh(class extends aJ{constructor(){super({id:"editor.gotoParentFold",label:ue(0,"Go to Parent Fold"),alias:"Go to Parent Fold",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const e=function(e,t){let i=null;const n=t.getRegionAtLine(e);if(null!==n&&(i=n.startLineNumber,e===i)){const e=n.parentIndex;i=-1!==e?t.regions.getStartLineNumber(e):null}return i}(n[0],t);null!==e&&i.setSelection({startLineNumber:e,startColumn:1,endLineNumber:e,endColumn:1})}}}),Lh(class extends aJ{constructor(){super({id:"editor.gotoPreviousFold",label:ue(0,"Go to Previous Folding Range"),alias:"Go to Previous Folding Range",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const e=function(e,t){let i=t.getRegionAtLine(e);if(null!==i&&i.startLineNumber===e){if(e!==i.startLineNumber)return i.startLineNumber;{const e=i.parentIndex;let n=0;for(-1!==e&&(n=t.regions.getStartLineNumber(i.parentIndex));null!==i;){if(!(i.regionIndex>0))return null;if(i=t.regions.toRegion(i.regionIndex-1),i.startLineNumber<=n)return null;if(i.parentIndex===e)return i.startLineNumber}}}else if(t.regions.length>0)for(i=t.regions.toRegion(t.regions.length-1);null!==i;){if(i.startLineNumber0?t.regions.toRegion(i.regionIndex-1):null}return null}(n[0],t);null!==e&&i.setSelection({startLineNumber:e,startColumn:1,endLineNumber:e,endColumn:1})}}}),Lh(class extends aJ{constructor(){super({id:"editor.gotoNextFold",label:ue(0,"Go to Next Folding Range"),alias:"Go to Next Folding Range",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,weight:100}})}invoke(e,t,i){const n=this.getSelectedLines(i);if(n.length>0){const e=function(e,t){let i=t.getRegionAtLine(e);if(null!==i&&i.startLineNumber===e){const e=i.parentIndex;let n=0;if(-1!==e)n=t.regions.getEndLineNumber(i.parentIndex);else{if(0===t.regions.length)return null;n=t.regions.getEndLineNumber(t.regions.length-1)}for(;null!==i;){if(!(i.regionIndex=n)return null;if(i.parentIndex===e)return i.startLineNumber}}else if(t.regions.length>0)for(i=t.regions.toRegion(0);null!==i;){if(i.startLineNumber>e)return i.startLineNumber;i=i.regionIndexe.startLineNumber&&(s.push({startLineNumber:e.startLineNumber,endLineNumber:t,type:void 0,isCollapsed:!0,source:1}),i.setSelection({startLineNumber:e.startLineNumber,startColumn:1,endLineNumber:e.startLineNumber,endColumn:1}))}if(s.length>0){s.sort(((e,t)=>e.startLineNumber-t.startLineNumber));const e=IQ.sanitizeAndMerge(t.regions,s,null===(n=i.getModel())||void 0===n?void 0:n.getLineCount());t.updatePost(IQ.fromFoldRanges(e))}}}}),Lh(class extends aJ{constructor(){super({id:"editor.removeManualFoldingRanges",label:ue(0,"Remove Manual Folding Ranges"),alias:"Remove Manual Folding Ranges",precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2137),weight:100}})}invoke(e,t,i){const n=i.getSelections();if(n){const i=[];for(const e of n){const{startLineNumber:t,endLineNumber:n}=e;i.push(n>=t?{startLineNumber:t,endLineNumber:n}:{endLineNumber:n,startLineNumber:t})}t.removeManualRanges(i),e.triggerFoldingModelChanged()}}});for(let Tre=1;Tre<=7;Tre++)dJ=new hJ({id:hJ.ID(Tre),label:ue(0,"Fold Level {0}",Tre),alias:`Fold Level ${Tre}`,precondition:sJ,kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2048|21+Tre),weight:100}}),Nh.INSTANCE.registerEditorAction(dJ);var dJ;Xa.registerCommand("_executeFoldingRangeProvider",(function(e,...t){return nJ(this,void 0,void 0,(function*(){const[i]=t;if(!(i instanceof an))throw u();const n=e.get(oL),s=e.get(Ha).getModel(i);if(!s)throw u();const o=e.get(pu);if(!o.getValue("editor.folding",{resource:i}))return[];const r=e.get(Ju),a=o.getValue("editor.foldingStrategy",{resource:i}),l={get limit(){return o.getValue("editor.foldingMaximumRegions",{resource:i})},update:(e,t)=>{}},h=new HQ(s,r,l);let d=h;if("indentation"!==a){const e=oJ.getFoldingRangeProviders(n,s);e.length&&(d=new QQ(s,e,(()=>{}),l,h))}const c=yield d.compute(Uh.None),g=[];try{if(c)for(let e=0;eFq.replace(Rh.lift(e.range),e.text)))):e.executeEdits("formatEditsCommand",s.map((e=>Fq.replaceMove(Rh.lift(e.range),e.text)))),i&&e.pushUndoStop(),n.restoreRelativeVerticalPositionOfCursor(e)}}class uJ{constructor(e){this.value=e,this._lower=e.toLowerCase()}static toKey(e){return"string"==typeof e?e.toLowerCase():e._lower}}class gJ{constructor(e){if(this._set=new Set,e)for(const t of e)this.add(t)}add(e){this._set.add(uJ.toKey(e))}has(e){return this._set.has(uJ.toKey(e))}}var pJ=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function mJ(e){if(!(e=e.filter((e=>e.range))).length)return;let{range:t}=e[0];for(let s=1;sa.provideDocumentRangeFormattingEdits(e,e.getFullModelRange(),t,i)})}return n}class _J{static setFormatterSelector(e){return{dispose:_J._selectors.unshift(e)}}static select(e,t,i){return pJ(this,void 0,void 0,(function*(){if(0===e.length)return;const n=v.first(_J._selectors);return n?yield n(e,t,i):void 0}))}}function vJ(e,t,i,n,s,o){return pJ(this,void 0,void 0,(function*(){const r=e.get(Fa),{documentRangeFormattingEditProvider:a}=e.get(oL),l=iV(t)?t.getModel():t,h=a.ordered(l),d=yield _J.select(h,l,n);d&&(s.report(d),yield r.invokeFunction(bJ,d,t,i,o))}))}function bJ(e,t,i,n,s){var o,r;return pJ(this,void 0,void 0,(function*(){const a=e.get(fG),l=e.get(hh);let h,d;iV(i)?(h=i.getModel(),d=new dL(i,5,void 0,s)):(h=i,d=new cL(i,s));const c=[];let u=0;for(const e of Zd(n).sort(Rh.compareRangesUsingStarts))u>0&&Rh.areIntersectingOrTouching(c[u-1],e)?c[u-1]=Rh.fromPositions(c[u-1].getStartPosition(),e.getEndPosition()):u=c.push(e);const g=e=>pJ(this,void 0,void 0,(function*(){var i,n;l.trace("[format][provideDocumentRangeFormattingEdits] (request)",null===(i=t.extensionId)||void 0===i?void 0:i.value,e);const s=(yield t.provideDocumentRangeFormattingEdits(h,e,h.getFormattingOptions(),d.token))||[];return l.trace("[format][provideDocumentRangeFormattingEdits] (response)",null===(n=t.extensionId)||void 0===n?void 0:n.value,s),s})),p=(e,t)=>{if(!e.length||!t.length)return!1;const i=e.reduce(((e,t)=>Rh.plusRange(e,t.range)),e[0].range);if(!t.some((e=>Rh.intersectRanges(i,e.range))))return!1;for(const n of e)for(const e of t)if(Rh.intersectRanges(n.range,e.range))return!0;return!1},m=[],f=[];try{if("function"==typeof t.provideDocumentRangesFormattingEdits){l.trace("[format][provideDocumentRangeFormattingEdits] (request)",null===(o=t.extensionId)||void 0===o?void 0:o.value,c);const e=(yield t.provideDocumentRangesFormattingEdits(h,c,h.getFormattingOptions(),d.token))||[];l.trace("[format][provideDocumentRangeFormattingEdits] (response)",null===(r=t.extensionId)||void 0===r?void 0:r.value,e),f.push(e)}else{for(const e of c){if(d.token.isCancellationRequested)return!0;f.push(yield g(e))}for(let e=0;e({text:e.text,range:Rh.lift(e.range),forceMoveMarkers:!0}))),(e=>{for(const{range:i}of e)if(Rh.areIntersectingOrTouching(i,t))return[new Ah(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn)];return null}))}return!0}))}function CJ(e,t,i,n,s){return pJ(this,void 0,void 0,(function*(){const o=e.get(Fa),r=e.get(oL),a=iV(t)?t.getModel():t,l=fJ(r.documentFormattingEditProvider,r.documentRangeFormattingEditProvider,a),h=yield _J.select(l,a,i);h&&(n.report(h),yield o.invokeFunction(wJ,h,t,i,s))}))}function wJ(e,t,i,n,s){return pJ(this,void 0,void 0,(function*(){const o=e.get(fG);let r,a,l;iV(i)?(r=i.getModel(),a=new dL(i,5,void 0,s)):(r=i,a=new cL(i,s));try{const e=yield t.provideDocumentFormattingEdits(r,r.getFormattingOptions(),a.token);if(l=yield o.computeMoreMinimalEdits(r.uri,e),a.token.isCancellationRequested)return!0}finally{a.dispose()}if(!l||0===l.length)return!1;if(iV(i))cJ.execute(i,l,2!==n),2!==n&&(mJ(l),i.revealPositionInCenterIfOutsideViewport(i.getPosition(),1));else{const[{range:e}]=l,t=new Ah(e.startLineNumber,e.startColumn,e.endLineNumber,e.endColumn);r.pushEditOperations([t],l.map((e=>({text:e.text,range:Rh.lift(e.range),forceMoveMarkers:!0}))),(e=>{for(const{range:i}of e)if(Rh.areIntersectingOrTouching(i,t))return[new Ah(i.startLineNumber,i.startColumn,i.endLineNumber,i.endColumn)];return null}))}return!0}))}function yJ(e,t,i,n,s,o,r){const l=t.onTypeFormattingEditProvider.ordered(i);return 0===l.length||l[0].autoFormatTriggerCharacters.indexOf(s)<0?Promise.resolve(void 0):Promise.resolve(l[0].provideOnTypeFormattingEdits(i,n,s,o,r)).catch(a).then((t=>e.computeMoreMinimalEdits(i.uri,t)))}_J._selectors=new O,Xa.registerCommand("_executeFormatRangeProvider",(function(e,...t){return pJ(this,void 0,void 0,(function*(){const[i,n,s]=t;qr(an.isUri(i)),qr(Rh.isIRange(n));const o=e.get(za),r=e.get(fG),l=e.get(oL),h=yield o.createModelReference(i);try{return function(e,t,i,n,s,o){return pJ(this,void 0,void 0,(function*(){const r=t.documentRangeFormattingEditProvider.ordered(i);for(const t of r){const r=yield Promise.resolve(t.provideDocumentRangeFormattingEdits(i,n,s,o)).catch(a);if(Hd(r))return yield e.computeMoreMinimalEdits(i.uri,r)}}))}(r,l,h.object.textEditorModel,Rh.lift(n),s,Uh.None)}finally{h.dispose()}}))})),Xa.registerCommand("_executeFormatDocumentProvider",(function(e,...t){return pJ(this,void 0,void 0,(function*(){const[i,n]=t;qr(an.isUri(i));const s=e.get(za),o=e.get(fG),r=e.get(oL),l=yield s.createModelReference(i);try{return function(e,t,i,n,s){return pJ(this,void 0,void 0,(function*(){const o=fJ(t.documentFormattingEditProvider,t.documentRangeFormattingEditProvider,i);for(const t of o){const o=yield Promise.resolve(t.provideDocumentFormattingEdits(i,n,s)).catch(a);if(Hd(o))return yield e.computeMoreMinimalEdits(i.uri,o)}}))}(o,r,l.object.textEditorModel,n,Uh.None)}finally{l.dispose()}}))})),Xa.registerCommand("_executeFormatOnTypeProvider",(function(e,...t){return pJ(this,void 0,void 0,(function*(){const[i,n,s,o]=t;qr(an.isUri(i)),qr(Va.isIPosition(n)),qr("string"==typeof s);const r=e.get(za),a=e.get(fG),l=e.get(oL),h=yield r.createModelReference(i);try{return yJ(a,l,h.object.textEditorModel,Va.lift(n),s,o,Uh.None)}finally{h.dispose()}}))}));var SJ=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},LJ=function(e,t){return function(i,n){t(i,n,e)}},kJ=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let DJ=class{constructor(e,t,i){this._editor=e,this._languageFeaturesService=t,this._workerService=i,this._disposables=new N,this._sessionDisposables=new N,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((e=>{e.hasChanged(56)&&this._update()}))),this._update()}dispose(){this._disposables.dispose(),this._sessionDisposables.dispose()}_update(){if(this._sessionDisposables.clear(),!this._editor.getOption(56))return;if(!this._editor.hasModel())return;const e=this._editor.getModel(),[t]=this._languageFeaturesService.onTypeFormattingEditProvider.ordered(e);if(!t||!t.autoFormatTriggerCharacters)return;const i=new qb;for(const n of t.autoFormatTriggerCharacters)i.add(n.charCodeAt(0));this._sessionDisposables.add(this._editor.onDidType((e=>{const t=e.charCodeAt(e.length-1);i.has(t)&&this._trigger(String.fromCharCode(t))})))}_trigger(e){if(!this._editor.hasModel())return;if(this._editor.getSelections().length>1||!this._editor.getSelection().isEmpty())return;const t=this._editor.getModel(),i=this._editor.getPosition(),n=new jh,s=this._editor.onDidChangeModelContent((e=>{if(e.isFlush)return n.cancel(),void s.dispose();for(let t=0,o=e.changes.length;t{n.token.isCancellationRequested||Hd(e)&&(cJ.execute(this._editor,e,!0),mJ(e))})).finally((()=>{s.dispose()}))}};DJ.ID="editor.contrib.autoFormat",DJ=SJ([LJ(1,oL),LJ(2,fG)],DJ);let xJ=class{constructor(e,t,i){this.editor=e,this._languageFeaturesService=t,this._instantiationService=i,this._callOnDispose=new N,this._callOnModel=new N,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(55)&&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(vJ,this.editor,e,2,_L.None,Uh.None).catch(r))}};xJ.ID="editor.contrib.formatOnPaste",xJ=SJ([LJ(1,oL),LJ(2,Fa)],xJ);Dh(DJ.ID,DJ,2),Dh(xJ.ID,xJ,2),Lh(class extends bh{constructor(){super({id:"editor.action.formatDocument",label:ue(0,"Format Document"),alias:"Format Document",precondition:pl.and(Oh.notInCompositeEditor,Oh.writable,Oh.hasDocumentFormattingProvider),kbOpts:{kbExpr:Oh.editorTextFocus,primary:1572,linux:{primary:3111},weight:100},contextMenuOpts:{group:"1_modification",order:1.3}})}run(e,t){return kJ(this,void 0,void 0,(function*(){if(t.hasModel()){const i=e.get(Fa),n=e.get(vL);yield n.showWhile(i.invokeFunction(CJ,t,1,_L.None,Uh.None),250)}}))}}),Lh(class extends bh{constructor(){super({id:"editor.action.formatSelection",label:ue(0,"Format Selection"),alias:"Format Selection",precondition:pl.and(Oh.writable,Oh.hasDocumentSelectionFormattingProvider),kbOpts:{kbExpr:Oh.editorTextFocus,primary:pt(2089,2084),weight:100},contextMenuOpts:{when:Oh.hasNonEmptySelection,group:"1_modification",order:1.31}})}run(e,t){return kJ(this,void 0,void 0,(function*(){if(!t.hasModel())return;const i=e.get(Fa),n=t.getModel(),s=t.getSelections().map((e=>e.isEmpty()?new Rh(e.startLineNumber,1,e.startLineNumber,n.getLineMaxColumn(e.startLineNumber)):e)),o=e.get(vL);yield o.showWhile(i.invokeFunction(vJ,t,s,1,_L.None,Uh.None),250)}))}}),Xa.registerCommand("editor.action.format",(e=>kJ(void 0,void 0,void 0,(function*(){const t=e.get(Wa).getFocusedCodeEditor();if(!t||!t.hasModel())return;const i=e.get(Ya);t.getSelection().isEmpty()?yield i.executeCommand("editor.action.formatDocument"):yield i.executeCommand("editor.action.formatSelection")}))));class NJ{constructor(e){this.options=e,this.rangeHighlightDecorationId=void 0}provide(e,t){var i;const n=new N;e.canAcceptInBackground=!!(null===(i=this.options)||void 0===i?void 0:i.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const s=n.add(new I);return s.value=this.doProvide(e,t),n.add(this.onDidActiveTextEditorControlChange((()=>{s.value=void 0,s.value=this.doProvide(e,t)}))),n}doProvide(e,t){var i;const n=new N,s=this.activeTextEditorControl;if(s&&this.canProvideWithTextEditor(s)){const o={editor:s},r=sV(s);if(r){let e=null!==(i=s.saveViewState())&&void 0!==i?i:void 0;n.add(r.onDidChangeCursorPosition((()=>{var t;e=null!==(t=s.saveViewState())&&void 0!==t?t:void 0}))),o.restoreViewState=()=>{e&&s===this.activeTextEditorControl&&s.restoreViewState(e)},n.add(_(t.onCancellationRequested)((()=>{var e;return null===(e=o.restoreViewState)||void 0===e?void 0:e.call(o)})))}n.add(x((()=>this.clearDecorations(s)))),n.add(this.provideWithTextEditor(o,e,t))}else n.add(this.provideWithoutTextEditor(e,t));return n}canProvideWithTextEditor(e){return!0}gotoLocation({editor:e},t){e.setSelection(t.range),e.revealRangeInCenter(t.range,0),t.preserveFocus||e.focus();const i=e.getModel();i&&"getLineContent"in i&&Fs(`${i.getLineContent(t.range.startLineNumber)}`)}getModel(e){var t;return nV(e)?null===(t=e.getModel())||void 0===t?void 0:t.modified:e.getModel()}addDecorations(e,t){e.changeDecorations((e=>{const i=[];this.rangeHighlightDecorationId&&(i.push(this.rangeHighlightDecorationId.overviewRulerDecorationId),i.push(this.rangeHighlightDecorationId.rangeHighlightId),this.rangeHighlightDecorationId=void 0);const n=[{range:t,options:{description:"quick-access-range-highlight",className:"rangeHighlight",isWholeLine:!0}},{range:t,options:{description:"quick-access-range-highlight-overview",overviewRuler:{color:F_(mv),position:Cd.Full}}}],[s,o]=e.deltaDecorations(i,n);this.rangeHighlightDecorationId={rangeHighlightId:s,overviewRulerDecorationId:o}}))}clearDecorations(e){const t=this.rangeHighlightDecorationId;t&&(e.changeDecorations((e=>{e.deltaDecorations([t.overviewRulerDecorationId,t.rangeHighlightId],[])})),this.rangeHighlightDecorationId=void 0)}}class EJ extends NJ{constructor(){super({canAcceptInBackground:!0})}provideWithoutTextEditor(e){const t=ue(0,"Open a text editor first to go to a line.");return e.items=[{label:t}],e.ariaLabel=t,E.None}provideWithTextEditor(e,t,i){const n=e.editor,s=new N;s.add(t.onDidAccept((i=>{const[s]=t.selectedItems;if(s){if(!this.isValidLineNumber(n,s.lineNumber))return;this.gotoLocation(e,{range:this.toRange(s.lineNumber,s.column),keyMods:t.keyMods,preserveFocus:i.inBackground}),i.inBackground||t.hide()}})));const o=()=>{const e=this.parsePosition(n,t.value.trim().substr(EJ.PREFIX.length)),i=this.getPickLabel(n,e.lineNumber,e.column);if(t.items=[{lineNumber:e.lineNumber,column:e.column,label:i}],t.ariaLabel=i,!this.isValidLineNumber(n,e.lineNumber))return void this.clearDecorations(n);const s=this.toRange(e.lineNumber,e.column);n.revealRangeInCenter(s,0),this.addDecorations(n,s)};o(),s.add(t.onDidChangeValue((()=>o())));const r=sV(n);if(r){2===r.getOptions().get(67).renderType&&(r.updateOptions({lineNumbers:"on"}),s.add(x((()=>r.updateOptions({lineNumbers:"relative"})))))}return s}toRange(e=1,t=1){return{startLineNumber:e,startColumn:t,endLineNumber:e,endColumn:t}}parsePosition(e,t){const i=t.split(/,|:|#/).map((e=>parseInt(e,10))).filter((e=>!isNaN(e))),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)?ue(0,"Go to line {0} and character {1}.",t,i):ue(0,"Go to line {0}.",t);const n=e.getPosition()||{lineNumber:1,column:1},s=this.lineCount(e);return s>1?ue(0,"Current Line: {0}, Character: {1}. Type a line number between 1 and {2} to navigate to.",n.lineNumber,n.column,s):ue(0,"Current Line: {0}, Character: {1}. Type a line number to navigate to.",n.lineNumber,n.column)}isValidLineNumber(e,t){return!(!t||"number"!=typeof t)&&(t>0&&t<=this.lineCount(e))}isValidColumn(e,t,i){if(!i||"number"!=typeof i)return!1;const n=this.getModel(e);if(!n)return!1;const s={lineNumber:t,column:i};return n.validatePosition(s).equals(s)}lineCount(e){var t,i;return null!==(i=null===(t=this.getModel(e))||void 0===t?void 0:t.getLineCount())&&void 0!==i?i:0}}var IJ;EJ.PREFIX=":",function(e){e[e.PRESERVE=0]="PRESERVE",e[e.LAST=1]="LAST"}(IJ||(IJ={}));const MJ="workbench.contributions.quickaccess";var TJ,RJ,AJ,OJ,PJ,FJ,BJ,WJ;jl.add(MJ,new class{constructor(){this.providers=[],this.defaultProvider=void 0}registerQuickAccessProvider(e){return 0===e.prefix.length?this.defaultProvider=e:this.providers.push(e),this.providers.sort(((e,t)=>t.prefix.length-e.prefix.length)),x((()=>{this.providers.splice(this.providers.indexOf(e),1),this.defaultProvider===e&&(this.defaultProvider=void 0)}))}getQuickAccessProviders(){return Bd([this.defaultProvider,...this.providers])}getQuickAccessProvider(e){return e&&this.providers.find((t=>e.startsWith(t.prefix)))||void 0||this.defaultProvider}}),function(e){e.inspectTokensAction=ue(0,"Developer: Inspect Tokens")}(TJ||(TJ={})),function(e){e.gotoLineActionLabel=ue(0,"Go to Line/Column...")}(RJ||(RJ={})),function(e){e.helpQuickAccessActionLabel=ue(0,"Show all Quick Access Providers")}(AJ||(AJ={})),function(e){e.quickCommandActionLabel=ue(0,"Command Palette"),e.quickCommandHelp=ue(0,"Show And Run Commands")}(OJ||(OJ={})),function(e){e.quickOutlineActionLabel=ue(0,"Go to Symbol..."),e.quickOutlineByCategoryActionLabel=ue(0,"Go to Symbol by Category...")}(PJ||(PJ={})),function(e){e.editorViewAccessibleLabel=ue(0,"Editor content"),e.accessibilityHelpMessage=ue(0,"Press Alt+F1 for Accessibility Options.")}(FJ||(FJ={})),function(e){e.toggleHighContrast=ue(0,"Toggle High Contrast Theme")}(BJ||(BJ={})),function(e){e.bulkEditServiceSummary=ue(0,"Made {0} edits in {1} files")}(WJ||(WJ={}));var VJ=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},HJ=function(e,t){return function(i,n){t(i,n,e)}};let zJ=class extends EJ{constructor(e){super(),this.editorService=e,this.onDidActiveTextEditorControlChange=B.None}get activeTextEditorControl(){var e;return null!==(e=this.editorService.getFocusedCodeEditor())&&void 0!==e?e:void 0}};zJ=VJ([HJ(0,Wa)],zJ);class UJ extends bh{constructor(){super({id:UJ.ID,label:RJ.gotoLineActionLabel,alias:"Go to Line/Column...",precondition:void 0,kbOpts:{kbExpr:Oh.focus,primary:2085,mac:{primary:293},weight:100}})}run(e){e.get(cE).quickAccess.show(zJ.PREFIX)}}UJ.ID="editor.action.gotoLine",Lh(UJ),jl.as(MJ).registerQuickAccessProvider({ctor:zJ,prefix:zJ.PREFIX,helpEntries:[{description:RJ.gotoLineActionLabel,commandId:UJ.ID}]});class KJ extends E{constructor(e){super(),this.editor=e,this.widget=null,He&&(this._register(e.onDidChangeConfiguration((()=>this.update()))),this.update())}update(){const e=!this.editor.getOption(90);!this.widget&&e?this.widget=new jJ(this.editor):this.widget&&!e&&(this.widget.dispose(),this.widget=null)}dispose(){super.dispose(),this.widget&&(this.widget.dispose(),this.widget=null)}}KJ.ID="editor.contrib.iPadShowKeyboard";class jJ extends E{constructor(e){super(),this.editor=e,this._domNode=document.createElement("textarea"),this._domNode.className="iPadShowKeyboard",this._register(En(this._domNode,"touchstart",(e=>{this.editor.focus()}))),this._register(En(this._domNode,"focus",(e=>{this.editor.focus()}))),this.editor.addOverlayWidget(this)}dispose(){this.editor.removeOverlayWidget(this),super.dispose()}getId(){return jJ.ID}getDomNode(){return this._domNode}getPosition(){return{preference:1}}}jJ.ID="editor.contrib.ShowKeyboardWidget",Dh(KJ.ID,KJ,3);class qJ{constructor(e,t,i){this._editRange=e,this._originalSelection=t,this._text=i}getEditOperations(e,t){t.addTrackedEditOperation(this._editRange,this._text)}computeCursorState(e,t){const i=t.getInverseEditOperations()[0].range;return this._originalSelection.isEmpty()?new Ah(i.endLineNumber,Math.min(this._originalSelection.positionColumn,i.endColumn),i.endLineNumber,Math.min(this._originalSelection.positionColumn,i.endColumn)):new Ah(i.endLineNumber,i.endColumn-this._text.length,i.endLineNumber,i.endColumn)}}var $J,GJ=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},ZJ=function(e,t){return function(i,n){t(i,n,e)}};let YJ=$J=class{static get(e){return e.getContribution($J.ID)}constructor(e,t){this.editor=e,this.editorWorkerService=t,this.decorations=this.editor.createDecorationsCollection()}dispose(){}run(e,t){var i;null===(i=this.currentRequest)||void 0===i||i.cancel();const n=this.editor.getSelection(),s=this.editor.getModel();if(!s||!n)return;let o=n;if(o.startLineNumber!==o.endLineNumber)return;const a=new hL(this.editor,5),l=s.uri;return this.editorWorkerService.canNavigateValueSet(l)?(this.currentRequest=Yh((e=>this.editorWorkerService.navigateValueSet(l,o,t))),this.currentRequest.then((t=>{var i;if(!t||!t.range||!t.value)return;if(!a.validate(this.editor))return;const n=Rh.lift(t.range);let s=t.range;const l=t.value.length-(o.endColumn-o.startColumn);s={startLineNumber:s.startLineNumber,startColumn:s.startColumn,endLineNumber:s.endLineNumber,endColumn:s.startColumn+t.value.length},l>1&&(o=new Ah(o.startLineNumber,o.startColumn,o.endLineNumber,o.endColumn+l-1));const h=new qJ(n,o,t.value);this.editor.pushUndoStop(),this.editor.executeCommand(e,h),this.editor.pushUndoStop(),this.decorations.set([{range:s,options:$J.DECORATION}]),null===(i=this.decorationRemover)||void 0===i||i.cancel(),this.decorationRemover=td(350),this.decorationRemover.then((()=>this.decorations.clear())).catch(r)})).catch(r)):Promise.resolve(void 0)}};YJ.ID="editor.contrib.inPlaceReplaceController",YJ.DECORATION=Iw.register({description:"in-place-replace",className:"valueSetReplacement"}),YJ=$J=GJ([ZJ(1,fG)],YJ);function XJ(e,t){let i=0;for(let n=0;n=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},e0=function(e,t){return function(i,n){t(i,n,e)}};function t0(e,t,i,n,s){if(1===e.getLineCount()&&1===e.getLineMaxColumn(1))return[];const o=t.getLanguageConfiguration(e.getLanguageId()).indentationRules;if(!o)return[];for(n=Math.min(n,e.getLineCount());i<=n&&o.unIndentedLinePattern;){const t=e.getLineContent(i);if(!o.unIndentedLinePattern.test(t))break;i++}if(i>n-1)return[];const{tabSize:r,indentSize:a,insertSpaces:l}=e.getOptions(),h=(e,t)=>(t=t||1,_y.shiftIndent(e,e.length+t,r,a,l)),d=(e,t)=>(t=t||1,_y.unshiftIndent(e,e.length+t,r,a,l)),c=[];let u;const g=e.getLineContent(i);let p=g;if(null!=s){u=s;const e=ao(g);p=u+g.substring(e.length),o.decreaseIndentPattern&&o.decreaseIndentPattern.test(p)&&(u=d(u),p=u+g.substring(e.length)),g!==p&&c.push(Fq.replaceMove(new Ah(i,1,i,e.length+1),cc(u,a,l)))}else u=ao(g);let m=u;o.increaseIndentPattern&&o.increaseIndentPattern.test(p)?(m=h(m),u=h(u)):o.indentNextLinePattern&&o.indentNextLinePattern.test(p)&&(m=h(m));for(let f=++i;f<=n;f++){const t=e.getLineContent(f),i=ao(t),n=m+t.substring(i.length);o.decreaseIndentPattern&&o.decreaseIndentPattern.test(n)&&(m=d(m),u=d(u)),i!==m&&c.push(Fq.replaceMove(new Ah(f,1,f,i.length+1),cc(m,a,l))),o.unIndentedLinePattern&&o.unIndentedLinePattern.test(t)||(o.increaseIndentPattern&&o.increaseIndentPattern.test(n)?(u=h(u),m=u):m=o.indentNextLinePattern&&o.indentNextLinePattern.test(n)?h(m):u)}return c}class i0 extends bh{constructor(){super({id:i0.ID,label:ue(0,"Convert Indentation to Spaces"),alias:"Convert Indentation to Spaces",precondition:Oh.writable})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),s=t.getSelection();if(!s)return;const o=new u0(s,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[o]),t.pushUndoStop(),i.updateOptions({insertSpaces:!0})}}i0.ID="editor.action.indentationToSpaces";class n0 extends bh{constructor(){super({id:n0.ID,label:ue(0,"Convert Indentation to Tabs"),alias:"Convert Indentation to Tabs",precondition:Oh.writable})}run(e,t){const i=t.getModel();if(!i)return;const n=i.getOptions(),s=t.getSelection();if(!s)return;const o=new g0(s,n.tabSize);t.pushUndoStop(),t.executeCommands(this.id,[o]),t.pushUndoStop(),i.updateOptions({insertSpaces:!1})}}n0.ID="editor.action.indentationToTabs";class s0 extends bh{constructor(e,t,i){super(i),this.insertSpaces=e,this.displaySizeOnly=t}run(e,t){const i=e.get(cE),n=e.get(Ha),s=t.getModel();if(!s)return;const o=n.getCreationOptions(s.getLanguageId(),s.uri,s.isForSimpleWidget),r=s.getOptions(),a=[1,2,3,4,5,6,7,8].map((e=>({id:e.toString(),label:e.toString(),description:e===o.tabSize&&e===r.tabSize?ue(0,"Configured Tab Size"):e===o.tabSize?ue(0,"Default Tab Size"):e===r.tabSize?ue(0,"Current Tab Size"):void 0}))),l=Math.min(s.getOptions().tabSize-1,7);setTimeout((()=>{i.pick(a,{placeHolder:ue(0,"Select Tab Size for Current File"),activeItem:a[l]}).then((e=>{if(e&&s&&!s.isDisposed()){const t=parseInt(e.label,10);this.displaySizeOnly?s.updateOptions({tabSize:t}):s.updateOptions({tabSize:t,indentSize:t,insertSpaces:this.insertSpaces})}}))}),50)}}class o0 extends s0{constructor(){super(!1,!1,{id:o0.ID,label:ue(0,"Indent Using Tabs"),alias:"Indent Using Tabs",precondition:void 0})}}o0.ID="editor.action.indentUsingTabs";class r0 extends s0{constructor(){super(!0,!1,{id:r0.ID,label:ue(0,"Indent Using Spaces"),alias:"Indent Using Spaces",precondition:void 0})}}r0.ID="editor.action.indentUsingSpaces";class a0 extends s0{constructor(){super(!0,!0,{id:a0.ID,label:ue(0,"Change Tab Display Size"),alias:"Change Tab Display Size",precondition:void 0})}}a0.ID="editor.action.changeTabDisplaySize";class l0 extends bh{constructor(){super({id:l0.ID,label:ue(0,"Detect Indentation from Content"),alias:"Detect Indentation from Content",precondition:void 0})}run(e,t){const i=e.get(Ha),n=t.getModel();if(!n)return;const s=i.getCreationOptions(n.getLanguageId(),n.uri,n.isForSimpleWidget);n.detectIndentation(s.insertSpaces,s.tabSize)}}l0.ID="editor.action.detectIndentation";class h0{constructor(e,t){this._initialSelection=t,this._edits=[],this._selectionId=null;for(const i of e)i.range&&"string"==typeof i.text&&this._edits.push(i)}getEditOperations(e,t){for(const n of this._edits)t.addEditOperation(Rh.lift(n.range),n.text);let i=!1;Array.isArray(this._edits)&&1===this._edits.length&&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)}}let d0=class{constructor(e,t){this.editor=e,this._languageConfigurationService=t,this.callOnDispose=new N,this.callOnModel=new N,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(12)<4||this.editor.getOption(55)||this.editor.hasModel()&&this.callOnModel.add(this.editor.onDidPaste((({range:e})=>{this.trigger(e)})))}trigger(e){const t=this.editor.getSelections();if(null===t||t.length>1)return;const i=this.editor.getModel();if(!i)return;if(!i.tokenization.isCheapToTokenize(e.getStartPosition().lineNumber))return;const n=this.editor.getOption(12),{tabSize:s,indentSize:o,insertSpaces:r}=i.getOptions(),a=[],l={shiftIndent:e=>_y.shiftIndent(e,e.length+1,s,o,r),unshiftIndent:e=>_y.unshiftIndent(e,e.length+1,s,o,r)};let h=e.startLineNumber;for(;h<=e.endLineNumber&&this.shouldIgnoreLine(i,h);)h++;if(h>e.endLineNumber)return;let d=i.getLineContent(h);if(!/\S/.test(d.substring(0,e.startColumn-1))){const e=wy(n,i,i.getLanguageId(),h,l,this._languageConfigurationService);if(null!==e){const t=ao(d),n=XJ(e,s);if(n!==XJ(t,s)){const e=QJ(n,s,r);a.push({range:new Rh(h,1,h,t.length+1),text:e}),d=e+d.substr(t.length)}else{const e=yy(i,h,this._languageConfigurationService);if(0===e||8===e)return}}}const c=h;for(;hi.tokenization.getLineTokens(e),getLanguageId:()=>i.getLanguageId(),getLanguageIdAtPosition:(e,t)=>i.getLanguageIdAtPosition(e,t)},getLineContent:e=>e===c?d:i.getLineContent(e)},i.getLanguageId(),h+1,l,this._languageConfigurationService);if(null!==t){const n=XJ(t,s),o=XJ(ao(i.getLineContent(h+1)),s);if(n!==o){const t=n-o;for(let n=h+1;n<=e.endLineNumber;n++){const e=ao(i.getLineContent(n)),o=QJ(XJ(e,s)+t,s,r);o!==e&&a.push({range:new Rh(n,1,n,e.length+1),text:o})}}}}if(a.length>0){this.editor.pushUndoStop();const e=new h0(a,this.editor.getSelection());this.editor.executeCommand("autoIndentOnPaste",e),this.editor.pushUndoStop()}}shouldIgnoreLine(e,t){e.tokenization.forceTokenization(t);const i=e.getLineFirstNonWhitespaceColumn(t);if(0===i)return!0;const n=e.tokenization.getLineTokens(t);if(n.getCount()>0){const e=n.findTokenIndexAtOffset(i);if(e>=0&&1===n.getStandardTokenType(e))return!0}return!1}dispose(){this.callOnDispose.dispose(),this.callOnModel.dispose()}};function c0(e,t,i,n){if(1===e.getLineCount()&&1===e.getLineMaxColumn(1))return;let s="";for(let r=0;r0&&(t.pushUndoStop(),t.executeEdits(this.id,s),t.pushUndoStop())}}),Lh(class extends bh{constructor(){super({id:"editor.action.reindentselectedlines",label:ue(0,"Reindent Selected Lines"),alias:"Reindent Selected Lines",precondition:Oh.writable})}run(e,t){const i=e.get(Ju),n=t.getModel();if(!n)return;const s=t.getSelections();if(null===s)return;const o=[];for(const r of s){let e=r.startLineNumber,t=r.endLineNumber;if(e!==t&&1===r.endColumn&&t--,1===e){if(e===t)continue}else e--;const s=t0(n,i,e,t);o.push(...s)}o.length>0&&(t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop())}});var p0=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class m0{constructor(e,t){this.range=e,this.direction=t}}class f0{constructor(e,t,i){this.hint=e,this.anchor=t,this.provider=i,this._isResolved=!1}with(e){const t=new f0(this.hint,e.anchor,this.provider);return t._isResolved=this._isResolved,t._currentResolve=this._currentResolve,t}resolve(e){return p0(this,void 0,void 0,(function*(){if("function"==typeof this.provider.resolveInlayHint){if(this._currentResolve){if(yield this._currentResolve,e.isCancellationRequested)return;return this.resolve(e)}this._isResolved||(this._currentResolve=this._doResolve(e).finally((()=>this._currentResolve=void 0))),yield this._currentResolve}}))}_doResolve(e){var t,i;return p0(this,void 0,void 0,(function*(){try{const n=yield Promise.resolve(this.provider.resolveInlayHint(this.hint,e));this.hint.tooltip=null!==(t=null==n?void 0:n.tooltip)&&void 0!==t?t:this.hint.tooltip,this.hint.label=null!==(i=null==n?void 0:n.label)&&void 0!==i?i:this.hint.label,this._isResolved=!0}catch(n){a(n),this._isResolved=!1}}))}}class _0{static create(e,t,i,n){return p0(this,void 0,void 0,(function*(){const s=[],o=e.ordered(t).reverse().map((e=>i.map((i=>p0(this,void 0,void 0,(function*(){try{const o=yield e.provideInlayHints(t,i,n);(null==o?void 0:o.hints.length)&&s.push([o,e])}catch(o){a(o)}}))))));if(yield Promise.all(o.flat()),n.isCancellationRequested||t.isDisposed())throw new c;return new _0(i,s,t)}))}constructor(e,t,i){this._disposables=new N,this.ranges=e,this.provider=new Set;const n=[];for(const[s,o]of t){this._disposables.add(s),this.provider.add(o);for(const e of s.hints){const t=i.validatePosition(e.position);let s="before";const r=_0._getRangeAtPosition(i,t);let a;r.getStartPosition().isBefore(t)?(a=Rh.fromPositions(r.getStartPosition(),t),s="after"):(a=Rh.fromPositions(t,r.getEndPosition()),s="before"),n.push(new f0(e,new m0(a,s),o))}}this.items=n.sort(((e,t)=>Va.compare(e.hint.position,t.hint.position)))}dispose(){this._disposables.dispose()}static _getRangeAtPosition(e,t){const i=t.lineNumber,n=e.getWordAtPosition(t);if(n)return new Rh(i,n.startColumn,i,n.endColumn);e.tokenization.tokenizeIfCheap(i);const s=e.tokenization.getLineTokens(i),o=t.column-1,r=s.findTokenIndexAtOffset(o);let a=s.getStartOffset(r),l=s.getEndOffset(r);return l-a==1&&(a===o&&r>1?(a=s.getStartOffset(r-1),l=s.getEndOffset(r-1)):l===o&&rJl(e)?e.command.id:NZ())));for(const e of qU.all())u.has(e.desc.id)&&c.push(new Ka(e.desc.id,oh.label(e.desc,{renderShortTitle:!0}),void 0,!0,(()=>v0(this,void 0,void 0,(function*(){const i=yield o.createModelReference(d.uri);try{const s=new jU(i.object.textEditorModel,Rh.getStartPosition(d.range)),o=n.item.anchor.range;yield l.invokeFunction(e.runEditorCommand.bind(e),t,s,o)}finally{i.dispose()}})))));if(n.part.command){const{command:e}=n.part;c.push(new qa),c.push(new Ka(e.id,e.title,void 0,!0,(()=>v0(this,void 0,void 0,(function*(){var t;try{yield a.executeCommand(e.id,...null!==(t=e.arguments)&&void 0!==t?t:[])}catch(i){h.notify({severity:pL.Error,source:n.item.provider.displayName,message:i})}})))))}const g=t.getOption(126);r.showContextMenu({domForShadowRoot:g&&null!==(s=t.getDomNode())&&void 0!==s?s:void 0,getAnchor:()=>{const e=Hn(i);return{x:e.left,y:e.top+e.height+8}},getActions:()=>c,onHide:()=>{t.focus()},autoSelectFirstItem:!0})}))}function C0(e,t,i,n){return v0(this,void 0,void 0,(function*(){const s=e.get(za),o=yield s.createModelReference(n.uri);yield i.invokeWithinContext((e=>v0(this,void 0,void 0,(function*(){const s=t.hasSideBySideModifier,r=e.get(Ol),a=qW.inPeekEditor.getValue(r),l=!s&&i.getOption(87)&&!a;return new $U({openToSide:s,openInPeek:l,muteMessage:!0},{title:{value:"",original:""},id:"",precondition:void 0}).run(e,new jU(o.object.textEditorModel,Rh.getStartPosition(n.range)),Rh.lift(n.range))})))),o.dispose()}))}var w0,y0=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},S0=function(e,t){return function(i,n){t(i,n,e)}},L0=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class k0{constructor(){this._entries=new js(50)}get(e){const t=k0._key(e);return this._entries.get(t)}set(e,t){const i=k0._key(e);this._entries.set(i,t)}static _key(e){return`${e.uri.toString()}/${e.getVersionId()}`}}const D0=Ba("IInlayHintsCache");yu(D0,k0,1);class x0{constructor(e,t){this.item=e,this.index=t}get part(){const e=this.item.hint.label;return"string"==typeof e?{label:e}:e[this.index]}}class N0{constructor(e,t){this.part=e,this.hasTriggerModifier=t}}let E0=w0=class{static get(e){var t;return null!==(t=e.getContribution(w0.ID))&&void 0!==t?t:void 0}constructor(e,t,i,n,s,o,r){this._editor=e,this._languageFeaturesService=t,this._inlayHintsCache=n,this._commandService=s,this._notificationService=o,this._instaService=r,this._disposables=new N,this._sessionDisposables=new N,this._decorationsMetadata=new Map,this._ruleFactory=new zE(this._editor),this._activeRenderMode=0,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((e=>{e.hasChanged(139)&&this._update()}))),this._update()}dispose(){this._sessionDisposables.dispose(),this._removeAllDecorations(),this._disposables.dispose()}_update(){this._sessionDisposables.clear(),this._removeAllDecorations();const e=this._editor.getOption(139);if("off"===e.enabled)return;const t=this._editor.getModel();if(!t||!this._languageFeaturesService.inlayHintsProvider.has(t))return;const i=this._inlayHintsCache.get(t);let n;i&&this._updateHintsDecorators([t.getFullModelRange()],i),this._sessionDisposables.add(x((()=>{t.isDisposed()||this._cacheHintsForFastRestore(t)})));const s=new Set,o=new rd((()=>L0(this,void 0,void 0,(function*(){const e=Date.now();null==n||n.dispose(!0),n=new jh;const i=t.onWillDispose((()=>null==n?void 0:n.cancel()));try{const i=n.token,r=yield _0.create(this._languageFeaturesService.inlayHintsProvider,t,this._getHintsRanges(),i);if(o.delay=this._debounceInfo.update(t,Date.now()-e),i.isCancellationRequested)return void r.dispose();for(const e of r.provider)"function"!=typeof e.onDidChangeInlayHints||s.has(e)||(s.add(e),this._sessionDisposables.add(e.onDidChangeInlayHints((()=>{o.isScheduled()||o.schedule()}))));this._sessionDisposables.add(r),this._updateHintsDecorators(r.ranges,r.items),this._cacheHintsForFastRestore(t)}catch(a){r(a)}finally{n.dispose(),i.dispose()}}))),this._debounceInfo.get(t));if(this._sessionDisposables.add(o),this._sessionDisposables.add(x((()=>null==n?void 0:n.dispose(!0)))),o.schedule(0),this._sessionDisposables.add(this._editor.onDidScrollChange((e=>{!e.scrollTopChanged&&o.isScheduled()||o.schedule()}))),this._sessionDisposables.add(this._editor.onDidChangeModelContent((e=>{const t=Math.max(o.delay,1250);o.schedule(t)}))),"on"===e.enabled)this._activeRenderMode=0;else{let t,i;"onUnlessPressed"===e.enabled?(t=0,i=1):(t=1,i=0),this._activeRenderMode=t,this._sessionDisposables.add(ks.getInstance().event((e=>{if(!this._editor.hasModel())return;const n=e.altKey&&e.ctrlKey&&!e.shiftKey&&!e.metaKey?i:t;if(n!==this._activeRenderMode){this._activeRenderMode=n;const e=this._editor.getModel(),t=this._copyInlayHintsWithCurrentAnchor(e);this._updateHintsDecorators([e.getFullModelRange()],t),o.schedule(0)}})))}this._sessionDisposables.add(this._installDblClickGesture((()=>o.schedule(0)))),this._sessionDisposables.add(this._installLinkGesture()),this._sessionDisposables.add(this._installContextMenu())}_installLinkGesture(){const e=new N,t=e.add(new RR(this._editor)),i=new N;return e.add(i),e.add(t.onMouseMoveOrRelevantKeyDown((e=>{const[t]=e,n=this._getInlayHintLabelPart(t),s=this._editor.getModel();if(!n||!s)return void i.clear();const o=new jh;i.add(x((()=>o.dispose(!0)))),n.item.resolve(o.token),this._activeInlayHintPart=n.part.command||n.part.location?new N0(n,t.hasTriggerModifier):void 0;const r=s.validatePosition(n.item.hint.position).lineNumber,a=new Rh(r,1,r,s.getLineMaxColumn(r)),l=this._getInlineHintsForRange(a);this._updateHintsDecorators([a],l),i.add(x((()=>{this._activeInlayHintPart=void 0,this._updateHintsDecorators([a],l)})))}))),e.add(t.onCancel((()=>i.clear()))),e.add(t.onExecute((e=>L0(this,void 0,void 0,(function*(){const t=this._getInlayHintLabelPart(e);if(t){const i=t.part;i.location?this._instaService.invokeFunction(C0,e,this._editor,i.location):kC.is(i.command)&&(yield this._invokeCommand(i.command,t.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((t=>L0(this,void 0,void 0,(function*(){if(2!==t.event.detail)return;const i=this._getInlayHintLabelPart(t);if(i&&(t.event.preventDefault(),yield i.item.resolve(Uh.None),Hd(i.item.hint.textEdits))){const t=i.item.hint.textEdits.map((e=>Fq.replace(Rh.lift(e.range),e.text)));this._editor.executeEdits("inlayHint.default",t),e()}}))))}_installContextMenu(){return this._editor.onContextMenu((e=>L0(this,void 0,void 0,(function*(){if(!(e.event.target instanceof HTMLElement))return;const t=this._getInlayHintLabelPart(e);t&&(yield this._instaService.invokeFunction(b0,this._editor,e.event.target,t))}))))}_getInlayHintLabelPart(e){var t;if(6!==e.target.type)return;const i=null===(t=e.target.detail.injectedText)||void 0===t?void 0:t.options;return i instanceof Ew&&(null==i?void 0:i.attachedData)instanceof x0?i.attachedData:void 0}_invokeCommand(e,t){var i;return L0(this,void 0,void 0,(function*(){try{yield this._commandService.executeCommand(e.id,...null!==(i=e.arguments)&&void 0!==i?i:[])}catch(n){this._notificationService.notify({severity:pL.Error,source:t.provider.displayName,message:n})}}))}_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 s=e.getDecorationRange(i);if(s){const e=new m0(s,n.item.anchor.direction),i=n.item.with({anchor:e});t.set(n.item,i)}}return Array.from(t.values())}_getHintsRanges(){const e=this._editor.getModel(),t=this._editor.getVisibleRangesPlusViewportAboveBelow(),i=[];for(const n of t.sort(Rh.compareRangesUsingStarts)){const t=e.validateRange(new Rh(n.startLineNumber-30,n.startColumn,n.endLineNumber+30,n.endColumn));0!==i.length&&Rh.areIntersectingOrTouching(i[i.length-1],t)?i[i.length-1]=Rh.plusRange(i[i.length-1],t):i.push(t)}return i}_updateHintsDecorators(e,t){var i,n;const s=[],o=(e,t,i,n,o)=>{const r={content:i,inlineClassNameAffectsLetterSpacing:!0,inlineClassName:t.className,cursorStops:n,attachedData:o};s.push({item:e,classNameRef:t,decoration:{range:e.anchor.range,options:{description:"InlayHint",showIfCollapsed:e.anchor.range.isEmpty(),collapseOnReplaceEdit:!e.anchor.range.isEmpty(),stickiness:0,[e.anchor.direction]:0===this._activeRenderMode?r:void 0}}})},r=(e,t)=>{const i=this._ruleFactory.createClassNameRef({width:(a/3|0)+"px",display:"inline-block"});o(e,i,"\u200a",t?Sd.Right:Sd.None)},{fontSize:a,fontFamily:l,padding:h,isUniform:d}=this._getLayoutInfo(),c="--code-editorInlayHintsFontFamily";this._editor.getContainerDomNode().style.setProperty(c,l);for(const p of t){p.hint.paddingLeft&&r(p,!1);const e="string"==typeof p.hint.label?[{label:p.hint.label}]:p.hint.label;for(let t=0;tw0._MAX_DECORATORS)break}const u=[];for(const p of e)for(const{id:e}of null!==(n=this._editor.getDecorationsInRange(p))&&void 0!==n?n:[]){const t=this._decorationsMetadata.get(e);t&&(u.push(e),t.classNameRef.dispose(),this._decorationsMetadata.delete(e))}const g=WN.capture(this._editor);this._editor.changeDecorations((e=>{const t=e.deltaDecorations(u,s.map((e=>e.decoration)));for(let i=0;ii)&&(s=i);const o=e.fontFamily||n;return{fontSize:s,fontFamily:o,padding:t,isUniform:!t&&o===n&&s===i}}_removeAllDecorations(){this._editor.removeDecorations(Array.from(this._decorationsMetadata.keys()));for(const e of this._decorationsMetadata.values())e.classNameRef.dispose();this._decorationsMetadata.clear()}};function I0(e){return e.replace(/[ \t]/g,"\xa0")}E0.ID="editor.contrib.InlayHints",E0._MAX_DECORATORS=1500,E0=w0=y0([S0(1,oL),S0(2,SE),S0(3,D0),S0(4,Ya),S0(5,mL),S0(6,Fa)],E0),Xa.registerCommand("_executeInlayHintProvider",((e,...t)=>L0(void 0,void 0,void 0,(function*(){const[i,n]=t;qr(an.isUri(i)),qr(Rh.isIRange(n));const{inlayHintsProvider:s}=e.get(oL),o=yield e.get(za).createModelReference(i);try{const e=yield _0.create(s,o.object.textEditorModel,[Rh.lift(n)],Uh.None),t=e.items.map((e=>e.hint));return setTimeout((()=>e.dispose()),0),t}finally{o.dispose()}}))));var M0=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},T0=function(e,t){return function(i,n){t(i,n,e)}},R0=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))},A0=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,i=e[Symbol.asyncIterator];return i?i.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=e[i]&&function(t){return new Promise((function(n,s){(function(e,t,i,n){Promise.resolve(n).then((function(t){e({value:t,done:i})}),t)})(n,s,(t=e[i](t)).done,t.value)}))}}};class O0 extends uK{constructor(e,t,i,n){super(10,t,e.item.anchor.range,i,n,!0),this.part=e}}let P0=class extends WK{constructor(e,t,i,n,s,o){super(e,t,i,n,o),this._resolverService=s,this.hoverOrdinal=6}suggestHoverAnchor(e){var t;if(!E0.get(this._editor))return null;if(6!==e.target.type)return null;const i=null===(t=e.target.detail.injectedText)||void 0===t?void 0:t.options;return i instanceof Ew&&i.attachedData instanceof x0?new O0(i.attachedData,this,e.event.posx,e.event.posy):null}computeSync(){return[]}computeAsync(e,t,i){return e instanceof O0?new cd((t=>R0(this,void 0,void 0,(function*(){var n,s,o,r;const{part:a}=e;if(yield a.item.resolve(i),i.isCancellationRequested)return;let l,h;if("string"==typeof a.item.hint.tooltip?l=(new Ta).appendText(a.item.hint.tooltip):a.item.hint.tooltip&&(l=a.item.hint.tooltip),l&&t.emitOne(new BK(this,e.range,[l],!1,0)),Hd(a.item.hint.textEdits)&&t.emitOne(new BK(this,e.range,[(new Ta).appendText(ue(0,"Double-click to insert"))],!1,10001)),"string"==typeof a.part.tooltip?h=(new Ta).appendText(a.part.tooltip):a.part.tooltip&&(h=a.part.tooltip),h&&t.emitOne(new BK(this,e.range,[h],!1,1)),a.part.location||a.part.command){let i;const n=ue(0,"altKey"===this._editor.getOption(77)?Pe?"cmd + click":"ctrl + click":Pe?"option + click":"alt + click");a.part.location&&a.part.command?i=(new Ta).appendText(ue(0,"Go to Definition ({0}), right click for more",n)):a.part.location?i=(new Ta).appendText(ue(0,"Go to Definition ({0})",n)):a.part.command&&(i=new Ta(`[${ue(0,"Execute Command")}](${d=a.part.command,an.from({scheme:vn.command,path:d.id,query:d.arguments&&encodeURIComponent(JSON.stringify(d.arguments))}).toString()} "${a.part.command.title}") (${n})`,{isTrusted:!0})),i&&t.emitOne(new BK(this,e.range,[i],!1,1e4))}var d;const c=yield this._resolveInlayHintLabelPartHover(a,i);try{for(var u,g=!0,p=A0(c);!(n=(u=yield p.next()).done);g=!0){r=u.value,g=!1;const e=r;t.emitOne(e)}}catch(m){s={error:m}}finally{try{g||n||!(o=p.return)||(yield o.call(p))}finally{if(s)throw s.error}}})))):cd.EMPTY}_resolveInlayHintLabelPartHover(e,t){return R0(this,void 0,void 0,(function*(){if(!e.part.location)return cd.EMPTY;const{uri:i,range:n}=e.part.location,s=yield this._resolverService.createModelReference(i);try{const i=s.object.textEditorModel;return this._languageFeaturesService.hoverProvider.has(i)?AK(this._languageFeaturesService.hoverProvider,i,new Va(n.startLineNumber,n.startColumn),t).filter((e=>!Ra(e.hover.contents))).map((t=>new BK(this,e.item.anchor.range,t.hover.contents,!1,2+t.ordinal))):cd.EMPTY}finally{s.dispose()}}))}};P0=M0([T0(1,Lc),T0(2,qk),T0(3,pu),T0(4,za),T0(5,oL)],P0),Dh(E0.ID,E0,1),gK.register(P0);class F0 extends E{constructor(e,t){super(),this.contextKeyService=e,this.model=t,this.inlineCompletionVisible=F0.inlineSuggestionVisible.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentation=F0.inlineSuggestionHasIndentation.bindTo(this.contextKeyService),this.inlineCompletionSuggestsIndentationLessThanTabSize=F0.inlineSuggestionHasIndentationLessThanTabSize.bindTo(this.contextKeyService),this.suppressSuggestions=F0.suppressSuggestions.bindTo(this.contextKeyService),this._register(Kj((e=>{const t=this.model.read(e),i=null==t?void 0:t.state.read(e),n=!!(null==i?void 0:i.inlineCompletion)&&void 0!==(null==i?void 0:i.ghostText)&&!(null==i?void 0:i.ghostText.isEmpty());this.inlineCompletionVisible.set(n),(null==i?void 0:i.ghostText)&&(null==i?void 0:i.inlineCompletion)&&this.suppressSuggestions.set(i.inlineCompletion.inlineCompletion.source.inlineCompletions.suppressSuggestions)}))),this._register(Kj((e=>{const t=this.model.read(e);let i=!1,n=!0;const s=null==t?void 0:t.ghostText.read(e);if((null==t?void 0:t.selectedSuggestItem)&&s&&s.parts.length>0){const{column:e,lines:o}=s.parts[0],r=o[0];if(e<=t.textModel.getLineIndentColumn(s.lineNumber)){let e=ro(r);-1===e&&(e=r.length-1),i=e>0;const s=t.textModel.getOptions().tabSize;n=dc.visibleColumnFromColumn(r,e+1,s)t)throw new f(`startColumn ${e} cannot be after endColumnExclusive ${t}`)}toRange(e){return new Rh(e,this.startColumn,e,this.endColumnExclusive)}equals(e){return this.startColumn===e.startColumn&&this.endColumnExclusive===e.endColumnExclusive}}function H0(e,t){return new Va(e.lineNumber+t.lineNumber-1,1===t.lineNumber?e.column+t.column-1:t.column)}function z0(e){let t=1,i=1;for(const n of e)"\n"===n?(t++,i=1):i++;return new Va(t,i)}class U0{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])))}renderForScreenReader(e){if(0===this.parts.length)return"";const t=this.parts[this.parts.length-1],i=function(e,t){const i=new B0(e),n=t.map((e=>{const t=Rh.lift(e.range);return{startOffset:i.getOffset(t.getStartPosition()),endOffset:i.getOffset(t.getEndPosition()),text:e.text}}));n.sort(((e,t)=>t.startOffset-e.startOffset));for(const s of n)e=e.substring(0,s.startOffset)+s.text+e.substring(s.endOffset);return e}(e.substr(0,t.column-1),this.parts.map((e=>({range:{startLineNumber:1,endLineNumber:1,startColumn:e.column,endColumn:e.column},text:e.lines.join("\n")}))));return i.substring(this.parts[0].column-1)}isEmpty(){return this.parts.every((e=>0===e.lines.length))}get lineCount(){return 1+this.parts.reduce(((e,t)=>e+t.lines.length-1),0)}}class K0{constructor(e,t,i){this.column=e,this.lines=t,this.preview=i}equals(e){return this.column===e.column&&this.lines.length===e.lines.length&&this.lines.every(((t,i)=>t===e.lines[i]))}}class j0{constructor(e,t,i,n=0){this.lineNumber=e,this.columnRange=t,this.newLines=i,this.additionalReservedLineCount=n,this.parts=[new K0(this.columnRange.endColumnExclusive,this.newLines,!1)]}renderForScreenReader(e){return this.newLines.join("\n")}get lineCount(){return this.newLines.length}isEmpty(){return this.parts.every((e=>0===e.lines.length))}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 q0(e,t){return e===t||!(!e||!t)&&((e instanceof U0&&t instanceof U0||e instanceof j0&&t instanceof j0)&&e.equals(t))}var $0=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},G0=function(e,t){return function(i,n){t(i,n,e)}};const Z0="ghost-text";let Y0=class extends E{constructor(e,t,i){super(),this.editor=e,this.model=t,this.languageService=i,this.isDisposed=Aj(this,!1),this.currentTextModel=Yj(this.editor.onDidChangeModel,(()=>this.editor.getModel())),this.uiState=Wj(this,(e=>{if(this.isDisposed.read(e))return;const t=this.currentTextModel.read(e);if(t!==this.model.targetTextModel.read(e))return;const i=this.model.ghostText.read(e);if(!i)return;const n=i instanceof j0?i.columnRange:void 0,s=[],o=[];function r(e,t){if(o.length>0){const i=o[o.length-1];t&&i.decorations.push(new bA(i.content.length+1,i.content.length+1+e[0].length,t,0)),i.content+=e[0],e=e.slice(1)}for(const i of e)o.push({content:i,decorations:t?[new bA(1,i.length+1,t,0)]:[]})}const a=t.getLineContent(i.lineNumber);let l,h=0;for(const c of i.parts){let e=c.lines;void 0===l?(s.push({column:c.column,text:e[0],preview:c.preview}),e=e.slice(1)):r([a.substring(h,c.column-1)],void 0),e.length>0&&(r(e,Z0),void 0===l&&c.column<=a.length&&(l=c.column)),h=c.column-1}void 0!==l&&r([a.substring(h)],void 0);const d=void 0!==l?new V0(l,a.length+1):void 0;return{replacedRange:n,inlineTexts:s,additionalLines:o,hiddenRange:d,lineNumber:i.lineNumber,additionalReservedLineCount:this.model.minReservedLineCount.read(e),targetTextModel:t}})),this.decorations=Wj(this,(e=>{const t=this.uiState.read(e);if(!t)return[];const i=[];t.replacedRange&&i.push({range:t.replacedRange.toRange(t.lineNumber),options:{inlineClassName:"inline-completion-text-to-replace",description:"GhostTextReplacement"}}),t.hiddenRange&&i.push({range:t.hiddenRange.toRange(t.lineNumber),options:{inlineClassName:"ghost-text-hidden",description:"ghost-text-hidden"}});for(const n of t.inlineTexts)i.push({range:Rh.fromPositions(new Va(t.lineNumber,n.column)),options:{description:Z0,after:{content:n.text,inlineClassName:n.preview?"ghost-text-decoration-preview":"ghost-text-decoration",cursorStops:Sd.Left},showIfCollapsed:!0}});return i})),this.additionalLinesWidget=this._register(new X0(this.editor,this.languageService.languageIdCodec,Wj((e=>{const t=this.uiState.read(e);return t?{lineNumber:t.lineNumber,additionalLines:t.additionalLines,minReservedLineCount:t.additionalReservedLineCount,targetTextModel:t.targetTextModel}:void 0})))),this._register(x((()=>{this.isDisposed.set(!0,void 0)}))),this._register(function(e,t){const i=new N,n=e.createDecorationsCollection();return i.add(Uj({debugName:()=>`Apply decorations from ${t.debugName}`},(e=>{const i=t.read(e);n.set(i)}))),i.add({dispose:()=>{n.clear()}}),i}(this.editor,this.decorations))}ownsViewZone(e){return this.additionalLinesWidget.viewZoneId===e}};Y0=$0([G0(2,Lc)],Y0);class X0 extends E{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=Qj("editorOptionChanged",B.filter(this.editor.onDidChangeConfiguration,(e=>e.hasChanged(33)||e.hasChanged(116)||e.hasChanged(98)||e.hasChanged(93)||e.hasChanged(51)||e.hasChanged(50)||e.hasChanged(66)))),this._register(Kj((e=>{const t=this.lines.read(e);this.editorOptionsChanged.read(e),t?this.updateLines(t.lineNumber,t.additionalLines,t.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:s}=n.getOptions();this.editor.changeViewZones((n=>{this._viewZoneId&&(n.removeZone(this._viewZoneId),this._viewZoneId=void 0);const o=Math.max(t.length,i);if(o>0){const i=document.createElement("div");!function(e,t,i,n,s){const o=n.get(33),r=n.get(116),a="none",l=n.get(93),h=n.get(51),d=n.get(50),c=n.get(66),u=new eu(1e4);u.appendString('
    ');for(let m=0,f=i.length;m');const g=To(n),p=Io(n),f=PC.createEmpty(n,s);EA(new kA(d.isMonospace&&!o,d.canUseHalfwidthRightwardsArrow,n,!1,g,p,0,f,e.decorations,t,0,d.spaceWidth,d.middotWidth,d.wsmiddotWidth,r,a,l,h!==MS.OFF,null),u),u.appendString("
    ")}u.appendString(""),Hk(e,d);const g=u.build(),p=Q0?Q0.createHTML(g):g;e.innerHTML=p}(i,s,t,this.editor.getOptions(),this.languageIdCodec),this._viewZoneId=n.addZone({afterLineNumber:e,heightInLines:o,domNode:i,afterColumnAffinity:1})}}))}}const Q0=Fk("editorGhostText",{createHTML:e=>e});class J0{constructor(e){this.lines=e,this.tokenization={getLineTokens:e=>this.lines[e-1]}}getLineCount(){return this.lines.length}getLineLength(e){return this.lines[e-1].getLineContent().length}}class e1{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return 95===e||e>=97&&e<=122||e>=65&&e<=90}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:14,pos:this.pos,len:0};const e=this.pos;let t,i=0,n=this.value.charCodeAt(e);if(t=e1._table[n],"number"==typeof t)return this.pos+=1,{type:t,pos:e,len:1};if(e1.isDigitCharacter(n)){t=8;do{i+=1,n=this.value.charCodeAt(e+i)}while(e1.isDigitCharacter(n));return this.pos+=i,{type:t,pos:e,len:i}}if(e1.isVariableCharacter(n)){t=9;do{n=this.value.charCodeAt(e+ ++i)}while(e1.isVariableCharacter(n)||e1.isDigitCharacter(n));return this.pos+=i,{type:t,pos:e,len:i}}t=10;do{i+=1,n=this.value.charCodeAt(e+i)}while(!isNaN(n)&&void 0===e1._table[n]&&!e1.isDigitCharacter(n)&&!e1.isVariableCharacter(n));return this.pos+=i,{type:t,pos:e,len:i}}}e1._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};class t1{constructor(){this._children=[]}appendChild(e){return e instanceof i1&&this._children[this._children.length-1]instanceof i1?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),s=i.children.slice(0);s.splice(n,1,...t),i._children=s,function e(t,i){for(const n of t)n.parent=i,e(n.children,n)}(t,i)}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 d1)return e;e=e.parent}}toString(){return this.children.reduce(((e,t)=>e+t.toString()),"")}len(){return 0}}class i1 extends t1{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new i1(this.value)}}class n1 extends t1{}class s1 extends n1{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 0===this.index}get choice(){return 1===this._children.length&&this._children[0]instanceof o1?this._children[0]:void 0}clone(){const e=new s1(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map((e=>e.clone())),e}}class o1 extends t1{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof i1&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new o1;return this.options.forEach(e.appendChild,e),e}}class r1 extends t1{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((e=>e instanceof a1&&Boolean(e.elseValue)))&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof a1){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const e=new r1;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map((e=>e.clone())),e}}class a1 extends t1{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}resolve(e){return"upcase"===this.shorthandName?e?e.toLocaleUpperCase():"":"downcase"===this.shorthandName?e?e.toLocaleLowerCase():"":"capitalize"===this.shorthandName?e?e[0].toLocaleUpperCase()+e.substr(1):"":"pascalcase"===this.shorthandName?e?this._toPascalCase(e):"":"camelcase"===this.shorthandName?e?this._toCamelCase(e):"":Boolean(e)&&"string"==typeof this.ifValue?this.ifValue:Boolean(e)||"string"!=typeof this.elseValue?e||"":this.elseValue}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((e=>e.charAt(0).toUpperCase()+e.substr(1))).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(((e,t)=>0===t?e.charAt(0).toLowerCase()+e.substr(1):e.charAt(0).toUpperCase()+e.substr(1))).join(""):e}clone(){return new a1(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class l1 extends n1{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),void 0!==t&&(this._children=[new i1(t)],!0)}clone(){const e=new l1(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map((e=>e.clone())),e}}function h1(e,t){const i=[...e];for(;i.length>0;){const e=i.shift();if(!t(e))break;i.unshift(...e.children)}}class d1 extends t1{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk((function(i){return i instanceof s1&&(e.push(i),t=!t||t.indexn===e?(i=!0,!1):(t+=n.len(),!0))),i?t:-1}fullLen(e){let t=0;return h1([e],(e=>(t+=e.len(),!0))),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof s1&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk((t=>(t instanceof l1&&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)}clone(){const e=new d1;return this._children=this.children.map((e=>e.clone())),e}walk(e){h1(this.children,e)}}class c1{constructor(){this._scanner=new e1,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const n=new d1;return this.parseFragment(e,n),this.ensureFinalTabstop(n,null!=i&&i,null!=t&&t),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,s=[];t.walk((e=>(e instanceof s1&&(e.isFinalTabstop?n.set(0,void 0):!n.has(e.index)&&e.children.length>0?n.set(e.index,e.children):s.push(e)),!0)));const o=(e,i)=>{const s=n.get(e.index);if(!s)return;const r=new s1(e.index);r.transform=e.transform;for(const t of s){const e=t.clone();r.appendChild(e),e instanceof s1&&n.has(e.index)&&!i.has(e.index)&&(i.add(e.index),o(e,i),i.delete(e.index))}t.replace(e,[r])},r=new Set;for(const a of s)o(a,r);return t.children.slice(i)}ensureFinalTabstop(e,t,i){if(t||i&&e.placeholders.length>0){e.placeholders.find((e=>0===e.index))||e.appendChild(new s1(0))}}_accept(e,t){if(void 0===e||this._token.type===e){const e=!t||this._scanner.tokenText(this._token);return this._token=this._scanner.next(),e}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(14===this._token.type)return!1;if(5===this._token.type){const e=this._scanner.next();if(0!==e.type&&4!==e.type&&5!==e.type)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(5,!0))&&(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new i1(t)),!0)}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new s1(Number(t)):new l1(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const n=new s1(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(n),!0;if(!this._parse(n))return e.appendChild(new i1("${"+t+":")),n.children.forEach(e.appendChild,e),!0}else{if(!(n.index>0&&this._accept(7)))return this._accept(6)?this._parseTransform(n)?(e.appendChild(n),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(n),!0):this._backTo(i);{const t=new o1;for(;;){if(this._parseChoiceElement(t)){if(this._accept(2))continue;if(this._accept(7)&&(n.appendChild(t),this._accept(4)))return e.appendChild(n),!0}return this._backTo(i),!1}}}}_parseChoiceElement(e){const t=this._token,i=[];for(;2!==this._token.type&&7!==this._token.type;){let e;if(e=(e=this._accept(5,!0))?this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||e:this._accept(void 0,!0),!e)return this._backTo(t),!1;i.push(e)}return 0===i.length?(this._backTo(t),!1):(e.appendChild(new i1(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const n=new l1(t);if(!this._accept(1))return this._accept(6)?this._parseTransform(n)?(e.appendChild(n),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(n),!0):this._backTo(i);for(;;){if(this._accept(4))return e.appendChild(n),!0;if(!this._parse(n))return e.appendChild(new i1("${"+t+":")),n.children.forEach(e.appendChild,e),!0}}_parseTransform(e){const t=new r1;let i="",n="";for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(6,!0)||e,i+=e;else{if(14===this._token.type)return!1;i+=this._accept(void 0,!0)}}for(;!this._accept(6);){let e;if(e=this._accept(5,!0))e=this._accept(5,!0)||this._accept(6,!0)||e,t.appendChild(new i1(e));else if(!this._parseFormatString(t)&&!this._parseAnything(t))return!1}for(;!this._accept(4);){if(14===this._token.type)return!1;n+=this._accept(void 0,!0)}try{t.regexp=new RegExp(i,n)}catch(Mre){return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const n=this._accept(8,!0);if(!n)return this._backTo(t),!1;if(!i)return e.appendChild(new a1(Number(n))),!0;if(this._accept(4))return e.appendChild(new a1(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1;if(this._accept(6)){const i=this._accept(9,!0);return i&&this._accept(4)?(e.appendChild(new a1(Number(n),i)),!0):(this._backTo(t),!1)}if(this._accept(11)){const t=this._until(4);if(t)return e.appendChild(new a1(Number(n),void 0,t,void 0)),!0}else if(this._accept(12)){const t=this._until(4);if(t)return e.appendChild(new a1(Number(n),void 0,void 0,t)),!0}else if(this._accept(13)){const t=this._until(1);if(t){const i=this._until(4);if(i)return e.appendChild(new a1(Number(n),void 0,t,i)),!0}}else{const t=this._until(4);if(t)return e.appendChild(new a1(Number(n),void 0,void 0,t)),!0}return this._backTo(t),!1}_parseAnything(e){return 14!==this._token.type&&(e.appendChild(new i1(this._scanner.tokenText(this._token))),this._accept(void 0),!0)}}var u1=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function g1(e,t,i,n,s=Uh.None,o){return u1(this,void 0,void 0,(function*(){const r=function(e,t){const i=t.getWordAtPosition(e),n=t.getLineMaxColumn(e.lineNumber);return i?new Rh(e.lineNumber,i.startColumn,e.lineNumber,n):Rh.fromPositions(e,e.with(void 0,n))}(t,i),l=e.all(i),h=new $s;for(const e of l)e.groupId&&h.add(e.groupId,e);function d(e){if(!e.yieldsToGroupIds)return[];const t=[];for(const i of e.yieldsToGroupIds||[]){const e=h.get(i);for(const i of e)t.push(i)}return t}const c=new Map,u=new Set;function g(e,t){if(t=[...t,e],u.has(e))return t;u.add(e);try{const i=d(e);for(const e of i){const i=g(e,t);if(i)return i}}finally{u.delete(e)}}function p(e){const o=c.get(e);if(o)return o;const r=g(e,[]);r&&a(new Error(`Inline completions: cyclic yield-to dependency detected. Path: ${r.map((e=>e.toString?e.toString():""+e)).join(" -> ")}`));const l=new hd;return c.set(e,l.p),(()=>u1(this,void 0,void 0,(function*(){if(!r){const t=d(e);for(const e of t){const t=yield p(e);if(t&&t.items.length>0)return}}try{return yield e.provideInlineCompletions(i,t,n,s)}catch(Mre){return void a(Mre)}})))().then((e=>l.complete(e)),(e=>l.error(e))),l.p}const m=yield Promise.all(l.map((e=>u1(this,void 0,void 0,(function*(){return{provider:e,completions:yield p(e)}}))))),f=new Map,_=[];for(const e of m){const t=e.completions;if(!t)continue;const n=new m1(t,e.provider);_.push(n);for(const e of t.items){const t=f1.from(e,n,r,i,o);f.set(t.hash(),t)}}return new p1(Array.from(f.values()),new Set(f.keys()),_)}))}class p1{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()}}class m1{constructor(e,t){this.inlineCompletions=e,this.provider=t,this.refCount=1}addRef(){this.refCount++}removeRef(){this.refCount--,0===this.refCount&&this.provider.freeInlineCompletions(this.inlineCompletions)}}class f1{static from(e,t,i,n,s){let o,r,a=e.range?Rh.lift(e.range):i;if("string"==typeof e.insertText){if(o=e.insertText,s&&e.completeBracketPairs){o=_1(o,a.getStartPosition(),n,s);const t=o.length-e.insertText.length;0!==t&&(a=new Rh(a.startLineNumber,a.startColumn,a.endLineNumber,a.endColumn+t))}r=void 0}else if("snippet"in e.insertText){const t=e.insertText.snippet.length;if(s&&e.completeBracketPairs){e.insertText.snippet=_1(e.insertText.snippet,a.getStartPosition(),n,s);const i=e.insertText.snippet.length-t;0!==i&&(a=new Rh(a.startLineNumber,a.startColumn,a.endLineNumber,a.endColumn+i))}const i=(new c1).parse(e.insertText.snippet);1===i.children.length&&i.children[0]instanceof i1?(o=i.children[0].value,r=void 0):(o=i.toString(),r={snippet:e.insertText.snippet,range:a})}else zl(e.insertText);return new f1(o,e.command,a,o,r,e.additionalTextEdits||W0,e,t)}constructor(e,t,i,n,s,o,r,a){this.filterText=e,this.command=t,this.range=i,this.insertText=n,this.snippetInfo=s,this.additionalTextEdits=o,this.sourceInlineCompletion=r,this.source=a,n=(e=e.replace(/\r\n|\r/g,"\n")).replace(/\r\n|\r/g,"\n")}withRange(e){return new f1(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()})}}function _1(e,t,i,n){const s=i.getLineContent(t.lineNumber).substring(0,t.column-1)+e,o=i.tokenization.tokenizeLineWithEdit(t,s.length-(t.column-1),e),r=null==o?void 0:o.sliceAndInflate(t.column-1,s.length,0);if(!r)return e;const a=function(e,t){const i=new Og,n=new ep(i,(e=>t.getLanguageConfiguration(e))),s=ap(new Yg(new J0([e]),n),[],void 0,!0);let o="";const r=e.getLineContent();return function e(t,i){if(2===t.kind)if(e(t.openingBracket,i),i=Cg(i,t.openingBracket.length),t.child&&(e(t.child,i),i=Cg(i,t.child.length)),t.closingBracket)e(t.closingBracket,i),i=Cg(i,t.closingBracket.length);else{const e=n.getSingleLanguageBracketTokens(t.openingBracket.languageId).findClosingTokenText(t.openingBracket.bracketIds);o+=e}else if(3===t.kind);else if(0===t.kind||1===t.kind)o+=r.substring(i,Cg(i,t.length));else if(4===t.kind)for(const n of t.children)e(n,i),i=Cg(i,n.length)}(s,mg),o}(r,n);return a}class v1{constructor(e,t){this.range=e,this.text=t}removeCommonPrefix(e,t){const i=t?this.range.intersectRanges(t):this.range;if(!i)return this;const n=e.getValueInRange(i,1),s=bo(n,this.text),o=H0(this.range.getStartPosition(),z0(n.substring(0,s))),r=this.text.substring(s),a=Rh.fromPositions(o,this.range.getEndPosition());return new v1(a,r)}augments(e){return this.text.startsWith(e.text)&&(t=this.range,(i=e.range).getStartPosition().equals(t.getStartPosition())&&i.getEndPosition().isBeforeOrEqual(t.getEndPosition()));var t,i}computeGhostText(e,t,i,n=0){let s=this.removeCommonPrefix(e);if(s.range.endLineNumber!==s.range.startLineNumber)return;const o=e.getLineContent(s.range.startLineNumber),r=ao(o).length;if(s.range.startColumn-1<=r){const e=ao(s.text).length,t=o.substring(s.range.startColumn-1,r),[i,n]=[s.range.getStartPosition(),s.range.getEndPosition()],a=i.column+t.length<=n.column?i.delta(0,t.length):n,l=Rh.fromPositions(a,n),h=s.text.startsWith(t)?s.text.substring(t.length):s.text.substring(e);s=new v1(l,h)}const a=e.getValueInRange(s.range),l=function(e,t){if((null==b1?void 0:b1.originalValue)===e&&(null==b1?void 0:b1.newValue)===t)return null==b1?void 0:b1.changes;{let i=w1(e,t,!0);if(i){const n=C1(i);if(n>0){const s=w1(e,t,!1);s&&C1(s)0===e.originalLength));if(e.length>1||1===e.length&&e[0].originalStart!==a.length)return}const c=s.text.length-n;for(const u of l){const e=s.range.startColumn+u.originalStart+u.originalLength;if("subwordSmart"===t&&i&&i.lineNumber===s.range.startLineNumber&&e0)return;if(0===u.modifiedLength)continue;const n=u.modifiedStart+u.modifiedLength,o=Math.max(u.modifiedStart,Math.min(n,c)),r=s.text.substring(u.modifiedStart,o),a=s.text.substring(o,Math.max(u.modifiedStart,n));if(r.length>0){const t=oo(r);d.push(new K0(e,t,!1))}if(a.length>0){const t=oo(a);d.push(new K0(e,t,!0))}}return new U0(h,d)}}let b1;function C1(e){let t=0;for(const i of e)t+=i.originalLength;return t}function w1(e,t,i){if(e.length>5e3||t.length>5e3)return;function n(e){let t=0;for(let i=0,n=e.length;it&&(t=n)}return t}const s=Math.max(n(e),n(t));function o(e){if(e<0)throw new Error("unexpected");return s+e+1}function r(e){let t=0,n=0;const s=new Int32Array(e.length);for(let r=0,a=e.length;ra},{getElements:()=>l}).ComputeDiff(!1).changes}var y1=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},S1=function(e,t){return function(i,n){t(i,n,e)}},L1=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let k1=class extends E{constructor(e,t,i,n,s){super(),this.textModel=e,this.versionId=t,this._debounceValue=i,this.languageFeaturesService=n,this.languageConfigurationService=s,this._updateOperation=this._register(new I),this.inlineCompletions=Pj("inlineCompletions",void 0),this.suggestWidgetInlineCompletions=Pj("suggestWidgetInlineCompletions",void 0),this._register(this.textModel.onDidChangeContent((()=>{this._updateOperation.clear()})))}fetch(e,t,i){var n,s;const o=new D1(e,t,this.textModel.getVersionId()),r=t.selectedSuggestionInfo?this.suggestWidgetInlineCompletions:this.inlineCompletions;if(null===(n=this._updateOperation.value)||void 0===n?void 0:n.request.satisfies(o))return this._updateOperation.value.promise;if(null===(s=r.get())||void 0===s?void 0:s.request.satisfies(o))return Promise.resolve(!0);const a=!!this._updateOperation.value;this._updateOperation.clear();const l=new jh,h=(()=>L1(this,void 0,void 0,(function*(){var n,s;if((a||t.triggerKind===pC.Automatic)&&(yield(n=this._debounceValue.get(this.textModel),new Promise((e=>{let t;const i=setTimeout((()=>{t&&t.dispose(),e()}),n);s&&(t=s.onCancellationRequested((()=>{clearTimeout(i),t&&t.dispose(),e()})))})))),l.token.isCancellationRequested||this.textModel.getVersionId()!==o.versionId)return!1;const h=new Date,d=yield g1(this.languageFeaturesService.inlineCompletionsProvider,e,this.textModel,t,l.token,this.languageConfigurationService);if(l.token.isCancellationRequested||this.textModel.getVersionId()!==o.versionId)return!1;const c=new Date;this._debounceValue.update(this.textModel,c.getTime()-h.getTime());const u=new N1(d,o,this.textModel,this.versionId);if(i){const t=i.toInlineCompletion(void 0);i.canBeReused(this.textModel,e)&&!d.has(t)&&u.prepend(i.inlineCompletion,t.range,!0)}return this._updateOperation.clear(),Ej((e=>{r.set(u,e)})),!0})))(),d=new x1(o,l,h);return this._updateOperation.value=d,h}clear(e){this._updateOperation.clear(),this.inlineCompletions.set(void 0,e),this.suggestWidgetInlineCompletions.set(void 0,e)}clearSuggestWidgetInlineCompletions(e){var t;(null===(t=this._updateOperation.value)||void 0===t?void 0:t.request.context.selectedSuggestionInfo)&&this._updateOperation.clear(),this.suggestWidgetInlineCompletions.set(void 0,e)}cancelUpdate(){this._updateOperation.clear()}};k1=y1([S1(3,oL),S1(4,Ju)],k1);class D1{constructor(e,t,i){this.position=e,this.context=t,this.versionId=i}satisfies(e){return this.position.equals(e.position)&&function(e,t,i){if(!e||!t)return e===t;return i(e,t)}(this.context.selectedSuggestionInfo,e.context.selectedSuggestionInfo,((e,t)=>e.equals(t)))&&(e.context.triggerKind===pC.Automatic||this.context.triggerKind===pC.Explicit)&&this.versionId===e.versionId}}class x1{constructor(e,t,i){this.request=e,this.cancellationTokenSource=t,this.promise=i}dispose(){this.cancellationTokenSource.cancel()}}class N1{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=[],this._rangeVersionIdValue=0,this._rangeVersionId=Wj(this,(e=>{this.versionId.read(e);let t=!1;for(const i of this._inlineCompletions)t=t||i._updateRange(this.textModel);return t&&this._rangeVersionIdValue++,this._rangeVersionIdValue}));const s=i.deltaDecorations([],e.completions.map((e=>({range:e.range,options:{description:"inline-completion-tracking-range"}}))));this._inlineCompletions=e.completions.map(((e,t)=>new E1(e,s[t],this._rangeVersionId)))}clone(){return this._refCount++,this}dispose(){if(this._refCount--,0===this._refCount){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 E1(e,n,this._rangeVersionId,t)),this._prependedInlineCompletionItems.push(e)}}class E1{get forwardStable(){var e;return null!==(e=this.inlineCompletion.source.inlineCompletions.enableForwardStability)&&void 0!==e&&e}constructor(e,t,i,n){this.inlineCompletion=e,this.decorationId=t,this.rangeVersion=i,this.semanticId=JSON.stringify([this.inlineCompletion.filterText,this.inlineCompletion.insertText,this.inlineCompletion.range.getStartPosition().toString()]),this._isValid=!0,this._updatedRange=null!=n?n:e.range}toInlineCompletion(e){return this.inlineCompletion.withRange(this._getUpdatedRange(e))}toSingleTextEdit(e){return new v1(this._getUpdatedRange(e),this.inlineCompletion.insertText)}isVisible(e,t,i){const n=this._toFilterTextReplacement(i).removeCommonPrefix(e);if(!this._isValid||!this.inlineCompletion.range.getStartPosition().equals(this._getUpdatedRange(i).getStartPosition())||t.lineNumber!==n.range.startLineNumber)return!1;const s=e.getValueInRange(n.range,1).toLowerCase(),o=n.text.toLowerCase(),r=Math.max(0,t.column-n.range.startColumn);let a=o.substring(0,r),l=o.substring(r),h=s.substring(0,r),d=s.substring(r);const c=e.getLineIndentColumn(n.range.startLineNumber);return n.range.startColumn<=c&&(h=h.trimStart(),0===h.length&&(d=d.trimStart()),a=a.trimStart(),0===a.length&&(l=l.trimStart())),a.startsWith(h)&&!!Yo(d,l)}canBeReused(e,t){return this._isValid&&this._getUpdatedRange(void 0).containsPosition(t)&&this.isVisible(e,t,void 0)&&!this._isSmallerThanOriginal(void 0)}_toFilterTextReplacement(e){return new v1(this._getUpdatedRange(e),this.inlineCompletion.filterText)}_isSmallerThanOriginal(e){return I1(this._getUpdatedRange(e)).isBefore(I1(this.inlineCompletion.range))}_getUpdatedRange(e){return this.rangeVersion.read(e),this._updatedRange}_updateRange(e){const t=e.getDecorationRange(this.decorationId);return t?!this._updatedRange.equalsRange(t)&&(this._updatedRange=t,!0):(this._isValid=!1,!0)}}function I1(e){return e.startLineNumber===e.endLineNumber?new Va(1,1+e.endColumn-e.startColumn):new Va(1+e.endLineNumber-e.startLineNumber,e.endColumn)}var M1=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const T1={Visible:xX,HasFocusedSuggestion:new Al("suggestWidgetHasFocusedSuggestion",!1,ue(0,"Whether any suggestion is focused")),DetailsVisible:new Al("suggestWidgetDetailsVisible",!1,ue(0,"Whether suggestion details are visible")),MultipleSuggestions:new Al("suggestWidgetMultipleSuggestions",!1,ue(0,"Whether there are multiple suggestions to pick from")),MakesTextEdit:new Al("suggestionMakesTextEdit",!0,ue(0,"Whether inserting the current suggestion yields in a change or has everything already been typed")),AcceptSuggestionsOnEnter:new Al("acceptSuggestionOnEnter",!0,ue(0,"Whether suggestions are inserted when pressing Enter")),HasInsertAndReplaceRange:new Al("suggestionHasInsertAndReplaceRange",!1,ue(0,"Whether the current suggestion has insert and replace behaviour")),InsertMode:new Al("suggestionInsertMode",void 0,{type:"string",description:ue(0,"Whether the default behaviour is to insert or replace")}),CanResolve:new Al("suggestionCanResolve",!1,ue(0,"Whether the current suggestion supports to resolve further details"))},R1=new eh("suggestWidgetStatusBar");class A1{constructor(e,t,i,n){var s;this.position=e,this.completion=t,this.container=i,this.provider=n,this.isInvalid=!1,this.score=Mr.Default,this.distance=0,this.textLabel="string"==typeof t.label?t.label:null===(s=t.label)||void 0===s?void 0:s.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,Rh.isIRange(t.range)?(this.editStart=new Va(t.range.startLineNumber,t.range.startColumn),this.editInsertEnd=new Va(t.range.endLineNumber,t.range.endColumn),this.editReplaceEnd=new Va(t.range.endLineNumber,t.range.endColumn),this.isInvalid=this.isInvalid||Rh.spansMultipleLines(t.range)||t.range.startLineNumber!==e.lineNumber):(this.editStart=new Va(t.range.insert.startLineNumber,t.range.insert.startColumn),this.editInsertEnd=new Va(t.range.insert.endLineNumber,t.range.insert.endColumn),this.editReplaceEnd=new Va(t.range.replace.endLineNumber,t.range.replace.endColumn),this.isInvalid=this.isInvalid||Rh.spansMultipleLines(t.range.insert)||Rh.spansMultipleLines(t.range.replace)||t.range.insert.startLineNumber!==e.lineNumber||t.range.replace.startLineNumber!==e.lineNumber||t.range.insert.startColumn!==t.range.replace.startColumn),"function"!=typeof n.resolveCompletionItem&&(this._resolveCache=Promise.resolve(),this._resolveDuration=0)}get isResolved(){return void 0!==this._resolveDuration}get resolveDuration(){return void 0!==this._resolveDuration?this._resolveDuration:-1}resolve(e){return M1(this,void 0,void 0,(function*(){if(!this._resolveCache){const t=e.onCancellationRequested((()=>{this._resolveCache=void 0,this._resolveDuration=void 0})),i=new F(!0);this._resolveCache=Promise.resolve(this.provider.resolveCompletionItem(this.completion,e)).then((e=>{Object.assign(this.completion,e),this._resolveDuration=i.elapsed()}),(e=>{d(e)&&(this._resolveCache=void 0,this._resolveDuration=void 0)})).finally((()=>{t.dispose()}))}return this._resolveCache}))}}class O1{constructor(e=2,t=new Set,i=new Set,n=new Map,s=!0){this.snippetSortOrder=e,this.kindFilter=t,this.providerFilter=i,this.providerItemsToReuse=n,this.showDeprecated=s}}let P1;O1.default=new O1;class F1{constructor(e,t,i,n){this.items=e,this.needsClipboard=t,this.durations=i,this.disposable=n}}function B1(e,t,i,n=O1.default,s={triggerKind:0},o=Uh.None){return M1(this,void 0,void 0,(function*(){const r=new F;i=i.clone();const l=t.getWordAtPosition(i),h=l?new Rh(i.lineNumber,l.startColumn,i.lineNumber,l.endColumn):Rh.fromPositions(i),d={replace:h,insert:h.setEndPosition(i.lineNumber,i.column)},u=[],g=new N,p=[];let m=!1;const f=(e,t,s)=>{var o,r,a;let l=!1;if(!t)return l;for(const h of t.suggestions)if(!n.kindFilter.has(h.kind)){if(!n.showDeprecated&&(null===(o=null==h?void 0:h.tags)||void 0===o?void 0:o.includes(1)))continue;h.range||(h.range=d),h.sortText||(h.sortText="string"==typeof h.label?h.label:h.label.label),!m&&h.insertTextRules&&4&h.insertTextRules&&(m=c1.guessNeedsClipboard(h.insertText)),u.push(new A1(i,h,t,e)),l=!0}return L(t)&&g.add(t),p.push({providerName:null!==(r=e._debugDisplayName)&&void 0!==r?r:"unknown_provider",elapsedProvider:null!==(a=t.duration)&&void 0!==a?a:-1,elapsedOverall:s.elapsed()}),l},_=(()=>M1(this,void 0,void 0,(function*(){})))();for(const c of e.orderedGroups(t)){let e=!1;if(yield Promise.all(c.map((r=>M1(this,void 0,void 0,(function*(){if(n.providerItemsToReuse.has(r)){const t=n.providerItemsToReuse.get(r);return t.forEach((e=>u.push(e))),void(e=e||t.length>0)}if(!(n.providerFilter.size>0)||n.providerFilter.has(r))try{const n=new F,a=yield r.provideCompletionItems(t,i,s,o);e=f(r,a,n)||e}catch(l){a(l)}}))))),e||o.isCancellationRequested)break}return yield _,o.isCancellationRequested?(g.dispose(),Promise.reject(new c)):new F1(u.sort((v=n.snippetSortOrder,V1.get(v))),m,{entries:p,elapsed:r.elapsed()},g);var v}))}function W1(e,t){if(e.sortTextLow&&t.sortTextLow){if(e.sortTextLowt.sortTextLow)return 1}return e.textLabelt.textLabel?1:e.completion.kind-t.completion.kind}const V1=new Map;V1.set(0,(function(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return-1;if(27===t.completion.kind)return 1}return W1(e,t)})),V1.set(2,(function(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return 1;if(27===t.completion.kind)return-1}return W1(e,t)})),V1.set(1,W1),Xa.registerCommand("_executeCompletionItemProvider",((e,...t)=>M1(void 0,void 0,void 0,(function*(){const[i,n,s,o]=t;qr(an.isUri(i)),qr(Va.isIPosition(n)),qr("string"==typeof s||!s),qr("number"==typeof o||!o);const{completionProvider:r}=e.get(oL),a=yield e.get(za).createModelReference(i);try{const e={incomplete:!1,suggestions:[]},t=[],i=a.object.textEditorModel.validatePosition(n),l=yield B1(r,a.object.textEditorModel,i,void 0,{triggerCharacter:null!=s?s:void 0,triggerKind:s?1:0});for(const n of l.items)t.length<(null!=o?o:0)&&t.push(n.resolve(Uh.None)),e.incomplete=e.incomplete||n.container.incomplete,e.suggestions.push(n.completion);try{return yield Promise.all(t),e}finally{setTimeout((()=>l.disposable.dispose()),100)}}finally{a.dispose()}}))));class H1{static isAllOff(e){return"off"===e.other&&"off"===e.comments&&"off"===e.strings}static isAllOn(e){return"on"===e.other&&"on"===e.comments&&"on"===e.strings}static valueFor(e,t){switch(t){case 1:return e.comments;case 2:return e.strings;default:return e.other}}}function z1(e,t=Oe){return function(e,t=Oe){return!!t&&ma(e.charCodeAt(0))&&58===e.charCodeAt(1)}(e,t)?e.charAt(0).toUpperCase()+e.slice(1):e}Object.create(null);var U1=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},K1=function(e,t){return function(i,n){t(i,n,e)}};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 j1{constructor(e){this._delegates=e}resolve(e){for(const t of this._delegates){const i=t.resolve(e);if(void 0!==i)return i}}}class q1{constructor(e,t,i,n){this._model=e,this._selection=t,this._selectionIdx=i,this._overtypingCapturer=n}resolve(e){const{name:t}=e;if("SELECTION"===t||"TM_SELECTED_TEXT"===t){let t=this._model.getValueInRange(this._selection)||void 0,i=this._selection.startLineNumber!==this._selection.endLineNumber;if(!t&&this._overtypingCapturer){const e=this._overtypingCapturer.getLastOvertypedInfo(this._selectionIdx);e&&(t=e.value,i=e.multiline)}if(t&&i&&e.snippet){const i=ao(this._model.getLineContent(this._selection.startLineNumber),0,this._selection.startColumn-1);let n=i;e.snippet.walk((t=>t!==e&&(t instanceof i1&&(n=ao(oo(t.value).pop())),!0)));const s=bo(n,i);t=t.replace(/(\r\n|\r|\n)(.*)/g,((e,t,i)=>`${t}${n.substr(s)}${i}`))}return t}if("TM_CURRENT_LINE"===t)return this._model.getLineContent(this._selection.positionLineNumber);if("TM_CURRENT_WORD"===t){const e=this._model.getWordAtPosition({lineNumber:this._selection.positionLineNumber,column:this._selection.positionColumn});return e&&e.word||void 0}return"TM_LINE_INDEX"===t?String(this._selection.positionLineNumber-1):"TM_LINE_NUMBER"===t?String(this._selection.positionLineNumber):"CURSOR_INDEX"===t?String(this._selectionIdx):"CURSOR_NUMBER"===t?String(this._selectionIdx+1):void 0}}class $1{constructor(e,t){this._labelService=e,this._model=t}resolve(e){const{name:t}=e;if("TM_FILENAME"===t)return Xi(this._model.uri.fsPath);if("TM_FILENAME_BASE"===t){const e=Xi(this._model.uri.fsPath),t=e.lastIndexOf(".");return t<=0?e:e.slice(0,t)}return"TM_DIRECTORY"===t?"."===Yi(this._model.uri.fsPath)?"":this._labelService.getUriLabel(Sa(this._model.uri)):"TM_FILEPATH"===t?this._labelService.getUriLabel(this._model.uri):"RELATIVE_FILEPATH"===t?this._labelService.getUriLabel(this._model.uri,{relative:!0,noPrefix:!0}):void 0}}class G1{constructor(e,t,i,n){this._readClipboardText=e,this._selectionIdx=t,this._selectionCount=i,this._spread=n}resolve(e){if("CLIPBOARD"!==e.name)return;const t=this._readClipboardText();if(t){if(this._spread){const e=t.split(/\r\n|\n|\r/).filter((e=>!Ys(e)));if(e.length===this._selectionCount)return e[this._selectionIdx]}return t}}}let Z1=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)return"LINE_COMMENT"===t?n.lineCommentToken||void 0:"BLOCK_COMMENT_START"===t?n.blockCommentStartToken||void 0:"BLOCK_COMMENT_END"===t&&n.blockCommentEndToken||void 0}};Z1=U1([K1(2,Ju)],Z1);class Y1{constructor(){this._date=new Date}resolve(e){const{name:t}=e;if("CURRENT_YEAR"===t)return String(this._date.getFullYear());if("CURRENT_YEAR_SHORT"===t)return String(this._date.getFullYear()).slice(-2);if("CURRENT_MONTH"===t)return String(this._date.getMonth().valueOf()+1).padStart(2,"0");if("CURRENT_DATE"===t)return String(this._date.getDate().valueOf()).padStart(2,"0");if("CURRENT_HOUR"===t)return String(this._date.getHours().valueOf()).padStart(2,"0");if("CURRENT_MINUTE"===t)return String(this._date.getMinutes().valueOf()).padStart(2,"0");if("CURRENT_SECOND"===t)return String(this._date.getSeconds().valueOf()).padStart(2,"0");if("CURRENT_DAY_NAME"===t)return Y1.dayNames[this._date.getDay()];if("CURRENT_DAY_NAME_SHORT"===t)return Y1.dayNamesShort[this._date.getDay()];if("CURRENT_MONTH_NAME"===t)return Y1.monthNames[this._date.getMonth()];if("CURRENT_MONTH_NAME_SHORT"===t)return Y1.monthNamesShort[this._date.getMonth()];if("CURRENT_SECONDS_UNIX"===t)return String(Math.floor(this._date.getTime()/1e3));if("CURRENT_TIMEZONE_OFFSET"===t){const e=this._date.getTimezoneOffset(),t=e>0?"-":"+",i=Math.trunc(Math.abs(e/60)),n=i<10?"0"+i:i,s=Math.abs(e)-60*i;return t+n+":"+(s<10?"0"+s:s)}}}Y1.dayNames=[ue(0,"Sunday"),ue(0,"Monday"),ue(0,"Tuesday"),ue(0,"Wednesday"),ue(0,"Thursday"),ue(0,"Friday"),ue(0,"Saturday")],Y1.dayNamesShort=[ue(0,"Sun"),ue(0,"Mon"),ue(0,"Tue"),ue(0,"Wed"),ue(0,"Thu"),ue(0,"Fri"),ue(0,"Sat")],Y1.monthNames=[ue(0,"January"),ue(0,"February"),ue(0,"March"),ue(0,"April"),ue(0,"May"),ue(0,"June"),ue(0,"July"),ue(0,"August"),ue(0,"September"),ue(0,"October"),ue(0,"November"),ue(0,"December")],Y1.monthNamesShort=[ue(0,"Jan"),ue(0,"Feb"),ue(0,"Mar"),ue(0,"Apr"),ue(0,"May"),ue(0,"Jun"),ue(0,"Jul"),ue(0,"Aug"),ue(0,"Sep"),ue(0,"Oct"),ue(0,"Nov"),ue(0,"Dec")];class X1{constructor(e){this._workspaceService=e}resolve(e){if(!this._workspaceService)return;const t=function(e,t){if("string"==typeof e||void 0===e)return"string"==typeof e?{id:Xi(e)}:t?Yq:Xq;const i=e;return i.configuration?{id:i.id,configPath:i.configuration}:1===i.folders.length?{id:i.id,uri:i.folders[0].uri}:{id:i.id}}(this._workspaceService.getWorkspace());return Zq(t)?void 0:"WORKSPACE_NAME"===e.name?this._resolveWorkspaceName(t):"WORKSPACE_FOLDER"===e.name?this._resoveWorkspacePath(t):void 0}_resolveWorkspaceName(e){if(Gq(e))return Xi(e.uri.path);let t=Xi(e.configPath.path);return t.endsWith(Jq)&&(t=t.substr(0,t.length-14-1)),t}_resoveWorkspacePath(e){if(Gq(e))return z1(e.uri.fsPath);const t=Xi(e.configPath.path);let i=e.configPath.fsPath;return i.endsWith(t)&&(i=i.substr(0,i.length-t.length-1)),i?z1(i):"/"}}class Q1{resolve(e){const{name:t}=e;return"RANDOM"===t?Math.random().toString().slice(-6):"RANDOM_HEX"===t?Math.random().toString(16).slice(-6):"UUID"===t?NZ():void 0}}var J1,e2=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},t2=function(e,t){return function(i,n){t(i,n,e)}};class i2{constructor(e,t,i){this._editor=e,this._snippet=t,this._snippetLineLeadingWhitespace=i,this._offset=-1,this._nestingLevel=1,this._placeholderGroups=Od(t.placeholders,s1.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(-1===this._offset)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),s=this._snippet.fullLen(i),o=Rh.fromPositions(e.getPositionAt(this._offset+n),e.getPositionAt(this._offset+n+s)),r=i.isFinalTabstop?i2._decor.inactiveFinal:i2._decor.inactive,a=t.addDecoration(o,r);this._placeholderDecorations.set(i,a)}}))}move(e){if(!this._editor.hasModel())return[];if(this._initDecorations(),this._placeholderGroupsIdx>=0){const e=[];for(const t of this._placeholderGroups[this._placeholderGroupsIdx])if(t.transform){const i=this._placeholderDecorations.get(t),n=this._editor.getModel().getDecorationRange(i),s=this._editor.getModel().getValueInRange(n),o=t.transform.resolve(s).split(/\r\n|\r|\n/);for(let e=1;e0&&this._editor.executeEdits("snippet.placeholderTransform",e)}let t=!1;!0===e&&this._placeholderGroupsIdx0&&(this._placeholderGroupsIdx-=1,t=!0);const i=this._editor.getModel().changeDecorations((e=>{const i=new Set,n=[];for(const s of this._placeholderGroups[this._placeholderGroupsIdx]){const o=this._placeholderDecorations.get(s),r=this._editor.getModel().getDecorationRange(o);n.push(new Ah(r.startLineNumber,r.startColumn,r.endLineNumber,r.endColumn)),t=t&&this._hasPlaceholderBeenCollapsed(s),e.changeDecorationOptions(o,s.isFinalTabstop?i2._decor.activeFinal:i2._decor.active),i.add(s);for(const t of this._snippet.enclosingPlaceholders(s)){const n=this._placeholderDecorations.get(t);e.changeDecorationOptions(n,t.isFinalTabstop?i2._decor.activeFinal:i2._decor.active),i.add(t)}}for(const[t,s]of this._placeholderDecorations)i.has(t)||e.changeDecorationOptions(s,t.isFinalTabstop?i2._decor.inactiveFinal:i2._decor.inactive);return n}));return t?this.move(e):null!=i?i:[]}_hasPlaceholderBeenCollapsed(e){let t=e;for(;t;){if(t instanceof s1){const e=this._placeholderDecorations.get(t);if(this._editor.getModel().getDecorationRange(e).isEmpty()&&t.toString().length>0)return!0}t=t.parent}return!1}get isAtFirstPlaceholder(){return this._placeholderGroupsIdx<=0||0===this._placeholderGroups.length}get isAtLastPlaceholder(){return this._placeholderGroupsIdx===this._placeholderGroups.length-1}get hasPlaceholder(){return this._snippet.placeholders.length>0}get isTrivialSnippet(){if(0===this._snippet.placeholders.length)return!0;if(1===this._snippet.placeholders.length){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 t=this._placeholderDecorations.get(n),s=this._editor.getModel().getDecorationRange(t);if(!s){e.delete(n.index);break}i.push(s)}}return e}get activeChoice(){if(!this._placeholderDecorations)return;const e=this._placeholderGroups[this._placeholderGroupsIdx][0];if(!(null==e?void 0:e.choice))return;const t=this._placeholderDecorations.get(e);if(!t)return;const i=this._editor.getModel().getDecorationRange(t);return i?{range:i,choice:e.choice}:void 0}get hasChoice(){let e=!1;return this._snippet.walk((t=>(e=t instanceof o1,!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 s=e.shift();console.assert(-1!==s._offset),console.assert(!s._placeholderDecorations);const o=s._snippet.placeholderInfo.last.index;for(const e of s._snippet.placeholderInfo.all)e.isFinalTabstop?e.index=n.index+(o+1)/this._nestingLevel:e.index=n.index+e.index/this._nestingLevel;this._snippet.replace(n,s._snippet.children);const r=this._placeholderDecorations.get(n);i.removeDecoration(r),this._placeholderDecorations.delete(n);for(const e of s._snippet.placeholders){const n=s._snippet.offset(e),o=s._snippet.fullLen(e),r=Rh.fromPositions(t.getPositionAt(s._offset+n),t.getPositionAt(s._offset+n+o)),a=i.addDecoration(r,i2._decor.inactive);this._placeholderDecorations.set(e,a)}}this._placeholderGroups=Od(this._snippet.placeholders,s1.compareByIndex)}))}}i2._decor={active:Iw.register({description:"snippet-placeholder-1",stickiness:0,className:"snippet-placeholder"}),inactive:Iw.register({description:"snippet-placeholder-2",stickiness:1,className:"snippet-placeholder"}),activeFinal:Iw.register({description:"snippet-placeholder-3",stickiness:1,className:"finish-snippet-placeholder"}),inactiveFinal:Iw.register({description:"snippet-placeholder-4",stickiness:1,className:"finish-snippet-placeholder"})};const n2={overwriteBefore:0,overwriteAfter:0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let s2=J1=class{static adjustWhitespace(e,t,i,n,s){const o=ao(e.getLineContent(t.lineNumber),0,t.column-1);let r;return n.walk((t=>{if(!(t instanceof i1)||t.parent instanceof o1)return!0;if(s&&!s.has(t))return!0;const a=t.value.split(/\r\n|\r|\n/);if(i){const i=n.offset(t);if(0===i)a[0]=e.normalizeIndentation(a[0]);else{r=null!=r?r:n.toString();const t=r.charCodeAt(i-1);10!==t&&13!==t||(a[0]=e.normalizeIndentation(o+a[0]))}for(let t=1;te.get($q))),g=e.invokeWithinContext((e=>new $1(e.get(Zz),c))),p=()=>r,m=c.getValueInRange(J1.adjustSelection(c,e.getSelection(),i,0)),f=c.getValueInRange(J1.adjustSelection(c,e.getSelection(),0,n)),_=c.getLineFirstNonWhitespaceColumn(e.getSelection().positionLineNumber),v=e.getSelections().map(((e,t)=>({selection:e,idx:t}))).sort(((e,t)=>Rh.compareRangesUsingStarts(e.selection,t.selection)));for(const{selection:b,idx:C}of v){let r=J1.adjustSelection(c,b,i,0),w=J1.adjustSelection(c,b,0,n);m!==c.getValueInRange(r)&&(r=b),f!==c.getValueInRange(w)&&(w=b);const y=b.setStartPosition(r.startLineNumber,r.startColumn).setEndPosition(w.endLineNumber,w.endColumn),S=(new c1).parse(t,!0,s),L=y.getStartPosition(),k=J1.adjustWhitespace(c,L,o||C>0&&_!==c.getLineFirstNonWhitespaceColumn(b.positionLineNumber),S);S.resolveVariables(new j1([g,new G1(p,C,v.length,"spread"===e.getOption(78)),new q1(c,b,C,a),new Z1(c,b,l),new Y1,new X1(u),new Q1])),h[C]=Fq.replace(y,S.toString()),h[C].identifier={major:C,minor:0},h[C]._isTracked=!0,d[C]=new i2(e,S,k)}return{edits:h,snippets:d}}static createEditsAndSnippetsFromEdits(e,t,i,n,s,o,r){if(!e.hasModel()||0===t.length)return{edits:[],snippets:[]};const a=[],l=e.getModel(),h=new c1,d=new d1,c=new j1([e.invokeWithinContext((e=>new $1(e.get(Zz),l))),new G1((()=>s),0,e.getSelections().length,"spread"===e.getOption(78)),new q1(l,e.getSelection(),0,o),new Z1(l,e.getSelection(),r),new Y1,new X1(e.invokeWithinContext((e=>e.get($q)))),new Q1]);t=t.sort(((e,t)=>Rh.compareRangesUsingStarts(e.range,t.range)));let u=0;for(let g=0;g0){const i=t[g-1].range,n=Rh.fromPositions(i.getEndPosition(),e.getStartPosition()),s=new i1(l.getValueInRange(n));d.appendChild(s),u+=s.value.length}const n=h.parseFragment(i,d);J1.adjustWhitespace(l,e.getStartPosition(),!0,d,new Set(n)),d.resolveVariables(c);const s=d.toString(),o=s.slice(u);u=s.length;const r=Fq.replace(e,o);r.identifier={major:g,minor:0},r._isTracked=!0,a.push(r)}return h.ensureFinalTabstop(d,i,!0),{edits:a,snippets:[new i2(e,d,"")]}}constructor(e,t,i=n2,n){this._editor=e,this._template=t,this._options=i,this._languageConfigurationService=n,this._templateMerges=[],this._snippets=[]}dispose(){k(this._snippets)}_logInfo(){return`template="${this._template}", merged_templates="${this._templateMerges.join(" -> ")}"`}insert(){if(!this._editor.hasModel())return;const{edits:e,snippets:t}="string"==typeof this._template?J1.createEditsAndSnippetsFromSelections(this._editor,this._template,this._options.overwriteBefore,this._options.overwriteAfter,!1,this._options.adjustWhitespace,this._options.clipboardText,this._options.overtypingCapturer,this._languageConfigurationService):J1.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,(e=>{const i=e.filter((e=>!!e.identifier));for(let n=0;nAh.fromPositions(e.range.getEndPosition())))})),this._editor.revealRange(this._editor.getSelections()[0])}merge(e,t=n2){if(!this._editor.hasModel())return;this._templateMerges.push([this._snippets[0]._nestingLevel,this._snippets[0]._placeholderGroupsIdx,e]);const{edits:i,snippets:n}=J1.createEditsAndSnippetsFromSelections(this._editor,e,t.overwriteBefore,t.overwriteAfter,!0,t.adjustWhitespace,t.clipboardText,t.overtypingCapturer,this._languageConfigurationService);this._editor.executeEdits("snippet",i,(e=>{const t=e.filter((e=>!!e.identifier));for(let s=0;sAh.fromPositions(e.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{e.push(...n.get(t))}))}e.sort(Rh.compareRangesUsingStarts);for(const[i,n]of t)if(n.length===e.length){n.sort(Rh.compareRangesUsingStarts);for(let s=0;s0}};s2=J1=e2([t2(3,Ju)],s2);var o2,r2=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},a2=function(e,t){return function(i,n){t(i,n,e)}};const l2={overwriteBefore:0,overwriteAfter:0,undoStopBefore:!0,undoStopAfter:!0,adjustWhitespace:!0,clipboardText:void 0,overtypingCapturer:void 0};let h2=o2=class{static get(e){return e.getContribution(o2.ID)}constructor(e,t,i,n,s){this._editor=e,this._logService=t,this._languageFeaturesService=i,this._languageConfigurationService=s,this._snippetListener=new N,this._modelVersionId=-1,this._inSnippet=o2.InSnippetMode.bindTo(n),this._hasNextTabstop=o2.HasNextTabstop.bindTo(n),this._hasPrevTabstop=o2.HasPrevTabstop.bindTo(n)}dispose(){var e;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),null===(e=this._session)||void 0===e||e.dispose(),this._snippetListener.dispose()}insert(e,t){try{this._doInsert(e,void 0===t?l2:Object.assign(Object.assign({},l2),t))}catch(Mre){this.cancel(),this._logService.error(Mre),this._logService.error("snippet_error"),this._logService.error("insert_template=",e),this._logService.error("existing_template=",this._session?this._session._logInfo():"")}}_doInsert(e,t){var i;if(this._editor.hasModel()){if(this._snippetListener.clear(),t.undoStopBefore&&this._editor.getModel().pushStackElement(),this._session&&"string"!=typeof e&&this.cancel(),this._session?(qr("string"==typeof e),this._session.merge(e,t)):(this._modelVersionId=this._editor.getModel().getAlternativeVersionId(),this._session=new s2(this._editor,e,t,this._languageConfigurationService),this._session.insert()),t.undoStopAfter&&this._editor.getModel().pushStackElement(),null===(i=this._session)||void 0===i?void 0:i.hasChoice){const e={_debugDisplayName:"snippetChoiceCompletions",provideCompletionItems:(e,t)=>{if(!this._session||e!==this._editor.getModel()||!Va.equals(this._editor.getPosition(),t))return;const{activeChoice:i}=this._session;if(!i||0===i.choice.options.length)return;const n=e.getValueInRange(i.range),s=Boolean(i.choice.options.find((e=>e.value===n))),o=[];for(let r=0;r{null==i||i.dispose(),n=!1},o=()=>{n||(i=this._languageFeaturesService.completionProvider.register({language:t.getLanguageId(),pattern:t.uri.fsPath,scheme:t.uri.scheme,exclusive:!0},e),this._snippetListener.add(i),n=!0)};this._choiceCompletions={provider:e,enable:o,disable:s}}this._updateState(),this._snippetListener.add(this._editor.onDidChangeModelContent((e=>e.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(){var e;if(!this._session||!this._editor.hasModel())return void(this._currentChoice=void 0);const{activeChoice:t}=this._session;if(!t||!this._choiceCompletions)return null===(e=this._choiceCompletions)||void 0===e||e.disable(),void(this._currentChoice=void 0);this._currentChoice!==t.choice&&(this._currentChoice=t.choice,this._choiceCompletions.enable(),queueMicrotask((()=>{!function(e,t){var i;null===(i=e.getContribution("editor.contrib.suggestController"))||void 0===i||i.triggerSuggest((new Set).add(t),void 0,!0)}(this._editor,this._choiceCompletions.provider)})))}finish(){for(;this._inSnippet.get();)this.next()}cancel(e=!1){var t;this._inSnippet.reset(),this._hasPrevTabstop.reset(),this._hasNextTabstop.reset(),this._snippetListener.clear(),this._currentChoice=void 0,null===(t=this._session)||void 0===t||t.dispose(),this._session=void 0,this._modelVersionId=-1,e&&this._editor.setSelections([this._editor.getSelection()])}prev(){var e;null===(e=this._session)||void 0===e||e.prev(),this._updateState()}next(){var e;null===(e=this._session)||void 0===e||e.next(),this._updateState()}isInSnippet(){return Boolean(this._inSnippet.get())}};h2.ID="snippetController2",h2.InSnippetMode=new Al("inSnippetMode",!1,ue(0,"Whether the editor in current in snippet mode")),h2.HasNextTabstop=new Al("hasNextTabstop",!1,ue(0,"Whether there is a next tab stop when in snippet mode")),h2.HasPrevTabstop=new Al("hasPrevTabstop",!1,ue(0,"Whether there is a previous tab stop when in snippet mode")),h2=o2=r2([a2(1,hh),a2(2,oL),a2(3,Ol),a2(4,Ju)],h2),Dh(h2.ID,h2,4);const d2=vh.bindToContribution(h2.get);Sh(new d2({id:"jumpToNextSnippetPlaceholder",precondition:pl.and(h2.InSnippetMode,h2.HasNextTabstop),handler:e=>e.next(),kbOpts:{weight:130,kbExpr:Oh.editorTextFocus,primary:2}})),Sh(new d2({id:"jumpToPrevSnippetPlaceholder",precondition:pl.and(h2.InSnippetMode,h2.HasPrevTabstop),handler:e=>e.prev(),kbOpts:{weight:130,kbExpr:Oh.editorTextFocus,primary:1026}})),Sh(new d2({id:"leaveSnippet",precondition:h2.InSnippetMode,handler:e=>e.cancel(!0),kbOpts:{weight:130,kbExpr:Oh.editorTextFocus,primary:9,secondary:[1033]}})),Sh(new d2({id:"acceptSnippet",precondition:h2.InSnippetMode,handler:e=>e.finish()}));var c2,u2=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},g2=function(e,t){return function(i,n){t(i,n,e)}},p2=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};!function(e){e[e.Undo=0]="Undo",e[e.Redo=1]="Redo",e[e.AcceptWord=2]="AcceptWord",e[e.Other=3]="Other"}(c2||(c2={}));let m2=class extends E{get isAcceptingPartially(){return this._isAcceptingPartially}constructor(e,t,i,n,s,o,r,a,l,h,d,c){let u;super(),this.textModel=e,this.selectedSuggestItem=t,this.cursorPosition=i,this.textModelVersionId=n,this._debounceValue=s,this._suggestPreviewEnabled=o,this._suggestPreviewMode=r,this._inlineSuggestMode=a,this._enabled=l,this._instantiationService=h,this._commandService=d,this._languageConfigurationService=c,this._source=this._register(this._instantiationService.createInstance(k1,this.textModel,this.textModelVersionId,this._debounceValue)),this._isActive=Aj(this,!1),this._forceUpdate=eq("forceUpdate"),this._selectedInlineCompletionId=Aj(this,void 0),this._isAcceptingPartially=!1,this._preserveCurrentCompletionReasons=new Set([c2.Redo,c2.Undo,c2.AcceptWord]),this._fetchInlineCompletions=function(e,t){var i;return new zj(e.owner,e.debugName,t,e.createEmptyChangeSummary,e.handleChange,void 0,null!==(i=e.equalityComparer)&&void 0!==i?i:Bj)}({owner:this,createEmptyChangeSummary:()=>({preserveCurrentCompletion:!1,inlineCompletionTriggerKind:pC.Automatic}),handleChange:(e,t)=>(e.didChange(this.textModelVersionId)&&this._preserveCurrentCompletionReasons.has(e.change)?t.preserveCurrentCompletion=!0:e.didChange(this._forceUpdate)&&(t.inlineCompletionTriggerKind=e.change),!0)},((e,t)=>{this._forceUpdate.read(e);if(!(this._enabled.read(e)&&this.selectedSuggestItem.read(e)||this._isActive.read(e)))return void this._source.cancelUpdate();this.textModelVersionId.read(e);const i=this.selectedInlineCompletion.get(),n=t.preserveCurrentCompletion||(null==i?void 0:i.forwardStable)?i:void 0,s=this._source.suggestWidgetInlineCompletions.get(),o=this.selectedSuggestItem.read(e);if(s&&!o){const e=this._source.inlineCompletions.get();Ej((t=>{e&&s.request.versionId>e.request.versionId&&this._source.inlineCompletions.set(s.clone(),t),this._source.clearSuggestWidgetInlineCompletions(t)}))}const r=this.cursorPosition.read(e),a={triggerKind:t.inlineCompletionTriggerKind,selectedSuggestionInfo:null==o?void 0:o.toSelectedSuggestionInfo()};return this._source.fetch(r,a,n)})),this._filteredInlineCompletionItems=Wj(this,(e=>{const t=this._source.inlineCompletions.read(e);if(!t)return[];const i=this.cursorPosition.read(e),n=t.inlineCompletions.filter((t=>t.isVisible(this.textModel,i,e)));return n})),this.selectedInlineCompletionIndex=Wj(this,(e=>{const t=this._selectedInlineCompletionId.read(e),i=this._filteredInlineCompletionItems.read(e),n=void 0===this._selectedInlineCompletionId?-1:i.findIndex((e=>e.semanticId===t));return-1===n?(this._selectedInlineCompletionId.set(void 0,void 0),0):n})),this.selectedInlineCompletion=Wj(this,(e=>this._filteredInlineCompletionItems.read(e)[this.selectedInlineCompletionIndex.read(e)])),this.lastTriggerKind=this._source.inlineCompletions.map((e=>null==e?void 0:e.request.context.triggerKind)),this.inlineCompletionsCount=Wj(this,(e=>this.lastTriggerKind.read(e)===pC.Explicit?this._filteredInlineCompletionItems.read(e).length:void 0)),this.state=Vj({owner:this,equalityComparer:(e,t)=>e&&t?q0(e.ghostText,t.ghostText)&&e.inlineCompletion===t.inlineCompletion&&e.suggestItem===t.suggestItem:e===t},(e=>{var t;const i=this.textModel,n=this.selectedSuggestItem.read(e);if(n){const s=n.toSingleTextEdit().removeCommonPrefix(i),o=this._computeAugmentedCompletion(s,e);if(!this._suggestPreviewEnabled.read(e)&&!o)return;const r=null!==(t=null==o?void 0:o.edit)&&void 0!==t?t:s,a=o?o.edit.text.length-s.text.length:0,l=this._suggestPreviewMode.read(e),h=this.cursorPosition.read(e),d=r.computeGhostText(i,l,h,a);return{ghostText:null!=d?d:new U0(r.range.endLineNumber,[]),inlineCompletion:null==o?void 0:o.completion,suggestItem:n}}{if(!this._isActive.read(e))return;const t=this.selectedInlineCompletion.read(e);if(!t)return;const n=t.toSingleTextEdit(e),s=this._inlineSuggestMode.read(e),o=this.cursorPosition.read(e),r=n.computeGhostText(i,s,o);return r?{ghostText:r,inlineCompletion:t,suggestItem:void 0}:void 0}})),this.ghostText=Vj({owner:this,equalityComparer:q0},(e=>{const t=this.state.read(e);if(t)return t.ghostText})),this._register(iq(this._fetchInlineCompletions)),this._register(Kj((e=>{var t,i;const n=this.state.read(e),s=null==n?void 0:n.inlineCompletion;if((null==s?void 0:s.semanticId)!==(null==u?void 0:u.semanticId)&&(u=s,s)){const e=s.inlineCompletion,n=e.source;null===(i=(t=n.provider).handleItemDidShow)||void 0===i||i.call(t,n.inlineCompletions,e.sourceInlineCompletion,e.insertText)}})))}trigger(e){return p2(this,void 0,void 0,(function*(){this._isActive.set(!0,e),yield this._fetchInlineCompletions.get()}))}triggerExplicitly(e){return p2(this,void 0,void 0,(function*(){Ij(e,(e=>{this._isActive.set(!0,e),this._forceUpdate.trigger(e,pC.Explicit)})),yield this._fetchInlineCompletions.get()}))}stop(e){Ij(e,(e=>{this._isActive.set(!1,e),this._source.clear(e)}))}_computeAugmentedCompletion(e,t){const i=this.textModel,n=this._source.suggestWidgetInlineCompletions.read(t);return function(e,t){for(const i of e){const e=t(i);if(void 0!==e)return e}}(n?n.inlineCompletions:[this.selectedInlineCompletion.read(t)].filter(Kr),(n=>{let s=n.toSingleTextEdit(t);return s=s.removeCommonPrefix(i,Rh.fromPositions(s.range.getStartPosition(),e.range.getEndPosition())),s.augments(e)?{edit:s,completion:n}:void 0}))}_deltaSelectedInlineCompletionIndex(e){return p2(this,void 0,void 0,(function*(){yield 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)}))}next(){return p2(this,void 0,void 0,(function*(){yield this._deltaSelectedInlineCompletionIndex(1)}))}previous(){return p2(this,void 0,void 0,(function*(){yield this._deltaSelectedInlineCompletionIndex(-1)}))}accept(e){var t;return p2(this,void 0,void 0,(function*(){if(e.getModel()!==this.textModel)throw new f;const i=this.state.get();if(!i||i.ghostText.isEmpty()||!i.inlineCompletion)return;const n=i.inlineCompletion.toInlineCompletion(void 0);e.pushUndoStop(),n.snippetInfo?(e.executeEdits("inlineSuggestion.accept",[Fq.replaceMove(n.range,""),...n.additionalTextEdits]),e.setPosition(n.snippetInfo.range.getStartPosition()),null===(t=h2.get(e))||void 0===t||t.insert(n.snippetInfo.snippet,{undoStopBefore:!1})):e.executeEdits("inlineSuggestion.accept",[Fq.replaceMove(n.range,n.insertText),...n.additionalTextEdits]),n.command&&n.source.addRef(),Ej((e=>{this._source.clear(e),this._isActive.set(!1,e)})),n.command&&(yield this._commandService.executeCommand(n.command.id,...n.command.arguments||[]).then(void 0,a),n.source.removeRef())}))}acceptNextWord(e){return p2(this,void 0,void 0,(function*(){yield this._acceptNext(e,((e,t)=>{const i=this.textModel.getLanguageIdAtPosition(e.lineNumber,e.column),n=this._languageConfigurationService.getLanguageConfiguration(i),s=new RegExp(n.wordDefinition.source,n.wordDefinition.flags.replace("g","")),o=t.match(s);let r=0;r=o&&void 0!==o.index?0===o.index?o[0].length:o.index:t.length;const a=/\s+/g.exec(t);return a&&void 0!==a.index&&a.index+a[0].length{const i=t.match(/\n/);return i&&void 0!==i.index?i.index+1:t.length}))}))}_acceptNext(e,t){return p2(this,void 0,void 0,(function*(){if(e.getModel()!==this.textModel)throw new f;const i=this.state.get();if(!i||i.ghostText.isEmpty()||!i.inlineCompletion)return;const n=i.ghostText,s=i.inlineCompletion.toInlineCompletion(void 0);if(s.snippetInfo||s.filterText!==s.insertText)return void(yield this.accept(e));const o=n.parts[0],r=new Va(n.lineNumber,o.column),a=o.lines.join("\n"),l=t(r,a);if(l===a.length&&1===n.parts.length)return void this.accept(e);const h=a.substring(0,l);this._isAcceptingPartially=!0;try{e.pushUndoStop(),e.executeEdits("inlineSuggestion.accept",[Fq.replace(Rh.fromPositions(r),h)]);const t=z0(h);e.setPosition(H0(r,t))}finally{this._isAcceptingPartially=!1}if(s.source.provider.handlePartialAccept){const t=Rh.fromPositions(s.range.getStartPosition(),H0(r,z0(h))),i=e.getModel().getValueInRange(t,1);s.source.provider.handlePartialAccept(s.source.inlineCompletions,s.sourceInlineCompletion,i.length)}}))}handleSuggestAccepted(e){var t,i;const n=e.toSingleTextEdit().removeCommonPrefix(this.textModel),s=this._computeAugmentedCompletion(n,void 0);if(!s)return;const o=s.completion.inlineCompletion;null===(i=(t=o.source.provider).handlePartialAccept)||void 0===i||i.call(t,o.source.inlineCompletions,o.sourceInlineCompletion,n.text.length)}};m2=u2([g2(9,Fa),g2(10,Ya),g2(11,Ju)],m2);var f2,_2=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},v2=function(e,t){return function(i,n){t(i,n,e)}};class b2{constructor(e){this.name=e}select(e,t,i){if(0===i.length)return 0;const n=i[0].score[0];for(let s=0;sthis._saveState()),500),this._disposables.add(e.onWillSaveState((e=>{e.reason===YN.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){var i;const n=this._configService.getValue("editor.suggestSelection",{overrideIdentifier:e.getLanguageIdAtPosition(t.lineNumber,t.column),resource:e.uri});if((null===(i=this._strategy)||void 0===i?void 0:i.name)!==n){this._saveState();const e=f2._strategyCtors.get(n)||C2;this._strategy=new e;try{const e=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,t=this._storageService.get(`${f2._storagePrefix}/${n}`,e);t&&this._strategy.fromJSON(JSON.parse(t))}catch(Mre){}}return this._strategy}_saveState(){if(this._strategy){const e=this._configService.getValue("editor.suggest.shareSuggestSelections")?0:1,t=JSON.stringify(this._strategy);this._storageService.store(`${f2._storagePrefix}/${this._strategy.name}`,t,e,1)}}};w2._strategyCtors=new Map([["recentlyUsedByPrefix",class extends b2{constructor(){super("recentlyUsedByPrefix"),this._trie=qq.forStrings(),this._seq=0}memorize(e,t,i){const{word:n}=e.getWordUntilPosition(t),s=`${e.getLanguageId()}/${n}`;this._trie.set(s,{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 s=`${e.getLanguageId()}/${n}`;let o=this._trie.get(s);if(o||(o=this._trie.findSubstr(s)),o)for(let r=0;re.push([i,t]))),e.sort(((e,t)=>-(e[1].touch-t[1].touch))).forEach(((e,t)=>e[1].touch=t)),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="number"==typeof i.type?i.type:gC.fromString(i.type),this._trie.set(t,i)}}}],["recentlyUsed",class extends b2{constructor(){super("recentlyUsed"),this._cache=new js(300,.66),this._seq=0}memorize(e,t,i){const n=`${e.getLanguageId()}/${i.textLabel}`;this._cache.set(n,{touch:this._seq++,type:i.completion.kind,insertText:i.completion.insertText})}select(e,t,i){if(0===i.length)return 0;const n=e.getLineContent(t.lineNumber).substr(t.column-10,t.column-1);if(/\s$/.test(n))return super.select(e,t,i);const s=i[0].score[0];let o=-1,r=-1,a=-1;for(let l=0;la&&n.type===i[l].completion.kind&&n.insertText===i[l].completion.insertText&&(a=n.touch,r=l),i[l].completion.preselect&&-1===o)return l}return-1!==r?r:-1!==o?o:0}toJSON(){return this._cache.toJSON()}fromJSON(e){this._cache.clear();for(const[t,i]of e)i.touch=0,i.type="number"==typeof i.type?i.type:gC.fromString(i.type),this._cache.set(t,i);this._seq=this._cache.size}}],["first",C2]]),w2._storagePrefix="suggest/memories",w2=f2=_2([v2(0,ZN),v2(1,pu)],w2);const y2=Ba("ISuggestMemories");yu(y2,w2,1);var S2,L2=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},k2=function(e,t){return function(i,n){t(i,n,e)}};let D2=S2=class{constructor(e,t){this._editor=e,this._enabled=!1,this._ckAtEnd=S2.AtEnd.bindTo(t),this._configListener=this._editor.onDidChangeConfiguration((e=>e.hasChanged(122)&&this._update())),this._update()}dispose(){var e;this._configListener.dispose(),null===(e=this._selectionListener)||void 0===e||e.dispose(),this._ckAtEnd.reset()}_update(){const e="on"===this._editor.getOption(122);if(this._enabled!==e)if(this._enabled=e,this._enabled){const e=()=>{if(!this._editor.hasModel())return void this._ckAtEnd.set(!1);const e=this._editor.getModel(),t=this._editor.getSelection(),i=e.getWordAtPosition(t.getStartPosition());i?this._ckAtEnd.set(i.endColumn===t.getStartPosition().column):this._ckAtEnd.set(!1)};this._selectionListener=this._editor.onDidChangeCursorSelection(e),e()}else this._selectionListener&&(this._ckAtEnd.reset(),this._selectionListener.dispose(),this._selectionListener=void 0)}};D2.AtEnd=new Al("atEndOfWord",!1),D2=S2=L2([k2(1,Ol)],D2);var x2,N2=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},E2=function(e,t){return function(i,n){t(i,n,e)}};let I2=x2=class{constructor(e,t){this._editor=e,this._index=0,this._ckOtherSuggestions=x2.OtherSuggestions.bindTo(t)}dispose(){this.reset()}reset(){var e;this._ckOtherSuggestions.reset(),null===(e=this._listener)||void 0===e||e.dispose(),this._model=void 0,this._acceptNext=void 0,this._ignore=!1}set({model:e,index:t},i){if(0===e.items.length)return void this.reset();x2._moveIndex(!0,e,t)!==t?(this._acceptNext=i,this._model=e,this._index=t,this._listener=this._editor.onDidChangeCursorPosition((()=>{this._ignore||this.reset()})),this._ckOtherSuggestions.set(!0)):this.reset()}static _moveIndex(e,t,i){let n=i;for(let s=t.items.length;s>0&&(n=(n+t.items.length+(e?1:-1))%t.items.length,n!==i)&&t.items[n].completion.additionalTextEdits;s--);return n}next(){this._move(!0)}prev(){this._move(!1)}_move(e){if(this._model)try{this._ignore=!0,this._index=x2._moveIndex(e,this._model,this._index),this._acceptNext({index:this._index,item:this._model.items[this._index],model:this._model})}finally{this._ignore=!1}}};I2.OtherSuggestions=new Al("hasOtherSuggestions",!1),I2=x2=N2([E2(1,Ol)],I2);class M2{constructor(e,t,i,n){this._disposables=new N,this._disposables.add(i.onDidSuggest((e=>{0===e.completionModel.items.length&&this.reset()}))),this._disposables.add(i.onDidCancel((e=>{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((s=>{if(this._active&&!t.isFrozen()&&0!==i.state){const t=s.charCodeAt(s.length-1);this._active.acceptCharacters.has(t)&&e.getOption(0)&&n(this._active.item)}})))}_onItem(e){if(!e||!Hd(e.item.completion.commitCharacters))return void this.reset();if(this._active&&this._active.item.item===e.item)return;const t=new qb;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()}}var T2=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class R2{provideSelectionRanges(e,t){return T2(this,void 0,void 0,(function*(){const i=[];for(const n of t){const t=[];i.push(t);const s=new Map;yield new Promise((t=>R2._bracketsRightYield(t,0,e,n,s))),yield new Promise((i=>R2._bracketsLeftYield(i,0,e,n,s,t)))}return i}))}static _bracketsRightYield(e,t,i,n,s){const o=new Map,r=Date.now();for(;;){if(t>=R2._maxRounds){e();break}if(!n){e();break}const a=i.bracketPairs.findNextBracket(n);if(!a){e();break}if(Date.now()-r>R2._maxDuration){setTimeout((()=>R2._bracketsRightYield(e,t+1,i,n,s)));break}if(a.bracketInfo.isOpeningBracket){const e=a.bracketInfo.bracketText,t=o.has(e)?o.get(e):0;o.set(e,t+1)}else{const e=a.bracketInfo.getOpeningBrackets()[0].bracketText;let t=o.has(e)?o.get(e):0;if(t-=1,o.set(e,Math.max(0,t)),t<0){let t=s.get(e);t||(t=new O,s.set(e,t)),t.push(a.range)}}n=a.range.getEndPosition()}}static _bracketsLeftYield(e,t,i,n,s,o){const r=new Map,a=Date.now();for(;;){if(t>=R2._maxRounds&&0===s.size){e();break}if(!n){e();break}const l=i.bracketPairs.findPrevBracket(n);if(!l){e();break}if(Date.now()-a>R2._maxDuration){setTimeout((()=>R2._bracketsLeftYield(e,t+1,i,n,s,o)));break}if(l.bracketInfo.isOpeningBracket){const e=l.bracketInfo.bracketText;let t=r.has(e)?r.get(e):0;if(t-=1,r.set(e,Math.max(0,t)),t<0){const t=s.get(e);if(t){const n=t.shift();0===t.size&&s.delete(e);const r=Rh.fromPositions(l.range.getEndPosition(),n.getStartPosition()),a=Rh.fromPositions(l.range.getStartPosition(),n.getEndPosition());o.push({range:r}),o.push({range:a}),R2._addBracketLeading(i,a,o)}}}else{const e=l.bracketInfo.getOpeningBrackets()[0].bracketText,t=r.has(e)?r.get(e):0;r.set(e,t+1)}n=l.range.getStartPosition()}}static _addBracketLeading(e,t,i){if(t.startLineNumber===t.endLineNumber)return;const n=t.startLineNumber,s=e.getLineFirstNonWhitespaceColumn(n);0!==s&&s!==t.startColumn&&(i.push({range:Rh.fromPositions(new Va(n,s),t.getEndPosition())}),i.push({range:Rh.fromPositions(new Va(n,1),t.getEndPosition())}));const o=n-1;if(o>0){const n=e.getLineFirstNonWhitespaceColumn(o);n===t.startColumn&&n!==e.getLineLastNonWhitespaceColumn(o)&&(i.push({range:Rh.fromPositions(new Va(o,n),t.getEndPosition())}),i.push({range:Rh.fromPositions(new Va(o,1),t.getEndPosition())}))}}}R2._maxDuration=30,R2._maxRounds=2;var A2=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class O2{static create(e,t){return A2(this,void 0,void 0,(function*(){if(!t.getOption(117).localityBonus)return O2.None;if(!t.hasModel())return O2.None;const i=t.getModel(),n=t.getPosition();if(!e.canComputeWordRanges(i.uri))return O2.None;const[s]=yield(new R2).provideSelectionRanges(i,[n]);if(0===s.length)return O2.None;const o=yield e.computeWordRanges(i.uri,s[0].range);if(!o)return O2.None;const r=i.getWordUntilPosition(n);return delete o[r.word],new class extends O2{distance(e,i){if(!n.equals(t.getPosition()))return 0;if(17===i.kind)return 2<<20;const r="string"==typeof i.label?i.label:i.label.label,a=o[r];if(Vd(a))return 2<<20;const l=Rd(a,Rh.fromPositions(e),Rh.compareRangesUsingStarts),h=l>=0?a[l]:a[Math.max(0,~l-1)];let d=s.length;for(const t of s){if(!Rh.containsRange(t.range,h))break;d-=1}return d}}}))}}O2.None=new class extends O2{distance(){return 0}};class P2{constructor(e,t){this.leadingLineContent=e,this.characterCountDelta=t}}class F2{constructor(e,t,i,n,s,o,r=Tr.default,a=void 0){this.clipboardText=a,this._snippetCompareFn=F2._compareCompletionItems,this._items=e,this._column=t,this._wordDistance=n,this._options=s,this._refilterKind=1,this._lineContext=i,this._fuzzyScoreOptions=r,"top"===o?this._snippetCompareFn=F2._compareCompletionItemsSnippetsUp:"bottom"===o&&(this._snippetCompareFn=F2._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(){0!==this._refilterKind&&this._createCachedState()}_createCachedState(){this._itemsByProvider=new Map;const e=[],{leadingLineContent:t,characterCountDelta:i}=this._lineContext;let n="",s="";const o=1===this._refilterKind?this._items:this._filteredItems,r=[],a=!this._options.filterGraceful||o.length>2e3?Rr:Or;for(let l=0;l=u)h.score=Mr.Default;else if("string"==typeof h.completion.filterText){const t=a(n,s,e,h.completion.filterText,h.filterTextLow,0,this._fuzzyScoreOptions);if(!t)continue;0===uo(h.completion.filterText,h.textLabel)?h.score=t:(h.score=fr(n,s,e,h.textLabel,h.labelLow,0),h.score[0]=t[0])}else{const t=a(n,s,e,h.textLabel,h.labelLow,0,this._fuzzyScoreOptions);if(!t)continue;h.score=t}}h.idx=l,h.distance=this._wordDistance.distance(h.position,h.completion),r.push(h),e.push(h.textLabel.length)}this._filteredItems=r.sort(this._snippetCompareFn),this._refilterKind=0,this._stats={pLabelLen:e.length?Ad(e.length-.85,e,((e,t)=>e-t)):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(27===e.completion.kind)return 1;if(27===t.completion.kind)return-1}return F2._compareCompletionItems(e,t)}static _compareCompletionItemsSnippetsUp(e,t){if(e.completion.kind!==t.completion.kind){if(27===e.completion.kind)return-1;if(27===t.completion.kind)return 1}return F2._compareCompletionItems(e,t)}}var B2,W2=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},V2=function(e,t){return function(i,n){t(i,n,e)}},H2=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class z2{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}}let U2=B2=class{constructor(e,t,i,n,s,o,r,a,l){this._editor=e,this._editorWorkerService=t,this._clipboardService=i,this._telemetryService=n,this._logService=s,this._contextKeyService=o,this._configurationService=r,this._languageFeaturesService=a,this._envService=l,this._toDispose=new N,this._triggerCharacterListener=new N,this._triggerQuickSuggest=new sd,this._triggerState=void 0,this._completionDisposables=new N,this._onDidCancel=new U,this._onDidTrigger=new U,this._onDidSuggest=new U,this.onDidCancel=this._onDidCancel.event,this.onDidTrigger=this._onDidTrigger.event,this.onDidSuggest=this._onDidSuggest.event,this._telemetryGate=0,this._currentSelection=this._editor.getSelection()||new Ah(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 h=!1;this._toDispose.add(this._editor.onDidCompositionStart((()=>{h=!0}))),this._toDispose.add(this._editor.onDidCompositionEnd((()=>{h=!1,this._onCompositionEnd()}))),this._toDispose.add(this._editor.onDidChangeCursorSelection((e=>{h||this._onCursorChange(e)}))),this._toDispose.add(this._editor.onDidChangeModelContent((()=>{h||void 0===this._triggerState||this._refilterCompletionItems()}))),this._updateTriggerCharacters()}dispose(){k(this._triggerCharacterListener),k([this._onDidCancel,this._onDidSuggest,this._onDidTrigger,this._triggerQuickSuggest]),this._toDispose.dispose(),this._completionDisposables.dispose(),this.cancel()}_updateTriggerCharacters(){if(this._triggerCharacterListener.clear(),this._editor.getOption(90)||!this._editor.hasModel()||!this._editor.getOption(120))return;const e=new Map;for(const i of this._languageFeaturesService.completionProvider.all(this._editor.getModel()))for(const t of i.triggerCharacters||[]){let n=e.get(t);n||(n=new Set,n.add(P1),e.set(t,n)),n.add(i)}const t=t=>{var i;if(!function(e,t,i){if(!Boolean(t.getContextKeyValue("inlineSuggestionVisible")))return!0;const n=t.getContextKeyValue(F0.suppressSuggestions.key);return void 0!==n?!n:!e.getOption(62).suppressSuggestions}(this._editor,this._contextKeyService,this._configurationService))return;if(z2.shouldAutoTrigger(this._editor))return;if(!t){const e=this._editor.getPosition();t=this._editor.getModel().getLineContent(e.lineNumber).substr(0,e.column-1)}let n="";yo(t.charCodeAt(t.length-1))?wo(t.charCodeAt(t.length-2))&&(n=t.substr(t.length-2)):n=t.charAt(t.length-1);const s=e.get(n);if(s){const e=new Map;if(this._completionModel)for(const[t,i]of this._completionModel.getItemsByProvider())s.has(t)||e.set(t,i);this.trigger({auto:!0,triggerKind:1,triggerCharacter:n,retrigger:Boolean(this._completionModel),clipboardText:null===(i=this._completionModel)||void 0===i?void 0:i.clipboardText,completionOptions:{providerFilter:s,providerItemsToReuse:e}})}};this._triggerCharacterListener.add(this._editor.onDidType(t)),this._triggerCharacterListener.add(this._editor.onDidCompositionEnd((()=>t())))}get state(){return this._triggerState?this._triggerState.auto?2:1:0}cancel(e=!1){var t;void 0!==this._triggerState&&(this._triggerQuickSuggest.cancel(),null===(t=this._requestToken)||void 0===t||t.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(){void 0!==this._triggerState&&(this._editor.hasModel()&&this._languageFeaturesService.completionProvider.has(this._editor.getModel())?this.trigger({auto:this._triggerState.auto,retrigger:!0}):this.cancel())}_onCursorChange(e){if(!this._editor.hasModel())return;const t=this._currentSelection;this._currentSelection=this._editor.getSelection(),!e.selection.isEmpty()||0!==e.reason&&3!==e.reason||"keyboard"!==e.source&&"deleteLeft"!==e.source?this.cancel():void 0===this._triggerState&&0===e.reason?(t.containsRange(this._currentSelection)||t.getEndPosition().isBeforeOrEqual(this._currentSelection.getPosition()))&&this._doTriggerQuickSuggest():void 0!==this._triggerState&&3===e.reason&&this._refilterCompletionItems()}_onCompositionEnd(){void 0===this._triggerState?this._doTriggerQuickSuggest():this._refilterCompletionItems()}_doTriggerQuickSuggest(){var e;H1.isAllOff(this._editor.getOption(88))||this._editor.getOption(117).snippetsPreventQuickSuggestions&&(null===(e=h2.get(this._editor))||void 0===e?void 0:e.isInSnippet())||(this.cancel(),this._triggerQuickSuggest.cancelAndSet((()=>{if(void 0!==this._triggerState)return;if(!z2.shouldAutoTrigger(this._editor))return;if(!this._editor.hasModel()||!this._editor.hasWidgetFocus())return;const e=this._editor.getModel(),t=this._editor.getPosition(),i=this._editor.getOption(88);if(!H1.isAllOff(i)){if(!H1.isAllOn(i)){e.tokenization.tokenizeIfCheap(t.lineNumber);const n=e.tokenization.getLineTokens(t.lineNumber),s=n.getStandardTokenType(n.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if("on"!==H1.valueFor(i,s))return}(function(e,t,i){if(!Boolean(t.getContextKeyValue(F0.inlineSuggestionVisible.key)))return!0;const n=t.getContextKeyValue(F0.suppressSuggestions.key);return void 0!==n?!n:!e.getOption(62).suppressSuggestions})(this._editor,this._contextKeyService,this._configurationService)&&this._languageFeaturesService.completionProvider.has(e)&&this.trigger({auto:!0})}}),this._editor.getOption(89)))}_refilterCompletionItems(){qr(this._editor.hasModel()),qr(void 0!==this._triggerState);const e=this._editor.getModel(),t=this._editor.getPosition(),i=new z2(e,t,Object.assign(Object.assign({},this._triggerState),{refilter:!0}));this._onNewContext(i)}trigger(e){var t,i,n,s,o,a;if(!this._editor.hasModel())return;const l=this._editor.getModel(),h=new z2(l,this._editor.getPosition(),e);this.cancel(e.retrigger),this._triggerState=e,this._onDidTrigger.fire({auto:e.auto,shy:null!==(t=e.shy)&&void 0!==t&&t,position:this._editor.getPosition()}),this._context=h;let d={triggerKind:null!==(i=e.triggerKind)&&void 0!==i?i:0};e.triggerCharacter&&(d={triggerKind:1,triggerCharacter:e.triggerCharacter}),this._requestToken=new jh;let c=1;switch(this._editor.getOption(111)){case"top":c=0;break;case"bottom":c=2}const{itemKind:u,showDeprecated:g}=B2._createSuggestFilter(this._editor),p=new O1(c,null!==(s=null===(n=e.completionOptions)||void 0===n?void 0:n.kindFilter)&&void 0!==s?s:u,null===(o=e.completionOptions)||void 0===o?void 0:o.providerFilter,null===(a=e.completionOptions)||void 0===a?void 0:a.providerItemsToReuse,g),m=O2.create(this._editorWorkerService,this._editor),f=B1(this._languageFeaturesService.completionProvider,l,this._editor.getPosition(),p,d,this._requestToken.token);Promise.all([f,m]).then((([t,i])=>H2(this,void 0,void 0,(function*(){var n;if(null===(n=this._requestToken)||void 0===n||n.dispose(),!this._editor.hasModel())return;let s=null==e?void 0:e.clipboardText;if(!s&&t.needsClipboard&&(s=yield this._clipboardService.readText()),void 0===this._triggerState)return;const o=this._editor.getModel(),r=new z2(o,this._editor.getPosition(),e),a=Object.assign(Object.assign({},Tr.default),{firstMatchCanBeWeak:!this._editor.getOption(117).matchOnWordStartOnly});if(this._completionModel=new F2(t.items,this._context.column,{leadingLineContent:r.leadingLineContent,characterCountDelta:r.column-this._context.column},i,this._editor.getOption(117),this._editor.getOption(111),a,s),this._completionDisposables.add(t.disposable),this._onNewContext(r),this._reportDurationsTelemetry(t.durations),!this._envService.isBuilt||this._envService.isExtensionDevelopment)for(const e of t.items)e.isInvalid&&this._logService.warn(`[suggest] did IGNORE invalid completion item from ${e.provider._debugDisplayName}`,e.completion)})))).catch(r)}_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;"none"===e.getOption(111)&&t.add(27);const i=e.getOption(117);return i.showMethods||t.add(0),i.showFunctions||t.add(1),i.showConstructors||t.add(2),i.showFields||t.add(3),i.showVariables||t.add(4),i.showClasses||t.add(5),i.showStructs||t.add(6),i.showInterfaces||t.add(7),i.showModules||t.add(8),i.showProperties||t.add(9),i.showEvents||t.add(10),i.showOperators||t.add(11),i.showUnits||t.add(12),i.showValues||t.add(13),i.showConstants||t.add(14),i.showEnums||t.add(15),i.showEnumMembers||t.add(16),i.showKeywords||t.add(17),i.showWords||t.add(18),i.showColors||t.add(19),i.showFiles||t.add(20),i.showReferences||t.add(21),i.showColors||t.add(22),i.showFolders||t.add(23),i.showTypeParameters||t.add(24),i.showSnippets||t.add(27),i.showUsers||t.add(25),i.showIssues||t.add(26),{itemKind:t,showDeprecated:i.showDeprecated}}_onNewContext(e){if(this._context)if(e.lineNumber===this._context.lineNumber)if(ao(e.leadingLineContent)===ao(this._context.leadingLineContent)){if(e.columnthis._context.leadingWord.startColumn){if(z2.shouldAutoTrigger(this._editor)&&this._context){const e=this._completionModel.getItemsByProvider();this.trigger({auto:this._context.triggerOptions.auto,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerItemsToReuse:e}})}}else if(e.column>this._context.column&&this._completionModel.getIncompleteProvider().size>0&&0!==e.leadingWord.word.length){const e=new Map,t=new Set;for(const[i,n]of this._completionModel.getItemsByProvider())n.length>0&&n[0].container.incomplete?t.add(i):e.set(i,n);this.trigger({auto:this._context.triggerOptions.auto,triggerKind:2,retrigger:!0,clipboardText:this._completionModel.clipboardText,completionOptions:{providerFilter:t,providerItemsToReuse:e}})}else{const t=this._completionModel.lineContext;let i=!1;if(this._completionModel.lineContext={leadingLineContent:e.leadingLineContent,characterCountDelta:e.column-this._context.column},0===this._completionModel.items.length){const n=z2.shouldAutoTrigger(this._editor);if(!this._context)return void this.cancel();if(n&&this._context.leadingWord.endColumn0,i&&0===e.leadingWord.word.length)return void this.cancel()}this._onDidSuggest.fire({completionModel:this._completionModel,triggerOptions:e.triggerOptions,isFrozen:i})}}else this.cancel();else this.cancel()}};U2=B2=W2([V2(1,fG),V2(2,eS),V2(3,lh),V2(4,hh),V2(5,Ol),V2(6,pu),V2(7,oL),V2(8,CE)],U2);class K2{constructor(e,t){this._disposables=new N,this._lastOvertyped=[],this._locked=!1,this._disposables.add(e.onWillType((()=>{if(this._locked||!e.hasModel())return;const t=e.getSelections(),i=t.length;let n=!1;for(let e=0;eK2._maxSelectionLength)return;this._lastOvertyped[e]={value:s.getValueInRange(i),multiline:i.startLineNumber!==i.endLineNumber}}}))),this._disposables.add(t.onDidTrigger((e=>{this._locked=!0}))),this._disposables.add(t.onDidCancel((e=>{this._locked=!1})))}getLastOvertypedInfo(e){if(e>=0&&e=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},q2=function(e,t){return function(i,n){t(i,n,e)}};class $2 extends BW{updateLabel(){const e=this._keybindingService.lookupKeybinding(this._action.id,this._contextKeyService);if(!e)return super.updateLabel();this.label&&(this.label.textContent=ue(0,"{0} ({1})",this._action.label,$2.symbolPrintEnter(e)))}static symbolPrintEnter(e){var t;return null===(t=e.getLabel())||void 0===t?void 0:t.replace(/\benter\b/gi,"\u23ce")}}let G2=class{constructor(e,t,i,n,s){this._menuId=t,this._menuService=n,this._contextKeyService=s,this._menuDisposables=new N,this.element=ds(e,fs(".suggest-status-bar"));const o=e=>e instanceof oh?i.createInstance($2,e,void 0):void 0;this._leftActions=new Rx(this.element,{actionViewItemProvider:o}),this._rightActions=new Rx(this.element,{actionViewItemProvider:o}),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 t=[],i=[];for(const[n,s]of e.getActions())"left"===n?t.push(...s):i.push(...s);this._leftActions.clear(),this._leftActions.push(t),this._rightActions.clear(),this._rightActions.push(i)};this._menuDisposables.add(e.onDidChange((()=>t()))),this._menuDisposables.add(e)}hide(){this._menuDisposables.clear()}};G2=j2([q2(2,Fa),q2(3,th),q2(4,Ol)],G2);var Z2=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Y2=function(e,t){return function(i,n){t(i,n,e)}};function X2(e){return!!e&&Boolean(e.completion.documentation||e.completion.detail&&e.completion.detail!==e.completion.label)}let Q2=class{constructor(e,t){this._editor=e,this._onDidClose=new U,this.onDidClose=this._onDidClose.event,this._onDidChangeContents=new U,this.onDidChangeContents=this._onDidChangeContents.event,this._disposables=new N,this._renderDisposeable=new N,this._borderWidth=1,this._size=new Wn(330,0),this.domNode=fs(".suggest-details"),this.domNode.classList.add("no-docs"),this._markdownRenderer=t.createInstance(Jk,{editor:e}),this._body=fs(".body"),this._scrollbar=new OD(this._body,{alwaysConsumeMouseWheel:!0}),ds(this.domNode,this._scrollbar.getDomNode()),this._disposables.add(this._scrollbar),this._header=ds(this._body,fs(".header")),this._close=ds(this._header,fs("span"+ta.asCSSSelector(Jr.close))),this._close.title=ue(0,"Close"),this._type=ds(this._header,fs("p.type")),this._docs=ds(this._body,fs("p.docs")),this._configureFont(),this._disposables.add(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(50)&&this._configureFont()})))}dispose(){this._disposables.dispose(),this._renderDisposeable.dispose()}_configureFont(){const e=this._editor.getOptions(),t=e.get(50),i=t.getMassagedFontFamily(),n=e.get(118)||t.fontSize,s=e.get(119)||t.lineHeight,o=t.fontWeight,r=`${n}px`,a=`${s}px`;this.domNode.style.fontSize=r,this.domNode.style.lineHeight=""+s/n,this.domNode.style.fontWeight=o,this.domNode.style.fontFeatureSettings=t.fontFeatureSettings,this._type.style.fontFamily=i,this._close.style.height=a,this._close.style.width=a}getLayoutInfo(){const e=this._editor.getOption(119)||this._editor.getOption(50).lineHeight,t=this._borderWidth;return{lineHeight:e,borderWidth:t,borderHeight:2*t,verticalPadding:22,horizontalPadding:14}}renderLoading(){this._type.textContent=ue(0,"Loading..."),this._docs.textContent="",this.domNode.classList.remove("no-docs","no-type"),this.layout(this.size.width,2*this.getLayoutInfo().lineHeight),this._onDidChangeContents.fire(this)}renderItem(e,t){var i,n;this._renderDisposeable.clear();let{detail:s,documentation:o}=e.completion;if(t){let t="";t+=`score: ${e.score[0]}\n`,t+=`prefix: ${null!==(i=e.word)&&void 0!==i?i:"(no prefix)"}\n`,t+=`word: ${e.completion.filterText?e.completion.filterText+" (filterText)":e.textLabel}\n`,t+=`distance: ${e.distance} (localityBonus-setting)\n`,t+=`index: ${e.idx}, based on ${e.completion.sortText&&`sortText: "${e.completion.sortText}"`||"label"}\n`,t+=`commit_chars: ${null===(n=e.completion.commitCharacters)||void 0===n?void 0:n.join("")}\n`,o=(new Ta).appendCodeblock("empty",t),s=`Provider: ${e.provider._debugDisplayName}`}if(t||X2(e)){if(this.domNode.classList.remove("no-docs","no-type"),s){const e=s.length>1e5?`${s.substr(0,1e5)}\u2026`:s;this._type.textContent=e,this._type.title=e,_s(this._type),this._type.classList.toggle("auto-wrap",!/\r?\n^\s+/gim.test(e))}else Dn(this._type),this._type.title="",vs(this._type),this.domNode.classList.add("no-type");if(Dn(this._docs),"string"==typeof o)this._docs.classList.remove("markdown-docs"),this._docs.textContent=o;else if(o){this._docs.classList.add("markdown-docs"),Dn(this._docs);const e=this._markdownRenderer.render(o);this._docs.appendChild(e.element),this._renderDisposeable.add(e),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=e=>{e.preventDefault(),e.stopPropagation()},this._close.onclick=e=>{e.preventDefault(),e.stopPropagation(),this._onDidClose.fire()},this._body.scrollTop=0,this.layout(this._size.width,this._type.clientHeight+this._docs.clientHeight),this._onDidChangeContents.fire(this)}else this.clearContents()}clearContents(){this.domNode.classList.add("no-docs"),this._type.textContent="",this._docs.textContent=""}get size(){return this._size}layout(e,t){const i=new Wn(e,t);Wn.equals(i,this._size)||(this._size=i,function(e,t,i){"number"==typeof t&&(e.style.width=`${t}px`),"number"==typeof i&&(e.style.height=`${i}px`)}(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}};Q2=Z2([Y2(1,Fa)],Q2);class J2{constructor(e,t){let i,n;this.widget=e,this._editor=t,this._disposables=new N,this._added=!1,this._preferAlignAtTop=!0,this._resizable=new pK,this._resizable.domNode.classList.add("suggest-details-container"),this._resizable.domNode.appendChild(e.domNode),this._resizable.enableSashes(!1,!0,!0,!1);let s=0,o=0;this._disposables.add(this._resizable.onDidWillResize((()=>{i=this._topLeft,n=this._resizable.size}))),this._disposables.add(this._resizable.onDidResize((e=>{if(i&&n){this.widget.layout(e.dimension.width,e.dimension.height);let t=!1;e.west&&(o=n.width-e.dimension.width,t=!0),e.north&&(s=n.height-e.dimension.height,t=!0),t&&this._applyTopLeft({top:i.top+s,left:i.left+o})}e.done&&(i=void 0,n=void 0,s=0,o=0,this._userSize=e.dimension)}))),this._disposables.add(this.widget.onDidChangeContents((()=>{var e;this._anchorBox&&this._placeAtAnchor(this._anchorBox,null!==(e=this._userSize)&&void 0!==e?e: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 null}show(){this._added||(this._editor.addOverlayWidget(this),this.getDomNode().style.position="fixed",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){var i;const n=e.getBoundingClientRect();this._anchorBox=n,this._preferAlignAtTop=t,this._placeAtAnchor(this._anchorBox,null!==(i=this._userSize)&&void 0!==i?i:this.widget.size,t)}_placeAtAnchor(e,t,i){var n;const s=Fn(this.getDomNode().ownerDocument.body),o=this.widget.getLayoutInfo(),r=new Wn(220,2*o.lineHeight),a=e.top,l=function(){const i=s.width-(e.left+e.width+o.borderWidth+o.horizontalPadding),n=-o.borderWidth+e.left+e.width,l=new Wn(i,s.height-e.top-o.borderHeight-o.verticalPadding),h=l.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:a,left:n,fit:i-t.width,maxSizeTop:l,maxSizeBottom:h,minSize:r.with(Math.min(i,r.width))}}(),h=[l,function(){const i=e.left-o.borderWidth-o.horizontalPadding,n=Math.max(o.horizontalPadding,e.left-t.width-o.borderWidth),l=new Wn(i,s.height-e.top-o.borderHeight-o.verticalPadding),h=l.with(void 0,e.top+e.height-o.borderHeight-o.verticalPadding);return{top:a,left:n,fit:i-t.width,maxSizeTop:l,maxSizeBottom:h,minSize:r.with(Math.min(i,r.width))}}(),function(){const i=e.left,n=-o.borderWidth+e.top+e.height,a=new Wn(e.width-o.borderHeight,s.height-e.top-e.height-o.verticalPadding);return{top:n,left:i,fit:a.height-t.height,maxSizeBottom:a,maxSizeTop:a,minSize:r.with(a.width)}}()],d=null!==(n=h.find((e=>e.fit>=0)))&&void 0!==n?n:h.sort(((e,t)=>t.fit-e.fit))[0],c=e.top+e.height-o.borderHeight;let u,g=t.height;const p=Math.max(d.maxSizeTop.height,d.maxSizeBottom.height);let m;g>p&&(g=p),i?g<=d.maxSizeTop.height?(u=!0,m=d.maxSizeTop):(u=!1,m=d.maxSizeBottom):g<=d.maxSizeBottom.height?(u=!1,m=d.maxSizeBottom):(u=!0,m=d.maxSizeTop),this._applyTopLeft({left:d.left,top:u?d.top:c-g}),this.getDomNode().style.position="fixed",this._resizable.enableSashes(!u,d===l,u,d!==l),this._resizable.minSize=d.minSize,this._resizable.maxSize=m,this._resizable.layout(g,Math.min(m.width,t.width)),this.widget.layout(this._resizable.size.width,this._resizable.size.height)}_applyTopLeft(e){this._topLeft=e,this.getDomNode().style.left=`${this._topLeft.left}px`,this.getDomNode().style.top=`${this._topLeft.top}px`}}var e4;!function(e){e[e.FILE=0]="FILE",e[e.FOLDER=1]="FOLDER",e[e.ROOT_FOLDER=2]="ROOT_FOLDER"}(e4||(e4={}));const t4=/(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;function i4(e,t,i,n){const s=n===e4.ROOT_FOLDER?["rootfolder-icon"]:n===e4.FOLDER?["folder-icon"]:["file-icon"];if(i){let o;if(i.scheme===vn.data){o=Ia.parseMetaData(i).get(Ia.META_DATA_LABEL)}else{const e=i.path.match(t4);e?(o=n4(e[2].toLowerCase()),e[1]&&s.push(`${n4(e[1].toLowerCase())}-name-dir-icon`)):o=n4(i.authority.toLowerCase())}if(n===e4.FOLDER)s.push(`${o}-name-folder-icon`);else{if(o){if(s.push(`${o}-name-file-icon`),s.push("name-file-icon"),o.length<=255){const e=o.split(".");for(let t=1;t=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},r4=function(e,t){return function(i,n){t(i,n,e)}};function a4(e){return`suggest-aria-id:${e}`}const l4=tR("suggest-more-info",Jr.chevronRight,ue(0,"Icon for more information in the suggest widget.")),h4=new(s4=class{extract(e,t){if(e.textLabel.match(s4._regexStrict))return t[0]=e.textLabel,!0;if(e.completion.detail&&e.completion.detail.match(s4._regexStrict))return t[0]=e.completion.detail,!0;if("string"==typeof e.completion.documentation){const i=s4._regexRelaxed.exec(e.completion.documentation);if(i&&(0===i.index||i.index+i[0].length===e.completion.documentation.length))return t[0]=i[0],!0}return!1}},s4._regexRelaxed=/(#([\da-fA-F]{3}){1,2}|(rgb|hsl)a\(\s*(\d{1,3}%?\s*,\s*){3}(1|0?\.\d+)\)|(rgb|hsl)\(\s*\d{1,3}%?(\s*,\s*\d{1,3}%?){2}\s*\))/,s4._regexStrict=new RegExp(`^${s4._regexRelaxed.source}$`,"i"),s4);let d4=class{constructor(e,t,i,n){this._editor=e,this._modelService=t,this._languageService=i,this._themeService=n,this._onDidToggleDetails=new U,this.onDidToggleDetails=this._onDidToggleDetails.event,this.templateId="suggestion"}dispose(){this._onDidToggleDetails.dispose()}renderTemplate(e){const t=new N,i=e;i.classList.add("show-file-icons");const n=ds(e,fs(".icon")),s=ds(n,fs("span.colorspan")),o=ds(e,fs(".contents")),r=ds(o,fs(".main")),a=ds(r,fs(".icon-label.codicon")),l=ds(r,fs("span.left")),h=ds(r,fs("span.right")),d=new qz(l,{supportHighlights:!0,supportIcons:!0});t.add(d);const c=ds(l,fs("span.signature-label")),u=ds(l,fs("span.qualifier-label")),g=ds(h,fs("span.details-label")),p=ds(h,fs("span.readMore"+ta.asCSSSelector(l4)));p.title=ue(0,"Read More");const m=()=>{const e=this._editor.getOptions(),t=e.get(50),s=t.getMassagedFontFamily(),o=t.fontFeatureSettings,a=e.get(118)||t.fontSize,l=e.get(119)||t.lineHeight,h=t.fontWeight,d=`${a}px`,c=`${l}px`,u=`${t.letterSpacing}px`;i.style.fontSize=d,i.style.fontWeight=h,i.style.letterSpacing=u,r.style.fontFamily=s,r.style.fontFeatureSettings=o,r.style.lineHeight=c,n.style.height=c,n.style.width=c,p.style.height=c,p.style.width=c};return m(),t.add(this._editor.onDidChangeConfiguration((e=>{(e.hasChanged(50)||e.hasChanged(118)||e.hasChanged(119))&&m()}))),{root:i,left:l,right:h,icon:n,colorspan:s,iconLabel:d,iconContainer:a,parametersLabel:c,qualifierLabel:u,detailsLabel:g,readMore:p,disposables:t}}renderElement(e,t,i){const{completion:n}=e;i.root.id=a4(t),i.colorspan.style.backgroundColor="";const s={labelEscapeNewLines:!0,matches:_r(e.score)},o=[];if(19===n.kind&&h4.extract(e,o))i.icon.className="icon customcolor",i.iconContainer.className="icon hide",i.colorspan.style.backgroundColor=o[0];else if(20===n.kind&&this._themeService.getFileIconTheme().hasFileIcons){i.icon.className="icon hide",i.iconContainer.className="icon hide";const t=i4(this._modelService,this._languageService,an.from({scheme:"fake",path:e.textLabel}),e4.FILE),o=i4(this._modelService,this._languageService,an.from({scheme:"fake",path:n.detail}),e4.FILE);s.extraClasses=t.length>o.length?t:o}else 23===n.kind&&this._themeService.getFileIconTheme().hasFolderIcons?(i.icon.className="icon hide",i.iconContainer.className="icon hide",s.extraClasses=[i4(this._modelService,this._languageService,an.from({scheme:"fake",path:e.textLabel}),e4.FOLDER),i4(this._modelService,this._languageService,an.from({scheme:"fake",path:n.detail}),e4.FOLDER)].flat()):(i.icon.className="icon hide",i.iconContainer.className="",i.iconContainer.classList.add("suggest-icon",...ta.asClassNameArray(gC.toIcon(n.kind))));n.tags&&n.tags.indexOf(1)>=0&&(s.extraClasses=(s.extraClasses||[]).concat(["deprecated"]),s.matches=[]),i.iconLabel.setLabel(e.textLabel,void 0,s),"string"==typeof n.label?(i.parametersLabel.textContent="",i.detailsLabel.textContent=c4(n.detail||""),i.root.classList.add("string-label")):(i.parametersLabel.textContent=c4(n.label.detail||""),i.detailsLabel.textContent=c4(n.label.description||""),i.root.classList.remove("string-label")),this._editor.getOption(117).showInlineDetails?_s(i.detailsLabel):vs(i.detailsLabel),X2(e)?(i.right.classList.add("can-expand-details"),_s(i.readMore),i.readMore.onmousedown=e=>{e.stopPropagation(),e.preventDefault()},i.readMore.onclick=e=>{e.stopPropagation(),e.preventDefault(),this._onDidToggleDetails.fire()}):(i.right.classList.remove("can-expand-details"),vs(i.readMore),i.readMore.onmousedown=null,i.readMore.onclick=null)}disposeTemplate(e){e.disposables.dispose()}};function c4(e){return e.replace(/\r\n|\r|\n/g,"")}d4=o4([r4(1,Ha),r4(2,Lc),r4(3,P_)],d4);var u4,g4=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},p4=function(e,t){return function(i,n){t(i,n,e)}},m4=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};Dp("editorSuggestWidget.background",{dark:km,light:km,hcDark:km,hcLight:km},ue(0,"Background color of the suggest widget.")),Dp("editorSuggestWidget.border",{dark:xm,light:xm,hcDark:xm,hcLight:xm},ue(0,"Border color of the suggest widget."));const f4=Dp("editorSuggestWidget.foreground",{dark:Lm,light:Lm,hcDark:Lm,hcLight:Lm},ue(0,"Foreground color of the suggest widget."));Dp("editorSuggestWidget.selectedForeground",{dark:zf,light:zf,hcDark:zf,hcLight:zf},ue(0,"Foreground color of the selected entry in the suggest widget.")),Dp("editorSuggestWidget.selectedIconForeground",{dark:Uf,light:Uf,hcDark:Uf,hcLight:Uf},ue(0,"Icon foreground color of the selected entry in the suggest widget."));const _4=Dp("editorSuggestWidget.selectedBackground",{dark:Kf,light:Kf,hcDark:Kf,hcLight:Kf},ue(0,"Background color of the selected entry in the suggest widget."));Dp("editorSuggestWidget.highlightForeground",{dark:kf,light:kf,hcDark:kf,hcLight:kf},ue(0,"Color of the match highlights in the suggest widget.")),Dp("editorSuggestWidget.focusHighlightForeground",{dark:Df,light:Df,hcDark:Df,hcLight:Df},ue(0,"Color of the match highlights in the suggest widget when an item is focused.")),Dp("editorSuggestWidgetStatus.foreground",{dark:D_(f4,.5),light:D_(f4,.5),hcDark:D_(f4,.5),hcLight:D_(f4,.5)},ue(0,"Foreground color of the suggest widget status."));class v4{constructor(e,t){this._service=e,this._key=`suggestWidget.size/${t.getEditorType()}/${t instanceof pW}`}restore(){var e;const t=null!==(e=this._service.get(this._key,0))&&void 0!==e?e:"";try{const e=JSON.parse(t);if(Wn.is(e))return Wn.lift(e)}catch(Vs){}}store(e){this._service.store(this._key,JSON.stringify(e),0,1)}reset(){this._service.remove(this._key,0)}}let b4=u4=class{constructor(e,t,i,n,s){this.editor=e,this._storageService=t,this._state=0,this._isAuto=!1,this._pendingLayout=new I,this._pendingShowDetails=new I,this._ignoreFocusEvents=!1,this._forceRenderingAbove=!1,this._explainMode=!1,this._showTimeout=new sd,this._disposables=new N,this._onDidSelect=new j,this._onDidFocus=new j,this._onDidHide=new U,this._onDidShow=new U,this.onDidSelect=this._onDidSelect.event,this.onDidFocus=this._onDidFocus.event,this.onDidHide=this._onDidHide.event,this.onDidShow=this._onDidShow.event,this._onDetailsKeydown=new U,this.onDetailsKeyDown=this._onDetailsKeydown.event,this.element=new pK,this.element.domNode.classList.add("editor-widget","suggest-widget"),this._contentWidget=new C4(this,e),this._persistedSize=new v4(t,e);class o{constructor(e,t,i=!1,n=!1){this.persistedSize=e,this.currentSize=t,this.persistHeight=i,this.persistWidth=n}}let r;this._disposables.add(this.element.onDidWillResize((()=>{this._contentWidget.lockPreference(),r=new o(this._persistedSize.restore(),this.element.size)}))),this._disposables.add(this.element.onDidResize((e=>{var t,i,n,s;if(this._resize(e.dimension.width,e.dimension.height),r&&(r.persistHeight=r.persistHeight||!!e.north||!!e.south,r.persistWidth=r.persistWidth||!!e.east||!!e.west),e.done){if(r){const{itemHeight:e,defaultSize:o}=this.getLayoutInfo(),a=Math.round(e/2);let{width:l,height:h}=this.element.size;(!r.persistHeight||Math.abs(r.currentSize.height-h)<=a)&&(h=null!==(i=null===(t=r.persistedSize)||void 0===t?void 0:t.height)&&void 0!==i?i:o.height),(!r.persistWidth||Math.abs(r.currentSize.width-l)<=a)&&(l=null!==(s=null===(n=r.persistedSize)||void 0===n?void 0:n.width)&&void 0!==s?s:o.width),this._persistedSize.store(new Wn(l,h))}this._contentWidget.unlockPreference(),r=void 0}}))),this._messageElement=ds(this.element.domNode,fs(".message")),this._listElement=ds(this.element.domNode,fs(".tree"));const a=this._disposables.add(s.createInstance(Q2,this.editor));a.onDidClose(this.toggleDetails,this,this._disposables),this._details=new J2(a,this.editor);const l=()=>this.element.domNode.classList.toggle("no-icons",!this.editor.getOption(117).showIcons);l();const h=s.createInstance(d4,this.editor);this._disposables.add(h),this._disposables.add(h.onDidToggleDetails((()=>this.toggleDetails()))),this._list=new yx("SuggestWidget",this._listElement,{getHeight:e=>this.getLayoutInfo().itemHeight,getTemplateId:e=>"suggestion"},[h],{alwaysConsumeMouseWheel:!0,useShadows:!1,mouseSupport:!1,multipleSelectionSupport:!1,accessibilityProvider:{getRole:()=>"option",getWidgetAriaLabel:()=>ue(0,"Suggest"),getWidgetRole:()=>"listbox",getAriaLabel:e=>{let t=e.textLabel;if("string"!=typeof e.completion.label){const{detail:i,description:n}=e.completion.label;i&&n?t=ue(0,"{0} {1}, {2}",t,i,n):i?t=ue(0,"{0} {1}",t,i):n&&(t=ue(0,"{0}, {1}",t,n))}if(!e.isResolved||!this._isDetailsVisible())return t;const{documentation:i,detail:n}=e.completion;return ue(0,"{0}, docs: {1}",t,Qs("{0}{1}",n||"",i?"string"==typeof i?i:i.value:""))}}}),this._list.style(Jx({listInactiveFocusBackground:_4,listInactiveFocusOutline:Tp})),this._status=s.createInstance(G2,this.element.domNode,R1);const d=()=>this.element.domNode.classList.toggle("with-status-bar",this.editor.getOption(117).showStatusBar);d(),this._disposables.add(n.onDidColorThemeChange((e=>this._onThemeChange(e)))),this._onThemeChange(n.getColorTheme()),this._disposables.add(this._list.onMouseDown((e=>this._onListMouseDownOrTap(e)))),this._disposables.add(this._list.onTap((e=>this._onListMouseDownOrTap(e)))),this._disposables.add(this._list.onDidChangeSelection((e=>this._onListSelection(e)))),this._disposables.add(this._list.onDidChangeFocus((e=>this._onListFocus(e)))),this._disposables.add(this.editor.onDidChangeCursorSelection((()=>this._onCursorSelectionChanged()))),this._disposables.add(this.editor.onDidChangeConfiguration((e=>{e.hasChanged(117)&&(d(),l())}))),this._ctxSuggestWidgetVisible=T1.Visible.bindTo(i),this._ctxSuggestWidgetDetailsVisible=T1.DetailsVisible.bindTo(i),this._ctxSuggestWidgetMultipleSuggestions=T1.MultipleSuggestions.bindTo(i),this._ctxSuggestWidgetHasFocusedSuggestion=T1.HasFocusedSuggestion.bindTo(i),this._disposables.add(Mn(this._details.widget.domNode,"keydown",(e=>{this._onDetailsKeydown.fire(e)}))),this._disposables.add(this.editor.onMouseDown((e=>this._onEditorMouseDown(e))))}dispose(){var e;this._details.widget.dispose(),this._details.dispose(),this._list.dispose(),this._status.dispose(),this._disposables.dispose(),null===(e=this._loadingTimeout)||void 0===e||e.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(){0!==this._state&&this._contentWidget.layout()}_onListMouseDownOrTap(e){void 0!==e.element&&void 0!==e.index&&(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=A_(e.type)?2:1}_onListFocus(e){var t;if(this._ignoreFocusEvents)return;if(!e.elements.length)return this._currentSuggestionDetails&&(this._currentSuggestionDetails.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=void 0),this.editor.setAriaOptions({activeDescendant:void 0}),void this._ctxSuggestWidgetHasFocusedSuggestion.set(!1);if(!this._completionModel)return;this._ctxSuggestWidgetHasFocusedSuggestion.set(!0);const i=e.elements[0],n=e.indexes[0];i!==this._focusedItem&&(null===(t=this._currentSuggestionDetails)||void 0===t||t.cancel(),this._currentSuggestionDetails=void 0,this._focusedItem=i,this._list.reveal(n),this._currentSuggestionDetails=Yh((e=>m4(this,void 0,void 0,(function*(){const t=id((()=>{this._isDetailsVisible()&&this.showDetails(!0)}),250),n=e.onCancellationRequested((()=>t.dispose()));try{return yield i.resolve(e)}finally{t.dispose(),n.dispose()}})))),this._currentSuggestionDetails.then((()=>{n>=this._list.length||i!==this._list.element(n)||(this._ignoreFocusEvents=!0,this._list.splice(n,1,[i]),this._list.setFocus([n]),this._ignoreFocusEvents=!1,this._isDetailsVisible()?this.showDetails(!1):this.element.domNode.classList.remove("docs-side"),this.editor.setAriaOptions({activeDescendant:a4(n)}))})).catch(r)),this._onDidFocus.fire({item:i,index:n,model:this._completionModel})}_setState(e){if(this._state!==e)switch(this._state=e,this.element.domNode.classList.toggle("frozen",4===e),this.element.domNode.classList.remove("message"),e){case 0:vs(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 1:this.element.domNode.classList.add("message"),this._messageElement.textContent=u4.LOADING_MESSAGE,vs(this._listElement,this._status.element),_s(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Fs(u4.LOADING_MESSAGE);break;case 2:this.element.domNode.classList.add("message"),this._messageElement.textContent=u4.NO_SUGGESTIONS_MESSAGE,vs(this._listElement,this._status.element),_s(this._messageElement),this._details.hide(),this._show(),this._focusedItem=void 0,Fs(u4.NO_SUGGESTIONS_MESSAGE);break;case 3:case 4:vs(this._messageElement),_s(this._listElement,this._status.element),this._show();break;case 5:vs(this._messageElement),_s(this._listElement,this._status.element),this._details.show(),this._show()}}_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){0===this._state&&(this._contentWidget.setPosition(this.editor.getPosition()),this._isAuto=!!e,this._isAuto||(this._loadingTimeout=id((()=>this._setState(1)),t)))}showSuggestions(e,t,i,n,s){var o,r;if(this._contentWidget.setPosition(this.editor.getPosition()),null===(o=this._loadingTimeout)||void 0===o||o.dispose(),null===(r=this._currentSuggestionDetails)||void 0===r||r.cancel(),this._currentSuggestionDetails=void 0,this._completionModel!==e&&(this._completionModel=e),i&&2!==this._state&&0!==this._state)return void this._setState(4);const a=this._completionModel.items.length,l=0===a;if(this._ctxSuggestWidgetMultipleSuggestions.set(a>1),l)return this._setState(n?0:2),void(this._completionModel=void 0);this._focusedItem=void 0,this._onDidFocus.pause(),this._onDidSelect.pause();try{this._list.splice(0,this._list.length,this._completionModel.items),this._setState(i?4:3),this._list.reveal(t,0),this._list.setFocus(s?[]:[t])}finally{this._onDidFocus.resume(),this._onDidSelect.resume()}this._pendingLayout.value=Rn((()=>{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 0:return!1;case 5:return this._details.widget.pageDown(),!0;case 1:return!this._isAuto;default:return this._list.focusNextPage(),!0}}selectNext(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusNext(1,!0),!0}}selectLast(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollBottom(),!0;case 1:return!this._isAuto;default:return this._list.focusLast(),!0}}selectPreviousPage(){switch(this._state){case 0:return!1;case 5:return this._details.widget.pageUp(),!0;case 1:return!this._isAuto;default:return this._list.focusPreviousPage(),!0}}selectPrevious(){switch(this._state){case 0:return!1;case 1:return!this._isAuto;default:return this._list.focusPrevious(1,!0),!1}}selectFirst(){switch(this._state){case 0:return!1;case 5:return this._details.widget.scrollTop(),!0;case 1:return!this._isAuto;default:return this._list.focusFirst(),!0}}getFocusedItem(){if(0!==this._state&&2!==this._state&&1!==this._state&&this._completionModel&&this._list.getFocus().length>0)return{item:this._list.getFocusedElements()[0],index:this._list.getFocus()[0],model:this._completionModel}}toggleDetailsFocus(){5===this._state?(this._setState(3),this._details.widget.domNode.classList.remove("focused")):3===this._state&&this._isDetailsVisible()&&(this._setState(5),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")):!X2(this._list.getFocusedElements()[0])&&!this._explainMode||3!==this._state&&5!==this._state&&4!==this._state||(this._ctxSuggestWidgetDetailsVisible.set(!0),this._setDetailsVisible(!0),this.showDetails(!1))}showDetails(e){this._pendingShowDetails.value=Rn((()=>{this._pendingShowDetails.clear(),this._details.show(),e?this._details.widget.renderLoading():this._details.widget.renderItem(this._list.getFocusedElements()[0],this._explainMode),this._positionDetails(),this.editor.focus(),this.element.domNode.classList.add("shows-details")}))}toggleExplainMode(){this._list.getFocusedElements()[0]&&(this._explainMode=!this._explainMode,this._isDetailsVisible()?this.showDetails(!1):this.toggleDetails())}resetPersistedSize(){this._persistedSize.reset()}hideWidget(){var e;this._pendingLayout.clear(),this._pendingShowDetails.clear(),null===(e=this._loadingTimeout)||void 0===e||e.dispose(),this._setState(0),this._onDidHide.fire(this),this.element.clearSashHoverState();const t=this._persistedSize.restore(),i=Math.ceil(4.3*this.getLayoutInfo().itemHeight);t&&t.heightl&&(a=l);const h=this._completionModel?this._completionModel.stats.pLabelLen*o.typicalHalfwidthCharacterWidth:a,d=o.statusBarHeight+this._list.contentHeight+o.borderHeight,c=o.itemHeight+o.statusBarHeight,u=Hn(this.editor.getDomNode()),g=this.editor.getScrolledVisiblePosition(this.editor.getPosition()),p=u.top+g.top+g.height,m=Math.min(s.height-p-o.verticalPadding,d),f=u.top+g.top-o.verticalPadding,_=Math.min(f,d);let v=Math.min(Math.max(_,m)+o.borderHeight,d);r===(null===(t=this._cappedHeight)||void 0===t?void 0:t.capped)&&(r=this._cappedHeight.wanted),rv&&(r=v);const b=150;r>m||this._forceRenderingAbove&&f>b?(this._contentWidget.setPreference(1),this.element.enableSashes(!0,!0,!1,!1),v=_):(this._contentWidget.setPreference(2),this.element.enableSashes(!1,!0,!0,!1),v=m),this.element.preferredSize=new Wn(h,o.defaultSize.height),this.element.maxSize=new Wn(l,v),this.element.minSize=new Wn(220,c),this._cappedHeight=r===d?{wanted:null!==(n=null===(i=this._cappedHeight)||void 0===i?void 0:i.wanted)&&void 0!==n?n:e.height,capped:r}:void 0}this._resize(a,r)}_resize(e,t){const{width:i,height:n}=this.element.maxSize;e=Math.min(i,e),t=Math.min(n,t);const{statusBarHeight:s}=this.getLayoutInfo();this._list.layout(t-s,e),this._listElement.style.height=t-s+"px",this.element.layout(t,e),this._contentWidget.layout(),this._positionDetails()}_positionDetails(){var e;this._isDetailsVisible()&&this._details.placeAtAnchor(this.element.domNode,2===(null===(e=this._contentWidget.getPosition())||void 0===e?void 0:e.preference[0]))}getLayoutInfo(){const e=this.editor.getOption(50),t=uD(this.editor.getOption(119)||e.lineHeight,8,1e3),i=this.editor.getOption(117).showStatusBar&&2!==this._state&&1!==this._state?t:0,n=this._details.widget.borderWidth,s=2*n;return{itemHeight:t,statusBarHeight:i,borderWidth:n,borderHeight:s,typicalHalfwidthCharacterWidth:e.typicalHalfwidthCharacterWidth,verticalPadding:22,horizontalPadding:14,defaultSize:new Wn(430,i+12*t+s)}}_isDetailsVisible(){return this._storageService.getBoolean("expandSuggestionDocs",0,!1)}_setDetailsVisible(e){this._storageService.store("expandSuggestionDocs",e,0,0)}forceRenderingAbove(){this._forceRenderingAbove||(this._forceRenderingAbove=!0,this._layout(this._persistedSize.restore()))}stopForceRenderingAbove(){this._forceRenderingAbove=!1}};b4.LOADING_MESSAGE=ue(0,"Loading..."),b4.NO_SUGGESTIONS_MESSAGE=ue(0,"No suggestions."),b4=u4=g4([p4(1,ZN),p4(2,Ol),p4(3,P_),p4(4,Fa)],b4);class C4{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?{position:this._position,preference:[this._preference]}:null}beforeRender(){const{height:e,width:t}=this._widget.element.size,{borderWidth:i,horizontalPadding:n}=this._widget.getLayoutInfo();return new Wn(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 w4,y4=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},S4=function(e,t){return function(i,n){t(i,n,e)}};class L4{constructor(e,t){this._model=e,this._position=t;if(e.getLineMaxColumn(t.lineNumber)!==t.column){const i=e.getOffsetAt(t),n=e.getPositionAt(i+1);this._marker=e.deltaDecorations([],[{range:Rh.fromPositions(t,n),options:{description:"suggest-line-suffix",stickiness:1}}])}}dispose(){this._marker&&!this._model.isDisposed()&&this._model.deltaDecorations(this._marker,[])}delta(e){if(this._model.isDisposed()||this._position.lineNumber!==e.lineNumber)return 0;if(this._marker){const t=this._model.getDecorationRange(this._marker[0]);return this._model.getOffsetAt(t.getStartPosition())-this._model.getOffsetAt(e)}return this._model.getLineMaxColumn(e.lineNumber)-e.column}}let k4=w4=class{static get(e){return e.getContribution(w4.ID)}constructor(e,t,i,n,s,o,r){this._memoryService=t,this._commandService=i,this._contextKeyService=n,this._instantiationService=s,this._logService=o,this._telemetryService=r,this._lineSuffix=new I,this._toDispose=new N,this._selectors=new D4((e=>e.priority)),this._onWillInsertSuggestItem=new U,this.onWillInsertSuggestItem=this._onWillInsertSuggestItem.event,this.editor=e,this.model=s.createInstance(U2,this.editor),this._selectors.register({priority:0,select:(e,t,i)=>this._memoryService.select(e,t,i)});const a=T1.InsertMode.bindTo(n);a.set(e.getOption(117).insertMode),this._toDispose.add(this.model.onDidTrigger((()=>a.set(e.getOption(117).insertMode)))),this.widget=this._toDispose.add(new ld((()=>{const e=this._instantiationService.createInstance(b4,this.editor);this._toDispose.add(e),this._toDispose.add(e.onDidSelect((e=>this._insertSuggestion(e,0)),this));const t=new M2(this.editor,e,this.model,(e=>this._insertSuggestion(e,2)));this._toDispose.add(t);const i=T1.MakesTextEdit.bindTo(this._contextKeyService),n=T1.HasInsertAndReplaceRange.bindTo(this._contextKeyService),s=T1.CanResolve.bindTo(this._contextKeyService);return this._toDispose.add(x((()=>{i.reset(),n.reset(),s.reset()}))),this._toDispose.add(e.onDidFocus((({item:e})=>{const t=this.editor.getPosition(),o=e.editStart.column,r=t.column;let a=!0;if(!("smart"!==this.editor.getOption(1)||2!==this.model.state||e.completion.additionalTextEdits||4&e.completion.insertTextRules||r-o!==e.completion.insertText.length)){a=this.editor.getModel().getValueInRange({startLineNumber:t.lineNumber,startColumn:o,endLineNumber:t.lineNumber,endColumn:r})!==e.completion.insertText}i.set(a),n.set(!Va.equals(e.editInsertEnd,e.editReplaceEnd)),s.set(Boolean(e.provider.resolveCompletionItem)||Boolean(e.completion.documentation)||e.completion.detail!==e.completion.label)}))),this._toDispose.add(e.onDetailsKeyDown((e=>{e.toKeyCodeChord().equals(new _t(!0,!1,!1,!1,33))||Pe&&e.toKeyCodeChord().equals(new _t(!1,!1,!1,!0,33))?e.stopPropagation():e.toKeyCodeChord().isModifierKey()||this.editor.focus()}))),e}))),this._overtypingCapturer=this._toDispose.add(new ld((()=>this._toDispose.add(new K2(this.editor,this.model))))),this._alternatives=this._toDispose.add(new ld((()=>this._toDispose.add(new I2(this.editor,this._contextKeyService))))),this._toDispose.add(s.createInstance(D2,e)),this._toDispose.add(this.model.onDidTrigger((e=>{this.widget.value.showTriggered(e.auto,e.shy?250:50),this._lineSuffix.value=new L4(this.editor.getModel(),e.position)}))),this._toDispose.add(this.model.onDidSuggest((e=>{if(e.triggerOptions.shy)return;let t=-1;for(const n of this._selectors.itemsOrderedByPriorityDesc)if(t=n.select(this.editor.getModel(),this.editor.getPosition(),e.completionModel.items),-1!==t)break;-1===t&&(t=0);let i=!1;if(e.triggerOptions.auto){const t=this.editor.getOption(117);"never"===t.selectionMode||"always"===t.selectionMode?i="never"===t.selectionMode:"whenTriggerCharacter"===t.selectionMode?i=1!==e.triggerOptions.triggerKind:"whenQuickSuggestion"===t.selectionMode&&(i=1===e.triggerOptions.triggerKind&&!e.triggerOptions.refilter)}this.widget.value.showSuggestions(e.completionModel,t,e.isFrozen,e.triggerOptions.auto,i)}))),this._toDispose.add(this.model.onDidCancel((e=>{e.retrigger||this.widget.value.hideWidget()}))),this._toDispose.add(this.editor.onDidBlurEditorWidget((()=>{this.model.cancel(),this.model.clear()})));const l=T1.AcceptSuggestionsOnEnter.bindTo(n),h=()=>{const e=this.editor.getOption(1);l.set("on"===e||"smart"===e)};this._toDispose.add(this.editor.onDidChangeConfiguration((()=>h()))),h()}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)return this._alternatives.value.reset(),this.model.cancel(),void this.model.clear();if(!this.editor.hasModel())return;const i=h2.get(this.editor);if(!i)return;this._onWillInsertSuggestItem.fire({item:e.item});const n=this.editor.getModel(),s=n.getAlternativeVersionId(),{item:o}=e,l=[],h=new jh;1&t||this.editor.pushUndoStop();const d=this.getOverwriteInfo(o,Boolean(8&t));this._memoryService.memorize(n,this.editor.getPosition(),o);const c=o.isResolved;let u=-1,g=-1;if(Array.isArray(o.completion.additionalTextEdits)){this.model.cancel();const e=WN.capture(this.editor);this.editor.executeEdits("suggestController.additionalTextEdits.sync",o.completion.additionalTextEdits.map((e=>Fq.replaceMove(Rh.lift(e.range),e.text)))),e.restoreRelativeVerticalPositionOfCursor(this.editor)}else if(!c){const e=new F;let i;const s=n.onDidChangeContent((e=>{if(e.isFlush)return h.cancel(),void s.dispose();for(const t of e.changes){const e=Rh.getEndPosition(t.range);i&&!Va.isBefore(e,i)||(i=e)}})),r=t;t|=2;let a=!1;const d=this.editor.onWillType((()=>{d.dispose(),a=!0,2&r||this.editor.pushUndoStop()}));l.push(o.resolve(h.token).then((()=>{if(!o.completion.additionalTextEdits||h.token.isCancellationRequested)return;if(i&&o.completion.additionalTextEdits.some((e=>Va.isBefore(i,Rh.getStartPosition(e.range)))))return!1;a&&this.editor.pushUndoStop();const e=WN.capture(this.editor);return this.editor.executeEdits("suggestController.additionalTextEdits.async",o.completion.additionalTextEdits.map((e=>Fq.replaceMove(Rh.lift(e.range),e.text)))),e.restoreRelativeVerticalPositionOfCursor(this.editor),!a&&2&r||this.editor.pushUndoStop(),!0})).then((t=>{this._logService.trace("[suggest] async resolving of edits DONE (ms, applied?)",e.elapsed(),t),g=!0===t?1:!1===t?0:-2})).finally((()=>{s.dispose(),d.dispose()})))}let{insertText:p}=o.completion;if(4&o.completion.insertTextRules||(p=c1.escape(p)),this.model.cancel(),i.insert(p,{overwriteBefore:d.overwriteBefore,overwriteAfter:d.overwriteAfter,undoStopBefore:!1,undoStopAfter:!1,adjustWhitespace:!(1&o.completion.insertTextRules),clipboardText:e.model.clipboardText,overtypingCapturer:this._overtypingCapturer.value}),2&t||this.editor.pushUndoStop(),o.completion.command)if(o.completion.command.id===x4.id)this.model.trigger({auto:!0,retrigger:!0});else{const e=new F;l.push(this._commandService.executeCommand(o.completion.command.id,...o.completion.command.arguments?[...o.completion.command.arguments]:[]).catch((e=>{o.completion.extensionId?a(e):r(e)})).finally((()=>{u=e.elapsed()})))}4&t&&this._alternatives.value.set(e,(e=>{for(h.cancel();n.canUndo();){s!==n.getAlternativeVersionId()&&n.undo(),this._insertSuggestion(e,3|(8&t?8:0));break}})),this._alertCompletionItem(o),Promise.all(l).finally((()=>{this._reportSuggestionAcceptedTelemetry(o,n,c,u,g),this.model.clear(),h.dispose()}))}_reportSuggestionAcceptedTelemetry(e,t,i,n,s){var o,r,a;0!==Math.floor(100*Math.random())&&this._telemetryService.publicLog2("suggest.acceptedSuggestion",{extensionId:null!==(r=null===(o=e.extensionId)||void 0===o?void 0:o.value)&&void 0!==r?r:"unknown",providerId:null!==(a=e.provider._debugDisplayName)&&void 0!==a?a:"unknown",kind:e.completion.kind,basenameHash:uE(wa(t.uri)).toString(16),languageId:t.getLanguageId(),fileExtension:ya(t.uri),resolveInfo:e.provider.resolveCompletionItem?i?1:0:-1,resolveDuration:e.resolveDuration,commandDuration:n,additionalEditsAsync:s})}getOverwriteInfo(e,t){qr(this.editor.hasModel());let i="replace"===this.editor.getOption(117).insertMode;t&&(i=!i);const n=e.position.column-e.editStart.column,s=(i?e.editReplaceEnd.column:e.editInsertEnd.column)-e.position.column;return{overwriteBefore:n+(this.editor.getPosition().column-e.position.column),overwriteAfter:s+(this._lineSuffix.value?this._lineSuffix.value.delta(this.editor.getPosition()):0)}}_alertCompletionItem(e){if(Hd(e.completion.additionalTextEdits)){Ps(ue(0,"Accepting '{0}' made {1} additional edits",e.textLabel,e.completion.additionalTextEdits.length))}}triggerSuggest(e,t,i){this.editor.hasModel()&&(this.model.trigger({auto:null!=t&&t,completionOptions:{providerFilter:e,kindFilter:i?new Set:void 0}}),this.editor.revealPosition(this.editor.getPosition(),0),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=e=>{if(4&e.completion.insertTextRules||e.completion.additionalTextEdits)return!0;const t=this.editor.getPosition(),i=e.editStart.column,n=t.column;if(n-i!==e.completion.insertText.length)return!0;return this.editor.getModel().getValueInRange({startLineNumber:t.lineNumber,startColumn:i,endLineNumber:t.lineNumber,endColumn:n})!==e.completion.insertText};B.once(this.model.onDidTrigger)((e=>{const t=[];B.any(this.model.onDidTrigger,this.model.onDidCancel)((()=>{k(t),i()}),void 0,t),this.model.onDidSuggest((({completionModel:e})=>{if(k(t),0===e.items.length)return void i();const s=this._memoryService.select(this.editor.getModel(),this.editor.getPosition(),e.items),o=e.items[s];n(o)?(this.editor.pushUndoStop(),this._insertSuggestion({index:s,item:o,model:e},7)):i()}),void 0,t)})),this.model.trigger({auto:!1,shy:!0}),this.editor.revealPosition(t,0),this.editor.focus()}acceptSelectedSuggestion(e,t){const i=this.widget.value.getFocusedItem();let n=0;e&&(n|=4),t&&(n|=8),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)}};k4.ID="editor.contrib.suggestController",k4=w4=y4([S4(1,y2),S4(2,Ya),S4(3,Ol),S4(4,Fa),S4(5,hh),S4(6,lh)],k4);class D4{constructor(e){this.prioritySelector=e,this._items=new Array}register(e){if(-1!==this._items.indexOf(e))throw new Error("Value is already registered");return this._items.push(e),this._items.sort(((e,t)=>this.prioritySelector(t)-this.prioritySelector(e))),{dispose:()=>{const t=this._items.indexOf(e);t>=0&&this._items.splice(t,1)}}}get itemsOrderedByPriorityDesc(){return this._items}}class x4 extends bh{constructor(){super({id:x4.id,label:ue(0,"Trigger Suggest"),alias:"Trigger Suggest",precondition:pl.and(Oh.writable,Oh.hasCompletionItemProvider,T1.Visible.toNegated()),kbOpts:{kbExpr:Oh.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[521,2087]},weight:100}})}run(e,t,i){const n=k4.get(t);if(!n)return;let s;i&&"object"==typeof i&&!0===i.auto&&(s=!0),n.triggerSuggest(void 0,s,void 0)}}x4.id="editor.action.triggerSuggest",Dh(k4.ID,k4,2),Lh(x4);const N4=190,E4=vh.bindToContribution(k4.get);Sh(new E4({id:"acceptSelectedSuggestion",precondition:pl.and(T1.Visible,T1.HasFocusedSuggestion),handler(e){e.acceptSelectedSuggestion(!0,!1)},kbOpts:[{primary:2,kbExpr:pl.and(T1.Visible,Oh.textInputFocus),weight:N4},{primary:3,kbExpr:pl.and(T1.Visible,Oh.textInputFocus,T1.AcceptSuggestionsOnEnter,T1.MakesTextEdit),weight:N4}],menuOpts:[{menuId:R1,title:ue(0,"Insert"),group:"left",order:1,when:T1.HasInsertAndReplaceRange.toNegated()},{menuId:R1,title:ue(0,"Insert"),group:"left",order:1,when:pl.and(T1.HasInsertAndReplaceRange,T1.InsertMode.isEqualTo("insert"))},{menuId:R1,title:ue(0,"Replace"),group:"left",order:1,when:pl.and(T1.HasInsertAndReplaceRange,T1.InsertMode.isEqualTo("replace"))}]})),Sh(new E4({id:"acceptAlternativeSelectedSuggestion",precondition:pl.and(T1.Visible,Oh.textInputFocus,T1.HasFocusedSuggestion),kbOpts:{weight:N4,kbExpr:Oh.textInputFocus,primary:1027,secondary:[1026]},handler(e){e.acceptSelectedSuggestion(!1,!0)},menuOpts:[{menuId:R1,group:"left",order:2,when:pl.and(T1.HasInsertAndReplaceRange,T1.InsertMode.isEqualTo("insert")),title:ue(0,"Replace")},{menuId:R1,group:"left",order:2,when:pl.and(T1.HasInsertAndReplaceRange,T1.InsertMode.isEqualTo("replace")),title:ue(0,"Insert")}]})),Xa.registerCommandAlias("acceptSelectedSuggestionOnEnter","acceptSelectedSuggestion"),Sh(new E4({id:"hideSuggestWidget",precondition:T1.Visible,handler:e=>e.cancelSuggestWidget(),kbOpts:{weight:N4,kbExpr:Oh.textInputFocus,primary:9,secondary:[1033]}})),Sh(new E4({id:"selectNextSuggestion",precondition:pl.and(T1.Visible,pl.or(T1.MultipleSuggestions,T1.HasFocusedSuggestion.negate())),handler:e=>e.selectNextSuggestion(),kbOpts:{weight:N4,kbExpr:Oh.textInputFocus,primary:18,secondary:[2066],mac:{primary:18,secondary:[2066,300]}}})),Sh(new E4({id:"selectNextPageSuggestion",precondition:pl.and(T1.Visible,pl.or(T1.MultipleSuggestions,T1.HasFocusedSuggestion.negate())),handler:e=>e.selectNextPageSuggestion(),kbOpts:{weight:N4,kbExpr:Oh.textInputFocus,primary:12,secondary:[2060]}})),Sh(new E4({id:"selectLastSuggestion",precondition:pl.and(T1.Visible,pl.or(T1.MultipleSuggestions,T1.HasFocusedSuggestion.negate())),handler:e=>e.selectLastSuggestion()})),Sh(new E4({id:"selectPrevSuggestion",precondition:pl.and(T1.Visible,pl.or(T1.MultipleSuggestions,T1.HasFocusedSuggestion.negate())),handler:e=>e.selectPrevSuggestion(),kbOpts:{weight:N4,kbExpr:Oh.textInputFocus,primary:16,secondary:[2064],mac:{primary:16,secondary:[2064,302]}}})),Sh(new E4({id:"selectPrevPageSuggestion",precondition:pl.and(T1.Visible,pl.or(T1.MultipleSuggestions,T1.HasFocusedSuggestion.negate())),handler:e=>e.selectPrevPageSuggestion(),kbOpts:{weight:N4,kbExpr:Oh.textInputFocus,primary:11,secondary:[2059]}})),Sh(new E4({id:"selectFirstSuggestion",precondition:pl.and(T1.Visible,pl.or(T1.MultipleSuggestions,T1.HasFocusedSuggestion.negate())),handler:e=>e.selectFirstSuggestion()})),Sh(new E4({id:"focusSuggestion",precondition:pl.and(T1.Visible,T1.HasFocusedSuggestion.negate()),handler:e=>e.focusSuggestion(),kbOpts:{weight:N4,kbExpr:Oh.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}}})),Sh(new E4({id:"focusAndAcceptSuggestion",precondition:pl.and(T1.Visible,T1.HasFocusedSuggestion.negate()),handler:e=>{e.focusSuggestion(),e.acceptSelectedSuggestion(!0,!1)}})),Sh(new E4({id:"toggleSuggestionDetails",precondition:pl.and(T1.Visible,T1.HasFocusedSuggestion),handler:e=>e.toggleSuggestionDetails(),kbOpts:{weight:N4,kbExpr:Oh.textInputFocus,primary:2058,secondary:[2087],mac:{primary:266,secondary:[2087]}},menuOpts:[{menuId:R1,group:"right",order:1,when:pl.and(T1.DetailsVisible,T1.CanResolve),title:ue(0,"show less")},{menuId:R1,group:"right",order:1,when:pl.and(T1.DetailsVisible.toNegated(),T1.CanResolve),title:ue(0,"show more")}]})),Sh(new E4({id:"toggleExplainMode",precondition:T1.Visible,handler:e=>e.toggleExplainMode(),kbOpts:{weight:100,primary:2138}})),Sh(new E4({id:"toggleSuggestionFocus",precondition:T1.Visible,handler:e=>e.toggleSuggestionFocus(),kbOpts:{weight:N4,kbExpr:Oh.textInputFocus,primary:2570,mac:{primary:778}}})),Sh(new E4({id:"insertBestCompletion",precondition:pl.and(Oh.textInputFocus,pl.equals("config.editor.tabCompletion","on"),D2.AtEnd,T1.Visible.toNegated(),I2.OtherSuggestions.toNegated(),h2.InSnippetMode.toNegated()),handler:(e,t)=>{e.triggerSuggestAndAcceptBest(Br(t)?Object.assign({fallback:"tab"},t):{fallback:"tab"})},kbOpts:{weight:N4,primary:2}})),Sh(new E4({id:"insertNextSuggestion",precondition:pl.and(Oh.textInputFocus,pl.equals("config.editor.tabCompletion","on"),I2.OtherSuggestions,T1.Visible.toNegated(),h2.InSnippetMode.toNegated()),handler:e=>e.acceptNextSuggestion(),kbOpts:{weight:N4,kbExpr:Oh.textInputFocus,primary:2}})),Sh(new E4({id:"insertPrevSuggestion",precondition:pl.and(Oh.textInputFocus,pl.equals("config.editor.tabCompletion","on"),I2.OtherSuggestions,T1.Visible.toNegated(),h2.InSnippetMode.toNegated()),handler:e=>e.acceptPrevSuggestion(),kbOpts:{weight:N4,kbExpr:Oh.textInputFocus,primary:1026}})),Lh(class extends bh{constructor(){super({id:"editor.action.resetSuggestSize",label:ue(0,"Reset Suggest Widget Size"),alias:"Reset Suggest Widget Size",precondition:void 0})}run(e,t){var i;null===(i=k4.get(t))||void 0===i||i.resetWidgetSize()}});class I4 extends E{get selectedItem(){return this._selectedItem}constructor(e,t,i,n){super(),this.editor=e,this.suggestControllerPreselector=t,this.checkModelVersion=i,this.onWillAccept=n,this.isSuggestWidgetVisible=!1,this.isShiftKeyPressed=!1,this._isActive=!1,this._currentSuggestItemInfo=void 0,this._selectedItem=Aj(this,void 0),this._register(e.onKeyDown((e=>{e.shiftKey&&!this.isShiftKeyPressed&&(this.isShiftKeyPressed=!0,this.update(this._isActive))}))),this._register(e.onKeyUp((e=>{e.shiftKey&&this.isShiftKeyPressed&&(this.isShiftKeyPressed=!1,this.update(this._isActive))})));const s=k4.get(this.editor);if(s){this._register(s.registerSelector({priority:100,select:(e,t,i)=>{var n;Ej((e=>this.checkModelVersion(e)));const o=this.editor.getModel();if(!o)return-1;const r=null===(n=this.suggestControllerPreselector())||void 0===n?void 0:n.removeCommonPrefix(o);if(!r)return-1;const a=Va.lift(t),l=bc(i.map(((e,t)=>{const i=M4.fromSuggestion(s,o,a,e,this.isShiftKeyPressed).toSingleTextEdit().removeCommonPrefix(o);return{index:t,valid:r.augments(i),prefixLength:i.text.length,suggestItem:e}})).filter((e=>e&&e.valid&&e.prefixLength>0)),Qd((e=>e.prefixLength),Jd));return l?l.index:-1}}));let e=!1;const t=()=>{e||(e=!0,this._register(s.widget.value.onDidShow((()=>{this.isSuggestWidgetVisible=!0,this.update(!0)}))),this._register(s.widget.value.onDidHide((()=>{this.isSuggestWidgetVisible=!1,this.update(!1)}))),this._register(s.widget.value.onDidFocus((()=>{this.isSuggestWidgetVisible=!0,this.update(!0)}))))};this._register(B.once(s.model.onDidTrigger)((e=>{t()}))),this._register(s.onWillInsertSuggestItem((e=>{const t=this.editor.getPosition(),i=this.editor.getModel();if(!t||!i)return;const n=M4.fromSuggestion(s,i,t,e.item,this.isShiftKeyPressed);this.onWillAccept(n)})))}this.update(this._isActive)}update(e){const t=this.getSuggestItemInfo();this._isActive===e&&function(e,t){if(e===t)return!0;if(!e||!t)return!1;return e.equals(t)}(this._currentSuggestItemInfo,t)||(this._isActive=e,this._currentSuggestItemInfo=t,Ej((e=>{this.checkModelVersion(e),this._selectedItem.set(this._isActive?this._currentSuggestItemInfo:void 0,e)})))}getSuggestItemInfo(){const e=k4.get(this.editor);if(!e||!this.isSuggestWidgetVisible)return;const t=e.widget.value.getFocusedItem(),i=this.editor.getPosition(),n=this.editor.getModel();return t&&i&&n?M4.fromSuggestion(e,n,i,t.item,this.isShiftKeyPressed):void 0}stopForceRenderingAbove(){const e=k4.get(this.editor);null==e||e.stopForceRenderingAbove()}forceRenderingAbove(){const e=k4.get(this.editor);null==e||e.forceRenderingAbove()}}class M4{static fromSuggestion(e,t,i,n,s){let{insertText:o}=n.completion,r=!1;if(4&n.completion.insertTextRules){const e=(new c1).parse(o);e.children.length<100&&s2.adjustWhitespace(t,i,!0,e),o=e.toString(),r=!0}const a=e.getOverwriteInfo(n,s);return new M4(Rh.fromPositions(i.delta(0,-a.overwriteBefore),i.delta(0,Math.max(a.overwriteAfter,0))),o,n.completion.kind,r)}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 yC(this.range,this.insertText,this.completionItemKind,this.isSnippetText)}toSingleTextEdit(){return new v1(this.range,this.insertText)}}var T4,R4=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},A4=function(e,t){return function(i,n){t(i,n,e)}};let O4=T4=class extends E{static get(e){return e.getContribution(T4.ID)}constructor(e,t,i,n,s,o,r,a,l){super(),this.editor=e,this.instantiationService=t,this.contextKeyService=i,this.configurationService=n,this.commandService=s,this.debounceService=o,this.languageFeaturesService=r,this.audioCueService=a,this._keybindingService=l,this.model=Pj("inlineCompletionModel",void 0),this.textModelVersionId=Aj(this,-1),this.cursorPosition=Aj(this,new Va(1,1)),this.suggestWidgetAdaptor=this._register(new I4(this.editor,(()=>{var e,t;return null===(t=null===(e=this.model.get())||void 0===e?void 0:e.selectedInlineCompletion.get())||void 0===t?void 0:t.toSingleTextEdit(void 0)}),(e=>this.updateObservables(e,c2.Other)),(e=>{Ej((t=>{var i;this.updateObservables(t,c2.Other),null===(i=this.model.get())||void 0===i||i.handleSuggestAccepted(e)}))}))),this._enabled=Yj(this.editor.onDidChangeConfiguration,(()=>this.editor.getOption(62).enabled)),this.ghostTextWidget=this._register(this.instantiationService.createInstance(Y0,this.editor,{ghostText:this.model.map(((e,t)=>null==e?void 0:e.ghostText.read(t))),minReservedLineCount:Gj(0),targetTextModel:this.model.map((e=>null==e?void 0:e.textModel))})),this._debounceValue=this.debounceService.for(this.languageFeaturesService.inlineCompletionsProvider,"InlineCompletionsDebounce",{min:50,max:50}),this._register(new F0(this.contextKeyService,this.model)),this._register(B.runAndSubscribe(e.onDidChangeModel,(()=>Ej((i=>{this.model.set(void 0,i),this.updateObservables(i,c2.Other);const n=e.getModel();if(n){const s=t.createInstance(m2,n,this.suggestWidgetAdaptor.selectedItem,this.cursorPosition,this.textModelVersionId,this._debounceValue,Yj(e.onDidChangeConfiguration,(()=>e.getOption(117).preview)),Yj(e.onDidChangeConfiguration,(()=>e.getOption(117).previewMode)),Yj(e.onDidChangeConfiguration,(()=>e.getOption(62).mode)),this._enabled);this.model.set(s,i)}})))));const h=e=>{var t;return e.isUndoing?c2.Undo:e.isRedoing?c2.Redo:(null===(t=this.model.get())||void 0===t?void 0:t.isAcceptingPartially)?c2.AcceptWord:c2.Other};let d;this._register(e.onDidChangeModelContent((e=>Ej((t=>this.updateObservables(t,h(e))))))),this._register(e.onDidChangeCursorPosition((e=>Ej((t=>{var i;this.updateObservables(t,c2.Other),3!==e.reason&&"api"!==e.source||null===(i=this.model.get())||void 0===i||i.stop(t)}))))),this._register(e.onDidType((()=>Ej((e=>{var t;this.updateObservables(e,c2.Other),this._enabled.get()&&(null===(t=this.model.get())||void 0===t||t.trigger(e))}))))),this._register(this.commandService.onDidExecuteCommand((t=>{new Set([By.Tab.id,By.DeleteLeft.id,By.DeleteRight.id,sq,"acceptSelectedSuggestion"]).has(t.commandId)&&e.hasTextFocus()&&this._enabled.get()&&Ej((e=>{var t;null===(t=this.model.get())||void 0===t||t.trigger(e)}))}))),this._register(this.editor.onDidBlurEditorWidget((()=>{this.contextKeyService.getContextKeyValue("accessibleViewIsShown")||this.configurationService.getValue("editor.inlineSuggest.keepOnBlur")||e.getOption(62).keepOnBlur||bq.dropDownVisible||Ej((e=>{var t;null===(t=this.model.get())||void 0===t||t.stop(e)}))}))),this._register(Kj((e=>{var t;const i=null===(t=this.model.read(e))||void 0===t?void 0:t.state.read(e);(null==i?void 0:i.suggestItem)?i.ghostText.lineCount>=2&&this.suggestWidgetAdaptor.forceRenderingAbove():this.suggestWidgetAdaptor.stopForceRenderingAbove()}))),this._register(x((()=>{this.suggestWidgetAdaptor.stopForceRenderingAbove()}))),this._register(Kj((e=>{const t=this.model.read(e),i=null==t?void 0:t.state.read(e);if(t&&i&&i.inlineCompletion){if(i.inlineCompletion.semanticId!==d){d=i.inlineCompletion.semanticId;const e=t.textModel.getLineContent(i.ghostText.lineNumber);this.audioCueService.playAudioCue(k$.inlineSuggestion).then((()=>{this.editor.getOption(8)&&this.provideScreenReaderUpdate(i.ghostText.renderForScreenReader(e))}))}}else d=void 0}))),this._register(new fq(this.editor,this.model,this.instantiationService)),this._register(this.configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration("accessibility.verbosity.inlineCompletions")&&this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this.configurationService.getValue("accessibility.verbosity.inlineCompletions")})}))),this.editor.updateOptions({inlineCompletionsAccessibilityVerbose:this.configurationService.getValue("accessibility.verbosity.inlineCompletions")})}provideScreenReaderUpdate(e){const t=this.contextKeyService.getContextKeyValue("accessibleViewIsShown"),i=this._keybindingService.lookupKeybinding("editor.action.accessibleView");let n;!t&&i&&this.editor.getOption(147)&&(n=ue(0,"Inspect this in the accessible view ({0})",i.getAriaLabel())),Ps(n?e+", "+n:e)}updateObservables(e,t){var i,n;const s=this.editor.getModel();this.textModelVersionId.set(null!==(i=null==s?void 0:s.getVersionId())&&void 0!==i?i:-1,e,t),this.cursorPosition.set(null!==(n=this.editor.getPosition())&&void 0!==n?n:new Va(1,1),e)}shouldShowHoverAt(e){var t;const i=null===(t=this.model.get())||void 0===t?void 0:t.ghostText.get();return!!i&&i.parts.some((t=>e.containsPosition(new Va(i.lineNumber,t.column))))}shouldShowHoverAtViewZone(e){return this.ghostTextWidget.ownsViewZone(e)}};O4.ID="editor.contrib.inlineCompletionsController",O4=T4=R4([A4(1,Fa),A4(2,Ol),A4(3,pu),A4(4,Ya),A4(5,SE),A4(6,oL),A4(7,y$),A4(8,WL)],O4);var P4=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class F4 extends bh{constructor(){super({id:F4.ID,label:ue(0,"Show Next Inline Suggestion"),alias:"Show Next Inline Suggestion",precondition:pl.and(Oh.writable,F0.inlineSuggestionVisible),kbOpts:{weight:100,primary:606}})}run(e,t){var i;return P4(this,void 0,void 0,(function*(){const e=O4.get(t);null===(i=null==e?void 0:e.model.get())||void 0===i||i.next()}))}}F4.ID=rq;class B4 extends bh{constructor(){super({id:B4.ID,label:ue(0,"Show Previous Inline Suggestion"),alias:"Show Previous Inline Suggestion",precondition:pl.and(Oh.writable,F0.inlineSuggestionVisible),kbOpts:{weight:100,primary:604}})}run(e,t){var i;return P4(this,void 0,void 0,(function*(){const e=O4.get(t);null===(i=null==e?void 0:e.model.get())||void 0===i||i.previous()}))}}B4.ID=oq;class W4 extends bh{constructor(){super({id:W4.ID,label:ue(0,"Hide Inline Suggestion"),alias:"Hide Inline Suggestion",precondition:F0.inlineSuggestionVisible,kbOpts:{weight:100,primary:9}})}run(e,t){return P4(this,void 0,void 0,(function*(){const e=O4.get(t);Ej((t=>{var i;null===(i=null==e?void 0:e.model.get())||void 0===i||i.stop(t)}))}))}}W4.ID="editor.action.inlineSuggest.hide";class V4 extends rh{constructor(){super({id:V4.ID,title:ue(0,"Always Show Toolbar"),f1:!1,precondition:void 0,menu:[{id:eh.InlineSuggestionToolbar,group:"secondary",order:10}],toggled:pl.equals("config.editor.inlineSuggest.showToolbar","always")})}run(e,t){return P4(this,void 0,void 0,(function*(){const t=e.get(pu),i="always"===t.getValue("editor.inlineSuggest.showToolbar")?"onHover":"always";t.updateValue("editor.inlineSuggest.showToolbar",i)}))}}V4.ID="editor.action.inlineSuggest.toggleAlwaysShowToolbar";var H4=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},z4=function(e,t){return function(i,n){t(i,n,e)}};class U4{constructor(e,t,i){this.owner=e,this.range=t,this.controller=i}isValidForHoverAnchor(e){return 1===e.type&&this.range.startColumn<=e.range.startColumn&&this.range.endColumn>=e.range.endColumn}}let K4=class{constructor(e,t,i,n,s,o){this._editor=e,this._languageService=t,this._openerService=i,this.accessibilityService=n,this._instantiationService=s,this._telemetryService=o,this.hoverOrdinal=4}suggestHoverAnchor(e){const t=O4.get(this._editor);if(!t)return null;const i=e.target;if(8===i.type){const n=i.detail;if(t.shouldShowHoverAtViewZone(n.viewZoneId))return new uK(1e3,this,Rh.fromPositions(this._editor.getModel().validatePosition(n.positionBefore||n.position)),e.event.posx,e.event.posy,!1)}if(7===i.type&&t.shouldShowHoverAt(i.range))return new uK(1e3,this,i.range,e.event.posx,e.event.posy,!1);if(6===i.type){if(i.detail.mightBeForeignElement&&t.shouldShowHoverAt(i.range))return new uK(1e3,this,i.range,e.event.posx,e.event.posy,!1)}return null}computeSync(e,t){if("always"===this._editor.getOption(62).showToolbar)return[];const i=O4.get(this._editor);return i&&i.shouldShowHoverAt(e.range)?[new U4(this,e.range,i)]:[]}renderHoverParts(e,t){const i=new N,n=t[0];this._telemetryService.publicLog2("inlineCompletionHover.shown"),this.accessibilityService.isScreenReaderOptimized()&&!this._editor.getOption(8)&&this.renderScreenReaderText(e,n,i);const s=n.controller.model.get(),o=this._instantiationService.createInstance(bq,this._editor,!1,Gj(null),s.selectedInlineCompletionIndex,s.inlineCompletionsCount,s.selectedInlineCompletion.map((e=>{var t;return null!==(t=null==e?void 0:e.inlineCompletion.source.inlineCompletions.commands)&&void 0!==t?t:[]})));return e.fragment.appendChild(o.getDomNode()),s.triggerExplicitly(),i.add(o),i}renderScreenReaderText(e,t,i){const n=fs,s=n("div.hover-row.markdown-hover"),o=ds(s,n("div.hover-contents",{"aria-live":"assertive"})),r=i.add(new Jk({editor:this._editor},this._languageService,this._openerService));i.add(Kj((n=>{var s;const a=null===(s=t.controller.model.read(n))||void 0===s?void 0:s.ghostText.read(n);if(a){const t=this._editor.getModel().getLineContent(a.lineNumber);(t=>{i.add(r.onDidRenderAsync((()=>{o.className="hover-contents code-hover-contents",e.onContentsChanged()})));const n=ue(0,"Suggestion:"),s=i.add(r.render((new Ta).appendText(n).appendCodeblock("text",t)));o.replaceChildren(s.element)})(a.renderForScreenReader(t))}else us(o)}))),e.fragment.appendChild(s)}};K4=H4([z4(1,Lc),z4(2,qk),z4(3,QR),z4(4,Fa),z4(5,lh)],K4),Dh(O4.ID,O4,3),Lh(class extends bh{constructor(){super({id:"editor.action.inlineSuggest.trigger",label:ue(0,"Trigger Inline Suggestion"),alias:"Trigger Inline Suggestion",precondition:Oh.writable})}run(e,t){var i;return P4(this,void 0,void 0,(function*(){const e=O4.get(t);null===(i=null==e?void 0:e.model.get())||void 0===i||i.triggerExplicitly()}))}}),Lh(F4),Lh(B4),Lh(class extends bh{constructor(){super({id:"editor.action.inlineSuggest.acceptNextWord",label:ue(0,"Accept Next Word Of Inline Suggestion"),alias:"Accept Next Word Of Inline Suggestion",precondition:pl.and(Oh.writable,F0.inlineSuggestionVisible),kbOpts:{weight:101,primary:2065,kbExpr:pl.and(Oh.writable,F0.inlineSuggestionVisible)},menuOpts:[{menuId:eh.InlineSuggestionToolbar,title:ue(0,"Accept Word"),group:"primary",order:2}]})}run(e,t){var i;return P4(this,void 0,void 0,(function*(){const e=O4.get(t);yield null===(i=null==e?void 0:e.model.get())||void 0===i?void 0:i.acceptNextWord(e.editor)}))}}),Lh(class extends bh{constructor(){super({id:"editor.action.inlineSuggest.acceptNextLine",label:ue(0,"Accept Next Line Of Inline Suggestion"),alias:"Accept Next Line Of Inline Suggestion",precondition:pl.and(Oh.writable,F0.inlineSuggestionVisible),kbOpts:{weight:101},menuOpts:[{menuId:eh.InlineSuggestionToolbar,title:ue(0,"Accept Line"),group:"secondary",order:2}]})}run(e,t){var i;return P4(this,void 0,void 0,(function*(){const e=O4.get(t);yield null===(i=null==e?void 0:e.model.get())||void 0===i?void 0:i.acceptNextLine(e.editor)}))}}),Lh(class extends bh{constructor(){super({id:sq,label:ue(0,"Accept Inline Suggestion"),alias:"Accept Inline Suggestion",precondition:F0.inlineSuggestionVisible,menuOpts:[{menuId:eh.InlineSuggestionToolbar,title:ue(0,"Accept"),group:"primary",order:1}],kbOpts:{primary:2,weight:200,kbExpr:pl.and(F0.inlineSuggestionVisible,Oh.tabMovesFocus.toNegated(),F0.inlineSuggestionHasIndentationLessThanTabSize,T1.Visible.toNegated(),Oh.hoverFocused.toNegated())}})}run(e,t){var i;return P4(this,void 0,void 0,(function*(){const e=O4.get(t);e&&(null===(i=e.model.get())||void 0===i||i.accept(e.editor),e.editor.focus())}))}}),Lh(W4),ah(V4),gK.register(K4);const j4=Ba("themeService");var q4,$4=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},G4=function(e,t){return function(i,n){t(i,n,e)}};let Z4=q4=class extends E{static get(e){return e.getContribution(q4.ID)}constructor(e,t,i){super(),this._editor=e,this._languageService=i,this._widget=null,this._register(this._editor.onDidChangeModel((e=>this.stop()))),this._register(this._editor.onDidChangeModelLanguage((e=>this.stop()))),this._register(EC.onDidChange((e=>this.stop()))),this._register(this._editor.onKeyUp((e=>9===e.keyCode&&this.stop())))}dispose(){this.stop(),super.dispose()}launch(){this._widget||this._editor.hasModel()&&(this._widget=new Y4(this._editor,this._languageService))}stop(){this._widget&&(this._widget.dispose(),this._widget=null)}};Z4.ID="editor.contrib.inspectTokens",Z4=q4=$4([G4(1,j4),G4(2,Lc)],Z4);class Y4 extends E{constructor(e,t){super(),this.allowEditorOverflow=!0,this._editor=e,this._languageService=t,this._model=this._editor.getModel(),this._domNode=document.createElement("div"),this._domNode.className="tokens-inspect-widget",this._tokenizationSupport=function(e,t){const i=EC.get(t);if(i)return i;const n=e.encodeLanguageId(t);return{getInitialState:()=>IC,tokenize:(e,i,n)=>MC(t,n),tokenizeEncoded:(e,t,i)=>TC(n,i)}}(this._languageService.languageIdCodec,this._model.getLanguageId()),this._compute(this._editor.getPosition()),this._register(this._editor.onDidChangeCursorPosition((e=>this._compute(this._editor.getPosition())))),this._editor.addContentWidget(this)}dispose(){this._editor.removeContentWidget(this),super.dispose()}getId(){return Y4._ID}_compute(e){const t=this._getTokensAtLine(e.lineNumber);let i=0;for(let a=t.tokens1.length-1;a>=0;a--){const n=t.tokens1[a];if(e.column-1>=n.offset){i=a;break}}let n=0;for(let a=t.tokens2.length>>>1;a>=0;a--)if(e.column-1>=t.tokens2[a<<1]){n=a;break}const s=this._model.getLineContent(e.lineNumber);let o="";if(ie.lineNumber===t.lineNumber?e.column-t.column:e.lineNumber-t.lineNumber));for(let r=t.length-2;r>=0;r--)t[r].lineNumber===t[r+1].lineNumber&&t.splice(r,1);const i=[];let n=0,s=0;const o=t.length;for(let r=1,a=e.getLineCount();r<=a;r++){const a=e.getLineContent(r),l=a.length+1;let h=0;if(s=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},e5=function(e,t){return function(i,n){t(i,n,e)}};let t5=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.getLineCount();if(this._isMovingDown&&this._selection.endLineNumber===i)return void(this._selectionId=t.trackSelection(this._selection));if(!this._isMovingDown&&1===this._selection.startLineNumber)return void(this._selectionId=t.trackSelection(this._selection));this._moveEndPositionDown=!1;let n=this._selection;n.startLineNumbere.tokenization.getLineTokens(t),getLanguageId:()=>e.getLanguageId(),getLanguageIdAtPosition:(t,i)=>e.getLanguageIdAtPosition(t,i)},getLineContent:null};if(n.startLineNumber===n.endLineNumber&&1===e.getLineMaxColumn(n.startLineNumber)){const i=n.startLineNumber,s=this._isMovingDown?i+1:i-1;1===e.getLineMaxColumn(s)?t.addEditOperation(new Rh(1,1,1,1),null):(t.addEditOperation(new Rh(i,1,i,1),e.getLineContent(s)),t.addEditOperation(new Rh(s,1,s,e.getLineMaxColumn(s)),null)),n=new Ah(s,1,s,1)}else{let i,o;if(this._isMovingDown){i=n.endLineNumber+1,o=e.getLineContent(i),t.addEditOperation(new Rh(i-1,e.getLineMaxColumn(i-1),i,e.getLineMaxColumn(i)),null);let h=o;if(this.shouldAutoIndent(e,n)){const d=this.matchEnterRule(e,a,s,i,n.startLineNumber-1);if(null!==d){const t=QJ(d+XJ(ao(e.getLineContent(i)),s),s,r);h=t+this.trimStart(o)}else{l.getLineContent=t=>t===n.startLineNumber?e.getLineContent(i):e.getLineContent(t);const t=wy(this._autoIndent,l,e.getLanguageIdAtPosition(i,1),n.startLineNumber,a,this._languageConfigurationService);if(null!==t){const n=ao(e.getLineContent(i)),a=XJ(t,s);if(a!==XJ(n,s)){const e=QJ(a,s,r);h=e+this.trimStart(o)}}}t.addEditOperation(new Rh(n.startLineNumber,1,n.startLineNumber,1),h+"\n");const c=this.matchEnterRuleMovingDown(e,a,s,n.startLineNumber,i,h);if(null!==c)0!==c&&this.getIndentEditsOfMovingBlock(e,t,n,s,r,c);else{l.getLineContent=t=>t===n.startLineNumber?h:t>=n.startLineNumber+1&&t<=n.endLineNumber+1?e.getLineContent(t-1):e.getLineContent(t);const o=wy(this._autoIndent,l,e.getLanguageIdAtPosition(i,1),n.startLineNumber+1,a,this._languageConfigurationService);if(null!==o){const i=ao(e.getLineContent(n.startLineNumber)),a=XJ(o,s),l=XJ(i,s);if(a!==l){const i=a-l;this.getIndentEditsOfMovingBlock(e,t,n,s,r,i)}}}}else t.addEditOperation(new Rh(n.startLineNumber,1,n.startLineNumber,1),h+"\n")}else if(i=n.startLineNumber-1,o=e.getLineContent(i),t.addEditOperation(new Rh(i,1,i+1,1),null),t.addEditOperation(new Rh(n.endLineNumber,e.getLineMaxColumn(n.endLineNumber),n.endLineNumber,e.getLineMaxColumn(n.endLineNumber)),"\n"+o),this.shouldAutoIndent(e,n)){l.getLineContent=t=>t===i?e.getLineContent(n.startLineNumber):e.getLineContent(t);const o=this.matchEnterRule(e,a,s,n.startLineNumber,n.startLineNumber-2);if(null!==o)0!==o&&this.getIndentEditsOfMovingBlock(e,t,n,s,r,o);else{const o=wy(this._autoIndent,l,e.getLanguageIdAtPosition(n.startLineNumber,1),i,a,this._languageConfigurationService);if(null!==o){const i=ao(e.getLineContent(n.startLineNumber)),a=XJ(o,s),l=XJ(i,s);if(a!==l){const i=a-l;this.getIndentEditsOfMovingBlock(e,t,n,s,r,i)}}}}}this._selectionId=t.trackSelection(n)}buildIndentConverter(e,t,i){return{shiftIndent:n=>_y.shiftIndent(n,n.length+1,e,t,i),unshiftIndent:n=>_y.unshiftIndent(n,n.length+1,e,t,i)}}parseEnterResult(e,t,i,n,s){if(s){let o=s.indentation;s.indentAction===Mc.None||s.indentAction===Mc.Indent?o=s.indentation+s.appendText:s.indentAction===Mc.IndentOutdent?o=s.indentation:s.indentAction===Mc.Outdent&&(o=t.unshiftIndent(s.indentation)+s.appendText);const r=e.getLineContent(n);if(this.trimStart(r).indexOf(this.trimStart(o))>=0){const s=ao(e.getLineContent(n));let r=ao(o);const a=yy(e,n,this._languageConfigurationService);null!==a&&2&a&&(r=t.unshiftIndent(r));return XJ(r,i)-XJ(s,i)}}return null}matchEnterRuleMovingDown(e,t,i,n,s,o){if(lo(o)>=0){const o=e.getLineMaxColumn(s),r=cy(this._autoIndent,e,new Rh(s,o,s,o),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,r)}{let s=n-1;for(;s>=1;){if(lo(e.getLineContent(s))>=0)break;s--}if(s<1||n>e.getLineCount())return null;const o=e.getLineMaxColumn(s),r=cy(this._autoIndent,e,new Rh(s,o,s,o),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,r)}}matchEnterRule(e,t,i,n,s,o){let r=s;for(;r>=1;){let t;t=r===s&&void 0!==o?o:e.getLineContent(r);if(lo(t)>=0)break;r--}if(r<1||n>e.getLineCount())return null;const a=e.getLineMaxColumn(r),l=cy(this._autoIndent,e,new Rh(r,a,r,a),this._languageConfigurationService);return this.parseEnterResult(e,t,i,n,l)}trimStart(e){return e.replace(/^\s+/,"")}shouldAutoIndent(e,t){if(this._autoIndent<4)return!1;if(!e.tokenization.isCheapToTokenize(t.startLineNumber))return!1;const i=e.getLanguageIdAtPosition(t.startLineNumber,1);return i===e.getLanguageIdAtPosition(t.endLineNumber,1)&&null!==this._languageConfigurationService.getLanguageConfiguration(i).indentRulesSupport}getIndentEditsOfMovingBlock(e,t,i,n,s,o){for(let r=i.startLineNumber;r<=i.endLineNumber;r++){const a=ao(e.getLineContent(r)),l=QJ(XJ(a,n)+o,n,s);l!==a&&(t.addEditOperation(new Rh(r,1,r,a.length+1),l),r===i.endLineNumber&&i.endColumn<=a.length+1&&""===l&&(this._moveEndLineSelectionShrink=!0))}}computeCursorState(e,t){let i=t.getTrackedSelection(this._selectionId);return this._moveEndPositionDown&&(i=i.setEndPosition(i.endLineNumber+1,1)),this._moveEndLineSelectionShrink&&i.startLineNumber=s)return null;const o=[];for(let a=n;a<=s;a++)o.push(e.getLineContent(a));let r=o.slice(0);return r.sort(i5.getCollator().compare),!0===i&&(r=r.reverse()),{startLineNumber:n,endLineNumber:s,before:o,after:r}}i5._COLLATOR=null;class s5 extends bh{constructor(e,t){super(t),this.down=e}run(e,t){if(!t.hasModel())return;const i=t.getSelections().map(((e,t)=>({selection:e,index:t,ignore:!1})));i.sort(((e,t)=>Rh.compareRangesUsingStarts(e.selection,t.selection)));let n=i[0];for(let o=1;onew Va(e.positionLineNumber,e.positionColumn))));const s=t.getSelection();if(null===s)return;const o=new X4(s,n);t.pushUndoStop(),t.executeCommands(this.id,[o]),t.pushUndoStop()}}a5.ID="editor.action.trimTrailingWhitespace";class l5 extends bh{run(e,t){if(!t.hasModel())return;const i=t.getSelection(),n=this._getRangesToDelete(t),s=[];for(let a=0,l=n.length-1;aFq.replace(e,"")));t.pushUndoStop(),t.executeEdits(this.id,r,o),t.pushUndoStop()}}class h5 extends bh{run(e,t){const i=t.getSelections();if(null===i)return;const n=t.getModel();if(null===n)return;const s=t.getOption(129),o=[];for(const r of i)if(r.isEmpty()){const e=r.getStartPosition(),i=t.getConfiguredWordAtPosition(e);if(!i)continue;const a=new Rh(e.lineNumber,i.startColumn,e.lineNumber,i.endColumn),l=n.getValueInRange(a);o.push(Fq.replace(a,this._modifyText(l,s)))}else{const e=n.getValueInRange(r);o.push(Fq.replace(r,this._modifyText(e,s)))}t.pushUndoStop(),t.executeEdits(this.id,o),t.pushUndoStop()}}class d5{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(e){}}return this._actual}isSupported(){return null!==this.get()}}class c5 extends h5{constructor(){super({id:"editor.action.transformToTitlecase",label:ue(0,"Transform to Title Case"),alias:"Transform to Title Case",precondition:Oh.writable})}_modifyText(e,t){const i=c5.titleBoundary.get();return i?e.toLocaleLowerCase().replace(i,(e=>e.toLocaleUpperCase())):e}}c5.titleBoundary=new d5("(^|[^\\p{L}\\p{N}']|((^|\\P{L})'))\\p{L}","gmu");class u5 extends h5{constructor(){super({id:"editor.action.transformToSnakecase",label:ue(0,"Transform to Snake Case"),alias:"Transform to Snake Case",precondition:Oh.writable})}_modifyText(e,t){const i=u5.caseBoundary.get(),n=u5.singleLetters.get();return i&&n?e.replace(i,"$1_$2").replace(n,"$1_$2$3").toLocaleLowerCase():e}}u5.caseBoundary=new d5("(\\p{Ll})(\\p{Lu})","gmu"),u5.singleLetters=new d5("(\\p{Lu}|\\p{N})(\\p{Lu})(\\p{Ll})","gmu");class g5 extends h5{constructor(){super({id:"editor.action.transformToCamelcase",label:ue(0,"Transform to Camel Case"),alias:"Transform to Camel Case",precondition:Oh.writable})}_modifyText(e,t){const i=g5.wordBoundary.get();if(!i)return e;const n=e.split(i);return n.shift()+n.map((e=>e.substring(0,1).toLocaleUpperCase()+e.substring(1))).join("")}}g5.wordBoundary=new d5("[_\\s-]","gm");class p5 extends h5{static isSupported(){return[this.caseBoundary,this.singleLetters,this.underscoreBoundary].every((e=>e.isSupported()))}constructor(){super({id:"editor.action.transformToKebabcase",label:ue(0,"Transform to Kebab Case"),alias:"Transform to Kebab Case",precondition:Oh.writable})}_modifyText(e,t){const i=p5.caseBoundary.get(),n=p5.singleLetters.get(),s=p5.underscoreBoundary.get();return i&&n&&s?e.replace(s,"$1-$3").replace(i,"$1-$2").replace(n,"$1-$2").toLocaleLowerCase():e}}p5.caseBoundary=new d5("(\\p{Ll})(\\p{Lu})","gmu"),p5.singleLetters=new d5("(\\p{Lu}|\\p{N})(\\p{Lu}\\p{Ll})","gmu"),p5.underscoreBoundary=new d5("(\\S)(_)(\\S)","gm"),Lh(class extends s5{constructor(){super(!1,{id:"editor.action.copyLinesUpAction",label:ue(0,"Copy Line Up"),alias:"Copy Line Up",precondition:Oh.writable,kbOpts:{kbExpr:Oh.editorTextFocus,primary:1552,linux:{primary:3600},weight:100},menuOpts:{menuId:eh.MenubarSelectionMenu,group:"2_line",title:ue(0,"&&Copy Line Up"),order:1}})}}),Lh(class extends s5{constructor(){super(!0,{id:"editor.action.copyLinesDownAction",label:ue(0,"Copy Line Down"),alias:"Copy Line Down",precondition:Oh.writable,kbOpts:{kbExpr:Oh.editorTextFocus,primary:1554,linux:{primary:3602},weight:100},menuOpts:{menuId:eh.MenubarSelectionMenu,group:"2_line",title:ue(0,"Co&&py Line Down"),order:2}})}}),Lh(class extends bh{constructor(){super({id:"editor.action.duplicateSelection",label:ue(0,"Duplicate Selection"),alias:"Duplicate Selection",precondition:Oh.writable,menuOpts:{menuId:eh.MenubarSelectionMenu,group:"2_line",title:ue(0,"&&Duplicate Selection"),order:5}})}run(e,t,i){if(!t.hasModel())return;const n=[],s=t.getSelections(),o=t.getModel();for(const r of s)if(r.isEmpty())n.push(new Q4(r,!0));else{const e=new Ah(r.endLineNumber,r.endColumn,r.endLineNumber,r.endColumn);n.push(new Qw(e,o.getValueInRange(r)))}t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop()}}),Lh(class extends o5{constructor(){super(!1,{id:"editor.action.moveLinesUpAction",label:ue(0,"Move Line Up"),alias:"Move Line Up",precondition:Oh.writable,kbOpts:{kbExpr:Oh.editorTextFocus,primary:528,linux:{primary:528},weight:100},menuOpts:{menuId:eh.MenubarSelectionMenu,group:"2_line",title:ue(0,"Mo&&ve Line Up"),order:3}})}}),Lh(class extends o5{constructor(){super(!0,{id:"editor.action.moveLinesDownAction",label:ue(0,"Move Line Down"),alias:"Move Line Down",precondition:Oh.writable,kbOpts:{kbExpr:Oh.editorTextFocus,primary:530,linux:{primary:530},weight:100},menuOpts:{menuId:eh.MenubarSelectionMenu,group:"2_line",title:ue(0,"Move &&Line Down"),order:4}})}}),Lh(class extends r5{constructor(){super(!1,{id:"editor.action.sortLinesAscending",label:ue(0,"Sort Lines Ascending"),alias:"Sort Lines Ascending",precondition:Oh.writable})}}),Lh(class extends r5{constructor(){super(!0,{id:"editor.action.sortLinesDescending",label:ue(0,"Sort Lines Descending"),alias:"Sort Lines Descending",precondition:Oh.writable})}}),Lh(class extends bh{constructor(){super({id:"editor.action.removeDuplicateLines",label:ue(0,"Delete Duplicate Lines"),alias:"Delete Duplicate Lines",precondition:Oh.writable})}run(e,t){if(!t.hasModel())return;const i=t.getModel();if(1===i.getLineCount()&&1===i.getLineMaxColumn(1))return;const n=[],s=[];let o=0;for(const r of t.getSelections()){const e=new Set,t=[];for(let n=r.startLineNumber;n<=r.endLineNumber;n++){const s=i.getLineContent(n);e.has(s)||(t.push(s),e.add(s))}const a=new Ah(r.startLineNumber,1,r.endLineNumber,i.getLineMaxColumn(r.endLineNumber)),l=r.startLineNumber-o,h=new Ah(l,1,l+t.length-1,t[t.length-1].length);n.push(Fq.replace(a,t.join("\n"))),s.push(h),o+=r.endLineNumber-r.startLineNumber+1-t.length}t.pushUndoStop(),t.executeEdits(this.id,n,s),t.pushUndoStop()}}),Lh(a5),Lh(class extends bh{constructor(){super({id:"editor.action.deleteLines",label:ue(0,"Delete Line"),alias:"Delete Line",precondition:Oh.writable,kbOpts:{kbExpr:Oh.textInputFocus,primary:3113,weight:100}})}run(e,t){if(!t.hasModel())return;const i=this._getLinesToRemove(t),n=t.getModel();if(1===n.getLineCount()&&1===n.getLineMaxColumn(1))return;let s=0;const o=[],r=[];for(let a=0,l=i.length;a1&&(t-=1,h=n.getLineMaxColumn(t)),o.push(Fq.replace(new Ah(t,h,l,d),"")),r.push(new Ah(t-s,e.positionColumn,t-s,e.positionColumn)),s+=e.endLineNumber-e.startLineNumber+1}t.pushUndoStop(),t.executeEdits(this.id,o,r),t.pushUndoStop()}_getLinesToRemove(e){const t=e.getSelections().map((e=>{let t=e.endLineNumber;return e.startLineNumbere.startLineNumber===t.startLineNumber?e.endLineNumber-t.endLineNumber:e.startLineNumber-t.startLineNumber));const i=[];let n=t[0];for(let s=1;s=t[s].startLineNumber?n.endLineNumber=t[s].endLineNumber:(i.push(n),n=t[s]);return i.push(n),i}}),Lh(class extends bh{constructor(){super({id:"editor.action.indentLines",label:ue(0,"Indent Line"),alias:"Indent Line",precondition:Oh.writable,kbOpts:{kbExpr:Oh.editorTextFocus,primary:2142,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Sy.indent(i.cursorConfig,t.getModel(),t.getSelections())),t.pushUndoStop())}}),Lh(class extends bh{constructor(){super({id:"editor.action.outdentLines",label:ue(0,"Outdent Line"),alias:"Outdent Line",precondition:Oh.writable,kbOpts:{kbExpr:Oh.editorTextFocus,primary:2140,weight:100}})}run(e,t){By.Outdent.runEditorCommand(e,t,null)}}),Lh(class extends bh{constructor(){super({id:"editor.action.insertLineBefore",label:ue(0,"Insert Line Above"),alias:"Insert Line Above",precondition:Oh.writable,kbOpts:{kbExpr:Oh.editorTextFocus,primary:3075,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Sy.lineInsertBefore(i.cursorConfig,t.getModel(),t.getSelections())))}}),Lh(class extends bh{constructor(){super({id:"editor.action.insertLineAfter",label:ue(0,"Insert Line Below"),alias:"Insert Line Below",precondition:Oh.writable,kbOpts:{kbExpr:Oh.editorTextFocus,primary:2051,weight:100}})}run(e,t){const i=t._getViewModel();i&&(t.pushUndoStop(),t.executeCommands(this.id,Sy.lineInsertAfter(i.cursorConfig,t.getModel(),t.getSelections())))}}),Lh(class extends l5{constructor(){super({id:"deleteAllLeft",label:ue(0,"Delete All Left"),alias:"Delete All Left",precondition:Oh.writable,kbOpts:{kbExpr:Oh.textInputFocus,primary:0,mac:{primary:2049},weight:100}})}_getEndCursorState(e,t){let i=null;const n=[];let s=0;return t.forEach((t=>{let o;if(1===t.endColumn&&s>0){const e=t.startLineNumber-s;o=new Ah(e,t.startColumn,e,t.startColumn)}else o=new Ah(t.startLineNumber,t.startColumn,t.startLineNumber,t.startColumn);s+=t.endLineNumber-t.startLineNumber,t.intersectRanges(e)?i=o:n.push(o)})),i&&n.unshift(i),n}_getRangesToDelete(e){const t=e.getSelections();if(null===t)return[];let i=t;const n=e.getModel();return null===n?[]:(i.sort(Rh.compareRangesUsingStarts),i=i.map((e=>{if(e.isEmpty()){if(1===e.startColumn){const t=Math.max(1,e.startLineNumber-1),i=1===e.startLineNumber?1:n.getLineLength(t)+1;return new Rh(t,i,e.startLineNumber,1)}return new Rh(e.startLineNumber,1,e.startLineNumber,e.startColumn)}return new Rh(e.startLineNumber,1,e.endLineNumber,e.endColumn)})),i)}}),Lh(class extends l5{constructor(){super({id:"deleteAllRight",label:ue(0,"Delete All Right"),alias:"Delete All Right",precondition:Oh.writable,kbOpts:{kbExpr:Oh.textInputFocus,primary:0,mac:{primary:297,secondary:[2068]},weight:100}})}_getEndCursorState(e,t){let i=null;const n=[];for(let s=0,o=t.length,r=0;s{if(e.isEmpty()){const i=t.getLineMaxColumn(e.startLineNumber);return e.startColumn===i?new Rh(e.startLineNumber,e.startColumn,e.startLineNumber+1,1):new Rh(e.startLineNumber,e.startColumn,e.startLineNumber,i)}return e}));return n.sort(Rh.compareRangesUsingStarts),n}}),Lh(class extends bh{constructor(){super({id:"editor.action.joinLines",label:ue(0,"Join Lines"),alias:"Join Lines",precondition:Oh.writable,kbOpts:{kbExpr:Oh.editorTextFocus,primary:0,mac:{primary:296},weight:100}})}run(e,t){const i=t.getSelections();if(null===i)return;let n=t.getSelection();if(null===n)return;i.sort(Rh.compareRangesUsingStarts);const s=[],o=i.reduce(((e,t)=>e.isEmpty()?e.endLineNumber===t.startLineNumber?(n.equalsSelection(e)&&(n=t),t):t.startLineNumber>e.endLineNumber+1?(s.push(e),t):new Ah(e.startLineNumber,e.startColumn,t.endLineNumber,t.endColumn):t.startLineNumber>e.endLineNumber?(s.push(e),t):new Ah(e.startLineNumber,e.startColumn,t.endLineNumber,t.endColumn)));s.push(o);const r=t.getModel();if(null===r)return;const a=[],l=[];let h=n,d=0;for(let c=0,u=s.length;c=1){let i=!0;""===m&&(i=!1),!i||" "!==m.charAt(m.length-1)&&"\t"!==m.charAt(m.length-1)||(i=!1,m=m.replace(/[\s\uFEFF\xA0]+$/g," "));const n=e.substr(t-1);m+=(i?" ":"")+n,g=i?n.length+1:n.length}else g=0}const f=new Rh(t,i,o,u);if(!f.isEmpty()){let i;e.isEmpty()?(a.push(Fq.replace(f,m)),i=new Ah(f.startLineNumber-d,m.length-g+1,t-d,m.length-g+1)):e.startLineNumber===e.endLineNumber?(a.push(Fq.replace(f,m)),i=new Ah(e.startLineNumber-d,e.startColumn,e.endLineNumber-d,e.endColumn)):(a.push(Fq.replace(f,m)),i=new Ah(e.startLineNumber-d,e.startColumn,e.startLineNumber-d,m.length-p)),null!==Rh.intersectRanges(f,n)?h=i:l.push(i)}d+=f.endLineNumber-f.startLineNumber}l.unshift(h),t.pushUndoStop(),t.executeEdits(this.id,a,l),t.pushUndoStop()}}),Lh(class extends bh{constructor(){super({id:"editor.action.transpose",label:ue(0,"Transpose Characters around the Cursor"),alias:"Transpose Characters around the Cursor",precondition:Oh.writable})}run(e,t){const i=t.getSelections();if(null===i)return;const n=t.getModel();if(null===n)return;const s=[];for(let o=0,r=i.length;o=r){if(t.lineNumber===n.getLineCount())continue;const e=new Rh(t.lineNumber,Math.max(1,t.column-1),t.lineNumber+1,1),i=n.getValueInRange(e).split("").reverse().join("");s.push(new Xw(new Ah(t.lineNumber,Math.max(1,t.column-1),t.lineNumber+1,1),i))}else{const e=new Rh(t.lineNumber,Math.max(1,t.column-1),t.lineNumber,t.column+1),i=n.getValueInRange(e).split("").reverse().join("");s.push(new ty(e,i,new Ah(t.lineNumber,t.column+1,t.lineNumber,t.column+1)))}}t.pushUndoStop(),t.executeCommands(this.id,s),t.pushUndoStop()}}),Lh(class extends h5{constructor(){super({id:"editor.action.transformToUppercase",label:ue(0,"Transform to Uppercase"),alias:"Transform to Uppercase",precondition:Oh.writable})}_modifyText(e,t){return e.toLocaleUpperCase()}}),Lh(class extends h5{constructor(){super({id:"editor.action.transformToLowercase",label:ue(0,"Transform to Lowercase"),alias:"Transform to Lowercase",precondition:Oh.writable})}_modifyText(e,t){return e.toLocaleLowerCase()}}),u5.caseBoundary.isSupported()&&u5.singleLetters.isSupported()&&Lh(u5),g5.wordBoundary.isSupported()&&Lh(g5),c5.titleBoundary.isSupported()&&Lh(c5),p5.isSupported()&&Lh(p5);var m5,f5=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},_5=function(e,t){return function(i,n){t(i,n,e)}},v5=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const b5=new Al("LinkedEditingInputVisible",!1);let C5=m5=class extends E{static get(e){return e.getContribution(m5.ID)}constructor(e,t,i,n,s){super(),this.languageConfigurationService=n,this._syncRangesToken=0,this._localToDispose=this._register(new N),this._editor=e,this._providers=i.linkedEditingRangeProvider,this._enabled=!1,this._visibleContextKey=b5.bindTo(t),this._debounceInformation=s.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 N),this._rangeUpdateTriggerPromise=null,this._rangeSyncTriggerPromise=null,this._currentRequest=null,this._currentRequestPosition=null,this._currentRequestModelVersion=null,this._register(this._editor.onDidChangeModel((()=>this.reinitialize(!0)))),this._register(this._editor.onDidChangeConfiguration((e=>{(e.hasChanged(69)||e.hasChanged(92))&&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=null!==t&&(this._editor.getOption(69)||this._editor.getOption(92))&&this._providers.has(t);if(i===this._enabled&&!e)return;if(this._enabled=i,this.clearRanges(),this._localToDispose.clear(),!i||null===t)return;this._localToDispose.add(B.runAndSubscribe(t.onDidChangeLanguageConfiguration,(()=>{this._languageWordPattern=this.languageConfigurationService.getLanguageConfiguration(t.getLanguageId()).getWordDefinition()})));const n=new Jh(this._debounceInformation.get(t)),s=()=>{var e;this._rangeUpdateTriggerPromise=n.trigger((()=>this.updateRanges()),null!==(e=this._debounceDuration)&&void 0!==e?e:this._debounceInformation.get(t))},o=new Jh(0),r=e=>{this._rangeSyncTriggerPromise=o.trigger((()=>this._syncRanges(e)))};this._localToDispose.add(this._editor.onDidChangeCursorPosition((()=>{s()}))),this._localToDispose.add(this._editor.onDidChangeModelContent((e=>{if(!this._ignoreChangeEvent&&this._currentDecorations.length>0){const t=this._currentDecorations.getRange(0);if(t&&e.changes.every((e=>t.intersectRanges(e.range))))return void r(this._syncRangesToken)}s()}))),this._localToDispose.add({dispose:()=>{n.dispose(),o.dispose()}}),this.updateRanges()}_syncRanges(e){if(!this._editor.hasModel()||e!==this._syncRangesToken||0===this._currentDecorations.length)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 e=n.match(this._currentWordPattern);if((e?e[0].length:0)!==n.length)return this.clearRanges()}const s=[];for(let o=1,r=this._currentDecorations.length;o1)return void this.clearRanges();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 e=this._currentDecorations.getRange(0);if(e&&e.containsPosition(t))return}}this.clearRanges(),this._currentRequestPosition=t,this._currentRequestModelVersion=n;const s=Yh((e=>v5(this,void 0,void 0,(function*(){try{const o=new F(!1),r=yield w5(this._providers,i,t,e);if(this._debounceInformation.update(i,o.elapsed()),s!==this._currentRequest)return;if(this._currentRequest=null,n!==i.getVersionId())return;let a=[];(null==r?void 0:r.ranges)&&(a=r.ranges),this._currentWordPattern=(null==r?void 0:r.wordPattern)||this._languageWordPattern;let l=!1;for(let e=0,i=a.length;e({range:e,options:m5.DECORATION})));this._visibleContextKey.set(!0),this._currentDecorations.set(h),this._syncRangesToken++}catch(o){d(o)||r(o),this._currentRequest!==s&&this._currentRequest||this.clearRanges()}}))));return this._currentRequest=s,s}))}};C5.ID="editor.contrib.linkedEditing",C5.DECORATION=Iw.register({description:"linked-editing",stickiness:0,className:"linked-editing-decoration"}),C5=m5=f5([_5(1,Ol),_5(2,oL),_5(3,Ju),_5(4,SE)],C5);function w5(e,t,i,n){return nd(e.ordered(t).map((e=>()=>v5(this,void 0,void 0,(function*(){try{return yield e.provideLinkedEditingRanges(t,i,n)}catch(Mre){return void a(Mre)}})))),(e=>!!e&&Hd(null==e?void 0:e.ranges)))}Sh(new(vh.bindToContribution(C5.get))({id:"cancelLinkedEditingInput",precondition:b5,handler:e=>e.clearRanges(),kbOpts:{kbExpr:Oh.editorTextFocus,weight:199,primary:9,secondary:[1033]}}));Dp("editor.linkedEditingBackground",{dark:lc.fromHex("#f00").transparent(.3),light:lc.fromHex("#f00").transparent(.3),hcDark:lc.fromHex("#f00").transparent(.3),hcLight:lc.white},ue(0,"Background color when the editor auto renames on type."));yh("_executeLinkedEditingProvider",((e,t,i)=>{const{linkedEditingRangeProvider:n}=e.get(oL);return w5(n,t,i,Uh.None)})),Dh(C5.ID,C5,1),Lh(class extends bh{constructor(){super({id:"editor.action.linkedEditing",label:ue(0,"Start Linked Editing"),alias:"Start Linked Editing",precondition:pl.and(Oh.writable,Oh.hasRenameProvider),kbOpts:{kbExpr:Oh.editorTextFocus,primary:3132,weight:100}})}runCommand(e,t){const i=e.get(Wa),[n,s]=Array.isArray(t)&&t||[void 0,void 0];return an.isUri(n)&&Va.isIPosition(s)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then((e=>{e&&(e.setPosition(s),e.invokeWithinContext((t=>(this.reportTelemetry(t,e),this.run(t,e)))))}),r):super.runCommand(e,t)}run(e,t){const i=C5.get(t);return i?Promise.resolve(i.updateRanges(!0)):Promise.resolve()}});var y5=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class S5{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}resolve(e){return y5(this,void 0,void 0,(function*(){return this._link.url?this._link.url:"function"==typeof this._provider.resolveLink?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 L5{constructor(e){this._disposables=new N;let t=[];for(const[i,n]of e){const e=i.links.map((e=>new S5(e,n)));t=L5._union(t,e),L(i)&&this._disposables.add(i)}this.links=t}dispose(){this._disposables.dispose(),this.links.length=0}static _union(e,t){const i=[];let n,s,o,r;for(n=0,o=0,s=e.length,r=t.length;nPromise.resolve(e.provideLinks(t,i)).then((t=>{t&&(n[s]=[t,e])}),a)));return Promise.all(s).then((()=>{const e=new L5(Bd(n));return i.isCancellationRequested?(e.dispose(),new L5([])):e}))}Xa.registerCommand("_executeLinkProvider",((e,...t)=>y5(void 0,void 0,void 0,(function*(){let[i,n]=t;qr(i instanceof an),"number"!=typeof n&&(n=0);const{linkProvider:s}=e.get(oL),o=e.get(Ha).getModel(i);if(!o)return[];const r=yield k5(s,o,Uh.None);if(!r)return[];for(let e=0;e=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},N5=function(e,t){return function(i,n){t(i,n,e)}},E5=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let I5=D5=class extends E{static get(e){return e.getContribution(D5.ID)}constructor(e,t,i,n,s){super(),this.editor=e,this.openerService=t,this.notificationService=i,this.languageFeaturesService=n,this.providers=this.languageFeaturesService.linkProvider,this.debounceInformation=s.for(this.providers,"Links",{min:1e3,max:4e3}),this.computeLinks=this._register(new rd((()=>this.computeLinksNow()),1e3)),this.computePromise=null,this.activeLinksList=null,this.currentOccurrences={},this.activeLinkDecorationId=null;const o=this._register(new RR(e));this._register(o.onMouseMoveOrRelevantKeyDown((([e,t])=>{this._onEditorMouseMove(e,t)}))),this._register(o.onExecute((e=>{this.onEditorMouseUp(e)}))),this._register(o.onCancel((e=>{this.cleanUpActiveLinkDecoration()}))),this._register(e.onDidChangeConfiguration((e=>{e.hasChanged(70)&&(this.updateDecorations([]),this.stop(),this.computeLinks.schedule(0))}))),this._register(e.onDidChangeModelContent((e=>{this.editor.hasModel()&&this.computeLinks.schedule(this.debounceInformation.get(this.editor.getModel()))}))),this._register(e.onDidChangeModel((e=>{this.currentOccurrences={},this.activeLinkDecorationId=null,this.stop(),this.computeLinks.schedule(0)}))),this._register(e.onDidChangeModelLanguage((e=>{this.stop(),this.computeLinks.schedule(0)}))),this._register(this.providers.onDidChange((e=>{this.stop(),this.computeLinks.schedule(0)}))),this.computeLinks.schedule(0)}computeLinksNow(){return E5(this,void 0,void 0,(function*(){if(!this.editor.hasModel()||!this.editor.getOption(70))return;const e=this.editor.getModel();if(!e.isTooLargeForSyncing()&&this.providers.has(e)){this.activeLinksList&&(this.activeLinksList.dispose(),this.activeLinksList=null),this.computePromise=Yh((t=>k5(this.providers,e,t)));try{const t=new F(!1);if(this.activeLinksList=yield this.computePromise,this.debounceInformation.update(e,t.elapsed()),e.isDisposed())return;this.updateDecorations(this.activeLinksList.links)}catch(t){r(t)}finally{this.computePromise=null}}}))}updateDecorations(e){const t="altKey"===this.editor.getOption(77),i=[],n=Object.keys(this.currentOccurrences);for(const o of n){const e=this.currentOccurrences[o];i.push(e.decorationId)}const s=[];if(e)for(const o of e)s.push(T5.decoration(o,t));this.editor.changeDecorations((t=>{const n=t.deltaDecorations(i,s);this.currentOccurrences={},this.activeLinkDecorationId=null;for(let i=0,s=n.length;i{t.activate(e,i),this.activeLinkDecorationId=t.decorationId}))}else this.cleanUpActiveLinkDecoration()}cleanUpActiveLinkDecoration(){const e="altKey"===this.editor.getOption(77);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(Uh.None).then((e=>{if("string"==typeof e&&this.editor.hasModel()){const t=this.editor.getModel().uri;if(t.scheme===vn.file&&e.startsWith(`${vn.file}:`)){const i=an.parse(e);if(i.scheme===vn.file){const n=fa(i);let s=null;n.startsWith("/./")?s=`.${n.substr(1)}`:n.startsWith("//./")&&(s=`.${n.substr(2)}`),s&&(e=La(t,s))}}}return this.openerService.open(e,{openToSide:t,fromUserGesture:i,allowContributedOpeners:!0,allowCommands:!0,fromWorkspace:!0})}),(e=>{const t=e instanceof Error?e.message:e;"invalid"===t?this.notificationService.warn(ue(0,"Failed to open this link because it is not well-formed: {0}",n.url.toString())):"missing"===t?this.notificationService.warn(ue(0,"Failed to open this link because its target is missing.")):r(e)}))}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 e=this.currentOccurrences[i.id];if(e)return e}return null}isEnabled(e,t){return Boolean(6===e.target.type&&(e.hasTriggerModifier||t&&t.keyCodeIsTriggerKey))}stop(){var e;this.computeLinks.cancel(),this.activeLinksList&&(null===(e=this.activeLinksList)||void 0===e||e.dispose(),this.activeLinksList=null),this.computePromise&&(this.computePromise.cancel(),this.computePromise=null)}dispose(){super.dispose(),this.stop()}};I5.ID="editor.linkDetector",I5=D5=x5([N5(1,qk),N5(2,mL),N5(3,oL),N5(4,SE)],I5);const M5={general:Iw.register({description:"detected-link",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link"}),active:Iw.register({description:"detected-link-active",stickiness:1,collapseOnReplaceEdit:!0,inlineClassName:"detected-link-active"})};class T5{static decoration(e,t){return{range:e.range,options:T5._getOptions(e,t,!1)}}static _getOptions(e,t,i){const n=Object.assign({},i?M5.active:M5.general);return n.hoverMessage=function(e,t){const i=e.url&&/^command:/i.test(e.url.toString()),n=e.tooltip?e.tooltip:ue(0,i?"Execute command":"Follow link"),s=ue(0,t?Pe?"cmd + click":"ctrl + click":Pe?"option + click":"alt + click");if(e.url){let t="";if(/^command:/i.test(e.url.toString())){const i=e.url.toString().match(/^command:([^?#]+)/);if(i){t=ue(0,"Execute command {0}",i[1])}}return new Ta("",!0).appendLink(e.url.toString(!0).replace(/ /g,"%20"),n,t).appendMarkdown(` (${s})`)}return(new Ta).appendText(`${n} (${s})`)}(e,t),n}constructor(e,t){this.link=e,this.decorationId=t}activate(e,t){e.changeDecorationOptions(this.decorationId,T5._getOptions(this.link,t,!0))}deactivate(e,t){e.changeDecorationOptions(this.decorationId,T5._getOptions(this.link,t,!1))}}Dh(I5.ID,I5,1),Lh(class extends bh{constructor(){super({id:"editor.action.openLink",label:ue(0,"Open Link"),alias:"Open Link",precondition:void 0})}run(e,t){const i=I5.get(t);if(!i)return;if(!t.hasModel())return;const n=t.getSelections();for(const s of n){const e=i.getLinkOccurrence(s.getEndPosition());e&&i.openLinkOccurrence(e,!1)}}});class R5 extends E{constructor(e){super(),this._editor=e,this._register(this._editor.onMouseDown((e=>{const t=this._editor.getOption(116);t>=0&&6===e.target.type&&e.target.position.column>=t&&this._editor.updateOptions({stopRenderingLineAfter:-1})})))}}R5.ID="editor.contrib.longLinesHelper",Dh(R5.ID,R5,2);const A5=Dp("editor.wordHighlightBackground",{dark:"#575757B8",light:"#57575740",hcDark:null,hcLight:null},ue(0,"Background color of a symbol during read-access, like reading a variable. The color must not be opaque so as not to hide underlying decorations."),!0);Dp("editor.wordHighlightStrongBackground",{dark:"#004972B8",light:"#0e639c40",hcDark:null,hcLight:null},ue(0,"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),Dp("editor.wordHighlightTextBackground",{light:A5,dark:A5,hcDark:A5,hcLight:A5},ue(0,"Background color of a textual occurrence for a symbol. The color must not be opaque so as not to hide underlying decorations."),!0);const O5=Dp("editor.wordHighlightBorder",{light:null,dark:null,hcDark:Tp,hcLight:Tp},ue(0,"Border color of a symbol during read-access, like reading a variable."));Dp("editor.wordHighlightStrongBorder",{light:null,dark:null,hcDark:Tp,hcLight:Tp},ue(0,"Border color of a symbol during write-access, like writing to a variable.")),Dp("editor.wordHighlightTextBorder",{light:O5,dark:O5,hcDark:O5,hcLight:O5},ue(0,"Border color of a textual occurrence for a symbol."));const P5=Dp("editorOverviewRuler.wordHighlightForeground",{dark:"#A0A0A0CC",light:"#A0A0A0CC",hcDark:"#A0A0A0CC",hcLight:"#A0A0A0CC"},ue(0,"Overview ruler marker color for symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),F5=Dp("editorOverviewRuler.wordHighlightStrongForeground",{dark:"#C0A0C0CC",light:"#C0A0C0CC",hcDark:"#C0A0C0CC",hcLight:"#C0A0C0CC"},ue(0,"Overview ruler marker color for write-access symbol highlights. The color must not be opaque so as not to hide underlying decorations."),!0),B5=Dp("editorOverviewRuler.wordHighlightTextForeground",{dark:u_,light:u_,hcDark:u_,hcLight:u_},ue(0,"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),W5=Iw.register({description:"word-highlight-strong",stickiness:1,className:"wordHighlightStrong",overviewRuler:{color:F_(F5),position:Cd.Center},minimap:{color:F_(p_),position:yd.Inline}}),V5=Iw.register({description:"word-highlight-text",stickiness:1,className:"wordHighlightText",overviewRuler:{color:F_(B5),position:Cd.Center},minimap:{color:F_(p_),position:yd.Inline}}),H5=Iw.register({description:"selection-highlight-overview",stickiness:1,className:"selectionHighlight",overviewRuler:{color:F_(u_),position:Cd.Center},minimap:{color:F_(p_),position:yd.Inline}}),z5=Iw.register({description:"selection-highlight",stickiness:1,className:"selectionHighlight"}),U5=Iw.register({description:"word-highlight",stickiness:1,className:"wordHighlight",overviewRuler:{color:F_(P5),position:Cd.Center},minimap:{color:F_(p_),position:yd.Inline}});function K5(e){return e?z5:H5}H_(((e,t)=>{const i=e.getColor(Hm);i&&t.addRule(`.monaco-editor .selectionHighlight { background-color: ${i.transparent(.5)}; }`)}));var j5,q5=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},$5=function(e,t){return function(i,n){t(i,n,e)}};function G5(e,t){const i=t.filter((t=>!e.find((e=>e.equals(t)))));if(i.length>=1){const e=i.map((e=>`line ${e.viewState.position.lineNumber} column ${e.viewState.position.column}`)).join(", ");Fs(1===i.length?ue(0,"Cursor added: {0}",e):ue(0,"Cursors added: {0}",e))}}class Z5{constructor(e,t,i){this.selections=e,this.revealRange=t,this.revealScrollType=i}}class Y5{static create(e,t){if(!e.hasModel())return null;const i=t.getState();if(!e.hasTextFocus()&&i.isRevealed&&i.searchString.length>0)return new Y5(e,t,!1,i.searchString,i.wholeWord,i.matchCase,null);let n,s,o=!1;const r=e.getSelections();1===r.length&&r[0].isEmpty()?(o=!0,n=!0,s=!0):(n=i.wholeWord,s=i.matchCase);const a=e.getSelection();let l,h=null;if(a.isEmpty()){const t=e.getConfiguredWordAtPosition(a.getStartPosition());if(!t)return null;l=t.word,h=new Ah(a.startLineNumber,t.startColumn,a.startLineNumber,t.endColumn)}else l=e.getModel().getValueInRange(a).replace(/\r\n/g,"\n");return new Y5(e,t,o,l,n,s,h)}constructor(e,t,i,n,s,o,r){this._editor=e,this.findController=t,this.isDisconnectedFromFindController=i,this.searchText=n,this.wholeWord=s,this.matchCase=o,this.currentMatch=r}addSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new Z5(t.concat(e),e,0)}moveSelectionToNextFindMatch(){if(!this._editor.hasModel())return null;const e=this._getNextMatch();if(!e)return null;const t=this._editor.getSelections();return new Z5(t.slice(0,t.length-1).concat(e),e,0)}_getNextMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const e=this.currentMatch;return this.currentMatch=null,e}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(129):null,!1);return i?new Ah(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 Z5(t.concat(e),e,0)}moveSelectionToPreviousFindMatch(){if(!this._editor.hasModel())return null;const e=this._getPreviousMatch();if(!e)return null;const t=this._editor.getSelections();return new Z5(t.slice(0,t.length-1).concat(e),e,0)}_getPreviousMatch(){if(!this._editor.hasModel())return null;if(this.currentMatch){const e=this.currentMatch;return this.currentMatch=null,e}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(129):null,!1);return i?new Ah(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(129):null,!1,1073741824):t.findMatches(this.searchText,!0,!1,this.matchCase,this.wholeWord?this._editor.getOption(129):null,!1,1073741824)}}class X5 extends E{static get(e){return e.getContribution(X5.ID)}constructor(e){super(),this._sessionDispose=this._register(new N),this._editor=e,this._ignoreSelectionChange=!1,this._session=null}dispose(){this._endSession(),super.dispose()}_beginSessionIfNeeded(e){if(!this._session){const t=Y5.create(this._editor,e);if(!t)return;this._session=t;const i={searchString:this._session.searchText};this._session.isDisconnectedFromFindController&&(i.wholeWordOverride=1,i.matchCaseOverride=1,i.isRegexOverride=2),e.getState().change(i,!1),this._sessionDispose.add(this._editor.onDidChangeCursorSelection((e=>{this._ignoreSelectionChange||this._endSession()}))),this._sessionDispose.add(this._editor.onDidBlurEditorText((()=>{this._endSession()}))),this._sessionDispose.add(e.getState().onFindReplaceStateChange((e=>{(e.matchCase||e.wholeWord)&&this._endSession()})))}}_endSession(){if(this._sessionDispose.clear(),this._session&&this._session.isDisconnectedFromFindController){const e={wholeWordOverride:0,matchCaseOverride:0,isRegexOverride:0};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 Ah(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 i=e.getState().matchCase;if(!t3(this._editor.getModel(),t,i)){const e=this._editor.getModel(),i=[];for(let n=0,s=t.length;n0&&i.isRegex){const e=this._editor.getModel();t=i.searchScope?e.findMatches(i.searchString,i.searchScope,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(129):null,!1,1073741824):e.findMatches(i.searchString,!0,i.isRegex,i.matchCase,i.wholeWord?this._editor.getOption(129):null,!1,1073741824)}else{if(this._beginSessionIfNeeded(e),!this._session)return;t=this._session.selectAll(i.searchScope)}if(t.length>0){const e=this._editor.getSelection();for(let i=0,n=t.length;inew Ah(e.range.startLineNumber,e.range.startColumn,e.range.endLineNumber,e.range.endColumn))))}}}X5.ID="editor.contrib.multiCursorController";class Q5 extends bh{run(e,t){const i=X5.get(t);if(!i)return;const n=t._getViewModel();if(n){const s=n.getCursorStates(),o=CQ.get(t);if(o)this._run(i,o);else{const n=e.get(Fa).createInstance(CQ,t);this._run(i,n),n.dispose()}G5(s,n.getCursorStates())}}}class J5{constructor(e,t,i,n,s){this._model=e,this._searchText=t,this._matchCase=i,this._wordSeparators=n,this._modelVersionId=this._model.getVersionId(),this._cachedFindMatches=null,s&&this._model===s._model&&this._searchText===s._searchText&&this._matchCase===s._matchCase&&this._wordSeparators===s._wordSeparators&&this._modelVersionId===s._modelVersionId&&(this._cachedFindMatches=s._cachedFindMatches)}findMatches(){return null===this._cachedFindMatches&&(this._cachedFindMatches=this._model.findMatches(this._searchText,!0,!1,this._matchCase,this._wordSeparators,!1).map((e=>e.range)),this._cachedFindMatches.sort(Rh.compareRangesUsingStarts)),this._cachedFindMatches}}let e3=j5=class extends E{constructor(e,t){super(),this._languageFeaturesService=t,this.editor=e,this._isEnabled=e.getOption(107),this._decorations=e.createDecorationsCollection(),this.updateSoon=this._register(new rd((()=>this._update()),300)),this.state=null,this._register(e.onDidChangeConfiguration((t=>{this._isEnabled=e.getOption(107)}))),this._register(e.onDidChangeCursorSelection((e=>{this._isEnabled&&(e.selection.isEmpty()?3===e.reason?(this.state&&this._setState(null),this.updateSoon.schedule()):this._setState(null):this._update())}))),this._register(e.onDidChangeModel((e=>{this._setState(null)}))),this._register(e.onDidChangeModelContent((e=>{this._isEnabled&&this.updateSoon.schedule()})));const i=CQ.get(e);i&&this._register(i.getState().onFindReplaceStateChange((e=>{this._update()}))),this.updateSoon.schedule()}_update(){this._setState(j5._createState(this.state,this._isEnabled,this.editor))}static _createState(e,t,i){if(!t)return null;if(!i.hasModel())return null;const n=i.getSelection();if(n.startLineNumber!==n.endLineNumber)return null;const s=X5.get(i);if(!s)return null;const o=CQ.get(i);if(!o)return null;let r=s.getSession(o);if(!r){const e=i.getSelections();if(e.length>1){const t=o.getState().matchCase;if(!t3(i.getModel(),e,t))return null}r=Y5.create(i,o)}if(!r)return null;if(r.currentMatch)return null;if(/^[ \t]+$/.test(r.searchText))return null;if(r.searchText.length>200)return null;const a=o.getState(),l=a.matchCase;if(a.isRevealed){let e=a.searchString;l||(e=e.toLowerCase());let t=r.searchText;if(l||(t=t.toLowerCase()),e===t&&r.matchCase===a.matchCase&&r.wholeWord===a.wholeWord&&!a.isRegex)return null}return new J5(i.getModel(),r.searchText,r.matchCase,r.wholeWord?i.getOption(129):null,e)}_setState(e){if(this.state=e,!this.state)return void this._decorations.clear();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(Rh.compareRangesUsingStarts);const s=[];for(let a=0,l=0,h=i.length,d=n.length;a=d)s.push(e),a++;else{const t=Rh.compareRangesUsingStarts(e,n[l]);t<0?(!n[l].isEmpty()&&Rh.areIntersecting(e,n[l])||s.push(e),a++):(t>0||a++,l++)}}const o=this._languageFeaturesService.documentHighlightProvider.has(t)&&this.editor.getOption(80),r=s.map((e=>({range:e,options:K5(o)})));this._decorations.set(r)}dispose(){this._setState(null),super.dispose()}};function t3(e,t,i){const n=i3(e,t[0],!i);for(let s=1,o=t.length;s1&&i.push(new Ah(e.endLineNumber,e.endColumn,e.endLineNumber,e.endColumn))}}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=t.getSelections(),s=t._getViewModel(),o=s.getCursorStates(),r=[];n.forEach((e=>this.getCursorsForSelection(e,i,r))),r.length>0&&t.setSelections(r),G5(o,s.getCursorStates())}}),Lh(class extends Q5{constructor(){super({id:"editor.action.addSelectionToNextFindMatch",label:ue(0,"Add Selection To Next Find Match"),alias:"Add Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:Oh.focus,primary:2082,weight:100},menuOpts:{menuId:eh.MenubarSelectionMenu,group:"3_multi",title:ue(0,"Add &&Next Occurrence"),order:5}})}_run(e,t){e.addSelectionToNextFindMatch(t)}}),Lh(class extends Q5{constructor(){super({id:"editor.action.addSelectionToPreviousFindMatch",label:ue(0,"Add Selection To Previous Find Match"),alias:"Add Selection To Previous Find Match",precondition:void 0,menuOpts:{menuId:eh.MenubarSelectionMenu,group:"3_multi",title:ue(0,"Add P&&revious Occurrence"),order:6}})}_run(e,t){e.addSelectionToPreviousFindMatch(t)}}),Lh(class extends Q5{constructor(){super({id:"editor.action.moveSelectionToNextFindMatch",label:ue(0,"Move Last Selection To Next Find Match"),alias:"Move Last Selection To Next Find Match",precondition:void 0,kbOpts:{kbExpr:Oh.focus,primary:pt(2089,2082),weight:100}})}_run(e,t){e.moveSelectionToNextFindMatch(t)}}),Lh(class extends Q5{constructor(){super({id:"editor.action.moveSelectionToPreviousFindMatch",label:ue(0,"Move Last Selection To Previous Find Match"),alias:"Move Last Selection To Previous Find Match",precondition:void 0})}_run(e,t){e.moveSelectionToPreviousFindMatch(t)}}),Lh(class extends Q5{constructor(){super({id:"editor.action.selectHighlights",label:ue(0,"Select All Occurrences of Find Match"),alias:"Select All Occurrences of Find Match",precondition:void 0,kbOpts:{kbExpr:Oh.focus,primary:3114,weight:100},menuOpts:{menuId:eh.MenubarSelectionMenu,group:"3_multi",title:ue(0,"Select All &&Occurrences"),order:7}})}_run(e,t){e.selectAll(t)}}),Lh(class extends Q5{constructor(){super({id:"editor.action.changeAll",label:ue(0,"Change All Occurrences"),alias:"Change All Occurrences",precondition:pl.and(Oh.writable,Oh.editorTextFocus),kbOpts:{kbExpr:Oh.editorTextFocus,primary:2108,weight:100},contextMenuOpts:{group:"1_modification",order:1.2}})}_run(e,t){e.selectAll(t)}}),Lh(class extends bh{constructor(){super({id:"editor.action.addCursorsToBottom",label:ue(0,"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(),s=[];for(let a=i[0].startLineNumber;a<=n;a++)s.push(new Ah(a,i[0].startColumn,a,i[0].endColumn));const o=t._getViewModel(),r=o.getCursorStates();s.length>0&&t.setSelections(s),G5(r,o.getCursorStates())}}),Lh(class extends bh{constructor(){super({id:"editor.action.addCursorsToTop",label:ue(0,"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 r=i[0].startLineNumber;r>=1;r--)n.push(new Ah(r,i[0].startColumn,r,i[0].endColumn));const s=t._getViewModel(),o=s.getCursorStates();n.length>0&&t.setSelections(n),G5(o,s.getCursorStates())}}),Lh(class extends bh{constructor(){super({id:"editor.action.focusNextCursor",label:ue(0,"Focus Next Cursor"),description:{description:ue(0,"Focuses the next cursor"),args:[]},alias:"Focus Next Cursor",precondition:void 0})}run(e,t,i){if(!t.hasModel())return;const n=t._getViewModel();if(n.cursorConfig.readOnly)return;n.model.pushStackElement();const s=Array.from(n.getCursorStates()),o=s.shift();o&&(s.push(o),n.setCursorStates(i.source,3,s),n.revealPrimaryCursor(i.source,!0),G5(s,n.getCursorStates()))}}),Lh(class extends bh{constructor(){super({id:"editor.action.focusPreviousCursor",label:ue(0,"Focus Previous Cursor"),description:{description:ue(0,"Focuses the previous cursor"),args:[]},alias:"Focus Previous Cursor",precondition:void 0})}run(e,t,i){if(!t.hasModel())return;const n=t._getViewModel();if(n.cursorConfig.readOnly)return;n.model.pushStackElement();const s=Array.from(n.getCursorStates()),o=s.pop();o&&(s.unshift(o),n.setCursorStates(i.source,3,s),n.revealPrimaryCursor(i.source,!0),G5(s,n.getCursorStates()))}});var n3=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const s3={Visible:new Al("parameterHintsVisible",!1),MultipleSignatures:new Al("parameterHintsMultipleSignatures",!1)};function o3(e,t,i,n,s){return n3(this,void 0,void 0,(function*(){const o=e.ordered(t);for(const e of o)try{const o=yield e.provideSignatureHelp(t,i,s,n);if(o)return o}catch(r){a(r)}}))}Xa.registerCommand("_executeSignatureHelpProvider",((e,...t)=>n3(void 0,void 0,void 0,(function*(){const[i,n,s]=t;qr(an.isUri(i)),qr(Va.isIPosition(n)),qr("string"==typeof s||!s);const o=e.get(oL),r=yield e.get(za).createModelReference(i);try{const e=yield o3(o.signatureHelpProvider,r.object.textEditorModel,Va.lift(n),{triggerKind:mC.Invoke,isRetrigger:!1,triggerCharacter:s},Uh.None);if(!e)return;return setTimeout((()=>e.dispose()),0),e.value}finally{r.dispose()}}))));var r3,a3=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};!function(e){e.Default={type:0};e.Pending=class{constructor(e,t){this.request=e,this.previouslyActiveHints=t,this.type=2}};e.Active=class{constructor(e){this.hints=e,this.type=1}}}(r3||(r3={}));class l3 extends E{constructor(e,t,i=l3.DEFAULT_DELAY){super(),this._onChangedHints=this._register(new U),this.onChangedHints=this._onChangedHints.event,this.triggerOnType=!1,this._state=r3.Default,this._pendingTriggers=[],this._lastSignatureHelpResult=this._register(new I),this.triggerChars=new qb,this.retriggerChars=new qb,this.triggerId=0,this.editor=e,this.providers=t,this.throttledDelayer=new Jh(i),this._register(this.editor.onDidBlurEditorWidget((()=>this.cancel()))),this._register(this.editor.onDidChangeConfiguration((()=>this.onEditorConfigurationChange()))),this._register(this.editor.onDidChangeModel((e=>this.onModelChanged()))),this._register(this.editor.onDidChangeModelLanguage((e=>this.onModelChanged()))),this._register(this.editor.onDidChangeCursorSelection((e=>this.onCursorChange(e)))),this._register(this.editor.onDidChangeModelContent((e=>this.onModelContentChange()))),this._register(this.providers.onDidChange(this.onModelChanged,this)),this._register(this.editor.onDidType((e=>this.onDidType(e)))),this.onEditorConfigurationChange(),this.onModelChanged()}get state(){return this._state}set state(e){2===this._state.type&&this._state.request.cancel(),this._state=e}cancel(e=!1){this.state=r3.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(r)}next(){if(1!==this.state.type)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=t%e==e-1,n=this.editor.getOption(85).cycle;!(e<2||i)||n?this.updateActiveSignature(i&&n?0:t+1):this.cancel()}previous(){if(1!==this.state.type)return;const e=this.state.hints.signatures.length,t=this.state.hints.activeSignature,i=0===t,n=this.editor.getOption(85).cycle;!(e<2||i)||n?this.updateActiveSignature(i&&n?e-1:t-1):this.cancel()}updateActiveSignature(e){1===this.state.type&&(this.state=new r3.Active(Object.assign(Object.assign({},this.state.hints),{activeSignature:e})),this._onChangedHints.fire(this.state.hints))}doTrigger(e){return a3(this,void 0,void 0,(function*(){const t=1===this.state.type||2===this.state.type,i=this.getLastActiveHints();if(this.cancel(!0),0===this._pendingTriggers.length)return!1;const n=this._pendingTriggers.reduce(h3);this._pendingTriggers=[];const s={triggerKind:n.triggerKind,triggerCharacter:n.triggerCharacter,isRetrigger:t,activeSignatureHelp:i};if(!this.editor.hasModel())return!1;const o=this.editor.getModel(),a=this.editor.getPosition();this.state=new r3.Pending(Yh((e=>o3(this.providers,o,a,s,e))),i);try{const t=yield this.state.request;return e!==this.triggerId?(null==t||t.dispose(),!1):t&&t.value.signatures&&0!==t.value.signatures.length?(this.state=new r3.Active(t.value),this._lastSignatureHelpResult.value=t,this._onChangedHints.fire(this.state.hints),!0):(null==t||t.dispose(),this._lastSignatureHelpResult.clear(),this.cancel(),!1)}catch(l){return e===this.triggerId&&(this.state=r3.Default),r(l),!1}}))}getLastActiveHints(){switch(this.state.type){case 1:return this.state.hints;case 2:return this.state.previouslyActiveHints;default:return}}get isTriggered(){return 1===this.state.type||2===this.state.type||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 e of t.signatureHelpTriggerCharacters||[])if(e.length){const t=e.charCodeAt(0);this.triggerChars.add(t),this.retriggerChars.add(t)}for(const e of t.signatureHelpRetriggerCharacters||[])e.length&&this.retriggerChars.add(e.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:mC.TriggerCharacter,triggerCharacter:e.charAt(t)})}onCursorChange(e){"mouse"===e.source?this.cancel():this.isTriggered&&this.trigger({triggerKind:mC.ContentChange})}onModelContentChange(){this.isTriggered&&this.trigger({triggerKind:mC.ContentChange})}onEditorConfigurationChange(){this.triggerOnType=this.editor.getOption(85).enabled,this.triggerOnType||this.cancel()}dispose(){this.cancel(!0),super.dispose()}}function h3(e,t){switch(t.triggerKind){case mC.Invoke:return t;case mC.ContentChange:return e;case mC.TriggerCharacter:default:return t}}l3.DEFAULT_DELAY=120;var d3,c3=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},u3=function(e,t){return function(i,n){t(i,n,e)}};const g3=fs,p3=tR("parameter-hints-next",Jr.chevronDown,ue(0,"Icon for show next parameter hint.")),m3=tR("parameter-hints-previous",Jr.chevronUp,ue(0,"Icon for show previous parameter hint."));let f3=d3=class extends E{constructor(e,t,i,n,s){super(),this.editor=e,this.model=t,this.renderDisposeables=this._register(new N),this.visible=!1,this.announcedLabel=null,this.allowEditorOverflow=!0,this.markdownRenderer=this._register(new Jk({editor:e},s,n)),this.keyVisible=s3.Visible.bindTo(i),this.keyMultipleSignatures=s3.MultipleSignatures.bindTo(i)}createParameterHintDOMNodes(){const e=g3(".editor-widget.parameter-hints-widget"),t=ds(e,g3(".phwrapper"));t.tabIndex=-1;const i=ds(t,g3(".controls")),n=ds(i,g3(".button"+ta.asCSSSelector(m3))),s=ds(i,g3(".overloads")),o=ds(i,g3(".button"+ta.asCSSSelector(p3)));this._register(En(n,"click",(e=>{as(e),this.previous()}))),this._register(En(o,"click",(e=>{as(e),this.next()})));const r=g3(".body"),a=new OD(r,{alwaysConsumeMouseWheel:!0});this._register(a),t.appendChild(a.getDomNode());const l=ds(r,g3(".signature")),h=ds(r,g3(".docs"));e.style.userSelect="text",this.domNodes={element:e,signature:l,overloads:s,docs:h,scrollbar:a},this.editor.addContentWidget(this),this.hide(),this._register(this.editor.onDidChangeCursorSelection((e=>{this.visible&&this.editor.layoutContentWidget(this)})));const d=()=>{if(!this.domNodes)return;const e=this.editor.getOption(50);this.domNodes.element.style.fontSize=`${e.fontSize}px`,this.domNodes.element.style.lineHeight=""+e.lineHeight/e.fontSize};d(),this._register(B.chain(this.editor.onDidChangeConfiguration.bind(this.editor),(e=>e.filter((e=>e.hasChanged(50)))))(d)),this._register(this.editor.onDidLayoutChange((e=>this.updateMaxHeight()))),this.updateMaxHeight()}show(){this.visible||(this.domNodes||this.createParameterHintDOMNodes(),this.keyVisible.set(!0),this.visible=!0,setTimeout((()=>{var e;null===(e=this.domNodes)||void 0===e||e.element.classList.add("visible")}),100),this.editor.layoutContentWidget(this))}hide(){var e;this.renderDisposeables.clear(),this.visible&&(this.keyVisible.reset(),this.visible=!1,this.announcedLabel=null,null===(e=this.domNodes)||void 0===e||e.element.classList.remove("visible"),this.editor.layoutContentWidget(this))}getPosition(){return this.visible?{position:this.editor.getPosition(),preference:[1,2]}:null}render(e){var t;if(this.renderDisposeables.clear(),!this.domNodes)return;const i=e.signatures.length>1;this.domNodes.element.classList.toggle("multiple",i),this.keyMultipleSignatures.set(i),this.domNodes.signature.innerText="",this.domNodes.docs.innerText="";const n=e.signatures[e.activeSignature];if(!n)return;const s=ds(this.domNodes.signature,g3(".code")),o=this.editor.getOption(50);s.style.fontSize=`${o.fontSize}px`,s.style.fontFamily=o.fontFamily;const r=n.parameters.length>0,a=null!==(t=n.activeParameter)&&void 0!==t?t:e.activeParameter;if(r)this.renderParameters(s,n,a);else{ds(s,g3("span")).textContent=n.label}const l=n.parameters[a];if(null==l?void 0:l.documentation){const e=g3("span.documentation");if("string"==typeof l.documentation)e.textContent=l.documentation;else{const t=this.renderMarkdownDocs(l.documentation);e.appendChild(t.element)}ds(this.domNodes.docs,g3("p",{},e))}if(void 0===n.documentation);else if("string"==typeof n.documentation)ds(this.domNodes.docs,g3("p",{},n.documentation));else{const e=this.renderMarkdownDocs(n.documentation);ds(this.domNodes.docs,e.element)}const h=this.hasDocs(n,l);if(this.domNodes.signature.classList.toggle("has-docs",h),this.domNodes.docs.classList.toggle("empty",!h),this.domNodes.overloads.textContent=String(e.activeSignature+1).padStart(e.signatures.length.toString().length,"0")+"/"+e.signatures.length,l){let e="";const t=n.parameters[a];e=Array.isArray(t.label)?n.label.substring(t.label[0],t.label[1]):t.label,t.documentation&&(e+="string"==typeof t.documentation?`, ${t.documentation}`:`, ${t.documentation.value}`),n.documentation&&(e+="string"==typeof n.documentation?`, ${n.documentation}`:`, ${n.documentation.value}`),this.announcedLabel!==e&&(Ps(ue(0,"{0}, hint",e)),this.announcedLabel=e)}this.editor.layoutContentWidget(this),this.domNodes.scrollbar.scanDomNode()}renderMarkdownDocs(e){const t=this.renderDisposeables.add(this.markdownRenderer.render(e,{asyncRenderCallback:()=>{var e;null===(e=this.domNodes)||void 0===e||e.scrollbar.scanDomNode()}}));return t.element.classList.add("markdown-docs"),t}hasDocs(e,t){return!!(t&&"string"==typeof t.documentation&&$r(t.documentation).length>0)||(!!(t&&"object"==typeof t.documentation&&$r(t.documentation).value.length>0)||(!!(e.documentation&&"string"==typeof e.documentation&&$r(e.documentation).length>0)||!!(e.documentation&&"object"==typeof e.documentation&&$r(e.documentation.value).length>0)))}renderParameters(e,t,i){const[n,s]=this.getParameterLabelOffsets(t,i),o=document.createElement("span");o.textContent=t.label.substring(0,n);const r=document.createElement("span");r.textContent=t.label.substring(n,s),r.className="parameter active";const a=document.createElement("span");a.textContent=t.label.substring(s),ds(e,o,r,a)}getParameterLabelOffsets(e,t){const i=e.parameters[t];if(i){if(Array.isArray(i.label))return i.label;if(i.label.length){const t=new RegExp(`(\\W|^)${eo(i.label)}(?=\\W|$)`,"g");t.test(e.label);const n=t.lastIndex-i.label.length;return n>=0?[n,t.lastIndex]:[0,0]}return[0,0]}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 d3.ID}updateMaxHeight(){if(!this.domNodes)return;const e=`${Math.max(this.editor.getLayoutInfo().height/4,250)}px`;this.domNodes.element.style.maxHeight=e;const t=this.domNodes.element.getElementsByClassName("phwrapper");t.length&&(t[0].style.maxHeight=e)}};f3.ID="editor.widget.parameterHintsWidget",f3=d3=c3([u3(2,Ol),u3(3,qk),u3(4,Lc)],f3),Dp("editorHoverWidget.highlightForeground",{dark:kf,light:kf,hcDark:kf,hcLight:kf},ue(0,"Foreground color of the active item in the parameter hint."));var _3,v3=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},b3=function(e,t){return function(i,n){t(i,n,e)}};let C3=_3=class extends E{static get(e){return e.getContribution(_3.ID)}constructor(e,t,i){super(),this.editor=e,this.model=this._register(new l3(e,i.signatureHelpProvider)),this._register(this.model.onChangedHints((e=>{var t;e?(this.widget.value.show(),this.widget.value.render(e)):null===(t=this.widget.rawValue)||void 0===t||t.hide()}))),this.widget=new Zs((()=>this._register(t.createInstance(f3,this.editor,this.model))))}cancel(){this.model.cancel()}previous(){var e;null===(e=this.widget.rawValue)||void 0===e||e.previous()}next(){var e;null===(e=this.widget.rawValue)||void 0===e||e.next()}trigger(e){this.model.trigger(e,0)}};C3.ID="editor.controller.parameterHints",C3=_3=v3([b3(1,Fa),b3(2,oL)],C3);Dh(C3.ID,C3,2),Lh(class extends bh{constructor(){super({id:"editor.action.triggerParameterHints",label:ue(0,"Trigger Parameter Hints"),alias:"Trigger Parameter Hints",precondition:Oh.hasSignatureHelpProvider,kbOpts:{kbExpr:Oh.editorTextFocus,primary:3082,weight:100}})}run(e,t){const i=C3.get(t);null==i||i.trigger({triggerKind:mC.Invoke})}});const w3=vh.bindToContribution(C3.get);function y3(e,t){return t&&(e.stack||e.stacktrace)?ue(0,"{0}: {1}",L3(e),S3(e.stack)||S3(e.stacktrace)):L3(e)}function S3(e){return Array.isArray(e)?e.join("\n"):e}function L3(e){return"ERR_UNC_HOST_NOT_ALLOWED"===e.code?`${e.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:"string"==typeof e.code&&"number"==typeof e.errno&&"string"==typeof e.syscall?ue(0,"A system error occurred ({0})",e.message):e.message||ue(0,"An unknown error occurred. Please consult the log for more details.")}function k3(e=null,t=!1){if(!e)return ue(0,"An unknown error occurred. Please consult the log for more details.");if(Array.isArray(e)){const i=Bd(e),n=k3(i[0],t);return i.length>1?ue(0,"{0} ({1} errors in total)",n,i.length):n}if(Fr(e))return e;if(e.detail){const i=e.detail;if(i.error)return y3(i.error,t);if(i.exception)return y3(i.exception,t)}return e.stack?y3(e,t):e.message?e.message:ue(0,"An unknown error occurred. Please consult the log for more details.")}Sh(new w3({id:"closeParameterHints",precondition:s3.Visible,handler:e=>e.cancel(),kbOpts:{weight:175,kbExpr:Oh.focus,primary:9,secondary:[1033]}})),Sh(new w3({id:"showPrevParameterHint",precondition:pl.and(s3.Visible,s3.MultipleSignatures),handler:e=>e.previous(),kbOpts:{weight:175,kbExpr:Oh.focus,primary:16,secondary:[528],mac:{primary:16,secondary:[528,302]}}})),Sh(new w3({id:"showNextParameterHint",precondition:pl.and(s3.Visible,s3.MultipleSignatures),handler:e=>e.next(),kbOpts:{weight:175,kbExpr:Oh.focus,primary:18,secondary:[530],mac:{primary:18,secondary:[530,300]}}}));class D3{constructor(){this.chunkCount=0,this.chunkOccurrences=new Map,this.documents=new Map}calculateScores(e,t){const i=this.computeEmbedding(e),n=new Map,s=[];for(const[o,r]of this.documents){if(t.isCancellationRequested)return[];for(const e of r.chunks){const t=this.computeSimilarityScore(e,i,n);t>0&&s.push({key:o,score:t})}}return s}static termFrequencies(e){return function(e){var t;const i=new Map;for(const n of e)i.set(n,(null!==(t=i.get(n))&&void 0!==t?t:0)+1);return i}(D3.splitTerms(e))}static*splitTerms(e){const t=e=>e.toLowerCase();for(const[i]of e.matchAll(/\b\p{Letter}[\p{Letter}\d]{2,}\b/gu)){yield t(i);const e=i.split(/(?<=[a-z])(?=[A-Z])/g);if(e.length>1)for(const i of e)i.length>2&&/\p{Letter}{3,}/gu.test(i)&&(yield t(i))}}updateDocuments(e){var t;for(const{key:i}of e)this.deleteDocument(i);for(const i of e){const e=[];for(const n of i.textChunks){const i=D3.termFrequencies(n);for(const e of i.keys())this.chunkOccurrences.set(e,(null!==(t=this.chunkOccurrences.get(e))&&void 0!==t?t:0)+1);e.push({text:n,tf:i})}this.chunkCount+=e.length,this.documents.set(i.key,{chunks:e})}return this}deleteDocument(e){const t=this.documents.get(e);if(t){this.documents.delete(e),this.chunkCount-=t.chunks.length;for(const e of t.chunks)for(const t of e.tf.keys()){const e=this.chunkOccurrences.get(t);if("number"==typeof e){const i=e-1;i<=0?this.chunkOccurrences.delete(t):this.chunkOccurrences.set(t,i)}}}}computeSimilarityScore(e,t,i){let n=0;for(const[s,o]of Object.entries(t)){const t=e.tf.get(s);if(!t)continue;let r=i.get(s);"number"!=typeof r&&(r=this.computeIdf(s),i.set(s,r));n+=t*r*o}return n}computeEmbedding(e){const t=D3.termFrequencies(e);return this.computeTfidf(t)}computeIdf(e){var t;const i=null!==(t=this.chunkOccurrences.get(e))&&void 0!==t?t:0;return i>0?Math.log((this.chunkCount+1)/i):0}computeTfidf(e){const t=Object.create(null);for(const[i,n]of e){const e=this.computeIdf(i);e>0&&(t[i]=n*e)}return t}}const x3=Ba("dialogService");var N3,E3=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function I3(e){const t=e;return Array.isArray(t.items)}function M3(e){const t=e;return!!t.picks&&t.additionalPicks instanceof Promise}!function(e){e[e.NO_ACTION=0]="NO_ACTION",e[e.CLOSE_PICKER=1]="CLOSE_PICKER",e[e.REFRESH_PICKER=2]="REFRESH_PICKER",e[e.REMOVE_ITEM=3]="REMOVE_ITEM"}(N3||(N3={}));class T3 extends E{constructor(e,t){super(),this.prefix=e,this.options=t}provide(e,t,i){var n;const s=new N;let o;e.canAcceptInBackground=!!(null===(n=this.options)||void 0===n?void 0:n.canAcceptInBackground),e.matchOnLabel=e.matchOnDescription=e.matchOnDetail=e.sortByLabel=!1;const r=s.add(new I),a=()=>E3(this,void 0,void 0,(function*(){const n=r.value=new N;null==o||o.dispose(!0),e.busy=!1,o=new jh(t);const s=o.token,a=e.value.substr(this.prefix.length).trim(),l=this._getPicks(a,n,s,i),h=(t,i)=>{var n;let s,o;if(I3(t)?(s=t.items,o=t.active):s=t,0===s.length){if(i)return!1;(a.length>0||e.hideInput)&&(null===(n=this.options)||void 0===n?void 0:n.noResultsPick)&&(s=Gr(this.options.noResultsPick)?[this.options.noResultsPick(a)]:[this.options.noResultsPick])}return e.items=s,o&&(e.activeItems=[o]),!0},d=t=>E3(this,void 0,void 0,(function*(){let i=!1,n=!1;yield Promise.all([(()=>E3(this,void 0,void 0,(function*(){"number"==typeof t.mergeDelay&&(yield td(t.mergeDelay),s.isCancellationRequested)||n||(i=h(t.picks,!0))})))(),(()=>E3(this,void 0,void 0,(function*(){e.busy=!0;try{const n=yield t.additionalPicks;if(s.isCancellationRequested)return;let o,r,a,l;if(I3(t.picks)?(o=t.picks.items,r=t.picks.active):o=t.picks,I3(n)?(a=n.items,l=n.active):a=n,a.length>0||!i){let t;if(!r&&!l){const i=e.activeItems[0];i&&-1!==o.indexOf(i)&&(t=i)}h({items:[...o,...a],active:r||l||t})}}finally{s.isCancellationRequested||(e.busy=!1),n=!0}})))()])}));if(null===l);else if(M3(l))yield d(l);else if(l instanceof Promise){e.busy=!0;try{const e=yield l;if(s.isCancellationRequested)return;M3(e)?yield d(e):h(e)}finally{s.isCancellationRequested||(e.busy=!1)}}else h(l)}));return s.add(e.onDidChangeValue((()=>a()))),a(),s.add(e.onDidAccept((t=>{const[i]=e.selectedItems;"function"==typeof(null==i?void 0:i.accept)&&(t.inBackground||e.hide(),i.accept(e.keyMods,t))}))),s.add(e.onDidTriggerItemButton((({button:i,item:n})=>E3(this,void 0,void 0,(function*(){var s,o;if("function"==typeof n.trigger){const r=null!==(o=null===(s=n.buttons)||void 0===s?void 0:s.indexOf(i))&&void 0!==o?o:-1;if(r>=0){const i=n.trigger(r,e.keyMods),s="number"==typeof i?i:yield i;if(t.isCancellationRequested)return;switch(s){case N3.NO_ACTION:break;case N3.CLOSE_PICKER:e.hide();break;case N3.REFRESH_PICKER:a();break;case N3.REMOVE_ITEM:{const t=e.items.indexOf(n);if(-1!==t){const i=e.items.slice(),n=i.splice(t,1),s=e.activeItems.filter((e=>e!==n[0])),o=e.keepScrollPosition;e.keepScrollPosition=!0,e.items=i,s&&(e.activeItems=s),e.keepScrollPosition=o}break}}}}}))))),s}}var R3,A3,O3=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},P3=function(e,t){return function(i,n){t(i,n,e)}},F3=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let B3=R3=class extends T3{constructor(e,t,i,n,s,o){super(R3.PREFIX,e),this.instantiationService=t,this.keybindingService=i,this.commandService=n,this.telemetryService=s,this.dialogService=o,this.commandsHistory=this._register(this.instantiationService.createInstance(W3)),this.options=e}_getPicks(e,t,i,n){var s,o,r,a;return F3(this,void 0,void 0,(function*(){const t=yield this.getCommandPicks(i);if(i.isCancellationRequested)return[];const l=_((()=>{const n=new D3;n.updateDocuments(t.map((e=>({key:e.commandId,textChunks:[e.label+(e.commandAlias?` ${e.commandAlias}`:"")]}))));return function(e){var t,i;const n=e.slice(0);n.sort(((e,t)=>t.score-e.score));const s=null!==(i=null===(t=n[0])||void 0===t?void 0:t.score)&&void 0!==i?i:0;if(s>0)for(const o of n)o.score/=s;return n}(n.calculateScores(e,i)).filter((e=>e.score>R3.TFIDF_THRESHOLD)).slice(0,R3.TFIDF_MAX_RESULTS)})),h=[];for(const n of t){const t=null!==(s=R3.WORD_FILTER(e,n.label))&&void 0!==s?s:void 0,r=n.commandAlias&&null!==(o=R3.WORD_FILTER(e,n.commandAlias))&&void 0!==o?o:void 0;if(t||r)n.highlights={label:t,detail:this.options.showAlias?r:void 0},h.push(n);else if(e===n.commandId)h.push(n);else if(e.length>=3){const e=l();if(i.isCancellationRequested)return[];const t=e.find((e=>e.key===n.commandId));t&&(n.tfIdfScore=t.score,h.push(n))}}const d=new Map;for(const e of h){const t=d.get(e.label);t?(e.description=e.commandId,t.description=t.commandId):d.set(e.label,e)}h.sort(((e,t)=>{if(e.tfIdfScore&&t.tfIdfScore)return e.tfIdfScore===t.tfIdfScore?e.label.localeCompare(t.label):t.tfIdfScore-e.tfIdfScore;if(e.tfIdfScore)return 1;if(t.tfIdfScore)return-1;const i=this.commandsHistory.peek(e.commandId),n=this.commandsHistory.peek(t.commandId);if(i&&n)return i>n?-1:1;if(i)return-1;if(n)return 1;if(this.options.suggestedCommandIds){const i=this.options.suggestedCommandIds.has(e.commandId),n=this.options.suggestedCommandIds.has(t.commandId);if(i&&n)return 0;if(i)return-1;if(n)return 1}return e.label.localeCompare(t.label)}));const c=[];let u=!1,g=!0,p=!!this.options.suggestedCommandIds;for(let e=0;eF3(this,void 0,void 0,(function*(){var s;const o=yield this.getAdditionalCommandPicks(t,h,e,i);if(i.isCancellationRequested)return[];const r=o.map((e=>this.toCommandPick(e,n)));return g&&"separator"!==(null===(s=r[0])||void 0===s?void 0:s.type)&&r.unshift({type:"separator",label:ue(0,"similar commands")}),r})))()}:c}))}toCommandPick(e,t){if("separator"===e.type)return e;const i=this.keybindingService.lookupKeybinding(e.commandId),n=i?ue(0,"{0}, {1}",e.label,i.getAriaLabel()):e.label;return Object.assign(Object.assign({},e),{ariaLabel:n,detail:this.options.showAlias&&e.commandAlias!==e.label?e.commandAlias:void 0,keybinding:i,accept:()=>F3(this,void 0,void 0,(function*(){var i,n;this.commandsHistory.push(e.commandId),this.telemetryService.publicLog2("workbenchActionExecuted",{id:e.commandId,from:null!==(i=null==t?void 0:t.from)&&void 0!==i?i:"quick open"});try{(null===(n=e.args)||void 0===n?void 0:n.length)?yield this.commandService.executeCommand(e.commandId,...e.args):yield this.commandService.executeCommand(e.commandId)}catch(s){d(s)||this.dialogService.error(ue(0,"Command '{0}' resulted in an error",e.label),k3(s))}}))})}};B3.PREFIX=">",B3.TFIDF_THRESHOLD=.5,B3.TFIDF_MAX_RESULTS=5,B3.WORD_FILTER=qo($o,(function(e,t,i=!1){if(!t||0===t.length)return null;let n=null,s=0;for(e=e.toLowerCase(),t=t.toLowerCase();sthis.updateConfiguration(e))))}updateConfiguration(e){e&&!e.affectsConfiguration("workbench.commandPalette.history")||(this.configuredCommandsHistoryLength=A3.getConfiguredCommandHistoryLength(this.configurationService),A3.cache&&A3.cache.limit!==this.configuredCommandsHistoryLength&&(A3.cache.limit=this.configuredCommandsHistoryLength,A3.saveState(this.storageService)))}load(){const e=this.storageService.get(A3.PREF_KEY_CACHE,0);let t;if(e)try{t=JSON.parse(e)}catch(n){}const i=A3.cache=new js(this.configuredCommandsHistoryLength,1);if(t){let e;e=t.usesLRU?t.entries:t.entries.sort(((e,t)=>e.value-t.value)),e.forEach((e=>i.set(e.key,e.value)))}A3.counter=this.storageService.getNumber(A3.PREF_KEY_COUNTER,0,A3.counter)}push(e){A3.cache&&(A3.cache.set(e,A3.counter++),A3.saveState(this.storageService))}peek(e){var t;return null===(t=A3.cache)||void 0===t?void 0:t.peek(e)}static saveState(e){if(!A3.cache)return;const t={usesLRU:!0,entries:[]};A3.cache.forEach(((e,i)=>t.entries.push({key:i,value:e}))),e.store(A3.PREF_KEY_CACHE,JSON.stringify(t),0,0),e.store(A3.PREF_KEY_COUNTER,A3.counter,0,0)}static getConfiguredCommandHistoryLength(e){var t,i;const n=null===(i=null===(t=e.getValue().workbench)||void 0===t?void 0:t.commandPalette)||void 0===i?void 0:i.history;return"number"==typeof n?n:A3.DEFAULT_COMMANDS_HISTORY_LENGTH}};W3.DEFAULT_COMMANDS_HISTORY_LENGTH=50,W3.PREF_KEY_CACHE="commandPalette.mru.cache",W3.PREF_KEY_COUNTER="commandPalette.mru.counter",W3.counter=1,W3=A3=O3([P3(0,ZN),P3(1,pu)],W3);class V3 extends B3{constructor(e,t,i,n,s,o){super(e,t,i,n,s,o)}getCodeEditorCommandPicks(){const e=this.activeTextEditorControl;if(!e)return[];const t=[];for(const i of e.getSupportedActions())t.push({commandId:i.id,commandAlias:i.alias,label:aa(i.label)||i.id});return t}}var H3=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},z3=function(e,t){return function(i,n){t(i,n,e)}},U3=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let K3=class extends V3{get activeTextEditorControl(){var e;return null!==(e=this.codeEditorService.getFocusedCodeEditor())&&void 0!==e?e:void 0}constructor(e,t,i,n,s,o){super({showAlias:!1},e,i,n,s,o),this.codeEditorService=t}getCommandPicks(){return U3(this,void 0,void 0,(function*(){return this.getCodeEditorCommandPicks()}))}hasAdditionalCommandPicks(){return!1}getAdditionalCommandPicks(){return U3(this,void 0,void 0,(function*(){return[]}))}};K3=H3([z3(0,Fa),z3(1,Wa),z3(2,WL),z3(3,Ya),z3(4,lh),z3(5,x3)],K3);class j3 extends bh{constructor(){super({id:j3.ID,label:OJ.quickCommandActionLabel,alias:"Command Palette",precondition:void 0,kbOpts:{kbExpr:Oh.focus,primary:59,weight:100},contextMenuOpts:{group:"z_commands",order:1}})}run(e){e.get(cE).quickAccess.show(K3.PREFIX)}}j3.ID="editor.action.quickCommand",Lh(j3),jl.as(MJ).registerQuickAccessProvider({ctor:K3,prefix:K3.PREFIX,helpEntries:[{description:OJ.quickCommandHelp,commandId:j3.ID}]});var q3,$3=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},G3=function(e,t){return function(i,n){t(i,n,e)}};let Z3=q3=class{constructor(e,t){this.quickInputService=e,this.keybindingService=t,this.registry=jl.as(MJ)}provide(e){const t=new N;return t.add(e.onDidAccept((()=>{const[t]=e.selectedItems;t&&this.quickInputService.quickAccess.show(t.prefix,{preserveValue:!0})}))),t.add(e.onDidChangeValue((e=>{const t=this.registry.getQuickAccessProvider(e.substr(q3.PREFIX.length));t&&t.prefix&&t.prefix!==q3.PREFIX&&this.quickInputService.quickAccess.show(t.prefix,{preserveValue:!0})}))),e.items=this.getQuickAccessProviders().filter((e=>e.prefix!==q3.PREFIX)),t}getQuickAccessProviders(){return this.registry.getQuickAccessProviders().sort(((e,t)=>e.prefix.localeCompare(t.prefix))).flatMap((e=>this.createPicks(e)))}createPicks(e){return e.helpEntries.map((t=>{const i=t.prefix||e.prefix,n=i||"\u2026";return{prefix:i,label:n,keybinding:t.commandId?this.keybindingService.lookupKeybinding(t.commandId):void 0,ariaLabel:ue(0,"{0}, {1}",n,t.description),description:t.description}}))}};Z3.PREFIX="?",Z3=q3=$3([G3(0,cE),G3(1,WL)],Z3),jl.as(MJ).registerQuickAccessProvider({ctor:Z3,prefix:"",helpEntries:[{description:AJ.helpQuickAccessActionLabel}]});const Y3=[void 0,[]];function X3(e,t,i=0,n=0){const s=t;return s.values&&s.values.length>1?function(e,t,i,n){let s=0;const o=[];for(const r of t){const[t,a]=Q3(e,r,i,n);if("number"!=typeof t)return Y3;s+=t,o.push(...a)}return[s,J3(o)]}(e,s.values,i,n):Q3(e,t,i,n)}function Q3(e,t,i,n){const s=Rr(t.original,t.originalLowercase,i,e,e.toLowerCase(),n,{firstMatchCanBeWeak:!0,boostFullMatch:!0});return s?[s[0],_r(s)]:Y3}Object.freeze({score:0});function J3(e){const t=e.sort(((e,t)=>e.start-t.start)),i=[];let n;for(const s of t)n&&e6(n,s)?(n.start=Math.min(n.start,s.start),n.end=Math.max(n.end,s.end)):(n=s,i.push(s));return i}function e6(e,t){return!(e.end=0,r=t6(e);let a;const l=e.split(i6);if(l.length>1)for(const h of l){const e=t6(h),{pathNormalized:t,normalized:i,normalizedLowercase:n}=s6(h);i&&(a||(a=[]),a.push({original:h,originalLowercase:h.toLowerCase(),pathNormalized:t,normalized:i,normalizedLowercase:n,expectContiguousMatch:e}))}return{original:e,originalLowercase:t,pathNormalized:i,normalized:n,normalizedLowercase:s,values:a,containsPathSeparator:o,expectContiguousMatch:r}}function s6(e){let t;t=Oe?e.replace(/\//g,Ji):e.replace(/\\/g,Ji);const i=(n=t,n.replace(/\*/g,"")).replace(/\s|"/g,"");var n;return{pathNormalized:t,normalized:i,normalizedLowercase:i.toLowerCase()}}function o6(e){return Array.isArray(e)?n6(e.map((e=>e.original)).join(i6)):n6(e.original)}var r6,a6=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},l6=function(e,t){return function(i,n){t(i,n,e)}},h6=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let d6=r6=class extends NJ{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,ue(0,"To go to a symbol, first open a text editor with symbol information.")),E.None}provideWithTextEditor(e,t,i){const n=e.editor,s=this.getModel(n);return s?this._languageFeaturesService.documentSymbolProvider.has(s)?this.doProvideWithEditorSymbols(e,s,t,i):this.doProvideWithoutEditorSymbols(e,s,t,i):E.None}doProvideWithoutEditorSymbols(e,t,i,n){const s=new N;return this.provideLabelPick(i,ue(0,"The active text editor does not provide symbol information.")),(()=>{h6(this,void 0,void 0,(function*(){(yield this.waitForLanguageSymbolRegistry(t,s))&&!n.isCancellationRequested&&s.add(this.doProvideWithEditorSymbols(e,t,i,n))}))})(),s}provideLabelPick(e,t){e.items=[{label:t,index:0,kind:14}],e.ariaLabel=t}waitForLanguageSymbolRegistry(e,t){return h6(this,void 0,void 0,(function*(){if(this._languageFeaturesService.documentSymbolProvider.has(e))return!0;const i=new hd,n=t.add(this._languageFeaturesService.documentSymbolProvider.onDidChange((()=>{this._languageFeaturesService.documentSymbolProvider.has(e)&&(n.dispose(),i.complete(!0))})));return t.add(x((()=>i.complete(!1)))),i.p}))}doProvideWithEditorSymbols(e,t,i,n){var s;const o=e.editor,r=new N;r.add(i.onDidAccept((t=>{const[n]=i.selectedItems;n&&n.range&&(this.gotoLocation(e,{range:n.range.selection,keyMods:i.keyMods,preserveFocus:t.inBackground}),t.inBackground||i.hide())}))),r.add(i.onDidTriggerItemButton((({item:t})=>{t&&t.range&&(this.gotoLocation(e,{range:t.range.selection,keyMods:i.keyMods,forceSideBySide:!0}),i.hide())})));const a=this.getDocumentSymbols(t,n);let l;const h=e=>h6(this,void 0,void 0,(function*(){null==l||l.dispose(!0),i.busy=!1,l=new jh(n),i.busy=!0;try{const t=n6(i.value.substr(r6.PREFIX.length).trim()),s=yield this.doGetSymbolPicks(a,t,void 0,l.token);if(n.isCancellationRequested)return;if(s.length>0){if(i.items=s,e&&0===t.original.length){const t=pc(s,(t=>Boolean("separator"!==t.type&&t.range&&Rh.containsPosition(t.range.decoration,e))));t&&(i.activeItems=[t])}}else t.original.length>0?this.provideLabelPick(i,ue(0,"No matching editor symbols")):this.provideLabelPick(i,ue(0,"No editor symbols"))}finally{n.isCancellationRequested||(i.busy=!1)}}));return r.add(i.onDidChangeValue((()=>h(void 0)))),h(null===(s=o.getSelection())||void 0===s?void 0:s.getPosition()),r.add(i.onDidChangeActive((()=>{const[e]=i.activeItems;e&&e.range&&(o.revealRangeInCenter(e.range.selection,0),this.addDecorations(o,e.range.decoration))}))),r}doGetSymbolPicks(e,t,i,n){var s,o;return h6(this,void 0,void 0,(function*(){const r=yield e;if(n.isCancellationRequested)return[];const a=0===t.original.indexOf(r6.SCOPE_PREFIX),l=a?1:0;let h,d,c;t.values&&t.values.length>1?(h=o6(t.values[0]),d=o6(t.values.slice(1))):h=t;const u=null===(o=null===(s=this.options)||void 0===s?void 0:s.openSideBySideDirection)||void 0===o?void 0:o.call(s);u&&(c=[{iconClass:"right"===u?ta.asClassName(Jr.splitHorizontal):ta.asClassName(Jr.splitVertical),tooltip:ue(0,"right"===u?"Open to the Side":"Open to the Bottom")}]);const g=[];for(let v=0;vl){let E=!1;if(h!==t&&([S,L]=X3(w,Object.assign(Object.assign({},t),{values:void 0}),l,y),"number"==typeof S&&(E=!0)),"number"!=typeof S&&([S,L]=X3(w,h,l,y),"number"!=typeof S))continue;if(!E&&d){if(x&&d.original.length>0&&([k,D]=X3(x,d)),"number"!=typeof k)continue;"number"==typeof S&&(S+=k)}}const N=b.tags&&b.tags.indexOf(1)>=0;g.push({index:v,kind:b.kind,score:S,label:w,ariaLabel:(p=b.name,m=b.kind,ue(0,"{0} ({1})",p,SC[m])),description:x,highlights:N?void 0:{label:L,description:D},range:{selection:Rh.collapseToStart(b.selectionRange),decoration:b.range},strikethrough:N,buttons:c})}var p,m;const f=g.sort(((e,t)=>a?this.compareByKindAndScore(e,t):this.compareByScore(e,t)));let _=[];if(a){let I,M,T=0;function R(){M&&"number"==typeof I&&T>0&&(M.label=Qs(u6[I]||c6,T))}for(const A of f)I!==A.kind?(R(),I=A.kind,T=1,M={type:"separator"},_.push(M)):T++,_.push(A);R()}else f.length>0&&(_=[{label:ue(0,"symbols ({0})",g.length),type:"separator"},...f]);return _}))}compareByScore(e,t){if("number"!=typeof e.score&&"number"==typeof t.score)return 1;if("number"==typeof e.score&&"number"!=typeof t.score)return-1;if("number"==typeof e.score&&"number"==typeof t.score){if(e.score>t.score)return-1;if(e.scoret.index?1:0}compareByKindAndScore(e,t){const i=u6[e.kind]||c6,n=u6[t.kind]||c6,s=i.localeCompare(n);return 0===s?this.compareByScore(e,t):s}getDocumentSymbols(e,t){return h6(this,void 0,void 0,(function*(){const i=yield this._outlineModelService.getOrCreate(e,t);return t.isCancellationRequested?[]:i.asListOfDocumentSymbols()}))}};d6.PREFIX="@",d6.SCOPE_PREFIX=":",d6.PREFIX_BY_CATEGORY=`${r6.PREFIX}${r6.SCOPE_PREFIX}`,d6=r6=a6([l6(0,oL),l6(1,kZ)],d6);const c6=ue(0,"properties ({0})"),u6={5:ue(0,"methods ({0})"),11:ue(0,"functions ({0})"),8:ue(0,"constructors ({0})"),12:ue(0,"variables ({0})"),4:ue(0,"classes ({0})"),22:ue(0,"structs ({0})"),23:ue(0,"events ({0})"),24:ue(0,"operators ({0})"),10:ue(0,"interfaces ({0})"),2:ue(0,"namespaces ({0})"),3:ue(0,"packages ({0})"),25:ue(0,"type parameters ({0})"),1:ue(0,"modules ({0})"),6:ue(0,"properties ({0})"),9:ue(0,"enumerations ({0})"),21:ue(0,"enumeration members ({0})"),14:ue(0,"strings ({0})"),0:ue(0,"files ({0})"),17:ue(0,"arrays ({0})"),15:ue(0,"numbers ({0})"),16:ue(0,"booleans ({0})"),18:ue(0,"objects ({0})"),19:ue(0,"keys ({0})"),7:ue(0,"fields ({0})"),13:ue(0,"constants ({0})")};var g6=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},p6=function(e,t){return function(i,n){t(i,n,e)}};let m6=class extends d6{constructor(e,t,i){super(t,i),this.editorService=e,this.onDidActiveTextEditorControlChange=B.None}get activeTextEditorControl(){var e;return null!==(e=this.editorService.getFocusedCodeEditor())&&void 0!==e?e:void 0}};m6=g6([p6(0,Wa),p6(1,oL),p6(2,kZ)],m6);class f6 extends bh{constructor(){super({id:f6.ID,label:PJ.quickOutlineActionLabel,alias:"Go to Symbol...",precondition:Oh.hasDocumentSymbolProvider,kbOpts:{kbExpr:Oh.focus,primary:3117,weight:100},contextMenuOpts:{group:"navigation",order:3}})}run(e){e.get(cE).quickAccess.show(d6.PREFIX,{itemActivation:dE.NONE})}}f6.ID="editor.action.quickOutline",Lh(f6),jl.as(MJ).registerQuickAccessProvider({ctor:m6,prefix:d6.PREFIX,helpEntries:[{description:PJ.quickOutlineActionLabel,prefix:d6.PREFIX,commandId:f6.ID},{description:PJ.quickOutlineByCategoryActionLabel,prefix:d6.PREFIX_BY_CATEGORY}]});class _6 extends E{constructor(e){super(),this.editor=e,this._register(this.editor.onDidAttemptReadOnlyEdit((()=>this._onDidAttemptReadOnlyEdit())))}_onDidAttemptReadOnlyEdit(){const e=oD.get(this.editor);if(e&&this.editor.hasModel()){let t=this.editor.getOptions().get(91);t||(t=this.editor.isSimpleWidget?new Ta(ue(0,"Cannot edit in read-only input")):new Ta(ue(0,"Cannot edit in read-only editor"))),e.showMessage(t,this.editor.getPosition())}}}_6.ID="editor.contrib.readOnlyMessageController",Dh(_6.ID,_6,2);var v6=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},b6=function(e,t){return function(i,n){t(i,n,e)}};let C6=class extends CU{constructor(e,t,i,n,s,o,r){super(!0,e,t,i,n,s,o,r)}};C6=v6([b6(1,Ol),b6(2,Wa),b6(3,mL),b6(4,Fa),b6(5,ZN),b6(6,pu)],C6),Dh(CU.ID,C6,4);var w6=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},y6=function(e,t){return function(i,n){t(i,n,e)}};const S6=new Al("renameInputVisible",!1,ue(0,"Whether the rename input widget is visible"));let L6=class{constructor(e,t,i,n,s){this._editor=e,this._acceptKeybindings=t,this._themeService=i,this._keybindingService=n,this._disposables=new N,this.allowEditorOverflow=!0,this._visibleContextKey=S6.bindTo(s),this._editor.addContentWidget(this),this._disposables.add(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(50)&&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._input=document.createElement("input"),this._input.className="rename-input",this._input.type="text",this._input.setAttribute("aria-label",ue(0,"Rename input. Type new name and press Enter to commit.")),this._domNode.appendChild(this._input),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){var t,i,n,s;if(!this._input||!this._domNode)return;const o=e.getColor(Ap),r=e.getColor(Op);this._domNode.style.backgroundColor=String(null!==(t=e.getColor(km))&&void 0!==t?t:""),this._domNode.style.boxShadow=o?` 0 0 8px 2px ${o}`:"",this._domNode.style.border=r?`1px solid ${r}`:"",this._domNode.style.color=String(null!==(i=e.getColor(Fp))&&void 0!==i?i:""),this._input.style.backgroundColor=String(null!==(n=e.getColor(Pp))&&void 0!==n?n:"");const a=e.getColor(Bp);this._input.style.borderWidth=a?"1px":"0px",this._input.style.borderStyle=a?"solid":"none",this._input.style.borderColor=null!==(s=null==a?void 0:a.toString())&&void 0!==s?s:"none"}_updateFont(){if(!this._input||!this._label)return;const e=this._editor.getOption(50);this._input.style.fontFamily=e.fontFamily,this._input.style.fontWeight=e.fontWeight,this._input.style.fontSize=`${e.fontSize}px`,this._label.style.fontSize=.8*e.fontSize+"px"}getPosition(){return this._visible?{position:this._position,preference:[2,1]}:null}beforeRender(){var e,t;const[i,n]=this._acceptKeybindings;return this._label.innerText=ue(0,"{0} to Rename, {1} to Preview",null===(e=this._keybindingService.lookupKeybinding(i))||void 0===e?void 0:e.getLabel(),null===(t=this._keybindingService.lookupKeybinding(n))||void 0===t?void 0:t.getLabel()),null}afterRender(e){e||this.cancelInput(!0)}acceptInput(e){var t;null===(t=this._currentAcceptInput)||void 0===t||t.call(this,e)}cancelInput(e){var t;null===(t=this._currentCancelInput)||void 0===t||t.call(this,e)}getInput(e,t,i,n,s,o){this._domNode.classList.toggle("preview",s),this._position=new Va(e.startLineNumber,e.startColumn),this._input.value=t,this._input.setAttribute("selectionStart",i.toString()),this._input.setAttribute("selectionEnd",n.toString()),this._input.size=Math.max(1.1*(e.endColumn-e.startColumn),20);const r=new N;return new Promise((e=>{this._currentCancelInput=t=>(this._currentAcceptInput=void 0,this._currentCancelInput=void 0,e(t),!0),this._currentAcceptInput=i=>{0!==this._input.value.trim().length&&this._input.value!==t?(this._currentAcceptInput=void 0,this._currentCancelInput=void 0,e({newName:this._input.value,wantsPreview:s&&i})):this.cancelInput(!0)},r.add(o.onCancellationRequested((()=>this.cancelInput(!0)))),r.add(this._editor.onDidBlurEditorWidget((()=>{var e;return this.cancelInput(!(null===(e=this._domNode)||void 0===e?void 0:e.ownerDocument.hasFocus()))}))),this._show()})).finally((()=>{r.dispose(),this._hide()}))}_show(){this._editor.revealLineInCenterIfOutsideViewport(this._position.lineNumber,0),this._visible=!0,this._visibleContextKey.set(!0),this._editor.layoutContentWidget(this),setTimeout((()=>{this._input.focus(),this._input.setSelectionRange(parseInt(this._input.getAttribute("selectionStart")),parseInt(this._input.getAttribute("selectionEnd")))}),100)}_hide(){this._visible=!1,this._visibleContextKey.reset(),this._editor.layoutContentWidget(this)}};L6=w6([y6(2,P_),y6(3,WL),y6(4,Ol)],L6);var k6,D6=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},x6=function(e,t){return function(i,n){t(i,n,e)}},N6=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class E6{constructor(e,t,i){this.model=e,this.position=t,this._providerRenameIdx=0,this._providers=i.ordered(e)}hasProvider(){return this._providers.length>0}resolveRenameLocation(e){return N6(this,void 0,void 0,(function*(){const t=[];for(this._providerRenameIdx=0;this._providerRenameIdx0?t.join("\n"):void 0}:{range:Rh.fromPositions(this.position),text:"",rejectReason:t.length>0?t.join("\n"):void 0}}))}provideRenameEdits(e,t){return N6(this,void 0,void 0,(function*(){return this._provideRenameEdits(e,this._providerRenameIdx,[],t)}))}_provideRenameEdits(e,t,i,n){return N6(this,void 0,void 0,(function*(){const s=this._providers[t];if(!s)return{edits:[],rejectReason:i.join("\n")};const o=yield s.provideRenameEdits(this.model,this.position,e,n);return o?o.rejectReason?this._provideRenameEdits(e,t+1,i.concat(o.rejectReason),n):o:this._provideRenameEdits(e,t+1,i.concat(ue(0,"No result.")),n)}))}}let I6=k6=class{static get(e){return e.getContribution(k6.ID)}constructor(e,t,i,n,s,o,r,a){this.editor=e,this._instaService=t,this._notificationService=i,this._bulkEditService=n,this._progressService=s,this._logService=o,this._configService=r,this._languageFeaturesService=a,this._disposableStore=new N,this._cts=new jh,this._renameInputField=this._disposableStore.add(this._instaService.createInstance(L6,this.editor,["acceptRenameInput","acceptRenameInputWithPreview"]))}dispose(){this._disposableStore.dispose(),this._cts.dispose(!0)}run(){var e,t;return N6(this,void 0,void 0,(function*(){if(this._cts.dispose(!0),this._cts=new jh,!this.editor.hasModel())return;const i=this.editor.getPosition(),n=new E6(this.editor.getModel(),i,this._languageFeaturesService.renameProvider);if(!n.hasProvider())return;const s=new dL(this.editor,5,void 0,this._cts.token);let o;try{const e=n.resolveRenameLocation(s.token);this._progressService.showWhile(e,250),o=yield e}catch(Mre){return void(null===(e=oD.get(this.editor))||void 0===e||e.showMessage(Mre||ue(0,"An unknown error occurred while resolving rename location"),i))}finally{s.dispose()}if(!o)return;if(o.rejectReason)return void(null===(t=oD.get(this.editor))||void 0===t||t.showMessage(o.rejectReason,i));if(s.token.isCancellationRequested)return;const r=new dL(this.editor,5,o.range,this._cts.token),a=this.editor.getSelection();let l=0,h=o.text.length;Rh.isEmpty(a)||Rh.spansMultipleLines(a)||!Rh.containsRange(o.range,a)||(l=Math.max(0,a.startColumn-o.range.startColumn),h=Math.min(o.range.endColumn,a.endColumn)-o.range.startColumn);const d=this._bulkEditService.hasPreviewHandler()&&this._configService.getValue(this.editor.getModel().uri,"editor.rename.enablePreview"),c=yield this._renameInputField.getInput(o.range,o.text,l,h,d,r.token);if("boolean"==typeof c)return c&&this.editor.focus(),void r.dispose();this.editor.focus();const u=Xh(n.provideRenameEdits(c.newName,r.token),r.token).then((e=>N6(this,void 0,void 0,(function*(){e&&this.editor.hasModel()&&(e.rejectReason?this._notificationService.info(e.rejectReason):(this.editor.setSelection(Rh.fromPositions(this.editor.getSelection().getPosition())),this._bulkEditService.apply(e,{editor:this.editor,showPreview:c.wantsPreview,label:ue(0,"Renaming '{0}' to '{1}'",null==o?void 0:o.text,c.newName),code:"undoredo.rename",quotableLabel:ue(0,"Renaming {0} to {1}",null==o?void 0:o.text,c.newName),respectAutoSaveConfig:!0}).then((e=>{e.ariaSummary&&Ps(ue(0,"Successfully renamed '{0}' to '{1}'. Summary: {2}",o.text,c.newName,e.ariaSummary))})).catch((e=>{this._notificationService.error(ue(0,"Rename failed to apply edits")),this._logService.error(e)}))))}))),(e=>{this._notificationService.error(ue(0,"Rename failed to compute edits")),this._logService.error(e)})).finally((()=>{r.dispose()}));return this._progressService.showWhile(u,250),u}))}acceptRenameInput(e){this._renameInputField.acceptInput(e)}cancelRenameInput(){this._renameInputField.cancelInput(!0)}};I6.ID="editor.contrib.renameController",I6=k6=D6([x6(1,Fa),x6(2,mL),x6(3,tL),x6(4,vL),x6(5,hh),x6(6,pT),x6(7,oL)],I6);Dh(I6.ID,I6,4),Lh(class extends bh{constructor(){super({id:"editor.action.rename",label:ue(0,"Rename Symbol"),alias:"Rename Symbol",precondition:pl.and(Oh.writable,Oh.hasRenameProvider),kbOpts:{kbExpr:Oh.editorTextFocus,primary:60,weight:100},contextMenuOpts:{group:"1_modification",order:1.1}})}runCommand(e,t){const i=e.get(Wa),[n,s]=Array.isArray(t)&&t||[void 0,void 0];return an.isUri(n)&&Va.isIPosition(s)?i.openCodeEditor({resource:n},i.getActiveCodeEditor()).then((e=>{e&&(e.setPosition(s),e.invokeWithinContext((t=>(this.reportTelemetry(t,e),this.run(t,e)))))}),r):super.runCommand(e,t)}run(e,t){const i=I6.get(t);return i?i.run():Promise.resolve()}});const M6=vh.bindToContribution(I6.get);Sh(new M6({id:"acceptRenameInput",precondition:S6,handler:e=>e.acceptRenameInput(!1),kbOpts:{weight:199,kbExpr:pl.and(Oh.focus,pl.not("isComposing")),primary:3}})),Sh(new M6({id:"acceptRenameInputWithPreview",precondition:pl.and(S6,pl.has("config.editor.rename.enablePreview")),handler:e=>e.acceptRenameInput(!0),kbOpts:{weight:199,kbExpr:pl.and(Oh.focus,pl.not("isComposing")),primary:1027}})),Sh(new M6({id:"cancelRenameInput",precondition:S6,handler:e=>e.cancelRenameInput(),kbOpts:{weight:199,kbExpr:Oh.focus,primary:9,secondary:[1033]}})),yh("_executeDocumentRenameProvider",(function(e,t,i,...n){const[s]=n;qr("string"==typeof s);const{renameProvider:o}=e.get(oL);return function(e,t,i,n){return N6(this,void 0,void 0,(function*(){const s=new E6(t,i,e),o=yield s.resolveRenameLocation(Uh.None);return(null==o?void 0:o.rejectReason)?{edits:[],rejectReason:o.rejectReason}:s.provideRenameEdits(n,Uh.None)}))}(o,t,i,s)})),yh("_executePrepareRename",(function(e,t,i){return N6(this,void 0,void 0,(function*(){const{renameProvider:n}=e.get(oL),s=new E6(t,i,n),o=yield s.resolveRenameLocation(Uh.None);if(null==o?void 0:o.rejectReason)throw new Error(o.rejectReason);return o}))})),jl.as(xu).registerConfiguration({id:"editor",properties:{"editor.rename.enablePreview":{scope:5,description:ue(0,"Enable/disable the ability to preview changes before renaming"),default:!0,type:"boolean"}}});class T6{static create(e,t){return new T6(e,new R6(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 Rh(this._startLineNumber+e.startLineNumber,e.startColumn,this._startLineNumber+e.endLineNumber,e.endColumn):e}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,s,o]=this._tokens.split(t,e.startColumn-1,i,e.endColumn-1);return[new T6(this._startLineNumber,n),new T6(this._startLineNumber+o,s)]}applyEdit(e,t){const[i,n,s]=hc(t);this.acceptEdit(e,i,n,s,t.length>0?t.charCodeAt(0):0)}acceptEdit(e,t,i,n,s){this._acceptDeleteRange(e),this._acceptInsertText(new Va(e.startLineNumber,e.startColumn),t,i,n,s),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 e=i-t;return void(this._startLineNumber-=e)}const n=this._tokens.getMaxDeltaLine();if(!(t>=n+1)){if(t<0&&i>=n+1)return this._startLineNumber=0,void this._tokens.clear();if(t<0){const n=-t;this._startLineNumber-=n,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,s){if(0===t&&0===i)return;const o=e.lineNumber-this._startLineNumber;if(o<0)return void(this._startLineNumber+=t);o>=this._tokens.getMaxDeltaLine()+1||this._tokens.acceptInsertText(o,e.column-1,t,i,n,s)}}class R6{constructor(e){this._tokens=e,this._tokenCount=e.length/4}toString(e){const t=[];for(let i=0;ie)){let s=n;for(;s>t&&this._getDeltaLine(s-1)===e;)s--;let o=n;for(;oe||d===e&&u>=t)&&(de||r===e&&g>=t){if(rs?p-=s-i:p=i;else if(u===t&&g===i){if(!(u===n&&p>s)){h=!0;continue}p-=s-i}else if(us)){h=!0;continue}u=t,g=i,p=g+(p-s)}else if(u>n){if(0===a&&!h){l=r;break}u-=a}else{if(!(u===n&&g>=s))throw new Error("Not possible!");e&&0===u&&(g+=e,p+=e),u-=a,g-=s-i,p-=s-i}const f=4*l;o[f]=u,o[f+1]=g,o[f+2]=p,o[f+3]=m,l++}this._tokenCount=l}acceptInsertText(e,t,i,n,s,o){const r=0===i&&1===n&&(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122),a=this._tokens,l=this._tokenCount;for(let h=0;h=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},P6=function(e,t){return function(i,n){t(i,n,e)}};let F6=class{constructor(e,t,i,n){this._legend=e,this._themeService=t,this._languageService=i,this._logService=n,this._hasWarnedOverlappingTokens=!1,this._hasWarnedInvalidLengthTokens=!1,this._hasWarnedInvalidEditStart=!1,this._hashTable=new V6}getMetadata(e,t,i){const n=this._languageService.languageIdCodec.encodeLanguageId(i),s=this._hashTable.get(e,t,n);let o;if(s)o=s.metadata,this._logService.getLevel()===dh.Trace&&this._logService.trace(`SemanticTokensProviderStyling [CACHED] ${e} / ${t}: foreground ${Gg.getForeground(o)}, fontStyle ${Gg.getFontStyle(o).toString(2)}`);else{let s=this._legend.tokenTypes[e];const r=[];if(s){let e=t;for(let t=0;e>0&&t>=1;e>0&&this._logService.getLevel()===dh.Trace&&(this._logService.trace(`SemanticTokensProviderStyling: unknown token modifier index: ${t.toString(2)} for legend: ${JSON.stringify(this._legend.tokenModifiers)}`),r.push("not-in-legend"));const n=this._themeService.getColorTheme().getTokenStyleMetadata(s,r,i);if(void 0===n)o=2147483647;else{if(o=0,void 0!==n.italic){o|=1|(n.italic?1:0)<<11}if(void 0!==n.bold){o|=2|(n.bold?2:0)<<11}if(void 0!==n.underline){o|=4|(n.underline?4:0)<<11}if(void 0!==n.strikethrough){o|=8|(n.strikethrough?8:0)<<11}if(n.foreground){o|=16|n.foreground<<15}0===o&&(o=2147483647)}}else this._logService.getLevel()===dh.Trace&&this._logService.trace(`SemanticTokensProviderStyling: unknown token type index: ${e} for legend: ${JSON.stringify(this._legend.tokenTypes)}`),o=2147483647,s="not-in-legend";this._hashTable.add(e,t,n,o),this._logService.getLevel()===dh.Trace&&this._logService.trace(`SemanticTokensProviderStyling ${e} (${s}) / ${t} (${r.join(" ")}): foreground ${Gg.getForeground(o)}, fontStyle ${Gg.getFontStyle(o).toString(2)}`)}return o}warnOverlappingSemanticTokens(e,t){this._hasWarnedOverlappingTokens||(this._hasWarnedOverlappingTokens=!0,console.warn(`Overlapping semantic tokens detected at lineNumber ${e}, column ${t}`))}warnInvalidLengthSemanticTokens(e,t){this._hasWarnedInvalidLengthTokens||(this._hasWarnedInvalidLengthTokens=!0,console.warn(`Semantic token with invalid length detected at lineNumber ${e}, column ${t}`))}warnInvalidEditStart(e,t,i,n,s){this._hasWarnedInvalidEditStart||(this._hasWarnedInvalidEditStart=!0,console.warn(`Invalid semantic tokens edit detected (previousResultId: ${e}, resultId: ${t}) at edit #${i}: The provided start offset ${n} is outside the previous data (length ${s}).`))}};function B6(e,t,i){const n=e.data,s=e.data.length/5|0,o=Math.max(Math.ceil(s/1024),400),r=[];let a=0,l=1,h=0;for(;ae&&0===n[5*t];)t--;if(t-1===e){let e=d;for(;e+1d)t.warnOverlappingSemanticTokens(r,d+1);else{const e=t.getMetadata(_,v,i);2147483647!==e&&(0===g&&(g=r),c[u]=r-g,c[u+1]=d,c[u+2]=f,c[u+3]=e,u+=4,p=r,m=f)}l=r,h=d,a++}u!==c.length&&(c=c.subarray(0,u));const f=T6.create(g,c);r.push(f)}return r}F6=O6([P6(1,P_),P6(2,Lc),P6(3,hh)],F6);class W6{constructor(e,t,i,n){this.tokenTypeIndex=e,this.tokenModifierSet=t,this.languageId=i,this.metadata=n,this.next=null}}class V6{constructor(){this._elementsCount=0,this._currentLengthIndex=0,this._currentLength=V6._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+1=this._growCount){const e=this._elements;this._currentLengthIndex++,this._currentLength=V6._SIZES[this._currentLengthIndex],this._growCount=Math.round(this._currentLengthIndex+10?i[0]:[]}(e,t),r=yield Promise.all(o.map((e=>z6(this,void 0,void 0,(function*(){let o,r=null;try{o=yield e.provideDocumentSemanticTokens(t,e===i?n:null,s)}catch(a){r=a,o=null}return o&&(U6(o)||K6(o))||(o=null),new j6(e,o,r)})))));for(const e of r){if(e.error)throw e.error;if(e.tokens)return e}return r.length>0?r[0]:null}))}class G6{constructor(e,t){this.provider=e,this.tokens=t}}function Z6(e,t){const i=e.orderedGroups(t);return i.length>0?i[0]:[]}function Y6(e,t,i,n){return z6(this,void 0,void 0,(function*(){const s=Z6(e,t),o=yield Promise.all(s.map((e=>z6(this,void 0,void 0,(function*(){let s;try{s=yield e.provideDocumentRangeSemanticTokens(t,i,n)}catch(o){a(o),s=null}return s&&U6(s)||(s=null),new G6(e,s)})))));for(const e of o)if(e.tokens)return e;return o.length>0?o[0]:null}))}Xa.registerCommand("_provideDocumentSemanticTokensLegend",((e,...t)=>z6(void 0,void 0,void 0,(function*(){const[i]=t;qr(i instanceof an);const n=e.get(Ha).getModel(i);if(!n)return;const{documentSemanticTokensProvider:s}=e.get(oL),o=function(e,t){const i=e.orderedGroups(t);return i.length>0?i[0]:null}(s,n);return o?o[0].getLegend():e.get(Ya).executeCommand("_provideDocumentRangeSemanticTokensLegend",i)})))),Xa.registerCommand("_provideDocumentSemanticTokens",((e,...t)=>z6(void 0,void 0,void 0,(function*(){const[i]=t;qr(i instanceof an);const n=e.get(Ha).getModel(i);if(!n)return;const{documentSemanticTokensProvider:s}=e.get(oL);if(!q6(s,n))return e.get(Ya).executeCommand("_provideDocumentRangeSemanticTokens",i,n.getFullModelRange());const o=yield $6(s,n,null,null,Uh.None);if(!o)return;const{provider:r,tokens:a}=o;if(!a||!U6(a))return;const l=H6({id:0,type:"full",data:a.data});return a.resultId&&r.releaseDocumentSemanticTokens(a.resultId),l})))),Xa.registerCommand("_provideDocumentRangeSemanticTokensLegend",((e,...t)=>z6(void 0,void 0,void 0,(function*(){const[i,n]=t;qr(i instanceof an);const s=e.get(Ha).getModel(i);if(!s)return;const{documentRangeSemanticTokensProvider:o}=e.get(oL),r=Z6(o,s);if(0===r.length)return;if(1===r.length)return r[0].getLegend();if(!n||!Rh.isIRange(n))return console.warn("provideDocumentRangeSemanticTokensLegend might be out-of-sync with provideDocumentRangeSemanticTokens unless a range argument is passed in"),r[0].getLegend();const a=yield Y6(o,s,Rh.lift(n),Uh.None);return a?a.provider.getLegend():void 0})))),Xa.registerCommand("_provideDocumentRangeSemanticTokens",((e,...t)=>z6(void 0,void 0,void 0,(function*(){const[i,n]=t;qr(i instanceof an),qr(Rh.isIRange(n));const s=e.get(Ha).getModel(i);if(!s)return;const{documentRangeSemanticTokensProvider:o}=e.get(oL),r=yield Y6(o,s,Rh.lift(n),Uh.None);return r&&r.tokens?H6({id:0,type:"full",data:r.tokens.data}):void 0}))));const X6=Ba("semanticTokensStylingService"),Q6="editor.semanticHighlighting";function J6(e,t,i){var n;const s=null===(n=i.getValue(Q6,{overrideIdentifier:e.getLanguageId(),resource:e.uri}))||void 0===n?void 0:n.enabled;return"boolean"==typeof s?s:t.getColorTheme().semanticHighlighting}var e9,t9=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},i9=function(e,t){return function(i,n){t(i,n,e)}};let n9=class extends E{constructor(e,t,i,n,s,o){super(),this._watchers=Object.create(null);const r=t=>{this._watchers[t.uri.toString()]=new s9(t,e,i,s,o)},a=(e,t)=>{t.dispose(),delete this._watchers[e.uri.toString()]},l=()=>{for(const e of t.getModels()){const t=this._watchers[e.uri.toString()];J6(e,i,n)?t||r(e):t&&a(e,t)}};this._register(t.onModelAdded((e=>{J6(e,i,n)&&r(e)}))),this._register(t.onModelRemoved((e=>{const t=this._watchers[e.uri.toString()];t&&a(e,t)}))),this._register(n.onDidChangeConfiguration((e=>{e.affectsConfiguration(Q6)&&l()}))),this._register(i.onDidColorThemeChange(l))}dispose(){for(const e of Object.values(this._watchers))e.dispose();super.dispose()}};n9=t9([i9(0,X6),i9(1,Ha),i9(2,P_),i9(3,pu),i9(4,SE),i9(5,oL)],n9);let s9=e9=class extends E{constructor(e,t,i,n,s){super(),this._semanticTokensStylingService=t,this._isDisposed=!1,this._model=e,this._provider=s.documentSemanticTokensProvider,this._debounceInformation=n.for(this._provider,"DocumentSemanticTokens",{min:e9.REQUEST_MIN_DELAY,max:e9.REQUEST_MAX_DELAY}),this._fetchDocumentSemanticTokens=this._register(new rd((()=>this._fetchDocumentSemanticTokensNow()),e9.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 o=()=>{k(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[];for(const t of this._provider.all(e))"function"==typeof t.onDidChange&&this._documentProvidersChangeListeners.push(t.onDidChange((()=>{this._currentDocumentRequestCancellationTokenSource?this._providersChangedDuringRequest=!0:this._fetchDocumentSemanticTokens.schedule(0)})))};o(),this._register(this._provider.onDidChange((()=>{o(),this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model))}))),this._register(i.onDidColorThemeChange((e=>{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),k(this._documentProvidersChangeListeners),this._documentProvidersChangeListeners=[],this._setDocumentSemanticTokens(null,null,null,[]),this._isDisposed=!0,super.dispose()}_fetchDocumentSemanticTokensNow(){if(this._currentDocumentRequestCancellationTokenSource)return;if(!q6(this._provider,this._model))return void(this._currentDocumentResponse&&this._model.tokenization.setSemanticTokens(null,!1));if(!this._model.isAttachedToEditor())return;const e=new jh,t=this._currentDocumentResponse?this._currentDocumentResponse.provider:null,i=this._currentDocumentResponse&&this._currentDocumentResponse.resultId||null,n=$6(this._provider,this._model,t,i,e.token);this._currentDocumentRequestCancellationTokenSource=e,this._providersChangedDuringRequest=!1;const s=[],o=this._model.onDidChangeContent((e=>{s.push(e)})),a=new F(!1);n.then((e=>{if(this._debounceInformation.update(this._model,a.elapsed()),this._currentDocumentRequestCancellationTokenSource=null,o.dispose(),e){const{provider:t,tokens:i}=e,n=this._semanticTokensStylingService.getStyling(t);this._setDocumentSemanticTokens(t,i||null,n,s)}else this._setDocumentSemanticTokens(null,null,null,s)}),(e=>{e&&(d(e)||"string"==typeof e.message&&-1!==e.message.indexOf("busy"))||r(e),this._currentDocumentRequestCancellationTokenSource=null,o.dispose(),(s.length>0||this._providersChangedDuringRequest)&&(this._fetchDocumentSemanticTokens.isScheduled()||this._fetchDocumentSemanticTokens.schedule(this._debounceInformation.get(this._model)))}))}static _copy(e,t,i,n,s){s=Math.min(s,i.length-n,e.length-t);for(let o=0;o{(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);else if(e&&i){if(!t)return this._model.tokenization.setSemanticTokens(null,!0),void o();if(K6(t)){if(!s)return void this._model.tokenization.setSemanticTokens(null,!0);if(0===t.edits.length)t={resultId:t.resultId,data:s.data};else{let e=0;for(const i of t.edits)e+=(i.data?i.data.length:0)-i.deleteCount;const n=s.data,o=new Uint32Array(n.length+e);let r=n.length,a=o.length;for(let l=t.edits.length-1;l>=0;l--){const e=t.edits[l];if(e.start>n.length)return i.warnInvalidEditStart(s.resultId,t.resultId,l,e.start,n.length),void this._model.tokenization.setSemanticTokens(null,!0);const h=r-(e.start+e.deleteCount);h>0&&(e9._copy(n,r-h,o,a-h,h),a-=h),e.data&&(e9._copy(e.data,0,o,a-e.data.length,e.data.length),a-=e.data.length),r=e.start}r>0&&e9._copy(n,0,o,0,r),t={resultId:t.resultId,data:o}}}if(U6(t)){this._currentDocumentResponse=new o9(e,t.resultId,t.data);const s=B6(t,i,this._model.getLanguageId());if(n.length>0)for(const e of n)for(const t of s)for(const i of e.changes)t.applyEdit(i.range,i.text);this._model.tokenization.setSemanticTokens(s,!0)}else this._model.tokenization.setSemanticTokens(null,!0);o()}else this._model.tokenization.setSemanticTokens(null,!1)}};s9.REQUEST_MIN_DELAY=300,s9.REQUEST_MAX_DELAY=2e3,s9=e9=t9([i9(1,X6),i9(2,P_),i9(3,SE),i9(4,oL)],s9);class o9{constructor(e,t,i){this.provider=e,this.resultId=t,this.data=i}dispose(){this.provider.releaseDocumentSemanticTokens(this.resultId)}}ET(n9);var r9=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},a9=function(e,t){return function(i,n){t(i,n,e)}};let l9=class extends E{constructor(e,t,i,n,s,o){super(),this._semanticTokensStylingService=t,this._themeService=i,this._configurationService=n,this._editor=e,this._provider=o.documentRangeSemanticTokensProvider,this._debounceInformation=s.for(this._provider,"DocumentRangeSemanticTokens",{min:100,max:500}),this._tokenizeViewport=this._register(new rd((()=>this._tokenizeViewportNow()),100)),this._outstandingRequests=[];const r=()=>{this._editor.hasModel()&&this._tokenizeViewport.schedule(this._debounceInformation.get(this._editor.getModel()))};this._register(this._editor.onDidScrollChange((()=>{r()}))),this._register(this._editor.onDidChangeModel((()=>{this._cancelAll(),r()}))),this._register(this._editor.onDidChangeModelContent((e=>{this._cancelAll(),r()}))),this._register(this._provider.onDidChange((()=>{this._cancelAll(),r()}))),this._register(this._configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration(Q6)&&(this._cancelAll(),r())}))),this._register(this._themeService.onDidColorThemeChange((()=>{this._cancelAll(),r()}))),r()}_cancelAll(){for(const e of this._outstandingRequests)e.cancel();this._outstandingRequests=[]}_removeOutstandingRequest(e){for(let t=0,i=this._outstandingRequests.length;tthis._requestRange(e,t))))}_requestRange(e,t){const i=e.getVersionId(),n=Yh((i=>Promise.resolve(Y6(this._provider,e,t,i)))),s=new F(!1);return n.then((n=>{if(this._debounceInformation.update(e,s.elapsed()),!n||!n.tokens||e.isDisposed()||e.getVersionId()!==i)return;const{provider:o,tokens:r}=n,a=this._semanticTokensStylingService.getStyling(o);e.tokenization.setPartialSemanticTokens(t,B6(r,a,e.getLanguageId()))})).then((()=>this._removeOutstandingRequest(n)),(()=>this._removeOutstandingRequest(n))),n}};l9.ID="editor.contrib.viewportSemanticTokens",l9=r9([a9(1,X6),a9(2,P_),a9(3,pu),a9(4,SE),a9(5,oL)],l9),Dh(l9.ID,l9,1);class h9{constructor(e=!0){this.selectSubwords=e}provideSelectionRanges(e,t){const i=[];for(const n of t){const t=[];i.push(t),this.selectSubwords&&this._addInWordRanges(t,e,n),this._addWordRanges(t,e,n),this._addWhitespaceLine(t,e,n),t.push({range:e.getFullModelRange()})}return i}_addInWordRanges(e,t,i){const n=t.getWordAtPosition(i);if(!n)return;const{word:s,startColumn:o}=n,r=i.column-o;let a=r,l=r,h=0;for(;a>=0;a--){const e=s.charCodeAt(a);if(a!==r&&(95===e||45===e))break;if(mo(e)&&fo(h))break;h=e}for(a+=1;l0&&0===t.getLineFirstNonWhitespaceColumn(i.lineNumber)&&0===t.getLineLastNonWhitespaceColumn(i.lineNumber)&&e.push({range:new Rh(i.lineNumber,1,i.lineNumber,t.getLineMaxColumn(i.lineNumber))})}}var d9,c9=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},u9=function(e,t){return function(i,n){t(i,n,e)}},g9=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class p9{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 p9(t,this.ranges);return i.ranges[t].equalsRange(this.ranges[this.index])?i.mov(e):i}}let m9=d9=class{static get(e){return e.getContribution(d9.ID)}constructor(e,t){this._editor=e,this._languageFeaturesService=t,this._ignoreSelection=!1}dispose(){var e;null===(e=this._selectionListener)||void 0===e||e.dispose()}run(e){return g9(this,void 0,void 0,(function*(){if(!this._editor.hasModel())return;const t=this._editor.getSelections(),i=this._editor.getModel();if(this._state||(yield _9(this._languageFeaturesService.selectionRangeProvider,i,t.map((e=>e.getPosition())),this._editor.getOption(112),Uh.None).then((e=>{var i;if(Hd(e)&&e.length===t.length&&this._editor.hasModel()&&Td(this._editor.getSelections(),t,((e,t)=>e.equalsSelection(t)))){for(let i=0;ie.containsPosition(t[i].getStartPosition())&&e.containsPosition(t[i].getEndPosition()))),e[i].unshift(t[i]);this._state=e.map((e=>new p9(0,e))),null===(i=this._selectionListener)||void 0===i||i.dispose(),this._selectionListener=this._editor.onDidChangeCursorPosition((()=>{var e;this._ignoreSelection||(null===(e=this._selectionListener)||void 0===e||e.dispose(),this._state=void 0)}))}}))),!this._state)return;this._state=this._state.map((t=>t.mov(e)));const n=this._state.map((e=>Ah.fromPositions(e.ranges[e.index].getStartPosition(),e.ranges[e.index].getEndPosition())));this._ignoreSelection=!0;try{this._editor.setSelections(n)}finally{this._ignoreSelection=!1}}))}};m9.ID="editor.contrib.smartSelectController",m9=d9=c9([u9(1,oL)],m9);class f9 extends bh{constructor(e,t){super(t),this._forward=e}run(e,t){return g9(this,void 0,void 0,(function*(){const e=m9.get(t);e&&(yield e.run(this._forward))}))}}Xa.registerCommandAlias("editor.action.smartSelect.grow","editor.action.smartSelect.expand");function _9(e,t,i,n,s){return g9(this,void 0,void 0,(function*(){const o=e.all(t).concat(new h9(n.selectSubwords));1===o.length&&o.unshift(new R2);const r=[],l=[];for(const e of o)r.push(Promise.resolve(e.provideSelectionRanges(t,i,s)).then((e=>{if(Hd(e)&&e.length===i.length)for(let t=0;t{if(0===e.length)return[];e.sort(((e,t)=>Va.isBefore(e.getStartPosition(),t.getStartPosition())?1:Va.isBefore(t.getStartPosition(),e.getStartPosition())||Va.isBefore(e.getEndPosition(),t.getEndPosition())?-1:Va.isBefore(t.getEndPosition(),e.getEndPosition())?1:0));const i=[];let s;for(const t of e)(!s||Rh.containsRange(t,s)&&!Rh.equalsRange(t,s))&&(i.push(t),s=t);if(!n.selectLeadingAndTrailingWhitespace)return i;const o=[i[0]];for(let n=1;ne}),y9="data-sticky-line-index",S9="data-sticky-is-line",L9="data-sticky-is-folding-icon";class k9 extends E{constructor(e){super(),this._editor=e,this._foldingIconStore=new N,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(66),this._stickyLines=[],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 pW),this._rootDomNode.appendChild(this._lineNumbersDomNode),this._rootDomNode.appendChild(this._linesDomNodeScrollable);const t=()=>{this._linesDomNode.style.left=this._editor.getOption(114).scrollWithEditor?`-${this._editor.getScrollLeft()}px`:"0px"};this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(114)&&t(),e.hasChanged(66)&&(this._lineHeight=this._editor.getOption(66))}))),this._register(this._editor.onDidScrollChange((e=>{e.scrollLeftChanged&&t(),e.scrollWidthChanged&&this._updateWidgetWidth()}))),this._register(this._editor.onDidChangeModel((()=>{t(),this._updateWidgetWidth()}))),this._register(this._foldingIconStore),t(),this._register(this._editor.onDidLayoutChange((e=>{this._updateWidgetWidth()}))),this._updateWidgetWidth()}get lineNumbers(){return this._lineNumbers}get lineNumberCount(){return this._lineNumbers.length}getStickyLineForLine(e){return this._stickyLines.find((t=>t.lineNumber===e))}getCurrentLines(){return this._lineNumbers}setState(e,t,i=1/0){if((!this._previousState&&!e||this._previousState&&this._previousState.equals(e))&&i===1/0)return;this._previousState=e;const n=this._stickyLines;if(this._clearStickyWidget(),!e||!this._editor._getViewModel())return;if(e.startLineNumbers.length*this._lineHeight+e.lastLineRelativePosition>0){this._lastLineRelativePosition=e.lastLineRelativePosition;const t=[...e.startLineNumbers];null!==e.showEndForLine&&(t[e.showEndForLine]=e.endLineNumbers[e.showEndForLine]),this._lineNumbers=t}else this._lastLineRelativePosition=0,this._lineNumbers=[];this._renderRootNode(n,t,i)}_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"}_clearStickyWidget(){this._stickyLines=[],this._foldingIconStore.clear(),Dn(this._lineNumbersDomNode),Dn(this._linesDomNode),this._rootDomNode.style.display="none"}_useFoldingOpacityTransition(e){this._lineNumbersDomNode.style.setProperty("--vscode-editorStickyScroll-foldingOpacityTransition",`opacity ${e?.5:0}s`)}_setFoldingIconsVisibility(e){for(const t of this._stickyLines){const i=t.foldingIcon;i&&i.setVisible(!!e||i.isCollapsed)}}_renderRootNode(e,t,i=1/0){return b9(this,void 0,void 0,(function*(){const n=this._editor.getLayoutInfo();for(const[o,r]of this._lineNumbers.entries()){const s=e[o],a=r>=i||(null==s?void 0:s.lineNumber)!==r?this._renderChildNode(o,r,t,n):this._updateTopAndZIndexOfStickyLine(s);a&&(this._linesDomNode.appendChild(a.lineDomNode),this._lineNumbersDomNode.appendChild(a.lineNumberDomNode),this._stickyLines.push(a))}t&&(this._setFoldingHoverListeners(),this._useFoldingOpacityTransition(!this._isOnGlyphMargin));const s=this._lineNumbers.length*this._lineHeight+this._lastLineRelativePosition;0!==s?(this._rootDomNode.style.display="block",this._lineNumbersDomNode.style.height=`${s}px`,this._linesDomNodeScrollable.style.height=`${s}px`,this._rootDomNode.style.height=`${s}px`,this._rootDomNode.style.marginLeft="0px",this._updateMinContentWidth(),this._editor.layoutOverlayWidget(this)):this._clearStickyWidget()}))}_setFoldingHoverListeners(){"mouseover"===this._editor.getOption(109)&&(this._foldingIconStore.add(En(this._lineNumbersDomNode,os.MOUSE_ENTER,(e=>{this._isOnGlyphMargin=!0,this._setFoldingIconsVisibility(!0)}))),this._foldingIconStore.add(En(this._lineNumbersDomNode,os.MOUSE_LEAVE,(()=>{this._isOnGlyphMargin=!1,this._useFoldingOpacityTransition(!0),this._setFoldingIconsVisibility(!1)}))))}_renderChildNode(e,t,i,n){const s=this._editor._getViewModel();if(!s)return;const o=s.coordinatesConverter.convertModelPositionToViewPosition(new Va(t,1)).lineNumber,r=s.getViewLineRenderingData(o),a=this._editor.getOption(67);let l;try{l=bA.filter(r.inlineDecorations,o,r.minColumn,r.maxColumn)}catch(b){l=[]}const h=new kA(!0,!0,r.content,r.continuesWithWrappedLine,r.isBasicASCII,r.containsRTL,0,r.tokens,l,r.tabSize,r.startVisibleColumn,1,1,1,500,"none",!0,!0,null),d=new eu(2e3),c=EA(h,d);let u;u=w9?w9.createHTML(d.build()):d.build();const g=document.createElement("span");g.setAttribute(y9,String(e)),g.setAttribute(S9,""),g.setAttribute("role","listitem"),g.tabIndex=0,g.className="sticky-line-content",g.classList.add(`stickyLine${t}`),g.style.lineHeight=`${this._lineHeight}px`,g.innerHTML=u;const p=document.createElement("span");p.setAttribute(y9,String(e)),p.setAttribute("data-sticky-is-line-number",""),p.className="sticky-line-number",p.style.lineHeight=`${this._lineHeight}px`;const m=n.contentLeft;p.style.width=`${m}px`;const f=document.createElement("span");1===a.renderType||3===a.renderType&&t%10==0?f.innerText=t.toString():2===a.renderType&&(f.innerText=Math.abs(t-this._editor.getPosition().lineNumber).toString()),f.className="sticky-line-number-inner",f.style.lineHeight=`${this._lineHeight}px`,f.style.width=`${n.lineNumbersWidth}px`,f.style.paddingLeft=`${n.lineNumbersLeft}px`,p.appendChild(f);const _=this._renderFoldingIconForLine(i,t);_&&p.appendChild(_.domNode),this._editor.applyFontInfo(g),this._editor.applyFontInfo(f),p.style.lineHeight=`${this._lineHeight}px`,g.style.lineHeight=`${this._lineHeight}px`,p.style.height=`${this._lineHeight}px`,g.style.height=`${this._lineHeight}px`;const v=new D9(e,t,g,p,_,c.characterMapping);return this._updateTopAndZIndexOfStickyLine(v)}_updateTopAndZIndexOfStickyLine(e){var t;const i=e.index,n=e.lineDomNode,s=e.lineNumberDomNode,o=i===this._lineNumbers.length-1;n.style.zIndex=o?"0":"1",s.style.zIndex=o?"0":"1";const r=`${i*this._lineHeight+this._lastLineRelativePosition+((null===(t=e.foldingIcon)||void 0===t?void 0:t.isCollapsed)?1:0)}px`,a=i*this._lineHeight+"px";return n.style.top=o?r:a,s.style.top=o?r:a,e}_renderFoldingIconForLine(e,t){const i=this._editor.getOption(109);if(!e||"never"===i)return;const n=e.regions,s=n.findRange(t),o=n.getStartLineNumber(s);if(!(t===o))return;const r=n.isCollapsed(s),a=new x9(r,o,n.getEndLineNumber(s),this._lineHeight);return a.setVisible(!!this._isOnGlyphMargin||(r||"always"===i)),a.domNode.setAttribute(L9,""),a}_updateMinContentWidth(){this._minContentWidthInPx=0;for(const e of this._stickyLines)e.lineDomNode.scrollWidth>this._minContentWidthInPx&&(this._minContentWidthInPx=e.lineDomNode.scrollWidth);this._minContentWidthInPx+=this._editor.getLayoutInfo().verticalScrollbarWidth}getId(){return"editor.contrib.stickyScrollWidget"}getDomNode(){return this._rootDomNode}getPosition(){return{preference:null}}getMinContentWidthInPx(){return this._minContentWidthInPx}focusLineWithIndex(e){0<=e&&e0)return null;const t=this._getRenderedStickyLineFromChildDomNode(e);if(!t)return null;const i=jA(t.characterMapping,e,0);return new Va(t.lineNumber,i)}getLineNumberFromChildDomNode(e){var t,i;return null!==(i=null===(t=this._getRenderedStickyLineFromChildDomNode(e))||void 0===t?void 0:t.lineNumber)&&void 0!==i?i:null}_getRenderedStickyLineFromChildDomNode(e){const t=this.getLineIndexFromChildDomNode(e);return null===t||t<0||t>=this._stickyLines.length?null:this._stickyLines[t]}getLineIndexFromChildDomNode(e){const t=this._getAttributeValue(e,y9);return t?parseInt(t,10):null}isInStickyLine(e){return void 0!==this._getAttributeValue(e,S9)}isInFoldingIconDomNode(e){return void 0!==this._getAttributeValue(e,L9)}_getAttributeValue(e,t){for(;e&&e!==this._rootDomNode;){const i=e.getAttribute(t);if(null!==i)return i;e=e.parentElement}}}class D9{constructor(e,t,i,n,s,o){this.index=e,this.lineNumber=t,this.lineDomNode=i,this.lineNumberDomNode=n,this.foldingIcon=s,this.characterMapping=o}}class x9{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=ta.asClassName(e?qQ:jQ)}setVisible(e){this.domNode.style.cursor=e?"pointer":"default",this.domNode.style.opacity=e?"1":"0"}}class N9{constructor(e,t){this.startLineNumber=e,this.endLineNumber=t}}class E9{constructor(e,t,i){this.range=e,this.children=t,this.parent=i}}class I9{constructor(e,t,i,n){this.uri=e,this.version=t,this.element=i,this.outlineProviderId=n}}var M9,T9,R9=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},A9=function(e,t){return function(i,n){t(i,n,e)}},O9=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};!function(e){e.OUTLINE_MODEL="outlineModel",e.FOLDING_PROVIDER_MODEL="foldingProviderModel",e.INDENTATION_MODEL="indentationModel"}(M9||(M9={})),function(e){e[e.VALID=0]="VALID",e[e.INVALID=1]="INVALID",e[e.CANCELED=2]="CANCELED"}(T9||(T9={}));let P9=class extends E{constructor(e,t,i,n){super(),this._editor=e,this._languageConfigurationService=t,this._languageFeaturesService=i,this._modelProviders=[],this._modelPromise=null,this._updateScheduler=this._register(new Jh(300)),this._updateOperation=this._register(new N);const s=new B9(i),o=new H9(this._editor,i),r=new V9(this._editor,t);switch(n){case M9.OUTLINE_MODEL:this._modelProviders.push(s),this._modelProviders.push(o),this._modelProviders.push(r);break;case M9.FOLDING_PROVIDER_MODEL:this._modelProviders.push(o),this._modelProviders.push(r);break;case M9.INDENTATION_MODEL:this._modelProviders.push(r)}}_cancelModelPromise(){this._modelPromise&&(this._modelPromise.cancel(),this._modelPromise=null)}update(e,t,i){return O9(this,void 0,void 0,(function*(){return this._updateOperation.clear(),this._updateOperation.add({dispose:()=>{this._cancelModelPromise(),this._updateScheduler.cancel()}}),this._cancelModelPromise(),yield this._updateScheduler.trigger((()=>O9(this,void 0,void 0,(function*(){for(const n of this._modelProviders){const{statusPromise:s,modelPromise:o}=n.computeStickyModel(e,t,i);this._modelPromise=o;const r=yield s;if(this._modelPromise!==o)return null;switch(r){case T9.CANCELED:return this._updateOperation.clear(),null;case T9.VALID:return n.stickyModel}}return null})))).catch((e=>(r(e),null)))}))}};P9=R9([A9(1,Ju),A9(2,oL)],P9);class F9{constructor(){this._stickyModel=null}get stickyModel(){return this._stickyModel}_invalid(){return this._stickyModel=null,T9.INVALID}computeStickyModel(e,t,i){if(i.isCancellationRequested||!this.isProviderValid(e))return{statusPromise:this._invalid(),modelPromise:null};const n=Yh((i=>this.createModelFromProvider(e,t,i)));return{statusPromise:n.then((n=>this.isModelValid(n)?i.isCancellationRequested?T9.CANCELED:(this._stickyModel=this.createStickyModel(e,t,i,n),T9.VALID):this._invalid())).then(void 0,(e=>(r(e),T9.CANCELED))),modelPromise:n}}isModelValid(e){return!0}isProviderValid(e){return!0}}let B9=class extends F9{constructor(e){super(),this._languageFeaturesService=e}createModelFromProvider(e,t,i){return LZ.create(this._languageFeaturesService.documentSymbolProvider,e,i)}createStickyModel(e,t,i,n){var s;const{stickyOutlineElement:o,providerID:r}=this._stickyModelFromOutlineModel(n,null===(s=this._stickyModel)||void 0===s?void 0:s.outlineProviderId);return new I9(e.uri,t,o,r)}isModelValid(e){return e&&e.children.size>0}_stickyModelFromOutlineModel(e,t){let i;if(v.first(e.children.values())instanceof SZ){const n=v.find(e.children.values(),(e=>e.id===t));if(n)i=n.children;else{let n,s="",o=-1;for(const[t,i]of e.children.entries()){const e=this._findSumOfRangesOfGroup(i);e>o&&(n=i,o=e,s=i.id)}t=s,i=n.children}}else i=e.children;const n=[],s=Array.from(i.values()).sort(((e,t)=>{const i=new N9(e.symbol.range.startLineNumber,e.symbol.range.endLineNumber),n=new N9(t.symbol.range.startLineNumber,t.symbol.range.endLineNumber);return this._comparator(i,n)}));for(const o of s)n.push(this._stickyModelFromOutlineElement(o,o.symbol.selectionRange.startLineNumber));return{stickyOutlineElement:new E9(void 0,n,void 0),providerID:t}}_stickyModelFromOutlineElement(e,t){const i=[];for(const s of e.children.values())if(s.symbol.selectionRange.startLineNumber!==s.symbol.range.endLineNumber)if(s.symbol.selectionRange.startLineNumber!==t)i.push(this._stickyModelFromOutlineElement(s,s.symbol.selectionRange.startLineNumber));else for(const e of s.children.values())i.push(this._stickyModelFromOutlineElement(e,s.symbol.selectionRange.startLineNumber));i.sort(((e,t)=>this._comparator(e.range,t.range)));const n=new N9(e.symbol.selectionRange.startLineNumber,e.symbol.range.endLineNumber);return new E9(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 yZ?t+e.symbol.range.endLineNumber-e.symbol.selectionRange.startLineNumber:t}};B9=R9([A9(0,oL)],B9);class W9 extends F9{constructor(e){super(),this._foldingLimitReporter=new rJ(e)}createStickyModel(e,t,i,n){const s=this._fromFoldingRegions(n);return new I9(e.uri,t,s,void 0)}isModelValid(e){return null!==e}_fromFoldingRegions(e){const t=e.length,i=[],n=new E9(void 0,[],void 0);for(let s=0;s0}createModelFromProvider(e,t,i){const n=oJ.getFoldingRangeProviders(this._languageFeaturesService,e);return new QQ(e,n,(()=>this.createModelFromProvider(e,t,i)),this._foldingLimitReporter,void 0).compute(i)}};H9=R9([A9(1,oL)],H9);var z9=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},U9=function(e,t){return function(i,n){t(i,n,e)}},K9=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class j9{constructor(e,t,i){this.startLineNumber=e,this.endLineNumber=t,this.nestingDepth=i}}let q9=class extends E{constructor(e,t,i){super(),this._languageFeaturesService=t,this._languageConfigurationService=i,this._onDidChangeStickyScroll=this._register(new U),this.onDidChangeStickyScroll=this._onDidChangeStickyScroll.event,this._options=null,this._model=null,this._cts=null,this._stickyModelProvider=null,this._editor=e,this._sessionStore=this._register(new N),this._updateSoon=this._register(new rd((()=>this.update()),50)),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(114)&&this.readConfiguration()}))),this.readConfiguration()}readConfiguration(){this._stickyModelProvider=null,this._sessionStore.clear(),this._options=this._editor.getOption(114),this._options.enabled&&(this._stickyModelProvider=this._sessionStore.add(new P9(this._editor,this._languageConfigurationService,this._languageFeaturesService,this._options.defaultModel)),this._sessionStore.add(this._editor.onDidChangeModel((()=>{this._model=null,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.update())}getVersionId(){var e;return null===(e=this._model)||void 0===e?void 0:e.version}update(){var e;return K9(this,void 0,void 0,(function*(){null===(e=this._cts)||void 0===e||e.dispose(!0),this._cts=new jh,yield this.updateStickyModel(this._cts.token),this._onDidChangeStickyScroll.fire()}))}updateStickyModel(e){return K9(this,void 0,void 0,(function*(){if(!this._editor.hasModel()||!this._stickyModelProvider||this._editor.getModel().isTooLargeForTokenization())return void(this._model=null);const t=this._editor.getModel(),i=t.getVersionId(),n=yield this._stickyModelProvider.update(t,i,e);e.isCancellationRequested||(this._model=n)}))}updateIndex(e){return-1===e?e=0:e<0&&(e=-e-2),e}getCandidateStickyLinesIntersectingFromStickyModel(e,t,i,n,s){if(0===t.children.length)return;let o=s;const r=[];for(let h=0;he-t))),l=this.updateIndex(Rd(r,e.startLineNumber+n,((e,t)=>e-t)));for(let h=a;h<=l;h++){const r=t.children[h];if(!r)return;if(r.range){const t=r.range.startLineNumber,s=r.range.endLineNumber;e.startLineNumber<=s+1&&t-1<=e.endLineNumber&&t!==o&&(o=t,i.push(new j9(t,s-1,n+1)),this.getCandidateStickyLinesIntersectingFromStickyModel(e,r,i,n+1,t))}else this.getCandidateStickyLinesIntersectingFromStickyModel(e,r,i,n,s)}}getCandidateStickyLinesIntersecting(e){var t,i;if(!(null===(t=this._model)||void 0===t?void 0:t.element))return[];let n=[];this.getCandidateStickyLinesIntersectingFromStickyModel(e,this._model.element,n,0,-1);const s=null===(i=this._editor._getViewModel())||void 0===i?void 0:i.getHiddenAreas();if(s)for(const o of s)n=n.filter((e=>!(e.startLineNumber>=o.startLineNumber&&e.endLineNumber<=o.endLineNumber+1)));return n}};q9=z9([U9(1,oL),U9(2,Ju)],q9);var $9,G9=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Z9=function(e,t){return function(i,n){t(i,n,e)}},Y9=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let X9=$9=class extends E{constructor(e,t,i,n,s,o,r){super(),this._editor=e,this._contextMenuService=t,this._languageFeaturesService=i,this._instaService=n,this._contextKeyService=r,this._sessionStore=new N,this._foldingModel=null,this._maxStickyLines=Number.MAX_SAFE_INTEGER,this._candidateDefinitionsLength=-1,this._focusedStickyElementIndex=-1,this._enabled=!1,this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1,this._endLineNumbers=[],this._showEndForLine=null,this._stickyScrollWidget=new k9(this._editor),this._stickyLineCandidateProvider=new q9(this._editor,i,s),this._register(this._stickyScrollWidget),this._register(this._stickyLineCandidateProvider),this._widgetState=new C9([],[],0),this._readConfiguration();const a=this._stickyScrollWidget.getDomNode();this._register(this._editor.onDidChangeConfiguration((e=>{(e.hasChanged(114)||e.hasChanged(72)||e.hasChanged(66)||e.hasChanged(109))&&this._readConfiguration()}))),this._register(En(a,os.CONTEXT_MENU,(e=>Y9(this,void 0,void 0,(function*(){this._onContextMenu(e)}))))),this._stickyScrollFocusedContextKey=Oh.stickyScrollFocused.bindTo(this._contextKeyService),this._stickyScrollVisibleContextKey=Oh.stickyScrollVisible.bindTo(this._contextKeyService);const l=this._register(hs(a));this._register(l.onDidBlur((e=>{!1===this._positionRevealed&&0===a.clientHeight?(this._focusedStickyElementIndex=-1,this.focus()):this._disposeFocusStickyScrollStore()}))),this._register(l.onDidFocus((e=>{this.focus()}))),this._registerMouseListeners(),this._register(En(a,os.MOUSE_DOWN,(e=>{this._onMouseDown=!0})))}static get(e){return e.getContribution($9.ID)}_disposeFocusStickyScrollStore(){var e;this._stickyScrollFocusedContextKey.set(!1),null===(e=this._focusDisposableStore)||void 0===e||e.dispose(),this._focused=!1,this._positionRevealed=!1,this._onMouseDown=!1}focus(){if(this._onMouseDown)return this._onMouseDown=!1,void this._editor.focus();!0!==this._stickyScrollFocusedContextKey.get()&&(this._focused=!0,this._focusDisposableStore=new N,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,0)))}_reveaInEditor(e,t){this._focused&&this._disposeFocusStickyScrollStore(),this._positionRevealed=!0,t(),this._editor.setSelection(Rh.fromPositions(e)),this._editor.focus()}_registerMouseListeners(){const e=this._register(new N),t=this._register(new RR(this._editor,{extractLineNumberFromMouseEvent:e=>{const t=this._stickyScrollWidget.getEditorPositionFromNode(e.target.element);return t?t.lineNumber:0}})),i=e=>{if(!this._editor.hasModel())return null;if(12!==e.target.type||e.target.detail!==this._stickyScrollWidget.getId())return null;const t=e.target.element;if(!t||t.innerText!==t.innerHTML)return null;const i=this._stickyScrollWidget.getEditorPositionFromNode(t);return i?{range:new Rh(i.lineNumber,i.column,i.lineNumber,i.column+t.innerText.length),textElement:t}:null},n=this._stickyScrollWidget.getDomNode();this._register(Mn(n,os.CLICK,(e=>{if(e.ctrlKey||e.altKey||e.metaKey)return;if(!e.leftButton)return;if(e.shiftKey){const t=this._stickyScrollWidget.getLineIndexFromChildDomNode(e.target);if(null===t)return;const i=new Va(this._endLineNumbers[t],1);return void this._revealLineInCenterIfOutsideViewport(i)}if(this._stickyScrollWidget.isInFoldingIconDomNode(e.target)){const t=this._stickyScrollWidget.getLineNumberFromChildDomNode(e.target);return void this._toggleFoldingRegionForLine(t)}if(!this._stickyScrollWidget.isInStickyLine(e.target))return;let t=this._stickyScrollWidget.getEditorPositionFromNode(e.target);if(!t){const i=this._stickyScrollWidget.getLineNumberFromChildDomNode(e.target);if(null===i)return;t=new Va(i,1)}this._revealPosition(t)}))),this._register(Mn(n,os.MOUSE_MOVE,(e=>{if(e.shiftKey){const t=this._stickyScrollWidget.getLineIndexFromChildDomNode(e.target);if(null===t||null!==this._showEndForLine&&this._showEndForLine===t)return;return this._showEndForLine=t,void this._renderStickyScroll()}null!==this._showEndForLine&&(this._showEndForLine=null,this._renderStickyScroll())}))),this._register(En(n,os.MOUSE_LEAVE,(e=>{null!==this._showEndForLine&&(this._showEndForLine=null,this._renderStickyScroll())}))),this._register(t.onMouseMoveOrRelevantKeyDown((([t,n])=>{const s=i(t);if(!s||!t.hasTriggerModifier||!this._editor.hasModel())return void e.clear();const{range:o,textElement:r}=s;if(o.equalsRange(this._stickyRangeProjectedOnEditor)){if("underline"===r.style.textDecoration)return}else this._stickyRangeProjectedOnEditor=o,e.clear();const a=new jh;let l;e.add(x((()=>a.dispose(!0)))),IU(this._languageFeaturesService.definitionProvider,this._editor.getModel(),new Va(o.startLineNumber,o.startColumn+1),a.token).then((t=>{if(!a.token.isCancellationRequested)if(0!==t.length){this._candidateDefinitionsLength=t.length;const i=r;l!==i?(e.clear(),l=i,l.style.textDecoration="underline",e.add(x((()=>{l.style.textDecoration="none"})))):l||(l=i,l.style.textDecoration="underline",e.add(x((()=>{l.style.textDecoration="none"}))))}else e.clear()}))}))),this._register(t.onCancel((()=>{e.clear()}))),this._register(t.onExecute((e=>Y9(this,void 0,void 0,(function*(){if(12!==e.target.type||e.target.detail!==this._stickyScrollWidget.getId())return;const t=this._stickyScrollWidget.getEditorPositionFromNode(e.target.element);t&&(this._candidateDefinitionsLength>1&&(this._focused&&this._disposeFocusStickyScrollStore(),this._revealPosition({lineNumber:t.lineNumber,column:1})),this._instaService.invokeFunction(C0,e,this._editor,{uri:this._editor.getModel().uri,range:this._stickyRangeProjectedOnEditor}))})))))}_onContextMenu(e){const t=new Nt(e);this._contextMenuService.showContextMenu({menuId:eh.StickyScrollContext,getAnchor:()=>t})}_toggleFoldingRegionForLine(e){if(!this._foldingModel||null===e)return;const t=this._stickyScrollWidget.getStickyLineForLine(e),i=null==t?void 0:t.foldingIcon;if(!i)return;RQ(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(66)*t.index+1;this._editor.setScrollTop(n),this._renderStickyScroll(e)}_readConfiguration(){const e=this._editor.getOption(114);if(!1===e.enabled)return this._editor.removeOverlayWidget(this._stickyScrollWidget),this._sessionStore.clear(),void(this._enabled=!1);e.enabled&&!this._enabled&&(this._editor.addOverlayWidget(this._stickyScrollWidget),this._sessionStore.add(this._editor.onDidScrollChange((e=>{e.scrollTopChanged&&(this._showEndForLine=null,this._renderStickyScroll())}))),this._sessionStore.add(this._editor.onDidLayoutChange((()=>this._onDidResize()))),this._sessionStore.add(this._editor.onDidChangeModelTokens((e=>this._onTokensChange(e)))),this._sessionStore.add(this._stickyLineCandidateProvider.onDidChangeStickyScroll((()=>{this._showEndForLine=null,this._renderStickyScroll()}))),this._enabled=!0);2===this._editor.getOption(67).renderType&&this._sessionStore.add(this._editor.onDidChangeCursorPosition((()=>{this._showEndForLine=null,this._renderStickyScroll()})))}_needsUpdate(e){const t=this._stickyScrollWidget.getCurrentLines();for(const i of t)for(const t of e.ranges)if(i>=t.fromLineNumber&&i<=t.toLineNumber)return!0;return!1}_onTokensChange(e){this._needsUpdate(e)&&this._renderStickyScroll(-1)}_onDidResize(){const e=this._editor.getLayoutInfo().height/this._editor.getOption(66);this._maxStickyLines=Math.round(.25*e)}_renderStickyScroll(e=1/0){var t,i;return Y9(this,void 0,void 0,(function*(){const n=this._editor.getModel();if(!n||n.isTooLargeForTokenization())return this._foldingModel=null,void this._stickyScrollWidget.setState(void 0,null,e);const s=this._stickyLineCandidateProvider.getVersionId();if(void 0===s||s===n.getVersionId())if(this._foldingModel=null!==(i=yield null===(t=oJ.get(this._editor))||void 0===t?void 0:t.getFoldingModel())&&void 0!==i?i:null,this._widgetState=this.findScrollWidgetState(),this._stickyScrollVisibleContextKey.set(!(0===this._widgetState.startLineNumbers.length)),this._focused)if(-1===this._focusedStickyElementIndex)this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1,-1!==this._focusedStickyElementIndex&&this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex);else{const t=this._stickyScrollWidget.lineNumbers[this._focusedStickyElementIndex];if(this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e),0===this._stickyScrollWidget.lineNumberCount)this._focusedStickyElementIndex=-1;else{this._stickyScrollWidget.lineNumbers.includes(t)||(this._focusedStickyElementIndex=this._stickyScrollWidget.lineNumberCount-1),this._stickyScrollWidget.focusLineWithIndex(this._focusedStickyElementIndex)}}else this._stickyScrollWidget.setState(this._widgetState,this._foldingModel,e)}))}findScrollWidgetState(){const e=this._editor.getOption(66),t=Math.min(this._maxStickyLines,this._editor.getOption(114).maxLineCount),i=this._editor.getScrollTop();let n=0;const s=[],o=[],r=this._editor.getVisibleRanges();if(0!==r.length){const a=new N9(r[0].startLineNumber,r[r.length-1].endLineNumber),l=this._stickyLineCandidateProvider.getCandidateStickyLinesIntersecting(a);for(const r of l){const a=r.startLineNumber,l=r.endLineNumber,h=r.nestingDepth;if(l-a>0){const r=(h-1)*e,d=h*e,c=this._editor.getBottomForLineNumber(a)-i,u=this._editor.getTopForLineNumber(l)-i,g=this._editor.getBottomForLineNumber(l)-i;if(r>u&&r<=g){s.push(a),o.push(l+1),n=g-d;break}if(d>c&&d<=g&&(s.push(a),o.push(l+1)),s.length===t)break}}}return this._endLineNumbers=o,new C9(s,o,n,this._showEndForLine)}dispose(){super.dispose(),this._sessionStore.dispose()}};X9.ID="store.contrib.stickyScrollController",X9=$9=G9([Z9(1,Kx),Z9(2,oL),Z9(3,Fa),Z9(4,Ju),Z9(5,SE),Z9(6,Ol)],X9);var Q9=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const J9=100;Dh(X9.ID,X9,1),ah(class extends rh{constructor(){super({id:"editor.action.toggleStickyScroll",title:{value:ue(0,"Toggle Sticky Scroll"),mnemonicTitle:ue(0,"&&Toggle Sticky Scroll"),original:"Toggle Sticky Scroll"},category:v9.View,toggled:{condition:pl.equals("config.editor.stickyScroll.enabled",!0),title:ue(0,"Sticky Scroll"),mnemonicTitle:ue(0,"&&Sticky Scroll")},menu:[{id:eh.CommandPalette},{id:eh.MenubarAppearanceMenu,group:"4_editor",order:3},{id:eh.StickyScrollContext}]})}run(e){return Q9(this,void 0,void 0,(function*(){const t=e.get(pu),i=!t.getValue("editor.stickyScroll.enabled");return t.updateValue("editor.stickyScroll.enabled",i)}))}}),ah(class extends wh{constructor(){super({id:"editor.action.focusStickyScroll",title:{value:ue(0,"Focus Sticky Scroll"),mnemonicTitle:ue(0,"&&Focus Sticky Scroll"),original:"Focus Sticky Scroll"},precondition:pl.and(pl.has("config.editor.stickyScroll.enabled"),Oh.stickyScrollVisible),menu:[{id:eh.CommandPalette}]})}runEditorCommand(e,t){var i;null===(i=X9.get(t))||void 0===i||i.focus()}}),ah(class extends wh{constructor(){super({id:"editor.action.selectPreviousStickyScrollLine",title:{value:ue(0,"Select previous sticky scroll line"),original:"Select previous sticky scroll line"},precondition:Oh.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:J9,primary:16}})}runEditorCommand(e,t){var i;null===(i=X9.get(t))||void 0===i||i.focusPrevious()}}),ah(class extends wh{constructor(){super({id:"editor.action.selectNextStickyScrollLine",title:{value:ue(0,"Select next sticky scroll line"),original:"Select next sticky scroll line"},precondition:Oh.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:J9,primary:18}})}runEditorCommand(e,t){var i;null===(i=X9.get(t))||void 0===i||i.focusNext()}}),ah(class extends wh{constructor(){super({id:"editor.action.goToFocusedStickyScrollLine",title:{value:ue(0,"Go to focused sticky scroll line"),original:"Go to focused sticky scroll line"},precondition:Oh.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:J9,primary:3}})}runEditorCommand(e,t){var i;null===(i=X9.get(t))||void 0===i||i.goToFocused()}}),ah(class extends wh{constructor(){super({id:"editor.action.selectEditor",title:{value:ue(0,"Select Editor"),original:"Select Editor"},precondition:Oh.stickyScrollFocused.isEqualTo(!0),keybinding:{weight:J9,primary:9}})}runEditorCommand(e,t){var i;null===(i=X9.get(t))||void 0===i||i.selectEditor()}});var e7,t7=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},i7=function(e,t){return function(i,n){t(i,n,e)}},n7=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class s7{constructor(e,t,i,n,s,o){this.range=e,this.insertText=t,this.filterText=i,this.additionalTextEdits=n,this.command=s,this.completion=o}}let o7=class extends M{constructor(e,t,i,n,s,o){super(s.disposable),this.model=e,this.line=t,this.word=i,this.completionModel=n,this._suggestMemoryService=o}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(Uh.None)}return t}};o7=t7([i7(5,y2)],o7);let r7=class{constructor(e,t,i,n){this._getEditorOption=e,this._languageFeatureService=t,this._clipboardService=i,this._suggestMemoryService=n}provideInlineCompletions(e,t,i,n){var s;return n7(this,void 0,void 0,(function*(){if(i.selectedSuggestionInfo)return;const o=this._getEditorOption(88,e);if(H1.isAllOff(o))return;e.tokenization.tokenizeIfCheap(t.lineNumber);const r=e.tokenization.getLineTokens(t.lineNumber),a=r.getStandardTokenType(r.findTokenIndexAtOffset(Math.max(t.column-1-1,0)));if("inline"!==H1.valueFor(o,a))return;let l,h,d=e.getWordAtPosition(t);if((null==d?void 0:d.word)||(l=this._getTriggerCharacterInfo(e,t)),!(null==d?void 0:d.word)&&!l)return;if(d||(d=e.getWordUntilPosition(t)),d.endColumn!==t.column)return;const c=e.getValueInRange(new Rh(t.lineNumber,1,t.lineNumber,t.column));if(!l&&(null===(s=this._lastResult)||void 0===s?void 0:s.canBeReused(e,t.lineNumber,d))){const e=new P2(c,t.column-this._lastResult.word.endColumn);this._lastResult.completionModel.lineContext=e,this._lastResult.acquire(),h=this._lastResult}else{const i=yield B1(this._languageFeatureService.completionProvider,e,t,new O1(void 0,void 0,null==l?void 0:l.providers),l&&{triggerKind:1,triggerCharacter:l.ch},n);let s;i.needsClipboard&&(s=yield this._clipboardService.readText());const o=new F2(i.items,t.column,new P2(c,0),O2.None,this._getEditorOption(117,e),this._getEditorOption(111,e),{boostFullMatch:!1,firstMatchCanBeWeak:!1},s);h=new o7(e,t.lineNumber,d,o,i,this._suggestMemoryService)}return this._lastResult=h,h}))}handleItemDidShow(e,t){t.completion.resolve(Uh.None)}freeInlineCompletions(e){e.release()}_getTriggerCharacterInfo(e,t){var i;const n=e.getValueInRange(Rh.fromPositions({lineNumber:t.lineNumber,column:t.column-1},t)),s=new Set;for(const o of this._languageFeatureService.completionProvider.all(e))(null===(i=o.triggerCharacters)||void 0===i?void 0:i.includes(n))&&s.add(o);if(0!==s.size)return{providers:s,ch:n}}};r7=t7([i7(1,oL),i7(2,eS),i7(3,y2)],r7);let a7=e7=class{constructor(e,t,i,n){if(1==++e7._counter){const s=n.createInstance(r7,((t,n)=>{var s;return(null!==(s=i.listCodeEditors().find((e=>e.getModel()===n)))&&void 0!==s?s:e).getOption(t)}));e7._disposable=t.inlineCompletionsProvider.register("*",s)}}dispose(){var e;0==--e7._counter&&(null===(e=e7._disposable)||void 0===e||e.dispose(),e7._disposable=void 0)}};a7._counter=0,a7=e7=t7([i7(1,oL),i7(2,Wa),i7(3,Fa)],a7),Dh("suggest.inlineCompletionsProvider",a7,0);class l7{constructor(e,t,i,n,s){this._parsedThemeRuleBrand=void 0,this.token=e,this.index=t,this.fontStyle=i,this.foreground=n,this.background=s}}const h7=/^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;class d7{constructor(){this._lastColorId=0,this._id2color=[],this._color2id=new Map}getId(e){if(null===e)return 0;const t=e.match(h7);if(!t)throw new Error("Illegal value for token color: "+e);e=t[1].toUpperCase();let i=this._color2id.get(e);return i||(i=++this._lastColorId,this._color2id.set(e,i),this._id2color[i]=lc.fromHex("#"+e),i)}getColorMap(){return this._id2color.slice(0)}}class c7{static createFromRawTokenTheme(e,t){return this.createFromParsedTokenTheme(function(e){if(!e||!Array.isArray(e))return[];const t=[];let i=0;for(let n=0,s=e.length;n{const i=function(e,t){return et?1:0}(e.token,t.token);return 0!==i?i:e.index-t.index}));let i=0,n="000000",s="ffffff";for(;e.length>=1&&""===e[0].token;){const t=e.shift();-1!==t.fontStyle&&(i=t.fontStyle),null!==t.foreground&&(n=t.foreground),null!==t.background&&(s=t.background)}const o=new d7;for(const d of t)o.getId(d);const r=o.getId(n),a=o.getId(s),l=new g7(i,r,a),h=new p7(l);for(let d=0,c=e.length;d>>0,this._cache.set(t,i)}return(i|e)>>>0}}const u7=/\b(comment|string|regex|regexp)\b/;class g7{constructor(e,t,i){this._themeTrieElementRuleBrand=void 0,this._fontStyle=e,this._foreground=t,this._background=i,this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}clone(){return new g7(this._fontStyle,this._foreground,this._background)}acceptOverwrite(e,t,i){-1!==e&&(this._fontStyle=e),0!==t&&(this._foreground=t),0!==i&&(this._background=i),this.metadata=(this._fontStyle<<11|this._foreground<<15|this._background<<24)>>>0}}class p7{constructor(e){this._themeTrieElementBrand=void 0,this._mainRule=e,this._children=new Map}match(e){if(""===e)return this._mainRule;const t=e.indexOf(".");let i,n;-1===t?(i=e,n=""):(i=e.substring(0,t),n=e.substring(t+1));const s=this._children.get(i);return void 0!==s?s.match(n):this._mainRule}insert(e,t,i,n){if(""===e)return void this._mainRule.acceptOverwrite(t,i,n);const s=e.indexOf(".");let o,r;-1===s?(o=e,r=""):(o=e.substring(0,s),r=e.substring(s+1));let a=this._children.get(o);void 0===a&&(a=new p7(this._mainRule.clone()),this._children.set(o,a)),a.insert(r,t,i,n)}}const m7={base:"vs",inherit:!1,rules:[{token:"",foreground:"000000",background:"fffffe"},{token:"invalid",foreground:"cd3131"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"001188"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"delimiter.xml",foreground:"0000FF"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"FF0000"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"FF0000"},{token:"attribute.value",foreground:"0451A5"},{token:"attribute.value.number",foreground:"098658"},{token:"attribute.value.unit",foreground:"098658"},{token:"attribute.value.html",foreground:"0000FF"},{token:"attribute.value.xml",foreground:"0000FF"},{token:"string",foreground:"A31515"},{token:"string.html",foreground:"0000FF"},{token:"string.sql",foreground:"FF0000"},{token:"string.yaml",foreground:"0451A5"},{token:"keyword",foreground:"0000FF"},{token:"keyword.json",foreground:"0451A5"},{token:"keyword.flow",foreground:"AF00DB"},{token:"keyword.flow.scss",foreground:"0000FF"},{token:"operator.scss",foreground:"666666"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[Sm]:"#FFFFFE",[Lm]:"#000000",[Vm]:"#E5EBF1",[X_]:"#D3D3D3",[nv]:"#939393",[Hm]:"#ADD6FF4D"}},f7={base:"vs-dark",inherit:!1,rules:[{token:"",foreground:"D4D4D4",background:"1E1E1E"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"74B0DF"},{token:"variable.predefined",foreground:"4864AA"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"B5CEA8"},{token:"number.hex",foreground:"5BB498"},{token:"regexp",foreground:"B46695"},{token:"annotation",foreground:"cc6666"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"DCDCDC"},{token:"delimiter.html",foreground:"808080"},{token:"delimiter.xml",foreground:"808080"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"A79873"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"DD6A6F"},{token:"metatag.content.html",foreground:"9CDCFE"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key.json",foreground:"9CDCFE"},{token:"string.value.json",foreground:"CE9178"},{token:"attribute.name",foreground:"9CDCFE"},{token:"attribute.value",foreground:"CE9178"},{token:"attribute.value.number.css",foreground:"B5CEA8"},{token:"attribute.value.unit.css",foreground:"B5CEA8"},{token:"attribute.value.hex.css",foreground:"D4D4D4"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"keyword.json",foreground:"CE9178"},{token:"keyword.flow.scss",foreground:"569CD6"},{token:"operator.scss",foreground:"909090"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[Sm]:"#1E1E1E",[Lm]:"#D4D4D4",[Vm]:"#3A3D41",[X_]:"#404040",[nv]:"#707070",[Hm]:"#ADD6FF26"}},_7={base:"hc-black",inherit:!1,rules:[{token:"",foreground:"FFFFFF",background:"000000"},{token:"invalid",foreground:"f44747"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"1AEBFF"},{token:"variable.parameter",foreground:"9CDCFE"},{token:"constant",foreground:"569CD6"},{token:"comment",foreground:"608B4E"},{token:"number",foreground:"FFFFFF"},{token:"regexp",foreground:"C0C0C0"},{token:"annotation",foreground:"569CD6"},{token:"type",foreground:"3DC9B0"},{token:"delimiter",foreground:"FFFF00"},{token:"delimiter.html",foreground:"FFFF00"},{token:"tag",foreground:"569CD6"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta",foreground:"D4D4D4"},{token:"meta.tag",foreground:"CE9178"},{token:"metatag",foreground:"569CD6"},{token:"metatag.content.html",foreground:"1AEBFF"},{token:"metatag.html",foreground:"569CD6"},{token:"metatag.xml",foreground:"569CD6"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"9CDCFE"},{token:"string.key",foreground:"9CDCFE"},{token:"string.value",foreground:"CE9178"},{token:"attribute.name",foreground:"569CD6"},{token:"attribute.value",foreground:"3FF23F"},{token:"string",foreground:"CE9178"},{token:"string.sql",foreground:"FF0000"},{token:"keyword",foreground:"569CD6"},{token:"keyword.flow",foreground:"C586C0"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"909090"},{token:"predefined.sql",foreground:"FF00FF"}],colors:{[Sm]:"#000000",[Lm]:"#FFFFFF",[X_]:"#FFFFFF",[nv]:"#FFFFFF"}},v7={base:"hc-light",inherit:!1,rules:[{token:"",foreground:"292929",background:"FFFFFF"},{token:"invalid",foreground:"B5200D"},{token:"emphasis",fontStyle:"italic"},{token:"strong",fontStyle:"bold"},{token:"variable",foreground:"264F70"},{token:"variable.predefined",foreground:"4864AA"},{token:"constant",foreground:"dd0000"},{token:"comment",foreground:"008000"},{token:"number",foreground:"098658"},{token:"number.hex",foreground:"3030c0"},{token:"regexp",foreground:"800000"},{token:"annotation",foreground:"808080"},{token:"type",foreground:"008080"},{token:"delimiter",foreground:"000000"},{token:"delimiter.html",foreground:"383838"},{token:"tag",foreground:"800000"},{token:"tag.id.pug",foreground:"4F76AC"},{token:"tag.class.pug",foreground:"4F76AC"},{token:"meta.scss",foreground:"800000"},{token:"metatag",foreground:"e00000"},{token:"metatag.content.html",foreground:"B5200D"},{token:"metatag.html",foreground:"808080"},{token:"metatag.xml",foreground:"808080"},{token:"metatag.php",fontStyle:"bold"},{token:"key",foreground:"863B00"},{token:"string.key.json",foreground:"A31515"},{token:"string.value.json",foreground:"0451A5"},{token:"attribute.name",foreground:"264F78"},{token:"attribute.value",foreground:"0451A5"},{token:"string",foreground:"A31515"},{token:"string.sql",foreground:"B5200D"},{token:"keyword",foreground:"0000FF"},{token:"keyword.flow",foreground:"AF00DB"},{token:"operator.sql",foreground:"778899"},{token:"operator.swift",foreground:"666666"},{token:"predefined.sql",foreground:"C700C7"}],colors:{[Sm]:"#FFFFFF",[Lm]:"#292929",[X_]:"#292929",[nv]:"#292929"}};class b7{getIcon(e){const t=iR();let i=e.defaults;for(;ta.isThemeIcon(i);){const e=t.getIcon(i.id);if(!e)return;i=e.defaults}return i}}const C7="vs",w7="vs-dark",y7="hc-black",S7="hc-light",L7=jl.as(Lp),k7=jl.as(W_);class D7{constructor(e,t){this.semanticHighlighting=!1,this.themeData=t;const i=t.base;e.length>0?(x7(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 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,lc.fromHex(this.themeData.colors[t]));if(this.themeData.inherit){const t=N7(this.themeData.base);for(const i in t.colors)e.has(i)||e.set(i,lc.fromHex(t.colors[i]))}this.colors=e}return this.colors}getColor(e,t){const i=this.getColors().get(e);return i||(!1!==t?this.getDefault(e):void 0)}getDefault(e){let t=this.defaultColors[e];return t||(t=L7.resolveDefaultColor(e,this),this.defaultColors[e]=t,t)}defines(e){return this.getColors().has(e)}get type(){switch(this.base){case C7:return R_.LIGHT;case y7:return R_.HIGH_CONTRAST_DARK;case S7:return R_.HIGH_CONTRAST_LIGHT;default:return R_.DARK}}get tokenTheme(){if(!this._tokenTheme){let e=[],t=[];if(this.themeData.inherit){const i=N7(this.themeData.base);e=i.rules,i.encodedTokensColors&&(t=i.encodedTokensColors)}const i=this.themeData.colors["editor.foreground"],n=this.themeData.colors["editor.background"];if(i||n){const t={token:""};i&&(t.foreground=i),n&&(t.background=n),e.push(t)}e=e.concat(this.themeData.rules),this.themeData.encodedTokensColors&&(t=this.themeData.encodedTokensColors),this._tokenTheme=c7.createFromRawTokenTheme(e,t)}return this._tokenTheme}getTokenStyleMetadata(e,t,i){const n=this.tokenTheme._match([e].concat(t).join(".")).metadata,s=Gg.getForeground(n),o=Gg.getFontStyle(n);return{foreground:s,italic:Boolean(1&o),bold:Boolean(2&o),underline:Boolean(4&o),strikethrough:Boolean(8&o)}}}function x7(e){return e===C7||e===w7||e===y7||e===S7}function N7(e){switch(e){case C7:return m7;case w7:return f7;case y7:return _7;case S7:return v7}}function E7(e){const t=N7(e);return new D7(e,t)}Lh(class extends bh{constructor(){super({id:"editor.action.toggleHighContrast",label:BJ.toggleHighContrast,alias:"Toggle High Contrast Theme",precondition:void 0}),this._originalThemeName=null}run(e,t){const i=e.get(j4),n=i.getColorTheme();A_(n.type)?(i.setTheme(this._originalThemeName||(O_(n.type)?w7:C7)),this._originalThemeName=null):(i.setTheme(O_(n.type)?y7:S7),this._originalThemeName=n.themeName)}});class I7 extends rh{constructor(){super({id:I7.ID,title:{value:ue(0,"Toggle Tab Key Moves Focus"),original:"Toggle Tab Key Moves Focus"},precondition:void 0,keybinding:{primary:2091,mac:{primary:1323},weight:100},f1:!0})}run(){const e=!XR.getTabFocusMode();XR.setTabFocusMode(e),Ps(ue(0,e?"Pressing Tab will now move focus to the next focusable element":"Pressing Tab will now insert the tab character"))}}I7.ID="editor.action.toggleTabFocusMode",ah(I7);Lh(class extends bh{constructor(){super({id:"editor.action.forceRetokenize",label:ue(0,"Developer: Force Retokenize"),alias:"Developer: Force Retokenize",precondition:void 0})}run(e,t){if(!t.hasModel())return;const i=t.getModel();i.tokenization.resetTokenization();const n=new F;i.tokenization.forceTokenization(i.getLineCount()),n.stop(),console.log(`tokenization took ${n.elapsed()}`)}});var M7=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},T7=function(e,t){return function(i,n){t(i,n,e)}};let R7=class extends E{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}constructor(e,t,i={},n){var s;super(),this._link=t,this._enabled=!0,this.el=ds(e,fs("a.monaco-link",{tabIndex:null!==(s=t.tabIndex)&&void 0!==s?s:0,href:t.href,title:t.title},t.label)),this.el.setAttribute("role","button");const o=this._register(new Ky(this.el,"click")),r=this._register(new Ky(this.el,"keypress")),a=B.chain(r.event,(e=>e.map((e=>new St(e))).filter((e=>3===e.keyCode)))),l=this._register(new Ky(this.el,$L.Tap)).event;this._register(ZL.addTarget(this.el));const h=B.any(o.event,a,l);this._register(h((e=>{this.enabled&&(as(e,!0),(null==i?void 0:i.opener)?i.opener(this._link.href):n.open(this._link.href,{allowCommands:!0}))}))),this.enabled=!0}};R7=M7([T7(3,qk)],R7);var A7=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},O7=function(e,t){return function(i,n){t(i,n,e)}};let P7=class extends E{constructor(e,t){super(),this._editor=e,this.instantiationService=t,this.banner=this._register(this.instantiationService.createInstance(F7))}hide(){this._editor.setBanner(null,0),this.banner.clear()}show(e){this.banner.show(Object.assign(Object.assign({},e),{onClose:()=>{var t;this.hide(),null===(t=e.onClose)||void 0===t||t.call(e)}})),this._editor.setBanner(this.banner.element,26)}};P7=A7([O7(1,Fa)],P7);let F7=class extends E{constructor(e){super(),this.instantiationService=e,this.markdownRenderer=this.instantiationService.createInstance(Jk,{}),this.element=fs("div.editor-banner"),this.element.tabIndex=0}getAriaLabel(e){return e.ariaLabel?e.ariaLabel:"string"==typeof e.message?e.message:void 0}getBannerMessage(e){if("string"==typeof e){const t=fs("span");return t.innerText=e,t}return this.markdownRenderer.render(e).element}clear(){Dn(this.element)}show(e){Dn(this.element);const t=this.getAriaLabel(e);t&&this.element.setAttribute("aria-label",t);const i=ds(this.element,fs("div.icon-container"));i.setAttribute("aria-hidden","true"),e.icon&&i.appendChild(fs(`div${ta.asCSSSelector(e.icon)}`));const n=ds(this.element,fs("div.message-container"));if(n.setAttribute("aria-hidden","true"),n.appendChild(this.getBannerMessage(e.message)),this.messageActionsContainer=ds(this.element,fs("div.message-actions-container")),e.actions)for(const o of e.actions)this._register(this.instantiationService.createInstance(R7,this.messageActionsContainer,Object.assign(Object.assign({},o),{tabIndex:-1}),{}));const s=ds(this.element,fs("div.action-container"));this.actionBar=this._register(new Rx(s)),this.actionBar.push(this._register(new Ka("banner.close","Close Banner",ta.asClassName(rR),!0,(()=>{"function"==typeof e.onClose&&e.onClose()}))),{icon:!0,label:!1}),this.actionBar.setFocusable(!1)}};F7=A7([O7(0,Fa)],F7);const B7=Ba("workspaceTrustManagementService");var W7=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},V7=function(e,t){return function(i,n){t(i,n,e)}},H7=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const z7=tR("extensions-warning-message",Jr.warning,ue(0,"Icon shown with a warning message in the extensions editor."));let U7=class extends E{constructor(e,t,i,n){super(),this._editor=e,this._editorWorkerService=t,this._workspaceTrustService=i,this._highlighter=null,this._bannerClosed=!1,this._updateState=e=>{if(e&&e.hasMore){if(this._bannerClosed)return;const t=Math.max(e.ambiguousCharacterCount,e.nonBasicAsciiCharacterCount,e.invisibleCharacterCount);let i;if(e.nonBasicAsciiCharacterCount>=t)i={message:ue(0,"This document contains many non-basic ASCII unicode characters"),command:new t8};else if(e.ambiguousCharacterCount>=t)i={message:ue(0,"This document contains many ambiguous unicode characters"),command:new J7};else{if(!(e.invisibleCharacterCount>=t))throw new Error("Unreachable");i={message:ue(0,"This document contains many invisible unicode characters"),command:new e8}}this._bannerController.show({id:"unicodeHighlightBanner",message:i.message,icon:z7,actions:[{label:i.command.shortLabel,href:`command:${i.command.id}`}],onClose:()=>{this._bannerClosed=!0}})}else this._bannerController.hide()},this._bannerController=this._register(n.createInstance(P7,e)),this._register(this._editor.onDidChangeModel((()=>{this._bannerClosed=!1,this._updateHighlighter()}))),this._options=e.getOption(124),this._register(i.onDidChangeTrust((e=>{this._updateHighlighter()}))),this._register(e.onDidChangeConfiguration((t=>{t.hasChanged(124)&&(this._options=e.getOption(124),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=function(e,t){return{nonBasicASCII:t.nonBasicASCII===FS?!e:t.nonBasicASCII,ambiguousCharacters:t.ambiguousCharacters,invisibleCharacters:t.invisibleCharacters,includeComments:t.includeComments===FS?!e:t.includeComments,includeStrings:t.includeStrings===FS?!e:t.includeStrings,allowedCharacters:t.allowedCharacters,allowedLocales:t.allowedLocales}}(this._workspaceTrustService.isWorkspaceTrusted(),this._options);if([e.nonBasicASCII,e.ambiguousCharacters,e.invisibleCharacters].every((e=>!1===e)))return;const t={nonBasicASCII:e.nonBasicASCII,ambiguousCharacters:e.ambiguousCharacters,invisibleCharacters:e.invisibleCharacters,includeComments:e.includeComments,includeStrings:e.includeStrings,allowedCodePoints:Object.keys(e.allowedCharacters).map((e=>e.codePointAt(0))),allowedLocales:Object.keys(e.allowedLocales).map((e=>{if("_os"===e){return(new Intl.NumberFormat).resolvedOptions().locale}return"_vscode"===e?Ke:e}))};this._editorWorkerService.canComputeUnicodeHighlights(this._editor.getModel().uri)?this._highlighter=new K7(this._editor,t,this._updateState,this._editorWorkerService):this._highlighter=new j7(this._editor,t,this._updateState)}getDecorationInfo(e){return this._highlighter?this._highlighter.getDecorationInfo(e):null}};U7.ID="editor.contrib.unicodeHighlighter",U7=W7([V7(1,fG),V7(2,B7),V7(3,Fa)],U7);let K7=class extends E{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 rd((()=>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())return void this._decorations.clear();const e=this._model.getVersionId();this._editorWorkerService.computedUnicodeHighlights(this._model.uri,this._options).then((t=>{if(this._model.isDisposed())return;if(this._model.getVersionId()!==e)return;this._updateState(t);const i=[];if(!t.hasMore)for(const e of t.ranges)i.push({range:e,options:Y7.instance.getDecorationFromOptions(this._options)});this._decorations.set(i)}))}getDecorationInfo(e){if(!this._decorations.has(e))return null;const t=this._editor.getModel();if(!nB(t,e))return null;return{reason:Z7(t.getValueInRange(e.range),this._options),inComment:sB(t,e),inString:oB(t,e)}}};K7=W7([V7(3,fG)],K7);class j7 extends E{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 rd((()=>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())return void this._decorations.clear();const e=this._editor.getVisibleRanges(),t=[],i={ranges:[],ambiguousCharacterCount:0,invisibleCharacterCount:0,nonBasicAsciiCharacterCount:0,hasMore:!1};for(const n of e){const e=cM.computeUnicodeHighlights(this._model,this._options,n);for(const t of e.ranges)i.ranges.push(t);i.ambiguousCharacterCount+=i.ambiguousCharacterCount,i.invisibleCharacterCount+=i.invisibleCharacterCount,i.nonBasicAsciiCharacterCount+=i.nonBasicAsciiCharacterCount,i.hasMore=i.hasMore||e.hasMore}if(!i.hasMore)for(const n of i.ranges)t.push({range:n,options:Y7.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 nB(t,e)?{reason:Z7(i,this._options),inComment:sB(t,e),inString:oB(t,e)}:null}}let q7=class{constructor(e,t,i){this._editor=e,this._languageService=t,this._openerService=i,this.hoverOrdinal=5}computeSync(e,t){if(!this._editor.hasModel()||1!==e.type)return[];const i=this._editor.getModel(),n=this._editor.getContribution(U7.ID);if(!n)return[];const s=[],o=new Set;let r=300;for(const a of t){const e=n.getDecorationInfo(a);if(!e)continue;const t=i.getValueInRange(a.range).codePointAt(0),l=G7(t);let h;switch(e.reason.kind){case 0:h=To(e.reason.confusableWith)?ue(0,"The character {0} could be confused with the ASCII character {1}, which is more common in source code.",l,G7(e.reason.confusableWith.codePointAt(0))):ue(0,"The character {0} could be confused with the character {1}, which is more common in source code.",l,G7(e.reason.confusableWith.codePointAt(0)));break;case 1:h=ue(0,"The character {0} is invisible.",l);break;case 2:h=ue(0,"The character {0} is not a basic ASCII character.",l)}if(o.has(h))continue;o.add(h);const d={codePoint:t,reason:e.reason,inComment:e.inComment,inString:e.inString},c=ue(0,"Adjust settings"),u=`command:${i8.ID}?${encodeURIComponent(JSON.stringify(d))}`,g=new Ta("",!0).appendMarkdown(h).appendText(" ").appendLink(u,c);s.push(new BK(this,a.range,[g],!1,r++))}return s}renderHoverParts(e,t){return VK(e,t,this._editor,this._languageService,this._openerService)}};function $7(e){return`U+${e.toString(16).padStart(4,"0")}`}function G7(e){let t=`\`${$7(e)}\``;return jo.isInvisibleCharacter(e)||(t+=` "${function(e){if(96===e)return"`` ` ``";return"`"+String.fromCodePoint(e)+"`"}(e)}"`),t}function Z7(e,t){return cM.computeUnicodeHighlightReason(e,t)}q7=W7([V7(1,Lc),V7(2,qk)],q7);class Y7{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=Iw.createDynamic({description:"unicode-highlight",stickiness:1,className:"unicode-highlight",showIfCollapsed:!0,overviewRuler:null,minimap:null,hideInCommentTokens:e,hideInStringTokens:t}),this.map.set(i,n)),n}}Y7.instance=new Y7;class X7 extends bh{constructor(){super({id:J7.ID,label:ue(0,"Disable highlighting of characters in comments"),alias:"Disable highlighting of characters in comments",precondition:void 0}),this.shortLabel=ue(0,"Disable Highlight In Comments")}run(e,t,i){return H7(this,void 0,void 0,(function*(){const t=null==e?void 0:e.get(pu);t&&this.runAction(t)}))}runAction(e){return H7(this,void 0,void 0,(function*(){yield e.updateValue(zS,!1,2)}))}}class Q7 extends bh{constructor(){super({id:J7.ID,label:ue(0,"Disable highlighting of characters in strings"),alias:"Disable highlighting of characters in strings",precondition:void 0}),this.shortLabel=ue(0,"Disable Highlight In Strings")}run(e,t,i){return H7(this,void 0,void 0,(function*(){const t=null==e?void 0:e.get(pu);t&&this.runAction(t)}))}runAction(e){return H7(this,void 0,void 0,(function*(){yield e.updateValue(US,!1,2)}))}}class J7 extends bh{constructor(){super({id:J7.ID,label:ue(0,"Disable highlighting of ambiguous characters"),alias:"Disable highlighting of ambiguous characters",precondition:void 0}),this.shortLabel=ue(0,"Disable Ambiguous Highlight")}run(e,t,i){return H7(this,void 0,void 0,(function*(){const t=null==e?void 0:e.get(pu);t&&this.runAction(t)}))}runAction(e){return H7(this,void 0,void 0,(function*(){yield e.updateValue(HS,!1,2)}))}}J7.ID="editor.action.unicodeHighlight.disableHighlightingOfAmbiguousCharacters";class e8 extends bh{constructor(){super({id:e8.ID,label:ue(0,"Disable highlighting of invisible characters"),alias:"Disable highlighting of invisible characters",precondition:void 0}),this.shortLabel=ue(0,"Disable Invisible Highlight")}run(e,t,i){return H7(this,void 0,void 0,(function*(){const t=null==e?void 0:e.get(pu);t&&this.runAction(t)}))}runAction(e){return H7(this,void 0,void 0,(function*(){yield e.updateValue(WS,!1,2)}))}}e8.ID="editor.action.unicodeHighlight.disableHighlightingOfInvisibleCharacters";class t8 extends bh{constructor(){super({id:t8.ID,label:ue(0,"Disable highlighting of non basic ASCII characters"),alias:"Disable highlighting of non basic ASCII characters",precondition:void 0}),this.shortLabel=ue(0,"Disable Non ASCII Highlight")}run(e,t,i){return H7(this,void 0,void 0,(function*(){const t=null==e?void 0:e.get(pu);t&&this.runAction(t)}))}runAction(e){return H7(this,void 0,void 0,(function*(){yield e.updateValue(VS,!1,2)}))}}t8.ID="editor.action.unicodeHighlight.disableHighlightingOfNonBasicAsciiCharacters";class i8 extends bh{constructor(){super({id:i8.ID,label:ue(0,"Show Exclude Options"),alias:"Show Exclude Options",precondition:void 0})}run(e,t,i){return H7(this,void 0,void 0,(function*(){const{codePoint:t,reason:n,inString:s,inComment:o}=i,r=String.fromCodePoint(t),a=e.get(cE),l=e.get(pu);const h=[];if(0===n.kind)for(const e of n.notAmbiguousInLocales)h.push({label:ue(0,'Allow unicode characters that are more common in the language "{0}".',e),run:()=>H7(this,void 0,void 0,(function*(){n8(l,[e])}))});if(h.push({label:function(e){return jo.isInvisibleCharacter(e)?ue(0,"Exclude {0} (invisible character) from being highlighted",$7(e)):ue(0,"Exclude {0} from being highlighted",`${$7(e)} "${r}"`)}(t),run:()=>function(e,t){return H7(this,void 0,void 0,(function*(){const i=e.getValue(BS);let n;n="object"==typeof i&&i?i:{};for(const e of t)n[String.fromCodePoint(e)]=!0;yield e.updateValue(BS,n,2)}))}(l,[t])}),o){const e=new X7;h.push({label:e.label,run:()=>H7(this,void 0,void 0,(function*(){return e.runAction(l)}))})}else if(s){const e=new Q7;h.push({label:e.label,run:()=>H7(this,void 0,void 0,(function*(){return e.runAction(l)}))})}if(0===n.kind){const e=new J7;h.push({label:e.label,run:()=>H7(this,void 0,void 0,(function*(){return e.runAction(l)}))})}else if(1===n.kind){const e=new e8;h.push({label:e.label,run:()=>H7(this,void 0,void 0,(function*(){return e.runAction(l)}))})}else if(2===n.kind){const e=new t8;h.push({label:e.label,run:()=>H7(this,void 0,void 0,(function*(){return e.runAction(l)}))})}else!function(e){throw new Error(`Unexpected value: ${e}`)}(n);const d=yield a.pick(h,{title:ue(0,"Configure Unicode Highlight Options")});d&&(yield d.run())}))}}function n8(e,t){var i;return H7(this,void 0,void 0,(function*(){const n=null===(i=e.inspect(KS).user)||void 0===i?void 0:i.value;let s;s="object"==typeof n&&n?Object.assign({},n):{};for(const e of t)s[e]=!0;yield e.updateValue(KS,s,2)}))}i8.ID="editor.action.unicodeHighlight.showExcludeOptions",Lh(J7),Lh(e8),Lh(t8),Lh(i8),Dh(U7.ID,U7,1),gK.register(q7);var s8=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},o8=function(e,t){return function(i,n){t(i,n,e)}},r8=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const a8="ignoreUnusualLineTerminators";let l8=class extends E{constructor(e,t,i){super(),this._editor=e,this._dialogService=t,this._codeEditorService=i,this._isPresentingDialog=!1,this._config=this._editor.getOption(125),this._register(this._editor.onDidChangeConfiguration((e=>{e.hasChanged(125)&&(this._config=this._editor.getOption(125),this._checkForUnusualLineTerminators())}))),this._register(this._editor.onDidChangeModel((()=>{this._checkForUnusualLineTerminators()}))),this._register(this._editor.onDidChangeModelContent((e=>{e.isUndoing||this._checkForUnusualLineTerminators()}))),this._checkForUnusualLineTerminators()}_checkForUnusualLineTerminators(){return r8(this,void 0,void 0,(function*(){if("off"===this._config)return;if(!this._editor.hasModel())return;const e=this._editor.getModel();if(!e.mightContainUnusualLineTerminators())return;const t=function(e,t){return e.getModelProperty(t.uri,a8)}(this._codeEditorService,e);if(!0===t)return;if(this._editor.getOption(90))return;if("auto"===this._config)return void e.removeUnusualLineTerminators(this._editor.getSelections());if(this._isPresentingDialog)return;let i;try{this._isPresentingDialog=!0,i=yield this._dialogService.confirm({title:ue(0,"Unusual Line Terminators"),message:ue(0,"Detected unusual line terminators"),detail:ue(0,"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`.",wa(e.uri)),primaryButton:ue(0,"&&Remove Unusual Line Terminators"),cancelButton:ue(0,"Ignore")})}finally{this._isPresentingDialog=!1}i.confirmed?e.removeUnusualLineTerminators(this._editor.getSelections()):function(e,t,i){e.setModelProperty(t.uri,a8,i)}(this._codeEditorService,e,!0)}))}};l8.ID="editor.contrib.unusualLineTerminatorsDetector",l8=s8([o8(1,x3),o8(2,Wa)],l8),Dh(l8.ID,l8,1);var h8,d8=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},c8=function(e,t){return function(i,n){t(i,n,e)}};const u8=new Al("hasWordHighlights",!1);function g8(e,t,i,n){return nd(e.ordered(t).map((e=>()=>Promise.resolve(e.provideDocumentHighlights(t,i,n)).then(void 0,a))),Hd)}class p8{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=Yh((e=>this._compute(this._model,this._selection,this._wordSeparators,e)))),this._result}_getCurrentWordRange(e,t){const i=e.getWordAtPosition(t.getPosition());return i?new Rh(t.startLineNumber,i.startColumn,t.startLineNumber,i.endColumn):null}isValid(e,t,i){const n=t.startLineNumber,s=t.startColumn,o=t.endColumn,r=this._getCurrentWordRange(e,t);let a=Boolean(this._wordRange&&this._wordRange.equalsRange(r));for(let l=0,h=i.length;!a&&l=o&&(a=!0)}return a}cancel(){this.result.cancel()}}class m8 extends p8{constructor(e,t,i,n){super(e,t,i),this._providers=n}_compute(e,t,i,n){return g8(this._providers,e,t.getPosition(),n).then((e=>e||[]))}}class f8 extends p8{constructor(e,t,i){super(e,t,i),this._selectionIsEmpty=t.isEmpty()}_compute(e,t,i,n){return td(250,n).then((()=>{if(!t.isEmpty())return[];const n=e.getWordAtPosition(t.getPosition());if(!n||n.word.length>1e3)return[];return e.findMatches(n.word,!0,!1,!0,i,!1).map((e=>({range:e.range,kind:fC.Text})))}))}isValid(e,t,i){const n=t.isEmpty();return this._selectionIsEmpty===n&&super.isValid(e,t,i)}}yh("_executeDocumentHighlights",((e,t,i)=>g8(e.get(oL).documentHighlightProvider,t,i,Uh.None)));class _8{constructor(e,t,i,n){this.toUnhook=new N,this.workerRequestTokenId=0,this.workerRequestCompleted=!1,this.workerRequestValue=[],this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1,this.editor=e,this.providers=t,this.linkedHighlighters=i,this._hasWordHighlights=u8.bindTo(n),this._ignorePositionChangeEvent=!1,this.occurrencesHighlight=this.editor.getOption(80),this.model=this.editor.getModel(),this.toUnhook.add(e.onDidChangeCursorPosition((e=>{this._ignorePositionChangeEvent||this.occurrencesHighlight&&this._onPositionChanged(e)}))),this.toUnhook.add(e.onDidChangeModelContent((e=>{this._stopAll()}))),this.toUnhook.add(e.onDidChangeConfiguration((e=>{const t=this.editor.getOption(80);this.occurrencesHighlight!==t&&(this.occurrencesHighlight=t,this._stopAll())}))),this.decorations=this.editor.createDecorationsCollection(),this.workerRequestTokenId=0,this.workerRequest=null,this.workerRequestCompleted=!1,this.lastCursorPositionChangeTime=0,this.renderDecorationsTimer=-1}hasDecorations(){return this.decorations.length>0}restore(){this.occurrencesHighlight&&this._run()}_getSortedHighlights(){return this.decorations.getRanges().sort(Rh.compareRangesUsingStarts)}moveNext(){const e=this._getSortedHighlights(),t=e.findIndex((e=>e.containsPosition(this.editor.getPosition()))),i=(t+1)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const t=this._getWord();if(t){Ps(`${this.editor.getModel().getLineContent(n.startLineNumber)}, ${i+1} of ${e.length} for '${t.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}moveBack(){const e=this._getSortedHighlights(),t=e.findIndex((e=>e.containsPosition(this.editor.getPosition()))),i=(t-1+e.length)%e.length,n=e[i];try{this._ignorePositionChangeEvent=!0,this.editor.setPosition(n.getStartPosition()),this.editor.revealRangeInCenterIfOutsideViewport(n);const t=this._getWord();if(t){Ps(`${this.editor.getModel().getLineContent(n.startLineNumber)}, ${i+1} of ${e.length} for '${t.word}'`)}}finally{this._ignorePositionChangeEvent=!1}}_removeDecorations(){this.decorations.length>0&&(this.decorations.clear(),this._hasWordHighlights.set(!1))}_stopAll(){this._removeDecorations(),-1!==this.renderDecorationsTimer&&(clearTimeout(this.renderDecorationsTimer),this.renderDecorationsTimer=-1),null!==this.workerRequest&&(this.workerRequest.cancel(),this.workerRequest=null),this.workerRequestCompleted||(this.workerRequestTokenId++,this.workerRequestCompleted=!0)}_onPositionChanged(e){this.occurrencesHighlight&&3===e.reason?this._run():this._stopAll()}_getWord(){const e=this.editor.getSelection(),t=e.startLineNumber,i=e.startColumn;return this.model.getWordAtPosition({lineNumber:t,column:i})}_run(){const e=this.editor.getSelection();if(e.startLineNumber!==e.endLineNumber)return void this._stopAll();const t=e.startColumn,i=e.endColumn,n=this._getWord();if(!n||n.startColumn>t||n.endColumn{e===this.workerRequestTokenId&&(this.workerRequestCompleted=!0,this.workerRequestValue=t||[],this._beginRenderDecorations())}),r)}}_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=[];for(const i of this.workerRequestValue)i.range&&e.push({range:i.range,options:(t=i.kind,t===fC.Write?W5:t===fC.Text?V5:U5)});var t;this.decorations.set(e),this._hasWordHighlights.set(this.hasDecorations());for(const i of this.linkedHighlighters())(null==i?void 0:i.editor.getModel())===this.editor.getModel()&&(i._stopAll(),i.decorations.set(e),i._hasWordHighlights.set(i.hasDecorations()))}dispose(){this._stopAll(),this.toUnhook.dispose()}}let v8=h8=class extends E{static get(e){return e.getContribution(h8.ID)}constructor(e,t,i){super(),this.wordHighlighter=null,this.linkedContributions=new Set;const n=()=>{e.hasModel()&&!e.getModel().isTooLargeForTokenization()&&(this.wordHighlighter=new _8(e,i.documentHighlightProvider,(()=>v.map(this.linkedContributions,(e=>e.wordHighlighter))),t))};this._register(e.onDidChangeModel((e=>{this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),n()}))),n()}saveViewState(){return!(!this.wordHighlighter||!this.wordHighlighter.hasDecorations())}moveNext(){var e;null===(e=this.wordHighlighter)||void 0===e||e.moveNext()}moveBack(){var e;null===(e=this.wordHighlighter)||void 0===e||e.moveBack()}restoreViewState(e){this.wordHighlighter&&e&&this.wordHighlighter.restore()}dispose(){this.wordHighlighter&&(this.wordHighlighter.dispose(),this.wordHighlighter=null),super.dispose()}};v8.ID="editor.contrib.wordHighlighter",v8=h8=d8([c8(1,Ol),c8(2,oL)],v8);class b8 extends bh{constructor(e,t){super(t),this._isNext=e}run(e,t){const i=v8.get(t);i&&(this._isNext?i.moveNext():i.moveBack())}}Dh(v8.ID,v8,0),Lh(class extends b8{constructor(){super(!0,{id:"editor.action.wordHighlight.next",label:ue(0,"Go to Next Symbol Highlight"),alias:"Go to Next Symbol Highlight",precondition:u8,kbOpts:{kbExpr:Oh.editorTextFocus,primary:65,weight:100}})}}),Lh(class extends b8{constructor(){super(!1,{id:"editor.action.wordHighlight.prev",label:ue(0,"Go to Previous Symbol Highlight"),alias:"Go to Previous Symbol Highlight",precondition:u8,kbOpts:{kbExpr:Oh.editorTextFocus,primary:1089,weight:100}})}}),Lh(class extends bh{constructor(){super({id:"editor.action.wordHighlight.trigger",label:ue(0,"Trigger Symbol Highlight"),alias:"Trigger Symbol Highlight",precondition:u8.toNegated(),kbOpts:{kbExpr:Oh.editorTextFocus,primary:0,weight:100}})}run(e,t,i){const n=v8.get(t);n&&n.restoreViewState(!0)}});class C8 extends vh{constructor(e){super(e),this._inSelectionMode=e.inSelectionMode,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){if(!t.hasModel())return;const n=Gb(t.getOption(129)),s=t.getModel(),o=t.getSelections().map((e=>{const t=new Va(e.positionLineNumber,e.positionColumn),i=this._move(n,s,t,this._wordNavigationType);return this._moveTo(e,i,this._inSelectionMode)}));if(s.pushStackElement(),t._getViewModel().setCursorStates("moveWordCommand",3,o.map((e=>Kw.fromModelSelection(e)))),1===o.length){const e=new Va(o[0].positionLineNumber,o[0].positionColumn);t.revealPosition(e,0)}}_moveTo(e,t,i){return i?new Ah(e.selectionStartLineNumber,e.selectionStartColumn,t.lineNumber,t.column):new Ah(t.lineNumber,t.column,t.lineNumber,t.column)}}class w8 extends C8{_move(e,t,i,n){return ry.moveWordLeft(e,t,i,n)}}class y8 extends C8{_move(e,t,i,n){return ry.moveWordRight(e,t,i,n)}}class S8 extends vh{constructor(e){super(e),this._whitespaceHeuristics=e.whitespaceHeuristics,this._wordNavigationType=e.wordNavigationType}runEditorCommand(e,t,i){const n=e.get(Ju);if(!t.hasModel())return;const s=Gb(t.getOption(129)),o=t.getModel(),r=t.getSelections(),a=t.getOption(6),l=t.getOption(11),h=n.getLanguageConfiguration(o.getLanguageId()).getAutoClosingPairs(),d=t._getViewModel(),c=r.map((e=>{const i=this._delete({wordSeparators:s,model:o,selection:e,whitespaceHeuristics:this._whitespaceHeuristics,autoClosingDelete:t.getOption(9),autoClosingBrackets:a,autoClosingQuotes:l,autoClosingPairs:h,autoClosedCharacters:d.getCursorAutoClosedCharacters()},this._wordNavigationType);return new Xw(i,"")}));t.pushUndoStop(),t.executeCommands(this.id,c),t.pushUndoStop()}}class L8 extends S8{_delete(e,t){const i=ry.deleteWordLeft(e,t);return i||new Rh(1,1,1,1)}}class k8 extends S8{_delete(e,t){const i=ry.deleteWordRight(e,t);if(i)return i;const n=e.model.getLineCount(),s=e.model.getLineMaxColumn(n);return new Rh(n,s,n,s)}}Sh(new class extends w8{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartLeft",precondition:void 0})}}),Sh(new class extends w8{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndLeft",precondition:void 0})}}),Sh(new class extends w8{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:1,id:"cursorWordLeft",precondition:void 0,kbOpts:{kbExpr:pl.and(Oh.textInputFocus,null===(e=pl.and(JR,AH))||void 0===e?void 0:e.negate()),primary:2063,mac:{primary:527},weight:100}})}}),Sh(new class extends w8{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartLeftSelect",precondition:void 0})}}),Sh(new class extends w8{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndLeftSelect",precondition:void 0})}}),Sh(new class extends w8{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:1,id:"cursorWordLeftSelect",precondition:void 0,kbOpts:{kbExpr:pl.and(Oh.textInputFocus,null===(e=pl.and(JR,AH))||void 0===e?void 0:e.negate()),primary:3087,mac:{primary:1551},weight:100}})}}),Sh(new class extends y8{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordStartRight",precondition:void 0})}}),Sh(new class extends y8{constructor(){var e;super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordEndRight",precondition:void 0,kbOpts:{kbExpr:pl.and(Oh.textInputFocus,null===(e=pl.and(JR,AH))||void 0===e?void 0:e.negate()),primary:2065,mac:{primary:529},weight:100}})}}),Sh(new class extends y8{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordRight",precondition:void 0})}}),Sh(new class extends y8{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordStartRightSelect",precondition:void 0})}}),Sh(new class extends y8{constructor(){var e;super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordEndRightSelect",precondition:void 0,kbOpts:{kbExpr:pl.and(Oh.textInputFocus,null===(e=pl.and(JR,AH))||void 0===e?void 0:e.negate()),primary:3089,mac:{primary:1553},weight:100}})}}),Sh(new class extends y8{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordRightSelect",precondition:void 0})}}),Sh(new class extends w8{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityLeft",precondition:void 0})}_move(e,t,i,n){return super._move(Gb(ZS.wordSeparators.defaultValue),t,i,n)}}),Sh(new class extends w8{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityLeftSelect",precondition:void 0})}_move(e,t,i,n){return super._move(Gb(ZS.wordSeparators.defaultValue),t,i,n)}}),Sh(new class extends y8{constructor(){super({inSelectionMode:!1,wordNavigationType:3,id:"cursorWordAccessibilityRight",precondition:void 0})}_move(e,t,i,n){return super._move(Gb(ZS.wordSeparators.defaultValue),t,i,n)}}),Sh(new class extends y8{constructor(){super({inSelectionMode:!0,wordNavigationType:3,id:"cursorWordAccessibilityRightSelect",precondition:void 0})}_move(e,t,i,n){return super._move(Gb(ZS.wordSeparators.defaultValue),t,i,n)}}),Sh(new class extends L8{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartLeft",precondition:Oh.writable})}}),Sh(new class extends L8{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndLeft",precondition:Oh.writable})}}),Sh(new class extends L8{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordLeft",precondition:Oh.writable,kbOpts:{kbExpr:Oh.textInputFocus,primary:2049,mac:{primary:513},weight:100}})}}),Sh(new class extends k8{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:0,id:"deleteWordStartRight",precondition:Oh.writable})}}),Sh(new class extends k8{constructor(){super({whitespaceHeuristics:!1,wordNavigationType:2,id:"deleteWordEndRight",precondition:Oh.writable})}}),Sh(new class extends k8{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordRight",precondition:Oh.writable,kbOpts:{kbExpr:Oh.textInputFocus,primary:2068,mac:{primary:532},weight:100}})}}),Lh(class extends bh{constructor(){super({id:"deleteInsideWord",precondition:Oh.writable,label:ue(0,"Delete Word"),alias:"Delete Word"})}run(e,t,i){if(!t.hasModel())return;const n=Gb(t.getOption(129)),s=t.getModel(),o=t.getSelections().map((e=>{const t=ry.deleteInsideWord(n,s,e);return new Xw(t,"")}));t.pushUndoStop(),t.executeCommands(this.id,o),t.pushUndoStop()}});class D8 extends C8{_move(e,t,i,n){return ay.moveWordPartLeft(e,t,i)}}Xa.registerCommandAlias("cursorWordPartStartLeft","cursorWordPartLeft");Xa.registerCommandAlias("cursorWordPartStartLeftSelect","cursorWordPartLeftSelect");class x8 extends C8{_move(e,t,i,n){return ay.moveWordPartRight(e,t,i)}}Sh(new class extends S8{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:0,id:"deleteWordPartLeft",precondition:Oh.writable,kbOpts:{kbExpr:Oh.textInputFocus,primary:0,mac:{primary:769},weight:100}})}_delete(e,t){const i=ay.deleteWordPartLeft(e);return i||new Rh(1,1,1,1)}}),Sh(new class extends S8{constructor(){super({whitespaceHeuristics:!0,wordNavigationType:2,id:"deleteWordPartRight",precondition:Oh.writable,kbOpts:{kbExpr:Oh.textInputFocus,primary:0,mac:{primary:788},weight:100}})}_delete(e,t){const i=ay.deleteWordPartRight(e);if(i)return i;const n=e.model.getLineCount(),s=e.model.getLineMaxColumn(n);return new Rh(n,s,n,s)}}),Sh(new class extends D8{constructor(){super({inSelectionMode:!1,wordNavigationType:0,id:"cursorWordPartLeft",precondition:void 0,kbOpts:{kbExpr:Oh.textInputFocus,primary:0,mac:{primary:783},weight:100}})}}),Sh(new class extends D8{constructor(){super({inSelectionMode:!0,wordNavigationType:0,id:"cursorWordPartLeftSelect",precondition:void 0,kbOpts:{kbExpr:Oh.textInputFocus,primary:0,mac:{primary:1807},weight:100}})}}),Sh(new class extends x8{constructor(){super({inSelectionMode:!1,wordNavigationType:2,id:"cursorWordPartRight",precondition:void 0,kbOpts:{kbExpr:Oh.textInputFocus,primary:0,mac:{primary:785},weight:100}})}}),Sh(new class extends x8{constructor(){super({inSelectionMode:!0,wordNavigationType:2,id:"cursorWordPartRightSelect",precondition:void 0,kbOpts:{kbExpr:Oh.textInputFocus,primary:0,mac:{primary:1809},weight:100}})}});class N8 extends xT{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||"function"!=typeof this._foreignModuleHost[e])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(Mre){return Promise.reject(Mre)}}_getForeignProxy(){return this._foreignProxy||(this._foreignProxy=this._getProxy().then((e=>{const t=this._foreignModuleHost?bd(this._foreignModuleHost):[];return e.loadForeignModule(this._foreignModuleId,this._foreignModuleCreateData,t).then((t=>{this._foreignModuleCreateData=null;const i=(t,i)=>e.fmr(t,i),n=(e,t)=>function(){const i=Array.prototype.slice.call(arguments,0);return t(e,i)},s={};for(const e of t)s[e]=n(e,i);return s}))}))),this._foreignProxy}getProxy(){return this._getForeignProxy()}withSyncedResources(e){return this._withSyncedResources(e).then((e=>this.getProxy()))}}function E8(e){return!function(e){return Array.isArray(e)}(e)}function I8(e){return"string"==typeof e}function M8(e){return!I8(e)}function T8(e){return!e}function R8(e,t){return e.ignoreCase&&t?t.toLowerCase():t}function A8(e){return e.replace(/[&<>'"_]/g,"-")}function O8(e,t){console.log(`${e.languageId}: ${t}`)}function P8(e,t){return new Error(`${e.languageId}: ${t}`)}function F8(e,t,i,n,s){let o=null;return t.replace(/\$((\$)|(#)|(\d\d?)|[sS](\d\d?)|@(\w+))/g,(function(t,r,a,l,h,d,c,u,g){return T8(a)?T8(l)?!T8(h)&&h0;){const t=e.tokenizer[i];if(t)return t;const n=i.lastIndexOf(".");i=n<0?null:i.substr(0,n)}return null}var W8,V8=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},H8=function(e,t){return function(i,n){t(i,n,e)}};class z8{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(null!==e&&e.depth>=this._maxCacheDepth)return new U8(e,t);let i=U8.getStackElementId(e);i.length>0&&(i+="|"),i+=t;let n=this._entries[i];return n||(n=new U8(e,t),this._entries[i]=n,n)}}z8._INSTANCE=new z8(5);class U8{constructor(e,t){this.parent=e,this.state=t,this.depth=(this.parent?this.parent.depth:0)+1}static getStackElementId(e){let t="";for(;null!==e;)t.length>0&&(t+="|"),t+=e.state,e=e.parent;return t}static _equals(e,t){for(;null!==e&&null!==t;){if(e===t)return!0;if(e.state!==t.state)return!1;e=e.parent,t=t.parent}return null===e&&null===t}equals(e){return U8._equals(this,e)}push(e){return z8.create(this,e)}pop(){return this.parent}popall(){let e=this;for(;e.parent;)e=e.parent;return e}switchTo(e){return z8.create(this.parent,e)}}class K8{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 K8(this.languageId,this.state)}}class j8{static create(e,t){return this._INSTANCE.create(e,t)}constructor(e){this._maxCacheDepth=e,this._entries=Object.create(null)}create(e,t){if(null!==t)return new q8(e,t);if(null!==e&&e.depth>=this._maxCacheDepth)return new q8(e,t);const i=U8.getStackElementId(e);let n=this._entries[i];return n||(n=new q8(e,null),this._entries[i]=n,n)}}j8._INSTANCE=new j8(5);class q8{constructor(e,t){this.stack=e,this.embeddedLanguageData=t}clone(){return(this.embeddedLanguageData?this.embeddedLanguageData.clone():null)===this.embeddedLanguageData?this:j8.create(this.stack,this.embeddedLanguageData)}equals(e){return e instanceof q8&&(!!this.stack.equals(e.stack)&&(null===this.embeddedLanguageData&&null===e.embeddedLanguageData||null!==this.embeddedLanguageData&&null!==e.embeddedLanguageData&&this.embeddedLanguageData.equals(e.embeddedLanguageData)))}}class $8{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 bC(e,t,this._languageId)))}nestedLanguageTokenize(e,t,i,n){const s=i.languageId,o=i.state,r=EC.get(s);if(!r)return this.enterLanguage(s),this.emit(n,""),o;const a=r.tokenize(e,t,o);if(0!==n)for(const l of a.tokens)this._tokens.push(new bC(l.offset+n,l.type,l.language));else this._tokens=this._tokens.concat(a.tokens);return this._lastTokenType=null,this._lastTokenLanguage=null,this._languageId=null,a.endState}finalize(e){return new CC(this._tokens,e)}}class G8{constructor(e,t){this._languageService=e,this._theme=t,this._prependTokens=null,this._tokens=[],this._currentLanguageId=0,this._lastTokenMetadata=0}enterLanguage(e){this._currentLanguageId=this._languageService.languageIdCodec.encodeLanguageId(e)}emit(e,t){const i=1024|this._theme.match(this._currentLanguageId,t);this._lastTokenMetadata!==i&&(this._lastTokenMetadata=i,this._tokens.push(e),this._tokens.push(i))}static _merge(e,t,i){const n=null!==e?e.length:0,s=t.length,o=null!==i?i.length:0;if(0===n&&0===s&&0===o)return new Uint32Array(0);if(0===n&&0===s)return i;if(0===s&&0===o)return e;const r=new Uint32Array(n+s+o);null!==e&&r.set(e);for(let a=0;a{if(o)return;let t=!1;for(let i=0,n=e.changedLanguages.length;i{e.affectsConfiguration("editor.maxTokenizationLineLength")&&(this._maxTokenizationLineLength=this._configurationService.getValue("editor.maxTokenizationLineLength",{overrideIdentifier:this._languageId}))})))}getLoadStatus(){const e=[];for(const t in this._embeddedLanguages){const i=EC.get(t);if(i){if(i instanceof W8){const t=i.getLoadStatus();!1===t.loaded&&e.push(t.promise)}}else EC.isResolved(t)||e.push(EC.getOrCreate(t))}return 0===e.length?{loaded:!0}:{loaded:!1,promise:Promise.all(e).then((e=>{}))}}getInitialState(){const e=z8.create(null,this._lexer.start);return j8.create(e,null)}tokenize(e,t,i){if(e.length>=this._maxTokenizationLineLength)return MC(this._languageId,i);const n=new $8,s=this._tokenize(e,t,i,n);return n.finalize(s)}tokenizeEncoded(e,t,i){if(e.length>=this._maxTokenizationLineLength)return TC(this._languageService.languageIdCodec.encodeLanguageId(this._languageId),i);const n=new G8(this._languageService,this._standaloneThemeService.getColorTheme().tokenTheme),s=this._tokenize(e,t,i,n);return n.finalize(s)}_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=B8(this._lexer,t.stack.state),!i))throw P8(this._lexer,"tokenizer state is not defined: "+t.stack.state);let n=-1,s=!1;for(const o of i){if(!M8(o.action)||"@pop"!==o.action.nextEmbedded)continue;s=!0;let t=o.regex;const i=o.regex.source;if("^(?:"===i.substr(0,4)&&")"===i.substr(i.length-1,1)){const e=(t.ignoreCase?"i":"")+(t.unicode?"u":"");t=new RegExp(i.substr(4,i.length-5),e)}const r=e.search(t);-1===r||0!==r&&o.matchOnlyAtLineStart||(-1===n||r0&&s.nestedLanguageTokenize(r,!1,i.embeddedLanguageData,n);const a=e.substring(o);return this._myTokenize(a,t,i,n+o,s)}_safeRuleName(e){return e?e.name:"(unknown)"}_myTokenize(e,t,i,n,s){s.enterLanguage(this._languageId);const o=e.length,r=t&&this._lexer.includeLF?e+"\n":e,a=r.length;let l=i.embeddedLanguageData,h=i.stack,d=0,c=null,u=!0;for(;u||d=a)break;u=!1;let e=this._lexer.tokenizer[m];if(!e&&(e=B8(this._lexer,m),!e))throw P8(this._lexer,"tokenizer state is not defined: "+m);const t=r.substr(d);for(const i of e)if((0===d||!i.matchOnlyAtLineStart)&&(f=t.match(i.regex),f)){_=f[0],v=i.action;break}}if(f||(f=[""],_=""),v||(d=this._lexer.maxStack)throw P8(this._lexer,"maximum tokenizer stack size reached: ["+h.state+","+h.parent.state+",...]");h=h.push(m)}else if("@pop"===v.next){if(h.depth<=1)throw P8(this._lexer,"trying to pop an empty stack in rule: "+this._safeRuleName(b));h=h.pop()}else if("@popall"===v.next)h=h.popall();else{let e=F8(this._lexer,v.next,_,f,m);if("@"===e[0]&&(e=e.substr(1)),!B8(this._lexer,e))throw P8(this._lexer,"trying to set a next state '"+e+"' that is undefined in rule: "+this._safeRuleName(b));h=h.push(e)}}v.log&&"string"==typeof v.log&&O8(this._lexer,this._lexer.languageId+": "+F8(this._lexer,v.log,_,f,m))}if(null===w)throw P8(this._lexer,"lexer rule has no well-defined action in rule: "+this._safeRuleName(b));const y=i=>{const o=this._languageService.getLanguageIdByLanguageName(i)||this._languageService.getLanguageIdByMimeType(i)||i,r=this._getNestedEmbeddedLanguageData(o);if(d0)throw P8(this._lexer,"groups cannot be nested: "+this._safeRuleName(b));if(f.length!==w.length+1)throw P8(this._lexer,"matched number of groups does not match the number of actions in rule: "+this._safeRuleName(b));let e=0;for(let t=1;te});class J8{static colorizeElement(e,t,i,n){const s=(n=n||{}).theme||"vs",o=n.mimeType||i.getAttribute("lang")||i.getAttribute("data-lang");if(!o)return console.error("Mode not detected"),Promise.resolve();const r=t.getLanguageIdByMimeType(o)||o;e.setTheme(s);const a=i.firstChild?i.firstChild.nodeValue:"";i.className+=" "+s;return this.colorize(t,a||"",r,n).then((e=>{var t;const n=null!==(t=null==Q8?void 0:Q8.createHTML(e))&&void 0!==t?t:e;i.innerHTML=n}),(e=>console.error(e)))}static colorize(e,t,i,n){return X8(this,void 0,void 0,(function*(){const s=e.languageIdCodec;let o=4;n&&"number"==typeof n.tabSize&&(o=n.tabSize),Bo(t)&&(t=t.substr(1));const r=oo(t);if(!e.isRegisteredLanguageId(i))return eee(r,o,s);const a=yield EC.getOrCreate(i);return a?function(e,t,i,n){return new Promise(((s,o)=>{const r=()=>{const a=function(e,t,i,n){let s=[],o=i.getInitialState();for(let r=0,a=e.length;r"),o=l.endState}return s.join("")}(e,t,i,n);if(i instanceof Z8){const e=i.getLoadStatus();if(!1===e.loaded)return void e.promise.then(r,o)}s(a)};r()}))}(r,o,a,s):eee(r,o,s)}))}static colorizeLine(e,t,i,n,s=4){const o=cP.isBasicASCII(e,t),r=cP.containsRTL(e,o,i);return MA(new kA(!1,!0,e,!1,o,r,0,n,[],s,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 s=e.tokenization.getLineTokens(t).inflate();return this.colorizeLine(n,e.mightContainNonBasicASCII(),e.mightContainRTL(),s,i)}}function eee(e,t,i){let n=[];const s=new Uint32Array(2);s[0]=0,s[1]=33587200;for(let o=0,r=e.length;o")}return n.join("")}var tee=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},iee=function(e,t){return function(i,n){t(i,n,e)}},nee=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let see=class extends E{constructor(e){super(),this._themeService=e,this._onWillCreateCodeEditor=this._register(new U),this._onCodeEditorAdd=this._register(new U),this.onCodeEditorAdd=this._onCodeEditorAdd.event,this._onCodeEditorRemove=this._register(new U),this.onCodeEditorRemove=this._onCodeEditorRemove.event,this._onWillCreateDiffEditor=this._register(new U),this._onDiffEditorAdd=this._register(new U),this.onDiffEditorAdd=this._onDiffEditorAdd.event,this._onDiffEditorRemove=this._register(new U),this.onDiffEditorRemove=this._onDiffEditorRemove.event,this._decorationOptionProviders=new Map,this._codeEditorOpenHandlers=new O,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)}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}removeDecorationType(e){const t=this._decorationOptionProviders.get(e);t&&(t.refCount--,t.refCount<=0&&(this._decorationOptionProviders.delete(e),t.dispose(),this.listCodeEditors().forEach((t=>t.removeDecorationsByType(e)))))}setModelProperty(e,t,i){const n=e.toString();let s;this._modelProperties.has(n)?s=this._modelProperties.get(n):(s=new Map,this._modelProperties.set(n,s)),s.set(t,i)}getModelProperty(e,t){const i=e.toString();if(this._modelProperties.has(i)){return this._modelProperties.get(i).get(t)}}openCodeEditor(e,t,i){return nee(this,void 0,void 0,(function*(){for(const n of this._codeEditorOpenHandlers){const s=yield n(e,t,i);if(null!==s)return s}return null}))}registerCodeEditorOpenHandler(e){return x(this._codeEditorOpenHandlers.unshift(e))}};see=tee([iee(0,P_)],see);var oee=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},ree=function(e,t){return function(i,n){t(i,n,e)}},aee=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let lee=class extends see{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(((e,t,i)=>aee(this,void 0,void 0,(function*(){return t?this.doOpenEditor(t,e):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 i=t.resource.scheme;if(i===vn.http||i===vn.https)return Cs(t.resource.toString()),e}return null}const i=t.options?t.options.selection:null;if(i)if("number"==typeof i.endLineNumber&&"number"==typeof i.endColumn)e.setSelection(i),e.revealRangeInCenter(i,1);else{const t={lineNumber:i.startLineNumber,column:i.startColumn};e.setPosition(t),e.revealPositionInCenter(t,1)}return e}findModel(e,t){const i=e.getModel();return i&&i.uri.toString()!==t.toString()?null:i}};lee=oee([ree(0,Ol),ree(1,P_)],lee),yu(Wa,lee,0);const hee=Ba("layoutService");var dee=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},cee=function(e,t){return function(i,n){t(i,n,e)}};let uee=class{get dimension(){return this._dimension||(this._dimension=Fn(window.document.body)),this._dimension}get hasContainer(){return!1}get container(){throw new Error("ILayoutService.container is not available in the standalone editor!")}focus(){var e;null===(e=this._codeEditorService.getFocusedCodeEditor())||void 0===e||e.focus()}constructor(e){this._codeEditorService=e,this.onDidLayout=B.None,this.offset={top:0,quickPickTop:0}}};uee=dee([cee(0,Wa)],uee);let gee=class extends uee{get hasContainer(){return!1}get container(){return this._container}constructor(e,t){super(t),this._container=e}};gee=dee([cee(1,Wa)],gee),yu(hee,uee,1);var pee=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},mee=function(e,t){return function(i,n){t(i,n,e)}},fee=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const _ee=!1;function vee(e){return e.scheme===vn.file?e.fsPath:e.path}let bee=0;class Cee{constructor(e,t,i,n,s,o,r){this.id=++bee,this.type=0,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=s,this.sourceId=o,this.sourceOrder=r,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}`}}class wee{constructor(e,t){this.resourceLabel=e,this.reason=t}}class yee{constructor(){this.elements=new Map}createMessage(){const e=[],t=[];for(const[,n]of this.elements){(0===n.reason?e:t).push(n.resourceLabel)}const i=[];return e.length>0&&i.push(ue(0,"The following files have been closed and modified on disk: {0}.",e.join(", "))),t.length>0&&i.push(ue(0,"The following files have been modified in an incompatible way: {0}.",t.join(", "))),i.join("\n")}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 See{constructor(e,t,i,n,s,o,r){this.id=++bee,this.type=1,this.actual=e,this.label=e.label,this.confirmBeforeUndo=e.confirmBeforeUndo||!1,this.resourceLabels=t,this.strResources=i,this.groupId=n,this.groupOrder=s,this.sourceId=o,this.sourceOrder=r,this.removedResources=null,this.invalidatedResources=null}canSplit(){return"function"==typeof this.actual.split}removeResource(e,t,i){this.removedResources||(this.removedResources=new yee),this.removedResources.has(t)||this.removedResources.set(t,new wee(e,i))}setValid(e,t,i){i?this.invalidatedResources&&(this.invalidatedResources.delete(t),0===this.invalidatedResources.size&&(this.invalidatedResources=null)):(this.invalidatedResources||(this.invalidatedResources=new yee),this.invalidatedResources.has(t)||this.invalidatedResources.set(t,new wee(e,0)))}toString(){return`[id:${this.id}] [group:${this.groupId}] [${this.invalidatedResources?"INVALID":" VALID"}] ${this.actual.constructor.name} - ${this.actual}`}}class Lee{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)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);for(const e of this._future)1===e.type&&e.removeResource(this.resourceLabel,this.strResource,0);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("\n")}flushAllElements(){this._past=[],this._future=[],this.versionId++}_setElementValidFlag(e,t){1===e.type?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)1===t.type&&t.removeResource(this.resourceLabel,this.strResource,1);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 dw(e,t)}restoreSnapshot(e){const t=e.elements.length;let i=!0,n=0,s=-1;for(let r=0,a=this._past.length;r=t||o.id!==e.elements[n])&&(i=!1,s=0),i||1!==o.type||o.removeResource(this.resourceLabel,this.strResource,0)}let o=-1;for(let r=this._future.length-1;r>=0;r--,n++){const s=this._future[r];i&&(n>=t||s.id!==e.elements[n])&&(i=!1,o=r),i||1!==s.type||s.removeResource(this.resourceLabel,this.strResource,0)}-1!==s&&(this._past=this._past.slice(0,s)),-1!==o&&(this._future=this._future.slice(o+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 0===this._past.length?null:this._past[this._past.length-1]}getSecondClosestPastElement(){return this._past.length<2?null:this._past[this._past.length-2]}getClosestFutureElement(){return 0===this._future.length?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 kee{constructor(e){this.editStacks=e,this._versionIds=[];for(let t=0,i=this.editStacks.length;tt.sourceOrder)&&(t=o,i=n))}return[t,i]}canUndo(e){if(e instanceof uw){const[,t]=this._findClosestUndoElementWithSource(e.id);return!!t}const t=this.getUriComparisonKey(e);if(this._editStacks.has(t)){return this._editStacks.get(t).hasPastElements()}return!1}_onError(e,t){r(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,s){const o=this._acquireLocks(i);let r;try{r=t()}catch(a){return o(),n.dispose(),this._onError(a,e)}return r?r.then((()=>(o(),n.dispose(),s())),(t=>(o(),n.dispose(),this._onError(t,e)))):(o(),n.dispose(),s())}_invokeWorkspacePrepare(e){return fee(this,void 0,void 0,(function*(){if(void 0===e.actual.prepareUndoRedo)return E.None;const t=e.actual.prepareUndoRedo();return void 0===t?E.None:t}))}_invokeResourcePrepare(e,t){if(1!==e.actual.type||void 0===e.actual.prepareUndoRedo)return t(E.None);const i=e.actual.prepareUndoRedo();return i?L(i)?t(i):i.then((e=>t(e))):t(E.None)}_getAffectedEditStacks(e){const t=[];for(const i of e.strResources)t.push(this._editStacks.get(i)||Dee);return new kee(t)}_tryToSplitAndUndo(e,t,i,n){if(t.canSplit())return this._splitPastWorkspaceElement(t,i),this._notificationService.warn(n),new Nee(this._undo(e,0,!0));for(const s of t.strResources)this.removeElements(s);return this._notificationService.warn(n),new Nee}_checkWorkspaceUndo(e,t,i,n){if(t.removedResources)return this._tryToSplitAndUndo(e,t,t.removedResources,ue(0,"Could not undo '{0}' across all files. {1}",t.label,t.removedResources.createMessage()));if(n&&t.invalidatedResources)return this._tryToSplitAndUndo(e,t,t.invalidatedResources,ue(0,"Could not undo '{0}' across all files. {1}",t.label,t.invalidatedResources.createMessage()));const s=[];for(const r of i.editStacks)r.getClosestPastElement()!==t&&s.push(r.resourceLabel);if(s.length>0)return this._tryToSplitAndUndo(e,t,null,ue(0,"Could not undo '{0}' across all files because changes were made to {1}",t.label,s.join(", ")));const o=[];for(const r of i.editStacks)r.locked&&o.push(r.resourceLabel);return o.length>0?this._tryToSplitAndUndo(e,t,null,ue(0,"Could not undo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,o.join(", "))):i.isValid()?null:this._tryToSplitAndUndo(e,t,null,ue(0,"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),s=this._checkWorkspaceUndo(e,t,n,!1);return s?s.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 i=t.getSecondClosestPastElement();if(i&&i.groupId===e.groupId)return!0}if(i.groupId===e.groupId)return!0}}return!1}_confirmAndExecuteWorkspaceUndo(e,t,i,n){return fee(this,void 0,void 0,(function*(){if(t.canSplit()&&!this._isPartOfUndoGroup(t)){let s;!function(e){e[e.All=0]="All",e[e.This=1]="This",e[e.Cancel=2]="Cancel"}(s||(s={}));const{result:o}=yield this._dialogService.prompt({type:gL.Info,message:ue(0,"Would you like to undo '{0}' across all files?",t.label),buttons:[{label:ue(0,"&&Undo in {0} Files",i.editStacks.length),run:()=>s.All},{label:ue(0,"Undo this &&File"),run:()=>s.This}],cancelButton:{run:()=>s.Cancel}});if(o===s.Cancel)return;if(o===s.This)return this._splitPastWorkspaceElement(t,null),this._undo(e,0,!0);const r=this._checkWorkspaceUndo(e,t,i,!1);if(r)return r.returnValue;n=!0}let s;try{s=yield this._invokeWorkspacePrepare(t)}catch(r){return this._onError(r,t)}const o=this._checkWorkspaceUndo(e,t,i,!0);if(o)return s.dispose(),o.returnValue;for(const e of i.editStacks)e.moveBackward(t);return this._safeInvokeWithLocks(t,(()=>t.actual.undo()),i,s,(()=>this._continueUndoInGroup(t.groupId,n)))}))}_resourceUndo(e,t,i){if(t.isValid){if(!e.locked)return this._invokeResourcePrepare(t,(n=>(e.moveBackward(t),this._safeInvokeWithLocks(t,(()=>t.actual.undo()),new kee([e]),n,(()=>this._continueUndoInGroup(t.groupId,i))))));{const e=ue(0,"Could not undo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(e)}}else e.flushAllElements()}_findClosestUndoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,s]of this._editStacks){const o=s.getClosestPastElement();o&&(o.groupId===e&&(!t||o.groupOrder>t.groupOrder)&&(t=o,i=n))}return[t,i]}_continueUndoInGroup(e,t){if(!e)return;const[,i]=this._findClosestUndoElementInGroup(e);return i?this._undo(i,0,t):void 0}undo(e){if(e instanceof uw){const[,t]=this._findClosestUndoElementWithSource(e.id);return t?this._undo(t,e.id,!1):void 0}return"string"==typeof e?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),s=n.getClosestPastElement();if(!s)return;if(s.groupId){const[e,n]=this._findClosestUndoElementInGroup(s.groupId);if(s!==e&&n)return this._undo(n,t,i)}if((s.sourceId!==t||s.confirmBeforeUndo)&&!i)return this._confirmAndContinueUndo(e,t,s);try{return 1===s.type?this._workspaceUndo(e,s,i):this._resourceUndo(n,s,i)}finally{_ee}}_confirmAndContinueUndo(e,t,i){return fee(this,void 0,void 0,(function*(){if((yield this._dialogService.confirm({message:ue(0,"Would you like to undo '{0}'?",i.label),primaryButton:ue(0,"&&Yes"),cancelButton:ue(0,"No")})).confirmed)return this._undo(e,t,!0)}))}_findClosestRedoElementWithSource(e){if(!e)return[null,null];let t=null,i=null;for(const[n,s]of this._editStacks){const o=s.getClosestFutureElement();o&&(o.sourceId===e&&(!t||o.sourceOrder0)return this._tryToSplitAndRedo(e,t,null,ue(0,"Could not redo '{0}' across all files because changes were made to {1}",t.label,s.join(", ")));const o=[];for(const r of i.editStacks)r.locked&&o.push(r.resourceLabel);return o.length>0?this._tryToSplitAndRedo(e,t,null,ue(0,"Could not redo '{0}' across all files because there is already an undo or redo operation running on {1}",t.label,o.join(", "))):i.isValid()?null:this._tryToSplitAndRedo(e,t,null,ue(0,"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)}_executeWorkspaceRedo(e,t,i){return fee(this,void 0,void 0,(function*(){let n;try{n=yield this._invokeWorkspacePrepare(t)}catch(o){return this._onError(o,t)}const s=this._checkWorkspaceRedo(e,t,i,!0);if(s)return n.dispose(),s.returnValue;for(const e of i.editStacks)e.moveForward(t);return this._safeInvokeWithLocks(t,(()=>t.actual.redo()),i,n,(()=>this._continueRedoInGroup(t.groupId)))}))}_resourceRedo(e,t){if(t.isValid){if(!e.locked)return this._invokeResourcePrepare(t,(i=>(e.moveForward(t),this._safeInvokeWithLocks(t,(()=>t.actual.redo()),new kee([e]),i,(()=>this._continueRedoInGroup(t.groupId))))));{const e=ue(0,"Could not redo '{0}' because there is already an undo or redo operation running.",t.label);this._notificationService.warn(e)}}else e.flushAllElements()}_findClosestRedoElementInGroup(e){if(!e)return[null,null];let t=null,i=null;for(const[n,s]of this._editStacks){const o=s.getClosestFutureElement();o&&(o.groupId===e&&(!t||o.groupOrder=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Iee=function(e,t){return function(i,n){t(i,n,e)}};let Mee=class extends E{constructor(e,t,i){super(),this._themeService=e,this._logService=t,this._languageService=i,this._caches=new WeakMap,this._register(this._themeService.onDidColorThemeChange((()=>{this._caches=new WeakMap})))}getStyling(e){return this._caches.has(e)||this._caches.set(e,new F6(e.getLegend(),this._themeService,this._languageService,this._logService)),this._caches.get(e)}};Mee=Eee([Iee(0,P_),Iee(1,hh),Iee(2,Lc)],Mee),yu(X6,Mee,1);var Tee=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const Ree="**",Aee="/",Oee="[/\\\\]",Pee="[^/\\\\]",Fee=/\//g;function Bee(e,t){switch(e){case 0:return"";case 1:return`${Pee}*?`;default:return`(?:${Oee}|${Pee}+${Oee}${t?`|${Oee}${Pee}+`:""})*?`}}function Wee(e,t){if(!e)return[];const i=[];let n=!1,s=!1,o="";for(const r of e){switch(r){case t:if(!n&&!s){i.push(o),o="";continue}break;case"{":n=!0;break;case"}":n=!1;break;case"[":s=!0;break;case"]":s=!1}o+=r}return o&&i.push(o),i}function Vee(e){if(!e)return"";let t="";const i=Wee(e,Aee);if(i.every((e=>e===Ree)))t=".*";else{let e=!1;i.forEach(((n,s)=>{if(n===Ree){if(e)return;t+=Bee(2,s===i.length-1)}else{let e=!1,o="",r=!1,a="";for(const i of n)if("}"!==i&&e)o+=i;else if(!r||"]"===i&&a)switch(i){case"{":e=!0;continue;case"[":r=!0;continue;case"}":{const i=`(?:${Wee(o,",").map((e=>Vee(e))).join("|")})`;t+=i,e=!1,o="";break}case"]":t+="["+a+"]",r=!1,a="";break;case"?":t+=Pee;continue;case"*":t+=Bee(1);continue;default:t+=eo(i)}else{let e;e="-"===i?i:"^"!==i&&"!"!==i||a?i===Aee?"":eo(i):"^",a+=e}sYee(e,t))).filter((e=>e!==Zee)),e),n=i.length;if(!n)return Zee;if(1===n)return i[0];const s=function(t,n){for(let s=0,o=i.length;s!!e.allBasenames));o&&(s.allBasenames=o.allBasenames);const r=i.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);r.length&&(s.allPaths=r);return s}(i,t):(s=jee.exec(Qee(i,t)))?Jee(s[1].substr(1),i,!0):(s=qee.exec(Qee(i,t)))?Jee(s[1],i,!1):function(e){try{const t=new RegExp(`^${Vee(e)}$`);return function(i){return t.lastIndex=0,"string"==typeof i&&t.test(i)?e:null}}catch(t){return Zee}}(i),$ee.set(n,o)),Xee(o,e)}function Xee(e,t){if("string"==typeof t)return e;const i=function(i,n){return pa(i,t.base,!Fe)?e(io(i.substr(t.base.length),Ji),n):null};return i.allBasenames=e.allBasenames,i.allPaths=e.allPaths,i.basenames=e.basenames,i.patterns=e.patterns,i}function Qee(e,t){return t.trimForExclusions&&e.endsWith("/**")?e.substr(0,e.length-2):e}function Jee(e,t,i){const n=Ji===qi.sep,s=n?e:e.replace(Fee,Ji),o=Ji+s,r=qi.sep+e;let a;return a=i?function(i,a){return"string"!=typeof i||i!==s&&!i.endsWith(o)&&(n||i!==e&&!i.endsWith(r))?null:t}:function(i,o){return"string"!=typeof i||i!==s&&(n||i!==e)?null:t},a.allPaths=[(i?"*/":"./")+e],a}function ete(e,t={}){if(!e)return Gee;if("string"==typeof e||function(e){const t=e;if(!t)return!1;return"string"==typeof t.base&&"string"==typeof t.pattern}(e)){const i=Yee(e,t);if(i===Zee)return Gee;const n=function(e,t){return!!i(e,t)};return i.allBasenames&&(n.allBasenames=i.allBasenames),i.allPaths&&(n.allPaths=i.allPaths),n}return function(e,t){const i=tte(Object.getOwnPropertyNames(e).map((i=>function(e,t,i){if(!1===t)return Zee;const n=Yee(e,i);if(n===Zee)return Zee;if("boolean"==typeof t)return n;if(t){const i=t.when;if("string"==typeof i){const t=(t,s,o,r)=>{if(!r||!n(t,s))return null;const a=r(i.replace("$(basename)",(()=>o)));return Zh(a)?a.then((t=>t?e:null)):a?e:null};return t.requiresSiblings=!0,t}}return n}(i,e[i],t))).filter((e=>e!==Zee))),n=i.length;if(!n)return Zee;if(!i.some((e=>!!e.requiresSiblings))){if(1===n)return i[0];const e=function(e,t){let n;for(let s=0,o=i.length;sTee(this,void 0,void 0,(function*(){for(const e of n){const t=yield e;if("string"==typeof t)return t}return null})))():null},t=i.find((e=>!!e.allBasenames));t&&(e.allBasenames=t.allBasenames);const s=i.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);return s.length&&(e.allPaths=s),e}const s=function(e,t,n){let s,o;for(let r=0,a=i.length;rTee(this,void 0,void 0,(function*(){for(const e of o){const t=yield e;if("string"==typeof t)return t}return null})))():null},o=i.find((e=>!!e.allBasenames));o&&(s.allBasenames=o.allBasenames);const r=i.reduce(((e,t)=>t.allPaths?e.concat(t.allPaths):e),[]);r.length&&(s.allPaths=r);return s}(e,t)}function tte(e,t){const i=e.filter((e=>!!e.basenames));if(i.length<2)return e;const n=i.reduce(((e,t)=>{const i=t.basenames;return i?e.concat(i):e}),[]);let s;if(t){s=[];for(let e=0,i=n.length;e{const i=t.patterns;return i?e.concat(i):e}),[]);const o=function(e,t){if("string"!=typeof e)return null;if(!t){let i;for(i=e.length;i>0;i--){const t=e.charCodeAt(i-1);if(47===t||92===t)break}t=e.substr(i)}const i=n.indexOf(t);return-1!==i?s[i]:null};o.basenames=n,o.patterns=s,o.allBasenames=n;const r=e.filter((e=>!e.basenames));return r.push(o),r}function ite(e,t,i,n,s,o){if(Array.isArray(e)){let r=0;for(const a of e){const e=ite(a,t,i,n,s,o);if(10===e)return e;e>r&&(r=e)}return r}if("string"==typeof e)return n?"*"===e?5:e===i?10:0:0;if(e){const{language:h,pattern:d,scheme:c,hasAccessToAllModels:u,notebookType:g}=e;if(!n&&!u)return 0;g&&s&&(t=s);let p=0;if(c)if(c===t.scheme)p=10;else{if("*"!==c)return 0;p=5}if(h)if(h===i)p=10;else{if("*"!==h)return 0;p=Math.max(p,5)}if(g)if(g===o)p=10;else{if("*"!==g||void 0===o)return 0;p=Math.max(p,5)}if(d){let e;if(e="string"==typeof d?d:Object.assign(Object.assign({},d),{base:$i(d.base)}),e!==t.fsPath&&(r=e,a=t.fsPath,!r||"string"!=typeof a||!ete(r)(a,void 0,l)))return 0;p=10}return p}return 0;var r,a,l}function nte(e){return"string"!=typeof e&&(Array.isArray(e)?e.every(nte):!!e.exclusive)}class ste{constructor(e,t,i,n){this.uri=e,this.languageId=t,this.notebookUri=i,this.notebookType=n}equals(e){var t,i;return this.notebookType===e.notebookType&&this.languageId===e.languageId&&this.uri.toString()===e.uri.toString()&&(null===(t=this.notebookUri)||void 0===t?void 0:t.toString())===(null===(i=e.notebookUri)||void 0===i?void 0:i.toString())}}class ote{constructor(e){this._notebookInfoResolver=e,this._clock=0,this._entries=[],this._onDidChange=new U,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),x((()=>{if(i){const e=this._entries.indexOf(i);e>=0&&(this._entries.splice(e,1),this._lastCandidate=void 0,this._onDidChange.fire(this._entries.length),i=void 0)}}))}has(e){return this.all(e).length>0}all(e){if(!e)return[];this._updateScores(e);const t=[];for(const i of this._entries)i._score>0&&t.push(i.provider);return t}ordered(e){const t=[];return this._orderedForEach(e,(e=>t.push(e.provider))),t}orderedGroups(e){const t=[];let i,n;return this._orderedForEach(e,(e=>{i&&n===e._score?i.push(e.provider):(n=e._score,i=[e.provider],t.push(i))})),t}_orderedForEach(e,t){this._updateScores(e);for(const i of this._entries)i._score>0&&t(i)}_updateScores(e){var t,i;const n=null===(t=this._notebookInfoResolver)||void 0===t?void 0:t.call(this,e.uri),s=n?new ste(e.uri,e.getLanguageId(),n.uri,n.type):new ste(e.uri,e.getLanguageId(),void 0,void 0);if(!(null===(i=this._lastCandidate)||void 0===i?void 0:i.equals(s))){this._lastCandidate=s;for(const t of this._entries)if(t._score=ite(t.selector,s.uri,s.languageId,Id(e),s.notebookUri,s.notebookType),nte(t.selector)&&t._score>0){for(const e of this._entries)e._score=0;t._score=1e3;break}this._entries.sort(ote._compareByScoreAndTime)}}static _compareByScoreAndTime(e,t){return e._scoret._score?-1:rte(e.selector)&&!rte(t.selector)?1:!rte(e.selector)&&rte(t.selector)?-1:e._timet._time?-1:0}}function rte(e){return"string"!=typeof e&&(Array.isArray(e)?e.some(rte):Boolean(e.isBuiltin))}function ate(e){return Object.isFrozen(e)?e:function(e){if(!e||"object"!=typeof e)return e;const t=[e];for(;t.length>0;){const e=t.shift();Object.freeze(e);for(const i in e)if(pd.call(e,i)){const n=e[i];"object"!=typeof n||Object.isFrozen(n)||Wr(n)||t.push(n)}}return e}(e)}yu(oL,class{constructor(){this.referenceProvider=new ote(this._score.bind(this)),this.renameProvider=new ote(this._score.bind(this)),this.codeActionProvider=new ote(this._score.bind(this)),this.definitionProvider=new ote(this._score.bind(this)),this.typeDefinitionProvider=new ote(this._score.bind(this)),this.declarationProvider=new ote(this._score.bind(this)),this.implementationProvider=new ote(this._score.bind(this)),this.documentSymbolProvider=new ote(this._score.bind(this)),this.inlayHintsProvider=new ote(this._score.bind(this)),this.colorProvider=new ote(this._score.bind(this)),this.codeLensProvider=new ote(this._score.bind(this)),this.documentFormattingEditProvider=new ote(this._score.bind(this)),this.documentRangeFormattingEditProvider=new ote(this._score.bind(this)),this.onTypeFormattingEditProvider=new ote(this._score.bind(this)),this.signatureHelpProvider=new ote(this._score.bind(this)),this.hoverProvider=new ote(this._score.bind(this)),this.documentHighlightProvider=new ote(this._score.bind(this)),this.selectionRangeProvider=new ote(this._score.bind(this)),this.foldingRangeProvider=new ote(this._score.bind(this)),this.linkProvider=new ote(this._score.bind(this)),this.inlineCompletionsProvider=new ote(this._score.bind(this)),this.completionProvider=new ote(this._score.bind(this)),this.linkedEditingRangeProvider=new ote(this._score.bind(this)),this.documentRangeSemanticTokensProvider=new ote(this._score.bind(this)),this.documentSemanticTokensProvider=new ote(this._score.bind(this)),this.documentOnDropEditProvider=new ote(this._score.bind(this)),this.documentPasteEditProvider=new ote(this._score.bind(this))}_score(e){var t;return null===(t=this._notebookTypeResolver)||void 0===t?void 0:t.call(this,e)}},1);class lte{constructor(e={},t=[],i=[],n){this._contents=e,this._keys=t,this._overrides=i,this.raw=n,this.overrideConfigurations=new Map}get rawConfiguration(){var e;if(!this._rawConfiguration)if(null===(e=this.raw)||void 0===e?void 0:e.length){const e=this.raw.map((e=>{if(e instanceof lte)return e;const t=new hte("");return t.parseRaw(e),t.configurationModel}));this._rawConfiguration=e.reduce(((e,t)=>t===e?t:e.merge(t)),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 0===this._keys.length&&0===Object.keys(this._contents).length&&0===this._overrides.length}getValue(e){return e?bu(this.contents,e):this.contents}inspect(e,t){const i=this.rawConfiguration.getValue(e);return{value:i,override:t?this.rawConfiguration.getOverrideValue(e,t):void 0,merged:t?this.rawConfiguration.override(t).getValue(e):i}}getOverrideValue(e,t){const i=this.getContentsForOverrideIdentifer(t);return i?e?bu(i,e):i:void 0}override(e){let t=this.overrideConfigurations.get(e);return t||(t=this.createOverrideConfigurationModel(e),this.overrideConfigurations.set(e,t)),t}merge(...e){var t,i;const n=gd(this.contents),s=gd(this.overrides),o=[...this.keys],r=(null===(t=this.raw)||void 0===t?void 0:t.length)?[...this.raw]:[this];for(const a of e)if(r.push(...(null===(i=a.raw)||void 0===i?void 0:i.length)?a.raw:[a]),!a.isEmpty()){this.mergeContents(n,a.contents);for(const e of a.overrides){const[t]=s.filter((t=>Td(t.identifiers,e.identifiers)));t?(this.mergeContents(t.contents,e.contents),t.keys.push(...e.keys),t.keys=zd(t.keys)):s.push(gd(e))}for(const e of a.keys)-1===o.indexOf(e)&&o.push(e)}return new lte(n,o,s,r.every((e=>e instanceof lte))?void 0:r)}createOverrideConfigurationModel(e){const t=this.getContentsForOverrideIdentifer(e);if(!t||"object"!=typeof t||!Object.keys(t).length)return this;const i={};for(const n of zd([...Object.keys(this.contents),...Object.keys(t)])){let e=this.contents[n];const s=t[n];s&&("object"==typeof e&&"object"==typeof s?(e=gd(e),this.mergeContents(e,s)):e=s),i[n]=e}return new lte(i,this.keys,this.overrides)}mergeContents(e,t){for(const i of Object.keys(t))i in e&&Br(e[i])&&Br(t[i])?this.mergeContents(e[i],t[i]):e[i]=gd(t[i])}getContentsForOverrideIdentifer(e){let t=null,i=null;const n=e=>{e&&(i?this.mergeContents(i,e):i=gd(e))};for(const s of this.overrides)1===s.identifiers.length&&s.identifiers[0]===e?t=s.contents:s.identifiers.includes(e)&&n(s.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);-1!==t&&(this.keys.splice(t,1),_u(this.contents,e),Wu.test(e)&&this.overrides.splice(this.overrides.findIndex((t=>Td(t.identifiers,Vu(e)))),1))}updateValue(e,t,i){fu(this.contents,e,t,(e=>console.error(e))),(i=i||-1===this.keys.indexOf(e))&&this.keys.push(e),Wu.test(e)&&this.overrides.push({identifiers:Vu(e),keys:Object.keys(this.contents[e]),contents:mu(this.contents[e],(e=>console.error(e)))})}}class hte{constructor(e){this._name=e,this._raw=null,this._configurationModel=null,this._restrictedConfigurations=[]}get configurationModel(){return this._configurationModel||new lte}parseRaw(e,t){this._raw=e;const{contents:i,keys:n,overrides:s,restricted:o,hasExcludedProperties:r}=this.doParseRaw(e,t);this._configurationModel=new lte(i,n,s,r?[e]:void 0),this._restrictedConfigurations=o||[]}doParseRaw(e,t){const i=jl.as(xu).getConfigurationProperties(),n=this.filter(e,i,!0,t);return{contents:mu(e=n.raw,(e=>console.error(`Conflict in settings file ${this._name}: ${e}`))),keys:Object.keys(e),overrides:this.toOverrides(e,(e=>console.error(`Conflict in settings file ${this._name}: ${e}`))),restricted:n.restricted,hasExcludedProperties:n.hasExcludedProperties}}filter(e,t,i,n){var s,o,r;let a=!1;if(!(null==n?void 0:n.scopes)&&!(null==n?void 0:n.skipRestricted)&&!(null===(s=null==n?void 0:n.exclude)||void 0===s?void 0:s.length))return{raw:e,restricted:[],hasExcludedProperties:a};const l={},h=[];for(const d in e)if(Wu.test(d)&&i){const i=this.filter(e[d],t,!1,n);l[d]=i.raw,a=a||i.hasExcludedProperties,h.push(...i.restricted)}else{const i=t[d],s=i?void 0!==i.scope?i.scope:3:void 0;(null==i?void 0:i.restricted)&&h.push(d),(null===(o=n.exclude)||void 0===o?void 0:o.includes(d))||!(null===(r=n.include)||void 0===r?void 0:r.includes(d))&&(void 0!==s&&void 0!==n.scopes&&!n.scopes.includes(s)||n.skipRestricted&&(null==i?void 0:i.restricted))?a=!0:l[d]=e[d]}return{raw:l,restricted:h,hasExcludedProperties:a}}toOverrides(e,t){const i=[];for(const n of Object.keys(e))if(Wu.test(n)){const s={};for(const t in e[n])s[t]=e[n][t];i.push({identifiers:Vu(n),keys:Object.keys(s),contents:mu(s,t)})}return i}}class dte{constructor(e,t,i,n,s,o,r,a,l,h,d,c,u){this.key=e,this.overrides=t,this._value=i,this.overrideIdentifiers=n,this.defaultConfiguration=s,this.policyConfiguration=o,this.applicationConfiguration=r,this.userConfiguration=a,this.localUserConfiguration=l,this.remoteUserConfiguration=h,this.workspaceConfiguration=d,this.folderConfigurationModel=c,this.memoryConfigurationModel=u}inspect(e,t,i){const n=e.inspect(t,i);return{get value(){return ate(n.value)},get override(){return ate(n.override)},get merged(){return ate(n.merged)}}}get userInspectValue(){return this._userInspectValue||(this._userInspectValue=this.inspect(this.userConfiguration,this.key,this.overrides.overrideIdentifier)),this._userInspectValue}get user(){return void 0!==this.userInspectValue.value||void 0!==this.userInspectValue.override?{value:this.userInspectValue.value,override:this.userInspectValue.override}:void 0}}class cte{constructor(e,t,i,n,s=new lte,o=new lte,r=new Us,a=new lte,l=new Us){this._defaultConfiguration=e,this._policyConfiguration=t,this._applicationConfiguration=i,this._localUserConfiguration=n,this._remoteUserConfiguration=s,this._workspaceConfiguration=o,this._folderConfigurations=r,this._memoryConfiguration=a,this._memoryConfigurationByResource=l,this._workspaceConsolidatedConfiguration=null,this._foldersConsolidatedConfigurations=new Us,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=new lte,this._memoryConfigurationByResource.set(i.resource,n))):n=this._memoryConfiguration,void 0===t?n.removeValue(e):n.setValue(e,t),i.resource||(this._workspaceConsolidatedConfiguration=null)}inspect(e,t,i){const n=this.getConsolidatedConfigurationModel(e,t,i),s=this.getFolderConfigurationModelForResource(t.resource,i),o=t.resource&&this._memoryConfigurationByResource.get(t.resource)||this._memoryConfiguration,r=new Set;for(const a of n.overrides)for(const t of a.identifiers)void 0!==n.getOverrideValue(e,t)&&r.add(t);return new dte(e,t,n.getValue(e),r.size?[...r]: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,s||void 0,o)}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}getConsolidatedConfigurationModel(e,t,i){let n=this.getConsolidatedConfigurationModelForResource(t,i);return t.overrideIdentifier&&(n=n.override(t.overrideIdentifier)),this._policyConfiguration.isEmpty()||void 0===this._policyConfiguration.getValue(e)||(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 s=this._memoryConfigurationByResource.get(e);s&&(i=i.merge(s))}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:s}=this._folderConfigurations.get(t);return e.push([t,{contents:i,overrides:n,keys:s}]),e}),[])}}static parse(e){const t=this.parseConfigurationModel(e.defaults),i=this.parseConfigurationModel(e.policy),n=this.parseConfigurationModel(e.application),s=this.parseConfigurationModel(e.user),o=this.parseConfigurationModel(e.workspace),r=e.folders.reduce(((e,t)=>(e.set(an.revive(t[0]),this.parseConfigurationModel(t[1])),e)),new Us);return new cte(t,i,n,s,new lte,o,r,new lte,new Us)}static parseConfigurationModel(e){return new lte(e.contents,e.keys,e.overrides)}}class ute{constructor(e,t,i,n){this.change=e,this.previous=t,this.currentConfiguraiton=i,this.currentWorkspace=n,this._marker="\n",this._markerCode1=this._marker.charCodeAt(0),this._markerCode2=".".charCodeAt(0),this.affectedKeys=new Set,this._previousConfiguration=void 0;for(const s of e.keys)this.affectedKeys.add(s);for(const[,s]of e.overrides)for(const e of s)this.affectedKeys.add(e);this._affectsConfigStr=this._marker;for(const s of this.affectedKeys)this._affectsConfigStr+=s+this._marker}get previousConfiguration(){return!this._previousConfiguration&&this.previous&&(this._previousConfiguration=cte.parse(this.previous.data)),this._previousConfiguration}affectsConfiguration(e,t){var i;const n=this._marker+e,s=this._affectsConfigStr.indexOf(n);if(s<0)return!1;const o=s+n.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){return!vd(this.previousConfiguration?this.previousConfiguration.getValue(e,t,null===(i=this.previous)||void 0===i?void 0:i.workspace):void 0,this.currentConfiguraiton.getValue(e,t,this.currentWorkspace))}return!0}}const gte={kind:0},pte={kind:1};class mte{constructor(e,t,i){var n;this._log=i,this._defaultKeybindings=e,this._defaultBoundCommands=new Map;for(const s of e){const e=s.command;e&&"-"!==e.charAt(0)&&this._defaultBoundCommands.set(e,!0)}this._map=new Map,this._lookupMap=new Map,this._keybindings=mte.handleRemovals([].concat(e).concat(t));for(let s=0,o=this._keybindings.length;s=0;n--){const e=i[n];if(e.command===t.command)continue;let s=!0;for(let i=1;i=0;n--){const e=i[n];if(t.contextMatchesRules(e.when))return e}return i[i.length-1]}resolve(e,t,i){const n=[...t,i];this._log(`| Resolving ${n}`);const s=this._map.get(n[0]);if(void 0===s)return this._log("\\ No keybinding entries."),gte;let o=null;if(n.length<2)o=s;else{o=[];for(let e=0,t=s.length;et.chords.length)continue;let i=!0;for(let e=1;e=0;i--){const n=t[i];if(mte._contextMatchesRules(e,n.when))return n}return null}static _contextMatchesRules(e,t){return!t||t.evaluate(e)}}function fte(e){return e?`${e.serialize()}`:"no when condition"}function _te(e){return e.extensionId?e.isBuiltinExtension?`built-in extension ${e.extensionId}`:`user extension ${e.extensionId}`:e.isDefault?"built-in":"user"}const vte=/^(cursor|delete|undo|redo|tab|editor\.action\.clipboard)/;class bte extends E{get onDidUpdateKeybindings(){return this._onDidUpdateKeybindings?this._onDidUpdateKeybindings.event:B.None}get inChordMode(){return this._currentChords.length>0}constructor(e,t,i,n,s){super(),this._contextKeyService=e,this._commandService=t,this._telemetryService=i,this._notificationService=n,this._logService=s,this._onDidUpdateKeybindings=this._register(new U),this._currentChords=[],this._currentChordChecker=new od,this._currentChordStatusMessage=null,this._ignoreSingleModifiers=Cte.EMPTY,this._currentSingleModifier=null,this._currentSingleModifierClearTimeout=new sd,this._logging=!1}dispose(){super.dispose()}_log(e){this._logging&&this._logService.info(`[KeybindingService]: ${e}`)}getKeybindings(){return this._getResolver().getKeybindings()}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"),gte;const[n]=i.getDispatchChords();if(null===n)return this._log("\\ Keyboard event cannot be dispatched"),gte;const s=this._contextKeyService.getContext(t),o=this._currentChords.map((({keypress:e})=>e));return this._getResolver().resolve(s,o,n)}_scheduleLeaveChordMode(){const e=Date.now();this._currentChordChecker.cancelAndSet((()=>{this._documentHasFocus()?Date.now()-e>5e3&&this._leaveChordMode():this._leaveChordMode()}),500)}_expectAnotherChord(e,t){switch(this._currentChords.push({keypress:e,label:t}),this._currentChords.length){case 0:throw g("impossible");case 1:this._currentChordStatusMessage=this._notificationService.status(ue(0,"({0}) was pressed. Waiting for second key of chord...",t));break;default:{const e=this._currentChords.map((({label:e})=>e)).join(", ");this._currentChordStatusMessage=this._notificationService.status(ue(0,"({0}) was pressed. Waiting for next key of chord...",e))}}this._scheduleLeaveChordMode(),_O.enabled&&_O.disable()}_leaveChordMode(){this._currentChordStatusMessage&&(this._currentChordStatusMessage.dispose(),this._currentChordStatusMessage=null),this._currentChordChecker.cancel(),this._currentChords=[],_O.enable()}_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=Cte.EMPTY,this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1):(this._ignoreSingleModifiers=Cte.EMPTY,null===this._currentSingleModifier?(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[s]=i.getChords();return this._ignoreSingleModifiers=new Cte(s),null!==this._currentSingleModifier&&this._log("+ Clearing single modifier due to other key up."),this._currentSingleModifierClearTimeout.cancel(),this._currentSingleModifier=null,!1}_doDispatch(e,t,i=!1){var n;let s=!1;if(e.hasMultipleChords())return console.warn("Unexpected keyboard event mapped to multiple chords"),!1;let o=null,r=null;if(i){const[t]=e.getSingleModifierDispatchChords();o=t,r=t?[t]:[]}else[o]=e.getDispatchChords(),r=this._currentChords.map((({keypress:e})=>e));if(null===o)return this._log("\\ Keyboard event cannot be dispatched in keydown phase."),s;const a=this._contextKeyService.getContext(t),l=e.getLabel(),h=this._getResolver().resolve(a,r,o);switch(h.kind){case 0:if(this._logService.trace("KeybindingService#dispatch",l,"[ No matching keybinding ]"),this.inChordMode){const e=this._currentChords.map((({label:e})=>e)).join(", ");this._log(`+ Leaving multi-chord mode: Nothing bound to "${e}, ${l}".`),this._notificationService.status(ue(0,"The key combination ({0}, {1}) is not a command.",e,l),{hideAfter:1e4}),this._leaveChordMode(),s=!0}return s;case 1:return this._logService.trace("KeybindingService#dispatch",l,"[ Several keybindings match - more chords needed ]"),s=!0,this._expectAnotherChord(o,l),this._log(1===this._currentChords.length?"+ Entering multi-chord mode...":"+ Continuing multi-chord mode..."),s;case 2:if(this._logService.trace("KeybindingService#dispatch",l,`[ Will dispatch command ${h.commandId} ]`),null===h.commandId||""===h.commandId){if(this.inChordMode){const e=this._currentChords.map((({label:e})=>e)).join(", ");this._log(`+ Leaving chord mode: Nothing bound to "${e}, ${l}".`),this._notificationService.status(ue(0,"The key combination ({0}, {1}) is not a command.",e,l),{hideAfter:1e4}),this._leaveChordMode(),s=!0}}else this.inChordMode&&this._leaveChordMode(),h.isBubble||(s=!0),this._log(`+ Invoking command ${h.commandId}.`),void 0===h.commandArgs?this._commandService.executeCommand(h.commandId).then(void 0,(e=>this._notificationService.warn(e))):this._commandService.executeCommand(h.commandId,h.commandArgs).then(void 0,(e=>this._notificationService.warn(e))),vte.test(h.commandId)||this._telemetryService.publicLog2("workbenchActionExecuted",{id:h.commandId,from:"keybinding",detail:null!==(n=e.getUserSettingsLabel())&&void 0!==n?n:void 0});return s}}mightProducePrintableCharacter(e){return!e.ctrlKey&&!e.metaKey&&(e.keyCode>=31&&e.keyCode<=56||e.keyCode>=21&&e.keyCode<=30)}}class Cte{constructor(e){this._ctrlKey=!!e&&e.ctrlKey,this._shiftKey=!!e&&e.shiftKey,this._altKey=!!e&&e.altKey,this._metaKey=!!e&&e.metaKey}has(e){switch(e){case"ctrl":return this._ctrlKey;case"shift":return this._shiftKey;case"alt":return this._altKey;case"meta":return this._metaKey}}}Cte.EMPTY=new Cte(null);class wte{constructor(e,t,i,n,s,o,r){this._resolvedKeybindingItemBrand=void 0,this.resolvedKeybinding=e,this.chords=e?yte(e.getDispatchChords()):[],e&&0===this.chords.length&&(this.chords=yte(e.getSingleModifierDispatchChords())),this.bubble=!!t&&94===t.charCodeAt(0),this.command=this.bubble?t.substr(1):t,this.commandArgs=i,this.when=n,this.isDefault=s,this.extensionId=o,this.isBuiltinExtension=r}}function yte(e){const t=[];for(let i=0,n=e.length;ithis._getLabel(e)))}getAriaLabel(){return Px.toLabel(this._os,this._chords,(e=>this._getAriaLabel(e)))}getElectronAccelerator(){return this._chords.length>1||this._chords[0].isDuplicateModifierCase()?null:Fx.toLabel(this._os,this._chords,(e=>this._getElectronAccelerator(e)))}getUserSettingsLabel(){return Bx.toLabel(this._os,this._chords,(e=>this._getUserSettingsLabel(e)))}hasMultipleChords(){return this._chords.length>1}getChords(){return this._chords.map((e=>this._getChord(e)))}_getChord(e){return new bt(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 Lte extends Ste{constructor(e,t){super(t,e)}_keyCodeToUILabel(e){if(2===this._os)switch(e){case 15:return"\u2190";case 16:return"\u2191";case 17:return"\u2192";case 18:return"\u2193"}return gt.toString(e)}_getLabel(e){return e.isDuplicateModifierCase()?"":this._keyCodeToUILabel(e.keyCode)}_getAriaLabel(e){return e.isDuplicateModifierCase()?"":gt.toString(e.keyCode)}_getElectronAccelerator(e){return gt.toElectronAccelerator(e.keyCode)}_getUserSettingsLabel(e){if(e.isDuplicateModifierCase())return"";const t=gt.toUserSettingsUS(e.keyCode);return t?t.toLowerCase():t}_getChordDispatch(e){return Lte.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+=gt.toString(e.keyCode),t}_getSingleModifierChordDispatch(e){return 5!==e.keyCode||e.shiftKey||e.altKey||e.metaKey?4!==e.keyCode||e.ctrlKey||e.altKey||e.metaKey?6!==e.keyCode||e.ctrlKey||e.shiftKey||e.metaKey?57!==e.keyCode||e.ctrlKey||e.shiftKey||e.altKey?null:"meta":"alt":"shift":"ctrl"}static _scanCodeToKeyCode(e){const t=ct[e];if(-1!==t)return t;switch(e){case 10:return 31;case 11:return 32;case 12:return 33;case 13:return 34;case 14:return 35;case 15:return 36;case 16:return 37;case 17:return 38;case 18:return 39;case 19:return 40;case 20:return 41;case 21:return 42;case 22:return 43;case 23:return 44;case 24:return 45;case 25:return 46;case 26:return 47;case 27:return 48;case 28:return 49;case 29:return 50;case 30:return 51;case 31:return 52;case 32:return 53;case 33:return 54;case 34:return 55;case 35:return 56;case 36:return 22;case 37:return 23;case 38:return 24;case 39:return 25;case 40:return 26;case 41:return 27;case 42:return 28;case 43:return 29;case 44:return 30;case 45:return 21;case 51:return 88;case 52:return 86;case 53:return 92;case 54:return 94;case 55:return 93;case 56:return 0;case 57:return 85;case 58:return 95;case 59:return 91;case 60:return 87;case 61:return 89;case 62:return 90;case 106:return 97}return 0}static _toKeyCodeChord(e){if(!e)return null;if(e instanceof _t)return e;const t=this._scanCodeToKeyCode(e.scanCode);return 0===t?null:new _t(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,t)}static resolveKeybinding(e,t){const i=yte(e.chords.map((e=>this._toKeyCodeChord(e))));return i.length>0?[new Lte(i,t)]:[]}}var kte;function Dte(e,t,i){const n=i.mode===kte.ALIGN?i.offset:i.offset+i.size,s=i.mode===kte.ALIGN?i.offset+i.size:i.offset;return 0===i.position?t<=e-n?n:t<=s?s-t:Math.max(e-t,0):t<=s?s-t:t<=e-n?n:0}!function(e){e[e.AVOID=0]="AVOID",e[e.ALIGN=1]="ALIGN"}(kte||(kte={}));class xte extends E{constructor(e,t){super(),this.container=null,this.delegate=null,this.toDisposeOnClean=E.None,this.toDisposeOnSetContainer=E.None,this.shadowRoot=null,this.shadowRootHostElement=null,this.view=fs(".context-view"),this.useFixedPosition=!1,this.useShadowDOM=!1,vs(this.view),this.setContainer(e,t),this._register(x((()=>this.setContainer(null,1))))}setContainer(e,t){var i;if(this.container&&(this.toDisposeOnSetContainer.dispose(),this.shadowRoot?(this.shadowRoot.removeChild(this.view),this.shadowRoot=null,null===(i=this.shadowRootHostElement)||void 0===i||i.remove(),this.shadowRootHostElement=null):this.container.removeChild(this.view),this.container=null),e){if(this.container=e,this.useFixedPosition=1!==t,this.useShadowDOM=3===t,this.useShadowDOM){this.shadowRootHostElement=fs(".shadow-root-host"),this.container.appendChild(this.shadowRootHostElement),this.shadowRoot=this.shadowRootHostElement.attachShadow({mode:"open"});const e=document.createElement("style");e.textContent=Nte,this.shadowRoot.appendChild(e),this.shadowRoot.appendChild(this.view),this.shadowRoot.appendChild(fs("slot"))}else this.container.appendChild(this.view);const i=new N;xte.BUBBLE_UP_EVENTS.forEach((e=>{i.add(Mn(this.container,e,(e=>{this.onDOMEvent(e,!1)})))})),xte.BUBBLE_DOWN_EVENTS.forEach((e=>{i.add(Mn(this.container,e,(e=>{this.onDOMEvent(e,!0)}),!0))})),this.toDisposeOnSetContainer=i}}show(e){var t,i;this.isVisible()&&this.hide(),Dn(this.view),this.view.className="context-view",this.view.style.top="0px",this.view.style.left="0px",this.view.style.zIndex="2575",this.view.style.position=this.useFixedPosition?"fixed":"absolute",_s(this.view),this.toDisposeOnClean=e.render(this.view)||E.None,this.delegate=e,this.doLayout(),null===(i=(t=this.delegate).focus)||void 0===i||i.call(t)}getViewElement(){return this.view}layout(){this.isVisible()&&(!1!==this.delegate.canRelayout||He&&tt?(this.delegate.layout&&this.delegate.layout(),this.doLayout()):this.hide())}doLayout(){if(!this.isVisible())return;const e=this.delegate.getAnchor();let t;if(ss(e)){const i=Hn(e),n=function(e){let t=e,i=1;do{const e=Pn(t).zoom;null!=e&&"1"!==e&&(i*=e),t=t.parentElement}while(null!==t&&t!==t.ownerDocument.documentElement);return i}(e);t={top:i.top*n,left:i.left*n,width:i.width*n,height:i.height*n}}else t=function(e){const t=e;return!!t&&"number"==typeof t.x&&"number"==typeof t.y}(e)?{top:e.y,left:e.x,width:e.width||1,height:e.height||2}:{top:e.posy,left:e.posx,width:2,height:2};const i=zn(this.view),n=jn(this.view),s=this.delegate.anchorPosition||0,o=this.delegate.anchorAlignment||0;let r,a;if(0===(this.delegate.anchorAxisAlignment||0)){const e={offset:t.top-window.pageYOffset,size:t.height,position:0===s?0:1},l={offset:t.left,size:t.width,position:0===o?0:1,mode:kte.ALIGN};r=Dte(window.innerHeight,n,e)+window.pageYOffset,PD.intersects({start:r,end:r+n},{start:e.offset,end:e.offset+e.size})&&(l.mode=kte.AVOID),a=Dte(window.innerWidth,i,l)}else{const e={offset:t.left,size:t.width,position:0===o?0:1},l={offset:t.top,size:t.height,position:0===s?0:1,mode:kte.ALIGN};a=Dte(window.innerWidth,i,e),PD.intersects({start:a,end:a+i},{start:e.offset,end:e.offset+e.size})&&(l.mode=kte.AVOID),r=Dte(window.innerHeight,n,l)+window.pageYOffset}this.view.classList.remove("top","bottom","left","right"),this.view.classList.add(0===s?"bottom":"top"),this.view.classList.add(0===o?"left":"right"),this.view.classList.toggle("fixed",this.useFixedPosition);const l=Hn(this.container);this.view.style.top=r-(this.useFixedPosition?Hn(this.view).top:l.top)+"px",this.view.style.left=a-(this.useFixedPosition?Hn(this.view).left:l.left)+"px",this.view.style.width="initial"}hide(e){const t=this.delegate;this.delegate=null,(null==t?void 0:t.onHide)&&t.onHide(e),this.toDisposeOnClean.dispose(),vs(this.view)}isVisible(){return!!this.delegate}onDOMEvent(e,t){this.delegate&&(this.delegate.onDOMEvent?this.delegate.onDOMEvent(e,document.activeElement):t&&!qn(e.target,this.container)&&this.hide())}dispose(){this.hide(),super.dispose()}}xte.BUBBLE_UP_EVENTS=["click","keydown","focus","blur"],xte.BUBBLE_DOWN_EVENTS=["click"];const Nte='\n\t:host {\n\t\tall: initial; /* 1st rule so subsequent properties are reset. */\n\t}\n\n\t.codicon[class*=\'codicon-\'] {\n\t\tfont: normal normal normal 16px/1 codicon;\n\t\tdisplay: inline-block;\n\t\ttext-decoration: none;\n\t\ttext-rendering: auto;\n\t\ttext-align: center;\n\t\t-webkit-font-smoothing: antialiased;\n\t\t-moz-osx-font-smoothing: grayscale;\n\t\tuser-select: none;\n\t\t-webkit-user-select: none;\n\t\t-ms-user-select: none;\n\t}\n\n\t:host {\n\t\tfont-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", system-ui, "Ubuntu", "Droid Sans", sans-serif;\n\t}\n\n\t:host-context(.mac) { font-family: -apple-system, BlinkMacSystemFont, sans-serif; }\n\t:host-context(.mac:lang(zh-Hans)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif; }\n\t:host-context(.mac:lang(zh-Hant)) { font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", sans-serif; }\n\t:host-context(.mac:lang(ja)) { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic Pro", sans-serif; }\n\t:host-context(.mac:lang(ko)) { font-family: -apple-system, BlinkMacSystemFont, "Nanum Gothic", "Apple SD Gothic Neo", "AppleGothic", sans-serif; }\n\n\t:host-context(.windows) { font-family: "Segoe WPC", "Segoe UI", sans-serif; }\n\t:host-context(.windows:lang(zh-Hans)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft YaHei", sans-serif; }\n\t:host-context(.windows:lang(zh-Hant)) { font-family: "Segoe WPC", "Segoe UI", "Microsoft Jhenghei", sans-serif; }\n\t:host-context(.windows:lang(ja)) { font-family: "Segoe WPC", "Segoe UI", "Yu Gothic UI", "Meiryo UI", sans-serif; }\n\t:host-context(.windows:lang(ko)) { font-family: "Segoe WPC", "Segoe UI", "Malgun Gothic", "Dotom", sans-serif; }\n\n\t:host-context(.linux) { font-family: system-ui, "Ubuntu", "Droid Sans", sans-serif; }\n\t:host-context(.linux:lang(zh-Hans)) { font-family: system-ui, "Ubuntu", "Droid Sans", "Source Han Sans SC", "Source Han Sans CN", "Source Han Sans", sans-serif; }\n\t: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; }\n\t: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; }\n\t: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; }\n';var Ete=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Ite=function(e,t){return function(i,n){t(i,n,e)}};let Mte=class extends E{constructor(e){super(),this.layoutService=e,this.currentViewDisposable=E.None,this.container=e.hasContainer?e.container:null,this.contextView=this._register(new xte(this.container,1)),this.layout(),this._register(e.onDidLayout((()=>this.layout())))}setContainer(e,t){this.contextView.setContainer(e,t||1)}showContextView(e,t,i){t?t===this.container&&this.shadowRoot===i||(this.container=t,this.setContainer(t,i?3:2)):this.layoutService.hasContainer&&this.container!==this.layoutService.container&&(this.container=this.layoutService.container,this.setContainer(this.container,1)),this.shadowRoot=i,this.contextView.show(e);const n=x((()=>{this.currentViewDisposable===n&&this.hideContextView()}));return this.currentViewDisposable=n,n}getContextViewElement(){return this.contextView.getViewElement()}layout(){this.contextView.layout()}hideContextView(e){this.contextView.hide(e)}};Mte=Ete([Ite(0,hee)],Mte);let Tte=[],Rte=[],Ate=[];function Ote(e,t=!1){!function(e,t,i){const n=function(e,t){return{id:e.id,mime:e.mime,filename:e.filename,extension:e.extension,filepattern:e.filepattern,firstline:e.firstline,userConfigured:t,filenameLowercase:e.filename?e.filename.toLowerCase():void 0,extensionLowercase:e.extension?e.extension.toLowerCase():void 0,filepatternLowercase:e.filepattern?ete(e.filepattern.toLowerCase()):void 0,filepatternOnPath:!!e.filepattern&&e.filepattern.indexOf(qi.sep)>=0}}(e,t);Tte.push(n),n.userConfigured?Ate.push(n):Rte.push(n);i&&!n.userConfigured&&Tte.forEach((e=>{e.mime===n.mime||e.userConfigured||(n.extension&&e.extension===n.extension&&console.warn(`Overwriting extension <<${n.extension}>> to now point to mime <<${n.mime}>>`),n.filename&&e.filename===n.filename&&console.warn(`Overwriting filename <<${n.filename}>> to now point to mime <<${n.mime}>>`),n.filepattern&&e.filepattern===n.filepattern&&console.warn(`Overwriting filepattern <<${n.filepattern}>> to now point to mime <<${n.mime}>>`),n.firstline&&e.firstline===n.firstline&&console.warn(`Overwriting firstline <<${n.firstline}>> to now point to mime <<${n.mime}>>`))}))}(e,!1,t)}function Pte(e,t){return function(e,t){let i;if(e)switch(e.scheme){case vn.file:i=e.fsPath;break;case vn.data:i=Ia.parseMetaData(e).get(Ia.META_DATA_LABEL);break;case vn.vscodeNotebookCell:i=void 0;break;default:i=e.path}if(!i)return[{id:"unknown",mime:Lu.unknown}];i=i.toLowerCase();const n=Xi(i),s=Fte(i,n,Ate);if(s)return[s,{id:Ku,mime:Lu.text}];const o=Fte(i,n,Rte);if(o)return[o,{id:Ku,mime:Lu.text}];if(t){const e=function(e){Bo(e)&&(e=e.substr(1));if(e.length>0)for(let t=Tte.length-1;t>=0;t--){const i=Tte[t];if(!i.firstline)continue;const n=e.match(i.firstline);if(n&&n.length>0)return i}return}(t);if(e)return[e,{id:Ku,mime:Lu.text}]}return[{id:"unknown",mime:Lu.unknown}]}(e,t).map((e=>e.id))}function Fte(e,t,i){var n;let s,o,r;for(let a=i.length-1;a>=0;a--){const l=i[a];if(t===l.filenameLowercase){s=l;break}if(l.filepattern&&(!o||l.filepattern.length>o.filepattern.length)){const i=l.filepatternOnPath?e:t;(null===(n=l.filepatternLowercase)||void 0===n?void 0:n.call(l,i))&&(o=l)}l.extension&&(!r||l.extension.length>r.extension.length)&&t.endsWith(l.extensionLowercase)&&(r=l)}return s||(o||(r||void 0))}const Bte=Object.prototype.hasOwnProperty,Wte="vs.editor.nullLanguage";class Vte{constructor(){this._languageIdToLanguage=[],this._languageToLanguageId=new Map,this._register(Wte,0),this._register(Ku,1),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)||0}decodeLanguageId(e){return this._languageIdToLanguage[e]||Wte}}class Hte extends E{constructor(e=!0,t=!1){super(),this._onDidChange=this._register(new U),this.onDidChange=this._onDidChange.event,Hte.instanceCount++,this._warnOnOverwrite=t,this.languageIdCodec=new Vte,this._dynamicLanguages=[],this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},e&&(this._initializeFromRegistry(),this._register(Uu.onDidChangeLanguages((e=>{this._initializeFromRegistry()}))))}dispose(){Hte.instanceCount--,super.dispose()}_initializeFromRegistry(){this._languages={},this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Tte=Tte.filter((e=>e.userConfigured)),Rte=[];const e=[].concat(Uu.getLanguages()).concat(this._dynamicLanguages);this._registerLanguages(e)}_registerLanguages(e){for(const t of e)this._registerLanguage(t);this._mimeTypesMap={},this._nameMap={},this._lowercaseNameMap={},Object.keys(this._languages).forEach((e=>{const t=this._languages[e];t.name&&(this._nameMap[t.name]=t.identifier),t.aliases.forEach((e=>{this._lowercaseNameMap[e.toLowerCase()]=t.identifier})),t.mimetypes.forEach((e=>{this._mimeTypesMap[e]=t.identifier}))})),jl.as(xu).registerOverrideIdentifiers(this.getRegisteredLanguageIds()),this._onDidChange.fire()}_registerLanguage(e){const t=e.id;let i;Bte.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 e of t.extensions)Ote({id:i,mime:n,extension:e},this._warnOnOverwrite)}if(Array.isArray(t.filenames))for(const l of t.filenames)Ote({id:i,mime:n,filename:l},this._warnOnOverwrite),e.filenames.push(l);if(Array.isArray(t.filenamePatterns))for(const l of t.filenamePatterns)Ote({id:i,mime:n,filepattern:l},this._warnOnOverwrite);if("string"==typeof t.firstLine&&t.firstLine.length>0){let e=t.firstLine;"^"!==e.charAt(0)&&(e="^"+e);try{const t=new RegExp(e);"^"!==(s=t).source&&"^$"!==s.source&&"$"!==s.source&&"^\\s*$"!==s.source&&s.exec("")&&0===s.lastIndex||Ote({id:i,mime:n,firstline:t},this._warnOnOverwrite)}catch(a){console.warn(`[${t.id}]: Invalid regular expression \`${e}\`: `,a)}}var s;e.aliases.push(i);let o=null;if(void 0!==t.aliases&&Array.isArray(t.aliases)&&(o=0===t.aliases.length?[null]:t.aliases),null!==o)for(const l of o)l&&0!==l.length&&e.aliases.push(l);const r=null!==o&&o.length>0;if(r&&null===o[0]);else{const t=(r?o[0]:null)||i;!r&&e.name||(e.name=t)}t.configuration&&e.configurationFiles.push(t.configuration),t.icon&&e.icons.push(t.icon)}isRegisteredLanguageId(e){return!!e&&Bte.call(this._languages,e)}getRegisteredLanguageIds(){return Object.keys(this._languages)}getLanguageIdByLanguageName(e){const t=e.toLowerCase();return Bte.call(this._lowercaseNameMap,t)?this._lowercaseNameMap[t]:null}getLanguageIdByMimeType(e){return e&&Bte.call(this._mimeTypesMap,e)?this._mimeTypesMap[e]:null}guessLanguageIdByFilepathOrFirstLine(e,t){return e||t?Pte(e,t):[]}}Hte.instanceCount=0;class zte extends E{constructor(e=!1){super(),this._onDidRequestBasicLanguageFeatures=this._register(new U),this.onDidRequestBasicLanguageFeatures=this._onDidRequestBasicLanguageFeatures.event,this._onDidRequestRichLanguageFeatures=this._register(new U),this.onDidRequestRichLanguageFeatures=this._onDidRequestRichLanguageFeatures.event,this._onDidChange=this._register(new U({leakWarningThreshold:200})),this.onDidChange=this._onDidChange.event,this._requestedBasicLanguages=new Set,this._requestedRichLanguages=new Set,zte.instanceCount++,this._registry=this._register(new Hte(!0,e)),this.languageIdCodec=this._registry.languageIdCodec,this._register(this._registry.onDidChange((()=>this._onDidChange.fire())))}dispose(){zte.instanceCount--,super.dispose()}isRegisteredLanguageId(e){return this._registry.isRegisteredLanguageId(e)}getLanguageIdByLanguageName(e){return this._registry.getLanguageIdByLanguageName(e)}getLanguageIdByMimeType(e){return this._registry.getLanguageIdByMimeType(e)}guessLanguageIdByFilepathOrFirstLine(e,t){return Ud(this._registry.guessLanguageIdByFilepathOrFirstLine(e,t),null)}createById(e){return new Ute(this.onDidChange,(()=>this._createAndGetLanguageIdentifier(e)))}createByFilepathOrFirstLine(e,t){return new Ute(this.onDidChange,(()=>{const i=this.guessLanguageIdByFilepathOrFirstLine(e,t);return this._createAndGetLanguageIdentifier(i)}))}_createAndGetLanguageIdentifier(e){return e&&this.isRegisteredLanguageId(e)||(e=Ku),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),EC.getOrCreate(e),this._onDidRequestRichLanguageFeatures.fire(e))}}zte.instanceCount=0;class Ute{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 U({onDidRemoveLastListener:()=>{this._dispose()}})),this._emitter.event}_evaluate(){var e;const t=this._selector();t!==this.languageId&&(this.languageId=t,null===(e=this._emitter)||void 0===e||e.fire(this.languageId))}}const Kte=/\(&([^\s&])\)|(^|[^&])&([^\s&])/,jte=/(&)?(&)([^\s&])/g;var qte;!function(e){e[e.Right=0]="Right",e[e.Left=1]="Left"}(qte||(qte={}));class $te extends Rx{constructor(e,t,i,n){e.classList.add("monaco-menu-container"),e.setAttribute("role","presentation");const s=document.createElement("div");s.classList.add("monaco-menu"),s.setAttribute("role","presentation"),super(s,{orientation:1,actionViewItemProvider:e=>this.doGetActionViewItem(e,i,o),context:i.context,actionRunner:i.actionRunner,ariaLabel:i.ariaLabel,ariaRole:"menu",focusOnlyEnabledItems:!0,triggerKeys:{keys:[3,...Pe||Fe?[10]:[]],keyDown:!0}}),this.menuStyles=n,this.menuElement=s,this.actionsList.tabIndex=0,this.menuDisposables=this._register(new N),this.initializeOrUpdateStyleSheet(e,n),this._register(ZL.addTarget(s)),En(s,os.KEY_DOWN,(e=>{new St(e).equals(2)&&e.preventDefault()})),i.enableMnemonics&&this.menuDisposables.add(En(s,os.KEY_DOWN,(e=>{const t=e.key.toLocaleLowerCase();if(this.mnemonics.has(t)){as(e,!0);const i=this.mnemonics.get(t);if(1===i.length&&(i[0]instanceof Zte&&i[0].container&&this.focusItemByElement(i[0].container),i[0].onClick(e)),i.length>1){const e=i.shift();e&&e.container&&(this.focusItemByElement(e.container),i.push(e)),this.mnemonics.set(t,i)}}}))),Fe&&this._register(En(s,os.KEY_DOWN,(e=>{const t=new St(e);t.equals(14)||t.equals(11)?(this.focusedItem=this.viewItems.length-1,this.focusNext(),as(e,!0)):(t.equals(13)||t.equals(12))&&(this.focusedItem=0,this.focusPrevious(),as(e,!0))}))),this._register(En(this.domNode,os.MOUSE_OUT,(e=>{qn(e.relatedTarget,this.domNode)||(this.focusedItem=void 0,this.updateFocus(),e.stopPropagation())}))),this._register(En(this.actionsList,os.MOUSE_OVER,(e=>{let t=e.target;if(t&&qn(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(t.classList.contains("action-item")){const e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}}))),this._register(ZL.addTarget(this.actionsList)),this._register(En(this.actionsList,$L.Tap,(e=>{let t=e.initialTarget;if(t&&qn(t,this.actionsList)&&t!==this.actionsList){for(;t.parentElement!==this.actionsList&&null!==t.parentElement;)t=t.parentElement;if(t.classList.contains("action-item")){const e=this.focusedItem;this.setFocusedItem(t),e!==this.focusedItem&&this.updateFocus()}}})));const o={parent:this};this.mnemonics=new Map,this.scrollableElement=this._register(new OD(s,{alwaysConsumeMouseWheel:!0,horizontal:2,vertical:3,verticalScrollbarSize:7,handleMouseWheel:!0,useShadows:!0}));const r=this.scrollableElement.getDomNode();r.style.position="",this.styleScrollElement(r,n),this._register(En(s,$L.Change,(e=>{as(e,!0);const t=this.scrollableElement.getScrollPosition().scrollTop;this.scrollableElement.setScrollPosition({scrollTop:t-e.translationY})}))),this._register(En(r,os.MOUSE_UP,(e=>{e.preventDefault()}))),s.style.maxHeight=`${Math.max(10,window.innerHeight-e.getBoundingClientRect().top-35)}px`,t=t.filter((e=>{var t;return!(null===(t=i.submenuIds)||void 0===t?void 0:t.has(e.id))||(console.warn(`Found submenu cycle: ${e.id}`),!1)})),this.push(t,{icon:!0,label:!0,isMenu:!0}),e.appendChild(this.scrollableElement.getDomNode()),this.scrollableElement.scanDomNode(),this.viewItems.filter((e=>!(e instanceof Yte))).forEach(((e,t,i)=>{e.updatePositionInSet(t+1,i.length)}))}initializeOrUpdateStyleSheet(e,t){this.styleSheet||(Zn(e)?this.styleSheet=Jn(e):($te.globalStyleSheet||($te.globalStyleSheet=Jn()),this.styleSheet=$te.globalStyleSheet)),this.styleSheet.textContent=function(e,t){let i=`\n.monaco-menu {\n\tfont-size: 13px;\n\tborder-radius: 5px;\n\tmin-width: 160px;\n}\n\n${Xte(Jr.menuSelection)}\n${Xte(Jr.menuSubmenu)}\n\n.monaco-menu .monaco-action-bar {\n\ttext-align: right;\n\toverflow: hidden;\n\twhite-space: nowrap;\n}\n\n.monaco-menu .monaco-action-bar .actions-container {\n\tdisplay: flex;\n\tmargin: 0 auto;\n\tpadding: 0;\n\twidth: 100%;\n\tjustify-content: flex-end;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar.reverse .actions-container {\n\tflex-direction: row-reverse;\n}\n\n.monaco-menu .monaco-action-bar .action-item {\n\tcursor: pointer;\n\tdisplay: inline-block;\n\ttransition: transform 50ms ease;\n\tposition: relative; /* DO NOT REMOVE - this is the key to preventing the ghosting icon bug in Chrome 42 */\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled {\n\tcursor: default;\n}\n\n.monaco-menu .monaco-action-bar.animated .action-item.active {\n\ttransform: scale(1.272019649, 1.272019649); /* 1.272019649 = \u221a\u03c6 */\n}\n\n.monaco-menu .monaco-action-bar .action-item .icon,\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: inline-block;\n}\n\n.monaco-menu .monaco-action-bar .action-item .codicon {\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar .action-label {\n\tfont-size: 11px;\n\tmargin-right: 4px;\n}\n\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label,\n.monaco-menu .monaco-action-bar .action-item.disabled .action-label:hover {\n\tcolor: var(--vscode-disabledForeground);\n}\n\n/* Vertical actions */\n\n.monaco-menu .monaco-action-bar.vertical {\n\ttext-align: left;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tdisplay: block;\n\tborder-bottom: 1px solid var(--vscode-menu-separatorBackground);\n\tpadding-top: 1px;\n\tpadding: 30px;\n}\n\n.monaco-menu .secondary-actions .monaco-action-bar .action-label {\n\tmargin-left: 6px;\n}\n\n/* Action Items */\n.monaco-menu .monaco-action-bar .action-item.select-container {\n\toverflow: hidden; /* somehow the dropdown overflows its container, we prevent it here to not push */\n\tflex: 1;\n\tmax-width: 170px;\n\tmin-width: 60px;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n\tmargin-right: 10px;\n}\n\n.monaco-menu .monaco-action-bar.vertical {\n\tmargin-left: 0;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .actions-container {\n\tdisplay: block;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tpadding: 0;\n\ttransform: none;\n\tdisplay: flex;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.active {\n\ttransform: none;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\tflex: 1 1 auto;\n\tdisplay: flex;\n\theight: 2em;\n\talign-items: center;\n\tposition: relative;\n\tmargin: 0 4px;\n\tborder-radius: 4px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item:hover .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-menu-item:focus .keybinding {\n\topacity: unset;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label {\n\tflex: 1 1 auto;\n\ttext-decoration: none;\n\tpadding: 0 1em;\n\tbackground: none;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .keybinding,\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tdisplay: inline-block;\n\tflex: 2 1 auto;\n\tpadding: 0 1em;\n\ttext-align: right;\n\tfont-size: 12px;\n\tline-height: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon {\n\tfont-size: 16px !important;\n\tdisplay: flex;\n\talign-items: center;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator.codicon::before {\n\tmargin-left: auto;\n\tmargin-right: -20px;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .keybinding,\n.monaco-menu .monaco-action-bar.vertical .action-item.disabled .submenu-indicator {\n\topacity: 0.4;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator) {\n\tdisplay: inline-block;\n\tbox-sizing: border-box;\n\tmargin: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item {\n\tposition: static;\n\toverflow: visible;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-item .monaco-submenu {\n\tposition: absolute;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\twidth: 100%;\n\theight: 0px !important;\n\topacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator.text {\n\tpadding: 0.7em 1em 0.1em 1em;\n\tfont-weight: bold;\n\topacity: 1;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:hover {\n\tcolor: inherit;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tposition: absolute;\n\tvisibility: hidden;\n\twidth: 1em;\n\theight: 100%;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item.checked .menu-item-check {\n\tvisibility: visible;\n\tdisplay: flex;\n\talign-items: center;\n\tjustify-content: center;\n}\n\n/* Context Menu */\n\n.context-view.monaco-menu-container {\n\toutline: 0;\n\tborder: none;\n\tanimation: fadeIn 0.083s linear;\n\t-webkit-app-region: no-drag;\n}\n\n.context-view.monaco-menu-container :focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical:focus,\n.context-view.monaco-menu-container .monaco-action-bar.vertical :focus {\n\toutline: 0;\n}\n\n.hc-black .context-view.monaco-menu-container,\n.hc-light .context-view.monaco-menu-container,\n:host-context(.hc-black) .context-view.monaco-menu-container,\n:host-context(.hc-light) .context-view.monaco-menu-container {\n\tbox-shadow: none;\n}\n\n.hc-black .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n.hc-light .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n:host-context(.hc-black) .monaco-menu .monaco-action-bar.vertical .action-item.focused,\n:host-context(.hc-light) .monaco-menu .monaco-action-bar.vertical .action-item.focused {\n\tbackground: none;\n}\n\n/* Vertical Action Bar Styles */\n\n.monaco-menu .monaco-action-bar.vertical {\n\tpadding: 4px 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-menu-item {\n\theight: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label:not(.separator),\n.monaco-menu .monaco-action-bar.vertical .keybinding {\n\tfont-size: inherit;\n\tpadding: 0 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .menu-item-check {\n\tfont-size: inherit;\n\twidth: 2em;\n}\n\n.monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tfont-size: inherit;\n\tmargin: 5px 0 !important;\n\tpadding: 0;\n\tborder-radius: 0;\n}\n\n.linux .monaco-menu .monaco-action-bar.vertical .action-label.separator,\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .action-label.separator {\n\tmargin-left: 0;\n\tmargin-right: 0;\n}\n\n.monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\tfont-size: 60%;\n\tpadding: 0 1.8em;\n}\n\n.linux .monaco-menu .monaco-action-bar.vertical .submenu-indicator,\n:host-context(.linux) .monaco-menu .monaco-action-bar.vertical .submenu-indicator {\n\theight: 100%;\n\tmask-size: 10px 10px;\n\t-webkit-mask-size: 10px 10px;\n}\n\n.monaco-menu .action-item {\n\tcursor: default;\n}`;if(t){i+="\n\t\t\t/* Arrows */\n\t\t\t.monaco-scrollable-element > .scrollbar > .scra {\n\t\t\t\tcursor: pointer;\n\t\t\t\tfont-size: 11px !important;\n\t\t\t}\n\n\t\t\t.monaco-scrollable-element > .visible {\n\t\t\t\topacity: 1;\n\n\t\t\t\t/* Background rule added for IE9 - to allow clicks on dom node */\n\t\t\t\tbackground:rgba(0,0,0,0);\n\n\t\t\t\ttransition: opacity 100ms linear;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .invisible {\n\t\t\t\topacity: 0;\n\t\t\t\tpointer-events: none;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .invisible.fade {\n\t\t\t\ttransition: opacity 800ms linear;\n\t\t\t}\n\n\t\t\t/* Scrollable Content Inset Shadow */\n\t\t\t.monaco-scrollable-element > .shadow {\n\t\t\t\tposition: absolute;\n\t\t\t\tdisplay: none;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 3px;\n\t\t\t\theight: 3px;\n\t\t\t\twidth: 100%;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 3px;\n\t\t\t\tleft: 0;\n\t\t\t\theight: 100%;\n\t\t\t\twidth: 3px;\n\t\t\t}\n\t\t\t.monaco-scrollable-element > .shadow.top-left-corner {\n\t\t\t\tdisplay: block;\n\t\t\t\ttop: 0;\n\t\t\t\tleft: 0;\n\t\t\t\theight: 3px;\n\t\t\t\twidth: 3px;\n\t\t\t}\n\t\t";const t=e.scrollbarShadow;t&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .shadow.top {\n\t\t\t\t\tbox-shadow: ${t} 0 6px 6px -6px inset;\n\t\t\t\t}\n\n\t\t\t\t.monaco-scrollable-element > .shadow.left {\n\t\t\t\t\tbox-shadow: ${t} 6px 0 6px -6px inset;\n\t\t\t\t}\n\n\t\t\t\t.monaco-scrollable-element > .shadow.top.left {\n\t\t\t\t\tbox-shadow: ${t} 6px 6px 6px -6px inset;\n\t\t\t\t}\n\t\t\t`);const n=e.scrollbarSliderBackground;n&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider {\n\t\t\t\t\tbackground: ${n};\n\t\t\t\t}\n\t\t\t`);const s=e.scrollbarSliderHoverBackground;s&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider:hover {\n\t\t\t\t\tbackground: ${s};\n\t\t\t\t}\n\t\t\t`);const o=e.scrollbarSliderActiveBackground;o&&(i+=`\n\t\t\t\t.monaco-scrollable-element > .scrollbar > .slider.active {\n\t\t\t\t\tbackground: ${o};\n\t\t\t\t}\n\t\t\t`)}return i}(t,Zn(e))}styleScrollElement(e,t){var i,n;const s=null!==(i=t.foregroundColor)&&void 0!==i?i:"",o=null!==(n=t.backgroundColor)&&void 0!==n?n:"",r=t.borderColor?`1px solid ${t.borderColor}`:"",a=t.shadowColor?`0 2px 8px ${t.shadowColor}`:"";e.style.outline=r,e.style.borderRadius="5px",e.style.color=s,e.style.backgroundColor=o,e.style.boxShadow=a}getContainer(){return this.scrollableElement.getDomNode()}get onScroll(){return this.scrollableElement.onScroll}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(En(this.element,os.MOUSE_UP,(e=>{if(as(e,!0),ne){if(new Nt(e).rightButton)return;this.onClick(e)}else setTimeout((()=>{this.onClick(e)}),0)}))),this._register(En(this.element,os.CONTEXT_MENU,(e=>{as(e,!0)}))))}),100),this._register(this.runOnceToEnableMouseUp)}render(e){super.render(e),this.element&&(this.container=e,this.item=ds(this.element,fs("a.action-menu-item")),this._action.id===qa.ID?this.item.setAttribute("role","presentation"):(this.item.setAttribute("role","menuitem"),this.mnemonic&&this.item.setAttribute("aria-keyshortcuts",`${this.mnemonic}`)),this.check=ds(this.item,fs("span.menu-item-check"+ta.asCSSSelector(Jr.menuSelection))),this.check.setAttribute("role","none"),this.label=ds(this.item,fs("span.action-label")),this.options.label&&this.options.keybinding&&(ds(this.item,fs("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(){var e;super.focus(),null===(e=this.item)||void 0===e||e.focus(),this.applyStyle()}updatePositionInSet(e,t){this.item&&(this.item.setAttribute("aria-posinset",`${e}`),this.item.setAttribute("aria-setsize",`${t}`))}updateLabel(){var e;if(this.label&&this.options.label){Dn(this.label);let t=aa(this.action.label);if(t){const i=function(e){const t=Kte,i=t.exec(e);if(!i)return e;const n=!i[1];return e.replace(t,n?"$2$3":"").trim()}(t);this.options.enableMnemonics||(t=i),this.label.setAttribute("aria-label",i.replace(/&&/g,"&"));const n=Kte.exec(t);if(n){t=Js(t),jte.lastIndex=0;let i=jte.exec(t);for(;i&&i[1];)i=jte.exec(t);const s=e=>e.replace(/&&/g,"&");i?this.label.append(io(s(t.substr(0,i.index))," "),fs("u",{"aria-hidden":"true"},i[3]),no(s(t.substr(i.index+i[0].length))," ")):this.label.innerText=s(t).trim(),null===(e=this.item)||void 0===e||e.setAttribute("aria-keyshortcuts",(n[1]?n[1]:n[3]).toLocaleLowerCase())}else this.label.innerText=t.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),void 0!==e?(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}`:"",s=e&&this.menuStyle.selectionBorderColor?"-1px":"";this.item&&(this.item.style.color=null!=t?t:"",this.item.style.backgroundColor=null!=i?i:"",this.item.style.outline=n,this.item.style.outlineOffset=s),this.check&&(this.check.style.color=null!=t?t:"")}}class Zte extends Gte{constructor(e,t,i,n,s){super(e,e,n,s),this.submenuActions=t,this.parentData=i,this.submenuOptions=n,this.mysubmenu=null,this.submenuDisposables=this._register(new N),this.mouseOver=!1,this.expandDirection=n&&void 0!==n.expandDirection?n.expandDirection:qte.Right,this.showScheduler=new rd((()=>{this.mouseOver&&(this.cleanupExistingSubmenu(!1),this.createSubmenu(!1))}),250),this.hideScheduler=new rd((()=>{this.element&&!qn(Xn(),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=ds(this.item,fs("span.submenu-indicator"+ta.asCSSSelector(Jr.menuSubmenu))),this.submenuIndicator.setAttribute("aria-hidden","true")),this._register(En(this.element,os.KEY_UP,(e=>{const t=new St(e);(t.equals(17)||t.equals(3))&&(as(e,!0),this.createSubmenu(!0))}))),this._register(En(this.element,os.KEY_DOWN,(e=>{const t=new St(e);Xn()===this.item&&(t.equals(17)||t.equals(3))&&as(e,!0)}))),this._register(En(this.element,os.MOUSE_OVER,(e=>{this.mouseOver||(this.mouseOver=!0,this.showScheduler.schedule())}))),this._register(En(this.element,os.MOUSE_LEAVE,(e=>{this.mouseOver=!1}))),this._register(En(this.element,os.FOCUS_OUT,(e=>{this.element&&!qn(Xn(),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(){}onClick(e){as(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(ge){}this.parentData.submenu=void 0,this.updateAriaExpanded("false"),this.submenuContainer&&(this.submenuDisposables.clear(),this.submenuContainer=void 0)}}calculateSubmenuMenuLayout(e,t,i,n){const s={top:0,left:0};return s.left=Dte(e.width,t.width,{position:n===qte.Right?0:1,offset:i.left,size:i.width}),s.left>=i.left&&s.left{new St(e).equals(15)&&(as(e,!0),this.parentData.parent.focus(),this.cleanupExistingSubmenu(!0))}))),this.submenuDisposables.add(En(this.submenuContainer,os.KEY_DOWN,(e=>{new St(e).equals(15)&&as(e,!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){var t;this.item&&(null===(t=this.item)||void 0===t||t.setAttribute("aria-expanded",e))}applyStyle(){super.applyStyle();const e=this.element&&this.element.classList.contains("focused")&&this.menuStyle.selectionForegroundColor?this.menuStyle.selectionForegroundColor:this.menuStyle.foregroundColor;this.submenuIndicator&&(this.submenuIndicator.style.color=null!=e?e:"")}dispose(){super.dispose(),this.hideScheduler.dispose(),this.mysubmenu&&(this.mysubmenu.dispose(),this.mysubmenu=null),this.submenuContainer&&(this.submenuContainer=void 0)}}class Yte extends Ix{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 Xte(e){const t=Qr()[e.id];return`.codicon-${e.id}:before { content: '\\${t.toString(16)}'; }`}class Qte{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;let i;this.focusToReturn=document.activeElement;const n=ss(e.domForShadowRoot)?e.domForShadowRoot:void 0;this.contextViewService.showContextView({getAnchor:()=>e.getAnchor(),canRelayout:!1,anchorAlignment:e.anchorAlignment,anchorAxisAlignment:e.anchorAxisAlignment,render:n=>{var s;this.lastContainer=n;const o=e.getMenuClassName?e.getMenuClassName():"";o&&(n.className+=" "+o),this.options.blockMouse&&(this.block=n.appendChild(fs(".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",null===(s=this.blockDisposable)||void 0===s||s.dispose(),this.blockDisposable=En(this.block,os.MOUSE_DOWN,(e=>e.stopPropagation())));const r=new N,a=e.actionRunner||new ja;return a.onWillRun((t=>this.onActionRun(t,!e.skipTelemetry)),this,r),a.onDidRun(this.onDidActionRun,this,r),i=new $te(n,t,{actionViewItemProvider:e.getActionViewItem,context:e.getActionsContext?e.getActionsContext():null,actionRunner:a,getKeyBinding:e.getKeyBinding?e.getKeyBinding:e=>this.keybindingService.lookupKeybinding(e.id)},nN),i.onDidCancel((()=>this.contextViewService.hideContextView(!0)),null,r),i.onDidBlur((()=>this.contextViewService.hideContextView(!0)),null,r),r.add(En(window,os.BLUR,(()=>this.contextViewService.hideContextView(!0)))),r.add(En(window,os.MOUSE_DOWN,(e=>{if(e.defaultPrevented)return;const t=new Nt(e);let i=t.target;if(!t.rightButton){for(;i;){if(i===n)return;i=i.parentElement}this.contextViewService.hideContextView(!0)}}))),D(r,i)},focus:()=>{null==i||i.focus(!!e.autoSelectFirstItem)},onHide:t=>{var i,n,s;null===(i=e.onHide)||void 0===i||i.call(e,!!t),this.block&&(this.block.remove(),this.block=null),null===(n=this.blockDisposable)||void 0===n||n.dispose(),this.blockDisposable=null,this.lastContainer&&(Xn()===this.lastContainer||qn(Xn(),this.lastContainer))&&(null===(s=this.focusToReturn)||void 0===s||s.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&&!d(e.error)&&this.notificationService.error(e.error)}}var Jte=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},eie=function(e,t){return function(i,n){t(i,n,e)}};let tie=class extends E{get contextMenuHandler(){return this._contextMenuHandler||(this._contextMenuHandler=new Qte(this.contextViewService,this.telemetryService,this.notificationService,this.keybindingService)),this._contextMenuHandler}constructor(e,t,i,n,s,o){super(),this.telemetryService=e,this.notificationService=t,this.contextViewService=i,this.keybindingService=n,this.menuService=s,this.contextKeyService=o,this._contextMenuHandler=void 0,this._onDidShowContextMenu=this._store.add(new U),this._onDidHideContextMenu=this._store.add(new U)}configure(e){this.contextMenuHandler.configure(e)}showContextMenu(e){e=iie.transform(e,this.menuService,this.contextKeyService),this.contextMenuHandler.showContextMenu(Object.assign(Object.assign({},e),{onHide:t=>{var i;null===(i=e.onHide)||void 0===i||i.call(e,t),this._onDidHideContextMenu.fire()}})),ks.getInstance().resetKeyStatus(),this._onDidShowContextMenu.fire()}};var iie,nie;tie=Jte([eie(0,lh),eie(1,mL),eie(2,Ux),eie(3,WL),eie(4,th),eie(5,Ol)],tie),function(e){e.transform=function(e,t,i){if(!((n=e)&&n.menuId instanceof eh))return e;var n;const{menuId:s,menuActionOptions:o,contextKeyService:r}=e;return Object.assign(Object.assign({},e),{getActions:()=>{const n=[];if(s){const e=t.createMenu(s,null!=r?r:i);!function(e,t,i,n){const s=e.getActions(t),o=ks.getInstance();FW(s,i,o.keyStatus.altKey||(Oe||Fe)&&o.keyStatus.shiftKey,n?e=>e===n:e=>"navigation"===e)}(e,o,n),e.dispose()}return e.getActions?qa.join(e.getActions(),n):n}})}}(iie||(iie={})),function(e){e[e.API=0]="API",e[e.USER=1]="USER"}(nie||(nie={}));var sie=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},oie=function(e,t){return function(i,n){t(i,n,e)}},rie=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let aie=class{constructor(e){this._commandService=e}open(e,t){return rie(this,void 0,void 0,(function*(){if(!$k(e,vn.command))return!1;if(!(null==t?void 0:t.allowCommands))return!0;if("string"==typeof e&&(e=an.parse(e)),Array.isArray(t.allowCommands)&&!t.allowCommands.includes(e.path))return!0;let i=[];try{i=pk(decodeURIComponent(e.query))}catch(ge){try{i=pk(e.query)}catch(Vs){}}return Array.isArray(i)||(i=[i]),yield this._commandService.executeCommand(e.path,...i),!0}))}};aie=sie([oie(0,Ya)],aie);let lie=class{constructor(e){this._editorService=e}open(e,t){return rie(this,void 0,void 0,(function*(){"string"==typeof e&&(e=an.parse(e));const{selection:i,uri:n}=function(e){let t;const i=/^L?(\d+)(?:,(\d+))?(-L?(\d+)(?:,(\d+))?)?/.exec(e.fragment);return i&&(t={startLineNumber:parseInt(i[1]),startColumn:i[2]?parseInt(i[2]):1,endLineNumber:i[4]?parseInt(i[4]):void 0,endColumn:i[4]?i[5]?parseInt(i[5]):1:void 0},e=e.with({fragment:""})),{selection:t,uri:e}}(e);return(e=n).scheme===vn.file&&(e=ka(e)),yield this._editorService.openCodeEditor({resource:e,options:Object.assign({selection:i,source:(null==t?void 0:t.fromUserGesture)?nie.USER:nie.API},null==t?void 0:t.editorOptions)},this._editorService.getFocusedCodeEditor(),null==t?void 0:t.openToSide),!0}))}};lie=sie([oie(0,Wa)],lie);let hie=class{constructor(e,t){this._openers=new O,this._validators=new O,this._resolvers=new O,this._resolvedUriTargets=new Us((e=>e.with({path:null,fragment:null,query:null}).toString())),this._externalOpeners=new O,this._defaultExternalOpener={openExternal:e=>rie(this,void 0,void 0,(function*(){return Gk(e,vn.http,vn.https)?Cs(e):window.location.href=e,!0}))},this._openers.push({open:(e,t)=>rie(this,void 0,void 0,(function*(){return!(!(null==t?void 0:t.openExternal)&&!Gk(e,vn.mailto,vn.http,vn.https,vn.vsls))&&(yield this._doOpenExternal(e,t),!0)}))}),this._openers.push(new aie(t)),this._openers.push(new lie(e))}registerOpener(e){return{dispose:this._openers.unshift(e)}}open(e,t){var i;return rie(this,void 0,void 0,(function*(){const n="string"==typeof e?an.parse(e):e,s=null!==(i=this._resolvedUriTargets.get(n))&&void 0!==i?i:e;for(const e of this._validators)if(!(yield e.shouldOpen(s,t)))return!1;for(const i of this._openers){if(yield i.open(e,t))return!0}return!1}))}resolveExternalUri(e,t){return rie(this,void 0,void 0,(function*(){for(const i of this._resolvers)try{const n=yield i.resolveExternalUri(e,t);if(n)return this._resolvedUriTargets.has(n.resolved)||this._resolvedUriTargets.set(n.resolved,e),n}catch(ge){}throw new Error("Could not resolve external URI: "+e.toString())}))}_doOpenExternal(e,t){return rie(this,void 0,void 0,(function*(){const i="string"==typeof e?an.parse(e):e;let n,s;try{n=(yield this.resolveExternalUri(i,t)).resolved}catch(ge){n=i}if(s="string"==typeof e&&i.toString()===n.toString()?e:encodeURI(n.toString(!0)),null==t?void 0:t.allowContributedOpeners){const e="string"==typeof(null==t?void 0:t.allowContributedOpeners)?null==t?void 0:t.allowContributedOpeners:void 0;for(const t of this._externalOpeners){if(yield t.openExternal(s,{sourceUri:i,preferredOpenerId:e},Uh.None))return!0}}return this._defaultExternalOpener.openExternal(s,{sourceUri:i},Uh.None)}))}dispose(){this._validators.clear()}};hie=sie([oie(0,Wa),oie(1,Ya)],hie);var die=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},cie=function(e,t){return function(i,n){t(i,n,e)}};let uie=class extends E{constructor(e,t){super(),this._markerService=t,this._onDidChangeMarker=this._register(new U),this._markerDecorations=new Us,e.getModels().forEach((e=>this._onModelAdded(e))),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}_handleMarkerChange(e){e.forEach((e=>{const t=this._markerDecorations.get(e);t&&this._updateDecorations(t)}))}_onModelAdded(e){const t=new gie(e);this._markerDecorations.set(e.uri,t),this._updateDecorations(t)}_onModelRemoved(e){var t;const i=this._markerDecorations.get(e.uri);i&&(i.dispose(),this._markerDecorations.delete(e.uri)),e.uri.scheme!==vn.inMemory&&e.uri.scheme!==vn.internal&&e.uri.scheme!==vn.vscode||null===(t=this._markerService)||void 0===t||t.read({resource:e.uri}).map((e=>e.owner)).forEach((t=>this._markerService.remove(t,[e.uri])))}_updateDecorations(e){const t=this._markerService.read({resource:e.model.uri,take:500});e.update(t)&&this._onDidChangeMarker.fire(e.model)}};uie=die([cie(0,Ha),cie(1,LN)],uie);class gie extends E{constructor(e){super(),this.model=e,this._map=new qs,this._register(x((()=>{this.model.deltaDecorations([...this._map.values()],[]),this._map.clear()})))}update(e){const{added:t,removed:i}=function(e,t){const i=[],n=[];for(const s of e)t.has(s)||i.push(s);for(const s of t)e.has(s)||n.push(s);return{removed:i,added:n}}(new Set(this._map.keys()),new Set(e));if(0===t.length&&0===i.length)return!1;const n=i.map((e=>this._map.get(e))),s=t.map((e=>({range:this._createDecorationRange(this.model,e),options:this._createDecorationOption(e)}))),o=this.model.deltaDecorations(n,s);for(const r of i)this._map.delete(r);for(let r=0;r=t)return i;const n=e.getWordAtPosition(i.getStartPosition());n&&(i=new Rh(i.startLineNumber,n.startColumn,i.endLineNumber,n.endColumn))}else if(t.endColumn===Number.MAX_VALUE&&1===t.startColumn&&i.startLineNumber===i.endLineNumber){const n=e.getLineFirstNonWhitespaceColumn(t.startLineNumber);n=0}}var pie,mie=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},fie=function(e,t){return function(i,n){t(i,n,e)}};function _ie(e){return e.toString()}class vie{constructor(e,t,i){this.model=e,this._modelEventListeners=new N,this.model=e,this._modelEventListeners.add(e.onWillDispose((()=>t(e)))),this._modelEventListeners.add(e.onDidChangeLanguage((t=>i(e,t))))}dispose(){this._modelEventListeners.dispose()}}const bie=Fe||Pe?1:2;class Cie{constructor(e,t,i,n,s,o,r,a){this.uri=e,this.initialUndoRedoSnapshot=t,this.time=i,this.sharesUndoRedoStack=n,this.heapSize=s,this.sha1=o,this.versionId=r,this.alternativeVersionId=a}}let wie=pie=class extends E{constructor(e,t,i,n,s){super(),this._configurationService=e,this._resourcePropertiesService=t,this._undoRedoService=i,this._languageService=n,this._languageConfigurationService=s,this._onModelAdded=this._register(new U),this.onModelAdded=this._onModelAdded.event,this._onModelRemoved=this._register(new U),this.onModelRemoved=this._onModelRemoved.event,this._onModelModeChanged=this._register(new U),this.onModelLanguageChanged=this._onModelModeChanged.event,this._modelCreationOptionsByLanguageAndResource=Object.create(null),this._models={},this._disposedModels=new Map,this._disposedModelsHeapSize=0,this._register(this._configurationService.onDidChangeConfiguration((e=>this._updateModelOptions(e)))),this._updateModelOptions(void 0)}static _readModelOptions(e,t){var i;let n=Sc.tabSize;if(e.editor&&void 0!==e.editor.tabSize){const t=parseInt(e.editor.tabSize,10);isNaN(t)||(n=t),n<1&&(n=1)}let s="tabSize";if(e.editor&&void 0!==e.editor.indentSize&&"tabSize"!==e.editor.indentSize){const t=parseInt(e.editor.indentSize,10);isNaN(t)||(s=Math.max(t,1))}let o=Sc.insertSpaces;e.editor&&void 0!==e.editor.insertSpaces&&(o="false"!==e.editor.insertSpaces&&Boolean(e.editor.insertSpaces));let r=bie;const a=e.eol;"\r\n"===a?r=2:"\n"===a&&(r=1);let l=Sc.trimAutoWhitespace;e.editor&&void 0!==e.editor.trimAutoWhitespace&&(l="false"!==e.editor.trimAutoWhitespace&&Boolean(e.editor.trimAutoWhitespace));let h=Sc.detectIndentation;e.editor&&void 0!==e.editor.detectIndentation&&(h="false"!==e.editor.detectIndentation&&Boolean(e.editor.detectIndentation));let d=Sc.largeFileOptimizations;e.editor&&void 0!==e.editor.largeFileOptimizations&&(d="false"!==e.editor.largeFileOptimizations&&Boolean(e.editor.largeFileOptimizations));let c=Sc.bracketPairColorizationOptions;return(null===(i=e.editor)||void 0===i?void 0:i.bracketPairColorization)&&"object"==typeof e.editor.bracketPairColorization&&(c={enabled:!!e.editor.bracketPairColorization.enabled,independentColorPoolPerBracketType:!!e.editor.bracketPairColorization.independentColorPoolPerBracketType}),{isForSimpleWidget:t,tabSize:n,indentSize:s,insertSpaces:o,detectIndentation:h,defaultEOL:r,trimAutoWhitespace:l,largeFileOptimizations:d,bracketPairColorizationOptions:c}}_getEOL(e,t){if(e)return this._resourcePropertiesService.getEOL(e,t);const i=this._configurationService.getValue("files.eol",{overrideIdentifier:t});return i&&"string"==typeof i&&"auto"!==i?i:3===$e||2===$e?"\n":"\r\n"}_shouldRestoreUndoStack(){const e=this._configurationService.getValue("files.restoreUndoStack");return"boolean"!=typeof e||e}getCreationOptions(e,t,i){const n="string"==typeof e?e:e.languageId;let s=this._modelCreationOptionsByLanguageAndResource[n+t];if(!s){const e=this._configurationService.getValue("editor",{overrideIdentifier:n,resource:t}),o=this._getEOL(t,n);s=pie._readModelOptions({editor:e,eol:o},i),this._modelCreationOptionsByLanguageAndResource[n+t]=s}return s}_updateModelOptions(e){const t=this._modelCreationOptionsByLanguageAndResource;this._modelCreationOptionsByLanguageAndResource=Object.create(null);const i=Object.keys(this._models);for(let n=0,s=i.length;ne){const t=[];for(this._disposedModels.forEach((e=>{e.sharesUndoRedoStack||t.push(e)})),t.sort(((e,t)=>e.time-t.time));t.length>0&&this._disposedModelsHeapSize>e;){const e=t.shift();this._removeDisposedModel(e.uri),null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}}}_createModelData(e,t,i,n){const s=this.getCreationOptions(t,i,n),o=new Cw(e,t,s,i,this._undoRedoService,this._languageService,this._languageConfigurationService);if(i&&this._disposedModels.has(_ie(i))){const e=this._removeDisposedModel(i),t=this._undoRedoService.getElements(i),n=this._getSHA1Computer(),s=!!n.canComputeSHA1(o)&&n.computeSHA1(o)===e.sha1;if(s||e.sharesUndoRedoStack){for(const e of t.past)Gv(e)&&e.matchesResource(i)&&e.setModel(o);for(const e of t.future)Gv(e)&&e.matchesResource(i)&&e.setModel(o);this._undoRedoService.setElementsValidFlag(i,!0,(e=>Gv(e)&&e.matchesResource(i))),s&&(o._overwriteVersionId(e.versionId),o._overwriteAlternativeVersionId(e.alternativeVersionId),o._overwriteInitialUndoRedoSnapshot(e.initialUndoRedoSnapshot))}else null!==e.initialUndoRedoSnapshot&&this._undoRedoService.restoreSnapshot(e.initialUndoRedoSnapshot)}const r=_ie(o.uri);if(this._models[r])throw new Error("ModelService: Cannot add model because it already exists!");const a=new vie(o,(e=>this._onWillDispose(e)),((e,t)=>this._onDidChangeLanguage(e,t)));return this._models[r]=a,a}createModel(e,t,i,n=!1){let s;return s=t?this._createModelData(e,t,i,n):this._createModelData(e,Ku,i,n),this._onModelAdded.fire(s.model),s.model}getModels(){const e=[],t=Object.keys(this._models);for(let i=0,n=t.length;i0||t.future.length>0){for(const i of t.past)Gv(i)&&i.matchesResource(e.uri)&&(s=!0,o+=i.heapSize(e.uri),i.setModel(e.uri));for(const i of t.future)Gv(i)&&i.matchesResource(e.uri)&&(s=!0,o+=i.heapSize(e.uri),i.setModel(e.uri))}}const r=pie.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK,a=this._getSHA1Computer();if(s)if(n||!(o>r)&&a.canComputeSHA1(e))this._ensureDisposedModelsHeapSize(r-o),this._undoRedoService.setElementsValidFlag(e.uri,!1,(t=>Gv(t)&&t.matchesResource(e.uri))),this._insertDisposedModel(new Cie(e.uri,i.model.getInitialUndoRedoSnapshot(),Date.now(),n,o,a.computeSHA1(e),e.getVersionId(),e.getAlternativeVersionId()));else{const e=i.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}else if(!n){const e=i.model.getInitialUndoRedoSnapshot();null!==e&&this._undoRedoService.restoreSnapshot(e)}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(),s=this.getCreationOptions(i,e.uri,e.isForSimpleWidget),o=this.getCreationOptions(n,e.uri,e.isForSimpleWidget);pie._setModelOptionsForModel(e,o,s),this._onModelModeChanged.fire({model:e,oldLanguageId:i})}_getSHA1Computer(){return new yie}};wie.MAX_MEMORY_FOR_CLOSED_FILES_UNDO_STACK=20971520,wie=pie=mie([fie(0,pu),fie(1,mT),fie(2,hw),fie(3,Lc),fie(4,Ju)],wie);class yie{canComputeSHA1(e){return e.getValueLength()<=yie.MAX_MODEL_SIZE}computeSHA1(e){const t=new bE,i=e.createSnapshot();let n;for(;n=i.read();)t.update(n);return t.digest()}}yie.MAX_MODEL_SIZE=10485760;var Sie=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Lie=function(e,t){return function(i,n){t(i,n,e)}};let kie=class extends E{constructor(e,t){super(),this.quickInputService=e,this.instantiationService=t,this.registry=jl.as(MJ),this.mapProviderToDescriptor=new Map,this.lastAcceptedPickerValues=new Map,this.visibleQuickAccess=void 0}show(e="",t){this.doShowOrPick(e,!1,t)}doShowOrPick(e,t,i){var n;const[s,o]=this.getOrInstantiateProvider(e),r=this.visibleQuickAccess,a=null==r?void 0:r.descriptor;if(r&&o&&a===o)return e===o.prefix||(null==i?void 0:i.preserveValue)||(r.picker.value=e),void this.adjustValueSelection(r.picker,o,i);if(o&&!(null==i?void 0:i.preserveValue)){let t;if(r&&a&&a!==o){const e=r.value.substr(a.prefix.length);e&&(t=`${o.prefix}${e}`)}if(!t){const e=null==s?void 0:s.defaultFilterValue;e===IJ.LAST?t=this.lastAcceptedPickerValues.get(o):"string"==typeof e&&(t=`${o.prefix}${e}`)}"string"==typeof t&&(e=t)}const l=new N,h=l.add(this.quickInputService.createQuickPick());let d;h.value=e,this.adjustValueSelection(h,o,i),h.placeholder=null==o?void 0:o.placeholder,h.quickNavigate=null==i?void 0:i.quickNavigateConfiguration,h.hideInput=!!h.quickNavigate&&!r,("number"==typeof(null==i?void 0:i.itemActivation)||(null==i?void 0:i.quickNavigateConfiguration))&&(h.itemActivation=null!==(n=null==i?void 0:i.itemActivation)&&void 0!==n?n:dE.SECOND),h.contextKey=null==o?void 0:o.contextKey,h.filterValue=e=>e.substring(o?o.prefix.length:0),t&&(d=new hd,l.add(B.once(h.onWillAccept)((e=>{e.veto(),h.hide()})))),l.add(this.registerPickerListeners(h,s,o,e,null==i?void 0:i.providerOptions));const c=l.add(new jh);return s&&l.add(s.provide(h,c.token,null==i?void 0:i.providerOptions)),B.once(h.onDidHide)((()=>{0===h.selectedItems.length&&c.cancel(),l.dispose(),null==d||d.complete(h.selectedItems.slice(0))})),h.show(),t?null==d?void 0:d.p:void 0}adjustValueSelection(e,t,i){var n;let s;s=(null==i?void 0:i.preserveValue)?[e.value.length,e.value.length]:[null!==(n=null==t?void 0:t.prefix.length)&&void 0!==n?n:0,e.value.length],e.valueSelection=s}registerPickerListeners(e,t,i,n,s){const o=new N,r=this.visibleQuickAccess={picker:e,descriptor:i,value:n};return o.add(x((()=>{r===this.visibleQuickAccess&&(this.visibleQuickAccess=void 0)}))),o.add(e.onDidChangeValue((e=>{const[i]=this.getOrInstantiateProvider(e);i!==t?this.show(e,{preserveValue:!0,providerOptions:s}):r.value=e}))),i&&o.add(e.onDidAccept((()=>{this.lastAcceptedPickerValues.set(i,e.value)}))),o}getOrInstantiateProvider(e){const t=this.registry.getQuickAccessProvider(e);if(!t)return[void 0,void 0];let i=this.mapProviderToDescriptor.get(t);return i||(i=this.instantiationService.createInstance(t.ctor),this.mapProviderToDescriptor.set(t,i)),[i,t]}};kie=Sie([Lie(0,cE),Lie(1,Fa)],kie);const Die="done",xie="active",Nie="infinite",Eie="infinite-long-running",Iie="discrete";class Mie extends E{constructor(e,t){super(),this.workedVal=0,this.showDelayedScheduler=this._register(new rd((()=>_s(this.element)),0)),this.longRunningScheduler=this._register(new rd((()=>this.infiniteLongRunning()),Mie.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=(null==t?void 0:t.progressBarBackground)||"#0E70C0",this.element.appendChild(this.bit)}off(){this.bit.style.width="inherit",this.bit.style.opacity="1",this.element.classList.remove(xie,Nie,Eie,Iie),this.workedVal=0,this.totalWork=void 0,this.longRunningScheduler.cancel()}stop(){return this.doDone(!1)}doDone(e){return this.element.classList.add(Die),this.element.classList.contains(Nie)?(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(Iie,Die,Eie),this.element.classList.add(xie,Nie),this.longRunningScheduler.schedule(),this}infiniteLongRunning(){this.element.classList.add(Eie)}getContainer(){return this.element}}Mie.LONG_RUNNING_INFINITE_THRESHOLD=1e4;const Tie=fs;class Rie extends E{constructor(e,t,i){super(),this.parent=e,this.onKeyDown=e=>En(this.findInput.inputBox.inputElement,os.KEY_DOWN,(t=>{e(new St(t))})),this.onMouseDown=e=>En(this.findInput.inputBox.inputElement,os.MOUSE_DOWN,(t=>{e(new Nt(t))})),this.onDidChange=e=>this.findInput.onDidChange(e),this.container=ds(this.parent,Tie(".quick-input-box")),this.findInput=this._register(new MV(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)}isSelectionAtEnd(){return this.findInput.inputBox.isSelectionAtEnd()}get placeholder(){return this.findInput.inputBox.inputElement.getAttribute("placeholder")||""}set placeholder(e){this.findInput.inputBox.setPlaceHolder(e)}get password(){return"password"===this.findInput.inputBox.inputElement.type}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)}setAttribute(e,t){this.findInput.inputBox.inputElement.setAttribute(e,t)}showDecoration(e){e===gL.Ignore?this.findInput.clearMessage():this.findInput.showMessage({type:e===gL.Info?1:e===gL.Warning?2:3,content:""})}stylesForType(e){return this.findInput.inputBox.stylesForType(e===gL.Info?1:e===gL.Warning?2:3)}setFocus(){this.findInput.focus()}layout(){this.findInput.inputBox.layout()}}const Aie=new Zs((()=>{const e=new Intl.Collator(void 0,{numeric:!0,sensitivity:"base"});return{collator:e,collatorIsNumeric:e.resolvedOptions().numeric}}));new Zs((()=>({collator:new Intl.Collator(void 0,{numeric:!0})}))),new Zs((()=>({collator:new Intl.Collator(void 0,{numeric:!0,sensitivity:"accent"})})));function Oie(e,t,i){const n=e.toLowerCase(),s=t.toLowerCase(),o=function(e,t,i){const n=e.toLowerCase(),s=t.toLowerCase(),o=n.startsWith(i),r=s.startsWith(i);if(o!==r)return o?-1:1;if(o&&r){if(n.lengths.length)return 1}return 0}(e,t,i);if(o)return o;const r=n.endsWith(i);if(r!==s.endsWith(i))return r?-1:1;const a=function(e,t,i=!1){const n=e||"",s=t||"",o=Aie.value.collator.compare(n,s);return Aie.value.collatorIsNumeric&&0===o&&n!==s?n=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r};class Fie{constructor(e){this.nodes=e}toString(){return this.nodes.map((e=>"string"==typeof e?e:e.label)).join("")}}Pie([qL],Fie.prototype,"toString",null);const Bie=/\[([^\]]+)\]\(((?:https?:\/\/|command:|file:)[^\)\s]+)(?: (["'])(.+?)(\3))?\)/gi;const Wie={},Vie=new dk("quick-input-button-icon-");function Hie(e){if(!e)return;let t;const i=e.dark.toString();return Wie[i]?t=Wie[i]:(t=Vie.nextId(),is(`.${t}, .hc-light .${t}`,`background-image: ${ws(e.light||e.dark)}`),is(`.vs-dark .${t}, .hc-black .${t}`,`background-image: ${ws(e.dark)}`),Wie[i]=t),t}function zie(e,t,i){us(t);const n=function(e){const t=[];let i,n=0;for(;i=Bie.exec(e);){i.index-n>0&&t.push(e.substring(n,i.index));const[,s,o,,r]=i;r?t.push({label:s,href:o,title:r}):t.push({label:s,href:o}),n=i.index+i[0].length}return n{rs(e)&&as(e,!0),i.callback(o.href)},a=i.disposables.add(new Ky(n,os.CLICK)).event,l=i.disposables.add(new Ky(n,os.KEY_DOWN)).event,h=B.chain(l,(e=>e.filter((e=>{const t=new St(e);return t.equals(10)||t.equals(3)}))));i.disposables.add(ZL.addTarget(n));const d=i.disposables.add(new Ky(n,$L.Tap)).event;B.any(a,d,h)(r,null,i.disposables),t.appendChild(n)}}var Uie=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Kie=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const jie=fs;class qie{constructor(e,t,i,n,s,o,r){var a,l,h;this._checked=!1,this._hidden=!1,this.hasCheckbox=n,this.index=i,this.fireButtonTriggered=s,this.fireSeparatorButtonTriggered=o,this._onChecked=r,this.onChecked=n?B.map(B.filter(this._onChecked.event,(e=>e.listElement===this)),(e=>e.checked)):B.None,"separator"===e.type?this._separator=e:(this.item=e,t&&"separator"===t.type&&!t.buttons&&(this._separator=t),this.saneDescription=this.item.description,this.saneDetail=this.item.detail,this._labelHighlights=null===(a=this.item.highlights)||void 0===a?void 0:a.label,this._descriptionHighlights=null===(l=this.item.highlights)||void 0===l?void 0:l.description,this._detailHighlights=null===(h=this.item.highlights)||void 0===h?void 0:h.detail,this.saneTooltip=this.item.tooltip),this._init=new Zs((()=>{var t;const i=null!==(t=e.label)&&void 0!==t?t:"",n=ha(i).text.trim(),s=e.ariaLabel||[i,this.saneDescription,this.saneDetail].map((e=>{return(t=e)?t.replace(/\$\((.*?)\)/g,((e,t)=>` ${t} `)).trim():"";var t})).filter((e=>!!e)).join(", ");return{saneLabel:i,saneSortLabel:n,saneAriaLabel:s}}))}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 checked(){return this._checked}set checked(e){e!==this._checked&&(this._checked=e,this._onChecked.fire({listElement:this,checked:e}))}get separator(){return this._separator}set separator(e){this._separator=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 $ie{constructor(e){this.themeService=e}get templateId(){return $ie.ID}renderTemplate(e){const t=Object.create(null);t.toDisposeElement=[],t.toDisposeTemplate=[],t.entry=ds(e,jie(".quick-input-list-entry"));const i=ds(t.entry,jie("label.quick-input-list-label"));t.toDisposeTemplate.push(Mn(i,os.CLICK,(e=>{t.checkbox.offsetParent||e.preventDefault()}))),t.checkbox=ds(i,jie("input.quick-input-list-checkbox")),t.checkbox.type="checkbox",t.toDisposeTemplate.push(Mn(t.checkbox,os.CHANGE,(e=>{t.element.checked=t.checkbox.checked})));const n=ds(i,jie(".quick-input-list-rows")),s=ds(n,jie(".quick-input-list-row")),o=ds(n,jie(".quick-input-list-row"));t.label=new qz(s,{supportHighlights:!0,supportDescriptionHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.label),t.icon=cs(t.label.element,jie(".quick-input-list-icon"));const r=ds(s,jie(".quick-input-list-entry-keybinding"));t.keybinding=new zx(r,$e);const a=ds(o,jie(".quick-input-list-label-meta"));return t.detail=new qz(a,{supportHighlights:!0,supportIcons:!0}),t.toDisposeTemplate.push(t.detail),t.separator=ds(t.entry,jie(".quick-input-list-separator")),t.actionBar=new Rx(t.entry),t.actionBar.domNode.classList.add("quick-input-list-entry-action-bar"),t.toDisposeTemplate.push(t.actionBar),t}renderElement(e,t,i){var n,s,o,r;i.element=e,e.element=null!==(n=i.entry)&&void 0!==n?n:void 0;const a=e.item?e.item:e.separator;i.checkbox.checked=e.checked,i.toDisposeElement.push(e.onChecked((e=>i.checkbox.checked=e)));const{labelHighlights:l,descriptionHighlights:h,detailHighlights:d}=e;if(null===(s=e.item)||void 0===s?void 0:s.iconPath){const t=O_(this.themeService.getColorTheme().type)?e.item.iconPath.dark:null!==(o=e.item.iconPath.light)&&void 0!==o?o:e.item.iconPath.dark,n=an.revive(t);i.icon.className="quick-input-list-icon",i.icon.style.backgroundImage=ws(n)}else i.icon.style.backgroundImage="",i.icon.className=(null===(r=e.item)||void 0===r?void 0:r.iconClass)?`quick-input-list-icon ${e.item.iconClass}`:"";const c={matches:l||[],descriptionTitle:e.saneDescription,descriptionMatches:h||[],labelEscapeNewLines:!0};"separator"!==a.type?(c.extraClasses=a.iconClasses,c.italic=a.italic,c.strikethrough=a.strikethrough,i.entry.classList.remove("quick-input-list-separator-as-item")):i.entry.classList.add("quick-input-list-separator-as-item"),i.label.setLabel(e.saneLabel,e.saneDescription,c),i.keybinding.set("separator"===a.type?void 0:a.keybinding),e.saneDetail?(i.detail.element.style.display="",i.detail.setLabel(e.saneDetail,void 0,{matches:d,title:e.saneDetail,labelEscapeNewLines:!0})):i.detail.element.style.display="none",e.item&&e.separator&&e.separator.label?(i.separator.textContent=e.separator.label,i.separator.style.display=""):i.separator.style.display="none",i.entry.classList.toggle("quick-input-list-separator-border",!!e.separator);const u=a.buttons;u&&u.length?(i.actionBar.push(u.map(((t,i)=>{let n=t.iconClass||(t.iconPath?Hie(t.iconPath):void 0);return t.alwaysVisible&&(n=n?`${n} always-visible`:"always-visible"),{id:`id-${i}`,class:n,enabled:!0,label:"",tooltip:t.tooltip||"",run:()=>{"separator"!==a.type?e.fireButtonTriggered({button:t,item:a}):e.fireSeparatorButtonTriggered({button:t,separator:a})}}})),{icon:!0,label:!1}),i.entry.classList.add("has-actions")):i.entry.classList.remove("has-actions")}disposeElement(e,t,i){i.toDisposeElement=k(i.toDisposeElement),i.actionBar.clear()}disposeTemplate(e){e.toDisposeElement=k(e.toDisposeElement),e.toDisposeTemplate=k(e.toDisposeTemplate)}}$ie.ID="listelement";class Gie{getHeight(e){return e.item?e.saneDetail?44:22:24}getTemplateId(e){return $ie.ID}}var Zie;!function(e){e[e.First=1]="First",e[e.Second=2]="Second",e[e.Last=3]="Last",e[e.Next=4]="Next",e[e.Previous=5]="Previous",e[e.NextPage=6]="NextPage",e[e.PreviousPage=7]="PreviousPage"}(Zie||(Zie={}));class Yie{constructor(e,t,i,n){this.parent=e,this.options=i,this.inputElements=[],this.elements=[],this.elementsToIndexes=new Map,this.matchOnDescription=!1,this.matchOnDetail=!1,this.matchOnLabel=!0,this.matchOnLabelMode="fuzzy",this.sortByLabel=!0,this._onChangedAllVisibleChecked=new U,this.onChangedAllVisibleChecked=this._onChangedAllVisibleChecked.event,this._onChangedCheckedCount=new U,this.onChangedCheckedCount=this._onChangedCheckedCount.event,this._onChangedVisibleCount=new U,this.onChangedVisibleCount=this._onChangedVisibleCount.event,this._onChangedCheckedElements=new U,this.onChangedCheckedElements=this._onChangedCheckedElements.event,this._onButtonTriggered=new U,this.onButtonTriggered=this._onButtonTriggered.event,this._onSeparatorButtonTriggered=new U,this.onSeparatorButtonTriggered=this._onSeparatorButtonTriggered.event,this._onKeyDown=new U,this.onKeyDown=this._onKeyDown.event,this._onLeave=new U,this.onLeave=this._onLeave.event,this._listElementChecked=new U,this._fireCheckedEvents=!0,this.elementDisposables=[],this.disposables=[],this.id=t,this.container=ds(this.parent,jie(".quick-input-list"));const s=new Gie,o=new Qie;if(this.list=i.createList("QuickInput",this.container,s,[new $ie(n)],{identityProvider:{getId:e=>{var t,i,n,s,o,r,a,l;return null!==(l=null!==(r=null!==(s=null!==(i=null===(t=e.item)||void 0===t?void 0:t.id)&&void 0!==i?i:null===(n=e.item)||void 0===n?void 0:n.label)&&void 0!==s?s:null===(o=e.separator)||void 0===o?void 0:o.id)&&void 0!==r?r:null===(a=e.separator)||void 0===a?void 0:a.label)&&void 0!==l?l:""}},setRowLineHeight:!1,multipleSelectionSupport:!1,horizontalScrolling:!1,accessibilityProvider:o}),this.list.getHTMLElement().id=t,this.disposables.push(this.list),this.disposables.push(this.list.onKeyDown((e=>{const t=new St(e);switch(t.keyCode){case 10:this.toggleCheckbox();break;case 31:(Pe?e.metaKey:e.ctrlKey)&&this.list.setFocus(Kd(this.list.length));break;case 16:{const e=this.list.getFocus();1===e.length&&0===e[0]&&this._onLeave.fire();break}case 18:{const e=this.list.getFocus();1===e.length&&e[0]===this.list.length-1&&this._onLeave.fire();break}}this._onKeyDown.fire(t)}))),this.disposables.push(this.list.onMouseDown((e=>{2!==e.browserEvent.button&&e.browserEvent.preventDefault()}))),this.disposables.push(En(this.container,os.CLICK,(e=>{(e.x||e.y)&&this._onLeave.fire()}))),this.disposables.push(this.list.onMouseMiddleClick((e=>{this._onLeave.fire()}))),this.disposables.push(this.list.onContextMenu((e=>{"number"==typeof e.index&&(e.browserEvent.preventDefault(),this.list.setSelection([e.index]))}))),i.hoverDelegate){const e=new ed(i.hoverDelegate.delay);this.disposables.push(this.list.onMouseOver((t=>Kie(this,void 0,void 0,(function*(){var i;if(t.browserEvent.target instanceof HTMLAnchorElement)e.cancel();else if(t.browserEvent.relatedTarget instanceof HTMLAnchorElement||!qn(t.browserEvent.relatedTarget,null===(i=t.element)||void 0===i?void 0:i.element))try{yield e.trigger((()=>Kie(this,void 0,void 0,(function*(){t.element&&this.showHover(t.element)}))))}catch(t){if(!d(t))throw t}}))))),this.disposables.push(this.list.onMouseOut((t=>{var i;qn(t.browserEvent.relatedTarget,null===(i=t.element)||void 0===i?void 0:i.element)||e.cancel()}))),this.disposables.push(e)}this.disposables.push(this._listElementChecked.event((e=>this.fireCheckedEvents()))),this.disposables.push(this._onChangedAllVisibleChecked,this._onChangedCheckedCount,this._onChangedVisibleCount,this._onChangedCheckedElements,this._onButtonTriggered,this._onSeparatorButtonTriggered,this._onLeave,this._onKeyDown)}get onDidChangeFocus(){return B.map(this.list.onDidChangeFocus,(e=>e.elements.map((e=>e.item))))}get onDidChangeSelection(){return B.map(this.list.onDidChangeSelection,(e=>({items:e.elements.map((e=>e.item)),event:e.browserEvent})))}get scrollTop(){return this.list.scrollTop}set scrollTop(e){this.list.scrollTop=e}get ariaLabel(){return this.list.getHTMLElement().ariaLabel}set ariaLabel(e){this.list.getHTMLElement().ariaLabel=e}getAllVisibleChecked(){return this.allVisibleChecked(this.elements,!1)}allVisibleChecked(e,t=!0){for(let i=0,n=e.length;i{t.hidden||(t.checked=e)}))}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}setElements(e){this.elementDisposables=k(this.elementDisposables);const t=e=>this.fireButtonTriggered(e),i=e=>this.fireSeparatorButtonTriggered(e);this.inputElements=e;const n=new Map,s=this.parent.classList.contains("show-checkboxes");this.elements=e.reduce(((o,r,a)=>{var l;const h=a>0?e[a-1]:void 0;if("separator"===r.type&&!r.buttons)return o;const d=new qie(r,h,a,s,t,i,this._listElementChecked),c=o.length;return o.push(d),n.set(null!==(l=d.item)&&void 0!==l?l:d.separator,c),o}),[]),this.elementsToIndexes=n,this.list.splice(0,this.list.length),this.list.splice(0,this.list.length,this.elements),this._onChangedVisibleCount.fire(this.elements.length)}getFocusedElements(){return this.list.getFocusedElements().map((e=>e.item))}setFocusedElements(e){if(this.list.setFocus(e.filter((e=>this.elementsToIndexes.has(e))).map((e=>this.elementsToIndexes.get(e)))),e.length>0){const e=this.list.getFocus()[0];"number"==typeof e&&this.list.reveal(e)}}getActiveDescendant(){return this.list.getHTMLElement().getAttribute("aria-activedescendant")}setSelectedElements(e){this.list.setSelection(e.filter((e=>this.elementsToIndexes.has(e))).map((e=>this.elementsToIndexes.get(e))))}getCheckedElements(){return this.elements.filter((e=>e.checked)).map((e=>e.item)).filter((e=>!!e))}setCheckedElements(e){try{this._fireCheckedEvents=!1;const t=new Set;for(const i of e)t.add(i);for(const e of this.elements)e.checked=t.has(e.item)}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}set enabled(e){this.list.getHTMLElement().style.pointerEvents=e?"":"none"}focus(e){if(!this.list.length)return;switch(e===Zie.Second&&this.list.length<2&&(e=Zie.First),e){case Zie.First:this.list.scrollTop=0,this.list.focusFirst(void 0,(e=>!!e.item));break;case Zie.Second:this.list.scrollTop=0,this.list.focusNth(1,void 0,(e=>!!e.item));break;case Zie.Last:this.list.scrollTop=this.list.scrollHeight,this.list.focusLast(void 0,(e=>!!e.item));break;case Zie.Next:{this.list.focusNext(void 0,!0,void 0,(e=>!!e.item));const e=this.list.getFocus()[0];0!==e&&!this.elements[e-1].item&&this.list.firstVisibleIndex>e-1&&this.list.reveal(e-1);break}case Zie.Previous:{this.list.focusPrevious(void 0,!0,void 0,(e=>!!e.item));const e=this.list.getFocus()[0];0!==e&&!this.elements[e-1].item&&this.list.firstVisibleIndex>e-1&&this.list.reveal(e-1);break}case Zie.NextPage:this.list.focusNextPage(void 0,(e=>!!e.item));break;case Zie.PreviousPage:this.list.focusPreviousPage(void 0,(e=>!!e.item))}const t=this.list.getFocus()[0];"number"==typeof t&&this.list.reveal(t)}clearFocus(){this.list.setFocus([])}domFocus(){this.list.domFocus()}showHover(e){var t,i,n;void 0!==this.options.hoverDelegate&&(this._lastHover&&!this._lastHover.isDisposed&&(null===(i=(t=this.options.hoverDelegate).onDidHideHover)||void 0===i||i.call(t),null===(n=this._lastHover)||void 0===n||n.dispose()),e.element&&e.saneTooltip&&(this._lastHover=this.options.hoverDelegate.showHover({content:e.saneTooltip,target:e.element,linkHandler:e=>{this.options.linkOpenerDelegate(e)},showPointer:!0,container:this.container,hoverPosition:1},!1)))}layout(e){this.list.getHTMLElement().style.maxHeight=e?44*Math.floor(e/44)+6+"px":"",this.list.layout()}filter(e){if(!(this.sortByLabel||this.matchOnLabel||this.matchOnDescription||this.matchOnDetail))return this.list.layout(),!1;const t=e;if((e=e.trim())&&(this.matchOnLabel||this.matchOnDescription||this.matchOnDetail)){let i;this.elements.forEach((n=>{var s,o,r,a;let l;l="fuzzy"===this.matchOnLabelMode?this.matchOnLabel&&null!==(s=da(e,ha(n.saneLabel)))&&void 0!==s?s:void 0:this.matchOnLabel&&null!==(o=function(e,t){const{text:i,iconOffsets:n}=t;if(!n||0===n.length)return Xie(e,i);const s=io(i," "),o=i.length-s.length,r=Xie(e,s);if(r)for(const a of r){const e=n[a.start+o]+o;a.start+=e,a.end+=e}return r}(t,ha(n.saneLabel)))&&void 0!==o?o:void 0;const h=this.matchOnDescription&&null!==(r=da(e,ha(n.saneDescription||"")))&&void 0!==r?r:void 0,d=this.matchOnDetail&&null!==(a=da(e,ha(n.saneDetail||"")))&&void 0!==a?a:void 0;if(l||h||d?(n.labelHighlights=l,n.descriptionHighlights=h,n.detailHighlights=d,n.hidden=!1):(n.labelHighlights=void 0,n.descriptionHighlights=void 0,n.detailHighlights=void 0,n.hidden=!n.item||!n.item.alwaysShow),n.item?n.separator=void 0:n.separator&&(n.hidden=!0),!this.sortByLabel){const e=n.index&&this.inputElements[n.index-1];i=e&&"separator"===e.type?e:i,i&&!n.hidden&&(n.separator=i,i=void 0)}}))}else this.elements.forEach((e=>{e.labelHighlights=void 0,e.descriptionHighlights=void 0,e.detailHighlights=void 0,e.hidden=!1;const t=e.index&&this.inputElements[e.index-1];e.item&&(e.separator=t&&"separator"===t.type&&!t.buttons?t:void 0)}));const i=this.elements.filter((e=>!e.hidden));if(this.sortByLabel&&e){const t=e.toLowerCase();i.sort(((e,i)=>function(e,t,i){const n=e.labelHighlights||[],s=t.labelHighlights||[];if(n.length&&!s.length)return-1;if(!n.length&&s.length)return 1;if(0===n.length&&0===s.length)return 0;return Oie(e.saneSortLabel,t.saneSortLabel,i)}(e,i,t)))}return this.elementsToIndexes=i.reduce(((e,t,i)=>{var n;return e.set(null!==(n=t.item)&&void 0!==n?n:t.separator,i),e}),new Map),this.list.splice(0,this.list.length,i),this.list.setFocus([]),this.list.layout(),this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedVisibleCount.fire(i.length),!0}toggleCheckbox(){try{this._fireCheckedEvents=!1;const e=this.list.getFocusedElements(),t=this.allVisibleChecked(e);for(const i of e)i.checked=!t}finally{this._fireCheckedEvents=!0,this.fireCheckedEvents()}}display(e){this.container.style.display=e?"":"none"}isDisplayed(){return"none"!==this.container.style.display}dispose(){this.elementDisposables=k(this.elementDisposables),this.disposables=k(this.disposables)}fireCheckedEvents(){this._fireCheckedEvents&&(this._onChangedAllVisibleChecked.fire(this.getAllVisibleChecked()),this._onChangedCheckedCount.fire(this.getCheckedCount()),this._onChangedCheckedElements.fire(this.getCheckedElements()))}fireButtonTriggered(e){this._onButtonTriggered.fire(e)}fireSeparatorButtonTriggered(e){this._onSeparatorButtonTriggered.fire(e)}style(e){this.list.style(e)}toggleHover(){const e=this.list.getFocusedElements()[0];if(!(null==e?void 0:e.saneTooltip))return;if(this._lastHover&&!this._lastHover.isDisposed)return void this._lastHover.dispose();const t=this.list.getFocusedElements()[0];if(!t)return;this.showHover(t);const i=new N;i.add(this.list.onDidChangeFocus((e=>{e.indexes.length&&this.showHover(e.elements[0])}))),this._lastHover&&i.add(this._lastHover),this._toggleHover=i,this.elementDisposables.push(this._toggleHover)}}function Xie(e,t){const i=t.toLowerCase().indexOf(e.toLowerCase());return-1!==i?[{start:i,end:i+e.length}]:null}Uie([qL],Yie.prototype,"onDidChangeFocus",null),Uie([qL],Yie.prototype,"onDidChangeSelection",null);class Qie{getWidgetAriaLabel(){return ue(0,"Quick Input")}getAriaLabel(e){var t;return(null===(t=e.separator)||void 0===t?void 0:t.label)?`${e.saneAriaLabel}, ${e.separator.label}`:e.saneAriaLabel}getWidgetRole(){return"listbox"}getRole(e){return e.hasCheckbox?"checkbox":"option"}isChecked(e){if(e.hasCheckbox)return{value:e.checked,onDidChange:e.onChecked}}}var Jie=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};const ene={iconClass:ta.asClassName(Jr.quickInputBack),tooltip:ue(0,"Back"),handle:-1};class tne extends E{constructor(e){super(),this.ui=e,this._widgetUpdated=!1,this.visible=!1,this._enabled=!0,this._busy=!1,this._ignoreFocusOut=!1,this._buttons=[],this.buttonsUpdated=!1,this._toggles=[],this.togglesUpdated=!1,this.noValidationMessage=tne.noPromptMessage,this._severity=gL.Ignore,this.onDidTriggerButtonEmitter=this._register(new U),this.onDidHideEmitter=this._register(new U),this.onDisposeEmitter=this._register(new U),this.visibleDisposables=this._register(new N),this.onDidHide=this.onDidHideEmitter.event}get title(){return this._title}set title(e){this._title=e,this.update()}get description(){return this._description}set description(e){this._description=e,this.update()}get step(){return this._steps}set step(e){this._steps=e,this.update()}get totalSteps(){return this._totalSteps}set totalSteps(e){this._totalSteps=e,this.update()}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this.update()}get contextKey(){return this._contextKey}set contextKey(e){this._contextKey=e,this.update()}get busy(){return this._busy}set busy(e){this._busy=e,this.update()}get ignoreFocusOut(){return this._ignoreFocusOut}set ignoreFocusOut(e){const t=this._ignoreFocusOut!==e&&!He;this._ignoreFocusOut=e&&!He,t&&this.update()}get buttons(){return this._buttons}set buttons(e){this._buttons=e,this.buttonsUpdated=!0,this.update()}get toggles(){return this._toggles}set toggles(e){this._toggles=null!=e?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=>{-1!==this.buttons.indexOf(e)&&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=hE.Other){this.visible=!1,this.visibleDisposables.clear(),this.onDidHideEmitter.fire({reason:e})}update(){var e,t;if(!this.visible)return;const i=this.getTitle();i&&this.ui.title.textContent!==i?this.ui.title.textContent=i:i||" "===this.ui.title.innerHTML||(this.ui.title.innerText="\xa0");const n=this.getDescription();if(this.ui.description1.textContent!==n&&(this.ui.description1.textContent=n),this.ui.description2.textContent!==n&&(this.ui.description2.textContent=n),this._widgetUpdated&&(this._widgetUpdated=!1,this._widget?us(this.ui.widget,this._widget):us(this.ui.widget)),this.busy&&!this.busyDelay&&(this.busyDelay=new sd,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 e=this.buttons.filter((e=>e===ene));this.ui.leftActionBar.push(e.map(((e,t)=>{const i=new Ka(`id-${t}`,"",e.iconClass||Hie(e.iconPath),!0,(()=>Jie(this,void 0,void 0,(function*(){this.onDidTriggerButtonEmitter.fire(e)}))));return i.tooltip=e.tooltip||"",i})),{icon:!0,label:!1}),this.ui.rightActionBar.clear();const t=this.buttons.filter((e=>e!==ene));this.ui.rightActionBar.push(t.map(((e,t)=>{const i=new Ka(`id-${t}`,"",e.iconClass||Hie(e.iconPath),!0,(()=>Jie(this,void 0,void 0,(function*(){this.onDidTriggerButtonEmitter.fire(e)}))));return i.tooltip=e.tooltip||"",i})),{icon:!0,label:!1})}if(this.togglesUpdated){this.togglesUpdated=!1;const i=null!==(t=null===(e=this.toggles)||void 0===e?void 0:e.filter((e=>e instanceof vV)))&&void 0!==t?t:[];this.ui.inputBox.toggles=i}this.ui.ignoreFocusOut=this.ignoreFocusOut,this.ui.setEnabled(this.enabled),this.ui.setContextKey(this.contextKey);const s=this.validationMessage||this.noValidationMessage;this._lastValidationMessage!==s&&(this._lastValidationMessage=s,us(this.ui.message),zie(s,this.ui.message,{callback:e=>{this.ui.linkOpenerDelegate(e)},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?ue(0,"{0}/{1}",this.step,this.totalSteps):this.step?String(this.step):""}showMessageDecoration(e){if(this.ui.inputBox.showDecoration(e),e!==gL.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()}}tne.noPromptMessage=ue(0,"Press 'Enter' to confirm your input or 'Escape' to cancel");class ine extends tne{constructor(){super(...arguments),this._value="",this.onDidChangeValueEmitter=this._register(new U),this.onWillAcceptEmitter=this._register(new U),this.onDidAcceptEmitter=this._register(new U),this.onDidCustomEmitter=this._register(new U),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._autoFocusOnList=!0,this._keepScrollPosition=!1,this._itemActivation=dE.FIRST,this._activeItems=[],this.activeItemsUpdated=!1,this.activeItemsToConfirm=[],this.onDidChangeActiveEmitter=this._register(new U),this._selectedItems=[],this.selectedItemsUpdated=!1,this.selectedItemsToConfirm=[],this.onDidChangeSelectionEmitter=this._register(new U),this.onDidTriggerItemButtonEmitter=this._register(new U),this.onDidTriggerSeparatorButtonEmitter=this._register(new U),this.valueSelectionUpdated=!0,this._ok="default",this._customButton=!1,this.filterValue=e=>e,this.onDidChangeValue=this.onDidChangeValueEmitter.event,this.onWillAccept=this.onWillAcceptEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.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){if(this._value!==e){if(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 autoFocusOnList(){return this._autoFocusOnList}set autoFocusOnList(e){this._autoFocusOnList=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?lE:this.ui.keyMods}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()}get hideInput(){return!!this._hideInput}set hideInput(e){this._hideInput=e,this.update()}trySelectFirst(){this.autoFocusOnList&&(this.canSelectMany||this.ui.list.focus(Zie.First))}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange((e=>{this.doSetValue(e,!0)}))),this.visibleDisposables.add(this.ui.inputBox.onMouseDown((e=>{this.autoFocusOnList||this.ui.list.clearFocus()}))),this.visibleDisposables.add((this._hideInput?this.ui.list:this.ui.inputBox).onKeyDown((e=>{switch(e.keyCode){case 18:this.ui.list.focus(Zie.Next),this.canSelectMany&&this.ui.list.domFocus(),as(e,!0);break;case 16:this.ui.list.getFocusedElements().length?this.ui.list.focus(Zie.Previous):this.ui.list.focus(Zie.Last),this.canSelectMany&&this.ui.list.domFocus(),as(e,!0);break;case 12:this.ui.list.focus(Zie.NextPage),this.canSelectMany&&this.ui.list.domFocus(),as(e,!0);break;case 11:this.ui.list.focus(Zie.PreviousPage),this.canSelectMany&&this.ui.list.domFocus(),as(e,!0);break;case 17:if(!this._canAcceptInBackground)return;if(!this.ui.inputBox.isSelectionAtEnd())return;this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!0));break;case 14:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(Zie.First),as(e,!0));break;case 13:!e.ctrlKey&&!e.metaKey||e.shiftKey||e.altKey||(this.ui.list.focus(Zie.Last),as(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.ui.list.onDidChangeFocus((e=>{this.activeItemsUpdated||this.activeItemsToConfirm!==this._activeItems&&Td(e,this._activeItems,((e,t)=>e===t))||(this._activeItems=e,this.onDidChangeActiveEmitter.fire(e))}))),this.visibleDisposables.add(this.ui.list.onDidChangeSelection((({items:e,event:t})=>{this.canSelectMany?e.length&&this.ui.list.setSelectedElements([]):this.selectedItemsToConfirm!==this._selectedItems&&Td(e,this._selectedItems,((e,t)=>e===t))||(this._selectedItems=e,this.onDidChangeSelectionEmitter.fire(e),e.length&&this.handleAccept(t instanceof MouseEvent&&1===t.button))}))),this.visibleDisposables.add(this.ui.list.onChangedCheckedElements((e=>{this.canSelectMany&&(this.selectedItemsToConfirm!==this._selectedItems&&Td(e,this._selectedItems,((e,t)=>e===t))||(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 En(this.ui.container,os.KEY_UP,(e=>{if(this.canSelectMany||!this._quickNavigate)return;const t=new St(e),i=t.keyCode;this._quickNavigate.keybindings.some((e=>{const n=e.getChords();return!(n.length>1)&&(n[0].shiftKey&&4===i?!(t.ctrlKey||t.altKey||t.metaKey):!(!n[0].altKey||6!==i)||(!(!n[0].ctrlKey||5!==i)||!(!n[0].metaKey||57!==i)))}))&&(this.activeItems[0]&&(this._selectedItems=[this.activeItems[0]],this.onDidChangeSelectionEmitter.fire(this.selectedItems),this.handleAccept(!1)),this._quickNavigate=void 0)}))}update(){if(!this.visible)return;const e=this.keepScrollPosition?this.scrollTop:0,t=!!this.description,i={title:!!this.title||!!this.step||!!this.buttons.length,description:t,checkAll:this.canSelectMany&&!this._hideCheckAll,checkBox:this.canSelectMany,inputBox:!this._hideInput,progressBar:!this._hideInput||t,visibleCount:!0,count:this.canSelectMany&&!this._hideCountBadge,ok:"default"===this.ok?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;if(!n&&i.inputBox&&(n=this.placeholder||ine.DEFAULT_ARIA_LABEL,this.title&&(n+=` - ${this.title}`)),this.ui.list.ariaLabel!==n&&(this.ui.list.ariaLabel=null!=n?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)switch(this.itemsUpdated=!1,this.ui.list.setElements(this.items),this.ui.list.filter(this.filterValue(this.ui.inputBox.value)),this.ui.checkAll.checked=this.ui.list.getAllVisibleChecked(),this.ui.visibleCount.setCount(this.ui.list.getVisibleCount()),this.ui.count.setCount(this.ui.list.getCheckedCount()),this._itemActivation){case dE.NONE:this._itemActivation=dE.FIRST;break;case dE.SECOND:this.ui.list.focus(Zie.Second),this._itemActivation=dE.FIRST;break;case dE.LAST:this.ui.list.focus(Zie.Last),this._itemActivation=dE.FIRST;break;default:this.trySelectFirst()}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(Zie.First)),this.keepScrollPosition&&(this.scrollTop=e)}}ine.DEFAULT_ARIA_LABEL=ue(0,"Type to narrow down results.");class nne extends tne{constructor(){super(...arguments),this._value="",this.valueSelectionUpdated=!0,this._password=!1,this.onDidValueChangeEmitter=this._register(new U),this.onDidAcceptEmitter=this._register(new U),this.onDidChangeValue=this.onDidValueChangeEmitter.event,this.onDidAccept=this.onDidAcceptEmitter.event}get value(){return this._value}set value(e){this._value=e||"",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()}show(){this.visible||(this.visibleDisposables.add(this.ui.inputBox.onDidChange((e=>{e!==this.value&&(this._value=e,this.onDidValueChangeEmitter.fire(e))}))),this.visibleDisposables.add(this.ui.onDidAccept((()=>this.onDidAcceptEmitter.fire()))),this.valueSelectionUpdated=!0),super.show()}update(){if(!this.visible)return;this.ui.container.classList.remove("hidden-input");const e={title:!!this.title||!!this.step||!!this.buttons.length,description:!!this.description||!!this.step,inputBox:!0,message:!0,progressBar:!0};this.ui.setVisibilities(e),super.update(),this.ui.inputBox.value!==this.value&&(this.ui.inputBox.value=this.value),this.valueSelectionUpdated&&(this.valueSelectionUpdated=!1,this.ui.inputBox.select(this._valueSelection&&{start:this._valueSelection[0],end:this._valueSelection[1]})),this.ui.inputBox.placeholder!==(this.placeholder||"")&&(this.ui.inputBox.placeholder=this.placeholder||""),this.ui.inputBox.password!==this.password&&(this.ui.inputBox.password=this.password)}}const sne=fs;class one extends E{constructor(e,t){super(),this.options=e,this.themeService=t,this.enabled=!0,this.onDidAcceptEmitter=this._register(new U),this.onDidCustomEmitter=this._register(new U),this.onDidTriggerButtonEmitter=this._register(new U),this.keyMods={ctrlCmd:!1,alt:!1},this.controller=null,this.onShowEmitter=this._register(new U),this.onShow=this.onShowEmitter.event,this.onHideEmitter=this._register(new U),this.onHide=this.onHideEmitter.event,this.idPrefix=e.idPrefix,this.parentElement=e.container,this.styles=e.styles,this.registerKeyModsListeners()}registerKeyModsListeners(){const e=e=>{this.keyMods.ctrlCmd=e.ctrlKey||e.metaKey,this.keyMods.alt=e.altKey};this._register(En(window,os.KEY_DOWN,e,!0)),this._register(En(window,os.KEY_UP,e,!0)),this._register(En(window,os.MOUSE_DOWN,e,!0))}getUI(){if(this.ui)return this.ui;const e=ds(this.parentElement,sne(".quick-input-widget.show-file-icons"));e.tabIndex=-1,e.style.display="none";const t=Jn(e),i=ds(e,sne(".quick-input-titlebar")),n=this.options.hoverDelegate?{hoverDelegate:this.options.hoverDelegate}:void 0,s=this._register(new Rx(i,n));s.domNode.classList.add("quick-input-left-action-bar");const o=ds(i,sne(".quick-input-title")),r=this._register(new Rx(i,n));r.domNode.classList.add("quick-input-right-action-bar");const a=ds(e,sne(".quick-input-header")),l=ds(a,sne("input.quick-input-check-all"));l.type="checkbox",l.setAttribute("aria-label",ue(0,"Toggle all checkboxes")),this._register(Mn(l,os.CHANGE,(e=>{const t=l.checked;D.setAllVisibleChecked(t)}))),this._register(En(l,os.CLICK,(e=>{(e.x||e.y)&&u.setFocus()})));const h=ds(a,sne(".quick-input-description")),d=ds(a,sne(".quick-input-and-message")),c=ds(d,sne(".quick-input-filter")),u=this._register(new Rie(c,this.styles.inputBox,this.styles.toggle));u.setAttribute("aria-describedby",`${this.idPrefix}message`);const g=ds(c,sne(".quick-input-visible-count"));g.setAttribute("aria-live","polite"),g.setAttribute("aria-atomic","true");const p=new Uz(g,{countFormat:ue(0,"{0} Results")},this.styles.countBadge),m=ds(c,sne(".quick-input-count"));m.setAttribute("aria-live","polite");const f=new Uz(m,{countFormat:ue(0,"{0} Selected")},this.styles.countBadge),_=ds(a,sne(".quick-input-action")),v=this._register(new XZ(_,this.styles.button));v.label=ue(0,"OK"),this._register(v.onDidClick((e=>{this.onDidAcceptEmitter.fire()})));const b=ds(a,sne(".quick-input-action")),C=this._register(new XZ(b,this.styles.button));C.label=ue(0,"Custom"),this._register(C.onDidClick((e=>{this.onDidCustomEmitter.fire()})));const w=ds(d,sne(`#${this.idPrefix}message.quick-input-message`)),y=this._register(new Mie(e,this.styles.progressBar));y.getContainer().classList.add("quick-input-progress");const S=ds(e,sne(".quick-input-html-widget"));S.tabIndex=-1;const L=ds(e,sne(".quick-input-description")),k=this.idPrefix+"list",D=this._register(new Yie(e,k,this.options,this.themeService));u.setAttribute("aria-controls",k),this._register(D.onDidChangeFocus((()=>{var e;u.setAttribute("aria-activedescendant",null!==(e=D.getActiveDescendant())&&void 0!==e?e:"")}))),this._register(D.onChangedAllVisibleChecked((e=>{l.checked=e}))),this._register(D.onChangedVisibleCount((e=>{p.setCount(e)}))),this._register(D.onChangedCheckedCount((e=>{f.setCount(e)}))),this._register(D.onLeave((()=>{setTimeout((()=>{u.setFocus(),this.controller instanceof ine&&this.controller.canSelectMany&&D.clearFocus()}),0)})));const x=hs(e);return this._register(x),this._register(En(e,os.FOCUS,(t=>{qn(t.relatedTarget,e)||(this.previousFocusElement=t.relatedTarget instanceof HTMLElement?t.relatedTarget:void 0)}),!0)),this._register(x.onDidBlur((()=>{this.getUI().ignoreFocusOut||this.options.ignoreFocusOut()||this.hide(hE.Blur),this.previousFocusElement=void 0}))),this._register(En(e,os.FOCUS,(e=>{u.setFocus()}))),this._register(Mn(e,os.KEY_DOWN,(t=>{if(!qn(t.target,S))switch(t.keyCode){case 3:as(t,!0),this.enabled&&this.onDidAcceptEmitter.fire();break;case 9:as(t,!0),this.hide(hE.Gesture);break;case 2:if(!t.altKey&&!t.ctrlKey&&!t.metaKey){const i=[".quick-input-list .monaco-action-bar .always-visible",".quick-input-list-entry:hover .monaco-action-bar",".monaco-list-row.focused .monaco-action-bar"];if(e.classList.contains("show-checkboxes")?i.push("input"):i.push("input[type=text]"),this.getUI().list.isDisplayed()&&i.push(".monaco-list"),this.getUI().message&&i.push(".quick-input-message a"),this.getUI().widget){if(qn(t.target,this.getUI().widget))break;i.push(".quick-input-html-widget")}const n=e.querySelectorAll(i.join(", "));t.shiftKey&&t.target===n[0]?(as(t,!0),D.clearFocus()):!t.shiftKey&&qn(t.target,n[n.length-1])&&(as(t,!0),n[0].focus())}break;case 10:t.ctrlKey&&(as(t,!0),this.getUI().list.toggleHover())}}))),this.ui={container:e,styleSheet:t,leftActionBar:s,titleBar:i,title:o,description1:L,description2:h,widget:S,rightActionBar:r,checkAll:l,inputContainer:d,filterContainer:c,inputBox:u,visibleCountContainer:g,visibleCount:p,countContainer:m,count:f,okContainer:_,ok:v,message:w,customButtonContainer:b,customButton:C,list:D,progressBar:y,onDidAccept:this.onDidAcceptEmitter.event,onDidCustom:this.onDidCustomEmitter.event,onDidTriggerButton:this.onDidTriggerButtonEmitter.event,ignoreFocusOut:!1,keyMods:this.keyMods,show:e=>this.show(e),hide:()=>this.hide(),setVisibilities:e=>this.setVisibilities(e),setEnabled:e=>this.setEnabled(e),setContextKey:e=>this.options.setContextKey(e),linkOpenerDelegate:e=>this.options.linkOpenerDelegate(e)},this.updateStyles(),this.ui}pick(e,t={},i=Uh.None){return new Promise(((n,s)=>{let o=e=>{var i;o=n,null===(i=t.onKeyMods)||void 0===i||i.call(t,r.keyMods),n(e)};if(i.isCancellationRequested)return void o(void 0);const r=this.createQuickPick();let a;const l=[r,r.onDidAccept((()=>{if(r.canSelectMany)o(r.selectedItems.slice()),r.hide();else{const e=r.activeItems[0];e&&(o(e),r.hide())}})),r.onDidChangeActive((e=>{const i=e[0];i&&t.onDidFocus&&t.onDidFocus(i)})),r.onDidChangeSelection((e=>{if(!r.canSelectMany){const t=e[0];t&&(o(t),r.hide())}})),r.onDidTriggerItemButton((e=>t.onDidTriggerItemButton&&t.onDidTriggerItemButton(Object.assign(Object.assign({},e),{removeItem:()=>{const t=r.items.indexOf(e.item);if(-1!==t){const e=r.items.slice(),i=e.splice(t,1),n=r.activeItems.filter((e=>e!==i[0])),s=r.keepScrollPosition;r.keepScrollPosition=!0,r.items=e,n&&(r.activeItems=n),r.keepScrollPosition=s}}})))),r.onDidTriggerSeparatorButton((e=>{var i;return null===(i=t.onDidTriggerSeparatorButton)||void 0===i?void 0:i.call(t,e)})),r.onDidChangeValue((e=>{!a||e||1===r.activeItems.length&&r.activeItems[0]===a||(r.activeItems=[a])})),i.onCancellationRequested((()=>{r.hide()})),r.onDidHide((()=>{k(l),o(void 0)}))];r.title=t.title,r.canSelectMany=!!t.canPickMany,r.placeholder=t.placeHolder,r.ignoreFocusOut=!!t.ignoreFocusLost,r.matchOnDescription=!!t.matchOnDescription,r.matchOnDetail=!!t.matchOnDetail,r.matchOnLabel=void 0===t.matchOnLabel||t.matchOnLabel,r.autoFocusOnList=void 0===t.autoFocusOnList||t.autoFocusOnList,r.quickNavigate=t.quickNavigate,r.hideInput=!!t.hideInput,r.contextKey=t.contextKey,r.busy=!0,Promise.all([e,t.activeItem]).then((([e,t])=>{a=t,r.busy=!1,r.items=e,r.canSelectMany&&(r.selectedItems=e.filter((e=>"separator"!==e.type&&e.picked))),a&&(r.activeItems=[a])})),r.show(),Promise.resolve(e).then(void 0,(e=>{s(e),r.hide()}))}))}createQuickPick(){const e=this.getUI();return new ine(e)}createInputBox(){const e=this.getUI();return new nne(e)}show(e){const t=this.getUI();this.onShowEmitter.fire();const i=this.controller;this.controller=e,null==i||i.didHide(),this.setEnabled(!0),t.leftActionBar.clear(),t.title.textContent="",t.description1.textContent="",t.description2.textContent="",us(t.widget),t.rightActionBar.clear(),t.checkAll.checked=!1,t.inputBox.placeholder="",t.inputBox.password=!1,t.inputBox.showDecoration(gL.Ignore),t.visibleCount.setCount(0),t.count.setCount(0),us(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();ene.tooltip=n?ue(0,"Back ({0})",n):ue(0,"Back"),t.container.style.display="",this.updateLayout(),t.inputBox.setFocus()}setVisibilities(e){const t=this.getUI();t.title.style.display=e.title?"":"none",t.description1.style.display=e.description&&(e.inputBox||e.checkAll)?"":"none",t.description2.style.display=!e.description||e.inputBox||e.checkAll?"none":"",t.checkAll.style.display=e.checkAll?"":"none",t.inputContainer.style.display=e.inputBox?"":"none",t.filterContainer.style.display=e.inputBox?"":"none",t.visibleCountContainer.style.display=e.visibleCount?"":"none",t.countContainer.style.display=e.count?"":"none",t.okContainer.style.display=e.ok?"":"none",t.customButtonContainer.style.display=e.customButton?"":"none",t.message.style.display=e.message?"":"none",t.progressBar.getContainer().style.display=e.progressBar?"":"none",t.list.display(!!e.list),t.container.classList.toggle("show-checkboxes",!!e.checkBox),t.container.classList.toggle("hidden-input",!e.inputBox&&!e.description),this.updateLayout()}setEnabled(e){if(e!==this.enabled){this.enabled=e;for(const t of this.getUI().leftActionBar.viewItems)t.action.enabled=e;for(const t of this.getUI().rightActionBar.viewItems)t.action.enabled=e;this.getUI().checkAll.disabled=!e,this.getUI().inputBox.enabled=e,this.getUI().ok.enabled=e,this.getUI().list.enabled=e}}hide(e){var t,i,n;const s=this.controller;if(!s)return;const o=!qn(document.activeElement,null!==(i=null===(t=this.ui)||void 0===t?void 0:t.container)&&void 0!==i?i:null);if(this.controller=null,this.onHideEmitter.fire(),this.getUI().container.style.display="none",!o){let e=this.previousFocusElement;for(;e&&!e.offsetParent;)e=null!==(n=e.parentElement)&&void 0!==n?n:void 0;(null==e?void 0:e.offsetParent)?(e.focus(),this.previousFocusElement=void 0):this.options.returnFocus()}s.didHide(e)}layout(e,t){this.dimension=e,this.titleBarOffset=t,this.updateLayout()}updateLayout(){if(this.ui&&this.isDisplayed()){this.ui.container.style.top=`${this.titleBarOffset}px`;const e=this.ui.container.style,t=Math.min(.62*this.dimension.width,one.MAX_WIDTH);e.width=t+"px",e.marginLeft="-"+t/2+"px",this.ui.inputBox.layout(),this.ui.list.layout(this.dimension&&.4*this.dimension.height)}}applyStyles(e){this.styles=e,this.updateStyles()}updateStyles(){if(this.ui){const{quickInputTitleBackground:e,quickInputBackground:t,quickInputForeground:i,widgetBorder:n,widgetShadow:s}=this.styles.widget;this.ui.titleBar.style.backgroundColor=null!=e?e:"",this.ui.container.style.backgroundColor=null!=t?t:"",this.ui.container.style.color=null!=i?i:"",this.ui.container.style.border=n?`1px solid ${n}`:"",this.ui.container.style.boxShadow=s?`0 0 8px 2px ${s}`:"",this.ui.list.style(this.styles.list);const o=[];this.styles.pickerGroup.pickerGroupBorder&&o.push(`.quick-input-list .quick-input-list-entry { border-top-color: ${this.styles.pickerGroup.pickerGroupBorder}; }`),this.styles.pickerGroup.pickerGroupForeground&&o.push(`.quick-input-list .quick-input-list-separator { color: ${this.styles.pickerGroup.pickerGroupForeground}; }`),this.styles.pickerGroup.pickerGroupForeground&&o.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)&&(o.push(".quick-input-list .monaco-keybinding > .monaco-keybinding-key {"),this.styles.keybindingLabel.keybindingLabelBackground&&o.push(`background-color: ${this.styles.keybindingLabel.keybindingLabelBackground};`),this.styles.keybindingLabel.keybindingLabelBorder&&o.push(`border-color: ${this.styles.keybindingLabel.keybindingLabelBorder};`),this.styles.keybindingLabel.keybindingLabelBottomBorder&&o.push(`border-bottom-color: ${this.styles.keybindingLabel.keybindingLabelBottomBorder};`),this.styles.keybindingLabel.keybindingLabelShadow&&o.push(`box-shadow: inset 0 -1px 0 ${this.styles.keybindingLabel.keybindingLabelShadow};`),this.styles.keybindingLabel.keybindingLabelForeground&&o.push(`color: ${this.styles.keybindingLabel.keybindingLabelForeground};`),o.push("}"));const r=o.join("\n");r!==this.ui.styleSheet.textContent&&(this.ui.styleSheet.textContent=r)}}isDisplayed(){return this.ui&&"none"!==this.ui.container.style.display}}one.MAX_WIDTH=600;var rne=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},ane=function(e,t){return function(i,n){t(i,n,e)}};let lne=class extends z_{get controller(){return this._controller||(this._controller=this._register(this.createController())),this._controller}get hasController(){return!!this._controller}get quickAccess(){return this._quickAccess||(this._quickAccess=this._register(this.instantiationService.createInstance(kie))),this._quickAccess}constructor(e,t,i,n){super(i),this.instantiationService=e,this.contextKeyService=t,this.layoutService=n,this._onShow=this._register(new U),this._onHide=this._register(new U),this.contexts=new Map}createController(e=this.layoutService,t){const i={idPrefix:"quickInput_",container:e.container,ignoreFocusOut:()=>!1,backKeybindingLabel:()=>{},setContextKey:e=>this.setContextKey(e),linkOpenerDelegate:e=>{this.instantiationService.invokeFunction((t=>{t.get(qk).open(e,{allowCommands:!0,fromUserGesture:!0})}))},returnFocus:()=>e.focus(),createList:(e,t,i,n,s)=>this.instantiationService.createInstance(wz,e,t,i,n,s),styles:this.computeStyles()},n=this._register(new one(Object.assign(Object.assign({},i),t),this.themeService));return n.layout(e.dimension,e.offset.quickPickTop),this._register(e.onDidLayout((t=>n.layout(t,e.offset.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 Al(e,!1).bindTo(this.contextKeyService),this.contexts.set(e,t))),t&&t.get()||(this.resetContextKeys(),null==t||t.set(!0))}resetContextKeys(){this.contexts.forEach((e=>{e.get()&&e.reset()}))}pick(e,t={},i=Uh.None){return this.controller.pick(e,t,i)}createQuickPick(){return this.controller.createQuickPick()}createInputBox(){return this.controller.createInputBox()}updateStyles(){this.hasController&&this.controller.applyStyles(this.computeStyles())}computeStyles(){return{widget:{quickInputBackground:Sp(Em),quickInputForeground:Sp(Im),quickInputTitleBackground:Sp(Mm),widgetBorder:Sp(Op),widgetShadow:Sp(Ap)},inputBox:Zx,toggle:Gx,countBadge:Xx,button:qx,progressBar:$x,keybindingLabel:jx,list:Jx({listBackground:Em,listFocusBackground:Kf,listFocusForeground:zf,listInactiveFocusForeground:zf,listInactiveSelectionIconForeground:Uf,listInactiveFocusBackground:Kf,listFocusOutline:Tp,listInactiveFocusOutline:Tp}),pickerGroup:{pickerGroupBorder:Sp(Rm),pickerGroupForeground:Sp(Tm)}}}};lne=rne([ane(0,Fa),ane(1,Ol),ane(2,P_),ane(3,hee)],lne);var hne=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},dne=function(e,t){return function(i,n){t(i,n,e)}};let cne=class extends lne{constructor(e,t,i,n,s){super(t,i,n,new gee(e.getContainerDomNode(),s)),this.host=void 0;const o=gne.get(e);if(o){const t=o.widget;this.host={_serviceBrand:void 0,get hasContainer(){return!0},get container(){return t.getDomNode()},get dimension(){return e.getLayoutInfo()},get onDidLayout(){return e.onDidLayoutChange},focus:()=>e.focus(),offset:{top:0,quickPickTop:0}}}else this.host=void 0}createController(){return super.createController(this.host)}};cne=hne([dne(1,Fa),dne(2,Ol),dne(3,P_),dne(4,Wa)],cne);let une=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(cne,e);this.mapEditorToService.set(e,t),_(e.onDidDispose)((()=>{i.dispose(),this.mapEditorToService.delete(e)}))}return t}get quickAccess(){return this.activeService.quickAccess}constructor(e,t){this.instantiationService=e,this.codeEditorService=t,this.mapEditorToService=new Map}pick(e,t={},i=Uh.None){return this.activeService.pick(e,t,i)}createQuickPick(){return this.activeService.createQuickPick()}createInputBox(){return this.activeService.createInputBox()}};une=hne([dne(0,Fa),dne(1,Wa)],une);class gne{static get(e){return e.getContribution(gne.ID)}constructor(e){this.editor=e,this.widget=new pne(this.editor)}dispose(){this.widget.dispose()}}gne.ID="editor.controller.quickInput";class pne{constructor(e){this.codeEditor=e,this.domNode=document.createElement("div"),this.codeEditor.addOverlayWidget(this)}getId(){return pne.ID}getDomNode(){return this.domNode}getPosition(){return{preference:2}}dispose(){this.codeEditor.removeOverlayWidget(this)}}pne.ID="editor.contrib.quickInputWidget",Dh(gne.ID,gne,4);var mne=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},fne=function(e,t){return function(i,n){t(i,n,e)}};let _ne=class extends E{constructor(e,t,i){super(),this._contextKeyService=e,this._layoutService=t,this._configurationService=i,this._accessibilitySupport=0,this._onDidChangeScreenReaderOptimized=new U,this._onDidChangeReducedMotion=new U,this._accessibilityModeEnabledContext=JR.bindTo(this._contextKeyService);const n=()=>this._accessibilityModeEnabledContext.set(this.isScreenReaderOptimized());this._register(this._configurationService.onDidChangeConfiguration((e=>{e.affectsConfiguration("editor.accessibilitySupport")&&(n(),this._onDidChangeScreenReaderOptimized.fire()),e.affectsConfiguration("workbench.reduceMotion")&&(this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this._onDidChangeReducedMotion.fire())}))),n(),this._register(this.onDidChangeScreenReaderOptimized((()=>n())));const s=window.matchMedia("(prefers-reduced-motion: reduce)");this._systemMotionReduced=s.matches,this._configMotionReduced=this._configurationService.getValue("workbench.reduceMotion"),this.initReducedMotionListeners(s)}initReducedMotionListeners(e){if(!this._layoutService.hasContainer)return;this._register(En(e,"change",(()=>{this._systemMotionReduced=e.matches,"auto"===this._configMotionReduced&&this._onDidChangeReducedMotion.fire()})));const t=()=>{const e=this.isMotionReduced();this._layoutService.container.classList.toggle("reduce-motion",e),this._layoutService.container.classList.toggle("enable-motion",!e)};t(),this._register(this.onDidChangeReducedMotion((()=>t())))}get onDidChangeScreenReaderOptimized(){return this._onDidChangeScreenReaderOptimized.event}isScreenReaderOptimized(){const e=this._configurationService.getValue("editor.accessibilitySupport");return"on"===e||"auto"===e&&2===this._accessibilitySupport}get onDidChangeReducedMotion(){return this._onDidChangeReducedMotion.event}isMotionReduced(){const e=this._configMotionReduced;return"on"===e||"auto"===e&&this._systemMotionReduced}getAccessibilitySupport(){return this._accessibilitySupport}};_ne=mne([fne(0,Ol),fne(1,hee),fne(2,pu)],_ne);var vne,bne,Cne=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},wne=function(e,t){return function(i,n){t(i,n,e)}};let yne=class{constructor(e,t){this._commandService=e,this._hiddenStates=new Sne(t)}createMenu(e,t,i){return new kne(e,this._hiddenStates,Object.assign({emitEventsForSubmenuChanges:!1,eventDebounceDelay:50},i),this._commandService,t)}resetHiddenStates(e){this._hiddenStates.reset(e)}};yne=Cne([wne(0,Ya),wne(1,ZN)],yne);let Sne=vne=class{constructor(e){this._storageService=e,this._disposables=new N,this._onDidChange=new U,this.onDidChange=this._onDidChange.event,this._ignoreChangeEvent=!1,this._hiddenByDefaultCache=new Map;try{const t=e.get(vne._key,0,"{}");this._data=JSON.parse(t)}catch(t){this._data=Object.create(null)}this._disposables.add(e.onDidChangeValue(0,vne._key,this._disposables)((()=>{if(!this._ignoreChangeEvent)try{const t=e.get(vne._key,0,"{}");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){var i;return null!==(i=this._hiddenByDefaultCache.get(`${e.id}/${t}`))&&void 0!==i&&i}setDefaultState(e,t,i){this._hiddenByDefaultCache.set(`${e.id}/${t}`,i)}isHidden(e,t){var i,n;const s=this._isHiddenByDefault(e,t),o=null!==(n=null===(i=this._data[e.id])||void 0===i?void 0:i.includes(t))&&void 0!==n&&n;return s?!o:o}updateHidden(e,t,i){this._isHiddenByDefault(e,t)&&(i=!i);const n=this._data[e.id];if(i)if(n){n.indexOf(t)<0&&n.push(t)}else this._data[e.id]=[t];else if(n){const i=n.indexOf(t);i>=0&&function(e,t){const i=e.length-1;te[1])));s.length>0&&o.push(new sh(t,n,s))}}o.length>0&&t.push([n,o])}return t}static _fillInKbExprKeys(e,t){if(e)for(const i of e.keys())t.add(i)}static _compareMenuItems(e,t){const i=e.group,n=t.group;if(i!==n){if(!i)return 1;if(!n)return-1;if("navigation"===i)return-1;if("navigation"===n)return 1;const e=i.localeCompare(n);if(0!==e)return e}const s=e.order||0,o=t.order||0;return so?1:bne._compareTitles(Jl(e)?e.command.title:e.title,Jl(t)?t.command.title:t.title)}static _compareTitles(e,t){const i="string"==typeof e?e:e.original,n="string"==typeof t?t:t.original;return i.localeCompare(n)}};Lne=bne=Cne([wne(3,Ya),wne(4,Ol)],Lne);let kne=class{constructor(e,t,i,n,s){this._disposables=new N,this._menuInfo=new Lne(e,t,i.emitEventsForSubmenuChanges,n,s);const o=new rd((()=>{this._menuInfo.refresh(),this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!0,isToggleChange:!0})}),i.eventDebounceDelay);this._disposables.add(o),this._disposables.add(nh.onDidChangeMenu((t=>{t.has(e)&&o.schedule()})));const r=this._disposables.add(new N);this._onDidChange=new q({onWillAddFirstListener:()=>{r.add(s.onDidChangeContext((e=>{const t=e.affectsSome(this._menuInfo.structureContextKeys),i=e.affectsSome(this._menuInfo.preconditionContextKeys),n=e.affectsSome(this._menuInfo.toggledContextKeys);(t||i||n)&&this._onDidChange.fire({menu:this,isStructuralChange:t,isEnablementChange:i,isToggleChange:n})}))),r.add(t.onDidChange((e=>{this._onDidChange.fire({menu:this,isStructuralChange:!0,isEnablementChange:!1,isToggleChange:!1})})))},onDidRemoveLastListener:r.clear.bind(r),delay:i.eventDebounceDelay,merge:e=>{let t=!1,i=!1,n=!1;for(const s of e)if(t=t||s.isStructuralChange,i=i||s.isEnablementChange,n=n||s.isToggleChange,t&&i&&n)break;return{menu:this,isStructuralChange:t,isEnablementChange:i,isToggleChange:n}}}),this.onDidChange=this._onDidChange.event}getActions(e){return this._menuInfo.createActionGroups(e)}dispose(){this._disposables.dispose(),this._onDidChange.dispose()}};function Dne(e,t,i){const n=void 0!==t.submenu?t.submenu.id:t.id;const s="string"==typeof t.title?t.title:t.title.value,o=Za({id:`hide/${e.id}/${n}`,label:ue(0,"Hide '{0}'",s),run(){i.updateHidden(e,n,!0)}}),r=Za({id:`toggle/${e.id}/${n}`,label:s,get checked(){return!i.isHidden(e,n)},run(){i.updateHidden(e,n,!!this.checked)}});return{hide:o,toggle:r,get isHidden(){return!r.checked}}}kne=Cne([wne(3,Ya),wne(4,Ol)],kne);var xne=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Nne=function(e,t){return function(i,n){t(i,n,e)}},Ene=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};let Ine=class extends E{constructor(e,t){super(),this.layoutService=e,this.logService=t,this.mapTextToType=new Map,this.findText="",this.resources=[],(re||ae)&&this.installWebKitWriteTextWorkaround()}installWebKitWriteTextWorkaround(){const e=()=>{const e=new hd;this.webKitPendingClipboardWritePromise&&!this.webKitPendingClipboardWritePromise.isSettled&&this.webKitPendingClipboardWritePromise.cancel(),this.webKitPendingClipboardWritePromise=e,navigator.clipboard.write([new ClipboardItem({"text/plain":e.p})]).catch((t=>Ene(this,void 0,void 0,(function*(){t instanceof Error&&"NotAllowedError"===t.name&&e.isRejected||this.logService.error(t)}))))};this.layoutService.hasContainer&&(this._register(En(this.layoutService.container,"click",e)),this._register(En(this.layoutService.container,"keydown",e)))}writeText(e,t){return Ene(this,void 0,void 0,(function*(){if(t)return void this.mapTextToType.set(t,e);if(this.webKitPendingClipboardWritePromise)return this.webKitPendingClipboardWritePromise.complete(e);try{return yield navigator.clipboard.writeText(e)}catch(s){console.error(s)}const i=document.activeElement,n=document.body.appendChild(fs("textarea",{"aria-hidden":!0}));n.style.height="1px",n.style.width="1px",n.style.position="absolute",n.value=e,n.focus(),n.select(),document.execCommand("copy"),i instanceof HTMLElement&&i.focus(),document.body.removeChild(n)}))}readText(e){return Ene(this,void 0,void 0,(function*(){if(e)return this.mapTextToType.get(e)||"";try{return yield navigator.clipboard.readText()}catch(t){return console.error(t),""}}))}readFindText(){return Ene(this,void 0,void 0,(function*(){return this.findText}))}writeFindText(e){return Ene(this,void 0,void 0,(function*(){this.findText=e}))}writeResources(e){return Ene(this,void 0,void 0,(function*(){this.resources=e}))}readResources(){return Ene(this,void 0,void 0,(function*(){return this.resources}))}};Ine=xne([Nne(0,hee),Nne(1,hh)],Ine);var Mne=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},Tne=function(e,t){return function(i,n){t(i,n,e)}};const Rne="data-keybinding-context";class Ane{constructor(e,t){this._id=e,this._parent=t,this._value=Object.create(null),this._value._contextId=e}get value(){return Object.assign({},this._value)}setValue(e,t){return this._value[e]!==t&&(this._value[e]=t,!0)}removeValue(e){return e in this._value&&(delete this._value[e],!0)}getValue(e){const t=this._value[e];return void 0===t&&this._parent?this._parent.getValue(e):t}}class One extends Ane{constructor(){super(-1,null)}setValue(e,t){return!1}removeValue(e){return!1}getValue(e){}}One.INSTANCE=new One;class Pne extends Ane{constructor(e,t,i){super(e,null),this._configurationService=t,this._values=qq.forConfigKeys(),this._listener=this._configurationService.onDidChangeConfiguration((e=>{if(7===e.source){const e=Array.from(this._values,(([e])=>e));this._values.clear(),i.fire(new Wne(e))}else{const t=[];for(const i of e.affectedKeys){const e=`config.${i}`,n=this._values.findSuperstr(e);void 0!==n&&(t.push(...v.map(n,(([e])=>e))),this._values.deleteSuperstr(e)),this._values.has(e)&&(t.push(e),this._values.delete(e))}i.fire(new Wne(t))}}))}dispose(){this._listener.dispose()}getValue(e){if(0!==e.indexOf(Pne._keyPrefix))return super.getValue(e);if(this._values.has(e))return this._values.get(e);const t=e.substr(Pne._keyPrefix.length),i=this._configurationService.getValue(t);let n;switch(typeof i){case"number":case"boolean":case"string":n=i;break;default:n=Array.isArray(i)?JSON.stringify(i):i}return this._values.set(e,n),n}setValue(e,t){return super.setValue(e,t)}removeValue(e){return super.removeValue(e)}}Pne._keyPrefix="config.";class Fne{constructor(e,t,i){this._service=e,this._key=t,this._defaultValue=i,this.reset()}set(e){this._service.setContext(this._key,e)}reset(){void 0===this._defaultValue?this._service.removeContext(this._key):this._service.setContext(this._key,this._defaultValue)}get(){return this._service.getContextKeyValue(this._key)}}class Bne{constructor(e){this.key=e}affectsSome(e){return e.has(this.key)}allKeysContainedIn(e){return this.affectsSome(e)}}class Wne{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 Vne{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)))}}class Hne extends E{constructor(e){super(),this._onDidChangeContext=this._register(new j({merge:e=>new Vne(e)})),this.onDidChangeContext=this._onDidChangeContext.event,this._isDisposed=!1,this._myContextId=e}createKey(e,t){if(this._isDisposed)throw new Error("AbstractContextKeyService has been disposed");return new Fne(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 Une(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)}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 Bne(e))}removeContext(e){this._isDisposed||this.getContextValuesContainer(this._myContextId).removeValue(e)&&this._onDidChangeContext.fire(new Bne(e))}getContext(e){return this._isDisposed?One.INSTANCE:this.getContextValuesContainer(function(e){for(;e;){if(e.hasAttribute(Rne)){const t=e.getAttribute(Rne);return t?parseInt(t,10):NaN}e=e.parentElement}return 0}(e))}dispose(){super.dispose(),this._isDisposed=!0}}let zne=class extends Hne{constructor(e){super(0),this._contexts=new Map,this._lastContextId=0;const t=this._register(new Pne(this._myContextId,e,this._onDidChangeContext));this._contexts.set(this._myContextId,t)}getContextValuesContainer(e){return this._isDisposed?One.INSTANCE:this._contexts.get(e)||One.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 Ane(t,this.getContextValuesContainer(e))),t}disposeContext(e){this._isDisposed||this._contexts.delete(e)}};zne=Mne([Tne(0,pu)],zne);class Une extends Hne{constructor(e,t){if(super(e.createChildContext()),this._parentChangeListener=this._register(new I),this._parent=e,this._updateParentChangeListener(),this._domNode=t,this._domNode.hasAttribute(Rne)){let e="";this._domNode.classList&&(e=Array.from(this._domNode.classList.values()).join(", ")),console.error("Element already has context attribute"+(e?": "+e:""))}this._domNode.setAttribute(Rne,String(this._myContextId))}_updateParentChangeListener(){this._parentChangeListener.value=this._parent.onDidChangeContext((e=>{const t=this._parent.getContextValuesContainer(this._myContextId).value;var i;i=t,e.allKeysContainedIn(new Set(Object.keys(i)))||this._onDidChangeContext.fire(e)}))}dispose(){this._isDisposed||(this._parent.disposeContext(this._myContextId),this._domNode.removeAttribute(Rne),super.dispose())}getContextValuesContainer(e){return this._isDisposed?One.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)}}Xa.registerCommand("_setContext",(function(e,t,i){e.get(Ol).createKey(String(t),function(e){return md(e,(e=>"object"==typeof e&&1===e.$mid?an.revive(e).toString():e instanceof an?e.toString():void 0))}(i))})),Xa.registerCommand({id:"getContextKeyInfo",handler:()=>[...Al.all()].sort(((e,t)=>e.key.localeCompare(t.key))),description:{description:ue(0,"A command that returns information about context keys"),args:[]}}),Xa.registerCommand("_generateContextKeyInfo",(function(){const e=[],t=new Set;for(const i of Al.all())t.has(i.key)||(t.add(i.key),e.push(i));e.sort(((e,t)=>e.key.localeCompare(t.key))),console.log(JSON.stringify(e,void 0,2))}));class Kne{constructor(e,t){this.key=e,this.data=t,this.incoming=new Map,this.outgoing=new Map}}class jne{constructor(e){this._hashFn=e,this._nodes=new Map}roots(){const e=[];for(const t of this._nodes.values())0===t.outgoing.size&&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 Kne(t,e),this._nodes.set(t,i)),i}isEmpty(){return 0===this._nodes.size}toString(){const e=[];for(const[t,i]of this._nodes)e.push(`${t}\n\t(-> incoming)[${[...i.incoming.keys()].join(", ")}]\n\t(outgoing ->)[${[...i.outgoing.keys()].join(",")}]\n`);return e.join("\n")}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 e=this._findCycle(n,t);if(e)return e;t.delete(i)}}}class qne extends Error{constructor(e){var t;super("cyclic dependency between services"),this.message=null!==(t=e.findCycleSlow())&&void 0!==t?t:`UNABLE to detect cycle, dumping graph: \n${e.toString()}`}}class $ne{constructor(e=new DB,t=!1,i,n=false){var s;this._services=e,this._strict=t,this._parent=i,this._enableTracing=n,this._activeInstantiations=new Set,this._services.set(Fa,this),this._globalGraph=n?null!==(s=null==i?void 0:i._globalGraph)&&void 0!==s?s:new jne((e=>e)):void 0}createChild(e){return new $ne(e,this._strict,this,this._enableTracing)}invokeFunction(e,...t){const i=Gne.traceInvocation(this._enableTracing,e);let n=!1;try{return e({get:e=>{if(n)throw g("service accessor is only valid during the invocation of its target method");const t=this._getOrCreateServiceInstance(e,i);if(!t)throw new Error(`[invokeFunction] unknown service '${e}'`);return t}},...t)}finally{n=!0,i.stop()}}createInstance(e,...t){let i,n;return e instanceof Cu?(i=Gne.traceCreation(this._enableTracing,e.ctor),n=this._createInstance(e.ctor,e.staticArguments.concat(t),i)):(i=Gne.traceCreation(this._enableTracing,e),n=this._createInstance(e,t,i)),i.stop(),n}_createInstance(e,t=[],i){const n=Ma.getServiceDependencies(e).sort(((e,t)=>e.index-t.index)),s=[];for(const r of n){const t=this._getOrCreateServiceInstance(r.id,i);t||this._throwIfStrict(`[createInstance] ${e.name} depends on UNKNOWN service ${r.id}.`,!1),s.push(t)}const o=n.length>0?n[0].index:t.length;if(t.length!==o){console.trace(`[createInstance] First service dependency of ${e.name} at position ${o+1} conflicts with ${t.length} static arguments`);const i=o-t.length;t=i>0?t.concat(new Array(i)):t.slice(0,o)}return Reflect.construct(e,t.concat(s))}_setServiceInstance(e,t){if(this._services.get(e)instanceof Cu)this._services.set(e,t);else{if(!this._parent)throw new Error("illegalState - setting UNKNOWN service instance");this._parent._setServiceInstance(e,t)}}_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 Cu?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){var n;const s=new jne((e=>e.id.toString()));let o=0;const r=[{id:e,desc:t,_trace:i}];for(;r.length;){const t=r.pop();if(s.lookupOrInsertNode(t),o++>1e3)throw new qne(s);for(const i of Ma.getServiceDependencies(t.desc.ctor)){const o=this._getServiceInstanceOrDescriptor(i.id);if(o||this._throwIfStrict(`[createInstance] ${e} depends on ${i.id} which is NOT registered.`,!0),null===(n=this._globalGraph)||void 0===n||n.insertEdge(String(t.id),String(i.id)),o instanceof Cu){const e={id:i.id,desc:o,_trace:t._trace.branch(i.id,!0)};s.insertEdge(t,e),r.push(e)}}}for(;;){const e=s.roots();if(0===e.length){if(!s.isEmpty())throw new qne(s);break}for(const{data:t}of e){if(this._getServiceInstanceOrDescriptor(t.id)instanceof Cu){const e=this._createServiceInstanceWithOwner(t.id,t.desc.ctor,t.desc.staticArguments,t.desc.supportsDelayedInstantiation,t._trace);this._setServiceInstance(t.id,e)}s.removeNode(t)}}return this._getServiceInstanceOrDescriptor(e)}_createServiceInstanceWithOwner(e,t,i=[],n,s){if(this._services.get(e)instanceof Cu)return this._createServiceInstance(e,t,i,n,s);if(this._parent)return this._parent._createServiceInstanceWithOwner(e,t,i,n,s);throw new Error(`illegalState - creating UNKNOWN service instance ${t.name}`)}_createServiceInstance(e,t,i=[],n,s){if(n){const n=new $ne(void 0,this._strict,this,this._enableTracing);n._globalGraphImplicitDependency=String(e);const o=new Map,r=new ld((()=>{const e=n._createInstance(t,i,s);for(const[t,i]of o){const n=e[t];if("function"==typeof n)for(const t of i)n.apply(e,t)}return o.clear(),e}));return new Proxy(Object.create(null),{get(e,t){if(!r.isInitialized&&"string"==typeof t&&(t.startsWith("onDid")||t.startsWith("onWill"))){let e=o.get(t);e||(e=new O,o.set(t,e));return(t,i,n)=>x(e.push([t,i,n]))}if(t in e)return e[t];const i=r.value;let n=i[t];return"function"!=typeof n||(n=n.bind(i),e[t]=n),n},set:(e,t,i)=>(r.value[t]=i,!0),getPrototypeOf:e=>t.prototype})}return this._createInstance(t,i,s)}_throwIfStrict(e,t){if(t&&console.warn(e),this._strict)throw new Error(e)}}class Gne{static traceInvocation(e,t){return e?new Gne(2,t.name||(new Error).stack.split("\n").slice(3,4).join("\n")):Gne._None}static traceCreation(e,t){return e?new Gne(1,t.name):Gne._None}constructor(e,t){this.type=e,this.name=t,this._start=Date.now(),this._dep=[]}branch(e,t){const i=new Gne(3,e.toString());return this._dep.push([e,t,i]),i}stop(){const e=Date.now()-this._start;Gne._totals+=e;let t=!1;const i=[`${1===this.type?"CREATE":"CALL"} ${this.name}`,`${function e(i,n){const s=[],o=new Array(i+1).join("\t");for(const[r,a,l]of n._dep)if(a&&l){t=!0,s.push(`${o}CREATES -> ${r}`);const n=e(i+1,l);n&&s.push(n)}else s.push(`${o}uses -> ${r}`);return s.join("\n")}(1,this)}`,`DONE, took ${e.toFixed(2)}ms (grand total ${Gne._totals.toFixed(2)}ms)`];(e>2||t)&&Gne.all.add(i.join("\n"))}}Gne.all=new Set,Gne._None=new class extends Gne{constructor(){super(0,null)}stop(){}branch(){return this}},Gne._totals=0;const Zne=new Set([vn.inMemory,vn.vscodeSourceControl,vn.walkThrough,vn.walkThroughSnippet]);class Yne{constructor(){this._byResource=new Us,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 s=this._byOwner.get(t);s||(s=new Us,this._byOwner.set(t,s)),s.set(e,i)}get(e,t){const i=this._byResource.get(e);return null==i?void 0:i.get(t)}delete(e,t){let i=!1,n=!1;const s=this._byResource.get(e);s&&(i=s.delete(t));const o=this._byOwner.get(t);if(o&&(n=o.delete(e)),i!==n)throw new Error("illegal state");return i&&n}values(e){var t,i,n,s;return"string"==typeof e?null!==(i=null===(t=this._byOwner.get(e))||void 0===t?void 0:t.values())&&void 0!==i?i:v.empty():an.isUri(e)?null!==(s=null===(n=this._byResource.get(e))||void 0===n?void 0:n.values())&&void 0!==s?s:v.empty():v.map(v.concat(...this._byOwner.values()),(e=>e[1]))}}class Xne{constructor(e){this.errors=0,this.infos=0,this.warnings=0,this.unknowns=0,this._data=new Us,this._service=e,this._subscription=e.onMarkerChanged(this._update,this)}dispose(){this._subscription.dispose()}_update(e){for(const t of e){const e=this._data.get(t);e&&this._substract(e);const i=this._resourceStats(t);this._add(i),this._data.set(t,i)}}_resourceStats(e){const t={errors:0,warnings:0,infos:0,unknowns:0};if(Zne.has(e.scheme))return t;for(const{severity:i}of this._service.read({resource:e}))i===yN.Error?t.errors+=1:i===yN.Warning?t.warnings+=1:i===yN.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 Qne{constructor(){this._onMarkerChanged=new q({delay:0,merge:Qne._merge}),this.onMarkerChanged=this._onMarkerChanged.event,this._data=new Yne,this._stats=new Xne(this)}dispose(){this._stats.dispose(),this._onMarkerChanged.dispose()}remove(e,t){for(const i of t||[])this.changeOne(e,i,[])}changeOne(e,t,i){if(Vd(i)){this._data.delete(t,e)&&this._onMarkerChanged.fire([t])}else{const n=[];for(const s of i){const i=Qne._toMarker(e,t,s);i&&n.push(i)}this._data.set(t,e,n),this._onMarkerChanged.fire([t])}}static _toMarker(e,t,i){let{code:n,severity:s,message:o,source:r,startLineNumber:a,startColumn:l,endLineNumber:h,endColumn:d,relatedInformation:c,tags:u}=i;if(o)return a=a>0?a:1,l=l>0?l:1,h=h>=a?h:a,d=d>0?d:l,{resource:t,owner:e,code:n,severity:s,message:o,source:r,startLineNumber:a,startColumn:l,endLineNumber:h,endColumn:d,relatedInformation:c,tags:u}}changeAll(e,t){const i=[],n=this._data.values(e);if(n)for(const s of n){const t=v.first(s);t&&(i.push(t.resource),this._data.delete(t.resource,e))}if(Hd(t)){const n=new Us;for(const{resource:s,marker:o}of t){const t=Qne._toMarker(e,s,o);if(!t)continue;const r=n.get(s);r?r.push(t):(n.set(s,[t]),i.push(s))}for(const[t,i]of n)this._data.set(t,e,i)}i.length>0&&this._onMarkerChanged.fire(i)}read(e=Object.create(null)){let{owner:t,resource:i,severities:n,take:s}=e;if((!s||s<0)&&(s=-1),t&&i){const e=this._data.get(i,t);if(e){const t=[];for(const i of e)if(Qne._accept(i,n)){const e=t.push(i);if(s>0&&e===s)break}return t}return[]}if(t||i){const e=this._data.values(null!=i?i:t),o=[];for(const t of e)for(const e of t)if(Qne._accept(e,n)){const t=o.push(e);if(s>0&&t===s)return o}return o}{const e=[];for(const t of this._data.values())for(const i of t)if(Qne._accept(i,n)){const t=e.push(i);if(s>0&&t===s)return e}return e}}static _accept(e,t){return void 0===t||(t&e.severity)===e.severity}static _merge(e){const t=new Us;for(const i of e)for(const e of i)t.set(e,!0);return Array.from(t.keys())}}class Jne extends E{constructor(){super(...arguments),this._configurationModel=new lte}get configurationModel(){return this._configurationModel}reload(){return this.resetConfigurationModel(),this.configurationModel}getConfigurationDefaultOverrides(){return{}}resetConfigurationModel(){this._configurationModel=new lte;const e=jl.as(xu).getConfigurationProperties();this.updateConfigurationModel(Object.keys(e),e)}updateConfigurationModel(e,t){const i=this.getConfigurationDefaultOverrides();for(const n of e){const e=i[n],s=t[n];void 0!==e?this._configurationModel.addValue(n,e):s?this._configurationModel.addValue(n,s.default):this._configurationModel.removeValue(n)}}}class ese extends E{constructor(e,t=[]){super(),this.logger=new ph([e,...t]),this._register(e.onDidChangeLogLevel((e=>this.setLevel(e))))}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)}}var tse=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},ise=function(e,t){return function(i,n){t(i,n,e)}},nse=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};class sse{constructor(e){this.disposed=!1,this.model=e,this._onWillDispose=new U}get textEditorModel(){return this.model}dispose(){this.disposed=!0,this._onWillDispose.fire()}}let ose=class{constructor(e){this.modelService=e}createModelReference(e){const t=this.modelService.getModel(e);return t?Promise.resolve(new T(new sse(t))):Promise.reject(new Error("Model not found"))}};ose=tse([ise(0,Ha)],ose);class rse{show(){return rse.NULL_PROGRESS_RUNNER}showWhile(e,t){return nse(this,void 0,void 0,(function*(){yield e}))}}rse.NULL_PROGRESS_RUNNER={done:()=>{},total:()=>{},worked:()=>{}};class ase{info(e){return this.notify({severity:gL.Info,message:e})}warn(e){return this.notify({severity:gL.Warning,message:e})}error(e){return this.notify({severity:gL.Error,message:e})}notify(e){switch(e.severity){case gL.Error:console.error(e.message);break;case gL.Warning:console.warn(e.message);break;default:console.log(e.message)}return ase.NO_OP}prompt(e,t,i,n){return ase.NO_OP}status(e,t){return E.None}}ase.NO_OP=new class{};let lse=class{constructor(e){this._onWillExecuteCommand=new U,this._onDidExecuteCommand=new U,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this._instantiationService=e}executeCommand(e,...t){const i=Xa.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)}}};lse=tse([ise(0,Fa)],lse);let hse=class extends bte{constructor(e,t,i,n,s,o){super(e,t,i,n,s),this._cachedResolver=null,this._dynamicKeybindings=[],this._domNodeListeners=[];const r=e=>{const t=new N;t.add(En(e,os.KEY_DOWN,(e=>{const t=new St(e);this._dispatch(t,t.target)&&(t.preventDefault(),t.stopPropagation())}))),t.add(En(e,os.KEY_UP,(e=>{const t=new St(e);this._singleModifierDispatch(t,t.target)&&t.preventDefault()}))),this._domNodeListeners.push(new dse(e,t))},a=e=>{for(let t=0;t{e.getOption(61)||r(e.getContainerDomNode())};this._register(o.onCodeEditorAdd(l)),this._register(o.onCodeEditorRemove((e=>{e.getOption(61)||a(e.getContainerDomNode())}))),o.listCodeEditors().forEach(l);const h=e=>{r(e.getContainerDomNode())};this._register(o.onDiffEditorAdd(h)),this._register(o.onDiffEditorRemove((e=>{a(e.getContainerDomNode())}))),o.listDiffEditors().forEach(h)}addDynamicKeybinding(e,t,i,n){return D(Xa.registerCommand(e,i),this.addDynamicKeybindings([{keybinding:t,command:e,when:n}]))}addDynamicKeybindings(e){const t=e.map((e=>{var t;return{keybinding:mt(e.keybinding,$e),command:null!==(t=e.command)&&void 0!==t?t:null,commandArgs:e.commandArgs,when:e.when,weight1:1e3,weight2:0,extensionId:null,isBuiltinExtension:!1}}));return this._dynamicKeybindings=this._dynamicKeybindings.concat(t),this.updateResolver(),x((()=>{for(let e=0;ethis._log(e)))}return this._cachedResolver}_documentHasFocus(){return document.hasFocus()}_toNormalizedKeybindingItems(e,t){const i=[];let n=0;for(const s of e){const e=s.when||void 0,o=s.keybinding;if(o){const r=Lte.resolveKeybinding(o,$e);for(const o of r)i[n++]=new wte(o,s.command,s.commandArgs,e,t,null,!1)}else i[n++]=new wte(void 0,s.command,s.commandArgs,e,t,null,!1)}return i}resolveKeyboardEvent(e){const t=new _t(e.ctrlKey,e.shiftKey,e.altKey,e.metaKey,e.keyCode);return new Lte([t],$e)}};hse=tse([ise(0,Ol),ise(1,Ya),ise(2,lh),ise(3,mL),ise(4,hh),ise(5,Wa)],hse);class dse extends E{constructor(e,t){super(),this.domNode=e,this._register(t)}}function cse(e){return e&&"object"==typeof e&&(!e.overrideIdentifier||"string"==typeof e.overrideIdentifier)&&(!e.resource||e.resource instanceof an)}class use{constructor(){this._onDidChangeConfiguration=new U,this.onDidChangeConfiguration=this._onDidChangeConfiguration.event;const e=new Jne;this._configuration=new cte(e.reload(),new lte,new lte,new lte),e.dispose()}getValue(e,t){const i="string"==typeof e?e:void 0,n=cse(e)?e:cse(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[e,t]=n;this.getValue(e)!==t&&(this._configuration.updateValue(e,t),i.push(e))}if(i.length>0){const e=new ute({keys:i,overrides:[]},t,this._configuration);e.source=8,e.sourceConfig=null,this._onDidChangeConfiguration.fire(e)}return Promise.resolve()}updateValue(e,t,i,n){return this.updateValues([[e,t]])}inspect(e,t={}){return this._configuration.inspect(e,t,void 0)}}let gse=class{constructor(e,t,i){this.configurationService=e,this.modelService=t,this.languageService=i,this._onDidChangeConfiguration=new U,this.configurationService.onDidChangeConfiguration((e=>{this._onDidChangeConfiguration.fire({affectedKeys:e.affectedKeys,affectsConfiguration:(t,i)=>e.affectsConfiguration(i)})}))}getValue(e,t,i){const n=Va.isIPosition(t)?t:null,s=n?"string"==typeof i?i:void 0:"string"==typeof t?t:void 0,o=e?this.getLanguage(e,n):void 0;return void 0===s?this.configurationService.getValue({resource:e,overrideIdentifier:o}):this.configurationService.getValue(s,{resource:e,overrideIdentifier:o})}getLanguage(e,t){const i=this.modelService.getModel(e);return i?t?i.getLanguageIdAtPosition(t.lineNumber,t.column):i.getLanguageId():this.languageService.guessLanguageIdByFilepathOrFirstLine(e)}};gse=tse([ise(0,pu),ise(1,Ha),ise(2,Lc)],gse);let pse=class{constructor(e){this.configurationService=e}getEOL(e,t){const i=this.configurationService.getValue("files.eol",{overrideIdentifier:t,resource:e});return i&&"string"==typeof i&&"auto"!==i?i:Fe||Pe?"\n":"\r\n"}};pse=tse([ise(0,pu)],pse);class mse{constructor(){const e=an.from({scheme:mse.SCHEME,authority:"model",path:"/"});this.workspace={id:e$,folders:[new Qq({uri:e,name:"",index:0})]}}getWorkspace(){return this.workspace}getWorkspaceFolder(e){return e&&e.scheme===mse.SCHEME?this.workspace.folders[0]:null}}function fse(e,t,i){if(!t)return;if(!(e instanceof use))return;const n=[];Object.keys(t).forEach((e=>{(function(e){return eL()[`editor.${e}`]||!1})(e)&&n.push([`editor.${e}`,t[e]]),i&&function(e){return eL()[`diffEditor.${e}`]||!1}(e)&&n.push([`diffEditor.${e}`,t[e]])})),n.length>0&&e.updateValues(n)}mse.SCHEME="inmemory";let _se=class{constructor(e){this._modelService=e}hasPreviewHandler(){return!1}apply(e,t){return nse(this,void 0,void 0,(function*(){const t=Array.isArray(e)?e:iL.convert(e),i=new Map;for(const e of t){if(!(e instanceof nL))throw new Error("bad edit - only text edits are supported");const t=this._modelService.getModel(e.resource);if(!t)throw new Error("bad edit - model not found");if("number"==typeof e.versionId&&t.getVersionId()!==e.versionId)throw new Error("bad state - model changed in the meantime");let n=i.get(t);n||(n=[],i.set(t,n)),n.push(Fq.replaceMove(Rh.lift(e.textEdit.range),e.textEdit.text))}let n=0,s=0;for(const[e,o]of i)e.pushStackElement(),e.pushEditOperations([],o,(()=>[])),e.pushStackElement(),s+=1,n+=o.length;return{ariaSummary:Qs(WJ.bulkEditServiceSummary,n,s),isApplied:n>0}}))}};_se=tse([ise(0,Ha)],_se);let vse=class extends Mte{constructor(e,t){super(e),this._codeEditorService=t}showContextView(e,t,i){if(!t){const e=this._codeEditorService.getFocusedCodeEditor()||this._codeEditorService.getActiveCodeEditor();e&&(t=e.getContainerDomNode())}return super.showContextView(e,t,i)}};vse=tse([ise(0,hee),ise(1,Wa)],vse);let bse=class extends tie{constructor(e,t,i,n,s,o){super(e,t,i,n,s,o),this.configure({blockMouse:!1})}};bse=tse([ise(0,lh),ise(1,mL),ise(2,Ux),ise(3,WL),ise(4,th),ise(5,Ol)],bse);var Cse;yu(pu,use,0),yu(pT,gse,0),yu(mT,pse,0),yu($q,mse,0),yu(Zz,class{getUriLabel(e,t){return"file"===e.scheme?e.fsPath:e.path}getUriBasenameLabel(e){return wa(e)}},0),yu(lh,class{publicLog2(){}},0),yu(x3,class{confirm(e){return nse(this,void 0,void 0,(function*(){return{confirmed:this.doConfirm(e.message,e.detail),checkboxChecked:!1}}))}doConfirm(e,t){let i=e;return t&&(i=i+"\n\n"+t),window.confirm(i)}prompt(e){var t,i;return nse(this,void 0,void 0,(function*(){let n;if(this.doConfirm(e.message,e.detail)){const s=[...null!==(t=e.buttons)&&void 0!==t?t:[]];e.cancelButton&&"string"!=typeof e.cancelButton&&"boolean"!=typeof e.cancelButton&&s.push(e.cancelButton),n=yield null===(i=s[0])||void 0===i?void 0:i.run({checkboxChecked:!1})}return{result:n}}))}error(e,t){return nse(this,void 0,void 0,(function*(){yield this.prompt({type:gL.Error,message:e,detail:t})}))}},0),yu(CE,class{constructor(){this.isExtensionDevelopment=!1,this.isBuilt=!1}},0),yu(mL,ase,0),yu(LN,Qne,0),yu(Lc,class extends zte{constructor(){super()}},0),yu(j4,class extends E{constructor(){super(),this._onColorThemeChange=this._register(new U),this.onDidColorThemeChange=this._onColorThemeChange.event,this._onProductIconThemeChange=this._register(new U),this.onDidProductIconThemeChange=this._onProductIconThemeChange.event,this._environment=Object.create(null),this._builtInProductIconTheme=new b7,this._autoDetectHighContrast=!0,this._knownThemes=new Map,this._knownThemes.set(C7,E7(C7)),this._knownThemes.set(w7,E7(w7)),this._knownThemes.set(y7,E7(y7)),this._knownThemes.set(S7,E7(S7));const e=this._register(function(e){const t=new N,i=t.add(new U),n=iR();return t.add(n.onDidChange((()=>i.fire()))),e&&t.add(e.onDidProductIconThemeChange((()=>i.fire()))),{dispose:()=>t.dispose(),onDidChange:i.event,getCSS(){const t=e?e.getProductIconTheme():new b7,i={},s=e=>{const n=t.getIcon(e);if(!n)return;const s=n.font;return s?(i[s.id]=s.definition,`.codicon-${e.id}:before { content: '${n.fontCharacter}'; font-family: ${ys(s.id)}; }`):`.codicon-${e.id}:before { content: '${n.fontCharacter}'; }`},o=[];for(const e of n.getIcons()){const t=s(e);t&&o.push(t)}for(const e in i){const t=i[e],n=t.weight?`font-weight: ${t.weight};`:"",s=t.style?`font-style: ${t.style};`:"",r=t.src.map((e=>`${ws(e.location)} format('${e.format}')`)).join(", ");o.push(`@font-face { src: ${r}; font-family: ${ys(e)};${n}${s} font-display: block; }`)}return o.join("\n")}}}(this));this._codiconCSS=e.getCSS(),this._themeCSS="",this._allCSS=`${this._codiconCSS}\n${this._themeCSS}`,this._globalStyleElement=null,this._styleElements=[],this._colorMapOverride=null,this.setTheme(C7),this._onOSSchemeChanged(),this._register(e.onDidChange((()=>{this._codiconCSS=e.getCSS(),this._updateCSS()}))),ee("(forced-colors: active)",(()=>{this._onOSSchemeChanged()}))}registerEditorContainer(e){return Zn(e)?this._registerShadowDomContainer(e):this._registerRegularEditorContainer()}_registerRegularEditorContainer(){return this._globalStyleElement||(this._globalStyleElement=Jn(void 0,(e=>{e.className="monaco-colors",e.textContent=this._allCSS})),this._styleElements.push(this._globalStyleElement)),E.None}_registerShadowDomContainer(e){const t=Jn(e,(e=>{e.className="monaco-colors",e.textContent=this._allCSS}));return this._styleElements.push(t),{dispose:()=>{for(let e=0;e{t.base===e&&t.notifyBaseUpdated()})),this._theme.themeName===e&&this.setTheme(e)}getColorTheme(){return this._theme}setColorMapOverride(e){this._colorMapOverride=e,this._updateThemeOrColorMap()}setTheme(e){let t;t=this._knownThemes.has(e)?this._knownThemes.get(e):this._knownThemes.get(C7),this._updateActualTheme(t)}_updateActualTheme(e){e&&this._theme!==e&&(this._theme=e,this._updateThemeOrColorMap())}_onOSSchemeChanged(){if(this._autoDetectHighContrast){const e=window.matchMedia("(forced-colors: active)").matches;if(e!==A_(this._theme.type)){let t;t=O_(this._theme.type)?e?y7:w7:e?S7:C7,this._updateActualTheme(this._knownThemes.get(t))}}}setAutoDetectHighContrast(e){this._autoDetectHighContrast=e,this._onOSSchemeChanged()}_updateThemeOrColorMap(){const e=[],t={},i={addRule:i=>{t[i]||(e.push(i),t[i]=!0)}};k7.getThemingParticipants().forEach((e=>e(this._theme,i,this._environment)));const n=[];for(const o of L7.getColors()){const e=this._theme.getColor(o.id,!0);e&&n.push(`${yp(o.id)}: ${e.toString()};`)}i.addRule(`.monaco-editor, .monaco-diff-editor { ${n.join("\n")} }`);const s=this._colorMapOverride||this._theme.tokenTheme.getColorMap();i.addRule(function(e){const t=[];for(let i=1,n=e.length;ie.textContent=this._allCSS))}getFileIconTheme(){return{hasFileIcons:!1,hasFolderIcons:!1,hidesExplorerArrows:!1}}getProductIconTheme(){return this._builtInProductIconTheme}},0),yu(hh,class extends ese{constructor(){super(new gh)}},0),yu(Ha,wie,0),yu(AR,uie,0),yu(Ol,zne,0),yu(fL,class{withProgress(e,t,i){return t({report:()=>{}})}},0),yu(vL,rse,0),yu(ZN,class extends XN{constructor(){super(),this.applicationStorage=this._register(new qN(new $N,{hint:UN.STORAGE_IN_MEMORY})),this.profileStorage=this._register(new qN(new $N,{hint:UN.STORAGE_IN_MEMORY})),this.workspaceStorage=this._register(new qN(new $N,{hint:UN.STORAGE_IN_MEMORY})),this._register(this.workspaceStorage.onDidChangeStorage((e=>this.emitDidChangeValue(1,e)))),this._register(this.profileStorage.onDidChangeStorage((e=>this.emitDidChangeValue(0,e)))),this._register(this.applicationStorage.onDidChangeStorage((e=>this.emitDidChangeValue(-1,e))))}getStorage(e){switch(e){case-1:return this.applicationStorage;case 0:return this.profileStorage;default:return this.workspaceStorage}}},0),yu(fG,wT,0),yu(tL,_se,0),yu(B7,class{constructor(){this._neverEmitter=new U,this.onDidChangeTrust=this._neverEmitter.event}isWorkspaceTrusted(){return!0}},0),yu(za,ose,0),yu(QR,_ne,0),yu(WH,class{get lastFocusedList(){return this._lastFocusedWidget}constructor(){this.disposables=new N,this.lists=[],this._lastFocusedWidget=void 0,this._hasCreatedStyleController=!1}setLastFocusedList(e){var t,i;e!==this._lastFocusedWidget&&(null===(t=this._lastFocusedWidget)||void 0===t||t.getHTMLElement().classList.remove("last-focused"),this._lastFocusedWidget=e,null===(i=this._lastFocusedWidget)||void 0===i||i.getHTMLElement().classList.add("last-focused"))}register(e,t){if(!this._hasCreatedStyleController){this._hasCreatedStyleController=!0;new px(Jn(),"").style(Qx)}if(this.lists.some((t=>t.widget===e)))throw new Error("Cannot register the same widget multiple times");const i={widget:e,extraContextKeys:t};return this.lists.push(i),e.getHTMLElement()===document.activeElement&&this.setLastFocusedList(e),D(e.onDidFocus((()=>this.setLastFocusedList(e))),x((()=>this.lists.splice(this.lists.indexOf(i),1))),e.onDidDispose((()=>{this.lists=this.lists.filter((e=>e!==i)),this._lastFocusedWidget===e&&this.setLastFocusedList(void 0)})))}dispose(){this.disposables.dispose()}},0),yu(Ya,lse,0),yu(WL,hse,0),yu(cE,une,0),yu(Ux,vse,0),yu(qk,hie,0),yu(eS,Ine,0),yu(Kx,bse,0),yu(th,yne,0),yu(y$,class{playAudioCue(e,t){return nse(this,void 0,void 0,(function*(){}))}},0),function(e){const t=new DB;for(const[r,a]of Su())t.set(r,a);const i=new $ne(t,!0);t.set(Fa,i),e.get=function(e){n||o({});const s=t.get(e);if(!s)throw new Error("Missing service "+e);return s instanceof Cu?i.invokeFunction((t=>t.get(e))):s};let n=!1;const s=new U;function o(e){if(n)return i;n=!0;for(const[i,n]of Su())t.get(i)||t.set(i,n);for(const i in e)if(e.hasOwnProperty(i)){const n=Ba(i);t.get(n)instanceof Cu&&t.set(n,e[i])}const o=IT();for(const t of o)try{i.createInstance(t)}catch(a){r(a)}return s.fire(),i}e.initialize=o,e.withServices=function(e){if(n)return e();const t=new N,i=t.add(s.event((()=>{i.dispose(),t.add(e())})));return t}}(Cse||(Cse={}));var wse=function(e,t,i,n){var s,o=arguments.length,r=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,i,r):s(t,i))||r);return o>3&&r&&Object.defineProperty(t,i,r),r},yse=function(e,t){return function(i,n){t(i,n,e)}};let Sse=0,Lse=!1;function kse(e){if(!e){if(Lse)return;Lse=!0}!function(e){Ms=document.createElement("div"),Ms.className="monaco-aria-container";const t=()=>{const e=document.createElement("div");return e.className="monaco-alert",e.setAttribute("role","alert"),e.setAttribute("aria-atomic","true"),Ms.appendChild(e),e};Ts=t(),Rs=t();const i=()=>{const e=document.createElement("div");return e.className="monaco-status",e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","true"),Ms.appendChild(e),e};As=i(),Os=i(),e.appendChild(Ms)}(e||document.body)}let Dse=class extends eW{constructor(e,t,i,n,s,o,r,a,l,h,d,c){const u=Object.assign({},t);u.ariaLabel=u.ariaLabel||FJ.editorViewAccessibleLabel,u.ariaLabel=u.ariaLabel+";"+FJ.accessibilityHelpMessage,super(e,u,{},i,n,s,o,a,l,h,d,c),this._standaloneKeybindingService=r instanceof hse?r:null,kse(u.ariaContainerElement)}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_"+ ++Sse,s=pl.deserialize(i);return this._standaloneKeybindingService.addDynamicKeybinding(n,e,t,s),n}createContextKey(e,t){return this._contextKeyService.createKey(e,t)}addAction(e){if("string"!=typeof e.id||"string"!=typeof e.label||"function"!=typeof e.run)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"),E.None;const t=e.id,i=e.label,n=pl.and(pl.equals("editorId",this.getId()),pl.deserialize(e.precondition)),s=e.keybindings,o=pl.and(n,pl.deserialize(e.keybindingContext)),r=e.contextMenuGroupId||null,a=e.contextMenuOrder||0,l=(t,...i)=>Promise.resolve(e.run(this,...i)),h=new N,d=this.getId()+":"+t;if(h.add(Xa.registerCommand(d,l)),r){const e={command:{id:d,title:i},when:n,group:r,order:a};h.add(nh.appendMenuItem(eh.EditorContext,e))}if(Array.isArray(s))for(const u of s)h.add(this._standaloneKeybindingService.addDynamicKeybinding(d,u,l,o));const c=new rF(d,i,i,n,((...t)=>Promise.resolve(e.run(this,...t))),this._contextKeyService);return this._actions.set(t,c),h.add(x((()=>{this._actions.delete(t)}))),h}_triggerCommand(e,t){if(this._codeEditorService instanceof lee)try{this._codeEditorService.setActiveCodeEditor(this),super._triggerCommand(e,t)}finally{this._codeEditorService.setActiveCodeEditor(null)}else super._triggerCommand(e,t)}};Dse=wse([yse(2,Fa),yse(3,Wa),yse(4,Ya),yse(5,Ol),yse(6,WL),yse(7,P_),yse(8,mL),yse(9,QR),yse(10,Ju),yse(11,oL)],Dse);let xse=class extends Dse{constructor(e,t,i,n,s,o,r,a,l,h,d,c,u,g,p){const m=Object.assign({},t);fse(h,m,!1);const f=a.registerEditorContainer(e);"string"==typeof m.theme&&a.setTheme(m.theme),void 0!==m.autoDetectHighContrast&&a.setAutoDetectHighContrast(Boolean(m.autoDetectHighContrast));const _=m.model;let v;if(delete m.model,super(e,m,i,n,s,o,r,a,l,d,g,p),this._configurationService=h,this._standaloneThemeService=a,this._register(f),void 0===_){const e=u.getLanguageIdByMimeType(m.language)||m.language||Ku;v=Ese(c,u,m.value||"",e,void 0),this._ownsModel=!0}else v=_,this._ownsModel=!1;if(this._attachModel(v),v){const e={oldModelUrl:null,newModelUrl:v.uri};this._onDidChangeModel.fire(e)}}dispose(){super.dispose()}updateOptions(e){fse(this._configurationService,e,!1),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),void 0!==e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_postDetachModelCleanup(e){super._postDetachModelCleanup(e),e&&this._ownsModel&&(e.dispose(),this._ownsModel=!1)}};xse=wse([yse(2,Fa),yse(3,Wa),yse(4,Ya),yse(5,Ol),yse(6,WL),yse(7,j4),yse(8,mL),yse(9,pu),yse(10,QR),yse(11,Ha),yse(12,Lc),yse(13,Ju),yse(14,oL)],xse);let Nse=class extends oZ{constructor(e,t,i,n,s,o,r,a,l,h,d,c){const u=Object.assign({},t);fse(a,u,!0);const g=o.registerEditorContainer(e);"string"==typeof u.theme&&o.setTheme(u.theme),void 0!==u.autoDetectHighContrast&&o.setAutoDetectHighContrast(Boolean(u.autoDetectHighContrast)),super(e,u,{},n,i,s,c,h),this._configurationService=a,this._standaloneThemeService=o,this._register(g)}dispose(){super.dispose()}updateOptions(e){fse(this._configurationService,e,!0),"string"==typeof e.theme&&this._standaloneThemeService.setTheme(e.theme),void 0!==e.autoDetectHighContrast&&this._standaloneThemeService.setAutoDetectHighContrast(Boolean(e.autoDetectHighContrast)),super.updateOptions(e)}_createInnerEditor(e,t,i){return e.createInstance(Dse,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)}};function Ese(e,t,i,n,s){if(i=i||"",!n){const n=i.indexOf("\n");let o=i;return-1!==n&&(o=i.substring(0,n)),Ise(e,i,t.createByFilepathOrFirstLine(s||null,o),s)}return Ise(e,i,t.createById(n),s)}function Ise(e,t,i,n){return e.createModel(t,i,n)}Nse=wse([yse(2,Fa),yse(3,Ol),yse(4,Wa),yse(5,j4),yse(6,mL),yse(7,pu),yse(8,Kx),yse(9,vL),yse(10,eS),yse(11,y$)],Nse);var Mse=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function Tse(e,t,i){return Cse.initialize(i||{}).createInstance(xse,e,t)}function Rse(e){return Cse.get(Wa).onCodeEditorAdd((t=>{e(t)}))}function Ase(e){return Cse.get(Wa).onDiffEditorAdd((t=>{e(t)}))}function Ose(){return Cse.get(Wa).listCodeEditors()}function Pse(){return Cse.get(Wa).listDiffEditors()}function Fse(e,t,i){return Cse.initialize(i||{}).createInstance(Nse,e,t)}function Bse(e){if("string"!=typeof e.id||"function"!=typeof e.run)throw new Error("Invalid command descriptor, `id` and `run` are required properties!");return Xa.registerCommand(e.id,e.run)}function Wse(e){if("string"!=typeof e.id||"string"!=typeof e.label||"function"!=typeof e.run)throw new Error("Invalid action descriptor, `id`, `label` and `run` are required properties!");const t=pl.deserialize(e.precondition),i=new N;if(i.add(Xa.registerCommand(e.id,((i,...n)=>vh.runEditorCommand(i,n,t,((t,i,n)=>Promise.resolve(e.run(i,...n))))))),e.contextMenuGroupId){const n={command:{id:e.id,title:e.label},when:t,group:e.contextMenuGroupId,order:e.contextMenuOrder||0};i.add(nh.appendMenuItem(eh.EditorContext,n))}if(Array.isArray(e.keybindings)){const n=Cse.get(WL);if(n instanceof hse){const s=pl.and(t,pl.deserialize(e.keybindingContext));i.add(n.addDynamicKeybindings(e.keybindings.map((t=>({keybinding:t,command:e.id,when:s})))))}else console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService")}return i}function Vse(e){return Hse([e])}function Hse(e){const t=Cse.get(WL);return t instanceof hse?t.addDynamicKeybindings(e.map((e=>({keybinding:e.keybinding,command:e.command,commandArgs:e.commandArgs,when:pl.deserialize(e.when)})))):(console.warn("Cannot add keybinding because the editor is configured with an unrecognized KeybindingService"),E.None)}function zse(e,t,i){const n=Cse.get(Lc),s=n.getLanguageIdByMimeType(t)||t;return Ese(Cse.get(Ha),n,e,s,i)}function Use(e,t){const i=Cse.get(Lc),n=i.getLanguageIdByMimeType(t)||t||Ku;e.setLanguage(i.createById(n))}function Kse(e,t,i){if(e){Cse.get(LN).changeOne(t,e.uri,i)}}function jse(e){Cse.get(LN).changeAll(e,[])}function qse(e){return Cse.get(LN).read(e)}function $se(e){return Cse.get(LN).onMarkerChanged(e)}function Gse(e){return Cse.get(Ha).getModel(e)}function Zse(){return Cse.get(Ha).getModels()}function Yse(e){return Cse.get(Ha).onModelAdded(e)}function Xse(e){return Cse.get(Ha).onModelRemoved(e)}function Qse(e){return Cse.get(Ha).onModelLanguageChanged((t=>{e({model:t.model,oldLanguage:t.oldLanguageId})}))}function Jse(e){return function(e,t,i){return new N8(e,t,i)}(Cse.get(Ha),Cse.get(Ju),e)}function eoe(e,t){const i=Cse.get(Lc),n=Cse.get(j4);return J8.colorizeElement(n,i,e,t).then((()=>{n.registerEditorContainer(e)}))}function toe(e,t,i){const n=Cse.get(Lc);return Cse.get(j4).registerEditorContainer(document.body),J8.colorize(n,e,t,i)}function ioe(e,t,i=4){return Cse.get(j4).registerEditorContainer(document.body),J8.colorizeModelLine(e,t,i)}function noe(e,t){EC.getOrCreate(t);const i=function(e){const t=EC.get(e);return t||{getInitialState:()=>IC,tokenize:(t,i,n)=>MC(e,n)}}(t),n=oo(e),s=[];let o=i.getInitialState();for(let r=0,a=n.length;rMse(this,void 0,void 0,(function*(){var n;if(!i)return null;const s=null===(n=t.options)||void 0===n?void 0:n.selection;let o;return s&&"number"==typeof s.endLineNumber&&"number"==typeof s.endColumn?o=s:s&&(o={lineNumber:s.startLineNumber,column:s.startColumn}),(yield e.openCodeEditor(i,t.resource,o))?i:null}))))}function doe(e,t){return"boolean"==typeof e?e:t}function coe(e,t){return"string"==typeof e?e:t}function uoe(e,t=!1){t&&(e=e.map((function(e){return e.toLowerCase()})));const i=function(e){const t={};for(const i of e)t[i]=!0;return t}(e);return t?function(e){return void 0!==i[e.toLowerCase()]&&i.hasOwnProperty(e.toLowerCase())}:function(e){return void 0!==i[e]&&i.hasOwnProperty(e)}}function goe(e,t){t=t.replace(/@@/g,"\x01");let i,n=0;do{i=!1,t=t.replace(/@(\w+)/g,(function(n,s){i=!0;let o="";if("string"==typeof e[s])o=e[s];else{if(!(e[s]&&e[s]instanceof RegExp))throw void 0===e[s]?P8(e,"language definition does not contain attribute '"+s+"', used at: "+t):P8(e,"attribute reference '"+s+"' must be a string, used at: "+t);o=e[s].source}return T8(o)?"":"(?:"+o+")"})),n++}while(i&&n<5);t=t.replace(/\x01/g,"@");const s=(e.ignoreCase?"i":"")+(e.unicode?"u":"");return new RegExp(t,s)}function poe(e,t,i,n){let s=-1,o=i,r=i.match(/^\$(([sS]?)(\d\d?)|#)(.*)$/);r&&(r[3]&&(s=parseInt(r[3]),r[2]&&(s+=100)),o=r[4]);let a,l="~",h=o;if(o&&0!==o.length?/^\w*$/.test(h)?l="==":(r=o.match(/^(@|!@|~|!~|==|!=)(.*)$/),r&&(l=r[1],h=r[2])):(l="!=",h=""),"~"!==l&&"!~"!==l||!/^(\w|\|)*$/.test(h))if("@"===l||"!@"===l){const i=e[h];if(!i)throw P8(e,"the @ match target '"+h+"' is not defined, in rule: "+t);if(!function(e,t){if(!t)return!1;if(!Array.isArray(t))return!1;for(const i of t)if(!e(i))return!1;return!0}((function(e){return"string"==typeof e}),i))throw P8(e,"the @ match target '"+h+"' must be an array of strings, in rule: "+t);const n=uoe(i,e.ignoreCase);a=function(e){return"@"===l?n(e):!n(e)}}else if("~"===l||"!~"===l)if(h.indexOf("$")<0){const t=goe(e,"^"+h+"$");a=function(e){return"~"===l?t.test(e):!t.test(e)}}else a=function(t,i,n,s){return goe(e,"^"+F8(e,h,i,n,s)+"$").test(t)};else if(h.indexOf("$")<0){const t=R8(e,h);a=function(e){return"=="===l?e===t:e!==t}}else{const t=R8(e,h);a=function(i,n,s,o,r){const a=F8(e,t,n,s,o);return"=="===l?i===a:i!==a}}else{const t=uoe(h.split("|"),e.ignoreCase);a=function(e){return"~"===l?t(e):!t(e)}}return-1===s?{name:i,value:n,test:function(e,t,i,n){return a(e,e,t,i,n)}}:{name:i,value:n,test:function(e,t,i,n){const o=function(e,t,i,n){if(n<0)return e;if(n=100){n-=100;const e=i.split(".");if(e.unshift(i),n=0&&(n.tokenSubst=!0),"string"==typeof i.bracket)if("@open"===i.bracket)n.bracket=1;else{if("@close"!==i.bracket)throw P8(e,"a 'bracket' attribute must be either '@open' or '@close', in rule: "+t);n.bracket=-1}if(i.next){if("string"!=typeof i.next)throw P8(e,"the next state must be a string value in rule: "+t);{let s=i.next;if(!/^(@pop|@push|@popall)$/.test(s)&&("@"===s[0]&&(s=s.substr(1)),s.indexOf("$")<0&&!function(e,t){let i=t;for(;i&&i.length>0;){if(e.stateNames[i])return!0;const t=i.lastIndexOf(".");i=t<0?null:i.substr(0,t)}return!1}(e,F8(e,s,"",[],""))))throw P8(e,"the next state '"+i.next+"' is not defined in rule: "+t);n.next=s}}return"number"==typeof i.goBack&&(n.goBack=i.goBack),"string"==typeof i.switchTo&&(n.switchTo=i.switchTo),"string"==typeof i.log&&(n.log=i.log),"string"==typeof i.nextEmbedded&&(n.nextEmbedded=i.nextEmbedded,e.usesEmbedded=!0),n}}if(Array.isArray(i)){const n=[];for(let s=0,o=i.length;s0&&"^"===i[0],this.name=this.name+": "+i,this.regex=goe(e,"^(?:"+(this.matchOnlyAtLineStart?i.substr(1):i)+")")}setAction(e,t){this.action=moe(e,this.name,t)}}function _oe(e,t){if(!t||"object"!=typeof t)throw new Error("Monarch: expecting a language definition object");const i={};i.languageId=e,i.includeLF=doe(t.includeLF,!1),i.noThrow=!1,i.maxStack=100,i.start="string"==typeof t.start?t.start:null,i.ignoreCase=doe(t.ignoreCase,!1),i.unicode=doe(t.unicode,!1),i.tokenPostfix=coe(t.tokenPostfix,"."+i.languageId),i.defaultToken=coe(t.defaultToken,"source"),i.usesEmbedded=!1;const n=t;function s(e,o,r){for(const a of r){let r=a.include;if(r){if("string"!=typeof r)throw P8(i,"an 'include' attribute must be a string at: "+e);if("@"===r[0]&&(r=r.substr(1)),!t.tokenizer[r])throw P8(i,"include target '"+r+"' is not defined at: "+e);s(e+"."+r,o,t.tokenizer[r])}else{const t=new foe(e);if(Array.isArray(a)&&a.length>=1&&a.length<=3)if(t.setRegex(n,a[0]),a.length>=3)if("string"==typeof a[1])t.setAction(n,{token:a[1],next:a[2]});else{if("object"!=typeof a[1])throw P8(i,"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: "+e);{const e=a[1];e.next=a[2],t.setAction(n,e)}}else t.setAction(n,a[1]);else{if(!a.regex)throw P8(i,"a rule must either be an array, or an object with a 'regex' or 'include' field at: "+e);a.name&&"string"==typeof a.name&&(t.name=a.name),a.matchOnlyAtStart&&(t.matchOnlyAtLineStart=doe(a.matchOnlyAtLineStart,!1)),t.setRegex(n,a.regex),t.setAction(n,a.action)}o.push(t)}}}if(n.languageId=e,n.includeLF=i.includeLF,n.ignoreCase=i.ignoreCase,n.unicode=i.unicode,n.noThrow=i.noThrow,n.usesEmbedded=i.usesEmbedded,n.stateNames=t.tokenizer,n.defaultToken=i.defaultToken,!t.tokenizer||"object"!=typeof t.tokenizer)throw P8(i,"a language definition must define the 'tokenizer' attribute as an object");i.tokenizer=[];for(const r in t.tokenizer)if(t.tokenizer.hasOwnProperty(r)){i.start||(i.start=r);const e=t.tokenizer[r];i.tokenizer[r]=new Array,s("tokenizer."+r,i.tokenizer[r],e)}if(i.usesEmbedded=n.usesEmbedded,t.brackets){if(!Array.isArray(t.brackets))throw P8(i,"the 'brackets' attribute must be defined as an array")}else t.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 t.brackets){let e=r;if(e&&Array.isArray(e)&&3===e.length&&(e={token:e[2],open:e[0],close:e[1]}),e.open===e.close)throw P8(i,"open and close brackets in a 'brackets' attribute must be different: "+e.open+"\n hint: use the 'bracket' attribute if matching on equal brackets is required.");if("string"!=typeof e.open||"string"!=typeof e.token||"string"!=typeof e.close)throw P8(i,"every element in the 'brackets' array must be a '{open,close,token}' object or array");o.push({token:e.token+i.tokenPostfix,open:R8(i,e.open),close:R8(i,e.close)})}return i.brackets=o,i.noThrow=!0,i}var voe=function(e,t,i,n){return new(i||(i=Promise))((function(s,o){function r(e){try{l(n.next(e))}catch(Mre){o(Mre)}}function a(e){try{l(n.throw(e))}catch(Mre){o(Mre)}}function l(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(r,a)}l((n=n.apply(e,t||[])).next())}))};function boe(e){Uu.registerLanguage(e)}function Coe(){let e=[];return e=e.concat(Uu.getLanguages()),e}function woe(e){return Cse.get(Lc).languageIdCodec.encodeLanguageId(e)}function yoe(e,t){return Cse.withServices((()=>{const i=Cse.get(Lc).onDidRequestRichLanguageFeatures((n=>{n===e&&(i.dispose(),t())}));return i}))}function Soe(e,t){return Cse.withServices((()=>{const i=Cse.get(Lc).onDidRequestBasicLanguageFeatures((n=>{n===e&&(i.dispose(),t())}));return i}))}function Loe(e,t){if(!Cse.get(Lc).isRegisteredLanguageId(e))throw new Error(`Cannot set configuration for unknown language ${e}`);return Cse.get(Ju).register(e,t,100)}class koe{constructor(e,t){this._languageId=e,this._actual=t}dispose(){}getInitialState(){return this._actual.getInitialState()}tokenize(e,t,i){if("function"==typeof this._actual.tokenize)return Doe.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 wC(n.tokens,n.endState)}}class Doe{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 s=0,o=e.length;s0&&s[o-1]===a)continue;let h=e.startIndex;0===l?h=0:hvoe(this,void 0,void 0,(function*(){const i=yield Promise.resolve(t.create());return i?"function"==typeof i.getInitialState?Eoe(e,i):new Z8(Cse.get(Lc),Cse.get(j4),e,_oe(e,i),Cse.get(pu)):null}))));return EC.registerFactory(e,i)}function Moe(e,t){if(!Cse.get(Lc).isRegisteredLanguageId(e))throw new Error(`Cannot set tokens provider for unknown language ${e}`);return xoe(t)?Ioe(e,{create:()=>t}):EC.register(e,Eoe(e,t))}function Toe(e,t){return xoe(t)?Ioe(e,{create:()=>t}):EC.register(e,(t=>new Z8(Cse.get(Lc),Cse.get(j4),e,_oe(e,t),Cse.get(pu)))(t))}function Roe(e,t){return Cse.get(oL).referenceProvider.register(e,t)}function Aoe(e,t){return Cse.get(oL).renameProvider.register(e,t)}function Ooe(e,t){return Cse.get(oL).signatureHelpProvider.register(e,t)}function Poe(e,t){return Cse.get(oL).hoverProvider.register(e,{provideHover:(e,i,n)=>{const s=e.getWordAtPosition(i);return Promise.resolve(t.provideHover(e,i,n)).then((e=>{if(e)return!e.range&&s&&(e.range=new Rh(i.lineNumber,s.startColumn,i.lineNumber,s.endColumn)),e.range||(e.range=new Rh(i.lineNumber,i.column,i.lineNumber,i.column)),e}))}})}function Foe(e,t){return Cse.get(oL).documentSymbolProvider.register(e,t)}function Boe(e,t){return Cse.get(oL).documentHighlightProvider.register(e,t)}function Woe(e,t){return Cse.get(oL).linkedEditingRangeProvider.register(e,t)}function Voe(e,t){return Cse.get(oL).definitionProvider.register(e,t)}function Hoe(e,t){return Cse.get(oL).implementationProvider.register(e,t)}function zoe(e,t){return Cse.get(oL).typeDefinitionProvider.register(e,t)}function Uoe(e,t){return Cse.get(oL).codeLensProvider.register(e,t)}function Koe(e,t,i){return Cse.get(oL).codeActionProvider.register(e,{providedCodeActionKinds:null==i?void 0:i.providedCodeActionKinds,documentation:null==i?void 0:i.documentation,provideCodeActions:(e,i,n,s)=>{const o=Cse.get(LN).read({resource:e.uri}).filter((e=>Rh.areIntersectingOrTouching(e,i)));return t.provideCodeActions(e,i,{markers:o,only:n.only,trigger:n.trigger},s)},resolveCodeAction:t.resolveCodeAction})}function joe(e,t){return Cse.get(oL).documentFormattingEditProvider.register(e,t)}function qoe(e,t){return Cse.get(oL).documentRangeFormattingEditProvider.register(e,t)}function $oe(e,t){return Cse.get(oL).onTypeFormattingEditProvider.register(e,t)}function Goe(e,t){return Cse.get(oL).linkProvider.register(e,t)}function Zoe(e,t){return Cse.get(oL).completionProvider.register(e,t)}function Yoe(e,t){return Cse.get(oL).colorProvider.register(e,t)}function Xoe(e,t){return Cse.get(oL).foldingRangeProvider.register(e,t)}function Qoe(e,t){return Cse.get(oL).declarationProvider.register(e,t)}function Joe(e,t){return Cse.get(oL).selectionRangeProvider.register(e,t)}function ere(e,t){return Cse.get(oL).documentSemanticTokensProvider.register(e,t)}function tre(e,t){return Cse.get(oL).documentRangeSemanticTokensProvider.register(e,t)}function ire(e,t){return Cse.get(oL).inlineCompletionsProvider.register(e,t)}function nre(e,t){return Cse.get(oL).inlayHintsProvider.register(e,t)}ZS.wrappingIndent.defaultValue=0,ZS.glyphMargin.defaultValue=!1,ZS.autoIndent.defaultValue=3,ZS.overviewRulerLanes.defaultValue=2,_J.setFormatterSelector(((e,t,i)=>Promise.resolve(e[0])));const sre=dM();sre.editor={create:Tse,getEditors:Ose,getDiffEditors:Pse,onDidCreateEditor:Rse,onDidCreateDiffEditor:Ase,createDiffEditor:Fse,addCommand:Bse,addEditorAction:Wse,addKeybindingRule:Vse,addKeybindingRules:Hse,createModel:zse,setModelLanguage:Use,setModelMarkers:Kse,getModelMarkers:qse,removeAllMarkers:jse,onDidChangeMarkers:$se,getModels:Zse,getModel:Gse,onDidCreateModel:Yse,onWillDisposeModel:Xse,onDidChangeModelLanguage:Qse,createWebWorker:Jse,colorizeElement:eoe,colorize:toe,colorizeModelLine:ioe,tokenize:noe,defineTheme:soe,setTheme:ooe,remeasureFonts:roe,registerCommand:aoe,registerLinkOpener:loe,registerEditorOpener:hoe,AccessibilitySupport:LI,ContentWidgetPositionPreference:II,CursorChangeReason:MI,DefaultEndOfLine:TI,EditorAutoIndentStrategy:AI,EditorOption:OI,EndOfLinePreference:PI,EndOfLineSequence:FI,MinimapPosition:qI,MouseTargetType:$I,OverlayWidgetPositionPreference:GI,OverviewRulerLane:ZI,GlyphMarginLane:BI,RenderLineNumbersType:XI,RenderMinimap:QI,ScrollbarVisibility:eM,ScrollType:JI,TextEditorCursorBlinkingStyle:oM,TextEditorCursorStyle:rM,TrackedRangeStickiness:aM,WrappingIndent:lM,InjectedTextCursorStops:VI,PositionAffinity:YI,ConfigurationChangedEvent:gS,BareFontInfo:UR,FontInfo:KR,TextModelResolvedOptions:kd,FindMatch:Dd,ApplyUpdateResult:fS,EditorZoom:HR,EditorType:aF,EditorOptions:ZS},sre.languages={register:boe,getLanguages:Coe,onLanguage:yoe,onLanguageEncountered:Soe,getEncodedLanguageId:woe,setLanguageConfiguration:Loe,setColorMap:Noe,registerTokensProviderFactory:Ioe,setTokensProvider:Moe,setMonarchTokensProvider:Toe,registerReferenceProvider:Roe,registerRenameProvider:Aoe,registerCompletionItemProvider:Zoe,registerSignatureHelpProvider:Ooe,registerHoverProvider:Poe,registerDocumentSymbolProvider:Foe,registerDocumentHighlightProvider:Boe,registerLinkedEditingRangeProvider:Woe,registerDefinitionProvider:Voe,registerImplementationProvider:Hoe,registerTypeDefinitionProvider:zoe,registerCodeLensProvider:Uoe,registerCodeActionProvider:Koe,registerDocumentFormattingEditProvider:joe,registerDocumentRangeFormattingEditProvider:qoe,registerOnTypeFormattingEditProvider:$oe,registerLinkProvider:Goe,registerColorProvider:Yoe,registerFoldingRangeProvider:Xoe,registerDeclarationProvider:Qoe,registerSelectionRangeProvider:Joe,registerDocumentSemanticTokensProvider:ere,registerDocumentRangeSemanticTokensProvider:tre,registerInlineCompletionsProvider:ire,registerInlayHintsProvider:nre,DocumentHighlightKind:RI,CompletionItemKind:xI,CompletionItemTag:NI,CompletionItemInsertTextRule:DI,SymbolKind:nM,SymbolTag:sM,IndentAction:WI,CompletionTriggerKind:EI,SignatureHelpTriggerKind:iM,InlayHintKind:HI,InlineCompletionTriggerKind:zI,CodeActionTriggerType:kI,FoldingRangeKind:xC,SelectedSuggestionInfo:yC};const ore=sre.CancellationTokenSource,rre=sre.Emitter,are=sre.KeyCode,lre=sre.KeyMod,hre=sre.Position,dre=sre.Range,cre=sre.Selection,ure=sre.SelectionDirection,gre=sre.MarkerSeverity,pre=sre.MarkerTag,mre=sre.Uri,fre=sre.Token,_re=sre.editor,vre=sre.languages,bre=globalThis.MonacoEnvironment;((null==bre?void 0:bre.globalAPI)||"function"==typeof define&&i.amdO)&&(globalThis.monaco=sre),void 0!==globalThis.require&&"function"==typeof globalThis.require.config&&globalThis.require.config({ignoreDuplicateModules:["vscode-languageserver-types","vscode-languageserver-types/main","vscode-languageserver-textdocument","vscode-languageserver-textdocument/main","vscode-nls","vscode-nls/vscode-nls","jsonc-parser","jsonc-parser/main","vscode-uri","vscode-uri/index","vs/basic-languages/typescript/typescript"]});var Cre,wre,yre=Object.defineProperty,Sre=Object.getOwnPropertyDescriptor,Lre=Object.getOwnPropertyNames,kre=Object.prototype.hasOwnProperty,Dre=(e,t,i,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let s of Lre(t))kre.call(e,s)||s===i||yre(e,s,{get:()=>t[s],enumerable:!(n=Sre(t,s))||n.enumerable});return e},xre={};Dre(xre,Cre=s,"default"),wre&&Dre(wre,Cre,"default");var Nre,Ere=new class{_onDidChange=new xre.Emitter;_diagnosticsOptions;_modeConfiguration;_languageId;constructor(e,t,i){this._languageId=e,this.setDiagnosticsOptions(t),this.setModeConfiguration(i)}get onDidChange(){return this._onDidChange.event}get languageId(){return this._languageId}get modeConfiguration(){return this._modeConfiguration}get diagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(e){this._diagnosticsOptions=e||Object.create(null),this._onDidChange.fire(this)}setModeConfiguration(e){this._modeConfiguration=e||Object.create(null),this._onDidChange.fire(this)}}("json",{validate:!0,allowComments:!0,schemas:[],enableSchemaRequest:!1,schemaRequest:"warning",schemaValidation:"warning",comments:"error",trailingCommas:"error"},{documentFormattingEdits:!0,documentRangeFormattingEdits:!0,completionItems:!0,hovers:!0,documentSymbols:!0,tokens:!0,colors:!0,foldingRanges:!0,diagnostics:!0,selectionRanges:!0});xre.languages.json={jsonDefaults:Ere},xre.languages.register({id:"json",extensions:[".json",".bowerrc",".jshintrc",".jscsrc",".eslintrc",".babelrc",".har"],aliases:["JSON","json"],mimetypes:["application/json"]}),xre.languages.onLanguage("json",(()=>{i.e(4839).then(i.bind(i,4839)).then((e=>e.setupMode(Ere)))})),self.MonacoEnvironment=(Nre={editorWorkerService:"editor.worker.js",json:"json.worker.js"},{globalAPI:!1,getWorkerUrl:function(e,t){var n=i.p,s=(n?n.replace(/\/$/,"")+"/":"")+Nre[t];if(/^((http:)|(https:)|(file:)|(\/\/))/.test(s)){var o=String(window.location),r=o.substr(0,o.length-window.location.hash.length-window.location.search.length-window.location.pathname.length);if(s.substring(0,r.length)!==r){/^(\/\/)/.test(s)&&(s=window.location.protocol+s);var a=new Blob(["/*"+t+'*/importScripts("'+s+'");'],{type:"application/javascript"});return URL.createObjectURL(a)}}return s}});const Ire=n},1569:(e,t,i)=>{i.r(t),i.d(t,{MonacoDiffEditor:()=>h,default:()=>g,monaco:()=>n});var n=i(8047),s=i(6540);function o(e){return/^\d+$/.test(e)?"".concat(e,"px"):e}function r(){}var a=function(){return a=Object.assign||function(e){for(var t,i=1,n=arguments.length;i{i.d(t,{m:()=>ce});class n extends Error{constructor(e,t){super("".concat(e," at position ").concat(t)),this.position=t}}const s=92,o=47,r=42,a=123,l=125,h=91,d=93,c=40,u=41,g=32,p=10,m=9,f=13,_=8,v=12,b=34,C=43,w=45,y=39,S=48,L=57,k=44,D=46,x=58,N=59,E=65,I=97,M=69,T=101,R=70,A=102,O=160,P=8192,F=8202,B=8239,W=8287,V=12288,H=8220,z=8221,U=8216,K=8217,j=96,q=180;function $(e){return e>=S&&e<=L}function G(e){return e>=32&&e<=1114111}function Z(e){return Y.test(e)}const Y=/^[,:[\]/{}()\n+]$/;function X(e){return Q.test(e)||e&&te(e.charCodeAt(0))}const Q=/^[[{\w-]$/;function J(e){return e===p||e===f||e===m||e===_||e===v}function ee(e){return e===g||e===p||e===m||e===f}function te(e){return ie(e)||se(e)}function ie(e){return e===b||e===H||e===z}function ne(e){return e===b}function se(e){return e===y||e===U||e===K||e===j||e===q}function oe(e){return e===y}function re(e,t){let i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=e.lastIndexOf(t);return-1!==n?e.substring(0,n)+(i?"":e.substring(n+1)):e}function ae(e,t){let i=e.length;if(!ee(e.charCodeAt(i-1)))return e+t;for(;ee(e.charCodeAt(i-1));)i--;return e.substring(0,i)+t+e.substring(i)}function le(e,t,i){return e.substring(0,t)+e.substring(t+i)}const he={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},de={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function ce(e){let t=0,i="";m()||function(){throw new n("Unexpected end of json string",e.length)}();const g=y(k);for(g&&f(),X(e[t])&&function(e){return/[,\n][ \t\r]*$/.test(e)}(i)?(g||(i=ae(i,",")),function(){let e=!0,t=!0;for(;t;){if(e)e=!1;else{y(k)||(i=ae(i,","))}t=m()}t||(i=re(i,","));i="[\n".concat(i,"\n]")}()):g&&(i=re(i,","));e.charCodeAt(t)===l||e.charCodeAt(t)===d;)t++,f();if(t>=e.length)return i;function m(){f();const n=function(){if(e.charCodeAt(t)===a){i+="{",t++,f(),H(k)&&f();let n=!0;for(;t=e.length;o||(X(e[t])||r?i=ae(i,":"):me());m()||(o||r?i+="null":me())}return e.charCodeAt(t)===l?(i+="}",t++):i=ae(i,"}"),!0}return!1}()||function(){if(e.charCodeAt(t)===h){i+="[",t++,f(),H(k)&&f();let n=!0;for(;tn){const s=e.slice(n,t),o=/^0\d/.test(s);return i+=o?'"'.concat(s,'"'):s,!0}return!1}()||j("true","true")||j("false","false")||j("null","null")||j("True","true")||j("False","false")||j("None","null")||q();return f(),n}function f(){const e=t;let i=_();do{i=v(),i&&(i=_())}while(i);return t>e}function _(){let n,s="";for(;(n=ee(e.charCodeAt(t)))||((o=e.charCodeAt(t))===O||o>=P&&o<=F||o===B||o===W||o===V);)s+=n?e[t]:" ",t++;var o;return s.length>0&&(i+=s,!0)}function v(){if(e.charCodeAt(t)===o&&e.charCodeAt(t+1)===r){for(;t0&&void 0!==arguments[0]&&arguments[0],o=e.charCodeAt(t)===s;if(o&&(t++,o=!0),te(e.charCodeAt(t))){const a=ne(e.charCodeAt(t))?ne:oe(e.charCodeAt(t))?oe:se(e.charCodeAt(t))?se:ie,l=t,h=i.length;let d='"';for(t++;;){if(t>=e.length){const s=Y(t-1);return!n&&Z(e.charAt(s))?(t=l,i=i.substring(0,h),U(!0)):(d=ae(d,'"'),i+=d,!0)}if(a(e.charCodeAt(t))){const s=t,o=d.length;if(d+='"',t++,i+=d,f(),n||t>=e.length||Z(e.charAt(t))||te(e.charCodeAt(t))||$(e.charCodeAt(t)))return K(),!0;if(Z(e.charAt(Y(s-1))))return t=l,i=i.substring(0,h),U(!0);i=i.substring(0,h),t=s+1,d="".concat(d.substring(0,o),"\\").concat(d.substring(o))}else{if(n&&Z(e[t]))return d=ae(d,'"'),i+=d,K(),!0;if(e.charCodeAt(t)===s){const i=e.charAt(t+1);if(void 0!==de[i])d+=e.slice(t,t+2),t+=2;else if("u"===i){let i=2;for(;i<6&&((r=e.charCodeAt(t+i))>=S&&r<=L||r>=E&&r<=R||r>=I&&r<=A);)i++;6===i?(d+=e.slice(t,t+6),t+=6):t+i>=e.length?t=e.length:fe()}else d+=i,t+=2}else{const i=e.charAt(t),n=e.charCodeAt(t);n===b&&e.charCodeAt(t-1)!==s?(d+="\\".concat(i),t++):J(n)?(d+=he[i],t++):(G(n)||ge(i),d+=i,t++)}}o&&H(s)}}var r;return!1}function K(){let n=!1;for(f();e.charCodeAt(t)===C;){n=!0,t++,f(),i=re(i,'"',!0);const e=i.length,s=U();i=s?le(i,e,1):ae(i,'"')}return n}function j(n,s){return e.slice(t,t+n.length)===n&&(i+=s,t+=n.length,!0)}function q(){const n=t;for(;tn){if(e.charCodeAt(t)===c&&function(e){return/^\w+$/.test(e)}(e.slice(n,t).trim()))return t++,m(),e.charCodeAt(t)===u&&(t++,e.charCodeAt(t)===N&&t++),!0;{for(;ee(e.charCodeAt(t-1))&&t>0;)t--;const s=e.slice(n,t);return i+="undefined"===s?"null":JSON.stringify(s),e.charCodeAt(t)===b&&t++,!0}}}function Y(t){let i=t;for(;i>0&&ee(e.charCodeAt(i));)i--;return i}function Q(){return t>=e.length||Z(e[t])||ee(e.charCodeAt(t))}function ce(n){i+="".concat(e.slice(n,t),"0")}function ge(e){throw new n("Invalid character ".concat(JSON.stringify(e)),t)}function pe(){throw new n("Object key expected",t)}function me(){throw new n("Colon expected",t)}function fe(){const i=e.slice(t,t+6);throw new n('Invalid unicode character "'.concat(i,'"'),t)}!function(){throw new n("Unexpected character ".concat(JSON.stringify(e[t])),t)}()}function ue(e,t){return"*"===e[t]&&"/"===e[t+1]}},9571:(e,t,i)=>{i.d(t,{N9:()=>F,oR:()=>E});var n=i(6540),s=i(4164);const o=e=>"number"==typeof e&&!isNaN(e),r=e=>"string"==typeof e,a=e=>"function"==typeof e,l=e=>r(e)||a(e)?e:null,h=e=>(0,n.isValidElement)(e)||r(e)||a(e)||o(e);function d(e){let{enter:t,exit:i,appendPosition:s=!1,collapse:o=!0,collapseDuration:r=300}=e;return function(e){let{children:a,position:l,preventExitTransition:h,done:d,nodeRef:c,isIn:u,playToast:g}=e;const p=s?`${t}--${l}`:t,m=s?`${i}--${l}`:i,f=(0,n.useRef)(0);return(0,n.useLayoutEffect)((()=>{const e=c.current,t=p.split(" "),i=n=>{n.target===c.current&&(g(),e.removeEventListener("animationend",i),e.removeEventListener("animationcancel",i),0===f.current&&"animationcancel"!==n.type&&e.classList.remove(...t))};e.classList.add(...t),e.addEventListener("animationend",i),e.addEventListener("animationcancel",i)}),[]),(0,n.useEffect)((()=>{const e=c.current,t=()=>{e.removeEventListener("animationend",t),o?function(e,t,i){void 0===i&&(i=300);const{scrollHeight:n,style:s}=e;requestAnimationFrame((()=>{s.minHeight="initial",s.height=n+"px",s.transition=`all ${i}ms`,requestAnimationFrame((()=>{s.height="0",s.padding="0",s.margin="0",setTimeout(t,i)}))}))}(e,d,r):d()};u||(h?t():(f.current=1,e.className+=` ${m}`,e.addEventListener("animationend",t)))}),[u]),n.createElement(n.Fragment,null,a)}}function c(e,t){return null!=e?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const u=new Map;let g=[];const p=new Set,m=e=>p.forEach((t=>t(e))),f=()=>u.size>0;function _(e,t){var i;if(t)return!(null==(i=u.get(t))||!i.isToastActive(e));let n=!1;return u.forEach((t=>{t.isToastActive(e)&&(n=!0)})),n}function v(e,t){h(e)&&(f()||g.push({content:e,options:t}),u.forEach((i=>{i.buildToast(e,t)})))}function b(e,t){u.forEach((i=>{null!=t&&null!=t&&t.containerId?(null==t?void 0:t.containerId)===i.id&&i.toggle(e,null==t?void 0:t.id):i.toggle(e,null==t?void 0:t.id)}))}function C(e){const{subscribe:t,getSnapshot:i,setProps:s}=(0,n.useRef)(function(e){const t=e.containerId||1;return{subscribe(i){const s=function(e,t,i){let s=1,d=0,u=[],g=[],p=[],m=t;const f=new Map,_=new Set,v=()=>{p=Array.from(f.values()),_.forEach((e=>e()))},b=e=>{g=null==e?[]:g.filter((t=>t!==e)),v()},C=e=>{const{toastId:t,onOpen:s,updateId:o,children:r}=e.props,l=null==o;e.staleId&&f.delete(e.staleId),f.set(t,e),g=[...g,e.props.toastId].filter((t=>t!==e.staleId)),v(),i(c(e,l?"added":"updated")),l&&a(s)&&s((0,n.isValidElement)(r)&&r.props)};return{id:e,props:m,observe:e=>(_.add(e),()=>_.delete(e)),toggle:(e,t)=>{f.forEach((i=>{null!=t&&t!==i.props.toastId||a(i.toggle)&&i.toggle(e)}))},removeToast:b,toasts:f,clearQueue:()=>{d-=u.length,u=[]},buildToast:(t,g)=>{if((t=>{let{containerId:i,toastId:n,updateId:s}=t;const o=i?i!==e:1!==e,r=f.has(n)&&null==s;return o||r})(g))return;const{toastId:p,updateId:_,data:w,staleId:y,delay:S}=g,L=()=>{b(p)},k=null==_;k&&d++;const D={...m,style:m.toastStyle,key:s++,...Object.fromEntries(Object.entries(g).filter((e=>{let[t,i]=e;return null!=i}))),toastId:p,updateId:_,data:w,closeToast:L,isIn:!1,className:l(g.className||m.toastClassName),bodyClassName:l(g.bodyClassName||m.bodyClassName),progressClassName:l(g.progressClassName||m.progressClassName),autoClose:!g.isLoading&&(x=g.autoClose,N=m.autoClose,!1===x||o(x)&&x>0?x:N),deleteToast(){const e=f.get(p),{onClose:t,children:s}=e.props;a(t)&&t((0,n.isValidElement)(s)&&s.props),i(c(e,"removed")),f.delete(p),d--,d<0&&(d=0),u.length>0?C(u.shift()):v()}};var x,N;D.closeButton=m.closeButton,!1===g.closeButton||h(g.closeButton)?D.closeButton=g.closeButton:!0===g.closeButton&&(D.closeButton=!h(m.closeButton)||m.closeButton);let E=t;(0,n.isValidElement)(t)&&!r(t.type)?E=(0,n.cloneElement)(t,{closeToast:L,toastProps:D,data:w}):a(t)&&(E=t({closeToast:L,toastProps:D,data:w}));const I={content:E,props:D,staleId:y};m.limit&&m.limit>0&&d>m.limit&&k?u.push(I):o(S)?setTimeout((()=>{C(I)}),S):C(I)},setProps(e){m=e},setToggle:(e,t)=>{f.get(e).toggle=t},isToastActive:e=>g.some((t=>t===e)),getSnapshot:()=>p}}(t,e,m);u.set(t,s);const d=s.observe(i);return g.forEach((e=>v(e.content,e.options))),g=[],()=>{d(),u.delete(t)}},setProps(e){var i;null==(i=u.get(t))||i.setProps(e)},getSnapshot(){var e;return null==(e=u.get(t))?void 0:e.getSnapshot()}}}(e)).current;s(e);const d=(0,n.useSyncExternalStore)(t,i,i);return{getToastToRender:function(t){if(!d)return[];const i=new Map;return e.newestOnTop&&d.reverse(),d.forEach((e=>{const{position:t}=e.props;i.has(t)||i.set(t,[]),i.get(t).push(e)})),Array.from(i,(e=>t(e[0],e[1])))},isToastActive:_,count:null==d?void 0:d.length}}function w(e){const[t,i]=(0,n.useState)(!1),[s,o]=(0,n.useState)(!1),r=(0,n.useRef)(null),a=(0,n.useRef)({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:l,pauseOnHover:h,closeToast:d,onClick:c,closeOnClick:g}=e;var p,m;function f(){i(!0)}function _(){i(!1)}function v(i){const n=r.current;a.canDrag&&n&&(a.didMove=!0,t&&_(),a.delta="x"===e.draggableDirection?i.clientX-a.start:i.clientY-a.start,a.start!==i.clientX&&(a.canCloseOnClick=!1),n.style.transform=`translate3d(${"x"===e.draggableDirection?`${a.delta}px, var(--y)`:`0, calc(${a.delta}px + var(--y))`},0)`,n.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function b(){document.removeEventListener("pointermove",v),document.removeEventListener("pointerup",b);const t=r.current;if(a.canDrag&&a.didMove&&t){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return o(!0),e.closeToast(),void e.collapseAll();t.style.transition="transform 0.2s, opacity 0.2s",t.style.removeProperty("transform"),t.style.removeProperty("opacity")}}null==(m=u.get((p={id:e.toastId,containerId:e.containerId,fn:i}).containerId||1))||m.setToggle(p.id,p.fn),(0,n.useEffect)((()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||_(),window.addEventListener("focus",f),window.addEventListener("blur",_),()=>{window.removeEventListener("focus",f),window.removeEventListener("blur",_)}}),[e.pauseOnFocusLoss]);const C={onPointerDown:function(t){if(!0===e.draggable||e.draggable===t.pointerType){a.didMove=!1,document.addEventListener("pointermove",v),document.addEventListener("pointerup",b);const i=r.current;a.canCloseOnClick=!0,a.canDrag=!0,i.style.transition="none","x"===e.draggableDirection?(a.start=t.clientX,a.removalDistance=i.offsetWidth*(e.draggablePercent/100)):(a.start=t.clientY,a.removalDistance=i.offsetHeight*(80===e.draggablePercent?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(t){const{top:i,bottom:n,left:s,right:o}=r.current.getBoundingClientRect();"touchend"!==t.nativeEvent.type&&e.pauseOnHover&&t.clientX>=s&&t.clientX<=o&&t.clientY>=i&&t.clientY<=n?_():f()}};return l&&h&&(C.onMouseEnter=_,e.stacked||(C.onMouseLeave=f)),g&&(C.onClick=e=>{c&&c(e),a.canCloseOnClick&&d()}),{playToast:f,pauseToast:_,isRunning:t,preventExitTransition:s,toastRef:r,eventHandlers:C}}function y(e){let{delay:t,isRunning:i,closeToast:o,type:r="default",hide:l,className:h,style:d,controlledProgress:c,progress:u,rtl:g,isIn:p,theme:m}=e;const f=l||c&&0===u,_={...d,animationDuration:`${t}ms`,animationPlayState:i?"running":"paused"};c&&(_.transform=`scaleX(${u})`);const v=(0,s.A)("Toastify__progress-bar",c?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${m}`,`Toastify__progress-bar--${r}`,{"Toastify__progress-bar--rtl":g}),b=a(h)?h({rtl:g,type:r,defaultClassName:v}):(0,s.A)(v,h),C={[c&&u>=1?"onTransitionEnd":"onAnimationEnd"]:c&&u<1?null:()=>{p&&o()}};return n.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":f},n.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${m} Toastify__progress-bar--${r}`}),n.createElement("div",{role:"progressbar","aria-hidden":f?"true":"false","aria-label":"notification timer",className:b,style:_,...C}))}let S=1;const L=()=>""+S++;function k(e){return e&&(r(e.toastId)||o(e.toastId))?e.toastId:L()}function D(e,t){return v(e,t),t.toastId}function x(e,t){return{...t,type:t&&t.type||e,toastId:k(t)}}function N(e){return(t,i)=>D(t,x(e,i))}function E(e,t){return D(e,x("default",t))}E.loading=(e,t)=>D(e,x("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),E.promise=function(e,t,i){let n,{pending:s,error:o,success:l}=t;s&&(n=r(s)?E.loading(s,i):E.loading(s.render,{...i,...s}));const h={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},d=(e,t,s)=>{if(null==t)return void E.dismiss(n);const o={type:e,...h,...i,data:s},a=r(t)?{render:t}:t;return n?E.update(n,{...o,...a}):E(a.render,{...o,...a}),s},c=a(e)?e():e;return c.then((e=>d("success",l,e))).catch((e=>d("error",o,e))),c},E.success=N("success"),E.info=N("info"),E.error=N("error"),E.warning=N("warning"),E.warn=E.warning,E.dark=(e,t)=>D(e,x("default",{theme:"dark",...t})),E.dismiss=function(e){!function(e){var t;if(f()){if(null==e||r(t=e)||o(t))u.forEach((t=>{t.removeToast(e)}));else if(e&&("containerId"in e||"id"in e)){const t=u.get(e.containerId);t?t.removeToast(e.id):u.forEach((t=>{t.removeToast(e.id)}))}}else g=g.filter((t=>null!=e&&t.options.toastId!==e))}(e)},E.clearWaitingQueue=function(e){void 0===e&&(e={}),u.forEach((t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()}))},E.isActive=_,E.update=function(e,t){void 0===t&&(t={});const i=((e,t)=>{var i;let{containerId:n}=t;return null==(i=u.get(n||1))?void 0:i.toasts.get(e)})(e,t);if(i){const{props:n,content:s}=i,o={delay:100,...n,...t,toastId:t.toastId||e,updateId:L()};o.toastId!==e&&(o.staleId=e);const r=o.render||s;delete o.render,D(r,o)}},E.done=e=>{E.update(e,{progress:1})},E.onChange=function(e){return p.add(e),()=>{p.delete(e)}},E.play=e=>b(!0,e),E.pause=e=>b(!1,e);const I="undefined"!=typeof window?n.useLayoutEffect:n.useEffect,M=e=>{let{theme:t,type:i,isLoading:s,...o}=e;return n.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:"colored"===t?"currentColor":`var(--toastify-icon-color-${i})`,...o})},T={info:function(e){return n.createElement(M,{...e},n.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return n.createElement(M,{...e},n.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return n.createElement(M,{...e},n.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return n.createElement(M,{...e},n.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return n.createElement("div",{className:"Toastify__spinner"})}},R=e=>{const{isRunning:t,preventExitTransition:i,toastRef:o,eventHandlers:r,playToast:l}=w(e),{closeButton:h,children:d,autoClose:c,onClick:u,type:g,hideProgressBar:p,closeToast:m,transition:f,position:_,className:v,style:b,bodyClassName:C,bodyStyle:S,progressClassName:L,progressStyle:k,updateId:D,role:x,progress:N,rtl:E,toastId:I,deleteToast:M,isIn:R,isLoading:A,closeOnClick:O,theme:P}=e,F=(0,s.A)("Toastify__toast",`Toastify__toast-theme--${P}`,`Toastify__toast--${g}`,{"Toastify__toast--rtl":E},{"Toastify__toast--close-on-click":O}),B=a(v)?v({rtl:E,position:_,type:g,defaultClassName:F}):(0,s.A)(F,v),W=function(e){let{theme:t,type:i,isLoading:s,icon:o}=e,r=null;const l={theme:t,type:i};return!1===o||(a(o)?r=o({...l,isLoading:s}):(0,n.isValidElement)(o)?r=(0,n.cloneElement)(o,l):s?r=T.spinner():(e=>e in T)(i)&&(r=T[i](l))),r}(e),V=!!N||!c,H={closeToast:m,type:g,theme:P};let z=null;return!1===h||(z=a(h)?h(H):(0,n.isValidElement)(h)?(0,n.cloneElement)(h,H):function(e){let{closeToast:t,theme:i,ariaLabel:s="close"}=e;return n.createElement("button",{className:`Toastify__close-button Toastify__close-button--${i}`,type:"button",onClick:e=>{e.stopPropagation(),t(e)},"aria-label":s},n.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},n.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}(H)),n.createElement(f,{isIn:R,done:M,position:_,preventExitTransition:i,nodeRef:o,playToast:l},n.createElement("div",{id:I,onClick:u,"data-in":R,className:B,...r,style:b,ref:o},n.createElement("div",{...R&&{role:x},className:a(C)?C({type:g}):(0,s.A)("Toastify__toast-body",C),style:S},null!=W&&n.createElement("div",{className:(0,s.A)("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!A})},W),n.createElement("div",null,d)),z,n.createElement(y,{...D&&!V?{key:`pb-${D}`}:{},rtl:E,theme:P,delay:c,isRunning:t,isIn:R,closeToast:m,hide:p,type:g,style:k,className:L,controlledProgress:V,progress:N||0})))},A=function(e,t){return void 0===t&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},O=d(A("bounce",!0)),P=(d(A("slide",!0)),d(A("zoom")),d(A("flip")),{position:"top-right",transition:O,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"});function F(e){let t={...P,...e};const i=e.stacked,[o,r]=(0,n.useState)(!0),h=(0,n.useRef)(null),{getToastToRender:d,isToastActive:c,count:u}=C(t),{className:g,style:p,rtl:m,containerId:f}=t;function _(e){const t=(0,s.A)("Toastify__toast-container",`Toastify__toast-container--${e}`,{"Toastify__toast-container--rtl":m});return a(g)?g({position:e,rtl:m,defaultClassName:t}):(0,s.A)(t,l(g))}function v(){i&&(r(!0),E.play())}return I((()=>{if(i){var e;const i=h.current.querySelectorAll('[data-in="true"]'),n=12,s=null==(e=t.position)?void 0:e.includes("top");let r=0,a=0;Array.from(i).reverse().forEach(((e,t)=>{const i=e;i.classList.add("Toastify__toast--stacked"),t>0&&(i.dataset.collapsed=`${o}`),i.dataset.pos||(i.dataset.pos=s?"top":"bot");const l=r*(o?.2:1)+(o?0:n*t);i.style.setProperty("--y",`${s?l:-1*l}px`),i.style.setProperty("--g",`${n}`),i.style.setProperty("--s",""+(1-(o?a:0))),r+=i.offsetHeight,a+=.025}))}}),[o,u,i]),n.createElement("div",{ref:h,className:"Toastify",id:f,onMouseEnter:()=>{i&&(r(!1),E.pause())},onMouseLeave:v},d(((e,t)=>{const s=t.length?{...p}:{...p,pointerEvents:"none"};return n.createElement("div",{className:_(e),style:s,key:`container-${e}`},t.map((e=>{let{content:t,props:s}=e;return n.createElement(R,{...s,stacked:i,collapseAll:v,isIn:c(s.toastId,s.containerId),style:s.style,key:`toast-${s.key}`},t)})))})))}}}]); \ No newline at end of file diff --git a/assets/js/392.1d599ed1.js.LICENSE.txt b/assets/js/392.3c5c3de4.js.LICENSE.txt similarity index 100% rename from assets/js/392.1d599ed1.js.LICENSE.txt rename to assets/js/392.3c5c3de4.js.LICENSE.txt diff --git a/assets/js/runtime~main.063c6f45.js b/assets/js/runtime~main.08fae093.js similarity index 98% rename from assets/js/runtime~main.063c6f45.js rename to assets/js/runtime~main.08fae093.js index e43b9309..556308cd 100644 --- a/assets/js/runtime~main.063c6f45.js +++ b/assets/js/runtime~main.08fae093.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,d,r,c,t={},f={};function o(e){var a=f[e];if(void 0!==a)return a.exports;var d=f[e]={id:e,loaded:!1,exports:{}};return t[e].call(d.exports,d,d.exports,o),d.loaded=!0,d.exports}o.m=t,o.c=f,o.amdO={},e=[],o.O=(a,d,r,c)=>{if(!d){var t=1/0;for(i=0;i=c)&&Object.keys(o.O).every((e=>o.O[e](d[b])))?d.splice(b--,1):(f=!1,c0&&e[i-1][2]>c;i--)e[i]=e[i-1];e[i]=[d,r,c]},o.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return o.d(a,{a:a}),a},d=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var c=Object.create(null);o.r(c);var t={};a=a||[null,d({}),d([]),d(d)];for(var f=2&r&&e;"object"==typeof f&&!~a.indexOf(f);f=d(f))Object.getOwnPropertyNames(f).forEach((a=>t[a]=()=>e[a]));return t.default=()=>e,o.d(c,t),c},o.d=(e,a)=>{for(var d in a)o.o(a,d)&&!o.o(e,d)&&Object.defineProperty(e,d,{enumerable:!0,get:a[d]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((a,d)=>(o.f[d](e,a),a)),[])),o.u=e=>"assets/js/"+({98:"2f44bdd3",308:"4edc808e",405:"3507a63a",418:"784e1330",468:"747c2147",957:"c141421f",1011:"ea313555",1235:"a7456010",1338:"ff7078eb",1903:"acecf23e",2006:"394d4b1d",2138:"1a4e3797",2595:"f07f4d27",2634:"c4f5d8e4",2635:"47714f8a",2690:"9cfa9441",2857:"3021cf83",2886:"b04c3690",2986:"9730aa91",3030:"a22ca990",3319:"e0b7d15d",3365:"0ce74438",3397:"774fa26e",3866:"53a5c477",4127:"cbfe01fc",4212:"621db11d",4213:"8b2d04df",4983:"ea513665",5333:"61458faa",5471:"c8e3ded0",5588:"32d12821",5742:"aba21aa0",5954:"ef92cb51",5988:"a7d35adb",6009:"12c31f0d",6710:"f3d36445",6721:"51479cd3",7098:"a7bd4aaa",7472:"814f3328",7772:"45fb2b0f",8092:"4550517b",8401:"17896441",9046:"2eddd5e4",9048:"a94703ab",9420:"c88b7449",9428:"62ecf328",9647:"5e95c892",9733:"0c182d93",9800:"91710b65",9858:"36994c47"}[e]||e)+"."+{98:"9287b8de",308:"86ecc8f6",392:"1d599ed1",405:"15bebd04",416:"4e5e991f",418:"a4a641bf",468:"0952d5e6",957:"53e6d15b",1011:"9862950b",1235:"01357a74",1338:"5024bbe5",1903:"36cb178c",2006:"5ef49c8b",2138:"05cc0fcc",2237:"99313feb",2595:"5c0716b8",2634:"2358895b",2635:"97ce0e96",2690:"ac31fd07",2857:"0672469c",2886:"828f9b34",2986:"1b5d1ae1",3030:"05b6986c",3165:"857ddabe",3284:"1d893ae4",3319:"b23cd583",3365:"8a0651ab",3397:"e0752232",3866:"c15da186",4127:"626efd4a",4212:"b409201f",4213:"c9fb2be9",4839:"24be128f",4885:"1309bb41",4983:"70f788ed",5333:"908def28",5394:"1f77cce4",5471:"264f9957",5588:"304cd965",5742:"237dc0b2",5954:"0e7e086f",5988:"3fb6591a",6009:"af421f32",6710:"5c3fbb06",6721:"c1fc0621",7098:"6fa4ea55",7399:"6bb60d64",7472:"88d98029",7595:"ee2f7a3f",7772:"0c8634ef",8092:"9f8ca519",8401:"3e857c74",8913:"f1b36686",9046:"bdafdcd2",9048:"ae3bfb10",9420:"25ed7eb1",9428:"9d3c6996",9462:"936b92fe",9647:"685ff062",9733:"436c3168",9800:"79f50df0",9858:"495eb1b5"}[e]+".js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),r={},c="gmail-processor-docs:",o.l=(e,a,d,t)=>{if(r[e])r[e].push(a);else{var f,b;if(void 0!==d)for(var n=document.getElementsByTagName("script"),i=0;i{f.onerror=f.onload=null,clearTimeout(u);var c=r[e];if(delete r[e],f.parentNode&&f.parentNode.removeChild(f),c&&c.forEach((e=>e(d))),a)return a(d)},u=setTimeout(s.bind(null,void 0,{type:"timeout",target:f}),12e4);f.onerror=s.bind(null,f.onerror),f.onload=s.bind(null,f.onload),b&&document.head.appendChild(f)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),o.p="/gmail-processor/",o.gca=function(e){return e={17896441:"8401","2f44bdd3":"98","4edc808e":"308","3507a63a":"405","784e1330":"418","747c2147":"468",c141421f:"957",ea313555:"1011",a7456010:"1235",ff7078eb:"1338",acecf23e:"1903","394d4b1d":"2006","1a4e3797":"2138",f07f4d27:"2595",c4f5d8e4:"2634","47714f8a":"2635","9cfa9441":"2690","3021cf83":"2857",b04c3690:"2886","9730aa91":"2986",a22ca990:"3030",e0b7d15d:"3319","0ce74438":"3365","774fa26e":"3397","53a5c477":"3866",cbfe01fc:"4127","621db11d":"4212","8b2d04df":"4213",ea513665:"4983","61458faa":"5333",c8e3ded0:"5471","32d12821":"5588",aba21aa0:"5742",ef92cb51:"5954",a7d35adb:"5988","12c31f0d":"6009",f3d36445:"6710","51479cd3":"6721",a7bd4aaa:"7098","814f3328":"7472","45fb2b0f":"7772","4550517b":"8092","2eddd5e4":"9046",a94703ab:"9048",c88b7449:"9420","62ecf328":"9428","5e95c892":"9647","0c182d93":"9733","91710b65":"9800","36994c47":"9858"}[e]||e,o.p+o.u(e)},(()=>{var e={5354:0,1869:0};o.f.j=(a,d)=>{var r=o.o(e,a)?e[a]:void 0;if(0!==r)if(r)d.push(r[2]);else if(/^(1869|5354)$/.test(a))e[a]=0;else{var c=new Promise(((d,c)=>r=e[a]=[d,c]));d.push(r[2]=c);var t=o.p+o.u(a),f=new Error;o.l(t,(d=>{if(o.o(e,a)&&(0!==(r=e[a])&&(e[a]=void 0),r)){var c=d&&("load"===d.type?"missing":d.type),t=d&&d.target&&d.target.src;f.message="Loading chunk "+a+" failed.\n("+c+": "+t+")",f.name="ChunkLoadError",f.type=c,f.request=t,r[1](f)}}),"chunk-"+a,a)}},o.O.j=a=>0===e[a];var a=(a,d)=>{var r,c,t=d[0],f=d[1],b=d[2],n=0;if(t.some((a=>0!==e[a]))){for(r in f)o.o(f,r)&&(o.m[r]=f[r]);if(b)var i=b(o)}for(a&&a(d);n{"use strict";var e,a,d,r,c,t={},f={};function o(e){var a=f[e];if(void 0!==a)return a.exports;var d=f[e]={id:e,loaded:!1,exports:{}};return t[e].call(d.exports,d,d.exports,o),d.loaded=!0,d.exports}o.m=t,o.c=f,o.amdO={},e=[],o.O=(a,d,r,c)=>{if(!d){var t=1/0;for(i=0;i=c)&&Object.keys(o.O).every((e=>o.O[e](d[b])))?d.splice(b--,1):(f=!1,c0&&e[i-1][2]>c;i--)e[i]=e[i-1];e[i]=[d,r,c]},o.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return o.d(a,{a:a}),a},d=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,o.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var c=Object.create(null);o.r(c);var t={};a=a||[null,d({}),d([]),d(d)];for(var f=2&r&&e;"object"==typeof f&&!~a.indexOf(f);f=d(f))Object.getOwnPropertyNames(f).forEach((a=>t[a]=()=>e[a]));return t.default=()=>e,o.d(c,t),c},o.d=(e,a)=>{for(var d in a)o.o(a,d)&&!o.o(e,d)&&Object.defineProperty(e,d,{enumerable:!0,get:a[d]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((a,d)=>(o.f[d](e,a),a)),[])),o.u=e=>"assets/js/"+({98:"2f44bdd3",308:"4edc808e",405:"3507a63a",418:"784e1330",468:"747c2147",957:"c141421f",1011:"ea313555",1235:"a7456010",1338:"ff7078eb",1903:"acecf23e",2006:"394d4b1d",2138:"1a4e3797",2595:"f07f4d27",2634:"c4f5d8e4",2635:"47714f8a",2690:"9cfa9441",2857:"3021cf83",2886:"b04c3690",2986:"9730aa91",3030:"a22ca990",3319:"e0b7d15d",3365:"0ce74438",3397:"774fa26e",3866:"53a5c477",4127:"cbfe01fc",4212:"621db11d",4213:"8b2d04df",4983:"ea513665",5333:"61458faa",5471:"c8e3ded0",5588:"32d12821",5742:"aba21aa0",5954:"ef92cb51",5988:"a7d35adb",6009:"12c31f0d",6710:"f3d36445",6721:"51479cd3",7098:"a7bd4aaa",7472:"814f3328",7772:"45fb2b0f",8092:"4550517b",8401:"17896441",9046:"2eddd5e4",9048:"a94703ab",9420:"c88b7449",9428:"62ecf328",9647:"5e95c892",9733:"0c182d93",9800:"91710b65",9858:"36994c47"}[e]||e)+"."+{98:"9287b8de",308:"86ecc8f6",392:"3c5c3de4",405:"15bebd04",416:"4e5e991f",418:"a4a641bf",468:"0952d5e6",957:"53e6d15b",1011:"9862950b",1235:"01357a74",1338:"5024bbe5",1903:"36cb178c",2006:"5ef49c8b",2138:"05cc0fcc",2237:"99313feb",2595:"5c0716b8",2634:"2358895b",2635:"97ce0e96",2690:"ac31fd07",2857:"0672469c",2886:"828f9b34",2986:"1b5d1ae1",3030:"05b6986c",3165:"857ddabe",3284:"1d893ae4",3319:"b23cd583",3365:"8a0651ab",3397:"e0752232",3866:"c15da186",4127:"626efd4a",4212:"b409201f",4213:"c9fb2be9",4839:"24be128f",4885:"1309bb41",4983:"70f788ed",5333:"908def28",5394:"1f77cce4",5471:"264f9957",5588:"304cd965",5742:"237dc0b2",5954:"0e7e086f",5988:"3fb6591a",6009:"af421f32",6710:"5c3fbb06",6721:"c1fc0621",7098:"6fa4ea55",7399:"6bb60d64",7472:"88d98029",7595:"ee2f7a3f",7772:"0c8634ef",8092:"9f8ca519",8401:"3e857c74",8913:"f1b36686",9046:"bdafdcd2",9048:"ae3bfb10",9420:"25ed7eb1",9428:"9d3c6996",9462:"936b92fe",9647:"685ff062",9733:"436c3168",9800:"79f50df0",9858:"495eb1b5"}[e]+".js",o.miniCssF=e=>{},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),r={},c="gmail-processor-docs:",o.l=(e,a,d,t)=>{if(r[e])r[e].push(a);else{var f,b;if(void 0!==d)for(var n=document.getElementsByTagName("script"),i=0;i{f.onerror=f.onload=null,clearTimeout(u);var c=r[e];if(delete r[e],f.parentNode&&f.parentNode.removeChild(f),c&&c.forEach((e=>e(d))),a)return a(d)},u=setTimeout(s.bind(null,void 0,{type:"timeout",target:f}),12e4);f.onerror=s.bind(null,f.onerror),f.onload=s.bind(null,f.onload),b&&document.head.appendChild(f)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),o.p="/gmail-processor/",o.gca=function(e){return e={17896441:"8401","2f44bdd3":"98","4edc808e":"308","3507a63a":"405","784e1330":"418","747c2147":"468",c141421f:"957",ea313555:"1011",a7456010:"1235",ff7078eb:"1338",acecf23e:"1903","394d4b1d":"2006","1a4e3797":"2138",f07f4d27:"2595",c4f5d8e4:"2634","47714f8a":"2635","9cfa9441":"2690","3021cf83":"2857",b04c3690:"2886","9730aa91":"2986",a22ca990:"3030",e0b7d15d:"3319","0ce74438":"3365","774fa26e":"3397","53a5c477":"3866",cbfe01fc:"4127","621db11d":"4212","8b2d04df":"4213",ea513665:"4983","61458faa":"5333",c8e3ded0:"5471","32d12821":"5588",aba21aa0:"5742",ef92cb51:"5954",a7d35adb:"5988","12c31f0d":"6009",f3d36445:"6710","51479cd3":"6721",a7bd4aaa:"7098","814f3328":"7472","45fb2b0f":"7772","4550517b":"8092","2eddd5e4":"9046",a94703ab:"9048",c88b7449:"9420","62ecf328":"9428","5e95c892":"9647","0c182d93":"9733","91710b65":"9800","36994c47":"9858"}[e]||e,o.p+o.u(e)},(()=>{var e={5354:0,1869:0};o.f.j=(a,d)=>{var r=o.o(e,a)?e[a]:void 0;if(0!==r)if(r)d.push(r[2]);else if(/^(1869|5354)$/.test(a))e[a]=0;else{var c=new Promise(((d,c)=>r=e[a]=[d,c]));d.push(r[2]=c);var t=o.p+o.u(a),f=new Error;o.l(t,(d=>{if(o.o(e,a)&&(0!==(r=e[a])&&(e[a]=void 0),r)){var c=d&&("load"===d.type?"missing":d.type),t=d&&d.target&&d.target.src;f.message="Loading chunk "+a+" failed.\n("+c+": "+t+")",f.name="ChunkLoadError",f.type=c,f.request=t,r[1](f)}}),"chunk-"+a,a)}},o.O.j=a=>0===e[a];var a=(a,d)=>{var r,c,t=d[0],f=d[1],b=d[2],n=0;if(t.some((a=>0!==e[a]))){for(r in f)o.o(f,r)&&(o.m[r]=f[r]);if(b)var i=b(o)}for(a&&a(d);n Authors | Gmail Processor - + diff --git a/docs/community/changelog/index.html b/docs/community/changelog/index.html index 50ea5758..d457ac93 100644 --- a/docs/community/changelog/index.html +++ b/docs/community/changelog/index.html @@ -4,7 +4,7 @@ Changelog | Gmail Processor - + diff --git a/docs/community/code-of-conduct/index.html b/docs/community/code-of-conduct/index.html index d52c8fe2..25875c2e 100644 --- a/docs/community/code-of-conduct/index.html +++ b/docs/community/code-of-conduct/index.html @@ -4,7 +4,7 @@ Code of Conduct | Gmail Processor - + diff --git a/docs/community/contributing/index.html b/docs/community/contributing/index.html index 2bba8e9a..5de8e158 100644 --- a/docs/community/contributing/index.html +++ b/docs/community/contributing/index.html @@ -4,7 +4,7 @@ Contributing | Gmail Processor - + diff --git a/docs/community/index.html b/docs/community/index.html index 4472a1d0..682a971f 100644 --- a/docs/community/index.html +++ b/docs/community/index.html @@ -4,7 +4,7 @@ Community | Gmail Processor - + diff --git a/docs/development/devbox/index.html b/docs/development/devbox/index.html index 2b9986b4..7314f872 100644 --- a/docs/development/devbox/index.html +++ b/docs/development/devbox/index.html @@ -4,7 +4,7 @@ Devbox Environment | Gmail Processor - + diff --git a/docs/development/index.html b/docs/development/index.html index d259b990..91d71e6e 100644 --- a/docs/development/index.html +++ b/docs/development/index.html @@ -4,7 +4,7 @@ Development | Gmail Processor - + diff --git a/docs/examples/actions/actionAttachmentExtractText/index.html b/docs/examples/actions/actionAttachmentExtractText/index.html index 6523a520..a74d0600 100644 --- a/docs/examples/actions/actionAttachmentExtractText/index.html +++ b/docs/examples/actions/actionAttachmentExtractText/index.html @@ -4,7 +4,7 @@ Extract Attachment Text | Gmail Processor - + diff --git a/docs/examples/actions/actionExport/index.html b/docs/examples/actions/actionExport/index.html index a31f3211..75f8032d 100644 --- a/docs/examples/actions/actionExport/index.html +++ b/docs/examples/actions/actionExport/index.html @@ -4,7 +4,7 @@ Export Thread/Message | Gmail Processor - + diff --git a/docs/examples/actions/actionThreadRemoveLabel/index.html b/docs/examples/actions/actionThreadRemoveLabel/index.html index f4287b2d..09f2dc3e 100644 --- a/docs/examples/actions/actionThreadRemoveLabel/index.html +++ b/docs/examples/actions/actionThreadRemoveLabel/index.html @@ -4,7 +4,7 @@ Remove Thread Label | Gmail Processor - + diff --git a/docs/examples/actions/index.html b/docs/examples/actions/index.html index 98b4b2a1..e8f3bf88 100644 --- a/docs/examples/actions/index.html +++ b/docs/examples/actions/index.html @@ -4,7 +4,7 @@ Actions | Gmail Processor - + diff --git a/docs/examples/advanced/customActions/index.html b/docs/examples/advanced/customActions/index.html index 633d69ed..789f8240 100644 --- a/docs/examples/advanced/customActions/index.html +++ b/docs/examples/advanced/customActions/index.html @@ -4,7 +4,7 @@ Custom Actions | Gmail Processor - + diff --git a/docs/examples/advanced/index.html b/docs/examples/advanced/index.html index 1dc6fdc4..b67c563b 100644 --- a/docs/examples/advanced/index.html +++ b/docs/examples/advanced/index.html @@ -4,7 +4,7 @@ Advanced | Gmail Processor - + diff --git a/docs/examples/advanced/logSheetLogging/index.html b/docs/examples/advanced/logSheetLogging/index.html index 05abdab7..fbca689b 100644 --- a/docs/examples/advanced/logSheetLogging/index.html +++ b/docs/examples/advanced/logSheetLogging/index.html @@ -4,7 +4,7 @@ LogSheet Logging | Gmail Processor - + diff --git a/docs/examples/advanced/regularExpressions/index.html b/docs/examples/advanced/regularExpressions/index.html index 324ee7b1..278605fe 100644 --- a/docs/examples/advanced/regularExpressions/index.html +++ b/docs/examples/advanced/regularExpressions/index.html @@ -4,7 +4,7 @@ Regular Expressions | Gmail Processor - + diff --git a/docs/examples/basics/index.html b/docs/examples/basics/index.html index 36646b47..d9de755c 100644 --- a/docs/examples/basics/index.html +++ b/docs/examples/basics/index.html @@ -4,7 +4,7 @@ Basics | Gmail Processor - + diff --git a/docs/examples/basics/simple/index.html b/docs/examples/basics/simple/index.html index 09aa5792..f34c120f 100644 --- a/docs/examples/basics/simple/index.html +++ b/docs/examples/basics/simple/index.html @@ -4,7 +4,7 @@ Store Attachment | Gmail Processor - + diff --git a/docs/examples/features/convertToGoogle/index.html b/docs/examples/features/convertToGoogle/index.html index ea3ffb31..21474c53 100644 --- a/docs/examples/features/convertToGoogle/index.html +++ b/docs/examples/features/convertToGoogle/index.html @@ -4,7 +4,7 @@ Convert to Google | Gmail Processor - + diff --git a/docs/examples/features/index.html b/docs/examples/features/index.html index 10dbfbef..fa279292 100644 --- a/docs/examples/features/index.html +++ b/docs/examples/features/index.html @@ -4,7 +4,7 @@ Features | Gmail Processor - + diff --git a/docs/examples/index.html b/docs/examples/index.html index f3bce333..e464e662 100644 --- a/docs/examples/index.html +++ b/docs/examples/index.html @@ -4,7 +4,7 @@ Examples | Gmail Processor - + diff --git a/docs/examples/migrations/index.html b/docs/examples/migrations/index.html index ea369dbb..1ea73f79 100644 --- a/docs/examples/migrations/index.html +++ b/docs/examples/migrations/index.html @@ -4,7 +4,7 @@ GMail2GDrive Migration | Gmail Processor - + diff --git a/docs/examples/migrations/migrationAdvanced/index.html b/docs/examples/migrations/migrationAdvanced/index.html index 078b099e..345c7cbb 100644 --- a/docs/examples/migrations/migrationAdvanced/index.html +++ b/docs/examples/migrations/migrationAdvanced/index.html @@ -4,7 +4,7 @@ Advanced Migration | Gmail Processor - + diff --git a/docs/examples/migrations/migrationMin/index.html b/docs/examples/migrations/migrationMin/index.html index fb7cb58a..083a2b83 100644 --- a/docs/examples/migrations/migrationMin/index.html +++ b/docs/examples/migrations/migrationMin/index.html @@ -4,7 +4,7 @@ Minimal Migration | Gmail Processor - + diff --git a/docs/examples/regressions/index.html b/docs/examples/regressions/index.html index d0cde63b..69320f75 100644 --- a/docs/examples/regressions/index.html +++ b/docs/examples/regressions/index.html @@ -4,7 +4,7 @@ Regressions | Gmail Processor - + diff --git a/docs/examples/regressions/issue301/index.html b/docs/examples/regressions/issue301/index.html index eee37eb8..419dab40 100644 --- a/docs/examples/regressions/issue301/index.html +++ b/docs/examples/regressions/issue301/index.html @@ -4,7 +4,7 @@ getBlob Issue | Gmail Processor - + diff --git a/docs/faqs/index.html b/docs/faqs/index.html index 852c95ad..ef1568d9 100644 --- a/docs/faqs/index.html +++ b/docs/faqs/index.html @@ -4,7 +4,7 @@ FAQs | Gmail Processor - + diff --git a/docs/getting-started/index.html b/docs/getting-started/index.html index 09e11c76..f5a32835 100644 --- a/docs/getting-started/index.html +++ b/docs/getting-started/index.html @@ -4,7 +4,7 @@ Getting Started | Gmail Processor - + diff --git a/docs/index.html b/docs/index.html index fb5bbcf4..ff12cd33 100644 --- a/docs/index.html +++ b/docs/index.html @@ -4,7 +4,7 @@ About Gmail Processor | Gmail Processor - + diff --git a/docs/migrating/index.html b/docs/migrating/index.html index f43394a3..f6a3715c 100644 --- a/docs/migrating/index.html +++ b/docs/migrating/index.html @@ -4,7 +4,7 @@ Migrating from Gmail2GDrive | Gmail Processor - + diff --git a/docs/reference/actions/index.html b/docs/reference/actions/index.html index 19da41f9..5ac10ae3 100644 --- a/docs/reference/actions/index.html +++ b/docs/reference/actions/index.html @@ -4,7 +4,7 @@ Actions | Gmail Processor - + diff --git a/docs/reference/config-schema/index.html b/docs/reference/config-schema/index.html index 6e41a696..40aadece 100644 --- a/docs/reference/config-schema/index.html +++ b/docs/reference/config-schema/index.html @@ -4,7 +4,7 @@ Config Schema | Gmail Processor - + diff --git a/docs/reference/enum-types/index.html b/docs/reference/enum-types/index.html index 48c2b3fa..6fc80163 100644 --- a/docs/reference/enum-types/index.html +++ b/docs/reference/enum-types/index.html @@ -4,7 +4,7 @@ Enum Types | Gmail Processor - + diff --git a/docs/reference/index.html b/docs/reference/index.html index bf6756e1..2b04fbac 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -4,7 +4,7 @@ Reference | Gmail Processor - + diff --git a/docs/reference/logging/index.html b/docs/reference/logging/index.html index 29aea861..b5902f49 100644 --- a/docs/reference/logging/index.html +++ b/docs/reference/logging/index.html @@ -4,7 +4,7 @@ Logging | Gmail Processor - + diff --git a/docs/reference/placeholder/index.html b/docs/reference/placeholder/index.html index 3c1ebfb6..7341630d 100644 --- a/docs/reference/placeholder/index.html +++ b/docs/reference/placeholder/index.html @@ -4,7 +4,7 @@ Placeholder | Gmail Processor - + diff --git a/index.html b/index.html index 848d07be..043b3e23 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ Gmail Processor | Gmail Processor - + diff --git a/playground/index.html b/playground/index.html index c2a88405..fe30be81 100644 --- a/playground/index.html +++ b/playground/index.html @@ -4,7 +4,7 @@ Playground | Gmail Processor - + diff --git a/search/index.html b/search/index.html index 1eb3b4b0..245bcd2b 100644 --- a/search/index.html +++ b/search/index.html @@ -4,7 +4,7 @@ Search the documentation | Gmail Processor - +