@ws-ui/code-editor 0.1.17 → 0.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,16 +1,16 @@
1
1
  var Pt = Object.defineProperty;
2
2
  var jt = (r, n, t) => n in r ? Pt(r, n, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[n] = t;
3
- var U = (r, n, t) => (jt(r, typeof n != "symbol" ? n + "" : n, t), t);
4
- import z, { useEffect as J, createContext as Qe, useState as oe, useRef as Ve, useContext as et, memo as kt } from "react";
5
- import { loader as At, useMonaco as Lt, Editor as Dt } from "@monaco-editor/react";
3
+ var Y = (r, n, t) => (jt(r, typeof n != "symbol" ? n + "" : n, t), t);
4
+ import z, { useEffect as J, createContext as Qe, useState as oe, useRef as Ue, useContext as et, memo as kt } from "react";
5
+ import { loader as At, useMonaco as Dt, Editor as Lt } from "@monaco-editor/react";
6
6
  import { getMonacoTheme as $t, lspSubject as Ft, LspActions as G, hasAttributesString as tt, FileFolderType as Mt } from "@ws-ui/shared";
7
7
  import { initServices as Wt, MonacoLanguageClient as Kt } from "monaco-languageclient";
8
- import { ErrorAction as Yt, CloseAction as Ut } from "vscode-languageclient";
8
+ import { ErrorAction as qt, CloseAction as Yt } from "vscode-languageclient";
9
9
  import * as c from "monaco-editor";
10
- import { Selection as Vt, KeyMod as Q, KeyCode as ee, editor as nt, Uri as qt } from "monaco-editor";
10
+ import { Selection as Ut, KeyMod as Q, KeyCode as ee, editor as nt, Uri as Vt } from "monaco-editor";
11
11
  import { WebSocketMessageReader as Bt, WebSocketMessageWriter as zt, toSocket as Gt } from "vscode-ws-jsonrpc";
12
12
  import { WillSaveTextDocumentNotification as Zt, TextDocumentSaveReason as Jt, DidSaveTextDocumentNotification as Ht, WillCreateFilesRequest as Xt, WillRenameFilesRequest as Qt, WillDeleteFilesRequest as en, DidCreateFilesNotification as tn, DidRenameFilesNotification as nn, DidDeleteFilesNotification as rn } from "vscode-languageserver-protocol";
13
- import { ICodeEditorService as qe, StandaloneServices as xe, ILanguageFeaturesService as Be, ITextModelService as ze } from "vscode/services";
13
+ import { ICodeEditorService as Ve, StandaloneServices as xe, ILanguageFeaturesService as Be, ITextModelService as ze } from "vscode/services";
14
14
  var Re = { exports: {} }, te = {};
15
15
  /*
16
16
  object-assign
@@ -28,15 +28,15 @@ function rt() {
28
28
  throw new TypeError("Object.assign cannot be called with null or undefined");
29
29
  return Object(u);
30
30
  }
31
- function l() {
31
+ function s() {
32
32
  try {
33
33
  if (!Object.assign)
34
34
  return !1;
35
35
  var u = new String("abc");
36
36
  if (u[5] = "de", Object.getOwnPropertyNames(u)[0] === "5")
37
37
  return !1;
38
- for (var f = {}, s = 0; s < 10; s++)
39
- f["_" + String.fromCharCode(s)] = s;
38
+ for (var f = {}, l = 0; l < 10; l++)
39
+ f["_" + String.fromCharCode(l)] = l;
40
40
  var d = Object.getOwnPropertyNames(f).map(function(b) {
41
41
  return f[b];
42
42
  });
@@ -50,15 +50,15 @@ function rt() {
50
50
  return !1;
51
51
  }
52
52
  }
53
- return Ce = l() ? Object.assign : function(u, f) {
54
- for (var s, d = i(u), h, b = 1; b < arguments.length; b++) {
55
- s = Object(arguments[b]);
56
- for (var S in s)
57
- n.call(s, S) && (d[S] = s[S]);
53
+ return Ce = s() ? Object.assign : function(u, f) {
54
+ for (var l, d = i(u), h, b = 1; b < arguments.length; b++) {
55
+ l = Object(arguments[b]);
56
+ for (var S in l)
57
+ n.call(l, S) && (d[S] = l[S]);
58
58
  if (r) {
59
- h = r(s);
59
+ h = r(l);
60
60
  for (var v = 0; v < h.length; v++)
61
- t.call(s, h[v]) && (d[h[v]] = s[h[v]]);
61
+ t.call(l, h[v]) && (d[h[v]] = l[h[v]]);
62
62
  }
63
63
  }
64
64
  return d;
@@ -82,16 +82,16 @@ function on() {
82
82
  var t = Symbol.for;
83
83
  n = t("react.element"), te.Fragment = t("react.fragment");
84
84
  }
85
- var i = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, l = Object.prototype.hasOwnProperty, u = { key: !0, ref: !0, __self: !0, __source: !0 };
86
- function f(s, d, h) {
87
- var b, S = {}, v = null, O = null;
88
- h !== void 0 && (v = "" + h), d.key !== void 0 && (v = "" + d.key), d.ref !== void 0 && (O = d.ref);
85
+ var i = r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, s = Object.prototype.hasOwnProperty, u = { key: !0, ref: !0, __self: !0, __source: !0 };
86
+ function f(l, d, h) {
87
+ var b, S = {}, v = null, N = null;
88
+ h !== void 0 && (v = "" + h), d.key !== void 0 && (v = "" + d.key), d.ref !== void 0 && (N = d.ref);
89
89
  for (b in d)
90
- l.call(d, b) && !u.hasOwnProperty(b) && (S[b] = d[b]);
91
- if (s && s.defaultProps)
92
- for (b in d = s.defaultProps, d)
90
+ s.call(d, b) && !u.hasOwnProperty(b) && (S[b] = d[b]);
91
+ if (l && l.defaultProps)
92
+ for (b in d = l.defaultProps, d)
93
93
  S[b] === void 0 && (S[b] = d[b]);
94
- return { $$typeof: n, type: s, key: v, ref: O, props: S, _owner: i.current };
94
+ return { $$typeof: n, type: l, key: v, ref: N, props: S, _owner: i.current };
95
95
  }
96
96
  return te.jsx = f, te.jsxs = f, te;
97
97
  }
@@ -108,12 +108,12 @@ var Je;
108
108
  function an() {
109
109
  return Je || (Je = 1, function(r) {
110
110
  process.env.NODE_ENV !== "production" && function() {
111
- var n = z, t = rt(), i = 60103, l = 60106;
111
+ var n = z, t = rt(), i = 60103, s = 60106;
112
112
  r.Fragment = 60107;
113
- var u = 60108, f = 60114, s = 60109, d = 60110, h = 60112, b = 60113, S = 60120, v = 60115, O = 60116, k = 60121, P = 60122, $ = 60117, _ = 60129, R = 60131;
113
+ var u = 60108, f = 60114, l = 60109, d = 60110, h = 60112, b = 60113, S = 60120, v = 60115, N = 60116, k = 60121, P = 60122, $ = 60117, _ = 60129, E = 60131;
114
114
  if (typeof Symbol == "function" && Symbol.for) {
115
115
  var y = Symbol.for;
116
- i = y("react.element"), l = y("react.portal"), r.Fragment = y("react.fragment"), u = y("react.strict_mode"), f = y("react.profiler"), s = y("react.provider"), d = y("react.context"), h = y("react.forward_ref"), b = y("react.suspense"), S = y("react.suspense_list"), v = y("react.memo"), O = y("react.lazy"), k = y("react.block"), P = y("react.server.block"), $ = y("react.fundamental"), y("react.scope"), y("react.opaque.id"), _ = y("react.debug_trace_mode"), y("react.offscreen"), R = y("react.legacy_hidden");
116
+ i = y("react.element"), s = y("react.portal"), r.Fragment = y("react.fragment"), u = y("react.strict_mode"), f = y("react.profiler"), l = y("react.provider"), d = y("react.context"), h = y("react.forward_ref"), b = y("react.suspense"), S = y("react.suspense_list"), v = y("react.memo"), N = y("react.lazy"), k = y("react.block"), P = y("react.server.block"), $ = y("react.fundamental"), y("react.scope"), y("react.opaque.id"), _ = y("react.debug_trace_mode"), y("react.offscreen"), E = y("react.legacy_hidden");
117
117
  }
118
118
  var g = typeof Symbol == "function" && Symbol.iterator, p = "@@iterator";
119
119
  function M(e) {
@@ -127,22 +127,22 @@ function an() {
127
127
  {
128
128
  for (var o = arguments.length, a = new Array(o > 1 ? o - 1 : 0), m = 1; m < o; m++)
129
129
  a[m - 1] = arguments[m];
130
- Y("error", e, a);
130
+ q("error", e, a);
131
131
  }
132
132
  }
133
- function Y(e, o, a) {
133
+ function q(e, o, a) {
134
134
  {
135
135
  var m = F.ReactDebugCurrentFrame, T = m.getStackAddendum();
136
136
  T !== "" && (o += "%s", a = a.concat([T]));
137
- var N = a.map(function(E) {
138
- return "" + E;
137
+ var O = a.map(function(R) {
138
+ return "" + R;
139
139
  });
140
- N.unshift("Warning: " + o), Function.prototype.apply.call(console[e], console, N);
140
+ O.unshift("Warning: " + o), Function.prototype.apply.call(console[e], console, O);
141
141
  }
142
142
  }
143
143
  var ce = !1;
144
144
  function x(e) {
145
- return !!(typeof e == "string" || typeof e == "function" || e === r.Fragment || e === f || e === _ || e === u || e === b || e === S || e === R || ce || typeof e == "object" && e !== null && (e.$$typeof === O || e.$$typeof === v || e.$$typeof === s || e.$$typeof === d || e.$$typeof === h || e.$$typeof === $ || e.$$typeof === k || e[0] === P));
145
+ return !!(typeof e == "string" || typeof e == "function" || e === r.Fragment || e === f || e === _ || e === u || e === b || e === S || e === E || ce || typeof e == "object" && e !== null && (e.$$typeof === N || e.$$typeof === v || e.$$typeof === l || e.$$typeof === d || e.$$typeof === h || e.$$typeof === $ || e.$$typeof === k || e[0] === P));
146
146
  }
147
147
  function I(e, o, a) {
148
148
  var m = o.displayName || o.name || "";
@@ -161,7 +161,7 @@ function an() {
161
161
  switch (e) {
162
162
  case r.Fragment:
163
163
  return "Fragment";
164
- case l:
164
+ case s:
165
165
  return "Portal";
166
166
  case f:
167
167
  return "Profiler";
@@ -177,7 +177,7 @@ function an() {
177
177
  case d:
178
178
  var o = e;
179
179
  return w(o) + ".Consumer";
180
- case s:
180
+ case l:
181
181
  var a = e;
182
182
  return w(a._context) + ".Provider";
183
183
  case h:
@@ -186,10 +186,10 @@ function an() {
186
186
  return W(e.type);
187
187
  case k:
188
188
  return W(e._render);
189
- case O: {
190
- var m = e, T = m._payload, N = m._init;
189
+ case N: {
190
+ var m = e, T = m._payload, O = m._init;
191
191
  try {
192
- return W(N(T));
192
+ return W(O(T));
193
193
  } catch {
194
194
  return null;
195
195
  }
@@ -197,18 +197,18 @@ function an() {
197
197
  }
198
198
  return null;
199
199
  }
200
- var ne = 0, Se, ye, we, _e, Ie, Te, Ne;
201
- function Oe() {
200
+ var ne = 0, Se, ye, we, _e, Ie, Te, Oe;
201
+ function Ne() {
202
202
  }
203
- Oe.__reactDisabledLog = !0;
203
+ Ne.__reactDisabledLog = !0;
204
204
  function ct() {
205
205
  {
206
206
  if (ne === 0) {
207
- Se = console.log, ye = console.info, we = console.warn, _e = console.error, Ie = console.group, Te = console.groupCollapsed, Ne = console.groupEnd;
207
+ Se = console.log, ye = console.info, we = console.warn, _e = console.error, Ie = console.group, Te = console.groupCollapsed, Oe = console.groupEnd;
208
208
  var e = {
209
209
  configurable: !0,
210
210
  enumerable: !0,
211
- value: Oe,
211
+ value: Ne,
212
212
  writable: !0
213
213
  };
214
214
  Object.defineProperties(console, {
@@ -252,7 +252,7 @@ function an() {
252
252
  value: Te
253
253
  }),
254
254
  groupEnd: t({}, e, {
255
- value: Ne
255
+ value: Oe
256
256
  })
257
257
  });
258
258
  }
@@ -290,31 +290,31 @@ function an() {
290
290
  me = !0;
291
291
  var T = Error.prepareStackTrace;
292
292
  Error.prepareStackTrace = void 0;
293
- var N;
294
- N = fe.current, fe.current = null, ct();
293
+ var O;
294
+ O = fe.current, fe.current = null, ct();
295
295
  try {
296
296
  if (o) {
297
- var E = function() {
297
+ var R = function() {
298
298
  throw Error();
299
299
  };
300
- if (Object.defineProperty(E.prototype, "props", {
300
+ if (Object.defineProperty(R.prototype, "props", {
301
301
  set: function() {
302
302
  throw Error();
303
303
  }
304
304
  }), typeof Reflect == "object" && Reflect.construct) {
305
305
  try {
306
- Reflect.construct(E, []);
306
+ Reflect.construct(R, []);
307
307
  } catch (B) {
308
308
  m = B;
309
309
  }
310
- Reflect.construct(e, [], E);
310
+ Reflect.construct(e, [], R);
311
311
  } else {
312
312
  try {
313
- E.call();
313
+ R.call();
314
314
  } catch (B) {
315
315
  m = B;
316
316
  }
317
- e.call(E.prototype);
317
+ e.call(R.prototype);
318
318
  }
319
319
  } else {
320
320
  try {
@@ -328,26 +328,26 @@ function an() {
328
328
  if (B && m && typeof B.stack == "string") {
329
329
  for (var C = B.stack.split(`
330
330
  `), K = m.stack.split(`
331
- `), L = C.length - 1, D = K.length - 1; L >= 1 && D >= 0 && C[L] !== K[D]; )
332
- D--;
333
- for (; L >= 1 && D >= 0; L--, D--)
334
- if (C[L] !== K[D]) {
335
- if (L !== 1 || D !== 1)
331
+ `), D = C.length - 1, L = K.length - 1; D >= 1 && L >= 0 && C[D] !== K[L]; )
332
+ L--;
333
+ for (; D >= 1 && L >= 0; D--, L--)
334
+ if (C[D] !== K[L]) {
335
+ if (D !== 1 || L !== 1)
336
336
  do
337
- if (L--, D--, D < 0 || C[L] !== K[D]) {
338
- var q = `
339
- ` + C[L].replace(" at new ", " at ");
340
- return typeof e == "function" && se.set(e, q), q;
337
+ if (D--, L--, L < 0 || C[D] !== K[L]) {
338
+ var V = `
339
+ ` + C[D].replace(" at new ", " at ");
340
+ return typeof e == "function" && se.set(e, V), V;
341
341
  }
342
- while (L >= 1 && D >= 0);
342
+ while (D >= 1 && L >= 0);
343
343
  break;
344
344
  }
345
345
  }
346
346
  } finally {
347
- me = !1, fe.current = N, ft(), Error.prepareStackTrace = T;
347
+ me = !1, fe.current = O, ft(), Error.prepareStackTrace = T;
348
348
  }
349
- var X = e ? e.displayName || e.name : "", Ue = X ? ae(X) : "";
350
- return typeof e == "function" && se.set(e, Ue), Ue;
349
+ var X = e ? e.displayName || e.name : "", Ye = X ? ae(X) : "";
350
+ return typeof e == "function" && se.set(e, Ye), Ye;
351
351
  }
352
352
  function je(e, o, a) {
353
353
  return Pe(e, !1);
@@ -377,10 +377,10 @@ function an() {
377
377
  return le(e.type, o, a);
378
378
  case k:
379
379
  return je(e._render);
380
- case O: {
381
- var m = e, T = m._payload, N = m._init;
380
+ case N: {
381
+ var m = e, T = m._payload, O = m._init;
382
382
  try {
383
- return le(N(T), o, a);
383
+ return le(O(T), o, a);
384
384
  } catch {
385
385
  }
386
386
  }
@@ -397,20 +397,20 @@ function an() {
397
397
  }
398
398
  function gt(e, o, a, m, T) {
399
399
  {
400
- var N = Function.call.bind(Object.prototype.hasOwnProperty);
401
- for (var E in e)
402
- if (N(e, E)) {
400
+ var O = Function.call.bind(Object.prototype.hasOwnProperty);
401
+ for (var R in e)
402
+ if (O(e, R)) {
403
403
  var C = void 0;
404
404
  try {
405
- if (typeof e[E] != "function") {
406
- var K = Error((m || "React class") + ": " + a + " type `" + E + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[E] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
405
+ if (typeof e[R] != "function") {
406
+ var K = Error((m || "React class") + ": " + a + " type `" + R + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[R] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
407
407
  throw K.name = "Invariant Violation", K;
408
408
  }
409
- C = e[E](o, E, m, a, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
410
- } catch (L) {
411
- C = L;
409
+ C = e[R](o, R, m, a, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
410
+ } catch (D) {
411
+ C = D;
412
412
  }
413
- C && !(C instanceof Error) && (ue(T), A("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", m || "React class", a, E, typeof C), ue(null)), C instanceof Error && !(C.message in ke) && (ke[C.message] = !0, ue(T), A("Failed %s type: %s", a, C.message), ue(null));
413
+ C && !(C instanceof Error) && (ue(T), A("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", m || "React class", a, R, typeof C), ue(null)), C instanceof Error && !(C.message in ke) && (ke[C.message] = !0, ue(T), A("Failed %s type: %s", a, C.message), ue(null));
414
414
  }
415
415
  }
416
416
  }
@@ -419,7 +419,7 @@ function an() {
419
419
  ref: !0,
420
420
  __self: !0,
421
421
  __source: !0
422
- }, Le, De, pe;
422
+ }, De, Le, pe;
423
423
  pe = {};
424
424
  function vt(e) {
425
425
  if (ge.call(e, "ref")) {
@@ -446,7 +446,7 @@ function an() {
446
446
  function Ct(e, o) {
447
447
  {
448
448
  var a = function() {
449
- Le || (Le = !0, A("%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://reactjs.org/link/special-props)", o));
449
+ De || (De = !0, A("%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://reactjs.org/link/special-props)", o));
450
450
  };
451
451
  a.isReactWarning = !0, Object.defineProperty(e, "key", {
452
452
  get: a,
@@ -457,7 +457,7 @@ function an() {
457
457
  function Et(e, o) {
458
458
  {
459
459
  var a = function() {
460
- De || (De = !0, A("%s: `ref` 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://reactjs.org/link/special-props)", o));
460
+ Le || (Le = !0, A("%s: `ref` 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://reactjs.org/link/special-props)", o));
461
461
  };
462
462
  a.isReactWarning = !0, Object.defineProperty(e, "ref", {
463
463
  get: a,
@@ -465,7 +465,7 @@ function an() {
465
465
  });
466
466
  }
467
467
  }
468
- var Rt = function(e, o, a, m, T, N, E) {
468
+ var Rt = function(e, o, a, m, T, O, R) {
469
469
  var C = {
470
470
  // This tag allows us to uniquely identify this as a React Element
471
471
  $$typeof: i,
@@ -473,9 +473,9 @@ function an() {
473
473
  type: e,
474
474
  key: o,
475
475
  ref: a,
476
- props: E,
476
+ props: R,
477
477
  // Record the component responsible for creating this element.
478
- _owner: N
478
+ _owner: O
479
479
  };
480
480
  return C._store = {}, Object.defineProperty(C._store, "validated", {
481
481
  configurable: !1,
@@ -496,20 +496,20 @@ function an() {
496
496
  };
497
497
  function xt(e, o, a, m, T) {
498
498
  {
499
- var N, E = {}, C = null, K = null;
499
+ var O, R = {}, C = null, K = null;
500
500
  a !== void 0 && (C = "" + a), ht(o) && (C = "" + o.key), vt(o) && (K = o.ref, bt(o, T));
501
- for (N in o)
502
- ge.call(o, N) && !pt.hasOwnProperty(N) && (E[N] = o[N]);
501
+ for (O in o)
502
+ ge.call(o, O) && !pt.hasOwnProperty(O) && (R[O] = o[O]);
503
503
  if (e && e.defaultProps) {
504
- var L = e.defaultProps;
505
- for (N in L)
506
- E[N] === void 0 && (E[N] = L[N]);
504
+ var D = e.defaultProps;
505
+ for (O in D)
506
+ R[O] === void 0 && (R[O] = D[O]);
507
507
  }
508
508
  if (C || K) {
509
- var D = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
510
- C && Ct(E, D), K && Et(E, D);
509
+ var L = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
510
+ C && Ct(R, L), K && Et(R, L);
511
511
  }
512
- return Rt(e, C, K, T, m, re.current, E);
512
+ return Rt(e, C, K, T, m, re.current, R);
513
513
  }
514
514
  }
515
515
  var ve = F.ReactCurrentOwner, $e = F.ReactDebugCurrentFrame;
@@ -588,8 +588,8 @@ Check the top-level render call using <` + a + ">.");
588
588
  else if (e) {
589
589
  var T = M(e);
590
590
  if (typeof T == "function" && T !== e.entries)
591
- for (var N = T.call(e), E; !(E = N.next()).done; )
592
- be(E.value) && We(E.value, o);
591
+ for (var O = T.call(e), R; !(R = O.next()).done; )
592
+ be(R.value) && We(R.value, o);
593
593
  }
594
594
  }
595
595
  }
@@ -630,44 +630,44 @@ Check the top-level render call using <` + a + ">.");
630
630
  e.ref !== null && (H(e), A("Invalid attribute `ref` supplied to `React.Fragment`."), H(null));
631
631
  }
632
632
  }
633
- function Ye(e, o, a, m, T, N) {
633
+ function qe(e, o, a, m, T, O) {
634
634
  {
635
- var E = x(e);
636
- if (!E) {
635
+ var R = x(e);
636
+ if (!R) {
637
637
  var C = "";
638
638
  (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (C += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
639
639
  var K = St(T);
640
640
  K ? C += K : C += Fe();
641
- var L;
642
- e === null ? L = "null" : Array.isArray(e) ? L = "array" : e !== void 0 && e.$$typeof === i ? (L = "<" + (W(e.type) || "Unknown") + " />", C = " Did you accidentally export a JSX literal instead of a component?") : L = typeof e, A("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", L, C);
641
+ var D;
642
+ e === null ? D = "null" : Array.isArray(e) ? D = "array" : e !== void 0 && e.$$typeof === i ? (D = "<" + (W(e.type) || "Unknown") + " />", C = " Did you accidentally export a JSX literal instead of a component?") : D = typeof e, A("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", D, C);
643
643
  }
644
- var D = xt(e, o, a, T, N);
645
- if (D == null)
646
- return D;
647
- if (E) {
648
- var q = o.children;
649
- if (q !== void 0)
644
+ var L = xt(e, o, a, T, O);
645
+ if (L == null)
646
+ return L;
647
+ if (R) {
648
+ var V = o.children;
649
+ if (V !== void 0)
650
650
  if (m)
651
- if (Array.isArray(q)) {
652
- for (var X = 0; X < q.length; X++)
653
- Ke(q[X], e);
654
- Object.freeze && Object.freeze(q);
651
+ if (Array.isArray(V)) {
652
+ for (var X = 0; X < V.length; X++)
653
+ Ke(V[X], e);
654
+ Object.freeze && Object.freeze(V);
655
655
  } else
656
656
  A("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
657
657
  else
658
- Ke(q, e);
658
+ Ke(V, e);
659
659
  }
660
- return e === r.Fragment ? _t(D) : wt(D), D;
660
+ return e === r.Fragment ? _t(L) : wt(L), L;
661
661
  }
662
662
  }
663
663
  function It(e, o, a) {
664
- return Ye(e, o, a, !0);
664
+ return qe(e, o, a, !0);
665
665
  }
666
666
  function Tt(e, o, a) {
667
- return Ye(e, o, a, !1);
667
+ return qe(e, o, a, !1);
668
668
  }
669
- var Nt = Tt, Ot = It;
670
- r.jsx = Nt, r.jsxs = Ot;
669
+ var Ot = Tt, Nt = It;
670
+ r.jsx = Ot, r.jsxs = Nt;
671
671
  }();
672
672
  }(Ee)), Ee;
673
673
  }
@@ -676,7 +676,7 @@ var j = Re.exports;
676
676
  class sn extends Bt {
677
677
  constructor(t, i) {
678
678
  super(t);
679
- U(this, "onMessage");
679
+ Y(this, "onMessage");
680
680
  this.onMessage = i;
681
681
  }
682
682
  readMessage(t) {
@@ -687,15 +687,15 @@ class sn extends Bt {
687
687
  if (this.state === "initial")
688
688
  this.events.splice(0, 0, { message: i });
689
689
  else if (this.state === "listening") {
690
- const l = JSON.parse(i);
691
- this.callback(l);
690
+ const s = JSON.parse(i);
691
+ this.callback(s);
692
692
  }
693
693
  }
694
694
  }
695
695
  class ln extends zt {
696
696
  constructor(t, i) {
697
697
  super(t);
698
- U(this, "onSend");
698
+ Y(this, "onSend");
699
699
  this.onSend = i;
700
700
  }
701
701
  async write(t) {
@@ -720,14 +720,14 @@ const un = {
720
720
  }
721
721
  ]
722
722
  };
723
- function V(r) {
723
+ function U(r) {
724
724
  return `file:///PACKAGE/Project/Sources/${r}`;
725
725
  }
726
726
  function it(r, n = 0) {
727
727
  setTimeout(r, n);
728
728
  }
729
729
  function cn(r, n) {
730
- const t = new Vt(
730
+ const t = new Ut(
731
731
  n.startLineNumber,
732
732
  n.startColumn,
733
733
  n.endLineNumber || n.startLineNumber,
@@ -742,13 +742,13 @@ function fn(r, n, t = 0) {
742
742
  r.setPosition({ lineNumber: n, column: 1 }), r.revealLineInCenter(n), r.focus();
743
743
  });
744
744
  }
745
- function Vn(r, n, t) {
746
- const l = r.getModel();
747
- if (l && n) {
748
- const u = l.getLineCount();
745
+ function zn(r, n, t) {
746
+ const s = r.getModel();
747
+ if (s && n) {
748
+ const u = s.getLineCount();
749
749
  for (let f = 1; f <= u; f++) {
750
- const s = l.getLineContent(f);
751
- if (new RegExp(`(?:Function|function) ${t}`).test(s))
750
+ const l = s.getLineContent(f);
751
+ if (new RegExp(`(?:Function|function) ${t}`).test(l))
752
752
  return f;
753
753
  }
754
754
  }
@@ -756,8 +756,8 @@ function Vn(r, n, t) {
756
756
  }
757
757
  const dn = {
758
758
  getServiceOverride: ({ openHandler: r }) => ({
759
- get [qe.toString()]() {
760
- const n = xe.get(qe);
759
+ get [Ve.toString()]() {
760
+ const n = xe.get(Ve);
761
761
  return r && n.registerCodeEditorOpenHandler(r), n;
762
762
  }
763
763
  })
@@ -1092,8 +1092,8 @@ const dn = {
1092
1092
  // vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.41.0/min/vs",
1093
1093
  // },
1094
1094
  });
1095
- const ot = Qe(void 0), qn = ({ children: r, url: n, qodly: t, defaultZoom: i, openHandler: l, language: u = "4d", defaultInited: f = !1 }) => {
1096
- const s = Lt(), [d, h] = oe(f), [b, S] = oe(null), v = Ve(), O = Ve(0);
1095
+ const ot = Qe(void 0), Gn = ({ children: r, url: n, qodly: t, defaultZoom: i, openHandler: s, language: u = "4d", defaultInited: f = !1 }) => {
1096
+ const l = Dt(), [d, h] = oe(f), [b, S] = oe(null), v = Ue(), N = Ue(0);
1097
1097
  J(() => {
1098
1098
  Wt({
1099
1099
  configureEditorOrViewsService: {
@@ -1102,23 +1102,23 @@ const ot = Qe(void 0), qn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
1102
1102
  debugLogging: !1,
1103
1103
  userServices: {
1104
1104
  // @see https://github.com/CodinGame/monaco-vscode-api#monaco-standalone-services
1105
- ...dn.getServiceOverride({ openHandler: l }),
1105
+ ...dn.getServiceOverride({ openHandler: s }),
1106
1106
  ...mn.getServiceOverride(),
1107
1107
  ...gn.getServiceOverride()
1108
1108
  }
1109
1109
  });
1110
1110
  }, []), J(() => {
1111
- n && s && k();
1112
- }, [n, s]);
1111
+ n && l && k();
1112
+ }, [n, l]);
1113
1113
  const k = async () => {
1114
- if (!s)
1114
+ if (!l)
1115
1115
  return;
1116
1116
  const x = await $t();
1117
- s.editor.defineTheme("fd-dark", x || un), s.languages.register({
1117
+ l.editor.defineTheme("fd-dark", x || un), l.languages.register({
1118
1118
  id: u,
1119
1119
  extensions: [".4dm", ".4qm", ".4qs"],
1120
1120
  aliases: ["4d", "4D"]
1121
- }), s.languages.setLanguageConfiguration(u, pn), s.languages.registerCompletionItemProvider(
1121
+ }), l.languages.setLanguageConfiguration(u, pn), l.languages.registerCompletionItemProvider(
1122
1122
  u,
1123
1123
  t ? hn : vn
1124
1124
  ), nt.addKeybindingRules(bn), P();
@@ -1131,20 +1131,20 @@ const ot = Qe(void 0), qn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
1131
1131
  S(new Event("INVALID_URL"));
1132
1132
  return;
1133
1133
  }
1134
- x.onopen = $, x.onclose = _, x.onerror = R, O.current = 0;
1134
+ x.onopen = $, x.onclose = _, x.onerror = E, N.current = 0;
1135
1135
  }, $ = async function() {
1136
1136
  const x = Gt(this), I = new sn(x), w = new ln(x), W = new Kt({
1137
1137
  name: "4D Language Client",
1138
1138
  clientOptions: {
1139
1139
  workspaceFolder: {
1140
- uri: qt.parse("file:///PACKAGE")
1140
+ uri: Vt.parse("file:///PACKAGE")
1141
1141
  },
1142
1142
  // use a language id as a document selector
1143
1143
  documentSelector: [{ scheme: "file", language: u }],
1144
1144
  // disable the default error handler
1145
1145
  errorHandler: {
1146
- error: () => ({ action: Yt.Continue }),
1147
- closed: () => ({ action: Ut.DoNotRestart })
1146
+ error: () => ({ action: qt.Continue }),
1147
+ closed: () => ({ action: Yt.DoNotRestart })
1148
1148
  }
1149
1149
  },
1150
1150
  // create a language client connection from the JSON RPC connection on demand
@@ -1156,12 +1156,12 @@ const ot = Qe(void 0), qn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
1156
1156
  }
1157
1157
  });
1158
1158
  v.current = W, I.onClose(() => {
1159
- W.stop(), O.current < 3 ? setTimeout(() => {
1160
- O.current++, P();
1159
+ W.stop(), N.current < 3 ? setTimeout(() => {
1160
+ N.current++, P();
1161
1161
  }, 1e3) : S(new Event("WEBSOCKET_CLOSED"));
1162
1162
  }), W.needsStart() && await W.start(), h(!0);
1163
1163
  }, _ = () => {
1164
- }, R = (x) => {
1164
+ }, E = (x) => {
1165
1165
  S(x);
1166
1166
  };
1167
1167
  J(() => {
@@ -1183,7 +1183,7 @@ const ot = Qe(void 0), qn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
1183
1183
  M(w.oldPath, w.newPath);
1184
1184
  break;
1185
1185
  case G.DID_RENAME:
1186
- Y(w.oldPath, w.newPath);
1186
+ q(w.oldPath, w.newPath);
1187
1187
  break;
1188
1188
  case G.WILL_DELETE:
1189
1189
  F(w.filePath);
@@ -1199,7 +1199,7 @@ const ot = Qe(void 0), qn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
1199
1199
  var w;
1200
1200
  (w = v.current) == null || w.sendNotification(Zt.type, {
1201
1201
  textDocument: {
1202
- uri: V(x)
1202
+ uri: U(x)
1203
1203
  },
1204
1204
  reason: I
1205
1205
  });
@@ -1207,7 +1207,7 @@ const ot = Qe(void 0), qn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
1207
1207
  var w;
1208
1208
  (w = v.current) == null || w.sendNotification(Ht.type, {
1209
1209
  textDocument: {
1210
- uri: V(x)
1210
+ uri: U(x)
1211
1211
  },
1212
1212
  text: I
1213
1213
  });
@@ -1216,7 +1216,7 @@ const ot = Qe(void 0), qn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
1216
1216
  (I = v.current) == null || I.sendRequest(Xt.type, {
1217
1217
  files: [
1218
1218
  {
1219
- uri: V(x)
1219
+ uri: U(x)
1220
1220
  }
1221
1221
  ]
1222
1222
  });
@@ -1225,8 +1225,8 @@ const ot = Qe(void 0), qn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
1225
1225
  (w = v.current) == null || w.sendRequest(Qt.type, {
1226
1226
  files: [
1227
1227
  {
1228
- oldUri: V(x),
1229
- newUri: V(I)
1228
+ oldUri: U(x),
1229
+ newUri: U(I)
1230
1230
  }
1231
1231
  ]
1232
1232
  });
@@ -1235,7 +1235,7 @@ const ot = Qe(void 0), qn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
1235
1235
  (I = v.current) == null || I.sendRequest(en.type, {
1236
1236
  files: [
1237
1237
  {
1238
- uri: V(x)
1238
+ uri: U(x)
1239
1239
  }
1240
1240
  ]
1241
1241
  });
@@ -1244,17 +1244,17 @@ const ot = Qe(void 0), qn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
1244
1244
  (I = v.current) == null || I.sendNotification(tn.type, {
1245
1245
  files: [
1246
1246
  {
1247
- uri: V(x)
1247
+ uri: U(x)
1248
1248
  }
1249
1249
  ]
1250
1250
  });
1251
- }, Y = (x, I) => {
1251
+ }, q = (x, I) => {
1252
1252
  var w;
1253
1253
  (w = v.current) == null || w.sendNotification(nn.type, {
1254
1254
  files: [
1255
1255
  {
1256
- oldUri: V(x),
1257
- newUri: V(I)
1256
+ oldUri: U(x),
1257
+ newUri: U(I)
1258
1258
  }
1259
1259
  ]
1260
1260
  });
@@ -1263,7 +1263,7 @@ const ot = Qe(void 0), qn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
1263
1263
  (I = v.current) == null || I.sendNotification(rn.type, {
1264
1264
  files: [
1265
1265
  {
1266
- uri: V(x)
1266
+ uri: U(x)
1267
1267
  }
1268
1268
  ]
1269
1269
  });
@@ -1284,7 +1284,7 @@ const ot = Qe(void 0), qn = ({ children: r, url: n, qodly: t, defaultZoom: i, op
1284
1284
  }
1285
1285
  );
1286
1286
  };
1287
- function Bn() {
1287
+ function Zn() {
1288
1288
  const r = et(ot);
1289
1289
  if (r === void 0)
1290
1290
  throw new Error("useLSP must be used within an LSPContext");
@@ -1292,7 +1292,7 @@ function Bn() {
1292
1292
  }
1293
1293
  const at = Qe(
1294
1294
  void 0
1295
- ), zn = kt(({ children: r }) => {
1295
+ ), Jn = kt(({ children: r }) => {
1296
1296
  const [n, t] = oe(null);
1297
1297
  return /* @__PURE__ */ j.jsx(
1298
1298
  at.Provider,
@@ -1326,8 +1326,8 @@ var st = {
1326
1326
  return Z = Object.assign || function(r) {
1327
1327
  for (var n, t = 1, i = arguments.length; t < i; t++) {
1328
1328
  n = arguments[t];
1329
- for (var l in n)
1330
- Object.prototype.hasOwnProperty.call(n, l) && (r[l] = n[l]);
1329
+ for (var s in n)
1330
+ Object.prototype.hasOwnProperty.call(n, s) && (r[s] = n[s]);
1331
1331
  }
1332
1332
  return r;
1333
1333
  }, Z.apply(this, arguments);
@@ -1336,8 +1336,8 @@ var st = {
1336
1336
  for (var i in r)
1337
1337
  Object.prototype.hasOwnProperty.call(r, i) && n.indexOf(i) < 0 && (t[i] = r[i]);
1338
1338
  if (r != null && typeof Object.getOwnPropertySymbols == "function")
1339
- for (var l = 0, i = Object.getOwnPropertySymbols(r); l < i.length; l++)
1340
- n.indexOf(i[l]) < 0 && Object.prototype.propertyIsEnumerable.call(r, i[l]) && (t[i[l]] = r[i[l]]);
1339
+ for (var s = 0, i = Object.getOwnPropertySymbols(r); s < i.length; s++)
1340
+ n.indexOf(i[s]) < 0 && Object.prototype.propertyIsEnumerable.call(r, i[s]) && (t[i[s]] = r[i[s]]);
1341
1341
  return t;
1342
1342
  };
1343
1343
  function lt(r) {
@@ -1356,7 +1356,7 @@ function ut(r) {
1356
1356
  }
1357
1357
  function xn(r) {
1358
1358
  var n = function(t) {
1359
- var i = r.attr, l = r.size, u = r.title, f = Rn(r, ["attr", "size", "title"]), s = l || t.size || "1em", d;
1359
+ var i = r.attr, s = r.size, u = r.title, f = Rn(r, ["attr", "size", "title"]), l = s || t.size || "1em", d;
1360
1360
  return t.className && (d = t.className), r.className && (d = (d ? d + " " : "") + r.className), z.createElement("svg", Z({
1361
1361
  stroke: "currentColor",
1362
1362
  fill: "currentColor",
@@ -1366,8 +1366,8 @@ function xn(r) {
1366
1366
  style: Z(Z({
1367
1367
  color: r.color || t.color
1368
1368
  }, t.style), r.style),
1369
- height: s,
1370
- width: s,
1369
+ height: l,
1370
+ width: l,
1371
1371
  xmlns: "http://www.w3.org/2000/svg"
1372
1372
  }), u && z.createElement("title", null, u), r.children);
1373
1373
  };
@@ -1382,7 +1382,7 @@ function yn(r) {
1382
1382
  return ut({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M449.07 399.08L278.64 82.58c-12.08-22.44-44.26-22.44-56.35 0L51.87 399.08A32 32 0 0080 446.25h340.89a32 32 0 0028.18-47.17zm-198.6-1.83a20 20 0 1120-20 20 20 0 01-20 20zm21.72-201.15l-5.74 122a16 16 0 01-32 0l-5.74-121.95a21.73 21.73 0 0121.5-22.69h.21a21.74 21.74 0 0121.73 22.7z" } }] })(r);
1383
1383
  }
1384
1384
  const wn = ({ lspProps: { lastError: r, reload: n } }) => {
1385
- const [t, i] = oe(!1), l = () => {
1385
+ const [t, i] = oe(!1), s = () => {
1386
1386
  n();
1387
1387
  }, u = () => {
1388
1388
  i(!1);
@@ -1399,7 +1399,7 @@ const wn = ({ lspProps: { lastError: r, reload: n } }) => {
1399
1399
  "button",
1400
1400
  {
1401
1401
  className: "text-primary-dark underline",
1402
- onClick: l,
1402
+ onClick: s,
1403
1403
  children: "Reload?"
1404
1404
  }
1405
1405
  )
@@ -1441,20 +1441,193 @@ const wn = ({ lspProps: { lastError: r, reload: n } }) => {
1441
1441
  ]
1442
1442
  };
1443
1443
  }
1444
+ }, In = "#/definitions/Condition", Tn = {
1445
+ Base: {
1446
+ type: "object",
1447
+ properties: {
1448
+ id: {
1449
+ type: "string"
1450
+ },
1451
+ name: {
1452
+ type: "string"
1453
+ }
1454
+ }
1455
+ },
1456
+ Condition: {
1457
+ oneOf: [
1458
+ {
1459
+ $ref: "#/definitions/Datasource"
1460
+ },
1461
+ {
1462
+ $ref: "#/definitions/Privilege"
1463
+ },
1464
+ {
1465
+ $ref: "#/definitions/Combination"
1466
+ },
1467
+ {
1468
+ $ref: "#/definitions/ParentState"
1469
+ },
1470
+ {
1471
+ $ref: "#/definitions/Reference"
1472
+ }
1473
+ ]
1474
+ },
1475
+ Datasource: {
1476
+ allOf: [
1477
+ {
1478
+ $ref: "#/definitions/Base"
1479
+ }
1480
+ ],
1481
+ properties: {
1482
+ type: {
1483
+ const: "datasource"
1484
+ },
1485
+ path: {
1486
+ type: "string"
1487
+ },
1488
+ value: {
1489
+ type: [
1490
+ "number",
1491
+ "string",
1492
+ "boolean",
1493
+ "object",
1494
+ "array",
1495
+ "null"
1496
+ ]
1497
+ },
1498
+ valueType: {
1499
+ enum: [
1500
+ "datasource",
1501
+ "hardCoded"
1502
+ ]
1503
+ },
1504
+ op: {
1505
+ enum: [
1506
+ "eq",
1507
+ "neq",
1508
+ "regex",
1509
+ "in",
1510
+ "nin",
1511
+ "gt",
1512
+ "gte",
1513
+ "lt",
1514
+ "lte"
1515
+ ]
1516
+ }
1517
+ }
1518
+ },
1519
+ Privilege: {
1520
+ allOf: [
1521
+ {
1522
+ $ref: "#/definitions/Base"
1523
+ }
1524
+ ],
1525
+ properties: {
1526
+ type: {
1527
+ const: "privilege"
1528
+ },
1529
+ value: {
1530
+ type: "string"
1531
+ },
1532
+ valueType: {
1533
+ enum: [
1534
+ "datasource",
1535
+ "hardCoded"
1536
+ ]
1537
+ },
1538
+ op: {
1539
+ enum: [
1540
+ "eq",
1541
+ "neq",
1542
+ "regex"
1543
+ ]
1544
+ }
1545
+ }
1546
+ },
1547
+ Combination: {
1548
+ allOf: [
1549
+ {
1550
+ $ref: "#/definitions/Base"
1551
+ }
1552
+ ],
1553
+ properties: {
1554
+ type: {
1555
+ const: "combination"
1556
+ },
1557
+ op: {
1558
+ enum: [
1559
+ "and",
1560
+ "or"
1561
+ ]
1562
+ },
1563
+ conditions: {
1564
+ type: "array",
1565
+ items: {
1566
+ $ref: "#/definitions/Condition"
1567
+ }
1568
+ }
1569
+ }
1570
+ },
1571
+ ParentState: {
1572
+ allOf: [
1573
+ {
1574
+ $ref: "#/definitions/Base"
1575
+ }
1576
+ ],
1577
+ properties: {
1578
+ type: {
1579
+ const: "parentState"
1580
+ },
1581
+ value: {
1582
+ type: "string"
1583
+ },
1584
+ valueType: {
1585
+ enum: [
1586
+ "datasource",
1587
+ "hardCoded"
1588
+ ]
1589
+ },
1590
+ op: {
1591
+ enum: [
1592
+ "eq",
1593
+ "neq",
1594
+ "regex"
1595
+ ]
1596
+ }
1597
+ }
1598
+ },
1599
+ Reference: {
1600
+ allOf: [
1601
+ {
1602
+ $ref: "#/definitions/Base"
1603
+ }
1604
+ ],
1605
+ properties: {
1606
+ type: {
1607
+ const: "reference"
1608
+ },
1609
+ ref: {
1610
+ type: "string"
1611
+ }
1612
+ }
1613
+ }
1614
+ }, On = {
1615
+ $ref: In,
1616
+ definitions: Tn
1444
1617
  };
1445
- function In(r, n) {
1618
+ function Nn(r, n) {
1446
1619
  const t = document.createElement("style");
1447
1620
  t.dataset.id = n, t.textContent = r, document.head.append(t);
1448
1621
  }
1449
- function Tn(r) {
1622
+ function Pn(r) {
1450
1623
  return Array.from(document.styleSheets).find(
1451
1624
  (n) => n.ownerNode.getAttribute("data-id") === r
1452
1625
  );
1453
1626
  }
1454
- function Nn(r, n) {
1627
+ function jn(r, n) {
1455
1628
  const t = [];
1456
1629
  let i = [];
1457
- const l = [], u = (g, p, M, F) => {
1630
+ const s = [], u = (g, p, M, F) => {
1458
1631
  t.push({
1459
1632
  startLineNumber: g,
1460
1633
  endLineNumber: M,
@@ -1462,12 +1635,12 @@ function Nn(r, n) {
1462
1635
  endColumn: F
1463
1636
  }), h(), d();
1464
1637
  }, f = (g) => {
1465
- l.indexOf(g) < 0 && l.push(g);
1466
- }, s = (g) => {
1467
- const p = l.indexOf(g);
1468
- p < 0 || l.splice(p, 1);
1638
+ s.indexOf(g) < 0 && s.push(g);
1639
+ }, l = (g) => {
1640
+ const p = s.indexOf(g);
1641
+ p < 0 || s.splice(p, 1);
1469
1642
  }, d = () => {
1470
- for (const g of l)
1643
+ for (const g of s)
1471
1644
  try {
1472
1645
  g(i);
1473
1646
  } catch (p) {
@@ -1475,7 +1648,7 @@ function Nn(r, n) {
1475
1648
  }
1476
1649
  }, h = () => {
1477
1650
  const g = r.getModel();
1478
- g && (i = Pn(
1651
+ g && (i = An(
1479
1652
  t.map((p) => [
1480
1653
  g.getOffsetAt({
1481
1654
  lineNumber: p.startLineNumber,
@@ -1497,25 +1670,25 @@ function Nn(r, n) {
1497
1670
  };
1498
1671
  return g.text === "" ? p.isDeletion = !0 : g.range.startLineNumber === g.range.endLineNumber && g.range.startColumn === g.range.endColumn ? p.isAddition = !0 : p.isReplacement = !0, p;
1499
1672
  }, S = r.onDidChangeModel((g) => {
1500
- h(), R();
1673
+ h(), E();
1501
1674
  }), v = r.onDidChangeModelContent((g) => {
1502
1675
  if (!g.isUndoing)
1503
1676
  for (const p of g.changes) {
1504
1677
  const M = b(p);
1505
1678
  if (M.isReplacement || M.isDeletion || M.isAddition) {
1506
1679
  const F = t.some(
1507
- (Y) => p.range.startLineNumber >= Y.startLineNumber && p.range.endLineNumber <= Y.endLineNumber && p.range.startColumn >= Y.startColumn && p.range.endColumn <= Y.endColumn
1680
+ (q) => p.range.startLineNumber >= q.startLineNumber && p.range.endLineNumber <= q.endLineNumber && p.range.startColumn >= q.startColumn && p.range.endColumn <= q.endColumn
1508
1681
  ), A = !F && n && p.range.startLineNumber === 1 && p.range.startColumn === 1 && !tt(p.text);
1509
1682
  if (F || A) {
1510
- const Y = r.getModel();
1511
- if (Y) {
1512
- Y.undo();
1683
+ const q = r.getModel();
1684
+ if (q) {
1685
+ q.undo();
1513
1686
  return;
1514
1687
  }
1515
1688
  }
1516
1689
  }
1517
1690
  }
1518
- }), O = () => {
1691
+ }), N = () => {
1519
1692
  S.dispose(), v.dispose();
1520
1693
  };
1521
1694
  let k = [], P = `
@@ -1526,13 +1699,13 @@ function Nn(r, n) {
1526
1699
  `;
1527
1700
  if (P) {
1528
1701
  const g = "monaco-read-only";
1529
- Tn(g) || In(P, g), P = null;
1702
+ Pn(g) || Nn(P, g), P = null;
1530
1703
  }
1531
1704
  const $ = () => {
1532
- f(R), R();
1705
+ f(E), E();
1533
1706
  }, _ = () => {
1534
- s(R), k = r.deltaDecorations(k, []);
1535
- }, R = () => {
1707
+ l(E), k = r.deltaDecorations(k, []);
1708
+ }, E = () => {
1536
1709
  const g = r.getModel();
1537
1710
  g && (k = r.deltaDecorations(
1538
1711
  k,
@@ -1558,27 +1731,27 @@ function Nn(r, n) {
1558
1731
  },
1559
1732
  exclude: u,
1560
1733
  attach: f,
1561
- detach: s,
1562
- dispose: O,
1734
+ detach: l,
1735
+ dispose: N,
1563
1736
  show: $,
1564
1737
  hide: _
1565
1738
  };
1566
1739
  }
1567
- function On(r, n, t) {
1740
+ function kn(r, n, t) {
1568
1741
  let i = !1;
1569
- const l = (_) => _[1] < _[0] ? (i = !0, [[_[1], _[0]]]) : [[..._]], u = (_) => i ? _.map((R) => R[1] > R[0] ? s(R) : R).reverse() : _;
1742
+ const s = (_) => _[1] < _[0] ? (i = !0, [[_[1], _[0]]]) : [[..._]], u = (_) => i ? _.map((E) => E[1] > E[0] ? l(E) : E).reverse() : _;
1570
1743
  let f;
1571
- const s = (_) => (f = _[1], _[1] = _[0], _[0] = f, _), d = l(r);
1572
- let h, b, S, v, O, k, P, $;
1744
+ const l = (_) => (f = _[1], _[1] = _[0], _[0] = f, _), d = s(r);
1745
+ let h, b, S, v, N, k, P, $;
1573
1746
  S = d[0];
1574
1747
  for (b of n)
1575
1748
  for (P = b[0], $ = b[1], v = 0; v < d.length; v++) {
1576
- if (S = d[v], O = S[0], k = S[1], O < P)
1577
- k < P ? h = [S] : k <= $ ? h = [[O, P - 1]] : h = [
1578
- [O, P - 1],
1749
+ if (S = d[v], N = S[0], k = S[1], N < P)
1750
+ k < P ? h = [S] : k <= $ ? h = [[N, P - 1]] : h = [
1751
+ [N, P - 1],
1579
1752
  [$ + 1, k]
1580
1753
  ];
1581
- else if (O <= $)
1754
+ else if (N <= $)
1582
1755
  if (P === Number.NEGATIVE_INFINITY) {
1583
1756
  const _ = $ + 1;
1584
1757
  h = t === 0 ? [] : [[_, k > _ ? k : _]];
@@ -1591,14 +1764,14 @@ function On(r, n, t) {
1591
1764
  }
1592
1765
  return u(d);
1593
1766
  }
1594
- function Pn(r, n) {
1767
+ function An(r, n) {
1595
1768
  if (r.length < 2)
1596
1769
  return r;
1597
1770
  const t = [];
1598
- let i = null, l, u;
1771
+ let i = null, s, u;
1599
1772
  r = r.map(
1600
- (f) => (f[1] < f[0] && (l = f[1], f[1] = f[0], f[1] = l), f)
1601
- ).sort((f, s) => f[0] - s[0]), t.push(r[0]);
1773
+ (f) => (f[1] < f[0] && (s = f[1], f[1] = f[0], f[1] = s), f)
1774
+ ).sort((f, l) => f[0] - l[0]), t.push(r[0]);
1602
1775
  for (let f = 1; f < r.length; f++)
1603
1776
  i = t[t.length - 1], u = r[f], i[1] === u[0] && !n ? t.push(u) : i[1] === u[0] - 1 && n ? (i[1] = u[1], t.splice(t.length - 1, 1, i)) : i[1] < u[0] ? t.push(u) : i[1] < u[1] && (i[1] = u[1], t.splice(t.length - 1, 1, i));
1604
1777
  return t;
@@ -1606,20 +1779,20 @@ function Pn(r, n) {
1606
1779
  function ie(r, n) {
1607
1780
  return n.bind(r);
1608
1781
  }
1609
- class jn {
1782
+ class Dn {
1610
1783
  constructor(n, t) {
1611
- U(this, "editor");
1612
- U(this, "intervals");
1613
- U(this, "disposables", []);
1784
+ Y(this, "editor");
1785
+ Y(this, "intervals");
1786
+ Y(this, "disposables", []);
1614
1787
  /**
1615
1788
  * Flag for `excludeIntervals`
1616
1789
  */
1617
- U(this, "prefer", 1);
1618
- U(this, "lastPrefer", 1);
1790
+ Y(this, "prefer", 1);
1791
+ Y(this, "lastPrefer", 1);
1619
1792
  /**
1620
1793
  * Linked to ICodeEditor.onDidChangeCursorPosition event.
1621
1794
  */
1622
- U(this, "onCursor", ie(
1795
+ Y(this, "onCursor", ie(
1623
1796
  this,
1624
1797
  function(n) {
1625
1798
  if (n.source === "api")
@@ -1628,16 +1801,16 @@ class jn {
1628
1801
  t.length !== 0 && this.editor.setSelections(t);
1629
1802
  }
1630
1803
  ));
1631
- U(this, "onRectangleSelectionStart", ie(this, function({ event: n }) {
1804
+ Y(this, "onRectangleSelectionStart", ie(this, function({ event: n }) {
1632
1805
  n.middleButton && (this.lastPrefer = this.prefer, this.prefer = 0, window.addEventListener("pointerup", this.onRectangleSelectionStop));
1633
1806
  }));
1634
- U(this, "onRectangleSelectionStop", ie(this, function() {
1807
+ Y(this, "onRectangleSelectionStop", ie(this, function() {
1635
1808
  this.prefer = this.lastPrefer, window.removeEventListener("pointerup", this.onRectangleSelectionStop);
1636
1809
  }));
1637
1810
  /**
1638
1811
  * Linked to ICodeEditor.onKeyDown event.
1639
1812
  */
1640
- U(this, "onKey", ie(this, function(n) {
1813
+ Y(this, "onKey", ie(this, function(n) {
1641
1814
  const t = n.keyCode, i = c.KeyCode;
1642
1815
  if (n.altKey || i.F1 <= t && t <= i.F19 || n.ctrlKey && t !== i.Backspace)
1643
1816
  return;
@@ -1649,24 +1822,24 @@ class jn {
1649
1822
  this.prefer = 1;
1650
1823
  return;
1651
1824
  }
1652
- const l = this.getSelections(), u = this.intervals.buffer;
1825
+ const s = this.getSelections(), u = this.intervals.buffer;
1653
1826
  let f;
1654
1827
  if (t === i.Delete)
1655
- f = (s) => s[0] === s[1] && u.find((d) => s[1] + 1 === d[0]) != null;
1828
+ f = (l) => l[0] === l[1] && u.find((d) => l[1] + 1 === d[0]) != null;
1656
1829
  else if (t === i.Backspace)
1657
- f = (s) => s[0] === s[1] && u.find((d) => d[1] + 1 === s[0]) != null;
1830
+ f = (l) => l[0] === l[1] && u.find((d) => d[1] + 1 === l[0]) != null;
1658
1831
  else
1659
1832
  return;
1660
- l.findIndex(f) !== -1 && (n.stopPropagation(), n.preventDefault());
1833
+ s.findIndex(f) !== -1 && (n.stopPropagation(), n.preventDefault());
1661
1834
  }));
1662
- U(this, "getOffsetAt", ie(this, function(n) {
1835
+ Y(this, "getOffsetAt", ie(this, function(n) {
1663
1836
  let t;
1664
1837
  for (let i = 0; i < this.intervals.buffer.length; i++)
1665
1838
  if (t = this.intervals.buffer[i], n <= t[1])
1666
1839
  return t[0] - n < n - t[1] ? t[0] : t[1];
1667
1840
  }));
1668
1841
  var i;
1669
- this.editor = n, this.intervals = Nn(n, t), (i = this.editor.getModel()) == null || i.setEOL(c.editor.EndOfLineSequence.LF);
1842
+ this.editor = n, this.intervals = jn(n, t), (i = this.editor.getModel()) == null || i.setEOL(c.editor.EndOfLineSequence.LF);
1670
1843
  }
1671
1844
  enable() {
1672
1845
  this.disposables.push(
@@ -1680,22 +1853,22 @@ class jn {
1680
1853
  n.dispose();
1681
1854
  this.disposables.splice(0);
1682
1855
  }
1683
- exclude(n, t, i, l) {
1684
- arguments.length === 1 ? this.intervals.exclude(n, 0, n, Number.MAX_SAFE_INTEGER) : this.intervals.exclude(n, t, i, l);
1856
+ exclude(n, t, i, s) {
1857
+ arguments.length === 1 ? this.intervals.exclude(n, 0, n, Number.MAX_SAFE_INTEGER) : this.intervals.exclude(n, t, i, s);
1685
1858
  }
1686
1859
  getApprovedSelections() {
1687
1860
  const n = this.editor.getModel();
1688
1861
  return this.getSelections().map(
1689
- (i) => On(
1862
+ (i) => kn(
1690
1863
  i,
1691
1864
  this.intervals.buffer,
1692
1865
  this.prefer
1693
1866
  )
1694
1867
  ).flat().map((i) => {
1695
- const l = n.getPositionAt(i[0]), u = n.getPositionAt(i[1]);
1868
+ const s = n.getPositionAt(i[0]), u = n.getPositionAt(i[1]);
1696
1869
  return new c.Selection(
1697
- l.lineNumber,
1698
- l.column,
1870
+ s.lineNumber,
1871
+ s.column,
1699
1872
  u.lineNumber,
1700
1873
  u.column
1701
1874
  );
@@ -1715,38 +1888,47 @@ class jn {
1715
1888
  ]);
1716
1889
  }
1717
1890
  }
1718
- const kn = new RegExp("^[ s]+(exposed|Function)", "i"), Xe = () => /* @__PURE__ */ j.jsx("div", { className: "absolute inset-0 animate-pulse", children: /* @__PURE__ */ j.jsx("div", { className: "w-full space-y-4 px-4 py-1", children: /* @__PURE__ */ j.jsxs("div", { className: "space-y-2", children: [
1891
+ const Ln = new RegExp("^[ s]+(exposed|Function)", "i"), Xe = () => /* @__PURE__ */ j.jsx("div", { className: "absolute inset-0 animate-pulse", children: /* @__PURE__ */ j.jsx("div", { className: "w-full space-y-4 px-4 py-1", children: /* @__PURE__ */ j.jsxs("div", { className: "space-y-2", children: [
1719
1892
  /* @__PURE__ */ j.jsx("div", { className: "h-3 w-3/4 rounded bg-grey-200" }),
1720
1893
  /* @__PURE__ */ j.jsx("div", { className: "h-3 rounded bg-grey-200" }),
1721
1894
  /* @__PURE__ */ j.jsx("div", { className: "h-3 w-5/6 rounded bg-grey-200" }),
1722
1895
  /* @__PURE__ */ j.jsx("div", { className: "h-3 rounded bg-grey-200" }),
1723
1896
  /* @__PURE__ */ j.jsx("div", { className: "h-3 rounded bg-grey-200" })
1724
- ] }) }) }), Gn = ({
1897
+ ] }) }) }), Hn = ({
1725
1898
  path: r,
1726
1899
  initialValue: n,
1727
1900
  theme: t = "fd-dark",
1728
1901
  type: i,
1729
- language: l,
1902
+ language: s,
1730
1903
  onChange: u,
1731
1904
  options: f = {},
1732
- extra: s = {},
1905
+ extra: l = {},
1733
1906
  showAlerts: d = !1,
1734
1907
  lspProps: h,
1735
1908
  ...b
1736
1909
  }) => {
1737
- const { initialLineInfo: S, initialSelectionInfo: v } = s, { editor: O, setEditor: k } = En(), { inited: P } = h;
1738
- function $(R) {
1739
- l === "css" && R.languages.registerCompletionItemProvider("css", _n);
1910
+ const { initialLineInfo: S, initialSelectionInfo: v } = l, { editor: N, setEditor: k } = En(), { inited: P } = h;
1911
+ function $(E) {
1912
+ s === "css" && E.languages.registerCompletionItemProvider("css", _n), s === "json" && E.languages.json && E.languages.json.jsonDefaults.setDiagnosticsOptions({
1913
+ validate: !0,
1914
+ schemas: [
1915
+ {
1916
+ uri: "condition-schema.json",
1917
+ fileMatch: ["*.condition.json"],
1918
+ schema: On
1919
+ }
1920
+ ]
1921
+ });
1740
1922
  }
1741
- function _(R, y) {
1742
- k(R);
1743
- const g = R.getModel();
1744
- if (g && (g.updateOptions({ insertSpaces: !1 }), R.onKeyUp(() => {
1923
+ function _(E, y) {
1924
+ k(E);
1925
+ const g = E.getModel();
1926
+ if (g && (g.updateOptions({ insertSpaces: !1 }), E.onKeyUp(() => {
1745
1927
  var M;
1746
- const p = (M = R.getPosition()) == null ? void 0 : M.lineNumber;
1928
+ const p = (M = E.getPosition()) == null ? void 0 : M.lineNumber;
1747
1929
  if (p) {
1748
- const F = g.getLineFirstNonWhitespaceColumn(p), A = g.getLineLength(p), Y = g.getLineContent(p);
1749
- kn.test(Y) && R.executeEdits("edit-handler", [
1930
+ const F = g.getLineFirstNonWhitespaceColumn(p), A = g.getLineLength(p), q = g.getLineContent(p);
1931
+ Ln.test(q) && E.executeEdits("edit-handler", [
1750
1932
  {
1751
1933
  range: new y.Range(
1752
1934
  p,
@@ -1754,7 +1936,7 @@ const kn = new RegExp("^[ s]+(exposed|Function)", "i"), Xe = () => /* @__PURE__
1754
1936
  p,
1755
1937
  A
1756
1938
  ),
1757
- text: Y.substr(
1939
+ text: q.substr(
1758
1940
  F - 1,
1759
1941
  A - F
1760
1942
  )
@@ -1762,24 +1944,24 @@ const kn = new RegExp("^[ s]+(exposed|Function)", "i"), Xe = () => /* @__PURE__
1762
1944
  ]);
1763
1945
  }
1764
1946
  })), i === Mt.METHOD && tt(n)) {
1765
- const p = new jn(R, !0);
1947
+ const p = new Dn(E, !0);
1766
1948
  p.exclude(1, 1, 1, Number.POSITIVE_INFINITY), p.enable();
1767
1949
  }
1768
1950
  }
1769
1951
  return J(() => {
1770
- if (!O)
1952
+ if (!N)
1771
1953
  return;
1772
- const { line: R, offset: y } = S || {};
1773
- R && fn(O, R, y);
1774
- }, [S, O]), J(() => {
1775
- if (!O)
1954
+ const { line: E, offset: y } = S || {};
1955
+ E && fn(N, E, y);
1956
+ }, [S, N]), J(() => {
1957
+ if (!N)
1776
1958
  return;
1777
- const { selection: R } = v || {};
1778
- R && cn(O, R);
1779
- }, [v, O]), P ? /* @__PURE__ */ j.jsxs(j.Fragment, { children: [
1959
+ const { selection: E } = v || {};
1960
+ E && cn(N, E);
1961
+ }, [v, N]), P ? /* @__PURE__ */ j.jsxs(j.Fragment, { children: [
1780
1962
  d ? /* @__PURE__ */ j.jsx(wn, { lspProps: h }) : null,
1781
1963
  /* @__PURE__ */ j.jsx(
1782
- Dt,
1964
+ Lt,
1783
1965
  {
1784
1966
  options: {
1785
1967
  readOnly: !0,
@@ -1787,11 +1969,11 @@ const kn = new RegExp("^[ s]+(exposed|Function)", "i"), Xe = () => /* @__PURE__
1787
1969
  "semanticHighlighting.enabled": !0,
1788
1970
  ...f
1789
1971
  },
1790
- path: V(r),
1972
+ path: U(r),
1791
1973
  value: n,
1792
1974
  theme: "fd-dark",
1793
- onChange: (R) => u && u(R || ""),
1794
- language: l,
1975
+ onChange: (E) => u && u(E || ""),
1976
+ language: s,
1795
1977
  beforeMount: $,
1796
1978
  onMount: _,
1797
1979
  loading: /* @__PURE__ */ j.jsx(Xe, {}),
@@ -1802,15 +1984,15 @@ const kn = new RegExp("^[ s]+(exposed|Function)", "i"), Xe = () => /* @__PURE__
1802
1984
  };
1803
1985
  export {
1804
1986
  wn as Alerts,
1805
- Gn as CodeEditor,
1806
- zn as CodeEditorProvider,
1807
- qn as LSPProvider,
1987
+ Hn as CodeEditor,
1988
+ Jn as CodeEditorProvider,
1989
+ Gn as LSPProvider,
1808
1990
  it as _await,
1809
- V as getFileSystemPath,
1810
- Vn as getFunctionOffset,
1991
+ U as getFileSystemPath,
1992
+ zn as getFunctionOffset,
1811
1993
  fn as jumpToLine,
1812
1994
  cn as jumpToSelection,
1813
1995
  En as useCodeEditor,
1814
- Bn as useLSP
1996
+ Zn as useLSP
1815
1997
  };
1816
1998
  //# sourceMappingURL=index.es.js.map