reactive-vscode 1.0.0-beta.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,902 +1,808 @@
1
- import { shallowRef as r, effectScope as Q, computed as d, toValue as v, getCurrentScope as z, isRef as C, watchEffect as w, unref as M, watch as D, onScopeDispose as L, shallowReactive as G, readonly as J, toRaw as X, ref as F } from "@reactive-vscode/reactivity";
1
+ import { computed as e, effectScope as t, getCurrentScope as n, isRef as r, onScopeDispose as i, readonly as a, ref as o, shallowReactive as s, shallowRef as c, toRaw as l, toValue as u, unref as d, watch as f, watchEffect as p } from "@reactive-vscode/reactivity";
2
+ import { ColorThemeKind as m, EventEmitter as ee, Uri as te, chat as ne, commands as h, debug as g, env as _, extensions as v, l10n as y, lm as b, tasks as x, window as S, workspace as C } from "vscode";
2
3
  export * from "@reactive-vscode/reactivity";
3
- import { workspace as T, env as x, window as f, Uri as Y, debug as W, extensions as A, chat as Z, commands as S, EventEmitter as q, ColorThemeKind as O, l10n as N, lm as V, tasks as R } from "vscode";
4
- const B = [];
5
- function _(e) {
6
- E.value ? e(E.value) : B.push(e);
7
- }
8
- const $ = [];
9
- function ve(e) {
10
- $.push(e);
11
- }
12
- const E = r(null), k = Q();
13
- function de(e) {
14
- return {
15
- activate: (t) => (E.value = t, k.run(() => (B.forEach((n) => n(t)), e(t)))),
16
- deactivate: async () => {
17
- await Promise.allSettled($.map((t) => t())), k.stop();
18
- }
19
- };
20
- }
21
- function fe(e, t) {
22
- const n = !e, o = r(null);
23
- function s() {
24
- return o.value = T.getConfiguration(e ?? void 0, t);
25
- }
26
- function i() {
27
- if (!E.value)
28
- throw new Error("Cannot access config before extension is activated.");
29
- return o.value ? o.value : s();
30
- }
31
- function u(c) {
32
- return new Proxy({}, {
33
- get(p, l) {
34
- const g = i();
35
- if (typeof l != "string")
36
- throw new TypeError("Symbol keys are not supported in defineConfig proxy.");
37
- if (c === "" && ["get", "has", "inspect", "update"].includes(l))
38
- return Reflect.get(g, l).bind(g);
39
- const m = g.get(c + l);
40
- if (m === void 0)
41
- throw new Error(`Configuration key "${e ? `${e}.` : ""}${c + l}" is not defined.`);
42
- return typeof m != "object" || m === null || Array.isArray(m) ? m : u(`${c}${l}.`);
43
- },
44
- set(p, l, g) {
45
- const m = i();
46
- if (typeof l != "string")
47
- throw new TypeError("Symbol keys are not supported in defineConfig proxy.");
48
- return m.update(c + l, g), !0;
49
- },
50
- apply: P,
51
- construct: P,
52
- defineProperty(p, l, g) {
53
- const m = i();
54
- return Reflect.defineProperty(m, l, g);
55
- },
56
- deleteProperty(p, l) {
57
- const g = i();
58
- return Reflect.deleteProperty(g, l);
59
- },
60
- getOwnPropertyDescriptor(p, l) {
61
- const g = i();
62
- return Reflect.getOwnPropertyDescriptor(g, l);
63
- },
64
- getPrototypeOf(p) {
65
- const l = i();
66
- return Reflect.getPrototypeOf(l);
67
- },
68
- has(p, l) {
69
- const g = i();
70
- return Reflect.has(g, l);
71
- },
72
- isExtensible(p) {
73
- const l = i();
74
- return Reflect.isExtensible(l);
75
- },
76
- ownKeys(p) {
77
- const l = i();
78
- return Reflect.ownKeys(l);
79
- },
80
- preventExtensions: P,
81
- setPrototypeOf: P
82
- });
83
- }
84
- return _(() => {
85
- a(T.onDidChangeConfiguration((c) => {
86
- (n || c.affectsConfiguration(e, t ?? void 0)) && s();
87
- }));
88
- }), u("");
89
- }
90
- function P() {
91
- throw new Error("Not supported");
92
- }
93
- const ee = [
94
- "append",
95
- "appendLine",
96
- "replace",
97
- "clear",
98
- "show",
99
- "hide",
100
- "trace",
101
- "debug",
102
- "info",
103
- "warn",
104
- "error"
4
+ //#region src/utils/onActivate.ts
5
+ var w = [];
6
+ function T(e) {
7
+ D.value ? e(D.value) : w.push(e);
8
+ }
9
+ //#endregion
10
+ //#region src/utils/onDeactivate.ts
11
+ var E = [];
12
+ function re(e) {
13
+ E.push(e);
14
+ }
15
+ //#endregion
16
+ //#region src/utils/defineExtension.ts
17
+ var D = c(null), O = t();
18
+ function ie(e) {
19
+ return {
20
+ activate: (t) => (D.value = t, O.run(() => (w.forEach((e) => e(t)), e(t)))),
21
+ deactivate: async () => {
22
+ await Promise.allSettled(E.map((e) => e())), O.stop();
23
+ }
24
+ };
25
+ }
26
+ //#endregion
27
+ //#region src/utils/defineConfig.ts
28
+ function ae(e, t) {
29
+ let n = !e, r = c(null);
30
+ function i() {
31
+ return r.value = C.getConfiguration(e ?? void 0, t);
32
+ }
33
+ function a() {
34
+ if (!D.value) throw Error("Cannot access config before extension is activated.");
35
+ return r.value ? r.value : i();
36
+ }
37
+ function o(t) {
38
+ return new Proxy({}, {
39
+ get(n, r) {
40
+ let i = a();
41
+ if (typeof r != "string") throw TypeError("Symbol keys are not supported in defineConfig proxy.");
42
+ if (t === "" && [
43
+ "get",
44
+ "has",
45
+ "inspect",
46
+ "update"
47
+ ].includes(r)) return Reflect.get(i, r).bind(i);
48
+ let s = i.get(t + r);
49
+ if (s === void 0) throw Error(`Configuration key "${e ? `${e}.` : ""}${t + r}" is not defined.`);
50
+ return typeof s != "object" || !s || Array.isArray(s) ? s : o(`${t}${r}.`);
51
+ },
52
+ set(e, n, r) {
53
+ let i = a();
54
+ if (typeof n != "string") throw TypeError("Symbol keys are not supported in defineConfig proxy.");
55
+ return i.update(t + n, r), !0;
56
+ },
57
+ apply: k,
58
+ construct: k,
59
+ defineProperty(e, t, n) {
60
+ let r = a();
61
+ return Reflect.defineProperty(r, t, n);
62
+ },
63
+ deleteProperty(e, t) {
64
+ let n = a();
65
+ return Reflect.deleteProperty(n, t);
66
+ },
67
+ getOwnPropertyDescriptor(e, t) {
68
+ let n = a();
69
+ return Reflect.getOwnPropertyDescriptor(n, t);
70
+ },
71
+ getPrototypeOf(e) {
72
+ let t = a();
73
+ return Reflect.getPrototypeOf(t);
74
+ },
75
+ has(e, t) {
76
+ let n = a();
77
+ return Reflect.has(n, t);
78
+ },
79
+ isExtensible(e) {
80
+ let t = a();
81
+ return Reflect.isExtensible(t);
82
+ },
83
+ ownKeys(e) {
84
+ let t = a();
85
+ return Reflect.ownKeys(t);
86
+ },
87
+ preventExtensions: k,
88
+ setPrototypeOf: k
89
+ });
90
+ }
91
+ return T(() => {
92
+ M(C.onDidChangeConfiguration((r) => {
93
+ (n || r.affectsConfiguration(e, t ?? void 0)) && i();
94
+ }));
95
+ }), o("");
96
+ }
97
+ function k() {
98
+ throw Error("Not supported");
99
+ }
100
+ //#endregion
101
+ //#region src/utils/defineLogger.ts
102
+ var A = [
103
+ "append",
104
+ "appendLine",
105
+ "replace",
106
+ "clear",
107
+ "show",
108
+ "hide",
109
+ "trace",
110
+ "debug",
111
+ "info",
112
+ "warn",
113
+ "error"
105
114
  ];
106
- function ge(e) {
107
- const t = r(null), n = r(x.logLevel), o = [];
108
- _(() => {
109
- const i = t.value = a(f.createOutputChannel(e, { log: !0 }));
110
- n.value = i.logLevel, a(i.onDidChangeLogLevel((u) => {
111
- n.value = u;
112
- })), o.forEach((u) => u());
113
- });
114
- const s = {};
115
- for (const i of ee)
116
- s[i] = (...u) => {
117
- t.value ? t.value[i](...u) : o.push(() => t.value[i](...u));
118
- };
119
- return {
120
- logger: d(() => t.value),
121
- ...s
122
- };
123
- }
124
- function h(e) {
125
- let t = !1, n = !1, o;
126
- return () => {
127
- if (!n) {
128
- if (t)
129
- throw new Error("Cannot call a singleton composable recursively.");
130
- try {
131
- t = !0, o = k.run(e);
132
- } finally {
133
- t = !1, n = !0;
134
- }
135
- }
136
- return o;
137
- };
138
- }
139
- function pe(e) {
140
- return d(() => Y.joinPath(E.value.extensionUri, v(e)));
141
- }
142
- function a(e) {
143
- return (z() ?? k).cleanups.push(e.dispose.bind(e)), e;
144
- }
145
- const te = h(() => {
146
- const e = r(f.activeColorTheme);
147
- return a(f.onDidChangeActiveColorTheme((t) => {
148
- e.value = t;
149
- })), e;
150
- }), he = h(() => {
151
- const e = r(W.activeDebugSession);
152
- return a(W.onDidChangeActiveDebugSession((t) => {
153
- e.value = t;
154
- })), d(() => e.value);
155
- }), me = h(() => {
156
- const e = r(f.activeNotebookEditor);
157
- return a(f.onDidChangeActiveNotebookEditor((t) => {
158
- e.value = t;
159
- })), e;
160
- }), Ce = h(() => {
161
- const e = r(f.activeTerminal);
162
- return a(f.onDidChangeActiveTerminal((t) => {
163
- e.value = t;
164
- })), e;
165
- }), we = h(() => {
166
- const e = r(f.activeTextEditor);
167
- return a(f.onDidChangeActiveTextEditor((t) => {
168
- e.value = t;
169
- })), d(() => e.value);
170
- }), De = h(() => {
171
- const e = r(A.all);
172
- return a(A.onDidChange(() => {
173
- e.value = A.all;
174
- })), d(() => e.value);
115
+ function oe(t) {
116
+ let n = c(null), r = c(_.logLevel), i = [];
117
+ T(() => {
118
+ let e = n.value = M(S.createOutputChannel(t, { log: !0 }));
119
+ r.value = e.logLevel, M(e.onDidChangeLogLevel((e) => {
120
+ r.value = e;
121
+ })), i.forEach((e) => e());
122
+ });
123
+ let a = {};
124
+ for (let e of A) a[e] = (...t) => {
125
+ n.value ? n.value[e](...t) : i.push(() => n.value[e](...t));
126
+ };
127
+ return {
128
+ logger: e(() => n.value),
129
+ logLevel: e(() => r.value),
130
+ ...a
131
+ };
132
+ }
133
+ //#endregion
134
+ //#region src/utils/defineService.ts
135
+ function j(e) {
136
+ let t = !1, n = !1, r;
137
+ return () => {
138
+ if (!n) {
139
+ if (t) throw Error("Cannot call a singleton composable recursively.");
140
+ try {
141
+ t = !0, r = O.run(e);
142
+ } finally {
143
+ t = !1, n = !0;
144
+ }
145
+ }
146
+ return r;
147
+ };
148
+ }
149
+ //#endregion
150
+ //#region src/composables/useAbsoluteUri.ts
151
+ function se(t) {
152
+ return e(() => te.joinPath(D.value.extensionUri, u(t)));
153
+ }
154
+ //#endregion
155
+ //#region src/composables/useDisposable.ts
156
+ function M(e) {
157
+ return (n() ?? O).cleanups.push(e.dispose.bind(e)), e;
158
+ }
159
+ //#endregion
160
+ //#region src/composables/useActiveColorTheme.ts
161
+ var N = j(() => {
162
+ let e = c(S.activeColorTheme);
163
+ return M(S.onDidChangeActiveColorTheme((t) => {
164
+ e.value = t;
165
+ })), e;
166
+ }), ce = j(() => {
167
+ let t = c(g.activeDebugSession);
168
+ return M(g.onDidChangeActiveDebugSession((e) => {
169
+ t.value = e;
170
+ })), e(() => t.value);
171
+ }), le = j(() => {
172
+ let e = c(S.activeNotebookEditor);
173
+ return M(S.onDidChangeActiveNotebookEditor((t) => {
174
+ e.value = t;
175
+ })), e;
176
+ }), ue = j(() => {
177
+ let e = c(S.activeTerminal);
178
+ return M(S.onDidChangeActiveTerminal((t) => {
179
+ e.value = t;
180
+ })), e;
181
+ }), de = j(() => {
182
+ let t = c(S.activeTextEditor);
183
+ return M(S.onDidChangeActiveTextEditor((e) => {
184
+ t.value = e;
185
+ })), e(() => t.value);
186
+ }), fe = j(() => {
187
+ let t = c(v.all);
188
+ return M(v.onDidChange(() => {
189
+ t.value = v.all;
190
+ })), e(() => t.value);
175
191
  });
176
- function b(e, t, n) {
177
- if (C(e) || typeof e == "function") {
178
- w(() => {
179
- const o = v(e);
180
- o != null && b(o, t, n);
181
- });
182
- return;
183
- }
184
- for (const o of n) {
185
- const s = t[o];
186
- s != null && e[o](s);
187
- }
188
- }
189
- function y(e, t, n) {
190
- for (const o of n) {
191
- const s = t[o];
192
- s !== void 0 && w(() => {
193
- const i = v(e);
194
- i != null && (i[o] = v(s));
195
- });
196
- }
197
- }
198
- function be(e, t, n = {}) {
199
- const o = a(Z.createChatParticipant(e, M(t)));
200
- return y(o, n, [
201
- "iconPath",
202
- "followupProvider"
203
- ]), b(o, n, [
204
- "onDidReceiveFeedback"
205
- ]), C(t) && D(t, (s) => {
206
- o.requestHandler = s;
207
- }), o;
208
- }
209
- function ne(e, t) {
210
- C(t) ? w((n) => {
211
- if (t.value) {
212
- const o = S.registerCommand(e, t.value);
213
- n(() => o.dispose());
214
- }
215
- }) : t && a(S.registerCommand(e, t));
216
- }
217
- function ye(e) {
218
- for (const [t, n] of Object.entries(e))
219
- ne(t, n);
220
- }
221
- function Te(e) {
222
- const t = r(v(e)?.getText());
223
- return (C(e) || typeof e == "function") && D(e, (n) => {
224
- t.value = n?.getText();
225
- }), a(T.onDidChangeTextDocument((n) => {
226
- n.document === v(e) && (t.value = n.document.getText());
227
- })), t;
228
- }
229
- function Ee(e, t, n, o = {}) {
230
- let s;
231
- const i = d(() => {
232
- s?.dispose(), s = void 0;
233
- const c = v(t);
234
- if ("key" in c)
235
- return c;
236
- const p = f.createTextEditorDecorationType(c);
237
- return s = p, p;
238
- });
239
- L(() => s?.dispose());
240
- const u = async () => {
241
- const c = v(e);
242
- c && c.setDecorations(
243
- i.value,
244
- typeof n == "function" ? await n(c) : M(n)
245
- );
246
- };
247
- return (o.watchDocumentChange ?? !0) && a(T.onDidChangeTextDocument(async (c) => {
248
- v(e)?.document === c.document && await u();
249
- })), (o.immediate ?? !0) && u(), {
250
- /**
251
- * Manually trigger the decoration update.
252
- */
253
- update: u
254
- };
255
- }
256
- const xe = h(() => {
257
- const e = r(x.shell);
258
- return a(x.onDidChangeShell((t) => {
259
- e.value = t;
260
- })), d(() => e.value);
192
+ //#endregion
193
+ //#region src/composables/useReactiveEvents.ts
194
+ function P(e, t, n) {
195
+ if (r(e) || typeof e == "function") {
196
+ p(() => {
197
+ let r = u(e);
198
+ r != null && P(r, t, n);
199
+ });
200
+ return;
201
+ }
202
+ for (let r of n) {
203
+ let n = t[r];
204
+ n != null && e[r](n);
205
+ }
206
+ }
207
+ //#endregion
208
+ //#region src/composables/useReactiveOptions.ts
209
+ function F(e, t, n) {
210
+ for (let r of n) {
211
+ let n = t[r];
212
+ n !== void 0 && p(() => {
213
+ let t = u(e);
214
+ t != null && (t[r] = u(n));
215
+ });
216
+ }
217
+ }
218
+ //#endregion
219
+ //#region src/composables/useChatParticipant.ts
220
+ function I(e, t, n = {}) {
221
+ let i = M(ne.createChatParticipant(e, d(t)));
222
+ return F(i, n, ["iconPath", "followupProvider"]), P(i, n, ["onDidReceiveFeedback"]), r(t) && f(t, (e) => {
223
+ i.requestHandler = e;
224
+ }), i;
225
+ }
226
+ //#endregion
227
+ //#region src/composables/useCommand.ts
228
+ function L(e, t) {
229
+ r(t) ? p((n) => {
230
+ if (t.value) {
231
+ let r = h.registerCommand(e, t.value);
232
+ n(() => r.dispose());
233
+ }
234
+ }) : t && M(h.registerCommand(e, t));
235
+ }
236
+ //#endregion
237
+ //#region src/composables/useCommands.ts
238
+ function R(e) {
239
+ for (let [t, n] of Object.entries(e)) L(t, n);
240
+ }
241
+ //#endregion
242
+ //#region src/composables/useDocumentText.ts
243
+ function z(e) {
244
+ let t = c(u(e)?.getText());
245
+ return (r(e) || typeof e == "function") && f(e, (e) => {
246
+ t.value = e?.getText();
247
+ }), M(C.onDidChangeTextDocument((n) => {
248
+ n.document === u(e) && (t.value = n.document.getText());
249
+ })), t;
250
+ }
251
+ //#endregion
252
+ //#region src/composables/useEditorDecorations.ts
253
+ function B(t, n, r, a = {}) {
254
+ let o, s = e(() => {
255
+ o?.dispose(), o = void 0;
256
+ let e = u(n);
257
+ if ("key" in e) return e;
258
+ let t = S.createTextEditorDecorationType(e);
259
+ return o = t, t;
260
+ });
261
+ i(() => o?.dispose());
262
+ let c = async () => {
263
+ let e = u(t);
264
+ e && e.setDecorations(s.value, typeof r == "function" ? await r(e) : d(r));
265
+ };
266
+ return (a.watchDocumentChange ?? !0) && M(C.onDidChangeTextDocument(async (e) => {
267
+ u(t)?.document === e.document && await c();
268
+ })), (a.immediate ?? !0) && c(), { update: c };
269
+ }
270
+ //#endregion
271
+ //#region src/composables/useEnvShell.ts
272
+ var V = j(() => {
273
+ let t = c(_.shell);
274
+ return M(_.onDidChangeShell((e) => {
275
+ t.value = e;
276
+ })), e(() => t.value);
261
277
  });
262
- function oe(e, t) {
263
- const n = (o, s, i) => a(e(o, s, i));
264
- return t?.forEach((o) => n(o)), n;
265
- }
266
- function I(e, t = []) {
267
- const n = Array.isArray(e) ? e : t ?? [], o = a(Array.isArray(e) || e == null ? new q() : e), s = oe(o.event, n);
268
- return {
269
- emitter: o,
270
- event: s,
271
- fire: o.fire.bind(o)
272
- };
273
- }
274
- function Se(e) {
275
- const t = E.value.secrets, n = r(null);
276
- t.get(e).then((u) => {
277
- n.value = u;
278
- }), a(t.onDidChange(async (u) => {
279
- u.key === e && (n.value = await t.get(e));
280
- }));
281
- const o = async (u) => {
282
- n.value = u, await t.store(e, u);
283
- }, s = async () => {
284
- n.value = void 0, await t.delete(e);
285
- }, i = d({
286
- get() {
287
- return n.value;
288
- },
289
- set(u) {
290
- u === void 0 ? s() : o(u);
291
- }
292
- });
293
- return i.set = o, i.remove = s, i;
294
- }
295
- function Re(e, t = {}) {
296
- const n = G(/* @__PURE__ */ new Map()), o = I(), s = I(), i = I(), u = d(() => {
297
- const l = v(e);
298
- return l instanceof Set ? l : new Set(
299
- Array.isArray(l) ? l : [l]
300
- );
301
- });
302
- function c() {
303
- const l = u.value;
304
- for (const [g, m] of n)
305
- l.has(g) || (m.dispose(), n.delete(g));
306
- for (const g of l)
307
- if (!n.has(g)) {
308
- const m = T.createFileSystemWatcher(
309
- g,
310
- t.onDidCreate === !1,
311
- t.onDidChange === !1,
312
- t.onDidDelete === !1
313
- );
314
- m.onDidCreate(o.fire), m.onDidChange(s.fire), m.onDidDelete(i.fire), n.set(g, m);
315
- }
316
- }
317
- function p() {
318
- for (const l of n.values())
319
- l.dispose();
320
- n.clear();
321
- }
322
- return c(), D(u, c), L(p), typeof t.onDidCreate == "function" && o.event(t.onDidCreate), typeof t.onDidChange == "function" && s.event(t.onDidChange), typeof t.onDidDelete == "function" && i.event(t.onDidDelete), {
323
- watchers: J(n),
324
- /**
325
- * @see {@link FileSystemWatcher.onDidCreate}
326
- */
327
- onDidCreate: o.event,
328
- /**
329
- * @see {@link FileSystemWatcher.onDidChange}
330
- */
331
- onDidChange: s.event,
332
- /**
333
- * @see {@link FileSystemWatcher.onDidDelete}
334
- */
335
- onDidDelete: i.event
336
- };
337
- }
338
- function U(e, t, n) {
339
- const o = r(e.get(t, n)), s = d({
340
- get() {
341
- return o.value;
342
- },
343
- set(i) {
344
- s.update(i);
345
- }
346
- });
347
- return s.update = async (i) => {
348
- o.value = i === void 0 ? n : i, await e.update(t, i);
349
- }, s;
350
- }
351
- function Pe(e, t) {
352
- return U(E.value.globalState, e, t);
353
- }
354
- function j(e, t) {
355
- y(e, t, [
356
- "title",
357
- "step",
358
- "totalSteps",
359
- "enabled",
360
- "busy",
361
- "ignoreFocusOut"
362
- ]), b(e, t, [
363
- "onDidHide"
364
- ]), t.visible != null && w(() => {
365
- v(t.visible) ? e.show() : e.hide();
366
- });
367
- }
368
- function Ie(e = {}) {
369
- const t = a(f.createInputBox());
370
- j(t, e), y(t, e, [
371
- "valueSelection",
372
- "placeholder",
373
- "password",
374
- "buttons",
375
- "prompt",
376
- "validationMessage"
377
- ]), b(t, e, [
378
- "onDidChangeValue",
379
- "onDidAccept",
380
- "onDidTriggerButton"
381
- ]);
382
- const n = r(e.value ?? t.value);
383
- return t.onDidChangeValue((o) => n.value = o), w(() => t.value = n.value), {
384
- ...t,
385
- /**
386
- * @see {@linkcode InputBox.value}
387
- */
388
- value: n
389
- };
390
- }
391
- const ke = h(() => {
392
- const e = te();
393
- return d(() => e.value.kind === O.Dark || e.value.kind === O.HighContrast);
394
- }), Ae = h(() => {
395
- const e = r(x.isTelemetryEnabled);
396
- return a(x.onDidChangeTelemetryEnabled((t) => {
397
- e.value = t;
398
- })), d(() => e.value);
278
+ //#endregion
279
+ //#region src/composables/useEvent.ts
280
+ function H(e, t) {
281
+ let n = (t, n, r) => M(e(t, n, r));
282
+ return t?.forEach((e) => n(e)), n;
283
+ }
284
+ //#endregion
285
+ //#region src/composables/useEventEmitter.ts
286
+ function U(e, t = []) {
287
+ let n = Array.isArray(e) ? e : t ?? [], r = M(Array.isArray(e) || e == null ? new ee() : e);
288
+ return {
289
+ emitter: r,
290
+ event: H(r.event, n),
291
+ fire: r.fire.bind(r)
292
+ };
293
+ }
294
+ //#endregion
295
+ //#region src/composables/useExtensionSecret.ts
296
+ function pe(t) {
297
+ let n = D.value.secrets, r = c(null);
298
+ n.get(t).then((e) => {
299
+ r.value = e;
300
+ }), M(n.onDidChange(async (e) => {
301
+ e.key === t && (r.value = await n.get(t));
302
+ }));
303
+ let i = async (e) => {
304
+ r.value = e, await n.store(t, e);
305
+ }, a = async () => {
306
+ r.value = void 0, await n.delete(t);
307
+ }, o = e({
308
+ get() {
309
+ return r.value;
310
+ },
311
+ set(e) {
312
+ e === void 0 ? a() : i(e);
313
+ }
314
+ });
315
+ return o.set = i, o.remove = a, o;
316
+ }
317
+ //#endregion
318
+ //#region src/composables/useFileSystemWatcher.ts
319
+ function me(t, n = {}) {
320
+ let r = s(/* @__PURE__ */ new Map()), o = U(), c = U(), l = U(), d = e(() => {
321
+ let e = u(t);
322
+ return e instanceof Set ? e : new Set(Array.isArray(e) ? e : [e]);
323
+ });
324
+ function p() {
325
+ let e = d.value;
326
+ for (let [t, n] of r) e.has(t) || (n.dispose(), r.delete(t));
327
+ for (let t of e) if (!r.has(t)) {
328
+ let e = C.createFileSystemWatcher(t, n.onDidCreate === !1, n.onDidChange === !1, n.onDidDelete === !1);
329
+ e.onDidCreate(o.fire), e.onDidChange(c.fire), e.onDidDelete(l.fire), r.set(t, e);
330
+ }
331
+ }
332
+ function m() {
333
+ for (let e of r.values()) e.dispose();
334
+ r.clear();
335
+ }
336
+ return p(), f(d, p), i(m), typeof n.onDidCreate == "function" && o.event(n.onDidCreate), typeof n.onDidChange == "function" && c.event(n.onDidChange), typeof n.onDidDelete == "function" && l.event(n.onDidDelete), {
337
+ watchers: a(r),
338
+ onDidCreate: o.event,
339
+ onDidChange: c.event,
340
+ onDidDelete: l.event
341
+ };
342
+ }
343
+ //#endregion
344
+ //#region src/composables/useMementoItem.ts
345
+ function W(t, n, r) {
346
+ let i = c(t.get(n, r)), a = e({
347
+ get() {
348
+ return i.value;
349
+ },
350
+ set(e) {
351
+ a.update(e);
352
+ }
353
+ });
354
+ return a.update = async (e) => {
355
+ i.value = e === void 0 ? r : e, await t.update(n, e);
356
+ }, a;
357
+ }
358
+ //#endregion
359
+ //#region src/composables/useGlobalState.ts
360
+ function he(e, t) {
361
+ return W(D.value.globalState, e, t);
362
+ }
363
+ //#endregion
364
+ //#region src/composables/useQuickInputOptions.ts
365
+ function G(e, t) {
366
+ F(e, t, [
367
+ "title",
368
+ "step",
369
+ "totalSteps",
370
+ "enabled",
371
+ "busy",
372
+ "ignoreFocusOut"
373
+ ]), P(e, t, ["onDidHide"]), t.visible != null && p(() => {
374
+ u(t.visible) ? e.show() : e.hide();
375
+ });
376
+ }
377
+ //#endregion
378
+ //#region src/composables/useInputBox.ts
379
+ function ge(e = {}) {
380
+ let t = M(S.createInputBox());
381
+ G(t, e), F(t, e, [
382
+ "valueSelection",
383
+ "placeholder",
384
+ "password",
385
+ "buttons",
386
+ "prompt",
387
+ "validationMessage"
388
+ ]), P(t, e, [
389
+ "onDidChangeValue",
390
+ "onDidAccept",
391
+ "onDidTriggerButton"
392
+ ]);
393
+ let n = c(e.value ?? t.value);
394
+ return t.onDidChangeValue((e) => n.value = e), p(() => t.value = n.value), {
395
+ inputBox: t,
396
+ value: n
397
+ };
398
+ }
399
+ //#endregion
400
+ //#region src/composables/useIsDarkTheme.ts
401
+ var _e = j(() => {
402
+ let t = N();
403
+ return e(() => t.value.kind === m.Dark || t.value.kind === m.HighContrast);
404
+ }), ve = j(() => {
405
+ let t = c(_.isTelemetryEnabled);
406
+ return M(_.onDidChangeTelemetryEnabled((e) => {
407
+ t.value = e;
408
+ })), e(() => t.value);
399
409
  });
400
- function Ve(e, ...t) {
401
- return d(() => {
402
- const n = v(t[0]);
403
- return typeof n == "object" ? N.t(v(e), X(n)) : N.t(v(e), ...t.map(v));
404
- });
405
- }
406
- const We = h(() => {
407
- const e = r(V.tools);
408
- return a(V.onDidChangeChatModels(() => {
409
- e.value = V.tools;
410
- })), d(() => e.value);
411
- }), Oe = h(() => {
412
- const e = r(x.logLevel);
413
- return a(x.onDidChangeLogLevel((t) => {
414
- e.value = t;
415
- })), d(() => e.value);
410
+ //#endregion
411
+ //#region src/composables/useL10nText.ts
412
+ function ye(t, ...n) {
413
+ return e(() => {
414
+ let e = u(n[0]);
415
+ return typeof e == "object" ? y.t(u(t), l(e)) : y.t(u(t), ...n.map(u));
416
+ });
417
+ }
418
+ //#endregion
419
+ //#region src/composables/useLmTools.ts
420
+ var be = j(() => {
421
+ let t = c(b.tools);
422
+ return M(b.onDidChangeChatModels(() => {
423
+ t.value = b.tools;
424
+ })), e(() => t.value);
425
+ }), xe = j(() => {
426
+ let t = c(_.logLevel);
427
+ return M(_.onDidChangeLogLevel((e) => {
428
+ t.value = e;
429
+ })), e(() => t.value);
416
430
  });
417
- function ie(e) {
418
- const t = r(v(e)?.selections ?? []);
419
- return (C(e) || typeof e == "function") && D(e, (n) => {
420
- t.value = n?.selections ?? [];
421
- }), a(f.onDidChangeNotebookEditorSelection((n) => {
422
- n.notebookEditor === v(e) && (t.value = n.selections);
423
- })), d({
424
- get() {
425
- return t.value;
426
- },
427
- set(n) {
428
- t.value = n;
429
- const o = v(e);
430
- o && (o.selections = n);
431
- }
432
- });
433
- }
434
- function Ne(e) {
435
- const t = ie(e);
436
- return d({
437
- get() {
438
- return t.value[0];
439
- },
440
- set(n) {
441
- t.value = n ? [n] : [];
442
- }
443
- });
444
- }
445
- function Me(e) {
446
- const t = r(v(e)?.visibleRanges ?? []);
447
- return (C(e) || typeof e == "function") && D(e, (n) => {
448
- t.value = n?.visibleRanges ?? [];
449
- }), a(f.onDidChangeNotebookEditorVisibleRanges((n) => {
450
- n.notebookEditor === v(e) && (t.value = n.visibleRanges);
451
- })), d(() => t.value);
452
- }
453
- const Le = h(() => {
454
- const e = r(f.terminals);
455
- function t() {
456
- e.value = f.terminals;
457
- }
458
- return a(f.onDidOpenTerminal(t)), a(f.onDidCloseTerminal(t)), e;
431
+ //#endregion
432
+ //#region src/composables/useNotebookEditorSelections.ts
433
+ function K(t) {
434
+ let n = c(u(t)?.selections ?? []);
435
+ return (r(t) || typeof t == "function") && f(t, (e) => {
436
+ n.value = e?.selections ?? [];
437
+ }), M(S.onDidChangeNotebookEditorSelection((e) => {
438
+ e.notebookEditor === u(t) && (n.value = e.selections);
439
+ })), e({
440
+ get() {
441
+ return n.value;
442
+ },
443
+ set(e) {
444
+ n.value = e;
445
+ let r = u(t);
446
+ r && (r.selections = e);
447
+ }
448
+ });
449
+ }
450
+ //#endregion
451
+ //#region src/composables/useNotebookEditorSelection.ts
452
+ function Se(t) {
453
+ let n = K(t);
454
+ return e({
455
+ get() {
456
+ return n.value[0];
457
+ },
458
+ set(e) {
459
+ n.value = e ? [e] : [];
460
+ }
461
+ });
462
+ }
463
+ //#endregion
464
+ //#region src/composables/useNotebookEditorVisibleRanges.ts
465
+ function Ce(t) {
466
+ let n = c(u(t)?.visibleRanges ?? []);
467
+ return (r(t) || typeof t == "function") && f(t, (e) => {
468
+ n.value = e?.visibleRanges ?? [];
469
+ }), M(S.onDidChangeNotebookEditorVisibleRanges((e) => {
470
+ e.notebookEditor === u(t) && (n.value = e.visibleRanges);
471
+ })), e(() => n.value);
472
+ }
473
+ //#endregion
474
+ //#region src/composables/useOpenedTerminals.ts
475
+ var we = j(() => {
476
+ let e = c(S.terminals);
477
+ function t() {
478
+ e.value = S.terminals;
479
+ }
480
+ return M(S.onDidOpenTerminal(t)), M(S.onDidCloseTerminal(t)), e;
459
481
  });
460
- function Fe(e = {}) {
461
- const t = a(f.createQuickPick());
462
- j(t, e), y(t, e, [
463
- "items",
464
- "buttons",
465
- "title",
466
- "step",
467
- "totalSteps",
468
- "enabled",
469
- "busy",
470
- "ignoreFocusOut",
471
- "placeholder",
472
- "canSelectMany",
473
- "matchOnDescription",
474
- "matchOnDetail",
475
- "keepScrollPosition"
476
- ]), b(t, e, [
477
- "onDidChangeValue",
478
- "onDidAccept",
479
- "onDidTriggerButton",
480
- "onDidTriggerItemButton",
481
- "onDidChangeActive",
482
- "onDidChangeSelection"
483
- ]);
484
- const n = r(e.value ?? t.value);
485
- t.onDidChangeValue((i) => n.value = i), w(() => t.value = n.value);
486
- const o = r(e.activeItems ?? t.activeItems);
487
- t.onDidChangeActive((i) => o.value = i), w(() => t.activeItems = o.value);
488
- const s = r(e.selectedItems ?? t.selectedItems);
489
- return t.onDidChangeSelection((i) => s.value = i), w(() => t.selectedItems = s.value), {
490
- ...t,
491
- /**
492
- * @see {@linkcode QuickPick.value}
493
- */
494
- value: n,
495
- /**
496
- * @see {@linkcode QuickPick.activeItems}
497
- */
498
- activeItems: o,
499
- /**
500
- * @see {@linkcode QuickPick.selectedItems}
501
- */
502
- selectedItems: s
503
- };
504
- }
505
- function Be(e) {
506
- const t = a(e.id ? f.createStatusBarItem(e.id, e.alignment, e.priority) : f.createStatusBarItem(e.alignment, e.priority));
507
- return y(t, e, [
508
- "name",
509
- "text",
510
- "tooltip",
511
- "color",
512
- "backgroundColor",
513
- "command",
514
- "accessibilityInformation"
515
- ]), e.visible != null && w(() => {
516
- v(e.visible) ? t.show() : t.hide();
517
- }), t;
518
- }
519
- const _e = h(() => {
520
- const e = r(R.taskExecutions);
521
- function t() {
522
- e.value = R.taskExecutions;
523
- }
524
- return a(R.onDidStartTask(t)), a(R.onDidEndTask(t)), d(() => e.value);
482
+ //#endregion
483
+ //#region src/composables/useQuickPick.ts
484
+ function Te(e = {}) {
485
+ let t = M(S.createQuickPick());
486
+ G(t, e), F(t, e, [
487
+ "items",
488
+ "buttons",
489
+ "title",
490
+ "step",
491
+ "totalSteps",
492
+ "enabled",
493
+ "busy",
494
+ "ignoreFocusOut",
495
+ "placeholder",
496
+ "canSelectMany",
497
+ "matchOnDescription",
498
+ "matchOnDetail",
499
+ "keepScrollPosition"
500
+ ]), P(t, e, [
501
+ "onDidChangeValue",
502
+ "onDidAccept",
503
+ "onDidTriggerButton",
504
+ "onDidTriggerItemButton",
505
+ "onDidChangeActive",
506
+ "onDidChangeSelection"
507
+ ]);
508
+ let n = c(e.value ?? t.value);
509
+ t.onDidChangeValue((e) => n.value = e), p(() => t.value = n.value);
510
+ let r = c(e.activeItems ?? t.activeItems);
511
+ t.onDidChangeActive((e) => r.value = e), p(() => t.activeItems = r.value);
512
+ let i = c(e.selectedItems ?? t.selectedItems);
513
+ return t.onDidChangeSelection((e) => i.value = e), p(() => t.selectedItems = i.value), {
514
+ quickPick: t,
515
+ value: n,
516
+ activeItems: r,
517
+ selectedItems: i
518
+ };
519
+ }
520
+ //#endregion
521
+ //#region src/composables/useStatusBarItem.ts
522
+ function Ee(e) {
523
+ let t = M(e.id ? S.createStatusBarItem(e.id, e.alignment, e.priority) : S.createStatusBarItem(e.alignment, e.priority));
524
+ return F(t, e, [
525
+ "name",
526
+ "text",
527
+ "tooltip",
528
+ "color",
529
+ "backgroundColor",
530
+ "command",
531
+ "accessibilityInformation"
532
+ ]), e.visible != null && p(() => {
533
+ u(e.visible) ? t.show() : t.hide();
534
+ }), t;
535
+ }
536
+ //#endregion
537
+ //#region src/composables/useTaskExecutions.ts
538
+ var De = j(() => {
539
+ let t = c(x.taskExecutions);
540
+ function n() {
541
+ t.value = x.taskExecutions;
542
+ }
543
+ return M(x.onDidStartTask(n)), M(x.onDidEndTask(n)), e(() => t.value);
525
544
  });
526
- function se(e) {
527
- const t = r(v(e)?.shellIntegration);
528
- return (C(e) || typeof e == "function") && D(e, (n) => {
529
- t.value = n?.shellIntegration;
530
- }), a(f.onDidChangeTerminalShellIntegration((n) => {
531
- n.terminal === v(e) && (t.value = n.shellIntegration);
532
- })), d(() => t.value);
533
- }
534
- function ae(e) {
535
- const t = r(v(e)?.state);
536
- return (C(e) || typeof e == "function") && D(e, (n) => {
537
- t.value = n?.state;
538
- }), a(f.onDidChangeTerminalState((n) => {
539
- n === v(e) && (t.value = n.state);
540
- })), d(() => t.value);
541
- }
542
- function $e(...e) {
543
- const t = a(f.createTerminal(...e));
544
- return {
545
- terminal: t,
546
- state: ae(t),
547
- shellIntegration: se(t),
548
- sendText: t.sendText.bind(t),
549
- show: t.show.bind(t),
550
- hide: t.hide.bind(t),
551
- dispose: t.dispose.bind(t)
552
- };
553
- }
554
- function re(e, t) {
555
- C(t) ? w((n) => {
556
- if (t.value) {
557
- const o = S.registerTextEditorCommand(e, t.value);
558
- n(() => o.dispose());
559
- }
560
- }) : t && a(S.registerTextEditorCommand(e, t));
561
- }
562
- function Ue(e) {
563
- for (const [t, n] of Object.entries(e))
564
- re(t, n);
565
- }
566
- function ue(e, t) {
567
- const n = r(v(e)?.selections ?? []);
568
- return (C(e) || typeof e == "function") && D(e, (o) => {
569
- n.value = o?.selections ?? [];
570
- }), a(f.onDidChangeTextEditorSelection((o) => {
571
- if (o.textEditor === v(e)) {
572
- const s = v(t);
573
- (!s || s.includes(o.kind)) && (n.value = o.selections);
574
- }
575
- })), d({
576
- get() {
577
- return n.value;
578
- },
579
- set(o) {
580
- n.value = o;
581
- const s = v(e);
582
- s && (s.selections = o);
583
- }
584
- });
585
- }
586
- function je(e, t) {
587
- const n = ue(e, t);
588
- return d({
589
- get() {
590
- return n.value[0];
591
- },
592
- set(o) {
593
- n.value = o ? [o] : [];
594
- }
595
- });
596
- }
597
- function He(e) {
598
- const t = r(v(e)?.viewColumn);
599
- return (C(e) || typeof e == "function") && D(e, (n) => {
600
- t.value = n?.viewColumn;
601
- }), a(f.onDidChangeTextEditorViewColumn((n) => {
602
- n.textEditor === v(e) && (t.value = n.viewColumn);
603
- })), d(() => t.value);
604
- }
605
- function Ke(e) {
606
- const t = r(v(e)?.visibleRanges ?? []);
607
- return (C(e) || typeof e == "function") && D(e, (n) => {
608
- t.value = n?.visibleRanges ?? [];
609
- }), a(f.onDidChangeTextEditorVisibleRanges((n) => {
610
- n.textEditor === v(e) && (t.value = n.visibleRanges);
611
- })), d(() => t.value);
612
- }
613
- function H(e) {
614
- const t = F(v(e)?.visible);
615
- return (C(e) || typeof e == "function") && D(e, (n) => {
616
- t.value = n?.visible;
617
- }), w((n) => {
618
- const o = v(e);
619
- if (o) {
620
- const s = o.onDidChangeVisibility(() => {
621
- t.value = o.visible;
622
- });
623
- n(() => s.dispose());
624
- }
625
- }), d(() => !!t.value);
626
- }
627
- function Qe(e, t, n = {}) {
628
- const o = I(), s = /* @__PURE__ */ new WeakMap(), i = a(f.createTreeView(e, {
629
- ...n,
630
- treeDataProvider: {
631
- onDidChangeTreeData: o.event,
632
- getTreeItem(c) {
633
- return c.treeItem;
634
- },
635
- async getChildren(c) {
636
- if (c) {
637
- const p = await c.children;
638
- return p?.forEach((l) => s.set(l, c)), p;
639
- }
640
- return v(t);
641
- },
642
- getParent(c) {
643
- return s.get(c);
644
- },
645
- resolveTreeItem: n.resolveTreeItem
646
- }
647
- }));
648
- D(t, () => o.fire()), y(i, n, [
649
- "message",
650
- "title",
651
- "description",
652
- "badge"
653
- ]), b(i, n, [
654
- "onDidExpandElement",
655
- "onDidCollapseElement",
656
- "onDidChangeSelection",
657
- "onDidChangeVisibility",
658
- "onDidChangeCheckboxState"
659
- ]);
660
- const u = r(i.selection);
661
- return a(i.onDidChangeSelection((c) => {
662
- u.value = c.selection;
663
- })), {
664
- view: i,
665
- /**
666
- * @see {@linkcode TreeView.selection}
667
- */
668
- selection: u,
669
- /**
670
- * @see {@linkcode TreeView.visible}
671
- */
672
- visible: H(i),
673
- /**
674
- * @see {@linkcode TreeView.reveal}
675
- */
676
- reveal: i.reveal.bind(i)
677
- };
678
- }
679
- const ze = h(() => {
680
- const e = r(f.visibleNotebookEditors);
681
- return a(f.onDidChangeVisibleNotebookEditors((t) => {
682
- e.value = t;
683
- })), d(() => e.value);
684
- }), Ge = h(() => {
685
- const e = r(f.visibleTextEditors);
686
- return a(f.onDidChangeVisibleTextEditors((t) => {
687
- e.value = t;
688
- })), d(() => e.value);
545
+ //#endregion
546
+ //#region src/composables/useTerminalShellIntegration.ts
547
+ function q(t) {
548
+ let n = c(u(t)?.shellIntegration);
549
+ return (r(t) || typeof t == "function") && f(t, (e) => {
550
+ n.value = e?.shellIntegration;
551
+ }), M(S.onDidChangeTerminalShellIntegration((e) => {
552
+ e.terminal === u(t) && (n.value = e.shellIntegration);
553
+ })), e(() => n.value);
554
+ }
555
+ //#endregion
556
+ //#region src/composables/useTerminalState.ts
557
+ function J(t) {
558
+ let n = c(u(t)?.state);
559
+ return (r(t) || typeof t == "function") && f(t, (e) => {
560
+ n.value = e?.state;
561
+ }), M(S.onDidChangeTerminalState((e) => {
562
+ e === u(t) && (n.value = e.state);
563
+ })), e(() => n.value);
564
+ }
565
+ //#endregion
566
+ //#region src/composables/useTerminal.ts
567
+ function Oe(...e) {
568
+ let t = M(S.createTerminal(...e));
569
+ return {
570
+ terminal: t,
571
+ state: J(t),
572
+ shellIntegration: q(t),
573
+ sendText: t.sendText.bind(t),
574
+ show: t.show.bind(t),
575
+ hide: t.hide.bind(t),
576
+ dispose: t.dispose.bind(t)
577
+ };
578
+ }
579
+ //#endregion
580
+ //#region src/composables/useTextEditorCommand.ts
581
+ function Y(e, t) {
582
+ r(t) ? p((n) => {
583
+ if (t.value) {
584
+ let r = h.registerTextEditorCommand(e, t.value);
585
+ n(() => r.dispose());
586
+ }
587
+ }) : t && M(h.registerTextEditorCommand(e, t));
588
+ }
589
+ //#endregion
590
+ //#region src/composables/useTextEditorCommands.ts
591
+ function ke(e) {
592
+ for (let [t, n] of Object.entries(e)) Y(t, n);
593
+ }
594
+ //#endregion
595
+ //#region src/composables/useTextEditorSelections.ts
596
+ function X(t, n) {
597
+ let i = c(u(t)?.selections ?? []);
598
+ return (r(t) || typeof t == "function") && f(t, (e) => {
599
+ i.value = e?.selections ?? [];
600
+ }), M(S.onDidChangeTextEditorSelection((e) => {
601
+ if (e.textEditor === u(t)) {
602
+ let t = u(n);
603
+ (!t || t.includes(e.kind)) && (i.value = e.selections);
604
+ }
605
+ })), e({
606
+ get() {
607
+ return i.value;
608
+ },
609
+ set(e) {
610
+ i.value = e;
611
+ let n = u(t);
612
+ n && (n.selections = e);
613
+ }
614
+ });
615
+ }
616
+ //#endregion
617
+ //#region src/composables/useTextEditorSelection.ts
618
+ function Ae(t, n) {
619
+ let r = X(t, n);
620
+ return e({
621
+ get() {
622
+ return r.value[0];
623
+ },
624
+ set(e) {
625
+ r.value = e ? [e] : [];
626
+ }
627
+ });
628
+ }
629
+ //#endregion
630
+ //#region src/composables/useTextEditorViewColumn.ts
631
+ function je(t) {
632
+ let n = c(u(t)?.viewColumn);
633
+ return (r(t) || typeof t == "function") && f(t, (e) => {
634
+ n.value = e?.viewColumn;
635
+ }), M(S.onDidChangeTextEditorViewColumn((e) => {
636
+ e.textEditor === u(t) && (n.value = e.viewColumn);
637
+ })), e(() => n.value);
638
+ }
639
+ //#endregion
640
+ //#region src/composables/useTextEditorVisibleRanges.ts
641
+ function Me(t) {
642
+ let n = c(u(t)?.visibleRanges ?? []);
643
+ return (r(t) || typeof t == "function") && f(t, (e) => {
644
+ n.value = e?.visibleRanges ?? [];
645
+ }), M(S.onDidChangeTextEditorVisibleRanges((e) => {
646
+ e.textEditor === u(t) && (n.value = e.visibleRanges);
647
+ })), e(() => n.value);
648
+ }
649
+ //#endregion
650
+ //#region src/composables/useViewVisibility.ts
651
+ function Z(t) {
652
+ let n = o(u(t)?.visible);
653
+ return (r(t) || typeof t == "function") && f(t, (e) => {
654
+ n.value = e?.visible;
655
+ }), p((e) => {
656
+ let r = u(t);
657
+ if (r) {
658
+ let t = r.onDidChangeVisibility(() => {
659
+ n.value = r.visible;
660
+ });
661
+ e(() => t.dispose());
662
+ }
663
+ }), e(() => !!n.value);
664
+ }
665
+ //#endregion
666
+ //#region src/composables/useTreeView.ts
667
+ function Ne(e, t, n = {}) {
668
+ let r = U(), i = /* @__PURE__ */ new WeakMap(), a = M(S.createTreeView(e, {
669
+ ...n,
670
+ treeDataProvider: {
671
+ onDidChangeTreeData: r.event,
672
+ getTreeItem(e) {
673
+ return e.treeItem;
674
+ },
675
+ async getChildren(e) {
676
+ if (e) {
677
+ let t = await e.children;
678
+ return t?.forEach((t) => i.set(t, e)), t;
679
+ }
680
+ return u(t);
681
+ },
682
+ getParent(e) {
683
+ return i.get(e);
684
+ },
685
+ resolveTreeItem: n.resolveTreeItem
686
+ }
687
+ }));
688
+ f(t, () => r.fire()), F(a, n, [
689
+ "message",
690
+ "title",
691
+ "description",
692
+ "badge"
693
+ ]), P(a, n, [
694
+ "onDidExpandElement",
695
+ "onDidCollapseElement",
696
+ "onDidChangeSelection",
697
+ "onDidChangeVisibility",
698
+ "onDidChangeCheckboxState"
699
+ ]);
700
+ let o = c(a.selection);
701
+ return M(a.onDidChangeSelection((e) => {
702
+ o.value = e.selection;
703
+ })), {
704
+ view: a,
705
+ selection: o,
706
+ visible: Z(a),
707
+ reveal: a.reveal.bind(a)
708
+ };
709
+ }
710
+ //#endregion
711
+ //#region src/composables/useVisibleNotebookEditors.ts
712
+ var Pe = j(() => {
713
+ let t = c(S.visibleNotebookEditors);
714
+ return M(S.onDidChangeVisibleNotebookEditors((e) => {
715
+ t.value = e;
716
+ })), e(() => t.value);
717
+ }), Fe = j(() => {
718
+ let t = c(S.visibleTextEditors);
719
+ return M(S.onDidChangeVisibleTextEditors((e) => {
720
+ t.value = e;
721
+ })), e(() => t.value);
689
722
  });
690
- function Je(e, t) {
691
- const n = C(t) ? t : typeof t == "function" ? d(t) : F(t);
692
- return D(n, (o) => {
693
- S.executeCommand("setContext", e, o);
694
- }, { immediate: !0 }), n;
695
- }
696
- function Xe(e, t, n, o, s = {}) {
697
- const i = a(f.createWebviewPanel(
698
- e,
699
- v(t),
700
- o,
701
- s
702
- )), u = i.webview;
703
- y(i, s, [
704
- "title",
705
- "iconPath"
706
- ]), b(i, s, [
707
- "onDidChangeViewState",
708
- "onDidDispose"
709
- ]);
710
- const c = r(0);
711
- w(() => {
712
- u.html = `${v(n)}<!--${c.value}-->`;
713
- }), y(u, { options: s.webviewOptions }, [
714
- "options"
715
- ]), b(u, s, [
716
- "onDidReceiveMessage"
717
- ]);
718
- const p = r(i.viewColumn), l = r(i.active), g = r(i.visible);
719
- return a(i.onDidChangeViewState((m) => {
720
- i === m.webviewPanel && (p.value = i.viewColumn, l.value = i.active, g.value = i.visible);
721
- })), {
722
- panel: i,
723
- webview: u,
724
- /**
725
- * @see {@linkcode WebviewPanel.viewColumn}
726
- */
727
- viewColumn: d(() => p.value),
728
- /**
729
- * @see {@linkcode WebviewPanel.active}
730
- */
731
- active: d(() => l.value),
732
- /**
733
- * @see {@linkcode WebviewPanel.visible}
734
- */
735
- visible: d(() => g.value),
736
- /**
737
- * @see {@linkcode WebviewPanel.reveal}
738
- */
739
- reveal: i.reveal.bind(i),
740
- /**
741
- * @see {@linkcode Webview.postMessage}
742
- */
743
- postMessage: u.postMessage.bind(u),
744
- /**
745
- * @see {@linkcode Webview.asWebviewUri}
746
- */
747
- asWebviewUri: u.asWebviewUri.bind(u),
748
- /**
749
- * Force reload the webview content.
750
- */
751
- forceReload: () => {
752
- c.value++;
753
- }
754
- };
755
- }
756
- function Ye(e, t, n = {}) {
757
- const o = r(), s = d(() => o.value?.webview), i = r();
758
- a(f.registerWebviewViewProvider(
759
- e,
760
- {
761
- resolveWebviewView(c, p) {
762
- o.value = c, i.value = p;
763
- }
764
- },
765
- {
766
- webviewOptions: {
767
- retainContextWhenHidden: n.retainContextWhenHidden
768
- }
769
- }
770
- ));
771
- const u = r(0);
772
- return w(() => {
773
- o.value && (o.value.webview.html = `${v(t)}<!--${u.value}-->`);
774
- }), y(o, n, [
775
- "title",
776
- "description",
777
- "badge"
778
- ]), b(o, n, [
779
- "onDidDispose"
780
- ]), y(s, { options: n.webviewOptions }, [
781
- "options"
782
- ]), b(s, n, [
783
- "onDidReceiveMessage"
784
- ]), {
785
- view: d(() => o.value),
786
- /**
787
- * @see {@linkcode WebviewView.webview}
788
- */
789
- webview: s,
790
- /**
791
- * Additional metadata about the view being resolved.
792
- */
793
- context: d(() => i.value),
794
- /**
795
- * @see {@linkcode WebviewView.visible}
796
- */
797
- visible: H(o),
798
- /**
799
- * @see {@linkcode WebviewView.show}
800
- */
801
- show: (c) => o.value?.show(c),
802
- /**
803
- * @see {@linkcode Webview.postMessage}
804
- */
805
- postMessage: (c) => o.value?.webview.postMessage(c),
806
- /**
807
- * @see {@linkcode Webview.asWebviewUri}
808
- */
809
- asWebviewUri: (c) => s.value?.asWebviewUri(c),
810
- /**
811
- * Force reload the webview content.
812
- */
813
- forceReload: () => {
814
- u.value++;
815
- }
816
- };
817
- }
818
- const K = h(() => {
819
- const e = r(f.state);
820
- return a(f.onDidChangeWindowState((t) => {
821
- e.value = t;
822
- })), {
823
- focused: d(() => e.value.focused),
824
- active: d(() => e.value.active)
825
- };
826
- }), Ze = h(() => K().active), qe = h(() => K().focused), et = h(() => {
827
- const e = r(T.workspaceFolders);
828
- return a(T.onDidChangeWorkspaceFolders(() => {
829
- e.value = T.workspaceFolders;
830
- })), d(() => e.value);
723
+ //#endregion
724
+ //#region src/composables/useVscodeContext.ts
725
+ function Ie(t, n) {
726
+ let i = r(n) ? n : typeof n == "function" ? e(n) : o(n);
727
+ return f(i, (e) => {
728
+ h.executeCommand("setContext", t, e);
729
+ }, { immediate: !0 }), i;
730
+ }
731
+ //#endregion
732
+ //#region src/composables/useWebviewPanel.ts
733
+ function Q(t, n, r, i, a = {}) {
734
+ let o = M(S.createWebviewPanel(t, u(n), i, a)), s = o.webview;
735
+ F(o, a, ["title", "iconPath"]), P(o, a, ["onDidChangeViewState", "onDidDispose"]);
736
+ let l = c(0);
737
+ p(() => {
738
+ s.html = `${u(r)}<!--${l.value}-->`;
739
+ }), F(s, { options: a.webviewOptions }, ["options"]), P(s, a, ["onDidReceiveMessage"]);
740
+ let d = c(o.viewColumn), f = c(o.active), m = c(o.visible);
741
+ return M(o.onDidChangeViewState((e) => {
742
+ o === e.webviewPanel && (d.value = o.viewColumn, f.value = o.active, m.value = o.visible);
743
+ })), {
744
+ panel: o,
745
+ webview: s,
746
+ viewColumn: e(() => d.value),
747
+ active: e(() => f.value),
748
+ visible: e(() => m.value),
749
+ reveal: o.reveal.bind(o),
750
+ postMessage: s.postMessage.bind(s),
751
+ asWebviewUri: s.asWebviewUri.bind(s),
752
+ forceReload: () => {
753
+ l.value++;
754
+ }
755
+ };
756
+ }
757
+ //#endregion
758
+ //#region src/composables/useWebviewView.ts
759
+ function Le(t, n, r = {}) {
760
+ let i = c(), a = e(() => i.value?.webview), o = c();
761
+ M(S.registerWebviewViewProvider(t, { resolveWebviewView(e, t) {
762
+ i.value = e, o.value = t;
763
+ } }, { webviewOptions: { retainContextWhenHidden: r.retainContextWhenHidden } }));
764
+ let s = c(0);
765
+ return p(() => {
766
+ i.value && (i.value.webview.html = `${u(n)}<!--${s.value}-->`);
767
+ }), F(i, r, [
768
+ "title",
769
+ "description",
770
+ "badge"
771
+ ]), P(i, r, ["onDidDispose"]), F(a, { options: r.webviewOptions }, ["options"]), P(a, r, ["onDidReceiveMessage"]), {
772
+ view: e(() => i.value),
773
+ webview: a,
774
+ context: e(() => o.value),
775
+ visible: Z(i),
776
+ show: (e) => i.value?.show(e),
777
+ postMessage: (e) => i.value?.webview.postMessage(e),
778
+ asWebviewUri: (e) => a.value?.asWebviewUri(e),
779
+ forceReload: () => {
780
+ s.value++;
781
+ }
782
+ };
783
+ }
784
+ //#endregion
785
+ //#region src/composables/useWindowState.ts
786
+ var $ = j(() => {
787
+ let t = c(S.state);
788
+ return M(S.onDidChangeWindowState((e) => {
789
+ t.value = e;
790
+ })), {
791
+ focused: e(() => t.value.focused),
792
+ active: e(() => t.value.active)
793
+ };
794
+ }), Re = j(() => $().active), ze = j(() => $().focused), Be = j(() => {
795
+ let t = c(C.workspaceFolders);
796
+ return M(C.onDidChangeWorkspaceFolders(() => {
797
+ t.value = C.workspaceFolders;
798
+ })), e(() => t.value);
831
799
  });
832
- function tt(e, t) {
833
- return U(E.value.workspaceState, e, t);
834
- }
835
- export {
836
- B as activateCbs,
837
- $ as deactivateCbs,
838
- fe as defineConfig,
839
- de as defineExtension,
840
- ge as defineLogger,
841
- h as defineService,
842
- E as extensionContext,
843
- k as extensionScope,
844
- _ as onActivate,
845
- ve as onDeactivate,
846
- pe as useAbsoluteUri,
847
- te as useActiveColorTheme,
848
- he as useActiveDebugSession,
849
- me as useActiveNotebookEditor,
850
- Ce as useActiveTerminal,
851
- we as useActiveTextEditor,
852
- De as useAllExtensions,
853
- be as useChatParticipant,
854
- ne as useCommand,
855
- ye as useCommands,
856
- a as useDisposable,
857
- Te as useDocumentText,
858
- Ee as useEditorDecorations,
859
- xe as useEnvShell,
860
- oe as useEvent,
861
- I as useEventEmitter,
862
- Se as useExtensionSecret,
863
- Re as useFileSystemWatcher,
864
- Pe as useGlobalState,
865
- Ie as useInputBox,
866
- ke as useIsDarkTheme,
867
- Ae as useIsTelemetryEnabled,
868
- Ve as useL10nText,
869
- We as useLmTools,
870
- Oe as useLogLevel,
871
- U as useMementoItem,
872
- Ne as useNotebookEditorSelection,
873
- ie as useNotebookEditorSelections,
874
- Me as useNotebookEditorVisibleRanges,
875
- Le as useOpenedTerminals,
876
- Fe as useQuickPick,
877
- y as useReactiveOptions,
878
- Be as useStatusBarItem,
879
- _e as useTaskExecutions,
880
- $e as useTerminal,
881
- se as useTerminalShellIntegration,
882
- ae as useTerminalState,
883
- re as useTextEditorCommand,
884
- Ue as useTextEditorCommands,
885
- je as useTextEditorSelection,
886
- ue as useTextEditorSelections,
887
- He as useTextEditorViewColumn,
888
- Ke as useTextEditorVisibleRanges,
889
- Qe as useTreeView,
890
- H as useViewVisibility,
891
- ze as useVisibleNotebookEditors,
892
- Ge as useVisibleTextEditors,
893
- Je as useVscodeContext,
894
- Xe as useWebviewPanel,
895
- Ye as useWebviewView,
896
- Ze as useWindowActive,
897
- qe as useWindowFocused,
898
- K as useWindowState,
899
- et as useWorkspaceFolders,
900
- tt as useWorkspaceState
901
- };
902
- //# sourceMappingURL=index.js.map
800
+ //#endregion
801
+ //#region src/composables/useWorkspaceState.ts
802
+ function Ve(e, t) {
803
+ return W(D.value.workspaceState, e, t);
804
+ }
805
+ //#endregion
806
+ export { w as activateCbs, E as deactivateCbs, ae as defineConfig, ie as defineExtension, oe as defineLogger, j as defineService, D as extensionContext, O as extensionScope, T as onActivate, re as onDeactivate, se as useAbsoluteUri, N as useActiveColorTheme, ce as useActiveDebugSession, le as useActiveNotebookEditor, ue as useActiveTerminal, de as useActiveTextEditor, fe as useAllExtensions, I as useChatParticipant, L as useCommand, R as useCommands, M as useDisposable, z as useDocumentText, B as useEditorDecorations, V as useEnvShell, H as useEvent, U as useEventEmitter, pe as useExtensionSecret, me as useFileSystemWatcher, he as useGlobalState, ge as useInputBox, _e as useIsDarkTheme, ve as useIsTelemetryEnabled, ye as useL10nText, be as useLmTools, xe as useLogLevel, W as useMementoItem, Se as useNotebookEditorSelection, K as useNotebookEditorSelections, Ce as useNotebookEditorVisibleRanges, we as useOpenedTerminals, Te as useQuickPick, F as useReactiveOptions, Ee as useStatusBarItem, De as useTaskExecutions, Oe as useTerminal, q as useTerminalShellIntegration, J as useTerminalState, Y as useTextEditorCommand, ke as useTextEditorCommands, Ae as useTextEditorSelection, X as useTextEditorSelections, je as useTextEditorViewColumn, Me as useTextEditorVisibleRanges, Ne as useTreeView, Z as useViewVisibility, Pe as useVisibleNotebookEditors, Fe as useVisibleTextEditors, Ie as useVscodeContext, Q as useWebviewPanel, Le as useWebviewView, Re as useWindowActive, ze as useWindowFocused, $ as useWindowState, Be as useWorkspaceFolders, Ve as useWorkspaceState };
807
+
808
+ //# sourceMappingURL=index.js.map