@ws-ui/code-editor 0.2.23 → 0.2.25

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,25 +1,25 @@
1
- var ve = Object.defineProperty;
2
- var Se = (n, e, t) => e in n ? ve(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
- var F = (n, e, t) => (Se(n, typeof e != "symbol" ? e + "" : e, t), t);
4
- import { jsxs as D, jsx as x, Fragment as ye } from "react/jsx-runtime";
5
- import E, { useEffect as J, createContext as oe, useState as z, useRef as te, useContext as re, memo as Ne } from "react";
6
- import { loader as xe, useMonaco as Re, Editor as we } from "@monaco-editor/react";
7
- import { lspSubject as ke, LspActions as X, hasAttributesString as se, HTTP_HANDLERS_PATH as Le, FileFolderType as We } from "@ws-ui/shared";
8
- import { MonacoLanguageClient as Fe } from "monaco-languageclient";
9
- import { mergeServices as Ze, initServices as je } from "monaco-languageclient/vscode/services";
10
- import Xe, { initUserConfiguration as Ke } from "@codingame/monaco-vscode-configuration-service-override";
1
+ var Se = Object.defineProperty;
2
+ var ye = (n, e, t) => e in n ? Se(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
+ var F = (n, e, t) => (ye(n, typeof e != "symbol" ? e + "" : e, t), t);
4
+ import { jsxs as J, jsx as w, Fragment as Ne } from "react/jsx-runtime";
5
+ import T, { useEffect as M, createContext as re, useState as _, useRef as ne, useContext as se, memo as Re } from "react";
6
+ import { loader as xe, useMonaco as we, Editor as ke } from "@monaco-editor/react";
7
+ import { lspSubject as Le, LspActions as X, hasAttributesString as le, HTTP_HANDLERS_PATH as We, FileFolderType as Fe } from "@ws-ui/shared";
8
+ import { MonacoLanguageClient as Ze } from "monaco-languageclient";
9
+ import { mergeServices as je, initServices as Xe } from "monaco-languageclient/vscode/services";
10
+ import Ee, { initUserConfiguration as Ke } from "@codingame/monaco-vscode-configuration-service-override";
11
11
  import Be from "@codingame/monaco-vscode-languages-service-override";
12
- import Ee from "@codingame/monaco-vscode-textmate-service-override";
12
+ import Te from "@codingame/monaco-vscode-textmate-service-override";
13
13
  import "@codingame/monaco-vscode-theme-defaults-default-extension";
14
- import Te from "@codingame/monaco-vscode-editor-service-override";
15
- import Oe from "@codingame/monaco-vscode-theme-service-override";
16
- import * as l from "monaco-editor";
17
- import { Selection as Ge, KeyMod as O, KeyCode as G, editor as le, Range as De, Uri as Je, CancellationTokenSource as Me } from "monaco-editor";
14
+ import Oe from "@codingame/monaco-vscode-editor-service-override";
15
+ import De from "@codingame/monaco-vscode-theme-service-override";
16
+ import * as s from "monaco-editor";
17
+ import { Selection as Ge, KeyMod as D, KeyCode as G, editor as ae, Range as Je, Uri as Me, CancellationTokenSource as Pe } from "monaco-editor";
18
18
  import { Logger as Ve } from "monaco-languageclient/tools";
19
- import { ErrorAction as Pe, CloseAction as Ye } from "vscode-languageclient";
20
- import { WebSocketMessageReader as He, WebSocketMessageWriter as ze, toSocket as _e } from "vscode-ws-jsonrpc";
21
- import { DocumentDiagnosticRequest as $e, WillSaveTextDocumentNotification as Ue, TextDocumentSaveReason as qe, DidSaveTextDocumentNotification as Qe, WillCreateFilesRequest as et, WillRenameFilesRequest as tt, WillDeleteFilesRequest as nt, DidCreateFilesNotification as it, DidRenameFilesNotification as ot, DidDeleteFilesNotification as rt, SemanticTokensRegistrationType as st } from "vscode-languageserver-protocol";
22
- import { StandaloneServices as lt, ICodeEditorService as at } from "vscode/services";
19
+ import { ErrorAction as Ye, CloseAction as He } from "vscode-languageclient";
20
+ import { WebSocketMessageReader as ze, WebSocketMessageWriter as _e, toSocket as $e } from "vscode-ws-jsonrpc";
21
+ import { DocumentDiagnosticRequest as Ue, WillSaveTextDocumentNotification as qe, TextDocumentSaveReason as Qe, DidSaveTextDocumentNotification as et, WillCreateFilesRequest as tt, WillRenameFilesRequest as nt, WillDeleteFilesRequest as it, DidCreateFilesNotification as ot, DidRenameFilesNotification as rt, DidDeleteFilesNotification as st, SemanticTokensRegistrationType as lt } from "vscode-languageserver-protocol";
22
+ import { StandaloneServices as at, ICodeEditorService as gt } from "vscode/services";
23
23
  import { KeybindingsRegistry as q } from "vscode/monaco";
24
24
  import "@codingame/monaco-vscode-standalone-languages";
25
25
  import "@codingame/monaco-vscode-standalone-html-language-features";
@@ -30,14 +30,14 @@ import "@codingame/monaco-vscode-css-default-extension";
30
30
  import "@codingame/monaco-vscode-json-default-extension";
31
31
  import "@codingame/monaco-vscode-html-default-extension";
32
32
  import "@codingame/monaco-vscode-javascript-default-extension";
33
- import { registerExtension as gt } from "vscode/extensions";
34
- const ct = () => Xe(), ut = () => Te(
33
+ import { registerExtension as ct } from "vscode/extensions";
34
+ const ut = () => Ee(), dt = () => Oe(
35
35
  () => Promise.resolve(void 0)
36
- ), dt = () => {
37
- const n = Oe(), e = n.themeService.ctor.prototype;
36
+ ), It = () => {
37
+ const n = De(), e = n.themeService.ctor.prototype;
38
38
  return e.defineTheme = () => {
39
39
  }, n;
40
- }, It = `{
40
+ }, Ct = `{
41
41
  "workbench.colorTheme": "Default Dark+",
42
42
  "workbench.iconTheme": "vs-seti",
43
43
  "editor.autoClosingBrackets": "languageDefined",
@@ -122,31 +122,31 @@ const ct = () => Xe(), ut = () => Te(
122
122
  }
123
123
  }
124
124
  }
125
- `, Ct = () => Ke(It), mt = async (n) => {
125
+ `, mt = () => Ke(Ct), ft = async (n) => {
126
126
  var o;
127
127
  const e = n.serviceConfig ?? {};
128
- e.debugLogging = ((o = n.logger) == null ? void 0 : o.isEnabled()) === !0 && (e.debugLogging === !0 || n.logger.isDebugEnabled() === !0), await Ct(), e.userServices = e.userServices ?? {};
128
+ e.debugLogging = ((o = n.logger) == null ? void 0 : o.isEnabled()) === !0 && (e.debugLogging === !0 || n.logger.isDebugEnabled() === !0), await mt(), e.userServices = e.userServices ?? {};
129
129
  const t = e.userServices.configurationService ?? void 0, i = e.workspaceConfig ?? void 0;
130
130
  if (t === void 0) {
131
131
  if (i)
132
132
  throw new Error(
133
133
  "You provided a workspaceConfig without using the configurationServiceOverride"
134
134
  );
135
- const a = {
135
+ const l = {
136
136
  // @see https://github.com/CodinGame/monaco-vscode-api#monaco-standalone-services
137
- ...ct(),
138
- ...dt(),
139
- ...Ee(),
137
+ ...ut(),
138
+ ...It(),
139
+ ...Te(),
140
140
  ...Be(),
141
- ...ut()
141
+ ...dt()
142
142
  };
143
- Ze(a, e.userServices);
143
+ je(l, e.userServices);
144
144
  }
145
145
  return i || (e.workspaceConfig = {
146
146
  workspaceProvider: {
147
147
  trusted: !0,
148
148
  workspace: {
149
- workspaceUri: l.Uri.file("/workspace")
149
+ workspaceUri: s.Uri.file("/workspace")
150
150
  },
151
151
  async open() {
152
152
  return !1;
@@ -154,7 +154,7 @@ const ct = () => Xe(), ut = () => Te(
154
154
  }
155
155
  }), e;
156
156
  };
157
- class ft extends He {
157
+ class At extends ze {
158
158
  constructor(t, i) {
159
159
  super(t);
160
160
  F(this, "onMessage");
@@ -173,7 +173,7 @@ class ft extends He {
173
173
  }
174
174
  }
175
175
  }
176
- class At extends ze {
176
+ class pt extends _e {
177
177
  constructor(t, i) {
178
178
  super(t);
179
179
  F(this, "onSend");
@@ -192,30 +192,30 @@ function j(n, e = !0) {
192
192
  const t = `/PACKAGE/Project/Sources/${n}`;
193
193
  return e ? `file://${t}` : t;
194
194
  }
195
- function ae(n, e = 0) {
195
+ function ge(n, e = 0) {
196
196
  setTimeout(n, e);
197
197
  }
198
- function pt(n, e) {
198
+ function bt(n, e) {
199
199
  const t = new Ge(
200
200
  e.startLineNumber,
201
201
  e.startColumn,
202
202
  e.endLineNumber || e.startLineNumber,
203
203
  e.endColumn || e.startColumn
204
204
  );
205
- ae(() => {
205
+ ge(() => {
206
206
  n.setSelection(t), n.revealRangeInCenter(t), n.focus();
207
207
  });
208
208
  }
209
- function bt(n, e, t = 0) {
210
- t > 0 && (e = t + e), ae(() => {
209
+ function ht(n, e, t = 0) {
210
+ t > 0 && (e = t + e), ge(() => {
211
211
  n.setPosition({ lineNumber: e, column: 1 }), n.revealLineInCenter(e), n.focus();
212
212
  });
213
213
  }
214
- function Rn(n, e, t) {
214
+ function wn(n, e, t) {
215
215
  const o = n.getModel();
216
216
  if (o && e) {
217
- const a = o.getLineCount();
218
- for (let r = 1; r <= a; r++) {
217
+ const l = o.getLineCount();
218
+ for (let r = 1; r <= l; r++) {
219
219
  const I = o.getLineContent(r);
220
220
  if (new RegExp(`(?:Function|function) ${t}`).test(I))
221
221
  return r;
@@ -223,15 +223,15 @@ function Rn(n, e, t) {
223
223
  }
224
224
  return 0;
225
225
  }
226
- const ht = {
226
+ const vt = {
227
227
  provideCompletionItems: async (n, e) => {
228
228
  const t = n.getWordUntilPosition(e);
229
229
  return {
230
230
  suggestions: [
231
231
  {
232
232
  label: "var",
233
- kind: l.languages.CompletionItemKind.Snippet,
234
- range: new l.Range(
233
+ kind: s.languages.CompletionItemKind.Snippet,
234
+ range: new s.Range(
235
235
  e.lineNumber,
236
236
  t.startColumn,
237
237
  e.lineNumber,
@@ -239,12 +239,12 @@ const ht = {
239
239
  ),
240
240
  insertText: ["var ${1:var_name} : ${2:var_type}"].join(`
241
241
  `),
242
- insertTextRules: l.languages.CompletionItemInsertTextRule.InsertAsSnippet
242
+ insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
243
243
  },
244
244
  {
245
245
  label: "While",
246
- kind: l.languages.CompletionItemKind.Snippet,
247
- range: new l.Range(
246
+ kind: s.languages.CompletionItemKind.Snippet,
247
+ range: new s.Range(
248
248
  e.lineNumber,
249
249
  t.startColumn,
250
250
  e.lineNumber,
@@ -256,12 +256,12 @@ const ht = {
256
256
  "End while"
257
257
  ].join(`
258
258
  `),
259
- insertTextRules: l.languages.CompletionItemInsertTextRule.InsertAsSnippet
259
+ insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
260
260
  },
261
261
  {
262
262
  label: "Case of",
263
- kind: l.languages.CompletionItemKind.Snippet,
264
- range: new l.Range(
263
+ kind: s.languages.CompletionItemKind.Snippet,
264
+ range: new s.Range(
265
265
  e.lineNumber,
266
266
  t.startColumn,
267
267
  e.lineNumber,
@@ -274,12 +274,12 @@ const ht = {
274
274
  "End case"
275
275
  ].join(`
276
276
  `),
277
- insertTextRules: l.languages.CompletionItemInsertTextRule.InsertAsSnippet
277
+ insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
278
278
  },
279
279
  {
280
280
  label: "Else",
281
- kind: l.languages.CompletionItemKind.Snippet,
282
- range: new l.Range(
281
+ kind: s.languages.CompletionItemKind.Snippet,
282
+ range: new s.Range(
283
283
  e.lineNumber,
284
284
  t.startColumn,
285
285
  e.lineNumber,
@@ -287,12 +287,12 @@ const ht = {
287
287
  ),
288
288
  insertText: ["Else", " "].join(`
289
289
  `),
290
- insertTextRules: l.languages.CompletionItemInsertTextRule.InsertAsSnippet
290
+ insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
291
291
  },
292
292
  {
293
293
  label: "If",
294
- kind: l.languages.CompletionItemKind.Snippet,
295
- range: new l.Range(
294
+ kind: s.languages.CompletionItemKind.Snippet,
295
+ range: new s.Range(
296
296
  e.lineNumber,
297
297
  t.startColumn,
298
298
  e.lineNumber,
@@ -302,12 +302,12 @@ const ht = {
302
302
  `
303
303
  `
304
304
  ),
305
- insertTextRules: l.languages.CompletionItemInsertTextRule.InsertAsSnippet
305
+ insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
306
306
  },
307
307
  {
308
308
  label: "For",
309
- kind: l.languages.CompletionItemKind.Snippet,
310
- range: new l.Range(
309
+ kind: s.languages.CompletionItemKind.Snippet,
310
+ range: new s.Range(
311
311
  e.lineNumber,
312
312
  t.startColumn,
313
313
  e.lineNumber,
@@ -319,12 +319,12 @@ const ht = {
319
319
  "End for"
320
320
  ].join(`
321
321
  `),
322
- insertTextRules: l.languages.CompletionItemInsertTextRule.InsertAsSnippet
322
+ insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
323
323
  },
324
324
  {
325
325
  label: "Function",
326
- kind: l.languages.CompletionItemKind.Snippet,
327
- range: new l.Range(
326
+ kind: s.languages.CompletionItemKind.Snippet,
327
+ range: new s.Range(
328
328
  e.lineNumber,
329
329
  t.startColumn,
330
330
  e.lineNumber,
@@ -335,20 +335,20 @@ const ht = {
335
335
  " ${5:body}"
336
336
  ].join(`
337
337
  `),
338
- insertTextRules: l.languages.CompletionItemInsertTextRule.InsertAsSnippet
338
+ insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
339
339
  }
340
340
  ]
341
341
  };
342
342
  }
343
- }, vt = {
343
+ }, St = {
344
344
  provideCompletionItems: async (n, e) => {
345
345
  const t = n.getWordUntilPosition(e);
346
346
  return {
347
347
  suggestions: [
348
348
  {
349
349
  label: "var",
350
- kind: l.languages.CompletionItemKind.Snippet,
351
- range: new l.Range(
350
+ kind: s.languages.CompletionItemKind.Snippet,
351
+ range: new s.Range(
352
352
  e.lineNumber,
353
353
  t.startColumn,
354
354
  e.lineNumber,
@@ -356,12 +356,12 @@ const ht = {
356
356
  ),
357
357
  insertText: ["var ${1:var_name} : ${2:var_type}"].join(`
358
358
  `),
359
- insertTextRules: l.languages.CompletionItemInsertTextRule.InsertAsSnippet
359
+ insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
360
360
  },
361
361
  {
362
362
  label: "while",
363
- kind: l.languages.CompletionItemKind.Snippet,
364
- range: new l.Range(
363
+ kind: s.languages.CompletionItemKind.Snippet,
364
+ range: new s.Range(
365
365
  e.lineNumber,
366
366
  t.startColumn,
367
367
  e.lineNumber,
@@ -371,12 +371,12 @@ const ht = {
371
371
  `
372
372
  `
373
373
  ),
374
- insertTextRules: l.languages.CompletionItemInsertTextRule.InsertAsSnippet
374
+ insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
375
375
  },
376
376
  {
377
377
  label: "switch",
378
- kind: l.languages.CompletionItemKind.Snippet,
379
- range: new l.Range(
378
+ kind: s.languages.CompletionItemKind.Snippet,
379
+ range: new s.Range(
380
380
  e.lineNumber,
381
381
  t.startColumn,
382
382
  e.lineNumber,
@@ -389,12 +389,12 @@ const ht = {
389
389
  "end"
390
390
  ].join(`
391
391
  `),
392
- insertTextRules: l.languages.CompletionItemInsertTextRule.InsertAsSnippet
392
+ insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
393
393
  },
394
394
  {
395
395
  label: "else",
396
- kind: l.languages.CompletionItemKind.Snippet,
397
- range: new l.Range(
396
+ kind: s.languages.CompletionItemKind.Snippet,
397
+ range: new s.Range(
398
398
  e.lineNumber,
399
399
  t.startColumn,
400
400
  e.lineNumber,
@@ -402,12 +402,12 @@ const ht = {
402
402
  ),
403
403
  insertText: ["else", " "].join(`
404
404
  `),
405
- insertTextRules: l.languages.CompletionItemInsertTextRule.InsertAsSnippet
405
+ insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
406
406
  },
407
407
  {
408
408
  label: "if",
409
- kind: l.languages.CompletionItemKind.Snippet,
410
- range: new l.Range(
409
+ kind: s.languages.CompletionItemKind.Snippet,
410
+ range: new s.Range(
411
411
  e.lineNumber,
412
412
  t.startColumn,
413
413
  e.lineNumber,
@@ -417,12 +417,12 @@ const ht = {
417
417
  `
418
418
  `
419
419
  ),
420
- insertTextRules: l.languages.CompletionItemInsertTextRule.InsertAsSnippet
420
+ insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
421
421
  },
422
422
  {
423
423
  label: "for",
424
- kind: l.languages.CompletionItemKind.Snippet,
425
- range: new l.Range(
424
+ kind: s.languages.CompletionItemKind.Snippet,
425
+ range: new s.Range(
426
426
  e.lineNumber,
427
427
  t.startColumn,
428
428
  e.lineNumber,
@@ -434,12 +434,12 @@ const ht = {
434
434
  "end"
435
435
  ].join(`
436
436
  `),
437
- insertTextRules: l.languages.CompletionItemInsertTextRule.InsertAsSnippet
437
+ insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
438
438
  },
439
439
  {
440
440
  label: "function",
441
- kind: l.languages.CompletionItemKind.Snippet,
442
- range: new l.Range(
441
+ kind: s.languages.CompletionItemKind.Snippet,
442
+ range: new s.Range(
443
443
  e.lineNumber,
444
444
  t.startColumn,
445
445
  e.lineNumber,
@@ -450,50 +450,50 @@ const ht = {
450
450
  " ${5:body}"
451
451
  ].join(`
452
452
  `),
453
- insertTextRules: l.languages.CompletionItemInsertTextRule.InsertAsSnippet
453
+ insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
454
454
  }
455
455
  ]
456
456
  };
457
457
  }
458
- }, St = [
458
+ }, yt = [
459
459
  // zoom in
460
460
  {
461
- keybinding: O.CtrlCmd | G.NumpadAdd,
461
+ keybinding: D.CtrlCmd | G.NumpadAdd,
462
462
  command: "editor.action.fontZoomIn"
463
463
  },
464
464
  {
465
- keybinding: O.CtrlCmd | G.Equal,
465
+ keybinding: D.CtrlCmd | G.Equal,
466
466
  command: "editor.action.fontZoomIn"
467
467
  },
468
468
  // zoom out
469
469
  {
470
- keybinding: O.CtrlCmd | G.NumpadSubtract,
470
+ keybinding: D.CtrlCmd | G.NumpadSubtract,
471
471
  command: "editor.action.fontZoomOut"
472
472
  },
473
473
  {
474
- keybinding: O.CtrlCmd | G.Minus,
474
+ keybinding: D.CtrlCmd | G.Minus,
475
475
  command: "editor.action.fontZoomOut"
476
476
  },
477
477
  // zoom reset
478
478
  {
479
- keybinding: O.CtrlCmd | G.Numpad0,
479
+ keybinding: D.CtrlCmd | G.Numpad0,
480
480
  command: "editor.action.fontZoomReset"
481
481
  },
482
482
  {
483
- keybinding: O.CtrlCmd | G.Digit0,
483
+ keybinding: D.CtrlCmd | G.Digit0,
484
484
  command: "editor.action.fontZoomReset"
485
485
  }
486
- ], yt = ({ defaultZoom: n }) => (J(() => {
487
- n !== void 0 && le.EditorZoom.setZoomLevel(n);
486
+ ], Nt = ({ defaultZoom: n }) => (M(() => {
487
+ n !== void 0 && ae.EditorZoom.setZoomLevel(n);
488
488
  }, []), null);
489
489
  ({}).VITE_DISABLE_MONACO_LOADER || xe.config({
490
- monaco: l
490
+ monaco: s
491
491
  // paths: {
492
492
  // vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.41.0/min/vs",
493
493
  // },
494
494
  });
495
- var H = /* @__PURE__ */ ((n) => (n[n.NotSet = -1] = "NotSet", n[n.None = 0] = "None", n[n.Italic = 1] = "Italic", n[n.Bold = 2] = "Bold", n[n.Underline = 4] = "Underline", n[n.Strikethrough = 8] = "Strikethrough", n))(H || {}), ge = /* @__PURE__ */ ((n) => (n[n.None = 0] = "None", n[n.DefaultForeground = 1] = "DefaultForeground", n[n.DefaultBackground = 2] = "DefaultBackground", n))(ge || {}), ce = /* @__PURE__ */ ((n) => (n[n.Other = 0] = "Other", n[n.Comment = 1] = "Comment", n[n.String = 2] = "String", n[n.RegEx = 3] = "RegEx", n))(ce || {});
496
- class P {
495
+ var z = /* @__PURE__ */ ((n) => (n[n.NotSet = -1] = "NotSet", n[n.None = 0] = "None", n[n.Italic = 1] = "Italic", n[n.Bold = 2] = "Bold", n[n.Underline = 4] = "Underline", n[n.Strikethrough = 8] = "Strikethrough", n))(z || {}), ce = /* @__PURE__ */ ((n) => (n[n.None = 0] = "None", n[n.DefaultForeground = 1] = "DefaultForeground", n[n.DefaultBackground = 2] = "DefaultBackground", n))(ce || {}), ue = /* @__PURE__ */ ((n) => (n[n.Other = 0] = "Other", n[n.Comment = 1] = "Comment", n[n.String = 2] = "String", n[n.RegEx = 3] = "RegEx", n))(ue || {});
496
+ class Y {
497
497
  static getLanguageId(e) {
498
498
  return (e & 255) >>> 0;
499
499
  }
@@ -519,10 +519,10 @@ class P {
519
519
  }
520
520
  static getInlineStyleFromMetadata(e, t) {
521
521
  const i = this.getForeground(e), o = this.getFontStyle(e);
522
- let a = `color: ${t[i]};`;
523
- o & 1 && (a += "font-style: italic;"), o & 2 && (a += "font-weight: bold;");
522
+ let l = `color: ${t[i]};`;
523
+ o & 1 && (l += "font-style: italic;"), o & 2 && (l += "font-weight: bold;");
524
524
  let r = "";
525
- return o & 4 && (r += " underline"), o & 8 && (r += " line-through"), r && (a += `text-decoration:${r};`), a;
525
+ return o & 4 && (r += " underline"), o & 8 && (r += " line-through"), r && (l += `text-decoration:${r};`), l;
526
526
  }
527
527
  static getPresentationFromMetadata(e) {
528
528
  const t = this.getForeground(e), i = this.getFontStyle(e);
@@ -535,43 +535,43 @@ class P {
535
535
  };
536
536
  }
537
537
  }
538
- function Nt(n, e, t, i) {
539
- const o = t.tokens.data, a = n.getLanguageId();
538
+ function Rt(n, e, t, i) {
539
+ const o = t.tokens.data, l = n.getLanguageId();
540
540
  let r = 0, I = 0;
541
- const m = i.lineNumber - 1, h = i.column - 1;
542
- for (let v = 0; v < o.length; v += 5) {
543
- const A = o[v], f = o[v + 1], R = o[v + 2], y = o[v + 3], b = o[v + 4], S = r + A, g = A === 0 ? I + f : f;
544
- if (m === S && g <= h && h < g + R) {
545
- const N = t.legend.tokenTypes[y] || "not in legend (ignored)", k = [];
546
- let s = b;
547
- for (let M = 0; s > 0 && M < t.legend.tokenModifiers.length; M++)
548
- s & 1 && k.push(t.legend.tokenModifiers[M]), s = s >> 1;
549
- s > 0 && k.push("not in legend (ignored)");
550
- const C = new De(
551
- S + 1,
552
- g + 1,
553
- S + 1,
554
- g + 1 + R
555
- ), w = {}, L = e.getColorTheme().tokenColorMap, p = e.getColorTheme().getTokenStyleMetadata(
556
- N,
541
+ const C = i.lineNumber - 1, S = i.column - 1;
542
+ for (let y = 0; y < o.length; y += 5) {
543
+ const p = o[y], m = o[y + 1], N = o[y + 2], x = o[y + 3], h = o[y + 4], R = r + p, f = p === 0 ? I + m : m;
544
+ if (C === R && f <= S && S < f + N) {
545
+ const k = t.legend.tokenTypes[x] || "not in legend (ignored)", A = [];
546
+ let a = h;
547
+ for (let P = 0; a > 0 && P < t.legend.tokenModifiers.length; P++)
548
+ a & 1 && A.push(t.legend.tokenModifiers[P]), a = a >> 1;
549
+ a > 0 && A.push("not in legend (ignored)");
550
+ const u = new Je(
551
+ R + 1,
552
+ f + 1,
553
+ R + 1,
554
+ f + 1 + N
555
+ ), v = {}, L = e.getColorTheme().tokenColorMap, b = e.getColorTheme().getTokenStyleMetadata(
557
556
  k,
558
- a,
557
+ A,
558
+ l,
559
559
  !0,
560
- w
560
+ v
561
561
  );
562
- let _;
563
- return p && (_ = {
562
+ let B;
563
+ return b && (B = {
564
564
  languageId: void 0,
565
- tokenType: ce.Other,
566
- bold: p == null ? void 0 : p.bold,
567
- italic: p == null ? void 0 : p.italic,
568
- underline: p == null ? void 0 : p.underline,
569
- strikethrough: p == null ? void 0 : p.strikethrough,
570
- foreground: L[(p == null ? void 0 : p.foreground) || ge.None],
565
+ tokenType: ue.Other,
566
+ bold: b == null ? void 0 : b.bold,
567
+ italic: b == null ? void 0 : b.italic,
568
+ underline: b == null ? void 0 : b.underline,
569
+ strikethrough: b == null ? void 0 : b.strikethrough,
570
+ foreground: L[(b == null ? void 0 : b.foreground) || ce.None],
571
571
  background: void 0
572
- }), { type: N, modifiers: k, range: C, metadata: _, definitions: w };
572
+ }), { type: k, modifiers: A, range: u, metadata: B, definitions: v };
573
573
  }
574
- r = S, I = g;
574
+ r = R, I = f;
575
575
  }
576
576
  return null;
577
577
  }
@@ -584,287 +584,287 @@ function xt(n, e, t) {
584
584
  ).ruleStack;
585
585
  return i;
586
586
  }
587
- function Rt(n, e, t) {
588
- const i = n.getColorTheme().tokenColorMap, o = P.getLanguageId(t), a = P.getTokenType(t), r = P.getFontStyle(t), I = P.getForeground(t), m = P.getBackground(t);
587
+ function wt(n, e, t) {
588
+ const i = n.getColorTheme().tokenColorMap, o = Y.getLanguageId(t), l = Y.getTokenType(t), r = Y.getFontStyle(t), I = Y.getForeground(t), C = Y.getBackground(t);
589
589
  return {
590
590
  languageId: e.languageIdCodec.decodeLanguageId(o),
591
- tokenType: a,
592
- bold: r & H.Bold ? !0 : void 0,
593
- italic: r & H.Italic ? !0 : void 0,
594
- underline: r & H.Underline ? !0 : void 0,
595
- strikethrough: r & H.Strikethrough ? !0 : void 0,
591
+ tokenType: l,
592
+ bold: r & z.Bold ? !0 : void 0,
593
+ italic: r & z.Italic ? !0 : void 0,
594
+ underline: r & z.Underline ? !0 : void 0,
595
+ strikethrough: r & z.Strikethrough ? !0 : void 0,
596
596
  foreground: i[I],
597
- background: i[m]
597
+ background: i[C]
598
598
  };
599
599
  }
600
- function wt(n, e, t) {
601
- const i = t.lineNumber, o = n, a = o._tokenizationTextModelPart.grammarTokens._tokenizer.tokenizationSupport._actual._grammar, r = xt(n, a, i), I = a.tokenizeLine(
600
+ function kt(n, e, t) {
601
+ const i = t.lineNumber, o = n, l = o._tokenizationTextModelPart.grammarTokens._tokenizer.tokenizationSupport._actual._grammar, r = xt(n, l, i), I = l.tokenizeLine(
602
602
  n.getLineContent(i),
603
603
  r
604
- ), m = a.tokenizeLine2(
604
+ ), C = l.tokenizeLine2(
605
605
  n.getLineContent(i),
606
606
  r
607
607
  );
608
- let h = 0;
609
- for (let A = I.tokens.length - 1; A >= 0; A--) {
610
- const f = I.tokens[A];
611
- if (t.column - 1 >= f.startIndex) {
612
- h = A;
608
+ let S = 0;
609
+ for (let p = I.tokens.length - 1; p >= 0; p--) {
610
+ const m = I.tokens[p];
611
+ if (t.column - 1 >= m.startIndex) {
612
+ S = p;
613
613
  break;
614
614
  }
615
615
  }
616
- let v = 0;
617
- for (let A = m.tokens.length >>> 1; A >= 0; A--)
618
- if (t.column - 1 >= m.tokens[A << 1]) {
619
- v = A;
616
+ let y = 0;
617
+ for (let p = C.tokens.length >>> 1; p >= 0; p--)
618
+ if (t.column - 1 >= C.tokens[p << 1]) {
619
+ y = p;
620
620
  break;
621
621
  }
622
622
  return {
623
- token: I.tokens[h],
624
- metadata: Rt(
623
+ token: I.tokens[S],
624
+ metadata: wt(
625
625
  e,
626
626
  o._languageService,
627
- m.tokens[(v << 1) + 1]
627
+ C.tokens[(y << 1) + 1]
628
628
  )
629
629
  };
630
630
  }
631
- const ue = oe(void 0), wn = ({
631
+ const de = re(void 0), kn = ({
632
632
  children: n,
633
633
  url: e,
634
634
  qodly: t,
635
635
  defaultZoom: i,
636
636
  openHandler: o,
637
- language: a = "4d",
637
+ language: l = "4d",
638
638
  defaultInited: r = !1
639
639
  }) => {
640
- const I = Re(), [m, h] = z(r), [v, A] = z(null), f = te(), R = te(0);
641
- J(() => {
642
- e && I && y();
640
+ const I = we(), [C, S] = _(r), [y, p] = _(null), m = ne(), N = ne(0);
641
+ M(() => {
642
+ e && I && x();
643
643
  }, [e, I]);
644
- const y = async () => {
644
+ const x = async () => {
645
645
  if (!I)
646
646
  return;
647
647
  const d = new Ve({
648
648
  enabled: process.env.NODE_ENV === "development",
649
649
  debugEnabled: process.env.NODE_ENV === "development"
650
- }), c = await mt({
650
+ }), g = await ft({
651
651
  logger: d
652
652
  });
653
- await je({
653
+ await Xe({
654
654
  caller: "Qodly Code Editor",
655
655
  logger: d,
656
- serviceConfig: c
657
- }), o && lt.get(at).registerCodeEditorOpenHandler(o), I.languages.registerCompletionItemProvider(
658
- a,
659
- t ? vt : ht
656
+ serviceConfig: g
657
+ }), o && at.get(gt).registerCodeEditorOpenHandler(o), I.languages.registerCompletionItemProvider(
658
+ l,
659
+ t ? St : vt
660
660
  );
661
- const u = q.getDefaultKeybindings.bind(q);
662
- q.getDefaultKeybindings = () => u().filter(
661
+ const c = q.getDefaultKeybindings.bind(q);
662
+ q.getDefaultKeybindings = () => c().filter(
663
663
  (Z) => ![
664
664
  "workbench.action.files.saveAs",
665
665
  "workbench.action.files.save"
666
666
  ].includes(Z.command)
667
- ), le.addKeybindingRules(St), b();
668
- }, b = () => {
669
- A(null);
667
+ ), ae.addKeybindingRules(yt), h();
668
+ }, h = () => {
669
+ p(null);
670
670
  let d;
671
671
  try {
672
672
  d = new WebSocket(localStorage.LSP_SERVER || e);
673
673
  } catch {
674
- A(new Event("INVALID_URL"));
674
+ p(new Event("INVALID_URL"));
675
675
  return;
676
676
  }
677
- d.onopen = S, d.onclose = g, d.onerror = N, R.current = 0;
678
- }, S = async function() {
679
- const d = _e(this), c = new ft(d), u = new At(d), W = new Fe({
677
+ d.onopen = R, d.onclose = f, d.onerror = k, N.current = 0;
678
+ }, R = async function() {
679
+ const d = $e(this), g = new At(d), c = new pt(d), W = new Ze({
680
680
  name: "4D Language Client",
681
681
  clientOptions: {
682
682
  workspaceFolder: {
683
- uri: Je.parse("file:///PACKAGE")
683
+ uri: Me.parse("file:///PACKAGE")
684
684
  },
685
685
  // use a language id as a document selector
686
- documentSelector: [{ scheme: "file", language: a }],
686
+ documentSelector: [{ scheme: "file", language: l }],
687
687
  // disable the default error handler
688
688
  errorHandler: {
689
- error: () => ({ action: Pe.Continue }),
690
- closed: () => ({ action: Ye.DoNotRestart })
689
+ error: () => ({ action: Ye.Continue }),
690
+ closed: () => ({ action: He.DoNotRestart })
691
691
  }
692
692
  },
693
693
  // create a language client connection from the JSON RPC connection on demand
694
694
  connectionProvider: {
695
695
  get: () => Promise.resolve({
696
- reader: c,
697
- writer: u
696
+ reader: g,
697
+ writer: c
698
698
  })
699
699
  }
700
700
  });
701
- f.current = W;
701
+ m.current = W;
702
702
  const Z = W.sendRequest.bind(W);
703
- f.current.sendRequest = function(T, V, U) {
704
- return typeof T == "object" && T.method === "textDocument/diagnostic" && /file:\/\/\/PACKAGE\/Project\/Sources\/Methods\/__Debugger_.*/.test(
703
+ m.current.sendRequest = function(O, V, U) {
704
+ return typeof O == "object" && O.method === "textDocument/diagnostic" && /file:\/\/\/PACKAGE\/Project\/Sources\/Methods\/__Debugger_.*/.test(
705
705
  V.textDocument.uri
706
- ) ? Promise.resolve() : Z(T, V, U);
707
- }, c.onClose(() => {
708
- W.stop(), R.current < 3 ? setTimeout(() => {
709
- R.current++, b();
710
- }, 1e3) : A(new Event("WEBSOCKET_CLOSED"));
711
- }), W.needsStart() && await W.start(), h(!0);
712
- }, g = () => {
713
- }, N = (d) => {
714
- A(d);
706
+ ) ? Promise.resolve() : Z(O, V, U);
707
+ }, g.onClose(() => {
708
+ W.stop(), N.current < 3 ? setTimeout(() => {
709
+ N.current++, h();
710
+ }, 1e3) : p(new Event("WEBSOCKET_CLOSED"));
711
+ }), W.needsStart() && await W.start(), S(!0);
712
+ }, f = () => {
713
+ }, k = (d) => {
714
+ p(d);
715
715
  };
716
- J(() => {
717
- const d = ke.subscribe(({ action: c, payload: u }) => {
718
- switch (c) {
716
+ M(() => {
717
+ const d = Le.subscribe(({ action: g, payload: c }) => {
718
+ switch (g) {
719
719
  case X.WILL_SAVE:
720
- L(u.filePath);
720
+ L(c.filePath);
721
721
  break;
722
722
  case X.DID_SAVE:
723
- B(u.filePath, u.content);
723
+ K(c.filePath, c.content);
724
724
  break;
725
725
  case X.WILL_CREATE:
726
- p(u.filePath);
726
+ b(c.filePath);
727
727
  break;
728
728
  case X.DID_CREATE:
729
- fe(u.filePath);
729
+ Ae(c.filePath);
730
730
  break;
731
731
  case X.WILL_RENAME:
732
- _(u.oldPath, u.newPath);
732
+ B(c.oldPath, c.newPath);
733
733
  break;
734
734
  case X.DID_RENAME:
735
- Ae(u.oldPath, u.newPath);
735
+ pe(c.oldPath, c.newPath);
736
736
  break;
737
737
  case X.WILL_DELETE:
738
- M(u.filePath);
738
+ P(c.filePath);
739
739
  break;
740
740
  case X.DID_DELETE:
741
- pe(u.filePath);
741
+ be(c.filePath);
742
742
  break;
743
743
  case X.DIAGNOSTIC_REFRESH:
744
- w(u.filePath);
744
+ v(c.filePath);
745
745
  break;
746
746
  }
747
747
  });
748
748
  return () => d.unsubscribe();
749
749
  }, []);
750
- const k = (d) => {
751
- var c, u;
752
- return (u = (c = f.current) == null ? void 0 : c._features) == null ? void 0 : u.find(
750
+ const A = (d) => {
751
+ var g, c;
752
+ return (c = (g = m.current) == null ? void 0 : g._features) == null ? void 0 : c.find(
753
753
  (W) => {
754
754
  var Z;
755
755
  return ((Z = W._registrationType) == null ? void 0 : Z.method) === d;
756
756
  }
757
757
  );
758
- }, s = (d) => {
759
- const c = [], u = k(d);
760
- if (u)
761
- for (const [W, Z] of u._registrations)
762
- Z.provider && c.push(Z.provider);
763
- return c;
764
- }, C = async (d, c, u) => {
765
- var Z, T, V;
766
- const W = s(
767
- st.method
758
+ }, a = (d) => {
759
+ const g = [], c = A(d);
760
+ if (c)
761
+ for (const [W, Z] of c._registrations)
762
+ Z.provider && g.push(Z.provider);
763
+ return g;
764
+ }, u = async (d, g, c) => {
765
+ var Z, O, V;
766
+ const W = a(
767
+ lt.method
768
768
  );
769
769
  if (W[0]) {
770
- const U = new Me(), Q = await Promise.resolve(
770
+ const U = new Pe(), ee = await Promise.resolve(
771
771
  W[0].full.provideDocumentSemanticTokens(
772
- c,
772
+ g,
773
773
  U.token
774
774
  )
775
- ), ee = d, be = Q ? Nt(
776
- c,
777
- ee._themeService,
775
+ ), te = d, he = ee ? Rt(
776
+ g,
777
+ te._themeService,
778
778
  {
779
- tokens: Q,
780
- legend: (V = (T = (Z = f.current) == null ? void 0 : Z._capabilities) == null ? void 0 : T.semanticTokensProvider) == null ? void 0 : V.legend
779
+ tokens: ee,
780
+ legend: (V = (O = (Z = m.current) == null ? void 0 : Z._capabilities) == null ? void 0 : O.semanticTokensProvider) == null ? void 0 : V.legend
781
781
  },
782
- u
783
- ) : null, he = wt(
784
- c,
785
- ee._themeService,
786
- u
782
+ c
783
+ ) : null, ve = kt(
784
+ g,
785
+ te._themeService,
786
+ c
787
787
  );
788
788
  return {
789
- semanticTokenInfo: be,
790
- textmateTokenInfo: he
789
+ semanticTokenInfo: he,
790
+ textmateTokenInfo: ve
791
791
  };
792
792
  }
793
793
  return null;
794
- }, w = (d) => {
795
- if (f.current) {
796
- const c = s(
797
- $e.method
794
+ }, v = (d) => {
795
+ if (m.current) {
796
+ const g = a(
797
+ Ue.method
798
798
  );
799
- for (const u of c)
800
- u.onDidChangeDiagnosticsEmitter.fire();
799
+ for (const c of g)
800
+ c.onDidChangeDiagnosticsEmitter.fire();
801
801
  }
802
- }, L = (d, c = qe.Manual) => {
803
- var u;
804
- (u = f.current) == null || u.sendNotification(Ue.type, {
802
+ }, L = (d, g = Qe.Manual) => {
803
+ var c;
804
+ (c = m.current) == null || c.sendNotification(qe.type, {
805
805
  textDocument: {
806
806
  uri: j(d)
807
807
  },
808
- reason: c
808
+ reason: g
809
809
  });
810
- }, B = (d, c) => {
811
- var u;
812
- (u = f.current) == null || u.sendNotification(Qe.type, {
810
+ }, K = (d, g) => {
811
+ var c;
812
+ (c = m.current) == null || c.sendNotification(et.type, {
813
813
  textDocument: {
814
814
  uri: j(d)
815
815
  },
816
- text: c
816
+ text: g
817
817
  });
818
- }, p = (d) => {
819
- var c;
820
- (c = f.current) == null || c.sendRequest(et.type, {
818
+ }, b = (d) => {
819
+ var g;
820
+ (g = m.current) == null || g.sendRequest(tt.type, {
821
821
  files: [
822
822
  {
823
823
  uri: j(d)
824
824
  }
825
825
  ]
826
826
  });
827
- }, _ = (d, c) => {
828
- var u;
829
- (u = f.current) == null || u.sendRequest(tt.type, {
827
+ }, B = (d, g) => {
828
+ var c;
829
+ (c = m.current) == null || c.sendRequest(nt.type, {
830
830
  files: [
831
831
  {
832
832
  oldUri: j(d),
833
- newUri: j(c)
833
+ newUri: j(g)
834
834
  }
835
835
  ]
836
836
  });
837
- }, M = (d) => {
838
- var c;
839
- (c = f.current) == null || c.sendRequest(nt.type, {
837
+ }, P = (d) => {
838
+ var g;
839
+ (g = m.current) == null || g.sendRequest(it.type, {
840
840
  files: [
841
841
  {
842
842
  uri: j(d)
843
843
  }
844
844
  ]
845
845
  });
846
- }, fe = (d) => {
847
- var c;
848
- (c = f.current) == null || c.sendNotification(it.type, {
846
+ }, Ae = (d) => {
847
+ var g;
848
+ (g = m.current) == null || g.sendNotification(ot.type, {
849
849
  files: [
850
850
  {
851
851
  uri: j(d)
852
852
  }
853
853
  ]
854
854
  });
855
- }, Ae = (d, c) => {
856
- var u;
857
- (u = f.current) == null || u.sendNotification(ot.type, {
855
+ }, pe = (d, g) => {
856
+ var c;
857
+ (c = m.current) == null || c.sendNotification(rt.type, {
858
858
  files: [
859
859
  {
860
860
  oldUri: j(d),
861
- newUri: j(c)
861
+ newUri: j(g)
862
862
  }
863
863
  ]
864
864
  });
865
- }, pe = (d) => {
866
- var c;
867
- (c = f.current) == null || c.sendNotification(rt.type, {
865
+ }, be = (d) => {
866
+ var g;
867
+ (g = m.current) == null || g.sendNotification(st.type, {
868
868
  files: [
869
869
  {
870
870
  uri: j(d)
@@ -872,35 +872,35 @@ const ue = oe(void 0), wn = ({
872
872
  ]
873
873
  });
874
874
  };
875
- return /* @__PURE__ */ D(
876
- ue.Provider,
875
+ return /* @__PURE__ */ J(
876
+ de.Provider,
877
877
  {
878
878
  value: {
879
- inited: m || !!v,
880
- clientRef: f,
881
- lastError: v,
882
- reload: b,
883
- getTokenAtPosition: C
879
+ inited: C || !!y,
880
+ clientRef: m,
881
+ lastError: y,
882
+ reload: h,
883
+ getTokenAtPosition: u
884
884
  },
885
885
  children: [
886
886
  n,
887
- /* @__PURE__ */ x(yt, { defaultZoom: i })
887
+ /* @__PURE__ */ w(Nt, { defaultZoom: i })
888
888
  ]
889
889
  }
890
890
  );
891
891
  };
892
- function kn() {
893
- const n = re(ue);
892
+ function Ln() {
893
+ const n = se(de);
894
894
  if (n === void 0)
895
895
  throw new Error("useLSP must be used within an LSPContext");
896
896
  return n;
897
897
  }
898
- const de = oe(
898
+ const Ie = re(
899
899
  void 0
900
- ), Ln = Ne(({ children: n }) => {
901
- const [e, t] = z(null);
902
- return /* @__PURE__ */ x(
903
- de.Provider,
900
+ ), Wn = Re(({ children: n }) => {
901
+ const [e, t] = _(null);
902
+ return /* @__PURE__ */ w(
903
+ Ie.Provider,
904
904
  {
905
905
  value: {
906
906
  editor: e,
@@ -910,8 +910,8 @@ const de = oe(
910
910
  }
911
911
  );
912
912
  });
913
- function kt() {
914
- const n = re(de), e = z(null);
913
+ function Lt() {
914
+ const n = se(Ie), e = _(null);
915
915
  if (n === void 0) {
916
916
  const [t, i] = e;
917
917
  return {
@@ -921,22 +921,22 @@ function kt() {
921
921
  }
922
922
  return n;
923
923
  }
924
- var Ie = {
924
+ var Ce = {
925
925
  color: void 0,
926
926
  size: void 0,
927
927
  className: void 0,
928
928
  style: void 0,
929
929
  attr: void 0
930
- }, ne = E.createContext && E.createContext(Ie), K = globalThis && globalThis.__assign || function() {
931
- return K = Object.assign || function(n) {
930
+ }, ie = T.createContext && T.createContext(Ce), E = globalThis && globalThis.__assign || function() {
931
+ return E = Object.assign || function(n) {
932
932
  for (var e, t = 1, i = arguments.length; t < i; t++) {
933
933
  e = arguments[t];
934
934
  for (var o in e)
935
935
  Object.prototype.hasOwnProperty.call(e, o) && (n[o] = e[o]);
936
936
  }
937
937
  return n;
938
- }, K.apply(this, arguments);
939
- }, Lt = globalThis && globalThis.__rest || function(n, e) {
938
+ }, E.apply(this, arguments);
939
+ }, Wt = globalThis && globalThis.__rest || function(n, e) {
940
940
  var t = {};
941
941
  for (var i in n)
942
942
  Object.prototype.hasOwnProperty.call(n, i) && e.indexOf(i) < 0 && (t[i] = n[i]);
@@ -945,64 +945,64 @@ var Ie = {
945
945
  e.indexOf(i[o]) < 0 && Object.prototype.propertyIsEnumerable.call(n, i[o]) && (t[i[o]] = n[i[o]]);
946
946
  return t;
947
947
  };
948
- function Ce(n) {
948
+ function me(n) {
949
949
  return n && n.map(function(e, t) {
950
- return E.createElement(e.tag, K({
950
+ return T.createElement(e.tag, E({
951
951
  key: t
952
- }, e.attr), Ce(e.child));
952
+ }, e.attr), me(e.child));
953
953
  });
954
954
  }
955
- function me(n) {
955
+ function fe(n) {
956
956
  return function(e) {
957
- return E.createElement(Wt, K({
958
- attr: K({}, n.attr)
959
- }, e), Ce(n.child));
957
+ return T.createElement(Ft, E({
958
+ attr: E({}, n.attr)
959
+ }, e), me(n.child));
960
960
  };
961
961
  }
962
- function Wt(n) {
962
+ function Ft(n) {
963
963
  var e = function(t) {
964
- var i = n.attr, o = n.size, a = n.title, r = Lt(n, ["attr", "size", "title"]), I = o || t.size || "1em", m;
965
- return t.className && (m = t.className), n.className && (m = (m ? m + " " : "") + n.className), E.createElement("svg", K({
964
+ var i = n.attr, o = n.size, l = n.title, r = Wt(n, ["attr", "size", "title"]), I = o || t.size || "1em", C;
965
+ return t.className && (C = t.className), n.className && (C = (C ? C + " " : "") + n.className), T.createElement("svg", E({
966
966
  stroke: "currentColor",
967
967
  fill: "currentColor",
968
968
  strokeWidth: "0"
969
969
  }, t.attr, i, r, {
970
- className: m,
971
- style: K(K({
970
+ className: C,
971
+ style: E(E({
972
972
  color: n.color || t.color
973
973
  }, t.style), n.style),
974
974
  height: I,
975
975
  width: I,
976
976
  xmlns: "http://www.w3.org/2000/svg"
977
- }), a && E.createElement("title", null, a), n.children);
977
+ }), l && T.createElement("title", null, l), n.children);
978
978
  };
979
- return ne !== void 0 ? E.createElement(ne.Consumer, null, function(t) {
979
+ return ie !== void 0 ? T.createElement(ie.Consumer, null, function(t) {
980
980
  return e(t);
981
- }) : e(Ie);
982
- }
983
- function Ft(n) {
984
- return me({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 10.5858L9.17157 7.75736L7.75736 9.17157L10.5858 12L7.75736 14.8284L9.17157 16.2426L12 13.4142L14.8284 16.2426L16.2426 14.8284L13.4142 12L16.2426 9.17157L14.8284 7.75736L12 10.5858Z" } }] })(n);
981
+ }) : e(Ce);
985
982
  }
986
983
  function Zt(n) {
987
- return me({ 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" } }] })(n);
984
+ return fe({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12C22 17.5228 17.5228 22 12 22ZM12 10.5858L9.17157 7.75736L7.75736 9.17157L10.5858 12L7.75736 14.8284L9.17157 16.2426L12 13.4142L14.8284 16.2426L16.2426 14.8284L13.4142 12L16.2426 9.17157L14.8284 7.75736L12 10.5858Z" } }] })(n);
988
985
  }
989
- const jt = ({
986
+ function jt(n) {
987
+ return fe({ 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" } }] })(n);
988
+ }
989
+ const Xt = ({
990
990
  lspProps: { lastError: n, reload: e }
991
991
  }) => {
992
- const [t, i] = z(!1), o = () => {
992
+ const [t, i] = _(!1), o = () => {
993
993
  e();
994
- }, a = () => {
994
+ }, l = () => {
995
995
  i(!1);
996
996
  };
997
- return J(() => {
997
+ return M(() => {
998
998
  i(!!n);
999
- }, [n]), t ? /* @__PURE__ */ D("div", { className: "flex items-center border-b border-fd-gray-darker bg-grey-800 px-2 py-1.5 text-xs text-grey-50", children: [
1000
- /* @__PURE__ */ D("span", { className: "flex flex-1 justify-center gap-1", children: [
1001
- /* @__PURE__ */ x(Zt, { className: "h-4 w-4 text-yellow-600" }),
1002
- /* @__PURE__ */ D("span", { children: [
999
+ }, [n]), t ? /* @__PURE__ */ J("div", { className: "flex items-center border-b border-fd-gray-darker bg-grey-800 px-2 py-1.5 text-xs text-grey-50", children: [
1000
+ /* @__PURE__ */ J("span", { className: "flex flex-1 justify-center gap-1", children: [
1001
+ /* @__PURE__ */ w(jt, { className: "h-4 w-4 text-yellow-600" }),
1002
+ /* @__PURE__ */ J("span", { children: [
1003
1003
  "LSP not loaded.",
1004
1004
  " ",
1005
- /* @__PURE__ */ x(
1005
+ /* @__PURE__ */ w(
1006
1006
  "button",
1007
1007
  {
1008
1008
  className: "text-primary-dark underline",
@@ -1012,24 +1012,24 @@ const jt = ({
1012
1012
  )
1013
1013
  ] })
1014
1014
  ] }),
1015
- /* @__PURE__ */ x("button", { className: "focus:outline-none", children: /* @__PURE__ */ x(
1016
- Ft,
1015
+ /* @__PURE__ */ w("button", { className: "focus:outline-none", children: /* @__PURE__ */ w(
1016
+ Zt,
1017
1017
  {
1018
1018
  className: "h-4 w-4 text-white",
1019
- onClick: a
1019
+ onClick: l
1020
1020
  }
1021
1021
  ) })
1022
1022
  ] }) : null;
1023
- }, Xt = {
1023
+ }, Et = {
1024
1024
  provideCompletionItems: (n, e) => {
1025
1025
  const t = n.getWordUntilPosition(e);
1026
1026
  return {
1027
1027
  suggestions: [
1028
1028
  {
1029
1029
  label: "device:xs",
1030
- kind: l.languages.CompletionItemKind.Snippet,
1030
+ kind: s.languages.CompletionItemKind.Snippet,
1031
1031
  documentation: "Media query for phone device",
1032
- range: new l.Range(
1032
+ range: new s.Range(
1033
1033
  e.lineNumber,
1034
1034
  t.startColumn,
1035
1035
  e.lineNumber,
@@ -1043,7 +1043,7 @@ const jt = ({
1043
1043
  "}"
1044
1044
  ].join(`
1045
1045
  `),
1046
- insertTextRules: l.languages.CompletionItemInsertTextRule.InsertAsSnippet
1046
+ insertTextRules: s.languages.CompletionItemInsertTextRule.InsertAsSnippet
1047
1047
  }
1048
1048
  ]
1049
1049
  };
@@ -1316,10 +1316,10 @@ const jt = ({
1316
1316
  "ref"
1317
1317
  ]
1318
1318
  }
1319
- }, Et = {
1319
+ }, Tt = {
1320
1320
  $ref: Kt,
1321
1321
  definitions: Bt
1322
- }, Tt = "array", Ot = {
1322
+ }, Ot = "array", Dt = {
1323
1323
  type: "object",
1324
1324
  properties: {
1325
1325
  class: {
@@ -1336,111 +1336,111 @@ const jt = ({
1336
1336
  }
1337
1337
  }
1338
1338
  }, Gt = {
1339
- type: Tt,
1340
- items: Ot
1339
+ type: Ot,
1340
+ items: Dt
1341
1341
  };
1342
- function Dt(n, e) {
1342
+ function Jt(n, e) {
1343
1343
  const t = document.createElement("style");
1344
1344
  t.dataset.id = e, t.textContent = n, document.head.append(t);
1345
1345
  }
1346
- function Jt(n) {
1346
+ function Mt(n) {
1347
1347
  return Array.from(document.styleSheets).find(
1348
1348
  (e) => e.ownerNode.getAttribute("data-id") === n
1349
1349
  );
1350
1350
  }
1351
- function Mt(n, e) {
1351
+ function Pt(n, e) {
1352
1352
  const t = [];
1353
1353
  let i = [];
1354
- const o = [], a = (s, C, w, L) => {
1354
+ const o = [], l = (a, u, v, L) => {
1355
1355
  t.push({
1356
- startLineNumber: s,
1357
- endLineNumber: w,
1358
- startColumn: C,
1356
+ startLineNumber: a,
1357
+ endLineNumber: v,
1358
+ startColumn: u,
1359
1359
  endColumn: L
1360
- }), h(), m();
1361
- }, r = (s) => {
1362
- o.indexOf(s) < 0 && o.push(s);
1363
- }, I = (s) => {
1364
- const C = o.indexOf(s);
1365
- C < 0 || o.splice(C, 1);
1366
- }, m = () => {
1367
- for (const s of o)
1360
+ }), S(), C();
1361
+ }, r = (a) => {
1362
+ o.indexOf(a) < 0 && o.push(a);
1363
+ }, I = (a) => {
1364
+ const u = o.indexOf(a);
1365
+ u < 0 || o.splice(u, 1);
1366
+ }, C = () => {
1367
+ for (const a of o)
1368
1368
  try {
1369
- s(i);
1370
- } catch (C) {
1371
- console.error(C);
1369
+ a(i);
1370
+ } catch (u) {
1371
+ console.error(u);
1372
1372
  }
1373
- }, h = () => {
1374
- const s = n.getModel();
1375
- s && (i = Pt(
1376
- t.map((C) => [
1377
- s.getOffsetAt({
1378
- lineNumber: C.startLineNumber,
1379
- column: C.startColumn
1373
+ }, S = () => {
1374
+ const a = n.getModel();
1375
+ a && (i = Yt(
1376
+ t.map((u) => [
1377
+ a.getOffsetAt({
1378
+ lineNumber: u.startLineNumber,
1379
+ column: u.startColumn
1380
1380
  }),
1381
- s.getOffsetAt({
1382
- lineNumber: C.endLineNumber,
1383
- column: C.endColumn
1381
+ a.getOffsetAt({
1382
+ lineNumber: u.endLineNumber,
1383
+ column: u.endColumn
1384
1384
  })
1385
1385
  ]),
1386
1386
  /*mergeJoins*/
1387
1387
  !0
1388
- ), i.length > 0 && (i[0][0] <= 0 && (i[0][0] = Number.NEGATIVE_INFINITY), i[i.length - 1][1] >= s.getValueLength() && (i[i.length - 1][1] = Number.POSITIVE_INFINITY)));
1389
- }, v = (s) => {
1390
- const C = {
1388
+ ), i.length > 0 && (i[0][0] <= 0 && (i[0][0] = Number.NEGATIVE_INFINITY), i[i.length - 1][1] >= a.getValueLength() && (i[i.length - 1][1] = Number.POSITIVE_INFINITY)));
1389
+ }, y = (a) => {
1390
+ const u = {
1391
1391
  isDeletion: !1,
1392
1392
  isAddition: !1,
1393
1393
  isReplacement: !1
1394
1394
  };
1395
- return s.text === "" ? C.isDeletion = !0 : s.range.startLineNumber === s.range.endLineNumber && s.range.startColumn === s.range.endColumn ? C.isAddition = !0 : C.isReplacement = !0, C;
1396
- }, A = n.onDidChangeModel((s) => {
1397
- h(), N();
1398
- }), f = n.onDidChangeModelContent((s) => {
1399
- if (!s.isUndoing)
1400
- for (const C of s.changes) {
1401
- const w = v(C);
1402
- if (w.isReplacement || w.isDeletion || w.isAddition) {
1395
+ return a.text === "" ? u.isDeletion = !0 : a.range.startLineNumber === a.range.endLineNumber && a.range.startColumn === a.range.endColumn ? u.isAddition = !0 : u.isReplacement = !0, u;
1396
+ }, p = n.onDidChangeModel((a) => {
1397
+ S(), k();
1398
+ }), m = n.onDidChangeModelContent((a) => {
1399
+ if (!a.isUndoing)
1400
+ for (const u of a.changes) {
1401
+ const v = y(u);
1402
+ if (v.isReplacement || v.isDeletion || v.isAddition) {
1403
1403
  const L = t.some(
1404
- (p) => C.range.startLineNumber >= p.startLineNumber && C.range.endLineNumber <= p.endLineNumber && C.range.startColumn >= p.startColumn && C.range.endColumn <= p.endColumn
1405
- ), B = !L && e && C.range.startLineNumber === 1 && C.range.startColumn === 1 && !se(C.text);
1406
- if (L || B) {
1407
- const p = n.getModel();
1408
- if (p) {
1409
- p.undo();
1404
+ (b) => u.range.startLineNumber >= b.startLineNumber && u.range.endLineNumber <= b.endLineNumber && u.range.startColumn >= b.startColumn && u.range.endColumn <= b.endColumn
1405
+ ), K = !L && e && u.range.startLineNumber === 1 && u.range.startColumn === 1 && !le(u.text);
1406
+ if (L || K) {
1407
+ const b = n.getModel();
1408
+ if (b) {
1409
+ b.undo();
1410
1410
  return;
1411
1411
  }
1412
1412
  }
1413
1413
  }
1414
1414
  }
1415
- }), R = () => {
1416
- A.dispose(), f.dispose();
1415
+ }), N = () => {
1416
+ p.dispose(), m.dispose();
1417
1417
  };
1418
- let y = [], b = `
1418
+ let x = [], h = `
1419
1419
  .idoc-readonly-mark {
1420
1420
  cursor: not-allowed;
1421
1421
  z-index: 1;
1422
1422
  }
1423
1423
  `;
1424
- if (b) {
1425
- const s = "monaco-read-only";
1426
- Jt(s) || Dt(b, s), b = null;
1424
+ if (h) {
1425
+ const a = "monaco-read-only";
1426
+ Mt(a) || Jt(h, a), h = null;
1427
1427
  }
1428
- const S = () => {
1429
- r(N), N();
1430
- }, g = () => {
1431
- I(N), y = n.deltaDecorations(y, []);
1432
- }, N = () => {
1433
- const s = n.getModel();
1434
- s && (y = n.deltaDecorations(
1435
- y,
1436
- i.map(k(s))
1428
+ const R = () => {
1429
+ r(k), k();
1430
+ }, f = () => {
1431
+ I(k), x = n.deltaDecorations(x, []);
1432
+ }, k = () => {
1433
+ const a = n.getModel();
1434
+ a && (x = n.deltaDecorations(
1435
+ x,
1436
+ i.map(A(a))
1437
1437
  ));
1438
- }, k = (s) => (C) => {
1439
- const w = s.getPositionAt(C[0]), L = s.getPositionAt(C[1]);
1438
+ }, A = (a) => (u) => {
1439
+ const v = a.getPositionAt(u[0]), L = a.getPositionAt(u[1]);
1440
1440
  return {
1441
- range: new l.Range(
1442
- w.lineNumber,
1443
- w.column,
1441
+ range: new s.Range(
1442
+ v.lineNumber,
1443
+ v.column,
1444
1444
  L.lineNumber,
1445
1445
  L.column
1446
1446
  ),
@@ -1453,57 +1453,57 @@ function Mt(n, e) {
1453
1453
  get buffer() {
1454
1454
  return i;
1455
1455
  },
1456
- exclude: a,
1456
+ exclude: l,
1457
1457
  attach: r,
1458
1458
  detach: I,
1459
- dispose: R,
1460
- show: S,
1461
- hide: g
1459
+ dispose: N,
1460
+ show: R,
1461
+ hide: f
1462
1462
  };
1463
1463
  }
1464
1464
  function Vt(n, e, t) {
1465
1465
  let i = !1;
1466
- const o = (g) => g[1] < g[0] ? (i = !0, [[g[1], g[0]]]) : [[...g]], a = (g) => i ? g.map((N) => N[1] > N[0] ? I(N) : N).reverse() : g;
1466
+ const o = (f) => f[1] < f[0] ? (i = !0, [[f[1], f[0]]]) : [[...f]], l = (f) => i ? f.map((k) => k[1] > k[0] ? I(k) : k).reverse() : f;
1467
1467
  let r;
1468
- const I = (g) => (r = g[1], g[1] = g[0], g[0] = r, g), m = o(n);
1469
- let h, v, A, f, R, y, b, S;
1470
- A = m[0];
1471
- for (v of e)
1472
- for (b = v[0], S = v[1], f = 0; f < m.length; f++) {
1473
- if (A = m[f], R = A[0], y = A[1], R < b)
1474
- y < b ? h = [A] : y <= S ? h = [[R, b - 1]] : h = [
1475
- [R, b - 1],
1476
- [S + 1, y]
1468
+ const I = (f) => (r = f[1], f[1] = f[0], f[0] = r, f), C = o(n);
1469
+ let S, y, p, m, N, x, h, R;
1470
+ p = C[0];
1471
+ for (y of e)
1472
+ for (h = y[0], R = y[1], m = 0; m < C.length; m++) {
1473
+ if (p = C[m], N = p[0], x = p[1], N < h)
1474
+ x < h ? S = [p] : x <= R ? S = [[N, h - 1]] : S = [
1475
+ [N, h - 1],
1476
+ [R + 1, x]
1477
1477
  ];
1478
- else if (R <= S)
1479
- if (b === Number.NEGATIVE_INFINITY) {
1480
- const g = S + 1;
1481
- h = t === 0 ? [] : [[g, y > g ? y : g]];
1478
+ else if (N <= R)
1479
+ if (h === Number.NEGATIVE_INFINITY) {
1480
+ const f = R + 1;
1481
+ S = t === 0 ? [] : [[f, x > f ? x : f]];
1482
1482
  } else
1483
- S === Number.POSITIVE_INFINITY ? h = t === 0 ? [] : [[b - 1, b - 1]] : y <= S ? h = t < 0 ? [[b - 1, b - 1]] : t > 0 ? [[S + 1, S + 1]] : [] : h = [[S + 1, y]];
1483
+ R === Number.POSITIVE_INFINITY ? S = t === 0 ? [] : [[h - 1, h - 1]] : x <= R ? S = t < 0 ? [[h - 1, h - 1]] : t > 0 ? [[R + 1, R + 1]] : [] : S = [[R + 1, x]];
1484
1484
  else
1485
- h = [A];
1486
- if (m.splice(f, 1, ...h), m.length === 1 && m[0][1] < b)
1487
- return a(m);
1485
+ S = [p];
1486
+ if (C.splice(m, 1, ...S), C.length === 1 && C[0][1] < h)
1487
+ return l(C);
1488
1488
  }
1489
- return a(m);
1489
+ return l(C);
1490
1490
  }
1491
- function Pt(n, e) {
1491
+ function Yt(n, e) {
1492
1492
  if (n.length < 2)
1493
1493
  return n;
1494
1494
  const t = [];
1495
- let i = null, o, a;
1495
+ let i = null, o, l;
1496
1496
  n = n.map(
1497
1497
  (r) => (r[1] < r[0] && (o = r[1], r[1] = r[0], r[1] = o), r)
1498
1498
  ).sort((r, I) => r[0] - I[0]), t.push(n[0]);
1499
1499
  for (let r = 1; r < n.length; r++)
1500
- i = t[t.length - 1], a = n[r], i[1] === a[0] && !e ? t.push(a) : i[1] === a[0] - 1 && e ? (i[1] = a[1], t.splice(t.length - 1, 1, i)) : i[1] < a[0] ? t.push(a) : i[1] < a[1] && (i[1] = a[1], t.splice(t.length - 1, 1, i));
1500
+ i = t[t.length - 1], l = n[r], i[1] === l[0] && !e ? t.push(l) : i[1] === l[0] - 1 && e ? (i[1] = l[1], t.splice(t.length - 1, 1, i)) : i[1] < l[0] ? t.push(l) : i[1] < l[1] && (i[1] = l[1], t.splice(t.length - 1, 1, i));
1501
1501
  return t;
1502
1502
  }
1503
- function Y(n, e) {
1503
+ function H(n, e) {
1504
1504
  return e.bind(n);
1505
1505
  }
1506
- class Yt {
1506
+ class Ht {
1507
1507
  constructor(e, t) {
1508
1508
  F(this, "editor");
1509
1509
  F(this, "intervals");
@@ -1516,7 +1516,7 @@ class Yt {
1516
1516
  /**
1517
1517
  * Linked to ICodeEditor.onDidChangeCursorPosition event.
1518
1518
  */
1519
- F(this, "onCursor", Y(
1519
+ F(this, "onCursor", H(
1520
1520
  this,
1521
1521
  function(e) {
1522
1522
  if (e.source === "api")
@@ -1525,17 +1525,17 @@ class Yt {
1525
1525
  t.length !== 0 && this.editor.setSelections(t);
1526
1526
  }
1527
1527
  ));
1528
- F(this, "onRectangleSelectionStart", Y(this, function({ event: e }) {
1528
+ F(this, "onRectangleSelectionStart", H(this, function({ event: e }) {
1529
1529
  e.middleButton && (this.lastPrefer = this.prefer, this.prefer = 0, window.addEventListener("pointerup", this.onRectangleSelectionStop));
1530
1530
  }));
1531
- F(this, "onRectangleSelectionStop", Y(this, function() {
1531
+ F(this, "onRectangleSelectionStop", H(this, function() {
1532
1532
  this.prefer = this.lastPrefer, window.removeEventListener("pointerup", this.onRectangleSelectionStop);
1533
1533
  }));
1534
1534
  /**
1535
1535
  * Linked to ICodeEditor.onKeyDown event.
1536
1536
  */
1537
- F(this, "onKey", Y(this, function(e) {
1538
- const t = e.keyCode, i = l.KeyCode;
1537
+ F(this, "onKey", H(this, function(e) {
1538
+ const t = e.keyCode, i = s.KeyCode;
1539
1539
  if (e.altKey || i.F1 <= t && t <= i.F19 || e.ctrlKey && t !== i.Backspace)
1540
1540
  return;
1541
1541
  if (t === i.UpArrow || t === i.LeftArrow || t === i.Home || t === i.PageUp) {
@@ -1546,24 +1546,24 @@ class Yt {
1546
1546
  this.prefer = 1;
1547
1547
  return;
1548
1548
  }
1549
- const o = this.getSelections(), a = this.intervals.buffer;
1549
+ const o = this.getSelections(), l = this.intervals.buffer;
1550
1550
  let r;
1551
1551
  if (t === i.Delete)
1552
- r = (I) => I[0] === I[1] && a.find((m) => I[1] + 1 === m[0]) != null;
1552
+ r = (I) => I[0] === I[1] && l.find((C) => I[1] + 1 === C[0]) != null;
1553
1553
  else if (t === i.Backspace)
1554
- r = (I) => I[0] === I[1] && a.find((m) => m[1] + 1 === I[0]) != null;
1554
+ r = (I) => I[0] === I[1] && l.find((C) => C[1] + 1 === I[0]) != null;
1555
1555
  else
1556
1556
  return;
1557
1557
  o.findIndex(r) !== -1 && (e.stopPropagation(), e.preventDefault());
1558
1558
  }));
1559
- F(this, "getOffsetAt", Y(this, function(e) {
1559
+ F(this, "getOffsetAt", H(this, function(e) {
1560
1560
  let t;
1561
1561
  for (let i = 0; i < this.intervals.buffer.length; i++)
1562
1562
  if (t = this.intervals.buffer[i], e <= t[1])
1563
1563
  return t[0] - e < e - t[1] ? t[0] : t[1];
1564
1564
  }));
1565
1565
  var i;
1566
- this.editor = e, this.intervals = Mt(e, t), (i = this.editor.getModel()) == null || i.setEOL(l.editor.EndOfLineSequence.LF);
1566
+ this.editor = e, this.intervals = Pt(e, t), (i = this.editor.getModel()) == null || i.setEOL(s.editor.EndOfLineSequence.LF);
1567
1567
  }
1568
1568
  enable() {
1569
1569
  this.disposables.push(
@@ -1589,12 +1589,12 @@ class Yt {
1589
1589
  this.prefer
1590
1590
  )
1591
1591
  ).flat().map((i) => {
1592
- const o = e.getPositionAt(i[0]), a = e.getPositionAt(i[1]);
1593
- return new l.Selection(
1592
+ const o = e.getPositionAt(i[0]), l = e.getPositionAt(i[1]);
1593
+ return new s.Selection(
1594
1594
  o.lineNumber,
1595
1595
  o.column,
1596
- a.lineNumber,
1597
- a.column
1596
+ l.lineNumber,
1597
+ l.column
1598
1598
  );
1599
1599
  });
1600
1600
  }
@@ -1612,105 +1612,108 @@ class Yt {
1612
1612
  ]);
1613
1613
  }
1614
1614
  }
1615
- const Ht = new RegExp("^[ s]+(exposed|Function)", "i"), ie = () => /* @__PURE__ */ x("div", { className: "absolute inset-0 animate-pulse", children: /* @__PURE__ */ x("div", { className: "w-full space-y-4 px-4 py-1", children: /* @__PURE__ */ D("div", { className: "space-y-2", children: [
1616
- /* @__PURE__ */ x("div", { className: "h-3 w-3/4 rounded bg-grey-200" }),
1617
- /* @__PURE__ */ x("div", { className: "h-3 rounded bg-grey-200" }),
1618
- /* @__PURE__ */ x("div", { className: "h-3 w-5/6 rounded bg-grey-200" }),
1619
- /* @__PURE__ */ x("div", { className: "h-3 rounded bg-grey-200" }),
1620
- /* @__PURE__ */ x("div", { className: "h-3 rounded bg-grey-200" })
1621
- ] }) }) }), Wn = ({
1615
+ const zt = new RegExp("^[ s]+(exposed|Function)", "i"), oe = () => /* @__PURE__ */ w("div", { className: "absolute inset-0 animate-pulse", children: /* @__PURE__ */ w("div", { className: "w-full space-y-4 px-4 py-1", children: /* @__PURE__ */ J("div", { className: "space-y-2", children: [
1616
+ /* @__PURE__ */ w("div", { className: "h-3 w-3/4 rounded bg-grey-200" }),
1617
+ /* @__PURE__ */ w("div", { className: "h-3 rounded bg-grey-200" }),
1618
+ /* @__PURE__ */ w("div", { className: "h-3 w-5/6 rounded bg-grey-200" }),
1619
+ /* @__PURE__ */ w("div", { className: "h-3 rounded bg-grey-200" }),
1620
+ /* @__PURE__ */ w("div", { className: "h-3 rounded bg-grey-200" })
1621
+ ] }) }) }), Q = ["fd-dark"], Fn = ({
1622
1622
  path: n,
1623
1623
  initialValue: e,
1624
1624
  type: t,
1625
1625
  language: i,
1626
1626
  onChange: o,
1627
- options: a = {},
1627
+ options: l = {},
1628
1628
  extra: r = {},
1629
1629
  showAlerts: I = !1,
1630
- lspProps: m,
1631
- ...h
1630
+ lspProps: C,
1631
+ theme: S = Q[0],
1632
+ ...y
1632
1633
  }) => {
1633
- const { initialLineInfo: v, initialSelectionInfo: A } = r, { editor: f, setEditor: R } = kt(), { inited: y } = m;
1634
- function b(g) {
1635
- i === "css" && g.languages.registerCompletionItemProvider("css", Xt), i === "json" && g.languages.json && g.languages.json.jsonDefaults.setDiagnosticsOptions({
1634
+ const { initialLineInfo: p, initialSelectionInfo: m } = r, { editor: N, setEditor: x } = Lt(), { inited: h } = C;
1635
+ function R(A) {
1636
+ i === "css" && A.languages.registerCompletionItemProvider("css", Et), i === "json" && A.languages.json && A.languages.json.jsonDefaults.setDiagnosticsOptions({
1636
1637
  validate: !0,
1637
1638
  schemas: [
1638
1639
  {
1639
1640
  uri: "condition-schema.json",
1640
1641
  fileMatch: ["*.condition.json"],
1641
- schema: Et
1642
+ schema: Tt
1642
1643
  },
1643
1644
  {
1644
1645
  uri: "handlers-schema.json",
1645
- fileMatch: [Le],
1646
+ fileMatch: [We],
1646
1647
  schema: Gt
1647
1648
  }
1648
1649
  ]
1649
1650
  });
1650
1651
  }
1651
- function S(g, N) {
1652
- R(g);
1653
- const k = g.getModel();
1654
- if (k && (k.updateOptions({ insertSpaces: !1 }), g.onKeyUp(() => {
1655
- var C;
1656
- const s = (C = g.getPosition()) == null ? void 0 : C.lineNumber;
1657
- if (s) {
1658
- const w = k.getLineFirstNonWhitespaceColumn(s), L = k.getLineLength(s), B = k.getLineContent(s);
1659
- Ht.test(B) && g.executeEdits("edit-handler", [
1652
+ function f(A, a) {
1653
+ x(A);
1654
+ const u = A.getModel();
1655
+ if (u && (u.updateOptions({ insertSpaces: !1 }), A.onKeyUp(() => {
1656
+ var L;
1657
+ const v = (L = A.getPosition()) == null ? void 0 : L.lineNumber;
1658
+ if (v) {
1659
+ const K = u.getLineFirstNonWhitespaceColumn(v), b = u.getLineLength(v), B = u.getLineContent(v);
1660
+ zt.test(B) && A.executeEdits("edit-handler", [
1660
1661
  {
1661
- range: new N.Range(
1662
- s,
1662
+ range: new a.Range(
1663
+ v,
1663
1664
  0,
1664
- s,
1665
- L
1665
+ v,
1666
+ b
1666
1667
  ),
1667
1668
  text: B.substr(
1668
- w - 1,
1669
- L - w
1669
+ K - 1,
1670
+ b - K
1670
1671
  )
1671
1672
  }
1672
1673
  ]);
1673
1674
  }
1674
- })), t === We.METHOD && se(e)) {
1675
- const s = new Yt(g, !0);
1676
- s.exclude(1, 1, 1, Number.POSITIVE_INFINITY), s.enable();
1675
+ })), t === Fe.METHOD && le(e)) {
1676
+ const v = new Ht(A, !0);
1677
+ v.exclude(1, 1, 1, Number.POSITIVE_INFINITY), v.enable();
1677
1678
  }
1678
1679
  }
1679
- return J(() => {
1680
- if (!f)
1680
+ M(() => {
1681
+ if (!N)
1681
1682
  return;
1682
- const { line: g, offset: N } = v || {};
1683
- g && bt(f, g, N);
1684
- }, [v, f]), J(() => {
1685
- if (!f)
1683
+ const { line: A, offset: a } = p || {};
1684
+ A && ht(N, A, a);
1685
+ }, [p, N]), M(() => {
1686
+ if (!N)
1686
1687
  return;
1687
- const { selection: g } = A || {};
1688
- g && pt(f, g);
1689
- }, [A, f]), y ? /* @__PURE__ */ D(ye, { children: [
1690
- I ? /* @__PURE__ */ x(jt, { lspProps: m }) : null,
1691
- /* @__PURE__ */ x(
1692
- we,
1688
+ const { selection: A } = m || {};
1689
+ A && bt(N, A);
1690
+ }, [m, N]);
1691
+ const k = (A) => Q.includes(A) ? A : Q[0];
1692
+ return h ? /* @__PURE__ */ J(Ne, { children: [
1693
+ I ? /* @__PURE__ */ w(Xt, { lspProps: C }) : null,
1694
+ /* @__PURE__ */ w(
1695
+ ke,
1693
1696
  {
1694
1697
  options: {
1695
1698
  readOnly: !0,
1696
1699
  fontSize: 12,
1697
1700
  "semanticHighlighting.enabled": !0,
1698
1701
  padding: { top: 10 },
1699
- ...a
1702
+ ...l
1700
1703
  },
1701
1704
  path: j(n),
1702
1705
  value: e,
1703
- theme: "fd-dark",
1704
- onChange: (g) => o && o(g || ""),
1706
+ theme: k(S),
1707
+ onChange: (A) => o && o(A || ""),
1705
1708
  language: i,
1706
- beforeMount: b,
1707
- onMount: S,
1708
- loading: /* @__PURE__ */ x(ie, {}),
1709
- ...h
1709
+ beforeMount: R,
1710
+ onMount: f,
1711
+ loading: /* @__PURE__ */ w(oe, {}),
1712
+ ...y
1710
1713
  }
1711
1714
  )
1712
- ] }) : /* @__PURE__ */ x(ie, {});
1713
- }, zt = {
1715
+ ] }) : /* @__PURE__ */ w(oe, {});
1716
+ }, _t = {
1714
1717
  name: "4d",
1715
1718
  displayName: "%displayName%",
1716
1719
  description: "%description%",
@@ -1735,7 +1738,7 @@ const Ht = new RegExp("^[ s]+(exposed|Function)", "i"), ie = () => /* @__PURE__
1735
1738
  }
1736
1739
  ]
1737
1740
  }
1738
- }, { registerFileUrl: $, whenReady: Fn } = gt(zt, void 0, {
1741
+ }, { registerFileUrl: $, whenReady: Zn } = ct(_t, void 0, {
1739
1742
  system: !0
1740
1743
  });
1741
1744
  $(
@@ -1759,18 +1762,19 @@ $(
1759
1762
  { mimeType: "application/json", size: 135 }
1760
1763
  );
1761
1764
  export {
1762
- jt as Alerts,
1763
- Wn as CodeEditor,
1764
- Ln as CodeEditorProvider,
1765
- wn as LSPProvider,
1766
- ae as _await,
1767
- mt as configureServices,
1765
+ Xt as Alerts,
1766
+ Fn as CodeEditor,
1767
+ Wn as CodeEditorProvider,
1768
+ kn as LSPProvider,
1769
+ Q as SUPPORTED_THEMES,
1770
+ ge as _await,
1771
+ ft as configureServices,
1768
1772
  j as getFileSystemPath,
1769
- Rn as getFunctionOffset,
1770
- Ct as initMonacoUserConfiguration,
1771
- bt as jumpToLine,
1772
- pt as jumpToSelection,
1773
- kt as useCodeEditor,
1774
- kn as useLSP
1773
+ wn as getFunctionOffset,
1774
+ mt as initMonacoUserConfiguration,
1775
+ ht as jumpToLine,
1776
+ bt as jumpToSelection,
1777
+ Lt as useCodeEditor,
1778
+ Ln as useLSP
1775
1779
  };
1776
1780
  //# sourceMappingURL=index.es.js.map