@sheetxl/scripting 1.0.2 → 1.0.4

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.
@@ -5,11 +5,11 @@ var c = class {
5
5
  start() {
6
6
  if (typeof Worker > "u") throw new Error("Web Workers are not supported in this environment.");
7
7
  return this._worker || (this._worker = this._workerFactory(), this._worker.onmessage = (t) => {
8
- const { id: n, result: e, error: r } = t.data, i = this._pendingRequests.get(n);
9
- if (i) if (this._pendingRequests.delete(n), r) {
10
- const a = new Error(r.message);
11
- a.stack = r.stack, r.cause && (a.cause = r.cause), i.reject(a);
12
- } else i.resolve(e);
8
+ const { id: n, result: e, error: r } = t.data, o = this._pendingRequests.get(n);
9
+ if (o) if (this._pendingRequests.delete(n), r) {
10
+ const i = new Error(r.message);
11
+ i.stack = r.stack, r.cause && (i.cause = r.cause), o.reject(i);
12
+ } else o.resolve(e);
13
13
  }, this._worker.onerror = (t) => {
14
14
  console.error("Worker error:", t), this._pendingRequests.forEach((n) => {
15
15
  n.reject(new Error(`Worker failed: ${t.message}`));
@@ -38,14 +38,14 @@ var c = class {
38
38
  }
39
39
  terminate() {
40
40
  }
41
- }, s = `var _t = Object.defineProperty, ar = (e, t, r) => () => {
41
+ }, s = `var _t = Object.defineProperty, or = (e, t, r) => () => {
42
42
  if (r) throw r[0];
43
43
  try {
44
44
  return e && (t = e(e = 0)), t;
45
45
  } catch (n) {
46
46
  throw r = [n], n;
47
47
  }
48
- }, or = (e, t) => {
48
+ }, ar = (e, t) => {
49
49
  let r = {};
50
50
  for (var n in e) _t(r, n, {
51
51
  get: e[n],
@@ -96,8 +96,8 @@ function Ge(e, t) {
96
96
  if (i = Object.keys(e), r = i.length, r !== Object.keys(t).length) return !1;
97
97
  for (n = r; n-- !== 0;) if (!Object.prototype.hasOwnProperty.call(t, i[n])) return !1;
98
98
  for (n = r; n-- !== 0;) {
99
- let a = i[n];
100
- if ((a !== "_owner" || !e.$$typeof) && !Ge(e[a], t[a])) return !1;
99
+ let o = i[n];
100
+ if ((o !== "_owner" || !e.$$typeof) && !Ge(e[o], t[o])) return !1;
101
101
  }
102
102
  return !0;
103
103
  }
@@ -143,11 +143,11 @@ function mn(e, t, r) {
143
143
  return r.isMergeableObject(e) && Tt(e).forEach(function(i) {
144
144
  n[i] = Oe(e[i], r);
145
145
  }), Tt(t).forEach(function(i) {
146
- (function(a, l) {
147
- return Ct(a, l) && !(Object.hasOwnProperty.call(a, l) && Object.propertyIsEnumerable.call(a, l));
148
- })(e, i) || (Ct(e, i) && r.isMergeableObject(t[i]) ? n[i] = (function(a, l) {
146
+ (function(o, l) {
147
+ return Ct(o, l) && !(Object.hasOwnProperty.call(o, l) && Object.propertyIsEnumerable.call(o, l));
148
+ })(e, i) || (Ct(e, i) && r.isMergeableObject(t[i]) ? n[i] = (function(o, l) {
149
149
  if (!l.customMerge) return Ee;
150
- let s = l.customMerge(a);
150
+ let s = l.customMerge(o);
151
151
  return typeof s == "function" ? s : Ee;
152
152
  })(i, r)(e[i], t[i], r) : n[i] = Oe(t[i], r));
153
153
  }), n;
@@ -216,13 +216,13 @@ function wn(e) {
216
216
  function Sn(e) {
217
217
  return e.replace(/[^a-zA-Z0-9]/g, "").toLowerCase();
218
218
  }
219
- var oe = Array.from({ length: 256 }, (e, t) => (t + 256).toString(16).slice(1));
219
+ var le = Array.from({ length: 256 }, (e, t) => (t + 256).toString(16).slice(1));
220
220
  function He() {
221
221
  let e = globalThis.crypto;
222
222
  if (e?.randomUUID) return e.randomUUID();
223
223
  if (e?.getRandomValues) {
224
224
  let t = e.getRandomValues(/* @__PURE__ */ new Uint8Array(16));
225
- return t[6] = 15 & t[6] | 64, t[8] = 63 & t[8] | 128, oe[t[0]] + oe[t[1]] + oe[t[2]] + oe[t[3]] + "-" + oe[t[4]] + oe[t[5]] + "-" + oe[t[6]] + oe[t[7]] + "-" + oe[t[8]] + oe[t[9]] + "-" + oe[t[10]] + oe[t[11]] + oe[t[12]] + oe[t[13]] + oe[t[14]] + oe[t[15]];
225
+ return t[6] = 15 & t[6] | 64, t[8] = 63 & t[8] | 128, le[t[0]] + le[t[1]] + le[t[2]] + le[t[3]] + "-" + le[t[4]] + le[t[5]] + "-" + le[t[6]] + le[t[7]] + "-" + le[t[8]] + le[t[9]] + "-" + le[t[10]] + le[t[11]] + le[t[12]] + le[t[13]] + le[t[14]] + le[t[15]];
226
226
  }
227
227
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(t) {
228
228
  let r = 16 * Math.random() | 0;
@@ -263,15 +263,15 @@ function En(e) {
263
263
  if (!Number.isFinite(t)) return null;
264
264
  let r = Math.trunc(t), n = t - r, i;
265
265
  r > 2 ** 53 - 1 ? i = Number(r.toExponential().split("e")[1]) + 1 : (i = Math.ceil(Math.log10(r + 1)), et[i] <= r && i++);
266
- let a = 0, l = 0, s = 15 - i;
266
+ let o = 0, l = 0, s = 15 - i;
267
267
  if (n > 0 && s > 0) {
268
268
  let c = et[s];
269
- if (a = Math.round(n * c), a === c) r++, a = 0, r >= et[i] && i++;
270
- else if (a > 0) for (l = s; a % 10 == 0;) a /= 10, l--;
269
+ if (o = Math.round(n * c), o === c) r++, o = 0, r >= et[i] && i++;
270
+ else if (o > 0) for (l = s; o % 10 == 0;) o /= 10, l--;
271
271
  }
272
272
  return {
273
273
  ip: e < 0 ? -r : r,
274
- fp: a,
274
+ fp: o,
275
275
  ipLength: i,
276
276
  fpLength: l
277
277
  };
@@ -320,8 +320,8 @@ function In(e) {
320
320
  let t = e.length, r = e[0].length, n = [];
321
321
  for (let i = 0; i < r; i++) n[i] = Array(t);
322
322
  for (let i = 0; i < t; i++) {
323
- let a = e[i];
324
- for (let l = 0; l < r; l++) n[l][i] = a[l];
323
+ let o = e[i];
324
+ for (let l = 0; l < r; l++) n[l][i] = o[l];
325
325
  }
326
326
  return n;
327
327
  }
@@ -331,12 +331,12 @@ function fr(e, t, r = dr) {
331
331
  if (!e || typeof e != "object" || Array.isArray(e) || e.isImmutable?.()) return r(e, t) ? null : e;
332
332
  let n = Object.keys(e), i = n.length;
333
333
  if (i === 0) return null;
334
- let a = !1;
334
+ let o = !1;
335
335
  for (let l = 0; l < i; l++) {
336
336
  let s = n[l];
337
- fr(e[s], t?.[s], r) === null && (a = !0, delete e[s]);
337
+ fr(e[s], t?.[s], r) === null && (o = !0, delete e[s]);
338
338
  }
339
- return a && Object.keys(e).length === 0 ? null : void 0;
339
+ return o && Object.keys(e).length === 0 ? null : void 0;
340
340
  }
341
341
  function pr(e, t, r = dr) {
342
342
  if (e == null) return !0;
@@ -347,12 +347,12 @@ function pr(e, t, r = dr) {
347
347
  }
348
348
  let n = Object.keys(e), i = n.length;
349
349
  if (i === 0) return !0;
350
- let a = t.length, l = !1;
350
+ let o = t.length, l = !1;
351
351
  for (let s = 0; s < i; s++) {
352
352
  let c = n[s], d = [];
353
- for (let m = 0; m < a; m++) {
354
- let o = t[m]?.[c];
355
- o !== void 0 && d.push(o);
353
+ for (let m = 0; m < o; m++) {
354
+ let a = t[m]?.[c];
355
+ a !== void 0 && d.push(a);
356
356
  }
357
357
  pr(e[c], d, r) && (l = !0, delete e[c]);
358
358
  }
@@ -362,13 +362,13 @@ function Rn(...e) {
362
362
  let t = e.length;
363
363
  if (t > 0 && e[t - 1] !== void 0 && !Fe(e[t - 1])) return e[t - 1];
364
364
  let r = e[0] || {};
365
- for (let n = 1; n < t; n++) r = Ee(r, e[n] || {}, { arrayMerge: (i, a) => [...a] });
365
+ for (let n = 1; n < t; n++) r = Ee(r, e[n] || {}, { arrayMerge: (i, o) => [...o] });
366
366
  return r;
367
367
  }
368
368
  function $n(e, t) {
369
369
  let r = {}, n = Object.keys(t), i = n.length;
370
- for (let a = 0; a < i; a++) {
371
- let l = n[a], s = e[l], c = t[l];
370
+ for (let o = 0; o < i; o++) {
371
+ let l = n[o], s = e[l], c = t[l];
372
372
  s !== c && (r[l] = s === void 0 ? c : s);
373
373
  }
374
374
  return Object.keys(r).length === 0 ? null : r;
@@ -376,18 +376,18 @@ function $n(e, t) {
376
376
  function Nn(e, t, r = sr) {
377
377
  let n = 0, i = e.length - 1;
378
378
  for (; n <= i;) {
379
- let a = Math.floor((n + i) / 2), l = r(e[a]);
380
- if (l === t) return a;
381
- l < t ? n = a + 1 : i = a - 1;
379
+ let o = Math.floor((n + i) / 2), l = r(e[o]);
380
+ if (l === t) return o;
381
+ l < t ? n = o + 1 : i = o - 1;
382
382
  }
383
383
  return n;
384
384
  }
385
385
  function Ln(e, t, r = sr) {
386
386
  let n = e.length - 1, i = 0;
387
387
  for (; n >= i;) {
388
- let a = Math.floor((n + i) / 2), l = r(e[a]);
389
- if (l === t) return a;
390
- l > t ? n = a - 1 : i = a + 1;
388
+ let o = Math.floor((n + i) / 2), l = r(e[o]);
389
+ if (l === t) return o;
390
+ l > t ? n = o - 1 : i = o + 1;
391
391
  }
392
392
  return n;
393
393
  }
@@ -419,7 +419,7 @@ function Un(e, t) {
419
419
  function Pn(e, t, r = !1) {
420
420
  if (!t) return [e];
421
421
  if (!hr(e, t)) return [];
422
- let n = [], i = e, a = () => {
422
+ let n = [], i = e, o = () => {
423
423
  t.top > i.top && t.top < i.bottom && (n.push({
424
424
  ...i,
425
425
  bottom: t.top
@@ -452,12 +452,12 @@ function Pn(e, t, r = !1) {
452
452
  left: t.left
453
453
  });
454
454
  };
455
- return r ? (c(), s(), a(), l()) : (a(), l(), s(), c()), n;
455
+ return r ? (c(), s(), o(), l()) : (o(), l(), s(), c()), n;
456
456
  }
457
457
  function Bn(e, t) {
458
458
  let r = t.split("."), n = e, i = r.length;
459
- for (let a = 0; a < i; a++) {
460
- let l = r[a];
459
+ for (let o = 0; o < i; o++) {
460
+ let l = r[o];
461
461
  if (!n) return null;
462
462
  let s = n[l];
463
463
  if (typeof s == "function" && (s = s.bind(n)()), !s || !Fe(s)) return s;
@@ -468,14 +468,14 @@ function Bn(e, t) {
468
468
  function jn(e, t, r) {
469
469
  let n = t.split("."), i = e;
470
470
  if (!i) throw Error("Can not set path to a null path.");
471
- let a = n.length;
472
- for (let l = 0; i && l < a - 1; l++) {
471
+ let o = n.length;
472
+ for (let l = 0; i && l < o - 1; l++) {
473
473
  let s = n[l], c = i[s];
474
474
  if (c ?? (c = {}, i[s] = c), !Fe(c)) throw Error("Can not set path to a non object path.");
475
475
  i = c;
476
476
  }
477
477
  if (typeof r != "number" && typeof r != "boolean" && typeof r != "string" && !Fe(r)) throw Error(\`Can not set path to \${r} that is not a a supported primitive.\`);
478
- return i[n[a - 1]] = r, e;
478
+ return i[n[o - 1]] = r, e;
479
479
  }
480
480
  function zn(...e) {
481
481
  return new Promise((t) => {
@@ -538,7 +538,7 @@ ge({
538
538
  isEqualSelectionCoords: () => Lr,
539
539
  isRangeWithinRange: () => Rr,
540
540
  isRangesIntersect: () => wt,
541
- isRefusedInsertCut: () => ai,
541
+ isRefusedInsertCut: () => oi,
542
542
  isSingleCell: () => Hn,
543
543
  isValidRange: () => Yn,
544
544
  mergeRangeCoordValues: () => Or,
@@ -549,8 +549,8 @@ ge({
549
549
  rowFirstCellComparator: () => _r,
550
550
  rowFirstRangeComparator: () => Sr,
551
551
  sanitizeRange: () => Mr,
552
- sanitizeRangeArray: () => Qn,
553
- translateRange: () => Zn,
552
+ sanitizeRangeArray: () => Zn,
553
+ translateRange: () => Qn,
554
554
  unionRanges: () => ft,
555
555
  unionRangesArrays: () => Jn
556
556
  });
@@ -634,11 +634,11 @@ function Nr(e, t, r) {
634
634
  if (!e) return r ? t : { ...t };
635
635
  if (!t) return r ? e : { ...e };
636
636
  if (!e && !t || e.rowStart > t.rowEnd || e.rowEnd < t.rowStart || e.colStart > t.colEnd || e.colEnd < t.colStart) return null;
637
- let n = Math.max(e.colStart, t.colStart), i = Math.max(e.rowStart, t.rowStart), a = Math.min(e.colEnd, t.colEnd), l = Math.min(e.rowEnd, t.rowEnd), s = r;
638
- return s ? (s.colStart = n, s.rowStart = i, s.colEnd = a, s.rowEnd = l) : s = {
637
+ let n = Math.max(e.colStart, t.colStart), i = Math.max(e.rowStart, t.rowStart), o = Math.min(e.colEnd, t.colEnd), l = Math.min(e.rowEnd, t.rowEnd), s = r;
638
+ return s ? (s.colStart = n, s.rowStart = i, s.colEnd = o, s.rowEnd = l) : s = {
639
639
  colStart: n,
640
640
  rowStart: i,
641
- colEnd: a,
641
+ colEnd: o,
642
642
  rowEnd: l
643
643
  }, s;
644
644
  }
@@ -646,11 +646,11 @@ function ft(e, t, r) {
646
646
  if (!e && !t) return null;
647
647
  if (!e) return r ? t : { ...t };
648
648
  if (!t) return r ? e : { ...e };
649
- let n = Math.min(e.colStart, t.colStart), i = Math.min(e.rowStart, t.rowStart), a = Math.max(e.colEnd, t.colEnd), l = Math.max(e.rowEnd, t.rowEnd), s = r;
650
- return s ? (s.colStart = n, s.rowStart = i, s.colEnd = a, s.rowEnd = l) : s = {
649
+ let n = Math.min(e.colStart, t.colStart), i = Math.min(e.rowStart, t.rowStart), o = Math.max(e.colEnd, t.colEnd), l = Math.max(e.rowEnd, t.rowEnd), s = r;
650
+ return s ? (s.colStart = n, s.rowStart = i, s.colEnd = o, s.rowEnd = l) : s = {
651
651
  colStart: n,
652
652
  rowStart: i,
653
- colEnd: a,
653
+ colEnd: o,
654
654
  rowEnd: l
655
655
  }, s;
656
656
  }
@@ -682,7 +682,7 @@ function kr(e, t) {
682
682
  }
683
683
  return r;
684
684
  }
685
- function Zn(e, t = -e.rowStart, r = -e.colStart, n) {
685
+ function Qn(e, t = -e.rowStart, r = -e.colStart, n) {
686
686
  return n ? (n.colStart = e.colStart + r, n.rowStart = e.rowStart + t, n.colEnd = e.colEnd + r, n.rowEnd = e.rowEnd + t, n) : {
687
687
  colStart: e.colStart + r,
688
688
  rowStart: e.rowStart + t,
@@ -704,7 +704,7 @@ function Mr(e, t) {
704
704
  rowEnd: e.rowIndex ?? e.rowEnd ?? t?.rowEnd ?? 0
705
705
  } : null;
706
706
  }
707
- function Qn(e, t) {
707
+ function Zn(e, t) {
708
708
  if (!e) return null;
709
709
  let r = e.length, n = Array(r);
710
710
  for (let i = 0; i < r; i++) n[i] = Mr(e[i], t);
@@ -722,13 +722,13 @@ var ti = [null, null], ri = (e, t, r) => {
722
722
  if (e[0].value === e[1].value) return t;
723
723
  };
724
724
  function Or(e, t = 2, r, n = ie.Row, i) {
725
- let a = [...e];
726
- if (t <= 0 || e.length <= 1) return a;
725
+ let o = [...e];
726
+ if (t <= 0 || e.length <= 1) return o;
727
727
  let l = n === ie.Column, s = 0, c = !1;
728
728
  do {
729
- let d = a.sort(Cr(l ? ie.Row : ie.Column));
730
- a = [], a.push(d[0]);
731
- let m = d.length, o = 0, f = d[0], b = f.colStart, S = f.rowStart, A = f.colEnd, L = f.rowEnd;
729
+ let d = o.sort(Cr(l ? ie.Row : ie.Column));
730
+ o = [], o.push(d[0]);
731
+ let m = d.length, a = 0, f = d[0], b = f.colStart, S = f.rowStart, A = f.colEnd, L = f.rowEnd;
732
732
  for (let h = 1; h < m; h++) {
733
733
  let y = d[h], w = !1;
734
734
  if (w = l ? f && S === y.rowStart && L === y.rowEnd && A + 1 === y.colStart : f && b === y.colStart && A === y.colEnd && L + 1 === y.rowStart, w) {
@@ -743,26 +743,26 @@ function Or(e, t = 2, r, n = ie.Row, i) {
743
743
  K[0] = f, K[1] = y, D = r(K, D, n);
744
744
  }
745
745
  if (D) {
746
- a[o] = D, c = !0, f = D, b = f.colStart, S = f.rowStart, A = f.colEnd, L = f.rowEnd;
746
+ o[a] = D, c = !0, f = D, b = f.colStart, S = f.rowStart, A = f.colEnd, L = f.rowEnd;
747
747
  continue;
748
748
  }
749
749
  }
750
- a[++o] = y, f = y, b = f.colStart, S = f.rowStart, A = f.colEnd, L = f.rowEnd;
750
+ o[++a] = y, f = y, b = f.colStart, S = f.rowStart, A = f.colEnd, L = f.rowEnd;
751
751
  }
752
752
  s++, l = !l, s === 1 && (c = !0);
753
- } while (s < t && c && a.length > 1);
754
- return a;
753
+ } while (s < t && c && o.length > 1);
754
+ return o;
755
755
  }
756
756
  function ni(e, t = !1) {
757
- let r = [], n, i = null, a = -(2 ** 53 - 1), l = -(2 ** 53 - 1);
757
+ let r = [], n, i = null, o = -(2 ** 53 - 1), l = -(2 ** 53 - 1);
758
758
  return {
759
759
  append: (s, c, d) => {
760
- let m = !0, o = d !== void 0;
761
- if (o) {
760
+ let m = !0, a = d !== void 0;
761
+ if (a) {
762
762
  let S = e ? e(n, d, t) : n === d ? d : void 0;
763
763
  S === void 0 ? m = !1 : d = S;
764
764
  }
765
- if (m && c === l + 1 && s === a) return t ? i.rowEnd = c : i.colEnd = c, l = c, void (n = d);
765
+ if (m && c === l + 1 && s === o) return t ? i.rowEnd = c : i.colEnd = c, l = c, void (n = d);
766
766
  i && r.push(i);
767
767
  let f = t ? s : c, b = t ? c : s;
768
768
  i = {
@@ -770,7 +770,7 @@ function ni(e, t = !1) {
770
770
  rowStart: b,
771
771
  colEnd: f,
772
772
  rowEnd: b
773
- }, o && (i.value = d), a = s, l = c, n = d;
773
+ }, a && (i.value = d), o = s, l = c, n = d;
774
774
  },
775
775
  done: (s) => (i &&= (r.push(i), null), s ? Or(r, 3, s === !0 ? ri : s, t ? ie.Column : ie.Row, ti) : r)
776
776
  };
@@ -785,7 +785,7 @@ function ii(e, t, r) {
785
785
  let n = r === ie.Row;
786
786
  return (n ? e.colStart === t.colStart && e.colEnd === t.colEnd : e.rowStart === t.rowStart && e.rowEnd === t.rowEnd) ? (n ? t.rowStart > e.rowStart && t.rowStart <= e.rowEnd : t.colStart > e.colStart && t.colStart <= e.colEnd) ? ve.Inside : ve.Close : (n ? e.rowEnd >= t.rowStart && e.colStart <= t.colEnd && e.colEnd >= t.colStart : e.colEnd >= t.colStart && e.rowStart <= t.rowEnd && e.rowEnd >= t.rowStart) ? ve.Tear : ve.Blank;
787
787
  }
788
- function ai(e) {
788
+ function oi(e) {
789
789
  return e === ve.Inside || e === ve.Tear;
790
790
  }
791
791
  var q = {
@@ -804,17 +804,17 @@ ge({
804
804
  });
805
805
  function fe(e, t, r, n) {
806
806
  if (!e) return t;
807
- let i = t, a = r === q.Right || r === q.Down;
807
+ let i = t, o = r === q.Right || r === q.Down;
808
808
  for (;;) {
809
- let l = e(i, !a);
809
+ let l = e(i, !o);
810
810
  if (l === 0) return i;
811
- let s = a ? i + l : i - l;
812
- if (n !== void 0 && (a ? s > n : s < n)) return n;
811
+ let s = o ? i + l : i - l;
812
+ if (n !== void 0 && (o ? s > n : s < n)) return n;
813
813
  i = s;
814
814
  }
815
815
  }
816
- function Dr(e, t = q.Right, r, n, i, a = null) {
817
- if (a && Lr(a, e)) return e;
816
+ function Dr(e, t = q.Right, r, n, i, o = null) {
817
+ if (o && Lr(o, e)) return e;
818
818
  let l = e.ranges, s = e.rangeIndex, c = l[s];
819
819
  if (!wt({
820
820
  rowStart: e.cell.rowIndex,
@@ -835,7 +835,7 @@ function Dr(e, t = q.Right, r, n, i, a = null) {
835
835
  break;
836
836
  case q.Up: d.rowIndex = fe(n, d.rowIndex - 1, t, c.rowStart - 1);
837
837
  }
838
- let o = (S) => {
838
+ let a = (S) => {
839
839
  if (S) {
840
840
  m = s >= l.length - 1 ? 0 : s + 1;
841
841
  let A = l[m];
@@ -852,10 +852,10 @@ function Dr(e, t = q.Right, r, n, i, a = null) {
852
852
  };
853
853
  }
854
854
  };
855
- if (t === q.Right && d.colIndex > c.colEnd && d.rowIndex === c.rowEnd) o(!0);
856
- else if (t === q.Left && d.colIndex < c.colStart && d.rowIndex === c.rowStart) o(!1);
857
- else if (t === q.Down && d.colIndex === c.colEnd && d.rowIndex > c.rowEnd) o(!0);
858
- else if (t === q.Up && d.colIndex === c.colStart && d.rowIndex < c.rowStart) o(!1);
855
+ if (t === q.Right && d.colIndex > c.colEnd && d.rowIndex === c.rowEnd) a(!0);
856
+ else if (t === q.Left && d.colIndex < c.colStart && d.rowIndex === c.rowStart) a(!1);
857
+ else if (t === q.Down && d.colIndex === c.colEnd && d.rowIndex > c.rowEnd) a(!0);
858
+ else if (t === q.Up && d.colIndex === c.colStart && d.rowIndex < c.rowStart) a(!1);
859
859
  else {
860
860
  let S = d.rowIndex, A = d.colIndex;
861
861
  switch (t) {
@@ -903,7 +903,7 @@ function Dr(e, t = q.Right, r, n, i, a = null) {
903
903
  cell: d,
904
904
  ranges: e.ranges,
905
905
  rangeIndex: m
906
- }, t, r, n, i, a ?? e);
906
+ }, t, r, n, i, o ?? e);
907
907
  }
908
908
  return {
909
909
  ranges: e.ranges,
@@ -911,27 +911,27 @@ function Dr(e, t = q.Right, r, n, i, a = null) {
911
911
  rangeIndex: m
912
912
  };
913
913
  }
914
- var oi, $e = (e, t) => {
914
+ var ai, Ne = (e, t) => {
915
915
  if (e.length >= t) return e;
916
916
  let r = new Int32Array(Math.max(t, 2 * e.length));
917
917
  return r.set(e), r;
918
- }, Ne = /* @__PURE__ */ new Int32Array(1024), tt = (e) => (Ne.length < e && (Ne = new Int32Array(Math.max(e, 2 * Ne.length))), Ne.fill(0, 0, e), Ne), li = class {
918
+ }, Le = /* @__PURE__ */ new Int32Array(1024), tt = (e) => (Le.length < e && (Le = new Int32Array(Math.max(e, 2 * Le.length))), Le.fill(0, 0, e), Le), li = class {
919
919
  constructor(e, t, r, n) {
920
920
  this._nextOrder = 0, this._activeLen = 0, this._events = /* @__PURE__ */ new Int32Array(64), this._hasBand = !1, this._bandStart = 0, this._bandEnd = 0, this._rMinS = /* @__PURE__ */ new Int32Array(64), this._rMinE = /* @__PURE__ */ new Int32Array(64), this._rOff = /* @__PURE__ */ new Int32Array(65), this._rCount = 0, this._pool = /* @__PURE__ */ new Int32Array(256), this._overlaps = /* @__PURE__ */ new Int32Array(16), this._rInter = null, this._region = -1, this._major = 0, this._minor = 0, this._done = !1, this.rowStart = 0, this.rowEnd = 0, this.colStart = 0, this.colEnd = 0, this.cellRow = 0, this.cellCol = 0, this.intersection = null, this._isColumn = r, this._isReverse = n, this._store = e;
921
921
  let i = e.count;
922
922
  this._n = i;
923
- let a = new Int32Array(i), l = new Int32Array(i), s = new Int32Array(i), c = new Int32Array(i), d = r ? e.colS : e.rowS, m = r ? e.colE : e.rowE, o = r ? e.rowS : e.colS, f = r ? e.rowE : e.colE;
924
- for (let h = 0; h < i; h++) n ? (a[h] = -m[h], l[h] = -d[h], s[h] = -f[h], c[h] = -o[h]) : (a[h] = d[h], l[h] = m[h], s[h] = o[h], c[h] = f[h]);
925
- this._M0 = a, this._M1 = l, this._m0 = s, this._m1 = c;
923
+ let o = new Int32Array(i), l = new Int32Array(i), s = new Int32Array(i), c = new Int32Array(i), d = r ? e.colS : e.rowS, m = r ? e.colE : e.rowE, a = r ? e.rowS : e.colS, f = r ? e.rowE : e.colE;
924
+ for (let h = 0; h < i; h++) n ? (o[h] = -m[h], l[h] = -d[h], s[h] = -f[h], c[h] = -a[h]) : (o[h] = d[h], l[h] = m[h], s[h] = a[h], c[h] = f[h]);
925
+ this._M0 = o, this._M1 = l, this._m0 = s, this._m1 = c;
926
926
  let b = r ? t.colStart : t.rowStart, S = r ? t.colEnd : t.rowEnd, A = S - b + 1, L = new Int32Array(i);
927
927
  if (i < 256 || A > 16 * i) {
928
928
  for (let h = 0; h < i; h++) L[h] = h;
929
- L.sort((h, y) => a[h] - a[y] || h - y);
929
+ L.sort((h, y) => o[h] - o[y] || h - y);
930
930
  } else {
931
931
  let h = n ? -S : b, y = tt(A + 1);
932
- for (let w = 0; w < i; w++) y[a[w] - h + 1]++;
932
+ for (let w = 0; w < i; w++) y[o[w] - h + 1]++;
933
933
  for (let w = 1; w <= A; w++) y[w] += y[w - 1];
934
- for (let w = 0; w < i; w++) L[y[a[w] - h]++] = w;
934
+ for (let w = 0; w < i; w++) L[y[o[w] - h]++] = w;
935
935
  }
936
936
  this._order = L, this._active = new Int32Array(Math.min(2 * i, 1024)), this._scratch = new Int32Array(this._active.length);
937
937
  }
@@ -939,49 +939,49 @@ var oi, $e = (e, t) => {
939
939
  return this._isReverse ? this._n - 1 - e : e;
940
940
  }
941
941
  _compareEvents(e, t) {
942
- let r = e >> 1, n = t >> 1, i = 1 & e, a = 1 & t, l = this._m0, s = this._m1, c = i ? s[r] : l[r], d = a ? s[n] : l[n];
942
+ let r = e >> 1, n = t >> 1, i = 1 & e, o = 1 & t, l = this._m0, s = this._m1, c = i ? s[r] : l[r], d = o ? s[n] : l[n];
943
943
  if (c !== d) return c - d;
944
- if (i !== a) return i - a;
945
- let m = i ? l[r] : s[r], o = a ? l[n] : s[n];
946
- return m === o ? this._stable(r) - this._stable(n) : m - o;
944
+ if (i !== o) return i - o;
945
+ let m = i ? l[r] : s[r], a = o ? l[n] : s[n];
946
+ return m === a ? this._stable(r) - this._stable(n) : m - a;
947
947
  }
948
948
  _sortEvents(e, t, r, n) {
949
949
  let i = n - r + 1;
950
- if (t < 256 || i > 16 * t) return e.subarray(0, t).sort((o, f) => this._compareEvents(o, f)), e;
951
- let a = this._m0, l = this._m1, s = e, c = this._scratch;
950
+ if (t < 256 || i > 16 * t) return e.subarray(0, t).sort((a, f) => this._compareEvents(a, f)), e;
951
+ let o = this._m0, l = this._m1, s = e, c = this._scratch;
952
952
  c.length < t && (c = this._scratch = new Int32Array(t));
953
953
  let d = tt(i + 1);
954
- for (let o = 0; o < t; o++) {
955
- let f = s[o];
956
- d[(1 & f ? a[f >> 1] : l[f >> 1]) - r + 1]++;
954
+ for (let a = 0; a < t; a++) {
955
+ let f = s[a];
956
+ d[(1 & f ? o[f >> 1] : l[f >> 1]) - r + 1]++;
957
957
  }
958
- for (let o = 1; o <= i; o++) d[o] += d[o - 1];
959
- for (let o = 0; o < t; o++) {
960
- let f = s[o];
961
- c[d[(1 & f ? a[f >> 1] : l[f >> 1]) - r]++] = f;
958
+ for (let a = 1; a <= i; a++) d[a] += d[a - 1];
959
+ for (let a = 0; a < t; a++) {
960
+ let f = s[a];
961
+ c[d[(1 & f ? o[f >> 1] : l[f >> 1]) - r]++] = f;
962
962
  }
963
963
  let m = 0;
964
- for (let o = 0; o < t; o++) 1 & c[o] || (s[m++] = c[o]);
965
- for (let o = 0; o < t; o++) 1 & ~c[o] || (s[m++] = c[o]);
964
+ for (let a = 0; a < t; a++) 1 & c[a] || (s[m++] = c[a]);
965
+ for (let a = 0; a < t; a++) 1 & ~c[a] || (s[m++] = c[a]);
966
966
  d = tt(i + 1);
967
- for (let o = 0; o < t; o++) {
968
- let f = s[o];
969
- d[(1 & f ? l[f >> 1] : a[f >> 1]) - r + 1]++;
967
+ for (let a = 0; a < t; a++) {
968
+ let f = s[a];
969
+ d[(1 & f ? l[f >> 1] : o[f >> 1]) - r + 1]++;
970
970
  }
971
- for (let o = 1; o <= i; o++) d[o] += d[o - 1];
972
- for (let o = 0; o < t; o++) {
973
- let f = s[o];
974
- c[d[(1 & f ? l[f >> 1] : a[f >> 1]) - r]++] = f;
971
+ for (let a = 1; a <= i; a++) d[a] += d[a - 1];
972
+ for (let a = 0; a < t; a++) {
973
+ let f = s[a];
974
+ c[d[(1 & f ? l[f >> 1] : o[f >> 1]) - r]++] = f;
975
975
  }
976
976
  return this._scratch = s, this._events = c, c;
977
977
  }
978
978
  _advanceBand() {
979
- let e = this._n, t = this._M0, r = this._M1, n = this._order, i, a = this._active, l = this._activeLen;
979
+ let e = this._n, t = this._M0, r = this._M1, n = this._order, i, o = this._active, l = this._activeLen;
980
980
  if (this._hasBand) {
981
- let o = this._bandEnd, f = 0;
981
+ let a = this._bandEnd, f = 0;
982
982
  for (let b = 0; b < l; b++) {
983
- let S = a[b];
984
- r[S >> 1] > o && (a[f++] = S);
983
+ let S = o[b];
984
+ r[S >> 1] > a && (o[f++] = S);
985
985
  }
986
986
  l = f;
987
987
  }
@@ -995,8 +995,8 @@ var oi, $e = (e, t) => {
995
995
  for (; c < e && t[n[c]] === i;) c++;
996
996
  let d = c - s;
997
997
  if (d > 0) {
998
- let o = 2 * d, f = this._events;
999
- f.length < o && (f = this._events = new Int32Array(Math.max(o, 2 * f.length)));
998
+ let a = 2 * d, f = this._events;
999
+ f.length < a && (f = this._events = new Int32Array(Math.max(a, 2 * f.length)));
1000
1000
  let b = this._m0, S = this._m1, A = 2 ** 53 - 1, L = -(2 ** 53 - 1), h = 0;
1001
1001
  if (this._isReverse) for (let K = c - 1; K >= s; K--) {
1002
1002
  let k = n[K];
@@ -1006,27 +1006,27 @@ var oi, $e = (e, t) => {
1006
1006
  let k = n[K];
1007
1007
  f[h++] = k << 1, f[h++] = k << 1 | 1, b[k] < A && (A = b[k]), S[k] > L && (L = S[k]);
1008
1008
  }
1009
- let y = this._sortEvents(f, o, A, L), w = l + o, D = this._scratch;
1010
- if ((D === y || D.length < w) && (D = new Int32Array(Math.max(w, 2 * a.length))), l === 0) D.set(y.subarray(0, o));
1009
+ let y = this._sortEvents(f, a, A, L), w = l + a, D = this._scratch;
1010
+ if ((D === y || D.length < w) && (D = new Int32Array(Math.max(w, 2 * o.length))), l === 0) D.set(y.subarray(0, a));
1011
1011
  else {
1012
1012
  let K = 0, k = 0, R = 0;
1013
- for (; K < l && k < o;) this._compareEvents(a[K], y[k]) <= 0 ? D[R++] = a[K++] : D[R++] = y[k++];
1014
- for (; K < l;) D[R++] = a[K++];
1015
- for (; k < o;) D[R++] = y[k++];
1013
+ for (; K < l && k < a;) this._compareEvents(o[K], y[k]) <= 0 ? D[R++] = o[K++] : D[R++] = y[k++];
1014
+ for (; K < l;) D[R++] = o[K++];
1015
+ for (; k < a;) D[R++] = y[k++];
1016
1016
  }
1017
- this._scratch = a.length >= D.length ? a : new Int32Array(D.length), a = this._active = D, l = w;
1017
+ this._scratch = o.length >= D.length ? o : new Int32Array(D.length), o = this._active = D, l = w;
1018
1018
  }
1019
1019
  this._activeLen = l, this._nextOrder = c;
1020
1020
  let m = c < e ? t[n[c]] - 1 : 2 ** 53 - 1;
1021
- for (let o = 0; o < l; o++) {
1022
- let f = r[a[o] >> 1];
1021
+ for (let a = 0; a < l; a++) {
1022
+ let f = r[o[a] >> 1];
1023
1023
  f < m && (m = f);
1024
1024
  }
1025
1025
  return this._bandStart = i, this._bandEnd = m, this._hasBand = !0, this._sweepBand(), !0;
1026
1026
  }
1027
1027
  _sweepBand() {
1028
- let e = this._active, t = this._activeLen, r = this._m0, n = this._m1, i = this._rMinS, a = this._rMinE, l = this._rOff, s = this._pool, c = this._overlaps, d = 0, m = 0, o = 0, f = 0, b = (S, A) => {
1029
- o >= i.length && (i = this._rMinS = $e(i, o + 1), a = this._rMinE = $e(a, o + 1), l = this._rOff = $e(l, i.length + 1)), i[o] = S, a[o] = A, l[o] = m, o++, m + d > s.length && (s = this._pool = $e(s, m + d));
1028
+ let e = this._active, t = this._activeLen, r = this._m0, n = this._m1, i = this._rMinS, o = this._rMinE, l = this._rOff, s = this._pool, c = this._overlaps, d = 0, m = 0, a = 0, f = 0, b = (S, A) => {
1029
+ a >= i.length && (i = this._rMinS = Ne(i, a + 1), o = this._rMinE = Ne(o, a + 1), l = this._rOff = Ne(l, i.length + 1)), i[a] = S, o[a] = A, l[a] = m, a++, m + d > s.length && (s = this._pool = Ne(s, m + d));
1030
1030
  for (let L = 0; L < d; L++) s[m++] = c[L];
1031
1031
  };
1032
1032
  for (let S = 0; S < t; S++) {
@@ -1043,16 +1043,16 @@ var oi, $e = (e, t) => {
1043
1043
  f = h + 1;
1044
1044
  } else {
1045
1045
  let h = r[L];
1046
- d > 0 && f < h && b(f, h - 1), d >= c.length && (c = this._overlaps = $e(c, d + 1));
1046
+ d > 0 && f < h && b(f, h - 1), d >= c.length && (c = this._overlaps = Ne(c, d + 1));
1047
1047
  let y = d;
1048
1048
  for (; y > 0 && c[y - 1] > L;) c[y] = c[y - 1], y--;
1049
1049
  c[y] = L, d++, f = h;
1050
1050
  }
1051
1051
  }
1052
- l[o] = m, this._rCount = o, this._region = -1, this._rInter = null;
1052
+ l[a] = m, this._rCount = a, this._region = -1, this._rInter = null;
1053
1053
  }
1054
1054
  _setRegion(e) {
1055
- let t = this._isReverse, r = t ? 0 - this._bandEnd : this._bandStart, n = t ? 0 - this._bandStart : this._bandEnd, i = this._rMinS[e], a = this._rMinE[e], l = t ? 0 - a : i, s = t ? 0 - i : a;
1055
+ let t = this._isReverse, r = t ? 0 - this._bandEnd : this._bandStart, n = t ? 0 - this._bandStart : this._bandEnd, i = this._rMinS[e], o = this._rMinE[e], l = t ? 0 - o : i, s = t ? 0 - i : o;
1056
1056
  this._isColumn ? (this.colStart = r, this.colEnd = n, this.rowStart = l, this.rowEnd = s) : (this.rowStart = r, this.rowEnd = n, this.colStart = l, this.colEnd = s);
1057
1057
  let c = this._rInter;
1058
1058
  if (c) {
@@ -1106,10 +1106,10 @@ var oi, $e = (e, t) => {
1106
1106
  }
1107
1107
  if (n < this._bandStart) return this._major = this._bandStart, this._minor = this._rMinS[0], this._setCell(0), !0;
1108
1108
  this._major = n;
1109
- let a = this._rMinE, l = 0, s = this._rCount;
1109
+ let o = this._rMinE, l = 0, s = this._rCount;
1110
1110
  for (; l < s;) {
1111
1111
  let c = l + s >>> 1;
1112
- a[c] < i ? l = c + 1 : s = c;
1112
+ o[c] < i ? l = c + 1 : s = c;
1113
1113
  }
1114
1114
  if (l < this._rCount) {
1115
1115
  let c = this._rMinS[l];
@@ -1130,17 +1130,17 @@ var oi, $e = (e, t) => {
1130
1130
  super(...i), this._reuseOverlaps = null;
1131
1131
  }
1132
1132
  _materialize(i) {
1133
- let a = this._rOff, l = this._pool, s = this._store.value, c = a[i], d = a[i + 1], m = this._reuseOverlaps;
1133
+ let o = this._rOff, l = this._pool, s = this._store.value, c = o[i], d = o[i + 1], m = this._reuseOverlaps;
1134
1134
  m ? m.length = 0 : m = [];
1135
- for (let o = c; o < d; o++) m.push(s[l[o]]);
1135
+ for (let a = c; a < d; a++) m.push(s[l[a]]);
1136
1136
  return m;
1137
1137
  }
1138
1138
  }
1139
1139
  class r {
1140
- constructor(i, a) {
1140
+ constructor(i, o) {
1141
1141
  if (this._sweep = null, this._isByCell = !1, this._cellComparator = null, this._lastCell = null, this._reuse = null, !i || i.length === 0) return;
1142
1142
  let l, s = !0, c = !1, d = !1;
1143
- if (a && (s = (a.axis ?? ie.Column) !== ie.Row, c = a.reverse ?? !1, d = a.byCell ?? !1, l = a.reuseIterator), this._isByCell = d, l) {
1143
+ if (o && (s = (o.axis ?? ie.Column) !== ie.Row, c = o.reverse ?? !1, d = o.byCell ?? !1, l = o.reuseIterator), this._isByCell = d, l) {
1144
1144
  let y = typeof l == "boolean" ? {
1145
1145
  done: !1,
1146
1146
  value: {
@@ -1165,7 +1165,7 @@ var oi, $e = (e, t) => {
1165
1165
  rowIndex: -1
1166
1166
  } : null, this._reuse = y;
1167
1167
  }
1168
- let m = i.length, o = {
1168
+ let m = i.length, a = {
1169
1169
  count: m,
1170
1170
  rowS: new Int32Array(m),
1171
1171
  rowE: new Int32Array(m),
@@ -1177,56 +1177,56 @@ var oi, $e = (e, t) => {
1177
1177
  }, f = 2 ** 53 - 1, b = -(2 ** 53 - 1), S = 2 ** 53 - 1, A = -(2 ** 53 - 1);
1178
1178
  for (let y = 0; y < m; y++) {
1179
1179
  let w = i[y];
1180
- o.rowS[y] = w.rowStart, o.rowE[y] = w.rowEnd, o.colS[y] = w.colStart, o.colE[y] = w.colEnd, o.value.push(w), w.rowStart < f && (f = w.rowStart), w.rowEnd > b && (b = w.rowEnd), w.colStart < S && (S = w.colStart), w.colEnd > A && (A = w.colEnd);
1180
+ a.rowS[y] = w.rowStart, a.rowE[y] = w.rowEnd, a.colS[y] = w.colStart, a.colE[y] = w.colEnd, a.value.push(w), w.rowStart < f && (f = w.rowStart), w.rowEnd > b && (b = w.rowEnd), w.colStart < S && (S = w.colStart), w.colEnd > A && (A = w.colEnd);
1181
1181
  }
1182
1182
  let L = {
1183
1183
  rowStart: f,
1184
1184
  rowEnd: b,
1185
1185
  colStart: S,
1186
1186
  colEnd: A
1187
- }, h = this._sweep = new t(o, L, s, c);
1187
+ }, h = this._sweep = new t(a, L, s, c);
1188
1188
  d ? this._cellComparator = Ar(s ? ie.Column : ie.Row, c) : l && (h._reuseOverlaps = []);
1189
1189
  }
1190
1190
  next(i) {
1191
- let a = this._sweep;
1192
- if (!a) return je;
1191
+ let o = this._sweep;
1192
+ if (!o) return je;
1193
1193
  let l = this._isByCell, s;
1194
1194
  if (i) {
1195
1195
  if (!l) throw Error("nextCell is only supported when byCell is true");
1196
- let o = this._lastCell;
1197
- if (o && this._cellComparator(o, i) >= 0) throw Error("nextCell must be after the current iteration cell");
1198
- s = a.seekCell(i.rowIndex, i.colIndex);
1199
- } else s = l ? a.nextCell() : a.nextRegion();
1196
+ let a = this._lastCell;
1197
+ if (a && this._cellComparator(a, i) >= 0) throw Error("nextCell must be after the current iteration cell");
1198
+ s = o.seekCell(i.rowIndex, i.colIndex);
1199
+ } else s = l ? o.nextCell() : o.nextRegion();
1200
1200
  if (!s) return this._sweep = null, je;
1201
1201
  let c = this._reuse;
1202
1202
  if (c) {
1203
- let o = c.value;
1203
+ let a = c.value;
1204
1204
  c.done = !1;
1205
- let f = o.range;
1206
- if (f.colStart = a.colStart, f.rowStart = a.rowStart, f.colEnd = a.colEnd, f.rowEnd = a.rowEnd, l) {
1207
- let b = o.cell;
1208
- b.colIndex = a.cellCol, b.rowIndex = a.cellRow;
1205
+ let f = a.range;
1206
+ if (f.colStart = o.colStart, f.rowStart = o.rowStart, f.colEnd = o.colEnd, f.rowEnd = o.rowEnd, l) {
1207
+ let b = a.cell;
1208
+ b.colIndex = o.cellCol, b.rowIndex = o.cellRow;
1209
1209
  let S = this._lastCell;
1210
1210
  S ||= this._lastCell = {
1211
1211
  colIndex: 0,
1212
1212
  rowIndex: 0
1213
- }, S.colIndex = a.cellCol, S.rowIndex = a.cellRow;
1213
+ }, S.colIndex = o.cellCol, S.rowIndex = o.cellRow;
1214
1214
  }
1215
- return o.overlaps = a.intersection, c;
1215
+ return a.overlaps = o.intersection, c;
1216
1216
  }
1217
- let d = null, m = a.intersection;
1217
+ let d = null, m = o.intersection;
1218
1218
  return l && (d = this._lastCell = {
1219
- colIndex: a.cellCol,
1220
- rowIndex: a.cellRow
1219
+ colIndex: o.cellCol,
1220
+ rowIndex: o.cellRow
1221
1221
  }, m = m.slice()), {
1222
1222
  done: !1,
1223
1223
  value: {
1224
1224
  cell: d,
1225
1225
  range: {
1226
- colStart: a.colStart,
1227
- rowStart: a.rowStart,
1228
- colEnd: a.colEnd,
1229
- rowEnd: a.rowEnd
1226
+ colStart: o.colStart,
1227
+ rowStart: o.rowStart,
1228
+ colEnd: o.colEnd,
1229
+ rowEnd: o.rowEnd
1230
1230
  },
1231
1231
  overlaps: m
1232
1232
  }
@@ -1243,7 +1243,7 @@ var oi, $e = (e, t) => {
1243
1243
  }
1244
1244
  }
1245
1245
  e.IteratorInstance = r;
1246
- })(oi ||= {});
1246
+ })(ai ||= {});
1247
1247
  var si = class {
1248
1248
  constructor() {
1249
1249
  this._onceMessageKeys = /* @__PURE__ */ new Set(), this._overrides = null;
@@ -1256,14 +1256,14 @@ var si = class {
1256
1256
  }
1257
1257
  _write(e, t, r) {
1258
1258
  if (r?.onceKey) {
1259
- let a = this._onceMessageKeys;
1260
- if (a.has(r.onceKey)) return;
1261
- a.add(r.onceKey);
1259
+ let o = this._onceMessageKeys;
1260
+ if (o.has(r.onceKey)) return;
1261
+ o.add(r.onceKey);
1262
1262
  }
1263
1263
  let n = r?.meta, i = this._overrides;
1264
1264
  if (i) {
1265
- let a = i[e];
1266
- if (a) return void a.bind(i)(t, r);
1265
+ let o = i[e];
1266
+ if (o) return void o.bind(i)(t, r);
1267
1267
  }
1268
1268
  n === void 0 ? console[e](t) : console[e](t, n);
1269
1269
  }
@@ -1313,17 +1313,17 @@ var Fr = !(typeof window > "u" || !window.document || !window.document.createEle
1313
1313
  if (!Fr) return void r("Unable to open dialog with no dom.");
1314
1314
  let n = document.createElement("input");
1315
1315
  n.type = "file", n.accept = e;
1316
- let i = null, a = !1;
1316
+ let i = null, o = !1;
1317
1317
  globalThis.addEventListener?.("focus", () => {
1318
1318
  setTimeout(() => {
1319
- i || a || (a = !0, t(null));
1319
+ i || o || (o = !0, t(null));
1320
1320
  }, 1e3);
1321
1321
  }, {
1322
1322
  once: !0,
1323
1323
  passive: !0
1324
1324
  }), n.onchange = () => {
1325
1325
  if (i = n.files?.[0] ?? null, i) {
1326
- if (a) return void console.warn("File open detected after faux cancel.", i);
1326
+ if (o) return void console.warn("File open detected after faux cancel.", i);
1327
1327
  t(i);
1328
1328
  }
1329
1329
  }, n.autofocus = !0, n.click();
@@ -1348,8 +1348,8 @@ var Fr = !(typeof window > "u" || !window.document || !window.document.createEle
1348
1348
  behavior: r,
1349
1349
  container: "nearest"
1350
1350
  });
1351
- let n = e.getBoundingClientRect(), i = t.getBoundingClientRect(), a = n.top + e.clientTop, l = a + e.clientHeight, s = 0;
1352
- i.top < a ? s = i.top - a : i.bottom > l && (s = Math.min(i.bottom - l, i.top - a)), s !== 0 && e.scrollBy({
1351
+ let n = e.getBoundingClientRect(), i = t.getBoundingClientRect(), o = n.top + e.clientTop, l = o + e.clientHeight, s = 0;
1352
+ i.top < o ? s = i.top - o : i.bottom > l && (s = Math.min(i.bottom - l, i.top - o)), s !== 0 && e.scrollBy({
1353
1353
  top: s,
1354
1354
  behavior: r
1355
1355
  });
@@ -1375,21 +1375,21 @@ function yi(e, t) {
1375
1375
  };
1376
1376
  }
1377
1377
  function wi(e, t = 300, r = !1) {
1378
- let n, i, a, l = null, s = 0;
1378
+ let n, i, o, l = null, s = 0;
1379
1379
  function c() {
1380
1380
  let m = Date.now() - s;
1381
- m < t && m >= 0 ? l = setTimeout(c, t - m) : (l = null, r || (a = e.apply(i, n), i = n = null));
1381
+ m < t && m >= 0 ? l = setTimeout(c, t - m) : (l = null, r || (o = e.apply(i, n), i = n = null));
1382
1382
  }
1383
1383
  t ??= 100;
1384
1384
  let d = function() {
1385
1385
  i = globalThis, n = arguments, s = Date.now();
1386
1386
  var m = r && !l;
1387
- return l ||= setTimeout(c, t), m && (a = e.apply(i, n), i = n = null), a;
1387
+ return l ||= setTimeout(c, t), m && (o = e.apply(i, n), i = n = null), o;
1388
1388
  };
1389
1389
  return d.clear = function() {
1390
1390
  l &&= (clearTimeout(l), null);
1391
1391
  }, d.flush = function() {
1392
- l &&= (a = e.apply(i, n), i = n = null, clearTimeout(l), null);
1392
+ l &&= (o = e.apply(i, n), i = n = null, clearTimeout(l), null);
1393
1393
  }, d;
1394
1394
  }
1395
1395
  var Si = (e) => {
@@ -1430,15 +1430,15 @@ ge({
1430
1430
  isNodeBuffer: () => Ti,
1431
1431
  isSharedArrayBufferSupported: () => Ci
1432
1432
  });
1433
- var xi = "application/octet-stream", Ae = globalThis.Buffer, Ti = (e) => Ae?.isBuffer(e) ?? !1, Ci = typeof SharedArrayBuffer == "function" && (globalThis.crossOriginIsolated === void 0 || globalThis.crossOriginIsolated === !0), Ai = new Uint8Array(new Uint16Array([1]).buffer)[0] === 1, It = globalThis.FileReader, Ii = (e) => {
1434
- let t = typeof globalThis.atob == "function" ? globalThis.atob(e) : Ae.from(e, "base64").toString("binary"), r = t.length, n = new Uint8Array(r);
1433
+ var xi = "application/octet-stream", Ie = globalThis.Buffer, Ti = (e) => Ie?.isBuffer(e) ?? !1, Ci = typeof SharedArrayBuffer == "function" && (globalThis.crossOriginIsolated === void 0 || globalThis.crossOriginIsolated === !0), Ai = new Uint8Array(new Uint16Array([1]).buffer)[0] === 1, It = globalThis.FileReader, Ii = (e) => {
1434
+ let t = typeof globalThis.atob == "function" ? globalThis.atob(e) : Ie.from(e, "base64").toString("binary"), r = t.length, n = new Uint8Array(r);
1435
1435
  for (let i = 0; i < r; i++) n[i] = t.charCodeAt(i);
1436
1436
  return n.buffer;
1437
1437
  }, Pr = (e) => {
1438
1438
  let t = new Uint8Array(e), r = t.byteLength, n = "";
1439
1439
  for (let i = 0; i < r; i++) n += String.fromCharCode(t[i]);
1440
1440
  if (typeof globalThis.btoa == "function") return globalThis.btoa(n);
1441
- if (Ae) return Ae.from(n, "binary").toString("base64");
1441
+ if (Ie) return Ie.from(n, "binary").toString("base64");
1442
1442
  throw Error("Unsupported environment");
1443
1443
  }, pt = (e) => new Promise((t, r) => {
1444
1444
  if (e) if (It) {
@@ -1448,8 +1448,8 @@ var xi = "application/octet-stream", Ae = globalThis.Buffer, Ti = (e) => Ae?.isB
1448
1448
  }, n.onerror = () => {
1449
1449
  r(n.error);
1450
1450
  }, n.readAsText(e);
1451
- } else if (Ae) {
1452
- let n = (i) => Ae.from(i).toString("utf-8");
1451
+ } else if (Ie) {
1452
+ let n = (i) => Ie.from(i).toString("utf-8");
1453
1453
  e.arrayBuffer().then((i) => {
1454
1454
  t(n(i));
1455
1455
  }).catch((i) => {
@@ -1472,7 +1472,7 @@ function Ri(e, t) {
1472
1472
  };
1473
1473
  });
1474
1474
  var i;
1475
- let a = [];
1475
+ let o = [];
1476
1476
  return (function l(s) {
1477
1477
  if (s && s.toJSON && typeof s.toJSON == "function" && (s = s.toJSON()), s === void 0) return;
1478
1478
  if (typeof s == "number") return isFinite(s) ? "" + s : "null";
@@ -1480,21 +1480,21 @@ function Ri(e, t) {
1480
1480
  let c;
1481
1481
  if (Array.isArray(s)) {
1482
1482
  c = "[";
1483
- for (let o = 0; o < s.length; o++) o && (c += ","), c += l(s[o]) || "null";
1483
+ for (let a = 0; a < s.length; a++) a && (c += ","), c += l(s[a]) || "null";
1484
1484
  return c + "]";
1485
1485
  }
1486
1486
  if (s === null) return "null";
1487
- if (a.indexOf(s) !== -1) {
1487
+ if (o.indexOf(s) !== -1) {
1488
1488
  if (r) return JSON.stringify("__cycle__");
1489
1489
  throw TypeError("Converting circular structure to JSON");
1490
1490
  }
1491
- let d = a.push(s) - 1, m = Object.keys(s).sort(n && n(s));
1491
+ let d = o.push(s) - 1, m = Object.keys(s).sort(n && n(s));
1492
1492
  c = "";
1493
- for (let o = 0; o < m.length; o++) {
1494
- let f = m[o], b = l(s[f]);
1493
+ for (let a = 0; a < m.length; a++) {
1494
+ let f = m[a], b = l(s[f]);
1495
1495
  b && (c && (c += ","), c += JSON.stringify(f) + ":" + b);
1496
1496
  }
1497
- return a.splice(d, 1), "{" + c + "}";
1497
+ return o.splice(d, 1), "{" + c + "}";
1498
1498
  })(e);
1499
1499
  }
1500
1500
  var $i;
@@ -1513,9 +1513,9 @@ var Br = "data:image/png;base64,", jr = "Unable to resolve image.", Rt = (e) =>
1513
1513
  width: i.naturalWidth,
1514
1514
  height: i.naturalHeight
1515
1515
  });
1516
- }, { once: !0 }), i.addEventListener("error", function(a) {
1516
+ }, { once: !0 }), i.addEventListener("error", function(o) {
1517
1517
  URL.revokeObjectURL(e);
1518
- let l = a?.error?.message ?? "";
1518
+ let l = o?.error?.message ?? "";
1519
1519
  l &&= \`: \${l}\`, r(\`Invalid Image\${l}\`);
1520
1520
  }, { once: !0 }), await i.decode();
1521
1521
  } catch {
@@ -1525,25 +1525,25 @@ var Br = "data:image/png;base64,", jr = "Unable to resolve image.", Rt = (e) =>
1525
1525
  }), Ni = (e, t = 1) => new Promise(async (r, n) => {
1526
1526
  let i = null;
1527
1527
  try {
1528
- let a = i = new Image();
1529
- a.src = e, a.addEventListener("load", function() {
1528
+ let o = i = new Image();
1529
+ o.src = e, o.addEventListener("load", function() {
1530
1530
  try {
1531
1531
  let l = document.createElement("canvas");
1532
- l.width = a.naturalWidth, l.height = a.naturalHeight;
1532
+ l.width = o.naturalWidth, l.height = o.naturalHeight;
1533
1533
  let s = l.getContext("2d");
1534
1534
  if (!s) throw Error("Unable to create 2d context");
1535
- s.drawImage(a, 0, 0);
1535
+ s.drawImage(o, 0, 0);
1536
1536
  let c = l.toDataURL("image/png", t);
1537
1537
  r({
1538
- elemImg: a,
1538
+ elemImg: o,
1539
1539
  dataUrl: c
1540
1540
  });
1541
1541
  } catch (l) {
1542
1542
  URL.revokeObjectURL(e), n(l);
1543
1543
  }
1544
- }, { once: !0 }), a.addEventListener("error", function() {
1544
+ }, { once: !0 }), o.addEventListener("error", function() {
1545
1545
  URL.revokeObjectURL(e), n("Invalid Image");
1546
- }, { once: !0 }), await a.decode();
1546
+ }, { once: !0 }), await o.decode();
1547
1547
  } catch {
1548
1548
  i?.src && URL.revokeObjectURL(i.src);
1549
1549
  }
@@ -1557,9 +1557,9 @@ var Br = "data:image/png;base64,", jr = "Unable to resolve image.", Rt = (e) =>
1557
1557
  if (i === 1229209940) return null;
1558
1558
  if (i === 1883789683) {
1559
1559
  if (n !== 9 || r + 17 > t.byteLength) return null;
1560
- let a = t.getUint32(r + 8), l = t.getUint32(r + 12);
1561
- return t.getUint8(r + 16) === 1 && a && l ? {
1562
- width: Math.max(1, Math.round(t.getUint32(16) * Nt / a)),
1560
+ let o = t.getUint32(r + 8), l = t.getUint32(r + 12);
1561
+ return t.getUint8(r + 16) === 1 && o && l ? {
1562
+ width: Math.max(1, Math.round(t.getUint32(16) * Nt / o)),
1563
1563
  height: Math.max(1, Math.round(t.getUint32(20) * Nt / l))
1564
1564
  } : null;
1565
1565
  }
@@ -1569,21 +1569,21 @@ var Br = "data:image/png;base64,", jr = "Unable to resolve image.", Rt = (e) =>
1569
1569
  }, nt = "image/svg+xml", ki = async (e, t = null) => {
1570
1570
  let r = null, n = async () => {
1571
1571
  try {
1572
- let a = t ?? "image/*", l = URL.createObjectURL(new Blob([e], { type: a }));
1572
+ let o = t ?? "image/*", l = URL.createObjectURL(new Blob([e], { type: o }));
1573
1573
  r = {
1574
- mimeType: a,
1574
+ mimeType: o,
1575
1575
  naturalSize: await Rt(l),
1576
1576
  asUrl: l
1577
1577
  };
1578
1578
  } catch {}
1579
1579
  }, i = async () => {
1580
1580
  try {
1581
- let a = new TextDecoder().decode(e), l = URL.createObjectURL(new Blob([a], { type: nt })), s = await Rt(l);
1581
+ let o = new TextDecoder().decode(e), l = URL.createObjectURL(new Blob([o], { type: nt })), s = await Rt(l);
1582
1582
  r = {
1583
1583
  mimeType: t ?? nt,
1584
1584
  naturalSize: s,
1585
1585
  asUrl: l,
1586
- asSVGText: a
1586
+ asSVGText: o
1587
1587
  };
1588
1588
  } catch {}
1589
1589
  };
@@ -1594,37 +1594,37 @@ var Br = "data:image/png;base64,", jr = "Unable to resolve image.", Rt = (e) =>
1594
1594
  };
1595
1595
  (function(e) {
1596
1596
  e.PassThrough = Object.freeze({});
1597
- let t = e.resolveTypedUpdates = (r, n, i, a, l = !1) => {
1597
+ let t = e.resolveTypedUpdates = (r, n, i, o, l = !1) => {
1598
1598
  if (r === null) return r;
1599
- if (r === void 0) return a;
1599
+ if (r === void 0) return o;
1600
1600
  let s = r;
1601
1601
  if (n?.shorthand) {
1602
- let o = n?.shorthand(r, i);
1603
- o !== void 0 && (s = o);
1602
+ let a = n?.shorthand(r, i);
1603
+ a !== void 0 && (s = a);
1604
1604
  }
1605
1605
  if (s !== null && n?.getSubType) {
1606
- let o = n.getSubType(s, a);
1607
- o && (n = o);
1606
+ let a = n.getSubType(s, o);
1607
+ a && (n = a);
1608
1608
  }
1609
1609
  let c = n?.properties, d = n?.arrayType ?? !1, m = s;
1610
- if (n && n.merge && m && a) m = n.merge(m, a, i);
1610
+ if (n && n.merge && m && o) m = n.merge(m, o, i);
1611
1611
  else if (!d && c) {
1612
- let o = Object.keys({
1612
+ let a = Object.keys({
1613
1613
  ...s,
1614
- ...a
1614
+ ...o
1615
1615
  });
1616
1616
  m = null;
1617
- let f = o.length;
1617
+ let f = a.length;
1618
1618
  for (let b = 0; b < f; b++) {
1619
- let S = o[b], A, L = s?.[S];
1619
+ let S = a[b], A, L = s?.[S];
1620
1620
  if (L !== void 0) {
1621
1621
  let h = c[S];
1622
1622
  if (!h) {
1623
1623
  Mi(S);
1624
1624
  continue;
1625
1625
  }
1626
- A = t(L, h, i, a?.[S], l);
1627
- } else A = a?.[S];
1626
+ A = t(L, h, i, o?.[S], l);
1627
+ } else A = o?.[S];
1628
1628
  A == null ? l && L === null && (m ??= {}, m[S] = null) : (m ??= {}, m[S] = A);
1629
1629
  }
1630
1630
  }
@@ -1650,7 +1650,7 @@ All copy and paste operations will be limited to the browser tab.\`
1650
1650
  document.hasFocus() ? e() : globalThis.addEventListener?.("focus", () => {
1651
1651
  e();
1652
1652
  }, { once: !0 }), document.activeElement.focus?.();
1653
- }), at = async (e, t, r) => {
1653
+ }), ot = async (e, t, r) => {
1654
1654
  if (qe() === pe.Safari) return await r(Error(St.message));
1655
1655
  try {
1656
1656
  let n = async (l) => {
@@ -1664,8 +1664,8 @@ All copy and paste operations will be limited to the browser tab.\`
1664
1664
  name: e,
1665
1665
  allowWithoutGesture: !0,
1666
1666
  allowWithoutSanitization: !0
1667
- }), a = !1;
1668
- if (i.state === "prompt" && (a = await n(t)), a || i.state !== "granted" || (a = await t()), !a) return await r(Error(i.state));
1667
+ }), o = !1;
1668
+ if (i.state === "prompt" && (o = await n(t)), o || i.state !== "granted" || (o = await t()), !o) return await r(Error(i.state));
1669
1669
  } catch (n) {
1670
1670
  return n.message === "No valid data on clipboard" || n.name === "DataError" ? void 0 : await r(n);
1671
1671
  }
@@ -1686,12 +1686,12 @@ if (!globalThis.ClipboardItem) {
1686
1686
  class t {
1687
1687
  constructor(n, i) {
1688
1688
  this._items = {}, this._types = Object.keys(n);
1689
- let a = {}, l = Object.keys(n);
1689
+ let o = {}, l = Object.keys(n);
1690
1690
  for (let s = 0; s < l.length; s++) {
1691
1691
  let c = l[s], d = n[c];
1692
- a[c] = typeof d == "string" ? e(c, d) : d;
1692
+ o[c] = typeof d == "string" ? e(c, d) : d;
1693
1693
  }
1694
- this._items = a, this._presentationStyle = i?.presentationStyle ?? "unspecified";
1694
+ this._items = o, this._presentationStyle = i?.presentationStyle ?? "unspecified";
1695
1695
  }
1696
1696
  get types() {
1697
1697
  return this._types;
@@ -1709,12 +1709,12 @@ var Mt, mt = async (e, t = J.Html) => new Promise(async (r, n) => {
1709
1709
  try {
1710
1710
  let i = await Di(e, t);
1711
1711
  if (i) {
1712
- let a = new FileReader();
1713
- a.onload = () => {
1714
- r(a.result);
1715
- }, a.onerror = () => {
1712
+ let o = new FileReader();
1713
+ o.onload = () => {
1714
+ r(o.result);
1715
+ }, o.onerror = () => {
1716
1716
  r("");
1717
- }, a.readAsText(i);
1717
+ }, o.readAsText(i);
1718
1718
  } else r("");
1719
1719
  } catch (i) {
1720
1720
  n(i);
@@ -1761,7 +1761,7 @@ var Mt, mt = async (e, t = J.Html) => new Promise(async (r, n) => {
1761
1761
  this._disableCheckOnFocus = e?.disableCheckOnFocus ?? !1, this._init();
1762
1762
  }
1763
1763
  async _checkForChanges() {
1764
- this._nativeClipboard && this._state && !this._disableCheckOnFocus && await at("clipboard-read", async () => {
1764
+ this._nativeClipboard && this._state && !this._disableCheckOnFocus && await ot("clipboard-read", async () => {
1765
1765
  await it();
1766
1766
  let e = await mt(this._nativeClipboard, Me);
1767
1767
  if (!this._state || e && e === this._state.uuid) return !0;
@@ -1784,7 +1784,7 @@ var Mt, mt = async (e, t = J.Html) => new Promise(async (r, n) => {
1784
1784
  async read() {
1785
1785
  if (!this._nativeClipboard) return this._state?.items ?? null;
1786
1786
  let e = this;
1787
- return await at("clipboard-read", async () => {
1787
+ return await ot("clipboard-read", async () => {
1788
1788
  if (await it(), this._state?.uuid) {
1789
1789
  let t = await mt(this._nativeClipboard, Me);
1790
1790
  if (t && t === e._state?.uuid) return !0;
@@ -1809,14 +1809,14 @@ var Mt, mt = async (e, t = J.Html) => new Promise(async (r, n) => {
1809
1809
  }
1810
1810
  async _write(e) {
1811
1811
  if (!this._nativeClipboard) return this._state = e, this.dispatchEvent(new Event("clipboardwrite")), void this.dispatchEvent(new Event("clipboardchange"));
1812
- let t = this, r = [], n = e.uuid, i = e.items ?? [], a = () => {
1812
+ let t = this, r = [], n = e.uuid, i = e.items ?? [], o = () => {
1813
1813
  t._state = {
1814
1814
  uuid: n,
1815
1815
  ref: e.ref,
1816
1816
  items: r
1817
1817
  }, t.dispatchEvent(new Event("clipboardwrite")), t.dispatchEvent(new Event("clipboardchange"));
1818
1818
  };
1819
- await at("clipboard-write", async () => {
1819
+ await ot("clipboard-write", async () => {
1820
1820
  await it(), n && i.length === 0 && (i.push(new ClipboardItem({ [Me]: new Blob([n], Pt) })), i.push(new ClipboardItem({ [J.Html]: new Blob([Dt(n)], Ut) })));
1821
1821
  for (let l = 0; l < Math.min(1, i.length); l++) {
1822
1822
  let s = i[l], c = s.types.indexOf(J.Html), d = null;
@@ -1832,21 +1832,21 @@ var Mt, mt = async (e, t = J.Html) => new Promise(async (r, n) => {
1832
1832
  d = \`<div \${Pe}="\${n}"><img src="\${Br + S}"/></div>\`;
1833
1833
  }
1834
1834
  !d && n && (d = Dt(n));
1835
- let m = new Blob([d ?? ""], Ut), o = {}, f = s.types, b = f.length;
1835
+ let m = new Blob([d ?? ""], Ut), a = {}, f = s.types, b = f.length;
1836
1836
  for (let S = 0; S < b; S++) {
1837
1837
  let A = f[S];
1838
- o[A] = S === c ? m : s.getType(A);
1838
+ a[A] = S === c ? m : s.getType(A);
1839
1839
  }
1840
- d && c === -1 && (o[J.Html] = m), n && (o[Me] = new Blob([n], Pt)), r.push(new ClipboardItem(o));
1840
+ d && c === -1 && (a[J.Html] = m), n && (a[Me] = new Blob([n], Pt)), r.push(new ClipboardItem(a));
1841
1841
  }
1842
1842
  try {
1843
1843
  r && r.length !== 0 ? await this._nativeClipboard.write(r) : await Fi(this._nativeClipboard);
1844
1844
  } catch (l) {
1845
1845
  l.message?.includes("Document is not focused") || console.warn("Unable to write to native clipboard: ", l);
1846
1846
  }
1847
- return a(), !0;
1847
+ return o(), !0;
1848
1848
  }, async (l) => {
1849
- this.dispatchEvent(new Event("clipboarderrorwrite")), a();
1849
+ this.dispatchEvent(new Event("clipboarderrorwrite")), o();
1850
1850
  });
1851
1851
  }
1852
1852
  async writeReference(e) {
@@ -1896,10 +1896,10 @@ var Mt, mt = async (e, t = J.Html) => new Promise(async (r, n) => {
1896
1896
  s.types.includes(J.Plain) && (n = await s.getType(J.Plain));
1897
1897
  }
1898
1898
  if (!n) return void e("");
1899
- let a = new FileReader();
1900
- a.onload = () => {
1901
- e(a.result);
1902
- }, a.readAsText(n), a.onerror = (l) => {
1899
+ let o = new FileReader();
1900
+ o.onload = () => {
1901
+ e(o.result);
1902
+ }, o.readAsText(n), o.onerror = (l) => {
1903
1903
  t(l);
1904
1904
  };
1905
1905
  });
@@ -1920,9 +1920,9 @@ var Mt, mt = async (e, t = J.Html) => new Promise(async (r, n) => {
1920
1920
  if (!e) return !1;
1921
1921
  let t = (r) => {
1922
1922
  let n = r.get(e.type);
1923
- n && n.forEach((i, a) => {
1923
+ n && n.forEach((i, o) => {
1924
1924
  try {
1925
- typeof a == "function" ? a(e) : a.handleEvent && a.handleEvent(e), i.once && n.delete(a);
1925
+ typeof o == "function" ? o(e) : o.handleEvent && o.handleEvent(e), i.once && n.delete(o);
1926
1926
  } catch (l) {
1927
1927
  console.warn(l);
1928
1928
  }
@@ -2032,13 +2032,13 @@ var Gi;
2032
2032
  e.truncateNumberText = function(n) {
2033
2033
  let i = n.length;
2034
2034
  if (i <= t) return n;
2035
- let a = 0, l = null;
2035
+ let o = 0, l = null;
2036
2036
  for (let s = 0; s < i; s++) {
2037
2037
  let c = n.charCodeAt(s);
2038
2038
  if (c >= 48 && c <= 57) {
2039
- if (a === 0 && c === 48) continue;
2040
- a++, a > t && ((l ??= n.split(""))[s] = "0");
2041
- } else if ((c === 69 || c === 101) && a > 0) break;
2039
+ if (o === 0 && c === 48) continue;
2040
+ o++, o > t && ((l ??= n.split(""))[s] = "0");
2041
+ } else if ((c === 69 || c === 101) && o > 0) break;
2042
2042
  }
2043
2043
  return l === null ? n : l.join("");
2044
2044
  };
@@ -2046,21 +2046,21 @@ var Gi;
2046
2046
  e.flushSubnormal = function(n) {
2047
2047
  return n > -r && n < r ? 0 : n;
2048
2048
  }, e.isNumberTextInRange = function(n, i = ".") {
2049
- let a = n.length;
2050
- if (a < 309 && n.indexOf("E") < 0 && n.indexOf("e") < 0) return !0;
2051
- let l = i.charCodeAt(0), s = !1, c = !1, d = !1, m = 0, o = 0, f = 0, b = 0;
2052
- for (; b < a; b++) {
2049
+ let o = n.length;
2050
+ if (o < 309 && n.indexOf("E") < 0 && n.indexOf("e") < 0) return !0;
2051
+ let l = i.charCodeAt(0), s = !1, c = !1, d = !1, m = 0, a = 0, f = 0, b = 0;
2052
+ for (; b < o; b++) {
2053
2053
  let L = n.charCodeAt(b);
2054
- if (L >= 48 && L <= 57) s = !0, c ? (f++, d || (L === 48 ? o++ : d = !0)) : (d || L !== 48) && (d = !0, m++);
2054
+ if (L >= 48 && L <= 57) s = !0, c ? (f++, d || (L === 48 ? a++ : d = !0)) : (d || L !== 48) && (d = !0, m++);
2055
2055
  else if (L === l) c = !0;
2056
2056
  else if ((L === 69 || L === 101) && s) break;
2057
2057
  }
2058
2058
  let S = 0;
2059
- if (b < a) {
2059
+ if (b < o) {
2060
2060
  let L = b + 1, h = !1, y = n.charCodeAt(L);
2061
2061
  y === 45 ? (h = !0, L++) : y === 43 && L++;
2062
2062
  let w = 0;
2063
- for (; L < a; L++) {
2063
+ for (; L < o; L++) {
2064
2064
  let D = n.charCodeAt(L);
2065
2065
  if (D < 48 || D > 57) break;
2066
2066
  S = 10 * S + (D - 48), w++;
@@ -2069,14 +2069,14 @@ var Gi;
2069
2069
  h && (S = -S);
2070
2070
  }
2071
2071
  if (d) {
2072
- let L = (m > 0 ? m - 1 : -(o + 1)) + S;
2072
+ let L = (m > 0 ? m - 1 : -(a + 1)) + S;
2073
2073
  return L >= -309 && L <= 307;
2074
2074
  }
2075
2075
  let A = S - f;
2076
2076
  return A >= -308 && A <= 308;
2077
2077
  };
2078
2078
  })(Gi ||= {});
2079
- var Gt, ot, Hi, T, me = {
2079
+ var Gt, at, Hi, T, me = {
2080
2080
  Number: "number",
2081
2081
  String: "string",
2082
2082
  Boolean: "boolean",
@@ -2093,13 +2093,13 @@ var Gt, ot, Hi, T, me = {
2093
2093
  Lambda: "lambda",
2094
2094
  Omitted: "omitted"
2095
2095
  };
2096
- (ot = Gt ||= {}).Axis = {
2096
+ (at = Gt ||= {}).Axis = {
2097
2097
  Column: "column",
2098
2098
  Row: "row"
2099
- }, ot.AxisSelection = {
2099
+ }, at.AxisSelection = {
2100
2100
  ...Gt.Axis,
2101
2101
  Both: "both"
2102
- }, ot.Direction = {
2102
+ }, at.Direction = {
2103
2103
  Up: "up",
2104
2104
  Down: "down",
2105
2105
  Left: "left",
@@ -2200,7 +2200,7 @@ var Gt, ot, Hi, T, me = {
2200
2200
  }
2201
2201
  }
2202
2202
  e.Parse = i;
2203
- class a extends n {
2203
+ class o extends n {
2204
2204
  constructor(R, F) {
2205
2205
  super(t.Null, r.Null, R, F);
2206
2206
  }
@@ -2208,7 +2208,7 @@ var Gt, ot, Hi, T, me = {
2208
2208
  this.code = T.Code.Null;
2209
2209
  }
2210
2210
  }
2211
- e.Null = a;
2211
+ e.Null = o;
2212
2212
  class l extends n {
2213
2213
  constructor(R, F) {
2214
2214
  super(t.Div0, r.Div0, R, F);
@@ -2254,7 +2254,7 @@ var Gt, ot, Hi, T, me = {
2254
2254
  }
2255
2255
  }
2256
2256
  e.Num = m;
2257
- class o extends n {
2257
+ class a extends n {
2258
2258
  constructor(R, F) {
2259
2259
  super(t.NA, r.NA, R, F);
2260
2260
  }
@@ -2262,7 +2262,7 @@ var Gt, ot, Hi, T, me = {
2262
2262
  this.code = T.Code.NA;
2263
2263
  }
2264
2264
  }
2265
- e.NA = o;
2265
+ e.NA = a;
2266
2266
  class f extends n {
2267
2267
  constructor(R, F) {
2268
2268
  super(t.GettingData, r.GettingData, R, F);
@@ -2383,42 +2383,42 @@ for (let e = 0; e < Jt.length; e++) {
2383
2383
  Python: t(T.Code.Python),
2384
2384
  Timeout: t(T.Code.Timeout)
2385
2385
  }, e.newTypedError = (r, n, i) => {
2386
- let a;
2387
- return a = typeof r == "string" ? Wr.get(r) : Jr.get(r), a ||= T.Unknown, new a(n, i);
2386
+ let o;
2387
+ return o = typeof r == "string" ? Wr.get(r) : Jr.get(r), o ||= T.Unknown, new o(n, i);
2388
2388
  }, e.getBuiltInByLabel = (r) => Gr.get(r), e.isError = function(r, n) {
2389
2389
  return !!r && r.isFormulaError === !0 && (n === void 0 || r.getCode() === n);
2390
2390
  };
2391
2391
  })(T ||= {});
2392
2392
  var Wi = class {
2393
2393
  createRange(e, t, r) {
2394
- throw le("createRange");
2394
+ throw oe("createRange");
2395
2395
  }
2396
2396
  flattenAreas(e) {
2397
- throw le("flattenAreas");
2397
+ throw oe("flattenAreas");
2398
2398
  }
2399
2399
  getReference(e, t) {
2400
- throw le("getReference");
2400
+ throw oe("getReference");
2401
2401
  }
2402
2402
  getResizedReference(e, t, r) {
2403
- throw le("getResizedReference");
2403
+ throw oe("getResizedReference");
2404
2404
  }
2405
2405
  getNumberFormat(e, t) {
2406
- throw le("getNumberFormat");
2406
+ throw oe("getNumberFormat");
2407
2407
  }
2408
2408
  fromSerialDate(e, t) {
2409
- throw le("fromSerialDate");
2409
+ throw oe("fromSerialDate");
2410
2410
  }
2411
2411
  toSerialDate(e, t) {
2412
- throw le("toSerialDate");
2412
+ throw oe("toSerialDate");
2413
2413
  }
2414
2414
  getDateParts(e, t) {
2415
- throw le("getDateParts");
2415
+ throw oe("getDateParts");
2416
2416
  }
2417
- getSerialDate(e, t, r, n, i, a, l) {
2418
- throw le("getSerialDate");
2417
+ getSerialDate(e, t, r, n, i, o, l) {
2418
+ throw oe("getSerialDate");
2419
2419
  }
2420
2420
  getNow() {
2421
- throw le("getNow");
2421
+ throw oe("getNow");
2422
2422
  }
2423
2423
  getRandom() {
2424
2424
  return Math.random();
@@ -2465,22 +2465,25 @@ var Wi = class {
2465
2465
  return null;
2466
2466
  }
2467
2467
  getAddress(e, t) {
2468
- throw le("getAddress");
2468
+ throw oe("getAddress");
2469
2469
  }
2470
2470
  parseAsSerialDate(e, t) {
2471
- throw le("parseAsSerialDate");
2471
+ throw oe("parseAsSerialDate");
2472
2472
  }
2473
2473
  parseAsDate(e, t) {
2474
- throw le("parseAsDate");
2474
+ throw oe("parseAsDate");
2475
2475
  }
2476
2476
  parseAsNumber(e, t) {
2477
- throw le("parseAsNumber");
2477
+ throw oe("parseAsNumber");
2478
2478
  }
2479
- createCriteria(e, t) {
2480
- throw le("createCriteria");
2479
+ createCriteria(e) {
2480
+ throw oe("createCriteria");
2481
+ }
2482
+ dbQuery(e, t) {
2483
+ throw oe("dbQuery");
2481
2484
  }
2482
2485
  createPivot(e, t, r) {
2483
- throw le("createPivot");
2486
+ throw oe("createPivot");
2484
2487
  }
2485
2488
  getPivotAt(e) {
2486
2489
  return null;
@@ -2489,7 +2492,7 @@ var Wi = class {
2489
2492
  let t = e.toUpperCase();
2490
2493
  return t === "TRUE" || t !== "FALSE" && T.getBuiltInByLabel(t);
2491
2494
  }
2492
- toText(e) {
2495
+ toText(e, t) {
2493
2496
  return typeof e == "string" ? e : e == null ? "" : typeof e == "boolean" ? e ? "TRUE" : "FALSE" : e?.isFormulaError ? e.getLabel() : String(e);
2494
2497
  }
2495
2498
  compare(e, t, r) {
@@ -2514,7 +2517,7 @@ var Wi = class {
2514
2517
  case "boolean": return 3;
2515
2518
  default: return 4;
2516
2519
  }
2517
- }, le = (e) => new Je(\`FormulaContext.\${e}() is only valid while a function body is running. A deferred executor reads its workbook through ctx.getFormulaContext().\`), Yr = "FormulaContext.getArgs() is only valid while a function body is running", Ji = "FormulaContext.createRichData() needs a workbook being calculated", Je = class extends Error {
2520
+ }, oe = (e) => new Je(\`FormulaContext.\${e}() is only valid while a function body is running. A deferred executor reads its workbook through ctx.getFormulaContext().\`), Yr = "FormulaContext.getArgs() is only valid while a function body is running", Ji = "FormulaContext.createRichData() needs a workbook being calculated", Je = class extends Error {
2518
2521
  constructor(e = "Not implemented in StubbedFormulaContext") {
2519
2522
  super(e), this.name = "NotImplementedError";
2520
2523
  }
@@ -2528,6 +2531,7 @@ var Wi = class {
2528
2531
  getLocale: () => qt.tag,
2529
2532
  getLocaleProfile: () => qt,
2530
2533
  isR1C1: () => !1,
2534
+ getCompatibilityVersion: () => 2,
2531
2535
  getNow: () => 0,
2532
2536
  getRandom: () => Math.random(),
2533
2537
  getLocation: () => "unknown",
@@ -2535,12 +2539,12 @@ var Wi = class {
2535
2539
  getOS: () => "unknown",
2536
2540
  getUser: () => "unidentified",
2537
2541
  getDescription: () => "Stubbed Formula Context"
2538
- }, qi = 2958465, Le = new Wi(), Zi = class {
2542
+ }, qi = 2958465, _e = new Wi(), Qi = class {
2539
2543
  constructor() {
2540
- this._scope = Le, this._argsFn = null;
2544
+ this._scope = _e, this._argsFn = null;
2541
2545
  }
2542
2546
  _setScope(e) {
2543
- this._scope = e ?? Le;
2547
+ this._scope = e ?? _e;
2544
2548
  }
2545
2549
  _getScope() {
2546
2550
  return this._scope;
@@ -2563,8 +2567,12 @@ var Wi = class {
2563
2567
  parseAsNumber(e, t) {
2564
2568
  return this._getScope().parseAsNumber(e, t);
2565
2569
  }
2566
- createCriteria(e, t) {
2567
- return this._getScope().createCriteria(e, t);
2570
+ createCriteria(e) {
2571
+ return this._getScope().createCriteria(e);
2572
+ }
2573
+ dbQuery(e, t) {
2574
+ let r = this._getScope();
2575
+ return r.dbQuery ? r.dbQuery(e, t) : _e.dbQuery(e, t);
2568
2576
  }
2569
2577
  createPivot(e, t, r) {
2570
2578
  return this._getScope().createPivot(e, t, r);
@@ -2574,10 +2582,10 @@ var Wi = class {
2574
2582
  }
2575
2583
  parseAsLiteral(e) {
2576
2584
  let t = this._getScope();
2577
- return t.parseAsLiteral ? t.parseAsLiteral(e) : Le.parseAsLiteral(e);
2585
+ return t.parseAsLiteral ? t.parseAsLiteral(e) : _e.parseAsLiteral(e);
2578
2586
  }
2579
- toText(e) {
2580
- return this._getScope().toText(e);
2587
+ toText(e, t) {
2588
+ return this._getScope().toText(e, t);
2581
2589
  }
2582
2590
  isValidDate(e, t = !1) {
2583
2591
  return this._getScope().isValidDate(e, t);
@@ -2591,8 +2599,8 @@ var Wi = class {
2591
2599
  getDateParts(e, t) {
2592
2600
  return this._getScope().getDateParts(e, t);
2593
2601
  }
2594
- getSerialDate(e, t, r, n = 0, i = 0, a = 0, l = 0) {
2595
- return this._getScope().getSerialDate(e, t, r, n, i, a, l);
2602
+ getSerialDate(e, t, r, n = 0, i = 0, o = 0, l = 0) {
2603
+ return this._getScope().getSerialDate(e, t, r, n, i, o, l);
2596
2604
  }
2597
2605
  getNow() {
2598
2606
  return this._getScope().getNow();
@@ -2607,8 +2615,8 @@ var Wi = class {
2607
2615
  if (!Array.isArray(e)) return e;
2608
2616
  let t = [];
2609
2617
  for (let r = 0; r < e.length; r++) {
2610
- let n = e[r], { rows: i, columns: a } = n.getShape();
2611
- for (let l = 0; l < i; l++) for (let s = 0; s < a; s++) t.push(n.getValueAt(l, s));
2618
+ let n = e[r], { rows: i, columns: o } = n.getShape();
2619
+ for (let l = 0; l < i; l++) for (let s = 0; s < o; s++) t.push(n.getValueAt(l, s));
2612
2620
  }
2613
2621
  return this.createRange(t.length, 1, (r, n) => t[n.rowIndex]);
2614
2622
  }
@@ -2661,14 +2669,14 @@ var Wi = class {
2661
2669
  return this._getScope().getAddress(e, t);
2662
2670
  }
2663
2671
  compare(e, t, r) {
2664
- return this._getScope().compare?.(e, t, r) ?? Le.compare(e, t, r);
2672
+ return this._getScope().compare?.(e, t, r) ?? _e.compare(e, t, r);
2665
2673
  }
2666
2674
  getRuntime() {
2667
2675
  return this._getScope().getRuntime();
2668
2676
  }
2669
2677
  createRichData(e, t) {
2670
2678
  let r = this._getScope();
2671
- return r.createRichData ? r.createRichData(e, t) : Le.createRichData(e, t);
2679
+ return r.createRichData ? r.createRichData(e, t) : _e.createRichData(e, t);
2672
2680
  }
2673
2681
  getArgs() {
2674
2682
  let e = this._argsFn, t = e ? e() : null;
@@ -2762,8 +2770,8 @@ var Wi = class {
2762
2770
  numeric: !0
2763
2771
  })
2764
2772
  });
2765
- new Zi();
2766
- const Qi = [
2773
+ new Qi();
2774
+ const Zi = [
2767
2775
  {
2768
2776
  name: "param",
2769
2777
  group: "jsdoc",
@@ -2821,57 +2829,57 @@ const Qi = [
2821
2829
  group: "jsdoc",
2822
2830
  description: "Reference a related function or link."
2823
2831
  }
2824
- ], ea = (() => {
2832
+ ], eo = (() => {
2825
2833
  const e = /* @__PURE__ */ new Map();
2826
- for (const t of Qi) if (e.set(t.name, t), t.aliases) for (const r of t.aliases) e.set(r, t);
2834
+ for (const t of Zi) if (e.set(t.name, t), t.aliases) for (const r of t.aliases) e.set(r, t);
2827
2835
  return e;
2828
2836
  })();
2829
- function ta(e) {
2837
+ function to(e) {
2830
2838
  if (!e) return;
2831
2839
  const t = (e.startsWith("@") ? e.slice(1) : e).toLowerCase();
2832
- return ea.get(t);
2840
+ return eo.get(t);
2833
2841
  }
2834
- function ra(e) {
2835
- return ta(e)?.standalone === !0;
2842
+ function ro(e) {
2843
+ return to(e)?.standalone === !0;
2836
2844
  }
2837
2845
  const ht = /* @__PURE__ */ new Map([["IReferenceRange", "p"], ["IRange", "r"]]), lt = new Set(Object.values(Wt).filter((e) => e !== Wt.Omitted)), bt = /* @__PURE__ */ new Map([
2838
2846
  ["IWorkbook", "workbook"],
2839
2847
  ["IWorksheet", "sheet"],
2840
2848
  ["ICellRanges", "ranges"],
2841
2849
  ["ICellRange", "range"]
2842
- ]), na = Array.from(bt.keys()), vt = (e, t) => {
2850
+ ]), no = Array.from(bt.keys()), vt = (e, t) => {
2843
2851
  Array.from(t.keys()).forEach((r) => {
2844
2852
  const n = t.get(r);
2845
2853
  t.set(\`\${e}.\${r}\`, n);
2846
2854
  });
2847
- }, ia = /* @__PURE__ */ new Map([
2855
+ }, io = /* @__PURE__ */ new Map([
2848
2856
  ["Scalar", "*"],
2849
2857
  ["Lambda", "l"],
2850
2858
  ["FormulaError.Known", me.Error],
2851
2859
  ["Date", Ht.Date],
2852
2860
  ["IRichData", Ht.RichData]
2853
- ]), Zr = /* @__PURE__ */ new Map([["Repeating", "repeating"]]), aa = /* @__PURE__ */ new Set(["Flatten", "SheetXL.Flatten"]), Qr = /* @__PURE__ */ new Set(["AcceptError"]), en = /* @__PURE__ */ new Set(["Omittable"]), tn = /* @__PURE__ */ new Set(["NoLift"]), rn = /* @__PURE__ */ new Set(["NoFilter"]), nn = /* @__PURE__ */ new Set(["Lazy"]), gt = /* @__PURE__ */ new Set(["ReportType"]), Zt = 255, oa = /^[a-zA-Z_-￿][a-zA-Z0-9_.-￿]*$/, la = /^([a-z]{1,3})([0-9]+)$/i, sa = /^r[0-9]*c[0-9]*$/i, ca = (e) => {
2854
- if (sa.test(e)) return !0;
2855
- const t = la.exec(e);
2861
+ ]), Qr = /* @__PURE__ */ new Map([["Repeating", "repeating"]]), oo = /* @__PURE__ */ new Set(["Flatten", "SheetXL.Flatten"]), Zr = /* @__PURE__ */ new Set(["AcceptError"]), en = /* @__PURE__ */ new Set(["Omittable"]), tn = /* @__PURE__ */ new Set(["NoLift"]), rn = /* @__PURE__ */ new Set(["NoFilter"]), nn = /* @__PURE__ */ new Set(["Lazy"]), gt = /* @__PURE__ */ new Set(["ReportType"]), Qt = 255, ao = /^[a-zA-Z_-￿][a-zA-Z0-9_.-￿]*$/, lo = /^([a-z]{1,3})([0-9]+)$/i, so = /^r[0-9]*c[0-9]*$/i, co = (e) => {
2862
+ if (so.test(e)) return !0;
2863
+ const t = lo.exec(e);
2856
2864
  if (!t) return !1;
2857
2865
  let r = 0;
2858
2866
  for (const i of t[1].toUpperCase()) r = r * 26 + (i.charCodeAt(0) - 64);
2859
2867
  const n = Number(t[2]);
2860
2868
  return r <= 16384 && n >= 1 && n <= 1048576;
2861
- }, se = "SheetXL", _e = (e) => {
2869
+ }, se = "SheetXL", xe = (e) => {
2862
2870
  const t = e.typeName.getText();
2863
2871
  return t.startsWith(\`\${se}.\`) ? t.slice(8) : t;
2864
2872
  };
2865
2873
  vt(se, ht);
2866
2874
  vt(se, bt);
2867
- vt(se, Zr);
2868
- Qr.add(se + ".AcceptError");
2875
+ vt(se, Qr);
2876
+ Zr.add(se + ".AcceptError");
2869
2877
  en.add(\`\${se}.Omittable\`);
2870
2878
  tn.add(\`\${se}.NoLift\`);
2871
2879
  rn.add(\`\${se}.NoFilter\`);
2872
2880
  nn.add(\`\${se}.Lazy\`);
2873
2881
  gt.add(\`\${se}.ReportType\`);
2874
- const ua = /* @__PURE__ */ new Map([["Volatile", () => ({ volatile: !0 })], [\`\${se}.Volatile\`, () => ({ volatile: !0 })]]), Qt = "__scriptContext__", er = "script", da = /* @__PURE__ */ new Set([
2882
+ const uo = /* @__PURE__ */ new Map([["Volatile", () => ({ volatile: !0 })], [\`\${se}.Volatile\`, () => ({ volatile: !0 })]]), Zt = "__scriptContext__", er = "script", fo = /* @__PURE__ */ new Set([
2875
2883
  "IScript.ScriptContext",
2876
2884
  \`\${se}.IScript.ScriptContext\`,
2877
2885
  "ScriptContext"
@@ -2895,8 +2903,8 @@ const ua = /* @__PURE__ */ new Map([["Volatile", () => ({ volatile: !0 })], [\`\
2895
2903
  const n = e[r], i = n.kind;
2896
2904
  if (i !== "link") {
2897
2905
  if (i === "linkName") {
2898
- const a = e[r + 1];
2899
- if (a?.kind === "linkText" && a.text.trim()) continue;
2906
+ const o = e[r + 1];
2907
+ if (o?.kind === "linkText" && o.text.trim()) continue;
2900
2908
  t += n.text;
2901
2909
  continue;
2902
2910
  }
@@ -2912,8 +2920,8 @@ const ua = /* @__PURE__ */ new Map([["Volatile", () => ({ volatile: !0 })], [\`\
2912
2920
  \`).map((n) => n.trim()).filter(Boolean).join(" ")).filter(Boolean).join(\`
2913
2921
  \`).trim();
2914
2922
  };
2915
- function fa(e, t, r, n) {
2916
- const i = n?.builtInNames?.length ? new Set(n.builtInNames.map((u) => u.toUpperCase())) : null, a = [], l = /* @__PURE__ */ new Map(), s = [];
2923
+ function po(e, t, r, n) {
2924
+ const i = n?.builtInNames?.length ? new Set(n.builtInNames.map((u) => u.toUpperCase())) : null, o = [], l = /* @__PURE__ */ new Map(), s = [];
2917
2925
  let c = null;
2918
2926
  const d = (u) => {
2919
2927
  if (!u || typeof u.getStart != "function") return {
@@ -2940,15 +2948,15 @@ function fa(e, t, r, n) {
2940
2948
  code: p,
2941
2949
  message: _
2942
2950
  });
2943
- }, o = (u, p, v) => {
2951
+ }, a = (u, p, v) => {
2944
2952
  m(u, p, "error", v);
2945
2953
  }, f = (u) => u?.parent?.name?.escapedText;
2946
2954
  let b = null;
2947
2955
  const S = (u, p, v, _, C = !1, M = !1, z = !1) => {
2948
2956
  const U = { count: 0 }, $ = te(u, p, v, _, U, C, M, z);
2949
- U.count >= 2 && (p.range || (p.range = "m", U.count -= 2), !_ && U.count >= 1 && (U.count -= 1, U.count > 0 && o(u, E.ArrayDepth, \`Arrays of more than 2 dimensions are not supported: '\${f(u)}'.\`))), U.count > 0 && (p.arrayDepth = U.count);
2957
+ U.count >= 2 && (p.range || (p.range = "m", U.count -= 2), !_ && U.count >= 1 && (U.count -= 1, U.count > 0 && a(u, E.ArrayDepth, \`Arrays of more than 2 dimensions are not supported: '\${f(u)}'.\`))), U.count > 0 && (p.arrayDepth = U.count);
2950
2958
  const B = p.enum;
2951
- return B && (U.count > (z ? 1 : 0) || p.range) && !K.has(p) && (p.valueOrRange || (o(u, E.EnumPosition, \`A list cannot hold the enum '\${B.id}': '\${p.name ?? f(u)}'. Its members reach the body as they are, so nothing checks them against the enum. Take one value per argument ('...x: \${B.id}[]'), or type the list by its scalar ('\${B.type}').\`), delete p.enum)), $;
2959
+ return B && (U.count > (z ? 1 : 0) || p.range) && !K.has(p) && (p.valueOrRange || (a(u, E.EnumPosition, \`A list cannot hold the enum '\${B.id}': '\${p.name ?? f(u)}'. Its members reach the body as they are, so nothing checks them against the enum. Take one value per argument ('...x: \${B.id}[]'), or type the list by its scalar ('\${B.type}').\`), delete p.enum)), $;
2952
2960
  }, A = (u, p, v, _, C) => {
2953
2961
  if (p !== "Lambda" && p !== \`\${se}.Lambda\`) return !1;
2954
2962
  const M = u.typeArguments;
@@ -2966,7 +2974,7 @@ function fa(e, t, r, n) {
2966
2974
  return v.lambda = z, !0;
2967
2975
  }, L = (u, p, v, _) => {
2968
2976
  if (!_) {
2969
- o(u, E.FunctionReturn, \`Function type is not a valid return type: '\${f(u)}'. Declare a 'Lambda' return instead.\`);
2977
+ a(u, E.FunctionReturn, \`Function type is not a valid return type: '\${f(u)}'. Declare a 'Lambda' return instead.\`);
2970
2978
  return;
2971
2979
  }
2972
2980
  const C = u.type, M = {};
@@ -2983,13 +2991,13 @@ function fa(e, t, r, n) {
2983
2991
  const v = e.isTypeReferenceNode(u) ? u.typeName : void 0, _ = v ? r.getSymbolAtLocation(v) : void 0, C = _?.declarations?.length ? _ : void 0;
2984
2992
  if (v) {
2985
2993
  if (C && C.flags & e.SymbolFlags.Alias) {
2986
- o(u, E.EnumNotLocal, \`'\${v.getText()}' is imported, so its declaration cannot be read: '\${p}'. An enum must be declared in the module that uses it.\`);
2994
+ a(u, E.EnumNotLocal, \`'\${v.getText()}' is imported, so its declaration cannot be read: '\${p}'. An enum must be declared in the module that uses it.\`);
2987
2995
  return;
2988
2996
  }
2989
2997
  if (!C || !(C.flags & e.SymbolFlags.Type)) {
2990
2998
  const x = v.getText();
2991
2999
  if (!(C ? (C.flags & e.SymbolFlags.Variable) !== 0 : t.statements.some((I) => e.isVariableStatement(I) && I.declarationList.declarations.some((V) => e.isIdentifier(V.name) && V.name.text === x)))) return null;
2992
- o(u, E.EnumMissingAlias, \`'\${x}' is a value, not a type: '\${p}'. Pair the object with a same-name type — 'type \${x} = typeof \${x}[keyof typeof \${x}];' — or declare it as 'enum \${x} { … }'.\`);
3000
+ a(u, E.EnumMissingAlias, \`'\${x}' is a value, not a type: '\${p}'. Pair the object with a same-name type — 'type \${x} = typeof \${x}[keyof typeof \${x}];' — or declare it as 'enum \${x} { … }'.\`);
2993
3001
  return;
2994
3002
  }
2995
3003
  const g = h.get(C);
@@ -3000,7 +3008,7 @@ function fa(e, t, r, n) {
3000
3008
  let z = !1;
3001
3009
  if (C && C.flags & e.SymbolFlags.Enum) {
3002
3010
  if (!C.declarations?.some(k)) {
3003
- o(u, E.EnumNotLocal, \`'\${C.name}' is not declared in this module: '\${p}'. An enum must be declared in the module that uses it.\`);
3011
+ a(u, E.EnumNotLocal, \`'\${C.name}' is not declared in this module: '\${p}'. An enum must be declared in the module that uses it.\`);
3004
3012
  return;
3005
3013
  }
3006
3014
  z = !0;
@@ -3010,7 +3018,7 @@ function fa(e, t, r, n) {
3010
3018
  if (!I || !e.isEnumMember(I)) return;
3011
3019
  const V = r.getConstantValue(I);
3012
3020
  if (V === void 0) {
3013
- o(I, E.EnumMemberNotConstant, \`'\${C.name}.\${x.name}' is not a constant number or string. A formula passes the VALUE, so every member needs one that can be read at compile time.\`), g = !0;
3021
+ a(I, E.EnumMemberNotConstant, \`'\${C.name}.\${x.name}' is not a constant number or string. A formula passes the VALUE, so every member needs one that can be read at compile time.\`), g = !0;
3014
3022
  return;
3015
3023
  }
3016
3024
  M.push([
@@ -3042,9 +3050,9 @@ function fa(e, t, r, n) {
3042
3050
  };
3043
3051
  V.sort((N, ne) => O(N) - O(ne));
3044
3052
  }
3045
- const Q = C && C.flags & e.SymbolFlags.Variable ? C.valueDeclaration : void 0, he = new Set(V);
3046
- if (C && Q && k(Q)) for (const P of r.getTypeOfSymbolAtLocation(C, Q).getProperties()) {
3047
- const O = P.valueDeclaration, N = r.getTypeOfSymbolAtLocation(P, O ?? Q);
3053
+ const Z = C && C.flags & e.SymbolFlags.Variable ? C.valueDeclaration : void 0, he = new Set(V);
3054
+ if (C && Z && k(Z)) for (const P of r.getTypeOfSymbolAtLocation(C, Z).getProperties()) {
3055
+ const O = P.valueDeclaration, N = r.getTypeOfSymbolAtLocation(P, O ?? Z);
3048
3056
  if (!(N.flags & (e.TypeFlags.NumberLiteral | e.TypeFlags.StringLiteral))) continue;
3049
3057
  const ne = N.value;
3050
3058
  V.includes(ne) && (z = !0, he.delete(ne), M.push([
@@ -3065,7 +3073,7 @@ function fa(e, t, r, n) {
3065
3073
  if (M.length === 0) return null;
3066
3074
  const U = typeof M[0][1] == "number";
3067
3075
  if (M.some(([, g]) => typeof g == "number" !== U)) {
3068
- o(u, E.EnumMixed, \`'\${C?.name ?? u.getText()}' mixes number and string members: '\${p}'. A parameter has one type, so an enum is all numbers or all strings.\`);
3076
+ a(u, E.EnumMixed, \`'\${C?.name ?? u.getText()}' mixes number and string members: '\${p}'. A parameter has one type, so an enum is all numbers or all strings.\`);
3069
3077
  return;
3070
3078
  }
3071
3079
  const $ = C ? R(C) : M.map(([, g]) => String(g)).join("|"), B = C ? void 0 : y.get($);
@@ -3073,8 +3081,8 @@ function fa(e, t, r, n) {
3073
3081
  if (z) {
3074
3082
  const g = /* @__PURE__ */ new Map();
3075
3083
  for (const [x, I, V, re] of M) {
3076
- const Y = V?.name?.getText() ?? x, Q = g.get(I);
3077
- Q !== void 0 ? m(V ?? u, E.EnumDuplicateValue, "warning", \`'\${$}.\${Y}' has the same value as '\${$}.\${Q}' (\${JSON.stringify(I)}). A formula passes the value, so the two cannot be told apart.\`) : g.set(I, Y), re === "" && m(V ?? u, E.EnumMemberUndocumented, "warning", \`'\${$}.\${Y}' is missing a description. Add a doc comment above the member — it is what the argument dropdown shows.\`);
3084
+ const Y = V?.name?.getText() ?? x, Z = g.get(I);
3085
+ Z !== void 0 ? m(V ?? u, E.EnumDuplicateValue, "warning", \`'\${$}.\${Y}' has the same value as '\${$}.\${Z}' (\${JSON.stringify(I)}). A formula passes the value, so the two cannot be told apart.\`) : g.set(I, Y), re === "" && m(V ?? u, E.EnumMemberUndocumented, "warning", \`'\${$}.\${Y}' is missing a description. Add a doc comment above the member — it is what the argument dropdown shows.\`);
3078
3086
  }
3079
3087
  }
3080
3088
  const G = {
@@ -3101,19 +3109,19 @@ function fa(e, t, r, n) {
3101
3109
  };
3102
3110
  if (u.kind !== e.SyntaxKind.TupleType) return [C(p, u, !1)];
3103
3111
  const M = u.elements;
3104
- if (M.length < 2) return o(u, E.RepeatingSlots, \`'\${p}': a repeating group of period \${M.length} must be spelled 'Repeating<T>' without the tuple.\`), null;
3112
+ if (M.length < 2) return a(u, E.RepeatingSlots, \`'\${p}': a repeating group of period \${M.length} must be spelled 'Repeating<T>' without the tuple.\`), null;
3105
3113
  const z = [];
3106
3114
  for (let U = 0; U < M.length; U++) {
3107
3115
  const $ = M[U];
3108
- if ($.kind !== e.SyntaxKind.NamedTupleMember) return o($, E.RepeatingSlots, \`'\${p}': every slot of a repeating group must be labelled, e.g. 'Repeating<[criteriaRange: IRange, criteria: Scalar]>'.\`), null;
3116
+ if ($.kind !== e.SyntaxKind.NamedTupleMember) return a($, E.RepeatingSlots, \`'\${p}': every slot of a repeating group must be labelled, e.g. 'Repeating<[criteriaRange: IRange, criteria: Scalar]>'.\`), null;
3109
3117
  const B = !!$.questionToken;
3110
- if (B && U !== M.length - 1) return o($, E.RepeatingOptional, \`'\${p}': only the LAST slot of a repeating group may be optional (slot '\${$.name?.getText?.()}' is not).\`), null;
3118
+ if (B && U !== M.length - 1) return a($, E.RepeatingOptional, \`'\${p}': only the LAST slot of a repeating group may be optional (slot '\${$.name?.getText?.()}' is not).\`), null;
3111
3119
  z.push(C($.name?.getText?.() ?? \`\${U}\`, $.type, B));
3112
3120
  }
3113
3121
  return z;
3114
3122
  }, te = (u, p, v, _, C, M = !1, z = !1, U = !1) => {
3115
3123
  if (!u) {
3116
- o(u, E.MissingType, \`Type is not defined for '\${p?.name ?? "return"}'.\`);
3124
+ a(u, E.MissingType, \`Type is not defined for '\${p?.name ?? "return"}'.\`);
3117
3125
  return;
3118
3126
  }
3119
3127
  if (u.kind === e.SyntaxKind.ParenthesizedType) return te(u.type, p, v, _, C, M, z, U);
@@ -3131,15 +3139,15 @@ function fa(e, t, r, n) {
3131
3139
  return;
3132
3140
  }
3133
3141
  if (B.length === 2) {
3134
- const X = (g) => g.kind !== e.SyntaxKind.TypeReference ? !1 : e.isTypeReferenceNode(g) && _e(g) === "Lambda", j = B.findIndex(X);
3142
+ const X = (g) => g.kind !== e.SyntaxKind.TypeReference ? !1 : e.isTypeReferenceNode(g) && xe(g) === "Lambda", j = B.findIndex(X);
3135
3143
  if (j >= 0 && !X(B[1 - j])) {
3136
- te(B[1 - j], p, v, _, C, M, z, U), A(B[j], _e(B[j]), p, v, _);
3144
+ te(B[1 - j], p, v, _, C, M, z, U), A(B[j], xe(B[j]), p, v, _);
3137
3145
  return;
3138
3146
  }
3139
3147
  }
3140
3148
  if (_ && B.length === 2) {
3141
3149
  const X = (g) => {
3142
- if (!(g.kind !== e.SyntaxKind.TypeReference || g.typeArguments?.length)) return ht.get(_e(g));
3150
+ if (!(g.kind !== e.SyntaxKind.TypeReference || g.typeArguments?.length)) return ht.get(xe(g));
3143
3151
  }, j = B.findIndex((g) => X(g) !== void 0);
3144
3152
  if (j >= 0 && X(B[1 - j]) === void 0) {
3145
3153
  const g = {}, x = C.count;
@@ -3152,7 +3160,7 @@ function fa(e, t, r, n) {
3152
3160
  }
3153
3161
  }
3154
3162
  if (_ && B.length === 2) {
3155
- const X = (g) => g.kind === e.SyntaxKind.TypeReference && !g.typeArguments?.length && _e(g) === "Scalar", j = B.findIndex(X);
3163
+ const X = (g) => g.kind === e.SyntaxKind.TypeReference && !g.typeArguments?.length && xe(g) === "Scalar", j = B.findIndex(X);
3156
3164
  if (j >= 0 && !X(B[1 - j])) {
3157
3165
  const g = de(B[1 - j], p.name ?? f(u));
3158
3166
  if (g === void 0) return;
@@ -3162,7 +3170,7 @@ function fa(e, t, r, n) {
3162
3170
  }
3163
3171
  }
3164
3172
  }
3165
- o(u, E.InvalidParamType, \`Union parameter types are not supported: '\${f(u)}'. Use a single type, optionally with '| null' or '| undefined', 'T | Lambda<…>' for a value-or-lambda slot, 'IRange | Scalar' for a value-or-range slot, or 'E | Scalar' for an uncoerced slot whose values an enum documents.\`);
3173
+ a(u, E.InvalidParamType, \`Union parameter types are not supported: '\${f(u)}'. Use a single type, optionally with '| null' or '| undefined', 'T | Lambda<…>' for a value-or-lambda slot, 'IRange | Scalar' for a value-or-range slot, or 'E | Scalar' for an uncoerced slot whose values an enum documents.\`);
3166
3174
  return;
3167
3175
  }
3168
3176
  if (u.kind === e.SyntaxKind.NumberKeyword) p.scalar = me.Number;
@@ -3170,7 +3178,7 @@ function fa(e, t, r, n) {
3170
3178
  else if (u.kind === e.SyntaxKind.BooleanKeyword) p.scalar = me.Boolean;
3171
3179
  else if (u.kind === e.SyntaxKind.UndefinedKeyword || u.kind === e.SyntaxKind.NullKeyword || u.kind === e.SyntaxKind.VoidKeyword) {
3172
3180
  if (_) {
3173
- o(u, E.UndefinedInput, \`'undefined' is not a valid type for input: '\${f(u)}'.\`);
3181
+ a(u, E.UndefinedInput, \`'undefined' is not a valid type for input: '\${f(u)}'.\`);
3174
3182
  return;
3175
3183
  }
3176
3184
  p.scalar = me.Null;
@@ -3179,7 +3187,7 @@ function fa(e, t, r, n) {
3179
3187
  else if (u.kind === e.SyntaxKind.ArrayType) {
3180
3188
  const $ = u.elementType;
3181
3189
  if (!$) {
3182
- o(u, E.UntypedArray, \`'Array' must be typed: '\${f(u)}'.\`);
3190
+ a(u, E.UntypedArray, \`'Array' must be typed: '\${f(u)}'.\`);
3183
3191
  return;
3184
3192
  }
3185
3193
  if (_ && z) {
@@ -3191,21 +3199,21 @@ function fa(e, t, r, n) {
3191
3199
  }
3192
3200
  C.count++, te($, p, v, _, C);
3193
3201
  } else if (u.kind !== e.SyntaxKind.TupleType) if (u.kind === e.SyntaxKind.TypeReference) {
3194
- const $ = _e(u);
3195
- if (Qr.has($)) {
3202
+ const $ = xe(u);
3203
+ if (Zr.has($)) {
3196
3204
  const g = f(u);
3197
3205
  if (!_) {
3198
- o(u, E.InvalidReturnType, \`'\${$}' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
3206
+ a(u, E.InvalidReturnType, \`'\${$}' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
3199
3207
  return;
3200
3208
  }
3201
3209
  const x = p;
3202
3210
  if (x.acceptError) {
3203
- o(u, E.InvalidParamType, \`'\${g}' declares 'AcceptError' more than once.\`);
3211
+ a(u, E.InvalidParamType, \`'\${g}' declares 'AcceptError' more than once.\`);
3204
3212
  return;
3205
3213
  }
3206
3214
  const I = u.typeArguments;
3207
3215
  if (!I || I.length !== 1) {
3208
- o(u, E.GenericArity, \`'\${$}' must be typed with exactly 1 type: '\${g}'.\`);
3216
+ a(u, E.GenericArity, \`'\${$}' must be typed with exactly 1 type: '\${g}'.\`);
3209
3217
  return;
3210
3218
  }
3211
3219
  return x.acceptError = !0, te(I[0], p, v, _, C, M, z, U);
@@ -3213,12 +3221,12 @@ function fa(e, t, r, n) {
3213
3221
  if (gt.has($)) {
3214
3222
  const g = p.name ?? f(u);
3215
3223
  if (!_) {
3216
- o(u, E.InvalidReturnType, \`'ReportType' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
3224
+ a(u, E.InvalidReturnType, \`'ReportType' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
3217
3225
  return;
3218
3226
  }
3219
3227
  const x = u.typeArguments;
3220
3228
  if (!x || x.length !== 1) {
3221
- o(u, E.GenericArity, \`'\${$}' must be typed with exactly 1 type: '\${g}'.\`);
3229
+ a(u, E.GenericArity, \`'\${$}' must be typed with exactly 1 type: '\${g}'.\`);
3222
3230
  return;
3223
3231
  }
3224
3232
  return p.reportType = !0, te(x[0], p, v, _, C, M, z, U);
@@ -3226,138 +3234,138 @@ function fa(e, t, r, n) {
3226
3234
  if (tn.has($)) {
3227
3235
  const g = p.name ?? f(u);
3228
3236
  if (!_) {
3229
- o(u, E.InvalidReturnType, \`'NoLift' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
3237
+ a(u, E.InvalidReturnType, \`'NoLift' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
3230
3238
  return;
3231
3239
  }
3232
3240
  const x = u.typeArguments;
3233
3241
  if (!x || x.length !== 1) {
3234
- o(u, E.GenericArity, \`'\${$}' must be typed with exactly 1 type: '\${g}'.\`);
3242
+ a(u, E.GenericArity, \`'\${$}' must be typed with exactly 1 type: '\${g}'.\`);
3235
3243
  return;
3236
3244
  }
3237
3245
  const I = p;
3238
3246
  I.noLift = !0;
3239
3247
  const V = C.count;
3240
- te(x[0], p, v, _, C, M, z, U), (I.range || I.lambda != null || I.repeating || C.count !== V) && o(u, E.InvalidParamType, \`'\${g}': 'NoLift' applies to a SCALAR parameter only - a range, list, repeating or lambda slot never lifts.\`);
3248
+ te(x[0], p, v, _, C, M, z, U), (I.range || I.lambda != null || I.repeating || C.count !== V) && a(u, E.InvalidParamType, \`'\${g}': 'NoLift' applies to a SCALAR parameter only - a range, list, repeating or lambda slot never lifts.\`);
3241
3249
  return;
3242
3250
  }
3243
3251
  if (rn.has($)) {
3244
3252
  const g = p.name ?? f(u);
3245
3253
  if (!_) {
3246
- o(u, E.InvalidReturnType, \`'NoFilter' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
3254
+ a(u, E.InvalidReturnType, \`'NoFilter' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
3247
3255
  return;
3248
3256
  }
3249
3257
  const x = u.typeArguments;
3250
3258
  if (!x || x.length !== 1) {
3251
- o(u, E.GenericArity, \`'\${$}' must be typed with exactly 1 type: '\${g}'.\`);
3259
+ a(u, E.GenericArity, \`'\${$}' must be typed with exactly 1 type: '\${g}'.\`);
3252
3260
  return;
3253
3261
  }
3254
3262
  const I = p;
3255
3263
  I.noFilter = !0;
3256
3264
  const V = C.count;
3257
3265
  if (te(x[0], p, v, _, C, M, z, U), I.range || I.lambda != null || C.count !== V) {
3258
- o(u, E.InvalidParamType, \`'\${g}': 'NoFilter' applies to a SCALAR slot only - a range, list or lambda slot has no members to coerce.\`);
3266
+ a(u, E.InvalidParamType, \`'\${g}': 'NoFilter' applies to a SCALAR slot only - a range, list or lambda slot has no members to coerce.\`);
3259
3267
  return;
3260
3268
  }
3261
3269
  const re = I.repeating;
3262
3270
  if (re) {
3263
3271
  if (delete I.noFilter, re.length !== 1) {
3264
- o(u, E.InvalidParamType, \`'\${g}': 'NoFilter' over a repeating group applies to a period-1 group only - write it on the slot that takes the members.\`);
3272
+ a(u, E.InvalidParamType, \`'\${g}': 'NoFilter' over a repeating group applies to a period-1 group only - write it on the slot that takes the members.\`);
3265
3273
  return;
3266
3274
  }
3267
3275
  re[0].noFilter = !0;
3268
- } else z && o(u, E.InvalidParamType, \`'\${g}': 'NoFilter' applies to a REPEATING slot only - a single scalar argument has no members to coerce.\`);
3276
+ } else z && a(u, E.InvalidParamType, \`'\${g}': 'NoFilter' applies to a REPEATING slot only - a single scalar argument has no members to coerce.\`);
3269
3277
  return;
3270
3278
  }
3271
3279
  if (en.has($)) {
3272
3280
  const g = p.name ?? f(u);
3273
3281
  if (!_) {
3274
- o(u, E.InvalidReturnType, \`'Omittable' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
3282
+ a(u, E.InvalidReturnType, \`'Omittable' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
3275
3283
  return;
3276
3284
  }
3277
3285
  const x = u.typeArguments;
3278
3286
  if (!x || x.length < 1 || x.length > 2) {
3279
- o(u, E.GenericArity, \`'\${$}' must be typed with 1 or 2 types: '\${g}'.\`);
3287
+ a(u, E.GenericArity, \`'\${$}' must be typed with 1 or 2 types: '\${g}'.\`);
3280
3288
  return;
3281
3289
  }
3282
3290
  const I = p;
3283
3291
  if (I.omittable = !0, x.length === 2) {
3284
3292
  const Y = tr(e, x[1]);
3285
3293
  if (Y === void 0) {
3286
- o(u, E.InvalidParamType, \`'\${g}' declares '\${$}' with a second type that is not a literal value. Use a number, string, boolean or null - the engine substitutes it for an omitted argument.\`);
3294
+ a(u, E.InvalidParamType, \`'\${g}' declares '\${$}' with a second type that is not a literal value. Use a number, string, boolean or null - the engine substitutes it for an omitted argument.\`);
3287
3295
  return;
3288
3296
  }
3289
3297
  I.omittedValue = Y;
3290
3298
  }
3291
3299
  const V = te(x[0], p, v, _, C, M, z, U), re = I.omittedValue;
3292
- return I.enum && re !== void 0 && re !== null && !I.enum.members.some(([, Y]) => Y === re) && o(x[1], E.EnumOmittedValue, \`'\${g}': \${JSON.stringify(re)} is not a member of '\${I.enum.id}'. An omitted argument must mean a member (\${I.enum.members.map(([, Y]) => JSON.stringify(Y)).join(", ")}) or null.\`), V;
3300
+ return I.enum && re !== void 0 && re !== null && !I.enum.members.some(([, Y]) => Y === re) && a(x[1], E.EnumOmittedValue, \`'\${g}': \${JSON.stringify(re)} is not a member of '\${I.enum.id}'. An omitted argument must mean a member (\${I.enum.members.map(([, Y]) => JSON.stringify(Y)).join(", ")}) or null.\`), V;
3293
3301
  }
3294
3302
  if (nn.has($)) {
3295
3303
  const g = p.name ?? f(u);
3296
3304
  if (!_) {
3297
- o(u, E.InvalidReturnType, \`'Lazy' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
3305
+ a(u, E.InvalidReturnType, \`'Lazy' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
3298
3306
  return;
3299
3307
  }
3300
3308
  const x = p;
3301
3309
  if (x.lazy) {
3302
- o(u, E.InvalidParamType, \`'\${g}' declares 'Lazy' more than once.\`);
3310
+ a(u, E.InvalidParamType, \`'\${g}' declares 'Lazy' more than once.\`);
3303
3311
  return;
3304
3312
  }
3305
3313
  const I = u.typeArguments;
3306
3314
  if (!I || I.length < 1 || I.length > 2) {
3307
- o(u, E.GenericArity, \`'\${$}' must be typed with 1 or 2 types: '\${g}'.\`);
3315
+ a(u, E.GenericArity, \`'\${$}' must be typed with 1 or 2 types: '\${g}'.\`);
3308
3316
  return;
3309
3317
  }
3310
3318
  if (x.lazy = !0, I.length === 2) {
3311
3319
  const V = tr(e, I[1]);
3312
3320
  if (V === void 0) {
3313
- o(u, E.InvalidParamType, \`'\${g}' declares '\${$}' with a second type that is not a literal value. Use a number, string, boolean or null - the engine substitutes it for an absent argument.\`);
3321
+ a(u, E.InvalidParamType, \`'\${g}' declares '\${$}' with a second type that is not a literal value. Use a number, string, boolean or null - the engine substitutes it for an absent argument.\`);
3314
3322
  return;
3315
3323
  }
3316
3324
  x.optional = !0, x.defaultValue = V;
3317
3325
  }
3318
- te(I[0], p, v, _, C, M, z, U), x.enum ? (o(u, E.EnumPosition, \`'\${g}': 'Lazy' cannot hold the enum '\${x.enum.id}'. The argument may never be evaluated, so there is no point at which it could be checked against the members.\`), delete x.enum) : x.lambda != null ? o(u, E.InvalidParamType, \`'\${g}': 'Lazy' cannot be combined with a Lambda parameter - a callable slot is already the body's to call, or not.\`) : x.repeating && o(u, E.InvalidParamType, \`'\${g}': 'Lazy' applies to a VALUE, not to a repeating group - mark the group's slots instead.\`);
3326
+ te(I[0], p, v, _, C, M, z, U), x.enum ? (a(u, E.EnumPosition, \`'\${g}': 'Lazy' cannot hold the enum '\${x.enum.id}'. The argument may never be evaluated, so there is no point at which it could be checked against the members.\`), delete x.enum) : x.lambda != null ? a(u, E.InvalidParamType, \`'\${g}': 'Lazy' cannot be combined with a Lambda parameter - a callable slot is already the body's to call, or not.\`) : x.repeating && a(u, E.InvalidParamType, \`'\${g}': 'Lazy' applies to a VALUE, not to a repeating group - mark the group's slots instead.\`);
3319
3327
  return;
3320
3328
  }
3321
- if (aa.has($)) {
3329
+ if (oo.has($)) {
3322
3330
  const g = p.name ?? f(u);
3323
3331
  if (!_) {
3324
- o(u, E.InvalidReturnType, \`'Flatten' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
3332
+ a(u, E.InvalidReturnType, \`'Flatten' is not a valid return type: '\${g}'. It describes how an ARGUMENT is received.\`);
3325
3333
  return;
3326
3334
  }
3327
3335
  const x = u.typeArguments;
3328
3336
  if (!x || x.length !== 1) {
3329
- o(u, E.GenericArity, \`'\${$}' must be typed with exactly 1 type: '\${g}'.\`);
3337
+ a(u, E.GenericArity, \`'\${$}' must be typed with exactly 1 type: '\${g}'.\`);
3330
3338
  return;
3331
3339
  }
3332
3340
  return C.count++, te(x[0], p, v, _, C, M);
3333
3341
  }
3334
- if (Zr.get($) === "repeating") {
3342
+ if (Qr.get($) === "repeating") {
3335
3343
  const g = p.name ?? f(u);
3336
3344
  if (!_) {
3337
- o(u, E.RepeatingPosition, \`'Repeating' is not a valid return type: '\${g}'.\`);
3345
+ a(u, E.RepeatingPosition, \`'Repeating' is not a valid return type: '\${g}'.\`);
3338
3346
  return;
3339
3347
  }
3340
3348
  if (C.count !== 0) {
3341
- o(u, E.RepeatingPosition, \`'Repeating' cannot be nested inside another type: '\${g}'.\`);
3349
+ a(u, E.RepeatingPosition, \`'Repeating' cannot be nested inside another type: '\${g}'.\`);
3342
3350
  return;
3343
3351
  }
3344
3352
  const x = p, I = u.typeArguments;
3345
3353
  if (!I || I.length < 1 || I.length > 2) {
3346
- o(u, E.GenericArity, \`'\${$}' must be typed with 1 type, optionally followed by a maximum argument count: '\${g}'.\`);
3354
+ a(u, E.GenericArity, \`'\${$}' must be typed with 1 type, optionally followed by a maximum argument count: '\${g}'.\`);
3347
3355
  return;
3348
3356
  }
3349
3357
  let V;
3350
3358
  if (I.length === 2) {
3351
- const Q = I[1], he = Q.kind === e.SyntaxKind.LiteralType ? Q.literal : null, P = he && he.kind === e.SyntaxKind.NumericLiteral ? Number(he.text) : NaN;
3352
- if (!Number.isInteger(P) || P < 1 || P > Zt) {
3353
- o(Q, E.RepeatingMax, \`'\${g}': '\${$}'’s maximum must be a whole number between 1 and \${Zt}.\`);
3359
+ const Z = I[1], he = Z.kind === e.SyntaxKind.LiteralType ? Z.literal : null, P = he && he.kind === e.SyntaxKind.NumericLiteral ? Number(he.text) : NaN;
3360
+ if (!Number.isInteger(P) || P < 1 || P > Qt) {
3361
+ a(Z, E.RepeatingMax, \`'\${g}': '\${$}'’s maximum must be a whole number between 1 and \${Qt}.\`);
3354
3362
  return;
3355
3363
  }
3356
3364
  V = P, v.maxArguments = P;
3357
3365
  }
3358
3366
  if (U) {
3359
3367
  if (V === void 0) {
3360
- o(u, E.RepeatingPosition, \`'\${g}' is a rest parameter and a repeating group. A group already repeats — drop the '...', or give the group a maximum ('Repeating<T, 254>') if the ceiling is all you meant.\`);
3368
+ a(u, E.RepeatingPosition, \`'\${g}' is a rest parameter and a repeating group. A group already repeats — drop the '...', or give the group a maximum ('Repeating<T, 254>') if the ceiling is all you meant.\`);
3361
3369
  return;
3362
3370
  }
3363
3371
  return te(I[0], p, v, _, C, M, z);
@@ -3371,19 +3379,19 @@ function fa(e, t, r, n) {
3371
3379
  const B = ht.get($);
3372
3380
  let G = !1;
3373
3381
  B && (p.range = B, G = !0);
3374
- const X = ia.get($);
3382
+ const X = io.get($);
3375
3383
  if (X && (p.scalar = X), X !== void 0 && (G = !0), A(u, $, p, v, _)) return;
3376
3384
  if (_) {
3377
3385
  if ($ === "Volatile" || $ === \`\${se}.Volatile\`) {
3378
- o(u, E.InvalidParamType, \`'Volatile' is not a valid parameter type: '\${f(u)}'. It describes the function's RESULT, so it belongs on the return type.\`);
3386
+ a(u, E.InvalidParamType, \`'Volatile' is not a valid parameter type: '\${f(u)}'. It describes the function's RESULT, so it belongs on the return type.\`);
3379
3387
  return;
3380
3388
  }
3381
- if (da.has($)) return Qt;
3389
+ if (fo.has($)) return Zt;
3382
3390
  const g = bt.get($);
3383
3391
  if (g) return g;
3384
3392
  } else if ($ === "Promise") b = u, G = !0;
3385
3393
  else {
3386
- const g = ua.get($);
3394
+ const g = uo.get($);
3387
3395
  g && (Object.assign(p, g()), G = !0);
3388
3396
  }
3389
3397
  if (!G) {
@@ -3397,32 +3405,32 @@ function fa(e, t, r, n) {
3397
3405
  if (!G) {
3398
3406
  const g = "number, string, boolean, Scalar, Lambda, Date, FormulaError.Known, IRichData, IRange, IReferenceRange (and arrays of these; optionally wrapped in AcceptError<T>, or grouped with Repeating<T>)", x = "number, string, boolean, Scalar, Date, FormulaError.Known, IRichData, IRange, Volatile<T> (and arrays of these)";
3399
3407
  let I;
3400
- _ ? M ? I = \`'\${$}' is not a valid first parameter: '\${f(u)}'. The first parameter is EITHER a macro target (making this a macro) OR a calculation input (making this a calculation function). Allowed: \${na.join(", ")} (macro target); \${g} (calculation input).\` : I = \`'\${$}' is not a valid parameter type: '\${f(u)}'. Allowed: \${g}.\` : I = \`'\${$}' is not a valid return type: '\${f(u)}'. Allowed: \${x}.\`, o(u, _ ? E.InvalidParamType : E.InvalidReturnType, I);
3408
+ _ ? M ? I = \`'\${$}' is not a valid first parameter: '\${f(u)}'. The first parameter is EITHER a macro target (making this a macro) OR a calculation input (making this a calculation function). Allowed: \${no.join(", ")} (macro target); \${g} (calculation input).\` : I = \`'\${$}' is not a valid parameter type: '\${f(u)}'. Allowed: \${g}.\` : I = \`'\${$}' is not a valid return type: '\${f(u)}'. Allowed: \${x}.\`, a(u, _ ? E.InvalidParamType : E.InvalidReturnType, I);
3401
3409
  return;
3402
3410
  }
3403
3411
  const j = u.typeArguments;
3404
3412
  if (j) {
3405
3413
  if (j.length !== 1) {
3406
- o(u, E.GenericArity, \`'\${$}' must be typed with exactly 1 type: '\${f(u)}'.\`);
3414
+ a(u, E.GenericArity, \`'\${$}' must be typed with exactly 1 type: '\${f(u)}'.\`);
3407
3415
  return;
3408
3416
  }
3409
- const g = j[0], x = _ && e.isTypeReferenceNode(g) && gt.has(_e(g)), I = p.reportType;
3417
+ const g = j[0], x = _ && e.isTypeReferenceNode(g) && gt.has(xe(g)), I = p.reportType;
3410
3418
  x && K.add(p), S(g, p, v, _), x && I === void 0 && delete p.reportType;
3411
3419
  const V = p.enum;
3412
- V && !x && (o(j[0], E.EnumPosition, \`'\${$}' cannot hold the enum '\${V.id}': '\${f(u)}'. The members of a range reach the body as they are, so nothing checks them against the enum. Take the enum as a value, or type the range by its scalar ('\${$}<\${V.type}>').\`), delete p.enum);
3420
+ V && !x && (a(j[0], E.EnumPosition, \`'\${$}' cannot hold the enum '\${V.id}': '\${f(u)}'. The members of a range reach the body as they are, so nothing checks them against the enum. Take the enum as a value, or type the range by its scalar ('\${$}<\${V.type}>').\`), delete p.enum);
3413
3421
  }
3414
3422
  } else u.kind === e.SyntaxKind.FunctionType && L(u, p, v, _);
3415
- }, Ze = (u) => (e.getCombinedModifierFlags(u) & e.ModifierFlags.Export) !== 0, Ie = (u) => (e.getCombinedModifierFlags(u) & e.ModifierFlags.Default) !== 0;
3423
+ }, Qe = (u) => (e.getCombinedModifierFlags(u) & e.ModifierFlags.Export) !== 0, Re = (u) => (e.getCombinedModifierFlags(u) & e.ModifierFlags.Default) !== 0;
3416
3424
  try {
3417
3425
  e.forEachChild(t, (u) => {
3418
- if (Ze(u) && e.isFunctionDeclaration(u)) {
3426
+ if (Qe(u) && e.isFunctionDeclaration(u)) {
3419
3427
  const p = u?.name?.getText();
3420
3428
  if (!u.body) {
3421
- o(u, E.NoBody, \`'\${p}': function has no body.\`);
3429
+ a(u, E.NoBody, \`'\${p}': function has no body.\`);
3422
3430
  return;
3423
3431
  }
3424
3432
  if (!p) {
3425
- o(u, E.Anonymous, "Anonymous exported functions are not allowed.");
3433
+ a(u, E.Anonymous, "Anonymous exported functions are not allowed.");
3426
3434
  return;
3427
3435
  }
3428
3436
  const v = {}, _ = { parameters: {} };
@@ -3433,7 +3441,7 @@ function fa(e, t, r, n) {
3433
3441
  const z = {};
3434
3442
  b = null, S(u.type, z, v, !1), v.returnType = z;
3435
3443
  const U = {};
3436
- Ie(u) && (U.default = !0, c = p), v.parameters = [];
3444
+ Re(u) && (U.default = !0, c = p), v.parameters = [];
3437
3445
  const $ = /* @__PURE__ */ new Map(), B = /* @__PURE__ */ new Map(), G = /* @__PURE__ */ new Set();
3438
3446
  let X = null, j = null, g = null, x = 0, I = !1, V = 0;
3439
3447
  for (let P = 0; P < u.parameters.length; P++) {
@@ -3444,27 +3452,27 @@ function fa(e, t, r, n) {
3444
3452
  v.context = er;
3445
3453
  continue;
3446
3454
  }
3447
- const Re = S(O.type, N, v, !0, ne, !O.dotDotDotToken, !!O.dotDotDotToken);
3448
- if (Re === Qt) {
3455
+ const $e = S(O.type, N, v, !0, ne, !O.dotDotDotToken, !!O.dotDotDotToken);
3456
+ if ($e === Zt) {
3449
3457
  P === 0 && v.context === void 0 && (v.context = er);
3450
3458
  continue;
3451
3459
  }
3452
- if (Re) {
3460
+ if ($e) {
3453
3461
  if (v.parameters.length !== 0) {
3454
- o(O, E.ContextNotFirst, \`'\${v.name}' contexts must be the first parameter: '\${N.name}'.\`);
3462
+ a(O, E.ContextNotFirst, \`'\${v.name}' contexts must be the first parameter: '\${N.name}'.\`);
3455
3463
  return;
3456
3464
  }
3457
- v.context = Re;
3465
+ v.context = $e;
3458
3466
  continue;
3459
3467
  }
3460
3468
  if (N.lambda !== void 0) {
3461
3469
  if (X !== null) {
3462
- o(O, E.MultipleLambda, \`'\${v.name}' has more than one Lambda parameter ('\${X}' and '\${N.name}'). Only one Lambda parameter is allowed.\`);
3470
+ a(O, E.MultipleLambda, \`'\${v.name}' has more than one Lambda parameter ('\${X}' and '\${N.name}'). Only one Lambda parameter is allowed.\`);
3463
3471
  return;
3464
3472
  }
3465
3473
  X = N.name;
3466
3474
  } else if (X !== null) {
3467
- o(O, E.LambdaNotLast, \`'\${v.name}' Lambda parameter ('\${X}') must be the last parameter, but '\${N.name}' follows it.\`);
3475
+ a(O, E.LambdaNotLast, \`'\${v.name}' Lambda parameter ('\${X}') must be the last parameter, but '\${N.name}' follows it.\`);
3468
3476
  return;
3469
3477
  }
3470
3478
  const ye = N.optional === !0 || !((O.initializer === void 0 || O.initializer === null) && (O.questionToken === void 0 || O.questionToken === null));
@@ -3486,47 +3494,47 @@ function fa(e, t, r, n) {
3486
3494
  const H = N.repeating;
3487
3495
  if (H) {
3488
3496
  if (N.rest) {
3489
- o(O, E.RepeatingPosition, \`'\${v.name}' parameter '\${N.name}' is both a rest parameter and a repeating group. A group already repeats — drop the '...'.\`);
3497
+ a(O, E.RepeatingPosition, \`'\${v.name}' parameter '\${N.name}' is both a rest parameter and a repeating group. A group already repeats — drop the '...'.\`);
3490
3498
  return;
3491
3499
  }
3492
3500
  if (ye && H.length === 1) {
3493
- o(O, E.RepeatingOptional, \`'\${v.name}' parameter '\${N.name}' cannot be an optional repeating group. Use '...\${N.name}: T[]' for zero-or-more, or drop the '?' for one-or-more.\`);
3501
+ a(O, E.RepeatingOptional, \`'\${v.name}' parameter '\${N.name}' cannot be an optional repeating group. Use '...\${N.name}: T[]' for zero-or-more, or drop the '?' for one-or-more.\`);
3494
3502
  return;
3495
3503
  }
3496
3504
  if (j !== null) {
3497
- o(O, E.MultipleRepeating, \`'\${v.name}' has more than one repeating group ('\${j}' and '\${N.name}'). Only one is allowed — two would make the argument count ambiguous.\`);
3505
+ a(O, E.MultipleRepeating, \`'\${v.name}' has more than one repeating group ('\${j}' and '\${N.name}'). Only one is allowed — two would make the argument count ambiguous.\`);
3498
3506
  return;
3499
3507
  }
3500
3508
  if (g !== null) {
3501
- o(O, E.RepeatingOptional, \`'\${v.name}' parameter '\${g}' is optional and precedes the repeating group '\${N.name}'. Every parameter outside a group must be required.\`);
3509
+ a(O, E.RepeatingOptional, \`'\${v.name}' parameter '\${g}' is optional and precedes the repeating group '\${N.name}'. Every parameter outside a group must be required.\`);
3502
3510
  return;
3503
3511
  }
3504
3512
  j = N.name, x = H.length, I = H[H.length - 1].optional === !0;
3505
3513
  } else if (j !== null && N.rest) {
3506
- o(O, E.RepeatingOptional, \`'\${v.name}' parameter '\${N.name}' is a rest parameter and follows the repeating group '\${j}'. Two variadic tails would make the argument count ambiguous.\`);
3514
+ a(O, E.RepeatingOptional, \`'\${v.name}' parameter '\${N.name}' is a rest parameter and follows the repeating group '\${j}'. Two variadic tails would make the argument count ambiguous.\`);
3507
3515
  return;
3508
3516
  } else if (j !== null && ye) {
3509
3517
  if (V >= x - 1) {
3510
- o(O, E.RepeatingOptional, x === 1 ? \`'\${v.name}' parameter '\${N.name}' is optional and follows the period-1 repeating group '\${j}'. One more argument is indistinguishable from one more repetition — make it required, or give the group a period.\` : \`'\${v.name}' has \${V + 1} optional parameters after the repeating group '\${j}', which has period \${x}. At most \${x - 1} may be optional, or the argument count no longer decides the parse.\`);
3518
+ a(O, E.RepeatingOptional, x === 1 ? \`'\${v.name}' parameter '\${N.name}' is optional and follows the period-1 repeating group '\${j}'. One more argument is indistinguishable from one more repetition — make it required, or give the group a period.\` : \`'\${v.name}' has \${V + 1} optional parameters after the repeating group '\${j}', which has period \${x}. At most \${x - 1} may be optional, or the argument count no longer decides the parse.\`);
3511
3519
  return;
3512
3520
  }
3513
3521
  if (I) {
3514
- o(O, E.RepeatingOptional, \`'\${v.name}' parameter '\${N.name}' is optional and follows '\${j}', whose own last slot is already optional. Both omissions reach the same argument count — drop one.\`);
3522
+ a(O, E.RepeatingOptional, \`'\${v.name}' parameter '\${N.name}' is optional and follows '\${j}', whose own last slot is already optional. Both omissions reach the same argument count — drop one.\`);
3515
3523
  return;
3516
3524
  }
3517
3525
  V++;
3518
3526
  }
3519
3527
  ye && !H && (g = N.name);
3520
- const W = (N.range ? 2 : 0) + (N.arrayDepth ?? 0), Be = N.range === "r" || N.range === "p" || N.range === "*", Z = N.rest || Be ? 3 : 2;
3521
- if (W > Z) {
3522
- o(O, E.ArrayDepth, \`'\${v.name}' parameter '\${N.name}' has an array depth of \${W}; the maximum is \${Z}\${N.rest ? " for a rest parameter" : " (use a rest parameter for one more level, or an IRange)"}.\`);
3528
+ const W = (N.range ? 2 : 0) + (N.arrayDepth ?? 0), Be = N.range === "r" || N.range === "p" || N.range === "*", Q = N.rest || Be ? 3 : 2;
3529
+ if (W > Q) {
3530
+ a(O, E.ArrayDepth, \`'\${v.name}' parameter '\${N.name}' has an array depth of \${W}; the maximum is \${Q}\${N.rest ? " for a rest parameter" : " (use a rest parameter for one more level, or an IRange)"}.\`);
3523
3531
  return;
3524
3532
  }
3525
3533
  v.parameters.push(N);
3526
3534
  const ce = { description: "" };
3527
3535
  _.parameters[N.name] = ce;
3528
- const Qe = r.getSymbolAtLocation(O.name);
3529
- ce.description = ke(Qe?.getDocumentationComment(r)), ae !== void 0 && (N.defaultValue = ae);
3536
+ const Ze = r.getSymbolAtLocation(O.name);
3537
+ ce.description = ke(Ze?.getDocumentationComment(r)), ae !== void 0 && (N.defaultValue = ae);
3530
3538
  for (const ue of [N, ...N.repeating ?? []]) {
3531
3539
  const Se = ue.enum ? w.get(ue.enum) : void 0;
3532
3540
  Se && ((_.enums ??= {})[ue.enum.id] = Se);
@@ -3543,13 +3551,13 @@ function fa(e, t, r, n) {
3543
3551
  if (re !== void 0) {
3544
3552
  const P = v.parameters ?? [];
3545
3553
  if (!P.some((N) => N.rest === !0 || N.repeating !== void 0)) {
3546
- o(u, E.RepeatingMax, \`'\${v.name}' declares a maximum of \${re} arguments but takes a fixed \${P.length}. A maximum only means something on a variadic tail.\`);
3554
+ a(u, E.RepeatingMax, \`'\${v.name}' declares a maximum of \${re} arguments but takes a fixed \${P.length}. A maximum only means something on a variadic tail.\`);
3547
3555
  return;
3548
3556
  }
3549
3557
  let O = 0;
3550
3558
  for (const N of P) N.rest === !0 || N.optional === !0 || (O += N.repeating ? N.repeating.length : 1);
3551
3559
  if (re < O) {
3552
- o(u, E.RepeatingMax, \`'\${v.name}' declares a maximum of \${re} arguments but requires \${O}.\`);
3560
+ a(u, E.RepeatingMax, \`'\${v.name}' declares a maximum of \${re} arguments but requires \${O}.\`);
3553
3561
  return;
3554
3562
  }
3555
3563
  }
@@ -3558,51 +3566,51 @@ function fa(e, t, r, n) {
3558
3566
  for (let N = 0; N < O; N++) {
3559
3567
  const ne = P[N]?.tags;
3560
3568
  if (!ne) continue;
3561
- const Re = ne.length;
3562
- for (let ye = 0; ye < Re; ye++) {
3569
+ const $e = ne.length;
3570
+ for (let ye = 0; ye < $e; ye++) {
3563
3571
  const ae = ne[ye];
3564
3572
  let H = ae?.tagName?.text;
3565
3573
  if (!H) continue;
3566
3574
  H = H.toLowerCase();
3567
3575
  let W = ae.comment;
3568
- const Be = ra(H);
3576
+ const Be = ro(H);
3569
3577
  if (typeof W != "string" && !Be) {
3570
- H === "returnkind" && o(ae, E.UnknownReturnKind, \`'@returnKind' needs a value kind. Known: \${[...lt].map((Z) => \`'\${Z}'\`).join(", ")}.\`);
3578
+ H === "returnkind" && a(ae, E.UnknownReturnKind, \`'@returnKind' needs a value kind. Known: \${[...lt].map((Q) => \`'\${Q}'\`).join(", ")}.\`);
3571
3579
  continue;
3572
3580
  }
3573
3581
  if (typeof W == "string" && (W = W.replace(/\\r\\n?/g, \`
3574
3582
  \`).trim()), !(!Be && W && (W = W.split(\`
3575
3583
  \`)[0].trim(), !W || W.length === 0))) {
3576
3584
  if (W && typeof W == "string") {
3577
- const Z = /\\{@link(code|plain)?\\s+([^}|]+)(?:\\s*\\|\\s*([^}]+))?\\}/g;
3578
- let ce, Qe = W, ue = [];
3579
- for (; (ce = Z.exec(W)) !== null;) {
3580
- const [Se, Ra, sn, Et] = ce, cn = [sn.trim()];
3585
+ const Q = /\\{@link(code|plain)?\\s+([^}|]+)(?:\\s*\\|\\s*([^}]+))?\\}/g;
3586
+ let ce, Ze = W, ue = [];
3587
+ for (; (ce = Q.exec(W)) !== null;) {
3588
+ const [Se, $o, sn, Et] = ce, cn = [sn.trim()];
3581
3589
  Et && cn.push(Et.trim());
3582
3590
  }
3583
- W = Qe, ue.length > 0 && H === "see" && (_.links || (_.links = []), _.links.push(...ue));
3591
+ W = Ze, ue.length > 0 && H === "see" && (_.links || (_.links = []), _.links.push(...ue));
3584
3592
  }
3585
3593
  if (H === "name") {
3586
- const Z = W;
3587
- Z !== p && (_.name = Z);
3594
+ const Q = W;
3595
+ Q !== p && (_.name = Q);
3588
3596
  } else if (H !== "description") {
3589
3597
  if (H === "param") {
3590
- const Z = ae.name?.getText?.() ?? ae.name?.text;
3591
- if (!$.get(Z)) {
3592
- o(ae, E.UnknownParam, \`Parameter '\${Z}' not found in function '\${p}'.\`);
3598
+ const Q = ae.name?.getText?.() ?? ae.name?.text;
3599
+ if (!$.get(Q)) {
3600
+ a(ae, E.UnknownParam, \`Parameter '\${Q}' not found in function '\${p}'.\`);
3593
3601
  continue;
3594
3602
  }
3595
- const ce = _.parameters?.[Z];
3603
+ const ce = _.parameters?.[Q];
3596
3604
  ce && !ce.description && typeof W == "string" && W && (ce.description = W);
3597
3605
  } else if (H === "returns" || H === "return") v.returnType.description = W;
3598
3606
  else if (H === "returnkind") {
3599
- const Z = (W ?? "").trim().toLowerCase();
3600
- lt.has(Z) ? v.returnType.kind = Z : o(ae, E.UnknownReturnKind, \`'@returnKind \${Z}' is not a known value kind. Known: \${[...lt].map((ce) => \`'\${ce}'\`).join(", ")}.\`);
3607
+ const Q = (W ?? "").trim().toLowerCase();
3608
+ lt.has(Q) ? v.returnType.kind = Q : a(ae, E.UnknownReturnKind, \`'@returnKind \${Q}' is not a known value kind. Known: \${[...lt].map((ce) => \`'\${ce}'\`).join(", ")}.\`);
3601
3609
  } else if (H === "category") _.category = W;
3602
3610
  else if (H === "deprecated" || H === "hidden") {
3603
- let Z = !0;
3611
+ let Q = !0;
3604
3612
  const ce = W?.toLowerCase();
3605
- ce === "false" ? Z = !1 : ce !== "true" && (Z = W), Z !== !1 && (_.deprecated = Z ?? !0, v.hidden = !0);
3613
+ ce === "false" ? Q = !1 : ce !== "true" && (Q = W), Q !== !1 && (_.deprecated = Q ?? !0, v.hidden = !0);
3606
3614
  }
3607
3615
  }
3608
3616
  }
@@ -3610,28 +3618,28 @@ function fa(e, t, r, n) {
3610
3618
  }
3611
3619
  }
3612
3620
  if (!v.context && b) {
3613
- o(b, E.InvalidReturnType, \`'\${p}': Promise<T> is not a valid return type for a calculation function. Return the value the cell shows now, and call FormulaContext.defer(executor, payload) to deliver the result later.\`);
3621
+ a(b, E.InvalidReturnType, \`'\${p}': Promise<T> is not a valid return type for a calculation function. Return the value the cell shows now, and call FormulaContext.defer(executor, payload) to deliver the result later.\`);
3614
3622
  return;
3615
3623
  }
3616
3624
  Object.keys(v.returnType).length === 0 && delete v.returnType, Object.keys(U).length > 0 && (v.behavior = U), _.summary || m(u.name ?? u, E.MissingSummary, "warning", \`'\${p}': missing a description. Add a JSDoc comment above the function.\`);
3617
- const Y = !v.context, Q = Y && _.name || p;
3618
- if (Y && !oa.test(Q)) {
3619
- const P = _.name ? \`'@name \${_.name}'\` : \`'\${Q}'\`;
3620
- o(u.name ?? u, E.InvalidName, \`'\${p}': \${P} cannot be called from a formula. A function name starts with a letter or '_', and continues with letters, digits, '_' or '.'.\` + (_.name ? "" : " Add an '@name' tag to register it under another name."));
3625
+ const Y = !v.context, Z = Y && _.name || p;
3626
+ if (Y && !ao.test(Z)) {
3627
+ const P = _.name ? \`'@name \${_.name}'\` : \`'\${Z}'\`;
3628
+ a(u.name ?? u, E.InvalidName, \`'\${p}': \${P} cannot be called from a formula. A function name starts with a letter or '_', and continues with letters, digits, '_' or '.'.\` + (_.name ? "" : " Add an '@name' tag to register it under another name."));
3621
3629
  return;
3622
3630
  }
3623
- if (Y && !n?.isBuiltIn && ca(Q)) {
3624
- const P = _.name ? \`'@name \${_.name}'\` : \`'\${Q}'\`;
3625
- o(u.name ?? u, E.InvalidName, \`'\${p}': \${P} cannot be called from a formula. It reads as a cell address.\` + (_.name ? "" : " Add an '@name' tag to register it under another name."));
3631
+ if (Y && !n?.isBuiltIn && co(Z)) {
3632
+ const P = _.name ? \`'@name \${_.name}'\` : \`'\${Z}'\`;
3633
+ a(u.name ?? u, E.InvalidName, \`'\${p}': \${P} cannot be called from a formula. It reads as a cell address.\` + (_.name ? "" : " Add an '@name' tag to register it under another name."));
3626
3634
  return;
3627
3635
  }
3628
- const he = l.get(Q.toUpperCase());
3636
+ const he = l.get(Z.toUpperCase());
3629
3637
  if (he !== void 0) {
3630
- o(u.name ?? u, E.DuplicateName, \`'\${p}': '\${Q}' is already the name of '\${he}' in this module.\`);
3638
+ a(u.name ?? u, E.DuplicateName, \`'\${p}': '\${Z}' is already the name of '\${he}' in this module.\`);
3631
3639
  return;
3632
3640
  }
3633
- if (l.set(Q.toUpperCase(), p), Y && i?.has(Q.toUpperCase())) {
3634
- o(u.name ?? u, E.BuiltInName, \`'\${Q}' is a built-in function. Choose a different name - a calculation function cannot replace a built-in.\`);
3641
+ if (l.set(Z.toUpperCase(), p), Y && i?.has(Z.toUpperCase())) {
3642
+ a(u.name ?? u, E.BuiltInName, \`'\${Z}' is a built-in function. Choose a different name - a calculation function cannot replace a built-in.\`);
3635
3643
  return;
3636
3644
  }
3637
3645
  if (Y) {
@@ -3641,72 +3649,72 @@ function fa(e, t, r, n) {
3641
3649
  m(ne, E.MissingParamDescription, "warning", \`'\${p}': parameter '\${O}' is missing a description. Add an '@param \${O}' tag.\`);
3642
3650
  }
3643
3651
  }
3644
- a.push([v, _]);
3652
+ o.push([v, _]);
3645
3653
  } catch (C) {
3646
- o(u, E.ParseError, \`'\${p}': \${C.message}\`);
3654
+ a(u, E.ParseError, \`'\${p}': \${C.message}\`);
3647
3655
  }
3648
3656
  }
3649
3657
  });
3650
3658
  } catch (u) {
3651
- o(void 0, E.ParseError, \`Unable to analyze module: \${u?.message ?? u}\`);
3659
+ a(void 0, E.ParseError, \`Unable to analyze module: \${u?.message ?? u}\`);
3652
3660
  }
3653
3661
  return {
3654
- functions: a,
3662
+ functions: o,
3655
3663
  autoRun: c,
3656
3664
  diagnostics: s
3657
3665
  };
3658
3666
  }
3659
3667
  const Ye = "__SHEETXL";
3660
- var pa = /* @__PURE__ */ or({ initialize: () => ma });
3661
- async function ma() {
3662
- return Te || (Te = new Promise(async (e, t) => {
3668
+ var mo = /* @__PURE__ */ ar({ initialize: () => ho });
3669
+ async function ho() {
3670
+ return Ce || (Ce = new Promise(async (e, t) => {
3663
3671
  try {
3664
- const r = "0.20.2", n = \`https://esm.sh/esbuild-wasm@\${r}\`, i = \`https://esm.sh/esbuild-wasm@\${r}/esbuild.wasm\`, a = (await import(
3672
+ const r = "0.20.2", n = \`https://esm.sh/esbuild-wasm@\${r}\`, i = \`https://esm.sh/esbuild-wasm@\${r}/esbuild.wasm\`, o = (await import(
3665
3673
  /* webpackIgnore: true */
3666
3674
  /* @vite-ignore */
3667
3675
  n
3668
3676
  )).default;
3669
- await a.initialize({
3677
+ await o.initialize({
3670
3678
  wasmURL: i,
3671
3679
  worker: !1
3672
- }), e(a);
3680
+ }), e(o);
3673
3681
  } catch (r) {
3674
- console.error("Error initializing esbuild:", r), Te = null, t(new Error("The script bundler could not be loaded. Check your connection and try again.", { cause: r }));
3682
+ console.error("Error initializing esbuild:", r), Ce = null, t(new Error("The script bundler could not be loaded. Check your connection and try again.", { cause: r }));
3675
3683
  }
3676
- }), Te);
3684
+ }), Ce);
3677
3685
  }
3678
- var Te, ha = ar((() => {
3679
- Te = null;
3686
+ var Ce, go = or((() => {
3687
+ Ce = null;
3680
3688
  }));
3681
- let xe = null, Ve = null;
3682
- async function ga() {
3683
- if (xe) return xe;
3689
+ let Te = null, Ve = null;
3690
+ async function yo() {
3691
+ if (Te) return Te;
3684
3692
  if (Ve) {
3685
- if (await Ve, !xe) throw new Error("ESBuild initialization promise resolved, but instance is not available.");
3686
- return xe;
3693
+ if (await Ve, !Te) throw new Error("ESBuild initialization promise resolved, but instance is not available.");
3694
+ return Te;
3687
3695
  }
3688
3696
  let e, t;
3689
3697
  Ve = new Promise((r, n) => {
3690
3698
  e = r, t = n;
3691
3699
  });
3692
3700
  try {
3693
- const { initialize: r } = await Promise.resolve().then(() => (ha(), pa));
3694
- return xe = await r(), e(), xe;
3701
+ const { initialize: r } = await Promise.resolve().then(() => (go(), mo));
3702
+ return Te = await r(), e(), Te;
3695
3703
  } catch (r) {
3696
3704
  throw console.error("Failed to import or initialize esbuild:", r), Ve = null, t(r), r;
3697
3705
  }
3698
3706
  }
3699
- const ya = { compilerOptions: { target: "esnext" } };
3700
- async function wa(e, t, r = "/script.js", n = Ye, i = !1) {
3707
+ const wo = { compilerOptions: { target: "esnext" } };
3708
+ async function So(e, t, r = "/script.js", n = Ye, i = !1) {
3701
3709
  try {
3702
- const a = await ga(), l = "@sheetxl/primitives", s = \`
3710
+ const o = await yo(), l = "@sheetxl/primitives", s = \`
3703
3711
  export const FormulaContext = globalThis.\${n}?.FormulaContext;
3704
3712
  export const ScalarType = globalThis.\${n}?.ScalarType;
3705
3713
  export const Observable = globalThis.\${n}?.Observable;
3706
3714
  export const IRange = globalThis.\${n}?.IRange;
3707
3715
  export const FormulaError = globalThis.\${n}?.FormulaError;
3708
3716
  // Add more exports as needed
3709
- \`, c = await a.build({
3717
+ \`, c = await o.build({
3710
3718
  entryPoints: [r],
3711
3719
  bundle: !0,
3712
3720
  write: !1,
@@ -3715,22 +3723,22 @@ async function wa(e, t, r = "/script.js", n = Ye, i = !1) {
3715
3723
  name: "sheetxl-esbuild-in-memory",
3716
3724
  setup(d) {
3717
3725
  const m = "sheetxl-" + (/* @__PURE__ */ new Date()).getTime();
3718
- d.onResolve({ filter: new RegExp(\`^(\${r.replace("/", "\\\\/")}|\${l})$\`) }, (o) => ({
3719
- path: o.path,
3726
+ d.onResolve({ filter: new RegExp(\`^(\${r.replace("/", "\\\\/")}|\${l})$\`) }, (a) => ({
3727
+ path: a.path,
3720
3728
  namespace: m
3721
- })), d.onResolve({ filter: /.*/ }, (o) => {
3722
- if (o.namespace !== m) return console.warn(\`esbuild: Treating import "\${o.path}" as external.\`), {
3723
- path: o.path,
3729
+ })), d.onResolve({ filter: /.*/ }, (a) => {
3730
+ if (a.namespace !== m) return console.warn(\`esbuild: Treating import "\${a.path}" as external.\`), {
3731
+ path: a.path,
3724
3732
  external: !0
3725
3733
  };
3726
3734
  }), d.onLoad({
3727
3735
  filter: /.*/,
3728
3736
  namespace: m
3729
- }, (o) => {
3737
+ }, (a) => {
3730
3738
  let f;
3731
- if (o.path === r) f = t;
3732
- else if (o.path === l) f = s;
3733
- else return { errors: [{ text: \`Cannot load unknown path in \${m}: \${o.path}\` }] };
3739
+ if (a.path === r) f = t;
3740
+ else if (a.path === l) f = s;
3741
+ else return { errors: [{ text: \`Cannot load unknown path in \${m}: \${a.path}\` }] };
3734
3742
  return {
3735
3743
  contents: f,
3736
3744
  loader: "ts"
@@ -3739,55 +3747,55 @@ async function wa(e, t, r = "/script.js", n = Ye, i = !1) {
3739
3747
  }
3740
3748
  }],
3741
3749
  sourcemap: "inline",
3742
- tsconfigRaw: ya,
3750
+ tsconfigRaw: wo,
3743
3751
  minify: i,
3744
3752
  platform: "neutral"
3745
3753
  });
3746
3754
  if (c.outputFiles && c.outputFiles.length > 0) return c.outputFiles[0].text;
3747
3755
  throw c.errors && c.errors.length > 0 ? /* @__PURE__ */ new Error(\`esbuild bundling failed: \${c.errors.map((d) => d.text).join(\`
3748
3756
  \`)}\`) : /* @__PURE__ */ new Error("esbuild did not produce an output file.");
3749
- } catch (a) {
3750
- throw console.error("esbuild bundling process failed:", a), a;
3757
+ } catch (o) {
3758
+ throw console.error("esbuild bundling process failed:", o), o;
3751
3759
  }
3752
3760
  }
3753
- function Sa(e, t, r) {
3761
+ function bo(e, t, r) {
3754
3762
  return (n) => {
3755
- const i = n.factory, a = () => i.createExpressionStatement(i.createCallChain(i.createPropertyAccessExpression(i.createIdentifier(Ye), "checkRun"), i.createToken(e.SyntaxKind.QuestionDotToken), void 0, [i.createStringLiteral(t), i.createNumericLiteral(r)])), l = (o) => {
3756
- const f = o.statements;
3763
+ const i = n.factory, o = () => i.createExpressionStatement(i.createCallChain(i.createPropertyAccessExpression(i.createIdentifier(Ye), "checkRun"), i.createToken(e.SyntaxKind.QuestionDotToken), void 0, [i.createStringLiteral(t), i.createNumericLiteral(r)])), l = (a) => {
3764
+ const f = a.statements;
3757
3765
  let b = 0;
3758
3766
  for (; b < f.length && e.isExpressionStatement(f[b]) && e.isStringLiteral(f[b].expression);) b++;
3759
- return i.updateBlock(o, [
3767
+ return i.updateBlock(a, [
3760
3768
  ...f.slice(0, b),
3761
- a(),
3769
+ o(),
3762
3770
  ...f.slice(b)
3763
3771
  ]);
3764
- }, s = (o) => e.isBlock(o) ? l(o) : i.createBlock([a(), o], !0), c = (o) => e.isBlock(o) ? l(o) : i.createBlock([a(), i.createReturnStatement(o)], !0), d = (o) => e.isForStatement(o) || e.isForInStatement(o) || e.isForOfStatement(o) || e.isWhileStatement(o) || e.isDoStatement(o), m = (o) => {
3765
- if (d(o)) {
3766
- const f = o.statement;
3767
- return e.visitEachChild(o, (b) => {
3772
+ }, s = (a) => e.isBlock(a) ? l(a) : i.createBlock([o(), a], !0), c = (a) => e.isBlock(a) ? l(a) : i.createBlock([o(), i.createReturnStatement(a)], !0), d = (a) => e.isForStatement(a) || e.isForInStatement(a) || e.isForOfStatement(a) || e.isWhileStatement(a) || e.isDoStatement(a), m = (a) => {
3773
+ if (d(a)) {
3774
+ const f = a.statement;
3775
+ return e.visitEachChild(a, (b) => {
3768
3776
  const S = m(b);
3769
3777
  return b === f ? s(S) : S;
3770
3778
  }, n);
3771
3779
  }
3772
- if (e.isFunctionLike(o) && o.body) {
3773
- const f = o.body;
3774
- return e.visitEachChild(o, (b) => {
3780
+ if (e.isFunctionLike(a) && a.body) {
3781
+ const f = a.body;
3782
+ return e.visitEachChild(a, (b) => {
3775
3783
  const S = m(b);
3776
3784
  return b === f ? c(S) : S;
3777
3785
  }, n);
3778
3786
  }
3779
- return e.visitEachChild(o, m, n);
3787
+ return e.visitEachChild(a, m, n);
3780
3788
  };
3781
- return (o) => e.visitNode(o, m);
3789
+ return (a) => e.visitNode(a, m);
3782
3790
  };
3783
3791
  }
3784
3792
  const rr = "//# sourceMappingURL";
3785
- var an = /* @__PURE__ */ or({
3786
- initialize: () => ba,
3787
- readLibFile: () => va
3793
+ var on = /* @__PURE__ */ ar({
3794
+ initialize: () => vo,
3795
+ readLibFile: () => Eo
3788
3796
  });
3789
- async function ba() {
3790
- return Ce || (Ce = new Promise(async (e, t) => {
3797
+ async function vo() {
3798
+ return Ae || (Ae = new Promise(async (e, t) => {
3791
3799
  let r = null;
3792
3800
  try {
3793
3801
  r = await import(
@@ -3798,14 +3806,14 @@ async function ba() {
3798
3806
  } catch (n) {
3799
3807
  console.error("Error initializing Browser TypeScript module:", n);
3800
3808
  }
3801
- r || (console.log("use script fallback"), Ce = null), e(r);
3802
- }), Ce);
3809
+ r || (console.log("use script fallback"), Ae = null), e(r);
3810
+ }), Ae);
3803
3811
  }
3804
- function va(e, t) {}
3805
- var Ce, on = ar((() => {
3806
- Ce = null;
3812
+ function Eo(e, t) {}
3813
+ var Ae, an = or((() => {
3814
+ Ae = null;
3807
3815
  }));
3808
- const Ea = \`
3816
+ const _o = \`
3809
3817
  /**
3810
3818
  * Represents the completion of an asynchronous operation
3811
3819
  */
@@ -3818,21 +3826,21 @@ interface Promise<T> {
3818
3826
  */
3819
3827
  finally(onfinally?: (() => void) | undefined | null): Promise<T>;
3820
3828
  }
3821
- \`, _a = \`
3829
+ \`, xo = \`
3822
3830
  interface FirstTest {
3823
3831
  isTrue?: boolean;
3824
3832
  }
3825
- \`, xa = async () => _a;
3833
+ \`, To = async () => xo;
3826
3834
  let Xe = null;
3827
- const st = "sheetxl.d.ts", nr = "sheetxl-modules.d.ts", Ta = \`declare module '@sheetxl/primitives' { export = SheetXL; }
3828
- \`, Ca = [
3835
+ const st = "sheetxl.d.ts", nr = "sheetxl-modules.d.ts", Co = \`declare module '@sheetxl/primitives' { export = SheetXL; }
3836
+ \`, Ao = [
3829
3837
  "lib.webworker.d.ts",
3830
3838
  "lib.es2020.d.ts",
3831
3839
  "lib.esnext.asynciterable.d.ts"
3832
3840
  ], ir = /* @__PURE__ */ new Map();
3833
3841
  let ct = null, ut = null;
3834
- async function Aa() {
3835
- return ut || (ut = Promise.resolve().then(() => (on(), an)).then(async (e) => {
3842
+ async function Io() {
3843
+ return ut || (ut = Promise.resolve().then(() => (an(), on)).then(async (e) => {
3836
3844
  const t = await ln();
3837
3845
  return e.readLibFile(t, "lib.es5.d.ts") !== void 0 ? e.readLibFile : null;
3838
3846
  })), ut;
@@ -3840,7 +3848,7 @@ async function Aa() {
3840
3848
  async function ln() {
3841
3849
  if (Xe) return Xe;
3842
3850
  try {
3843
- const e = await (await Promise.resolve().then(() => (on(), an))).initialize();
3851
+ const e = await (await Promise.resolve().then(() => (an(), on))).initialize();
3844
3852
  if (!e) throw new Error("TypeScript could not be loaded. Check your connection and try again.");
3845
3853
  return e;
3846
3854
  } catch (e) {
@@ -3849,17 +3857,17 @@ async function ln() {
3849
3857
  Xe = null;
3850
3858
  }
3851
3859
  }
3852
- async function Ia(e) {
3860
+ async function Ro(e) {
3853
3861
  const t = e?.source ?? null;
3854
3862
  if (!t) return {
3855
3863
  module: null,
3856
3864
  diagnostics: []
3857
3865
  };
3858
- const r = (e.disableBundle || e.declarationsOnly) ?? !1, [n, i, a] = await Promise.all([
3859
- xa(),
3866
+ const r = (e.disableBundle || e.declarationsOnly) ?? !1, [n, i, o] = await Promise.all([
3867
+ To(),
3860
3868
  ln(),
3861
- e.ambientTypes ? Aa() : null
3862
- ]), l = a ? e.ambientTypes ?? null : null;
3869
+ e.ambientTypes ? Io() : null
3870
+ ]), l = o ? e.ambientTypes ?? null : null;
3863
3871
  let s = "";
3864
3872
  const c = {
3865
3873
  allowJs: !0,
@@ -3874,19 +3882,19 @@ async function Ia(e) {
3874
3882
  emitDeclarationOnly: !1,
3875
3883
  target: i.ScriptTarget.ES2020,
3876
3884
  ...l ? {
3877
- lib: Ca,
3885
+ lib: Ao,
3878
3886
  skipLibCheck: !0,
3879
3887
  strict: !0
3880
3888
  } : {}
3881
- }, d = "script", m = \`\${d}.ts\`, o = "lib.d.ts", f = "global.d.ts", b = {
3889
+ }, d = "script", m = \`\${d}.ts\`, a = "lib.d.ts", f = "global.d.ts", b = {
3882
3890
  [m]: t,
3883
- [o]: Ea,
3891
+ [a]: _o,
3884
3892
  [f]: n,
3885
3893
  ...l ? {
3886
3894
  [st]: l,
3887
- [nr]: Ta
3895
+ [nr]: Co
3888
3896
  } : {}
3889
- }, S = (p) => b[p] ?? (a && p.startsWith("lib.") ? a(i, p) : void 0), A = {
3897
+ }, S = (p) => b[p] ?? (o && p.startsWith("lib.") ? o(i, p) : void 0), A = {
3890
3898
  getSourceFile: (p, v, _, C) => {
3891
3899
  if (p === st) return ct?.text !== l && (ct = {
3892
3900
  text: l,
@@ -3911,7 +3919,7 @@ async function Ia(e) {
3911
3919
  getCurrentDirectory: () => "./",
3912
3920
  getCanonicalFileName: (p) => p,
3913
3921
  useCaseSensitiveFileNames: () => !0,
3914
- getDefaultLibFileName: (p) => o,
3922
+ getDefaultLibFileName: (p) => a,
3915
3923
  getNewLine: () => \`
3916
3924
  \`
3917
3925
  }, L = i.createProgram([
@@ -3919,7 +3927,7 @@ async function Ia(e) {
3919
3927
  f,
3920
3928
  ...l ? [st, nr] : []
3921
3929
  ], c, A), h = L.getTypeChecker(), y = L.getSourceFile(m), w = e.runGuard;
3922
- L.emit(void 0, void 0, void 0, void 0, w ? { before: [Sa(i, w.key, w.timeoutMs)] } : void 0), s = b[\`\${d}.js\`] ?? "";
3930
+ L.emit(void 0, void 0, void 0, void 0, w ? { before: [bo(i, w.key, w.timeoutMs)] } : void 0), s = b[\`\${d}.js\`] ?? "";
3923
3931
  const D = (p) => ({
3924
3932
  start: p.start ?? 0,
3925
3933
  length: p.length ?? 0,
@@ -3927,7 +3935,7 @@ async function Ia(e) {
3927
3935
  code: \`TS\${p.code}\`,
3928
3936
  message: i.flattenDiagnosticMessageText(p.messageText, \`
3929
3937
  \`)
3930
- }), K = L.getSyntacticDiagnostics(y).map(D), k = l ? L.getSemanticDiagnostics(y).filter((p) => p.category === i.DiagnosticCategory.Error || p.category === i.DiagnosticCategory.Warning).map(D) : [], R = fa(i, y, h, {
3938
+ }), K = L.getSyntacticDiagnostics(y).map(D), k = l ? L.getSemanticDiagnostics(y).filter((p) => p.category === i.DiagnosticCategory.Error || p.category === i.DiagnosticCategory.Warning).map(D) : [], R = po(i, y, h, {
3931
3939
  builtInNames: e.builtInNames,
3932
3940
  isBuiltIn: e.isBuiltIn,
3933
3941
  lenient: e.lenient
@@ -3938,26 +3946,26 @@ async function Ia(e) {
3938
3946
  ...R.diagnostics
3939
3947
  ];
3940
3948
  e.lenient && (F = F.filter((p) => p.code !== E.MissingType));
3941
- const de = R.functions, we = R.autoRun, te = F.some((p) => p.severity === "error"), Ze = \`\${lr.uuidV4()}-script\`;
3942
- let Ie = null;
3949
+ const de = R.functions, we = R.autoRun, te = F.some((p) => p.severity === "error"), Qe = \`\${lr.uuidV4()}-script\`;
3950
+ let Re = null;
3943
3951
  if (te) s = "";
3944
3952
  else {
3945
3953
  try {
3946
- r || (s = await wa(i, s, d, void 0, e.minify ?? !1));
3954
+ r || (s = await So(i, s, d, void 0, e.minify ?? !1));
3947
3955
  } catch {
3948
3956
  console.warn("Error bundling script");
3949
3957
  }
3950
3958
  const p = s.indexOf(rr);
3951
- p > -1 && (Ie = s.substring(p + 20 + 1, s.length), s = s.substring(0, p), s = s.replaceAll("globalThis." + Ye, Ye));
3959
+ p > -1 && (Re = s.substring(p + 20 + 1, s.length), s = s.substring(0, p), s = s.replaceAll("globalThis." + Ye, Ye));
3952
3960
  }
3953
3961
  const u = {
3954
3962
  functions: de,
3955
- commitId: Ze,
3963
+ commitId: Qe,
3956
3964
  source: t,
3957
3965
  language: "typescript",
3958
3966
  compiled: s
3959
3967
  };
3960
- return Ie && (u.sourceMap = Ie), we && (u.autoRun = we), {
3968
+ return Re && (u.sourceMap = Re), we && (u.autoRun = we), {
3961
3969
  module: u,
3962
3970
  diagnostics: F
3963
3971
  };
@@ -3965,7 +3973,7 @@ async function Ia(e) {
3965
3973
  self.addEventListener("message", async (e) => {
3966
3974
  const { id: t, params: r } = e.data;
3967
3975
  try {
3968
- const n = await Ia(r);
3976
+ const n = await Ro(r);
3969
3977
  self.postMessage({
3970
3978
  id: t,
3971
3979
  result: n,
@@ -3983,11 +3991,11 @@ self.addEventListener("message", async (e) => {
3983
3991
  });
3984
3992
  }
3985
3993
  });
3986
- `, o = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", s], { type: "text/javascript;charset=utf-8" });
3994
+ `, a = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", s], { type: "text/javascript;charset=utf-8" });
3987
3995
  function d(t) {
3988
3996
  let n;
3989
3997
  try {
3990
- if (n = o && (self.URL || self.webkitURL).createObjectURL(o), !n) throw "";
3998
+ if (n = a && (self.URL || self.webkitURL).createObjectURL(a), !n) throw "";
3991
3999
  const e = new Worker(n, { type: "module", name: t?.name });
3992
4000
  return e.addEventListener("error", () => {
3993
4001
  (self.URL || self.webkitURL).revokeObjectURL(n);