@omniviewdev/editors 3.0.3 → 5.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/editors.css +1 -1
- package/dist/index.d.ts +165 -2
- package/dist/index.js +2087 -1555
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,359 +1,359 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import et, { forwardRef as _e, useRef as G, useState as me, useMemo as Oe, useEffect as U, useImperativeHandle as xt, useCallback as De, Suspense as kt, lazy as Rt, Children as Ft, isValidElement as Ut, useId as Yt, useLayoutEffect as St, useSyncExternalStore as Gt } from "react";
|
|
2
|
+
import { useTheme as Jt, Checkbox as Ve, Separator as Kt, Blockquote as Xt, Link as Zt, Table as be, CodeBlock as Qt, Code as er, Accordion as st, CommandList as ue, useCommandListConfig as tr, useCommandListStoreContext as rr, utf16ToUtf8 as nr, utf8ToUtf16 as or } from "@omniviewdev/base-ui";
|
|
3
|
+
import * as W from "monaco-editor";
|
|
4
|
+
import ir from "remark-gfm";
|
|
5
|
+
import sr from "rehype-raw";
|
|
6
|
+
import ar, { defaultSchema as Fe } from "rehype-sanitize";
|
|
7
7
|
import "@xterm/xterm/css/xterm.css";
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
if (
|
|
12
|
-
|
|
8
|
+
var je = { exports: {} }, Re = {};
|
|
9
|
+
var at;
|
|
10
|
+
function cr() {
|
|
11
|
+
if (at) return Re;
|
|
12
|
+
at = 1;
|
|
13
13
|
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
14
|
-
function n
|
|
15
|
-
var
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
for (var
|
|
19
|
-
|
|
20
|
-
} else
|
|
21
|
-
return c =
|
|
14
|
+
function r(n, c, i) {
|
|
15
|
+
var l = null;
|
|
16
|
+
if (i !== void 0 && (l = "" + i), c.key !== void 0 && (l = "" + c.key), "key" in c) {
|
|
17
|
+
i = {};
|
|
18
|
+
for (var d in c)
|
|
19
|
+
d !== "key" && (i[d] = c[d]);
|
|
20
|
+
} else i = c;
|
|
21
|
+
return c = i.ref, {
|
|
22
22
|
$$typeof: e,
|
|
23
|
-
type:
|
|
24
|
-
key:
|
|
23
|
+
type: n,
|
|
24
|
+
key: l,
|
|
25
25
|
ref: c !== void 0 ? c : null,
|
|
26
|
-
props:
|
|
26
|
+
props: i
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
return
|
|
30
|
-
}
|
|
31
|
-
var
|
|
32
|
-
var
|
|
33
|
-
function
|
|
34
|
-
return
|
|
35
|
-
function e(
|
|
36
|
-
if (
|
|
37
|
-
if (typeof
|
|
38
|
-
return
|
|
39
|
-
if (typeof
|
|
40
|
-
switch (
|
|
41
|
-
case
|
|
29
|
+
return Re.Fragment = t, Re.jsx = r, Re.jsxs = r, Re;
|
|
30
|
+
}
|
|
31
|
+
var Se = {};
|
|
32
|
+
var ct;
|
|
33
|
+
function lr() {
|
|
34
|
+
return ct || (ct = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
35
|
+
function e(a) {
|
|
36
|
+
if (a == null) return null;
|
|
37
|
+
if (typeof a == "function")
|
|
38
|
+
return a.$$typeof === b ? null : a.displayName || a.name || null;
|
|
39
|
+
if (typeof a == "string") return a;
|
|
40
|
+
switch (a) {
|
|
41
|
+
case x:
|
|
42
42
|
return "Fragment";
|
|
43
|
-
case
|
|
43
|
+
case S:
|
|
44
44
|
return "Profiler";
|
|
45
|
-
case
|
|
45
|
+
case z:
|
|
46
46
|
return "StrictMode";
|
|
47
|
-
case
|
|
47
|
+
case N:
|
|
48
48
|
return "Suspense";
|
|
49
|
-
case
|
|
49
|
+
case q:
|
|
50
50
|
return "SuspenseList";
|
|
51
|
-
case
|
|
51
|
+
case K:
|
|
52
52
|
return "Activity";
|
|
53
53
|
}
|
|
54
|
-
if (typeof
|
|
55
|
-
switch (typeof
|
|
54
|
+
if (typeof a == "object")
|
|
55
|
+
switch (typeof a.tag == "number" && console.error(
|
|
56
56
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
57
|
-
),
|
|
58
|
-
case
|
|
57
|
+
), a.$$typeof) {
|
|
58
|
+
case H:
|
|
59
59
|
return "Portal";
|
|
60
|
-
case
|
|
61
|
-
return
|
|
62
|
-
case
|
|
63
|
-
return (
|
|
64
|
-
case
|
|
65
|
-
var
|
|
66
|
-
return
|
|
60
|
+
case I:
|
|
61
|
+
return a.displayName || "Context";
|
|
62
|
+
case D:
|
|
63
|
+
return (a._context.displayName || "Context") + ".Consumer";
|
|
64
|
+
case B:
|
|
65
|
+
var w = a.render;
|
|
66
|
+
return a = a.displayName, a || (a = w.displayName || w.name || "", a = a !== "" ? "ForwardRef(" + a + ")" : "ForwardRef"), a;
|
|
67
67
|
case P:
|
|
68
|
-
return
|
|
69
|
-
case
|
|
70
|
-
|
|
68
|
+
return w = a.displayName || null, w !== null ? w : e(a.type) || "Memo";
|
|
69
|
+
case V:
|
|
70
|
+
w = a._payload, a = a._init;
|
|
71
71
|
try {
|
|
72
|
-
return e(
|
|
72
|
+
return e(a(w));
|
|
73
73
|
} catch {
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
76
|
return null;
|
|
77
77
|
}
|
|
78
|
-
function t(
|
|
79
|
-
return "" +
|
|
78
|
+
function t(a) {
|
|
79
|
+
return "" + a;
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function r(a) {
|
|
82
82
|
try {
|
|
83
|
-
t(
|
|
84
|
-
var
|
|
83
|
+
t(a);
|
|
84
|
+
var w = !1;
|
|
85
85
|
} catch {
|
|
86
|
-
|
|
86
|
+
w = !0;
|
|
87
87
|
}
|
|
88
|
-
if (
|
|
89
|
-
|
|
90
|
-
var
|
|
91
|
-
return
|
|
92
|
-
|
|
88
|
+
if (w) {
|
|
89
|
+
w = console;
|
|
90
|
+
var A = w.error, L = typeof Symbol == "function" && Symbol.toStringTag && a[Symbol.toStringTag] || a.constructor.name || "Object";
|
|
91
|
+
return A.call(
|
|
92
|
+
w,
|
|
93
93
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
94
|
-
|
|
95
|
-
), t(
|
|
94
|
+
L
|
|
95
|
+
), t(a);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
if (
|
|
100
|
-
if (typeof
|
|
98
|
+
function n(a) {
|
|
99
|
+
if (a === x) return "<>";
|
|
100
|
+
if (typeof a == "object" && a !== null && a.$$typeof === V)
|
|
101
101
|
return "<...>";
|
|
102
102
|
try {
|
|
103
|
-
var
|
|
104
|
-
return
|
|
103
|
+
var w = e(a);
|
|
104
|
+
return w ? "<" + w + ">" : "<...>";
|
|
105
105
|
} catch {
|
|
106
106
|
return "<...>";
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
109
|
function c() {
|
|
110
|
-
var
|
|
111
|
-
return
|
|
110
|
+
var a = o.A;
|
|
111
|
+
return a === null ? null : a.getOwner();
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function i() {
|
|
114
114
|
return Error("react-stack-top-frame");
|
|
115
115
|
}
|
|
116
|
-
function
|
|
117
|
-
if (
|
|
118
|
-
var
|
|
119
|
-
if (
|
|
116
|
+
function l(a) {
|
|
117
|
+
if (v.call(a, "key")) {
|
|
118
|
+
var w = Object.getOwnPropertyDescriptor(a, "key").get;
|
|
119
|
+
if (w && w.isReactWarning) return !1;
|
|
120
120
|
}
|
|
121
|
-
return
|
|
121
|
+
return a.key !== void 0;
|
|
122
122
|
}
|
|
123
|
-
function a
|
|
124
|
-
function
|
|
123
|
+
function d(a, w) {
|
|
124
|
+
function A() {
|
|
125
125
|
u || (u = !0, console.error(
|
|
126
126
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
127
|
-
|
|
127
|
+
w
|
|
128
128
|
));
|
|
129
129
|
}
|
|
130
|
-
|
|
131
|
-
get:
|
|
130
|
+
A.isReactWarning = !0, Object.defineProperty(a, "key", {
|
|
131
|
+
get: A,
|
|
132
132
|
configurable: !0
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
var
|
|
137
|
-
return
|
|
135
|
+
function y() {
|
|
136
|
+
var a = e(this.type);
|
|
137
|
+
return f[a] || (f[a] = !0, console.error(
|
|
138
138
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
139
|
-
)),
|
|
140
|
-
}
|
|
141
|
-
function
|
|
142
|
-
var
|
|
143
|
-
return
|
|
144
|
-
$$typeof:
|
|
145
|
-
type:
|
|
146
|
-
key:
|
|
147
|
-
props:
|
|
148
|
-
_owner:
|
|
149
|
-
}, (
|
|
139
|
+
)), a = this.props.ref, a !== void 0 ? a : null;
|
|
140
|
+
}
|
|
141
|
+
function h(a, w, A, L, F, O) {
|
|
142
|
+
var $ = A.ref;
|
|
143
|
+
return a = {
|
|
144
|
+
$$typeof: R,
|
|
145
|
+
type: a,
|
|
146
|
+
key: w,
|
|
147
|
+
props: A,
|
|
148
|
+
_owner: L
|
|
149
|
+
}, ($ !== void 0 ? $ : null) !== null ? Object.defineProperty(a, "ref", {
|
|
150
150
|
enumerable: !1,
|
|
151
|
-
get:
|
|
152
|
-
}) : Object.defineProperty(
|
|
151
|
+
get: y
|
|
152
|
+
}) : Object.defineProperty(a, "ref", { enumerable: !1, value: null }), a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
153
153
|
configurable: !1,
|
|
154
154
|
enumerable: !1,
|
|
155
155
|
writable: !0,
|
|
156
156
|
value: 0
|
|
157
|
-
}), Object.defineProperty(
|
|
157
|
+
}), Object.defineProperty(a, "_debugInfo", {
|
|
158
158
|
configurable: !1,
|
|
159
159
|
enumerable: !1,
|
|
160
160
|
writable: !0,
|
|
161
161
|
value: null
|
|
162
|
-
}), Object.defineProperty(
|
|
162
|
+
}), Object.defineProperty(a, "_debugStack", {
|
|
163
163
|
configurable: !1,
|
|
164
164
|
enumerable: !1,
|
|
165
165
|
writable: !0,
|
|
166
|
-
value:
|
|
167
|
-
}), Object.defineProperty(
|
|
166
|
+
value: F
|
|
167
|
+
}), Object.defineProperty(a, "_debugTask", {
|
|
168
168
|
configurable: !1,
|
|
169
169
|
enumerable: !1,
|
|
170
170
|
writable: !0,
|
|
171
|
-
value:
|
|
172
|
-
}), Object.freeze && (Object.freeze(
|
|
173
|
-
}
|
|
174
|
-
function
|
|
175
|
-
var
|
|
176
|
-
if (
|
|
177
|
-
if (
|
|
178
|
-
if (
|
|
179
|
-
for (
|
|
180
|
-
|
|
181
|
-
Object.freeze && Object.freeze(
|
|
171
|
+
value: O
|
|
172
|
+
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
173
|
+
}
|
|
174
|
+
function k(a, w, A, L, F, O) {
|
|
175
|
+
var $ = w.children;
|
|
176
|
+
if ($ !== void 0)
|
|
177
|
+
if (L)
|
|
178
|
+
if (p($)) {
|
|
179
|
+
for (L = 0; L < $.length; L++)
|
|
180
|
+
j($[L]);
|
|
181
|
+
Object.freeze && Object.freeze($);
|
|
182
182
|
} else
|
|
183
183
|
console.error(
|
|
184
184
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
185
185
|
);
|
|
186
|
-
else
|
|
187
|
-
if (
|
|
188
|
-
|
|
189
|
-
var
|
|
186
|
+
else j($);
|
|
187
|
+
if (v.call(w, "key")) {
|
|
188
|
+
$ = e(a);
|
|
189
|
+
var J = Object.keys(w).filter(function(oe) {
|
|
190
190
|
return oe !== "key";
|
|
191
191
|
});
|
|
192
|
-
|
|
192
|
+
L = 0 < J.length ? "{key: someKey, " + J.join(": ..., ") + ": ...}" : "{key: someKey}", C[$ + L] || (J = 0 < J.length ? "{" + J.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
193
193
|
`A props object containing a "key" prop is being spread into JSX:
|
|
194
194
|
let props = %s;
|
|
195
195
|
<%s {...props} />
|
|
196
196
|
React keys must be passed directly to JSX without using spread:
|
|
197
197
|
let props = %s;
|
|
198
198
|
<%s key={someKey} {...props} />`,
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
),
|
|
199
|
+
L,
|
|
200
|
+
$,
|
|
201
|
+
J,
|
|
202
|
+
$
|
|
203
|
+
), C[$ + L] = !0);
|
|
204
204
|
}
|
|
205
|
-
if (
|
|
206
|
-
|
|
207
|
-
for (var
|
|
208
|
-
|
|
209
|
-
} else
|
|
210
|
-
return
|
|
211
|
-
|
|
212
|
-
typeof
|
|
213
|
-
),
|
|
214
|
-
|
|
215
|
-
O,
|
|
216
|
-
M,
|
|
217
|
-
c(),
|
|
205
|
+
if ($ = null, A !== void 0 && (r(A), $ = "" + A), l(w) && (r(w.key), $ = "" + w.key), "key" in w) {
|
|
206
|
+
A = {};
|
|
207
|
+
for (var Z in w)
|
|
208
|
+
Z !== "key" && (A[Z] = w[Z]);
|
|
209
|
+
} else A = w;
|
|
210
|
+
return $ && d(
|
|
211
|
+
A,
|
|
212
|
+
typeof a == "function" ? a.displayName || a.name || "Unknown" : a
|
|
213
|
+
), h(
|
|
214
|
+
a,
|
|
218
215
|
$,
|
|
219
|
-
|
|
216
|
+
A,
|
|
217
|
+
c(),
|
|
218
|
+
F,
|
|
219
|
+
O
|
|
220
220
|
);
|
|
221
221
|
}
|
|
222
|
-
function
|
|
223
|
-
|
|
222
|
+
function j(a) {
|
|
223
|
+
m(a) ? a._store && (a._store.validated = 1) : typeof a == "object" && a !== null && a.$$typeof === V && (a._payload.status === "fulfilled" ? m(a._payload.value) && a._payload.value._store && (a._payload.value._store.validated = 1) : a._store && (a._store.validated = 1));
|
|
224
224
|
}
|
|
225
|
-
function
|
|
226
|
-
return typeof
|
|
225
|
+
function m(a) {
|
|
226
|
+
return typeof a == "object" && a !== null && a.$$typeof === R;
|
|
227
227
|
}
|
|
228
|
-
var
|
|
228
|
+
var T = et, R = /* @__PURE__ */ Symbol.for("react.transitional.element"), H = /* @__PURE__ */ Symbol.for("react.portal"), x = /* @__PURE__ */ Symbol.for("react.fragment"), z = /* @__PURE__ */ Symbol.for("react.strict_mode"), S = /* @__PURE__ */ Symbol.for("react.profiler"), D = /* @__PURE__ */ Symbol.for("react.consumer"), I = /* @__PURE__ */ Symbol.for("react.context"), B = /* @__PURE__ */ Symbol.for("react.forward_ref"), N = /* @__PURE__ */ Symbol.for("react.suspense"), q = /* @__PURE__ */ Symbol.for("react.suspense_list"), P = /* @__PURE__ */ Symbol.for("react.memo"), V = /* @__PURE__ */ Symbol.for("react.lazy"), K = /* @__PURE__ */ Symbol.for("react.activity"), b = /* @__PURE__ */ Symbol.for("react.client.reference"), o = T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, v = Object.prototype.hasOwnProperty, p = Array.isArray, s = console.createTask ? console.createTask : function() {
|
|
229
229
|
return null;
|
|
230
230
|
};
|
|
231
|
-
|
|
232
|
-
react_stack_bottom_frame: function(
|
|
233
|
-
return
|
|
231
|
+
T = {
|
|
232
|
+
react_stack_bottom_frame: function(a) {
|
|
233
|
+
return a();
|
|
234
234
|
}
|
|
235
235
|
};
|
|
236
|
-
var u,
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
)(),
|
|
240
|
-
|
|
241
|
-
var
|
|
242
|
-
return
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
236
|
+
var u, f = {}, g = T.react_stack_bottom_frame.bind(
|
|
237
|
+
T,
|
|
238
|
+
i
|
|
239
|
+
)(), _ = s(n(i)), C = {};
|
|
240
|
+
Se.Fragment = x, Se.jsx = function(a, w, A) {
|
|
241
|
+
var L = 1e4 > o.recentlyCreatedOwnerStacks++;
|
|
242
|
+
return k(
|
|
243
|
+
a,
|
|
244
|
+
w,
|
|
245
|
+
A,
|
|
246
246
|
!1,
|
|
247
|
-
|
|
248
|
-
|
|
247
|
+
L ? Error("react-stack-top-frame") : g,
|
|
248
|
+
L ? s(n(a)) : _
|
|
249
249
|
);
|
|
250
|
-
},
|
|
251
|
-
var
|
|
252
|
-
return
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
250
|
+
}, Se.jsxs = function(a, w, A) {
|
|
251
|
+
var L = 1e4 > o.recentlyCreatedOwnerStacks++;
|
|
252
|
+
return k(
|
|
253
|
+
a,
|
|
254
|
+
w,
|
|
255
|
+
A,
|
|
256
256
|
!0,
|
|
257
|
-
|
|
258
|
-
|
|
257
|
+
L ? Error("react-stack-top-frame") : g,
|
|
258
|
+
L ? s(n(a)) : _
|
|
259
259
|
);
|
|
260
260
|
};
|
|
261
|
-
})()),
|
|
262
|
-
}
|
|
263
|
-
var
|
|
264
|
-
function
|
|
265
|
-
return
|
|
266
|
-
}
|
|
267
|
-
var
|
|
268
|
-
var
|
|
269
|
-
function
|
|
270
|
-
if (
|
|
271
|
-
|
|
272
|
-
var e =
|
|
273
|
-
return
|
|
261
|
+
})()), Se;
|
|
262
|
+
}
|
|
263
|
+
var lt;
|
|
264
|
+
function ur() {
|
|
265
|
+
return lt || (lt = 1, process.env.NODE_ENV === "production" ? je.exports = cr() : je.exports = lr()), je.exports;
|
|
266
|
+
}
|
|
267
|
+
var E = ur(), Ne = { exports: {} }, Ue = {};
|
|
268
|
+
var ut;
|
|
269
|
+
function dr() {
|
|
270
|
+
if (ut) return Ue;
|
|
271
|
+
ut = 1;
|
|
272
|
+
var e = et.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
273
|
+
return Ue.c = function(t) {
|
|
274
274
|
return e.H.useMemoCache(t);
|
|
275
|
-
},
|
|
276
|
-
}
|
|
277
|
-
var
|
|
278
|
-
var
|
|
279
|
-
function
|
|
280
|
-
return
|
|
281
|
-
var e =
|
|
282
|
-
|
|
283
|
-
var
|
|
284
|
-
return
|
|
275
|
+
}, Ue;
|
|
276
|
+
}
|
|
277
|
+
var Ye = {};
|
|
278
|
+
var dt;
|
|
279
|
+
function fr() {
|
|
280
|
+
return dt || (dt = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
281
|
+
var e = et.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
282
|
+
Ye.c = function(t) {
|
|
283
|
+
var r = e.H;
|
|
284
|
+
return r === null && console.error(
|
|
285
285
|
`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
286
286
|
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
287
287
|
2. You might be breaking the Rules of Hooks
|
|
288
288
|
3. You might have more than one copy of React in the same app
|
|
289
289
|
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`
|
|
290
|
-
),
|
|
290
|
+
), r.useMemoCache(t);
|
|
291
291
|
};
|
|
292
|
-
})()),
|
|
292
|
+
})()), Ye;
|
|
293
293
|
}
|
|
294
|
-
var
|
|
295
|
-
function
|
|
296
|
-
return
|
|
294
|
+
var ft;
|
|
295
|
+
function gr() {
|
|
296
|
+
return ft || (ft = 1, process.env.NODE_ENV === "production" ? Ne.exports = dr() : Ne.exports = fr()), Ne.exports;
|
|
297
297
|
}
|
|
298
|
-
var
|
|
299
|
-
function
|
|
298
|
+
var Ce = gr();
|
|
299
|
+
function Et(e) {
|
|
300
300
|
return typeof document > "u" ? null : e?.closest("[data-ov-theme]") ?? e ?? document.documentElement;
|
|
301
301
|
}
|
|
302
|
-
function
|
|
303
|
-
const t =
|
|
302
|
+
function tt(e) {
|
|
303
|
+
const t = Et(e);
|
|
304
304
|
return t ? getComputedStyle(t) : null;
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
return
|
|
306
|
+
function To(e, t) {
|
|
307
|
+
return tt(t)?.getPropertyValue(e).trim() ?? "";
|
|
308
308
|
}
|
|
309
|
-
function
|
|
310
|
-
const e =
|
|
309
|
+
function rt() {
|
|
310
|
+
const e = Ce.c(2), {
|
|
311
311
|
activeTheme: t
|
|
312
|
-
} =
|
|
313
|
-
let
|
|
314
|
-
return e[0] !== t ? (
|
|
312
|
+
} = Jt();
|
|
313
|
+
let r;
|
|
314
|
+
return e[0] !== t ? (r = {
|
|
315
315
|
id: t.id,
|
|
316
316
|
base: t.base,
|
|
317
317
|
registration: t
|
|
318
|
-
}, e[0] = t, e[1] =
|
|
318
|
+
}, e[0] = t, e[1] = r) : r = e[1], r;
|
|
319
319
|
}
|
|
320
|
-
const
|
|
321
|
-
function
|
|
320
|
+
const mr = /^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i, hr = /^rgba?\(\s*([\d.]+)(?:\s*,\s*|\s+)([\d.]+)(?:\s*,\s*|\s+)([\d.]+)(?:\s*(?:,|\/)\s*([\d.]+))?\s*\)$/i;
|
|
321
|
+
function he(e) {
|
|
322
322
|
return Math.max(0, Math.min(255, Math.round(e))).toString(16).padStart(2, "0");
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function Ge(e) {
|
|
325
325
|
const t = e.trim();
|
|
326
|
-
if (
|
|
327
|
-
const
|
|
328
|
-
if (!
|
|
329
|
-
const
|
|
330
|
-
return
|
|
326
|
+
if (mr.test(t)) return t;
|
|
327
|
+
const r = t.match(hr);
|
|
328
|
+
if (!r) return "";
|
|
329
|
+
const n = r[4] === void 0 ? 1 : Number(r[4]), c = `#${he(Number(r[1]))}${he(Number(r[2]))}${he(Number(r[3]))}`;
|
|
330
|
+
return n >= 1 ? c : `${c}${he(n * 255)}`;
|
|
331
331
|
}
|
|
332
|
-
function
|
|
332
|
+
function pr(e) {
|
|
333
333
|
if (!e)
|
|
334
334
|
return {
|
|
335
|
-
normalize:
|
|
335
|
+
normalize: Ge,
|
|
336
336
|
dispose() {
|
|
337
337
|
}
|
|
338
338
|
};
|
|
339
339
|
const t = e.ownerDocument.createElement("canvas");
|
|
340
340
|
t.width = 1, t.height = 1, t.setAttribute("aria-hidden", "true"), t.style.cssText = "position:absolute;width:0;height:0;overflow:hidden;pointer-events:none;visibility:hidden", e.append(t);
|
|
341
|
-
let
|
|
341
|
+
let r;
|
|
342
342
|
return {
|
|
343
|
-
normalize(
|
|
344
|
-
const c =
|
|
343
|
+
normalize(n) {
|
|
344
|
+
const c = Ge(n);
|
|
345
345
|
if (c) return c;
|
|
346
|
-
if (t.style.color = "", t.style.color =
|
|
347
|
-
const
|
|
348
|
-
if (
|
|
349
|
-
if (!/^(?:color|lab|lch|oklab|oklch)\(/i.test(
|
|
346
|
+
if (t.style.color = "", t.style.color = n.trim(), !t.style.color) return "";
|
|
347
|
+
const i = getComputedStyle(t).color, l = Ge(i);
|
|
348
|
+
if (l) return l;
|
|
349
|
+
if (!/^(?:color|lab|lch|oklab|oklch)\(/i.test(i)) return "";
|
|
350
350
|
try {
|
|
351
|
-
if (
|
|
351
|
+
if (r ??= t.getContext("2d", {
|
|
352
352
|
willReadFrequently: !0
|
|
353
|
-
}), !
|
|
354
|
-
|
|
355
|
-
const
|
|
356
|
-
return
|
|
353
|
+
}), !r || (r.clearRect(0, 0, 1, 1), r.fillStyle = "#010203", r.fillStyle = i, r.fillStyle === "#010203")) return "";
|
|
354
|
+
r.fillRect(0, 0, 1, 1);
|
|
355
|
+
const d = r.getImageData(0, 0, 1, 1).data, y = `#${he(d[0])}${he(d[1])}${he(d[2])}`;
|
|
356
|
+
return d[3] === 255 ? y : `${y}${he(d[3])}`;
|
|
357
357
|
} catch {
|
|
358
358
|
return "";
|
|
359
359
|
}
|
|
@@ -363,7 +363,7 @@ function or(e) {
|
|
|
363
363
|
}
|
|
364
364
|
};
|
|
365
365
|
}
|
|
366
|
-
function
|
|
366
|
+
function yr(e) {
|
|
367
367
|
switch (e) {
|
|
368
368
|
case "light":
|
|
369
369
|
case "solarized-light":
|
|
@@ -376,73 +376,73 @@ function ir(e) {
|
|
|
376
376
|
return "vs-dark";
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
function
|
|
380
|
-
const
|
|
381
|
-
if (!
|
|
382
|
-
const
|
|
379
|
+
function vr(e, t, r, n, c, i) {
|
|
380
|
+
const l = n.normalize(r?.getPropertyValue(t).trim() ?? "");
|
|
381
|
+
if (!l) return null;
|
|
382
|
+
const d = {
|
|
383
383
|
token: e,
|
|
384
|
-
foreground:
|
|
384
|
+
foreground: l.slice(1)
|
|
385
385
|
};
|
|
386
|
-
return c && (
|
|
386
|
+
return c && (d.fontStyle = r?.getPropertyValue(c).trim() || i || ""), d;
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function br(e) {
|
|
389
389
|
const t = {};
|
|
390
|
-
for (const [
|
|
391
|
-
|
|
390
|
+
for (const [r, n] of Object.entries(e))
|
|
391
|
+
n && (t[r] = n);
|
|
392
392
|
return t;
|
|
393
393
|
}
|
|
394
|
-
function
|
|
395
|
-
const
|
|
394
|
+
function $e(e, t) {
|
|
395
|
+
const r = Et(t), n = tt(r), c = pr(r), i = (d, y, h, k) => vr(d, y, n, c, h, k), l = (d) => c.normalize(n?.getPropertyValue(d).trim() ?? "");
|
|
396
396
|
try {
|
|
397
|
-
const
|
|
397
|
+
const d = [i("comment", "--ov-syntax-comment", "--ov-syntax-style-comment", "italic"), i("string", "--ov-syntax-string"), i("string.escape", "--ov-syntax-string-escape"), i("number", "--ov-syntax-number"), i("keyword", "--ov-syntax-keyword", "--ov-syntax-style-keyword"), i("keyword.control", "--ov-syntax-keyword-control"), i("keyword.operator", "--ov-syntax-keyword-operator"), i("type", "--ov-syntax-type", "--ov-syntax-style-type"), i("type.identifier", "--ov-syntax-type"), i("class", "--ov-syntax-class"), i("interface", "--ov-syntax-interface"), i("function", "--ov-syntax-function", "--ov-syntax-style-function"), i("function.declaration", "--ov-syntax-function"), i("method", "--ov-syntax-method"), i("variable", "--ov-syntax-variable"), i("parameter", "--ov-syntax-parameter"), i("property", "--ov-syntax-property"), i("namespace", "--ov-syntax-namespace"), i("decorator", "--ov-syntax-decorator"), i("regexp", "--ov-syntax-regexp"), i("operator", "--ov-syntax-operator"), i("delimiter", "--ov-syntax-punctuation"), i("delimiter.bracket", "--ov-syntax-punctuation")].filter((y) => y !== null);
|
|
398
398
|
return {
|
|
399
|
-
base:
|
|
399
|
+
base: yr(e),
|
|
400
400
|
inherit: !0,
|
|
401
|
-
rules:
|
|
402
|
-
colors:
|
|
403
|
-
"editor.background":
|
|
404
|
-
"editor.foreground":
|
|
405
|
-
"editorCursor.foreground":
|
|
406
|
-
"editor.selectionBackground":
|
|
407
|
-
"editor.inactiveSelectionBackground":
|
|
408
|
-
"editor.lineHighlightBackground":
|
|
409
|
-
"editor.lineHighlightBorder":
|
|
410
|
-
"editorLineNumber.foreground":
|
|
411
|
-
"editorLineNumber.activeForeground":
|
|
412
|
-
"editorWhitespace.foreground":
|
|
413
|
-
"editorIndentGuide.background":
|
|
414
|
-
"editorIndentGuide.activeBackground":
|
|
415
|
-
"editorRuler.foreground":
|
|
416
|
-
"editor.findMatchBackground":
|
|
417
|
-
"editor.findMatchBorder":
|
|
418
|
-
"editor.findMatchHighlightBackground":
|
|
419
|
-
"editorLink.activeForeground":
|
|
420
|
-
"editorBracketMatch.background":
|
|
421
|
-
"editorBracketMatch.border":
|
|
422
|
-
"editorBracketHighlight.foreground1":
|
|
423
|
-
"editorBracketHighlight.foreground2":
|
|
424
|
-
"editorBracketHighlight.foreground3":
|
|
425
|
-
"editorBracketHighlight.foreground4":
|
|
426
|
-
"editorBracketHighlight.foreground5":
|
|
427
|
-
"editorBracketHighlight.foreground6":
|
|
428
|
-
"editorGutter.background":
|
|
429
|
-
"editorGutter.addedBackground":
|
|
430
|
-
"editorGutter.modifiedBackground":
|
|
431
|
-
"editorGutter.deletedBackground":
|
|
432
|
-
"diffEditor.insertedTextBackground":
|
|
433
|
-
"diffEditor.removedTextBackground":
|
|
434
|
-
"minimap.background":
|
|
435
|
-
"minimap.selectionHighlight":
|
|
436
|
-
"minimap.errorHighlight":
|
|
437
|
-
"minimap.warningHighlight":
|
|
438
|
-
"minimap.findMatchHighlight":
|
|
401
|
+
rules: d,
|
|
402
|
+
colors: br({
|
|
403
|
+
"editor.background": l("--ov-color-editor-bg"),
|
|
404
|
+
"editor.foreground": l("--ov-color-editor-fg"),
|
|
405
|
+
"editorCursor.foreground": l("--ov-color-editor-cursor"),
|
|
406
|
+
"editor.selectionBackground": l("--ov-color-editor-selection-bg"),
|
|
407
|
+
"editor.inactiveSelectionBackground": l("--ov-color-editor-selection-inactive-bg"),
|
|
408
|
+
"editor.lineHighlightBackground": l("--ov-color-editor-line-highlight-bg"),
|
|
409
|
+
"editor.lineHighlightBorder": l("--ov-color-editor-line-highlight-border"),
|
|
410
|
+
"editorLineNumber.foreground": l("--ov-color-editor-line-number"),
|
|
411
|
+
"editorLineNumber.activeForeground": l("--ov-color-editor-line-number-active"),
|
|
412
|
+
"editorWhitespace.foreground": l("--ov-color-editor-whitespace"),
|
|
413
|
+
"editorIndentGuide.background": l("--ov-color-editor-indent-guide"),
|
|
414
|
+
"editorIndentGuide.activeBackground": l("--ov-color-editor-indent-guide-active"),
|
|
415
|
+
"editorRuler.foreground": l("--ov-color-editor-ruler"),
|
|
416
|
+
"editor.findMatchBackground": l("--ov-color-editor-find-match-bg"),
|
|
417
|
+
"editor.findMatchBorder": l("--ov-color-editor-find-match-border"),
|
|
418
|
+
"editor.findMatchHighlightBackground": l("--ov-color-editor-find-range-bg"),
|
|
419
|
+
"editorLink.activeForeground": l("--ov-color-editor-link"),
|
|
420
|
+
"editorBracketMatch.background": l("--ov-color-editor-bracket-match-bg"),
|
|
421
|
+
"editorBracketMatch.border": l("--ov-color-editor-bracket-match-border"),
|
|
422
|
+
"editorBracketHighlight.foreground1": l("--ov-color-editor-bracket-1"),
|
|
423
|
+
"editorBracketHighlight.foreground2": l("--ov-color-editor-bracket-2"),
|
|
424
|
+
"editorBracketHighlight.foreground3": l("--ov-color-editor-bracket-3"),
|
|
425
|
+
"editorBracketHighlight.foreground4": l("--ov-color-editor-bracket-4"),
|
|
426
|
+
"editorBracketHighlight.foreground5": l("--ov-color-editor-bracket-5"),
|
|
427
|
+
"editorBracketHighlight.foreground6": l("--ov-color-editor-bracket-6"),
|
|
428
|
+
"editorGutter.background": l("--ov-color-gutter-bg"),
|
|
429
|
+
"editorGutter.addedBackground": l("--ov-color-gutter-added"),
|
|
430
|
+
"editorGutter.modifiedBackground": l("--ov-color-gutter-modified"),
|
|
431
|
+
"editorGutter.deletedBackground": l("--ov-color-gutter-deleted"),
|
|
432
|
+
"diffEditor.insertedTextBackground": l("--ov-color-diff-insert-bg"),
|
|
433
|
+
"diffEditor.removedTextBackground": l("--ov-color-diff-remove-bg"),
|
|
434
|
+
"minimap.background": l("--ov-color-minimap-bg"),
|
|
435
|
+
"minimap.selectionHighlight": l("--ov-color-minimap-selection"),
|
|
436
|
+
"minimap.errorHighlight": l("--ov-color-minimap-error"),
|
|
437
|
+
"minimap.warningHighlight": l("--ov-color-minimap-warning"),
|
|
438
|
+
"minimap.findMatchHighlight": l("--ov-color-minimap-find-match")
|
|
439
439
|
})
|
|
440
440
|
};
|
|
441
441
|
} finally {
|
|
442
442
|
c.dispose();
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
|
-
const
|
|
445
|
+
const pe = "ov-theme", wr = {
|
|
446
446
|
js: "javascript",
|
|
447
447
|
jsx: "javascript",
|
|
448
448
|
ts: "typescript",
|
|
@@ -501,32 +501,32 @@ const ge = "ov-theme", cr = {
|
|
|
501
501
|
vue: "html",
|
|
502
502
|
svelte: "html"
|
|
503
503
|
};
|
|
504
|
-
function
|
|
505
|
-
const t = e.toLowerCase(),
|
|
506
|
-
if (
|
|
507
|
-
if (
|
|
508
|
-
const
|
|
509
|
-
if (
|
|
510
|
-
return
|
|
504
|
+
function _r(e) {
|
|
505
|
+
const t = e.toLowerCase(), r = t.split("/").pop() ?? t;
|
|
506
|
+
if (r === "dockerfile") return "dockerfile";
|
|
507
|
+
if (r === "makefile") return "makefile";
|
|
508
|
+
const n = r.split(".").pop();
|
|
509
|
+
if (n)
|
|
510
|
+
return wr[n];
|
|
511
511
|
}
|
|
512
512
|
function se(...e) {
|
|
513
513
|
}
|
|
514
|
-
function
|
|
515
|
-
let
|
|
516
|
-
for (;
|
|
517
|
-
if (
|
|
518
|
-
|
|
519
|
-
else if (
|
|
520
|
-
c =
|
|
514
|
+
function Cr(e, t) {
|
|
515
|
+
let r = 0, n = 0, c = -1, i = -1;
|
|
516
|
+
for (; n < t.length; )
|
|
517
|
+
if (r < e.length && (e[r] === t[n] || e[r] === "?"))
|
|
518
|
+
r++, n++;
|
|
519
|
+
else if (r < e.length && e[r] === "*")
|
|
520
|
+
c = r, i = n, r++;
|
|
521
521
|
else if (c >= 0)
|
|
522
|
-
|
|
522
|
+
r = c + 1, i++, n = i;
|
|
523
523
|
else
|
|
524
524
|
return !1;
|
|
525
|
-
for (;
|
|
526
|
-
|
|
527
|
-
return
|
|
525
|
+
for (; r < e.length && e[r] === "*"; )
|
|
526
|
+
r++;
|
|
527
|
+
return r === e.length;
|
|
528
528
|
}
|
|
529
|
-
class
|
|
529
|
+
class xr {
|
|
530
530
|
_schemas = /* @__PURE__ */ new Map();
|
|
531
531
|
_listeners = /* @__PURE__ */ new Set();
|
|
532
532
|
_yamlHandle = null;
|
|
@@ -551,15 +551,15 @@ class dr {
|
|
|
551
551
|
}
|
|
552
552
|
/** Register multiple schemas at once. */
|
|
553
553
|
registerAll(t) {
|
|
554
|
-
se("registerAll() —", t.length, "schemas:", t.map((
|
|
555
|
-
for (const
|
|
556
|
-
this._schemas.set(
|
|
554
|
+
se("registerAll() —", t.length, "schemas:", t.map((r) => r.uri));
|
|
555
|
+
for (const r of t)
|
|
556
|
+
this._schemas.set(r.uri, r);
|
|
557
557
|
this._notify();
|
|
558
558
|
}
|
|
559
559
|
/** Unregister a schema by URI. */
|
|
560
560
|
unregister(t) {
|
|
561
|
-
const
|
|
562
|
-
return
|
|
561
|
+
const r = this._schemas.delete(t);
|
|
562
|
+
return r && this._notify(), r;
|
|
563
563
|
}
|
|
564
564
|
/** Clear all registered schemas. */
|
|
565
565
|
clear() {
|
|
@@ -570,7 +570,7 @@ class dr {
|
|
|
570
570
|
* model URI string. Uses the same glob-like matching that monaco-yaml uses.
|
|
571
571
|
*/
|
|
572
572
|
getSchemasForUri(t) {
|
|
573
|
-
return this.schemas.filter((
|
|
573
|
+
return this.schemas.filter((r) => r.fileMatch.some((n) => Cr(n, t)));
|
|
574
574
|
}
|
|
575
575
|
/** Whether the YAML handle has been injected (workers initialized). */
|
|
576
576
|
get isYamlReady() {
|
|
@@ -589,22 +589,22 @@ class dr {
|
|
|
589
589
|
applyYamlSchemas() {
|
|
590
590
|
if (!this._yamlHandle)
|
|
591
591
|
return;
|
|
592
|
-
const t = this.schemas,
|
|
593
|
-
uri:
|
|
594
|
-
fileMatch:
|
|
595
|
-
schema:
|
|
592
|
+
const t = this.schemas, r = t.map((n) => ({
|
|
593
|
+
uri: n.uri,
|
|
594
|
+
fileMatch: n.fileMatch,
|
|
595
|
+
schema: n.schema,
|
|
596
596
|
// name/description are passed through to yaml-language-server's
|
|
597
597
|
// registerExternalSchema — they appear in hover tooltips.
|
|
598
|
-
...
|
|
599
|
-
name:
|
|
598
|
+
...n.name && {
|
|
599
|
+
name: n.name
|
|
600
600
|
},
|
|
601
|
-
...
|
|
602
|
-
description:
|
|
601
|
+
...n.description && {
|
|
602
|
+
description: n.description
|
|
603
603
|
}
|
|
604
604
|
}));
|
|
605
605
|
se("applyYamlSchemas() — pushing", t.length, "schemas"), this._yamlHandle.update({
|
|
606
606
|
enableSchemaRequest: !1,
|
|
607
|
-
schemas:
|
|
607
|
+
schemas: r
|
|
608
608
|
});
|
|
609
609
|
}
|
|
610
610
|
/**
|
|
@@ -613,21 +613,21 @@ class dr {
|
|
|
613
613
|
* `monaco-editor` — keeping it usable before Monaco loads.
|
|
614
614
|
*/
|
|
615
615
|
applyJsonSchemas(t) {
|
|
616
|
-
const
|
|
616
|
+
const r = t, n = {
|
|
617
617
|
validate: !0,
|
|
618
|
-
schemas: this.schemas.map((
|
|
619
|
-
uri:
|
|
620
|
-
fileMatch:
|
|
621
|
-
schema:
|
|
618
|
+
schemas: this.schemas.map((i) => ({
|
|
619
|
+
uri: i.uri,
|
|
620
|
+
fileMatch: i.fileMatch,
|
|
621
|
+
schema: i.schema
|
|
622
622
|
}))
|
|
623
|
-
}, c =
|
|
624
|
-
se("applyJsonSchemas() —", this.schemas.length, "schemas, jsonDefaults available:", !!c), c?.setDiagnosticsOptions(
|
|
623
|
+
}, c = r.json?.jsonDefaults ?? r.languages?.json?.jsonDefaults;
|
|
624
|
+
se("applyJsonSchemas() —", this.schemas.length, "schemas, jsonDefaults available:", !!c), c?.setDiagnosticsOptions(n);
|
|
625
625
|
}
|
|
626
626
|
/** Log the current state of the registry for debugging. */
|
|
627
627
|
debugState() {
|
|
628
628
|
se(" Schemas:", this._schemas.size);
|
|
629
|
-
for (const [t,
|
|
630
|
-
se(` ${t} → fileMatch: ${JSON.stringify(
|
|
629
|
+
for (const [t, r] of this._schemas)
|
|
630
|
+
se(` ${t} → fileMatch: ${JSON.stringify(r.fileMatch)}`);
|
|
631
631
|
se(" Listeners:", this._listeners.size), se(" YAML handle:", this._yamlHandle ? "SET" : "NOT SET");
|
|
632
632
|
}
|
|
633
633
|
_notify() {
|
|
@@ -635,47 +635,47 @@ class dr {
|
|
|
635
635
|
for (const t of this._listeners)
|
|
636
636
|
try {
|
|
637
637
|
t();
|
|
638
|
-
} catch (
|
|
639
|
-
console.error("[schema-registry] listener threw during _notify():",
|
|
638
|
+
} catch (r) {
|
|
639
|
+
console.error("[schema-registry] listener threw during _notify():", r);
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
642
|
}
|
|
643
|
-
const
|
|
644
|
-
Root:
|
|
645
|
-
Inner:
|
|
643
|
+
const fe = new xr(), kr = "_Root_1729c_1", Rr = "_Inner_1729c_17", gt = {
|
|
644
|
+
Root: kr,
|
|
645
|
+
Inner: Rr
|
|
646
646
|
};
|
|
647
|
-
function
|
|
647
|
+
function Pe(...e) {
|
|
648
648
|
}
|
|
649
|
-
function
|
|
649
|
+
function Sr(...e) {
|
|
650
650
|
return e.filter(Boolean).join(" ");
|
|
651
651
|
}
|
|
652
|
-
function
|
|
653
|
-
if (
|
|
654
|
-
const
|
|
655
|
-
|
|
656
|
-
const c =
|
|
657
|
-
return c ||
|
|
652
|
+
function mt(e, t, r) {
|
|
653
|
+
if (r) {
|
|
654
|
+
const n = W.Uri.parse(r);
|
|
655
|
+
Pe("getOrCreateModel — parsed URI:", n.toString(), "| language:", t);
|
|
656
|
+
const c = W.editor.getModel(n);
|
|
657
|
+
return c || W.editor.createModel(e, t, n);
|
|
658
658
|
}
|
|
659
|
-
return
|
|
659
|
+
return W.editor.createModel(e, t);
|
|
660
660
|
}
|
|
661
|
-
function
|
|
661
|
+
function Tt(e) {
|
|
662
662
|
switch (e) {
|
|
663
|
-
case
|
|
663
|
+
case W.MarkerSeverity.Error:
|
|
664
664
|
return "error";
|
|
665
|
-
case
|
|
665
|
+
case W.MarkerSeverity.Warning:
|
|
666
666
|
return "warning";
|
|
667
|
-
case
|
|
667
|
+
case W.MarkerSeverity.Info:
|
|
668
668
|
return "info";
|
|
669
669
|
default:
|
|
670
670
|
return "hint";
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
|
-
function
|
|
674
|
-
return
|
|
673
|
+
function ht(e) {
|
|
674
|
+
return W.editor.getModelMarkers({
|
|
675
675
|
resource: e.uri
|
|
676
676
|
}).map((t) => ({
|
|
677
677
|
message: t.message,
|
|
678
|
-
severity:
|
|
678
|
+
severity: Tt(t.severity),
|
|
679
679
|
startLineNumber: t.startLineNumber,
|
|
680
680
|
startColumn: t.startColumn,
|
|
681
681
|
endLineNumber: t.endLineNumber,
|
|
@@ -684,39 +684,39 @@ function ut(e) {
|
|
|
684
684
|
code: typeof t.code == "string" ? t.code : t.code?.value
|
|
685
685
|
}));
|
|
686
686
|
}
|
|
687
|
-
const
|
|
687
|
+
const Mt = _e(function({
|
|
688
688
|
value: t,
|
|
689
|
-
onChange:
|
|
690
|
-
onMount:
|
|
689
|
+
onChange: r,
|
|
690
|
+
onMount: n,
|
|
691
691
|
onDiagnostics: c,
|
|
692
|
-
onCursorChange:
|
|
693
|
-
language:
|
|
694
|
-
filename:
|
|
695
|
-
readOnly:
|
|
696
|
-
lineNumbers:
|
|
697
|
-
minimap:
|
|
698
|
-
wordWrap:
|
|
699
|
-
tabSize:
|
|
700
|
-
diagnostics:
|
|
701
|
-
quickSuggestions:
|
|
702
|
-
syntaxHighlighting:
|
|
703
|
-
height:
|
|
704
|
-
width:
|
|
705
|
-
bordered:
|
|
706
|
-
className:
|
|
707
|
-
},
|
|
708
|
-
const
|
|
709
|
-
if (
|
|
692
|
+
onCursorChange: i,
|
|
693
|
+
language: l,
|
|
694
|
+
filename: d,
|
|
695
|
+
readOnly: y = !1,
|
|
696
|
+
lineNumbers: h = !0,
|
|
697
|
+
minimap: k = !1,
|
|
698
|
+
wordWrap: j = !1,
|
|
699
|
+
tabSize: m = 2,
|
|
700
|
+
diagnostics: T = !1,
|
|
701
|
+
quickSuggestions: R = !1,
|
|
702
|
+
syntaxHighlighting: H = !0,
|
|
703
|
+
height: x = "100%",
|
|
704
|
+
width: z = "100%",
|
|
705
|
+
bordered: S = !0,
|
|
706
|
+
className: D
|
|
707
|
+
}, I) {
|
|
708
|
+
const B = rt(), N = G(null), q = G(null), [P, V] = me(!1), K = G(!1), b = G(null), o = G(null), v = G(null), p = l ?? (d ? _r(d) : void 0), s = Oe(() => {
|
|
709
|
+
if (p === "json" && t)
|
|
710
710
|
try {
|
|
711
711
|
return JSON.stringify(JSON.parse(t), null, 2);
|
|
712
712
|
} catch {
|
|
713
713
|
return t;
|
|
714
714
|
}
|
|
715
715
|
return t;
|
|
716
|
-
}, [
|
|
717
|
-
|
|
718
|
-
if (!
|
|
719
|
-
|
|
716
|
+
}, [p, t]);
|
|
717
|
+
U(() => {
|
|
718
|
+
if (!q.current) return;
|
|
719
|
+
W.editor.defineTheme(pe, $e(B.base, q.current)), W.editor.setTheme(pe), W.languages.typescript.typescriptDefaults.setCompilerOptions({
|
|
720
720
|
jsx: 2,
|
|
721
721
|
// JsxEmit.React
|
|
722
722
|
jsxFactory: "React.createElement",
|
|
@@ -725,17 +725,17 @@ const gr = ve(function({
|
|
|
725
725
|
target: 99
|
|
726
726
|
// ESNext
|
|
727
727
|
});
|
|
728
|
-
const
|
|
729
|
-
|
|
730
|
-
const
|
|
731
|
-
model:
|
|
732
|
-
readOnly:
|
|
733
|
-
lineNumbers:
|
|
728
|
+
const g = mt(s, H ? p : "plaintext", d);
|
|
729
|
+
Pe(" model created — uri:", g.uri.toString());
|
|
730
|
+
const _ = W.editor.create(q.current, {
|
|
731
|
+
model: g,
|
|
732
|
+
readOnly: y,
|
|
733
|
+
lineNumbers: h ? "on" : "off",
|
|
734
734
|
minimap: {
|
|
735
|
-
enabled:
|
|
735
|
+
enabled: k
|
|
736
736
|
},
|
|
737
|
-
wordWrap:
|
|
738
|
-
quickSuggestions:
|
|
737
|
+
wordWrap: j ? "on" : "off",
|
|
738
|
+
quickSuggestions: R ? {
|
|
739
739
|
other: !0,
|
|
740
740
|
strings: !0,
|
|
741
741
|
comments: !1
|
|
@@ -744,1327 +744,1858 @@ const gr = ve(function({
|
|
|
744
744
|
automaticLayout: !0,
|
|
745
745
|
fontSize: 13,
|
|
746
746
|
fontFamily: "var(--ov-font-family-mono, monospace)",
|
|
747
|
-
tabSize:
|
|
748
|
-
renderValidationDecorations:
|
|
747
|
+
tabSize: m,
|
|
748
|
+
renderValidationDecorations: T ? "on" : "off"
|
|
749
749
|
});
|
|
750
|
-
return
|
|
751
|
-
|
|
752
|
-
const
|
|
753
|
-
|
|
750
|
+
return N.current = _, fe.applyYamlSchemas(), fe.applyJsonSchemas(W), n?.(_, W), V(!0), () => {
|
|
751
|
+
b.current?.dispose(), b.current = null, o.current?.dispose(), o.current = null, v.current?.dispose(), v.current = null;
|
|
752
|
+
const C = _.getModel();
|
|
753
|
+
_.setModel(null), C?.dispose(), _.dispose(), N.current = null, V(!1);
|
|
754
754
|
};
|
|
755
|
-
}, []),
|
|
756
|
-
const
|
|
757
|
-
if (!(!
|
|
758
|
-
if (
|
|
759
|
-
|
|
760
|
-
else if (
|
|
761
|
-
const
|
|
762
|
-
if (!
|
|
763
|
-
|
|
764
|
-
range:
|
|
765
|
-
text:
|
|
755
|
+
}, []), U(() => {
|
|
756
|
+
const g = N.current;
|
|
757
|
+
if (!(!g || !P || s === void 0)) {
|
|
758
|
+
if (g.getOption(W.editor.EditorOption.readOnly))
|
|
759
|
+
g.setValue(s);
|
|
760
|
+
else if (s !== g.getValue()) {
|
|
761
|
+
const _ = g.getModel();
|
|
762
|
+
if (!_) return;
|
|
763
|
+
K.current = !0, g.executeEdits("", [{
|
|
764
|
+
range: _.getFullModelRange(),
|
|
765
|
+
text: s,
|
|
766
766
|
forceMoveMarkers: !0
|
|
767
|
-
}]),
|
|
767
|
+
}]), g.pushUndoStop(), K.current = !1;
|
|
768
768
|
}
|
|
769
769
|
}
|
|
770
|
-
}, [
|
|
771
|
-
!
|
|
772
|
-
readOnly:
|
|
773
|
-
lineNumbers:
|
|
770
|
+
}, [s, P]), U(() => {
|
|
771
|
+
!N.current || !P || N.current.updateOptions({
|
|
772
|
+
readOnly: y,
|
|
773
|
+
lineNumbers: h ? "on" : "off",
|
|
774
774
|
minimap: {
|
|
775
|
-
enabled:
|
|
775
|
+
enabled: k
|
|
776
776
|
},
|
|
777
|
-
wordWrap:
|
|
778
|
-
quickSuggestions:
|
|
777
|
+
wordWrap: j ? "on" : "off",
|
|
778
|
+
quickSuggestions: R ? {
|
|
779
779
|
other: !0,
|
|
780
780
|
strings: !0,
|
|
781
781
|
comments: !1
|
|
782
782
|
} : !1,
|
|
783
|
-
tabSize:
|
|
784
|
-
renderValidationDecorations:
|
|
783
|
+
tabSize: m,
|
|
784
|
+
renderValidationDecorations: T ? "on" : "off"
|
|
785
785
|
});
|
|
786
|
-
}, [
|
|
787
|
-
if (!
|
|
788
|
-
const
|
|
789
|
-
if (
|
|
790
|
-
const
|
|
791
|
-
|
|
792
|
-
}
|
|
793
|
-
}, [
|
|
794
|
-
const u =
|
|
795
|
-
|
|
796
|
-
const
|
|
797
|
-
if (!
|
|
798
|
-
|
|
799
|
-
const
|
|
800
|
-
|
|
801
|
-
const
|
|
802
|
-
|
|
803
|
-
}, [
|
|
804
|
-
P && (
|
|
805
|
-
}, [P,
|
|
806
|
-
!
|
|
807
|
-
|
|
786
|
+
}, [y, h, k, j, R, m, T, P]), U(() => {
|
|
787
|
+
if (!N.current || !P) return;
|
|
788
|
+
const g = N.current.getModel();
|
|
789
|
+
if (g) {
|
|
790
|
+
const _ = H ? p ?? "plaintext" : "plaintext";
|
|
791
|
+
W.editor.setModelLanguage(g, _);
|
|
792
|
+
}
|
|
793
|
+
}, [p, H, P]);
|
|
794
|
+
const u = G(d);
|
|
795
|
+
U(() => {
|
|
796
|
+
const g = N.current;
|
|
797
|
+
if (!g || !P || u.current === d) return;
|
|
798
|
+
Pe("filename changed:", u.current, "→", d), u.current = d;
|
|
799
|
+
const _ = g.getModel(), C = _?.getValue?.() ?? s;
|
|
800
|
+
g.setModel(null), _?.dispose();
|
|
801
|
+
const a = mt(C, H ? p : "plaintext", d);
|
|
802
|
+
g.setModel(a), Pe(" new model set — uri:", a.uri.toString());
|
|
803
|
+
}, [d, P, p, H, s]), U(() => {
|
|
804
|
+
P && (W.editor.defineTheme(pe, $e(B.base, q.current)), W.editor.setTheme(pe));
|
|
805
|
+
}, [P, B.registration]), U(() => {
|
|
806
|
+
!N.current || !P || (b.current?.dispose(), r && (b.current = N.current.onDidChangeModelContent(() => {
|
|
807
|
+
K.current || r(N.current.getValue());
|
|
808
808
|
})));
|
|
809
|
-
}, [
|
|
810
|
-
P && (
|
|
811
|
-
const
|
|
812
|
-
if (!
|
|
813
|
-
const
|
|
814
|
-
|
|
809
|
+
}, [r, P]), U(() => {
|
|
810
|
+
P && (o.current?.dispose(), c && (o.current = W.editor.onDidChangeMarkers((g) => {
|
|
811
|
+
const _ = N.current?.getModel();
|
|
812
|
+
if (!_) return;
|
|
813
|
+
const C = _.uri.toString();
|
|
814
|
+
g.some((a) => a.toString() === C) && c(ht(_));
|
|
815
815
|
})));
|
|
816
|
-
}, [c, P]),
|
|
817
|
-
!
|
|
818
|
-
|
|
819
|
-
lineNumber:
|
|
820
|
-
column:
|
|
816
|
+
}, [c, P]), U(() => {
|
|
817
|
+
!N.current || !P || (v.current?.dispose(), i && (v.current = N.current.onDidChangeCursorPosition((g) => {
|
|
818
|
+
i({
|
|
819
|
+
lineNumber: g.position.lineNumber,
|
|
820
|
+
column: g.position.column
|
|
821
821
|
});
|
|
822
822
|
})));
|
|
823
|
-
}, [
|
|
823
|
+
}, [i, P]), U(() => {
|
|
824
824
|
if (P)
|
|
825
|
-
return
|
|
826
|
-
|
|
825
|
+
return fe.onChange(() => {
|
|
826
|
+
fe.applyYamlSchemas(), fe.applyJsonSchemas(W);
|
|
827
827
|
});
|
|
828
|
-
}, [P]),
|
|
829
|
-
getEditor: () =>
|
|
830
|
-
getMonaco: () =>
|
|
831
|
-
focus: () =>
|
|
828
|
+
}, [P]), xt(I, () => ({
|
|
829
|
+
getEditor: () => N.current,
|
|
830
|
+
getMonaco: () => W,
|
|
831
|
+
focus: () => N.current?.focus(),
|
|
832
832
|
getDiagnostics: () => {
|
|
833
|
-
const
|
|
834
|
-
return
|
|
833
|
+
const g = N.current?.getModel();
|
|
834
|
+
return g ? ht(g) : [];
|
|
835
835
|
},
|
|
836
836
|
getDebugState: () => {
|
|
837
|
-
const
|
|
838
|
-
resource:
|
|
839
|
-
}) : [],
|
|
837
|
+
const g = N.current, _ = g?.getModel() ?? null, C = _ ? W.editor.getModelMarkers({
|
|
838
|
+
resource: _.uri
|
|
839
|
+
}) : [], a = _?.uri.toString() ?? null, w = {
|
|
840
840
|
error: 0,
|
|
841
841
|
warning: 0,
|
|
842
842
|
info: 0,
|
|
843
843
|
hint: 0
|
|
844
|
-
},
|
|
845
|
-
for (const
|
|
846
|
-
const
|
|
847
|
-
|
|
848
|
-
const
|
|
849
|
-
|
|
844
|
+
}, A = {};
|
|
845
|
+
for (const $ of C) {
|
|
846
|
+
const J = Tt($.severity);
|
|
847
|
+
w[J]++;
|
|
848
|
+
const Z = $.source ?? "unknown";
|
|
849
|
+
A[Z] = (A[Z] ?? 0) + 1;
|
|
850
850
|
}
|
|
851
|
-
const
|
|
852
|
-
uri:
|
|
853
|
-
name:
|
|
854
|
-
fileMatch:
|
|
855
|
-
})) : [],
|
|
851
|
+
const L = a ? fe.getSchemasForUri(a).map(($) => ({
|
|
852
|
+
uri: $.uri,
|
|
853
|
+
name: $.name,
|
|
854
|
+
fileMatch: $.fileMatch
|
|
855
|
+
})) : [], F = g?.getPosition() ?? null, O = g?.getSelections() ?? [];
|
|
856
856
|
return {
|
|
857
|
-
modelUri:
|
|
858
|
-
modelLanguage:
|
|
859
|
-
modelLineCount:
|
|
860
|
-
modelContentLength:
|
|
861
|
-
modelVersionId:
|
|
862
|
-
modelEOL:
|
|
863
|
-
cursorPosition:
|
|
864
|
-
lineNumber:
|
|
865
|
-
column:
|
|
857
|
+
modelUri: a,
|
|
858
|
+
modelLanguage: _?.getLanguageId() ?? null,
|
|
859
|
+
modelLineCount: _?.getLineCount() ?? 0,
|
|
860
|
+
modelContentLength: _?.getValueLength() ?? 0,
|
|
861
|
+
modelVersionId: _?.getVersionId() ?? 0,
|
|
862
|
+
modelEOL: _?.getEOL() ?? null,
|
|
863
|
+
cursorPosition: F ? {
|
|
864
|
+
lineNumber: F.lineNumber,
|
|
865
|
+
column: F.column
|
|
866
866
|
} : null,
|
|
867
|
-
selections:
|
|
868
|
-
startLineNumber:
|
|
869
|
-
startColumn:
|
|
870
|
-
endLineNumber:
|
|
871
|
-
endColumn:
|
|
867
|
+
selections: O.map(($) => ({
|
|
868
|
+
startLineNumber: $.startLineNumber,
|
|
869
|
+
startColumn: $.startColumn,
|
|
870
|
+
endLineNumber: $.endLineNumber,
|
|
871
|
+
endColumn: $.endColumn
|
|
872
872
|
})),
|
|
873
|
-
diagnosticsTotal:
|
|
874
|
-
diagnosticsBySeverity:
|
|
875
|
-
diagnosticsBySource:
|
|
876
|
-
registeredSchemaCount:
|
|
877
|
-
matchingSchemas:
|
|
878
|
-
isReadOnly:
|
|
879
|
-
isFocused:
|
|
880
|
-
totalModelCount:
|
|
881
|
-
registeredLanguageCount:
|
|
882
|
-
yamlHandleSet:
|
|
873
|
+
diagnosticsTotal: C.length,
|
|
874
|
+
diagnosticsBySeverity: w,
|
|
875
|
+
diagnosticsBySource: A,
|
|
876
|
+
registeredSchemaCount: fe.schemas.length,
|
|
877
|
+
matchingSchemas: L,
|
|
878
|
+
isReadOnly: g?.getOption(W.editor.EditorOption.readOnly) ?? !1,
|
|
879
|
+
isFocused: g?.hasWidgetFocus() ?? !1,
|
|
880
|
+
totalModelCount: W.editor.getModels().length,
|
|
881
|
+
registeredLanguageCount: W.languages.getLanguages().length,
|
|
882
|
+
yamlHandleSet: fe.isYamlReady
|
|
883
883
|
};
|
|
884
884
|
}
|
|
885
885
|
}));
|
|
886
|
-
const
|
|
887
|
-
return /* @__PURE__ */
|
|
888
|
-
"--_editor-height":
|
|
889
|
-
"--_editor-width":
|
|
890
|
-
}, "data-testid": "code-editor", ...
|
|
886
|
+
const f = (g) => typeof g == "number" ? `${g}px` : g;
|
|
887
|
+
return /* @__PURE__ */ E.jsx("div", { className: Sr(gt.Root, D), style: {
|
|
888
|
+
"--_editor-height": f(x),
|
|
889
|
+
"--_editor-width": f(z)
|
|
890
|
+
}, "data-testid": "code-editor", ...S ? {} : {
|
|
891
891
|
"data-borderless": ""
|
|
892
|
-
}, children: /* @__PURE__ */
|
|
892
|
+
}, children: /* @__PURE__ */ E.jsx("div", { ref: q, className: gt.Inner }) });
|
|
893
893
|
});
|
|
894
|
-
|
|
895
|
-
const
|
|
896
|
-
|
|
897
|
-
|
|
894
|
+
Mt.displayName = "CodeEditor";
|
|
895
|
+
const Er = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
896
|
+
__proto__: null,
|
|
897
|
+
CodeEditor: Mt
|
|
898
|
+
}, Symbol.toStringTag, { value: "Module" })), Tr = "_Root_1ltbg_1", Mr = "_Inner_1ltbg_16", pt = {
|
|
899
|
+
Root: Tr,
|
|
900
|
+
Inner: Mr
|
|
898
901
|
};
|
|
899
|
-
function
|
|
902
|
+
function jr(...e) {
|
|
900
903
|
return e.filter(Boolean).join(" ");
|
|
901
904
|
}
|
|
902
|
-
const
|
|
905
|
+
const Nr = _e(function({
|
|
903
906
|
original: t,
|
|
904
|
-
modified:
|
|
905
|
-
language:
|
|
907
|
+
modified: r,
|
|
908
|
+
language: n,
|
|
906
909
|
mode: c = "side-by-side",
|
|
907
|
-
readOnly:
|
|
908
|
-
height:
|
|
909
|
-
bordered:
|
|
910
|
-
className:
|
|
911
|
-
},
|
|
912
|
-
const
|
|
913
|
-
|
|
914
|
-
if (!
|
|
915
|
-
|
|
916
|
-
const
|
|
917
|
-
readOnly:
|
|
910
|
+
readOnly: i = !0,
|
|
911
|
+
height: l = "100%",
|
|
912
|
+
bordered: d = !0,
|
|
913
|
+
className: y
|
|
914
|
+
}, h) {
|
|
915
|
+
const k = rt(), j = G(null), m = G(null), [T, R] = me(!1);
|
|
916
|
+
U(() => {
|
|
917
|
+
if (!j.current) return;
|
|
918
|
+
W.editor.defineTheme(pe, $e(k.base, j.current)), W.editor.setTheme(pe);
|
|
919
|
+
const x = W.editor.createDiffEditor(j.current, {
|
|
920
|
+
readOnly: i,
|
|
918
921
|
renderSideBySide: c === "side-by-side",
|
|
919
922
|
renderValidationDecorations: "off",
|
|
920
923
|
scrollBeyondLastLine: !1,
|
|
921
924
|
automaticLayout: !0,
|
|
922
925
|
fontSize: 13,
|
|
923
926
|
fontFamily: "var(--ov-font-family-mono, monospace)"
|
|
924
|
-
}),
|
|
925
|
-
return
|
|
926
|
-
original:
|
|
927
|
-
modified:
|
|
928
|
-
}),
|
|
929
|
-
|
|
927
|
+
}), z = W.editor.createModel(t, n), S = W.editor.createModel(r, n);
|
|
928
|
+
return x.setModel({
|
|
929
|
+
original: z,
|
|
930
|
+
modified: S
|
|
931
|
+
}), m.current = x, R(!0), () => {
|
|
932
|
+
x.getModel()?.original?.dispose(), x.getModel()?.modified?.dispose(), x.dispose(), m.current = null, R(!1);
|
|
930
933
|
};
|
|
931
|
-
}, []),
|
|
932
|
-
if (!
|
|
933
|
-
const
|
|
934
|
-
|
|
935
|
-
}, [t,
|
|
936
|
-
if (!
|
|
937
|
-
const
|
|
938
|
-
|
|
939
|
-
}, [
|
|
940
|
-
if (!
|
|
941
|
-
const
|
|
942
|
-
|
|
943
|
-
}, [
|
|
944
|
-
!
|
|
945
|
-
readOnly:
|
|
934
|
+
}, []), U(() => {
|
|
935
|
+
if (!m.current || !T) return;
|
|
936
|
+
const x = m.current.getModel()?.original;
|
|
937
|
+
x && t !== x.getValue() && x.setValue(t);
|
|
938
|
+
}, [t, T]), U(() => {
|
|
939
|
+
if (!m.current || !T) return;
|
|
940
|
+
const x = m.current.getModifiedEditor();
|
|
941
|
+
r !== x.getValue() && m.current.getModel()?.modified?.setValue(r);
|
|
942
|
+
}, [r, T]), U(() => {
|
|
943
|
+
if (!m.current || !T) return;
|
|
944
|
+
const x = n ?? "plaintext", z = m.current.getModel();
|
|
945
|
+
z?.original && W.editor.setModelLanguage(z.original, x), z?.modified && W.editor.setModelLanguage(z.modified, x);
|
|
946
|
+
}, [n, T]), U(() => {
|
|
947
|
+
!m.current || !T || m.current.updateOptions({
|
|
948
|
+
readOnly: i,
|
|
946
949
|
renderSideBySide: c === "side-by-side"
|
|
947
950
|
});
|
|
948
|
-
}, [
|
|
949
|
-
|
|
950
|
-
}, [
|
|
951
|
-
const
|
|
952
|
-
return /* @__PURE__ */
|
|
953
|
-
"--_diff-height":
|
|
954
|
-
}, "data-testid": "diff-viewer", ...
|
|
951
|
+
}, [i, c, T]), U(() => {
|
|
952
|
+
T && (W.editor.defineTheme(pe, $e(k.base, j.current)), W.editor.setTheme(pe));
|
|
953
|
+
}, [T, k.registration]);
|
|
954
|
+
const H = (x) => typeof x == "number" ? `${x}px` : x;
|
|
955
|
+
return /* @__PURE__ */ E.jsx("div", { ref: h, className: jr(pt.Root, y), style: {
|
|
956
|
+
"--_diff-height": H(l ?? "100%")
|
|
957
|
+
}, "data-testid": "diff-viewer", ...d ? {} : {
|
|
955
958
|
"data-borderless": ""
|
|
956
|
-
}, children: /* @__PURE__ */
|
|
959
|
+
}, children: /* @__PURE__ */ E.jsx("div", { ref: j, className: pt.Inner }) });
|
|
957
960
|
});
|
|
958
|
-
|
|
959
|
-
function
|
|
960
|
-
const t =
|
|
961
|
+
Nr.displayName = "DiffViewer";
|
|
962
|
+
function Je(e) {
|
|
963
|
+
const t = tt(e), r = (n, c = "") => t?.getPropertyValue(n).trim() || c;
|
|
961
964
|
return {
|
|
962
|
-
background:
|
|
963
|
-
foreground:
|
|
964
|
-
cursor:
|
|
965
|
-
selectionBackground:
|
|
966
|
-
selectionForeground:
|
|
967
|
-
black:
|
|
968
|
-
red:
|
|
969
|
-
green:
|
|
970
|
-
yellow:
|
|
971
|
-
blue:
|
|
972
|
-
magenta:
|
|
973
|
-
cyan:
|
|
974
|
-
white:
|
|
975
|
-
brightBlack:
|
|
976
|
-
brightRed:
|
|
977
|
-
brightGreen:
|
|
978
|
-
brightYellow:
|
|
979
|
-
brightBlue:
|
|
980
|
-
brightMagenta:
|
|
981
|
-
brightCyan:
|
|
982
|
-
brightWhite:
|
|
965
|
+
background: r("--ov-color-terminal-bg", "#0d0e10"),
|
|
966
|
+
foreground: r("--ov-color-terminal-fg", "#e2e7ee"),
|
|
967
|
+
cursor: r("--ov-color-terminal-cursor", "#89a7ee"),
|
|
968
|
+
selectionBackground: r("--ov-color-terminal-selection-bg", "rgba(90,127,226,0.18)"),
|
|
969
|
+
selectionForeground: r("--ov-color-terminal-selection-fg") || void 0,
|
|
970
|
+
black: r("--ov-color-ansi-black", "#3b4252"),
|
|
971
|
+
red: r("--ov-color-ansi-red", "#bf616a"),
|
|
972
|
+
green: r("--ov-color-ansi-green", "#a3be8c"),
|
|
973
|
+
yellow: r("--ov-color-ansi-yellow", "#ebcb8b"),
|
|
974
|
+
blue: r("--ov-color-ansi-blue", "#81a1c1"),
|
|
975
|
+
magenta: r("--ov-color-ansi-magenta", "#b48ead"),
|
|
976
|
+
cyan: r("--ov-color-ansi-cyan", "#88c0d0"),
|
|
977
|
+
white: r("--ov-color-ansi-white", "#e5e9f0"),
|
|
978
|
+
brightBlack: r("--ov-color-ansi-bright-black", "#4c566a"),
|
|
979
|
+
brightRed: r("--ov-color-ansi-bright-red", "#d08770"),
|
|
980
|
+
brightGreen: r("--ov-color-ansi-bright-green", "#a3be8c"),
|
|
981
|
+
brightYellow: r("--ov-color-ansi-bright-yellow", "#ebcb8b"),
|
|
982
|
+
brightBlue: r("--ov-color-ansi-bright-blue", "#81a1c1"),
|
|
983
|
+
brightMagenta: r("--ov-color-ansi-bright-magenta", "#b48ead"),
|
|
984
|
+
brightCyan: r("--ov-color-ansi-bright-cyan", "#8fbcbb"),
|
|
985
|
+
brightWhite: r("--ov-color-ansi-bright-white", "#eceff4")
|
|
983
986
|
};
|
|
984
987
|
}
|
|
985
|
-
const
|
|
986
|
-
Root:
|
|
988
|
+
const Ar = "_Root_1s8vo_1", Lr = {
|
|
989
|
+
Root: Ar
|
|
987
990
|
};
|
|
988
|
-
function
|
|
991
|
+
function Pr(...e) {
|
|
989
992
|
return e.filter(Boolean).join(" ");
|
|
990
993
|
}
|
|
991
|
-
function
|
|
992
|
-
let
|
|
994
|
+
function Or(e, t) {
|
|
995
|
+
let r = null;
|
|
993
996
|
return {
|
|
994
|
-
run: (...
|
|
995
|
-
|
|
996
|
-
|
|
997
|
+
run: (...n) => {
|
|
998
|
+
r !== null && clearTimeout(r), r = setTimeout(() => {
|
|
999
|
+
r = null, e(...n);
|
|
997
1000
|
}, t);
|
|
998
1001
|
},
|
|
999
1002
|
cancel: () => {
|
|
1000
|
-
|
|
1003
|
+
r !== null && (clearTimeout(r), r = null);
|
|
1001
1004
|
}
|
|
1002
1005
|
};
|
|
1003
1006
|
}
|
|
1004
|
-
const
|
|
1007
|
+
const Dr = _e(function({
|
|
1005
1008
|
onData: t,
|
|
1006
|
-
onBinaryData:
|
|
1007
|
-
onResize:
|
|
1009
|
+
onBinaryData: r,
|
|
1010
|
+
onResize: n,
|
|
1008
1011
|
onSignal: c,
|
|
1009
|
-
onError:
|
|
1010
|
-
onClose:
|
|
1011
|
-
onReady:
|
|
1012
|
-
onBell:
|
|
1013
|
-
onTitleChange:
|
|
1014
|
-
onKey:
|
|
1015
|
-
onSelectionChange:
|
|
1016
|
-
onLineFeed:
|
|
1017
|
-
onScroll:
|
|
1018
|
-
onWriteParsed:
|
|
1019
|
-
fontSize:
|
|
1020
|
-
fontFamily:
|
|
1021
|
-
fontWeight:
|
|
1022
|
-
fontWeightBold:
|
|
1023
|
-
scrollback:
|
|
1024
|
-
cursorBlink:
|
|
1025
|
-
cursorStyle:
|
|
1026
|
-
cursorWidth:
|
|
1027
|
-
lineHeight:
|
|
1012
|
+
onError: i,
|
|
1013
|
+
onClose: l,
|
|
1014
|
+
onReady: d,
|
|
1015
|
+
onBell: y,
|
|
1016
|
+
onTitleChange: h,
|
|
1017
|
+
onKey: k,
|
|
1018
|
+
onSelectionChange: j,
|
|
1019
|
+
onLineFeed: m,
|
|
1020
|
+
onScroll: T,
|
|
1021
|
+
onWriteParsed: R,
|
|
1022
|
+
fontSize: H = 13,
|
|
1023
|
+
fontFamily: x,
|
|
1024
|
+
fontWeight: z,
|
|
1025
|
+
fontWeightBold: S,
|
|
1026
|
+
scrollback: D = 5e3,
|
|
1027
|
+
cursorBlink: I = !0,
|
|
1028
|
+
cursorStyle: B,
|
|
1029
|
+
cursorWidth: N,
|
|
1030
|
+
lineHeight: q,
|
|
1028
1031
|
letterSpacing: P,
|
|
1029
|
-
drawBoldTextInBrightColors:
|
|
1030
|
-
convertEol:
|
|
1031
|
-
allowTransparency:
|
|
1032
|
-
macOptionIsMeta:
|
|
1033
|
-
macOptionClickForcesSelection:
|
|
1034
|
-
linkHandling:
|
|
1035
|
-
disableStdin:
|
|
1032
|
+
drawBoldTextInBrightColors: V = !0,
|
|
1033
|
+
convertEol: K = !0,
|
|
1034
|
+
allowTransparency: b = !0,
|
|
1035
|
+
macOptionIsMeta: o = !0,
|
|
1036
|
+
macOptionClickForcesSelection: v = !0,
|
|
1037
|
+
linkHandling: p = !0,
|
|
1038
|
+
disableStdin: s,
|
|
1036
1039
|
customKeyEventHandler: u,
|
|
1037
|
-
autoFocus:
|
|
1038
|
-
renderer:
|
|
1039
|
-
rows:
|
|
1040
|
-
cols:
|
|
1041
|
-
screenReaderMode:
|
|
1042
|
-
minimumContrastRatio:
|
|
1043
|
-
className:
|
|
1044
|
-
},
|
|
1045
|
-
const
|
|
1040
|
+
autoFocus: f = !1,
|
|
1041
|
+
renderer: g = "auto",
|
|
1042
|
+
rows: _,
|
|
1043
|
+
cols: C,
|
|
1044
|
+
screenReaderMode: a,
|
|
1045
|
+
minimumContrastRatio: w,
|
|
1046
|
+
className: A
|
|
1047
|
+
}, L) {
|
|
1048
|
+
const F = G(null), O = G(null), $ = G(null), J = G(null), Z = G(null), oe = G([]), le = G(null), ae = G(null), X = G(null), ce = rt(), te = G({
|
|
1046
1049
|
onData: t,
|
|
1047
|
-
onBinaryData:
|
|
1048
|
-
onResize:
|
|
1050
|
+
onBinaryData: r,
|
|
1051
|
+
onResize: n,
|
|
1049
1052
|
onSignal: c,
|
|
1050
|
-
onError:
|
|
1051
|
-
onClose:
|
|
1052
|
-
onReady:
|
|
1053
|
-
onBell:
|
|
1054
|
-
onTitleChange:
|
|
1055
|
-
onKey:
|
|
1056
|
-
onSelectionChange:
|
|
1057
|
-
onLineFeed:
|
|
1058
|
-
onScroll:
|
|
1059
|
-
onWriteParsed:
|
|
1053
|
+
onError: i,
|
|
1054
|
+
onClose: l,
|
|
1055
|
+
onReady: d,
|
|
1056
|
+
onBell: y,
|
|
1057
|
+
onTitleChange: h,
|
|
1058
|
+
onKey: k,
|
|
1059
|
+
onSelectionChange: j,
|
|
1060
|
+
onLineFeed: m,
|
|
1061
|
+
onScroll: T,
|
|
1062
|
+
onWriteParsed: R
|
|
1060
1063
|
});
|
|
1061
|
-
|
|
1064
|
+
te.current = {
|
|
1062
1065
|
onData: t,
|
|
1063
|
-
onBinaryData:
|
|
1064
|
-
onResize:
|
|
1066
|
+
onBinaryData: r,
|
|
1067
|
+
onResize: n,
|
|
1065
1068
|
onSignal: c,
|
|
1066
|
-
onError:
|
|
1067
|
-
onClose:
|
|
1068
|
-
onReady:
|
|
1069
|
-
onBell:
|
|
1070
|
-
onTitleChange:
|
|
1071
|
-
onKey:
|
|
1072
|
-
onSelectionChange:
|
|
1073
|
-
onLineFeed:
|
|
1074
|
-
onScroll:
|
|
1075
|
-
onWriteParsed:
|
|
1069
|
+
onError: i,
|
|
1070
|
+
onClose: l,
|
|
1071
|
+
onReady: d,
|
|
1072
|
+
onBell: y,
|
|
1073
|
+
onTitleChange: h,
|
|
1074
|
+
onKey: k,
|
|
1075
|
+
onSelectionChange: j,
|
|
1076
|
+
onLineFeed: m,
|
|
1077
|
+
onScroll: T,
|
|
1078
|
+
onWriteParsed: R
|
|
1076
1079
|
};
|
|
1077
|
-
const
|
|
1080
|
+
const Ie = De(() => {
|
|
1078
1081
|
try {
|
|
1079
|
-
|
|
1082
|
+
$.current?.fit?.();
|
|
1080
1083
|
} catch {
|
|
1081
1084
|
}
|
|
1082
1085
|
}, []);
|
|
1083
|
-
return
|
|
1084
|
-
write: (
|
|
1085
|
-
|
|
1086
|
+
return xt(L, () => ({
|
|
1087
|
+
write: (M) => {
|
|
1088
|
+
O.current?.write?.(M);
|
|
1086
1089
|
},
|
|
1087
|
-
writeln: (
|
|
1088
|
-
|
|
1090
|
+
writeln: (M) => {
|
|
1091
|
+
O.current?.writeln?.(M);
|
|
1089
1092
|
},
|
|
1090
1093
|
clear: () => {
|
|
1091
|
-
|
|
1094
|
+
O.current?.clear?.();
|
|
1092
1095
|
},
|
|
1093
1096
|
focus: () => {
|
|
1094
|
-
|
|
1097
|
+
O.current?.focus?.();
|
|
1095
1098
|
},
|
|
1096
1099
|
blur: () => {
|
|
1097
|
-
|
|
1100
|
+
O.current?.blur?.();
|
|
1098
1101
|
},
|
|
1099
|
-
fit:
|
|
1102
|
+
fit: Ie,
|
|
1100
1103
|
getDimensions: () => {
|
|
1101
|
-
const
|
|
1102
|
-
return
|
|
1103
|
-
cols:
|
|
1104
|
-
rows:
|
|
1104
|
+
const M = O.current;
|
|
1105
|
+
return M && typeof M.cols == "number" && typeof M.rows == "number" ? {
|
|
1106
|
+
cols: M.cols,
|
|
1107
|
+
rows: M.rows
|
|
1105
1108
|
} : null;
|
|
1106
1109
|
},
|
|
1107
1110
|
reset: () => {
|
|
1108
|
-
|
|
1111
|
+
O.current?.reset?.();
|
|
1109
1112
|
},
|
|
1110
1113
|
scrollToBottom: () => {
|
|
1111
|
-
|
|
1114
|
+
O.current?.scrollToBottom?.();
|
|
1112
1115
|
},
|
|
1113
|
-
findNext: (
|
|
1114
|
-
findPrevious: (
|
|
1116
|
+
findNext: (M, re) => J.current?.findNext?.(M, re) ?? !1,
|
|
1117
|
+
findPrevious: (M, re) => J.current?.findPrevious?.(M, re) ?? !1,
|
|
1115
1118
|
clearSearch: () => {
|
|
1116
|
-
|
|
1119
|
+
J.current?.clearDecorations?.();
|
|
1117
1120
|
},
|
|
1118
|
-
getSelection: () =>
|
|
1119
|
-
hasSelection: () =>
|
|
1121
|
+
getSelection: () => O.current?.getSelection?.() ?? "",
|
|
1122
|
+
hasSelection: () => O.current?.hasSelection?.() ?? !1,
|
|
1120
1123
|
selectAll: () => {
|
|
1121
|
-
|
|
1124
|
+
O.current?.selectAll?.();
|
|
1122
1125
|
},
|
|
1123
1126
|
clearSelection: () => {
|
|
1124
|
-
|
|
1127
|
+
O.current?.clearSelection?.();
|
|
1125
1128
|
},
|
|
1126
|
-
scrollToLine: (
|
|
1127
|
-
|
|
1129
|
+
scrollToLine: (M) => {
|
|
1130
|
+
O.current?.scrollToLine?.(M);
|
|
1128
1131
|
},
|
|
1129
|
-
scrollUp: (
|
|
1130
|
-
|
|
1132
|
+
scrollUp: (M) => {
|
|
1133
|
+
O.current?.scrollLines?.(-M);
|
|
1131
1134
|
},
|
|
1132
|
-
scrollDown: (
|
|
1133
|
-
|
|
1135
|
+
scrollDown: (M) => {
|
|
1136
|
+
O.current?.scrollLines?.(M);
|
|
1134
1137
|
},
|
|
1135
|
-
paste: (
|
|
1136
|
-
|
|
1138
|
+
paste: (M) => {
|
|
1139
|
+
O.current?.paste?.(M);
|
|
1137
1140
|
},
|
|
1138
|
-
getBufferContent: () =>
|
|
1139
|
-
})),
|
|
1140
|
-
const
|
|
1141
|
-
if (!
|
|
1142
|
-
let
|
|
1143
|
-
async function
|
|
1141
|
+
getBufferContent: () => Z.current?.serialize?.() ?? ""
|
|
1142
|
+
})), U(() => {
|
|
1143
|
+
const M = F.current;
|
|
1144
|
+
if (!M) return;
|
|
1145
|
+
let re = !1;
|
|
1146
|
+
async function We() {
|
|
1144
1147
|
await document.fonts.ready;
|
|
1145
1148
|
const [{
|
|
1146
|
-
Terminal:
|
|
1149
|
+
Terminal: ye
|
|
1147
1150
|
}, {
|
|
1148
|
-
FitAddon:
|
|
1151
|
+
FitAddon: He
|
|
1149
1152
|
}, {
|
|
1150
|
-
SearchAddon:
|
|
1153
|
+
SearchAddon: Bt
|
|
1151
1154
|
}, {
|
|
1152
|
-
SerializeAddon:
|
|
1155
|
+
SerializeAddon: qt
|
|
1153
1156
|
}, {
|
|
1154
|
-
Unicode11Addon:
|
|
1157
|
+
Unicode11Addon: zt
|
|
1155
1158
|
}] = await Promise.all([import("@xterm/xterm"), import("@xterm/addon-fit"), import("@xterm/addon-search"), import("@xterm/addon-serialize"), import("@xterm/addon-unicode11")]);
|
|
1156
|
-
if (
|
|
1157
|
-
const
|
|
1158
|
-
fontSize:
|
|
1159
|
-
fontFamily:
|
|
1160
|
-
theme:
|
|
1161
|
-
allowTransparency:
|
|
1162
|
-
cursorBlink:
|
|
1163
|
-
convertEol:
|
|
1164
|
-
scrollback:
|
|
1165
|
-
macOptionIsMeta:
|
|
1166
|
-
macOptionClickForcesSelection:
|
|
1159
|
+
if (re) return;
|
|
1160
|
+
const Vt = Je(M), ie = {
|
|
1161
|
+
fontSize: H,
|
|
1162
|
+
fontFamily: x || "'Menlo', 'Monaco', 'Consolas', 'Liberation Mono', 'Courier New', monospace",
|
|
1163
|
+
theme: Vt,
|
|
1164
|
+
allowTransparency: b,
|
|
1165
|
+
cursorBlink: I,
|
|
1166
|
+
convertEol: K,
|
|
1167
|
+
scrollback: D,
|
|
1168
|
+
macOptionIsMeta: o,
|
|
1169
|
+
macOptionClickForcesSelection: v,
|
|
1167
1170
|
allowProposedApi: !0,
|
|
1168
|
-
drawBoldTextInBrightColors:
|
|
1171
|
+
drawBoldTextInBrightColors: V
|
|
1169
1172
|
};
|
|
1170
|
-
|
|
1171
|
-
const
|
|
1172
|
-
u &&
|
|
1173
|
-
const
|
|
1174
|
-
if (
|
|
1173
|
+
z !== void 0 && (ie.fontWeight = z), S !== void 0 && (ie.fontWeightBold = S), s !== void 0 && (ie.disableStdin = s), B !== void 0 && (ie.cursorStyle = B), N !== void 0 && (ie.cursorWidth = N), q !== void 0 && (ie.lineHeight = q), P !== void 0 && (ie.letterSpacing = P), _ !== void 0 && (ie.rows = _), C !== void 0 && (ie.cols = C), a !== void 0 && (ie.screenReaderMode = a), w !== void 0 && (ie.minimumContrastRatio = w);
|
|
1174
|
+
const Y = new ye(ie);
|
|
1175
|
+
u && Y.attachCustomKeyEventHandler(u);
|
|
1176
|
+
const xe = [], ke = new He(), Be = new Bt(), qe = new qt(), nt = new zt();
|
|
1177
|
+
if (Y.loadAddon(ke), Y.loadAddon(Be), Y.loadAddon(qe), Y.loadAddon(nt), xe.push(ke, Be, qe, nt), Y.unicode.activeVersion = "11", p)
|
|
1175
1178
|
try {
|
|
1176
1179
|
const {
|
|
1177
|
-
WebLinksAddon:
|
|
1180
|
+
WebLinksAddon: Q
|
|
1178
1181
|
} = await import("@xterm/addon-web-links");
|
|
1179
|
-
if (!
|
|
1180
|
-
const
|
|
1181
|
-
|
|
1182
|
+
if (!re) {
|
|
1183
|
+
const de = new Q();
|
|
1184
|
+
Y.loadAddon(de), xe.push(de);
|
|
1182
1185
|
}
|
|
1183
1186
|
} catch {
|
|
1184
1187
|
}
|
|
1185
|
-
if (
|
|
1186
|
-
|
|
1188
|
+
if (re) {
|
|
1189
|
+
Y.dispose();
|
|
1187
1190
|
return;
|
|
1188
1191
|
}
|
|
1189
|
-
if (
|
|
1192
|
+
if (Y.open(M), g === "auto" || g === "webgl")
|
|
1190
1193
|
try {
|
|
1191
1194
|
const {
|
|
1192
|
-
WebglAddon:
|
|
1195
|
+
WebglAddon: Q
|
|
1193
1196
|
} = await import("@xterm/addon-webgl");
|
|
1194
|
-
if (!
|
|
1195
|
-
const
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
}),
|
|
1197
|
+
if (!re) {
|
|
1198
|
+
const de = new Q();
|
|
1199
|
+
de.onContextLoss(() => {
|
|
1200
|
+
de.dispose();
|
|
1201
|
+
}), Y.loadAddon(de), xe.push(de);
|
|
1199
1202
|
}
|
|
1200
1203
|
} catch {
|
|
1201
1204
|
}
|
|
1202
|
-
if (
|
|
1203
|
-
for (const
|
|
1205
|
+
if (re) {
|
|
1206
|
+
for (const Q of xe)
|
|
1204
1207
|
try {
|
|
1205
|
-
|
|
1208
|
+
Q.dispose();
|
|
1206
1209
|
} catch {
|
|
1207
1210
|
}
|
|
1208
|
-
|
|
1211
|
+
Y.dispose();
|
|
1209
1212
|
return;
|
|
1210
1213
|
}
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
}),
|
|
1214
|
-
|
|
1215
|
-
}),
|
|
1216
|
-
cols:
|
|
1217
|
-
rows:
|
|
1214
|
+
Y.options.theme = Je(M), ke.fit(), O.current = Y, $.current = ke, J.current = Be, Z.current = qe, oe.current = xe, Y.onData((Q) => {
|
|
1215
|
+
te.current.onData?.(Q);
|
|
1216
|
+
}), Y.onBinary((Q) => {
|
|
1217
|
+
te.current.onBinaryData?.(Q);
|
|
1218
|
+
}), Y.onResize(({
|
|
1219
|
+
cols: Q,
|
|
1220
|
+
rows: de
|
|
1218
1221
|
}) => {
|
|
1219
|
-
|
|
1220
|
-
}),
|
|
1221
|
-
|
|
1222
|
-
}),
|
|
1223
|
-
|
|
1224
|
-
}),
|
|
1225
|
-
|
|
1226
|
-
}),
|
|
1227
|
-
|
|
1228
|
-
}),
|
|
1229
|
-
|
|
1230
|
-
}),
|
|
1231
|
-
|
|
1232
|
-
}),
|
|
1233
|
-
|
|
1222
|
+
te.current.onResize?.(Q, de);
|
|
1223
|
+
}), Y.onBell(() => {
|
|
1224
|
+
te.current.onBell?.();
|
|
1225
|
+
}), Y.onTitleChange((Q) => {
|
|
1226
|
+
te.current.onTitleChange?.(Q);
|
|
1227
|
+
}), Y.onKey((Q) => {
|
|
1228
|
+
te.current.onKey?.(Q);
|
|
1229
|
+
}), Y.onSelectionChange(() => {
|
|
1230
|
+
te.current.onSelectionChange?.();
|
|
1231
|
+
}), Y.onLineFeed(() => {
|
|
1232
|
+
te.current.onLineFeed?.();
|
|
1233
|
+
}), Y.onScroll((Q) => {
|
|
1234
|
+
te.current.onScroll?.(Q);
|
|
1235
|
+
}), Y.onWriteParsed(() => {
|
|
1236
|
+
te.current.onWriteParsed?.();
|
|
1234
1237
|
});
|
|
1235
|
-
const
|
|
1238
|
+
const ze = Or(() => {
|
|
1236
1239
|
try {
|
|
1237
|
-
|
|
1240
|
+
ke.fit();
|
|
1238
1241
|
} catch {
|
|
1239
1242
|
}
|
|
1240
1243
|
}, 10);
|
|
1241
|
-
ae.current =
|
|
1242
|
-
const
|
|
1243
|
-
|
|
1244
|
+
ae.current = ze;
|
|
1245
|
+
const ot = new ResizeObserver(() => {
|
|
1246
|
+
ze.run();
|
|
1244
1247
|
});
|
|
1245
|
-
|
|
1246
|
-
const
|
|
1247
|
-
|
|
1248
|
+
ot.observe(M), le.current = ot;
|
|
1249
|
+
const it = () => {
|
|
1250
|
+
ze.run();
|
|
1248
1251
|
};
|
|
1249
|
-
window.addEventListener("resize",
|
|
1250
|
-
window.removeEventListener("resize",
|
|
1251
|
-
},
|
|
1252
|
-
cols:
|
|
1253
|
-
rows:
|
|
1252
|
+
window.addEventListener("resize", it), X.current = () => {
|
|
1253
|
+
window.removeEventListener("resize", it);
|
|
1254
|
+
}, f && Y.focus(), te.current.onReady?.({
|
|
1255
|
+
cols: Y.cols,
|
|
1256
|
+
rows: Y.rows
|
|
1254
1257
|
});
|
|
1255
1258
|
}
|
|
1256
|
-
return
|
|
1257
|
-
|
|
1259
|
+
return We().catch((ye) => {
|
|
1260
|
+
te.current.onError?.(ye instanceof Error ? ye : new Error(String(ye)));
|
|
1258
1261
|
}), () => {
|
|
1259
|
-
|
|
1260
|
-
for (const
|
|
1262
|
+
re = !0, ae.current?.cancel(), ae.current = null, le.current?.disconnect(), le.current = null, X.current?.(), X.current = null;
|
|
1263
|
+
for (const He of oe.current)
|
|
1261
1264
|
try {
|
|
1262
|
-
|
|
1265
|
+
He.dispose();
|
|
1263
1266
|
} catch {
|
|
1264
1267
|
}
|
|
1265
1268
|
oe.current = [];
|
|
1266
|
-
const
|
|
1269
|
+
const ye = O.current;
|
|
1267
1270
|
try {
|
|
1268
|
-
|
|
1271
|
+
ye?.dispose?.();
|
|
1269
1272
|
} catch {
|
|
1270
1273
|
}
|
|
1271
|
-
|
|
1274
|
+
O.current = null, $.current = null, J.current = null, Z.current = null;
|
|
1272
1275
|
};
|
|
1273
|
-
}, []),
|
|
1274
|
-
const
|
|
1275
|
-
|
|
1276
|
-
}, [ce.registration]),
|
|
1277
|
-
const
|
|
1278
|
-
|
|
1279
|
-
}, [
|
|
1280
|
-
const
|
|
1281
|
-
|
|
1282
|
-
}, [
|
|
1283
|
-
const
|
|
1284
|
-
|
|
1285
|
-
}, [
|
|
1286
|
-
const
|
|
1287
|
-
|
|
1288
|
-
}, [
|
|
1289
|
-
const
|
|
1290
|
-
|
|
1291
|
-
}, [
|
|
1292
|
-
const
|
|
1293
|
-
|
|
1294
|
-
}, [P]), /* @__PURE__ */
|
|
1276
|
+
}, []), U(() => {
|
|
1277
|
+
const M = O.current;
|
|
1278
|
+
M?.options && (M.options.theme = Je(F.current));
|
|
1279
|
+
}, [ce.registration]), U(() => {
|
|
1280
|
+
const M = O.current;
|
|
1281
|
+
M?.options && (M.options.fontSize = H, ae.current?.run());
|
|
1282
|
+
}, [H]), U(() => {
|
|
1283
|
+
const M = O.current;
|
|
1284
|
+
M?.options && I !== void 0 && (M.options.cursorBlink = I);
|
|
1285
|
+
}, [I]), U(() => {
|
|
1286
|
+
const M = O.current;
|
|
1287
|
+
M?.options && B !== void 0 && (M.options.cursorStyle = B);
|
|
1288
|
+
}, [B]), U(() => {
|
|
1289
|
+
const M = O.current;
|
|
1290
|
+
M?.options && D !== void 0 && (M.options.scrollback = D);
|
|
1291
|
+
}, [D]), U(() => {
|
|
1292
|
+
const M = O.current;
|
|
1293
|
+
M?.options && q !== void 0 && (M.options.lineHeight = q, ae.current?.run());
|
|
1294
|
+
}, [q]), U(() => {
|
|
1295
|
+
const M = O.current;
|
|
1296
|
+
M?.options && P !== void 0 && (M.options.letterSpacing = P, ae.current?.run());
|
|
1297
|
+
}, [P]), /* @__PURE__ */ E.jsx("div", { ref: F, className: Pr(Lr.Root, A), "data-testid": "terminal" });
|
|
1295
1298
|
});
|
|
1296
|
-
|
|
1297
|
-
const
|
|
1298
|
-
Root:
|
|
1299
|
-
Loading:
|
|
1300
|
-
},
|
|
1301
|
-
function
|
|
1299
|
+
Dr.displayName = "Terminal";
|
|
1300
|
+
const $r = "_Root_1wl3o_1", Ir = "_Loading_1wl3o_92", yt = {
|
|
1301
|
+
Root: $r,
|
|
1302
|
+
Loading: Ir
|
|
1303
|
+
}, Wr = [ir], Hr = Rt(() => import("react-markdown"));
|
|
1304
|
+
function Br(...e) {
|
|
1302
1305
|
return e.filter(Boolean).join(" ");
|
|
1303
1306
|
}
|
|
1304
|
-
function
|
|
1305
|
-
return e ? e.type === "text" ? e.value ?? "" : Array.isArray(e.children) ? e.children.map(
|
|
1307
|
+
function jt(e) {
|
|
1308
|
+
return e ? e.type === "text" ? e.value ?? "" : Array.isArray(e.children) ? e.children.map(jt).join("") : "" : "";
|
|
1306
1309
|
}
|
|
1307
|
-
function
|
|
1308
|
-
const t =
|
|
1309
|
-
summaryText:
|
|
1310
|
-
children:
|
|
1311
|
-
} = e,
|
|
1312
|
-
let
|
|
1313
|
-
return t[0] !==
|
|
1310
|
+
function qr(e) {
|
|
1311
|
+
const t = Ce.c(4), {
|
|
1312
|
+
summaryText: r,
|
|
1313
|
+
children: n
|
|
1314
|
+
} = e, i = `md-details-${Yt()}`;
|
|
1315
|
+
let l;
|
|
1316
|
+
return t[0] !== n || t[1] !== i || t[2] !== r ? (l = /* @__PURE__ */ E.jsx(st, { animation: "fast", children: /* @__PURE__ */ E.jsx(st.Item, { id: i, title: r, children: n }) }), t[0] = n, t[1] = i, t[2] = r, t[3] = l) : l = t[3], l;
|
|
1314
1317
|
}
|
|
1315
|
-
const
|
|
1318
|
+
const zr = {
|
|
1316
1319
|
// Code blocks & inline code
|
|
1317
1320
|
pre: ({
|
|
1318
1321
|
children: e
|
|
1319
|
-
}) => /* @__PURE__ */
|
|
1322
|
+
}) => /* @__PURE__ */ E.jsx(E.Fragment, { children: e }),
|
|
1320
1323
|
code: ({
|
|
1321
1324
|
className: e,
|
|
1322
1325
|
children: t
|
|
1323
1326
|
}) => {
|
|
1324
|
-
const
|
|
1325
|
-
return
|
|
1326
|
-
`) ? /* @__PURE__ */
|
|
1327
|
+
const r = /language-([^\s]+)/.exec(e ?? ""), n = String(t).replace(/\n$/, "");
|
|
1328
|
+
return r || n.includes(`
|
|
1329
|
+
`) ? /* @__PURE__ */ E.jsx(Qt, { language: r?.[1], copyable: !0, children: n }) : /* @__PURE__ */ E.jsx(er, { children: t });
|
|
1327
1330
|
},
|
|
1328
1331
|
// Tables
|
|
1329
1332
|
table: ({
|
|
1330
1333
|
children: e
|
|
1331
|
-
}) => /* @__PURE__ */
|
|
1334
|
+
}) => /* @__PURE__ */ E.jsx(be.Root, { striped: !0, hoverable: !0, size: "sm", children: e }),
|
|
1332
1335
|
thead: ({
|
|
1333
1336
|
children: e
|
|
1334
|
-
}) => /* @__PURE__ */
|
|
1337
|
+
}) => /* @__PURE__ */ E.jsx(be.Head, { children: e }),
|
|
1335
1338
|
tbody: ({
|
|
1336
1339
|
children: e
|
|
1337
|
-
}) => /* @__PURE__ */
|
|
1340
|
+
}) => /* @__PURE__ */ E.jsx(be.Body, { children: e }),
|
|
1338
1341
|
tr: ({
|
|
1339
1342
|
children: e
|
|
1340
|
-
}) => /* @__PURE__ */
|
|
1343
|
+
}) => /* @__PURE__ */ E.jsx(be.Row, { children: e }),
|
|
1341
1344
|
th: ({
|
|
1342
1345
|
children: e,
|
|
1343
1346
|
style: t
|
|
1344
|
-
}) => /* @__PURE__ */
|
|
1347
|
+
}) => /* @__PURE__ */ E.jsx(be.HeaderCell, { style: t, children: e }),
|
|
1345
1348
|
td: ({
|
|
1346
1349
|
children: e,
|
|
1347
1350
|
style: t
|
|
1348
|
-
}) => /* @__PURE__ */
|
|
1351
|
+
}) => /* @__PURE__ */ E.jsx(be.Cell, { style: t, children: e }),
|
|
1349
1352
|
// Links
|
|
1350
1353
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1351
1354
|
a: ({
|
|
1352
1355
|
children: e,
|
|
1353
1356
|
href: t,
|
|
1354
|
-
node:
|
|
1355
|
-
...
|
|
1356
|
-
}) => /* @__PURE__ */
|
|
1357
|
+
node: r,
|
|
1358
|
+
...n
|
|
1359
|
+
}) => /* @__PURE__ */ E.jsx(Zt, { ...n, href: t, target: "_blank", rel: "noopener noreferrer", underline: "hover", children: e }),
|
|
1357
1360
|
// Blockquotes
|
|
1358
1361
|
blockquote: ({
|
|
1359
1362
|
children: e
|
|
1360
|
-
}) => /* @__PURE__ */
|
|
1363
|
+
}) => /* @__PURE__ */ E.jsx(Xt, { variant: "plain", children: e }),
|
|
1361
1364
|
// Horizontal rules
|
|
1362
|
-
hr: () => /* @__PURE__ */
|
|
1365
|
+
hr: () => /* @__PURE__ */ E.jsx(Kt, {}),
|
|
1363
1366
|
// Details/summary → Accordion — extract title from the hast node's summary child
|
|
1364
1367
|
details: ({
|
|
1365
1368
|
children: e,
|
|
1366
1369
|
node: t
|
|
1367
1370
|
}) => {
|
|
1368
|
-
let
|
|
1371
|
+
let r = "Details";
|
|
1369
1372
|
if (t?.children) {
|
|
1370
|
-
const c = t.children.find((
|
|
1373
|
+
const c = t.children.find((i) => i.tagName === "summary");
|
|
1371
1374
|
if (c) {
|
|
1372
|
-
const
|
|
1373
|
-
|
|
1375
|
+
const i = jt(c).trim();
|
|
1376
|
+
i && (r = i);
|
|
1374
1377
|
}
|
|
1375
1378
|
}
|
|
1376
|
-
const
|
|
1377
|
-
return
|
|
1378
|
-
|
|
1379
|
-
}), /* @__PURE__ */
|
|
1379
|
+
const n = [];
|
|
1380
|
+
return Ft.forEach(e, (c) => {
|
|
1381
|
+
Ut(c) && c.props?.["data-md-summary"] || n.push(c);
|
|
1382
|
+
}), /* @__PURE__ */ E.jsx(qr, { summaryText: r, children: n });
|
|
1380
1383
|
},
|
|
1381
1384
|
// Mark summary so details can filter it out; text is extracted from hast node
|
|
1382
1385
|
summary: ({
|
|
1383
1386
|
children: e
|
|
1384
|
-
}) => /* @__PURE__ */
|
|
1387
|
+
}) => /* @__PURE__ */ E.jsx("span", { hidden: !0, "data-md-summary": !0, children: e }),
|
|
1385
1388
|
// Task list checkboxes — use compound parts for inline rendering
|
|
1386
1389
|
input: ({
|
|
1387
1390
|
type: e,
|
|
1388
1391
|
checked: t,
|
|
1389
|
-
disabled:
|
|
1390
|
-
}) => e === "checkbox" ? /* @__PURE__ */
|
|
1391
|
-
},
|
|
1392
|
-
const
|
|
1393
|
-
let c,
|
|
1394
|
-
|
|
1395
|
-
content:
|
|
1396
|
-
allowHtml:
|
|
1392
|
+
disabled: r
|
|
1393
|
+
}) => e === "checkbox" ? /* @__PURE__ */ E.jsx(Ve.Root, { checked: t, disabled: r, size: "sm", className: "ov-md-checkbox", children: /* @__PURE__ */ E.jsx(Ve.Control, { children: /* @__PURE__ */ E.jsx(Ve.Indicator, { keepMounted: !0 }) }) }) : null
|
|
1394
|
+
}, Vr = _e(function(t, r) {
|
|
1395
|
+
const n = Ce.c(16);
|
|
1396
|
+
let c, i, l, d;
|
|
1397
|
+
n[0] !== t ? ({
|
|
1398
|
+
content: i,
|
|
1399
|
+
allowHtml: d,
|
|
1397
1400
|
className: c,
|
|
1398
|
-
...
|
|
1399
|
-
} = t,
|
|
1400
|
-
const
|
|
1401
|
-
let g;
|
|
1402
|
-
r[5] !== c ? (g = jr(ft.Root, c), r[5] = c, r[6] = g) : g = r[6];
|
|
1403
|
-
let x;
|
|
1404
|
-
r[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (x = /* @__PURE__ */ T.jsx("div", { className: ft.Loading, "data-testid": "markdown-loading", children: "Loading…" }), r[7] = x) : x = r[7];
|
|
1405
|
-
let A;
|
|
1406
|
-
r[8] !== v || r[9] !== l ? (A = /* @__PURE__ */ T.jsx(Dt, { fallback: x, children: /* @__PURE__ */ T.jsx(Pr, { content: l, allowHtml: v }) }), r[8] = v, r[9] = l, r[10] = A) : A = r[10];
|
|
1401
|
+
...l
|
|
1402
|
+
} = t, n[0] = t, n[1] = c, n[2] = i, n[3] = l, n[4] = d) : (c = n[1], i = n[2], l = n[3], d = n[4]);
|
|
1403
|
+
const y = d === void 0 ? !1 : d;
|
|
1407
1404
|
let h;
|
|
1408
|
-
|
|
1405
|
+
n[5] !== c ? (h = Br(yt.Root, c), n[5] = c, n[6] = h) : h = n[6];
|
|
1406
|
+
let k;
|
|
1407
|
+
n[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (k = /* @__PURE__ */ E.jsx("div", { className: yt.Loading, "data-testid": "markdown-loading", children: "Loading…" }), n[7] = k) : k = n[7];
|
|
1408
|
+
let j;
|
|
1409
|
+
n[8] !== y || n[9] !== i ? (j = /* @__PURE__ */ E.jsx(kt, { fallback: k, children: /* @__PURE__ */ E.jsx(Ur, { content: i, allowHtml: y }) }), n[8] = y, n[9] = i, n[10] = j) : j = n[10];
|
|
1410
|
+
let m;
|
|
1411
|
+
return n[11] !== l || n[12] !== r || n[13] !== h || n[14] !== j ? (m = /* @__PURE__ */ E.jsx("div", { ref: r, className: h, "data-testid": "markdown-preview", ...l, children: j }), n[11] = l, n[12] = r, n[13] = h, n[14] = j, n[15] = m) : m = n[15], m;
|
|
1409
1412
|
});
|
|
1410
|
-
|
|
1411
|
-
const
|
|
1412
|
-
...
|
|
1413
|
+
Vr.displayName = "MarkdownPreview";
|
|
1414
|
+
const Fr = {
|
|
1415
|
+
...Fe,
|
|
1413
1416
|
attributes: {
|
|
1414
|
-
...
|
|
1415
|
-
"*": [...
|
|
1417
|
+
...Fe.attributes,
|
|
1418
|
+
"*": [...Fe.attributes?.["*"] ?? [], "className"]
|
|
1416
1419
|
}
|
|
1417
1420
|
};
|
|
1418
|
-
function
|
|
1419
|
-
const t =
|
|
1420
|
-
content:
|
|
1421
|
-
allowHtml:
|
|
1421
|
+
function Ur(e) {
|
|
1422
|
+
const t = Ce.c(6), {
|
|
1423
|
+
content: r,
|
|
1424
|
+
allowHtml: n
|
|
1422
1425
|
} = e;
|
|
1423
1426
|
let c;
|
|
1424
|
-
t[0] !==
|
|
1425
|
-
const
|
|
1426
|
-
let
|
|
1427
|
-
return t[2] !==
|
|
1428
|
-
}
|
|
1429
|
-
const
|
|
1430
|
-
Overlay:
|
|
1431
|
-
Root:
|
|
1432
|
-
CommandList:
|
|
1433
|
-
Results:
|
|
1427
|
+
t[0] !== n ? (c = n ? [sr, [ar, Fr]] : [], t[0] = n, t[1] = c) : c = t[1];
|
|
1428
|
+
const i = c, l = !n, d = i;
|
|
1429
|
+
let y;
|
|
1430
|
+
return t[2] !== r || t[3] !== l || t[4] !== d ? (y = /* @__PURE__ */ E.jsx(Hr, { skipHtml: l, remarkPlugins: Wr, rehypePlugins: d, components: zr, children: r }), t[2] = r, t[3] = l, t[4] = d, t[5] = y) : y = t[5], y;
|
|
1431
|
+
}
|
|
1432
|
+
const Yr = "_Overlay_pgin5_1", Gr = "_Root_pgin5_12", Jr = "_CommandList_pgin5_25", Kr = "_Results_pgin5_30", Xr = "_Message_pgin5_35", Ee = {
|
|
1433
|
+
Overlay: Yr,
|
|
1434
|
+
Root: Gr,
|
|
1435
|
+
CommandList: Jr,
|
|
1436
|
+
Results: Kr,
|
|
1437
|
+
Message: Xr
|
|
1434
1438
|
};
|
|
1435
|
-
function
|
|
1439
|
+
function Zr(e) {
|
|
1436
1440
|
return e.id;
|
|
1437
1441
|
}
|
|
1438
|
-
function
|
|
1439
|
-
const
|
|
1442
|
+
function Ke(e, t) {
|
|
1443
|
+
const r = e.toLowerCase(), n = t.toLowerCase();
|
|
1440
1444
|
let c = 0;
|
|
1441
|
-
for (let
|
|
1442
|
-
|
|
1443
|
-
return c ===
|
|
1444
|
-
}
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
} =
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1445
|
+
for (let i = 0; i < r.length && c < n.length; i++)
|
|
1446
|
+
r[i] === n[c] && c++;
|
|
1447
|
+
return c === n.length;
|
|
1448
|
+
}
|
|
1449
|
+
function Qr(e, t) {
|
|
1450
|
+
return Ke(e.label, t) || (e.description ? Ke(e.description, t) : !1) || (e.group ? Ke(e.group, t) : !1);
|
|
1451
|
+
}
|
|
1452
|
+
const en = [];
|
|
1453
|
+
function tn(e) {
|
|
1454
|
+
const t = Ce.c(7), {
|
|
1455
|
+
inputRef: r
|
|
1456
|
+
} = e, {
|
|
1457
|
+
listId: n
|
|
1458
|
+
} = tr(), c = rr(), {
|
|
1459
|
+
activeKey: i
|
|
1460
|
+
} = Gt(c.subscribe, c.getSnapshot, c.getSnapshot), l = i != null ? `${n}-item-${i}` : void 0;
|
|
1461
|
+
let d, y;
|
|
1462
|
+
t[0] !== l || t[1] !== r ? (d = () => {
|
|
1463
|
+
l && r.current?.ownerDocument.getElementById(l)?.scrollIntoView?.({
|
|
1464
|
+
block: "nearest"
|
|
1465
|
+
});
|
|
1466
|
+
}, y = [l, r], t[0] = l, t[1] = r, t[2] = d, t[3] = y) : (d = t[2], y = t[3]), St(d, y);
|
|
1458
1467
|
let h;
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1468
|
+
return t[4] !== l || t[5] !== r ? (h = /* @__PURE__ */ E.jsx(ue.Input, { ref: r, autoFocus: !1, role: "combobox", "aria-label": "Search commands", "aria-expanded": "true", "aria-haspopup": "listbox", "aria-activedescendant": l, autoComplete: "off", spellCheck: !1, "data-testid": "command-palette-input" }), t[4] = l, t[5] = r, t[6] = h) : h = t[6], h;
|
|
1469
|
+
}
|
|
1470
|
+
const rn = _e(function({
|
|
1471
|
+
open: t,
|
|
1472
|
+
onClose: r,
|
|
1473
|
+
commands: n,
|
|
1474
|
+
onSelect: c,
|
|
1475
|
+
placeholder: i = "Type a command…",
|
|
1476
|
+
loading: l = !1,
|
|
1477
|
+
error: d
|
|
1478
|
+
}, y) {
|
|
1479
|
+
const h = G(null), k = G(null), j = G(!1), m = d !== void 0, T = Oe(() => n.filter((S) => !S.disabled), [n]), R = m || l ? en : T, H = Oe(() => {
|
|
1480
|
+
const S = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map();
|
|
1481
|
+
let I, B = -1;
|
|
1482
|
+
for (const N of R) {
|
|
1483
|
+
const q = N.group || "Other commands";
|
|
1484
|
+
q !== I && B++, I = q;
|
|
1485
|
+
const P = String(B);
|
|
1486
|
+
S.set(N.id, P), D.set(P, q);
|
|
1487
|
+
}
|
|
1488
|
+
return {
|
|
1489
|
+
keys: S,
|
|
1490
|
+
labels: D,
|
|
1491
|
+
grouped: R.some((N) => N.group)
|
|
1492
|
+
};
|
|
1493
|
+
}, [R]), x = De((S) => H.keys.get(S.id), [H]), z = De((S) => H.labels.get(S), [H]);
|
|
1494
|
+
return St(() => {
|
|
1495
|
+
if (!t) return;
|
|
1496
|
+
const S = h.current, D = S?.ownerDocument, I = D?.activeElement;
|
|
1497
|
+
return j.current = !1, k.current?.focus({
|
|
1498
|
+
preventScroll: !0
|
|
1499
|
+
}), () => {
|
|
1500
|
+
I instanceof HTMLElement && I.isConnected && (D?.activeElement === D?.body || S?.contains(D?.activeElement ?? null)) && I.focus({
|
|
1501
|
+
preventScroll: !0
|
|
1502
|
+
});
|
|
1503
|
+
};
|
|
1504
|
+
}, [t]), t ? /* @__PURE__ */ E.jsx("div", { role: "presentation", className: Ee.Overlay, onClick: r, "data-testid": "command-palette-overlay", children: /* @__PURE__ */ E.jsx("div", { ref: (S) => {
|
|
1505
|
+
if (h.current = S, typeof y == "function") return y(S);
|
|
1506
|
+
y && (y.current = S);
|
|
1507
|
+
}, className: Ee.Root, onClick: (S) => S.stopPropagation(), onMouseDown: (S) => {
|
|
1508
|
+
S.button === 0 && S.target instanceof Element && !S.target.closest("input, button") && (S.preventDefault(), k.current?.focus({
|
|
1509
|
+
preventScroll: !0
|
|
1510
|
+
}));
|
|
1511
|
+
}, onKeyDown: (S) => S.stopPropagation(), onCompositionStartCapture: () => {
|
|
1512
|
+
j.current = !0;
|
|
1513
|
+
}, onCompositionEndCapture: () => {
|
|
1514
|
+
j.current = !1;
|
|
1515
|
+
}, onKeyDownCapture: (S) => {
|
|
1516
|
+
if (j.current || S.nativeEvent.isComposing || S.keyCode === 229) {
|
|
1517
|
+
S.stopPropagation();
|
|
1518
|
+
return;
|
|
1519
|
+
}
|
|
1520
|
+
if (S.target instanceof HTMLButtonElement && S.key !== "Escape" && S.key !== "Tab") {
|
|
1521
|
+
S.stopPropagation();
|
|
1522
|
+
return;
|
|
1523
|
+
}
|
|
1524
|
+
if (S.key === "Escape")
|
|
1525
|
+
S.preventDefault(), S.stopPropagation(), r();
|
|
1526
|
+
else if (S.key === "Tab") {
|
|
1527
|
+
const D = h.current?.querySelectorAll("input:not(:disabled), button:not(:disabled)");
|
|
1528
|
+
if (!D?.length) return;
|
|
1529
|
+
const I = D[0], B = D[D.length - 1], N = I.ownerDocument.activeElement;
|
|
1530
|
+
(S.shiftKey && N === I || !S.shiftKey && N === B) && (S.preventDefault(), (S.shiftKey ? B : I).focus());
|
|
1531
|
+
}
|
|
1532
|
+
}, role: "dialog", "aria-modal": "true", "aria-label": "Command palette", "data-testid": "command-palette", children: /* @__PURE__ */ E.jsxs(ue.Root, { className: Ee.CommandList, role: "presentation", "aria-expanded": void 0, "aria-haspopup": void 0, "aria-owns": void 0, "aria-activedescendant": void 0, items: R, itemKey: Zr, renderItem: (S, D) => /* @__PURE__ */ E.jsxs(ue.Item, { itemKey: D.key, "data-testid": `command-item-${S.id}`, children: [
|
|
1533
|
+
S.icon && /* @__PURE__ */ E.jsx(ue.ItemIcon, { "aria-hidden": "true", children: S.icon }),
|
|
1534
|
+
/* @__PURE__ */ E.jsx(ue.ItemLabel, { children: S.label }),
|
|
1535
|
+
S.description && /* @__PURE__ */ E.jsx(ue.ItemDescription, { children: S.description }),
|
|
1536
|
+
S.shortcut && /* @__PURE__ */ E.jsx(ue.ItemShortcut, { children: S.shortcut })
|
|
1537
|
+
] }), filterFn: Qr, sortByScore: !1, groupBy: H.grouped ? x : void 0, groupLabel: z, loading: l && !m, onAction: (S) => {
|
|
1538
|
+
const D = R.find((I) => I.id === S && !I.disabled);
|
|
1539
|
+
D && (c(D), r());
|
|
1540
|
+
}, onDismiss: r, placeholder: i, density: "compact", children: [
|
|
1541
|
+
/* @__PURE__ */ E.jsx(tn, { inputRef: k }),
|
|
1542
|
+
/* @__PURE__ */ E.jsx(ue.Results, { className: Ee.Results, "aria-label": "Commands", "aria-busy": l && !m, "data-testid": "command-palette-list" }),
|
|
1543
|
+
m ? /* @__PURE__ */ E.jsx("div", { role: "alert", className: Ee.Message, "data-testid": "command-palette-error", children: d || "Unable to load commands." }) : /* @__PURE__ */ E.jsxs(E.Fragment, { children: [
|
|
1544
|
+
/* @__PURE__ */ E.jsx(ue.Loading, { role: "status", "data-testid": "command-palette-loading", children: "Loading commands…" }),
|
|
1545
|
+
/* @__PURE__ */ E.jsx(ue.Empty, { role: "status", "data-testid": "command-palette-empty", children: "No matching commands" })
|
|
1546
|
+
] })
|
|
1547
|
+
] }) }) }) : null;
|
|
1478
1548
|
});
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
function Fr(e, t) {
|
|
1498
|
-
return Fe(e.label, t) || (e.description ? Fe(e.description, t) : !1) || (e.group ? Fe(e.group, t) : !1);
|
|
1499
|
-
}
|
|
1500
|
-
function Yr(e) {
|
|
1501
|
-
return e.group || "";
|
|
1502
|
-
}
|
|
1503
|
-
const qr = "_Root_1b5sv_1", Jr = "_Toolbar_1b5sv_12", Gr = "_SearchInput_1b5sv_20", Xr = "_CopyButton_1b5sv_41", Qr = "_Tree_1b5sv_55", Zr = "_Node_1b5sv_59", Kr = "_Row_1b5sv_63", en = "_RowHighlight_1b5sv_76", tn = "_Chevron_1b5sv_80", rn = "_ChevronExpanded_1b5sv_93", nn = "_ChevronSpacer_1b5sv_97", on = "_Key_1b5sv_103", sn = "_Colon_1b5sv_107", an = "_Value_1b5sv_111", cn = "_Preview_1b5sv_129", ln = "_Comma_1b5sv_134", re = {
|
|
1504
|
-
Root: qr,
|
|
1505
|
-
Toolbar: Jr,
|
|
1506
|
-
SearchInput: Gr,
|
|
1507
|
-
CopyButton: Xr,
|
|
1508
|
-
Tree: Qr,
|
|
1509
|
-
Node: Zr,
|
|
1510
|
-
Row: Kr,
|
|
1511
|
-
RowHighlight: en,
|
|
1512
|
-
Chevron: tn,
|
|
1513
|
-
ChevronExpanded: rn,
|
|
1514
|
-
ChevronSpacer: nn,
|
|
1515
|
-
Key: on,
|
|
1516
|
-
Colon: sn,
|
|
1517
|
-
Value: an,
|
|
1518
|
-
Preview: cn,
|
|
1519
|
-
Comma: ln
|
|
1549
|
+
rn.displayName = "CommandPalette";
|
|
1550
|
+
const nn = "_Root_1b5sv_1", on = "_Toolbar_1b5sv_12", sn = "_SearchInput_1b5sv_20", an = "_CopyButton_1b5sv_41", cn = "_Tree_1b5sv_55", ln = "_Node_1b5sv_59", un = "_Row_1b5sv_63", dn = "_RowHighlight_1b5sv_76", fn = "_Chevron_1b5sv_80", gn = "_ChevronExpanded_1b5sv_93", mn = "_ChevronSpacer_1b5sv_97", hn = "_Key_1b5sv_103", pn = "_Colon_1b5sv_107", yn = "_Value_1b5sv_111", vn = "_Preview_1b5sv_129", bn = "_Comma_1b5sv_134", ne = {
|
|
1551
|
+
Root: nn,
|
|
1552
|
+
Toolbar: on,
|
|
1553
|
+
SearchInput: sn,
|
|
1554
|
+
CopyButton: an,
|
|
1555
|
+
Tree: cn,
|
|
1556
|
+
Node: ln,
|
|
1557
|
+
Row: un,
|
|
1558
|
+
RowHighlight: dn,
|
|
1559
|
+
Chevron: fn,
|
|
1560
|
+
ChevronExpanded: gn,
|
|
1561
|
+
ChevronSpacer: mn,
|
|
1562
|
+
Key: hn,
|
|
1563
|
+
Colon: pn,
|
|
1564
|
+
Value: yn,
|
|
1565
|
+
Preview: vn,
|
|
1566
|
+
Comma: bn
|
|
1520
1567
|
};
|
|
1521
|
-
function
|
|
1568
|
+
function Xe(...e) {
|
|
1522
1569
|
return e.filter(Boolean).join(" ");
|
|
1523
1570
|
}
|
|
1524
|
-
function
|
|
1571
|
+
function Nt(e) {
|
|
1525
1572
|
return e === null ? "null" : e === void 0 ? "undefined" : Array.isArray(e) ? "array" : typeof e;
|
|
1526
1573
|
}
|
|
1527
|
-
function
|
|
1574
|
+
function wn(e) {
|
|
1528
1575
|
return e === null ? "null" : e === void 0 ? "undefined" : typeof e == "string" ? JSON.stringify(e) : String(e);
|
|
1529
1576
|
}
|
|
1530
|
-
function
|
|
1577
|
+
function _n(e, t) {
|
|
1531
1578
|
return typeof e == "boolean" ? e : t < e;
|
|
1532
1579
|
}
|
|
1533
|
-
function
|
|
1534
|
-
const
|
|
1535
|
-
return !!(e.toLowerCase().includes(
|
|
1580
|
+
function At(e, t, r) {
|
|
1581
|
+
const n = r.toLowerCase();
|
|
1582
|
+
return !!(e.toLowerCase().includes(n) || typeof t == "string" && t.toLowerCase().includes(n) || typeof t == "number" && String(t).includes(n) || typeof t == "boolean" && String(t).includes(n));
|
|
1536
1583
|
}
|
|
1537
|
-
function
|
|
1584
|
+
function Me(e) {
|
|
1538
1585
|
return e !== null && (typeof e == "object" || typeof e == "function");
|
|
1539
1586
|
}
|
|
1540
|
-
function
|
|
1587
|
+
function Lt(e, t, r, n) {
|
|
1541
1588
|
if (!t) return !1;
|
|
1542
|
-
const c =
|
|
1543
|
-
if (c !== "object" && c !== "array" || e == null ||
|
|
1544
|
-
if (
|
|
1545
|
-
const
|
|
1546
|
-
has: (
|
|
1589
|
+
const c = Nt(e);
|
|
1590
|
+
if (c !== "object" && c !== "array" || e == null || Me(e) && r.has(e)) return !1;
|
|
1591
|
+
if (Me(e) && n.has(e)) return n.get(e);
|
|
1592
|
+
const i = {
|
|
1593
|
+
has: (d) => d === e || r.has(d)
|
|
1547
1594
|
};
|
|
1548
|
-
let
|
|
1549
|
-
for (const [
|
|
1550
|
-
if (
|
|
1551
|
-
|
|
1595
|
+
let l = !1;
|
|
1596
|
+
for (const [d, y] of Object.entries(e))
|
|
1597
|
+
if (At(d, y, t) || Lt(y, t, i, n)) {
|
|
1598
|
+
l = !0;
|
|
1552
1599
|
break;
|
|
1553
1600
|
}
|
|
1554
|
-
return
|
|
1601
|
+
return Me(e) && n.set(e, l), l;
|
|
1555
1602
|
}
|
|
1556
|
-
function
|
|
1557
|
-
const t =
|
|
1558
|
-
nodeKey:
|
|
1559
|
-
value:
|
|
1603
|
+
function Pt(e) {
|
|
1604
|
+
const t = Ce.c(80), {
|
|
1605
|
+
nodeKey: r,
|
|
1606
|
+
value: n,
|
|
1560
1607
|
depth: c,
|
|
1561
|
-
defaultExpanded:
|
|
1562
|
-
searchQuery:
|
|
1563
|
-
isLast:
|
|
1564
|
-
ancestors:
|
|
1565
|
-
searchCache:
|
|
1608
|
+
defaultExpanded: i,
|
|
1609
|
+
searchQuery: l,
|
|
1610
|
+
isLast: d,
|
|
1611
|
+
ancestors: y,
|
|
1612
|
+
searchCache: h
|
|
1566
1613
|
} = e;
|
|
1567
|
-
let
|
|
1568
|
-
t[0] !==
|
|
1569
|
-
const
|
|
1570
|
-
let
|
|
1571
|
-
t[2] !==
|
|
1572
|
-
const
|
|
1614
|
+
let k;
|
|
1615
|
+
t[0] !== n ? (k = Nt(n), t[0] = n, t[1] = k) : k = t[1];
|
|
1616
|
+
const j = k, m = j === "object" || j === "array";
|
|
1617
|
+
let T;
|
|
1618
|
+
t[2] !== y || t[3] !== m || t[4] !== n ? (T = m && Me(n) && y.has(n), t[2] = y, t[3] = m, t[4] = n, t[5] = T) : T = t[5];
|
|
1619
|
+
const R = T;
|
|
1620
|
+
let H;
|
|
1621
|
+
t[6] !== i || t[7] !== c || t[8] !== R || t[9] !== m ? (H = () => m && !R && _n(i, c), t[6] = i, t[7] = c, t[8] = R, t[9] = m, t[10] = H) : H = t[10];
|
|
1622
|
+
const [x, z] = me(H), S = G(!1), D = G(!1);
|
|
1573
1623
|
let I;
|
|
1574
|
-
t[
|
|
1575
|
-
const
|
|
1576
|
-
let
|
|
1577
|
-
t[
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
t[16] !== j || t[17] !== U || t[18] !== C || t[19] !== h || t[20] !== f ? (D = () => {
|
|
1581
|
-
f && U && h && !C && !j && (H.current || (q.current = j), H.current = !0, W(!0)), H.current && (!f || !U) && (H.current = !1, W(q.current));
|
|
1582
|
-
}, V = [f, U, h, C, j], t[16] = j, t[17] = U, t[18] = C, t[19] = h, t[20] = f, t[21] = D, t[22] = V) : (D = t[21], V = t[22]), z(D, V);
|
|
1624
|
+
t[11] !== y || t[12] !== h || t[13] !== l || t[14] !== n ? (I = l ? Lt(n, l, y, h) : !1, t[11] = y, t[12] = h, t[13] = l, t[14] = n, t[15] = I) : I = t[15];
|
|
1625
|
+
const B = I;
|
|
1626
|
+
let N, q;
|
|
1627
|
+
t[16] !== x || t[17] !== B || t[18] !== R || t[19] !== m || t[20] !== l ? (N = () => {
|
|
1628
|
+
l && B && m && !R && !x && (S.current || (D.current = x), S.current = !0, z(!0)), S.current && (!l || !B) && (S.current = !1, z(D.current));
|
|
1629
|
+
}, q = [l, B, m, R, x], t[16] = x, t[17] = B, t[18] = R, t[19] = m, t[20] = l, t[21] = N, t[22] = q) : (N = t[21], q = t[22]), U(N, q);
|
|
1583
1630
|
let P;
|
|
1584
1631
|
e: {
|
|
1585
|
-
if (!
|
|
1586
|
-
P =
|
|
1632
|
+
if (!m || !Me(n) || R) {
|
|
1633
|
+
P = y;
|
|
1587
1634
|
break e;
|
|
1588
1635
|
}
|
|
1589
|
-
let
|
|
1590
|
-
t[23] !==
|
|
1591
|
-
has: (ce) => ce ===
|
|
1592
|
-
}, t[23] =
|
|
1636
|
+
let X;
|
|
1637
|
+
t[23] !== y || t[24] !== n ? (X = {
|
|
1638
|
+
has: (ce) => ce === n || y.has(ce)
|
|
1639
|
+
}, t[23] = y, t[24] = n, t[25] = X) : X = t[25], P = X;
|
|
1593
1640
|
}
|
|
1594
|
-
const
|
|
1595
|
-
let
|
|
1641
|
+
const V = P;
|
|
1642
|
+
let K;
|
|
1596
1643
|
e: {
|
|
1597
|
-
if (!
|
|
1644
|
+
if (!m || n === null || n === void 0 || R) {
|
|
1598
1645
|
let ce;
|
|
1599
|
-
t[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ce = [], t[26] = ce) : ce = t[26],
|
|
1646
|
+
t[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ce = [], t[26] = ce) : ce = t[26], K = ce;
|
|
1600
1647
|
break e;
|
|
1601
1648
|
}
|
|
1602
|
-
let
|
|
1603
|
-
t[27] !==
|
|
1649
|
+
let X;
|
|
1650
|
+
t[27] !== n ? (X = Object.entries(n), t[27] = n, t[28] = X) : X = t[28], K = X;
|
|
1604
1651
|
}
|
|
1605
|
-
const
|
|
1606
|
-
let
|
|
1607
|
-
t[29] !==
|
|
1608
|
-
|
|
1609
|
-
}, t[29] =
|
|
1610
|
-
const
|
|
1611
|
-
let
|
|
1612
|
-
t[32] !==
|
|
1613
|
-
const
|
|
1614
|
-
let
|
|
1615
|
-
t[36] !==
|
|
1616
|
-
const
|
|
1617
|
-
let
|
|
1618
|
-
t[38] !==
|
|
1619
|
-
"--_inspector-depth-indent":
|
|
1620
|
-
}, t[38] =
|
|
1621
|
-
const
|
|
1622
|
-
let
|
|
1623
|
-
t[40] !==
|
|
1624
|
-
(
|
|
1625
|
-
}, t[40] =
|
|
1626
|
-
const
|
|
1627
|
-
let $;
|
|
1628
|
-
t[42] !== j || t[43] !== C || t[44] !== h ? ($ = h && !C ? /* @__PURE__ */ T.jsx("span", { className: Ye(re.Chevron, j && re.ChevronExpanded), children: "▸" }) : /* @__PURE__ */ T.jsx("span", { className: re.ChevronSpacer }), t[42] = j, t[43] = C, t[44] = h, t[45] = $) : $ = t[45];
|
|
1629
|
-
let N;
|
|
1630
|
-
t[46] !== n ? (N = /* @__PURE__ */ T.jsx("span", { className: re.Key, children: n }), t[46] = n, t[47] = N) : N = t[47];
|
|
1631
|
-
let O;
|
|
1632
|
-
t[48] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (O = /* @__PURE__ */ T.jsx("span", { className: re.Colon, children: ": " }), t[48] = O) : O = t[48];
|
|
1652
|
+
const b = K;
|
|
1653
|
+
let o;
|
|
1654
|
+
t[29] !== R || t[30] !== m ? (o = () => {
|
|
1655
|
+
m && !R && z(Cn);
|
|
1656
|
+
}, t[29] = R, t[30] = m, t[31] = o) : o = t[31];
|
|
1657
|
+
const v = o;
|
|
1658
|
+
let p;
|
|
1659
|
+
t[32] !== r || t[33] !== l || t[34] !== n ? (p = l && At(r, n, l), t[32] = r, t[33] = l, t[34] = n, t[35] = p) : p = t[35];
|
|
1660
|
+
const s = p, u = R ? "[Circular]" : m ? j === "array" ? `Array(${n.length})` : `{${b.length}}` : null, f = s && ne.RowHighlight;
|
|
1661
|
+
let g;
|
|
1662
|
+
t[36] !== f ? (g = Xe(ne.Row, f), t[36] = f, t[37] = g) : g = t[37];
|
|
1663
|
+
const _ = `${c * 16}px`;
|
|
1664
|
+
let C;
|
|
1665
|
+
t[38] !== _ ? (C = {
|
|
1666
|
+
"--_inspector-depth-indent": _
|
|
1667
|
+
}, t[38] = _, t[39] = C) : C = t[39];
|
|
1668
|
+
const a = C;
|
|
1669
|
+
let w;
|
|
1670
|
+
t[40] !== v ? (w = (X) => {
|
|
1671
|
+
(X.key === "Enter" || X.key === " ") && (X.preventDefault(), v());
|
|
1672
|
+
}, t[40] = v, t[41] = w) : w = t[41];
|
|
1673
|
+
const A = m && !R ? x : void 0, L = `inspector-node-${r}`;
|
|
1633
1674
|
let F;
|
|
1634
|
-
t[
|
|
1635
|
-
let
|
|
1636
|
-
t[
|
|
1675
|
+
t[42] !== x || t[43] !== R || t[44] !== m ? (F = m && !R ? /* @__PURE__ */ E.jsx("span", { className: Xe(ne.Chevron, x && ne.ChevronExpanded), children: "▸" }) : /* @__PURE__ */ E.jsx("span", { className: ne.ChevronSpacer }), t[42] = x, t[43] = R, t[44] = m, t[45] = F) : F = t[45];
|
|
1676
|
+
let O;
|
|
1677
|
+
t[46] !== r ? (O = /* @__PURE__ */ E.jsx("span", { className: ne.Key, children: r }), t[46] = r, t[47] = O) : O = t[47];
|
|
1678
|
+
let $;
|
|
1679
|
+
t[48] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? ($ = /* @__PURE__ */ E.jsx("span", { className: ne.Colon, children: ": " }), t[48] = $) : $ = t[48];
|
|
1680
|
+
let J;
|
|
1681
|
+
t[49] !== m || t[50] !== u || t[51] !== j || t[52] !== n ? (J = m ? /* @__PURE__ */ E.jsx("span", { className: ne.Preview, children: u }) : /* @__PURE__ */ E.jsx("span", { className: ne.Value, "data-type": j, children: wn(n) }), t[49] = m, t[50] = u, t[51] = j, t[52] = n, t[53] = J) : J = t[53];
|
|
1682
|
+
let Z;
|
|
1683
|
+
t[54] !== x || t[55] !== d ? (Z = !d && !x && /* @__PURE__ */ E.jsx("span", { className: ne.Comma, children: "," }), t[54] = x, t[55] = d, t[56] = Z) : Z = t[56];
|
|
1637
1684
|
let oe;
|
|
1638
|
-
t[57] !==
|
|
1639
|
-
$,
|
|
1640
|
-
N,
|
|
1641
|
-
O,
|
|
1685
|
+
t[57] !== g || t[58] !== a || t[59] !== w || t[60] !== A || t[61] !== L || t[62] !== F || t[63] !== O || t[64] !== J || t[65] !== Z || t[66] !== v ? (oe = /* @__PURE__ */ E.jsxs("div", { className: g, style: a, onClick: v, onKeyDown: w, tabIndex: 0, role: "treeitem", "aria-expanded": A, "data-testid": L, children: [
|
|
1642
1686
|
F,
|
|
1643
|
-
|
|
1644
|
-
|
|
1687
|
+
O,
|
|
1688
|
+
$,
|
|
1689
|
+
J,
|
|
1690
|
+
Z
|
|
1691
|
+
] }), t[57] = g, t[58] = a, t[59] = w, t[60] = A, t[61] = L, t[62] = F, t[63] = O, t[64] = J, t[65] = Z, t[66] = v, t[67] = oe) : oe = t[67];
|
|
1645
1692
|
let le;
|
|
1646
|
-
t[68] !==
|
|
1647
|
-
const [
|
|
1648
|
-
return /* @__PURE__ */
|
|
1649
|
-
}), t[68] =
|
|
1693
|
+
t[68] !== V || t[69] !== i || t[70] !== c || t[71] !== b || t[72] !== x || t[73] !== h || t[74] !== l ? (le = x && b.map((X, ce) => {
|
|
1694
|
+
const [te, Ie] = X;
|
|
1695
|
+
return /* @__PURE__ */ E.jsx(Pt, { nodeKey: te, value: Ie, depth: c + 1, defaultExpanded: i, searchQuery: l, isLast: ce === b.length - 1, ancestors: V, searchCache: h }, te);
|
|
1696
|
+
}), t[68] = V, t[69] = i, t[70] = c, t[71] = b, t[72] = x, t[73] = h, t[74] = l, t[75] = le) : le = t[75];
|
|
1650
1697
|
let ae;
|
|
1651
|
-
return t[76] !== c || t[77] !== oe || t[78] !== le ? (ae = /* @__PURE__ */
|
|
1698
|
+
return t[76] !== c || t[77] !== oe || t[78] !== le ? (ae = /* @__PURE__ */ E.jsxs("div", { className: ne.Node, "data-depth": c, children: [
|
|
1652
1699
|
oe,
|
|
1653
1700
|
le
|
|
1654
1701
|
] }), t[76] = c, t[77] = oe, t[78] = le, t[79] = ae) : ae = t[79], ae;
|
|
1655
1702
|
}
|
|
1656
|
-
function
|
|
1703
|
+
function Cn(e) {
|
|
1657
1704
|
return !e;
|
|
1658
1705
|
}
|
|
1659
|
-
const
|
|
1706
|
+
const xn = /* @__PURE__ */ new WeakSet(), kn = _e(function({
|
|
1660
1707
|
data: t,
|
|
1661
|
-
format:
|
|
1662
|
-
defaultExpanded:
|
|
1708
|
+
format: r = "json",
|
|
1709
|
+
defaultExpanded: n = 1,
|
|
1663
1710
|
searchable: c = !1,
|
|
1664
|
-
copyable:
|
|
1665
|
-
className:
|
|
1666
|
-
...
|
|
1667
|
-
},
|
|
1668
|
-
const [
|
|
1711
|
+
copyable: i = !1,
|
|
1712
|
+
className: l,
|
|
1713
|
+
...d
|
|
1714
|
+
}, y) {
|
|
1715
|
+
const [h, k] = me(""), j = De(async () => {
|
|
1669
1716
|
try {
|
|
1670
|
-
let
|
|
1671
|
-
|
|
1717
|
+
let R;
|
|
1718
|
+
r === "yaml" ? R = Ze(t) : R = Rn(t), await navigator.clipboard.writeText(R);
|
|
1672
1719
|
} catch {
|
|
1673
1720
|
}
|
|
1674
|
-
}, [t,
|
|
1675
|
-
return /* @__PURE__ */
|
|
1676
|
-
(c ||
|
|
1677
|
-
c && /* @__PURE__ */
|
|
1678
|
-
|
|
1721
|
+
}, [t, r]), m = xn, T = Oe(() => /* @__PURE__ */ new WeakMap(), [h]);
|
|
1722
|
+
return /* @__PURE__ */ E.jsxs("div", { ref: y, className: Xe(ne.Root, l), "data-testid": "object-inspector", "data-format": r, ...d, children: [
|
|
1723
|
+
(c || i) && /* @__PURE__ */ E.jsxs("div", { className: ne.Toolbar, children: [
|
|
1724
|
+
c && /* @__PURE__ */ E.jsx("input", { className: ne.SearchInput, type: "text", value: h, onChange: (R) => k(R.target.value), placeholder: "Search keys/values…", "aria-label": "Search object", "data-testid": "inspector-search" }),
|
|
1725
|
+
i && /* @__PURE__ */ E.jsx("button", { className: ne.CopyButton, onClick: j, "data-testid": "inspector-copy", type: "button", children: "Copy" })
|
|
1679
1726
|
] }),
|
|
1680
|
-
/* @__PURE__ */
|
|
1727
|
+
/* @__PURE__ */ E.jsx("div", { className: ne.Tree, role: "tree", "data-testid": "inspector-tree", children: /* @__PURE__ */ E.jsx(Pt, { nodeKey: "root", value: t, depth: 0, defaultExpanded: n, searchQuery: h, isLast: !0, ancestors: m, searchCache: T }) })
|
|
1681
1728
|
] });
|
|
1682
1729
|
});
|
|
1683
|
-
|
|
1684
|
-
function
|
|
1730
|
+
kn.displayName = "ObjectInspector";
|
|
1731
|
+
function Rn(e) {
|
|
1685
1732
|
const t = [];
|
|
1686
|
-
return JSON.stringify(e, function(
|
|
1687
|
-
if (typeof
|
|
1733
|
+
return JSON.stringify(e, function(r, n) {
|
|
1734
|
+
if (typeof n != "object" || n === null) return n;
|
|
1688
1735
|
for (; t.length > 0 && t[t.length - 1] !== this; )
|
|
1689
1736
|
t.pop();
|
|
1690
|
-
return t.includes(
|
|
1737
|
+
return t.includes(n) ? "[Circular]" : (t.push(n), n);
|
|
1691
1738
|
}, 2);
|
|
1692
1739
|
}
|
|
1693
|
-
function
|
|
1740
|
+
function Ot(e) {
|
|
1694
1741
|
return !!(e === "" || /^[\s]/.test(e) || /[\s]$/.test(e) || /^[-?:,[\]{}#&*!|>'"%@`]/.test(e) || /[:\s]#|:\s|[{}[\],]/.test(e) || /^(true|false|yes|no|on|off|null|~)$/i.test(e) || /^[+-]?(\d+\.?\d*|\.inf|\.nan)$/i.test(e));
|
|
1695
1742
|
}
|
|
1696
|
-
function
|
|
1743
|
+
function Dt(e) {
|
|
1697
1744
|
return '"' + e.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\t/g, "\\t").replace(/\r/g, "\\r") + '"';
|
|
1698
1745
|
}
|
|
1699
|
-
function
|
|
1700
|
-
const
|
|
1746
|
+
function Sn(e, t) {
|
|
1747
|
+
const r = " ".repeat(t);
|
|
1701
1748
|
return e.includes(`
|
|
1702
1749
|
`) ? `|
|
|
1703
|
-
${
|
|
1750
|
+
${r} ${e.split(`
|
|
1704
1751
|
`).join(`
|
|
1705
|
-
${
|
|
1752
|
+
${r} `)}` : Ot(e) ? Dt(e) : e;
|
|
1706
1753
|
}
|
|
1707
|
-
function
|
|
1708
|
-
const
|
|
1754
|
+
function Ze(e, t = 0, r) {
|
|
1755
|
+
const n = " ".repeat(t);
|
|
1709
1756
|
if (e === null || e === void 0) return "null";
|
|
1710
|
-
if (typeof e == "string") return
|
|
1757
|
+
if (typeof e == "string") return Sn(e, t);
|
|
1711
1758
|
if (typeof e == "number" || typeof e == "boolean") return String(e);
|
|
1712
1759
|
if (typeof e == "object") {
|
|
1713
|
-
const c =
|
|
1760
|
+
const c = r ?? [];
|
|
1714
1761
|
if (c.includes(e)) return '"[Circular]"';
|
|
1715
|
-
const
|
|
1762
|
+
const i = [...c, e];
|
|
1716
1763
|
if (Array.isArray(e))
|
|
1717
|
-
return e.length === 0 ? "[]" : e.map((
|
|
1764
|
+
return e.length === 0 ? "[]" : e.map((d) => `${n}- ${Ze(d, t + 1, i).trimStart()}`).join(`
|
|
1718
1765
|
`);
|
|
1719
|
-
const
|
|
1720
|
-
return
|
|
1721
|
-
const
|
|
1722
|
-
return typeof
|
|
1723
|
-
${
|
|
1766
|
+
const l = Object.entries(e);
|
|
1767
|
+
return l.length === 0 ? "{}" : l.map(([d, y]) => {
|
|
1768
|
+
const h = Ot(d) ? Dt(d) : d, k = Ze(y, t + 1, i);
|
|
1769
|
+
return typeof y == "object" && y !== null && (Array.isArray(y) ? y.length > 0 : Object.keys(y).length > 0) ? `${n}${h}:
|
|
1770
|
+
${k}` : `${n}${h}: ${k}`;
|
|
1724
1771
|
}).join(`
|
|
1725
1772
|
`);
|
|
1726
1773
|
}
|
|
1727
1774
|
return String(e);
|
|
1728
1775
|
}
|
|
1729
|
-
|
|
1776
|
+
const we = "cel", vt = /* @__PURE__ */ new WeakSet();
|
|
1777
|
+
function En(e) {
|
|
1778
|
+
vt.has(e) || (vt.add(e), e.languages.register({
|
|
1779
|
+
id: we,
|
|
1780
|
+
extensions: [".cel"],
|
|
1781
|
+
aliases: ["CEL"]
|
|
1782
|
+
}), e.languages.setLanguageConfiguration(we, {
|
|
1783
|
+
comments: {
|
|
1784
|
+
lineComment: "//"
|
|
1785
|
+
},
|
|
1786
|
+
brackets: [["{", "}"], ["[", "]"], ["(", ")"]],
|
|
1787
|
+
autoClosingPairs: [{
|
|
1788
|
+
open: "{",
|
|
1789
|
+
close: "}"
|
|
1790
|
+
}, {
|
|
1791
|
+
open: "[",
|
|
1792
|
+
close: "]"
|
|
1793
|
+
}, {
|
|
1794
|
+
open: "(",
|
|
1795
|
+
close: ")"
|
|
1796
|
+
}, {
|
|
1797
|
+
open: '"',
|
|
1798
|
+
close: '"',
|
|
1799
|
+
notIn: ["string", "comment"]
|
|
1800
|
+
}, {
|
|
1801
|
+
open: "'",
|
|
1802
|
+
close: "'",
|
|
1803
|
+
notIn: ["string", "comment"]
|
|
1804
|
+
}],
|
|
1805
|
+
surroundingPairs: [{
|
|
1806
|
+
open: "{",
|
|
1807
|
+
close: "}"
|
|
1808
|
+
}, {
|
|
1809
|
+
open: "[",
|
|
1810
|
+
close: "]"
|
|
1811
|
+
}, {
|
|
1812
|
+
open: "(",
|
|
1813
|
+
close: ")"
|
|
1814
|
+
}, {
|
|
1815
|
+
open: '"',
|
|
1816
|
+
close: '"'
|
|
1817
|
+
}, {
|
|
1818
|
+
open: "'",
|
|
1819
|
+
close: "'"
|
|
1820
|
+
}],
|
|
1821
|
+
wordPattern: /[a-zA-Z_][a-zA-Z_0-9]*/g
|
|
1822
|
+
}), e.languages.setMonarchTokensProvider(we, {
|
|
1823
|
+
keywords: ["true", "false", "null", "in"],
|
|
1824
|
+
tokenizer: {
|
|
1825
|
+
root: [[/\/\/.*$/, "comment"], [/[rR]?[bB]?'''/, "string", "@tripleSingle"], [/[rR]?[bB]?"""/, "string", "@tripleDouble"], [/[rR]?[bB]?'/, "string", "@single"], [/[rR]?[bB]?"/, "string", "@double"], [/0[xX][0-9a-fA-F]+[uU]?/, "number.hex"], [/(?:\d+\.\d*|\.\d+|\d+)(?:[eE][+-]?\d+)?[uU]?/, "number"], [/[a-zA-Z_][a-zA-Z_0-9]*(?=\s*\()/, "type.identifier"], [/[a-zA-Z_][a-zA-Z_0-9]*/, {
|
|
1826
|
+
cases: {
|
|
1827
|
+
"@keywords": "keyword",
|
|
1828
|
+
"@default": "identifier"
|
|
1829
|
+
}
|
|
1830
|
+
}], [/[{}()[\]]/, "@brackets"], [/[!<>=&|+*/%?:-]+/, "operator"], [/[.,]/, "delimiter"], [/\s+/, "white"]],
|
|
1831
|
+
single: [[/\\./, "string.escape"], [/'/, "string", "@pop"], [/[^'\\]+/, "string"]],
|
|
1832
|
+
double: [[/\\./, "string.escape"], [/"/, "string", "@pop"], [/[^"\\]+/, "string"]],
|
|
1833
|
+
tripleSingle: [[/'''/, "string", "@pop"], [/\\./, "string.escape"], [/[^'\\]+|'/, "string"]],
|
|
1834
|
+
tripleDouble: [[/"""/, "string", "@pop"], [/\\./, "string.escape"], [/[^"\\]+|"/, "string"]]
|
|
1835
|
+
}
|
|
1836
|
+
}));
|
|
1837
|
+
}
|
|
1838
|
+
function bt(e, t) {
|
|
1839
|
+
const r = or(e, t);
|
|
1840
|
+
let n = 1, c = 0;
|
|
1841
|
+
for (let i = 0; i < r; i++)
|
|
1842
|
+
if (e[i] === "\r" || e[i] === `
|
|
1843
|
+
`) {
|
|
1844
|
+
if (e[i] === "\r" && e[i + 1] === `
|
|
1845
|
+
` && i++, i >= r) throw new RangeError("Offset splits a line ending");
|
|
1846
|
+
n++, c = i + 1;
|
|
1847
|
+
}
|
|
1848
|
+
return {
|
|
1849
|
+
lineNumber: n,
|
|
1850
|
+
column: r - c + 1
|
|
1851
|
+
};
|
|
1852
|
+
}
|
|
1853
|
+
function Tn(e, t) {
|
|
1854
|
+
if (!Number.isSafeInteger(t.lineNumber) || t.lineNumber < 1 || !Number.isSafeInteger(t.column) || t.column < 1) throw new RangeError("Expected a one-based source position");
|
|
1855
|
+
let r = 1, n = 0;
|
|
1856
|
+
for (; r < t.lineNumber; ) {
|
|
1857
|
+
let l = n;
|
|
1858
|
+
for (; l < e.length && e[l] !== "\r" && e[l] !== `
|
|
1859
|
+
`; ) l++;
|
|
1860
|
+
if (l === e.length) throw new RangeError("Position exceeds source lines");
|
|
1861
|
+
n = l + (e[l] === "\r" && e[l + 1] === `
|
|
1862
|
+
` ? 2 : 1), r++;
|
|
1863
|
+
}
|
|
1864
|
+
const c = n + t.column - 1;
|
|
1865
|
+
let i = n;
|
|
1866
|
+
for (; i < e.length && e[i] !== "\r" && e[i] !== `
|
|
1867
|
+
`; ) i++;
|
|
1868
|
+
if (c > i) throw new RangeError("Position exceeds source line");
|
|
1869
|
+
return nr(e, c);
|
|
1870
|
+
}
|
|
1871
|
+
function Mn(e, t) {
|
|
1872
|
+
let r = 0;
|
|
1873
|
+
const n = e.toLocaleLowerCase();
|
|
1874
|
+
for (const c of t.toLocaleLowerCase())
|
|
1875
|
+
if (c === n[r] && r++, r === n.length) return !0;
|
|
1876
|
+
return n.length === 0;
|
|
1877
|
+
}
|
|
1878
|
+
function Ae() {
|
|
1879
|
+
let e;
|
|
1880
|
+
return {
|
|
1881
|
+
begin() {
|
|
1882
|
+
return e?.abort(), e = new AbortController(), e;
|
|
1883
|
+
},
|
|
1884
|
+
current(t) {
|
|
1885
|
+
return e === t && !t.signal.aborted;
|
|
1886
|
+
},
|
|
1887
|
+
cancel() {
|
|
1888
|
+
e?.abort(), e = void 0;
|
|
1889
|
+
}
|
|
1890
|
+
};
|
|
1891
|
+
}
|
|
1892
|
+
function jn(e, t = 250) {
|
|
1893
|
+
let r;
|
|
1894
|
+
const n = () => {
|
|
1895
|
+
clearTimeout(r), r = void 0;
|
|
1896
|
+
};
|
|
1897
|
+
return {
|
|
1898
|
+
schedule(c = t) {
|
|
1899
|
+
n(), r = setTimeout(() => {
|
|
1900
|
+
r = void 0, e();
|
|
1901
|
+
}, c);
|
|
1902
|
+
},
|
|
1903
|
+
immediate() {
|
|
1904
|
+
n(), e();
|
|
1905
|
+
},
|
|
1906
|
+
cancel: n
|
|
1907
|
+
};
|
|
1908
|
+
}
|
|
1909
|
+
function Nn(e, t, r, n, c = 250) {
|
|
1910
|
+
const i = e.getModel();
|
|
1911
|
+
if (!i) throw new Error("CEL editor requires its own model");
|
|
1912
|
+
En(t), t.editor.setModelLanguage(i, we);
|
|
1913
|
+
const l = Ae(), d = Ae(), y = Ae(), h = Ae();
|
|
1914
|
+
let k = !1, j = !1, m = 0, T, R = !1, H = !1, x;
|
|
1915
|
+
const z = `cel:${i.uri.toString()}`, S = {
|
|
1916
|
+
language: we,
|
|
1917
|
+
scheme: i.uri.scheme,
|
|
1918
|
+
pattern: i.uri.path
|
|
1919
|
+
}, D = () => {
|
|
1920
|
+
const o = r();
|
|
1921
|
+
return k || i.isDisposed() || j || o.disabled || !!(o.availability && o.availability.status !== "ready");
|
|
1922
|
+
};
|
|
1923
|
+
function I() {
|
|
1924
|
+
e.trigger("cel", "closeParameterHints", {}), e.getContribution("editor.contrib.contentHover")?._hideWidgets();
|
|
1925
|
+
}
|
|
1926
|
+
function B(o, v) {
|
|
1927
|
+
if (v.unit !== "utf8-byte" || v.end < v.start) throw new RangeError("Expected a half-open UTF-8 range");
|
|
1928
|
+
const p = bt(o, v.start), s = bt(o, v.end);
|
|
1929
|
+
return {
|
|
1930
|
+
startLineNumber: p.lineNumber,
|
|
1931
|
+
startColumn: p.column,
|
|
1932
|
+
endLineNumber: s.lineNumber,
|
|
1933
|
+
endColumn: s.column
|
|
1934
|
+
};
|
|
1935
|
+
}
|
|
1936
|
+
async function N(o, v, p, s) {
|
|
1937
|
+
if (!o || D() || s?.isCancellationRequested) return;
|
|
1938
|
+
const u = r(), f = {
|
|
1939
|
+
...u.document,
|
|
1940
|
+
uri: i.uri.toString()
|
|
1941
|
+
}, g = i.getVersionId(), _ = m, C = p.begin(), a = s?.onCancellationRequested(() => C.abort());
|
|
1942
|
+
try {
|
|
1943
|
+
const w = await o({
|
|
1944
|
+
document: f,
|
|
1945
|
+
contextKey: u.contextKey,
|
|
1946
|
+
cursor: {
|
|
1947
|
+
offset: Tn(f.text, v),
|
|
1948
|
+
unit: "utf8-byte"
|
|
1949
|
+
},
|
|
1950
|
+
signal: C.signal
|
|
1951
|
+
}), A = r();
|
|
1952
|
+
return D() || !p.current(C) || _ !== m || i.isDisposed() || i.getVersionId() !== g || A.contextKey !== u.contextKey || A.document.version !== f.version || A.document.text !== f.text || w.documentVersion !== f.version || w.contextKey !== u.contextKey ? void 0 : (w.status !== "ready" && w.status !== "empty" && n(w.message ?? `CEL language service ${w.status}.`), w);
|
|
1953
|
+
} catch (w) {
|
|
1954
|
+
!C.signal.aborted && p.current(C) && !k && n(w instanceof Error ? w.message : "CEL language service request failed.");
|
|
1955
|
+
return;
|
|
1956
|
+
} finally {
|
|
1957
|
+
a?.dispose();
|
|
1958
|
+
}
|
|
1959
|
+
}
|
|
1960
|
+
function q(o) {
|
|
1961
|
+
if (o.status === "denied" || o.status === "unavailable") {
|
|
1962
|
+
t.editor.setModelMarkers(i, z, []);
|
|
1963
|
+
return;
|
|
1964
|
+
}
|
|
1965
|
+
const v = {
|
|
1966
|
+
error: t.MarkerSeverity.Error,
|
|
1967
|
+
warning: t.MarkerSeverity.Warning,
|
|
1968
|
+
info: t.MarkerSeverity.Info,
|
|
1969
|
+
hint: t.MarkerSeverity.Hint
|
|
1970
|
+
}, p = [];
|
|
1971
|
+
for (const s of o.diagnostics)
|
|
1972
|
+
try {
|
|
1973
|
+
p.push({
|
|
1974
|
+
...B(r().document.text, s.range),
|
|
1975
|
+
severity: v[s.severity],
|
|
1976
|
+
message: s.message,
|
|
1977
|
+
source: "CEL",
|
|
1978
|
+
code: s.id
|
|
1979
|
+
});
|
|
1980
|
+
} catch {
|
|
1981
|
+
n("The language service returned an invalid UTF-8 diagnostic range.");
|
|
1982
|
+
}
|
|
1983
|
+
t.editor.setModelMarkers(i, z, p);
|
|
1984
|
+
}
|
|
1985
|
+
function P(o, v, p) {
|
|
1986
|
+
if (o.disabledReason) return;
|
|
1987
|
+
const s = r().document.text, u = B(s, o.edit.range);
|
|
1988
|
+
if (u.startLineNumber !== p.lineNumber || u.endLineNumber !== p.lineNumber || u.startColumn > p.column || u.endColumn < p.column) throw new RangeError("Completion range must contain the cursor on one line");
|
|
1989
|
+
const f = i.getValueInRange({
|
|
1990
|
+
...u,
|
|
1991
|
+
endColumn: p.column
|
|
1992
|
+
});
|
|
1993
|
+
if (!Mn(f, o.filterText ?? o.label)) return;
|
|
1994
|
+
const g = {
|
|
1995
|
+
field: t.languages.CompletionItemKind.Field,
|
|
1996
|
+
operator: t.languages.CompletionItemKind.Operator,
|
|
1997
|
+
value: t.languages.CompletionItemKind.Value,
|
|
1998
|
+
parameter: t.languages.CompletionItemKind.Variable,
|
|
1999
|
+
function: t.languages.CompletionItemKind.Function
|
|
2000
|
+
};
|
|
2001
|
+
return {
|
|
2002
|
+
label: {
|
|
2003
|
+
label: o.label,
|
|
2004
|
+
detail: o.type ? `: ${o.type}` : void 0
|
|
2005
|
+
},
|
|
2006
|
+
kind: g[o.kind],
|
|
2007
|
+
detail: o.detail ?? o.type,
|
|
2008
|
+
documentation: o.description || o.condition ? {
|
|
2009
|
+
value: [o.description, o.condition].filter(Boolean).join(`
|
|
2010
|
+
|
|
2011
|
+
`),
|
|
2012
|
+
isTrusted: !1
|
|
2013
|
+
} : void 0,
|
|
2014
|
+
filterText: o.filterText ?? o.label,
|
|
2015
|
+
sortText: o.sortText ?? String(v).padStart(6, "0"),
|
|
2016
|
+
insertText: o.edit.text,
|
|
2017
|
+
insertTextRules: o.insertTextFormat === "snippet" ? t.languages.CompletionItemInsertTextRule.InsertAsSnippet : void 0,
|
|
2018
|
+
range: u
|
|
2019
|
+
};
|
|
2020
|
+
}
|
|
2021
|
+
const V = jn(() => {
|
|
2022
|
+
if (D()) return;
|
|
2023
|
+
const o = r(), v = e.getPosition();
|
|
2024
|
+
v && (o.check && N(o.check, v, d).then((p) => {
|
|
2025
|
+
p && (n(p.message), q(p));
|
|
2026
|
+
}), o.request && !R && e.hasTextFocus() && (T = i.getVersionId(), e.trigger("cel", "editor.action.triggerSuggest", {})));
|
|
2027
|
+
}, c), K = [t.languages.registerCompletionItemProvider(S, {
|
|
2028
|
+
async provideCompletionItems(o, v, p, s) {
|
|
2029
|
+
if (o !== i || D()) return {
|
|
2030
|
+
suggestions: []
|
|
2031
|
+
};
|
|
2032
|
+
if (p.triggerKind !== 0 || T !== i.getVersionId()) return {
|
|
2033
|
+
suggestions: []
|
|
2034
|
+
};
|
|
2035
|
+
T = void 0;
|
|
2036
|
+
const u = r(), f = await N(u.request, v, l, s);
|
|
2037
|
+
if (!f) return {
|
|
2038
|
+
suggestions: []
|
|
2039
|
+
};
|
|
2040
|
+
if (u.check || q(f), f.status !== "ready") return {
|
|
2041
|
+
suggestions: []
|
|
2042
|
+
};
|
|
2043
|
+
n(f.message);
|
|
2044
|
+
const g = [];
|
|
2045
|
+
for (const [_, C] of f.completions.slice(0, u.maxSuggestions ?? 100).entries())
|
|
2046
|
+
try {
|
|
2047
|
+
const a = P(C, _, v);
|
|
2048
|
+
a && g.push(a);
|
|
2049
|
+
} catch {
|
|
2050
|
+
n("The language service returned an invalid UTF-8 completion range.");
|
|
2051
|
+
}
|
|
2052
|
+
return {
|
|
2053
|
+
suggestions: g,
|
|
2054
|
+
incomplete: f.incomplete ?? !1
|
|
2055
|
+
};
|
|
2056
|
+
}
|
|
2057
|
+
}), t.languages.registerHoverProvider(S, {
|
|
2058
|
+
async provideHover(o, v, p) {
|
|
2059
|
+
if (o !== i) return;
|
|
2060
|
+
const s = await N(r().hover, v, y, p);
|
|
2061
|
+
if (!(s?.status !== "ready" || !s.hover))
|
|
2062
|
+
try {
|
|
2063
|
+
return {
|
|
2064
|
+
range: B(r().document.text, s.hover.range),
|
|
2065
|
+
contents: [{
|
|
2066
|
+
value: s.hover.contents,
|
|
2067
|
+
isTrusted: !1
|
|
2068
|
+
}]
|
|
2069
|
+
};
|
|
2070
|
+
} catch {
|
|
2071
|
+
n("The language service returned an invalid UTF-8 hover range.");
|
|
2072
|
+
return;
|
|
2073
|
+
}
|
|
2074
|
+
}
|
|
2075
|
+
}), t.languages.registerSignatureHelpProvider(S, {
|
|
2076
|
+
signatureHelpTriggerCharacters: ["(", ","],
|
|
2077
|
+
signatureHelpRetriggerCharacters: [","],
|
|
2078
|
+
async provideSignatureHelp(o, v, p) {
|
|
2079
|
+
if (o !== i) return;
|
|
2080
|
+
const s = await N(r().signature, v, h, p);
|
|
2081
|
+
if (s?.status !== "ready" || !s.signature) return;
|
|
2082
|
+
const u = s.signature;
|
|
2083
|
+
return {
|
|
2084
|
+
value: {
|
|
2085
|
+
activeSignature: 0,
|
|
2086
|
+
activeParameter: Math.max(0, Math.min(u.activeParameter, u.parameters.length - 1)),
|
|
2087
|
+
signatures: [{
|
|
2088
|
+
label: u.label,
|
|
2089
|
+
documentation: u.documentation ? {
|
|
2090
|
+
value: u.documentation,
|
|
2091
|
+
isTrusted: !1
|
|
2092
|
+
} : void 0,
|
|
2093
|
+
parameters: u.parameters.map((f) => ({
|
|
2094
|
+
label: f.label,
|
|
2095
|
+
documentation: f.documentation ? {
|
|
2096
|
+
value: f.documentation,
|
|
2097
|
+
isTrusted: !1
|
|
2098
|
+
} : void 0
|
|
2099
|
+
}))
|
|
2100
|
+
}]
|
|
2101
|
+
},
|
|
2102
|
+
dispose() {
|
|
2103
|
+
}
|
|
2104
|
+
};
|
|
2105
|
+
}
|
|
2106
|
+
}), e.onDidChangeModelContent(() => {
|
|
2107
|
+
H = !0, R = !1, T = void 0, l.cancel(), d.cancel(), y.cancel(), h.cancel(), e.trigger("cel", "hideSuggestWidget", {}), t.editor.setModelMarkers(i, z, []), j || V.schedule(r().debounceMs ?? c);
|
|
2108
|
+
}), e.onDidChangeCursorPosition(() => {
|
|
2109
|
+
T = void 0, l.cancel(), h.cancel();
|
|
2110
|
+
}), e.onDidCompositionStart(() => {
|
|
2111
|
+
j = !0, T = void 0, V.cancel(), l.cancel(), d.cancel(), y.cancel(), h.cancel(), e.trigger("cel", "hideSuggestWidget", {}), I();
|
|
2112
|
+
}), e.onDidCompositionEnd(() => {
|
|
2113
|
+
j = !1, V.schedule(r().debounceMs ?? c);
|
|
2114
|
+
}), e.onKeyDown((o) => {
|
|
2115
|
+
o.keyCode === t.KeyCode.Escape && (T = void 0, R = !0, l.cancel());
|
|
2116
|
+
}), e.addAction({
|
|
2117
|
+
id: `cel.complete.${i.id}`,
|
|
2118
|
+
label: "CEL: Show contextual suggestions",
|
|
2119
|
+
precondition: "!suggestWidgetVisible || !suggestWidgetHasFocusedSuggestion",
|
|
2120
|
+
keybindings: [t.KeyMod.CtrlCmd | t.KeyCode.Space, t.KeyMod.WinCtrl | t.KeyCode.Space],
|
|
2121
|
+
run: () => {
|
|
2122
|
+
D() || (R = !1, V.immediate());
|
|
2123
|
+
}
|
|
2124
|
+
}), e.addAction({
|
|
2125
|
+
id: `cel.run.${i.id}`,
|
|
2126
|
+
label: "CEL: Run query",
|
|
2127
|
+
keybindings: [t.KeyMod.CtrlCmd | t.KeyCode.Enter],
|
|
2128
|
+
run: () => {
|
|
2129
|
+
D() || r().onSubmit?.();
|
|
2130
|
+
}
|
|
2131
|
+
})];
|
|
2132
|
+
function b() {
|
|
2133
|
+
if (k || i.isDisposed()) return;
|
|
2134
|
+
const o = r(), v = x && x.contextKey === o.contextKey && x.request === o.request && x.check === o.check && x.hover === o.hover && x.signature === o.signature && x.disabled === o.disabled && x.maxSuggestions === o.maxSuggestions && x.debounceMs === o.debounceMs && x.availability?.status === o.availability?.status && x.availability?.message === o.availability?.message;
|
|
2135
|
+
x && (x.contextKey !== o.contextKey || x.request !== o.request || x.check !== o.check || x.hover !== o.hover || x.signature !== o.signature) && x.onDocumentClose?.(i.uri.toString());
|
|
2136
|
+
const p = H && i.getValue() === o.document.text, s = x?.document.text === o.document.text && x.document.version === o.document.version;
|
|
2137
|
+
x = {
|
|
2138
|
+
...o,
|
|
2139
|
+
document: {
|
|
2140
|
+
...o.document
|
|
2141
|
+
},
|
|
2142
|
+
availability: o.availability ? {
|
|
2143
|
+
...o.availability
|
|
2144
|
+
} : void 0
|
|
2145
|
+
}, H = !1, !(v && (p || s)) && (T = void 0, R = !1, m++, l.cancel(), d.cancel(), y.cancel(), h.cancel(), V.cancel(), e.trigger("cel", "hideSuggestWidget", {}), I(), t.editor.setModelMarkers(i, z, []), e.updateOptions({
|
|
2146
|
+
quickSuggestions: !1,
|
|
2147
|
+
suggestOnTriggerCharacters: !1,
|
|
2148
|
+
wordBasedSuggestions: "off",
|
|
2149
|
+
parameterHints: {
|
|
2150
|
+
enabled: !0
|
|
2151
|
+
},
|
|
2152
|
+
suggest: {
|
|
2153
|
+
showWords: !1,
|
|
2154
|
+
showStatusBar: !0,
|
|
2155
|
+
preview: !1,
|
|
2156
|
+
selectionMode: "always"
|
|
2157
|
+
},
|
|
2158
|
+
acceptSuggestionOnEnter: "on",
|
|
2159
|
+
tabCompletion: "off",
|
|
2160
|
+
renderValidationDecorations: "on",
|
|
2161
|
+
fixedOverflowWidgets: !0,
|
|
2162
|
+
padding: {
|
|
2163
|
+
top: 8,
|
|
2164
|
+
bottom: 8
|
|
2165
|
+
}
|
|
2166
|
+
}), n(r().availability?.message), D() || V.schedule(o.debounceMs ?? c));
|
|
2167
|
+
}
|
|
2168
|
+
return b(), {
|
|
2169
|
+
refresh: b,
|
|
2170
|
+
dispose() {
|
|
2171
|
+
if (!k) {
|
|
2172
|
+
k = !0, T = void 0, V.cancel(), l.cancel(), d.cancel(), y.cancel(), h.cancel(), x?.onDocumentClose?.(i.uri.toString());
|
|
2173
|
+
for (const o of K) o.dispose();
|
|
2174
|
+
i.isDisposed() || I(), i.isDisposed() || t.editor.setModelMarkers(i, z, []);
|
|
2175
|
+
}
|
|
2176
|
+
}
|
|
2177
|
+
};
|
|
2178
|
+
}
|
|
2179
|
+
const An = "_Root_im36v_1", Ln = "_Label_im36v_7", Pn = "_Surface_im36v_12", On = "_Placeholder_im36v_24", Dn = "_Loading_im36v_31", $n = "_Message_im36v_35", In = "_Hint_im36v_40", ve = {
|
|
2180
|
+
Root: An,
|
|
2181
|
+
Label: Ln,
|
|
2182
|
+
Surface: Pn,
|
|
2183
|
+
Placeholder: On,
|
|
2184
|
+
Loading: Dn,
|
|
2185
|
+
Message: $n,
|
|
2186
|
+
Hint: In
|
|
2187
|
+
}, Wn = Rt(() => Promise.resolve().then(() => Er).then((e) => ({
|
|
2188
|
+
default: e.CodeEditor
|
|
2189
|
+
})));
|
|
2190
|
+
let Hn = 0;
|
|
2191
|
+
function Mo(e) {
|
|
2192
|
+
const {
|
|
2193
|
+
document: t,
|
|
2194
|
+
contextKey: r,
|
|
2195
|
+
request: n,
|
|
2196
|
+
check: c,
|
|
2197
|
+
hover: i,
|
|
2198
|
+
signature: l,
|
|
2199
|
+
disabled: d,
|
|
2200
|
+
availability: y,
|
|
2201
|
+
debounceMs: h = 250,
|
|
2202
|
+
maxSuggestions: k = 100,
|
|
2203
|
+
label: j = "CEL query",
|
|
2204
|
+
placeholder: m = "Enter a CEL expression…",
|
|
2205
|
+
minHeight: T = 52,
|
|
2206
|
+
maxHeight: R = 180,
|
|
2207
|
+
className: H
|
|
2208
|
+
} = e, x = G(e);
|
|
2209
|
+
x.current = e;
|
|
2210
|
+
const [z] = me(() => `cel-query-${++Hn}:///query.cel`), [S, D] = me(T), [I, B] = me(), [N, q] = me(null), P = G(null), V = d || !!(y && y.status !== "ready");
|
|
2211
|
+
U(() => {
|
|
2212
|
+
const b = N?.editor.getModel();
|
|
2213
|
+
if (!N || !b || b.isDisposed()) return;
|
|
2214
|
+
const {
|
|
2215
|
+
editor: o,
|
|
2216
|
+
monaco: v
|
|
2217
|
+
} = N, p = Nn(o, v, () => x.current, B);
|
|
2218
|
+
P.current = p;
|
|
2219
|
+
const s = () => D(Math.max(x.current.minHeight ?? 52, Math.min(x.current.maxHeight ?? 180, o.getContentHeight())));
|
|
2220
|
+
s();
|
|
2221
|
+
const u = o.onDidContentSizeChange(s);
|
|
2222
|
+
return () => {
|
|
2223
|
+
u.dispose(), p.dispose(), P.current === p && (P.current = null);
|
|
2224
|
+
};
|
|
2225
|
+
}, [N]), U(() => {
|
|
2226
|
+
P.current?.refresh();
|
|
2227
|
+
}, [t.text, t.version, r, n, c, i, l, d, y?.status, y?.message, k, h, N]), U(() => {
|
|
2228
|
+
const b = N?.editor;
|
|
2229
|
+
b?.getModel() && (b.updateOptions({
|
|
2230
|
+
ariaLabel: j
|
|
2231
|
+
}), D(Math.max(T, Math.min(R, b.getContentHeight()))));
|
|
2232
|
+
}, [j, T, R, N]);
|
|
2233
|
+
function K(b, o) {
|
|
2234
|
+
q({
|
|
2235
|
+
editor: b,
|
|
2236
|
+
monaco: o
|
|
2237
|
+
}), x.current.onMount?.(b, o);
|
|
2238
|
+
}
|
|
2239
|
+
return /* @__PURE__ */ E.jsxs("div", { className: `${ve.Root} ${H ?? ""}`, "data-testid": "cel-query-editor", "data-context-key": r, "data-availability": y?.status ?? "ready", children: [
|
|
2240
|
+
/* @__PURE__ */ E.jsx("div", { className: ve.Label, children: j }),
|
|
2241
|
+
/* @__PURE__ */ E.jsxs("div", { className: ve.Surface, style: {
|
|
2242
|
+
"--_cel-editor-min-height": `${T}px`
|
|
2243
|
+
}, children: [
|
|
2244
|
+
/* @__PURE__ */ E.jsx(kt, { fallback: /* @__PURE__ */ E.jsx("div", { role: "status", className: ve.Loading, children: "Loading CEL editor…" }), children: /* @__PURE__ */ E.jsx(Wn, { value: t.text, onChange: (b) => {
|
|
2245
|
+
const o = x.current;
|
|
2246
|
+
x.current = {
|
|
2247
|
+
...o,
|
|
2248
|
+
document: {
|
|
2249
|
+
text: b,
|
|
2250
|
+
version: o.document.version + 1
|
|
2251
|
+
}
|
|
2252
|
+
}, o.onChange(b);
|
|
2253
|
+
}, filename: z, language: we, readOnly: V, lineNumbers: !1, minimap: !1, wordWrap: !0, quickSuggestions: !1, diagnostics: !0, bordered: !1, height: S, onMount: K }) }),
|
|
2254
|
+
!t.text && !V ? /* @__PURE__ */ E.jsx("div", { className: ve.Placeholder, "aria-hidden": "true", children: m }) : null
|
|
2255
|
+
] }),
|
|
2256
|
+
I || y?.message ? /* @__PURE__ */ E.jsx("div", { role: y?.status === "denied" || y?.status === "error" ? "alert" : "status", className: ve.Message, children: I ?? y?.message }) : null,
|
|
2257
|
+
/* @__PURE__ */ E.jsx("div", { className: ve.Hint, children: "Ctrl+Space suggestions · ⌘/Ctrl+Enter run · Enter accepts a suggestion" })
|
|
2258
|
+
] });
|
|
2259
|
+
}
|
|
2260
|
+
var $t;
|
|
1730
2261
|
(() => {
|
|
1731
|
-
var e = { 975: (
|
|
1732
|
-
function s
|
|
1733
|
-
if (typeof
|
|
2262
|
+
var e = { 975: (b) => {
|
|
2263
|
+
function o(s) {
|
|
2264
|
+
if (typeof s != "string") throw new TypeError("Path must be a string. Received " + JSON.stringify(s));
|
|
1734
2265
|
}
|
|
1735
|
-
function
|
|
1736
|
-
for (var
|
|
1737
|
-
if (
|
|
2266
|
+
function v(s, u) {
|
|
2267
|
+
for (var f, g = "", _ = 0, C = -1, a = 0, w = 0; w <= s.length; ++w) {
|
|
2268
|
+
if (w < s.length) f = s.charCodeAt(w);
|
|
1738
2269
|
else {
|
|
1739
|
-
if (
|
|
1740
|
-
|
|
2270
|
+
if (f === 47) break;
|
|
2271
|
+
f = 47;
|
|
1741
2272
|
}
|
|
1742
|
-
if (
|
|
1743
|
-
if (!(
|
|
1744
|
-
if (
|
|
1745
|
-
if (
|
|
1746
|
-
var
|
|
1747
|
-
if (
|
|
1748
|
-
|
|
2273
|
+
if (f === 47) {
|
|
2274
|
+
if (!(C === w - 1 || a === 1)) if (C !== w - 1 && a === 2) {
|
|
2275
|
+
if (g.length < 2 || _ !== 2 || g.charCodeAt(g.length - 1) !== 46 || g.charCodeAt(g.length - 2) !== 46) {
|
|
2276
|
+
if (g.length > 2) {
|
|
2277
|
+
var A = g.lastIndexOf("/");
|
|
2278
|
+
if (A !== g.length - 1) {
|
|
2279
|
+
A === -1 ? (g = "", _ = 0) : _ = (g = g.slice(0, A)).length - 1 - g.lastIndexOf("/"), C = w, a = 0;
|
|
1749
2280
|
continue;
|
|
1750
2281
|
}
|
|
1751
|
-
} else if (
|
|
1752
|
-
|
|
2282
|
+
} else if (g.length === 2 || g.length === 1) {
|
|
2283
|
+
g = "", _ = 0, C = w, a = 0;
|
|
1753
2284
|
continue;
|
|
1754
2285
|
}
|
|
1755
2286
|
}
|
|
1756
|
-
u && (
|
|
1757
|
-
} else
|
|
1758
|
-
|
|
1759
|
-
} else
|
|
2287
|
+
u && (g.length > 0 ? g += "/.." : g = "..", _ = 2);
|
|
2288
|
+
} else g.length > 0 ? g += "/" + s.slice(C + 1, w) : g = s.slice(C + 1, w), _ = w - C - 1;
|
|
2289
|
+
C = w, a = 0;
|
|
2290
|
+
} else f === 46 && a !== -1 ? ++a : a = -1;
|
|
1760
2291
|
}
|
|
1761
|
-
return
|
|
2292
|
+
return g;
|
|
1762
2293
|
}
|
|
1763
|
-
var
|
|
1764
|
-
for (var
|
|
1765
|
-
var
|
|
1766
|
-
|
|
2294
|
+
var p = { resolve: function() {
|
|
2295
|
+
for (var s, u = "", f = !1, g = arguments.length - 1; g >= -1 && !f; g--) {
|
|
2296
|
+
var _;
|
|
2297
|
+
g >= 0 ? _ = arguments[g] : (s === void 0 && (s = process.cwd()), _ = s), o(_), _.length !== 0 && (u = _ + "/" + u, f = _.charCodeAt(0) === 47);
|
|
1767
2298
|
}
|
|
1768
|
-
return u =
|
|
1769
|
-
}, normalize: function(
|
|
1770
|
-
if (s
|
|
1771
|
-
var u =
|
|
1772
|
-
return (
|
|
1773
|
-
}, isAbsolute: function(
|
|
1774
|
-
return s
|
|
2299
|
+
return u = v(u, !f), f ? u.length > 0 ? "/" + u : "/" : u.length > 0 ? u : ".";
|
|
2300
|
+
}, normalize: function(s) {
|
|
2301
|
+
if (o(s), s.length === 0) return ".";
|
|
2302
|
+
var u = s.charCodeAt(0) === 47, f = s.charCodeAt(s.length - 1) === 47;
|
|
2303
|
+
return (s = v(s, !u)).length !== 0 || u || (s = "."), s.length > 0 && f && (s += "/"), u ? "/" + s : s;
|
|
2304
|
+
}, isAbsolute: function(s) {
|
|
2305
|
+
return o(s), s.length > 0 && s.charCodeAt(0) === 47;
|
|
1775
2306
|
}, join: function() {
|
|
1776
2307
|
if (arguments.length === 0) return ".";
|
|
1777
|
-
for (var
|
|
1778
|
-
var
|
|
1779
|
-
|
|
2308
|
+
for (var s, u = 0; u < arguments.length; ++u) {
|
|
2309
|
+
var f = arguments[u];
|
|
2310
|
+
o(f), f.length > 0 && (s === void 0 ? s = f : s += "/" + f);
|
|
1780
2311
|
}
|
|
1781
|
-
return
|
|
1782
|
-
}, relative: function(
|
|
1783
|
-
if (s
|
|
1784
|
-
for (var
|
|
1785
|
-
for (var
|
|
1786
|
-
for (var
|
|
1787
|
-
if (
|
|
1788
|
-
if (
|
|
1789
|
-
if (u.charCodeAt(
|
|
1790
|
-
if (
|
|
1791
|
-
} else
|
|
2312
|
+
return s === void 0 ? "." : p.normalize(s);
|
|
2313
|
+
}, relative: function(s, u) {
|
|
2314
|
+
if (o(s), o(u), s === u || (s = p.resolve(s)) === (u = p.resolve(u))) return "";
|
|
2315
|
+
for (var f = 1; f < s.length && s.charCodeAt(f) === 47; ++f) ;
|
|
2316
|
+
for (var g = s.length, _ = g - f, C = 1; C < u.length && u.charCodeAt(C) === 47; ++C) ;
|
|
2317
|
+
for (var a = u.length - C, w = _ < a ? _ : a, A = -1, L = 0; L <= w; ++L) {
|
|
2318
|
+
if (L === w) {
|
|
2319
|
+
if (a > w) {
|
|
2320
|
+
if (u.charCodeAt(C + L) === 47) return u.slice(C + L + 1);
|
|
2321
|
+
if (L === 0) return u.slice(C + L);
|
|
2322
|
+
} else _ > w && (s.charCodeAt(f + L) === 47 ? A = L : L === 0 && (A = 0));
|
|
1792
2323
|
break;
|
|
1793
2324
|
}
|
|
1794
|
-
var
|
|
1795
|
-
if (
|
|
1796
|
-
|
|
2325
|
+
var F = s.charCodeAt(f + L);
|
|
2326
|
+
if (F !== u.charCodeAt(C + L)) break;
|
|
2327
|
+
F === 47 && (A = L);
|
|
1797
2328
|
}
|
|
1798
|
-
var
|
|
1799
|
-
for (
|
|
1800
|
-
return
|
|
1801
|
-
}, _makeLong: function(
|
|
1802
|
-
return
|
|
1803
|
-
}, dirname: function(
|
|
1804
|
-
if (s
|
|
1805
|
-
for (var u =
|
|
1806
|
-
if (!
|
|
1807
|
-
|
|
2329
|
+
var O = "";
|
|
2330
|
+
for (L = f + A + 1; L <= g; ++L) L !== g && s.charCodeAt(L) !== 47 || (O.length === 0 ? O += ".." : O += "/..");
|
|
2331
|
+
return O.length > 0 ? O + u.slice(C + A) : (C += A, u.charCodeAt(C) === 47 && ++C, u.slice(C));
|
|
2332
|
+
}, _makeLong: function(s) {
|
|
2333
|
+
return s;
|
|
2334
|
+
}, dirname: function(s) {
|
|
2335
|
+
if (o(s), s.length === 0) return ".";
|
|
2336
|
+
for (var u = s.charCodeAt(0), f = u === 47, g = -1, _ = !0, C = s.length - 1; C >= 1; --C) if ((u = s.charCodeAt(C)) === 47) {
|
|
2337
|
+
if (!_) {
|
|
2338
|
+
g = C;
|
|
1808
2339
|
break;
|
|
1809
2340
|
}
|
|
1810
|
-
} else
|
|
1811
|
-
return
|
|
1812
|
-
}, basename: function(
|
|
2341
|
+
} else _ = !1;
|
|
2342
|
+
return g === -1 ? f ? "/" : "." : f && g === 1 ? "//" : s.slice(0, g);
|
|
2343
|
+
}, basename: function(s, u) {
|
|
1813
2344
|
if (u !== void 0 && typeof u != "string") throw new TypeError('"ext" argument must be a string');
|
|
1814
|
-
s
|
|
1815
|
-
var
|
|
1816
|
-
if (u !== void 0 && u.length > 0 && u.length <=
|
|
1817
|
-
if (u.length ===
|
|
1818
|
-
var
|
|
1819
|
-
for (
|
|
1820
|
-
var
|
|
1821
|
-
if (
|
|
1822
|
-
if (!
|
|
1823
|
-
|
|
2345
|
+
o(s);
|
|
2346
|
+
var f, g = 0, _ = -1, C = !0;
|
|
2347
|
+
if (u !== void 0 && u.length > 0 && u.length <= s.length) {
|
|
2348
|
+
if (u.length === s.length && u === s) return "";
|
|
2349
|
+
var a = u.length - 1, w = -1;
|
|
2350
|
+
for (f = s.length - 1; f >= 0; --f) {
|
|
2351
|
+
var A = s.charCodeAt(f);
|
|
2352
|
+
if (A === 47) {
|
|
2353
|
+
if (!C) {
|
|
2354
|
+
g = f + 1;
|
|
1824
2355
|
break;
|
|
1825
2356
|
}
|
|
1826
|
-
} else
|
|
2357
|
+
} else w === -1 && (C = !1, w = f + 1), a >= 0 && (A === u.charCodeAt(a) ? --a == -1 && (_ = f) : (a = -1, _ = w));
|
|
1827
2358
|
}
|
|
1828
|
-
return
|
|
2359
|
+
return g === _ ? _ = w : _ === -1 && (_ = s.length), s.slice(g, _);
|
|
1829
2360
|
}
|
|
1830
|
-
for (
|
|
1831
|
-
if (!
|
|
1832
|
-
|
|
2361
|
+
for (f = s.length - 1; f >= 0; --f) if (s.charCodeAt(f) === 47) {
|
|
2362
|
+
if (!C) {
|
|
2363
|
+
g = f + 1;
|
|
1833
2364
|
break;
|
|
1834
2365
|
}
|
|
1835
|
-
} else
|
|
1836
|
-
return
|
|
1837
|
-
}, extname: function(
|
|
1838
|
-
s
|
|
1839
|
-
for (var u = -1,
|
|
1840
|
-
var
|
|
1841
|
-
if (
|
|
1842
|
-
else if (!
|
|
1843
|
-
|
|
2366
|
+
} else _ === -1 && (C = !1, _ = f + 1);
|
|
2367
|
+
return _ === -1 ? "" : s.slice(g, _);
|
|
2368
|
+
}, extname: function(s) {
|
|
2369
|
+
o(s);
|
|
2370
|
+
for (var u = -1, f = 0, g = -1, _ = !0, C = 0, a = s.length - 1; a >= 0; --a) {
|
|
2371
|
+
var w = s.charCodeAt(a);
|
|
2372
|
+
if (w !== 47) g === -1 && (_ = !1, g = a + 1), w === 46 ? u === -1 ? u = a : C !== 1 && (C = 1) : u !== -1 && (C = -1);
|
|
2373
|
+
else if (!_) {
|
|
2374
|
+
f = a + 1;
|
|
1844
2375
|
break;
|
|
1845
2376
|
}
|
|
1846
2377
|
}
|
|
1847
|
-
return u === -1 ||
|
|
1848
|
-
}, format: function(
|
|
1849
|
-
if (
|
|
1850
|
-
return (function(u,
|
|
1851
|
-
var
|
|
1852
|
-
return
|
|
1853
|
-
})(0,
|
|
1854
|
-
}, parse: function(
|
|
1855
|
-
s
|
|
2378
|
+
return u === -1 || g === -1 || C === 0 || C === 1 && u === g - 1 && u === f + 1 ? "" : s.slice(u, g);
|
|
2379
|
+
}, format: function(s) {
|
|
2380
|
+
if (s === null || typeof s != "object") throw new TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof s);
|
|
2381
|
+
return (function(u, f) {
|
|
2382
|
+
var g = f.dir || f.root, _ = f.base || (f.name || "") + (f.ext || "");
|
|
2383
|
+
return g ? g === f.root ? g + _ : g + "/" + _ : _;
|
|
2384
|
+
})(0, s);
|
|
2385
|
+
}, parse: function(s) {
|
|
2386
|
+
o(s);
|
|
1856
2387
|
var u = { root: "", dir: "", base: "", ext: "", name: "" };
|
|
1857
|
-
if (
|
|
1858
|
-
var
|
|
1859
|
-
|
|
1860
|
-
for (var
|
|
1861
|
-
else if (!
|
|
1862
|
-
|
|
2388
|
+
if (s.length === 0) return u;
|
|
2389
|
+
var f, g = s.charCodeAt(0), _ = g === 47;
|
|
2390
|
+
_ ? (u.root = "/", f = 1) : f = 0;
|
|
2391
|
+
for (var C = -1, a = 0, w = -1, A = !0, L = s.length - 1, F = 0; L >= f; --L) if ((g = s.charCodeAt(L)) !== 47) w === -1 && (A = !1, w = L + 1), g === 46 ? C === -1 ? C = L : F !== 1 && (F = 1) : C !== -1 && (F = -1);
|
|
2392
|
+
else if (!A) {
|
|
2393
|
+
a = L + 1;
|
|
1863
2394
|
break;
|
|
1864
2395
|
}
|
|
1865
|
-
return
|
|
2396
|
+
return C === -1 || w === -1 || F === 0 || F === 1 && C === w - 1 && C === a + 1 ? w !== -1 && (u.base = u.name = a === 0 && _ ? s.slice(1, w) : s.slice(a, w)) : (a === 0 && _ ? (u.name = s.slice(1, C), u.base = s.slice(1, w)) : (u.name = s.slice(a, C), u.base = s.slice(a, w)), u.ext = s.slice(C, w)), a > 0 ? u.dir = s.slice(0, a - 1) : _ && (u.dir = "/"), u;
|
|
1866
2397
|
}, sep: "/", delimiter: ":", win32: null, posix: null };
|
|
1867
|
-
|
|
2398
|
+
p.posix = p, b.exports = p;
|
|
1868
2399
|
} }, t = {};
|
|
1869
|
-
function
|
|
1870
|
-
var
|
|
1871
|
-
if (
|
|
1872
|
-
var
|
|
1873
|
-
return e[
|
|
2400
|
+
function r(b) {
|
|
2401
|
+
var o = t[b];
|
|
2402
|
+
if (o !== void 0) return o.exports;
|
|
2403
|
+
var v = t[b] = { exports: {} };
|
|
2404
|
+
return e[b](v, v.exports, r), v.exports;
|
|
1874
2405
|
}
|
|
1875
|
-
|
|
1876
|
-
for (var
|
|
1877
|
-
},
|
|
1878
|
-
typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(
|
|
2406
|
+
r.d = (b, o) => {
|
|
2407
|
+
for (var v in o) r.o(o, v) && !r.o(b, v) && Object.defineProperty(b, v, { enumerable: !0, get: o[v] });
|
|
2408
|
+
}, r.o = (b, o) => Object.prototype.hasOwnProperty.call(b, o), r.r = (b) => {
|
|
2409
|
+
typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(b, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(b, "__esModule", { value: !0 });
|
|
1879
2410
|
};
|
|
1880
|
-
var
|
|
2411
|
+
var n = {};
|
|
1881
2412
|
let c;
|
|
1882
|
-
|
|
1883
|
-
const
|
|
1884
|
-
function
|
|
1885
|
-
if (!
|
|
1886
|
-
if (
|
|
1887
|
-
if (
|
|
1888
|
-
if (
|
|
1889
|
-
if (!
|
|
1890
|
-
} else if (
|
|
2413
|
+
r.r(n), r.d(n, { URI: () => m, Utils: () => K }), typeof process == "object" ? c = process.platform === "win32" : typeof navigator == "object" && (c = navigator.userAgent.indexOf("Windows") >= 0);
|
|
2414
|
+
const i = /^\w[\w\d+.-]*$/, l = /^\//, d = /^\/\//;
|
|
2415
|
+
function y(b, o) {
|
|
2416
|
+
if (!b.scheme && o) throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${b.authority}", path: "${b.path}", query: "${b.query}", fragment: "${b.fragment}"}`);
|
|
2417
|
+
if (b.scheme && !i.test(b.scheme)) throw new Error("[UriError]: Scheme contains illegal characters.");
|
|
2418
|
+
if (b.path) {
|
|
2419
|
+
if (b.authority) {
|
|
2420
|
+
if (!l.test(b.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');
|
|
2421
|
+
} else if (d.test(b.path)) throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")');
|
|
1891
2422
|
}
|
|
1892
2423
|
}
|
|
1893
|
-
const
|
|
1894
|
-
class
|
|
1895
|
-
static isUri(
|
|
1896
|
-
return
|
|
2424
|
+
const h = "", k = "/", j = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;
|
|
2425
|
+
class m {
|
|
2426
|
+
static isUri(o) {
|
|
2427
|
+
return o instanceof m || !!o && typeof o.authority == "string" && typeof o.fragment == "string" && typeof o.path == "string" && typeof o.query == "string" && typeof o.scheme == "string" && typeof o.fsPath == "string" && typeof o.with == "function" && typeof o.toString == "function";
|
|
1897
2428
|
}
|
|
1898
2429
|
scheme;
|
|
1899
2430
|
authority;
|
|
1900
2431
|
path;
|
|
1901
2432
|
query;
|
|
1902
2433
|
fragment;
|
|
1903
|
-
constructor(
|
|
1904
|
-
typeof
|
|
1905
|
-
return
|
|
1906
|
-
})(
|
|
1907
|
-
switch (
|
|
2434
|
+
constructor(o, v, p, s, u, f = !1) {
|
|
2435
|
+
typeof o == "object" ? (this.scheme = o.scheme || h, this.authority = o.authority || h, this.path = o.path || h, this.query = o.query || h, this.fragment = o.fragment || h) : (this.scheme = /* @__PURE__ */ (function(g, _) {
|
|
2436
|
+
return g || _ ? g : "file";
|
|
2437
|
+
})(o, f), this.authority = v || h, this.path = (function(g, _) {
|
|
2438
|
+
switch (g) {
|
|
1908
2439
|
case "https":
|
|
1909
2440
|
case "http":
|
|
1910
2441
|
case "file":
|
|
1911
|
-
|
|
2442
|
+
_ ? _[0] !== k && (_ = k + _) : _ = k;
|
|
1912
2443
|
}
|
|
1913
|
-
return
|
|
1914
|
-
})(this.scheme,
|
|
2444
|
+
return _;
|
|
2445
|
+
})(this.scheme, p || h), this.query = s || h, this.fragment = u || h, y(this, f));
|
|
1915
2446
|
}
|
|
1916
2447
|
get fsPath() {
|
|
1917
|
-
return
|
|
1918
|
-
}
|
|
1919
|
-
with(
|
|
1920
|
-
if (!
|
|
1921
|
-
let { scheme:
|
|
1922
|
-
return
|
|
1923
|
-
}
|
|
1924
|
-
static parse(
|
|
1925
|
-
const
|
|
1926
|
-
return
|
|
1927
|
-
}
|
|
1928
|
-
static file(
|
|
1929
|
-
let
|
|
1930
|
-
if (c && (
|
|
1931
|
-
const
|
|
1932
|
-
|
|
2448
|
+
return S(this);
|
|
2449
|
+
}
|
|
2450
|
+
with(o) {
|
|
2451
|
+
if (!o) return this;
|
|
2452
|
+
let { scheme: v, authority: p, path: s, query: u, fragment: f } = o;
|
|
2453
|
+
return v === void 0 ? v = this.scheme : v === null && (v = h), p === void 0 ? p = this.authority : p === null && (p = h), s === void 0 ? s = this.path : s === null && (s = h), u === void 0 ? u = this.query : u === null && (u = h), f === void 0 ? f = this.fragment : f === null && (f = h), v === this.scheme && p === this.authority && s === this.path && u === this.query && f === this.fragment ? this : new R(v, p, s, u, f);
|
|
2454
|
+
}
|
|
2455
|
+
static parse(o, v = !1) {
|
|
2456
|
+
const p = j.exec(o);
|
|
2457
|
+
return p ? new R(p[2] || h, N(p[4] || h), N(p[5] || h), N(p[7] || h), N(p[9] || h), v) : new R(h, h, h, h, h);
|
|
2458
|
+
}
|
|
2459
|
+
static file(o) {
|
|
2460
|
+
let v = h;
|
|
2461
|
+
if (c && (o = o.replace(/\\/g, k)), o[0] === k && o[1] === k) {
|
|
2462
|
+
const p = o.indexOf(k, 2);
|
|
2463
|
+
p === -1 ? (v = o.substring(2), o = k) : (v = o.substring(2, p), o = o.substring(p) || k);
|
|
1933
2464
|
}
|
|
1934
|
-
return new
|
|
2465
|
+
return new R("file", v, o, h, h);
|
|
1935
2466
|
}
|
|
1936
|
-
static from(
|
|
1937
|
-
const
|
|
1938
|
-
return v
|
|
2467
|
+
static from(o) {
|
|
2468
|
+
const v = new R(o.scheme, o.authority, o.path, o.query, o.fragment);
|
|
2469
|
+
return y(v, !0), v;
|
|
1939
2470
|
}
|
|
1940
|
-
toString(
|
|
1941
|
-
return
|
|
2471
|
+
toString(o = !1) {
|
|
2472
|
+
return D(this, o);
|
|
1942
2473
|
}
|
|
1943
2474
|
toJSON() {
|
|
1944
2475
|
return this;
|
|
1945
2476
|
}
|
|
1946
|
-
static revive(
|
|
1947
|
-
if (
|
|
1948
|
-
if (
|
|
2477
|
+
static revive(o) {
|
|
2478
|
+
if (o) {
|
|
2479
|
+
if (o instanceof m) return o;
|
|
1949
2480
|
{
|
|
1950
|
-
const
|
|
1951
|
-
return
|
|
2481
|
+
const v = new R(o);
|
|
2482
|
+
return v._formatted = o.external, v._fsPath = o._sep === T ? o.fsPath : null, v;
|
|
1952
2483
|
}
|
|
1953
2484
|
}
|
|
1954
|
-
return
|
|
2485
|
+
return o;
|
|
1955
2486
|
}
|
|
1956
2487
|
}
|
|
1957
|
-
const
|
|
1958
|
-
class
|
|
2488
|
+
const T = c ? 1 : void 0;
|
|
2489
|
+
class R extends m {
|
|
1959
2490
|
_formatted = null;
|
|
1960
2491
|
_fsPath = null;
|
|
1961
2492
|
get fsPath() {
|
|
1962
|
-
return this._fsPath || (this._fsPath =
|
|
2493
|
+
return this._fsPath || (this._fsPath = S(this)), this._fsPath;
|
|
1963
2494
|
}
|
|
1964
|
-
toString(
|
|
1965
|
-
return
|
|
2495
|
+
toString(o = !1) {
|
|
2496
|
+
return o ? D(this, !0) : (this._formatted || (this._formatted = D(this, !1)), this._formatted);
|
|
1966
2497
|
}
|
|
1967
2498
|
toJSON() {
|
|
1968
|
-
const
|
|
1969
|
-
return this._fsPath && (
|
|
2499
|
+
const o = { $mid: 1 };
|
|
2500
|
+
return this._fsPath && (o.fsPath = this._fsPath, o._sep = T), this._formatted && (o.external = this._formatted), this.path && (o.path = this.path), this.scheme && (o.scheme = this.scheme), this.authority && (o.authority = this.authority), this.query && (o.query = this.query), this.fragment && (o.fragment = this.fragment), o;
|
|
1970
2501
|
}
|
|
1971
2502
|
}
|
|
1972
|
-
const
|
|
1973
|
-
function
|
|
1974
|
-
let
|
|
1975
|
-
for (let u = 0; u <
|
|
1976
|
-
const
|
|
1977
|
-
if (
|
|
2503
|
+
const H = { 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" };
|
|
2504
|
+
function x(b, o, v) {
|
|
2505
|
+
let p, s = -1;
|
|
2506
|
+
for (let u = 0; u < b.length; u++) {
|
|
2507
|
+
const f = b.charCodeAt(u);
|
|
2508
|
+
if (f >= 97 && f <= 122 || f >= 65 && f <= 90 || f >= 48 && f <= 57 || f === 45 || f === 46 || f === 95 || f === 126 || o && f === 47 || v && f === 91 || v && f === 93 || v && f === 58) s !== -1 && (p += encodeURIComponent(b.substring(s, u)), s = -1), p !== void 0 && (p += b.charAt(u));
|
|
1978
2509
|
else {
|
|
1979
|
-
|
|
1980
|
-
const
|
|
1981
|
-
|
|
2510
|
+
p === void 0 && (p = b.substr(0, u));
|
|
2511
|
+
const g = H[f];
|
|
2512
|
+
g !== void 0 ? (s !== -1 && (p += encodeURIComponent(b.substring(s, u)), s = -1), p += g) : s === -1 && (s = u);
|
|
1982
2513
|
}
|
|
1983
2514
|
}
|
|
1984
|
-
return
|
|
2515
|
+
return s !== -1 && (p += encodeURIComponent(b.substring(s))), p !== void 0 ? p : b;
|
|
1985
2516
|
}
|
|
1986
|
-
function
|
|
1987
|
-
let
|
|
1988
|
-
for (let
|
|
1989
|
-
const
|
|
1990
|
-
|
|
2517
|
+
function z(b) {
|
|
2518
|
+
let o;
|
|
2519
|
+
for (let v = 0; v < b.length; v++) {
|
|
2520
|
+
const p = b.charCodeAt(v);
|
|
2521
|
+
p === 35 || p === 63 ? (o === void 0 && (o = b.substr(0, v)), o += H[p]) : o !== void 0 && (o += b[v]);
|
|
1991
2522
|
}
|
|
1992
|
-
return
|
|
2523
|
+
return o !== void 0 ? o : b;
|
|
1993
2524
|
}
|
|
1994
|
-
function
|
|
1995
|
-
let
|
|
1996
|
-
return
|
|
2525
|
+
function S(b, o) {
|
|
2526
|
+
let v;
|
|
2527
|
+
return v = b.authority && b.path.length > 1 && b.scheme === "file" ? `//${b.authority}${b.path}` : b.path.charCodeAt(0) === 47 && (b.path.charCodeAt(1) >= 65 && b.path.charCodeAt(1) <= 90 || b.path.charCodeAt(1) >= 97 && b.path.charCodeAt(1) <= 122) && b.path.charCodeAt(2) === 58 ? b.path[1].toLowerCase() + b.path.substr(2) : b.path, c && (v = v.replace(/\//g, "\\")), v;
|
|
1997
2528
|
}
|
|
1998
|
-
function
|
|
1999
|
-
const
|
|
2000
|
-
let
|
|
2001
|
-
if (
|
|
2002
|
-
let
|
|
2003
|
-
if (
|
|
2004
|
-
const
|
|
2005
|
-
u = u.substr(
|
|
2529
|
+
function D(b, o) {
|
|
2530
|
+
const v = o ? z : x;
|
|
2531
|
+
let p = "", { scheme: s, authority: u, path: f, query: g, fragment: _ } = b;
|
|
2532
|
+
if (s && (p += s, p += ":"), (u || s === "file") && (p += k, p += k), u) {
|
|
2533
|
+
let C = u.indexOf("@");
|
|
2534
|
+
if (C !== -1) {
|
|
2535
|
+
const a = u.substr(0, C);
|
|
2536
|
+
u = u.substr(C + 1), C = a.lastIndexOf(":"), C === -1 ? p += v(a, !1, !1) : (p += v(a.substr(0, C), !1, !1), p += ":", p += v(a.substr(C + 1), !1, !0)), p += "@";
|
|
2006
2537
|
}
|
|
2007
|
-
u = u.toLowerCase(),
|
|
2008
|
-
}
|
|
2009
|
-
if (
|
|
2010
|
-
if (
|
|
2011
|
-
const
|
|
2012
|
-
|
|
2013
|
-
} else if (
|
|
2014
|
-
const
|
|
2015
|
-
|
|
2538
|
+
u = u.toLowerCase(), C = u.lastIndexOf(":"), C === -1 ? p += v(u, !1, !0) : (p += v(u.substr(0, C), !1, !0), p += u.substr(C));
|
|
2539
|
+
}
|
|
2540
|
+
if (f) {
|
|
2541
|
+
if (f.length >= 3 && f.charCodeAt(0) === 47 && f.charCodeAt(2) === 58) {
|
|
2542
|
+
const C = f.charCodeAt(1);
|
|
2543
|
+
C >= 65 && C <= 90 && (f = `/${String.fromCharCode(C + 32)}:${f.substr(3)}`);
|
|
2544
|
+
} else if (f.length >= 2 && f.charCodeAt(1) === 58) {
|
|
2545
|
+
const C = f.charCodeAt(0);
|
|
2546
|
+
C >= 65 && C <= 90 && (f = `${String.fromCharCode(C + 32)}:${f.substr(2)}`);
|
|
2016
2547
|
}
|
|
2017
|
-
|
|
2548
|
+
p += v(f, !0, !1);
|
|
2018
2549
|
}
|
|
2019
|
-
return
|
|
2550
|
+
return g && (p += "?", p += v(g, !1, !1)), _ && (p += "#", p += o ? _ : x(_, !1, !1)), p;
|
|
2020
2551
|
}
|
|
2021
|
-
function
|
|
2552
|
+
function I(b) {
|
|
2022
2553
|
try {
|
|
2023
|
-
return decodeURIComponent(
|
|
2554
|
+
return decodeURIComponent(b);
|
|
2024
2555
|
} catch {
|
|
2025
|
-
return
|
|
2556
|
+
return b.length > 3 ? b.substr(0, 3) + I(b.substr(3)) : b;
|
|
2026
2557
|
}
|
|
2027
2558
|
}
|
|
2028
|
-
const
|
|
2029
|
-
function
|
|
2030
|
-
return
|
|
2559
|
+
const B = /(%[0-9A-Za-z][0-9A-Za-z])+/g;
|
|
2560
|
+
function N(b) {
|
|
2561
|
+
return b.match(B) ? b.replace(B, ((o) => I(o))) : b;
|
|
2031
2562
|
}
|
|
2032
|
-
var
|
|
2033
|
-
const P =
|
|
2034
|
-
var
|
|
2035
|
-
(function(
|
|
2036
|
-
|
|
2037
|
-
return
|
|
2038
|
-
},
|
|
2039
|
-
let
|
|
2040
|
-
|
|
2041
|
-
let u = P.resolve(
|
|
2042
|
-
return
|
|
2043
|
-
},
|
|
2044
|
-
if (
|
|
2045
|
-
let
|
|
2046
|
-
return
|
|
2047
|
-
},
|
|
2048
|
-
return P.basename(
|
|
2049
|
-
},
|
|
2050
|
-
return P.extname(
|
|
2563
|
+
var q = r(975);
|
|
2564
|
+
const P = q.posix || q, V = "/";
|
|
2565
|
+
var K;
|
|
2566
|
+
(function(b) {
|
|
2567
|
+
b.joinPath = function(o, ...v) {
|
|
2568
|
+
return o.with({ path: P.join(o.path, ...v) });
|
|
2569
|
+
}, b.resolvePath = function(o, ...v) {
|
|
2570
|
+
let p = o.path, s = !1;
|
|
2571
|
+
p[0] !== V && (p = V + p, s = !0);
|
|
2572
|
+
let u = P.resolve(p, ...v);
|
|
2573
|
+
return s && u[0] === V && !o.authority && (u = u.substring(1)), o.with({ path: u });
|
|
2574
|
+
}, b.dirname = function(o) {
|
|
2575
|
+
if (o.path.length === 0 || o.path === V) return o;
|
|
2576
|
+
let v = P.dirname(o.path);
|
|
2577
|
+
return v.length === 1 && v.charCodeAt(0) === 46 && (v = ""), o.with({ path: v });
|
|
2578
|
+
}, b.basename = function(o) {
|
|
2579
|
+
return P.basename(o.path);
|
|
2580
|
+
}, b.extname = function(o) {
|
|
2581
|
+
return P.extname(o.path);
|
|
2051
2582
|
};
|
|
2052
|
-
})(
|
|
2583
|
+
})(K || (K = {})), $t = n;
|
|
2053
2584
|
})();
|
|
2054
|
-
const { URI:
|
|
2055
|
-
function
|
|
2585
|
+
const { URI: ge, Utils: jo } = $t;
|
|
2586
|
+
function Bn(e) {
|
|
2056
2587
|
return e === 4 ? 1 : e === 3 ? 2 : e === 2 ? 4 : 8;
|
|
2057
2588
|
}
|
|
2058
|
-
function
|
|
2589
|
+
function qn(e) {
|
|
2059
2590
|
return e;
|
|
2060
2591
|
}
|
|
2061
|
-
function
|
|
2592
|
+
function zn(e) {
|
|
2062
2593
|
return {
|
|
2063
2594
|
start: { line: e.startLineNumber - 1, character: e.startColumn - 1 },
|
|
2064
2595
|
end: { line: e.endLineNumber - 1, character: e.endColumn - 1 }
|
|
2065
2596
|
};
|
|
2066
2597
|
}
|
|
2067
|
-
function
|
|
2598
|
+
function ee(e) {
|
|
2068
2599
|
return {
|
|
2069
2600
|
startLineNumber: e.start.line + 1,
|
|
2070
2601
|
startColumn: e.start.character + 1,
|
|
@@ -2072,263 +2603,263 @@ function K(e) {
|
|
|
2072
2603
|
endColumn: e.end.character + 1
|
|
2073
2604
|
};
|
|
2074
2605
|
}
|
|
2075
|
-
function
|
|
2606
|
+
function Vn(e) {
|
|
2076
2607
|
return {
|
|
2077
|
-
...
|
|
2608
|
+
...ee(e.location.range),
|
|
2078
2609
|
message: e.message,
|
|
2079
|
-
resource:
|
|
2610
|
+
resource: ge.parse(e.location.uri)
|
|
2080
2611
|
};
|
|
2081
2612
|
}
|
|
2082
|
-
function
|
|
2613
|
+
function It(e) {
|
|
2083
2614
|
const t = {
|
|
2084
|
-
...
|
|
2615
|
+
...ee(e.range),
|
|
2085
2616
|
message: e.message,
|
|
2086
|
-
severity: e.severity ?
|
|
2617
|
+
severity: e.severity ? Bn(e.severity) : 8
|
|
2087
2618
|
};
|
|
2088
|
-
return e.code != null && (t.code = e.codeDescription == null ? String(e.code) : { value: String(e.code), target:
|
|
2619
|
+
return e.code != null && (t.code = e.codeDescription == null ? String(e.code) : { value: String(e.code), target: ge.parse(e.codeDescription.href) }), e.relatedInformation && (t.relatedInformation = e.relatedInformation.map(Vn)), e.tags && (t.tags = e.tags.map(qn)), e.source != null && (t.source = e.source), t;
|
|
2089
2620
|
}
|
|
2090
|
-
function
|
|
2621
|
+
function Qe(e) {
|
|
2091
2622
|
return {
|
|
2092
|
-
range:
|
|
2623
|
+
range: ee(e.range),
|
|
2093
2624
|
text: e.newText
|
|
2094
2625
|
};
|
|
2095
2626
|
}
|
|
2096
|
-
function
|
|
2627
|
+
function Fn(e) {
|
|
2097
2628
|
const t = {};
|
|
2098
2629
|
return e.ignoreIfExists != null && (t.ignoreIfExists = e.ignoreIfExists), e.ignoreIfNotExists != null && (t.ignoreIfNotExists = e.ignoreIfNotExists), e.overwrite != null && (t.overwrite = e.overwrite), e.recursive != null && (t.recursive = e.recursive), t;
|
|
2099
2630
|
}
|
|
2100
|
-
function
|
|
2101
|
-
const t = e.kind === "create" ? { newResource:
|
|
2102
|
-
oldResource:
|
|
2103
|
-
newResource:
|
|
2631
|
+
function Un(e) {
|
|
2632
|
+
const t = e.kind === "create" ? { newResource: ge.parse(e.uri) } : e.kind === "delete" ? { oldResource: ge.parse(e.uri) } : {
|
|
2633
|
+
oldResource: ge.parse(e.oldUri),
|
|
2634
|
+
newResource: ge.parse(e.newUri)
|
|
2104
2635
|
};
|
|
2105
|
-
return e.options && (t.options =
|
|
2636
|
+
return e.options && (t.options = Fn(e.options)), t;
|
|
2106
2637
|
}
|
|
2107
|
-
function
|
|
2638
|
+
function wt(e, t, r) {
|
|
2108
2639
|
return {
|
|
2109
|
-
resource:
|
|
2110
|
-
versionId:
|
|
2111
|
-
textEdit:
|
|
2640
|
+
resource: ge.parse(t),
|
|
2641
|
+
versionId: r,
|
|
2642
|
+
textEdit: Qe(e)
|
|
2112
2643
|
};
|
|
2113
2644
|
}
|
|
2114
|
-
function
|
|
2645
|
+
function Yn(e) {
|
|
2115
2646
|
var t;
|
|
2116
|
-
const
|
|
2647
|
+
const r = [];
|
|
2117
2648
|
if (e.changes)
|
|
2118
|
-
for (const [
|
|
2119
|
-
for (const
|
|
2120
|
-
|
|
2649
|
+
for (const [n, c] of Object.entries(e.changes))
|
|
2650
|
+
for (const i of c)
|
|
2651
|
+
r.push(wt(i, n));
|
|
2121
2652
|
if (e.documentChanges)
|
|
2122
|
-
for (const
|
|
2123
|
-
if ("textDocument" in
|
|
2124
|
-
for (const c of
|
|
2125
|
-
|
|
2653
|
+
for (const n of e.documentChanges)
|
|
2654
|
+
if ("textDocument" in n)
|
|
2655
|
+
for (const c of n.edits)
|
|
2656
|
+
r.push(wt(c, n.textDocument.uri, (t = n.textDocument.version) !== null && t !== void 0 ? t : void 0));
|
|
2126
2657
|
else
|
|
2127
|
-
|
|
2658
|
+
r.push(Un(n));
|
|
2128
2659
|
return {
|
|
2129
|
-
edits:
|
|
2660
|
+
edits: r
|
|
2130
2661
|
};
|
|
2131
2662
|
}
|
|
2132
|
-
function
|
|
2663
|
+
function Gn(e) {
|
|
2133
2664
|
const t = {
|
|
2134
2665
|
title: e.title,
|
|
2135
2666
|
isPreferred: e.isPreferred
|
|
2136
2667
|
};
|
|
2137
|
-
return e.diagnostics && (t.diagnostics = e.diagnostics.map(
|
|
2668
|
+
return e.diagnostics && (t.diagnostics = e.diagnostics.map(It)), e.disabled && (t.disabled = e.disabled.reason), e.edit && (t.edit = Yn(e.edit)), e.isPreferred != null && (t.isPreferred = e.isPreferred), e.kind && (t.kind = e.kind), t;
|
|
2138
2669
|
}
|
|
2139
|
-
function
|
|
2670
|
+
function Jn(e) {
|
|
2140
2671
|
const t = {
|
|
2141
2672
|
title: e.title,
|
|
2142
2673
|
id: e.command
|
|
2143
2674
|
};
|
|
2144
2675
|
return e.arguments && (t.arguments = e.arguments), t;
|
|
2145
2676
|
}
|
|
2146
|
-
function
|
|
2677
|
+
function Kn(e) {
|
|
2147
2678
|
return e === 1 ? 18 : e === 2 ? 0 : e === 3 ? 1 : e === 4 ? 2 : e === 5 ? 3 : e === 6 ? 4 : e === 7 ? 5 : e === 8 ? 7 : e === 9 ? 8 : e === 10 ? 9 : e === 11 ? 12 : e === 12 ? 13 : e === 13 ? 15 : e === 14 ? 17 : e === 15 ? 27 : e === 16 ? 19 : e === 17 ? 20 : e === 18 ? 21 : e === 19 ? 23 : e === 20 ? 16 : e === 21 ? 14 : e === 22 ? 6 : e === 23 ? 10 : e === 24 ? 11 : 24;
|
|
2148
2679
|
}
|
|
2149
|
-
function
|
|
2680
|
+
function Xn(e) {
|
|
2150
2681
|
return e;
|
|
2151
2682
|
}
|
|
2152
|
-
function
|
|
2683
|
+
function Wt(e) {
|
|
2153
2684
|
return {
|
|
2154
2685
|
value: e.value
|
|
2155
2686
|
};
|
|
2156
2687
|
}
|
|
2157
|
-
function
|
|
2688
|
+
function Zn(e) {
|
|
2158
2689
|
return {
|
|
2159
|
-
range:
|
|
2690
|
+
range: ee(e.range),
|
|
2160
2691
|
text: e.newText
|
|
2161
2692
|
};
|
|
2162
2693
|
}
|
|
2163
|
-
function
|
|
2164
|
-
return "range" in e ?
|
|
2165
|
-
insert:
|
|
2166
|
-
replace:
|
|
2167
|
-
} :
|
|
2168
|
-
}
|
|
2169
|
-
function
|
|
2170
|
-
var
|
|
2171
|
-
const
|
|
2172
|
-
let
|
|
2173
|
-
|
|
2174
|
-
const
|
|
2175
|
-
insertText:
|
|
2176
|
-
kind: e.kind == null ? 18 :
|
|
2694
|
+
function Qn(e) {
|
|
2695
|
+
return "range" in e ? ee(e.range) : "insert" in e && "replace" in e ? {
|
|
2696
|
+
insert: ee(e.insert),
|
|
2697
|
+
replace: ee(e.replace)
|
|
2698
|
+
} : ee(e);
|
|
2699
|
+
}
|
|
2700
|
+
function eo(e, t) {
|
|
2701
|
+
var r, n, c, i, l;
|
|
2702
|
+
const d = (r = t.itemDefaults) !== null && r !== void 0 ? r : {}, y = (n = e.textEdit) !== null && n !== void 0 ? n : d.editRange, h = (c = e.commitCharacters) !== null && c !== void 0 ? c : d.commitCharacters, k = (i = e.insertTextFormat) !== null && i !== void 0 ? i : d.insertTextFormat, j = (l = e.insertTextMode) !== null && l !== void 0 ? l : d.insertTextMode;
|
|
2703
|
+
let m = e.insertText, T;
|
|
2704
|
+
y ? (T = Qn(y), "newText" in y && (m = y.newText)) : T = { ...t.range };
|
|
2705
|
+
const R = {
|
|
2706
|
+
insertText: m ?? e.label,
|
|
2707
|
+
kind: e.kind == null ? 18 : Kn(e.kind),
|
|
2177
2708
|
label: e.label,
|
|
2178
|
-
range:
|
|
2709
|
+
range: T
|
|
2179
2710
|
};
|
|
2180
|
-
return e.additionalTextEdits && (
|
|
2711
|
+
return e.additionalTextEdits && (R.additionalTextEdits = e.additionalTextEdits.map(Zn)), e.command && (R.command = Jn(e.command)), h && (R.commitCharacters = h), e.detail != null && (R.detail = e.detail), typeof e.documentation == "string" ? R.documentation = e.documentation : e.documentation && (R.documentation = Wt(e.documentation)), e.filterText != null && (R.filterText = e.filterText), k === 2 ? R.insertTextRules = 4 : j === 2 && (R.insertTextRules = 1), e.preselect != null && (R.preselect = e.preselect), e.sortText != null && (R.sortText = e.sortText), e.tags && (R.tags = e.tags.map(Xn)), R;
|
|
2181
2712
|
}
|
|
2182
|
-
function
|
|
2713
|
+
function to(e, t) {
|
|
2183
2714
|
return {
|
|
2184
2715
|
incomplete: !!e.isIncomplete,
|
|
2185
|
-
suggestions: e.items.map((
|
|
2716
|
+
suggestions: e.items.map((r) => eo(r, { range: t.range, itemDefaults: e.itemDefaults }))
|
|
2186
2717
|
};
|
|
2187
2718
|
}
|
|
2188
|
-
function
|
|
2719
|
+
function ro(e) {
|
|
2189
2720
|
return e === 1 ? 0 : e === 2 ? 1 : e === 3 ? 2 : e === 4 ? 3 : e === 5 ? 4 : e === 6 ? 5 : e === 7 ? 6 : e === 8 ? 7 : e === 9 ? 8 : e === 10 ? 9 : e === 11 ? 10 : e === 12 ? 11 : e === 13 ? 12 : e === 14 ? 13 : e === 15 ? 14 : e === 16 ? 15 : e === 17 ? 16 : e === 18 ? 17 : e === 19 ? 18 : e === 20 ? 19 : e === 21 ? 20 : e === 22 ? 21 : e === 23 ? 22 : e === 24 ? 23 : e === 25 ? 24 : 25;
|
|
2190
2721
|
}
|
|
2191
|
-
function
|
|
2722
|
+
function no(e) {
|
|
2192
2723
|
return e;
|
|
2193
2724
|
}
|
|
2194
|
-
function
|
|
2195
|
-
var t,
|
|
2725
|
+
function Ht(e) {
|
|
2726
|
+
var t, r, n;
|
|
2196
2727
|
const c = {
|
|
2197
2728
|
detail: (t = e.detail) !== null && t !== void 0 ? t : "",
|
|
2198
|
-
kind:
|
|
2729
|
+
kind: ro(e.kind),
|
|
2199
2730
|
name: e.name,
|
|
2200
|
-
range:
|
|
2201
|
-
selectionRange:
|
|
2202
|
-
tags: (
|
|
2731
|
+
range: ee(e.range),
|
|
2732
|
+
selectionRange: ee(e.selectionRange),
|
|
2733
|
+
tags: (n = (r = e.tags) === null || r === void 0 ? void 0 : r.map(no)) !== null && n !== void 0 ? n : []
|
|
2203
2734
|
};
|
|
2204
|
-
return e.children && (c.children = e.children.map(
|
|
2735
|
+
return e.children && (c.children = e.children.map(Ht)), c;
|
|
2205
2736
|
}
|
|
2206
|
-
function
|
|
2737
|
+
function oo(e) {
|
|
2207
2738
|
const t = {
|
|
2208
2739
|
start: e.startLine + 1,
|
|
2209
2740
|
end: e.endLine + 1
|
|
2210
2741
|
};
|
|
2211
2742
|
return e.kind != null && (t.kind = { value: e.kind }), t;
|
|
2212
2743
|
}
|
|
2213
|
-
function
|
|
2744
|
+
function io(e) {
|
|
2214
2745
|
return {
|
|
2215
2746
|
insertSpaces: e.insertSpaces,
|
|
2216
2747
|
tabSize: e.tabSize
|
|
2217
2748
|
};
|
|
2218
2749
|
}
|
|
2219
|
-
function
|
|
2750
|
+
function _t(e) {
|
|
2220
2751
|
return typeof e == "string" ? { value: e } : { value: `\`\`\`${e.language}
|
|
2221
2752
|
${e.value}
|
|
2222
2753
|
\`\`\`` };
|
|
2223
2754
|
}
|
|
2224
|
-
function
|
|
2225
|
-
return typeof e == "string" || "language" in e ? [
|
|
2755
|
+
function so(e) {
|
|
2756
|
+
return typeof e == "string" || "language" in e ? [_t(e)] : Array.isArray(e) ? e.map(_t) : [Wt(e)];
|
|
2226
2757
|
}
|
|
2227
|
-
function
|
|
2758
|
+
function ao(e) {
|
|
2228
2759
|
const t = {
|
|
2229
|
-
contents:
|
|
2760
|
+
contents: so(e.contents)
|
|
2230
2761
|
};
|
|
2231
|
-
return e.range && (t.range =
|
|
2762
|
+
return e.range && (t.range = ee(e.range)), t;
|
|
2232
2763
|
}
|
|
2233
|
-
function
|
|
2764
|
+
function Te(e) {
|
|
2234
2765
|
return { character: e.column - 1, line: e.lineNumber - 1 };
|
|
2235
2766
|
}
|
|
2236
|
-
function
|
|
2767
|
+
function co(e) {
|
|
2237
2768
|
const t = {
|
|
2238
|
-
range:
|
|
2769
|
+
range: ee(e.range)
|
|
2239
2770
|
};
|
|
2240
|
-
return e.tooltip != null && (t.tooltip = e.tooltip), e.target != null && (t.url =
|
|
2771
|
+
return e.tooltip != null && (t.tooltip = e.tooltip), e.target != null && (t.url = ge.parse(e.target)), t;
|
|
2241
2772
|
}
|
|
2242
|
-
function
|
|
2773
|
+
function lo(e) {
|
|
2243
2774
|
const t = {
|
|
2244
|
-
range:
|
|
2245
|
-
targetSelectionRange:
|
|
2246
|
-
uri:
|
|
2775
|
+
range: ee(e.targetRange),
|
|
2776
|
+
targetSelectionRange: ee(e.targetSelectionRange),
|
|
2777
|
+
uri: ge.parse(e.targetUri)
|
|
2247
2778
|
};
|
|
2248
|
-
return e.originSelectionRange && (t.originSelectionRange =
|
|
2779
|
+
return e.originSelectionRange && (t.originSelectionRange = ee(e.originSelectionRange)), t;
|
|
2249
2780
|
}
|
|
2250
|
-
function
|
|
2781
|
+
function uo(e) {
|
|
2251
2782
|
const t = [];
|
|
2252
|
-
let
|
|
2253
|
-
for (;
|
|
2783
|
+
let r = e;
|
|
2784
|
+
for (; r; )
|
|
2254
2785
|
t.push({
|
|
2255
|
-
range:
|
|
2256
|
-
}),
|
|
2786
|
+
range: ee(r.range)
|
|
2787
|
+
}), r = r.parent;
|
|
2257
2788
|
return t;
|
|
2258
2789
|
}
|
|
2259
|
-
function
|
|
2260
|
-
const
|
|
2261
|
-
const
|
|
2262
|
-
!
|
|
2263
|
-
},
|
|
2264
|
-
if (!c(
|
|
2790
|
+
function fo(e, t, r) {
|
|
2791
|
+
const n = /* @__PURE__ */ new Map(), c = (m) => Array.isArray(t) ? t.includes(m) : t === m, i = async (m) => {
|
|
2792
|
+
const T = m.getVersionId(), R = await r.provideMarkerData(m);
|
|
2793
|
+
!m.isDisposed() && T === m.getVersionId() && c(m.getLanguageId()) && e.editor.setModelMarkers(m, r.owner, R ?? []);
|
|
2794
|
+
}, l = (m) => {
|
|
2795
|
+
if (!c(m.getLanguageId()))
|
|
2265
2796
|
return;
|
|
2266
|
-
let
|
|
2267
|
-
const
|
|
2268
|
-
clearTimeout(
|
|
2269
|
-
|
|
2797
|
+
let T;
|
|
2798
|
+
const R = m.onDidChangeContent(() => {
|
|
2799
|
+
clearTimeout(T), T = setTimeout(() => {
|
|
2800
|
+
i(m);
|
|
2270
2801
|
}, 500);
|
|
2271
2802
|
});
|
|
2272
|
-
|
|
2803
|
+
n.set(m, {
|
|
2273
2804
|
dispose() {
|
|
2274
|
-
clearTimeout(
|
|
2805
|
+
clearTimeout(T), R.dispose();
|
|
2275
2806
|
}
|
|
2276
|
-
}),
|
|
2277
|
-
},
|
|
2278
|
-
e.editor.setModelMarkers(
|
|
2279
|
-
const
|
|
2280
|
-
|
|
2807
|
+
}), i(m);
|
|
2808
|
+
}, d = (m) => {
|
|
2809
|
+
e.editor.setModelMarkers(m, r.owner, []);
|
|
2810
|
+
const T = n.get(m);
|
|
2811
|
+
T && (T.dispose(), n.delete(m));
|
|
2281
2812
|
};
|
|
2282
|
-
function
|
|
2283
|
-
|
|
2813
|
+
function y(m, T = m.getLanguageId()) {
|
|
2814
|
+
r.doReset && c(T) && r.doReset(m);
|
|
2284
2815
|
}
|
|
2285
|
-
const
|
|
2286
|
-
|
|
2287
|
-
}),
|
|
2288
|
-
|
|
2816
|
+
const h = e.editor.onDidCreateModel(l), k = e.editor.onWillDisposeModel((m) => {
|
|
2817
|
+
d(m), y(m);
|
|
2818
|
+
}), j = e.editor.onDidChangeModelLanguage(({ model: m, oldLanguage: T }) => {
|
|
2819
|
+
d(m), l(m), y(m, T);
|
|
2289
2820
|
});
|
|
2290
|
-
for (const
|
|
2291
|
-
|
|
2821
|
+
for (const m of e.editor.getModels())
|
|
2822
|
+
l(m);
|
|
2292
2823
|
return {
|
|
2293
2824
|
dispose() {
|
|
2294
|
-
for (const
|
|
2295
|
-
|
|
2296
|
-
|
|
2825
|
+
for (const m of n.keys())
|
|
2826
|
+
d(m);
|
|
2827
|
+
h.dispose(), k.dispose(), j.dispose();
|
|
2297
2828
|
},
|
|
2298
2829
|
async revalidate() {
|
|
2299
|
-
await Promise.all(e.editor.getModels().map(
|
|
2830
|
+
await Promise.all(e.editor.getModels().map(i));
|
|
2300
2831
|
}
|
|
2301
2832
|
};
|
|
2302
2833
|
}
|
|
2303
|
-
function
|
|
2304
|
-
let { createData:
|
|
2305
|
-
const
|
|
2306
|
-
|
|
2307
|
-
},
|
|
2308
|
-
if (!
|
|
2834
|
+
function go(e, t) {
|
|
2835
|
+
let { createData: r, interval: n = 3e4, label: c, moduleId: i, stopWhenIdleFor: l = 12e4 } = t, d, y = 0, h = !1;
|
|
2836
|
+
const k = () => {
|
|
2837
|
+
d && (d.dispose(), d = void 0);
|
|
2838
|
+
}, j = setInterval(() => {
|
|
2839
|
+
if (!d)
|
|
2309
2840
|
return;
|
|
2310
|
-
Date.now() -
|
|
2311
|
-
},
|
|
2841
|
+
Date.now() - y > l && k();
|
|
2842
|
+
}, n);
|
|
2312
2843
|
return {
|
|
2313
2844
|
dispose() {
|
|
2314
|
-
|
|
2845
|
+
h = !0, clearInterval(j), k();
|
|
2315
2846
|
},
|
|
2316
|
-
getWorker(...
|
|
2317
|
-
if (
|
|
2847
|
+
getWorker(...m) {
|
|
2848
|
+
if (h)
|
|
2318
2849
|
throw new Error("Worker manager has been disposed");
|
|
2319
|
-
return
|
|
2320
|
-
createData:
|
|
2850
|
+
return y = Date.now(), d || (d = e.editor.createWebWorker({
|
|
2851
|
+
createData: r,
|
|
2321
2852
|
label: c,
|
|
2322
|
-
moduleId:
|
|
2323
|
-
})),
|
|
2853
|
+
moduleId: i
|
|
2854
|
+
})), d.withSyncedResources(m);
|
|
2324
2855
|
},
|
|
2325
|
-
updateCreateData(
|
|
2326
|
-
|
|
2856
|
+
updateCreateData(m) {
|
|
2857
|
+
r = m, k();
|
|
2327
2858
|
}
|
|
2328
2859
|
};
|
|
2329
2860
|
}
|
|
2330
|
-
function
|
|
2331
|
-
const
|
|
2861
|
+
function mo(e, t) {
|
|
2862
|
+
const r = {
|
|
2332
2863
|
completion: !0,
|
|
2333
2864
|
customTags: [],
|
|
2334
2865
|
enableSchemaRequest: !1,
|
|
@@ -2346,93 +2877,93 @@ function Un(e, t) {
|
|
|
2346
2877
|
aliases: ["YAML", "yaml", "YML", "yml"],
|
|
2347
2878
|
mimetypes: ["application/x-yaml"]
|
|
2348
2879
|
});
|
|
2349
|
-
const
|
|
2880
|
+
const n = go(e, {
|
|
2350
2881
|
label: "yaml",
|
|
2351
2882
|
moduleId: "monaco-yaml/yaml.worker",
|
|
2352
|
-
createData:
|
|
2353
|
-
}), c = /* @__PURE__ */ new WeakMap(),
|
|
2883
|
+
createData: r
|
|
2884
|
+
}), c = /* @__PURE__ */ new WeakMap(), i = fo(e, "yaml", {
|
|
2354
2885
|
owner: "yaml",
|
|
2355
|
-
async provideMarkerData(
|
|
2356
|
-
const
|
|
2357
|
-
return c.set(
|
|
2886
|
+
async provideMarkerData(d) {
|
|
2887
|
+
const h = await (await n.getWorker(d.uri)).doValidation(String(d.uri));
|
|
2888
|
+
return c.set(d, h), h?.map(It);
|
|
2358
2889
|
},
|
|
2359
|
-
async doReset(
|
|
2360
|
-
await (await
|
|
2890
|
+
async doReset(d) {
|
|
2891
|
+
await (await n.getWorker(d.uri)).resetSchema(String(d.uri));
|
|
2361
2892
|
}
|
|
2362
|
-
}),
|
|
2363
|
-
|
|
2364
|
-
|
|
2893
|
+
}), l = [
|
|
2894
|
+
n,
|
|
2895
|
+
i,
|
|
2365
2896
|
e.languages.registerCompletionItemProvider("yaml", {
|
|
2366
2897
|
triggerCharacters: [" ", ":"],
|
|
2367
|
-
async provideCompletionItems(
|
|
2368
|
-
const
|
|
2369
|
-
if (
|
|
2370
|
-
return
|
|
2898
|
+
async provideCompletionItems(d, y) {
|
|
2899
|
+
const h = d.getWordUntilPosition(y), j = await (await n.getWorker(d.uri)).doComplete(String(d.uri), Te(y));
|
|
2900
|
+
if (j)
|
|
2901
|
+
return to(j, {
|
|
2371
2902
|
range: {
|
|
2372
|
-
startLineNumber:
|
|
2373
|
-
startColumn:
|
|
2374
|
-
endLineNumber:
|
|
2375
|
-
endColumn:
|
|
2903
|
+
startLineNumber: y.lineNumber,
|
|
2904
|
+
startColumn: h.startColumn,
|
|
2905
|
+
endLineNumber: y.lineNumber,
|
|
2906
|
+
endColumn: h.endColumn
|
|
2376
2907
|
}
|
|
2377
2908
|
});
|
|
2378
2909
|
}
|
|
2379
2910
|
}),
|
|
2380
2911
|
e.languages.registerHoverProvider("yaml", {
|
|
2381
|
-
async provideHover(
|
|
2382
|
-
const
|
|
2383
|
-
if (
|
|
2384
|
-
return
|
|
2912
|
+
async provideHover(d, y) {
|
|
2913
|
+
const k = await (await n.getWorker(d.uri)).doHover(String(d.uri), Te(y));
|
|
2914
|
+
if (k)
|
|
2915
|
+
return ao(k);
|
|
2385
2916
|
}
|
|
2386
2917
|
}),
|
|
2387
2918
|
e.languages.registerDefinitionProvider("yaml", {
|
|
2388
|
-
async provideDefinition(
|
|
2389
|
-
const
|
|
2390
|
-
return
|
|
2919
|
+
async provideDefinition(d, y) {
|
|
2920
|
+
const k = await (await n.getWorker(d.uri)).doDefinition(String(d.uri), Te(y));
|
|
2921
|
+
return k?.map(lo);
|
|
2391
2922
|
}
|
|
2392
2923
|
}),
|
|
2393
2924
|
e.languages.registerDocumentSymbolProvider("yaml", {
|
|
2394
2925
|
displayName: "yaml",
|
|
2395
|
-
async provideDocumentSymbols(
|
|
2396
|
-
const
|
|
2397
|
-
return
|
|
2926
|
+
async provideDocumentSymbols(d) {
|
|
2927
|
+
const h = await (await n.getWorker(d.uri)).findDocumentSymbols(String(d.uri));
|
|
2928
|
+
return h?.map(Ht);
|
|
2398
2929
|
}
|
|
2399
2930
|
}),
|
|
2400
2931
|
e.languages.registerDocumentFormattingEditProvider("yaml", {
|
|
2401
2932
|
displayName: "yaml",
|
|
2402
|
-
async provideDocumentFormattingEdits(
|
|
2403
|
-
const
|
|
2404
|
-
return
|
|
2933
|
+
async provideDocumentFormattingEdits(d) {
|
|
2934
|
+
const h = await (await n.getWorker(d.uri)).format(String(d.uri));
|
|
2935
|
+
return h?.map(Qe);
|
|
2405
2936
|
}
|
|
2406
2937
|
}),
|
|
2407
2938
|
e.languages.registerLinkProvider("yaml", {
|
|
2408
|
-
async provideLinks(
|
|
2409
|
-
const
|
|
2410
|
-
if (
|
|
2939
|
+
async provideLinks(d) {
|
|
2940
|
+
const h = await (await n.getWorker(d.uri)).findLinks(String(d.uri));
|
|
2941
|
+
if (h)
|
|
2411
2942
|
return {
|
|
2412
|
-
links:
|
|
2943
|
+
links: h.map(co)
|
|
2413
2944
|
};
|
|
2414
2945
|
}
|
|
2415
2946
|
}),
|
|
2416
2947
|
e.languages.registerCodeActionProvider("yaml", {
|
|
2417
|
-
async provideCodeActions(
|
|
2418
|
-
var
|
|
2419
|
-
const
|
|
2420
|
-
diagnostics: ((
|
|
2421
|
-
only:
|
|
2422
|
-
triggerKind:
|
|
2948
|
+
async provideCodeActions(d, y, h) {
|
|
2949
|
+
var k;
|
|
2950
|
+
const m = await (await n.getWorker(d.uri)).getCodeAction(String(d.uri), zn(y), {
|
|
2951
|
+
diagnostics: ((k = c.get(d)) == null ? void 0 : k.filter((T) => y.intersectRanges(ee(T.range)))) || [],
|
|
2952
|
+
only: h.only ? [h.only] : void 0,
|
|
2953
|
+
triggerKind: h.trigger
|
|
2423
2954
|
});
|
|
2424
|
-
if (
|
|
2955
|
+
if (m)
|
|
2425
2956
|
return {
|
|
2426
|
-
actions:
|
|
2957
|
+
actions: m.map(Gn),
|
|
2427
2958
|
dispose() {
|
|
2428
2959
|
}
|
|
2429
2960
|
};
|
|
2430
2961
|
}
|
|
2431
2962
|
}),
|
|
2432
2963
|
e.languages.registerFoldingRangeProvider("yaml", {
|
|
2433
|
-
async provideFoldingRanges(
|
|
2434
|
-
const
|
|
2435
|
-
return
|
|
2964
|
+
async provideFoldingRanges(d) {
|
|
2965
|
+
const h = await (await n.getWorker(d.uri)).getFoldingRanges(String(d.uri));
|
|
2966
|
+
return h?.map(oo);
|
|
2436
2967
|
}
|
|
2437
2968
|
}),
|
|
2438
2969
|
e.languages.setLanguageConfiguration("yaml", {
|
|
@@ -2462,145 +2993,146 @@ function Un(e, t) {
|
|
|
2462
2993
|
e.languages.registerOnTypeFormattingEditProvider("yaml", {
|
|
2463
2994
|
autoFormatTriggerCharacters: [`
|
|
2464
2995
|
`],
|
|
2465
|
-
async provideOnTypeFormattingEdits(
|
|
2466
|
-
const
|
|
2467
|
-
String(
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2996
|
+
async provideOnTypeFormattingEdits(d, y, h, k) {
|
|
2997
|
+
const m = await (await n.getWorker(d.uri)).doDocumentOnTypeFormatting(
|
|
2998
|
+
String(d.uri),
|
|
2999
|
+
Te(y),
|
|
3000
|
+
h,
|
|
3001
|
+
io(k)
|
|
2471
3002
|
);
|
|
2472
|
-
return
|
|
3003
|
+
return m?.map(Qe);
|
|
2473
3004
|
}
|
|
2474
3005
|
}),
|
|
2475
3006
|
e.languages.registerSelectionRangeProvider("yaml", {
|
|
2476
|
-
async provideSelectionRanges(
|
|
2477
|
-
const
|
|
2478
|
-
String(
|
|
2479
|
-
|
|
3007
|
+
async provideSelectionRanges(d, y) {
|
|
3008
|
+
const k = await (await n.getWorker(d.uri)).getSelectionRanges(
|
|
3009
|
+
String(d.uri),
|
|
3010
|
+
y.map(Te)
|
|
2480
3011
|
);
|
|
2481
|
-
return
|
|
3012
|
+
return k?.map(uo);
|
|
2482
3013
|
}
|
|
2483
3014
|
})
|
|
2484
3015
|
];
|
|
2485
3016
|
return {
|
|
2486
3017
|
dispose() {
|
|
2487
|
-
for (const
|
|
2488
|
-
|
|
3018
|
+
for (const d of l)
|
|
3019
|
+
d.dispose();
|
|
2489
3020
|
},
|
|
2490
|
-
async update(
|
|
2491
|
-
|
|
3021
|
+
async update(d) {
|
|
3022
|
+
n.updateCreateData(Object.assign(r, d)), await i.revalidate();
|
|
2492
3023
|
},
|
|
2493
3024
|
getOptions() {
|
|
2494
|
-
return
|
|
3025
|
+
return r;
|
|
2495
3026
|
}
|
|
2496
3027
|
};
|
|
2497
3028
|
}
|
|
2498
|
-
function
|
|
3029
|
+
function ho(e) {
|
|
2499
3030
|
return new Worker("/assets/editor.worker-CpuX8TSY.js", {
|
|
2500
3031
|
name: e?.name
|
|
2501
3032
|
});
|
|
2502
3033
|
}
|
|
2503
|
-
function
|
|
3034
|
+
function po(e) {
|
|
2504
3035
|
return new Worker("/assets/json.worker-B4VHhH6h.js", {
|
|
2505
3036
|
name: e?.name
|
|
2506
3037
|
});
|
|
2507
3038
|
}
|
|
2508
|
-
function
|
|
3039
|
+
function yo(e) {
|
|
2509
3040
|
return new Worker("/assets/ts.worker-sl17zBDo.js", {
|
|
2510
3041
|
name: e?.name
|
|
2511
3042
|
});
|
|
2512
3043
|
}
|
|
2513
|
-
function
|
|
3044
|
+
function vo(e) {
|
|
2514
3045
|
return new Worker("/assets/css.worker-Dmf38jDD.js", {
|
|
2515
3046
|
name: e?.name
|
|
2516
3047
|
});
|
|
2517
3048
|
}
|
|
2518
|
-
function
|
|
3049
|
+
function bo(e) {
|
|
2519
3050
|
return new Worker("/assets/html.worker-DotaEs7v.js", {
|
|
2520
3051
|
name: e?.name
|
|
2521
3052
|
});
|
|
2522
3053
|
}
|
|
2523
|
-
function
|
|
3054
|
+
function wo(e) {
|
|
2524
3055
|
return new Worker("/assets/yaml.worker-JJoHBMla.js", {
|
|
2525
3056
|
name: e?.name
|
|
2526
3057
|
});
|
|
2527
3058
|
}
|
|
2528
|
-
function
|
|
3059
|
+
function Le(...e) {
|
|
2529
3060
|
}
|
|
2530
|
-
function
|
|
3061
|
+
function _o(...e) {
|
|
2531
3062
|
}
|
|
2532
|
-
const
|
|
2533
|
-
if (!globalThis[
|
|
2534
|
-
globalThis[
|
|
3063
|
+
const Ct = "__omniview_monaco_setup__";
|
|
3064
|
+
if (!globalThis[Ct]) {
|
|
3065
|
+
globalThis[Ct] = !0;
|
|
2535
3066
|
const e = self.MonacoEnvironment ?? {};
|
|
2536
3067
|
self.MonacoEnvironment = {
|
|
2537
3068
|
...e,
|
|
2538
|
-
getWorker(t,
|
|
2539
|
-
let
|
|
3069
|
+
getWorker(t, r) {
|
|
3070
|
+
let n;
|
|
2540
3071
|
try {
|
|
2541
|
-
switch (
|
|
3072
|
+
switch (r) {
|
|
2542
3073
|
case "yaml":
|
|
2543
|
-
|
|
3074
|
+
n = new wo();
|
|
2544
3075
|
break;
|
|
2545
3076
|
case "json":
|
|
2546
|
-
|
|
3077
|
+
n = new po();
|
|
2547
3078
|
break;
|
|
2548
3079
|
case "typescript":
|
|
2549
3080
|
case "javascript":
|
|
2550
|
-
|
|
3081
|
+
n = new yo();
|
|
2551
3082
|
break;
|
|
2552
3083
|
case "css":
|
|
2553
3084
|
case "scss":
|
|
2554
3085
|
case "less":
|
|
2555
|
-
|
|
3086
|
+
n = new vo();
|
|
2556
3087
|
break;
|
|
2557
3088
|
case "html":
|
|
2558
3089
|
case "handlebars":
|
|
2559
3090
|
case "razor":
|
|
2560
|
-
|
|
3091
|
+
n = new bo();
|
|
2561
3092
|
break;
|
|
2562
3093
|
default:
|
|
2563
|
-
|
|
3094
|
+
n = new ho();
|
|
2564
3095
|
break;
|
|
2565
3096
|
}
|
|
2566
|
-
|
|
3097
|
+
Le(`Worker created for "${r}" — instanceof Worker: ${n instanceof Worker}`);
|
|
2567
3098
|
} catch (c) {
|
|
2568
3099
|
throw c;
|
|
2569
3100
|
}
|
|
2570
|
-
return
|
|
2571
|
-
|
|
2572
|
-
},
|
|
2573
|
-
|
|
3101
|
+
return n.onerror = (c) => {
|
|
3102
|
+
_o(`Worker "${r}" error:`, c.message, "| filename:", c.filename);
|
|
3103
|
+
}, n.addEventListener("message", (c) => {
|
|
3104
|
+
Le(`Worker "${r}" first message:`, JSON.stringify(c.data).slice(0, 200));
|
|
2574
3105
|
}, {
|
|
2575
3106
|
once: !0
|
|
2576
|
-
}),
|
|
3107
|
+
}), n;
|
|
2577
3108
|
}
|
|
2578
3109
|
};
|
|
2579
3110
|
try {
|
|
2580
|
-
const t =
|
|
3111
|
+
const t = mo(W, {
|
|
2581
3112
|
enableSchemaRequest: !1,
|
|
2582
3113
|
schemas: []
|
|
2583
3114
|
});
|
|
2584
|
-
|
|
3115
|
+
Le("configureMonacoYaml succeeded — handle keys:", Object.keys(t)), fe._setYamlHandle(t), Le("YAML handle injected into EditorSchemaRegistry");
|
|
2585
3116
|
} catch (t) {
|
|
2586
3117
|
console.error("[monaco-setup] configureMonacoYaml FAILED:", t);
|
|
2587
3118
|
}
|
|
2588
3119
|
}
|
|
2589
|
-
function
|
|
3120
|
+
function No() {
|
|
2590
3121
|
}
|
|
2591
3122
|
export {
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
Nr as
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
3123
|
+
Mo as CelQueryEditor,
|
|
3124
|
+
Mt as CodeEditor,
|
|
3125
|
+
rn as CommandPalette,
|
|
3126
|
+
Nr as DiffViewer,
|
|
3127
|
+
Vr as MarkdownPreview,
|
|
3128
|
+
pe as OV_MONACO_THEME,
|
|
3129
|
+
kn as ObjectInspector,
|
|
3130
|
+
Dr as Terminal,
|
|
3131
|
+
$e as buildMonacoTheme,
|
|
3132
|
+
Je as buildXtermTheme,
|
|
3133
|
+
fe as editorSchemas,
|
|
3134
|
+
To as getComputedToken,
|
|
3135
|
+
No as setupMonacoWorkers,
|
|
3136
|
+
rt as useEditorTheme
|
|
2605
3137
|
};
|
|
2606
3138
|
//# sourceMappingURL=index.js.map
|