@onerjs/code-input 0.1.3 → 0.1.5

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.
@@ -1,5 +1,5 @@
1
- import { defineComponent as St, ref as E, computed as K, watch as Be, nextTick as V, onMounted as Et, onBeforeUnmount as Mt, openBlock as I, createElementBlock as L, normalizeStyle as re, normalizeClass as te, createElementVNode as A, withModifiers as Oe, Fragment as Ne, renderList as We, toDisplayString as Y, createCommentVNode as Z, createTextVNode as Rt } from "vue";
2
- const It = [
1
+ import { defineComponent as Bt, ref as R, computed as q, watch as ze, nextTick as P, onMounted as Ot, onBeforeUnmount as Nt, openBlock as I, createElementBlock as H, normalizeStyle as ce, normalizeClass as le, createElementVNode as B, withModifiers as De, Fragment as je, renderList as Fe, toDisplayString as Y, createCommentVNode as K, createTextVNode as Wt } from "vue";
2
+ const zt = [
3
3
  {
4
4
  label: "Math",
5
5
  kind: "class",
@@ -134,14 +134,14 @@ const It = [
134
134
  kind: "function",
135
135
  detail: "(id: number) => void"
136
136
  }
137
- ], Lt = /[\w$]/;
138
- function _t(n, s) {
137
+ ], Dt = /[\w$]/;
138
+ function jt(n, s) {
139
139
  const o = [];
140
140
  let e = null;
141
- for (let C = 0; C < s; C++) {
142
- const b = n[C];
141
+ for (let S = 0; S < s; S++) {
142
+ const b = n[S];
143
143
  if (e) {
144
- b === e && n[C - 1] !== "\\" && (e = null);
144
+ b === e && n[S - 1] !== "\\" && (e = null);
145
145
  continue;
146
146
  }
147
147
  if (b === "'" || b === '"' || b === "`") {
@@ -149,7 +149,7 @@ function _t(n, s) {
149
149
  continue;
150
150
  }
151
151
  if (b === "(") {
152
- o.push({ index: C, commas: 0 });
152
+ o.push({ index: S, commas: 0 });
153
153
  continue;
154
154
  }
155
155
  if (b === ")") {
@@ -162,15 +162,15 @@ function _t(n, s) {
162
162
  if (!i) return null;
163
163
  let r = i.index - 1;
164
164
  for (; r >= 0 && /\s/.test(n[r]); ) r--;
165
- const d = r;
166
- for (; r >= 0 && Lt.test(n[r]); ) r--;
167
- const u = n.slice(r + 1, d + 1);
165
+ const f = r;
166
+ for (; r >= 0 && Dt.test(n[r]); ) r--;
167
+ const u = n.slice(r + 1, f + 1);
168
168
  if (!u) return null;
169
169
  let a = s;
170
170
  for (; a > 0 && /[\w$'"]/.test(n[a - 1]); ) a--;
171
- const f = n.slice(a, s);
172
- let $ = f, z = null;
173
- return f && (f[0] === "'" || f[0] === '"') && (z = f[0], $ = f.slice(1)), {
171
+ const d = n.slice(a, s);
172
+ let $ = d, z = null;
173
+ return d && (d[0] === "'" || d[0] === '"') && (z = d[0], $ = d.slice(1)), {
174
174
  functionName: u,
175
175
  paramIndex: i.commas,
176
176
  prefix: $,
@@ -178,7 +178,7 @@ function _t(n, s) {
178
178
  quote: z
179
179
  };
180
180
  }
181
- const ze = [
181
+ const Pe = [
182
182
  "break",
183
183
  "case",
184
184
  "catch",
@@ -223,7 +223,7 @@ const ze = [
223
223
  "undefined",
224
224
  "NaN",
225
225
  "Infinity"
226
- ], Ht = [
226
+ ], Ft = [
227
227
  "abstract",
228
228
  "any",
229
229
  "as",
@@ -253,36 +253,36 @@ const ze = [
253
253
  "type",
254
254
  "unknown"
255
255
  ];
256
- function Je(n) {
257
- return n === "typescript" ? [...ze, ...Ht] : ze;
256
+ function et(n) {
257
+ return n === "typescript" ? [...Pe, ...Ft] : Pe;
258
258
  }
259
- function De(n) {
260
- return new Set(Je(n));
259
+ function Ve(n) {
260
+ return new Set(et(n));
261
261
  }
262
- const At = /((?:[A-Za-z_$][\w$]*\??\.)*)([A-Za-z_$][\w$]*)?$/, je = /\b(?:const|let|var|function|class)\s+([A-Za-z_$][\w$]*)/g, Bt = /^[A-Za-z_$]/;
263
- function Xe(n, s) {
264
- const o = n.slice(0, s), e = At.exec(o);
262
+ const Pt = /((?:[A-Za-z_$][\w$]*\??\.)*)([A-Za-z_$][\w$]*)?$/, qe = /\b(?:const|let|var|function|class)\s+([A-Za-z_$][\w$]*)/g, Vt = /^[A-Za-z_$]/;
263
+ function tt(n, s) {
264
+ const o = n.slice(0, s), e = Pt.exec(o);
265
265
  if (!e) return { prefix: "", chain: [] };
266
- const i = e[1] ?? "", r = e[2] ?? "", d = i.split(".").filter(Boolean).map((u) => u.replace(/\?$/, ""));
267
- return { prefix: r, chain: d };
266
+ const i = e[1] ?? "", r = e[2] ?? "", f = i.split(".").filter(Boolean).map((u) => u.replace(/\?$/, ""));
267
+ return { prefix: r, chain: f };
268
268
  }
269
- function Fe(n, s) {
269
+ function Ke(n, s) {
270
270
  const o = [], e = /* @__PURE__ */ new Set();
271
271
  let i;
272
- for (je.lastIndex = 0; (i = je.exec(n)) && !(i.index >= s); ) {
272
+ for (qe.lastIndex = 0; (i = qe.exec(n)) && !(i.index >= s); ) {
273
273
  const r = i[1];
274
274
  if (e.has(r)) continue;
275
275
  e.add(r);
276
- const d = i[0].slice(0, i[0].indexOf(r)).trim();
276
+ const f = i[0].slice(0, i[0].indexOf(r)).trim();
277
277
  o.push({
278
278
  label: r,
279
- kind: d === "function" ? "function" : d === "class" ? "class" : "variable",
279
+ kind: f === "function" ? "function" : f === "class" ? "class" : "variable",
280
280
  detail: "当前文件"
281
281
  });
282
282
  }
283
283
  return o;
284
284
  }
285
- function Ge(n, s) {
285
+ function nt(n, s) {
286
286
  let o = s;
287
287
  for (const e of n) {
288
288
  if (!o) return null;
@@ -292,74 +292,74 @@ function Ge(n, s) {
292
292
  }
293
293
  return o;
294
294
  }
295
- function Ot(n, s) {
295
+ function qt(n, s) {
296
296
  const o = n.toLowerCase(), e = s.toLowerCase(), i = o.indexOf(e);
297
297
  if (i === 0) return 1e3 - o.length;
298
298
  if (i > 0) return 800 - i;
299
- let r = 0, d = 0, u = -1;
299
+ let r = 0, f = 0, u = -1;
300
300
  for (let a = 0; a < o.length && r < e.length; a++)
301
- o[a] === e[r] && (u >= 0 && (d += a - u - 1), u = a, r++);
302
- return r !== e.length ? null : 400 - d - o.length;
301
+ o[a] === e[r] && (u >= 0 && (f += a - u - 1), u = a, r++);
302
+ return r !== e.length ? null : 400 - f - o.length;
303
303
  }
304
- function Qe(n, s) {
304
+ function lt(n, s) {
305
305
  if (!s) return n;
306
306
  const o = [];
307
307
  for (const e of n) {
308
- const i = Ot(e.label, s);
308
+ const i = qt(e.label, s);
309
309
  i !== null && o.push({ item: e, score: i });
310
310
  }
311
311
  return o.sort((e, i) => i.score - e.score || e.item.label.localeCompare(i.item.label)), o.map((e) => e.item);
312
312
  }
313
- function Nt(n) {
313
+ function Kt(n) {
314
314
  const s = /* @__PURE__ */ new Set(), o = [];
315
315
  for (const e of n)
316
316
  s.has(e.label) || (s.add(e.label), o.push(e));
317
317
  return o;
318
318
  }
319
- function Wt(n, s, o) {
320
- const { prefix: e, chain: i } = Xe(n, s);
321
- if (o.auto && (!e && i.length === 0 || e && !Bt.test(e)))
319
+ function Zt(n, s, o) {
320
+ const { prefix: e, chain: i } = tt(n, s);
321
+ if (o.auto && (!e && i.length === 0 || e && !Vt.test(e)))
322
322
  return null;
323
- const r = o.declared ?? [], d = [...r, ...o.completions];
323
+ const r = o.declared ?? [], f = [...r, ...o.completions];
324
324
  let u;
325
325
  if (i.length > 0) {
326
- const f = Ge(i, d);
327
- if (!f || f.length === 0) return null;
328
- u = f;
326
+ const d = nt(i, f);
327
+ if (!d || d.length === 0) return null;
328
+ u = d;
329
329
  } else
330
330
  u = [
331
331
  ...o.completions,
332
332
  ...r,
333
- ...Je(o.language).map((f) => ({
334
- label: f,
333
+ ...et(o.language).map((d) => ({
334
+ label: d,
335
335
  kind: "keyword"
336
336
  }))
337
337
  ];
338
- const a = Qe(Nt(u), e);
338
+ const a = lt(Kt(u), e);
339
339
  return a.length === 0 ? null : {
340
340
  items: a,
341
341
  start: s - e.length,
342
342
  end: s
343
343
  };
344
344
  }
345
- const zt = /([A-Za-z_$][\w$]*(?:\??\.[A-Za-z_$][\w$]*)*)\??\.\s*$/;
346
- function Dt(n, s, o, e) {
345
+ const Ut = /([A-Za-z_$][\w$]*(?:\??\.[A-Za-z_$][\w$]*)*)\??\.\s*$/;
346
+ function Yt(n, s, o, e) {
347
347
  const i = n.slice(s, o);
348
348
  if (!i) return null;
349
- const r = [...e.declared ?? [], ...e.completions], d = zt.exec(n.slice(0, s));
350
- if (d) {
351
- const u = d[1].split(".").filter(Boolean).map(($) => $.replace(/\?$/, "")), a = Ge(u, r), f = a == null ? void 0 : a.find(($) => $.label === i);
352
- if (f) return f;
349
+ const r = [...e.declared ?? [], ...e.completions], f = Ut.exec(n.slice(0, s));
350
+ if (f) {
351
+ const u = f[1].split(".").filter(Boolean).map(($) => $.replace(/\?$/, "")), a = nt(u, r), d = a == null ? void 0 : a.find(($) => $.label === i);
352
+ if (d) return d;
353
353
  }
354
354
  return r.find((u) => u.label === i) ?? null;
355
355
  }
356
- const U = "[A-Za-z_$][\\w$]*", Pe = "(?:readonly\\s+|public\\s+|private\\s+|protected\\s+|static\\s+|abstract\\s+)*";
357
- function Ve(n, s) {
356
+ const Z = "[A-Za-z_$][\\w$]*", Ze = "(?:readonly\\s+|public\\s+|private\\s+|protected\\s+|static\\s+|abstract\\s+)*";
357
+ function Ue(n, s) {
358
358
  let o = 0, e = !1, i = s;
359
359
  for (let r = s; r < n.length; r++) {
360
- const d = n[r];
361
- for (let u = 0; u < d.length; u++) {
362
- const a = d[u];
360
+ const f = n[r];
361
+ for (let u = 0; u < f.length; u++) {
362
+ const a = f[u];
363
363
  a === "{" ? (o++, e = !0) : a === "}" && o--;
364
364
  }
365
365
  if (e && o <= 0) {
@@ -369,23 +369,23 @@ function Ve(n, s) {
369
369
  }
370
370
  return { end: i, body: n.slice(s + 1, i) };
371
371
  }
372
- function qe(n) {
372
+ function Ye(n) {
373
373
  return n.trim().replace(/[,;]$/, "").trim();
374
374
  }
375
- function jt(n) {
375
+ function Xt(n) {
376
376
  return /^(?:export\s+)?(?:declare\s+)?(?:abstract\s+)?(?:interface|class|type|function|const|let|var|namespace|enum)\b/.test(
377
377
  n
378
378
  );
379
379
  }
380
- function ne(n, s) {
380
+ function ie(n, s) {
381
381
  const o = n[s];
382
382
  let e = o.lastIndexOf("}");
383
383
  const i = o.lastIndexOf(";");
384
384
  if (i > e && (e = i), e === -1) return;
385
385
  const r = o.slice(e + 1).replace(/^[\s;]+/, "").trim();
386
- !r || !jt(r) || (n[s] = o.slice(0, e + 1), n.splice(s + 1, 0, r));
386
+ !r || !Xt(r) || (n[s] = o.slice(0, e + 1), n.splice(s + 1, 0, r));
387
387
  }
388
- function J(n) {
388
+ function G(n) {
389
389
  return n.length ? n.join(`
390
390
  `).replace(/^\s*\/\*\*?/, "").replace(/\*\/\s*$/, "").split(`
391
391
  `).map((s) => s.replace(/^\s*\*+\s?/, "").replace(/^\s*\/\/\s?/, "")).join(`
@@ -393,23 +393,23 @@ function J(n) {
393
393
 
394
394
  `).trim() : "";
395
395
  }
396
- function Ke(n) {
396
+ function Xe(n) {
397
397
  return n.split(`
398
398
  `).filter((s) => !/^\s*(\/\/|\/\*|\*)/.test(s)).join(`
399
399
  `).replace(/\n{2,}/g, `
400
400
  `).trim();
401
401
  }
402
- function Ze(n) {
403
- const s = [], o = /* @__PURE__ */ new Set(), e = new RegExp(`^${Pe}(${U})(\\?)?\\s*\\((.*)\\)\\s*:\\s*(.+?);?$`), i = new RegExp(`^${Pe}(${U})(\\?)?\\s*:\\s*(.+?);?$`);
404
- let r = [], d = !1;
402
+ function Je(n) {
403
+ const s = [], o = /* @__PURE__ */ new Set(), e = new RegExp(`^${Ze}(${Z})(\\?)?\\s*\\((.*)\\)\\s*:\\s*(.+?);?$`), i = new RegExp(`^${Ze}(${Z})(\\?)?\\s*:\\s*(.+?);?$`);
404
+ let r = [], f = !1;
405
405
  for (const u of n) {
406
406
  const a = u.trim();
407
- if (d) {
408
- r.push(a), a.includes("*/") && (d = !1);
407
+ if (f) {
408
+ r.push(a), a.includes("*/") && (f = !1);
409
409
  continue;
410
410
  }
411
411
  if (a.startsWith("/*")) {
412
- r.push(a), a.includes("*/") || (d = !0);
412
+ r.push(a), a.includes("*/") || (f = !0);
413
413
  continue;
414
414
  }
415
415
  if (a.startsWith("//")) {
@@ -420,31 +420,31 @@ function Ze(n) {
420
420
  r = [];
421
421
  continue;
422
422
  }
423
- const f = e.exec(a);
424
- if (f) {
425
- const z = J(r);
423
+ const d = e.exec(a);
424
+ if (d) {
425
+ const z = G(r);
426
426
  r = [];
427
- const C = f[1];
428
- if (o.has(C)) continue;
429
- o.add(C), s.push({
430
- label: C,
427
+ const S = d[1];
428
+ if (o.has(S)) continue;
429
+ o.add(S), s.push({
430
+ label: S,
431
431
  kind: "function",
432
- detail: `(${f[3].trim()}) => ${qe(f[4])}`,
432
+ detail: `(${d[3].trim()}) => ${Ye(d[4])}`,
433
433
  documentation: z || void 0
434
434
  });
435
435
  continue;
436
436
  }
437
437
  const $ = i.exec(a);
438
438
  if ($) {
439
- const z = J(r);
439
+ const z = G(r);
440
440
  r = [];
441
- const C = $[1];
442
- if (o.has(C)) continue;
443
- o.add(C);
444
- const b = qe($[3]), y = /^\(|=>/.test(b) ? "function" : "property";
441
+ const S = $[1];
442
+ if (o.has(S)) continue;
443
+ o.add(S);
444
+ const b = Ye($[3]), v = /^\(|=>/.test(b) ? "function" : "property";
445
445
  s.push({
446
- label: C,
447
- kind: y,
446
+ label: S,
447
+ kind: v,
448
448
  detail: b,
449
449
  documentation: z || void 0
450
450
  });
@@ -452,20 +452,20 @@ function Ze(n) {
452
452
  }
453
453
  return s;
454
454
  }
455
- function et(n) {
455
+ function it(n) {
456
456
  const s = [], o = /(['"])((?:\\.|(?!\1).)*)\1/g;
457
457
  let e;
458
458
  for (; e = o.exec(n); )
459
459
  s.push(e[2]);
460
460
  return s;
461
461
  }
462
- function Ft(n, s) {
462
+ function Jt(n, s) {
463
463
  const o = [];
464
464
  let e = 0, i = "", r = null;
465
- for (let d = 0; d < n.length; d++) {
466
- const u = n[d];
465
+ for (let f = 0; f < n.length; f++) {
466
+ const u = n[f];
467
467
  if (r) {
468
- i += u, u === r && n[d - 1] !== "\\" && (r = null);
468
+ i += u, u === r && n[f - 1] !== "\\" && (r = null);
469
469
  continue;
470
470
  }
471
471
  if (u === "'" || u === '"' || u === "`") {
@@ -480,16 +480,16 @@ function Ft(n, s) {
480
480
  }
481
481
  return o.push(i), o;
482
482
  }
483
- function Pt(n, s) {
484
- const o = n.trim(), e = et(o);
483
+ function Gt(n, s) {
484
+ const o = n.trim(), e = it(o);
485
485
  if (e.length) return e;
486
486
  const i = s.get(o.replace(/\[\]$/, ""));
487
487
  return (i == null ? void 0 : i.literals) ?? [];
488
488
  }
489
- function Vt(n, s) {
489
+ function Qt(n, s) {
490
490
  const o = n.trim();
491
- return o ? Ft(o, ",").map((e) => {
492
- const i = new RegExp(`^\\s*(${U})\\s*(\\?)?\\s*:\\s*(.+)$`).exec(e);
491
+ return o ? Jt(o, ",").map((e) => {
492
+ const i = new RegExp(`^\\s*(${Z})\\s*(\\?)?\\s*:\\s*(.+)$`).exec(e);
493
493
  if (!i)
494
494
  return { name: e.trim(), type: "", optional: !1, literals: [] };
495
495
  const r = i[3].replace(/\s*=\s*[^=]*$/, "").trim();
@@ -497,116 +497,116 @@ function Vt(n, s) {
497
497
  name: i[1],
498
498
  optional: !!i[2],
499
499
  type: r,
500
- literals: Pt(r, s)
500
+ literals: Gt(r, s)
501
501
  };
502
502
  }) : [];
503
503
  }
504
- function tt(n) {
505
- const s = n.replace(/\[\]/g, "").replace(/<[^>]*>/g, "").replace(/\s*\|\s*null\s*/g, "").trim(), o = new RegExp(`^(${U})$`).exec(s);
504
+ function ot(n) {
505
+ const s = n.replace(/\[\]/g, "").replace(/<[^>]*>/g, "").replace(/\s*\|\s*null\s*/g, "").trim(), o = new RegExp(`^(${Z})$`).exec(s);
506
506
  return o ? o[1] : null;
507
507
  }
508
- function qt(n) {
508
+ function en(n) {
509
509
  const s = n.trim();
510
510
  if (!s || s.endsWith(";")) return !1;
511
511
  const o = (s.match(/[(<[{]/g) ?? []).length, e = (s.match(/[)>\]}]/g) ?? []).length;
512
512
  return /[|&,(<]\s*$/.test(s) || o > e;
513
513
  }
514
- function nt(n, s, o, e = 0) {
514
+ function at(n, s, o, e = 0) {
515
515
  return e > 6 ? n : n.map((i) => {
516
516
  if (i.kind !== "property" || !i.detail) return i;
517
- const r = tt(i.detail), d = r ? s.get(r) : void 0;
518
- if (!d || o.has(d.label)) return i;
517
+ const r = ot(i.detail), f = r ? s.get(r) : void 0;
518
+ if (!f || o.has(f.label)) return i;
519
519
  const u = new Set(o);
520
- return u.add(d.label), {
520
+ return u.add(f.label), {
521
521
  ...i,
522
- type: d.type,
523
- members: nt(d.members, s, u, e + 1)
522
+ type: f.type,
523
+ members: at(f.members, s, u, e + 1)
524
524
  };
525
525
  });
526
526
  }
527
- const Kt = 50, le = /* @__PURE__ */ new Map(), Zt = { items: [], signatures: /* @__PURE__ */ new Map() };
528
- function lt(n) {
529
- if (!n || !n.trim()) return Zt;
530
- const s = le.get(n);
527
+ const tn = 50, oe = /* @__PURE__ */ new Map(), nn = { items: [], signatures: /* @__PURE__ */ new Map() };
528
+ function st(n) {
529
+ if (!n || !n.trim()) return nn;
530
+ const s = oe.get(n);
531
531
  if (s) return s;
532
- const o = Jt(n);
533
- if (le.size >= Kt) {
534
- const e = le.keys().next().value;
535
- e !== void 0 && le.delete(e);
532
+ const o = an(n);
533
+ if (oe.size >= tn) {
534
+ const e = oe.keys().next().value;
535
+ e !== void 0 && oe.delete(e);
536
536
  }
537
- return le.set(n, o), o;
537
+ return oe.set(n, o), o;
538
538
  }
539
- function Ut(n) {
540
- return lt(n).items;
539
+ function ln(n) {
540
+ return st(n).items;
541
541
  }
542
- function Yt(n) {
543
- return lt(n).signatures;
542
+ function on(n) {
543
+ return st(n).signatures;
544
544
  }
545
- function Jt(n) {
545
+ function an(n) {
546
546
  const s = n.split(`
547
- `), o = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map(), i = new RegExp(`^(?:export\\s+)?(?:declare\\s+)?interface\\s+(${U})`), r = new RegExp(`^(?:export\\s+)?(?:declare\\s+)?(?:abstract\\s+)?class\\s+(${U})`), d = new RegExp(`^(?:export\\s+)?(?:declare\\s+)?type\\s+(${U})\\s*=`);
547
+ `), o = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map(), i = new RegExp(`^(?:export\\s+)?(?:declare\\s+)?interface\\s+(${Z})`), r = new RegExp(`^(?:export\\s+)?(?:declare\\s+)?(?:abstract\\s+)?class\\s+(${Z})`), f = new RegExp(`^(?:export\\s+)?(?:declare\\s+)?type\\s+(${Z})\\s*=`);
548
548
  let u = [], a = !1;
549
549
  for (let b = 0; b < s.length; b++) {
550
- const y = s[b].trim();
550
+ const v = s[b].trim();
551
551
  if (a) {
552
- u.push(y), y.includes("*/") && (a = !1);
552
+ u.push(v), v.includes("*/") && (a = !1);
553
553
  continue;
554
554
  }
555
- if (y.startsWith("/*")) {
556
- u.push(y), y.includes("*/") || (a = !0);
555
+ if (v.startsWith("/*")) {
556
+ u.push(v), v.includes("*/") || (a = !0);
557
557
  continue;
558
558
  }
559
- if (y.startsWith("//")) {
560
- u.push(y);
559
+ if (v.startsWith("//")) {
560
+ u.push(v);
561
561
  continue;
562
562
  }
563
- if (!y) {
563
+ if (!v) {
564
564
  u = [];
565
565
  continue;
566
566
  }
567
- const O = i.exec(y);
568
- if (O && y.includes("{")) {
569
- const w = J(u);
567
+ const W = i.exec(v);
568
+ if (W && v.includes("{")) {
569
+ const w = G(u);
570
570
  u = [];
571
- const { end: T, body: _ } = Ve(s, b), g = O[1];
571
+ const { end: T, body: L } = Ue(s, b), g = W[1];
572
572
  o.set(g, {
573
573
  label: g,
574
- type: Ke(
574
+ type: Xe(
575
575
  s.slice(b, T + 1).join(`
576
576
  `).replace(/^\s*export\s+/, "")
577
577
  ),
578
- members: Ze(_),
578
+ members: Je(L),
579
579
  kind: "interface",
580
580
  documentation: w || void 0
581
- }), ne(s, T), b = T;
581
+ }), ie(s, T), b = T;
582
582
  continue;
583
583
  }
584
- const B = r.exec(y);
585
- if (B && y.includes("{")) {
586
- const w = J(u);
584
+ const O = r.exec(v);
585
+ if (O && v.includes("{")) {
586
+ const w = G(u);
587
587
  u = [];
588
- const { end: T, body: _ } = Ve(s, b), g = B[1];
588
+ const { end: T, body: L } = Ue(s, b), g = O[1];
589
589
  o.set(g, {
590
590
  label: g,
591
- type: Ke(
591
+ type: Xe(
592
592
  s.slice(b, T + 1).join(`
593
593
  `).replace(/^\s*export\s+/, "")
594
594
  ),
595
- members: Ze(_),
595
+ members: Je(L),
596
596
  kind: "class",
597
597
  documentation: w || void 0
598
- }), ne(s, T), b = T;
598
+ }), ie(s, T), b = T;
599
599
  continue;
600
600
  }
601
- const M = d.exec(y);
601
+ const M = f.exec(v);
602
602
  if (M) {
603
- const w = J(u);
603
+ const w = G(u);
604
604
  u = [];
605
605
  const T = [s[b]];
606
- let _ = b;
607
- for (; qt(T.join(`
608
- `)) && _ + 1 < s.length; )
609
- _++, T.push(s[_]);
606
+ let L = b;
607
+ for (; en(T.join(`
608
+ `)) && L + 1 < s.length; )
609
+ L++, T.push(s[L]);
610
610
  const g = T.join(`
611
611
  `).replace(/^\s*export\s+/, "").replace(/;\s*$/, "").trim();
612
612
  o.set(M[1], {
@@ -615,74 +615,74 @@ function Jt(n) {
615
615
  members: [],
616
616
  kind: "type",
617
617
  documentation: w || void 0,
618
- literals: et(g)
619
- }), ne(s, _), b = _;
618
+ literals: it(g)
619
+ }), ie(s, L), b = L;
620
620
  continue;
621
621
  }
622
622
  u = [];
623
623
  }
624
- const f = [], $ = /* @__PURE__ */ new Set(), z = new RegExp(
625
- `^(?:export\\s+)?(?:declare\\s+)?function\\s+(${U})\\s*\\(([^)]*)\\)\\s*:\\s*([^;{]+)`
626
- ), C = new RegExp(
627
- `^(?:export\\s+)?(?:declare\\s+)?(?:const|let|var)\\s+(${U})\\s*:\\s*([^=;]+)`
624
+ const d = [], $ = /* @__PURE__ */ new Set(), z = new RegExp(
625
+ `^(?:export\\s+)?(?:declare\\s+)?function\\s+(${Z})\\s*\\(([^)]*)\\)\\s*:\\s*([^;{]+)`
626
+ ), S = new RegExp(
627
+ `^(?:export\\s+)?(?:declare\\s+)?(?:const|let|var)\\s+(${Z})\\s*:\\s*([^=;]+)`
628
628
  );
629
629
  u = [], a = !1;
630
630
  for (let b = 0; b < s.length; b++) {
631
- const y = s[b].trim();
631
+ const v = s[b].trim();
632
632
  if (a) {
633
- u.push(y), y.includes("*/") && (a = !1);
633
+ u.push(v), v.includes("*/") && (a = !1);
634
634
  continue;
635
635
  }
636
- if (y.startsWith("/*")) {
637
- u.push(y), y.includes("*/") || (a = !0);
636
+ if (v.startsWith("/*")) {
637
+ u.push(v), v.includes("*/") || (a = !0);
638
638
  continue;
639
639
  }
640
- if (y.startsWith("//")) {
641
- u.push(y);
640
+ if (v.startsWith("//")) {
641
+ u.push(v);
642
642
  continue;
643
643
  }
644
- if (!y) {
644
+ if (!v) {
645
645
  u = [];
646
646
  continue;
647
647
  }
648
- const O = z.exec(y);
649
- if (O) {
650
- ne(s, b);
651
- const M = J(u);
648
+ const W = z.exec(v);
649
+ if (W) {
650
+ ie(s, b);
651
+ const M = G(u);
652
652
  u = [];
653
- const w = O[1];
654
- $.has(w) || ($.add(w), f.push({
653
+ const w = W[1];
654
+ $.has(w) || ($.add(w), d.push({
655
655
  label: w,
656
656
  kind: "function",
657
- detail: `(${O[2].trim()}) => ${O[3].trim()}`,
657
+ detail: `(${W[2].trim()}) => ${W[3].trim()}`,
658
658
  documentation: M || void 0
659
- })), e.set(w, { name: w, params: Vt(O[2], o) });
659
+ })), e.set(w, { name: w, params: Qt(W[2], o) });
660
660
  continue;
661
661
  }
662
- const B = C.exec(y);
663
- if (B) {
664
- ne(s, b);
665
- const M = J(u);
662
+ const O = S.exec(v);
663
+ if (O) {
664
+ ie(s, b);
665
+ const M = G(u);
666
666
  u = [];
667
- const w = B[1];
667
+ const w = O[1];
668
668
  if ($.has(w)) continue;
669
669
  $.add(w);
670
- const T = B[2].trim(), _ = tt(T), g = _ ? o.get(_) : void 0, ie = (g == null ? void 0 : g.kind) === "class" ? "class" : /^\(|=>/.test(T) ? "function" : "variable";
671
- f.push({
670
+ const T = O[2].trim(), L = ot(T), g = L ? o.get(L) : void 0, ae = (g == null ? void 0 : g.kind) === "class" ? "class" : /^\(|=>/.test(T) ? "function" : "variable";
671
+ d.push({
672
672
  label: w,
673
- kind: ie,
673
+ kind: ae,
674
674
  detail: T,
675
675
  type: g == null ? void 0 : g.type,
676
676
  documentation: M || (g == null ? void 0 : g.documentation) || void 0,
677
- members: g ? nt(g.members, o, /* @__PURE__ */ new Set([g.label])) : void 0
677
+ members: g ? at(g.members, o, /* @__PURE__ */ new Set([g.label])) : void 0
678
678
  });
679
679
  continue;
680
680
  }
681
681
  u = [];
682
682
  }
683
- return { items: f, signatures: e };
683
+ return { items: d, signatures: e };
684
684
  }
685
- function ke(n, s, o, e) {
685
+ function we(n, s, o, e) {
686
686
  if (!o || !e) return null;
687
687
  const i = Math.max(0, s - 1), r = n.lastIndexOf(o, i);
688
688
  if (r === -1 || n.lastIndexOf(e, i) > r) return null;
@@ -692,28 +692,28 @@ function ke(n, s, o, e) {
692
692
  end: u === -1 ? n.length : u
693
693
  };
694
694
  }
695
- function wn(n, s, o, e) {
696
- return ke(n, s, o, e) !== null;
695
+ function Hn(n, s, o, e) {
696
+ return we(n, s, o, e) !== null;
697
697
  }
698
- const Ue = /[A-Za-z_$]/, Xt = /[\w$]/, Ye = /\s/;
699
- function ce(n, s) {
698
+ const Ge = /[A-Za-z_$]/, sn = /[\w$]/, Qe = /\s/;
699
+ function ue(n, s) {
700
700
  const o = [], e = n.length;
701
701
  let i = 0;
702
702
  for (; i < e; ) {
703
- const r = n[i], d = n[i + 1];
704
- if (Ye.test(r)) {
703
+ const r = n[i], f = n[i + 1];
704
+ if (Qe.test(r)) {
705
705
  i++;
706
706
  continue;
707
707
  }
708
- if (r === "/" && d === "/") {
708
+ if (r === "/" && f === "/") {
709
709
  let a = n.indexOf(`
710
710
  `, i);
711
711
  a === -1 && (a = e), o.push({ start: i, end: a, type: "comment" }), i = a;
712
712
  continue;
713
713
  }
714
- if (r === "/" && d === "*") {
715
- const a = n.indexOf("*/", i + 2), f = a === -1 ? e : a + 2;
716
- o.push({ start: i, end: f, type: "comment" }), i = f;
714
+ if (r === "/" && f === "*") {
715
+ const a = n.indexOf("*/", i + 2), d = a === -1 ? e : a + 2;
716
+ o.push({ start: i, end: d, type: "comment" }), i = d;
717
717
  continue;
718
718
  }
719
719
  if (r === '"' || r === "'") {
@@ -750,93 +750,93 @@ function ce(n, s) {
750
750
  o.push({ start: i, end: a, type: "template" }), i = a;
751
751
  continue;
752
752
  }
753
- if (/[0-9]/.test(r) || r === "." && /[0-9]/.test(d ?? "")) {
753
+ if (/[0-9]/.test(r) || r === "." && /[0-9]/.test(f ?? "")) {
754
754
  let a = i + 1;
755
755
  for (; a < e && /[\w.]/.test(n[a]); ) a++;
756
756
  o.push({ start: i, end: a, type: "number" }), i = a;
757
757
  continue;
758
758
  }
759
- if (Ue.test(r)) {
759
+ if (Ge.test(r)) {
760
760
  let a = i + 1;
761
- for (; a < e && Xt.test(n[a]); ) a++;
762
- const f = n.slice(i, a), $ = s.keywords.has(f) ? "keyword" : s.builtins.has(f) ? "builtin" : "identifier";
761
+ for (; a < e && sn.test(n[a]); ) a++;
762
+ const d = n.slice(i, a), $ = s.keywords.has(d) ? "keyword" : s.builtins.has(d) ? "builtin" : "identifier";
763
763
  o.push({ start: i, end: a, type: $ }), i = a;
764
764
  continue;
765
765
  }
766
766
  let u = i + 1;
767
767
  for (; u < e; ) {
768
768
  const a = n[u];
769
- if (Ye.test(a) || Ue.test(a) || /[0-9]/.test(a) || a === '"' || a === "'" || a === "`" || a === "/") break;
769
+ if (Qe.test(a) || Ge.test(a) || /[0-9]/.test(a) || a === '"' || a === "'" || a === "`" || a === "/") break;
770
770
  u++;
771
771
  }
772
772
  o.push({ start: i, end: u, type: "punctuation" }), i = u;
773
773
  }
774
774
  return o;
775
775
  }
776
- const Gt = {
776
+ const rn = {
777
777
  "&": "&amp;",
778
778
  "<": "&lt;",
779
779
  ">": "&gt;"
780
780
  };
781
- function X(n) {
782
- return n.replace(/[&<>]/g, (s) => Gt[s] ?? s);
781
+ function Q(n) {
782
+ return n.replace(/[&<>]/g, (s) => rn[s] ?? s);
783
783
  }
784
- function ue(n, s, o = 0) {
784
+ function de(n, s, o = 0) {
785
785
  let e = "", i = 0;
786
786
  for (const r of s) {
787
- r.start > i && (e += X(n.slice(i, r.start)));
788
- const d = X(n.slice(r.start, r.end));
789
- e += `<span class="tok-${r.type}" data-start="${r.start + o}" data-end="${r.end + o}">${d}</span>`, i = r.end;
787
+ r.start > i && (e += Q(n.slice(i, r.start)));
788
+ const f = Q(n.slice(r.start, r.end));
789
+ e += `<span class="tok-${r.type}" data-start="${r.start + o}" data-end="${r.end + o}">${f}</span>`, i = r.end;
790
790
  }
791
- return i < n.length && (e += X(n.slice(i))), e;
791
+ return i < n.length && (e += Q(n.slice(i))), e;
792
792
  }
793
- function Qt(n, s, o, e) {
794
- if (!o || !e) return ue(n, ce(n, s));
793
+ function cn(n, s, o, e) {
794
+ if (!o || !e) return de(n, ue(n, s));
795
795
  let i = "", r = 0;
796
796
  for (; r < n.length; ) {
797
- const d = n.indexOf(o, r);
798
- if (d === -1) {
799
- i += X(n.slice(r));
797
+ const f = n.indexOf(o, r);
798
+ if (f === -1) {
799
+ i += Q(n.slice(r));
800
800
  break;
801
801
  }
802
- i += X(n.slice(r, d));
803
- const u = n.indexOf(e, d + o.length), a = u === -1 ? n.length : u, f = n.slice(d + o.length, a);
804
- i += `<span class="tok-brace">${X(o)}</span>`, i += ue(f, ce(f, s), d + o.length), u === -1 ? r = a : (i += `<span class="tok-brace">${X(e)}</span>`, r = u + e.length);
802
+ i += Q(n.slice(r, f));
803
+ const u = n.indexOf(e, f + o.length), a = u === -1 ? n.length : u, d = n.slice(f + o.length, a);
804
+ i += `<span class="tok-brace">${Q(o)}</span>`, i += de(d, ue(d, s), f + o.length), u === -1 ? r = a : (i += `<span class="tok-brace">${Q(e)}</span>`, r = u + e.length);
805
805
  }
806
806
  return i;
807
807
  }
808
- const en = {
808
+ const un = {
809
809
  key: 0,
810
810
  class: "gutter",
811
811
  "aria-hidden": "true"
812
- }, tn = ["innerHTML"], nn = ["value", "readonly", "placeholder"], ln = ["onMouseenter", "onClick"], on = { class: "popup-label" }, an = {
812
+ }, dn = ["innerHTML"], fn = ["value", "readonly", "placeholder"], pn = ["onMouseenter", "onClick"], mn = { class: "popup-label" }, hn = {
813
813
  key: 0,
814
814
  class: "popup-detail"
815
- }, sn = { class: "hover-head" }, rn = { class: "hover-name" }, cn = {
815
+ }, gn = { class: "hover-head" }, bn = { class: "hover-name" }, vn = {
816
816
  key: 0,
817
817
  class: "hover-colon"
818
- }, un = {
818
+ }, yn = {
819
819
  key: 0,
820
820
  class: "hover-type"
821
- }, dn = {
821
+ }, kn = {
822
822
  key: 0,
823
823
  class: "hover-doc"
824
- }, fn = {
824
+ }, wn = {
825
825
  key: 1,
826
826
  class: "hover-def"
827
- }, pn = ["innerHTML"], mn = ["title", "aria-label"], hn = {
827
+ }, xn = ["innerHTML"], $n = ["title", "aria-label"], Tn = {
828
828
  key: 0,
829
829
  viewBox: "0 0 16 16",
830
830
  width: "14",
831
831
  height: "14",
832
832
  "aria-hidden": "true"
833
- }, gn = {
833
+ }, Cn = {
834
834
  key: 1,
835
835
  viewBox: "0 0 16 16",
836
836
  width: "14",
837
837
  height: "14",
838
838
  "aria-hidden": "true"
839
- }, bn = /* @__PURE__ */ St({
839
+ }, Sn = /* @__PURE__ */ Bt({
840
840
  __name: "CodeEditor",
841
841
  props: {
842
842
  modelValue: {},
@@ -871,7 +871,7 @@ const en = {
871
871
  class: "对象",
872
872
  keyword: "关键字",
873
873
  value: "值"
874
- }, d = {
874
+ }, f = {
875
875
  "(": ")",
876
876
  "[": "]",
877
877
  "{": "}",
@@ -886,77 +886,77 @@ const en = {
886
886
  "End",
887
887
  "PageUp",
888
888
  "PageDown"
889
- ]), a = E(e.modelValue), f = E(), $ = E(), z = E(), C = E(), b = E(), y = E(), O = E(), B = E([]), M = E(0), w = E(!1), T = E({ start: 0, end: 0 }), _ = E({}), g = E(null), ie = E({}), it = K(
890
- () => e.tsTypes ? Ut(e.tsTypes) : []
891
- ), ot = K(
892
- () => e.tsTypes ? Yt(e.tsTypes) : /* @__PURE__ */ new Map()
893
- ), we = K(() => [
894
- ...It,
895
- ...it.value,
889
+ ]), a = R(e.modelValue), d = R(), $ = R(), z = R(), S = R(), b = R(), v = R(), W = R(), O = R([]), M = R(0), w = R(!1), T = R({ start: 0, end: 0 }), L = R({}), g = R(null), ae = R({}), rt = q(
890
+ () => e.tsTypes ? ln(e.tsTypes) : []
891
+ ), ct = q(
892
+ () => e.tsTypes ? on(e.tsTypes) : /* @__PURE__ */ new Map()
893
+ ), xe = q(() => [
894
+ ...zt,
895
+ ...rt.value,
896
896
  ...e.completions
897
- ]), de = K(
898
- () => e.mode === "template" ? [...e.templateCompletions, ...we.value] : we.value
899
- ), at = K(() => {
897
+ ]), fe = q(
898
+ () => e.mode === "template" ? [...e.templateCompletions, ...xe.value] : xe.value
899
+ ), ut = q(() => {
900
900
  const t = {
901
- keywords: De(e.language),
902
- builtins: new Set(de.value.map((l) => l.label))
901
+ keywords: Ve(e.language),
902
+ builtins: new Set(fe.value.map((l) => l.label))
903
903
  };
904
- return e.mode === "template" ? `${Qt(a.value, t, e.templateOpen, e.templateClose)}
905
- ` : `${ue(a.value, ce(a.value, t))}
904
+ return e.mode === "template" ? `${cn(a.value, t, e.templateOpen, e.templateClose)}
905
+ ` : `${de(a.value, ue(a.value, t))}
906
906
  `;
907
- }), st = K(() => a.value.split(`
908
- `).length), F = E(e.defaultExpanded), fe = E(!1), pe = K(() => e.collapsible && !F.value), rt = K(() => {
907
+ }), dt = q(() => a.value.split(`
908
+ `).length), F = R(e.defaultExpanded), pe = R(!1), me = q(() => e.collapsible && !F.value), ft = q(() => {
909
909
  const t = {};
910
910
  return e.collapsible && (t.height = e.collapsedHeight), t;
911
- }), ct = K(() => {
911
+ }), pt = q(() => {
912
912
  const t = {
913
913
  "--ce-radius": e.borderRadius,
914
914
  "--ce-collapsed-height": e.collapsedHeight
915
915
  };
916
916
  return e.background && (t["--ce-bg"] = e.background), e.borderColor && (t["--ce-border"] = e.borderColor), e.collapsible ? { ...t, height: F.value ? e.minHeight : e.collapsedHeight } : { ...t, height: e.minHeight };
917
917
  });
918
- let xe = 0;
919
- function $e(t) {
918
+ let $e = 0;
919
+ function Te(t) {
920
920
  if (F.value === t) return;
921
- const l = f.value;
922
- t && l && (xe = l.scrollTop), F.value = t, e.collapsible && (fe.value = !0), i(t ? "expand" : "collapse"), H(), j(), V(() => {
923
- if (me(), !F.value && l) {
921
+ const l = d.value;
922
+ t && l && ($e = l.scrollTop), F.value = t, e.collapsible && (pe.value = !0), i(t ? "expand" : "collapse"), _(), j(), P(() => {
923
+ if (he(), !F.value && l) {
924
924
  const c = Math.max(0, l.scrollHeight - l.clientHeight);
925
- l.scrollTop = Math.max(0, Math.min(xe, c)), P(!0), document.activeElement === l && G();
925
+ l.scrollTop = Math.max(0, Math.min($e, c)), D(!0), document.activeElement === l && X();
926
926
  return;
927
927
  }
928
- P(!0), t && e.collapseOnBlur && l && document.activeElement !== l && l.focus();
928
+ D(!0), t && e.collapseOnBlur && l && document.activeElement !== l && l.focus();
929
929
  });
930
930
  }
931
- function ut() {
932
- fe.value = !1;
931
+ function mt() {
932
+ pe.value = !1;
933
933
  }
934
- function dt() {
935
- $e(!F.value);
934
+ function ht() {
935
+ Te(!F.value);
936
936
  }
937
- Be(
937
+ ze(
938
938
  () => e.modelValue,
939
939
  (t) => {
940
- t !== a.value && (a.value = t, H());
940
+ t !== a.value && (a.value = t, _());
941
941
  }
942
- ), Be(a, () => {
943
- V(() => P(!0));
942
+ ), ze(a, () => {
943
+ P(() => D(!0));
944
944
  });
945
- function Te(t) {
945
+ function Ce(t) {
946
946
  return r[t];
947
947
  }
948
- function ft(t) {
949
- return t ? ue(
948
+ function gt(t) {
949
+ return t ? de(
950
950
  t,
951
- ce(t, { keywords: De("typescript"), builtins: /* @__PURE__ */ new Set() })
951
+ ue(t, { keywords: Ve("typescript"), builtins: /* @__PURE__ */ new Set() })
952
952
  ) : "";
953
953
  }
954
- let D = { top: 14, bottom: 14, left: 16, right: 16, lineHeight: 22 };
955
- function me() {
956
- const t = f.value;
954
+ let ee = { top: 14, bottom: 14, left: 16, right: 16, lineHeight: 22 };
955
+ function he() {
956
+ const t = d.value;
957
957
  if (!t) return;
958
958
  const l = window.getComputedStyle(t);
959
- D = {
959
+ ee = {
960
960
  top: parseFloat(l.paddingTop) || 0,
961
961
  bottom: parseFloat(l.paddingBottom) || 0,
962
962
  left: parseFloat(l.paddingLeft) || 0,
@@ -964,66 +964,67 @@ const en = {
964
964
  lineHeight: parseFloat(l.lineHeight) || 22
965
965
  };
966
966
  }
967
- function P(t = !1) {
968
- const l = f.value;
967
+ function D(t = !1) {
968
+ const l = d.value;
969
969
  if (!l) return;
970
- const c = C.value;
970
+ const c = S.value;
971
971
  if (c && (c.style.transform = `translate(${-l.scrollLeft}px, ${-l.scrollTop}px)`), b.value && (b.value.style.transform = `translateY(${-l.scrollTop}px)`), t) {
972
- const m = `${a.value}|${e.mode}|${l.clientWidth}|${l.clientHeight}`;
973
- m !== Se && (Se = m, pt());
972
+ const p = `${a.value}|${e.mode}|${l.clientWidth}|${l.clientHeight}`;
973
+ p !== Ee && (Ee = p, bt());
974
974
  }
975
975
  }
976
- function G() {
977
- const t = f.value;
976
+ function X() {
977
+ const t = d.value;
978
978
  if (!t) return;
979
- const l = Ee();
979
+ const l = Re();
980
980
  if (!l) return;
981
- let c = t.scrollTop;
982
- if (pe.value) {
983
- const q = t.clientHeight - D.top - D.bottom, W = l.top + t.scrollTop - D.top - Math.max(0, (q - l.lineHeight) / 2), se = Math.max(0, t.scrollHeight - t.clientHeight);
984
- c = Math.max(0, Math.min(W, se));
981
+ const c = t.getBoundingClientRect(), p = t.offsetWidth ? c.width / t.offsetWidth : 1, h = t.offsetHeight ? c.height / t.offsetHeight : 1;
982
+ let m = t.scrollTop;
983
+ if (me.value) {
984
+ const Ne = t.clientHeight * h, We = ee.top * h, It = ee.bottom * h, Ht = l.lineHeight * h, Lt = Ne - We - It, _t = l.top + t.scrollTop * h - We - Math.max(0, (Lt - Ht) / 2), At = Math.max(0, t.scrollHeight * h - Ne);
985
+ m = Math.max(0, Math.min(_t, At)) / h;
985
986
  }
986
- const m = t.clientWidth - D.left - D.right, h = l.left + t.scrollLeft, p = t.scrollLeft + D.left, x = t.scrollLeft + D.left + m, k = 8;
987
- let v = t.scrollLeft;
988
- h < p + k ? v = Math.max(0, h - D.left - k) : h > x - k && (v = Math.max(0, h - D.left - m + k));
989
- const S = Math.abs(c - t.scrollTop) > 0.5, R = Math.abs(v - t.scrollLeft) > 0.5;
990
- !S && !R || (S && (t.scrollTop = c), R && (t.scrollLeft = v), P());
991
- }
992
- let Ce = [], Se = "", oe = 0, he = -1, ge = -1, be = { x: 0, y: 0 };
993
- function pt() {
994
- const t = f.value, l = z.value;
987
+ const x = t.clientWidth * p, k = ee.left * p, y = ee.right * p, C = t.scrollLeft * p, E = l.left + C, V = C + k, N = C + x - y, A = 8 * p;
988
+ let J = t.scrollLeft;
989
+ E < V + A ? J = Math.max(0, (E - k - A) / p) : E > N - A && (J = Math.max(0, (E - k - x + y + A) / p));
990
+ const U = Math.abs(m - t.scrollTop) > 0.5, Oe = Math.abs(J - t.scrollLeft) > 0.5;
991
+ !U && !Oe || (U && (t.scrollTop = m), Oe && (t.scrollLeft = J), D());
992
+ }
993
+ let Se = [], Ee = "", se = 0, ge = -1, be = -1, ve = { x: 0, y: 0 };
994
+ function bt() {
995
+ const t = d.value, l = z.value;
995
996
  if (!t || !l) return;
996
- const c = t.getBoundingClientRect(), m = [];
997
+ const c = t.getBoundingClientRect(), p = [];
997
998
  l.querySelectorAll("[data-start]").forEach((h) => {
998
- const p = h.getBoundingClientRect();
999
- m.push({
999
+ const m = h.getBoundingClientRect();
1000
+ p.push({
1000
1001
  start: Number(h.dataset.start),
1001
1002
  end: Number(h.dataset.end),
1002
- left: p.left - c.left + t.scrollLeft,
1003
- right: p.right - c.left + t.scrollLeft,
1004
- top: p.top - c.top + t.scrollTop,
1005
- bottom: p.bottom - c.top + t.scrollTop
1003
+ left: m.left - c.left + t.scrollLeft,
1004
+ right: m.right - c.left + t.scrollLeft,
1005
+ top: m.top - c.top + t.scrollTop,
1006
+ bottom: m.bottom - c.top + t.scrollTop
1006
1007
  });
1007
- }), Ce = m;
1008
+ }), Se = p;
1008
1009
  }
1009
- function mt(t, l) {
1010
- for (const c of Ce)
1010
+ function vt(t, l) {
1011
+ for (const c of Se)
1011
1012
  if (t >= c.left - 1 && t <= c.right + 1 && l >= c.top && l <= c.bottom)
1012
1013
  return c;
1013
1014
  return null;
1014
1015
  }
1015
1016
  function j() {
1016
- g.value = null, oe = 0, he = -1, ge = -1;
1017
+ g.value = null, se = 0, ge = -1, be = -1;
1017
1018
  }
1018
- function ht(t) {
1019
- const l = O.value, c = f.value;
1019
+ function yt(t) {
1020
+ const l = W.value, c = d.value;
1020
1021
  if (!l || !c) return;
1021
- const m = c.getBoundingClientRect(), h = m.left + t.left - c.scrollLeft, p = m.left + t.right - c.scrollLeft, x = m.top + t.top - c.scrollTop, k = m.top + t.bottom - c.scrollTop, v = 12, S = 8, R = l.offsetWidth, q = l.offsetHeight;
1022
- let N = h, W = k + S;
1023
- N + R > window.innerWidth - v && (N = p - R), W + q > window.innerHeight - v && (W = x - q - S), N = Math.max(v, Math.min(N, window.innerWidth - v - R)), W = Math.max(v, W), ie.value = { left: `${N}px`, top: `${W}px` };
1022
+ const p = c.getBoundingClientRect(), h = p.left + t.left - c.scrollLeft, m = p.left + t.right - c.scrollLeft, x = p.top + t.top - c.scrollTop, k = p.top + t.bottom - c.scrollTop, y = 12, C = 8, E = l.offsetWidth, V = l.offsetHeight;
1023
+ let N = h, A = k + C;
1024
+ N + E > window.innerWidth - y && (N = m - E), A + V > window.innerHeight - y && (A = x - V - C), N = Math.max(y, Math.min(N, window.innerWidth - y - E)), A = Math.max(y, A), ae.value = { left: `${N}px`, top: `${A}px` };
1024
1025
  }
1025
- function gt(t, l) {
1026
- const c = f.value;
1026
+ function kt(t, l) {
1027
+ const c = d.value;
1027
1028
  if (!c || e.readonly || !e.hover || w.value) {
1028
1029
  j();
1029
1030
  return;
@@ -1032,42 +1033,42 @@ const en = {
1032
1033
  j();
1033
1034
  return;
1034
1035
  }
1035
- const m = O.value;
1036
- if (g.value && m) {
1037
- const k = m.getBoundingClientRect();
1036
+ const p = W.value;
1037
+ if (g.value && p) {
1038
+ const k = p.getBoundingClientRect();
1038
1039
  if (t >= k.left && t <= k.right && l >= k.top && l <= k.bottom)
1039
1040
  return;
1040
1041
  }
1041
- const h = c.getBoundingClientRect(), p = mt(t - h.left + c.scrollLeft, l - h.top + c.scrollTop);
1042
- if (!p) {
1042
+ const h = c.getBoundingClientRect(), m = vt(t - h.left + c.scrollLeft, l - h.top + c.scrollTop);
1043
+ if (!m) {
1043
1044
  j();
1044
1045
  return;
1045
1046
  }
1046
- if (g.value && he === p.start && ge === p.end)
1047
+ if (g.value && ge === m.start && be === m.end)
1047
1048
  return;
1048
- const x = Dt(c.value, p.start, p.end, {
1049
- completions: de.value,
1050
- declared: Fe(c.value, p.start)
1049
+ const x = Yt(c.value, m.start, m.end, {
1050
+ completions: fe.value,
1051
+ declared: Ke(c.value, m.start)
1051
1052
  });
1052
1053
  if (!x) {
1053
1054
  j();
1054
1055
  return;
1055
1056
  }
1056
- g.value = x, he = p.start, ge = p.end, V(() => ht(p));
1057
+ g.value = x, ge = m.start, be = m.end, P(() => yt(m));
1057
1058
  }
1058
- function bt(t) {
1059
- be = { x: t.clientX, y: t.clientY }, !oe && (oe = requestAnimationFrame(() => {
1060
- oe = 0, gt(be.x, be.y);
1059
+ function wt(t) {
1060
+ ve = { x: t.clientX, y: t.clientY }, !se && (se = requestAnimationFrame(() => {
1061
+ se = 0, kt(ve.x, ve.y);
1061
1062
  }));
1062
1063
  }
1063
- function Ee() {
1064
- const t = f.value;
1064
+ function Re() {
1065
+ const t = d.value;
1065
1066
  if (!t) return null;
1066
- const l = window.getComputedStyle(t), c = document.createElement("div"), m = parseFloat(l.paddingLeft) || 0, h = parseFloat(l.paddingRight) || 0, p = t.getBoundingClientRect();
1067
+ const l = window.getComputedStyle(t), c = document.createElement("div"), p = parseFloat(l.paddingLeft) || 0, h = parseFloat(l.paddingRight) || 0, m = t.getBoundingClientRect();
1067
1068
  Object.assign(c.style, {
1068
1069
  position: "fixed",
1069
- left: `${p.left}px`,
1070
- top: `${p.top}px`,
1070
+ left: `${m.left}px`,
1071
+ top: `${m.top}px`,
1071
1072
  visibility: "hidden",
1072
1073
  pointerEvents: "none",
1073
1074
  zIndex: "-1",
@@ -1075,7 +1076,7 @@ const en = {
1075
1076
  overflowWrap: l.overflowWrap,
1076
1077
  wordBreak: l.wordBreak,
1077
1078
  boxSizing: "content-box",
1078
- width: `${t.clientWidth - m - h}px`,
1079
+ width: `${t.clientWidth - p - h}px`,
1079
1080
  paddingTop: l.paddingTop,
1080
1081
  paddingRight: l.paddingRight,
1081
1082
  paddingBottom: l.paddingBottom,
@@ -1095,295 +1096,298 @@ const en = {
1095
1096
  x.textContent = "​", c.appendChild(x), document.body.appendChild(c);
1096
1097
  const k = x.getBoundingClientRect();
1097
1098
  document.body.removeChild(c);
1098
- const v = parseFloat(l.lineHeight) || 22, S = k.height, R = S > 0 && S < v ? (v - S) / 2 : 0;
1099
+ const y = parseFloat(l.lineHeight) || 22, C = k.height, E = C > 0 && C < y ? (y - C) / 2 : 0;
1099
1100
  return {
1100
- left: k.left - p.left - t.scrollLeft,
1101
- top: k.top - p.top - t.scrollTop - R,
1102
- lineHeight: v
1101
+ left: k.left - m.left - t.scrollLeft,
1102
+ top: k.top - m.top - t.scrollTop - E,
1103
+ lineHeight: y
1103
1104
  };
1104
1105
  }
1105
1106
  async function Me() {
1106
- await V();
1107
- const t = $.value, l = y.value, c = Ee();
1107
+ await P();
1108
+ const t = $.value, l = v.value, c = Re();
1108
1109
  if (!t || !l || !c) return;
1109
- const m = 4, h = 8, p = window.innerWidth, x = window.innerHeight, k = t.getBoundingClientRect(), v = l.scrollHeight, S = x - (k.top + c.top + c.lineHeight) - m - h, R = k.top + c.top - m - h, q = S >= Math.min(v, 180) || S >= R, N = Math.min(248, Math.max(q ? S : R, 96)), W = Math.min(v, N), se = l.offsetWidth || 280;
1110
- let ee = c.left;
1111
- k.left + ee + se > p - h && (ee = p - h - se - k.left), ee = Math.max(ee, h - k.left), _.value = {
1112
- left: `${ee}px`,
1113
- top: `${q ? c.top + c.lineHeight + m : c.top - m - W}px`,
1110
+ const p = 4, h = 8, m = window.innerWidth, x = window.innerHeight, k = t.getBoundingClientRect(), y = l.scrollHeight, C = x - (k.top + c.top + c.lineHeight) - p - h, E = k.top + c.top - p - h, V = C >= Math.min(y, 180) || C >= E, N = Math.min(248, Math.max(V ? C : E, 96)), A = Math.min(y, N), J = l.offsetWidth || 280;
1111
+ let U = c.left;
1112
+ k.left + U + J > m - h && (U = m - h - J - k.left), U = Math.max(U, h - k.left), L.value = {
1113
+ left: `${U}px`,
1114
+ top: `${V ? c.top + c.lineHeight + p : c.top - p - A}px`,
1114
1115
  maxHeight: `${N}px`
1115
1116
  };
1116
1117
  }
1117
- function H() {
1118
- w.value = !1, B.value = [], M.value = 0, j();
1118
+ function _() {
1119
+ w.value = !1, O.value = [], M.value = 0, j();
1119
1120
  }
1120
- function Q(t = !1) {
1121
+ function ne(t = !1) {
1121
1122
  var k;
1122
- const l = f.value;
1123
+ const l = d.value;
1123
1124
  if (!l || e.readonly) return;
1124
1125
  if (l.selectionStart !== l.selectionEnd) {
1125
- H();
1126
+ _();
1126
1127
  return;
1127
1128
  }
1128
1129
  const c = l.selectionStart;
1129
- let m = !t;
1130
- const h = _t(l.value, c);
1130
+ let p = !t;
1131
+ const h = jt(l.value, c);
1131
1132
  if (h) {
1132
- const v = (k = ot.value.get(h.functionName)) == null ? void 0 : k.params[h.paramIndex], S = (v == null ? void 0 : v.literals) ?? [];
1133
- if (S.length) {
1134
- const R = h.quote ?? "'", q = S.map((W) => ({
1135
- label: `${R}${W}${R}`,
1133
+ const y = (k = ct.value.get(h.functionName)) == null ? void 0 : k.params[h.paramIndex], C = (y == null ? void 0 : y.literals) ?? [];
1134
+ if (C.length) {
1135
+ const E = h.quote ?? "'", V = C.map((A) => ({
1136
+ label: `${E}${A}${E}`,
1136
1137
  kind: "value",
1137
- detail: v == null ? void 0 : v.type,
1138
- insertText: `${R}${W}${R}`
1139
- })), N = Qe(q, h.prefix);
1138
+ detail: y == null ? void 0 : y.type,
1139
+ insertText: `${E}${A}${E}`
1140
+ })), N = lt(V, h.prefix);
1140
1141
  if (N.length) {
1141
- B.value = N, T.value = { start: h.replaceStart, end: c }, M.value = 0, w.value = !0, Me();
1142
+ O.value = N, T.value = { start: h.replaceStart, end: c }, M.value = 0, w.value = !0, Me();
1142
1143
  return;
1143
1144
  }
1144
1145
  }
1145
1146
  }
1146
1147
  if (e.mode === "template") {
1147
- const v = ke(
1148
+ const y = we(
1148
1149
  l.value,
1149
1150
  c,
1150
1151
  e.templateOpen,
1151
1152
  e.templateClose
1152
1153
  );
1153
- if (!v) {
1154
- H();
1154
+ if (!y) {
1155
+ _();
1155
1156
  return;
1156
1157
  }
1157
- t && l.value.slice(v.start, c).trim() === "" && (m = !0);
1158
+ t && l.value.slice(y.start, c).trim() === "" && (p = !0);
1158
1159
  }
1159
- const p = Wt(l.value, c, {
1160
+ const m = Zt(l.value, c, {
1160
1161
  language: e.language,
1161
- completions: de.value,
1162
- declared: Fe(l.value, c),
1163
- auto: !m
1162
+ completions: fe.value,
1163
+ declared: Ke(l.value, c),
1164
+ auto: !p
1164
1165
  });
1165
- if (!p) {
1166
- H();
1166
+ if (!m) {
1167
+ _();
1167
1168
  return;
1168
1169
  }
1169
- let x = p.items;
1170
+ let x = m.items;
1170
1171
  if (e.completionFilter) {
1171
- const v = Xe(l.value, c);
1172
+ const y = tt(l.value, c);
1172
1173
  if (x = e.completionFilter(x, {
1173
- prefix: v.prefix,
1174
- chain: v.chain,
1174
+ prefix: y.prefix,
1175
+ chain: y.chain,
1175
1176
  text: l.value,
1176
1177
  position: c,
1177
1178
  mode: e.mode,
1178
1179
  language: e.language
1179
1180
  }), x.length === 0) {
1180
- H();
1181
+ _();
1181
1182
  return;
1182
1183
  }
1183
1184
  }
1184
- B.value = x, T.value = { start: p.start, end: p.end }, M.value = 0, w.value = !0, Me();
1185
+ O.value = x, T.value = { start: m.start, end: m.end }, M.value = 0, w.value = !0, Me();
1185
1186
  }
1186
- function vt(t) {
1187
+ function xt(t) {
1187
1188
  a.value = t, i("update:modelValue", t), i("change", t);
1188
1189
  }
1189
- function ae(t, l, c, m = t + c.length) {
1190
- const h = f.value;
1190
+ function re(t, l, c, p = t + c.length) {
1191
+ const h = d.value;
1191
1192
  if (!h) return;
1192
- const p = h.value.slice(0, t) + c + h.value.slice(l);
1193
- vt(p), H(), V(() => {
1194
- h.value = p, h.setSelectionRange(m, m), h.focus(), P(!0), G();
1193
+ const m = h.value.slice(0, t) + c + h.value.slice(l);
1194
+ xt(m), _(), P(() => {
1195
+ h.value = m, h.setSelectionRange(p, p), h.focus(), D(!0), X();
1195
1196
  });
1196
1197
  }
1197
- function Re(t = B.value[M.value]) {
1198
+ function Ie(t = O.value[M.value]) {
1198
1199
  if (!t) return;
1199
1200
  const l = t.insertText ?? t.label;
1200
- ae(T.value.start, T.value.end, l), H();
1201
+ re(T.value.start, T.value.end, l), _();
1201
1202
  }
1202
- function Ie(t) {
1203
- const l = B.value.length;
1204
- l && (M.value = (M.value + t + l) % l, V(() => {
1205
- var c, m;
1206
- (m = (c = y.value) == null ? void 0 : c.querySelector(".is-active")) == null || m.scrollIntoView({ block: "nearest" });
1203
+ function He(t) {
1204
+ const l = O.value.length;
1205
+ l && (M.value = (M.value + t + l) % l, P(() => {
1206
+ var c, p;
1207
+ (p = (c = v.value) == null ? void 0 : c.querySelector(".is-active")) == null || p.scrollIntoView({ block: "nearest" });
1207
1208
  }));
1208
1209
  }
1209
- function yt(t) {
1210
+ function $t(t) {
1210
1211
  const l = t.target;
1211
- a.value = l.value, i("update:modelValue", l.value), i("change", l.value), j(), P(), V(G), Q(!0);
1212
+ a.value = l.value, i("update:modelValue", l.value), i("change", l.value), j(), D(), X(), P(X), ne(!0);
1212
1213
  }
1213
- function kt(t) {
1214
- if (H(), j(), !e.collapsible || !e.collapseOnBlur || !F.value) return;
1214
+ function Tt(t) {
1215
+ if (_(), j(), !e.collapsible || !e.collapseOnBlur || !F.value) return;
1215
1216
  const l = t.relatedTarget;
1216
- l && l.closest(".expand-toggle") || $e(!1);
1217
+ l && l.closest(".expand-toggle") || Te(!1);
1217
1218
  }
1218
- function wt() {
1219
- Le(), G();
1219
+ function Ct() {
1220
+ Le(), X();
1220
1221
  }
1221
1222
  function Le() {
1222
- const t = f.value;
1223
+ const t = d.value;
1223
1224
  if (!t || e.readonly) return;
1224
1225
  if (t.selectionStart !== t.selectionEnd) {
1225
- H();
1226
+ _();
1226
1227
  return;
1227
1228
  }
1228
1229
  const l = t.selectionStart;
1229
1230
  if (l > 0 && t.value[l - 1] === ".") {
1230
- Q(!0);
1231
+ ne(!0);
1231
1232
  return;
1232
1233
  }
1233
1234
  if (e.mode === "template") {
1234
- const c = ke(
1235
+ const c = we(
1235
1236
  t.value,
1236
1237
  l,
1237
1238
  e.templateOpen,
1238
1239
  e.templateClose
1239
1240
  );
1240
1241
  if (c && t.value.slice(c.start, l).trim() === "") {
1241
- Q(!0);
1242
+ ne(!0);
1242
1243
  return;
1243
1244
  }
1244
1245
  }
1245
- H();
1246
+ _();
1246
1247
  }
1247
- let ve = 0;
1248
+ let ye = 0;
1248
1249
  function _e() {
1249
- window.clearTimeout(ve), ve = window.setTimeout(() => {
1250
- ve = 0, Le(), G();
1250
+ window.clearTimeout(ye), ye = window.setTimeout(() => {
1251
+ ye = 0, Le(), X();
1251
1252
  }, 0);
1252
1253
  }
1253
- function He(t) {
1254
- t.target !== f.value && w.value && H();
1254
+ function Ae(t) {
1255
+ t.target !== d.value && w.value && _();
1255
1256
  }
1256
- function xt() {
1257
- j(), P(), pe.value && $t();
1257
+ function St() {
1258
+ j(), D(), me.value && Et();
1258
1259
  }
1259
- let ye = 0;
1260
- function $t() {
1261
- window.clearTimeout(ye), ye = window.setTimeout(() => {
1262
- ye = 0, Tt();
1260
+ let ke = 0;
1261
+ function Et() {
1262
+ window.clearTimeout(ke), ke = window.setTimeout(() => {
1263
+ ke = 0, Rt();
1263
1264
  }, 120);
1264
1265
  }
1265
- function Tt() {
1266
- const t = f.value;
1266
+ function Rt() {
1267
+ const t = d.value;
1267
1268
  if (!t) return;
1268
- const l = D.lineHeight, c = t.scrollTop, m = Math.round(c / l) * l;
1269
- Math.abs(m - c) < 0.5 || (t.scrollTop = m, P());
1269
+ const l = ee.lineHeight, c = t.scrollTop, p = Math.round(c / l) * l;
1270
+ Math.abs(p - c) < 0.5 || (t.scrollTop = p, D());
1270
1271
  }
1271
- function Ct(t) {
1272
+ function Mt(t) {
1272
1273
  var h;
1273
- const l = f.value;
1274
+ const l = d.value;
1274
1275
  if (!l) return;
1275
- const c = t.metaKey || t.ctrlKey, m = u.has(t.key);
1276
+ const c = t.metaKey || t.ctrlKey, p = u.has(t.key);
1276
1277
  if (t.key === " " && c) {
1277
- t.preventDefault(), Q(!1);
1278
+ t.preventDefault(), ne(!1);
1278
1279
  return;
1279
1280
  }
1280
1281
  if (w.value) {
1281
1282
  if (t.key === "ArrowDown") {
1282
- t.preventDefault(), Ie(1);
1283
+ t.preventDefault(), He(1);
1283
1284
  return;
1284
1285
  }
1285
1286
  if (t.key === "ArrowUp") {
1286
- t.preventDefault(), Ie(-1);
1287
+ t.preventDefault(), He(-1);
1287
1288
  return;
1288
1289
  }
1289
1290
  if (t.key === "Enter" || t.key === "Tab") {
1290
- t.preventDefault(), Re();
1291
+ t.preventDefault(), Ie();
1291
1292
  return;
1292
1293
  }
1293
1294
  if (t.key === "Escape") {
1294
- t.preventDefault(), H();
1295
+ t.preventDefault(), _();
1295
1296
  return;
1296
1297
  }
1297
- if (m || c) {
1298
- H(), m && !c && _e();
1298
+ if (p || c) {
1299
+ _(), p && !c && _e();
1299
1300
  return;
1300
1301
  }
1301
1302
  }
1302
- if (m && !c) {
1303
+ if (p && !c) {
1303
1304
  _e();
1304
1305
  return;
1305
1306
  }
1306
1307
  if (t.key === "Enter" && !c && !t.shiftKey) {
1307
- const p = l.selectionStart;
1308
- if (p !== l.selectionEnd) return;
1308
+ const m = l.selectionStart;
1309
+ if (m !== l.selectionEnd) return;
1309
1310
  const x = l.value.lastIndexOf(`
1310
- `, p - 1) + 1, k = l.value.slice(x, p), v = ((h = k.match(/^[ \t]*/)) == null ? void 0 : h[0]) ?? "", S = /[{[(]$/.test(k.trimEnd()) ? " " : "";
1311
- t.preventDefault(), ae(p, p, `
1312
- ${v}${S}`);
1311
+ `, m - 1) + 1, k = l.value.slice(x, m), y = ((h = k.match(/^[ \t]*/)) == null ? void 0 : h[0]) ?? "", C = /[{[(]$/.test(k.trimEnd()) ? " " : "";
1312
+ t.preventDefault(), re(m, m, `
1313
+ ${y}${C}`);
1313
1314
  return;
1314
1315
  }
1315
1316
  if (t.key === "Tab") {
1316
- t.preventDefault(), ae(l.selectionStart, l.selectionEnd, " ");
1317
+ t.preventDefault(), re(l.selectionStart, l.selectionEnd, " ");
1317
1318
  return;
1318
1319
  }
1319
- if (t.key.length === 1 && !c && !t.altKey && d[t.key]) {
1320
+ if (t.key.length === 1 && !c && !t.altKey && f[t.key]) {
1320
1321
  if (l.selectionStart !== l.selectionEnd) return;
1321
- const p = l.selectionStart, x = l.value[p - 1], k = l.value[p];
1322
+ const m = l.selectionStart, x = l.value[m - 1], k = l.value[m];
1322
1323
  if ((t.key === '"' || t.key === "'") && x && /[\w$]/.test(x) || k !== void 0 && !/[\s)\]},;:]/.test(k)) return;
1323
- t.preventDefault(), ae(p, p, t.key + d[t.key], p + 1), e.mode === "template" && V(() => Q(!0));
1324
+ t.preventDefault(), re(m, m, t.key + f[t.key], m + 1), e.mode === "template" && P(() => ne(!0));
1324
1325
  }
1325
1326
  }
1326
- function Ae() {
1327
- w.value && H(), j(), V(() => {
1328
- me(), P(!0);
1327
+ function Be() {
1328
+ w.value && _(), j(), P(() => {
1329
+ he(), D(!0);
1329
1330
  });
1330
1331
  }
1331
- return Et(() => {
1332
- window.addEventListener("resize", Ae), window.addEventListener("scroll", He, !0), V(() => {
1333
- me(), P(!0);
1334
- });
1335
- }), Mt(() => {
1336
- window.removeEventListener("resize", Ae), window.removeEventListener("scroll", He, !0);
1332
+ let te = null;
1333
+ return Ot(() => {
1334
+ window.addEventListener("resize", Be), window.addEventListener("scroll", Ae, !0), P(() => {
1335
+ he(), D(!0);
1336
+ }), typeof ResizeObserver < "u" && d.value && (te = new ResizeObserver(() => {
1337
+ D(!0), X();
1338
+ }), te.observe(d.value));
1339
+ }), Nt(() => {
1340
+ window.removeEventListener("resize", Be), window.removeEventListener("scroll", Ae, !0), te == null || te.disconnect(), te = null;
1337
1341
  }), s({ focus: () => {
1338
1342
  var t;
1339
- return (t = f.value) == null ? void 0 : t.focus();
1340
- } }), (t, l) => (I(), L("div", {
1341
- class: te(["code-input", { "is-collapsible": n.collapsible }]),
1342
- style: re(rt.value)
1343
+ return (t = d.value) == null ? void 0 : t.focus();
1344
+ } }), (t, l) => (I(), H("div", {
1345
+ class: le(["code-input", { "is-collapsible": n.collapsible }]),
1346
+ style: ce(ft.value)
1343
1347
  }, [
1344
- A("div", {
1345
- class: te(["code-editor", {
1348
+ B("div", {
1349
+ class: le(["code-editor", {
1346
1350
  "is-readonly": n.readonly,
1347
1351
  "is-dark": n.theme === "dark",
1348
- "is-collapsed": pe.value,
1349
- "is-expanding": fe.value
1352
+ "is-collapsed": me.value,
1353
+ "is-expanding": pe.value
1350
1354
  }]),
1351
- style: re(ct.value),
1352
- onAnimationend: Oe(ut, ["self"])
1355
+ style: ce(pt.value),
1356
+ onAnimationend: De(mt, ["self"])
1353
1357
  }, [
1354
- n.lineNumbers ? (I(), L("div", en, [
1355
- A("div", {
1358
+ n.lineNumbers ? (I(), H("div", un, [
1359
+ B("div", {
1356
1360
  ref_key: "gutterInner",
1357
1361
  ref: b,
1358
1362
  class: "gutter-inner code-font"
1359
1363
  }, [
1360
- (I(!0), L(Ne, null, We(st.value, (c) => (I(), L("div", {
1364
+ (I(!0), H(je, null, Fe(dt.value, (c) => (I(), H("div", {
1361
1365
  key: c,
1362
1366
  class: "gutter-line"
1363
1367
  }, Y(c), 1))), 128))
1364
1368
  ], 512)
1365
- ])) : Z("", !0),
1366
- A("div", {
1369
+ ])) : K("", !0),
1370
+ B("div", {
1367
1371
  ref_key: "stage",
1368
1372
  ref: $,
1369
1373
  class: "stage"
1370
1374
  }, [
1371
- A("div", {
1375
+ B("div", {
1372
1376
  ref_key: "highlightLayer",
1373
1377
  ref: z,
1374
1378
  class: "highlight code-font"
1375
1379
  }, [
1376
- A("pre", {
1380
+ B("pre", {
1377
1381
  ref_key: "highlightInner",
1378
- ref: C,
1382
+ ref: S,
1379
1383
  class: "code-font"
1380
1384
  }, [
1381
- A("code", { innerHTML: at.value }, null, 8, tn)
1385
+ B("code", { innerHTML: ut.value }, null, 8, dn)
1382
1386
  ], 512)
1383
1387
  ], 512),
1384
- A("textarea", {
1388
+ B("textarea", {
1385
1389
  ref_key: "textarea",
1386
- ref: f,
1390
+ ref: d,
1387
1391
  class: "code-font input",
1388
1392
  value: a.value,
1389
1393
  readonly: n.readonly,
@@ -1393,71 +1397,71 @@ ${v}${S}`);
1393
1397
  autocapitalize: "off",
1394
1398
  autocorrect: "off",
1395
1399
  wrap: "off",
1396
- onInput: yt,
1397
- onKeydown: Ct,
1398
- onScroll: xt,
1399
- onClick: wt,
1400
- onMousemove: bt,
1400
+ onInput: $t,
1401
+ onKeydown: Mt,
1402
+ onScroll: St,
1403
+ onClick: Ct,
1404
+ onMousemove: wt,
1401
1405
  onMouseleave: j,
1402
- onBlur: kt
1403
- }, null, 40, nn),
1404
- w.value ? (I(), L("ul", {
1406
+ onBlur: Tt
1407
+ }, null, 40, fn),
1408
+ w.value ? (I(), H("ul", {
1405
1409
  key: 0,
1406
1410
  ref_key: "popup",
1407
- ref: y,
1411
+ ref: v,
1408
1412
  class: "popup",
1409
- style: re(_.value),
1410
- onMousedown: l[0] || (l[0] = Oe(() => {
1413
+ style: ce(L.value),
1414
+ onMousedown: l[0] || (l[0] = De(() => {
1411
1415
  }, ["prevent"]))
1412
1416
  }, [
1413
- (I(!0), L(Ne, null, We(B.value, (c, m) => (I(), L("li", {
1414
- key: `${c.label}-${m}`,
1415
- class: te(["popup-item", { "is-active": m === M.value }]),
1416
- onMouseenter: (h) => M.value = m,
1417
- onClick: (h) => Re(c)
1417
+ (I(!0), H(je, null, Fe(O.value, (c, p) => (I(), H("li", {
1418
+ key: `${c.label}-${p}`,
1419
+ class: le(["popup-item", { "is-active": p === M.value }]),
1420
+ onMouseenter: (h) => M.value = p,
1421
+ onClick: (h) => Ie(c)
1418
1422
  }, [
1419
- A("span", {
1420
- class: te(["badge", `badge-${c.kind}`])
1421
- }, Y(Te(c.kind)), 3),
1422
- A("span", on, Y(c.label), 1),
1423
- c.detail ? (I(), L("span", an, Y(c.detail), 1)) : Z("", !0)
1424
- ], 42, ln))), 128))
1425
- ], 36)) : Z("", !0),
1426
- g.value ? (I(), L("div", {
1423
+ B("span", {
1424
+ class: le(["badge", `badge-${c.kind}`])
1425
+ }, Y(Ce(c.kind)), 3),
1426
+ B("span", mn, Y(c.label), 1),
1427
+ c.detail ? (I(), H("span", hn, Y(c.detail), 1)) : K("", !0)
1428
+ ], 42, pn))), 128))
1429
+ ], 36)) : K("", !0),
1430
+ g.value ? (I(), H("div", {
1427
1431
  key: 1,
1428
1432
  ref_key: "hoverCard",
1429
- ref: O,
1433
+ ref: W,
1430
1434
  class: "hover-card",
1431
- style: re(ie.value)
1435
+ style: ce(ae.value)
1432
1436
  }, [
1433
- A("div", sn, [
1434
- A("span", {
1435
- class: te(["badge", `badge-${g.value.kind}`])
1436
- }, Y(Te(g.value.kind)), 3),
1437
- A("span", rn, [
1438
- Rt(Y(g.value.label), 1),
1439
- g.value.detail ? (I(), L("span", cn, ":")) : Z("", !0)
1437
+ B("div", gn, [
1438
+ B("span", {
1439
+ class: le(["badge", `badge-${g.value.kind}`])
1440
+ }, Y(Ce(g.value.kind)), 3),
1441
+ B("span", bn, [
1442
+ Wt(Y(g.value.label), 1),
1443
+ g.value.detail ? (I(), H("span", vn, ":")) : K("", !0)
1440
1444
  ]),
1441
- g.value.detail ? (I(), L("span", un, Y(g.value.detail), 1)) : Z("", !0)
1445
+ g.value.detail ? (I(), H("span", yn, Y(g.value.detail), 1)) : K("", !0)
1442
1446
  ]),
1443
- g.value.documentation ? (I(), L("p", dn, Y(g.value.documentation), 1)) : Z("", !0),
1444
- g.value.type ? (I(), L("pre", fn, [
1445
- A("code", {
1446
- innerHTML: ft(g.value.type)
1447
- }, null, 8, pn)
1448
- ])) : Z("", !0)
1449
- ], 4)) : Z("", !0)
1447
+ g.value.documentation ? (I(), H("p", kn, Y(g.value.documentation), 1)) : K("", !0),
1448
+ g.value.type ? (I(), H("pre", wn, [
1449
+ B("code", {
1450
+ innerHTML: gt(g.value.type)
1451
+ }, null, 8, xn)
1452
+ ])) : K("", !0)
1453
+ ], 4)) : K("", !0)
1450
1454
  ], 512),
1451
- n.collapsible ? (I(), L("button", {
1455
+ n.collapsible ? (I(), H("button", {
1452
1456
  key: 1,
1453
1457
  type: "button",
1454
1458
  class: "expand-toggle",
1455
1459
  title: F.value ? "收起" : "展开",
1456
1460
  "aria-label": F.value ? "收起编辑器" : "展开编辑器",
1457
- onClick: dt
1461
+ onClick: ht
1458
1462
  }, [
1459
- F.value ? (I(), L("svg", gn, [...l[2] || (l[2] = [
1460
- A("path", {
1463
+ F.value ? (I(), H("svg", Cn, [...l[2] || (l[2] = [
1464
+ B("path", {
1461
1465
  d: "M11 2 5 8 11 14",
1462
1466
  fill: "none",
1463
1467
  stroke: "currentColor",
@@ -1465,8 +1469,8 @@ ${v}${S}`);
1465
1469
  "stroke-linecap": "round",
1466
1470
  "stroke-linejoin": "round"
1467
1471
  }, null, -1)
1468
- ])])) : (I(), L("svg", hn, [...l[1] || (l[1] = [
1469
- A("path", {
1472
+ ])])) : (I(), H("svg", Tn, [...l[1] || (l[1] = [
1473
+ B("path", {
1470
1474
  d: "M6 2 12 8 6 14",
1471
1475
  fill: "none",
1472
1476
  stroke: "currentColor",
@@ -1475,35 +1479,35 @@ ${v}${S}`);
1475
1479
  "stroke-linejoin": "round"
1476
1480
  }, null, -1)
1477
1481
  ])]))
1478
- ], 8, mn)) : Z("", !0)
1482
+ ], 8, $n)) : K("", !0)
1479
1483
  ], 38)
1480
1484
  ], 6));
1481
1485
  }
1482
- }), vn = (n, s) => {
1486
+ }), En = (n, s) => {
1483
1487
  const o = n.__vccOpts || n;
1484
1488
  for (const [e, i] of s)
1485
1489
  o[e] = i;
1486
1490
  return o;
1487
- }, yn = /* @__PURE__ */ vn(bn, [["__scopeId", "data-v-fecd5f3c"]]), xn = {
1491
+ }, Rn = /* @__PURE__ */ En(Sn, [["__scopeId", "data-v-8af715cf"]]), Ln = {
1488
1492
  install(n) {
1489
- n.component("CodeInput", yn);
1493
+ n.component("CodeInput", Rn);
1490
1494
  }
1491
1495
  };
1492
1496
  export {
1493
- yn as CodeEditor,
1494
- Wt as collectCompletions,
1495
- xn as default,
1496
- It as defaultCompletions,
1497
- _t as findArgumentContext,
1498
- ke as findTemplateRange,
1499
- De as getKeywordSet,
1500
- Je as getKeywords,
1501
- ue as highlight,
1502
- Qt as highlightTemplate,
1503
- wn as isInsideTemplate,
1504
- Ut as parseTsCompletions,
1505
- Yt as parseTsSignatures,
1506
- Dt as resolveHoverItem,
1507
- Fe as scanDeclarations,
1508
- ce as tokenize
1497
+ Rn as CodeEditor,
1498
+ Zt as collectCompletions,
1499
+ Ln as default,
1500
+ zt as defaultCompletions,
1501
+ jt as findArgumentContext,
1502
+ we as findTemplateRange,
1503
+ Ve as getKeywordSet,
1504
+ et as getKeywords,
1505
+ de as highlight,
1506
+ cn as highlightTemplate,
1507
+ Hn as isInsideTemplate,
1508
+ ln as parseTsCompletions,
1509
+ on as parseTsSignatures,
1510
+ Yt as resolveHoverItem,
1511
+ Ke as scanDeclarations,
1512
+ ue as tokenize
1509
1513
  };