@pi-outpost/embed 0.42.0 → 0.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/CodeEditor-84sk1WGW.cjs +9 -0
  2. package/dist/{CodeEditor-CxKTvrhG.js → CodeEditor-CNBsvq8Z.js} +1081 -698
  3. package/dist/{dist-BDenKBYL.cjs → dist-B9TXDASo.cjs} +1 -1
  4. package/dist/{dist-AeGgfThs.cjs → dist-BF9tfVH8.cjs} +1 -1
  5. package/dist/{dist-BWEDf1a-.js → dist-BIMxMB--.js} +49 -49
  6. package/dist/{dist-C6eKaA9j.cjs → dist-BLS46S7g.cjs} +2 -2
  7. package/dist/{dist-CGZbBQje.js → dist-BWAsFrsx.js} +69 -69
  8. package/dist/{dist-DaJf_JYz.js → dist-BZ1m84Kh.js} +56 -56
  9. package/dist/{dist-CYUF5YPj.js → dist-Bg1-NGne.js} +13 -13
  10. package/dist/{dist-gn9y7Yb8.js → dist-BjQ1Exnz.js} +26 -26
  11. package/dist/{dist-DEZD35IP.cjs → dist-BlUoR-U1.cjs} +1 -1
  12. package/dist/{dist-DNg4hNu7.js → dist-BnXHuZGz.js} +93 -93
  13. package/dist/{dist-Kg2QsUg8.js → dist-C2UMsquH.js} +74 -74
  14. package/dist/{dist-D_oMTxAl.cjs → dist-CELe3Rxj.cjs} +2 -2
  15. package/dist/{dist-CmF-TINl.cjs → dist-CEPd6ecF.cjs} +1 -1
  16. package/dist/{dist-Cz8GulTe.cjs → dist-CGPxOMk5.cjs} +2 -2
  17. package/dist/{dist-CCIM600Y.cjs → dist-CPxwFKs7.cjs} +3 -3
  18. package/dist/{dist-CIBKGNWD.js → dist-Ca51SM3i.js} +141 -141
  19. package/dist/{dist-BWVp6Da-.js → dist-CcTOENSK.js} +21 -21
  20. package/dist/{dist-M4fo1U45.cjs → dist-CkDnvyBs.cjs} +1 -1
  21. package/dist/{dist-BTD5L343.js → dist-CpOA8cNn.js} +121 -121
  22. package/dist/{dist-CQNYwGEy.cjs → dist-CpsCEkIr.cjs} +1 -1
  23. package/dist/{dist-LM11INLG.js → dist-CwPu13CG.js} +38 -38
  24. package/dist/{dist-lPCEVnGX.js → dist-DCT8mdeU.js} +47 -47
  25. package/dist/{dist-rfjaCa2V.cjs → dist-DJYmQsI-.cjs} +1 -1
  26. package/dist/{dist-DszFZlYh.js → dist-DeLxY4Ia.js} +32 -32
  27. package/dist/{dist-2ynRxsSC.cjs → dist-Lxxq5IH0.cjs} +1 -1
  28. package/dist/{dist-hv72z6I6.js → dist-SqwJhRs0.js} +65 -65
  29. package/dist/{dist-D6LkseRA.cjs → dist-W-WjEDJm.cjs} +1 -1
  30. package/dist/{dist-CFf_g4kk.cjs → dist-c-DRw6Dh.cjs} +1 -1
  31. package/dist/{dist-ChWDi62w.js → dist-iZeihidk.js} +296 -296
  32. package/dist/{dist-BJHB0x8Y.js → dist-qeX2QqDc.js} +1 -1
  33. package/dist/{dist-Dpu_aN4m.cjs → dist-sM-IE5EO.cjs} +1 -1
  34. package/dist/{dist-CT7H4C9g.cjs → dist-vBlUeRrZ.cjs} +1 -1
  35. package/dist/pi-outpost-embed.cjs +29 -28
  36. package/dist/pi-outpost-embed.js +2300 -2183
  37. package/package.json +1 -1
  38. package/dist/CodeEditor-B699PZlx.cjs +0 -6
@@ -1,14 +1,14 @@
1
1
  import { n as e } from "./rolldown-runtime-5HNE8Q1r.js";
2
- import { $ as t, A as n, B as r, C as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, N as m, O as ee, P as h, Q as g, R as _, S as te, U as ne, V as re, W as ie, X as v, Y as ae, Z as oe, at as y, b as se, c as ce, ct as le, dt as ue, et as b, ft as de, g as fe, gt as pe, it as me, j as he, k as x, lt as S, m as ge, mt as _e, nt as ve, ot as C, pt as w, q as ye, rt as be, s as xe, st as Se, t as Ce, tt as we, ut as T, w as E, xt as Te, y as Ee, z as De } from "./dist-BJHB0x8Y.js";
3
- import { useEffect as Oe, useImperativeHandle as ke, useRef as Ae } from "react";
4
- import { jsx as je } from "react/jsx-runtime";
2
+ import { $ as t, A as n, B as r, C as i, Ct as a, E as o, F as s, G as c, H as l, I as u, J as d, K as f, L as p, M as m, N as h, O as ee, P as g, Q as _, R as te, S as ne, U as re, V as ie, W as ae, X as oe, Y as se, Z as ce, at as le, b as ue, c as de, ct as v, dt as y, et as b, ft as x, g as fe, gt as pe, ht as S, it as me, j as he, k as C, lt as w, m as ge, mt as _e, nt as T, ot as ve, pt as ye, q as be, rt as xe, s as Se, st as E, t as Ce, tt as we, ut as Te, vt as Ee, w as De, y as Oe, z as ke } from "./dist-qeX2QqDc.js";
3
+ import { useEffect as Ae, useImperativeHandle as je, useRef as Me } from "react";
4
+ import { jsx as Ne } from "react/jsx-runtime";
5
5
  //#region ../node_modules/@codemirror/autocomplete/dist/index.js
6
- var Me = class {
6
+ var Pe = class {
7
7
  constructor(e, t, n, r) {
8
8
  this.state = e, this.pos = t, this.explicit = n, this.view = r, this.abortListeners = [], this.abortOnDocChange = !1;
9
9
  }
10
10
  tokenBefore(e) {
11
- let t = x(this.state).resolveInner(this.pos, -1);
11
+ let t = C(this.state).resolveInner(this.pos, -1);
12
12
  for (; t && e.indexOf(t.name) < 0;) t = t.parent;
13
13
  return t ? {
14
14
  from: t.from,
@@ -18,7 +18,7 @@ var Me = class {
18
18
  } : null;
19
19
  }
20
20
  matchBefore(e) {
21
- 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(Re(e, !1));
21
+ 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(Be(e, !1));
22
22
  return i < 0 ? null : {
23
23
  from: n + i,
24
24
  to: this.pos,
@@ -32,21 +32,21 @@ var Me = class {
32
32
  e == "abort" && this.abortListeners && (this.abortListeners.push(t), n && n.onDocChange && (this.abortOnDocChange = !0));
33
33
  }
34
34
  };
35
- function Ne(e) {
35
+ function Fe(e) {
36
36
  let t = Object.keys(e).join(""), n = /\w/.test(t);
37
37
  return n && (t = t.replace(/\w/g, "")), `[${n ? "\\w" : ""}${t.replace(/[^\w\s]/g, "\\$&")}]`;
38
38
  }
39
- function Pe(e) {
39
+ function Ie(e) {
40
40
  let t = Object.create(null), n = Object.create(null);
41
41
  for (let { label: r } of e) {
42
42
  t[r[0]] = !0;
43
43
  for (let e = 1; e < r.length; e++) n[r[e]] = !0;
44
44
  }
45
- let r = Ne(t) + Ne(n) + "*$";
45
+ let r = Fe(t) + Fe(n) + "*$";
46
46
  return [RegExp("^" + r), new RegExp(r)];
47
47
  }
48
- function Fe(e) {
49
- let t = e.map((e) => typeof e == "string" ? { label: e } : e), [n, r] = t.every((e) => /^\w+$/.test(e.label)) ? [/\w*$/, /\w+$/] : Pe(t);
48
+ function Le(e) {
49
+ let t = e.map((e) => typeof e == "string" ? { label: e } : e), [n, r] = t.every((e) => /^\w+$/.test(e.label)) ? [/\w*$/, /\w+$/] : Ie(t);
50
50
  return (e) => {
51
51
  let i = e.matchBefore(r);
52
52
  return i || e.explicit ? {
@@ -56,16 +56,16 @@ function Fe(e) {
56
56
  } : null;
57
57
  };
58
58
  }
59
- function Ie(e, t) {
59
+ function Re(e, t) {
60
60
  return (n) => {
61
- for (let t = x(n.state).resolveInner(n.pos, -1); t; t = t.parent) {
61
+ for (let t = C(n.state).resolveInner(n.pos, -1); t; t = t.parent) {
62
62
  if (e.indexOf(t.name) > -1) return null;
63
63
  if (t.type.isTop) break;
64
64
  }
65
65
  return t(n);
66
66
  };
67
67
  }
68
- var Le = class {
68
+ var ze = class {
69
69
  constructor(e, t, n, r) {
70
70
  this.completion = e, this.source = t, this.match = n, this.score = r;
71
71
  }
@@ -73,12 +73,12 @@ var Le = class {
73
73
  function D(e) {
74
74
  return e.selection.main.from;
75
75
  }
76
- function Re(e, t) {
76
+ function Be(e, t) {
77
77
  let { source: n } = e, r = t && n[0] != "^", i = n[n.length - 1] != "$";
78
78
  return !r && !i ? e : RegExp(`${r ? "^" : ""}(?:${n})${i ? "$" : ""}`, e.flags ?? (e.ignoreCase ? "i" : ""));
79
79
  }
80
- var ze = /*@__PURE__*/ ye.define();
81
- function Be(e, t, n, r) {
80
+ var Ve = /*@__PURE__*/ se.define();
81
+ function He(e, t, n, r) {
82
82
  let { main: i } = e.selection, a = n - i.from, o = r - i.from;
83
83
  return {
84
84
  ...e.changeByRange((s) => {
@@ -90,27 +90,27 @@ function Be(e, t, n, r) {
90
90
  to: r == i.from ? s.to : s.from + o,
91
91
  insert: c
92
92
  },
93
- range: g.cursor(s.from + a + c.length)
93
+ range: b.cursor(s.from + a + c.length)
94
94
  };
95
95
  }),
96
96
  scrollIntoView: !0,
97
97
  userEvent: "input.complete"
98
98
  };
99
99
  }
100
- var Ve = /*@__PURE__*/ new WeakMap();
101
- function He(e) {
100
+ var Ue = /*@__PURE__*/ new WeakMap();
101
+ function We(e) {
102
102
  if (!Array.isArray(e)) return e;
103
- let t = Ve.get(e);
104
- return t || Ve.set(e, t = Fe(e)), t;
103
+ let t = Ue.get(e);
104
+ return t || Ue.set(e, t = Le(e)), t;
105
105
  }
106
- var Ue = /*@__PURE__*/ y.define(), O = /*@__PURE__*/ y.define(), We = class {
106
+ var Ge = /*@__PURE__*/ E.define(), O = /*@__PURE__*/ E.define(), Ke = class {
107
107
  constructor(e) {
108
108
  this.pattern = e, this.chars = [], this.folded = [], this.any = [], this.precise = [], this.byWord = [], this.score = 0, this.matched = [];
109
109
  for (let t = 0; t < e.length;) {
110
- let n = S(e, t), r = T(n);
110
+ let n = y(e, t), r = x(n);
111
111
  this.chars.push(n);
112
112
  let i = e.slice(t, t + r), a = i.toUpperCase();
113
- this.folded.push(S(a == i ? i.toLowerCase() : a, 0)), t += r;
113
+ this.folded.push(y(a == i ? i.toLowerCase() : a, 0)), t += r;
114
114
  }
115
115
  this.astral = e.length != this.chars.length;
116
116
  }
@@ -122,7 +122,7 @@ var Ue = /*@__PURE__*/ y.define(), O = /*@__PURE__*/ y.define(), We = class {
122
122
  if (e.length < this.pattern.length) return null;
123
123
  let { chars: t, folded: n, any: r, precise: i, byWord: a } = this;
124
124
  if (t.length == 1) {
125
- let r = S(e, 0), i = T(r), a = i == e.length ? 0 : -100;
125
+ let r = y(e, 0), i = x(r), a = i == e.length ? 0 : -100;
126
126
  if (r != t[0]) {
127
127
  if (r == n[0]) a += -200;
128
128
  else return null;
@@ -134,29 +134,29 @@ var Ue = /*@__PURE__*/ y.define(), O = /*@__PURE__*/ y.define(), We = class {
134
134
  let s = t.length, c = 0;
135
135
  if (o < 0) {
136
136
  for (let i = 0, a = Math.min(e.length, 200); i < a && c < s;) {
137
- let a = S(e, i);
138
- (a == t[c] || a == n[c]) && (r[c++] = i), i += T(a);
137
+ let a = y(e, i);
138
+ (a == t[c] || a == n[c]) && (r[c++] = i), i += x(a);
139
139
  }
140
140
  if (c < s) return null;
141
141
  }
142
- let l = 0, u = 0, d = !1, f = 0, p = -1, m = -1, ee = /[a-z]/.test(e), h = !0;
142
+ let l = 0, u = 0, d = !1, f = 0, p = -1, m = -1, h = /[a-z]/.test(e), ee = !0;
143
143
  for (let r = 0, c = Math.min(e.length, 200), g = 0; r < c && u < s;) {
144
- let c = S(e, r);
144
+ let c = y(e, r);
145
145
  o < 0 && (l < s && c == t[l] && (i[l++] = r), f < s && (c == t[f] || c == n[f] ? (f == 0 && (p = r), m = r + 1, f++) : f = 0));
146
- let _, te = c < 255 ? c >= 48 && c <= 57 || c >= 97 && c <= 122 ? 2 : +(c >= 65 && c <= 90) : (_ = _e(c)) == _.toLowerCase() ? _ == _.toUpperCase() ? 0 : 2 : 1;
147
- (!r || te == 1 && ee || g == 0 && te != 0) && (t[u] == c || n[u] == c && (d = !0) ? a[u++] = r : a.length && (h = !1)), g = te, r += T(c);
146
+ let _, te = c < 255 ? c >= 48 && c <= 57 || c >= 97 && c <= 122 ? 2 : +(c >= 65 && c <= 90) : (_ = pe(c)) == _.toLowerCase() ? _ == _.toUpperCase() ? 0 : 2 : 1;
147
+ (!r || te == 1 && h || g == 0 && te != 0) && (t[u] == c || n[u] == c && (d = !0) ? a[u++] = r : a.length && (ee = !1)), g = te, r += x(c);
148
148
  }
149
- return u == s && a[0] == 0 && h ? this.result(-100 + (d ? -200 : 0), a, e) : f == s && p == 0 ? this.ret(-200 - e.length + (m == e.length ? 0 : -100), [0, m]) : o > -1 ? this.ret(-700 - e.length, [o, o + this.pattern.length]) : f == s ? this.ret(-900 - e.length, [p, m]) : u == s ? this.result(-100 + (d ? -200 : 0) + -700 + (h ? 0 : -1100), a, e) : t.length == 2 ? null : this.result((r[0] ? -700 : 0) + -200 + -1100, r, e);
149
+ return u == s && a[0] == 0 && ee ? this.result(-100 + (d ? -200 : 0), a, e) : f == s && p == 0 ? this.ret(-200 - e.length + (m == e.length ? 0 : -100), [0, m]) : o > -1 ? this.ret(-700 - e.length, [o, o + this.pattern.length]) : f == s ? this.ret(-900 - e.length, [p, m]) : u == s ? this.result(-100 + (d ? -200 : 0) + -700 + (ee ? 0 : -1100), a, e) : t.length == 2 ? null : this.result((r[0] ? -700 : 0) + -200 + -1100, r, e);
150
150
  }
151
151
  result(e, t, n) {
152
152
  let r = [], i = 0;
153
153
  for (let e of t) {
154
- let t = e + (this.astral ? T(S(n, e)) : 1);
154
+ let t = e + (this.astral ? x(y(n, e)) : 1);
155
155
  i && r[i - 1] == e ? r[i - 1] = t : (r[i++] = e, r[i++] = t);
156
156
  }
157
157
  return this.ret(e - n.length, r);
158
158
  }
159
- }, Ge = class {
159
+ }, qe = class {
160
160
  constructor(e) {
161
161
  this.pattern = e, this.matched = [], this.score = 0, this.folded = e.toLowerCase();
162
162
  }
@@ -165,8 +165,8 @@ var Ue = /*@__PURE__*/ y.define(), O = /*@__PURE__*/ y.define(), We = class {
165
165
  let t = e.slice(0, this.pattern.length), n = t == this.pattern ? 0 : t.toLowerCase() == this.folded ? -200 : null;
166
166
  return n == null ? null : (this.matched = [0, t.length], this.score = n + (e.length == this.pattern.length ? 0 : -100), this);
167
167
  }
168
- }, k = /*@__PURE__*/ b.define({ combine(e) {
169
- return ue(e, {
168
+ }, k = /*@__PURE__*/ T.define({ combine(e) {
169
+ return ye(e, {
170
170
  activateOnTyping: !0,
171
171
  activateOnCompletion: () => !1,
172
172
  activateOnTypingDelay: 100,
@@ -180,7 +180,7 @@ var Ue = /*@__PURE__*/ y.define(), O = /*@__PURE__*/ y.define(), We = class {
180
180
  aboveCursor: !1,
181
181
  icons: !0,
182
182
  addToOptions: [],
183
- positionInfo: qe,
183
+ positionInfo: Ye,
184
184
  filterStrict: !1,
185
185
  compareCompletions: (e, t) => (e.sortText || e.label).localeCompare(t.sortText || t.label),
186
186
  interactionDelay: 75,
@@ -189,31 +189,31 @@ var Ue = /*@__PURE__*/ y.define(), O = /*@__PURE__*/ y.define(), We = class {
189
189
  defaultKeymap: (e, t) => e && t,
190
190
  closeOnBlur: (e, t) => e && t,
191
191
  icons: (e, t) => e && t,
192
- tooltipClass: (e, t) => (n) => Ke(e(n), t(n)),
193
- optionClass: (e, t) => (n) => Ke(e(n), t(n)),
192
+ tooltipClass: (e, t) => (n) => Je(e(n), t(n)),
193
+ optionClass: (e, t) => (n) => Je(e(n), t(n)),
194
194
  addToOptions: (e, t) => e.concat(t),
195
195
  filterStrict: (e, t) => e || t
196
196
  });
197
197
  } });
198
- function Ke(e, t) {
198
+ function Je(e, t) {
199
199
  return e ? t ? e + " " + t : e : t;
200
200
  }
201
- function qe(e, t, n, r, i, a) {
202
- let o = e.textDirection == he.RTL, s = o, c = !1, l = "top", u, d, f = t.left - i.left, p = i.right - t.right, m = r.right - r.left, ee = r.bottom - r.top;
203
- 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 - ee)) - t.top, d = Math.min(400, s ? f : p);
201
+ function Ye(e, t, n, r, i, a) {
202
+ let o = e.textDirection == he.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;
203
+ 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);
204
204
  else {
205
205
  c = !0, d = Math.min(400, (o ? t.right : i.right - t.left) - 30);
206
206
  let e = i.bottom - t.bottom;
207
- e >= ee || e > t.top ? u = n.bottom - t.top : (l = "bottom", u = t.bottom - n.top);
207
+ e >= h || e > t.top ? u = n.bottom - t.top : (l = "bottom", u = t.bottom - n.top);
208
208
  }
209
- let h = (t.bottom - t.top) / a.offsetHeight, g = (t.right - t.left) / a.offsetWidth;
209
+ let ee = (t.bottom - t.top) / a.offsetHeight, g = (t.right - t.left) / a.offsetWidth;
210
210
  return {
211
- style: `${l}: ${u / h}px; max-width: ${d / g}px`,
211
+ style: `${l}: ${u / ee}px; max-width: ${d / g}px`,
212
212
  class: "cm-completionInfo-" + (c ? o ? "left-narrow" : "right-narrow" : s ? "left" : "right")
213
213
  };
214
214
  }
215
- var Je = /*@__PURE__*/ y.define();
216
- function Ye(e) {
215
+ var Xe = /*@__PURE__*/ E.define();
216
+ function Ze(e) {
217
217
  let t = e.addToOptions.slice();
218
218
  return e.icons && t.push({
219
219
  render(e) {
@@ -244,7 +244,7 @@ function Ye(e) {
244
244
  position: 80
245
245
  }), t.sort((e, t) => e.position - t.position).map((e) => e.render);
246
246
  }
247
- function Xe(e, t, n) {
247
+ function Qe(e, t, n) {
248
248
  if (e <= n) return {
249
249
  from: 0,
250
250
  to: e
@@ -262,7 +262,7 @@ function Xe(e, t, n) {
262
262
  to: e - (r - 1) * n
263
263
  };
264
264
  }
265
- var Ze = class {
265
+ var $e = class {
266
266
  constructor(e, t, n) {
267
267
  this.view = e, this.stateField = t, this.applyCompletion = n, this.info = null, this.infoDestroy = null, this.placeInfoReq = {
268
268
  read: () => this.measureInfo(),
@@ -270,7 +270,7 @@ var Ze = class {
270
270
  key: this
271
271
  }, this.space = null, this.currentClass = "";
272
272
  let r = e.state.field(t), { options: i, selected: a } = r.open, o = e.state.facet(k);
273
- this.optionContent = Ye(o), this.optionClass = o.optionClass, this.tooltipClass = o.tooltipClass, this.range = Xe(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
+ this.optionContent = Ze(o), this.optionClass = o.optionClass, this.tooltipClass = o.tooltipClass, this.range = Qe(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) => {
274
274
  let { options: r } = e.state.field(t).open;
275
275
  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) {
276
276
  this.applyCompletion(e, r[+i[1]]), n.preventDefault();
@@ -278,7 +278,7 @@ var Ze = class {
278
278
  }
279
279
  if (n.target == this.list) {
280
280
  let t = this.list.classList.contains("cm-completionListIncompleteTop") && n.clientY < this.list.firstChild.getBoundingClientRect().top ? this.range.from - 1 : this.list.classList.contains("cm-completionListIncompleteBottom") && n.clientY > this.list.lastChild.getBoundingClientRect().bottom ? this.range.to : null;
281
- t != null && (e.dispatch({ effects: Je.of(t) }), n.preventDefault());
281
+ t != null && (e.dispatch({ effects: Xe.of(t) }), n.preventDefault());
282
282
  }
283
283
  }), this.dom.addEventListener("focusout", (t) => {
284
284
  let n = e.state.field(this.stateField, !1);
@@ -297,7 +297,7 @@ var Ze = class {
297
297
  let t = e.state.field(this.stateField), n = e.startState.field(this.stateField);
298
298
  if (this.updateTooltipClass(e.state), t != n) {
299
299
  let { options: r, selected: i, disabled: a } = t.open;
300
- (!n.open || n.open.options != r) && (this.range = Xe(r.length, i, e.state.facet(k).maxRenderedOptions), this.showOptions(r, t.id)), this.updateSel(), a != n.open?.disabled && this.dom.classList.toggle("cm-tooltip-autocomplete-disabled", !!a);
300
+ (!n.open || n.open.options != r) && (this.range = Qe(r.length, i, e.state.facet(k).maxRenderedOptions), this.showOptions(r, t.id)), this.updateSel(), a != n.open?.disabled && this.dom.classList.toggle("cm-tooltip-autocomplete-disabled", !!a);
301
301
  }
302
302
  }
303
303
  updateTooltipClass(e) {
@@ -313,7 +313,7 @@ var Ze = class {
313
313
  }
314
314
  updateSel() {
315
315
  let e = this.view.state.field(this.stateField), t = e.open;
316
- (t.selected > -1 && t.selected < this.range.from || t.selected >= this.range.to) && (this.range = Xe(t.options.length, t.selected, this.view.state.facet(k).maxRenderedOptions), this.showOptions(t.options, e.id));
316
+ (t.selected > -1 && t.selected < this.range.from || t.selected >= this.range.to) && (this.range = Qe(t.options.length, t.selected, this.view.state.facet(k).maxRenderedOptions), this.showOptions(t.options, e.id));
317
317
  let n = this.updateSelectedOption(t.selected);
318
318
  if (n) {
319
319
  this.destroyInfo();
@@ -323,7 +323,7 @@ var Ze = class {
323
323
  if (!a) return;
324
324
  "then" in a ? a.then((t) => {
325
325
  t && this.view.state.field(this.stateField, !1) == e && this.addInfoPane(t, r);
326
- }).catch((e) => ie(this.view.state, e, "completion info")) : (this.addInfoPane(a, r), n.setAttribute("aria-describedby", this.info.id));
326
+ }).catch((e) => f(this.view.state, e, "completion info")) : (this.addInfoPane(a, r), n.setAttribute("aria-describedby", this.info.id));
327
327
  }
328
328
  }
329
329
  addInfoPane(e, t) {
@@ -339,7 +339,7 @@ var Ze = class {
339
339
  updateSelectedOption(e) {
340
340
  let t = null;
341
341
  for (let n = this.list.firstChild, r = this.range.from; n; n = n.nextSibling, r++) n.nodeName != "LI" || !n.id ? r-- : r == e ? n.hasAttribute("aria-selected") || (n.setAttribute("aria-selected", "true"), t = n) : n.hasAttribute("aria-selected") && (n.removeAttribute("aria-selected"), n.removeAttribute("aria-describedby"));
342
- return t && $e(this.list, t), t;
342
+ return t && tt(this.list, t), t;
343
343
  }
344
344
  measureInfo() {
345
345
  let e = this.dom.querySelector("[aria-selected]");
@@ -395,17 +395,17 @@ var Ze = class {
395
395
  this.destroyInfo();
396
396
  }
397
397
  };
398
- function Qe(e, t) {
399
- return (n) => new Ze(n, e, t);
398
+ function et(e, t) {
399
+ return (n) => new $e(n, e, t);
400
400
  }
401
- function $e(e, t) {
401
+ function tt(e, t) {
402
402
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = n.height / e.offsetHeight;
403
403
  r.top < n.top ? e.scrollTop -= (n.top - r.top) / i : r.bottom > n.bottom && (e.scrollTop += (r.bottom - n.bottom) / i);
404
404
  }
405
- function et(e) {
405
+ function nt(e) {
406
406
  return (e.boost || 0) * 100 + (e.apply ? 10 : 0) + (e.info ? 5 : 0) + +!!e.type;
407
407
  }
408
- function tt(e, t) {
408
+ function rt(e, t) {
409
409
  let n = [], r = null, i = null, a = (e) => {
410
410
  n.push(e);
411
411
  let { section: t } = e.completion;
@@ -417,12 +417,12 @@ function tt(e, t) {
417
417
  }, o = t.facet(k);
418
418
  for (let r of e) if (r.hasResult()) {
419
419
  let e = r.result.getMatch;
420
- if (r.result.filter === !1) for (let t of r.result.options) a(new Le(t, r.source, e ? e(t) : [], 1e9 - n.length));
420
+ if (r.result.filter === !1) for (let t of r.result.options) a(new ze(t, r.source, e ? e(t) : [], 1e9 - n.length));
421
421
  else {
422
- let n = t.sliceDoc(r.from, r.to), s, c = o.filterStrict ? new Ge(n) : new We(n);
422
+ let n = t.sliceDoc(r.from, r.to), s, c = o.filterStrict ? new qe(n) : new Ke(n);
423
423
  for (let t of r.result.options) if (s = c.match(t.label)) {
424
424
  let n = t.displayLabel ? e ? e(t, s.matched) : [] : s.matched, o = s.score + (t.boost || 0);
425
- if (a(new Le(t, r.source, n, o)), typeof t.section == "object" && t.section.rank === "dynamic") {
425
+ if (a(new ze(t, r.source, n, o)), typeof t.section == "object" && t.section.rank === "dynamic") {
426
426
  let { name: e } = t.section;
427
427
  i ||= Object.create(null), i[e] = Math.max(o, i[e] || -1e9);
428
428
  }
@@ -440,20 +440,20 @@ function tt(e, t) {
440
440
  let s = [], c = null, l = o.compareCompletions;
441
441
  for (let e of n.sort((e, t) => t.score - e.score || l(e.completion, t.completion))) {
442
442
  let t = e.completion;
443
- !c || c.label != t.label || c.detail != t.detail || c.type != null && t.type != null && c.type != t.type || c.apply != t.apply || c.boost != t.boost ? s.push(e) : et(e.completion) > et(c) && (s[s.length - 1] = e), c = e.completion;
443
+ !c || c.label != t.label || c.detail != t.detail || c.type != null && t.type != null && c.type != t.type || c.apply != t.apply || c.boost != t.boost ? s.push(e) : nt(e.completion) > nt(c) && (s[s.length - 1] = e), c = e.completion;
444
444
  }
445
445
  return s;
446
446
  }
447
- var nt = class e {
447
+ var it = class e {
448
448
  constructor(e, t, n, r, i, a) {
449
449
  this.options = e, this.attrs = t, this.tooltip = n, this.timestamp = r, this.selected = i, this.disabled = a;
450
450
  }
451
451
  setSelected(t, n) {
452
- return t == this.selected || t >= this.options.length ? this : new e(this.options, st(n, t), this.tooltip, this.timestamp, t, this.disabled);
452
+ return t == this.selected || t >= this.options.length ? this : new e(this.options, lt(n, t), this.tooltip, this.timestamp, t, this.disabled);
453
453
  }
454
454
  static build(t, n, r, i, a, o) {
455
455
  if (i && !o && t.some((e) => e.isPending)) return i.setDisabled();
456
- let s = tt(t, n);
456
+ let s = rt(t, n);
457
457
  if (!s.length) return i && t.some((e) => e.isPending) ? i.setDisabled() : null;
458
458
  let c = n.facet(k).selectOnOpen ? 0 : -1;
459
459
  if (i && i.selected != c && i.selected != -1) {
@@ -463,9 +463,9 @@ var nt = class e {
463
463
  break;
464
464
  }
465
465
  }
466
- return new e(s, st(r, c), {
466
+ return new e(s, lt(r, c), {
467
467
  pos: t.reduce((e, t) => t.hasResult() ? Math.min(e, t.from) : e, 1e8),
468
- create: mt,
468
+ create: gt,
469
469
  above: a.aboveCursor
470
470
  }, i ? i.timestamp : Date.now(), c, !1);
471
471
  }
@@ -478,29 +478,29 @@ var nt = class e {
478
478
  setDisabled() {
479
479
  return new e(this.options, this.attrs, this.tooltip, this.timestamp, this.selected, !0);
480
480
  }
481
- }, rt = class e {
481
+ }, at = class e {
482
482
  constructor(e, t, n) {
483
483
  this.active = e, this.id = t, this.open = n;
484
484
  }
485
485
  static start() {
486
- return new e(ct, "cm-ac-" + Math.floor(Math.random() * 2e6).toString(36), null);
486
+ return new e(ut, "cm-ac-" + Math.floor(Math.random() * 2e6).toString(36), null);
487
487
  }
488
488
  update(t) {
489
- let { state: n } = t, r = n.facet(k), i = (r.override || n.languageDataAt("autocomplete", D(n)).map(He)).map((e) => (this.active.find((t) => t.source == e) || new A(e, +!!this.active.some((e) => e.state != 0))).update(t, r));
489
+ let { state: n } = t, r = n.facet(k), i = (r.override || n.languageDataAt("autocomplete", D(n)).map(We)).map((e) => (this.active.find((t) => t.source == e) || new A(e, +!!this.active.some((e) => e.state != 0))).update(t, r));
490
490
  i.length == this.active.length && i.every((e, t) => e == this.active[t]) && (i = this.active);
491
- let a = this.open, o = t.effects.some((e) => e.is(ft));
492
- a && t.docChanged && (a = a.map(t.changes)), t.selection || i.some((e) => e.hasResult() && t.changes.touchesRange(e.from, e.to)) || !it(i, this.active) || o ? a = nt.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 A(e.source, 0) : e));
493
- for (let e of t.effects) e.is(Je) && (a &&= a.setSelected(e.value, this.id));
491
+ let a = this.open, o = t.effects.some((e) => e.is(mt));
492
+ a && t.docChanged && (a = a.map(t.changes)), t.selection || i.some((e) => e.hasResult() && t.changes.touchesRange(e.from, e.to)) || !ot(i, this.active) || o ? a = it.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 A(e.source, 0) : e));
493
+ for (let e of t.effects) e.is(Xe) && (a &&= a.setSelected(e.value, this.id));
494
494
  return i == this.active && a == this.open ? this : new e(i, this.id, a);
495
495
  }
496
496
  get tooltip() {
497
497
  return this.open ? this.open.tooltip : null;
498
498
  }
499
499
  get attrs() {
500
- return this.open ? this.open.attrs : this.active.length ? at : ot;
500
+ return this.open ? this.open.attrs : this.active.length ? st : ct;
501
501
  }
502
502
  };
503
- function it(e, t) {
503
+ function ot(e, t) {
504
504
  if (e == t) return !0;
505
505
  for (let n = 0, r = 0;;) {
506
506
  for (; n < e.length && !e[n].hasResult();) n++;
@@ -510,8 +510,8 @@ function it(e, t) {
510
510
  if (e[n++].result != t[r++].result) return !1;
511
511
  }
512
512
  }
513
- var at = { "aria-autocomplete": "list" }, ot = {};
514
- function st(e, t) {
513
+ var st = { "aria-autocomplete": "list" }, ct = {};
514
+ function lt(e, t) {
515
515
  let n = {
516
516
  "aria-autocomplete": "list",
517
517
  "aria-haspopup": "listbox",
@@ -519,10 +519,10 @@ function st(e, t) {
519
519
  };
520
520
  return t > -1 && (n["aria-activedescendant"] = e + "-" + t), n;
521
521
  }
522
- var ct = [];
523
- function lt(e, t) {
522
+ var ut = [];
523
+ function dt(e, t) {
524
524
  if (e.isUserEvent("input.complete")) {
525
- let n = e.annotation(ze);
525
+ let n = e.annotation(Ve);
526
526
  if (n && t.activateOnCompletion(n)) return 12;
527
527
  }
528
528
  let n = e.isUserEvent("input.type");
@@ -539,11 +539,11 @@ var A = class e {
539
539
  return this.state == 1;
540
540
  }
541
541
  update(t, n) {
542
- let r = lt(t, n), i = this;
542
+ let r = dt(t, n), i = this;
543
543
  (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);
544
- for (let n of t.effects) if (n.is(Ue)) i = new e(i.source, 1, n.value);
544
+ for (let n of t.effects) if (n.is(Ge)) i = new e(i.source, 1, n.value);
545
545
  else if (n.is(O)) i = new e(i.source, 0);
546
- else if (n.is(ft)) for (let e of n.value) e.source == i.source && (i = e);
546
+ else if (n.is(mt)) for (let e of n.value) e.source == i.source && (i = e);
547
547
  return i;
548
548
  }
549
549
  updateFor(e, t) {
@@ -555,7 +555,7 @@ var A = class e {
555
555
  touches(e) {
556
556
  return e.changes.touchesRange(D(e.state));
557
557
  }
558
- }, ut = class e extends A {
558
+ }, ft = class e extends A {
559
559
  constructor(e, t, n, r, i, a) {
560
560
  super(e, 3, t), this.limit = n, this.result = r, this.from = i, this.to = a;
561
561
  }
@@ -569,7 +569,7 @@ var A = class e {
569
569
  let i = t.changes.mapPos(this.from), a = t.changes.mapPos(this.to, 1), o = D(t.state);
570
570
  if (o > a || !r || n & 2 && (D(t.startState) == this.from || o < this.limit)) return new A(this.source, n & 4 ? 1 : 0);
571
571
  let s = t.changes.mapPos(this.limit);
572
- return dt(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 Me(t.state, o, !1))) ? new e(this.source, this.explicit, s, r, r.from, r.to ?? D(t.state)) : new A(this.source, 1, this.explicit);
572
+ return pt(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 Pe(t.state, o, !1))) ? new e(this.source, this.explicit, s, r, r.from, r.to ?? D(t.state)) : new A(this.source, 1, this.explicit);
573
573
  }
574
574
  map(t) {
575
575
  if (t.empty) return this;
@@ -580,51 +580,51 @@ var A = class e {
580
580
  return e.changes.touchesRange(this.from, this.to);
581
581
  }
582
582
  };
583
- function dt(e, t, n, r) {
583
+ function pt(e, t, n, r) {
584
584
  if (!e) return !1;
585
585
  let i = t.sliceDoc(n, r);
586
- return typeof e == "function" ? e(i, n, r, t) : Re(e, !0).test(i);
586
+ return typeof e == "function" ? e(i, n, r, t) : Be(e, !0).test(i);
587
587
  }
588
- var ft = /*@__PURE__*/ y.define({ map(e, t) {
588
+ var mt = /*@__PURE__*/ E.define({ map(e, t) {
589
589
  return e.map((e) => e.map(t));
590
- } }), j = /*@__PURE__*/ C.define({
590
+ } }), j = /*@__PURE__*/ v.define({
591
591
  create() {
592
- return rt.start();
592
+ return at.start();
593
593
  },
594
594
  update(e, t) {
595
595
  return e.update(t);
596
596
  },
597
- provide: (e) => [d.from(e, (e) => e.tooltip), p.contentAttributes.from(e, (e) => e.attrs)]
597
+ provide: (e) => [d.from(e, (e) => e.tooltip), m.contentAttributes.from(e, (e) => e.attrs)]
598
598
  });
599
- function pt(e, t) {
599
+ function ht(e, t) {
600
600
  let n = t.completion.apply || t.completion.label, r = e.state.field(j).active.find((e) => e.source == t.source);
601
- return r instanceof ut && (typeof n == "string" ? e.dispatch({
602
- ...Be(e.state, n, r.from, r.to),
603
- annotations: ze.of(t.completion)
601
+ return r instanceof ft && (typeof n == "string" ? e.dispatch({
602
+ ...He(e.state, n, r.from, r.to),
603
+ annotations: Ve.of(t.completion)
604
604
  }) : n(e, t.completion, r.from, r.to), !0);
605
605
  }
606
- var mt = /*@__PURE__*/ Qe(j, pt);
607
- function ht(e, t = "option") {
606
+ var gt = /*@__PURE__*/ et(j, ht);
607
+ function _t(e, t = "option") {
608
608
  return (n) => {
609
609
  let r = n.state.field(j, !1);
610
610
  if (!r || !r.open || r.open.disabled || Date.now() - r.open.timestamp < n.state.facet(k).interactionDelay) return !1;
611
611
  let i = 1, a;
612
- t == "page" && (a = _(n, r.open.tooltip)) && (i = Math.max(2, Math.floor(a.dom.offsetHeight / a.dom.querySelector("li").offsetHeight) - 1));
612
+ t == "page" && (a = ke(n, r.open.tooltip)) && (i = Math.max(2, Math.floor(a.dom.offsetHeight / a.dom.querySelector("li").offsetHeight) - 1));
613
613
  let { length: o } = r.open.options, s = r.open.selected > -1 ? r.open.selected + i * (e ? 1 : -1) : e ? 0 : o - 1;
614
- return s < 0 ? s = t == "page" ? 0 : o - 1 : s >= o && (s = t == "page" ? o - 1 : 0), n.dispatch({ effects: Je.of(s) }), !0;
614
+ return s < 0 ? s = t == "page" ? 0 : o - 1 : s >= o && (s = t == "page" ? o - 1 : 0), n.dispatch({ effects: Xe.of(s) }), !0;
615
615
  };
616
616
  }
617
- var gt = (e) => {
617
+ var vt = (e) => {
618
618
  let t = e.state.field(j, !1);
619
- return e.state.readOnly || !t || !t.open || t.open.selected < 0 || t.open.disabled || Date.now() - t.open.timestamp < e.state.facet(k).interactionDelay ? !1 : pt(e, t.open.options[t.open.selected]);
620
- }, _t = (e) => e.state.field(j, !1) ? (e.dispatch({ effects: Ue.of(!0) }), !0) : !1, vt = (e) => {
619
+ return e.state.readOnly || !t || !t.open || t.open.selected < 0 || t.open.disabled || Date.now() - t.open.timestamp < e.state.facet(k).interactionDelay ? !1 : ht(e, t.open.options[t.open.selected]);
620
+ }, yt = (e) => e.state.field(j, !1) ? (e.dispatch({ effects: Ge.of(!0) }), !0) : !1, bt = (e) => {
621
621
  let t = e.state.field(j, !1);
622
622
  return !t || !t.active.some((e) => e.state != 0) ? !1 : (e.dispatch({ effects: O.of(null) }), !0);
623
- }, yt = class {
623
+ }, xt = class {
624
624
  constructor(e, t) {
625
625
  this.active = e, this.context = t, this.time = Date.now(), this.updates = [], this.done = void 0;
626
626
  }
627
- }, bt = 50, xt = 1e3, St = /*@__PURE__*/ m.fromClass(class {
627
+ }, St = 50, Ct = 1e3, wt = /*@__PURE__*/ g.fromClass(class {
628
628
  constructor(e) {
629
629
  this.view = e, this.debounceUpdate = -1, this.running = [], this.debounceAccept = -1, this.pendingStart = !1, this.composing = 0;
630
630
  for (let t of e.state.field(j).active) t.isPending && this.startQuery(t);
@@ -633,21 +633,21 @@ var gt = (e) => {
633
633
  let t = e.state.field(j), n = e.state.facet(k);
634
634
  if (!e.selectionSet && !e.docChanged && e.startState.field(j) == t) return;
635
635
  let r = e.transactions.some((e) => {
636
- let t = lt(e, n);
636
+ let t = dt(e, n);
637
637
  return t & 8 || (e.selection || e.docChanged) && !(t & 3);
638
638
  });
639
639
  for (let t = 0; t < this.running.length; t++) {
640
640
  let n = this.running[t];
641
- if (r || n.context.abortOnDocChange && e.docChanged || n.updates.length + e.transactions.length > bt && Date.now() - n.time > xt) {
641
+ if (r || n.context.abortOnDocChange && e.docChanged || n.updates.length + e.transactions.length > St && Date.now() - n.time > Ct) {
642
642
  for (let e of n.context.abortListeners) try {
643
643
  e();
644
644
  } catch (e) {
645
- ie(this.view.state, e);
645
+ f(this.view.state, e);
646
646
  }
647
647
  n.context.abortListeners = null, this.running.splice(t--, 1);
648
648
  } else n.updates.push(...e.transactions);
649
649
  }
650
- this.debounceUpdate > -1 && clearTimeout(this.debounceUpdate), e.transactions.some((e) => e.effects.some((e) => e.is(Ue))) && (this.pendingStart = !0);
650
+ this.debounceUpdate > -1 && clearTimeout(this.debounceUpdate), e.transactions.some((e) => e.effects.some((e) => e.is(Ge))) && (this.pendingStart = !0);
651
651
  let i = this.pendingStart ? 50 : n.activateOnTypingDelay;
652
652
  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);
653
653
  }
@@ -658,11 +658,11 @@ var gt = (e) => {
658
658
  this.running.length && t.open && t.open.disabled && (this.debounceAccept = setTimeout(() => this.accept(), this.view.state.facet(k).updateSyncTime));
659
659
  }
660
660
  startQuery(e) {
661
- let { state: t } = this.view, n = new Me(t, D(t), e.explicit, this.view), r = new yt(e, n);
661
+ let { state: t } = this.view, n = new Pe(t, D(t), e.explicit, this.view), r = new xt(e, n);
662
662
  this.running.push(r), Promise.resolve(e.source(n)).then((e) => {
663
663
  r.context.aborted || (r.done = e || null, this.scheduleAccept());
664
664
  }, (e) => {
665
- this.view.dispatch({ effects: O.of(null) }), ie(this.view.state, e);
665
+ this.view.dispatch({ effects: O.of(null) }), f(this.view.state, e);
666
666
  });
667
667
  }
668
668
  scheduleAccept() {
@@ -675,7 +675,7 @@ var gt = (e) => {
675
675
  let i = this.running[r];
676
676
  if (i.done === void 0) continue;
677
677
  if (this.running.splice(r--, 1), i.done) {
678
- 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 ut(i.active.source, i.active.explicit, r, i.done, i.done.from, i.done.to ?? n);
678
+ 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 ft(i.active.source, i.active.explicit, r, i.done, i.done.from, i.done.to ?? n);
679
679
  for (let e of i.updates) a = a.update(e, t);
680
680
  if (a.hasResult()) {
681
681
  e.push(a);
@@ -691,13 +691,13 @@ var gt = (e) => {
691
691
  } else this.startQuery(a);
692
692
  }
693
693
  }
694
- (e.length || n.open && n.open.disabled) && this.view.dispatch({ effects: ft.of(e) });
694
+ (e.length || n.open && n.open.disabled) && this.view.dispatch({ effects: mt.of(e) });
695
695
  }
696
696
  }, { eventHandlers: {
697
697
  blur(e) {
698
698
  let t = this.view.state.field(j, !1);
699
699
  if (t && t.tooltip && this.view.state.facet(k).closeOnBlur) {
700
- let n = t.open && _(this.view, t.open.tooltip);
700
+ let n = t.open && ke(this.view, t.open.tooltip);
701
701
  (!n || !n.dom.contains(e.relatedTarget)) && setTimeout(() => this.view.dispatch({ effects: O.of(null) }), 10);
702
702
  }
703
703
  },
@@ -705,14 +705,14 @@ var gt = (e) => {
705
705
  this.composing = 1;
706
706
  },
707
707
  compositionend() {
708
- this.composing == 3 && setTimeout(() => this.view.dispatch({ effects: Ue.of(!1) }), 20), this.composing = 0;
708
+ this.composing == 3 && setTimeout(() => this.view.dispatch({ effects: Ge.of(!1) }), 20), this.composing = 0;
709
709
  }
710
- } }), Ct = typeof navigator == "object" && /*@__PURE__*/ /Win/.test(navigator.platform), wt = /*@__PURE__*/ ve.highest(/*@__PURE__*/ p.domEventHandlers({ keydown(e, t) {
710
+ } }), Tt = typeof navigator == "object" && /*@__PURE__*/ /Win/.test(navigator.platform), Et = /*@__PURE__*/ me.highest(/*@__PURE__*/ m.domEventHandlers({ keydown(e, t) {
711
711
  let n = t.state.field(j, !1);
712
- if (!n || !n.open || n.open.disabled || n.open.selected < 0 || e.key.length > 1 || e.ctrlKey && !(Ct && e.altKey) || e.metaKey) return !1;
712
+ if (!n || !n.open || n.open.disabled || n.open.selected < 0 || e.key.length > 1 || e.ctrlKey && !(Tt && e.altKey) || e.metaKey) return !1;
713
713
  let r = n.open.options[n.open.selected], i = n.active.find((e) => e.source == r.source), a = r.completion.commitCharacters || i.result.commitCharacters;
714
- return a && a.indexOf(e.key) > -1 && pt(t, r), !1;
715
- } })), Tt = /*@__PURE__*/ p.baseTheme({
714
+ return a && a.indexOf(e.key) > -1 && ht(t, r), !1;
715
+ } })), Dt = /*@__PURE__*/ m.baseTheme({
716
716
  ".cm-tooltip.cm-tooltip-autocomplete": { "& > ul": {
717
717
  fontFamily: "monospace",
718
718
  whiteSpace: "nowrap",
@@ -809,19 +809,19 @@ var gt = (e) => {
809
809
  fontSize: "50%",
810
810
  verticalAlign: "middle"
811
811
  } }
812
- }), Et = class {
812
+ }), Ot = class {
813
813
  constructor(e, t, n, r) {
814
814
  this.field = e, this.line = t, this.from = n, this.to = r;
815
815
  }
816
- }, Dt = class e {
816
+ }, kt = class e {
817
817
  constructor(e, t, n) {
818
818
  this.field = e, this.from = t, this.to = n;
819
819
  }
820
820
  map(t) {
821
- let n = t.mapPos(this.from, -1, we.TrackDel), r = t.mapPos(this.to, 1, we.TrackDel);
821
+ let n = t.mapPos(this.from, -1, xe.TrackDel), r = t.mapPos(this.to, 1, xe.TrackDel);
822
822
  return n == null || r == null ? null : new e(this.field, n, r);
823
823
  }
824
- }, Ot = class e {
824
+ }, At = class e {
825
825
  constructor(e, t) {
826
826
  this.lines = e, this.fieldPositions = t;
827
827
  }
@@ -830,14 +830,14 @@ var gt = (e) => {
830
830
  for (let i of this.lines) {
831
831
  if (n.length) {
832
832
  let n = a, o = /^\t*/.exec(i)[0].length;
833
- for (let t = 0; t < o; t++) n += e.facet(E);
833
+ for (let t = 0; t < o; t++) n += e.facet(De);
834
834
  r.push(t + n.length - o), i = n + i.slice(o);
835
835
  }
836
836
  n.push(i), t += i.length + 1;
837
837
  }
838
838
  return {
839
839
  text: n,
840
- ranges: this.fieldPositions.map((e) => new Dt(e.field, r[e.line] + e.from, r[e.line] + e.to))
840
+ ranges: this.fieldPositions.map((e) => new kt(e.field, r[e.line] + e.from, r[e.line] + e.to))
841
841
  };
842
842
  }
843
843
  static parse(t) {
@@ -861,7 +861,7 @@ var gt = (e) => {
861
861
  let t = a[2] ? 3 + (a[1] || "").length : 2;
862
862
  e.from -= t, e.to -= t;
863
863
  }
864
- i.push(new Et(s, r.length, a.index, a.index + c.length)), e = e.slice(0, a.index) + o + e.slice(a.index + a[0].length);
864
+ i.push(new Ot(s, r.length, a.index, a.index + c.length)), e = e.slice(0, a.index) + o + e.slice(a.index + a[0].length);
865
865
  }
866
866
  e = e.replace(/\\([{}])/g, (e, t, n) => {
867
867
  for (let e of i) e.line == r.length && e.from > n && (e.from--, e.to--);
@@ -870,7 +870,7 @@ var gt = (e) => {
870
870
  }
871
871
  return new e(r, i);
872
872
  }
873
- }, kt = /*@__PURE__*/ n.widget({ widget: /*@__PURE__*/ new class extends h {
873
+ }, jt = /*@__PURE__*/ n.widget({ widget: /*@__PURE__*/ new class extends s {
874
874
  toDOM() {
875
875
  let e = document.createElement("span");
876
876
  return e.className = "cm-snippetFieldPosition", e;
@@ -878,9 +878,9 @@ var gt = (e) => {
878
878
  ignoreEvent() {
879
879
  return !1;
880
880
  }
881
- }() }), At = /*@__PURE__*/ n.mark({ class: "cm-snippetField" }), jt = class e {
881
+ }() }), Mt = /*@__PURE__*/ n.mark({ class: "cm-snippetField" }), Nt = class e {
882
882
  constructor(e, t) {
883
- this.ranges = e, this.active = t, this.deco = n.set(e.map((e) => (e.from == e.to ? kt : At).range(e.from, e.to)), !0);
883
+ this.ranges = e, this.active = t, this.deco = n.set(e.map((e) => (e.from == e.to ? jt : Mt).range(e.from, e.to)), !0);
884
884
  }
885
885
  map(t) {
886
886
  let n = [];
@@ -894,77 +894,77 @@ var gt = (e) => {
894
894
  selectionInsideField(e) {
895
895
  return e.ranges.every((e) => this.ranges.some((t) => t.field == this.active && t.from <= e.from && t.to >= e.to));
896
896
  }
897
- }, M = /*@__PURE__*/ y.define({ map(e, t) {
897
+ }, M = /*@__PURE__*/ E.define({ map(e, t) {
898
898
  return e && e.map(t);
899
- } }), Mt = /*@__PURE__*/ y.define(), N = /*@__PURE__*/ C.define({
899
+ } }), Pt = /*@__PURE__*/ E.define(), N = /*@__PURE__*/ v.define({
900
900
  create() {
901
901
  return null;
902
902
  },
903
903
  update(e, t) {
904
904
  for (let n of t.effects) {
905
905
  if (n.is(M)) return n.value;
906
- if (n.is(Mt) && e) return new jt(e.ranges, n.value);
906
+ if (n.is(Pt) && e) return new Nt(e.ranges, n.value);
907
907
  }
908
908
  return e && t.docChanged && (e = e.map(t.changes)), e && t.selection && !e.selectionInsideField(t.selection) && (e = null), e;
909
909
  },
910
- provide: (e) => p.decorations.from(e, (e) => e ? e.deco : n.none)
910
+ provide: (e) => m.decorations.from(e, (e) => e ? e.deco : n.none)
911
911
  });
912
- function Nt(e, t) {
913
- return g.create(e.filter((e) => e.field == t).map((e) => g.range(e.from, e.to)));
912
+ function Ft(e, t) {
913
+ return b.create(e.filter((e) => e.field == t).map((e) => b.range(e.from, e.to)));
914
914
  }
915
- function Pt(e) {
916
- let t = Ot.parse(e);
915
+ function It(e) {
916
+ let t = At.parse(e);
917
917
  return (e, n, r, i) => {
918
918
  let { text: a, ranges: o } = t.instantiate(e.state, r), { main: s } = e.state.selection, c = {
919
919
  changes: {
920
920
  from: r,
921
921
  to: i == s.from ? s.to : i,
922
- insert: Se.of(a)
922
+ insert: w.of(a)
923
923
  },
924
924
  scrollIntoView: !0,
925
- annotations: n ? [ze.of(n), le.userEvent.of("input.complete")] : void 0
925
+ annotations: n ? [Ve.of(n), Te.userEvent.of("input.complete")] : void 0
926
926
  };
927
- if (o.length && (c.selection = Nt(o, 0)), o.some((e) => e.field > 0)) {
928
- let t = new jt(o, 0), n = c.effects = [M.of(t)];
929
- e.state.field(N, !1) === void 0 && n.push(y.appendConfig.of([
927
+ if (o.length && (c.selection = Ft(o, 0)), o.some((e) => e.field > 0)) {
928
+ let t = new Nt(o, 0), n = c.effects = [M.of(t)];
929
+ e.state.field(N, !1) === void 0 && n.push(E.appendConfig.of([
930
930
  N,
931
- Rt,
932
931
  Bt,
933
- Tt
932
+ Ht,
933
+ Dt
934
934
  ]));
935
935
  }
936
936
  e.dispatch(e.state.update(c));
937
937
  };
938
938
  }
939
- function Ft(e) {
939
+ function Lt(e) {
940
940
  return ({ state: t, dispatch: n }) => {
941
941
  let r = t.field(N, !1);
942
942
  if (!r || e < 0 && r.active == 0) return !1;
943
943
  let i = r.active + e, a = e > 0 && !r.ranges.some((t) => t.field == i + e);
944
944
  return n(t.update({
945
- selection: Nt(r.ranges, i),
946
- effects: M.of(a ? null : new jt(r.ranges, i)),
945
+ selection: Ft(r.ranges, i),
946
+ effects: M.of(a ? null : new Nt(r.ranges, i)),
947
947
  scrollIntoView: !0
948
948
  })), !0;
949
949
  };
950
950
  }
951
- var It = [{
951
+ var Rt = [{
952
952
  key: "Tab",
953
- run: /* @__PURE__ */ Ft(1),
954
- shift: /* @__PURE__ */ Ft(-1)
953
+ run: /* @__PURE__ */ Lt(1),
954
+ shift: /* @__PURE__ */ Lt(-1)
955
955
  }, {
956
956
  key: "Escape",
957
957
  run: ({ state: e, dispatch: t }) => e.field(N, !1) ? (t(e.update({ effects: M.of(null) })), !0) : !1
958
- }], Lt = /*@__PURE__*/ b.define({ combine(e) {
959
- return e.length ? e[0] : It;
960
- } }), Rt = /*@__PURE__*/ ve.highest(/*@__PURE__*/ c.compute([Lt], (e) => e.facet(Lt)));
961
- function zt(e, t) {
958
+ }], zt = /*@__PURE__*/ T.define({ combine(e) {
959
+ return e.length ? e[0] : Rt;
960
+ } }), Bt = /*@__PURE__*/ me.highest(/*@__PURE__*/ ae.compute([zt], (e) => e.facet(zt)));
961
+ function Vt(e, t) {
962
962
  return {
963
963
  ...t,
964
- apply: Pt(e)
964
+ apply: It(e)
965
965
  };
966
966
  }
967
- var Bt = /*@__PURE__*/ p.domEventHandlers({ mousedown(e, t) {
967
+ var Ht = /*@__PURE__*/ m.domEventHandlers({ mousedown(e, t) {
968
968
  let n = t.state.field(N, !1), r;
969
969
  if (!n || (r = t.posAtCoords({
970
970
  x: e.clientX,
@@ -972,8 +972,8 @@ var Bt = /*@__PURE__*/ p.domEventHandlers({ mousedown(e, t) {
972
972
  })) == null) return !1;
973
973
  let i = n.ranges.find((e) => e.from <= r && e.to >= r);
974
974
  return !i || i.field == n.active ? !1 : (t.dispatch({
975
- selection: Nt(n.ranges, i.field),
976
- effects: M.of(n.ranges.some((e) => e.field > i.field) ? new jt(n.ranges, i.field) : null),
975
+ selection: Ft(n.ranges, i.field),
976
+ effects: M.of(n.ranges.some((e) => e.field > i.field) ? new Nt(n.ranges, i.field) : null),
977
977
  scrollIntoView: !0
978
978
  }), !0);
979
979
  } }), P = {
@@ -986,53 +986,53 @@ var Bt = /*@__PURE__*/ p.domEventHandlers({ mousedown(e, t) {
986
986
  ],
987
987
  before: ")]}:;>",
988
988
  stringPrefixes: []
989
- }, F = /*@__PURE__*/ y.define({ map(e, t) {
990
- return t.mapPos(e, -1, we.TrackAfter) ?? void 0;
991
- } }), Vt = /*@__PURE__*/ new class extends me {}();
992
- Vt.startSide = 1, Vt.endSide = -1;
993
- var Ht = /*@__PURE__*/ C.define({
989
+ }, F = /*@__PURE__*/ E.define({ map(e, t) {
990
+ return t.mapPos(e, -1, xe.TrackAfter) ?? void 0;
991
+ } }), Ut = /*@__PURE__*/ new class extends ve {}();
992
+ Ut.startSide = 1, Ut.endSide = -1;
993
+ var Wt = /*@__PURE__*/ v.define({
994
994
  create() {
995
- return be.empty;
995
+ return le.empty;
996
996
  },
997
997
  update(e, t) {
998
998
  if (e = e.map(t.changes), t.selection) {
999
999
  let n = t.state.doc.lineAt(t.selection.main.head);
1000
1000
  e = e.update({ filter: (e) => e >= n.from && e <= n.to });
1001
1001
  }
1002
- for (let n of t.effects) n.is(F) && (e = e.update({ add: [Vt.range(n.value, n.value + 1)] }));
1002
+ for (let n of t.effects) n.is(F) && (e = e.update({ add: [Ut.range(n.value, n.value + 1)] }));
1003
1003
  return e;
1004
1004
  }
1005
1005
  });
1006
- function Ut() {
1007
- return [Jt, Ht];
1006
+ function Gt() {
1007
+ return [Xt, Wt];
1008
1008
  }
1009
- var Wt = "()[]{}<>«»»«[]{}";
1010
- function Gt(e) {
1011
- for (let t = 0; t < 16; t += 2) if (Wt.charCodeAt(t) == e) return Wt.charAt(t + 1);
1012
- return _e(e < 128 ? e : e + 1);
1009
+ var Kt = "()[]{}<>«»»«[]{}";
1010
+ function qt(e) {
1011
+ for (let t = 0; t < 16; t += 2) if (Kt.charCodeAt(t) == e) return Kt.charAt(t + 1);
1012
+ return pe(e < 128 ? e : e + 1);
1013
1013
  }
1014
- function Kt(e, t) {
1014
+ function Jt(e, t) {
1015
1015
  return e.languageDataAt("closeBrackets", t)[0] || P;
1016
1016
  }
1017
- var qt = typeof navigator == "object" && /*@__PURE__*/ /Android\b/.test(navigator.userAgent), Jt = /*@__PURE__*/ p.inputHandler.of((e, t, n, r) => {
1018
- if ((qt ? e.composing : e.compositionStarted) || e.state.readOnly) return !1;
1017
+ var Yt = typeof navigator == "object" && /*@__PURE__*/ /Android\b/.test(navigator.userAgent), Xt = /*@__PURE__*/ m.inputHandler.of((e, t, n, r) => {
1018
+ if ((Yt ? e.composing : e.compositionStarted) || e.state.readOnly) return !1;
1019
1019
  let i = e.state.selection.main;
1020
- if (r.length > 2 || r.length == 2 && T(S(r, 0)) == 1 || t != i.from || n != i.to) return !1;
1021
- let a = Xt(e.state, r);
1020
+ if (r.length > 2 || r.length == 2 && x(y(r, 0)) == 1 || t != i.from || n != i.to) return !1;
1021
+ let a = Qt(e.state, r);
1022
1022
  return a ? (e.dispatch(a), !0) : !1;
1023
- }), Yt = [{
1023
+ }), Zt = [{
1024
1024
  key: "Backspace",
1025
1025
  run: ({ state: e, dispatch: t }) => {
1026
1026
  if (e.readOnly) return !1;
1027
- let n = Kt(e, e.selection.main.head).brackets || P.brackets, r = null, i = e.changeByRange((t) => {
1027
+ let n = Jt(e, e.selection.main.head).brackets || P.brackets, r = null, i = e.changeByRange((t) => {
1028
1028
  if (t.empty) {
1029
- let r = Qt(e.doc, t.head);
1030
- for (let i of n) if (i == r && I(e.doc, t.head) == Gt(S(i, 0))) return {
1029
+ let r = tn(e.doc, t.head);
1030
+ for (let i of n) if (i == r && en(e.doc, t.head) == qt(y(i, 0))) return {
1031
1031
  changes: {
1032
1032
  from: t.head - i.length,
1033
1033
  to: t.head + i.length
1034
1034
  },
1035
- range: g.cursor(t.head - i.length)
1035
+ range: b.cursor(t.head - i.length)
1036
1036
  };
1037
1037
  }
1038
1038
  return { range: r = t };
@@ -1043,30 +1043,30 @@ var qt = typeof navigator == "object" && /*@__PURE__*/ /Android\b/.test(navigato
1043
1043
  })), !r;
1044
1044
  }
1045
1045
  }];
1046
- function Xt(e, t) {
1047
- let n = Kt(e, e.selection.main.head), r = n.brackets || P.brackets;
1046
+ function Qt(e, t) {
1047
+ let n = Jt(e, e.selection.main.head), r = n.brackets || P.brackets;
1048
1048
  for (let i of r) {
1049
- let a = Gt(S(i, 0));
1050
- if (t == i) return a == i ? tn(e, i, r.indexOf(i + i + i) > -1, n) : $t(e, i, a, n.before || P.before);
1051
- if (t == a && Zt(e, e.selection.main.from)) return en(e, i, a);
1049
+ let a = qt(y(i, 0));
1050
+ if (t == i) return a == i ? an(e, i, r.indexOf(i + i + i) > -1, n) : nn(e, i, a, n.before || P.before);
1051
+ if (t == a && $t(e, e.selection.main.from)) return rn(e, i, a);
1052
1052
  }
1053
1053
  return null;
1054
1054
  }
1055
- function Zt(e, t) {
1055
+ function $t(e, t) {
1056
1056
  let n = !1;
1057
- return e.field(Ht).between(0, e.doc.length, (e) => {
1057
+ return e.field(Wt).between(0, e.doc.length, (e) => {
1058
1058
  e == t && (n = !0);
1059
1059
  }), n;
1060
1060
  }
1061
- function I(e, t) {
1061
+ function en(e, t) {
1062
1062
  let n = e.sliceString(t, t + 2);
1063
- return n.slice(0, T(S(n, 0)));
1063
+ return n.slice(0, x(y(n, 0)));
1064
1064
  }
1065
- function Qt(e, t) {
1065
+ function tn(e, t) {
1066
1066
  let n = e.sliceString(t - 2, t);
1067
- return T(S(n, 0)) == n.length ? n : n.slice(1);
1067
+ return x(y(n, 0)) == n.length ? n : n.slice(1);
1068
1068
  }
1069
- function $t(e, t, n, r) {
1069
+ function nn(e, t, n, r) {
1070
1070
  let i = null, a = e.changeByRange((a) => {
1071
1071
  if (!a.empty) return {
1072
1072
  changes: [{
@@ -1077,16 +1077,16 @@ function $t(e, t, n, r) {
1077
1077
  from: a.to
1078
1078
  }],
1079
1079
  effects: F.of(a.to + t.length),
1080
- range: g.range(a.anchor + t.length, a.head + t.length)
1080
+ range: b.range(a.anchor + t.length, a.head + t.length)
1081
1081
  };
1082
- let o = I(e.doc, a.head);
1082
+ let o = en(e.doc, a.head);
1083
1083
  return !o || /\s/.test(o) || r.indexOf(o) > -1 ? {
1084
1084
  changes: {
1085
1085
  insert: t + n,
1086
1086
  from: a.head
1087
1087
  },
1088
1088
  effects: F.of(a.head + t.length),
1089
- range: g.cursor(a.head + t.length)
1089
+ range: b.cursor(a.head + t.length)
1090
1090
  } : { range: i = a };
1091
1091
  });
1092
1092
  return i ? null : e.update(a, {
@@ -1094,21 +1094,21 @@ function $t(e, t, n, r) {
1094
1094
  userEvent: "input.type"
1095
1095
  });
1096
1096
  }
1097
- function en(e, t, n) {
1098
- let r = null, i = e.changeByRange((t) => t.empty && I(e.doc, t.head) == n ? {
1097
+ function rn(e, t, n) {
1098
+ let r = null, i = e.changeByRange((t) => t.empty && en(e.doc, t.head) == n ? {
1099
1099
  changes: {
1100
1100
  from: t.head,
1101
1101
  to: t.head + n.length,
1102
1102
  insert: n
1103
1103
  },
1104
- range: g.cursor(t.head + n.length)
1104
+ range: b.cursor(t.head + n.length)
1105
1105
  } : r = { range: t });
1106
1106
  return r ? null : e.update(i, {
1107
1107
  scrollIntoView: !0,
1108
1108
  userEvent: "input.type"
1109
1109
  });
1110
1110
  }
1111
- function tn(e, t, n, r) {
1111
+ function an(e, t, n, r) {
1112
1112
  let i = r.stringPrefixes || P.stringPrefixes, a = null, o = e.changeByRange((r) => {
1113
1113
  if (!r.empty) return {
1114
1114
  changes: [{
@@ -1119,19 +1119,19 @@ function tn(e, t, n, r) {
1119
1119
  from: r.to
1120
1120
  }],
1121
1121
  effects: F.of(r.to + t.length),
1122
- range: g.range(r.anchor + t.length, r.head + t.length)
1122
+ range: b.range(r.anchor + t.length, r.head + t.length)
1123
1123
  };
1124
- let o = r.head, s = I(e.doc, o), c;
1124
+ let o = r.head, s = en(e.doc, o), c;
1125
1125
  if (s == t) {
1126
- if (nn(e, o)) return {
1126
+ if (on(e, o)) return {
1127
1127
  changes: {
1128
1128
  insert: t + t,
1129
1129
  from: o
1130
1130
  },
1131
1131
  effects: F.of(o + t.length),
1132
- range: g.cursor(o + t.length)
1132
+ range: b.cursor(o + t.length)
1133
1133
  };
1134
- if (Zt(e, o)) {
1134
+ if ($t(e, o)) {
1135
1135
  let r = n && e.sliceDoc(o, o + t.length * 3) == t + t + t ? t + t + t : t;
1136
1136
  return {
1137
1137
  changes: {
@@ -1139,24 +1139,24 @@ function tn(e, t, n, r) {
1139
1139
  to: o + r.length,
1140
1140
  insert: r
1141
1141
  },
1142
- range: g.cursor(o + r.length)
1142
+ range: b.cursor(o + r.length)
1143
1143
  };
1144
1144
  }
1145
- } else if (n && e.sliceDoc(o - 2 * t.length, o) == t + t && (c = an(e, o - 2 * t.length, i)) > -1 && nn(e, c)) return {
1145
+ } else if (n && e.sliceDoc(o - 2 * t.length, o) == t + t && (c = cn(e, o - 2 * t.length, i)) > -1 && on(e, c)) return {
1146
1146
  changes: {
1147
1147
  insert: t + t + t + t,
1148
1148
  from: o
1149
1149
  },
1150
1150
  effects: F.of(o + t.length),
1151
- range: g.cursor(o + t.length)
1151
+ range: b.cursor(o + t.length)
1152
1152
  };
1153
- else if (e.charCategorizer(o)(s) != v.Word && an(e, o, i) > -1 && !rn(e, o, t, i)) return {
1153
+ else if (e.charCategorizer(o)(s) != _.Word && cn(e, o, i) > -1 && !sn(e, o, t, i)) return {
1154
1154
  changes: {
1155
1155
  insert: t + t,
1156
1156
  from: o
1157
1157
  },
1158
1158
  effects: F.of(o + t.length),
1159
- range: g.cursor(o + t.length)
1159
+ range: b.cursor(o + t.length)
1160
1160
  };
1161
1161
  return { range: a = r };
1162
1162
  });
@@ -1165,12 +1165,12 @@ function tn(e, t, n, r) {
1165
1165
  userEvent: "input.type"
1166
1166
  });
1167
1167
  }
1168
- function nn(e, t) {
1169
- let n = x(e).resolveInner(t + 1);
1168
+ function on(e, t) {
1169
+ let n = C(e).resolveInner(t + 1);
1170
1170
  return n.parent && n.from == t;
1171
1171
  }
1172
- function rn(e, t, n, r) {
1173
- let i = x(e).resolveInner(t, -1), a = r.reduce((e, t) => Math.max(e, t.length), 0);
1172
+ function sn(e, t, n, r) {
1173
+ let i = C(e).resolveInner(t, -1), a = r.reduce((e, t) => Math.max(e, t.length), 0);
1174
1174
  for (let o = 0; o < 5; o++) {
1175
1175
  let o = e.sliceDoc(i.from, Math.min(i.to, i.from + n.length + a)), s = o.indexOf(n);
1176
1176
  if (!s || s > -1 && r.indexOf(o.slice(0, s)) > -1) {
@@ -1187,81 +1187,81 @@ function rn(e, t, n, r) {
1187
1187
  }
1188
1188
  return !1;
1189
1189
  }
1190
- function an(e, t, n) {
1190
+ function cn(e, t, n) {
1191
1191
  let r = e.charCategorizer(t);
1192
- if (r(e.sliceDoc(t - 1, t)) != v.Word) return t;
1192
+ if (r(e.sliceDoc(t - 1, t)) != _.Word) return t;
1193
1193
  for (let i of n) {
1194
1194
  let n = t - i.length;
1195
- if (e.sliceDoc(n, t) == i && r(e.sliceDoc(n - 1, n)) != v.Word) return n;
1195
+ if (e.sliceDoc(n, t) == i && r(e.sliceDoc(n - 1, n)) != _.Word) return n;
1196
1196
  }
1197
1197
  return -1;
1198
1198
  }
1199
- function on(e = {}) {
1199
+ function ln(e = {}) {
1200
1200
  return [
1201
- wt,
1201
+ Et,
1202
1202
  j,
1203
1203
  k.of(e),
1204
- St,
1205
- cn,
1206
- Tt
1204
+ wt,
1205
+ dn,
1206
+ Dt
1207
1207
  ];
1208
1208
  }
1209
- var sn = [
1209
+ var un = [
1210
1210
  {
1211
1211
  key: "Ctrl-Space",
1212
- run: _t
1212
+ run: yt
1213
1213
  },
1214
1214
  {
1215
1215
  mac: "Alt-`",
1216
- run: _t
1216
+ run: yt
1217
1217
  },
1218
1218
  {
1219
1219
  mac: "Alt-i",
1220
- run: _t
1220
+ run: yt
1221
1221
  },
1222
1222
  {
1223
1223
  key: "Escape",
1224
- run: vt
1224
+ run: bt
1225
1225
  },
1226
1226
  {
1227
1227
  key: "ArrowDown",
1228
- run: /*@__PURE__*/ ht(!0)
1228
+ run: /*@__PURE__*/ _t(!0)
1229
1229
  },
1230
1230
  {
1231
1231
  key: "ArrowUp",
1232
- run: /*@__PURE__*/ ht(!1)
1232
+ run: /*@__PURE__*/ _t(!1)
1233
1233
  },
1234
1234
  {
1235
1235
  key: "PageDown",
1236
- run: /*@__PURE__*/ ht(!0, "page")
1236
+ run: /*@__PURE__*/ _t(!0, "page")
1237
1237
  },
1238
1238
  {
1239
1239
  key: "PageUp",
1240
- run: /*@__PURE__*/ ht(!1, "page")
1240
+ run: /*@__PURE__*/ _t(!1, "page")
1241
1241
  },
1242
1242
  {
1243
1243
  key: "Enter",
1244
- run: gt
1244
+ run: vt
1245
1245
  }
1246
- ], cn = /*@__PURE__*/ ve.highest(/*@__PURE__*/ c.computeN([k], (e) => e.facet(k).defaultKeymap ? [sn] : [])), ln = (e) => {
1247
- let { state: t } = e, n = t.doc.lineAt(t.selection.main.from), r = mn(e.state, n.from);
1248
- return r.line ? dn(e) : r.block ? pn(e) : !1;
1246
+ ], dn = /*@__PURE__*/ me.highest(/*@__PURE__*/ ae.computeN([k], (e) => e.facet(k).defaultKeymap ? [un] : [])), fn = (e) => {
1247
+ let { state: t } = e, n = t.doc.lineAt(t.selection.main.from), r = _n(e.state, n.from);
1248
+ return r.line ? mn(e) : r.block ? gn(e) : !1;
1249
1249
  };
1250
- function un(e, t) {
1250
+ function pn(e, t) {
1251
1251
  return ({ state: n, dispatch: r }) => {
1252
1252
  if (n.readOnly) return !1;
1253
1253
  let i = e(t, n);
1254
1254
  return i ? (r(n.update(i)), !0) : !1;
1255
1255
  };
1256
1256
  }
1257
- var dn = /*@__PURE__*/ un(vn, 0), fn = /*@__PURE__*/ un(_n, 0), pn = /*@__PURE__*/ un((e, t) => _n(e, t, gn(t)), 0);
1258
- function mn(e, t) {
1257
+ var mn = /*@__PURE__*/ pn(Sn, 0), hn = /*@__PURE__*/ pn(xn, 0), gn = /*@__PURE__*/ pn((e, t) => xn(e, t, bn(t)), 0);
1258
+ function _n(e, t) {
1259
1259
  let n = e.languageDataAt("commentTokens", t, 1);
1260
1260
  return n.length ? n[0] : {};
1261
1261
  }
1262
- var L = 50;
1263
- function hn(e, { open: t, close: n }, r, i) {
1264
- let a = e.sliceDoc(r - L, r), o = e.sliceDoc(i, i + L), s = /\s*$/.exec(a)[0].length, c = /^\s*/.exec(o)[0].length, l = a.length - s;
1262
+ var vn = 50;
1263
+ function yn(e, { open: t, close: n }, r, i) {
1264
+ let a = e.sliceDoc(r - vn, r), o = e.sliceDoc(i, i + vn), s = /\s*$/.exec(a)[0].length, c = /^\s*/.exec(o)[0].length, l = a.length - s;
1265
1265
  if (a.slice(l - t.length, l) == t && o.slice(c, c + n.length) == n) return {
1266
1266
  open: {
1267
1267
  pos: r - s,
@@ -1273,7 +1273,7 @@ function hn(e, { open: t, close: n }, r, i) {
1273
1273
  }
1274
1274
  };
1275
1275
  let u, d;
1276
- i - r <= 100 ? u = d = e.sliceDoc(r, i) : (u = e.sliceDoc(r, r + L), d = e.sliceDoc(i - L, i));
1276
+ i - r <= 100 ? u = d = e.sliceDoc(r, i) : (u = e.sliceDoc(r, r + vn), d = e.sliceDoc(i - vn, i));
1277
1277
  let f = /^\s*/.exec(u)[0].length, p = /\s*$/.exec(d)[0].length, m = d.length - p - n.length;
1278
1278
  return u.slice(f, f + t.length) == t && d.slice(m, m + n.length) == n ? {
1279
1279
  open: {
@@ -1286,7 +1286,7 @@ function hn(e, { open: t, close: n }, r, i) {
1286
1286
  }
1287
1287
  } : null;
1288
1288
  }
1289
- function gn(e) {
1289
+ function bn(e) {
1290
1290
  let t = [];
1291
1291
  for (let n of e.selection.ranges) {
1292
1292
  let r = e.doc.lineAt(n.from), i = n.to <= r.to ? r : e.doc.lineAt(n.to);
@@ -1299,10 +1299,10 @@ function gn(e) {
1299
1299
  }
1300
1300
  return t;
1301
1301
  }
1302
- function _n(e, t, n = t.selection.ranges) {
1303
- let r = n.map((e) => mn(t, e.from).block);
1302
+ function xn(e, t, n = t.selection.ranges) {
1303
+ let r = n.map((e) => _n(t, e.from).block);
1304
1304
  if (!r.every((e) => e)) return null;
1305
- let i = n.map((e, n) => hn(t, r[n], e.from, e.to));
1305
+ let i = n.map((e, n) => yn(t, r[n], e.from, e.to));
1306
1306
  if (e != 2 && !i.every((e) => e)) return { changes: t.changes(n.map((e, t) => i[t] ? [] : [{
1307
1307
  from: e.from,
1308
1308
  insert: r[t].open + " "
@@ -1326,13 +1326,13 @@ function _n(e, t, n = t.selection.ranges) {
1326
1326
  }
1327
1327
  return null;
1328
1328
  }
1329
- function vn(e, t, n = t.selection.ranges) {
1329
+ function Sn(e, t, n = t.selection.ranges) {
1330
1330
  let r = [], i = -1;
1331
1331
  ranges: for (let { from: e, to: a } of n) {
1332
1332
  let n = r.length, o = 1e9, s;
1333
1333
  for (let n = e; n <= a;) {
1334
1334
  let c = t.doc.lineAt(n);
1335
- if (s == null && (s = mn(t, c.from).line, !s)) continue ranges;
1335
+ if (s == null && (s = _n(t, c.from).line, !s)) continue ranges;
1336
1336
  if (c.from > i && (e == a || a > c.from)) {
1337
1337
  i = c.from;
1338
1338
  let e = /^\s*/.exec(c.text)[0].length, t = e == c.length, n = c.text.slice(e, e + s.length) == s ? e : -1;
@@ -1375,8 +1375,8 @@ function vn(e, t, n = t.selection.ranges) {
1375
1375
  }
1376
1376
  return null;
1377
1377
  }
1378
- var yn = /*@__PURE__*/ ye.define(), bn = /*@__PURE__*/ ye.define(), xn = /*@__PURE__*/ b.define(), Sn = /*@__PURE__*/ b.define({ combine(e) {
1379
- return ue(e, {
1378
+ var Cn = /*@__PURE__*/ se.define(), wn = /*@__PURE__*/ se.define(), Tn = /*@__PURE__*/ T.define(), En = /*@__PURE__*/ T.define({ combine(e) {
1379
+ return ye(e, {
1380
1380
  minDepth: 100,
1381
1381
  newGroupDelay: 500,
1382
1382
  joinToEvent: (e, t) => t
@@ -1385,19 +1385,19 @@ var yn = /*@__PURE__*/ ye.define(), bn = /*@__PURE__*/ ye.define(), xn = /*@__PU
1385
1385
  newGroupDelay: Math.min,
1386
1386
  joinToEvent: (e, t) => (n, r) => e(n, r) || t(n, r)
1387
1387
  });
1388
- } }), Cn = /*@__PURE__*/ C.define({
1388
+ } }), Dn = /*@__PURE__*/ v.define({
1389
1389
  create() {
1390
- return H.empty;
1390
+ return R.empty;
1391
1391
  },
1392
1392
  update(e, t) {
1393
- let n = t.state.facet(Sn), r = t.annotation(yn);
1393
+ let n = t.state.facet(En), r = t.annotation(Cn);
1394
1394
  if (r) {
1395
- let i = z.fromTransaction(t, r.selection), a = r.side, o = a == 0 ? e.undone : e.done;
1396
- return o = i ? B(o, o.length, n.minDepth, i) : Nn(o, t.startState.selection), new H(a == 0 ? r.rest : o, a == 0 ? o : r.rest);
1395
+ let i = I.fromTransaction(t, r.selection), a = r.side, o = a == 0 ? e.undone : e.done;
1396
+ return o = i ? Pn(o, o.length, n.minDepth, i) : zn(o, t.startState.selection), new R(a == 0 ? r.rest : o, a == 0 ? o : r.rest);
1397
1397
  }
1398
- let i = t.annotation(bn);
1399
- if ((i == "full" || i == "before") && (e = e.isolate()), t.annotation(le.addToHistory) === !1) return t.changes.empty ? e : e.addMapping(t.changes.desc);
1400
- let a = z.fromTransaction(t), o = t.annotation(le.time), s = t.annotation(le.userEvent);
1398
+ let i = t.annotation(wn);
1399
+ if ((i == "full" || i == "before") && (e = e.isolate()), t.annotation(Te.addToHistory) === !1) return t.changes.empty ? e : e.addMapping(t.changes.desc);
1400
+ let a = I.fromTransaction(t), o = t.annotation(Te.time), s = t.annotation(Te.userEvent);
1401
1401
  return a ? e = e.addChanges(a, o, s, n, t) : t.selection && (e = e.addSelection(t.startState.selection, o, s, n.newGroupDelay)), (i == "full" || i == "after") && (e = e.isolate()), e;
1402
1402
  },
1403
1403
  toJSON(e) {
@@ -1407,29 +1407,29 @@ var yn = /*@__PURE__*/ ye.define(), bn = /*@__PURE__*/ ye.define(), xn = /*@__PU
1407
1407
  };
1408
1408
  },
1409
1409
  fromJSON(e) {
1410
- return new H(e.done.map(z.fromJSON), e.undone.map(z.fromJSON));
1410
+ return new R(e.done.map(I.fromJSON), e.undone.map(I.fromJSON));
1411
1411
  }
1412
1412
  });
1413
- function wn(e = {}) {
1413
+ function On(e = {}) {
1414
1414
  return [
1415
- Cn,
1416
- Sn.of(e),
1417
- p.domEventHandlers({ beforeinput(e, t) {
1418
- let n = e.inputType == "historyUndo" ? Tn : e.inputType == "historyRedo" ? En : null;
1415
+ Dn,
1416
+ En.of(e),
1417
+ m.domEventHandlers({ beforeinput(e, t) {
1418
+ let n = e.inputType == "historyUndo" ? An : e.inputType == "historyRedo" ? jn : null;
1419
1419
  return n ? (e.preventDefault(), n(t)) : !1;
1420
1420
  } })
1421
1421
  ];
1422
1422
  }
1423
- function R(e, t) {
1423
+ function kn(e, t) {
1424
1424
  return function({ state: n, dispatch: r }) {
1425
1425
  if (!t && n.readOnly) return !1;
1426
- let i = n.field(Cn, !1);
1426
+ let i = n.field(Dn, !1);
1427
1427
  if (!i) return !1;
1428
1428
  let a = i.pop(e, n, t);
1429
1429
  return a ? (r(a), !0) : !1;
1430
1430
  };
1431
1431
  }
1432
- var Tn = /*@__PURE__*/ R(0, !1), En = /*@__PURE__*/ R(1, !1), Dn = /*@__PURE__*/ R(0, !0), On = /*@__PURE__*/ R(1, !0), z = class e {
1432
+ var An = /*@__PURE__*/ kn(0, !1), jn = /*@__PURE__*/ kn(1, !1), Mn = /*@__PURE__*/ kn(0, !0), Nn = /*@__PURE__*/ kn(1, !0), I = class e {
1433
1433
  constructor(e, t, n, r, i) {
1434
1434
  this.changes = e, this.effects = t, this.mapped = n, this.startSelection = r, this.selectionsAfter = i;
1435
1435
  }
@@ -1445,25 +1445,25 @@ var Tn = /*@__PURE__*/ R(0, !1), En = /*@__PURE__*/ R(1, !1), Dn = /*@__PURE__*/
1445
1445
  };
1446
1446
  }
1447
1447
  static fromJSON(t) {
1448
- return new e(t.changes && ae.fromJSON(t.changes), [], t.mapped && u.fromJSON(t.mapped), t.startSelection && g.fromJSON(t.startSelection), t.selectionsAfter.map(g.fromJSON));
1448
+ return new e(t.changes && ce.fromJSON(t.changes), [], t.mapped && oe.fromJSON(t.mapped), t.startSelection && b.fromJSON(t.startSelection), t.selectionsAfter.map(b.fromJSON));
1449
1449
  }
1450
1450
  static fromTransaction(t, n) {
1451
- let r = V;
1452
- for (let e of t.startState.facet(xn)) {
1451
+ let r = L;
1452
+ for (let e of t.startState.facet(Tn)) {
1453
1453
  let n = e(t);
1454
1454
  n.length && (r = r.concat(n));
1455
1455
  }
1456
- return !r.length && t.changes.empty ? null : new e(t.changes.invert(t.startState.doc), r, void 0, n || t.startState.selection, V);
1456
+ return !r.length && t.changes.empty ? null : new e(t.changes.invert(t.startState.doc), r, void 0, n || t.startState.selection, L);
1457
1457
  }
1458
1458
  static selection(t) {
1459
- return new e(void 0, V, void 0, void 0, t);
1459
+ return new e(void 0, L, void 0, void 0, t);
1460
1460
  }
1461
1461
  };
1462
- function B(e, t, n, r) {
1462
+ function Pn(e, t, n, r) {
1463
1463
  let i = t + 1 > n + 20 ? t - n - 1 : 0, a = e.slice(i, t);
1464
1464
  return a.push(r), a;
1465
1465
  }
1466
- function kn(e, t) {
1466
+ function Fn(e, t) {
1467
1467
  let n = [], r = !1;
1468
1468
  return e.iterChangedRanges((e, t) => n.push(e, t)), t.iterChangedRanges((e, t, i, a) => {
1469
1469
  for (let e = 0; e < n.length;) {
@@ -1472,44 +1472,44 @@ function kn(e, t) {
1472
1472
  }
1473
1473
  }), r;
1474
1474
  }
1475
- function An(e, t) {
1475
+ function In(e, t) {
1476
1476
  return e.ranges.length == t.ranges.length && e.ranges.filter((e, n) => e.empty != t.ranges[n].empty).length === 0;
1477
1477
  }
1478
- function jn(e, t) {
1478
+ function Ln(e, t) {
1479
1479
  return e.length ? t.length ? e.concat(t) : e : t;
1480
1480
  }
1481
- var V = [], Mn = 200;
1482
- function Nn(e, t) {
1481
+ var L = [], Rn = 200;
1482
+ function zn(e, t) {
1483
1483
  if (e.length) {
1484
- let n = e[e.length - 1], r = n.selectionsAfter.slice(Math.max(0, n.selectionsAfter.length - Mn));
1485
- return r.length && r[r.length - 1].eq(t) ? e : (r.push(t), B(e, e.length - 1, 1e9, n.setSelAfter(r)));
1484
+ let n = e[e.length - 1], r = n.selectionsAfter.slice(Math.max(0, n.selectionsAfter.length - Rn));
1485
+ return r.length && r[r.length - 1].eq(t) ? e : (r.push(t), Pn(e, e.length - 1, 1e9, n.setSelAfter(r)));
1486
1486
  }
1487
- return [z.selection([t])];
1487
+ return [I.selection([t])];
1488
1488
  }
1489
- function Pn(e) {
1489
+ function Bn(e) {
1490
1490
  let t = e[e.length - 1], n = e.slice();
1491
1491
  return n[e.length - 1] = t.setSelAfter(t.selectionsAfter.slice(0, t.selectionsAfter.length - 1)), n;
1492
1492
  }
1493
- function Fn(e, t) {
1493
+ function Vn(e, t) {
1494
1494
  if (!e.length) return e;
1495
- let n = e.length, r = V;
1495
+ let n = e.length, r = L;
1496
1496
  for (; n;) {
1497
- let i = In(e[n - 1], t, r);
1497
+ let i = Hn(e[n - 1], t, r);
1498
1498
  if (i.changes && !i.changes.empty || i.effects.length) {
1499
1499
  let t = e.slice(0, n);
1500
1500
  return t[n - 1] = i, t;
1501
1501
  }
1502
1502
  t = i.mapped, n--, r = i.selectionsAfter;
1503
1503
  }
1504
- return r.length ? [z.selection(r)] : V;
1504
+ return r.length ? [I.selection(r)] : L;
1505
1505
  }
1506
- function In(e, t, n) {
1507
- let r = jn(e.selectionsAfter.length ? e.selectionsAfter.map((e) => e.map(t)) : V, n);
1508
- if (!e.changes) return z.selection(r);
1506
+ function Hn(e, t, n) {
1507
+ let r = Ln(e.selectionsAfter.length ? e.selectionsAfter.map((e) => e.map(t)) : L, n);
1508
+ if (!e.changes) return I.selection(r);
1509
1509
  let i = e.changes.map(t), a = t.mapDesc(e.changes, !0), o = e.mapped ? e.mapped.composeDesc(a) : a;
1510
- return new z(i, y.mapEffects(e.effects, t), o, e.startSelection.map(a), r);
1510
+ return new I(i, E.mapEffects(e.effects, t), o, e.startSelection.map(a), r);
1511
1511
  }
1512
- var Ln = /^(input\.type|delete)($|\.)/, H = class e {
1512
+ var Un = /^(input\.type|delete)($|\.)/, R = class e {
1513
1513
  constructor(e, t, n = 0, r = void 0) {
1514
1514
  this.done = e, this.undone = t, this.prevTime = n, this.prevUserEvent = r;
1515
1515
  }
@@ -1518,14 +1518,14 @@ var Ln = /^(input\.type|delete)($|\.)/, H = class e {
1518
1518
  }
1519
1519
  addChanges(t, n, r, i, a) {
1520
1520
  let o = this.done, s = o[o.length - 1];
1521
- return o = s && s.changes && !s.changes.empty && t.changes && (!r || Ln.test(r)) && (!s.selectionsAfter.length && n - this.prevTime < i.newGroupDelay && i.joinToEvent(a, kn(s.changes, t.changes)) || r == "input.type.compose") ? B(o, o.length - 1, i.minDepth, new z(t.changes.compose(s.changes), jn(y.mapEffects(t.effects, s.changes), s.effects), s.mapped, s.startSelection, V)) : B(o, o.length, i.minDepth, t), new e(o, V, n, r);
1521
+ return o = s && s.changes && !s.changes.empty && t.changes && (!r || Un.test(r)) && (!s.selectionsAfter.length && n - this.prevTime < i.newGroupDelay && i.joinToEvent(a, Fn(s.changes, t.changes)) || r == "input.type.compose") ? Pn(o, o.length - 1, i.minDepth, new I(t.changes.compose(s.changes), Ln(E.mapEffects(t.effects, s.changes), s.effects), s.mapped, s.startSelection, L)) : Pn(o, o.length, i.minDepth, t), new e(o, L, n, r);
1522
1522
  }
1523
1523
  addSelection(t, n, r, i) {
1524
- let a = this.done.length ? this.done[this.done.length - 1].selectionsAfter : V;
1525
- return a.length > 0 && n - this.prevTime < i && r == this.prevUserEvent && r && /^select($|\.)/.test(r) && An(a[a.length - 1], t) ? this : new e(Nn(this.done, t), this.undone, n, r);
1524
+ let a = this.done.length ? this.done[this.done.length - 1].selectionsAfter : L;
1525
+ return a.length > 0 && n - this.prevTime < i && r == this.prevUserEvent && r && /^select($|\.)/.test(r) && In(a[a.length - 1], t) ? this : new e(zn(this.done, t), this.undone, n, r);
1526
1526
  }
1527
1527
  addMapping(t) {
1528
- return new e(Fn(this.done, t), Fn(this.undone, t), this.prevTime, this.prevUserEvent);
1528
+ return new e(Vn(this.done, t), Vn(this.undone, t), this.prevTime, this.prevUserEvent);
1529
1529
  }
1530
1530
  pop(e, t, n) {
1531
1531
  let r = e == 0 ? this.done : this.undone;
@@ -1533,21 +1533,21 @@ var Ln = /^(input\.type|delete)($|\.)/, H = class e {
1533
1533
  let i = r[r.length - 1], a = i.selectionsAfter[0] || (i.startSelection ? i.startSelection.map(i.changes.invertedDesc, 1) : t.selection);
1534
1534
  if (n && i.selectionsAfter.length) return t.update({
1535
1535
  selection: i.selectionsAfter[i.selectionsAfter.length - 1],
1536
- annotations: yn.of({
1536
+ annotations: Cn.of({
1537
1537
  side: e,
1538
- rest: Pn(r),
1538
+ rest: Bn(r),
1539
1539
  selection: a
1540
1540
  }),
1541
1541
  userEvent: e == 0 ? "select.undo" : "select.redo",
1542
1542
  scrollIntoView: !0
1543
1543
  });
1544
1544
  if (i.changes) {
1545
- let n = r.length == 1 ? V : r.slice(0, r.length - 1);
1546
- return i.mapped && (n = Fn(n, i.mapped)), t.update({
1545
+ let n = r.length == 1 ? L : r.slice(0, r.length - 1);
1546
+ return i.mapped && (n = Vn(n, i.mapped)), t.update({
1547
1547
  changes: i.changes,
1548
1548
  selection: i.startSelection,
1549
1549
  effects: i.effects,
1550
- annotations: yn.of({
1550
+ annotations: Cn.of({
1551
1551
  side: e,
1552
1552
  rest: n,
1553
1553
  selection: a
@@ -1560,93 +1560,93 @@ var Ln = /^(input\.type|delete)($|\.)/, H = class e {
1560
1560
  return null;
1561
1561
  }
1562
1562
  };
1563
- H.empty = /*@__PURE__*/ new H(V, V);
1564
- var Rn = [
1563
+ R.empty = /*@__PURE__*/ new R(L, L);
1564
+ var Wn = [
1565
1565
  {
1566
1566
  key: "Mod-z",
1567
- run: Tn,
1567
+ run: An,
1568
1568
  preventDefault: !0
1569
1569
  },
1570
1570
  {
1571
1571
  key: "Mod-y",
1572
1572
  mac: "Mod-Shift-z",
1573
- run: En,
1573
+ run: jn,
1574
1574
  preventDefault: !0
1575
1575
  },
1576
1576
  {
1577
1577
  linux: "Ctrl-Shift-z",
1578
- run: En,
1578
+ run: jn,
1579
1579
  preventDefault: !0
1580
1580
  },
1581
1581
  {
1582
1582
  key: "Mod-u",
1583
- run: Dn,
1583
+ run: Mn,
1584
1584
  preventDefault: !0
1585
1585
  },
1586
1586
  {
1587
1587
  key: "Alt-u",
1588
1588
  mac: "Mod-Shift-u",
1589
- run: On,
1589
+ run: Nn,
1590
1590
  preventDefault: !0
1591
1591
  }
1592
1592
  ];
1593
- function U(e, t) {
1594
- return g.create(e.ranges.map(t), e.mainIndex);
1593
+ function z(e, t) {
1594
+ return b.create(e.ranges.map(t), e.mainIndex);
1595
1595
  }
1596
- function W(e, t) {
1596
+ function B(e, t) {
1597
1597
  return e.update({
1598
1598
  selection: t,
1599
1599
  scrollIntoView: !0,
1600
1600
  userEvent: "select"
1601
1601
  });
1602
1602
  }
1603
- function G({ state: e, dispatch: t }, n) {
1604
- let r = U(e.selection, n);
1605
- return !r.eq(e.selection, !0) && (t(W(e, r)), !0);
1603
+ function V({ state: e, dispatch: t }, n) {
1604
+ let r = z(e.selection, n);
1605
+ return !r.eq(e.selection, !0) && (t(B(e, r)), !0);
1606
1606
  }
1607
- function zn(e, t) {
1608
- return g.cursor(t ? e.to : e.from);
1607
+ function Gn(e, t) {
1608
+ return b.cursor(t ? e.to : e.from);
1609
1609
  }
1610
- function Bn(e, t) {
1611
- return G(e, (n) => n.empty ? e.moveByChar(n, t) : zn(n, t));
1610
+ function Kn(e, t) {
1611
+ return V(e, (n) => n.empty ? e.moveByChar(n, t) : Gn(n, t));
1612
1612
  }
1613
- function K(e) {
1613
+ function H(e) {
1614
1614
  return e.textDirectionAt(e.state.selection.main.head) == he.LTR;
1615
1615
  }
1616
- var Vn = (e) => Bn(e, !K(e)), Hn = (e) => Bn(e, K(e));
1617
- function Un(e, t) {
1618
- return G(e, (n) => n.empty ? e.moveByGroup(n, t) : zn(n, t));
1616
+ var qn = (e) => Kn(e, !H(e)), Jn = (e) => Kn(e, H(e));
1617
+ function Yn(e, t) {
1618
+ return V(e, (n) => n.empty ? e.moveByGroup(n, t) : Gn(n, t));
1619
1619
  }
1620
- var Wn = (e) => Un(e, !K(e)), Gn = (e) => Un(e, K(e));
1620
+ var Xn = (e) => Yn(e, !H(e)), Zn = (e) => Yn(e, H(e));
1621
1621
  typeof Intl < "u" && Intl.Segmenter;
1622
- function Kn(e, t, n) {
1622
+ function Qn(e, t, n) {
1623
1623
  if (t.type.prop(n)) return !0;
1624
1624
  let r = t.to - t.from;
1625
1625
  return r && (r > 2 || /[^\s,.;:]/.test(e.sliceDoc(t.from, t.to))) || t.firstChild;
1626
1626
  }
1627
- function qn(e, t, n) {
1628
- let r = x(e).resolveInner(t.head), i = n ? Te.closedBy : Te.openedBy;
1627
+ function $n(e, t, n) {
1628
+ let r = C(e).resolveInner(t.head), i = n ? a.closedBy : a.openedBy;
1629
1629
  for (let a = t.head;;) {
1630
1630
  let t = n ? r.childAfter(a) : r.childBefore(a);
1631
1631
  if (!t) break;
1632
- Kn(e, t, i) ? r = t : a = n ? t.to : t.from;
1632
+ Qn(e, t, i) ? r = t : a = n ? t.to : t.from;
1633
1633
  }
1634
- let o = r.type.prop(i), s, c;
1635
- return c = o && (s = n ? a(e, r.from, 1) : a(e, r.to, -1)) && s.matched ? n ? s.end.to : s.end.from : n ? r.to : r.from, g.cursor(c, n ? -1 : 1);
1634
+ let s = r.type.prop(i), c, l;
1635
+ return l = s && (c = n ? o(e, r.from, 1) : o(e, r.to, -1)) && c.matched ? n ? c.end.to : c.end.from : n ? r.to : r.from, b.cursor(l, n ? -1 : 1);
1636
1636
  }
1637
- var Jn = (e) => G(e, (t) => qn(e.state, t, !K(e))), Yn = (e) => G(e, (t) => qn(e.state, t, K(e)));
1638
- function Xn(e, t) {
1639
- return G(e, (n) => {
1640
- if (!n.empty) return zn(n, t);
1637
+ var er = (e) => V(e, (t) => $n(e.state, t, !H(e))), tr = (e) => V(e, (t) => $n(e.state, t, H(e)));
1638
+ function nr(e, t) {
1639
+ return V(e, (n) => {
1640
+ if (!n.empty) return Gn(n, t);
1641
1641
  let r = e.moveVertically(n, t);
1642
1642
  return r.head == n.head ? e.moveToLineBoundary(n, t) : r;
1643
1643
  });
1644
1644
  }
1645
- var Zn = (e) => Xn(e, !1), Qn = (e) => Xn(e, !0);
1646
- function $n(e) {
1645
+ var rr = (e) => nr(e, !1), ir = (e) => nr(e, !0);
1646
+ function ar(e) {
1647
1647
  let t = e.scrollDOM.clientHeight < e.scrollDOM.scrollHeight - 2, n = 0, r = 0, i;
1648
1648
  if (t) {
1649
- for (let t of e.state.facet(p.scrollMargins)) {
1649
+ for (let t of e.state.facet(m.scrollMargins)) {
1650
1650
  let i = t(e);
1651
1651
  i?.top && (n = Math.max(i?.top, n)), i?.bottom && (r = Math.max(i?.bottom, r));
1652
1652
  }
@@ -1659,109 +1659,109 @@ function $n(e) {
1659
1659
  height: Math.max(e.defaultLineHeight, i - 5)
1660
1660
  };
1661
1661
  }
1662
- function er(e, t) {
1663
- let n = $n(e), { state: r } = e, i = U(r.selection, (r) => r.empty ? e.moveVertically(r, t, n.height) : zn(r, t));
1662
+ function or(e, t) {
1663
+ let n = ar(e), { state: r } = e, i = z(r.selection, (r) => r.empty ? e.moveVertically(r, t, n.height) : Gn(r, t));
1664
1664
  if (i.eq(r.selection)) return !1;
1665
1665
  let a;
1666
1666
  if (n.selfScroll) {
1667
1667
  let t = e.coordsAtPos(r.selection.main.head), o = e.scrollDOM.getBoundingClientRect(), s = o.top + n.marginTop, c = o.bottom - n.marginBottom;
1668
- t && t.top > s && t.bottom < c && (a = p.scrollIntoView(i.main.head, {
1668
+ t && t.top > s && t.bottom < c && (a = m.scrollIntoView(i.main.head, {
1669
1669
  y: "start",
1670
1670
  yMargin: t.top - s
1671
1671
  }));
1672
1672
  }
1673
- return e.dispatch(W(r, i), { effects: a }), !0;
1673
+ return e.dispatch(B(r, i), { effects: a }), !0;
1674
1674
  }
1675
- var tr = (e) => er(e, !1), nr = (e) => er(e, !0);
1676
- function q(e, t, n) {
1675
+ var sr = (e) => or(e, !1), cr = (e) => or(e, !0);
1676
+ function U(e, t, n) {
1677
1677
  let r = e.lineBlockAt(t.head), i = e.moveToLineBoundary(t, n);
1678
1678
  if (i.head == t.head && i.head != (n ? r.to : r.from) && (i = e.moveToLineBoundary(t, n, !1)), !n && i.head == r.from && r.length) {
1679
1679
  let n = /^\s*/.exec(e.state.sliceDoc(r.from, Math.min(r.from + 100, r.to)))[0].length;
1680
- n && t.head != r.from + n && (i = g.cursor(r.from + n));
1680
+ n && t.head != r.from + n && (i = b.cursor(r.from + n));
1681
1681
  }
1682
1682
  return i;
1683
1683
  }
1684
- var rr = (e) => G(e, (t) => q(e, t, !0)), ir = (e) => G(e, (t) => q(e, t, !1)), ar = (e) => G(e, (t) => q(e, t, !K(e))), or = (e) => G(e, (t) => q(e, t, K(e))), sr = (e) => G(e, (t) => e.moveToLineBoundary(t, !1, !1)), cr = (e) => G(e, (t) => e.moveToLineBoundary(t, !0, !1));
1685
- function lr(e, t, n) {
1686
- let r = !1, i = U(e.selection, (t) => {
1687
- let i = a(e, t.head, -1) || a(e, t.head, 1) || t.head > 0 && a(e, t.head - 1, 1) || t.head < e.doc.length && a(e, t.head + 1, -1);
1684
+ var lr = (e) => V(e, (t) => U(e, t, !0)), ur = (e) => V(e, (t) => U(e, t, !1)), dr = (e) => V(e, (t) => U(e, t, !H(e))), fr = (e) => V(e, (t) => U(e, t, H(e))), pr = (e) => V(e, (t) => e.moveToLineBoundary(t, !1, !1)), mr = (e) => V(e, (t) => e.moveToLineBoundary(t, !0, !1));
1685
+ function hr(e, t, n) {
1686
+ let r = !1, i = z(e.selection, (t) => {
1687
+ let i = o(e, t.head, -1) || o(e, t.head, 1) || t.head > 0 && o(e, t.head - 1, 1) || t.head < e.doc.length && o(e, t.head + 1, -1);
1688
1688
  if (!i || !i.end) return t;
1689
1689
  r = !0;
1690
- let o = i.start.from == t.head ? i.end.to : i.end.from;
1691
- return n ? g.range(t.anchor, o) : g.cursor(o);
1690
+ let a = i.start.from == t.head ? i.end.to : i.end.from;
1691
+ return n ? b.range(t.anchor, a) : b.cursor(a);
1692
1692
  });
1693
- return r ? (t(W(e, i)), !0) : !1;
1693
+ return r ? (t(B(e, i)), !0) : !1;
1694
1694
  }
1695
- var ur = ({ state: e, dispatch: t }) => lr(e, t, !1);
1696
- function J(e, t, n) {
1697
- let r = U(e.state.selection, (e) => {
1698
- e.undirectional && e.head >= e.anchor != t && (e = g.range(e.head, e.anchor));
1695
+ var gr = ({ state: e, dispatch: t }) => hr(e, t, !1);
1696
+ function W(e, t, n) {
1697
+ let r = z(e.state.selection, (e) => {
1698
+ e.undirectional && e.head >= e.anchor != t && (e = b.range(e.head, e.anchor));
1699
1699
  let r = n(e);
1700
- return g.range(e.anchor, r.head, r.goalColumn, r.bidiLevel || void 0, r.assoc);
1700
+ return b.range(e.anchor, r.head, r.goalColumn, r.bidiLevel || void 0, r.assoc);
1701
1701
  });
1702
- return !r.eq(e.state.selection) && (e.dispatch(W(e.state, r)), !0);
1702
+ return !r.eq(e.state.selection) && (e.dispatch(B(e.state, r)), !0);
1703
1703
  }
1704
- function dr(e, t) {
1705
- return J(e, t, (n) => e.moveByChar(n, t));
1704
+ function _r(e, t) {
1705
+ return W(e, t, (n) => e.moveByChar(n, t));
1706
1706
  }
1707
- var fr = (e) => dr(e, !K(e)), pr = (e) => dr(e, K(e));
1708
- function mr(e, t) {
1709
- return J(e, t, (n) => e.moveByGroup(n, t));
1707
+ var vr = (e) => _r(e, !H(e)), yr = (e) => _r(e, H(e));
1708
+ function br(e, t) {
1709
+ return W(e, t, (n) => e.moveByGroup(n, t));
1710
1710
  }
1711
- var hr = (e) => mr(e, !K(e)), gr = (e) => mr(e, K(e)), _r = (e) => {
1712
- let t = !K(e);
1713
- return J(e, t, (n) => qn(e.state, n, t));
1714
- }, vr = (e) => {
1715
- let t = K(e);
1716
- return J(e, t, (n) => qn(e.state, n, t));
1711
+ var xr = (e) => br(e, !H(e)), Sr = (e) => br(e, H(e)), Cr = (e) => {
1712
+ let t = !H(e);
1713
+ return W(e, t, (n) => $n(e.state, n, t));
1714
+ }, wr = (e) => {
1715
+ let t = H(e);
1716
+ return W(e, t, (n) => $n(e.state, n, t));
1717
1717
  };
1718
- function yr(e, t) {
1719
- return J(e, t, (n) => e.moveVertically(n, t));
1720
- }
1721
- var br = (e) => yr(e, !1), xr = (e) => yr(e, !0);
1722
- function Sr(e, t) {
1723
- return J(e, t, (n) => e.moveVertically(n, t, $n(e).height));
1724
- }
1725
- var Cr = (e) => Sr(e, !1), wr = (e) => Sr(e, !0), Tr = (e) => J(e, !0, (t) => q(e, t, !0)), Er = (e) => J(e, !1, (t) => q(e, t, !1)), Dr = (e) => {
1726
- let t = !K(e);
1727
- return J(e, t, (n) => q(e, n, t));
1728
- }, Or = (e) => {
1729
- let t = K(e);
1730
- return J(e, t, (n) => q(e, n, t));
1731
- }, kr = (e) => J(e, !1, (t) => g.cursor(e.lineBlockAt(t.head).from)), Ar = (e) => J(e, !0, (t) => g.cursor(e.lineBlockAt(t.head).to)), jr = ({ state: e, dispatch: t }) => (t(W(e, { anchor: 0 })), !0), Mr = ({ state: e, dispatch: t }) => (t(W(e, { anchor: e.doc.length })), !0), Nr = ({ state: e, dispatch: t }) => (t(W(e, {
1718
+ function Tr(e, t) {
1719
+ return W(e, t, (n) => e.moveVertically(n, t));
1720
+ }
1721
+ var Er = (e) => Tr(e, !1), Dr = (e) => Tr(e, !0);
1722
+ function Or(e, t) {
1723
+ return W(e, t, (n) => e.moveVertically(n, t, ar(e).height));
1724
+ }
1725
+ var kr = (e) => Or(e, !1), Ar = (e) => Or(e, !0), jr = (e) => W(e, !0, (t) => U(e, t, !0)), Mr = (e) => W(e, !1, (t) => U(e, t, !1)), Nr = (e) => {
1726
+ let t = !H(e);
1727
+ return W(e, t, (n) => U(e, n, t));
1728
+ }, Pr = (e) => {
1729
+ let t = H(e);
1730
+ return W(e, t, (n) => U(e, n, t));
1731
+ }, Fr = (e) => W(e, !1, (t) => b.cursor(e.lineBlockAt(t.head).from)), Ir = (e) => W(e, !0, (t) => b.cursor(e.lineBlockAt(t.head).to)), Lr = ({ state: e, dispatch: t }) => (t(B(e, { anchor: 0 })), !0), Rr = ({ state: e, dispatch: t }) => (t(B(e, { anchor: e.doc.length })), !0), zr = ({ state: e, dispatch: t }) => (t(B(e, {
1732
1732
  anchor: e.selection.main.anchor,
1733
1733
  head: 0
1734
- })), !0), Pr = ({ state: e, dispatch: t }) => (t(W(e, {
1734
+ })), !0), Br = ({ state: e, dispatch: t }) => (t(B(e, {
1735
1735
  anchor: e.selection.main.anchor,
1736
1736
  head: e.doc.length
1737
- })), !0), Fr = ({ state: e, dispatch: t }) => (t(e.update({
1737
+ })), !0), Vr = ({ state: e, dispatch: t }) => (t(e.update({
1738
1738
  selection: {
1739
1739
  anchor: 0,
1740
1740
  head: e.doc.length
1741
1741
  },
1742
1742
  userEvent: "select"
1743
- })), !0), Ir = ({ state: e, dispatch: t }) => {
1744
- let n = ei(e).map(({ from: t, to: n }) => g.undirectionalRange(t, Math.min(n + 1, e.doc.length)));
1743
+ })), !0), Hr = ({ state: e, dispatch: t }) => {
1744
+ let n = si(e).map(({ from: t, to: n }) => b.undirectionalRange(t, Math.min(n + 1, e.doc.length)));
1745
1745
  return t(e.update({
1746
- selection: g.create(n),
1746
+ selection: b.create(n),
1747
1747
  userEvent: "select"
1748
1748
  })), !0;
1749
- }, Lr = ({ state: e, dispatch: t }) => {
1750
- let n = U(e.selection, (t) => {
1751
- let n = x(e), r = n.resolveStack(t.from, 1);
1749
+ }, Ur = ({ state: e, dispatch: t }) => {
1750
+ let n = z(e.selection, (t) => {
1751
+ let n = C(e), r = n.resolveStack(t.from, 1);
1752
1752
  if (t.empty) {
1753
1753
  let e = n.resolveStack(t.from, -1);
1754
1754
  e.node.from >= r.node.from && e.node.to <= r.node.to && (r = e);
1755
1755
  }
1756
1756
  for (let e = r; e; e = e.next) {
1757
1757
  let { node: n } = e;
1758
- if ((n.from < t.from && n.to >= t.to || n.to > t.to && n.from <= t.from) && e.next) return g.undirectionalRange(n.from, n.to);
1758
+ if ((n.from < t.from && n.to >= t.to || n.to > t.to && n.from <= t.from) && e.next) return b.undirectionalRange(n.from, n.to);
1759
1759
  }
1760
1760
  return t;
1761
1761
  });
1762
- return !n.eq(e.selection) && (t(W(e, n)), !0);
1762
+ return !n.eq(e.selection) && (t(B(e, n)), !0);
1763
1763
  };
1764
- function Rr(e, t) {
1764
+ function Wr(e, t) {
1765
1765
  let { state: n } = e, r = n.selection, i = n.selection.ranges.slice();
1766
1766
  for (let r of n.selection.ranges) {
1767
1767
  let a = n.doc.lineAt(r.head);
@@ -1775,96 +1775,96 @@ function Rr(e, t) {
1775
1775
  n = r;
1776
1776
  }
1777
1777
  }
1778
- return i.length != r.ranges.length && (e.dispatch(W(n, g.create(i, i.length - 1))), !0);
1778
+ return i.length != r.ranges.length && (e.dispatch(B(n, b.create(i, i.length - 1))), !0);
1779
1779
  }
1780
- var zr = (e) => Rr(e, !1), Br = (e) => Rr(e, !0), Vr = ({ state: e, dispatch: t }) => {
1780
+ var Gr = (e) => Wr(e, !1), Kr = (e) => Wr(e, !0), qr = ({ state: e, dispatch: t }) => {
1781
1781
  let n = e.selection, r = null;
1782
- return n.ranges.length > 1 ? r = g.create([n.main]) : n.main.empty || (r = g.create([g.cursor(n.main.head)])), r ? (t(W(e, r)), !0) : !1;
1782
+ return n.ranges.length > 1 ? r = b.create([n.main]) : n.main.empty || (r = b.create([b.cursor(n.main.head)])), r ? (t(B(e, r)), !0) : !1;
1783
1783
  };
1784
- function Y(e, t) {
1784
+ function Jr(e, t) {
1785
1785
  if (e.state.readOnly) return !1;
1786
1786
  let n = "delete.selection", { state: r } = e, i = r.changeByRange((r) => {
1787
1787
  let { from: i, to: a } = r;
1788
1788
  if (i == a) {
1789
1789
  let o = t(r);
1790
- o < i ? (n = "delete.backward", o = Hr(e, o, !1)) : o > i && (n = "delete.forward", o = Hr(e, o, !0)), i = Math.min(i, o), a = Math.max(a, o);
1791
- } else i = Hr(e, i, !1), a = Hr(e, a, !0);
1790
+ o < i ? (n = "delete.backward", o = Yr(e, o, !1)) : o > i && (n = "delete.forward", o = Yr(e, o, !0)), i = Math.min(i, o), a = Math.max(a, o);
1791
+ } else i = Yr(e, i, !1), a = Yr(e, a, !0);
1792
1792
  return i == a ? { range: r } : {
1793
1793
  changes: {
1794
1794
  from: i,
1795
1795
  to: a
1796
1796
  },
1797
- range: g.cursor(i, i < r.head ? -1 : 1)
1797
+ range: b.cursor(i, i < r.head ? -1 : 1)
1798
1798
  };
1799
1799
  });
1800
1800
  return !i.changes.empty && (e.dispatch(r.update(i, {
1801
1801
  scrollIntoView: !0,
1802
1802
  userEvent: n,
1803
- effects: n == "delete.selection" ? p.announce.of(r.phrase("Selection deleted")) : void 0
1803
+ effects: n == "delete.selection" ? m.announce.of(r.phrase("Selection deleted")) : void 0
1804
1804
  })), !0);
1805
1805
  }
1806
- function Hr(e, t, n) {
1807
- if (e instanceof p) for (let r of e.state.facet(p.atomicRanges).map((t) => t(e))) r.between(t, t, (e, r) => {
1806
+ function Yr(e, t, n) {
1807
+ if (e instanceof m) for (let r of e.state.facet(m.atomicRanges).map((t) => t(e))) r.between(t, t, (e, r) => {
1808
1808
  e < t && r > t && (t = n ? r : e);
1809
1809
  });
1810
1810
  return t;
1811
1811
  }
1812
- var Ur = (e, t, n) => Y(e, (r) => {
1812
+ var Xr = (e, t, n) => Jr(e, (r) => {
1813
1813
  let i = r.from, { state: a } = e, o = a.doc.lineAt(i), s, c;
1814
1814
  if (n && !t && i > o.from && i < o.from + 200 && !/[^ \t]/.test(s = o.text.slice(0, i - o.from))) {
1815
1815
  if (s[s.length - 1] == " ") return i - 1;
1816
- let e = de(s, a.tabSize) % Ee(a) || Ee(a);
1816
+ let e = _e(s, a.tabSize) % Oe(a) || Oe(a);
1817
1817
  for (let t = 0; t < e && s[s.length - 1 - t] == " "; t++) i--;
1818
1818
  c = i;
1819
- } else c = w(o.text, i - o.from, t, t) + o.from, c == i && o.number != (t ? a.doc.lines : 1) ? c += t ? 1 : -1 : !t && /[\ufe00-\ufe0f]/.test(o.text.slice(c - o.from, i - o.from)) && (c = w(o.text, c - o.from, !1, !1) + o.from);
1819
+ } else c = S(o.text, i - o.from, t, t) + o.from, c == i && o.number != (t ? a.doc.lines : 1) ? c += t ? 1 : -1 : !t && /[\ufe00-\ufe0f]/.test(o.text.slice(c - o.from, i - o.from)) && (c = S(o.text, c - o.from, !1, !1) + o.from);
1820
1820
  return c;
1821
- }), Wr = (e) => Ur(e, !1, !0), Gr = (e) => Ur(e, !0, !1), Kr = (e, t) => Y(e, (n) => {
1821
+ }), Zr = (e) => Xr(e, !1, !0), Qr = (e) => Xr(e, !0, !1), $r = (e, t) => Jr(e, (n) => {
1822
1822
  let r = n.head, { state: i } = e, a = i.doc.lineAt(r), o = i.charCategorizer(r);
1823
1823
  for (let e = null;;) {
1824
1824
  if (r == (t ? a.to : a.from)) {
1825
1825
  r == n.head && a.number != (t ? i.doc.lines : 1) && (r += t ? 1 : -1);
1826
1826
  break;
1827
1827
  }
1828
- let s = w(a.text, r - a.from, t) + a.from, c = a.text.slice(Math.min(r, s) - a.from, Math.max(r, s) - a.from), l = o(c);
1828
+ let s = S(a.text, r - a.from, t) + a.from, c = a.text.slice(Math.min(r, s) - a.from, Math.max(r, s) - a.from), l = o(c);
1829
1829
  if (e != null && l != e) break;
1830
1830
  (c != " " || r != n.head) && (e = l), r = s;
1831
1831
  }
1832
1832
  return r;
1833
- }), qr = (e) => Kr(e, !1), Jr = (e) => Kr(e, !0), Yr = (e) => Y(e, (t) => {
1833
+ }), ei = (e) => $r(e, !1), ti = (e) => $r(e, !0), ni = (e) => Jr(e, (t) => {
1834
1834
  let n = e.lineBlockAt(t.head).to;
1835
1835
  return t.head < n ? n : Math.min(e.state.doc.length, t.head + 1);
1836
- }), Xr = (e) => Y(e, (t) => {
1836
+ }), ri = (e) => Jr(e, (t) => {
1837
1837
  let n = e.moveToLineBoundary(t, !1).head;
1838
1838
  return t.head > n ? n : Math.max(0, t.head - 1);
1839
- }), Zr = (e) => Y(e, (t) => {
1839
+ }), ii = (e) => Jr(e, (t) => {
1840
1840
  let n = e.moveToLineBoundary(t, !0).head;
1841
1841
  return t.head < n ? n : Math.min(e.state.doc.length, t.head + 1);
1842
- }), Qr = ({ state: e, dispatch: t }) => {
1842
+ }), ai = ({ state: e, dispatch: t }) => {
1843
1843
  if (e.readOnly) return !1;
1844
1844
  let n = e.changeByRange((e) => ({
1845
1845
  changes: {
1846
1846
  from: e.from,
1847
1847
  to: e.to,
1848
- insert: Se.of(["", ""])
1848
+ insert: w.of(["", ""])
1849
1849
  },
1850
- range: g.cursor(e.from)
1850
+ range: b.cursor(e.from)
1851
1851
  }));
1852
1852
  return t(e.update(n, {
1853
1853
  scrollIntoView: !0,
1854
1854
  userEvent: "input"
1855
1855
  })), !0;
1856
- }, $r = ({ state: e, dispatch: t }) => {
1856
+ }, oi = ({ state: e, dispatch: t }) => {
1857
1857
  if (e.readOnly) return !1;
1858
1858
  let n = e.changeByRange((t) => {
1859
1859
  if (!t.empty || t.from == 0 || t.from == e.doc.length) return { range: t };
1860
- let n = t.from, r = e.doc.lineAt(n), i = n == r.from ? n - 1 : w(r.text, n - r.from, !1) + r.from, a = n == r.to ? n + 1 : w(r.text, n - r.from, !0) + r.from;
1860
+ let n = t.from, r = e.doc.lineAt(n), i = n == r.from ? n - 1 : S(r.text, n - r.from, !1) + r.from, a = n == r.to ? n + 1 : S(r.text, n - r.from, !0) + r.from;
1861
1861
  return {
1862
1862
  changes: {
1863
1863
  from: i,
1864
1864
  to: a,
1865
1865
  insert: e.doc.slice(n, a).append(e.doc.slice(i, n))
1866
1866
  },
1867
- range: g.cursor(a)
1867
+ range: b.cursor(a)
1868
1868
  };
1869
1869
  });
1870
1870
  return !n.changes.empty && (t(e.update(n, {
@@ -1872,7 +1872,7 @@ var Ur = (e, t, n) => Y(e, (r) => {
1872
1872
  userEvent: "move.character"
1873
1873
  })), !0);
1874
1874
  };
1875
- function ei(e) {
1875
+ function si(e) {
1876
1876
  let t = [], n = -1;
1877
1877
  for (let r of e.selection.ranges) {
1878
1878
  let i = e.doc.lineAt(r.from), a = e.doc.lineAt(r.to);
@@ -1888,10 +1888,10 @@ function ei(e) {
1888
1888
  }
1889
1889
  return t;
1890
1890
  }
1891
- function ti(e, t, n) {
1891
+ function ci(e, t, n) {
1892
1892
  if (e.readOnly) return !1;
1893
1893
  let r = [], i = [];
1894
- for (let t of ei(e)) {
1894
+ for (let t of si(e)) {
1895
1895
  if (n ? t.to == e.doc.length : t.from == 0) continue;
1896
1896
  let a = e.doc.lineAt(n ? t.to + 1 : t.from - 1), o = a.length + 1;
1897
1897
  if (n) {
@@ -1902,7 +1902,7 @@ function ti(e, t, n) {
1902
1902
  from: t.from,
1903
1903
  insert: a.text + e.lineBreak
1904
1904
  });
1905
- for (let n of t.ranges) i.push(g.range(Math.min(e.doc.length, n.anchor + o), Math.min(e.doc.length, n.head + o)));
1905
+ for (let n of t.ranges) i.push(b.range(Math.min(e.doc.length, n.anchor + o), Math.min(e.doc.length, n.head + o)));
1906
1906
  } else {
1907
1907
  r.push({
1908
1908
  from: a.from,
@@ -1911,21 +1911,21 @@ function ti(e, t, n) {
1911
1911
  from: t.to,
1912
1912
  insert: e.lineBreak + a.text
1913
1913
  });
1914
- for (let e of t.ranges) i.push(g.range(e.anchor - o, e.head - o));
1914
+ for (let e of t.ranges) i.push(b.range(e.anchor - o, e.head - o));
1915
1915
  }
1916
1916
  }
1917
1917
  return r.length ? (t(e.update({
1918
1918
  changes: r,
1919
1919
  scrollIntoView: !0,
1920
- selection: g.create(i, e.selection.mainIndex),
1920
+ selection: b.create(i, e.selection.mainIndex),
1921
1921
  userEvent: "move.line"
1922
1922
  })), !0) : !1;
1923
1923
  }
1924
- var ni = ({ state: e, dispatch: t }) => ti(e, t, !1), ri = ({ state: e, dispatch: t }) => ti(e, t, !0);
1925
- function ii(e, t, n) {
1924
+ var li = ({ state: e, dispatch: t }) => ci(e, t, !1), ui = ({ state: e, dispatch: t }) => ci(e, t, !0);
1925
+ function di(e, t, n) {
1926
1926
  if (e.readOnly) return !1;
1927
1927
  let r = [];
1928
- for (let t of ei(e)) n ? r.push({
1928
+ for (let t of si(e)) n ? r.push({
1929
1929
  from: t.from,
1930
1930
  insert: e.doc.slice(t.from, t.to) + e.lineBreak
1931
1931
  }) : r.push({
@@ -1940,12 +1940,12 @@ function ii(e, t, n) {
1940
1940
  userEvent: "input.copyline"
1941
1941
  })), !0;
1942
1942
  }
1943
- var ai = ({ state: e, dispatch: t }) => ii(e, t, !1), oi = ({ state: e, dispatch: t }) => ii(e, t, !0), si = (e) => {
1943
+ var fi = ({ state: e, dispatch: t }) => di(e, t, !1), pi = ({ state: e, dispatch: t }) => di(e, t, !0), mi = (e) => {
1944
1944
  if (e.state.readOnly) return !1;
1945
- let { state: t } = e, n = t.changes(ei(t).map(({ from: e, to: n }) => (e > 0 ? e-- : n < t.doc.length && n++, {
1945
+ let { state: t } = e, n = t.changes(si(t).map(({ from: e, to: n }) => (e > 0 ? e-- : n < t.doc.length && n++, {
1946
1946
  from: e,
1947
1947
  to: n
1948
- }))), r = U(t.selection, (t) => {
1948
+ }))), r = z(t.selection, (t) => {
1949
1949
  let n;
1950
1950
  if (e.lineWrapping) {
1951
1951
  let r = e.lineBlockAt(t.head), i = e.coordsAtPos(t.head, t.assoc || 1);
@@ -1960,38 +1960,38 @@ var ai = ({ state: e, dispatch: t }) => ii(e, t, !1), oi = ({ state: e, dispatch
1960
1960
  userEvent: "delete.line"
1961
1961
  }), !0;
1962
1962
  };
1963
- function ci(e, t) {
1963
+ function hi(e, t) {
1964
1964
  if (/\(\)|\[\]|\{\}/.test(e.sliceDoc(t - 1, t + 1))) return {
1965
1965
  from: t,
1966
1966
  to: t
1967
1967
  };
1968
- let n = x(e).resolveInner(t), r = n.childBefore(t), i = n.childAfter(t), a;
1969
- return r && i && r.to <= t && i.from >= t && (a = r.type.prop(Te.closedBy)) && a.indexOf(i.name) > -1 && e.doc.lineAt(r.to).from == e.doc.lineAt(i.from).from && !/\S/.test(e.sliceDoc(r.to, i.from)) ? {
1968
+ let n = C(e).resolveInner(t), r = n.childBefore(t), i = n.childAfter(t), o;
1969
+ return r && i && r.to <= t && i.from >= t && (o = r.type.prop(a.closedBy)) && o.indexOf(i.name) > -1 && e.doc.lineAt(r.to).from == e.doc.lineAt(i.from).from && !/\S/.test(e.sliceDoc(r.to, i.from)) ? {
1970
1970
  from: r.to,
1971
1971
  to: i.from
1972
1972
  } : null;
1973
1973
  }
1974
- var li = /*@__PURE__*/ di(!1), ui = /*@__PURE__*/ di(!0);
1975
- function di(e) {
1974
+ var gi = /*@__PURE__*/ vi(!1), _i = /*@__PURE__*/ vi(!0);
1975
+ function vi(e) {
1976
1976
  return ({ state: t, dispatch: n }) => {
1977
1977
  if (t.readOnly) return !1;
1978
1978
  let r = t.changeByRange((n) => {
1979
- let { from: r, to: a } = n, o = t.doc.lineAt(r), s = !e && r == a && ci(t, r);
1979
+ let { from: r, to: a } = n, o = t.doc.lineAt(r), s = !e && r == a && hi(t, r);
1980
1980
  e && (r = a = (a <= o.to ? o : t.doc.lineAt(a)).to);
1981
1981
  let c = new Ce(t, {
1982
1982
  simulateBreak: r,
1983
1983
  simulateDoubleBreak: !!s
1984
- }), l = se(c, r);
1985
- for (l ??= de(/^\s*/.exec(t.doc.lineAt(r).text)[0], t.tabSize); a < o.to && /\s/.test(o.text[a - o.from]);) a++;
1984
+ }), l = ue(c, r);
1985
+ for (l ??= _e(/^\s*/.exec(t.doc.lineAt(r).text)[0], t.tabSize); a < o.to && /\s/.test(o.text[a - o.from]);) a++;
1986
1986
  s ? {from: r, to: a} = s : r > o.from && r < o.from + 100 && !/\S/.test(o.text.slice(0, r)) && (r = o.from);
1987
1987
  let u = ["", i(t, l)];
1988
1988
  return s && u.push(i(t, c.lineIndent(o.from, -1))), {
1989
1989
  changes: {
1990
1990
  from: r,
1991
1991
  to: a,
1992
- insert: Se.of(u)
1992
+ insert: w.of(u)
1993
1993
  },
1994
- range: g.cursor(r + 1 + u[1].length)
1994
+ range: b.cursor(r + 1 + u[1].length)
1995
1995
  };
1996
1996
  });
1997
1997
  return n(t.update(r, {
@@ -2000,7 +2000,7 @@ function di(e) {
2000
2000
  })), !0;
2001
2001
  };
2002
2002
  }
2003
- function fi(e, t) {
2003
+ function yi(e, t) {
2004
2004
  let n = -1;
2005
2005
  return e.changeByRange((r) => {
2006
2006
  let i = [];
@@ -2011,14 +2011,14 @@ function fi(e, t) {
2011
2011
  let a = e.changes(i);
2012
2012
  return {
2013
2013
  changes: i,
2014
- range: g.range(a.mapPos(r.anchor, 1), a.mapPos(r.head, 1))
2014
+ range: b.range(a.mapPos(r.anchor, 1), a.mapPos(r.head, 1))
2015
2015
  };
2016
2016
  });
2017
2017
  }
2018
- var pi = ({ state: e, dispatch: t }) => {
2018
+ var bi = ({ state: e, dispatch: t }) => {
2019
2019
  if (e.readOnly) return !1;
2020
- let n = Object.create(null), r = new Ce(e, { overrideIndentation: (e) => n[e] ?? -1 }), a = fi(e, (t, a, o) => {
2021
- let s = se(r, t.from);
2020
+ let n = Object.create(null), r = new Ce(e, { overrideIndentation: (e) => n[e] ?? -1 }), a = yi(e, (t, a, o) => {
2021
+ let s = ue(r, t.from);
2022
2022
  if (s == null) return;
2023
2023
  /\S/.test(t.text) || (s = 0);
2024
2024
  let c = /^\s*/.exec(t.text)[0], l = i(e, s);
@@ -2029,333 +2029,333 @@ var pi = ({ state: e, dispatch: t }) => {
2029
2029
  }));
2030
2030
  });
2031
2031
  return a.changes.empty || t(e.update(a, { userEvent: "indent" })), !0;
2032
- }, mi = ({ state: e, dispatch: t }) => !e.readOnly && (t(e.update(fi(e, (t, n) => {
2032
+ }, xi = ({ state: e, dispatch: t }) => !e.readOnly && (t(e.update(yi(e, (t, n) => {
2033
2033
  n.push({
2034
2034
  from: t.from,
2035
- insert: e.facet(E)
2035
+ insert: e.facet(De)
2036
2036
  });
2037
- }), { userEvent: "input.indent" })), !0), hi = ({ state: e, dispatch: t }) => !e.readOnly && (t(e.update(fi(e, (t, n) => {
2037
+ }), { userEvent: "input.indent" })), !0), Si = ({ state: e, dispatch: t }) => !e.readOnly && (t(e.update(yi(e, (t, n) => {
2038
2038
  let r = /^\s*/.exec(t.text)[0];
2039
2039
  if (!r) return;
2040
- let a = de(r, e.tabSize), o = 0, s = i(e, Math.max(0, a - Ee(e)));
2040
+ let a = _e(r, e.tabSize), o = 0, s = i(e, Math.max(0, a - Oe(e)));
2041
2041
  for (; o < r.length && o < s.length && r.charCodeAt(o) == s.charCodeAt(o);) o++;
2042
2042
  n.push({
2043
2043
  from: t.from + o,
2044
2044
  to: t.from + r.length,
2045
2045
  insert: s.slice(o)
2046
2046
  });
2047
- }), { userEvent: "delete.dedent" })), !0), gi = (e) => (e.setTabFocusMode(), !0), _i = [
2047
+ }), { userEvent: "delete.dedent" })), !0), Ci = (e) => (e.setTabFocusMode(), !0), wi = [
2048
2048
  {
2049
2049
  key: "Ctrl-b",
2050
- run: Vn,
2051
- shift: fr,
2050
+ run: qn,
2051
+ shift: vr,
2052
2052
  preventDefault: !0
2053
2053
  },
2054
2054
  {
2055
2055
  key: "Ctrl-f",
2056
- run: Hn,
2057
- shift: pr
2056
+ run: Jn,
2057
+ shift: yr
2058
2058
  },
2059
2059
  {
2060
2060
  key: "Ctrl-p",
2061
- run: Zn,
2062
- shift: br
2061
+ run: rr,
2062
+ shift: Er
2063
2063
  },
2064
2064
  {
2065
2065
  key: "Ctrl-n",
2066
- run: Qn,
2067
- shift: xr
2066
+ run: ir,
2067
+ shift: Dr
2068
2068
  },
2069
2069
  {
2070
2070
  key: "Ctrl-a",
2071
- run: sr,
2072
- shift: kr
2071
+ run: pr,
2072
+ shift: Fr
2073
2073
  },
2074
2074
  {
2075
2075
  key: "Ctrl-e",
2076
- run: cr,
2077
- shift: Ar
2076
+ run: mr,
2077
+ shift: Ir
2078
2078
  },
2079
2079
  {
2080
2080
  key: "Ctrl-d",
2081
- run: Gr
2081
+ run: Qr
2082
2082
  },
2083
2083
  {
2084
2084
  key: "Ctrl-h",
2085
- run: Wr
2085
+ run: Zr
2086
2086
  },
2087
2087
  {
2088
2088
  key: "Ctrl-k",
2089
- run: Yr
2089
+ run: ni
2090
2090
  },
2091
2091
  {
2092
2092
  key: "Ctrl-Alt-h",
2093
- run: qr
2093
+ run: ei
2094
2094
  },
2095
2095
  {
2096
2096
  key: "Ctrl-o",
2097
- run: Qr
2097
+ run: ai
2098
2098
  },
2099
2099
  {
2100
2100
  key: "Ctrl-t",
2101
- run: $r
2101
+ run: oi
2102
2102
  },
2103
2103
  {
2104
2104
  key: "Ctrl-v",
2105
- run: nr
2105
+ run: cr
2106
2106
  }
2107
- ], vi = /*@__PURE__*/ [
2107
+ ], Ti = /*@__PURE__*/ [
2108
2108
  {
2109
2109
  key: "ArrowLeft",
2110
- run: Vn,
2111
- shift: fr,
2110
+ run: qn,
2111
+ shift: vr,
2112
2112
  preventDefault: !0
2113
2113
  },
2114
2114
  {
2115
2115
  key: "Mod-ArrowLeft",
2116
2116
  mac: "Alt-ArrowLeft",
2117
- run: Wn,
2118
- shift: hr,
2117
+ run: Xn,
2118
+ shift: xr,
2119
2119
  preventDefault: !0
2120
2120
  },
2121
2121
  {
2122
2122
  mac: "Cmd-ArrowLeft",
2123
- run: ar,
2124
- shift: Dr,
2123
+ run: dr,
2124
+ shift: Nr,
2125
2125
  preventDefault: !0
2126
2126
  },
2127
2127
  {
2128
2128
  key: "ArrowRight",
2129
- run: Hn,
2130
- shift: pr,
2129
+ run: Jn,
2130
+ shift: yr,
2131
2131
  preventDefault: !0
2132
2132
  },
2133
2133
  {
2134
2134
  key: "Mod-ArrowRight",
2135
2135
  mac: "Alt-ArrowRight",
2136
- run: Gn,
2137
- shift: gr,
2136
+ run: Zn,
2137
+ shift: Sr,
2138
2138
  preventDefault: !0
2139
2139
  },
2140
2140
  {
2141
2141
  mac: "Cmd-ArrowRight",
2142
- run: or,
2143
- shift: Or,
2142
+ run: fr,
2143
+ shift: Pr,
2144
2144
  preventDefault: !0
2145
2145
  },
2146
2146
  {
2147
2147
  key: "ArrowUp",
2148
- run: Zn,
2149
- shift: br,
2148
+ run: rr,
2149
+ shift: Er,
2150
2150
  preventDefault: !0
2151
2151
  },
2152
2152
  {
2153
2153
  mac: "Cmd-ArrowUp",
2154
- run: jr,
2155
- shift: Nr
2154
+ run: Lr,
2155
+ shift: zr
2156
2156
  },
2157
2157
  {
2158
2158
  mac: "Ctrl-ArrowUp",
2159
- run: tr,
2160
- shift: Cr
2159
+ run: sr,
2160
+ shift: kr
2161
2161
  },
2162
2162
  {
2163
2163
  key: "ArrowDown",
2164
- run: Qn,
2165
- shift: xr,
2164
+ run: ir,
2165
+ shift: Dr,
2166
2166
  preventDefault: !0
2167
2167
  },
2168
2168
  {
2169
2169
  mac: "Cmd-ArrowDown",
2170
- run: Mr,
2171
- shift: Pr
2170
+ run: Rr,
2171
+ shift: Br
2172
2172
  },
2173
2173
  {
2174
2174
  mac: "Ctrl-ArrowDown",
2175
- run: nr,
2176
- shift: wr
2175
+ run: cr,
2176
+ shift: Ar
2177
2177
  },
2178
2178
  {
2179
2179
  key: "PageUp",
2180
- run: tr,
2181
- shift: Cr
2180
+ run: sr,
2181
+ shift: kr
2182
2182
  },
2183
2183
  {
2184
2184
  key: "PageDown",
2185
- run: nr,
2186
- shift: wr
2185
+ run: cr,
2186
+ shift: Ar
2187
2187
  },
2188
2188
  {
2189
2189
  key: "Home",
2190
- run: ir,
2191
- shift: Er,
2190
+ run: ur,
2191
+ shift: Mr,
2192
2192
  preventDefault: !0
2193
2193
  },
2194
2194
  {
2195
2195
  key: "Mod-Home",
2196
- run: jr,
2197
- shift: Nr
2196
+ run: Lr,
2197
+ shift: zr
2198
2198
  },
2199
2199
  {
2200
2200
  key: "End",
2201
- run: rr,
2202
- shift: Tr,
2201
+ run: lr,
2202
+ shift: jr,
2203
2203
  preventDefault: !0
2204
2204
  },
2205
2205
  {
2206
2206
  key: "Mod-End",
2207
- run: Mr,
2208
- shift: Pr
2207
+ run: Rr,
2208
+ shift: Br
2209
2209
  },
2210
2210
  {
2211
2211
  key: "Enter",
2212
- run: li,
2213
- shift: li
2212
+ run: gi,
2213
+ shift: gi
2214
2214
  },
2215
2215
  {
2216
2216
  key: "Mod-a",
2217
- run: Fr
2217
+ run: Vr
2218
2218
  },
2219
2219
  {
2220
2220
  key: "Backspace",
2221
- run: Wr,
2222
- shift: Wr,
2221
+ run: Zr,
2222
+ shift: Zr,
2223
2223
  preventDefault: !0
2224
2224
  },
2225
2225
  {
2226
2226
  key: "Delete",
2227
- run: Gr,
2227
+ run: Qr,
2228
2228
  preventDefault: !0
2229
2229
  },
2230
2230
  {
2231
2231
  key: "Mod-Backspace",
2232
2232
  mac: "Alt-Backspace",
2233
- run: qr,
2233
+ run: ei,
2234
2234
  preventDefault: !0
2235
2235
  },
2236
2236
  {
2237
2237
  key: "Mod-Delete",
2238
2238
  mac: "Alt-Delete",
2239
- run: Jr,
2239
+ run: ti,
2240
2240
  preventDefault: !0
2241
2241
  },
2242
2242
  {
2243
2243
  mac: "Mod-Backspace",
2244
- run: Xr,
2244
+ run: ri,
2245
2245
  preventDefault: !0
2246
2246
  },
2247
2247
  {
2248
2248
  mac: "Mod-Delete",
2249
- run: Zr,
2249
+ run: ii,
2250
2250
  preventDefault: !0
2251
2251
  }
2252
- ].concat(/*@__PURE__*/ _i.map((e) => ({
2252
+ ].concat(/*@__PURE__*/ wi.map((e) => ({
2253
2253
  mac: e.key,
2254
2254
  run: e.run,
2255
2255
  shift: e.shift
2256
- }))), yi = /*@__PURE__*/ [
2256
+ }))), Ei = /*@__PURE__*/ [
2257
2257
  {
2258
2258
  key: "Alt-ArrowLeft",
2259
2259
  mac: "Ctrl-ArrowLeft",
2260
- run: Jn,
2261
- shift: _r
2260
+ run: er,
2261
+ shift: Cr
2262
2262
  },
2263
2263
  {
2264
2264
  key: "Alt-ArrowRight",
2265
2265
  mac: "Ctrl-ArrowRight",
2266
- run: Yn,
2267
- shift: vr
2266
+ run: tr,
2267
+ shift: wr
2268
2268
  },
2269
2269
  {
2270
2270
  key: "Alt-ArrowUp",
2271
- run: ni
2271
+ run: li
2272
2272
  },
2273
2273
  {
2274
2274
  key: "Shift-Alt-ArrowUp",
2275
- run: ai
2275
+ run: fi
2276
2276
  },
2277
2277
  {
2278
2278
  key: "Alt-ArrowDown",
2279
- run: ri
2279
+ run: ui
2280
2280
  },
2281
2281
  {
2282
2282
  key: "Shift-Alt-ArrowDown",
2283
- run: oi
2283
+ run: pi
2284
2284
  },
2285
2285
  {
2286
2286
  key: "Mod-Alt-ArrowUp",
2287
- run: zr
2287
+ run: Gr
2288
2288
  },
2289
2289
  {
2290
2290
  key: "Mod-Alt-ArrowDown",
2291
- run: Br
2291
+ run: Kr
2292
2292
  },
2293
2293
  {
2294
2294
  key: "Escape",
2295
- run: Vr
2295
+ run: qr
2296
2296
  },
2297
2297
  {
2298
2298
  key: "Mod-Enter",
2299
- run: ui
2299
+ run: _i
2300
2300
  },
2301
2301
  {
2302
2302
  key: "Alt-l",
2303
2303
  mac: "Ctrl-l",
2304
- run: Ir
2304
+ run: Hr
2305
2305
  },
2306
2306
  {
2307
2307
  key: "Mod-i",
2308
- run: Lr,
2308
+ run: Ur,
2309
2309
  preventDefault: !0
2310
2310
  },
2311
2311
  {
2312
2312
  key: "Mod-[",
2313
- run: hi
2313
+ run: Si
2314
2314
  },
2315
2315
  {
2316
2316
  key: "Mod-]",
2317
- run: mi
2317
+ run: xi
2318
2318
  },
2319
2319
  {
2320
2320
  key: "Mod-Alt-\\",
2321
- run: pi
2321
+ run: bi
2322
2322
  },
2323
2323
  {
2324
2324
  key: "Shift-Mod-k",
2325
- run: si
2325
+ run: mi
2326
2326
  },
2327
2327
  {
2328
2328
  key: "Shift-Mod-\\",
2329
- run: ur
2329
+ run: gr
2330
2330
  },
2331
2331
  {
2332
2332
  key: "Mod-/",
2333
- run: ln
2333
+ run: fn
2334
2334
  },
2335
2335
  {
2336
2336
  key: "Alt-A",
2337
2337
  mac: "Ctrl-A",
2338
- run: fn
2338
+ run: hn
2339
2339
  },
2340
2340
  {
2341
2341
  key: "Ctrl-m",
2342
2342
  mac: "Shift-Alt-m",
2343
- run: gi
2343
+ run: Ci
2344
2344
  }
2345
- ].concat(vi), bi = typeof String.prototype.normalize == "function" ? (e) => e.normalize("NFKD") : (e) => e, xi = class {
2345
+ ].concat(Ti), Di = typeof String.prototype.normalize == "function" ? (e) => e.normalize("NFKD") : (e) => e, Oi = class {
2346
2346
  constructor(e, t, n = 0, r = e.length, i, a) {
2347
2347
  this.test = a, this.value = {
2348
2348
  from: 0,
2349
2349
  to: 0,
2350
2350
  precise: !1
2351
- }, this.done = !1, this.matches = [], this.buffer = "", this.bufferPos = 0, this.iter = e.iterRange(n, r), this.bufferStart = n, this.normalize = i ? (e) => i(bi(e)) : bi, this.query = this.normalize(t);
2351
+ }, this.done = !1, this.matches = [], this.buffer = "", this.bufferPos = 0, this.iter = e.iterRange(n, r), this.bufferStart = n, this.normalize = i ? (e) => i(Di(e)) : Di, this.query = this.normalize(t);
2352
2352
  }
2353
2353
  peek() {
2354
2354
  if (this.bufferPos == this.buffer.length) {
2355
2355
  if (this.bufferStart += this.buffer.length, this.iter.next(), this.iter.done) return -1;
2356
2356
  this.bufferPos = 0, this.buffer = this.iter.value;
2357
2357
  }
2358
- return S(this.buffer, this.bufferPos);
2358
+ return y(this.buffer, this.bufferPos);
2359
2359
  }
2360
2360
  next() {
2361
2361
  for (; this.matches.length;) this.matches.pop();
@@ -2365,8 +2365,8 @@ var pi = ({ state: e, dispatch: t }) => {
2365
2365
  for (;;) {
2366
2366
  let e = this.peek();
2367
2367
  if (e < 0) return this.done = !0, this;
2368
- let t = _e(e), n = this.bufferStart + this.bufferPos;
2369
- this.bufferPos += T(e);
2368
+ let t = pe(e), n = this.bufferStart + this.bufferPos;
2369
+ this.bufferPos += x(e);
2370
2370
  let r = this.normalize(t);
2371
2371
  if (r.length) for (let e = 0, i = n, a = !0;; e++) {
2372
2372
  let n = r.charCodeAt(e), o = this.match(n, i, a, this.bufferPos + this.bufferStart, e == r.length - 1);
@@ -2397,20 +2397,20 @@ var pi = ({ state: e, dispatch: t }) => {
2397
2397
  })), a && this.test && !this.test(a.from, a.to, this.buffer, this.bufferStart) && (a = null), a;
2398
2398
  }
2399
2399
  };
2400
- typeof Symbol < "u" && (xi.prototype[Symbol.iterator] = function() {
2400
+ typeof Symbol < "u" && (Oi.prototype[Symbol.iterator] = function() {
2401
2401
  return this;
2402
2402
  });
2403
- var Si = {
2403
+ var ki = {
2404
2404
  from: -1,
2405
2405
  to: -1,
2406
2406
  match: /*@__PURE__*/ /.*/.exec(""),
2407
2407
  precise: !0
2408
- }, Ci = "gm" + (/x/.unicode == null ? "" : "u"), wi = class {
2408
+ }, Ai = "gm" + (/x/.unicode == null ? "" : "u"), ji = class {
2409
2409
  constructor(e, t, n, r = 0, i = e.length) {
2410
- if (this.text = e, this.to = i, this.curLine = "", this.done = !1, this.value = Si, /\\[sWDnr]|\n|\r|\[\^/.test(t)) return new Di(e, t, n, r, i);
2411
- this.re = new RegExp(t, Ci + (n?.ignoreCase ? "i" : "")), this.test = n?.test, this.iter = e.iter();
2410
+ if (this.text = e, this.to = i, this.curLine = "", this.done = !1, this.value = ki, /\\[sWDnr]|\n|\r|\[\^/.test(t)) return new Pi(e, t, n, r, i);
2411
+ this.re = new RegExp(t, Ai + (n?.ignoreCase ? "i" : "")), this.test = n?.test, this.iter = e.iter();
2412
2412
  let a = e.lineAt(r);
2413
- this.curLineStart = a.from, this.matchPos = Oi(e, r), this.getLine(this.curLineStart);
2413
+ this.curLineStart = a.from, this.matchPos = Fi(e, r), this.getLine(this.curLineStart);
2414
2414
  }
2415
2415
  getLine(e) {
2416
2416
  this.iter.next(e), this.iter.lineBreak ? this.curLine = "" : (this.curLine = this.iter.value, this.curLineStart + this.curLine.length > this.to && (this.curLine = this.curLine.slice(0, this.to - this.curLineStart)), this.iter.next());
@@ -2424,7 +2424,7 @@ var Si = {
2424
2424
  let t = this.matchPos <= this.to && this.re.exec(this.curLine);
2425
2425
  if (t) {
2426
2426
  let n = this.curLineStart + t.index, r = n + t[0].length;
2427
- if (this.matchPos = Oi(this.text, r + +(n == r)), n == this.curLineStart + this.curLine.length && this.nextLine(), (n < r || n > this.value.to) && (!this.test || this.test(n, r, t))) return this.value = {
2427
+ if (this.matchPos = Fi(this.text, r + +(n == r)), n == this.curLineStart + this.curLine.length && this.nextLine(), (n < r || n > this.value.to) && (!this.test || this.test(n, r, t))) return this.value = {
2428
2428
  from: n,
2429
2429
  to: r,
2430
2430
  precise: !0,
@@ -2435,7 +2435,7 @@ var Si = {
2435
2435
  else return this.done = !0, this;
2436
2436
  }
2437
2437
  }
2438
- }, Ti = /*@__PURE__*/ new WeakMap(), Ei = class e {
2438
+ }, Mi = /*@__PURE__*/ new WeakMap(), Ni = class e {
2439
2439
  constructor(e, t) {
2440
2440
  this.from = e, this.text = t;
2441
2441
  }
@@ -2443,18 +2443,18 @@ var Si = {
2443
2443
  return this.from + this.text.length;
2444
2444
  }
2445
2445
  static get(t, n, r) {
2446
- let i = Ti.get(t);
2446
+ let i = Mi.get(t);
2447
2447
  if (!i || i.from >= r || i.to <= n) {
2448
2448
  let i = new e(n, t.sliceString(n, r));
2449
- return Ti.set(t, i), i;
2449
+ return Mi.set(t, i), i;
2450
2450
  }
2451
2451
  if (i.from == n && i.to == r) return i;
2452
2452
  let { text: a, from: o } = i;
2453
- return o > n && (a = t.sliceString(n, o) + a, o = n), i.to < r && (a += t.sliceString(i.to, r)), Ti.set(t, new e(o, a)), new e(n, a.slice(n - o, r - o));
2453
+ return o > n && (a = t.sliceString(n, o) + a, o = n), i.to < r && (a += t.sliceString(i.to, r)), Mi.set(t, new e(o, a)), new e(n, a.slice(n - o, r - o));
2454
2454
  }
2455
- }, Di = class {
2455
+ }, Pi = class {
2456
2456
  constructor(e, t, n, r, i) {
2457
- this.text = e, this.to = i, this.done = !1, this.value = Si, this.matchPos = Oi(e, r), this.re = new RegExp(t, Ci + (n?.ignoreCase ? "i" : "")), this.test = n?.test, this.flat = Ei.get(e, r, this.chunkEnd(r + 5e3));
2457
+ this.text = e, this.to = i, this.done = !1, this.value = ki, this.matchPos = Fi(e, r), this.re = new RegExp(t, Ai + (n?.ignoreCase ? "i" : "")), this.test = n?.test, this.flat = Ni.get(e, r, this.chunkEnd(r + 5e3));
2458
2458
  }
2459
2459
  chunkEnd(e) {
2460
2460
  return e >= this.to ? this.to : this.text.lineAt(e).to;
@@ -2469,46 +2469,46 @@ var Si = {
2469
2469
  to: n,
2470
2470
  precise: !0,
2471
2471
  match: t
2472
- }, this.matchPos = Oi(this.text, n + +(e == n)), this;
2472
+ }, this.matchPos = Fi(this.text, n + +(e == n)), this;
2473
2473
  }
2474
2474
  if (this.flat.to == this.to) return this.done = !0, this;
2475
- this.flat = Ei.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + this.flat.text.length * 2));
2475
+ this.flat = Ni.get(this.text, this.flat.from, this.chunkEnd(this.flat.from + this.flat.text.length * 2));
2476
2476
  }
2477
2477
  }
2478
2478
  };
2479
- typeof Symbol < "u" && (wi.prototype[Symbol.iterator] = Di.prototype[Symbol.iterator] = function() {
2479
+ typeof Symbol < "u" && (ji.prototype[Symbol.iterator] = Pi.prototype[Symbol.iterator] = function() {
2480
2480
  return this;
2481
2481
  });
2482
- function Oi(e, t) {
2482
+ function Fi(e, t) {
2483
2483
  if (t >= e.length) return t;
2484
2484
  let n = e.lineAt(t), r;
2485
2485
  for (; t < n.to && (r = n.text.charCodeAt(t - n.from)) >= 56320 && r < 57344;) t++;
2486
2486
  return t;
2487
2487
  }
2488
- var ki = {
2488
+ var Ii = {
2489
2489
  highlightWordAroundCursor: !1,
2490
2490
  minSelectionLength: 1,
2491
2491
  maxMatches: 100,
2492
2492
  wholeWords: !1
2493
- }, Ai = /*@__PURE__*/ b.define({ combine(e) {
2494
- return ue(e, ki, {
2493
+ }, Li = /*@__PURE__*/ T.define({ combine(e) {
2494
+ return ye(e, Ii, {
2495
2495
  highlightWordAroundCursor: (e, t) => e || t,
2496
2496
  minSelectionLength: Math.min,
2497
2497
  maxMatches: Math.min
2498
2498
  });
2499
2499
  } });
2500
- function ji(e) {
2501
- let t = [Li, Ii];
2502
- return e && t.push(Ai.of(e)), t;
2500
+ function Ri(e) {
2501
+ let t = [Wi, Ui];
2502
+ return e && t.push(Li.of(e)), t;
2503
2503
  }
2504
- var Mi = /*@__PURE__*/ n.mark({ class: "cm-selectionMatch" }), Ni = /*@__PURE__*/ n.mark({ class: "cm-selectionMatch cm-selectionMatch-main" });
2505
- function Pi(e, t, n, r) {
2506
- return (n == 0 || e(t.sliceDoc(n - 1, n)) != v.Word) && (r == t.doc.length || e(t.sliceDoc(r, r + 1)) != v.Word);
2504
+ var zi = /*@__PURE__*/ n.mark({ class: "cm-selectionMatch" }), Bi = /*@__PURE__*/ n.mark({ class: "cm-selectionMatch cm-selectionMatch-main" });
2505
+ function Vi(e, t, n, r) {
2506
+ return (n == 0 || e(t.sliceDoc(n - 1, n)) != _.Word) && (r == t.doc.length || e(t.sliceDoc(r, r + 1)) != _.Word);
2507
2507
  }
2508
- function Fi(e, t, n, r) {
2509
- return e(t.sliceDoc(n, n + 1)) == v.Word && e(t.sliceDoc(r - 1, r)) == v.Word;
2508
+ function Hi(e, t, n, r) {
2509
+ return e(t.sliceDoc(n, n + 1)) == _.Word && e(t.sliceDoc(r - 1, r)) == _.Word;
2510
2510
  }
2511
- var Ii = /*@__PURE__*/ m.fromClass(class {
2511
+ var Ui = /*@__PURE__*/ g.fromClass(class {
2512
2512
  constructor(e) {
2513
2513
  this.decorations = this.getDeco(e);
2514
2514
  }
@@ -2516,7 +2516,7 @@ var Ii = /*@__PURE__*/ m.fromClass(class {
2516
2516
  (e.selectionSet || e.docChanged || e.viewportChanged) && (this.decorations = this.getDeco(e.view));
2517
2517
  }
2518
2518
  getDeco(e) {
2519
- let t = e.state.facet(Ai), { state: r } = e, i = r.selection;
2519
+ let t = e.state.facet(Li), { state: r } = e, i = r.selection;
2520
2520
  if (i.ranges.length > 1) return n.none;
2521
2521
  let a = i.main, o, s = null;
2522
2522
  if (a.empty) {
@@ -2528,31 +2528,31 @@ var Ii = /*@__PURE__*/ m.fromClass(class {
2528
2528
  let e = a.to - a.from;
2529
2529
  if (e < t.minSelectionLength || e > 200) return n.none;
2530
2530
  if (t.wholeWords) {
2531
- if (o = r.sliceDoc(a.from, a.to), s = r.charCategorizer(a.head), !(Pi(s, r, a.from, a.to) && Fi(s, r, a.from, a.to))) return n.none;
2531
+ if (o = r.sliceDoc(a.from, a.to), s = r.charCategorizer(a.head), !(Vi(s, r, a.from, a.to) && Hi(s, r, a.from, a.to))) return n.none;
2532
2532
  } else if (o = r.sliceDoc(a.from, a.to), !o) return n.none;
2533
2533
  }
2534
2534
  let c = [];
2535
2535
  for (let i of e.visibleRanges) {
2536
- let e = new xi(r.doc, o, i.from, i.to);
2536
+ let e = new Oi(r.doc, o, i.from, i.to);
2537
2537
  for (; !e.next().done;) {
2538
2538
  let { from: i, to: o } = e.value;
2539
- if ((!s || Pi(s, r, i, o)) && (a.empty && i <= a.from && o >= a.to ? c.push(Ni.range(i, o)) : (i >= a.to || o <= a.from) && c.push(Mi.range(i, o)), c.length > t.maxMatches)) return n.none;
2539
+ if ((!s || Vi(s, r, i, o)) && (a.empty && i <= a.from && o >= a.to ? c.push(Bi.range(i, o)) : (i >= a.to || o <= a.from) && c.push(zi.range(i, o)), c.length > t.maxMatches)) return n.none;
2540
2540
  }
2541
2541
  }
2542
2542
  return n.set(c);
2543
2543
  }
2544
- }, { decorations: (e) => e.decorations }), Li = /*@__PURE__*/ p.baseTheme({
2544
+ }, { decorations: (e) => e.decorations }), Wi = /*@__PURE__*/ m.baseTheme({
2545
2545
  ".cm-selectionMatch": { backgroundColor: "#99ff7780" },
2546
2546
  ".cm-searchMatch .cm-selectionMatch": { backgroundColor: "transparent" }
2547
- }), Ri = ({ state: e, dispatch: t }) => {
2548
- let { selection: n } = e, r = g.create(n.ranges.map((t) => e.wordAt(t.head) || g.cursor(t.head)), n.mainIndex);
2547
+ }), Gi = ({ state: e, dispatch: t }) => {
2548
+ let { selection: n } = e, r = b.create(n.ranges.map((t) => e.wordAt(t.head) || b.cursor(t.head)), n.mainIndex);
2549
2549
  return !r.eq(n) && (t(e.update({ selection: r })), !0);
2550
2550
  };
2551
- function zi(e, t) {
2551
+ function Ki(e, t) {
2552
2552
  let { main: n, ranges: r } = e.selection, i = e.wordAt(n.head), a = i && i.from == n.from && i.to == n.to;
2553
- for (let n = !1, i = new xi(e.doc, t, r[r.length - 1].to);;) if (i.next(), i.done) {
2553
+ for (let n = !1, i = new Oi(e.doc, t, r[r.length - 1].to);;) if (i.next(), i.done) {
2554
2554
  if (n) return null;
2555
- i = new xi(e.doc, t, 0, Math.max(0, r[r.length - 1].from - 1)), n = !0;
2555
+ i = new Oi(e.doc, t, 0, Math.max(0, r[r.length - 1].from - 1)), n = !0;
2556
2556
  } else {
2557
2557
  if (n && r.some((e) => e.from == i.value.from)) continue;
2558
2558
  if (a) {
@@ -2562,95 +2562,472 @@ function zi(e, t) {
2562
2562
  return i.value;
2563
2563
  }
2564
2564
  }
2565
- var Bi = ({ state: e, dispatch: t }) => {
2565
+ var qi = ({ state: e, dispatch: t }) => {
2566
2566
  let { ranges: n } = e.selection;
2567
- if (n.some((e) => e.from === e.to)) return Ri({
2567
+ if (n.some((e) => e.from === e.to)) return Gi({
2568
2568
  state: e,
2569
2569
  dispatch: t
2570
2570
  });
2571
2571
  let r = e.sliceDoc(n[0].from, n[0].to);
2572
2572
  if (e.selection.ranges.some((t) => e.sliceDoc(t.from, t.to) != r)) return !1;
2573
- let i = zi(e, r);
2573
+ let i = Ki(e, r);
2574
2574
  return i ? (t(e.update({
2575
- selection: e.selection.addRange(g.range(i.from, i.to), !1),
2576
- effects: p.scrollIntoView(i.to)
2575
+ selection: e.selection.addRange(b.range(i.from, i.to), !1),
2576
+ effects: m.scrollIntoView(i.to)
2577
2577
  })), !0) : !1;
2578
2578
  };
2579
2579
  //#endregion
2580
2580
  //#region ../ui/src/components/codeEditorLanguages.ts
2581
- async function X(e) {
2582
- return xe.define(await e());
2581
+ async function G(e) {
2582
+ return Se.define(await e());
2583
2583
  }
2584
- var Vi = async () => (await import("./dist-CIBKGNWD.js").then((e) => e.t)).javascript({ typescript: !0 }), Hi = async () => (await import("./dist-CIBKGNWD.js").then((e) => e.t)).javascript({
2584
+ var Ji = async () => (await import("./dist-Ca51SM3i.js").then((e) => e.t)).javascript({ typescript: !0 }), Yi = async () => (await import("./dist-Ca51SM3i.js").then((e) => e.t)).javascript({
2585
2585
  typescript: !0,
2586
2586
  jsx: !0
2587
- }), Ui = async () => (await import("./dist-CIBKGNWD.js").then((e) => e.t)).javascript({ jsx: !0 }), Wi = async () => (await import("./dist-CYUF5YPj.js")).json(), Gi = async () => (await import("./dist-BTD5L343.js").then((e) => e.r)).css(), Ki = async () => (await import("./dist-DaJf_JYz.js")).html(), qi = async () => (await import("./dist-DszFZlYh.js")).xml(), Ji = async () => (await import("./dist-ChWDi62w.js")).markdown(), Yi = async () => (await import("./dist-DNg4hNu7.js")).python(), Xi = async () => (await import("./dist-hv72z6I6.js")).go(), Zi = async () => (await import("./dist-lPCEVnGX.js")).rust(), Qi = async () => (await import("./dist-LM11INLG.js")).java(), Z = async () => (await import("./dist-BWEDf1a-.js")).cpp(), $i = async () => (await import("./dist-Kg2QsUg8.js")).php(), ea = async () => (await import("./dist-gn9y7Yb8.js")).sql(), ta = async () => (await import("./dist-BWVp6Da-.js")).yaml(), na = () => X(async () => (await import("./shell-CevoiH_y.js")).shell), ra = () => X(async () => (await import("./dockerfile-4x0UkDoN.js")).dockerFile), ia = () => X(async () => (await import("./toml-CPJF62TK.js")).toml), Q = () => X(async () => (await import("./properties-C85NeSsH.js")).properties), aa = {
2588
- ts: Vi,
2589
- mts: Vi,
2590
- cts: Vi,
2591
- tsx: Hi,
2592
- js: Ui,
2593
- jsx: Ui,
2594
- mjs: Ui,
2595
- cjs: Ui,
2596
- json: Wi,
2597
- jsonc: Wi,
2598
- css: Gi,
2599
- scss: Gi,
2600
- less: Gi,
2601
- html: Ki,
2602
- htm: Ki,
2603
- xml: qi,
2604
- svg: qi,
2605
- md: Ji,
2606
- markdown: Ji,
2607
- py: Yi,
2608
- go: Xi,
2609
- rs: Zi,
2610
- java: Qi,
2611
- c: Z,
2612
- h: Z,
2613
- cpp: Z,
2614
- cc: Z,
2615
- cxx: Z,
2616
- hpp: Z,
2617
- php: $i,
2618
- sql: ea,
2619
- yaml: ta,
2620
- yml: ta,
2621
- sh: na,
2622
- bash: na,
2623
- zsh: na,
2624
- toml: ia,
2625
- ini: Q,
2626
- cfg: Q,
2627
- properties: Q,
2628
- env: Q,
2629
- rb: () => X(async () => (await import("./ruby-CjYBP7RB.js")).ruby),
2630
- cs: () => X(async () => (await import("./clike-VB7owi7S.js")).csharp)
2587
+ }), Xi = async () => (await import("./dist-Ca51SM3i.js").then((e) => e.t)).javascript({ jsx: !0 }), Zi = async () => (await import("./dist-Bg1-NGne.js")).json(), Qi = async () => (await import("./dist-CpOA8cNn.js").then((e) => e.r)).css(), $i = async () => (await import("./dist-BZ1m84Kh.js")).html(), ea = async () => (await import("./dist-DeLxY4Ia.js")).xml(), ta = async () => (await import("./dist-iZeihidk.js")).markdown(), na = async () => (await import("./dist-BnXHuZGz.js")).python(), ra = async () => (await import("./dist-SqwJhRs0.js")).go(), ia = async () => (await import("./dist-DCT8mdeU.js")).rust(), aa = async () => (await import("./dist-CwPu13CG.js")).java(), K = async () => (await import("./dist-BIMxMB--.js")).cpp(), oa = async () => (await import("./dist-C2UMsquH.js")).php(), sa = async () => (await import("./dist-BjQ1Exnz.js")).sql(), ca = async () => (await import("./dist-CcTOENSK.js")).yaml(), la = () => G(async () => (await import("./shell-CevoiH_y.js")).shell), ua = () => G(async () => (await import("./dockerfile-4x0UkDoN.js")).dockerFile), da = () => G(async () => (await import("./toml-CPJF62TK.js")).toml), q = () => G(async () => (await import("./properties-C85NeSsH.js")).properties), fa = {
2588
+ ts: Ji,
2589
+ mts: Ji,
2590
+ cts: Ji,
2591
+ tsx: Yi,
2592
+ js: Xi,
2593
+ jsx: Xi,
2594
+ mjs: Xi,
2595
+ cjs: Xi,
2596
+ json: Zi,
2597
+ jsonc: Zi,
2598
+ css: Qi,
2599
+ scss: Qi,
2600
+ less: Qi,
2601
+ html: $i,
2602
+ htm: $i,
2603
+ xml: ea,
2604
+ svg: ea,
2605
+ md: ta,
2606
+ markdown: ta,
2607
+ py: na,
2608
+ go: ra,
2609
+ rs: ia,
2610
+ java: aa,
2611
+ c: K,
2612
+ h: K,
2613
+ cpp: K,
2614
+ cc: K,
2615
+ cxx: K,
2616
+ hpp: K,
2617
+ php: oa,
2618
+ sql: sa,
2619
+ yaml: ca,
2620
+ yml: ca,
2621
+ sh: la,
2622
+ bash: la,
2623
+ zsh: la,
2624
+ toml: da,
2625
+ ini: q,
2626
+ cfg: q,
2627
+ properties: q,
2628
+ env: q,
2629
+ rb: () => G(async () => (await import("./ruby-CjYBP7RB.js")).ruby),
2630
+ cs: () => G(async () => (await import("./clike-VB7owi7S.js")).csharp)
2631
2631
  };
2632
- function oa(e) {
2632
+ function pa(e) {
2633
2633
  let t = e.split("/").pop() ?? e;
2634
- if (/^dockerfile$/i.test(t)) return ra();
2635
- if (/^\.env(\..+)?$/.test(t)) return Q();
2636
- let n = t.lastIndexOf("."), r = n < 0 ? void 0 : aa[t.slice(n + 1).toLowerCase()];
2634
+ if (/^dockerfile$/i.test(t)) return ua();
2635
+ if (/^\.env(\..+)?$/.test(t)) return q();
2636
+ let n = t.lastIndexOf("."), r = n < 0 ? void 0 : fa[t.slice(n + 1).toLowerCase()];
2637
2637
  return r === void 0 ? Promise.resolve(null) : r();
2638
2638
  }
2639
2639
  //#endregion
2640
+ //#region ../node_modules/@codemirror/merge/dist/index.js
2641
+ var J = class e {
2642
+ constructor(e, t, n, r) {
2643
+ this.fromA = e, this.toA = t, this.fromB = n, this.toB = r;
2644
+ }
2645
+ offset(t, n = t) {
2646
+ return new e(this.fromA + t, this.toA + t, this.fromB + n, this.toB + n);
2647
+ }
2648
+ };
2649
+ function Y(e, t, n, r, i, a) {
2650
+ if (e == r) return [];
2651
+ let o = xa(e, t, n, r, i, a), s = Sa(e, t + o, n, r, i + o, a);
2652
+ t += o, n -= s, i += o, a -= s;
2653
+ let c = n - t, l = a - i;
2654
+ if (!c || !l) return [new J(t, n, i, a)];
2655
+ if (c > l) {
2656
+ let o = e.slice(t, n).indexOf(r.slice(i, a));
2657
+ if (o > -1) return [new J(t, t + o, i, i), new J(t + o + l, n, a, a)];
2658
+ } else if (l > c) {
2659
+ let o = r.slice(i, a).indexOf(e.slice(t, n));
2660
+ if (o > -1) return [new J(t, t, i, i + o), new J(n, n, i + o + c, a)];
2661
+ }
2662
+ if (c == 1 || l == 1) return [new J(t, n, i, a)];
2663
+ let u = wa(e, t, n, r, i, a);
2664
+ if (u) {
2665
+ let [o, s, c] = u;
2666
+ return Y(e, t, o, r, i, s).concat(Y(e, o + c, n, r, s + c, a));
2667
+ }
2668
+ return ha(e, t, n, r, i, a);
2669
+ }
2670
+ var ma = 1e9, X = 0;
2671
+ function ha(e, t, n, r, i, a) {
2672
+ let o = n - t, s = a - i;
2673
+ if (ma < 1e9 && Math.min(o, s) > ma * 16 || X > 0 && Date.now() > X) return Math.min(o, s) > ma * 64 ? [new J(t, n, i, a)] : Ta(e, t, n, r, i, a);
2674
+ let c = Math.ceil((o + s) / 2);
2675
+ _a.reset(c), va.reset(c);
2676
+ let l = (n, a) => e.charCodeAt(t + n) == r.charCodeAt(i + a), u = (t, i) => e.charCodeAt(n - t - 1) == r.charCodeAt(a - i - 1), d = (o - s) % 2 == 0 ? null : va, f = d ? null : _a;
2677
+ for (let p = 0; p < c; p++) {
2678
+ if (p > ma || X > 0 && !(p & 63) && Date.now() > X) return Ta(e, t, n, r, i, a);
2679
+ let m = _a.advance(p, o, s, c, d, !1, l) || va.advance(p, o, s, c, f, !0, u);
2680
+ if (m) return ya(e, t, n, t + m[0], r, i, a, i + m[1]);
2681
+ }
2682
+ return [new J(t, n, i, a)];
2683
+ }
2684
+ var ga = class {
2685
+ constructor() {
2686
+ this.vec = [];
2687
+ }
2688
+ reset(e) {
2689
+ this.len = e << 1;
2690
+ for (let e = 0; e < this.len; e++) this.vec[e] = -1;
2691
+ this.vec[e + 1] = 0, this.start = this.end = 0;
2692
+ }
2693
+ advance(e, t, n, r, i, a, o) {
2694
+ for (let s = -e + this.start; s <= e - this.end; s += 2) {
2695
+ let c = r + s, l = s == -e || s != e && this.vec[c - 1] < this.vec[c + 1] ? this.vec[c + 1] : this.vec[c - 1] + 1, u = l - s;
2696
+ for (; l < t && u < n && o(l, u);) l++, u++;
2697
+ if (this.vec[c] = l, l > t) this.end += 2;
2698
+ else if (u > n) this.start += 2;
2699
+ else if (i) {
2700
+ let e = r + (t - n) - s;
2701
+ if (e >= 0 && e < this.len && i.vec[e] != -1) {
2702
+ if (a) {
2703
+ let n = i.vec[e];
2704
+ if (n >= t - l) return [n, r + n - e];
2705
+ } else {
2706
+ let n = t - i.vec[e];
2707
+ if (l >= n) return [l, u];
2708
+ }
2709
+ }
2710
+ }
2711
+ }
2712
+ return null;
2713
+ }
2714
+ }, _a = /*@__PURE__*/ new ga(), va = /*@__PURE__*/ new ga();
2715
+ function ya(e, t, n, r, i, a, o, s) {
2716
+ let c = !1;
2717
+ return !Z(e, r) && ++r == n && (c = !0), !Z(i, s) && ++s == o && (c = !0), c ? [new J(t, n, a, o)] : Y(e, t, r, i, a, s).concat(Y(e, r, n, i, s, o));
2718
+ }
2719
+ function ba(e, t) {
2720
+ let n = 1, r = Math.min(e, t);
2721
+ for (; n < r;) n <<= 1;
2722
+ return n;
2723
+ }
2724
+ function xa(e, t, n, r, i, a) {
2725
+ if (t == n || t == a || e.charCodeAt(t) != r.charCodeAt(i)) return 0;
2726
+ let o = ba(n - t, a - i);
2727
+ for (let s = t, c = i;;) {
2728
+ let i = s + o, l = c + o;
2729
+ if (i > n || l > a || e.slice(s, i) != r.slice(c, l)) {
2730
+ if (o == 1) return s - t - +!Z(e, s);
2731
+ o >>= 1;
2732
+ } else if (i == n || l == a) return i - t;
2733
+ else s = i, c = l;
2734
+ }
2735
+ }
2736
+ function Sa(e, t, n, r, i, a) {
2737
+ if (t == n || i == a || e.charCodeAt(n - 1) != r.charCodeAt(a - 1)) return 0;
2738
+ let o = ba(n - t, a - i);
2739
+ for (let s = n, c = a;;) {
2740
+ let a = s - o, l = c - o;
2741
+ if (a < t || l < i || e.slice(a, s) != r.slice(l, c)) {
2742
+ if (o == 1) return n - s - +!Z(e, s);
2743
+ o >>= 1;
2744
+ } else if (a == t || l == i) return n - a;
2745
+ else s = a, c = l;
2746
+ }
2747
+ }
2748
+ function Ca(e, t, n, r, i, a, o, s) {
2749
+ let c = r.slice(i, a), l = null;
2750
+ for (;;) {
2751
+ if (l || o < s) return l;
2752
+ for (let s = t + o;;) {
2753
+ Z(e, s) || s++;
2754
+ let u = s + o;
2755
+ if (Z(e, u) || (u += u == s + 1 ? 1 : -1), u >= n) break;
2756
+ let d = e.slice(s, u), f = -1;
2757
+ for (; (f = c.indexOf(d, f + 1)) != -1;) {
2758
+ let o = xa(e, u, n, r, i + f + d.length, a), c = Sa(e, t, s, r, i, i + f), p = d.length + o + c;
2759
+ (!l || l[2] < p) && (l = [
2760
+ s - c,
2761
+ i + f - c,
2762
+ p
2763
+ ]);
2764
+ }
2765
+ s = u;
2766
+ }
2767
+ if (s < 0) return l;
2768
+ o >>= 1;
2769
+ }
2770
+ }
2771
+ function wa(e, t, n, r, i, a) {
2772
+ let o = n - t, s = a - i;
2773
+ if (o < s) {
2774
+ let o = wa(r, i, a, e, t, n);
2775
+ return o && [
2776
+ o[1],
2777
+ o[0],
2778
+ o[2]
2779
+ ];
2780
+ }
2781
+ return o < 4 || s * 2 < o ? null : Ca(e, t, n, r, i, a, Math.floor(o / 4), -1);
2782
+ }
2783
+ function Ta(e, t, n, r, i, a) {
2784
+ let o = n - t, s = a - i, c;
2785
+ if (o < s) {
2786
+ let s = Ca(r, i, a, e, t, n, Math.floor(o / 6), 50);
2787
+ c = s && [
2788
+ s[1],
2789
+ s[0],
2790
+ s[2]
2791
+ ];
2792
+ } else c = Ca(e, t, n, r, i, a, Math.floor(s / 6), 50);
2793
+ if (!c) return [new J(t, n, i, a)];
2794
+ let [l, u, d] = c;
2795
+ return Y(e, t, l, r, i, u).concat(Y(e, l + d, n, r, u + d, a));
2796
+ }
2797
+ function Ea(e, t) {
2798
+ for (let n = 1; n < e.length; n++) {
2799
+ let r = e[n - 1], i = e[n];
2800
+ r.toA > i.fromA - t && r.toB > i.fromB - t && (e[n - 1] = new J(r.fromA, i.toA, r.fromB, i.toB), e.splice(n--, 1));
2801
+ }
2802
+ }
2803
+ function Da(e, t, n) {
2804
+ for (;;) {
2805
+ Ea(n, 1);
2806
+ let r = !1;
2807
+ for (let i = 0; i < n.length; i++) {
2808
+ let a = n[i], o, s;
2809
+ (o = xa(e, a.fromA, a.toA, t, a.fromB, a.toB)) && (a = n[i] = new J(a.fromA + o, a.toA, a.fromB + o, a.toB)), (s = Sa(e, a.fromA, a.toA, t, a.fromB, a.toB)) && (a = n[i] = new J(a.fromA, a.toA - s, a.fromB, a.toB - s));
2810
+ let c = a.toA - a.fromA, l = a.toB - a.fromB;
2811
+ if (c && l) continue;
2812
+ let u = a.fromA - (i ? n[i - 1].toA : 0), d = (i < n.length - 1 ? n[i + 1].fromA : e.length) - a.toA;
2813
+ if (!u || !d) continue;
2814
+ let f = c ? e.slice(a.fromA, a.toA) : t.slice(a.fromB, a.toB);
2815
+ u <= f.length && e.slice(a.fromA - u, a.fromA) == f.slice(f.length - u) ? (n[i] = new J(a.fromA - u, a.toA - u, a.fromB - u, a.toB - u), r = !0) : d <= f.length && e.slice(a.toA, a.toA + d) == f.slice(0, d) && (n[i] = new J(a.fromA + d, a.toA + d, a.fromB + d, a.toB + d), r = !0);
2816
+ }
2817
+ if (!r) break;
2818
+ }
2819
+ return n;
2820
+ }
2821
+ var Oa = (e) => e >= 55296 && e <= 56319, ka = (e) => e >= 56320 && e <= 57343;
2822
+ function Z(e, t) {
2823
+ return !t || t == e.length || !Oa(e.charCodeAt(t - 1)) || !ka(e.charCodeAt(t));
2824
+ }
2825
+ function Aa(e, t, n) {
2826
+ let r = n?.override;
2827
+ return r ? r(e, t) : (ma = (n?.scanLimit ?? 1e9) >> 1, X = n?.timeout ? Date.now() + n.timeout : 0, Da(e, t, Y(e, 0, e.length, t, 0, t.length)));
2828
+ }
2829
+ //#endregion
2830
+ //#region ../ui/src/components/gitGutter.ts
2831
+ function ja(e) {
2832
+ return e.fromA === e.toA ? "added" : e.fromB === e.toB ? "deleted" : "modified";
2833
+ }
2834
+ function Ma(e) {
2835
+ return e.split(/\r?\n/);
2836
+ }
2837
+ var Na = 256, Pa = 2048, Fa = 63232;
2838
+ function Ia(e) {
2839
+ let t = Na + e;
2840
+ return String.fromCharCode(t >= 55296 ? t + Pa : t);
2841
+ }
2842
+ function La(e, t) {
2843
+ let n = /* @__PURE__ */ new Map(), r = (e) => {
2844
+ let t = "";
2845
+ for (let r of e) {
2846
+ let e = n.get(r);
2847
+ if (e === void 0) {
2848
+ if (n.size >= Fa) return null;
2849
+ e = Ia(n.size), n.set(r, e);
2850
+ }
2851
+ t += e;
2852
+ }
2853
+ return t;
2854
+ }, i = r(e), a = r(t);
2855
+ return i === null || a === null ? null : Aa(i, a).map(({ fromA: e, toA: t, fromB: n, toB: r }) => ({
2856
+ fromA: e,
2857
+ toA: t,
2858
+ fromB: n,
2859
+ toB: r
2860
+ }));
2861
+ }
2862
+ function Ra(e, t, n) {
2863
+ let r = t.slice(n.fromA, n.toA);
2864
+ if (n.fromB === n.toB) {
2865
+ if (n.fromB < e.lines) {
2866
+ let t = e.line(n.fromB + 1).from;
2867
+ return {
2868
+ from: t,
2869
+ to: t,
2870
+ insert: w.of([...r, ""])
2871
+ };
2872
+ }
2873
+ return {
2874
+ from: e.length,
2875
+ to: e.length,
2876
+ insert: w.of(["", ...r])
2877
+ };
2878
+ }
2879
+ let i = e.line(n.fromB + 1).from, a = e.line(n.toB).to;
2880
+ return r.length === 0 ? (n.toB < e.lines ? a = e.line(n.toB + 1).from : n.fromB > 0 && (i = e.line(n.fromB).to), {
2881
+ from: i,
2882
+ to: a,
2883
+ insert: w.empty
2884
+ }) : {
2885
+ from: i,
2886
+ to: a,
2887
+ insert: w.of(r)
2888
+ };
2889
+ }
2890
+ var za = E.define(), Ba = E.define();
2891
+ function Va(e) {
2892
+ let t = [];
2893
+ for (let n = e.iterLines(); !n.next().done;) t.push(n.value);
2894
+ return t;
2895
+ }
2896
+ function Ha(e, t) {
2897
+ return e === null ? [] : La(e, Va(t)) ?? [];
2898
+ }
2899
+ function Ua(e, t) {
2900
+ let n = t.findIndex((t) => t.fromA === e.fromA && t.toA === e.toA);
2901
+ return n === -1 ? null : n;
2902
+ }
2903
+ var Q = v.define({
2904
+ create: () => ({
2905
+ baseline: null,
2906
+ hunks: [],
2907
+ open: null
2908
+ }),
2909
+ update(e, t) {
2910
+ let { baseline: n, hunks: r, open: i } = e, a = !1;
2911
+ for (let e of t.effects) e.is(za) && (n = e.value === null ? null : Ma(e.value), i = null, a = !0);
2912
+ if (a || t.docChanged && n !== null) {
2913
+ let e = i === null ? void 0 : r[i];
2914
+ r = Ha(n, t.state.doc), i = e === void 0 ? null : Ua(e, r);
2915
+ }
2916
+ for (let e of t.effects) e.is(Ba) && (i = i === e.value ? null : e.value);
2917
+ return n === e.baseline && r === e.hunks && i === e.open ? e : {
2918
+ baseline: n,
2919
+ hunks: r,
2920
+ open: i
2921
+ };
2922
+ }
2923
+ }), Wa = class extends h {
2924
+ kind;
2925
+ index;
2926
+ atEnd;
2927
+ constructor(e, t, n = !1) {
2928
+ super(), this.kind = e, this.index = t, this.atEnd = n;
2929
+ }
2930
+ eq(e) {
2931
+ return e.kind === this.kind && e.index === this.index && e.atEnd === this.atEnd;
2932
+ }
2933
+ toDOM(e) {
2934
+ let t = document.createElement("div");
2935
+ return t.className = `cm-git-mark cm-git-${this.kind}${this.atEnd ? " cm-git-at-end" : ""}`, t.dataset.gitChange = this.kind, t.title = {
2936
+ added: "Added since HEAD: click to see the change",
2937
+ modified: "Changed since HEAD: click to see what was there",
2938
+ deleted: "Lines removed since HEAD: click to see them"
2939
+ }[this.kind], t.addEventListener("mousedown", (t) => {
2940
+ t.preventDefault(), e.dispatch({ effects: Ba.of(this.index) });
2941
+ }), t;
2942
+ }
2943
+ };
2944
+ function Ga(e) {
2945
+ let { hunks: t } = e.field(Q), n = e.doc, r = [];
2946
+ for (let [e, i] of t.entries()) {
2947
+ let t = ja(i);
2948
+ if (t === "deleted") {
2949
+ let a = i.fromB >= n.lines;
2950
+ r.push(new Wa(t, e, a).range(n.line(a ? n.lines : i.fromB + 1).from));
2951
+ } else for (let a = i.fromB; a < i.toB; a++) r.push(new Wa(t, e).range(n.line(a + 1).from));
2952
+ }
2953
+ return le.of(r, !0);
2954
+ }
2955
+ var Ka = class extends s {
2956
+ index;
2957
+ kind;
2958
+ old;
2959
+ editable;
2960
+ constructor(e, t, n, r) {
2961
+ super(), this.index = e, this.kind = t, this.old = n, this.editable = r;
2962
+ }
2963
+ eq(e) {
2964
+ return e.index === this.index && e.editable === this.editable && e.old.join("\n") === this.old.join("\n");
2965
+ }
2966
+ toDOM(e) {
2967
+ let t = document.createElement("div");
2968
+ t.className = "cm-git-peek", t.setAttribute("role", "region"), t.setAttribute("aria-label", "HEAD version of this change");
2969
+ let n = document.createElement("div");
2970
+ n.className = "cm-git-peek-bar";
2971
+ let r = document.createElement("span");
2972
+ if (r.textContent = this.kind === "added" ? "Not in HEAD" : "In HEAD", n.append(r), this.editable) {
2973
+ let t = document.createElement("button");
2974
+ t.type = "button", t.textContent = "Revert this change", t.addEventListener("click", () => {
2975
+ let { baseline: t, hunks: n } = e.state.field(Q), r = n[this.index];
2976
+ t !== null && r !== void 0 && (e.dispatch({
2977
+ changes: Ra(e.state.doc, t, r),
2978
+ userEvent: "input.revert"
2979
+ }), e.focus());
2980
+ }), n.append(t);
2981
+ }
2982
+ let i = document.createElement("button");
2983
+ if (i.type = "button", i.textContent = "Close", i.addEventListener("click", () => e.dispatch({ effects: Ba.of(this.index) })), n.append(i), t.append(n), this.old.length > 0) {
2984
+ let e = document.createElement("pre");
2985
+ e.className = "cm-git-peek-old", e.textContent = this.old.join("\n"), t.append(e);
2986
+ }
2987
+ return t;
2988
+ }
2989
+ ignoreEvent() {
2990
+ return !0;
2991
+ }
2992
+ };
2993
+ function qa(e) {
2994
+ let t = e.field(Q);
2995
+ if (t.open === null || t.baseline === null) return n.none;
2996
+ let r = t.hunks[t.open];
2997
+ if (r === void 0) return n.none;
2998
+ let i = e.doc, a = ja(r), o = t.baseline.slice(r.fromA, r.toA), s = new Ka(t.open, a, o, !e.readOnly), c = a !== "deleted", l = c ? i.line(r.toB) : r.fromB < i.lines ? i.line(r.fromB + 1) : i.line(i.lines), u = c || r.fromB >= i.lines;
2999
+ return n.set(n.widget({
3000
+ widget: s,
3001
+ block: !0,
3002
+ side: u ? 1 : -1
3003
+ }).range(u ? l.to : l.from));
3004
+ }
3005
+ function Ja() {
3006
+ return [
3007
+ Q,
3008
+ m.decorations.compute([Q], qa),
3009
+ r({
3010
+ class: "cm-git-gutter",
3011
+ markers: (e) => Ga(e.state),
3012
+ lineMarkerChange: (e) => e.startState.field(Q) !== e.state.field(Q)
3013
+ })
3014
+ ];
3015
+ }
3016
+ //#endregion
2640
3017
  //#region ../ui/src/components/CodeEditor.tsx
2641
- var sa = /* @__PURE__ */ e({
2642
- CodeEditor: () => pa,
2643
- detectIndentUnit: () => ua,
3018
+ var Ya = /* @__PURE__ */ e({
3019
+ CodeEditor: () => to,
3020
+ detectIndentUnit: () => Qa,
2644
3021
  documentPosition: () => $
2645
- }), ca = y.define(), la = C.define({
3022
+ }), Xa = E.define(), Za = v.define({
2646
3023
  create: () => n.none,
2647
3024
  update(e, t) {
2648
- for (let e of t.effects) if (e.is(ca)) return n.set(e.value.map(({ from: e, to: t, current: r }) => n.mark({ class: r ? "find-match-current" : "find-match" }).range(e, t)), !0);
3025
+ for (let e of t.effects) if (e.is(Xa)) return n.set(e.value.map(({ from: e, to: t, current: r }) => n.mark({ class: r ? "find-match-current" : "find-match" }).range(e, t)), !0);
2649
3026
  return e.map(t.changes);
2650
3027
  },
2651
- provide: (e) => p.decorations.from(e)
3028
+ provide: (e) => m.decorations.from(e)
2652
3029
  });
2653
- function ua(e) {
3030
+ function Qa(e) {
2654
3031
  if (/^\t/m.test(e)) return " ";
2655
3032
  let t = [...e.matchAll(/^( +)\S/gm)].map((e) => e[1].length).filter((e) => e >= 2 && e <= 8);
2656
3033
  return " ".repeat(t.length === 0 ? 2 : Math.min(...t));
@@ -2660,26 +3037,26 @@ function $(e, t) {
2660
3037
  for (let r = e.indexOf("\r\n"); r !== -1 && r < t - 1; r = e.indexOf("\r\n", r + 2)) n++;
2661
3038
  return t - n;
2662
3039
  }
2663
- var da = ({ state: e, dispatch: t }) => e.selection.ranges.some((e) => !e.empty) ? mi({
3040
+ var $a = ({ state: e, dispatch: t }) => e.selection.ranges.some((e) => !e.empty) ? xi({
2664
3041
  state: e,
2665
3042
  dispatch: t
2666
- }) : (t(e.update(e.replaceSelection(e.facet(E)), {
3043
+ }) : (t(e.update(e.replaceSelection(e.facet(De)), {
2667
3044
  scrollIntoView: !0,
2668
3045
  userEvent: "input"
2669
3046
  })), !0);
2670
- function fa(e) {
3047
+ function eo(e) {
2671
3048
  return [
2672
- r(),
2673
- wn(),
2674
- f(),
2675
- t.allowMultipleSelections.of(!0),
3049
+ l(),
3050
+ On(),
2676
3051
  te(),
2677
- Ut(),
2678
- on({ activateOnTyping: !1 }),
2679
- s(),
2680
- o(),
2681
- De(),
2682
- c.of([
3052
+ we.allowMultipleSelections.of(!0),
3053
+ ne(),
3054
+ Gt(),
3055
+ ln({ activateOnTyping: !1 }),
3056
+ be(),
3057
+ u(),
3058
+ ie(),
3059
+ ae.of([
2683
3060
  ...["Ctrl-s", "Meta-s"].map((t) => ({
2684
3061
  key: t,
2685
3062
  preventDefault: !0,
@@ -2687,43 +3064,43 @@ function fa(e) {
2687
3064
  })),
2688
3065
  {
2689
3066
  key: "Mod-d",
2690
- run: Bi,
3067
+ run: qi,
2691
3068
  preventDefault: !0
2692
3069
  },
2693
- ...Yt,
2694
- ...yi,
2695
- ...Rn,
3070
+ ...Zt,
3071
+ ...Ei,
3072
+ ...Wn,
2696
3073
  ...fe,
2697
- ...sn,
3074
+ ...un,
2698
3075
  {
2699
3076
  key: "Tab",
2700
- run: da,
2701
- shift: hi,
3077
+ run: $a,
3078
+ shift: Si,
2702
3079
  preventDefault: !0
2703
3080
  }
2704
3081
  ]),
2705
- p.updateListener.of((t) => {
3082
+ m.updateListener.of((t) => {
2706
3083
  t.docChanged && e.current.onChange?.(t.state.sliceDoc());
2707
3084
  })
2708
3085
  ];
2709
3086
  }
2710
- function pa({ value: e, path: n, onChange: r, onSave: i, handle: a, readOnly: o = !1, label: s = o ? "File source" : "File editor" }) {
2711
- let u = Ae(null), d = Ae(null), f = Ae({
3087
+ function to({ value: e, path: n, onChange: r, onSave: i, handle: a, readOnly: o = !1, baseline: s = null, label: l = o ? "File source" : "File editor" }) {
3088
+ let u = Me(null), d = Me(null), f = Me({
2712
3089
  onChange: r,
2713
3090
  onSave: i
2714
3091
  });
2715
- return f.current = {
3092
+ f.current = {
2716
3093
  onChange: r,
2717
3094
  onSave: i
2718
- }, ke(a, () => ({
3095
+ }, je(a, () => ({
2719
3096
  focus: () => d.current?.focus(),
2720
3097
  select(e, t) {
2721
3098
  let n = d.current;
2722
3099
  if (n === null) return;
2723
3100
  let r = n.state.sliceDoc(), i = n.state.doc.length, a = Math.min($(r, e), i), o = Math.min($(r, t), i);
2724
3101
  n.dispatch({
2725
- selection: g.single(a, o),
2726
- effects: p.scrollIntoView(a, { y: "center" })
3102
+ selection: b.single(a, o),
3103
+ effects: m.scrollIntoView(a, { y: "center" })
2727
3104
  });
2728
3105
  },
2729
3106
  markMatches(e, t) {
@@ -2734,57 +3111,63 @@ function pa({ value: e, path: n, onChange: r, onSave: i, handle: a, readOnly: o
2734
3111
  to: Math.min($(r, n), i),
2735
3112
  current: a === t
2736
3113
  })).filter(({ from: e, to: t }) => e < t);
2737
- n.dispatch({ effects: ca.of(a) });
3114
+ n.dispatch({ effects: Xa.of(a) });
2738
3115
  }
2739
- })), Oe(() => {
2740
- let r = new oe(), i = new p({
3116
+ })), Ae(() => {
3117
+ let r = new t(), i = new m({
2741
3118
  parent: u.current,
2742
- state: t.create({
3119
+ state: we.create({
2743
3120
  doc: e,
2744
3121
  extensions: [
2745
- t.lineSeparator.of(e.includes("\r\n") ? "\r\n" : "\n"),
2746
- E.of(ua(e)),
2747
- ne(),
3122
+ we.lineSeparator.of(e.includes("\r\n") ? "\r\n" : "\n"),
3123
+ De.of(Qa(e)),
3124
+ c(),
3125
+ Ja(),
2748
3126
  re(),
2749
3127
  ge(),
2750
- l(),
2751
- ee(pe),
2752
- ce(),
2753
- ji(),
2754
- la,
2755
- p.lineWrapping,
2756
- p.contentAttributes.of({
2757
- "aria-label": s,
3128
+ p(),
3129
+ ee(Ee),
3130
+ de(),
3131
+ Ri(),
3132
+ Za,
3133
+ m.lineWrapping,
3134
+ m.contentAttributes.of({
3135
+ "aria-label": l,
2758
3136
  spellcheck: "false"
2759
3137
  }),
2760
3138
  ...o ? [
2761
- t.readOnly.of(!0),
2762
- p.editable.of(!1),
2763
- c.of(fe)
2764
- ] : fa(f),
3139
+ we.readOnly.of(!0),
3140
+ m.editable.of(!1),
3141
+ ae.of(fe)
3142
+ ] : eo(f),
2765
3143
  r.of([])
2766
3144
  ]
2767
3145
  })
2768
3146
  });
2769
- d.current = i, o || i.focus();
3147
+ d.current = i, s !== null && i.dispatch({ effects: za.of(s) }), o || i.focus();
2770
3148
  let a = !0;
2771
- return oa(n).then((e) => {
3149
+ return pa(n).then((e) => {
2772
3150
  a && e !== null && i.dispatch({ effects: r.reconfigure(e) });
2773
3151
  }, () => {}), () => {
2774
3152
  a = !1, i.destroy(), d.current = null;
2775
3153
  };
2776
- }, []), Oe(() => {
3154
+ }, []), Ae(() => {
2777
3155
  let t = d.current;
2778
3156
  t !== null && t.state.sliceDoc() !== e && t.dispatch({ changes: {
2779
3157
  from: 0,
2780
3158
  to: t.state.doc.length,
2781
3159
  insert: e
2782
3160
  } });
2783
- }, [e]), /* @__PURE__ */ je("div", {
3161
+ }, [e]);
3162
+ let h = Me(s);
3163
+ return Ae(() => {
3164
+ let e = d.current;
3165
+ e !== null && h.current !== s && (h.current = s, e.dispatch({ effects: za.of(s) }));
3166
+ }, [s]), /* @__PURE__ */ Ne("div", {
2784
3167
  ref: u,
2785
3168
  className: "code-editor h-full w-full",
2786
3169
  "data-testid": o ? "file-source" : "file-editor"
2787
3170
  });
2788
3171
  }
2789
3172
  //#endregion
2790
- export { pa as CodeEditor, zt as a, ua as detectIndentUnit, $ as documentPosition, Ie as i, Me as n, Fe as r, sa as t };
3173
+ export { to as CodeEditor, Vt as a, Qa as detectIndentUnit, $ as documentPosition, Re as i, Pe as n, Le as r, Ya as t };