@oomol-lab/open-flow 0.1.0-alpha.9 → 0.1.0-beta.2

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.
Files changed (58) hide show
  1. package/README.md +5 -1
  2. package/dist/browser/createResourceDialog-BkZns-oZ.js +504 -0
  3. package/dist/browser/diagnostics-giPSzyMo.js +9346 -0
  4. package/dist/browser/{dist-DhsGR_K3.js → dist-3Mj8q8Pr.js} +27 -27
  5. package/dist/browser/{dist-n9WmBm5w.js → dist-BKuSVKCC.js} +1 -1
  6. package/dist/browser/{dist-DQVavPcf.js → dist-BMqL-qR5.js} +469 -903
  7. package/dist/browser/{dist-D5mdziGP.js → dist-BN4ZCyOB.js} +9 -9
  8. package/dist/browser/{dist-CVtP-E2c.js → dist-BpopSHwP.js} +1 -1
  9. package/dist/browser/{dist-B0Q2Mn0n.js → dist-CJpzJrLM.js} +191 -191
  10. package/dist/browser/{dist-DXgEYMFx.js → dist-CPuF50D9.js} +196 -196
  11. package/dist/browser/{dist-CUkceEvN.js → dist-CUSrALSX.js} +113 -113
  12. package/dist/browser/dist-CeSZ2xSM.js +444 -0
  13. package/dist/browser/{dist-Bc9TvHYl.js → dist-DUzA0Ukh.js} +20 -20
  14. package/dist/browser/{dist-DWzdGVm9.js → dist-DWADUsVB.js} +74 -74
  15. package/dist/browser/{esm-YIGXG-Js.js → esm-B_PbUobB.js} +13 -13
  16. package/dist/browser/flow-authoring-node.d.ts +4 -2
  17. package/dist/browser/flow-authoring.d.ts +2 -1
  18. package/dist/browser/flow-authoring.js +400 -100
  19. package/dist/browser/flow-change.d.ts +9 -4
  20. package/dist/browser/flow-change.js +49 -46
  21. package/dist/browser/{flowRunInputEditorStore-DXOyyY7o.js → flowRunInputEditorStore-BeyUSWpO.js} +1644 -908
  22. package/dist/browser/{flowWorkspace-D7-rBA1-.js → flowWorkspace-DAMLVMcF.js} +18416 -16444
  23. package/dist/browser/getPseudoElementBounds-ESJExRFX.js +7642 -0
  24. package/dist/browser/languages-DgJehE1g.js +62 -0
  25. package/dist/browser/lib-C5Ipyfps.js +7856 -0
  26. package/dist/browser/licenses.md +119 -1
  27. package/dist/browser/main-DmjVyuWr.js +76 -0
  28. package/dist/browser/{markdownContent-ColGUxHy.js → markdownContent-DdlIRN3_.js} +4811 -4795
  29. package/dist/browser/theme.css +63 -0
  30. package/dist/browser/theme.css.d.ts +1 -0
  31. package/dist/browser/typeScriptSession-mPCiA9sV.js +2579 -0
  32. package/dist/browser/workbench-contract.d.ts +2 -1
  33. package/dist/browser/workbench.css +1 -1
  34. package/dist/browser/workbench.d.ts +46 -1
  35. package/dist/browser/workbench.js +1132 -1474
  36. package/dist/browser/workbenchSelect-B2s1HV-Y.js +1374 -0
  37. package/dist/common/connector-action.d.ts +6 -0
  38. package/dist/common/connector-action.js +37 -29
  39. package/dist/common/control-api-conformance.js +80 -29
  40. package/dist/common/control-api-errors.d.ts +24 -0
  41. package/dist/common/control-api.d.ts +54 -7
  42. package/dist/common/control-api.js +226 -95
  43. package/dist/common/flow-encoding.d.ts +2 -2
  44. package/dist/common/flow-encoding.js +4 -1
  45. package/dist/common/flow-semantics.d.ts +3 -0
  46. package/dist/common/flow-semantics.js +939 -851
  47. package/dist/common/integration-trigger.d.ts +1 -0
  48. package/dist/common/licenses.md +1 -25
  49. package/dist/common/localization.d.ts +21 -0
  50. package/dist/common/localization.js +62 -0
  51. package/dist/common/provider-triggers.js +4 -1
  52. package/dist/common/scheduler.d.ts +5 -5
  53. package/dist/common/scheduler.js +250 -236
  54. package/package.json +10 -1
  55. package/dist/browser/addNodeOptions-DRndy4EK.js +0 -6910
  56. package/dist/browser/createLucideIcon-CqjqCezK.js +0 -5537
  57. package/dist/browser/createResourceDialog-A64dDFCG.js +0 -467
  58. package/dist/browser/field-CKGQHCIi.js +0 -312
@@ -1,13 +1,13 @@
1
1
  import { _ as e, a as t, c as n, f as r, g as i, h as a, i as o, l as s, m as c, p as l, s as u, t as d, u as f, v as p, w as m, y as h } from "./dist-Mecbzdl2.js";
2
- import { E as g, a as _, n as v, o as y, p as b, r as x, t as S, x as C, y as ee } from "./dist-n9WmBm5w.js";
3
- import { E as te, j as w } from "./dist-CUkceEvN.js";
2
+ import { D as g, S as _, a as v, b as y, m as b, n as x, o as S, r as C, t as w } from "./dist-BKuSVKCC.js";
3
+ import { D as ee, N as T } from "./dist-CUSrALSX.js";
4
4
  //#region ../../node_modules/.bun/@codemirror+autocomplete@6.20.3/node_modules/@codemirror/autocomplete/dist/index.js
5
- var T = class {
5
+ var E = class {
6
6
  constructor(e, t, n, r) {
7
7
  this.state = e, this.pos = t, this.explicit = n, this.view = r, this.abortListeners = [], this.abortOnDocChange = !1;
8
8
  }
9
9
  tokenBefore(e) {
10
- let t = w(this.state).resolveInner(this.pos, -1);
10
+ let t = T(this.state).resolveInner(this.pos, -1);
11
11
  for (; t && e.indexOf(t.name) < 0;) t = t.parent;
12
12
  return t ? {
13
13
  from: t.from,
@@ -17,7 +17,7 @@ var T = class {
17
17
  } : null;
18
18
  }
19
19
  matchBefore(e) {
20
- let t = this.state.doc.lineAt(this.pos), n = Math.max(t.from, this.pos - 250), r = t.text.slice(n - t.from, this.pos - t.from), i = r.search(O(e, !1));
20
+ let t = this.state.doc.lineAt(this.pos), n = Math.max(t.from, this.pos - 250), r = t.text.slice(n - t.from, this.pos - t.from), i = r.search(k(e, !1));
21
21
  return i < 0 ? null : {
22
22
  from: n + i,
23
23
  to: this.pos,
@@ -31,21 +31,21 @@ var T = class {
31
31
  e == "abort" && this.abortListeners && (this.abortListeners.push(t), n && n.onDocChange && (this.abortOnDocChange = !0));
32
32
  }
33
33
  };
34
- function ne(e) {
34
+ function te(e) {
35
35
  let t = Object.keys(e).join(""), n = /\w/.test(t);
36
36
  return n && (t = t.replace(/\w/g, "")), `[${n ? "\\w" : ""}${t.replace(/[^\w\s]/g, "\\$&")}]`;
37
37
  }
38
- function re(e) {
38
+ function ne(e) {
39
39
  let t = Object.create(null), n = Object.create(null);
40
40
  for (let { label: r } of e) {
41
41
  t[r[0]] = !0;
42
42
  for (let e = 1; e < r.length; e++) n[r[e]] = !0;
43
43
  }
44
- let r = ne(t) + ne(n) + "*$";
44
+ let r = te(t) + te(n) + "*$";
45
45
  return [RegExp("^" + r), new RegExp(r)];
46
46
  }
47
- function ie(e) {
48
- let t = e.map((e) => typeof e == "string" ? { label: e } : e), [n, r] = t.every((e) => /^\w+$/.test(e.label)) ? [/\w*$/, /\w+$/] : re(t);
47
+ function re(e) {
48
+ let t = e.map((e) => typeof e == "string" ? { label: e } : e), [n, r] = t.every((e) => /^\w+$/.test(e.label)) ? [/\w*$/, /\w+$/] : ne(t);
49
49
  return (e) => {
50
50
  let i = e.matchBefore(r);
51
51
  return i || e.explicit ? {
@@ -55,29 +55,29 @@ function ie(e) {
55
55
  } : null;
56
56
  };
57
57
  }
58
- function ae(e, t) {
58
+ function ie(e, t) {
59
59
  return (n) => {
60
- for (let t = w(n.state).resolveInner(n.pos, -1); t; t = t.parent) {
60
+ for (let t = T(n.state).resolveInner(n.pos, -1); t; t = t.parent) {
61
61
  if (e.indexOf(t.name) > -1) return null;
62
62
  if (t.type.isTop) break;
63
63
  }
64
64
  return t(n);
65
65
  };
66
66
  }
67
- var E = class {
67
+ var D = class {
68
68
  constructor(e, t, n, r) {
69
69
  this.completion = e, this.source = t, this.match = n, this.score = r;
70
70
  }
71
71
  };
72
- function D(e) {
72
+ function O(e) {
73
73
  return e.selection.main.from;
74
74
  }
75
- function O(e, t) {
75
+ function k(e, t) {
76
76
  let { source: n } = e, r = t && n[0] != "^", i = n[n.length - 1] != "$";
77
77
  return !r && !i ? e : RegExp(`${r ? "^" : ""}(?:${n})${i ? "$" : ""}`, e.flags ?? (e.ignoreCase ? "i" : ""));
78
78
  }
79
- var k = /*@__PURE__*/ d.define();
80
- function oe(e, n, r, i) {
79
+ var A = /*@__PURE__*/ d.define();
80
+ function ae(e, n, r, i) {
81
81
  let { main: a } = e.selection, o = r - a.from, s = i - a.from;
82
82
  return {
83
83
  ...e.changeByRange((c) => {
@@ -96,13 +96,13 @@ function oe(e, n, r, i) {
96
96
  userEvent: "input.complete"
97
97
  };
98
98
  }
99
- var se = /*@__PURE__*/ new WeakMap();
100
- function ce(e) {
99
+ var oe = /*@__PURE__*/ new WeakMap();
100
+ function se(e) {
101
101
  if (!Array.isArray(e)) return e;
102
- let t = se.get(e);
103
- return t || se.set(e, t = ie(e)), t;
102
+ let t = oe.get(e);
103
+ return t || oe.set(e, t = re(e)), t;
104
104
  }
105
- var A = /*@__PURE__*/ l.define(), j = /*@__PURE__*/ l.define(), le = class {
105
+ var j = /*@__PURE__*/ l.define(), M = /*@__PURE__*/ l.define(), ce = class {
106
106
  constructor(t) {
107
107
  this.pattern = t, this.chars = [], this.folded = [], this.any = [], this.precise = [], this.byWord = [], this.score = 0, this.matched = [];
108
108
  for (let n = 0; n < t.length;) {
@@ -155,7 +155,7 @@ var A = /*@__PURE__*/ l.define(), j = /*@__PURE__*/ l.define(), le = class {
155
155
  }
156
156
  return this.ret(t - r.length, i);
157
157
  }
158
- }, ue = class {
158
+ }, le = class {
159
159
  constructor(e) {
160
160
  this.pattern = e, this.matched = [], this.score = 0, this.folded = e.toLowerCase();
161
161
  }
@@ -164,7 +164,7 @@ var A = /*@__PURE__*/ l.define(), j = /*@__PURE__*/ l.define(), le = class {
164
164
  let t = e.slice(0, this.pattern.length), n = t == this.pattern ? 0 : t.toLowerCase() == this.folded ? -200 : null;
165
165
  return n == null ? null : (this.matched = [0, t.length], this.score = n + (e.length == this.pattern.length ? 0 : -100), this);
166
166
  }
167
- }, M = /*@__PURE__*/ u.define({ combine(e) {
167
+ }, N = /*@__PURE__*/ u.define({ combine(e) {
168
168
  return h(e, {
169
169
  activateOnTyping: !0,
170
170
  activateOnCompletion: () => !1,
@@ -188,17 +188,17 @@ var A = /*@__PURE__*/ l.define(), j = /*@__PURE__*/ l.define(), le = class {
188
188
  defaultKeymap: (e, t) => e && t,
189
189
  closeOnBlur: (e, t) => e && t,
190
190
  icons: (e, t) => e && t,
191
- tooltipClass: (e, t) => (n) => N(e(n), t(n)),
192
- optionClass: (e, t) => (n) => N(e(n), t(n)),
191
+ tooltipClass: (e, t) => (n) => ue(e(n), t(n)),
192
+ optionClass: (e, t) => (n) => ue(e(n), t(n)),
193
193
  addToOptions: (e, t) => e.concat(t),
194
194
  filterStrict: (e, t) => e || t
195
195
  });
196
196
  } });
197
- function N(e, t) {
197
+ function ue(e, t) {
198
198
  return e ? t ? e + " " + t : e : t;
199
199
  }
200
200
  function de(e, t, n, r, i, a) {
201
- let o = e.textDirection == v.RTL, s = o, c = !1, l = "top", u, d, f = t.left - i.left, p = i.right - t.right, m = r.right - r.left, h = r.bottom - r.top;
201
+ let o = e.textDirection == x.RTL, s = o, c = !1, l = "top", u, d, f = t.left - i.left, p = i.right - t.right, m = r.right - r.left, h = r.bottom - r.top;
202
202
  if (s && f < Math.min(m, p) ? s = !1 : !s && p < Math.min(m, f) && (s = !0), m <= (s ? f : p)) u = Math.max(i.top, Math.min(n.top, i.bottom - h)) - t.top, d = Math.min(400, s ? f : p);
203
203
  else {
204
204
  c = !0, d = Math.min(400, (o ? t.right : i.right - t.left) - 30);
@@ -268,7 +268,7 @@ var pe = class {
268
268
  write: (e) => this.placeInfo(e),
269
269
  key: this
270
270
  }, this.space = null, this.currentClass = "";
271
- let r = e.state.field(t), { options: i, selected: a } = r.open, o = e.state.facet(M);
271
+ let r = e.state.field(t), { options: i, selected: a } = r.open, o = e.state.facet(N);
272
272
  this.optionContent = fe(o), this.optionClass = o.optionClass, this.tooltipClass = o.tooltipClass, this.range = F(i.length, a, o.maxRenderedOptions), this.dom = document.createElement("div"), this.dom.className = "cm-tooltip-autocomplete", this.updateTooltipClass(e.state), this.dom.addEventListener("mousedown", (n) => {
273
273
  let { options: r } = e.state.field(t).open;
274
274
  for (let t = n.target, i; t && t != this.dom; t = t.parentNode) if (t.nodeName == "LI" && (i = /-(\d+)$/.exec(t.id)) && +i[1] < r.length) {
@@ -281,7 +281,7 @@ var pe = class {
281
281
  }
282
282
  }), this.dom.addEventListener("focusout", (t) => {
283
283
  let n = e.state.field(this.stateField, !1);
284
- n && n.tooltip && e.state.facet(M).closeOnBlur && t.relatedTarget != e.contentDOM && e.dispatch({ effects: j.of(null) });
284
+ n && n.tooltip && e.state.facet(N).closeOnBlur && t.relatedTarget != e.contentDOM && e.dispatch({ effects: M.of(null) });
285
285
  }), this.showOptions(i, r.id);
286
286
  }
287
287
  mount() {
@@ -296,7 +296,7 @@ var pe = class {
296
296
  let t = e.state.field(this.stateField), n = e.startState.field(this.stateField);
297
297
  if (this.updateTooltipClass(e.state), t != n) {
298
298
  let { options: r, selected: i, disabled: a } = t.open;
299
- (!n.open || n.open.options != r) && (this.range = F(r.length, i, e.state.facet(M).maxRenderedOptions), this.showOptions(r, t.id)), this.updateSel(), a != n.open?.disabled && this.dom.classList.toggle("cm-tooltip-autocomplete-disabled", !!a);
299
+ (!n.open || n.open.options != r) && (this.range = F(r.length, i, e.state.facet(N).maxRenderedOptions), this.showOptions(r, t.id)), this.updateSel(), a != n.open?.disabled && this.dom.classList.toggle("cm-tooltip-autocomplete-disabled", !!a);
300
300
  }
301
301
  }
302
302
  updateTooltipClass(e) {
@@ -312,7 +312,7 @@ var pe = class {
312
312
  }
313
313
  updateSel() {
314
314
  let e = this.view.state.field(this.stateField), t = e.open;
315
- (t.selected > -1 && t.selected < this.range.from || t.selected >= this.range.to) && (this.range = F(t.options.length, t.selected, this.view.state.facet(M).maxRenderedOptions), this.showOptions(t.options, e.id));
315
+ (t.selected > -1 && t.selected < this.range.from || t.selected >= this.range.to) && (this.range = F(t.options.length, t.selected, this.view.state.facet(N).maxRenderedOptions), this.showOptions(t.options, e.id));
316
316
  let n = this.updateSelectedOption(t.selected);
317
317
  if (n) {
318
318
  this.destroyInfo();
@@ -322,7 +322,7 @@ var pe = class {
322
322
  if (!a) return;
323
323
  "then" in a ? a.then((t) => {
324
324
  t && this.view.state.field(this.stateField, !1) == e && this.addInfoPane(t, r);
325
- }).catch((e) => C(this.view.state, e, "completion info")) : (this.addInfoPane(a, r), n.setAttribute("aria-describedby", this.info.id));
325
+ }).catch((e) => _(this.view.state, e, "completion info")) : (this.addInfoPane(a, r), n.setAttribute("aria-describedby", this.info.id));
326
326
  }
327
327
  }
328
328
  addInfoPane(e, t) {
@@ -353,7 +353,7 @@ var pe = class {
353
353
  bottom: e.clientHeight
354
354
  };
355
355
  }
356
- return r.top > Math.min(i.bottom, t.bottom) - 10 || r.bottom < Math.max(i.top, t.top) + 10 ? null : this.view.state.facet(M).positionInfo(this.view, t, r, n, i, this.dom);
356
+ return r.top > Math.min(i.bottom, t.bottom) - 10 || r.bottom < Math.max(i.top, t.top) + 10 ? null : this.view.state.facet(N).positionInfo(this.view, t, r, n, i, this.dom);
357
357
  }
358
358
  placeInfo(e) {
359
359
  this.info && (e ? (e.style && (this.info.style.cssText = e.style), this.info.className = "cm-tooltip cm-completionInfo " + (e.class || "")) : this.info.style.cssText = "top: -1e6px");
@@ -413,15 +413,15 @@ function ge(e, t) {
413
413
  let e = typeof t == "string" ? t : t.name;
414
414
  r.some((t) => t.name == e) || r.push(typeof t == "string" ? { name: e } : t);
415
415
  }
416
- }, o = t.facet(M);
416
+ }, o = t.facet(N);
417
417
  for (let r of e) if (r.hasResult()) {
418
418
  let e = r.result.getMatch;
419
- if (r.result.filter === !1) for (let t of r.result.options) a(new E(t, r.source, e ? e(t) : [], 1e9 - n.length));
419
+ if (r.result.filter === !1) for (let t of r.result.options) a(new D(t, r.source, e ? e(t) : [], 1e9 - n.length));
420
420
  else {
421
- let n = t.sliceDoc(r.from, r.to), s, c = o.filterStrict ? new ue(n) : new le(n);
421
+ let n = t.sliceDoc(r.from, r.to), s, c = o.filterStrict ? new le(n) : new ce(n);
422
422
  for (let t of r.result.options) if (s = c.match(t.label)) {
423
423
  let n = t.displayLabel ? e ? e(t, s.matched) : [] : s.matched, o = s.score + (t.boost || 0);
424
- if (a(new E(t, r.source, n, o)), typeof t.section == "object" && t.section.rank === "dynamic") {
424
+ if (a(new D(t, r.source, n, o)), typeof t.section == "object" && t.section.rank === "dynamic") {
425
425
  let { name: e } = t.section;
426
426
  i ||= Object.create(null), i[e] = Math.max(o, i[e] || -1e9);
427
427
  }
@@ -454,7 +454,7 @@ var _e = class e {
454
454
  if (i && !o && t.some((e) => e.isPending)) return i.setDisabled();
455
455
  let s = ge(t, n);
456
456
  if (!s.length) return i && t.some((e) => e.isPending) ? i.setDisabled() : null;
457
- let c = n.facet(M).selectOnOpen ? 0 : -1;
457
+ let c = n.facet(N).selectOnOpen ? 0 : -1;
458
458
  if (i && i.selected != c && i.selected != -1) {
459
459
  let e = i.options[i.selected].completion;
460
460
  for (let t = 0; t < s.length; t++) if (s[t].completion == e) {
@@ -464,7 +464,7 @@ var _e = class e {
464
464
  }
465
465
  return new e(s, L(r, c), {
466
466
  pos: t.reduce((e, t) => t.hasResult() ? Math.min(e, t.from) : e, 1e8),
467
- create: Ee,
467
+ create: we,
468
468
  above: a.aboveCursor
469
469
  }, i ? i.timestamp : Date.now(), c, !1);
470
470
  }
@@ -485,10 +485,10 @@ var _e = class e {
485
485
  return new e(Se, "cm-ac-" + Math.floor(Math.random() * 2e6).toString(36), null);
486
486
  }
487
487
  update(t) {
488
- let { state: n } = t, r = n.facet(M), i = (r.override || n.languageDataAt("autocomplete", D(n)).map(ce)).map((e) => (this.active.find((t) => t.source == e) || new R(e, +!!this.active.some((e) => e.state != 0))).update(t, r));
488
+ let { state: n } = t, r = n.facet(N), i = (r.override || n.languageDataAt("autocomplete", O(n)).map(se)).map((e) => (this.active.find((t) => t.source == e) || new z(e, +!!this.active.some((e) => e.state != 0))).update(t, r));
489
489
  i.length == this.active.length && i.every((e, t) => e == this.active[t]) && (i = this.active);
490
- let a = this.open, o = t.effects.some((e) => e.is(z));
491
- a && t.docChanged && (a = a.map(t.changes)), t.selection || i.some((e) => e.hasResult() && t.changes.touchesRange(e.from, e.to)) || !ye(i, this.active) || o ? a = _e.build(i, n, this.id, a, r, o) : a && a.disabled && !i.some((e) => e.isPending) && (a = null), !a && i.every((e) => !e.isPending) && i.some((e) => e.hasResult()) && (i = i.map((e) => e.hasResult() ? new R(e.source, 0) : e));
490
+ let a = this.open, o = t.effects.some((e) => e.is(V));
491
+ a && t.docChanged && (a = a.map(t.changes)), t.selection || i.some((e) => e.hasResult() && t.changes.touchesRange(e.from, e.to)) || !ye(i, this.active) || o ? a = _e.build(i, n, this.id, a, r, o) : a && a.disabled && !i.some((e) => e.isPending) && (a = null), !a && i.every((e) => !e.isPending) && i.some((e) => e.hasResult()) && (i = i.map((e) => e.hasResult() ? new z(e.source, 0) : e));
492
492
  for (let e of t.effects) e.is(P) && (a &&= a.setSelected(e.value, this.id));
493
493
  return i == this.active && a == this.open ? this : new e(i, this.id, a);
494
494
  }
@@ -519,15 +519,15 @@ function L(e, t) {
519
519
  return t > -1 && (n["aria-activedescendant"] = e + "-" + t), n;
520
520
  }
521
521
  var Se = [];
522
- function Ce(e, t) {
522
+ function R(e, t) {
523
523
  if (e.isUserEvent("input.complete")) {
524
- let n = e.annotation(k);
524
+ let n = e.annotation(A);
525
525
  if (n && t.activateOnCompletion(n)) return 12;
526
526
  }
527
527
  let n = e.isUserEvent("input.type");
528
528
  return n && t.activateOnTyping ? 5 : n ? 1 : e.isUserEvent("delete.backward") ? 2 : e.selection ? 8 : e.docChanged ? 16 : 0;
529
529
  }
530
- var R = class e {
530
+ var z = class e {
531
531
  constructor(e, t, n = !1) {
532
532
  this.source = e, this.state = t, this.explicit = n;
533
533
  }
@@ -538,11 +538,11 @@ var R = class e {
538
538
  return this.state == 1;
539
539
  }
540
540
  update(t, n) {
541
- let r = Ce(t, n), i = this;
541
+ let r = R(t, n), i = this;
542
542
  (r & 8 || r & 16 && this.touches(t)) && (i = new e(i.source, 0)), r & 4 && i.state == 0 && (i = new e(this.source, 1)), i = i.updateFor(t, r);
543
- for (let n of t.effects) if (n.is(A)) i = new e(i.source, 1, n.value);
544
- else if (n.is(j)) i = new e(i.source, 0);
545
- else if (n.is(z)) for (let e of n.value) e.source == i.source && (i = e);
543
+ for (let n of t.effects) if (n.is(j)) i = new e(i.source, 1, n.value);
544
+ else if (n.is(M)) i = new e(i.source, 0);
545
+ else if (n.is(V)) for (let e of n.value) e.source == i.source && (i = e);
546
546
  return i;
547
547
  }
548
548
  updateFor(e, t) {
@@ -552,9 +552,9 @@ var R = class e {
552
552
  return this;
553
553
  }
554
554
  touches(e) {
555
- return e.changes.touchesRange(D(e.state));
555
+ return e.changes.touchesRange(O(e.state));
556
556
  }
557
- }, we = class e extends R {
557
+ }, B = class e extends z {
558
558
  constructor(e, t, n, r, i, a) {
559
559
  super(e, 3, t), this.limit = n, this.result = r, this.from = i, this.to = a;
560
560
  }
@@ -565,116 +565,116 @@ var R = class e {
565
565
  if (!(n & 3)) return this.map(t.changes);
566
566
  let r = this.result;
567
567
  r.map && !t.changes.empty && (r = r.map(r, t.changes));
568
- let i = t.changes.mapPos(this.from), a = t.changes.mapPos(this.to, 1), o = D(t.state);
569
- if (o > a || !r || n & 2 && (D(t.startState) == this.from || o < this.limit)) return new R(this.source, n & 4 ? 1 : 0);
568
+ let i = t.changes.mapPos(this.from), a = t.changes.mapPos(this.to, 1), o = O(t.state);
569
+ if (o > a || !r || n & 2 && (O(t.startState) == this.from || o < this.limit)) return new z(this.source, n & 4 ? 1 : 0);
570
570
  let s = t.changes.mapPos(this.limit);
571
- return Te(r.validFor, t.state, i, a) ? new e(this.source, this.explicit, s, r, i, a) : r.update && (r = r.update(r, i, a, new T(t.state, o, !1))) ? new e(this.source, this.explicit, s, r, r.from, r.to ?? D(t.state)) : new R(this.source, 1, this.explicit);
571
+ return Ce(r.validFor, t.state, i, a) ? new e(this.source, this.explicit, s, r, i, a) : r.update && (r = r.update(r, i, a, new E(t.state, o, !1))) ? new e(this.source, this.explicit, s, r, r.from, r.to ?? O(t.state)) : new z(this.source, 1, this.explicit);
572
572
  }
573
573
  map(t) {
574
574
  if (t.empty) return this;
575
575
  let n = this.result.map ? this.result.map(this.result, t) : this.result;
576
- return n ? new e(this.source, this.explicit, t.mapPos(this.limit), n, t.mapPos(this.from), t.mapPos(this.to, 1)) : new R(this.source, 0);
576
+ return n ? new e(this.source, this.explicit, t.mapPos(this.limit), n, t.mapPos(this.from), t.mapPos(this.to, 1)) : new z(this.source, 0);
577
577
  }
578
578
  touches(e) {
579
579
  return e.changes.touchesRange(this.from, this.to);
580
580
  }
581
581
  };
582
- function Te(e, t, n, r) {
582
+ function Ce(e, t, n, r) {
583
583
  if (!e) return !1;
584
584
  let i = t.sliceDoc(n, r);
585
- return typeof e == "function" ? e(i, n, r, t) : O(e, !0).test(i);
585
+ return typeof e == "function" ? e(i, n, r, t) : k(e, !0).test(i);
586
586
  }
587
- var z = /*@__PURE__*/ l.define({ map(e, t) {
587
+ var V = /*@__PURE__*/ l.define({ map(e, t) {
588
588
  return e.map((e) => e.map(t));
589
- } }), B = /*@__PURE__*/ c.define({
589
+ } }), H = /*@__PURE__*/ c.define({
590
590
  create() {
591
591
  return ve.start();
592
592
  },
593
593
  update(e, t) {
594
594
  return e.update(t);
595
595
  },
596
- provide: (e) => [g.from(e, (e) => e.tooltip), x.contentAttributes.from(e, (e) => e.attrs)]
596
+ provide: (e) => [g.from(e, (e) => e.tooltip), C.contentAttributes.from(e, (e) => e.attrs)]
597
597
  });
598
- function V(e, t) {
599
- let n = t.completion.apply || t.completion.label, r = e.state.field(B).active.find((e) => e.source == t.source);
600
- return r instanceof we && (typeof n == "string" ? e.dispatch({
601
- ...oe(e.state, n, r.from, r.to),
602
- annotations: k.of(t.completion)
598
+ function U(e, t) {
599
+ let n = t.completion.apply || t.completion.label, r = e.state.field(H).active.find((e) => e.source == t.source);
600
+ return r instanceof B && (typeof n == "string" ? e.dispatch({
601
+ ...ae(e.state, n, r.from, r.to),
602
+ annotations: A.of(t.completion)
603
603
  }) : n(e, t.completion, r.from, r.to), !0);
604
604
  }
605
- var Ee = /*@__PURE__*/ me(B, V);
606
- function H(e, t = "option") {
605
+ var we = /*@__PURE__*/ me(H, U);
606
+ function W(e, t = "option") {
607
607
  return (n) => {
608
- let r = n.state.field(B, !1);
609
- if (!r || !r.open || r.open.disabled || Date.now() - r.open.timestamp < n.state.facet(M).interactionDelay) return !1;
608
+ let r = n.state.field(H, !1);
609
+ if (!r || !r.open || r.open.disabled || Date.now() - r.open.timestamp < n.state.facet(N).interactionDelay) return !1;
610
610
  let i = 1, a;
611
611
  t == "page" && (a = b(n, r.open.tooltip)) && (i = Math.max(2, Math.floor(a.dom.offsetHeight / a.dom.querySelector("li").offsetHeight) - 1));
612
612
  let { length: o } = r.open.options, s = r.open.selected > -1 ? r.open.selected + i * (e ? 1 : -1) : e ? 0 : o - 1;
613
613
  return s < 0 ? s = t == "page" ? 0 : o - 1 : s >= o && (s = t == "page" ? o - 1 : 0), n.dispatch({ effects: P.of(s) }), !0;
614
614
  };
615
615
  }
616
- var De = (e) => {
617
- let t = e.state.field(B, !1);
618
- return e.state.readOnly || !t || !t.open || t.open.selected < 0 || t.open.disabled || Date.now() - t.open.timestamp < e.state.facet(M).interactionDelay ? !1 : V(e, t.open.options[t.open.selected]);
619
- }, U = (e) => e.state.field(B, !1) ? (e.dispatch({ effects: A.of(!0) }), !0) : !1, Oe = (e) => {
620
- let t = e.state.field(B, !1);
621
- return !t || !t.active.some((e) => e.state != 0) ? !1 : (e.dispatch({ effects: j.of(null) }), !0);
622
- }, ke = class {
616
+ var Te = (e) => {
617
+ let t = e.state.field(H, !1);
618
+ return e.state.readOnly || !t || !t.open || t.open.selected < 0 || t.open.disabled || Date.now() - t.open.timestamp < e.state.facet(N).interactionDelay ? !1 : U(e, t.open.options[t.open.selected]);
619
+ }, G = (e) => e.state.field(H, !1) ? (e.dispatch({ effects: j.of(!0) }), !0) : !1, Ee = (e) => {
620
+ let t = e.state.field(H, !1);
621
+ return !t || !t.active.some((e) => e.state != 0) ? !1 : (e.dispatch({ effects: M.of(null) }), !0);
622
+ }, De = class {
623
623
  constructor(e, t) {
624
624
  this.active = e, this.context = t, this.time = Date.now(), this.updates = [], this.done = void 0;
625
625
  }
626
- }, Ae = 50, je = 1e3, Me = /*@__PURE__*/ _.fromClass(class {
626
+ }, Oe = 50, ke = 1e3, Ae = /*@__PURE__*/ v.fromClass(class {
627
627
  constructor(e) {
628
628
  this.view = e, this.debounceUpdate = -1, this.running = [], this.debounceAccept = -1, this.pendingStart = !1, this.composing = 0;
629
- for (let t of e.state.field(B).active) t.isPending && this.startQuery(t);
629
+ for (let t of e.state.field(H).active) t.isPending && this.startQuery(t);
630
630
  }
631
631
  update(e) {
632
- let t = e.state.field(B), n = e.state.facet(M);
633
- if (!e.selectionSet && !e.docChanged && e.startState.field(B) == t) return;
632
+ let t = e.state.field(H), n = e.state.facet(N);
633
+ if (!e.selectionSet && !e.docChanged && e.startState.field(H) == t) return;
634
634
  let r = e.transactions.some((e) => {
635
- let t = Ce(e, n);
635
+ let t = R(e, n);
636
636
  return t & 8 || (e.selection || e.docChanged) && !(t & 3);
637
637
  });
638
638
  for (let t = 0; t < this.running.length; t++) {
639
639
  let n = this.running[t];
640
- if (r || n.context.abortOnDocChange && e.docChanged || n.updates.length + e.transactions.length > Ae && Date.now() - n.time > je) {
640
+ if (r || n.context.abortOnDocChange && e.docChanged || n.updates.length + e.transactions.length > Oe && Date.now() - n.time > ke) {
641
641
  for (let e of n.context.abortListeners) try {
642
642
  e();
643
643
  } catch (e) {
644
- C(this.view.state, e);
644
+ _(this.view.state, e);
645
645
  }
646
646
  n.context.abortListeners = null, this.running.splice(t--, 1);
647
647
  } else n.updates.push(...e.transactions);
648
648
  }
649
- this.debounceUpdate > -1 && clearTimeout(this.debounceUpdate), e.transactions.some((e) => e.effects.some((e) => e.is(A))) && (this.pendingStart = !0);
649
+ this.debounceUpdate > -1 && clearTimeout(this.debounceUpdate), e.transactions.some((e) => e.effects.some((e) => e.is(j))) && (this.pendingStart = !0);
650
650
  let i = this.pendingStart ? 50 : n.activateOnTypingDelay;
651
651
  if (this.debounceUpdate = t.active.some((e) => e.isPending && !this.running.some((t) => t.active.source == e.source)) ? setTimeout(() => this.startUpdate(), i) : -1, this.composing != 0) for (let t of e.transactions) t.isUserEvent("input.type") ? this.composing = 2 : this.composing == 2 && t.selection && (this.composing = 3);
652
652
  }
653
653
  startUpdate() {
654
654
  this.debounceUpdate = -1, this.pendingStart = !1;
655
- let { state: e } = this.view, t = e.field(B);
655
+ let { state: e } = this.view, t = e.field(H);
656
656
  for (let e of t.active) e.isPending && !this.running.some((t) => t.active.source == e.source) && this.startQuery(e);
657
- this.running.length && t.open && t.open.disabled && (this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(M).updateSyncTime));
657
+ this.running.length && t.open && t.open.disabled && (this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(N).updateSyncTime));
658
658
  }
659
659
  startQuery(e) {
660
- let { state: t } = this.view, n = new T(t, D(t), e.explicit, this.view), r = new ke(e, n);
660
+ let { state: t } = this.view, n = new E(t, O(t), e.explicit, this.view), r = new De(e, n);
661
661
  this.running.push(r), Promise.resolve(e.source(n)).then((e) => {
662
662
  r.context.aborted || (r.done = e || null, this.scheduleAccept());
663
663
  }, (e) => {
664
- this.view.dispatch({ effects: j.of(null) }), C(this.view.state, e);
664
+ this.view.dispatch({ effects: M.of(null) }), _(this.view.state, e);
665
665
  });
666
666
  }
667
667
  scheduleAccept() {
668
- this.running.every((e) => e.done !== void 0) ? this.accept() : this.debounceAccept < 0 && (this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(M).updateSyncTime));
668
+ this.running.every((e) => e.done !== void 0) ? this.accept() : this.debounceAccept < 0 && (this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(N).updateSyncTime));
669
669
  }
670
670
  accept() {
671
671
  this.debounceAccept > -1 && clearTimeout(this.debounceAccept), this.debounceAccept = -1;
672
- let e = [], t = this.view.state.facet(M), n = this.view.state.field(B);
672
+ let e = [], t = this.view.state.facet(N), n = this.view.state.field(H);
673
673
  for (let r = 0; r < this.running.length; r++) {
674
674
  let i = this.running[r];
675
675
  if (i.done === void 0) continue;
676
676
  if (this.running.splice(r--, 1), i.done) {
677
- let n = D(i.updates.length ? i.updates[0].startState : this.view.state), r = Math.min(n, i.done.from + +!i.active.explicit), a = new we(i.active.source, i.active.explicit, r, i.done, i.done.from, i.done.to ?? n);
677
+ let n = O(i.updates.length ? i.updates[0].startState : this.view.state), r = Math.min(n, i.done.from + +!i.active.explicit), a = new B(i.active.source, i.active.explicit, r, i.done, i.done.from, i.done.to ?? n);
678
678
  for (let e of i.updates) a = a.update(e, t);
679
679
  if (a.hasResult()) {
680
680
  e.push(a);
@@ -684,34 +684,34 @@ var De = (e) => {
684
684
  let a = n.active.find((e) => e.source == i.active.source);
685
685
  if (a && a.isPending) {
686
686
  if (i.done == null) {
687
- let n = new R(i.active.source, 0);
687
+ let n = new z(i.active.source, 0);
688
688
  for (let e of i.updates) n = n.update(e, t);
689
689
  n.isPending || e.push(n);
690
690
  } else this.startQuery(a);
691
691
  }
692
692
  }
693
- (e.length || n.open && n.open.disabled) && this.view.dispatch({ effects: z.of(e) });
693
+ (e.length || n.open && n.open.disabled) && this.view.dispatch({ effects: V.of(e) });
694
694
  }
695
695
  }, { eventHandlers: {
696
696
  blur(e) {
697
- let t = this.view.state.field(B, !1);
698
- if (t && t.tooltip && this.view.state.facet(M).closeOnBlur) {
697
+ let t = this.view.state.field(H, !1);
698
+ if (t && t.tooltip && this.view.state.facet(N).closeOnBlur) {
699
699
  let n = t.open && b(this.view, t.open.tooltip);
700
- (!n || !n.dom.contains(e.relatedTarget)) && setTimeout(() => this.view.dispatch({ effects: j.of(null) }), 10);
700
+ (!n || !n.dom.contains(e.relatedTarget)) && setTimeout(() => this.view.dispatch({ effects: M.of(null) }), 10);
701
701
  }
702
702
  },
703
703
  compositionstart() {
704
704
  this.composing = 1;
705
705
  },
706
706
  compositionend() {
707
- this.composing == 3 && setTimeout(() => this.view.dispatch({ effects: A.of(!1) }), 20), this.composing = 0;
707
+ this.composing == 3 && setTimeout(() => this.view.dispatch({ effects: j.of(!1) }), 20), this.composing = 0;
708
708
  }
709
- } }), Ne = typeof navigator == "object" && /*@__PURE__*/ /Win/.test(navigator.platform), Pe = /*@__PURE__*/ s.highest(/*@__PURE__*/ x.domEventHandlers({ keydown(e, t) {
710
- let n = t.state.field(B, !1);
711
- if (!n || !n.open || n.open.disabled || n.open.selected < 0 || e.key.length > 1 || e.ctrlKey && !(Ne && e.altKey) || e.metaKey) return !1;
709
+ } }), je = typeof navigator == "object" && /*@__PURE__*/ /Win/.test(navigator.platform), Me = /*@__PURE__*/ s.highest(/*@__PURE__*/ C.domEventHandlers({ keydown(e, t) {
710
+ let n = t.state.field(H, !1);
711
+ if (!n || !n.open || n.open.disabled || n.open.selected < 0 || e.key.length > 1 || e.ctrlKey && !(je && e.altKey) || e.metaKey) return !1;
712
712
  let r = n.open.options[n.open.selected], i = n.active.find((e) => e.source == r.source), a = r.completion.commitCharacters || i.result.commitCharacters;
713
- return a && a.indexOf(e.key) > -1 && V(t, r), !1;
714
- } })), W = /*@__PURE__*/ x.baseTheme({
713
+ return a && a.indexOf(e.key) > -1 && U(t, r), !1;
714
+ } })), Ne = /*@__PURE__*/ C.baseTheme({
715
715
  ".cm-tooltip.cm-tooltip-autocomplete": { "& > ul": {
716
716
  fontFamily: "monospace",
717
717
  whiteSpace: "nowrap",
@@ -808,11 +808,11 @@ var De = (e) => {
808
808
  fontSize: "50%",
809
809
  verticalAlign: "middle"
810
810
  } }
811
- }), Fe = class {
811
+ }), Pe = class {
812
812
  constructor(e, t, n, r) {
813
813
  this.field = e, this.line = t, this.from = n, this.to = r;
814
814
  }
815
- }, Ie = class e {
815
+ }, Fe = class e {
816
816
  constructor(e, t, n) {
817
817
  this.field = e, this.from = t, this.to = n;
818
818
  }
@@ -820,7 +820,7 @@ var De = (e) => {
820
820
  let r = t.mapPos(this.from, -1, n.TrackDel), i = t.mapPos(this.to, 1, n.TrackDel);
821
821
  return r == null || i == null ? null : new e(this.field, r, i);
822
822
  }
823
- }, Le = class e {
823
+ }, Ie = class e {
824
824
  constructor(e, t) {
825
825
  this.lines = e, this.fieldPositions = t;
826
826
  }
@@ -829,14 +829,14 @@ var De = (e) => {
829
829
  for (let i of this.lines) {
830
830
  if (n.length) {
831
831
  let n = a, o = /^\t*/.exec(i)[0].length;
832
- for (let t = 0; t < o; t++) n += e.facet(te);
832
+ for (let t = 0; t < o; t++) n += e.facet(ee);
833
833
  r.push(t + n.length - o), i = n + i.slice(o);
834
834
  }
835
835
  n.push(i), t += i.length + 1;
836
836
  }
837
837
  return {
838
838
  text: n,
839
- ranges: this.fieldPositions.map((e) => new Ie(e.field, r[e.line] + e.from, r[e.line] + e.to))
839
+ ranges: this.fieldPositions.map((e) => new Fe(e.field, r[e.line] + e.from, r[e.line] + e.to))
840
840
  };
841
841
  }
842
842
  static parse(t) {
@@ -860,7 +860,7 @@ var De = (e) => {
860
860
  let t = a[2] ? 3 + (a[1] || "").length : 2;
861
861
  e.from -= t, e.to -= t;
862
862
  }
863
- i.push(new Fe(s, r.length, a.index, a.index + c.length)), e = e.slice(0, a.index) + o + e.slice(a.index + a[0].length);
863
+ i.push(new Pe(s, r.length, a.index, a.index + c.length)), e = e.slice(0, a.index) + o + e.slice(a.index + a[0].length);
864
864
  }
865
865
  e = e.replace(/\\([{}])/g, (e, t, n) => {
866
866
  for (let e of i) e.line == r.length && e.from > n && (e.from--, e.to--);
@@ -869,7 +869,7 @@ var De = (e) => {
869
869
  }
870
870
  return new e(r, i);
871
871
  }
872
- }, Re = /*@__PURE__*/ S.widget({ widget: /*@__PURE__*/ new class extends y {
872
+ }, Le = /*@__PURE__*/ w.widget({ widget: /*@__PURE__*/ new class extends S {
873
873
  toDOM() {
874
874
  let e = document.createElement("span");
875
875
  return e.className = "cm-snippetFieldPosition", e;
@@ -877,9 +877,9 @@ var De = (e) => {
877
877
  ignoreEvent() {
878
878
  return !1;
879
879
  }
880
- }() }), ze = /*@__PURE__*/ S.mark({ class: "cm-snippetField" }), G = class e {
880
+ }() }), Re = /*@__PURE__*/ w.mark({ class: "cm-snippetField" }), K = class e {
881
881
  constructor(e, t) {
882
- this.ranges = e, this.active = t, this.deco = S.set(e.map((e) => (e.from == e.to ? Re : ze).range(e.from, e.to)), !0);
882
+ this.ranges = e, this.active = t, this.deco = w.set(e.map((e) => (e.from == e.to ? Le : Re).range(e.from, e.to)), !0);
883
883
  }
884
884
  map(t) {
885
885
  let n = [];
@@ -893,26 +893,26 @@ var De = (e) => {
893
893
  selectionInsideField(e) {
894
894
  return e.ranges.every((e) => this.ranges.some((t) => t.field == this.active && t.from <= e.from && t.to >= e.to));
895
895
  }
896
- }, K = /*@__PURE__*/ l.define({ map(e, t) {
896
+ }, q = /*@__PURE__*/ l.define({ map(e, t) {
897
897
  return e && e.map(t);
898
- } }), Be = /*@__PURE__*/ l.define(), q = /*@__PURE__*/ c.define({
898
+ } }), ze = /*@__PURE__*/ l.define(), J = /*@__PURE__*/ c.define({
899
899
  create() {
900
900
  return null;
901
901
  },
902
902
  update(e, t) {
903
903
  for (let n of t.effects) {
904
- if (n.is(K)) return n.value;
905
- if (n.is(Be) && e) return new G(e.ranges, n.value);
904
+ if (n.is(q)) return n.value;
905
+ if (n.is(ze) && e) return new K(e.ranges, n.value);
906
906
  }
907
907
  return e && t.docChanged && (e = e.map(t.changes)), e && t.selection && !e.selectionInsideField(t.selection) && (e = null), e;
908
908
  },
909
- provide: (e) => x.decorations.from(e, (e) => e ? e.deco : S.none)
909
+ provide: (e) => C.decorations.from(e, (e) => e ? e.deco : w.none)
910
910
  });
911
- function J(e, n) {
911
+ function Y(e, n) {
912
912
  return t.create(e.filter((e) => e.field == n).map((e) => t.range(e.from, e.to)));
913
913
  }
914
- function Ve(e) {
915
- let t = Le.parse(e);
914
+ function Be(e) {
915
+ let t = Ie.parse(e);
916
916
  return (e, n, r, o) => {
917
917
  let { text: s, ranges: c } = t.instantiate(e.state, r), { main: u } = e.state.selection, d = {
918
918
  changes: {
@@ -921,61 +921,61 @@ function Ve(e) {
921
921
  insert: a.of(s)
922
922
  },
923
923
  scrollIntoView: !0,
924
- annotations: n ? [k.of(n), i.userEvent.of("input.complete")] : void 0
924
+ annotations: n ? [A.of(n), i.userEvent.of("input.complete")] : void 0
925
925
  };
926
- if (c.length && (d.selection = J(c, 0)), c.some((e) => e.field > 0)) {
927
- let t = new G(c, 0), n = d.effects = [K.of(t)];
928
- e.state.field(q, !1) === void 0 && n.push(l.appendConfig.of([
929
- q,
930
- Ge,
931
- qe,
932
- W
926
+ if (c.length && (d.selection = Y(c, 0)), c.some((e) => e.field > 0)) {
927
+ let t = new K(c, 0), n = d.effects = [q.of(t)];
928
+ e.state.field(J, !1) === void 0 && n.push(l.appendConfig.of([
929
+ J,
930
+ We,
931
+ Ke,
932
+ Ne
933
933
  ]));
934
934
  }
935
935
  e.dispatch(e.state.update(d));
936
936
  };
937
937
  }
938
- function He(e) {
938
+ function Ve(e) {
939
939
  return ({ state: t, dispatch: n }) => {
940
- let r = t.field(q, !1);
940
+ let r = t.field(J, !1);
941
941
  if (!r || e < 0 && r.active == 0) return !1;
942
942
  let i = r.active + e, a = e > 0 && !r.ranges.some((t) => t.field == i + e);
943
943
  return n(t.update({
944
- selection: J(r.ranges, i),
945
- effects: K.of(a ? null : new G(r.ranges, i)),
944
+ selection: Y(r.ranges, i),
945
+ effects: q.of(a ? null : new K(r.ranges, i)),
946
946
  scrollIntoView: !0
947
947
  })), !0;
948
948
  };
949
949
  }
950
- var Ue = [{
950
+ var He = [{
951
951
  key: "Tab",
952
- run: /* @__PURE__ */ He(1),
953
- shift: /* @__PURE__ */ He(-1)
952
+ run: /* @__PURE__ */ Ve(1),
953
+ shift: /* @__PURE__ */ Ve(-1)
954
954
  }, {
955
955
  key: "Escape",
956
- run: ({ state: e, dispatch: t }) => e.field(q, !1) ? (t(e.update({ effects: K.of(null) })), !0) : !1
957
- }], We = /*@__PURE__*/ u.define({ combine(e) {
958
- return e.length ? e[0] : Ue;
959
- } }), Ge = /*@__PURE__*/ s.highest(/*@__PURE__*/ ee.compute([We], (e) => e.facet(We)));
960
- function Ke(e, t) {
956
+ run: ({ state: e, dispatch: t }) => e.field(J, !1) ? (t(e.update({ effects: q.of(null) })), !0) : !1
957
+ }], Ue = /*@__PURE__*/ u.define({ combine(e) {
958
+ return e.length ? e[0] : He;
959
+ } }), We = /*@__PURE__*/ s.highest(/*@__PURE__*/ y.compute([Ue], (e) => e.facet(Ue)));
960
+ function Ge(e, t) {
961
961
  return {
962
962
  ...t,
963
- apply: Ve(e)
963
+ apply: Be(e)
964
964
  };
965
965
  }
966
- var qe = /*@__PURE__*/ x.domEventHandlers({ mousedown(e, t) {
967
- let n = t.state.field(q, !1), r;
966
+ var Ke = /*@__PURE__*/ C.domEventHandlers({ mousedown(e, t) {
967
+ let n = t.state.field(J, !1), r;
968
968
  if (!n || (r = t.posAtCoords({
969
969
  x: e.clientX,
970
970
  y: e.clientY
971
971
  })) == null) return !1;
972
972
  let i = n.ranges.find((e) => e.from <= r && e.to >= r);
973
973
  return !i || i.field == n.active ? !1 : (t.dispatch({
974
- selection: J(n.ranges, i.field),
975
- effects: K.of(n.ranges.some((e) => e.field > i.field) ? new G(n.ranges, i.field) : null),
974
+ selection: Y(n.ranges, i.field),
975
+ effects: q.of(n.ranges.some((e) => e.field > i.field) ? new K(n.ranges, i.field) : null),
976
976
  scrollIntoView: !0
977
977
  }), !0);
978
- } }), Y = {
978
+ } }), X = {
979
979
  brackets: [
980
980
  "(",
981
981
  "[",
@@ -985,11 +985,11 @@ var qe = /*@__PURE__*/ x.domEventHandlers({ mousedown(e, t) {
985
985
  ],
986
986
  before: ")]}:;>",
987
987
  stringPrefixes: []
988
- }, X = /*@__PURE__*/ l.define({ map(e, t) {
988
+ }, Z = /*@__PURE__*/ l.define({ map(e, t) {
989
989
  return t.mapPos(e, -1, n.TrackAfter) ?? void 0;
990
- } }), Z = /*@__PURE__*/ new class extends r {}();
991
- Z.startSide = 1, Z.endSide = -1;
992
- var Je = /*@__PURE__*/ c.define({
990
+ } }), Q = /*@__PURE__*/ new class extends r {}();
991
+ Q.startSide = 1, Q.endSide = -1;
992
+ var qe = /*@__PURE__*/ c.define({
993
993
  create() {
994
994
  return f.empty;
995
995
  },
@@ -998,35 +998,35 @@ var Je = /*@__PURE__*/ c.define({
998
998
  let n = t.state.doc.lineAt(t.selection.main.head);
999
999
  e = e.update({ filter: (e) => e >= n.from && e <= n.to });
1000
1000
  }
1001
- for (let n of t.effects) n.is(X) && (e = e.update({ add: [Z.range(n.value, n.value + 1)] }));
1001
+ for (let n of t.effects) n.is(Z) && (e = e.update({ add: [Q.range(n.value, n.value + 1)] }));
1002
1002
  return e;
1003
1003
  }
1004
1004
  });
1005
- function Ye() {
1006
- return [et, Je];
1005
+ function Je() {
1006
+ return [$e, qe];
1007
1007
  }
1008
- var Xe = "()[]{}<>«»»«[]{}";
1009
- function Ze(e) {
1010
- for (let t = 0; t < 16; t += 2) if (Xe.charCodeAt(t) == e) return Xe.charAt(t + 1);
1008
+ var Ye = "()[]{}<>«»»«[]{}";
1009
+ function Xe(e) {
1010
+ for (let t = 0; t < 16; t += 2) if (Ye.charCodeAt(t) == e) return Ye.charAt(t + 1);
1011
1011
  return m(e < 128 ? e : e + 1);
1012
1012
  }
1013
- function Qe(e, t) {
1014
- return e.languageDataAt("closeBrackets", t)[0] || Y;
1013
+ function Ze(e, t) {
1014
+ return e.languageDataAt("closeBrackets", t)[0] || X;
1015
1015
  }
1016
- var $e = typeof navigator == "object" && /*@__PURE__*/ /Android\b/.test(navigator.userAgent), et = /*@__PURE__*/ x.inputHandler.of((t, n, r, i) => {
1017
- if (($e ? t.composing : t.compositionStarted) || t.state.readOnly) return !1;
1016
+ var Qe = typeof navigator == "object" && /*@__PURE__*/ /Android\b/.test(navigator.userAgent), $e = /*@__PURE__*/ C.inputHandler.of((t, n, r, i) => {
1017
+ if ((Qe ? t.composing : t.compositionStarted) || t.state.readOnly) return !1;
1018
1018
  let a = t.state.selection.main;
1019
1019
  if (i.length > 2 || i.length == 2 && p(e(i, 0)) == 1 || n != a.from || r != a.to) return !1;
1020
- let o = nt(t.state, i);
1020
+ let o = tt(t.state, i);
1021
1021
  return o ? (t.dispatch(o), !0) : !1;
1022
- }), tt = [{
1022
+ }), et = [{
1023
1023
  key: "Backspace",
1024
1024
  run: ({ state: n, dispatch: r }) => {
1025
1025
  if (n.readOnly) return !1;
1026
- let i = Qe(n, n.selection.main.head).brackets || Y.brackets, a = null, o = n.changeByRange((r) => {
1026
+ let i = Ze(n, n.selection.main.head).brackets || X.brackets, a = null, o = n.changeByRange((r) => {
1027
1027
  if (r.empty) {
1028
1028
  let a = rt(n.doc, r.head);
1029
- for (let o of i) if (o == a && $(n.doc, r.head) == Ze(e(o, 0))) return {
1029
+ for (let o of i) if (o == a && $(n.doc, r.head) == Xe(e(o, 0))) return {
1030
1030
  changes: {
1031
1031
  from: r.head - o.length,
1032
1032
  to: r.head + o.length
@@ -1042,18 +1042,18 @@ var $e = typeof navigator == "object" && /*@__PURE__*/ /Android\b/.test(navigato
1042
1042
  })), !a;
1043
1043
  }
1044
1044
  }];
1045
- function nt(t, n) {
1046
- let r = Qe(t, t.selection.main.head), i = r.brackets || Y.brackets;
1045
+ function tt(t, n) {
1046
+ let r = Ze(t, t.selection.main.head), i = r.brackets || X.brackets;
1047
1047
  for (let a of i) {
1048
- let o = Ze(e(a, 0));
1049
- if (n == a) return o == a ? ot(t, a, i.indexOf(a + a + a) > -1, r) : it(t, a, o, r.before || Y.before);
1050
- if (n == o && Q(t, t.selection.main.from)) return at(t, a, o);
1048
+ let o = Xe(e(a, 0));
1049
+ if (n == a) return o == a ? ot(t, a, i.indexOf(a + a + a) > -1, r) : it(t, a, o, r.before || X.before);
1050
+ if (n == o && nt(t, t.selection.main.from)) return at(t, a, o);
1051
1051
  }
1052
1052
  return null;
1053
1053
  }
1054
- function Q(e, t) {
1054
+ function nt(e, t) {
1055
1055
  let n = !1;
1056
- return e.field(Je).between(0, e.doc.length, (e) => {
1056
+ return e.field(qe).between(0, e.doc.length, (e) => {
1057
1057
  e == t && (n = !0);
1058
1058
  }), n;
1059
1059
  }
@@ -1075,7 +1075,7 @@ function it(e, n, r, i) {
1075
1075
  insert: r,
1076
1076
  from: o.to
1077
1077
  }],
1078
- effects: X.of(o.to + n.length),
1078
+ effects: Z.of(o.to + n.length),
1079
1079
  range: t.range(o.anchor + n.length, o.head + n.length)
1080
1080
  };
1081
1081
  let s = $(e.doc, o.head);
@@ -1084,7 +1084,7 @@ function it(e, n, r, i) {
1084
1084
  insert: n + r,
1085
1085
  from: o.head
1086
1086
  },
1087
- effects: X.of(o.head + n.length),
1087
+ effects: Z.of(o.head + n.length),
1088
1088
  range: t.cursor(o.head + n.length)
1089
1089
  } : { range: a = o };
1090
1090
  });
@@ -1108,7 +1108,7 @@ function at(e, n, r) {
1108
1108
  });
1109
1109
  }
1110
1110
  function ot(e, n, r, i) {
1111
- let a = i.stringPrefixes || Y.stringPrefixes, s = null, c = e.changeByRange((i) => {
1111
+ let a = i.stringPrefixes || X.stringPrefixes, s = null, c = e.changeByRange((i) => {
1112
1112
  if (!i.empty) return {
1113
1113
  changes: [{
1114
1114
  insert: n,
@@ -1117,7 +1117,7 @@ function ot(e, n, r, i) {
1117
1117
  insert: n,
1118
1118
  from: i.to
1119
1119
  }],
1120
- effects: X.of(i.to + n.length),
1120
+ effects: Z.of(i.to + n.length),
1121
1121
  range: t.range(i.anchor + n.length, i.head + n.length)
1122
1122
  };
1123
1123
  let c = i.head, l = $(e.doc, c), u;
@@ -1127,10 +1127,10 @@ function ot(e, n, r, i) {
1127
1127
  insert: n + n,
1128
1128
  from: c
1129
1129
  },
1130
- effects: X.of(c + n.length),
1130
+ effects: Z.of(c + n.length),
1131
1131
  range: t.cursor(c + n.length)
1132
1132
  };
1133
- if (Q(e, c)) {
1133
+ if (nt(e, c)) {
1134
1134
  let i = r && e.sliceDoc(c, c + n.length * 3) == n + n + n ? n + n + n : n;
1135
1135
  return {
1136
1136
  changes: {
@@ -1146,7 +1146,7 @@ function ot(e, n, r, i) {
1146
1146
  insert: n + n + n + n,
1147
1147
  from: c
1148
1148
  },
1149
- effects: X.of(c + n.length),
1149
+ effects: Z.of(c + n.length),
1150
1150
  range: t.cursor(c + n.length)
1151
1151
  };
1152
1152
  else if (e.charCategorizer(c)(l) != o.Word && lt(e, c, a) > -1 && !ct(e, c, n, a)) return {
@@ -1154,7 +1154,7 @@ function ot(e, n, r, i) {
1154
1154
  insert: n + n,
1155
1155
  from: c
1156
1156
  },
1157
- effects: X.of(c + n.length),
1157
+ effects: Z.of(c + n.length),
1158
1158
  range: t.cursor(c + n.length)
1159
1159
  };
1160
1160
  return { range: s = i };
@@ -1165,11 +1165,11 @@ function ot(e, n, r, i) {
1165
1165
  });
1166
1166
  }
1167
1167
  function st(e, t) {
1168
- let n = w(e).resolveInner(t + 1);
1168
+ let n = T(e).resolveInner(t + 1);
1169
1169
  return n.parent && n.from == t;
1170
1170
  }
1171
1171
  function ct(e, t, n, r) {
1172
- let i = w(e).resolveInner(t, -1), a = r.reduce((e, t) => Math.max(e, t.length), 0);
1172
+ let i = T(e).resolveInner(t, -1), a = r.reduce((e, t) => Math.max(e, t.length), 0);
1173
1173
  for (let o = 0; o < 5; o++) {
1174
1174
  let o = e.sliceDoc(i.from, Math.min(i.to, i.from + n.length + a)), s = o.indexOf(n);
1175
1175
  if (!s || s > -1 && r.indexOf(o.slice(0, s)) > -1) {
@@ -1197,51 +1197,51 @@ function lt(e, t, n) {
1197
1197
  }
1198
1198
  function ut(e = {}) {
1199
1199
  return [
1200
- Pe,
1201
- B,
1202
- M.of(e),
1203
1200
  Me,
1201
+ H,
1202
+ N.of(e),
1203
+ Ae,
1204
1204
  ft,
1205
- W
1205
+ Ne
1206
1206
  ];
1207
1207
  }
1208
1208
  var dt = [
1209
1209
  {
1210
1210
  key: "Ctrl-Space",
1211
- run: U
1211
+ run: G
1212
1212
  },
1213
1213
  {
1214
1214
  mac: "Alt-`",
1215
- run: U
1215
+ run: G
1216
1216
  },
1217
1217
  {
1218
1218
  mac: "Alt-i",
1219
- run: U
1219
+ run: G
1220
1220
  },
1221
1221
  {
1222
1222
  key: "Escape",
1223
- run: Oe
1223
+ run: Ee
1224
1224
  },
1225
1225
  {
1226
1226
  key: "ArrowDown",
1227
- run: /*@__PURE__*/ H(!0)
1227
+ run: /*@__PURE__*/ W(!0)
1228
1228
  },
1229
1229
  {
1230
1230
  key: "ArrowUp",
1231
- run: /*@__PURE__*/ H(!1)
1231
+ run: /*@__PURE__*/ W(!1)
1232
1232
  },
1233
1233
  {
1234
1234
  key: "PageDown",
1235
- run: /*@__PURE__*/ H(!0, "page")
1235
+ run: /*@__PURE__*/ W(!0, "page")
1236
1236
  },
1237
1237
  {
1238
1238
  key: "PageUp",
1239
- run: /*@__PURE__*/ H(!1, "page")
1239
+ run: /*@__PURE__*/ W(!1, "page")
1240
1240
  },
1241
1241
  {
1242
1242
  key: "Enter",
1243
- run: De
1243
+ run: Te
1244
1244
  }
1245
- ], ft = /*@__PURE__*/ s.highest(/*@__PURE__*/ ee.computeN([M], (e) => e.facet(M).defaultKeymap ? [dt] : []));
1245
+ ], ft = /*@__PURE__*/ s.highest(/*@__PURE__*/ y.computeN([N], (e) => e.facet(N).defaultKeymap ? [dt] : []));
1246
1246
  //#endregion
1247
- export { ie as a, Ke as c, tt as i, ut as n, dt as o, Ye as r, ae as s, T as t };
1247
+ export { re as a, ae as c, et as i, Be as l, ut as n, dt as o, Je as r, ie as s, E as t, Ge as u };