@sheetxl/scripting 0.4.13 → 0.4.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/cjs/{34iBAyHgzd1wjIbL.cjs → 3-RGSAiaXT2HOMK_.cjs} +1 -1
- package/browser/cjs/BC5OT57zRh8yrSLQ.cjs +13 -0
- package/browser/cjs/{FtCzRepb21szCWWo.cjs → C2i4KwT2tmglm9kQ.cjs} +2 -2
- package/browser/cjs/{D7p1GlEsqnlwvB3K.cjs → D02R0Cgf5E4um2CP.cjs} +5 -5
- package/browser/cjs/{Cwa_6JMSwgTCAbC4.cjs → D9YPrPdONari2od6.cjs} +385 -387
- package/browser/cjs/{C1r623K7ayZBgTm_.cjs → FnL1wUxRf7OR5HK1.cjs} +1 -1
- package/browser/cjs/index.cjs +2 -2
- package/browser/esm/{CRrnjwGGbtNwhYnV.mjs → Bmkw5DEeG8962lQa.mjs} +1 -1
- package/browser/esm/{BCabpDshAkNQO9_-.mjs → C7vVMSQNTuKjjo-L.mjs} +52 -58
- package/browser/esm/{zxvDdyWFKbHMjzBC.mjs → CgUmdK7PtrJJ-UWy.mjs} +1 -1
- package/browser/esm/{Do427VIOYeCKFKl4.mjs → CtaVPEmIY4AjIg5d.mjs} +2 -2
- package/browser/esm/{otmTmOwnAtat0vKx.mjs → aLRkuHyGxT3pantU.mjs} +20 -20
- package/browser/esm/{CT_-wr3IHgvtAO_d.mjs → ifE2tjluHwd8XWHM.mjs} +385 -387
- package/browser/esm/index.mjs +2 -2
- package/licenses/dependencies.txt +2 -2
- package/node/esm/{BsWEjczKGHMoYHPb.mjs → BmEEUH-e-6abUDuJ.mjs} +2 -2
- package/node/esm/{Dcn5tQzmmVjOVX1u.mjs → BzmHBBHx9IuQDgyH.mjs} +1 -1
- package/node/esm/{BZOj2GolCu2ca_tZ.mjs → C3TIRX2c5Sj3JjeI.mjs} +385 -387
- package/node/esm/{O2GKh9tWwubHKssv.mjs → DATh1LyXSh54FiRI.mjs} +3 -3
- package/node/esm/{mAtf8wb6YczY7TVk.mjs → I3Z5qZqLCUrv5zG7.mjs} +1 -1
- package/node/esm/index.mjs +2 -2
- package/package.json +3 -3
- package/browser/cjs/DXvW3LJ-K7xPq7I4.cjs +0 -13
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.15
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
package/browser/cjs/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.15
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./
|
|
6
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./BC5OT57zRh8yrSLQ.cjs");exports.ScriptingUtils=t.ScriptingUtils;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.15
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.15
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
6
|
*/
|
|
7
7
|
const h = "text/html", b = "text/plain", L = "image/png", Tt = Object.freeze({ left: 0, top: 0 }), Ct = Object.freeze({ left: 0, top: 0, bottom: 0, right: 0 }), Mt = Object.freeze({ x: 0, y: 0, width: 0, height: 0 });
|
|
8
8
|
Object.freeze(Object.defineProperty({ __proto__: null, EmptyBounds: Mt, EmptyRect: Ct, EmptyTopLeft: Tt }, Symbol.toStringTag, { value: "Module" }));
|
|
9
|
-
const m = "column", j = "row", Rt = Object.freeze({ colIndex: 0, rowIndex: 0 }), At = Object.freeze({ colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 }), yt = (e, t) => e.colStart === t.colStart ? e.rowStart - t.rowStart : e.colStart - t.colStart, gt = (e, t) => e.rowStart === t.rowStart ? e.colStart - t.colStart : e.rowStart - t.rowStart, Ft = (e, t) => e.rowEnd === t.rowEnd ? t.colEnd - e.colEnd : t.rowEnd - e.rowEnd, Lt = (e, t) => e.colEnd === t.colEnd ? t.rowEnd - e.rowEnd : t.colEnd - e.colEnd, J = (e, t) => e.colIndex === t.colIndex ? e.rowIndex - t.rowIndex : e.colIndex - t.colIndex, H = (e, t) => e.rowIndex === t.rowIndex ? e.colIndex - t.colIndex : e.rowIndex - t.rowIndex, bt = (e = j, t = !1) => t ? e !== m ? Ft : Lt : e !== m ? gt : yt,
|
|
9
|
+
const m = "column", j = "row", Rt = Object.freeze({ colIndex: 0, rowIndex: 0 }), At = Object.freeze({ colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 }), yt = (e, t) => e.colStart === t.colStart ? e.rowStart - t.rowStart : e.colStart - t.colStart, gt = (e, t) => e.rowStart === t.rowStart ? e.colStart - t.colStart : e.rowStart - t.rowStart, Ft = (e, t) => e.rowEnd === t.rowEnd ? t.colEnd - e.colEnd : t.rowEnd - e.rowEnd, Lt = (e, t) => e.colEnd === t.colEnd ? t.rowEnd - e.rowEnd : t.colEnd - e.colEnd, J = (e, t) => e.colIndex === t.colIndex ? e.rowIndex - t.rowIndex : e.colIndex - t.colIndex, H = (e, t) => e.rowIndex === t.rowIndex ? e.colIndex - t.colIndex : e.rowIndex - t.rowIndex, bt = (e = j, t = !1) => t ? e !== m ? Ft : Lt : e !== m ? gt : yt, Y = (e, t) => e === t || !(!e || !t) && e.rowIndex === t.rowIndex && e.colIndex === t.colIndex, D = (e, t) => e === t || !(!e || !t) && e.rowStart === t.rowStart && e.rowEnd === t.rowEnd && e.colStart === t.colStart && e.colEnd === t.colEnd, $ = (e, t) => !(!e || !t || e.colStart > t.colEnd || t.colStart > e.colEnd || e.rowStart > t.rowEnd || t.rowStart > e.rowEnd), K = (e, t) => {
|
|
10
10
|
if (e === t) return !0;
|
|
11
11
|
if (!e || !t || e.length !== t.length) return !1;
|
|
12
12
|
for (let n = 0; n < e.length; n++) if (!D(e[n], t[n])) return !1;
|
|
@@ -36,23 +36,23 @@ function X(e, t = 2, n, r = j, o) {
|
|
|
36
36
|
do {
|
|
37
37
|
const c = a.sort(bt(i ? j : m));
|
|
38
38
|
a = [], a.push(c[0]);
|
|
39
|
-
const
|
|
40
|
-
let w = 0,
|
|
41
|
-
for (let A = 1; A <
|
|
39
|
+
const d = c.length;
|
|
40
|
+
let w = 0, u = c[0], f = u.colStart, p = u.rowStart, x = u.colEnd, O = u.rowEnd;
|
|
41
|
+
for (let A = 1; A < d; A++) {
|
|
42
42
|
const g = c[A];
|
|
43
43
|
let G = !1;
|
|
44
|
-
if (G = i ?
|
|
44
|
+
if (G = i ? u && p === g.rowStart && O === g.rowEnd && x + 1 === g.colStart : u && f === g.colStart && x === g.colEnd && O + 1 === g.rowStart, G) {
|
|
45
45
|
let S = { colStart: f, rowStart: p, colEnd: i ? g.colEnd : x, rowEnd: i ? O : g.rowEnd };
|
|
46
|
-
if (
|
|
46
|
+
if (u.value !== void 0 && (S.value = u.value), n) {
|
|
47
47
|
const F = o ?? [null, null];
|
|
48
|
-
F[0] =
|
|
48
|
+
F[0] = u, F[1] = g, S = n(F, S, r);
|
|
49
49
|
}
|
|
50
50
|
if (S) {
|
|
51
|
-
a[w] = S, s = !0,
|
|
51
|
+
a[w] = S, s = !0, u = S, f = u.colStart, p = u.rowStart, x = u.colEnd, O = u.rowEnd;
|
|
52
52
|
continue;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
a[++w] = g,
|
|
55
|
+
a[++w] = g, u = g, f = u.colStart, p = u.rowStart, x = u.colEnd, O = u.rowEnd;
|
|
56
56
|
}
|
|
57
57
|
l++, i = !i, l === 1 && (s = !0);
|
|
58
58
|
} while (l < t && s && a.length > 1);
|
|
@@ -66,16 +66,16 @@ Object.freeze(Object.defineProperty({ __proto__: null, EmptyCell: Rt, EmptyRange
|
|
|
66
66
|
const n = [];
|
|
67
67
|
let r, o, a = Number.MIN_SAFE_INTEGER, i = Number.MIN_SAFE_INTEGER;
|
|
68
68
|
return { append: (l, s, c) => {
|
|
69
|
-
let
|
|
69
|
+
let d = !0;
|
|
70
70
|
const w = c !== void 0;
|
|
71
71
|
if (w) {
|
|
72
72
|
const p = e ? e(o, c, t) : o === c ? c : void 0;
|
|
73
|
-
p === void 0 ?
|
|
73
|
+
p === void 0 ? d = !1 : c = p;
|
|
74
74
|
}
|
|
75
|
-
if (
|
|
75
|
+
if (d && s === i + 1 && l === a) return t ? r.rowEnd = s : r.colEnd = s, i = s, void (o = c);
|
|
76
76
|
r && n.push(r);
|
|
77
|
-
const
|
|
78
|
-
r = { colStart:
|
|
77
|
+
const u = t ? l : s, f = t ? s : l;
|
|
78
|
+
r = { colStart: u, rowStart: f, colEnd: u, rowEnd: f }, w && (r.value = c), a = l, i = s, o = c;
|
|
79
79
|
}, done: (l) => (r && (n.push(r), r = null), l ? X(n, 3, l === !0 ? Pt : l, t ? m : j, Ut) : n) };
|
|
80
80
|
}, createRangeComparator: bt, defaultRange: (e, t, n) => e ? n ? (n.colStart = e.colStart ?? t.colStart, n.rowStart = e.rowStart ?? t.rowStart, n.colEnd = e.colEnd ?? t.colEnd, n.rowEnd = e.rowEnd ?? t.rowEnd, n) : { colStart: e.colStart ?? t.colStart, rowStart: e.rowStart ?? t.rowStart, colEnd: e.colEnd ?? t.colEnd, rowEnd: e.rowEnd ?? t.rowEnd } : t, extendRangeToIntersectingRanges: Z, extendRangeToUnionRanges: (e, t) => {
|
|
81
81
|
if (!t || t.length === 0) return e;
|
|
@@ -93,7 +93,7 @@ Object.freeze(Object.defineProperty({ __proto__: null, EmptyCell: Rt, EmptyRange
|
|
|
93
93
|
const r = Math.max(e.colStart, t.colStart), o = Math.max(e.rowStart, t.rowStart), a = Math.min(e.colEnd, t.colEnd), i = Math.min(e.rowEnd, t.rowEnd);
|
|
94
94
|
let l = n;
|
|
95
95
|
return l ? (l.colStart = r, l.rowStart = o, l.colEnd = a, l.rowEnd = i) : l = { colStart: r, rowStart: o, colEnd: a, rowEnd: i }, l;
|
|
96
|
-
}, isCellWithinRange: (e, t) => !(!e || !t || e.rowIndex < t.rowStart || e.rowIndex > t.rowEnd || e.colIndex < t.colStart || e.colIndex > t.colEnd), isEqualCells:
|
|
96
|
+
}, isCellWithinRange: (e, t) => !(!e || !t || e.rowIndex < t.rowStart || e.rowIndex > t.rowEnd || e.colIndex < t.colStart || e.colIndex > t.colEnd), isEqualCells: Y, isEqualRanges: D, isEqualRangesArrays: K, isEqualSelectionCoords: (e, t) => e === t || !(!e || !t) && e.rangeIndex === t.rangeIndex && !!Y(e.cell, t.cell) && K(e.ranges, t.ranges), isRangeWithinRange: (e, t) => !(e.rowStart < t.rowStart || e.rowEnd > t.rowEnd || e.colStart < t.colStart || e.colEnd > t.colEnd), isRangesIntersect: $, isSingleCell: (e) => !!e && e.rowEnd === e.rowStart && e.colStart === e.colEnd, isValidRange: (e) => !(!e || typeof e.colStart != "number" || e.colStart < 0 || typeof e.colEnd != "number" || e.colEnd < e.colStart || typeof e.rowStart != "number" || e.rowStart < 0 || typeof e.rowEnd != "number" || e.rowEnd < e.rowStart), mergeRangedValues: X, rowFirstCellComparator: H, rowFirstRangeComparator: gt, sanitizeRange: (e) => e ? { colStart: e.colIndex ?? e.colStart ?? 0, rowStart: e.rowIndex ?? e.rowStart ?? 0, colEnd: e.colIndex ?? e.colEnd ?? 0, rowEnd: e.rowIndex ?? e.rowEnd ?? 0 } : null, translateRange: (e, t = -e.rowStart, n = -e.colStart, r) => r ? (r.colStart = e.colStart + n, r.rowStart = e.rowStart + t, r.colEnd = e.colEnd + n, r.rowEnd = e.rowEnd + t, r) : { colStart: e.colStart + n, rowStart: e.rowStart + t, colEnd: e.colEnd + n, rowEnd: e.rowEnd + t }, unionRanges: U, unionRangesArrays: (e, t, n) => {
|
|
97
97
|
if (!e || e.length === 0) return null;
|
|
98
98
|
if (e.length === 1 && !t) return e[0];
|
|
99
99
|
let r = e[0];
|
|
@@ -106,9 +106,7 @@ function Nt(e) {
|
|
|
106
106
|
return !!t && typeof t == "object";
|
|
107
107
|
}(e) && !function(t) {
|
|
108
108
|
const n = Object.prototype.toString.call(t);
|
|
109
|
-
return n === "[object RegExp]" || n === "[object Date]" ||
|
|
110
|
-
return r.$$typeof === kt;
|
|
111
|
-
}(t);
|
|
109
|
+
return n === "[object RegExp]" || n === "[object Date]" || t.$$typeof === kt;
|
|
112
110
|
}(e);
|
|
113
111
|
}
|
|
114
112
|
function I(e, t) {
|
|
@@ -121,11 +119,10 @@ function Bt(e, t, n) {
|
|
|
121
119
|
});
|
|
122
120
|
}
|
|
123
121
|
function Q(e) {
|
|
124
|
-
return Object.keys(e).concat(
|
|
125
|
-
return Object.
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}(e));
|
|
122
|
+
return Object.keys(e).concat((t = e, Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(t).filter(function(n) {
|
|
123
|
+
return Object.propertyIsEnumerable.call(t, n);
|
|
124
|
+
}) : []));
|
|
125
|
+
var t;
|
|
129
126
|
}
|
|
130
127
|
function tt(e, t) {
|
|
131
128
|
try {
|
|
@@ -142,12 +139,11 @@ function E(e, t, n) {
|
|
|
142
139
|
return i.isMergeableObject(o) && Q(o).forEach(function(s) {
|
|
143
140
|
l[s] = I(o[s], i);
|
|
144
141
|
}), Q(a).forEach(function(s) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
})(o, s) || (tt(o, s) && i.isMergeableObject(a[s]) ? l[s] = function(c, u) {
|
|
142
|
+
var c, d;
|
|
143
|
+
tt(c = o, d = s) && (!Object.hasOwnProperty.call(c, d) || !Object.propertyIsEnumerable.call(c, d)) || (tt(o, s) && i.isMergeableObject(a[s]) ? l[s] = function(w, u) {
|
|
148
144
|
if (!u.customMerge) return E;
|
|
149
|
-
const
|
|
150
|
-
return typeof
|
|
145
|
+
const f = u.customMerge(w);
|
|
146
|
+
return typeof f == "function" ? f : E;
|
|
151
147
|
}(s, i)(o[s], a[s], i) : l[s] = I(a[s], i));
|
|
152
148
|
}), l;
|
|
153
149
|
}(e, t, n) : I(t, n);
|
|
@@ -199,14 +195,14 @@ const it = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeEl
|
|
|
199
195
|
}), debounce: function(e, t = 300, n = !1) {
|
|
200
196
|
let r, o, a, i, l = 0;
|
|
201
197
|
function s() {
|
|
202
|
-
let
|
|
203
|
-
|
|
198
|
+
let d = Date.now() - l;
|
|
199
|
+
d < t && d >= 0 ? r = setTimeout(s, t - d) : (r = null, n || (i = e.apply(a, o), a = o = null));
|
|
204
200
|
}
|
|
205
201
|
t == null && (t = 100);
|
|
206
202
|
const c = function() {
|
|
207
203
|
a = globalThis, o = arguments, l = Date.now();
|
|
208
|
-
var
|
|
209
|
-
return r || (r = setTimeout(s, t)),
|
|
204
|
+
var d = n && !r;
|
|
205
|
+
return r || (r = setTimeout(s, t)), d && (i = e.apply(a, o), a = o = null), i;
|
|
210
206
|
};
|
|
211
207
|
return c.clear = function() {
|
|
212
208
|
r && (clearTimeout(r), r = null);
|
|
@@ -508,19 +504,17 @@ Object.freeze(Object.defineProperty({ __proto__: null, DATA_URL_PNG_PREFIX: Ot,
|
|
|
508
504
|
const a = t?.properties, i = t?.arrayType ?? !1;
|
|
509
505
|
let l = o;
|
|
510
506
|
if (t && t.merge && l && r) l = t.merge(l, r, n);
|
|
511
|
-
else if (!i) {
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
w != null && (l = l ?? {}, l[u] = w);
|
|
523
|
-
}
|
|
507
|
+
else if (!i && a) {
|
|
508
|
+
const s = Object.keys({ ...o, ...r });
|
|
509
|
+
l = null;
|
|
510
|
+
for (let c = 0; c < s.length; c++) {
|
|
511
|
+
const d = s[c];
|
|
512
|
+
let w, u = o[d];
|
|
513
|
+
if (u !== void 0) {
|
|
514
|
+
const f = a[d];
|
|
515
|
+
w = f ? (0, ct.resolveTypedUpdates)(u, f, n, r?.[d]) : u;
|
|
516
|
+
} else w = r?.[d];
|
|
517
|
+
w != null && (l = l ?? {}, l[d] = w);
|
|
524
518
|
}
|
|
525
519
|
}
|
|
526
520
|
return l;
|
|
@@ -694,29 +688,29 @@ class wt {
|
|
|
694
688
|
await N(), o && a.length === 0 && (a.push(new ClipboardItem({ [v]: new Blob([o], { type: v }) })), a.push(new ClipboardItem({ [h]: new Blob([ft(o)], { type: h }) })));
|
|
695
689
|
for (let l = 0; l < Math.min(1, a.length); l++) {
|
|
696
690
|
const s = a[l];
|
|
697
|
-
let c = s.types.indexOf(h),
|
|
691
|
+
let c = s.types.indexOf(h), d = null;
|
|
698
692
|
if (c !== -1) {
|
|
699
693
|
const f = await s.getType(h);
|
|
700
|
-
|
|
694
|
+
d = await W(f), d && (d = Wt(o, d));
|
|
701
695
|
}
|
|
702
|
-
if (!
|
|
696
|
+
if (!d && s.types.includes(b)) {
|
|
703
697
|
const f = await s.getType(b);
|
|
704
698
|
if (f) {
|
|
705
699
|
let p = null;
|
|
706
|
-
typeof f == "string" ? (console.warn("text as string", f), p = f) : p = await W(f), p && (
|
|
700
|
+
typeof f == "string" ? (console.warn("text as string", f), p = f) : p = await W(f), p && (d = `<div ${C}="${o}">${p}</div>`);
|
|
707
701
|
}
|
|
708
702
|
}
|
|
709
|
-
if (!
|
|
703
|
+
if (!d && s.types.includes(L)) {
|
|
710
704
|
const f = await s.getType(L), p = xt(await f.arrayBuffer());
|
|
711
|
-
|
|
705
|
+
d = `<div ${C}="${o}"><img src="${Ot + p}"/></div>`;
|
|
712
706
|
}
|
|
713
|
-
!
|
|
714
|
-
const w = new Blob([
|
|
707
|
+
!d && o && (d = ft(o));
|
|
708
|
+
const w = new Blob([d ?? ""], { type: h }), u = {};
|
|
715
709
|
for (let f = 0; f < s.types.length; f++) {
|
|
716
710
|
const p = s.types[f];
|
|
717
|
-
|
|
711
|
+
u[p] = f === c ? w : s.getType(p);
|
|
718
712
|
}
|
|
719
|
-
|
|
713
|
+
d && c === -1 && (u[h] = w), o && (u[v] = new Blob([o], { type: v })), r.push(new ClipboardItem(u));
|
|
720
714
|
}
|
|
721
715
|
try {
|
|
722
716
|
r && r.length !== 0 ? await this._nativeClipboard.write(r) : await (async (l) => {
|
|
@@ -815,12 +809,12 @@ const Vt = Object.freeze({ compileTypescript: async function(e) {
|
|
|
815
809
|
if (q && $t.deepEqual(q, e)) return ht;
|
|
816
810
|
const t = await async function() {
|
|
817
811
|
if (M) return M;
|
|
818
|
-
const { TypeScriptCompiler: r } = await import("./
|
|
812
|
+
const { TypeScriptCompiler: r } = await import("./CtaVPEmIY4AjIg5d.mjs");
|
|
819
813
|
return M = new r(), M;
|
|
820
814
|
}(), n = await t.compileModule(e);
|
|
821
815
|
return ht = n, q = e, n;
|
|
822
816
|
} });
|
|
823
817
|
export {
|
|
824
818
|
Vt as S,
|
|
825
|
-
$t as
|
|
819
|
+
$t as Y
|
|
826
820
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.15
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.15
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -10,7 +10,7 @@ class o {
|
|
|
10
10
|
}
|
|
11
11
|
async getWorkerWrapper() {
|
|
12
12
|
if (this.workerWrapper) return this.workerWrapper;
|
|
13
|
-
const { createCompilerWorker: r } = await import("./
|
|
13
|
+
const { createCompilerWorker: r } = await import("./ifE2tjluHwd8XWHM.mjs");
|
|
14
14
|
return this.workerWrapper = await r(), this.workerWrapper;
|
|
15
15
|
}
|
|
16
16
|
async compileModule(r) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Y as he } from "./C7vVMSQNTuKjjo-L.mjs";
|
|
2
2
|
/**
|
|
3
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
3
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.15
|
|
4
4
|
*
|
|
5
5
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
6
6
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -166,7 +166,7 @@ var se, q, r;
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
e.Field = B;
|
|
169
|
-
class
|
|
169
|
+
class W extends a {
|
|
170
170
|
constructor(n, o) {
|
|
171
171
|
super(e.Code.Calc, e.Label.Calc, n, o);
|
|
172
172
|
}
|
|
@@ -174,7 +174,7 @@ var se, q, r;
|
|
|
174
174
|
this.code = e.Code.Calc;
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
-
e.Calc =
|
|
177
|
+
e.Calc = W;
|
|
178
178
|
class O extends a {
|
|
179
179
|
constructor(n, o) {
|
|
180
180
|
super(e.Code.Busy, e.Label.Busy, n, o);
|
|
@@ -193,7 +193,7 @@ var se, q, r;
|
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
e.Python = A;
|
|
196
|
-
class
|
|
196
|
+
class X extends a {
|
|
197
197
|
constructor(n, o) {
|
|
198
198
|
super(e.Code.Timeout, e.Label.Timeout, n, o);
|
|
199
199
|
}
|
|
@@ -201,7 +201,7 @@ var se, q, r;
|
|
|
201
201
|
this.code = e.Code.Timeout;
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
e.Timeout =
|
|
204
|
+
e.Timeout = X;
|
|
205
205
|
})(r || (r = {}));
|
|
206
206
|
const f = {};
|
|
207
207
|
f[r.Code.Parse] = r.Parse, f[r.Code.Null] = r.Null, f[r.Code.Div0] = r.Div0, f[r.Code.Value] = r.Value, f[r.Code.Ref] = r.Ref, f[r.Code.Name] = r.Name, f[r.Code.Num] = r.Num, f[r.Code.NA] = r.NA, f[r.Code.GettingData] = r.GettingData, f[r.Code.Spill] = r.Spill, f[r.Code.Connect] = r.Connect, f[r.Code.Blocked] = r.Blocked, f[r.Code.Unknown] = r.Unknown, f[r.Code.Field] = r.Field, f[r.Code.Calc] = r.Calc, f[r.Code.Busy] = r.Busy, f[r.Code.Python] = r.Python, f[r.Code.Timeout] = r.Timeout;
|
|
@@ -218,25 +218,25 @@ var u;
|
|
|
218
218
|
let p;
|
|
219
219
|
return p = typeof e == "string" ? de.get(e) : ue.get(e), p || (p = u.Unknown), new p(a, C);
|
|
220
220
|
}, u.getBuiltInById = (e) => ne.get(e) || xe;
|
|
221
|
-
let I = null,
|
|
221
|
+
let I = null, Y = null;
|
|
222
222
|
const be = { compilerOptions: { target: "esnext" } };
|
|
223
223
|
async function Te(e, a, C = "/script.js", p = "__SHEETXL") {
|
|
224
224
|
try {
|
|
225
225
|
const F = await async function() {
|
|
226
226
|
if (I) return I;
|
|
227
|
-
if (
|
|
228
|
-
if (await
|
|
227
|
+
if (Y) {
|
|
228
|
+
if (await Y, !I) throw new Error("ESBuild initialization promise resolved, but instance is not available.");
|
|
229
229
|
return I;
|
|
230
230
|
}
|
|
231
231
|
let b, N;
|
|
232
|
-
|
|
232
|
+
Y = new Promise((d, S) => {
|
|
233
233
|
b = d, N = S;
|
|
234
234
|
});
|
|
235
235
|
try {
|
|
236
|
-
const { initialize: d } = await import("./
|
|
236
|
+
const { initialize: d } = await import("./CgUmdK7PtrJJ-UWy.mjs");
|
|
237
237
|
return I = await d(), b(), I;
|
|
238
238
|
} catch (d) {
|
|
239
|
-
throw console.error("Failed to import or initialize esbuild:", d),
|
|
239
|
+
throw console.error("Failed to import or initialize esbuild:", d), Y = null, N(d), d;
|
|
240
240
|
}
|
|
241
241
|
}(), R = "@sheetxl/primitives", s = `
|
|
242
242
|
export const FormulaContext = globalThis.${p}?.FormulaContext;
|
|
@@ -278,15 +278,15 @@ const ke = async () => `
|
|
|
278
278
|
}, Ne = /* @__PURE__ */ new Map([["Scalar", "*"], ["FormulaError.Known", Ce], ["Date", "Date"], ["JSON", "JSON"]]), Se = /* @__PURE__ */ new Map([]), te = "SheetXL";
|
|
279
279
|
ee(te, pe), ee(te, me), ee(te, Se);
|
|
280
280
|
const Ee = /* @__PURE__ */ new Map([["Promise", () => ({ async: !0 })], ["Observable", () => ({ stream: !0 })]]);
|
|
281
|
-
let
|
|
281
|
+
let H = null;
|
|
282
282
|
async function Le() {
|
|
283
|
-
if (
|
|
283
|
+
if (H) return H;
|
|
284
284
|
try {
|
|
285
|
-
return await (await import("./
|
|
285
|
+
return await (await import("./Bmkw5DEeG8962lQa.mjs")).initialize();
|
|
286
286
|
} catch (e) {
|
|
287
|
-
throw
|
|
287
|
+
throw H = null, e;
|
|
288
288
|
} finally {
|
|
289
|
-
|
|
289
|
+
H = null;
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
async function ve(e) {
|
|
@@ -307,10 +307,10 @@ interface Promise<T> {
|
|
|
307
307
|
*/
|
|
308
308
|
finally(onfinally?: (() => void) | undefined | null): Promise<T>;
|
|
309
309
|
}
|
|
310
|
-
`, [_]: R },
|
|
310
|
+
`, [_]: R }, W = { getSourceFile: (t, i, T, E) => s.createSourceFile(t, B[t], s.ScriptTarget.Latest, !0), fileExists: (t) => B[t] !== void 0, readFile: (t) => B[t], writeFile: (t, i) => {
|
|
311
311
|
B[t] = i;
|
|
312
312
|
}, getCurrentDirectory: () => "./", getCanonicalFileName: (t) => t, useCaseSensitiveFileNames: () => !0, getDefaultLibFileName: (t) => G, getNewLine: () => `
|
|
313
|
-
` }, O = s.createProgram([S, _], N,
|
|
313
|
+
` }, O = s.createProgram([S, _], N, W), A = O.getTypeChecker(), X = O.getSourceFile(S), m = O.emit();
|
|
314
314
|
m.diagnostics.length > 0 && console.warn(m.diagnostics), K = B[`${d}.js`];
|
|
315
315
|
const n = (t, i, T, E) => {
|
|
316
316
|
if (t) {
|
|
@@ -356,7 +356,7 @@ interface Promise<T> {
|
|
|
356
356
|
}, o = [], L = (t, i) => {
|
|
357
357
|
o.push(i);
|
|
358
358
|
};
|
|
359
|
-
if (s.forEachChild(
|
|
359
|
+
if (s.forEachChild(X, (t) => {
|
|
360
360
|
if (((i) => (s.getCombinedModifierFlags(i) & s.ModifierFlags.Export) !== 0)(t) && s.isFunctionDeclaration(t)) {
|
|
361
361
|
const i = {}, T = { parameters: {} }, E = t?.name?.getText();
|
|
362
362
|
try {
|