@sheetxl/scripting 0.4.10 → 0.4.11
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/{CuRwP5MTc0sKqfRf.cjs → 0e_ieEwRgvHNzBct.cjs} +387 -385
- package/browser/cjs/{CJbQzW9SauWj1FBs.cjs → Bpcm__gmXmCT_9GX.cjs} +1 -1
- package/browser/cjs/{Bsq5VlJY-Td38K9C.cjs → BuB0aUcbgtZttT_w.cjs} +5 -5
- package/browser/cjs/CiJlgV1IXEmXJpsD.cjs +13 -0
- package/browser/cjs/{BPtWwADfTFtbtFp1.cjs → DHftuK8qPwcJe7Zj.cjs} +2 -2
- package/browser/cjs/index.cjs +2 -2
- package/browser/cjs/{D7hfNYOs7_pkIGbS.cjs → svT_bjMJTvfjJKLz.cjs} +1 -1
- package/browser/esm/{CScJG5QypXGnPkR2.mjs → B1ySwHm9YBwNYmJx.mjs} +387 -385
- package/browser/esm/{DK5PDu18K4_x66tQ.mjs → BCebrtm_TvBRuVB_.mjs} +58 -52
- package/browser/esm/{kareFFeW32O_ajMm.mjs → CKXcZ5awOabLTBIS.mjs} +1 -1
- package/browser/esm/{GsUk_uxd64EIkKwU.mjs → CoWXpBDGlVMCdmL6.mjs} +20 -20
- package/browser/esm/{fKEbHLCqu8DVTdFS.mjs → DVU8CuXcV7gxTc_P.mjs} +1 -1
- package/{node/esm/BwmZ8LkckrBAukJF.mjs → browser/esm/T3-nyuSCbau9JYmi.mjs} +2 -2
- package/browser/esm/index.mjs +2 -2
- package/licenses/dependencies.txt +2 -2
- package/node/esm/{B4O_Vb46djSB-6pt.mjs → BIvKOd32LAmxQo9T.mjs} +1 -1
- package/node/esm/{DHRL2LI8r6S4fCwI.mjs → DJicGDnUI-FD-BZk.mjs} +1 -1
- package/node/esm/{CiTOh9mK8ZyCe6vy.mjs → KKXOq6IO5VJGFx3U.mjs} +3 -3
- package/{browser/esm/BU7b75vTym2nREBl.mjs → node/esm/bYDfL7gXUKKr8g9_.mjs} +2 -2
- package/node/esm/{Ankf3x5Wv3jyLLnO.mjs → dFmhuJa_KcpGexrv.mjs} +387 -385
- package/node/esm/index.mjs +2 -2
- package/package.json +3 -3
- package/browser/cjs/DOgVGbF-vm0eId3R.cjs +0 -13
|
@@ -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.11
|
|
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.
|
|
@@ -47,7 +47,7 @@ class u {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
const s = `/**
|
|
50
|
-
* @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.4.
|
|
50
|
+
* @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.4.11
|
|
51
51
|
*
|
|
52
52
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
53
53
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -83,7 +83,7 @@ var Re, ae, d;
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
e.Known = t;
|
|
86
|
-
class
|
|
86
|
+
class n extends t {
|
|
87
87
|
constructor(c, m) {
|
|
88
88
|
super(e.Code.Parse, e.Label.Parse, c, m);
|
|
89
89
|
}
|
|
@@ -95,8 +95,8 @@ var Re, ae, d;
|
|
|
95
95
|
return { line: c?.line ?? 1, column: c?.column ?? 1, offset: c?.offset ?? 0, length: c?.length ?? 0 };
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
|
-
e.Parse =
|
|
99
|
-
class
|
|
98
|
+
e.Parse = n;
|
|
99
|
+
class r extends t {
|
|
100
100
|
constructor(c, m) {
|
|
101
101
|
super(e.Code.Null, e.Label.Null, c, m);
|
|
102
102
|
}
|
|
@@ -104,7 +104,7 @@ var Re, ae, d;
|
|
|
104
104
|
this.code = e.Code.Null;
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
e.Null =
|
|
107
|
+
e.Null = r;
|
|
108
108
|
class o extends t {
|
|
109
109
|
constructor(c, m) {
|
|
110
110
|
super(e.Code.Div0, e.Label.Div0, c, m);
|
|
@@ -252,54 +252,54 @@ var Re, ae, d;
|
|
|
252
252
|
})(d || (d = {}));
|
|
253
253
|
const _ = {};
|
|
254
254
|
_[d.Code.Parse] = d.Parse, _[d.Code.Null] = d.Null, _[d.Code.Div0] = d.Div0, _[d.Code.Value] = d.Value, _[d.Code.Ref] = d.Ref, _[d.Code.Name] = d.Name, _[d.Code.Num] = d.Num, _[d.Code.NA] = d.NA, _[d.Code.GettingData] = d.GettingData, _[d.Code.Spill] = d.Spill, _[d.Code.Connect] = d.Connect, _[d.Code.Blocked] = d.Blocked, _[d.Code.Unknown] = d.Unknown, _[d.Code.Field] = d.Field, _[d.Code.Calc] = d.Calc, _[d.Code.Busy] = d.Busy, _[d.Code.Python] = d.Python, _[d.Code.Timeout] = d.Timeout;
|
|
255
|
-
const et = /* @__PURE__ */ new Map(), Te = /* @__PURE__ */ new Map(), tt = /* @__PURE__ */ new Map(),
|
|
255
|
+
const et = /* @__PURE__ */ new Map(), Te = /* @__PURE__ */ new Map(), tt = /* @__PURE__ */ new Map(), nt = /* @__PURE__ */ new Map(), ke = Object.keys(_);
|
|
256
256
|
for (let e = 0; e < ke.length; e++) {
|
|
257
|
-
const t = ke[e],
|
|
258
|
-
tt.set(d.Label[t],
|
|
259
|
-
const
|
|
260
|
-
et.set(
|
|
257
|
+
const t = ke[e], n = _[t];
|
|
258
|
+
tt.set(d.Label[t], n), nt.set(d.Code[t], n);
|
|
259
|
+
const r = new n();
|
|
260
|
+
et.set(r.getLabel(), r), Te.set(r.getCode(), r);
|
|
261
261
|
}
|
|
262
262
|
const Et = Te.get(d.Code.Unknown);
|
|
263
263
|
var v;
|
|
264
|
-
(v = d || (d = {})).BuiltIn = { Parse: new v.Parse(), Null: new v.Null(), Div0: new v.Div0(), Value: new v.Value(), Ref: new v.Ref(), Name: new v.Name(), Num: new v.Num(), NA: new v.NA(), GettingData: new v.GettingData(), Spill: new v.Spill(), Connect: new v.Connect(), Blocked: new v.Blocked(), Unknown: new v.Unknown(), Field: new v.Field(), Calc: new v.Calc(), Busy: new v.Busy(), Python: new v.Python(), Timeout: new v.Timeout() }, v.getBuiltInByLabel = (e) => et.get(e), v.newTypedError = (e, t,
|
|
265
|
-
let
|
|
266
|
-
return
|
|
264
|
+
(v = d || (d = {})).BuiltIn = { Parse: new v.Parse(), Null: new v.Null(), Div0: new v.Div0(), Value: new v.Value(), Ref: new v.Ref(), Name: new v.Name(), Num: new v.Num(), NA: new v.NA(), GettingData: new v.GettingData(), Spill: new v.Spill(), Connect: new v.Connect(), Blocked: new v.Blocked(), Unknown: new v.Unknown(), Field: new v.Field(), Calc: new v.Calc(), Busy: new v.Busy(), Python: new v.Python(), Timeout: new v.Timeout() }, v.getBuiltInByLabel = (e) => et.get(e), v.newTypedError = (e, t, n) => {
|
|
265
|
+
let r;
|
|
266
|
+
return r = typeof e == "string" ? tt.get(e) : nt.get(e), r || (r = v.Unknown), new r(t, n);
|
|
267
267
|
}, v.getBuiltInById = (e) => Te.get(e) || Et;
|
|
268
268
|
/**
|
|
269
|
-
* @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.4.
|
|
269
|
+
* @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.4.11
|
|
270
270
|
*
|
|
271
271
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
272
272
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
273
273
|
*/
|
|
274
274
|
const S = { html: "text/html", plain: "text/plain", png: "image/png" }, St = Object.freeze({ left: 0, top: 0 }), xt = Object.freeze({ left: 0, top: 0, bottom: 0, right: 0 }), Ct = Object.freeze({ x: 0, y: 0, width: 0, height: 0 });
|
|
275
275
|
Object.freeze(Object.defineProperty({ __proto__: null, EmptyBounds: Ct, EmptyRect: xt, EmptyTopLeft: St }, Symbol.toStringTag, { value: "Module" }));
|
|
276
|
-
const j = { Column: "column", Row: "row" }, vt = Object.freeze({ colIndex: 0, rowIndex: 0 }), Tt = Object.freeze({ colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 }),
|
|
276
|
+
const j = { Column: "column", Row: "row" }, vt = Object.freeze({ colIndex: 0, rowIndex: 0 }), Tt = Object.freeze({ colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 }), rt = (e, t) => e.colStart === t.colStart ? e.rowStart - t.rowStart : e.colStart - t.colStart, ot = (e, t) => e.rowStart === t.rowStart ? e.colStart - t.colStart : e.rowStart - t.rowStart, _t = (e, t) => e.rowEnd === t.rowEnd ? t.colEnd - e.colEnd : t.rowEnd - e.rowEnd, Ot = (e, t) => e.colEnd === t.colEnd ? t.rowEnd - e.rowEnd : t.colEnd - e.colEnd, Le = (e, t) => e.colIndex === t.colIndex ? e.rowIndex - t.rowIndex : e.colIndex - t.colIndex, Ae = (e, t) => e.rowIndex === t.rowIndex ? e.colIndex - t.colIndex : e.rowIndex - t.rowIndex, it = (e = j.Row, t = !1) => t ? e !== j.Column ? _t : Ot : e !== j.Column ? ot : rt, Me = (e, t) => e === t || !(!e || !t) && e.rowIndex === t.rowIndex && e.colIndex === t.colIndex, Se = (e, t) => e === t || !(!e || !t) && e.rowStart === t.rowStart && e.rowEnd === t.rowEnd && e.colStart === t.colStart && e.colEnd === t.colEnd, xe = (e, t) => !(!e || !t) && !(e.colStart > t.colEnd || t.colStart > e.colEnd) && !(e.rowStart > t.rowEnd || t.rowStart > e.rowEnd), je = (e, t) => {
|
|
277
277
|
if (e === t) return !0;
|
|
278
278
|
if (!e || !t || e.length !== t.length) return !1;
|
|
279
|
-
for (let
|
|
279
|
+
for (let n = 0; n < e.length; n++) if (!Se(e[n], t[n])) return !1;
|
|
280
280
|
return !0;
|
|
281
|
-
}, he = (e, t,
|
|
281
|
+
}, he = (e, t, n) => {
|
|
282
282
|
if (!e && !t) return null;
|
|
283
|
-
if (!e) return
|
|
284
|
-
if (!t) return
|
|
285
|
-
const
|
|
286
|
-
let l =
|
|
287
|
-
return l ? (l.colStart =
|
|
283
|
+
if (!e) return n ? t : { ...t };
|
|
284
|
+
if (!t) return n ? e : { ...e };
|
|
285
|
+
const r = Math.min(e.colStart, t.colStart), o = Math.min(e.rowStart, t.rowStart), i = Math.max(e.colEnd, t.colEnd), a = Math.max(e.rowEnd, t.rowEnd);
|
|
286
|
+
let l = n;
|
|
287
|
+
return l ? (l.colStart = r, l.rowStart = o, l.colEnd = i, l.rowEnd = a) : l = { colStart: r, rowStart: o, colEnd: i, rowEnd: a }, l;
|
|
288
288
|
}, Pe = (e, t) => {
|
|
289
289
|
if (!t || t.length === 0) return e;
|
|
290
|
-
const
|
|
291
|
-
for (let
|
|
292
|
-
const o = t[
|
|
293
|
-
xe(
|
|
290
|
+
const n = { ...e };
|
|
291
|
+
for (let r = 0; r < t.length; r++) {
|
|
292
|
+
const o = t[r];
|
|
293
|
+
xe(n, o) && (n.rowStart = Math.min(n.rowStart, o.rowStart), n.colStart = Math.min(n.colStart, o.colStart), n.rowEnd = Math.max(n.rowEnd, o.rowEnd), n.colEnd = Math.max(n.colEnd, o.colEnd));
|
|
294
294
|
}
|
|
295
|
-
return
|
|
296
|
-
}, It = [null, null], Nt = (e, t,
|
|
295
|
+
return n;
|
|
296
|
+
}, It = [null, null], Nt = (e, t, n) => {
|
|
297
297
|
if (e[0].value === e[1].value) return t;
|
|
298
298
|
};
|
|
299
|
-
function Fe(e, t = 2,
|
|
299
|
+
function Fe(e, t = 2, n, r = j.Row, o) {
|
|
300
300
|
let i = [...e];
|
|
301
301
|
if (t <= 0 || e.length <= 1) return i;
|
|
302
|
-
let a =
|
|
302
|
+
let a = r === j.Column, l = 0, u = !1;
|
|
303
303
|
do {
|
|
304
304
|
const f = i.sort(it(a ? j.Row : j.Column));
|
|
305
305
|
i = [], i.push(f[0]);
|
|
@@ -310,9 +310,9 @@ function Fe(e, t = 2, r, n = j.Row, o) {
|
|
|
310
310
|
let J = !1;
|
|
311
311
|
if (J = a ? p && T === I.rowStart && D === I.rowEnd && A + 1 === I.colStart : p && y === I.colStart && A === I.colEnd && D + 1 === I.rowStart, J) {
|
|
312
312
|
let E = { colStart: y, rowStart: T, colEnd: a ? I.colEnd : A, rowEnd: a ? D : I.rowEnd };
|
|
313
|
-
if (p.value !== void 0 && (E.value = p.value),
|
|
313
|
+
if (p.value !== void 0 && (E.value = p.value), n) {
|
|
314
314
|
const c = o ?? [null, null];
|
|
315
|
-
c[0] = p, c[1] = I, E =
|
|
315
|
+
c[0] = p, c[1] = I, E = n(c, E, r);
|
|
316
316
|
}
|
|
317
317
|
if (E) {
|
|
318
318
|
i[g] = E, u = !0, p = E, y = p.colStart, T = p.rowStart, A = p.colEnd, D = p.rowEnd;
|
|
@@ -327,11 +327,11 @@ function Fe(e, t = 2, r, n = j.Row, o) {
|
|
|
327
327
|
}
|
|
328
328
|
Object.freeze(Object.defineProperty({ __proto__: null, EmptyCell: vt, EmptyRange: Tt, cellToRange: (e, t) => {
|
|
329
329
|
if (!e) return null;
|
|
330
|
-
let
|
|
331
|
-
return
|
|
332
|
-
}, columnFirstCellComparator: Le, columnFirstRangeComparator:
|
|
333
|
-
const
|
|
334
|
-
let
|
|
330
|
+
let n = t;
|
|
331
|
+
return n || (n = { ...e }, delete n.colIndex, delete n.rowIndex), n.colStart = e.colIndex ?? 0, n.rowStart = e.rowIndex ?? 0, n.colEnd = e.colIndex ?? 0, n.rowEnd = e.rowIndex ?? 0, n;
|
|
332
|
+
}, columnFirstCellComparator: Le, columnFirstRangeComparator: rt, createCellComparator: (e = j.Row, t = !1) => t ? e !== j.Column ? (n, r) => n.rowIndex === r.rowIndex ? r.colIndex - n.colIndex : r.rowIndex - n.rowIndex : (n, r) => n.colIndex === r.colIndex ? r.rowIndex - n.rowIndex : r.colIndex - n.colIndex : e !== j.Column ? Ae : Le, createConflatingRanges: (e, t = !1) => {
|
|
333
|
+
const n = [];
|
|
334
|
+
let r, o, i = Number.MIN_SAFE_INTEGER, a = Number.MIN_SAFE_INTEGER;
|
|
335
335
|
return { append: (l, u, f) => {
|
|
336
336
|
let h = !0;
|
|
337
337
|
const g = f !== void 0;
|
|
@@ -339,38 +339,38 @@ Object.freeze(Object.defineProperty({ __proto__: null, EmptyCell: vt, EmptyRange
|
|
|
339
339
|
const T = e ? e(o, f, t) : o === f ? f : void 0;
|
|
340
340
|
T === void 0 ? h = !1 : f = T;
|
|
341
341
|
}
|
|
342
|
-
if (h && u === a + 1 && l === i) return t ?
|
|
343
|
-
|
|
342
|
+
if (h && u === a + 1 && l === i) return t ? r.rowEnd = u : r.colEnd = u, a = u, void (o = f);
|
|
343
|
+
r && n.push(r);
|
|
344
344
|
const p = t ? l : u, y = t ? u : l;
|
|
345
|
-
|
|
346
|
-
}, done: (l) => (
|
|
347
|
-
}, createRangeComparator: it, defaultRange: (e, t,
|
|
345
|
+
r = { colStart: p, rowStart: y, colEnd: p, rowEnd: y }, g && (r.value = f), i = l, a = u, o = f;
|
|
346
|
+
}, done: (l) => (r && (n.push(r), r = null), l ? Fe(n, 3, l === !0 ? Nt : l, t ? j.Column : j.Row, It) : n) };
|
|
347
|
+
}, createRangeComparator: it, 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: Pe, extendRangeToUnionRanges: (e, t) => {
|
|
348
348
|
if (!t || t.length === 0) return e;
|
|
349
|
-
let
|
|
350
|
-
for (; !Se(
|
|
351
|
-
return
|
|
349
|
+
let n = e, r = null;
|
|
350
|
+
for (; !Se(n, r); ) r = n, n = Pe(r, t);
|
|
351
|
+
return n;
|
|
352
352
|
}, indexOfCoords: (e, t) => {
|
|
353
|
-
const
|
|
354
|
-
for (let
|
|
353
|
+
const n = { colStart: e.colIndex, rowStart: e.rowIndex, colEnd: e.colIndex, rowEnd: e.rowIndex };
|
|
354
|
+
for (let r = t.length - 1; r >= 0; r--) if (xe(n, t[r])) return r;
|
|
355
355
|
return -1;
|
|
356
|
-
}, intersectRanges: (e, t,
|
|
357
|
-
if (!e) return
|
|
358
|
-
if (!t) return
|
|
356
|
+
}, intersectRanges: (e, t, n) => {
|
|
357
|
+
if (!e) return n ? t : { ...t };
|
|
358
|
+
if (!t) return n ? e : { ...e };
|
|
359
359
|
if (!e && !t || e.rowStart > t.rowEnd || e.rowEnd < t.rowStart || e.colStart > t.colEnd || e.colEnd < t.colStart) return null;
|
|
360
|
-
const
|
|
361
|
-
let l =
|
|
362
|
-
return l ? (l.colStart =
|
|
363
|
-
}, isCellWithinRange: (e, t) => !(!e || !t) && !(e.rowIndex < t.rowStart || e.rowIndex > t.rowEnd) && !(e.colIndex < t.colStart || e.colIndex > t.colEnd), isEqualCells: Me, isEqualRanges: Se, isEqualRangesArrays: je, isEqualSelectionCoords: (e, t) => e === t || !(!e || !t) && e.rangeIndex === t.rangeIndex && !!Me(e.cell, t.cell) && je(e.ranges, t.ranges), isRangeWithinRange: (e, t) => !(e.rowStart < t.rowStart || e.rowEnd > t.rowEnd) && !(e.colStart < t.colStart || e.colEnd > t.colEnd), isRangesIntersect: xe, 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: Fe, rowFirstCellComparator: Ae, rowFirstRangeComparator: ot, 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,
|
|
360
|
+
const r = Math.max(e.colStart, t.colStart), o = Math.max(e.rowStart, t.rowStart), i = Math.min(e.colEnd, t.colEnd), a = Math.min(e.rowEnd, t.rowEnd);
|
|
361
|
+
let l = n;
|
|
362
|
+
return l ? (l.colStart = r, l.rowStart = o, l.colEnd = i, l.rowEnd = a) : l = { colStart: r, rowStart: o, colEnd: i, rowEnd: a }, l;
|
|
363
|
+
}, isCellWithinRange: (e, t) => !(!e || !t) && !(e.rowIndex < t.rowStart || e.rowIndex > t.rowEnd) && !(e.colIndex < t.colStart || e.colIndex > t.colEnd), isEqualCells: Me, isEqualRanges: Se, isEqualRangesArrays: je, isEqualSelectionCoords: (e, t) => e === t || !(!e || !t) && e.rangeIndex === t.rangeIndex && !!Me(e.cell, t.cell) && je(e.ranges, t.ranges), isRangeWithinRange: (e, t) => !(e.rowStart < t.rowStart || e.rowEnd > t.rowEnd) && !(e.colStart < t.colStart || e.colEnd > t.colEnd), isRangesIntersect: xe, 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: Fe, rowFirstCellComparator: Ae, rowFirstRangeComparator: ot, 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: he, unionRangesArrays: (e, t, n) => {
|
|
364
364
|
if (!e || e.length === 0) return null;
|
|
365
365
|
if (e.length === 1 && !t) return e[0];
|
|
366
|
-
let
|
|
367
|
-
for (let o = 1; o < e.length; o++)
|
|
368
|
-
return t && (
|
|
366
|
+
let r = e[0];
|
|
367
|
+
for (let o = 1; o < e.length; o++) r = he(r, e[o], n);
|
|
368
|
+
return t && (r = he(r, t, n)), r;
|
|
369
369
|
} }, Symbol.toStringTag, { value: "Module" }));
|
|
370
370
|
function Rt(e) {
|
|
371
371
|
const t = Object.prototype.toString.call(e);
|
|
372
|
-
return t === "[object RegExp]" || t === "[object Date]" || function(
|
|
373
|
-
return
|
|
372
|
+
return t === "[object RegExp]" || t === "[object Date]" || function(n) {
|
|
373
|
+
return n.$$typeof === kt;
|
|
374
374
|
}(e);
|
|
375
375
|
}
|
|
376
376
|
const kt = typeof Symbol == "function" && Symbol.for ? Symbol.for("react.element") : 60103;
|
|
@@ -379,19 +379,19 @@ function Lt(e) {
|
|
|
379
379
|
return !!t && typeof t == "object";
|
|
380
380
|
}(e) && !Rt(e);
|
|
381
381
|
}
|
|
382
|
-
function
|
|
383
|
-
return t.clone !== !1 && t.isMergeableObject(e) ? Y((
|
|
384
|
-
var
|
|
382
|
+
function re(e, t) {
|
|
383
|
+
return t.clone !== !1 && t.isMergeableObject(e) ? Y((n = e, Array.isArray(n) ? [] : {}), e, t) : e;
|
|
384
|
+
var n;
|
|
385
385
|
}
|
|
386
|
-
function At(e, t,
|
|
387
|
-
return e.concat(t).map(function(
|
|
388
|
-
return
|
|
386
|
+
function At(e, t, n) {
|
|
387
|
+
return e.concat(t).map(function(r) {
|
|
388
|
+
return re(r, n);
|
|
389
389
|
});
|
|
390
390
|
}
|
|
391
391
|
function De(e) {
|
|
392
392
|
return Object.keys(e).concat(function(t) {
|
|
393
|
-
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(t).filter(function(
|
|
394
|
-
return Object.propertyIsEnumerable.call(t,
|
|
393
|
+
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(t).filter(function(n) {
|
|
394
|
+
return Object.propertyIsEnumerable.call(t, n);
|
|
395
395
|
}) : [];
|
|
396
396
|
}(e));
|
|
397
397
|
}
|
|
@@ -402,45 +402,45 @@ function Ue(e, t) {
|
|
|
402
402
|
return !1;
|
|
403
403
|
}
|
|
404
404
|
}
|
|
405
|
-
function Mt(e, t,
|
|
406
|
-
const
|
|
407
|
-
return
|
|
408
|
-
|
|
405
|
+
function Mt(e, t, n) {
|
|
406
|
+
const r = {};
|
|
407
|
+
return n.isMergeableObject(e) && De(e).forEach(function(o) {
|
|
408
|
+
r[o] = re(e[o], n);
|
|
409
409
|
}), De(t).forEach(function(o) {
|
|
410
410
|
(function(i, a) {
|
|
411
411
|
return Ue(i, a) && !(Object.hasOwnProperty.call(i, a) && Object.propertyIsEnumerable.call(i, a));
|
|
412
|
-
})(e, o) || (Ue(e, o) &&
|
|
412
|
+
})(e, o) || (Ue(e, o) && n.isMergeableObject(t[o]) ? r[o] = function(i, a) {
|
|
413
413
|
if (!a.customMerge) return Y;
|
|
414
414
|
const l = a.customMerge(i);
|
|
415
415
|
return typeof l == "function" ? l : Y;
|
|
416
|
-
}(o,
|
|
417
|
-
}),
|
|
416
|
+
}(o, n)(e[o], t[o], n) : r[o] = re(t[o], n));
|
|
417
|
+
}), r;
|
|
418
418
|
}
|
|
419
|
-
function Y(e, t,
|
|
420
|
-
(
|
|
421
|
-
const
|
|
422
|
-
return
|
|
419
|
+
function Y(e, t, n) {
|
|
420
|
+
(n = n || {}).arrayMerge = n.arrayMerge || At, n.isMergeableObject = n.isMergeableObject || Lt, n.cloneUnlessOtherwiseSpecified = re;
|
|
421
|
+
const r = Array.isArray(t);
|
|
422
|
+
return r === Array.isArray(e) ? r ? n.arrayMerge(e, t, n) : Mt(e, t, n) : re(t, n);
|
|
423
423
|
}
|
|
424
424
|
Y.all = function(e, t) {
|
|
425
425
|
if (!Array.isArray(e)) throw new Error("first argument should be an array");
|
|
426
|
-
return e.reduce(function(
|
|
427
|
-
return Y(
|
|
426
|
+
return e.reduce(function(n, r) {
|
|
427
|
+
return Y(n, r, t);
|
|
428
428
|
}, {});
|
|
429
429
|
};
|
|
430
430
|
const jt = Object.freeze([]), Pt = Object.freeze({}), Be = (e) => e, de = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
431
431
|
let t = 16 * Math.random() | 0;
|
|
432
432
|
return (e === "x" ? t : 3 & t | 8).toString(16);
|
|
433
|
-
}), Ft = (e) => 1 * e, at = (e, t) => e === t || !(!Array.isArray(e) || !Array.isArray(t) || e.length !== t.length) && e.every((
|
|
433
|
+
}), Ft = (e) => 1 * e, at = (e, t) => e === t || !(!Array.isArray(e) || !Array.isArray(t) || e.length !== t.length) && e.every((n, r) => n === t[r]), ne = (e) => typeof e == "object" && !Array.isArray(e) && e !== null, lt = (e) => typeof e != "object" || Array.isArray(e) || e === null ? e : (Object.keys(e).forEach(function(t) {
|
|
434
434
|
e[t] && typeof e[t] == "object" ? lt(e[t]) : e[t] !== null && e[t] !== void 0 || delete e[t], typeof e[t] == "object" && Object.keys(e[t]).length === 0 && delete e[t];
|
|
435
|
-
}), Object.keys(e).length === 0 ? null : e), Dt = (e, t) => !(e !== t && !at(e, t)) || !!e.isEqual?.(t), st = (e, t,
|
|
435
|
+
}), Object.keys(e).length === 0 ? null : e), Dt = (e, t) => !(e !== t && !at(e, t)) || !!e.isEqual?.(t), st = (e, t, n = Dt) => {
|
|
436
436
|
if (e == null || e === t) return null;
|
|
437
|
-
if (!e || typeof e != "object" || Array.isArray(e) || e.isImmutable?.()) return
|
|
438
|
-
const
|
|
439
|
-
if (
|
|
437
|
+
if (!e || typeof e != "object" || Array.isArray(e) || e.isImmutable?.()) return n(e, t) ? null : e;
|
|
438
|
+
const r = Object.keys(e);
|
|
439
|
+
if (r.length === 0) return null;
|
|
440
440
|
let o = !1;
|
|
441
|
-
for (let i = 0; i <
|
|
442
|
-
const a =
|
|
443
|
-
st(e[a], t?.[a],
|
|
441
|
+
for (let i = 0; i < r.length; i++) {
|
|
442
|
+
const a = r[i];
|
|
443
|
+
st(e[a], t?.[a], n) === null && (o = !0, delete e[a]);
|
|
444
444
|
}
|
|
445
445
|
return o && Object.keys(e).length === 0 ? null : void 0;
|
|
446
446
|
}, $e = typeof performance == "object" && typeof performance.now == "function" ? () => performance.now() : () => Date.now(), ze = (e) => e == null, Ke = (e, t) => !(t.left > e.right || t.right < e.left || t.top > e.bottom || t.bottom < e.top), Ve = !(typeof window > "u" || !window.document || !window.document.createElement), k = { Windows: "windows", MacOS: "macos", IOS: "ios", Linux: "linux", Android: "android", Safari: "safari", Firefox: "firefox", Node: "node", Unknown: "unknown" }, oe = () => {
|
|
@@ -451,9 +451,9 @@ const jt = Object.freeze([]), Pt = Object.freeze({}), Be = (e) => e, de = () =>
|
|
|
451
451
|
function ct() {
|
|
452
452
|
return typeof process < "u" && process.release?.name === "node" || (typeof process < "u" && process.browser, !1);
|
|
453
453
|
}
|
|
454
|
-
const qe = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeElement || e?.contains(document.activeElement)), Ut = Object.freeze(Object.defineProperty({ __proto__: null, EmptyArray: jt, EmptyObject: Pt, OSType: k, arrayMove: function(e, t,
|
|
455
|
-
const
|
|
456
|
-
return
|
|
454
|
+
const qe = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeElement || e?.contains(document.activeElement)), Ut = Object.freeze(Object.defineProperty({ __proto__: null, EmptyArray: jt, EmptyObject: Pt, OSType: k, arrayMove: function(e, t, n) {
|
|
455
|
+
const r = e.slice();
|
|
456
|
+
return r.splice(n < 0 ? r.length + n : n, 0, r.splice(t, 1)[0]), r;
|
|
457
457
|
}, asNumber: (e) => {
|
|
458
458
|
const t = Ft(e);
|
|
459
459
|
return Number.isFinite(t) ? t : 0;
|
|
@@ -465,267 +465,267 @@ const qe = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeEl
|
|
|
465
465
|
setTimeout(() => {
|
|
466
466
|
Function("console.log.apply(console, arguments)").apply(null, e), t();
|
|
467
467
|
});
|
|
468
|
-
}), debounce: function(e, t = 300,
|
|
469
|
-
let
|
|
468
|
+
}), debounce: function(e, t = 300, n = !1) {
|
|
469
|
+
let r, o, i, a, l = 0;
|
|
470
470
|
function u() {
|
|
471
471
|
let h = Date.now() - l;
|
|
472
|
-
h < t && h >= 0 ?
|
|
472
|
+
h < t && h >= 0 ? r = setTimeout(u, t - h) : (r = null, n || (a = e.apply(i, o), i = o = null));
|
|
473
473
|
}
|
|
474
474
|
t == null && (t = 100);
|
|
475
475
|
const f = function() {
|
|
476
476
|
i = globalThis, o = arguments, l = Date.now();
|
|
477
|
-
var h =
|
|
478
|
-
return
|
|
477
|
+
var h = n && !r;
|
|
478
|
+
return r || (r = setTimeout(u, t)), h && (a = e.apply(i, o), i = o = null), a;
|
|
479
479
|
};
|
|
480
480
|
return f.clear = function() {
|
|
481
|
-
|
|
481
|
+
r && (clearTimeout(r), r = null);
|
|
482
482
|
}, f.flush = function() {
|
|
483
|
-
|
|
483
|
+
r && (a = e.apply(i, o), i = o = null, clearTimeout(r), r = null);
|
|
484
484
|
}, f;
|
|
485
|
-
}, deepEqual: function e(t,
|
|
486
|
-
if (t ===
|
|
487
|
-
if (t &&
|
|
488
|
-
if (t.constructor !==
|
|
489
|
-
let
|
|
485
|
+
}, deepEqual: function e(t, n) {
|
|
486
|
+
if (t === n) return !0;
|
|
487
|
+
if (t && n && typeof t == "object" && typeof n == "object") {
|
|
488
|
+
if (t.constructor !== n.constructor) return !1;
|
|
489
|
+
let r, o, i;
|
|
490
490
|
if (Array.isArray(t)) {
|
|
491
|
-
if (
|
|
492
|
-
for (o =
|
|
491
|
+
if (r = t.length, r != n.length) return !1;
|
|
492
|
+
for (o = r; o-- !== 0; ) if (!e(t[o], n[o])) return !1;
|
|
493
493
|
return !0;
|
|
494
494
|
}
|
|
495
|
-
if (t instanceof Map &&
|
|
496
|
-
if (t.size !==
|
|
497
|
-
for (o of t.entries()) if (!
|
|
498
|
-
for (o of t.entries()) if (!e(o[1],
|
|
495
|
+
if (t instanceof Map && n instanceof Map) {
|
|
496
|
+
if (t.size !== n.size) return !1;
|
|
497
|
+
for (o of t.entries()) if (!n.has(o[0])) return !1;
|
|
498
|
+
for (o of t.entries()) if (!e(o[1], n.get(o[0]))) return !1;
|
|
499
499
|
return !0;
|
|
500
500
|
}
|
|
501
|
-
if (t instanceof Set &&
|
|
502
|
-
if (t.size !==
|
|
503
|
-
for (o of t.entries()) if (!
|
|
501
|
+
if (t instanceof Set && n instanceof Set) {
|
|
502
|
+
if (t.size !== n.size) return !1;
|
|
503
|
+
for (o of t.entries()) if (!n.has(o[0])) return !1;
|
|
504
504
|
return !0;
|
|
505
505
|
}
|
|
506
|
-
if (ArrayBuffer.isView(t) && ArrayBuffer.isView(
|
|
507
|
-
if (
|
|
508
|
-
for (o =
|
|
506
|
+
if (ArrayBuffer.isView(t) && ArrayBuffer.isView(n)) {
|
|
507
|
+
if (r = t.length, r != n.length) return !1;
|
|
508
|
+
for (o = r; o-- !== 0; ) if (t[o] !== n[o]) return !1;
|
|
509
509
|
return !0;
|
|
510
510
|
}
|
|
511
|
-
if (t.constructor === RegExp) return t.source ===
|
|
512
|
-
if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() ===
|
|
513
|
-
if (t.toString !== Object.prototype.toString) return t.toString() ===
|
|
514
|
-
if (i = Object.keys(t),
|
|
515
|
-
for (o =
|
|
516
|
-
for (o =
|
|
511
|
+
if (t.constructor === RegExp) return t.source === n.source && t.flags === n.flags;
|
|
512
|
+
if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === n.valueOf();
|
|
513
|
+
if (t.toString !== Object.prototype.toString) return t.toString() === n.toString();
|
|
514
|
+
if (i = Object.keys(t), r = i.length, r !== Object.keys(n).length) return !1;
|
|
515
|
+
for (o = r; o-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(n, i[o])) return !1;
|
|
516
|
+
for (o = r; o-- !== 0; ) {
|
|
517
517
|
let a = i[o];
|
|
518
|
-
if ((a !== "_owner" || !t.$$typeof) && !e(t[a],
|
|
518
|
+
if ((a !== "_owner" || !t.$$typeof) && !e(t[a], n[a])) return !1;
|
|
519
519
|
}
|
|
520
520
|
return !0;
|
|
521
521
|
}
|
|
522
|
-
return t != t &&
|
|
522
|
+
return t != t && n != n;
|
|
523
523
|
}, deepFreeze: function e(t) {
|
|
524
|
-
return Object.freeze(t), Object.keys(t).forEach((
|
|
525
|
-
typeof t[
|
|
524
|
+
return Object.freeze(t), Object.keys(t).forEach((n) => {
|
|
525
|
+
typeof t[n] != "object" || t[n] === null || Object.isFrozen(t[n]) || e(t[n]);
|
|
526
526
|
}), t;
|
|
527
527
|
}, deepMerge: Y, diffValues: (e, t) => {
|
|
528
|
-
const
|
|
528
|
+
const n = {}, r = Object.keys(t), o = r.length;
|
|
529
529
|
for (let i = 0; i < o; i++) {
|
|
530
|
-
const a =
|
|
531
|
-
e[a] !== t[a] && (e[a] === void 0 ?
|
|
532
|
-
}
|
|
533
|
-
return Object.keys(
|
|
534
|
-
}, findEqualOrGreater: function(e, t,
|
|
535
|
-
let
|
|
536
|
-
for (;
|
|
537
|
-
let i = Math.floor((
|
|
530
|
+
const a = r[i];
|
|
531
|
+
e[a] !== t[a] && (e[a] === void 0 ? n[a] = t[a] : n[a] = e[a]);
|
|
532
|
+
}
|
|
533
|
+
return Object.keys(n).length === 0 ? null : n;
|
|
534
|
+
}, findEqualOrGreater: function(e, t, n = Be) {
|
|
535
|
+
let r = 0, o = e.length - 1;
|
|
536
|
+
for (; r <= o; ) {
|
|
537
|
+
let i = Math.floor((r + o) / 2), a = n(e[i]);
|
|
538
538
|
if (a === t) return i;
|
|
539
|
-
a < t ?
|
|
539
|
+
a < t ? r = i + 1 : o = i - 1;
|
|
540
540
|
}
|
|
541
|
-
return
|
|
542
|
-
}, findEqualOrLesser: function(e, t,
|
|
543
|
-
let
|
|
544
|
-
for (;
|
|
545
|
-
let i = Math.floor((
|
|
541
|
+
return r;
|
|
542
|
+
}, findEqualOrLesser: function(e, t, n = Be) {
|
|
543
|
+
let r = e.length - 1, o = 0;
|
|
544
|
+
for (; r >= o; ) {
|
|
545
|
+
let i = Math.floor((r + o) / 2), a = n(e[i]);
|
|
546
546
|
if (a === t) return i;
|
|
547
|
-
a > t ?
|
|
547
|
+
a > t ? r = i - 1 : o = i + 1;
|
|
548
548
|
}
|
|
549
|
-
return
|
|
550
|
-
}, findNextStep: (e, t = !0,
|
|
551
|
-
const i = Math.max(e -
|
|
552
|
-
return Math.min(o, Math[t ? "ceil" : "floor"](i /
|
|
549
|
+
return r;
|
|
550
|
+
}, findNextStep: (e, t = !0, n = 15, r = 10, o = 400) => {
|
|
551
|
+
const i = Math.max(e - r, 0) + (t ? 1 : -1);
|
|
552
|
+
return Math.min(o, Math[t ? "ceil" : "floor"](i / n) * n + r);
|
|
553
553
|
}, getDPI: () => {
|
|
554
554
|
let e = 1;
|
|
555
555
|
return typeof window == "object" && (e = window.devicePixelRatio || 1), e;
|
|
556
556
|
}, getFromPath: (e, t) => {
|
|
557
|
-
const
|
|
558
|
-
let
|
|
559
|
-
for (let o = 0; o <
|
|
560
|
-
const i =
|
|
561
|
-
if (!
|
|
562
|
-
let a =
|
|
563
|
-
if (typeof a == "function" && (a = a.bind(
|
|
564
|
-
|
|
565
|
-
}
|
|
566
|
-
return
|
|
557
|
+
const n = t.split(".");
|
|
558
|
+
let r = e;
|
|
559
|
+
for (let o = 0; o < n.length; o++) {
|
|
560
|
+
const i = n[o];
|
|
561
|
+
if (!r) return null;
|
|
562
|
+
let a = r[i];
|
|
563
|
+
if (typeof a == "function" && (a = a.bind(r)()), !a || !ne(a)) return a;
|
|
564
|
+
r = a;
|
|
565
|
+
}
|
|
566
|
+
return r ?? null;
|
|
567
567
|
}, getOS: oe, hasFocus: qe, isDefined: (e) => e != null, isEmpty: (e) => e == null || e === "", isEqualArrays: at, isEqualBounds: (e, t) => e === t || !(e && !t || t && !e) && e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height, isEqualObjectKeys: (e, t) => {
|
|
568
568
|
if (e === t) return !0;
|
|
569
569
|
if (e && !t || t && !e) return !1;
|
|
570
|
-
const
|
|
571
|
-
if (
|
|
572
|
-
for (let
|
|
570
|
+
const n = Object.keys(e);
|
|
571
|
+
if (n.length !== Object.keys(t).length) return !1;
|
|
572
|
+
for (let r = 0; r < n.length; r++) if (e[n[r]] !== t[n[r]]) return !1;
|
|
573
573
|
return !0;
|
|
574
574
|
}, isNode: ct, isNullOrUndefined: ze, isNumeric: (e) => {
|
|
575
575
|
const t = 1 * e;
|
|
576
576
|
return Number.isFinite(t) && typeof t == "number";
|
|
577
|
-
}, isObject:
|
|
577
|
+
}, isObject: ne, isPromiseLike: (e) => !!e && typeof e.then == "function", isRectInsideRect: (e, t) => e.top >= t.top && e.bottom <= t.bottom && e.left >= t.left && e.right <= t.right, isRectIntersect: Ke, mergeContentful: (...e) => {
|
|
578
578
|
const t = e.length;
|
|
579
|
-
if (t > 0 && e[t - 1] !== void 0 && !
|
|
580
|
-
let
|
|
581
|
-
for (let
|
|
582
|
-
return
|
|
579
|
+
if (t > 0 && e[t - 1] !== void 0 && !ne(e[t - 1])) return e[t - 1];
|
|
580
|
+
let n = e[0] || {};
|
|
581
|
+
for (let r = 1; r < t; r++) n = Y(n, e[r] || {}, { arrayMerge: (o, i) => [...i] });
|
|
582
|
+
return n;
|
|
583
583
|
}, nextTick: (e) => {
|
|
584
584
|
typeof window < "u" && typeof window.requestAnimationFrame == "function" ? window.requestAnimationFrame(() => {
|
|
585
585
|
e();
|
|
586
586
|
}) : (typeof setImmediate == "function" ? setImmediate : setTimeout)(() => {
|
|
587
587
|
e();
|
|
588
588
|
});
|
|
589
|
-
}, openFileDialog: (e = "*.*") => new Promise((t,
|
|
590
|
-
if (!Ve) return void
|
|
591
|
-
const
|
|
592
|
-
|
|
589
|
+
}, openFileDialog: (e = "*.*") => new Promise((t, n) => {
|
|
590
|
+
if (!Ve) return void n("Unable to open dialog with no dom.");
|
|
591
|
+
const r = document.createElement("input");
|
|
592
|
+
r.type = "file", r.accept = e;
|
|
593
593
|
let o = null, i = !1;
|
|
594
594
|
globalThis.addEventListener?.("focus", () => {
|
|
595
595
|
setTimeout(() => {
|
|
596
596
|
o || i || (i = !0, t(null));
|
|
597
597
|
}, 1e3);
|
|
598
|
-
}, { once: !0, passive: !0 }),
|
|
599
|
-
if (o =
|
|
598
|
+
}, { once: !0, passive: !0 }), r.onchange = () => {
|
|
599
|
+
if (o = r.files[0], o) {
|
|
600
600
|
if (i) return void console.warn("File open detected after faux cancel.", o);
|
|
601
601
|
t(o);
|
|
602
602
|
}
|
|
603
|
-
},
|
|
603
|
+
}, r.autofocus = !0, r.click();
|
|
604
604
|
}), rafThrottle: (e) => {
|
|
605
|
-
let t,
|
|
606
|
-
|
|
605
|
+
let t, n = !1, r = function() {
|
|
606
|
+
n = !1, e(t);
|
|
607
607
|
};
|
|
608
608
|
return function(o) {
|
|
609
|
-
t = o, t && t.persist && t.persist(),
|
|
609
|
+
t = o, t && t.persist && t.persist(), n || (n = !0, requestAnimationFrame(r));
|
|
610
610
|
};
|
|
611
611
|
}, removeEmptyProperties: lt, removeEqualValues: st, removeListenerAll: (e) => {
|
|
612
612
|
if (!e) return [];
|
|
613
613
|
for (let t = 0; t < e.length; t++) e[t] && e[t]();
|
|
614
614
|
return [];
|
|
615
615
|
}, requestTimeout: (e, t) => {
|
|
616
|
-
const
|
|
617
|
-
$e() -
|
|
616
|
+
const n = $e(), r = { id: requestAnimationFrame(function o() {
|
|
617
|
+
$e() - n >= t ? e.call(null) : r.id = requestAnimationFrame(o);
|
|
618
618
|
}) };
|
|
619
|
-
return
|
|
619
|
+
return r;
|
|
620
620
|
}, roundAccurately: (e, t = 0) => {
|
|
621
621
|
if (e == null || !isFinite(e)) return null;
|
|
622
|
-
const
|
|
623
|
-
return Number(Math.round(e *
|
|
624
|
-
}, setToPath: (e, t,
|
|
625
|
-
const
|
|
622
|
+
const n = 10 ** t;
|
|
623
|
+
return Number(Math.round(e * n) / n);
|
|
624
|
+
}, setToPath: (e, t, n) => {
|
|
625
|
+
const r = t.split(".");
|
|
626
626
|
let o = e;
|
|
627
627
|
if (!o) throw new Error("Can not set path to a null path.");
|
|
628
|
-
for (let i = 0; o && i <
|
|
629
|
-
const a =
|
|
628
|
+
for (let i = 0; o && i < r.length - 1; i++) {
|
|
629
|
+
const a = r[i];
|
|
630
630
|
let l = o[a];
|
|
631
|
-
if (l == null && (l = {}, o[a] = l), !
|
|
631
|
+
if (l == null && (l = {}, o[a] = l), !ne(l)) throw new Error("Can not set path to a non object path.");
|
|
632
632
|
o = l;
|
|
633
633
|
}
|
|
634
|
-
if (typeof
|
|
635
|
-
return o[
|
|
634
|
+
if (typeof n != "number" && typeof n != "boolean" && typeof n != "string" && !ne(n)) throw new Error(\`Can not set path to \${n} that is not a a supported primitive.\`);
|
|
635
|
+
return o[r[r.length - 1]] = n, e;
|
|
636
636
|
}, splitNumber: (e) => {
|
|
637
637
|
let t = Math.abs(e);
|
|
638
638
|
if (isNaN(t) || !isFinite(e)) return null;
|
|
639
|
-
let
|
|
640
|
-
if (
|
|
641
|
-
return { ip: Math.trunc(e), fp: o, ipLength: Math.ceil(Math.log10(
|
|
642
|
-
}, subtractRect: (e, t,
|
|
639
|
+
let n = 0 | t, r = t - n, o = 0, i = 0, a = 1;
|
|
640
|
+
if (r > 5e-8) for (; i < 8 && Math.abs(o / a - r) > 5e-8; ) i++, a *= 10, o = Math.round(r * a);
|
|
641
|
+
return { ip: Math.trunc(e), fp: o, ipLength: Math.ceil(Math.log10(n + 1)), fpLength: i };
|
|
642
|
+
}, subtractRect: (e, t, n = !1) => {
|
|
643
643
|
if (!t) return [e];
|
|
644
644
|
if (!Ke(e, t)) return [];
|
|
645
|
-
const
|
|
645
|
+
const r = [];
|
|
646
646
|
let o = e;
|
|
647
647
|
const i = () => {
|
|
648
|
-
t.top > o.top && t.top < o.bottom && (
|
|
648
|
+
t.top > o.top && t.top < o.bottom && (r.push({ ...o, bottom: t.top }), o = { ...o, top: t.top });
|
|
649
649
|
}, a = () => {
|
|
650
|
-
t.bottom > o.top && t.bottom < o.bottom && (
|
|
650
|
+
t.bottom > o.top && t.bottom < o.bottom && (r.push({ ...o, top: t.bottom }), o = { ...o, bottom: t.bottom });
|
|
651
651
|
}, l = () => {
|
|
652
|
-
t.right > o.left && t.right < o.right && (
|
|
652
|
+
t.right > o.left && t.right < o.right && (r.push({ ...o, left: t.right }), o = { ...o, right: t.right });
|
|
653
653
|
}, u = () => {
|
|
654
|
-
t.left > o.left && t.left < o.right && (
|
|
654
|
+
t.left > o.left && t.left < o.right && (r.push({ ...o, right: t.left }), o = { ...o, left: t.left });
|
|
655
655
|
};
|
|
656
|
-
return
|
|
656
|
+
return n ? (u(), l(), i(), a()) : (i(), a(), l(), u()), r;
|
|
657
657
|
}, textToKey: (e) => e.replace(/[^a-zA-Z0-9]/g, "").toLowerCase(), throttle: function(e, t) {
|
|
658
|
-
let
|
|
659
|
-
return (...
|
|
658
|
+
let n = null;
|
|
659
|
+
return (...r) => {
|
|
660
660
|
const o = Date.now();
|
|
661
|
-
(!
|
|
661
|
+
(!n || o - n >= t) && (n = o, e(...r));
|
|
662
662
|
};
|
|
663
663
|
}, toSafeJSON: function e(t) {
|
|
664
664
|
if (t === null || typeof t != "object") return t;
|
|
665
665
|
if (typeof t.toJSON == "function") return t.toJSON();
|
|
666
|
-
if (Array.isArray(t)) return t.map((
|
|
666
|
+
if (Array.isArray(t)) return t.map((r) => e(r));
|
|
667
667
|
if (typeof t.toString == "function" && t.toString !== Object.prototype.toString) return t.toString();
|
|
668
|
-
const
|
|
669
|
-
for (const
|
|
670
|
-
return
|
|
668
|
+
const n = {};
|
|
669
|
+
for (const r in t) t.hasOwnProperty(r) && (n[r] = e(t[r]));
|
|
670
|
+
return n;
|
|
671
671
|
}, transpose: (e) => {
|
|
672
672
|
if (!e) return e;
|
|
673
|
-
const t = e.length,
|
|
674
|
-
for (let o = 0; o <
|
|
675
|
-
for (let o = 0; o < t; o++) for (let i = 0; i <
|
|
676
|
-
return
|
|
673
|
+
const t = e.length, n = e[0].length, r = [];
|
|
674
|
+
for (let o = 0; o < n; o++) r[o] = Array(t);
|
|
675
|
+
for (let o = 0; o < t; o++) for (let i = 0; i < n; i++) r[i][o] = e[o][i];
|
|
676
|
+
return r;
|
|
677
677
|
}, uuidV4: de, validEnumValue: (e, t) => {
|
|
678
678
|
if (!Object.values(e).includes(t)) throw new Error(\`Invalid type: \${t ?? "null"}. Must be one of: \${Object.values(t).join(", ")}.\`);
|
|
679
|
-
}, whenFocus: async (e, t = !1) => new Promise((
|
|
680
|
-
qe(e, t) ?
|
|
681
|
-
|
|
679
|
+
}, whenFocus: async (e, t = !1) => new Promise((n) => {
|
|
680
|
+
qe(e, t) ? n(!0) : e.addEventListener("focusin", () => {
|
|
681
|
+
n(!0);
|
|
682
682
|
}, { once: !0 }), e.focus();
|
|
683
683
|
}) }, Symbol.toStringTag, { value: "Module" }));
|
|
684
684
|
Object.freeze(Object.defineProperty({ __proto__: null, MESSAGE_ERROR_INVALID_ARG: (e) => \`Invalid argument: '\${e}'.\` }, Symbol.toStringTag, { value: "Module" }));
|
|
685
685
|
const ut = (e) => {
|
|
686
|
-
const t = new Uint8Array(e),
|
|
687
|
-
let
|
|
688
|
-
for (let o = 0; o <
|
|
689
|
-
if (typeof window < "u" && typeof globalThis.btoa == "function") return globalThis.btoa(
|
|
690
|
-
if (typeof Buffer < "u") return Buffer.from(
|
|
686
|
+
const t = new Uint8Array(e), n = t.byteLength;
|
|
687
|
+
let r = "";
|
|
688
|
+
for (let o = 0; o < n; o++) r += String.fromCharCode(t[o]);
|
|
689
|
+
if (typeof window < "u" && typeof globalThis.btoa == "function") return globalThis.btoa(r);
|
|
690
|
+
if (typeof Buffer < "u") return Buffer.from(r, "binary").toString("base64");
|
|
691
691
|
throw new Error("Unsupported environment");
|
|
692
|
-
}, Ce = (e) => new Promise((t,
|
|
692
|
+
}, Ce = (e) => new Promise((t, n) => {
|
|
693
693
|
if (e) if (typeof FileReader < "u") {
|
|
694
|
-
const
|
|
695
|
-
|
|
696
|
-
t(
|
|
697
|
-
},
|
|
698
|
-
r
|
|
699
|
-
},
|
|
694
|
+
const r = new FileReader();
|
|
695
|
+
r.onload = () => {
|
|
696
|
+
t(r.result);
|
|
697
|
+
}, r.onerror = () => {
|
|
698
|
+
n(r.error);
|
|
699
|
+
}, r.readAsText(e);
|
|
700
700
|
} else if (typeof Buffer < "u") {
|
|
701
|
-
const
|
|
701
|
+
const r = (o) => Buffer.from(o).toString("utf-8");
|
|
702
702
|
e.arrayBuffer().then((o) => {
|
|
703
|
-
t(
|
|
703
|
+
t(r(o));
|
|
704
704
|
}).catch((o) => {
|
|
705
|
-
|
|
705
|
+
n(o);
|
|
706
706
|
});
|
|
707
|
-
} else
|
|
707
|
+
} else n(new Error("Unsupported environment"));
|
|
708
708
|
else t("");
|
|
709
709
|
});
|
|
710
710
|
Object.freeze(Object.defineProperty({ __proto__: null, DEFAULT_MIME_TYPE: "*/*", arrayBufferToBase64: ut, base64ToArrayBuffer: (e) => {
|
|
711
|
-
const t = typeof window < "u" && typeof globalThis.atob == "function" ? globalThis.atob(e) : Buffer.from(e, "base64").toString("binary"),
|
|
712
|
-
for (let o = 0; o <
|
|
713
|
-
return
|
|
711
|
+
const t = typeof window < "u" && typeof globalThis.atob == "function" ? globalThis.atob(e) : Buffer.from(e, "base64").toString("binary"), n = t.length, r = new Uint8Array(n);
|
|
712
|
+
for (let o = 0; o < n; o++) r[o] = t.charCodeAt(o);
|
|
713
|
+
return r.buffer;
|
|
714
714
|
}, blobToString: Ce }, Symbol.toStringTag, { value: "Module" }));
|
|
715
|
-
const dt = "data:image/png;base64,", ft = "Unable to resolve image.", Ge = (e) => new Promise(async (t,
|
|
716
|
-
let
|
|
715
|
+
const dt = "data:image/png;base64,", ft = "Unable to resolve image.", Ge = (e) => new Promise(async (t, n) => {
|
|
716
|
+
let r = null;
|
|
717
717
|
try {
|
|
718
|
-
|
|
719
|
-
t({ width:
|
|
720
|
-
}, { once: !0 }),
|
|
721
|
-
URL.revokeObjectURL(e),
|
|
722
|
-
}, { once: !0 }), await
|
|
718
|
+
r = new Image(), r.src = e, r.addEventListener("load", function() {
|
|
719
|
+
t({ width: r.naturalWidth, height: r.naturalHeight });
|
|
720
|
+
}, { once: !0 }), r.addEventListener("error", function() {
|
|
721
|
+
URL.revokeObjectURL(e), n("Invalid Image");
|
|
722
|
+
}, { once: !0 }), await r.decode("sync");
|
|
723
723
|
} catch {
|
|
724
|
-
|
|
724
|
+
r?.src && URL.revokeObjectURL(r.src);
|
|
725
725
|
}
|
|
726
|
-
|
|
726
|
+
r || n(ft);
|
|
727
727
|
}), we = "image/svg+xml";
|
|
728
|
-
Object.freeze(Object.defineProperty({ __proto__: null, DATA_URL_PNG_PREFIX: dt, getImageDataUrl: (e, t = 1) => new Promise(async (
|
|
728
|
+
Object.freeze(Object.defineProperty({ __proto__: null, DATA_URL_PNG_PREFIX: dt, getImageDataUrl: (e, t = 1) => new Promise(async (n, r) => {
|
|
729
729
|
let o = null;
|
|
730
730
|
try {
|
|
731
731
|
o = new Image(), o.src = e, o.addEventListener("load", function() {
|
|
@@ -733,42 +733,42 @@ Object.freeze(Object.defineProperty({ __proto__: null, DATA_URL_PNG_PREFIX: dt,
|
|
|
733
733
|
const i = document.createElement("canvas");
|
|
734
734
|
i.width = o.naturalWidth, i.height = o.naturalHeight, i.getContext("2d").drawImage(o, 0, 0);
|
|
735
735
|
const a = i.toDataURL("image/png", t);
|
|
736
|
-
|
|
736
|
+
n({ elemImg: o, dataUrl: a });
|
|
737
737
|
} catch (i) {
|
|
738
|
-
URL.revokeObjectURL(e),
|
|
738
|
+
URL.revokeObjectURL(e), r(i);
|
|
739
739
|
}
|
|
740
740
|
}, { once: !0 }), o.addEventListener("error", function() {
|
|
741
|
-
URL.revokeObjectURL(e),
|
|
741
|
+
URL.revokeObjectURL(e), r("Invalid Image");
|
|
742
742
|
}, { once: !0 }), await o.decode("sync");
|
|
743
743
|
} catch {
|
|
744
744
|
o?.src && URL.revokeObjectURL(o.src);
|
|
745
745
|
}
|
|
746
|
-
o ||
|
|
746
|
+
o || r(ft);
|
|
747
747
|
}), loadImageDetails: async (e, t = null) => {
|
|
748
|
-
let
|
|
749
|
-
const
|
|
748
|
+
let n = null;
|
|
749
|
+
const r = async () => {
|
|
750
750
|
try {
|
|
751
751
|
const i = t ?? "image/*", a = URL.createObjectURL(new Blob([e], { type: i })), l = await Ge(a);
|
|
752
|
-
|
|
752
|
+
n = { mimeType: i, naturalDimensions: l, asUrl: a };
|
|
753
753
|
} catch {
|
|
754
754
|
}
|
|
755
755
|
}, o = async () => {
|
|
756
756
|
try {
|
|
757
757
|
const i = new TextDecoder().decode(e), a = URL.createObjectURL(new Blob([i], { type: we })), l = await Ge(a);
|
|
758
|
-
|
|
758
|
+
n = { mimeType: t ?? we, naturalDimensions: l, asUrl: a, asSVGText: i };
|
|
759
759
|
} catch {
|
|
760
760
|
}
|
|
761
761
|
};
|
|
762
|
-
if (t === we ? await o() : t.startsWith("image/") ? await
|
|
763
|
-
return
|
|
762
|
+
if (t === we ? await o() : t.startsWith("image/") ? await r() : (await r(), n || await o()), !n) throw new Error("Failed to load image");
|
|
763
|
+
return n;
|
|
764
764
|
} }, Symbol.toStringTag, { value: "Module" }));
|
|
765
765
|
var We, Ye;
|
|
766
|
-
(Ye = We || (We = {})).resolveTypedUpdates = (e, t,
|
|
766
|
+
(Ye = We || (We = {})).resolveTypedUpdates = (e, t, n, r) => {
|
|
767
767
|
if (e === null) return e;
|
|
768
|
-
if (e === void 0) return
|
|
768
|
+
if (e === void 0) return r;
|
|
769
769
|
let o = e;
|
|
770
770
|
if (t?.shorthand) {
|
|
771
|
-
const u = t?.shorthand(e,
|
|
771
|
+
const u = t?.shorthand(e, n);
|
|
772
772
|
u !== void 0 && (o = u);
|
|
773
773
|
}
|
|
774
774
|
if (o !== null && t?.getSubType) {
|
|
@@ -777,18 +777,20 @@ var We, Ye;
|
|
|
777
777
|
}
|
|
778
778
|
const i = t?.properties, a = t?.arrayType ?? !1;
|
|
779
779
|
let l = o;
|
|
780
|
-
if (t && t.merge && l &&
|
|
781
|
-
else if (!a
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
780
|
+
if (t && t.merge && l && r) l = t.merge(l, r, n);
|
|
781
|
+
else if (!a) {
|
|
782
|
+
if (i) {
|
|
783
|
+
const u = Object.keys({ ...o, ...r });
|
|
784
|
+
l = null;
|
|
785
|
+
for (let f = 0; f < u.length; f++) {
|
|
786
|
+
const h = u[f];
|
|
787
|
+
let g, p = o[h];
|
|
788
|
+
if (p !== void 0) {
|
|
789
|
+
const y = i[h];
|
|
790
|
+
g = y ? (0, Ye.resolveTypedUpdates)(p, y, n, r?.[h]) : p;
|
|
791
|
+
} else g = r?.[h];
|
|
792
|
+
g != null && (l = l ?? {}, l[h] = g);
|
|
793
|
+
}
|
|
792
794
|
}
|
|
793
795
|
}
|
|
794
796
|
return l;
|
|
@@ -804,10 +806,10 @@ Please use Chrome or Edge if external copy and paste is required.\`, Perms: ye,
|
|
|
804
806
|
document.hasFocus() ? e() : globalThis.addEventListener?.("focus", () => {
|
|
805
807
|
e();
|
|
806
808
|
}, { once: !0 }), document.activeElement.focus?.();
|
|
807
|
-
}), be = async (e, t,
|
|
808
|
-
if (oe() === k.Safari) return await
|
|
809
|
+
}), be = async (e, t, n) => {
|
|
810
|
+
if (oe() === k.Safari) return await n(new Error(pt.Safari));
|
|
809
811
|
try {
|
|
810
|
-
const
|
|
812
|
+
const r = async (a) => {
|
|
811
813
|
try {
|
|
812
814
|
return await a();
|
|
813
815
|
} catch (l) {
|
|
@@ -816,9 +818,9 @@ Please use Chrome or Edge if external copy and paste is required.\`, Perms: ye,
|
|
|
816
818
|
}
|
|
817
819
|
}, o = await globalThis?.navigator?.permissions?.query({ name: e, allowWithoutGesture: !0, allowWithoutSanitization: !0 });
|
|
818
820
|
let i = !1;
|
|
819
|
-
if (o.state === "prompt" && (i = await
|
|
820
|
-
} catch (
|
|
821
|
-
return
|
|
821
|
+
if (o.state === "prompt" && (i = await r(t)), i || o.state !== "granted" || (i = await t()), !i) return await n(new Error(o.state));
|
|
822
|
+
} catch (r) {
|
|
823
|
+
return r.message === "No valid data on clipboard" || r.name === "DataError" ? void 0 : await n(r);
|
|
822
824
|
}
|
|
823
825
|
}, mt = async (e) => {
|
|
824
826
|
try {
|
|
@@ -828,21 +830,21 @@ Please use Chrome or Edge if external copy and paste is required.\`, Perms: ye,
|
|
|
828
830
|
return await e.read();
|
|
829
831
|
}, Bt = async (e, t) => {
|
|
830
832
|
if (!e) return null;
|
|
831
|
-
const
|
|
832
|
-
let
|
|
833
|
-
for (let o = 0; !
|
|
834
|
-
return await
|
|
835
|
-
return
|
|
833
|
+
const n = await mt(e);
|
|
834
|
+
let r = !1;
|
|
835
|
+
for (let o = 0; !r && n && o < n.length; o++) if (r = n[o].types.includes(t), r)
|
|
836
|
+
return await n[o].getType(t);
|
|
837
|
+
return r ? void 0 : null;
|
|
836
838
|
};
|
|
837
839
|
if (!globalThis.ClipboardItem) {
|
|
838
|
-
const e = (
|
|
840
|
+
const e = (n, r) => new Blob([r], { type: n });
|
|
839
841
|
class t {
|
|
840
|
-
constructor(
|
|
841
|
-
this._items = {}, this._types = Object.keys(
|
|
842
|
-
const i = {}, a = Object.keys(
|
|
842
|
+
constructor(r, o) {
|
|
843
|
+
this._items = {}, this._types = Object.keys(r);
|
|
844
|
+
const i = {}, a = Object.keys(r);
|
|
843
845
|
for (let l = 0; l < a.length; l++) {
|
|
844
846
|
const u = a[l];
|
|
845
|
-
let f =
|
|
847
|
+
let f = r[u];
|
|
846
848
|
i[u] = typeof f == "string" ? e(u, f) : f;
|
|
847
849
|
}
|
|
848
850
|
this._items = i, this._presentationStyle = o?.presentationStyle ?? "unspecified";
|
|
@@ -850,55 +852,55 @@ if (!globalThis.ClipboardItem) {
|
|
|
850
852
|
get types() {
|
|
851
853
|
return this._types;
|
|
852
854
|
}
|
|
853
|
-
getType(
|
|
854
|
-
return Promise.resolve(this._items[
|
|
855
|
+
getType(r) {
|
|
856
|
+
return Promise.resolve(this._items[r]);
|
|
855
857
|
}
|
|
856
|
-
supports(
|
|
858
|
+
supports(r) {
|
|
857
859
|
return !0;
|
|
858
860
|
}
|
|
859
861
|
}
|
|
860
862
|
globalThis.ClipboardItem = t;
|
|
861
863
|
}
|
|
862
|
-
const ve = async (e, t = S.html) => new Promise(async (
|
|
864
|
+
const ve = async (e, t = S.html) => new Promise(async (n, r) => {
|
|
863
865
|
try {
|
|
864
866
|
const o = await Bt(e, t);
|
|
865
867
|
if (o) {
|
|
866
868
|
const i = new FileReader();
|
|
867
869
|
i.onload = () => {
|
|
868
|
-
|
|
870
|
+
n(i.result);
|
|
869
871
|
}, i.onerror = () => {
|
|
870
|
-
|
|
872
|
+
n("");
|
|
871
873
|
}, i.readAsText(o);
|
|
872
|
-
} else
|
|
874
|
+
} else n("");
|
|
873
875
|
} catch (o) {
|
|
874
|
-
|
|
876
|
+
r(o);
|
|
875
877
|
}
|
|
876
878
|
}), He = async (e, t = S.html) => {
|
|
877
|
-
const
|
|
878
|
-
if (!
|
|
879
|
-
let
|
|
879
|
+
const n = await ve(e, t);
|
|
880
|
+
if (!n) return null;
|
|
881
|
+
let r = null;
|
|
880
882
|
try {
|
|
881
|
-
|
|
883
|
+
r = new DOMParser().parseFromString(n, S.html);
|
|
882
884
|
} catch {
|
|
883
885
|
console.warn("Can't parse html from clipboard.");
|
|
884
886
|
}
|
|
885
|
-
return
|
|
887
|
+
return r;
|
|
886
888
|
}, $t = async (e) => {
|
|
887
889
|
e && await e.writeText("");
|
|
888
890
|
}, ie = "clipboard-uuid", Q = "web text/uuid", Xe = (e) => \`<div style="display:none" \${ie}="\${e}"/>\`, zt = (e, t) => {
|
|
889
|
-
let
|
|
891
|
+
let n = null;
|
|
890
892
|
try {
|
|
891
|
-
const
|
|
892
|
-
|
|
893
|
-
} catch (
|
|
894
|
-
console.warn("Can't embed uuid.",
|
|
893
|
+
const r = new DOMParser().parseFromString(t, S.html);
|
|
894
|
+
r.body.firstElementChild.setAttribute(ie, e), n = r.getElementsByTagName("body")[0].innerHTML;
|
|
895
|
+
} catch (r) {
|
|
896
|
+
console.warn("Can't embed uuid.", r);
|
|
895
897
|
}
|
|
896
|
-
return
|
|
898
|
+
return n;
|
|
897
899
|
}, Ze = (e, t) => {
|
|
898
900
|
if (!t || !e) return !1;
|
|
899
901
|
try {
|
|
900
|
-
const
|
|
901
|
-
if (
|
|
902
|
+
const n = t.querySelectorAll(\`[\${ie}="\${e}"]\`);
|
|
903
|
+
if (n && n.length === 1) return !0;
|
|
902
904
|
if (t.querySelector("parsererror")) throw new Error("We are unable to parse node");
|
|
903
905
|
return !1;
|
|
904
906
|
} catch {
|
|
@@ -920,8 +922,8 @@ class Qe {
|
|
|
920
922
|
await ge();
|
|
921
923
|
const t = await ve(this._nativeClipboard, Q);
|
|
922
924
|
if (!this._state || t && t === this._state.uuid) return !0;
|
|
923
|
-
const
|
|
924
|
-
return !this._state || (Ze(this._state.uuid,
|
|
925
|
+
const n = await He(this._nativeClipboard, S.html);
|
|
926
|
+
return !this._state || (Ze(this._state.uuid, n) || this.clear(), !0);
|
|
925
927
|
}, async (t) => {
|
|
926
928
|
t?.message === "denied" || t.message?.includes("Document is not focused") || oe() === k.Safari || console.warn("Unable to detect clipboard changes: ", t);
|
|
927
929
|
});
|
|
@@ -932,7 +934,7 @@ class Qe {
|
|
|
932
934
|
t._checkForChanges();
|
|
933
935
|
}, this._onBlur = () => {
|
|
934
936
|
globalThis.addEventListener?.("focus", t._onFocus, { once: !0 });
|
|
935
|
-
}, globalThis.addEventListener?.("blur", this._onBlur), this._nativeClipboard.addEventListener("clipboardchange", (
|
|
937
|
+
}, globalThis.addEventListener?.("blur", this._onBlur), this._nativeClipboard.addEventListener("clipboardchange", (n) => {
|
|
936
938
|
t._checkForChanges();
|
|
937
939
|
}));
|
|
938
940
|
}
|
|
@@ -941,13 +943,13 @@ class Qe {
|
|
|
941
943
|
const t = this;
|
|
942
944
|
return await be("clipboard-read", async () => {
|
|
943
945
|
if (await ge(), this._state?.uuid) {
|
|
944
|
-
const
|
|
945
|
-
if (
|
|
946
|
-
const
|
|
947
|
-
if (Ze(t._state?.uuid,
|
|
946
|
+
const n = await ve(this._nativeClipboard, Q);
|
|
947
|
+
if (n && n === t._state.uuid) return !0;
|
|
948
|
+
const r = await He(this._nativeClipboard, S.html);
|
|
949
|
+
if (Ze(t._state?.uuid, r)) return !0;
|
|
948
950
|
}
|
|
949
951
|
return t._state = { items: await mt(this._nativeClipboard), uuid: null, ref: null }, this.dispatchEvent(new Event("clipboardread")), !0;
|
|
950
|
-
}, async (
|
|
952
|
+
}, async (n) => {
|
|
951
953
|
this.dispatchEvent(new Event("clipboarderrorread"));
|
|
952
954
|
}), this._state?.items ?? [];
|
|
953
955
|
}
|
|
@@ -956,10 +958,10 @@ class Qe {
|
|
|
956
958
|
}
|
|
957
959
|
async _write(t) {
|
|
958
960
|
if (!this._nativeClipboard) return this._state = t, this.dispatchEvent(new Event("clipboardwrite")), this.dispatchEvent(new Event("clipboardchange")), null;
|
|
959
|
-
const
|
|
961
|
+
const n = this, r = [], o = t.uuid;
|
|
960
962
|
let i = t.items ?? [];
|
|
961
963
|
const a = () => {
|
|
962
|
-
|
|
964
|
+
n._state = { uuid: o, ref: t.ref, items: r }, n.dispatchEvent(new Event("clipboardwrite")), n.dispatchEvent(new Event("clipboardchange"));
|
|
963
965
|
};
|
|
964
966
|
await be("clipboard-write", async () => {
|
|
965
967
|
await ge(), o && i.length === 0 && (i.push(new ClipboardItem({ [Q]: new Blob([o], { type: Q }) })), i.push(new ClipboardItem({ [S.html]: new Blob([Xe(o)], { type: S.html }) })));
|
|
@@ -987,10 +989,10 @@ class Qe {
|
|
|
987
989
|
const T = u.types[y];
|
|
988
990
|
p[T] = y === f ? g : u.getType(T);
|
|
989
991
|
}
|
|
990
|
-
h && f === -1 && (p[S.html] = g), o && (p[Q] = new Blob([o], { type: Q })),
|
|
992
|
+
h && f === -1 && (p[S.html] = g), o && (p[Q] = new Blob([o], { type: Q })), r.push(new ClipboardItem(p));
|
|
991
993
|
}
|
|
992
994
|
try {
|
|
993
|
-
|
|
995
|
+
r && r.length !== 0 ? await this._nativeClipboard.write(r) : await $t(this._nativeClipboard);
|
|
994
996
|
} catch (l) {
|
|
995
997
|
l.message?.includes("Document is not focused") || console.warn("Unable to write to native clipboard: ", l);
|
|
996
998
|
}
|
|
@@ -1001,28 +1003,28 @@ class Qe {
|
|
|
1001
1003
|
}
|
|
1002
1004
|
async writeReference(t) {
|
|
1003
1005
|
if (!t) return void this.clear();
|
|
1004
|
-
let
|
|
1005
|
-
const
|
|
1006
|
+
let n = null;
|
|
1007
|
+
const r = {};
|
|
1006
1008
|
try {
|
|
1007
1009
|
const i = await t.toText?.() ?? null;
|
|
1008
|
-
i && (
|
|
1010
|
+
i && (r[S.plain] = new Blob([i ?? ""], { type: S.plain }));
|
|
1009
1011
|
} catch (i) {
|
|
1010
|
-
|
|
1012
|
+
n = i;
|
|
1011
1013
|
}
|
|
1012
1014
|
try {
|
|
1013
1015
|
const i = await t.toHtml?.() ?? null;
|
|
1014
|
-
i && (
|
|
1016
|
+
i && (r[S.html] = new Blob([i], { type: S.html }));
|
|
1015
1017
|
} catch (i) {
|
|
1016
|
-
|
|
1018
|
+
n = i, console.warn("export to html", i);
|
|
1017
1019
|
}
|
|
1018
1020
|
try {
|
|
1019
1021
|
const i = await t.toImage?.() ?? null;
|
|
1020
|
-
i && (
|
|
1022
|
+
i && (r[S.png] = i);
|
|
1021
1023
|
} catch (i) {
|
|
1022
|
-
|
|
1024
|
+
n = i, console.warn("export to png", i);
|
|
1023
1025
|
}
|
|
1024
|
-
const o = this._write({ uuid: de(), ref: t, items: Object.keys(
|
|
1025
|
-
if (
|
|
1026
|
+
const o = this._write({ uuid: de(), ref: t, items: Object.keys(r).length > 0 ? [new ClipboardItem(r)] : null });
|
|
1027
|
+
if (n) throw n;
|
|
1026
1028
|
return o;
|
|
1027
1029
|
}
|
|
1028
1030
|
clear(t = !1) {
|
|
@@ -1032,32 +1034,32 @@ class Qe {
|
|
|
1032
1034
|
return await this.read(), this._state?.ref ?? null;
|
|
1033
1035
|
}
|
|
1034
1036
|
readText() {
|
|
1035
|
-
return new Promise(async (t,
|
|
1036
|
-
const
|
|
1037
|
+
return new Promise(async (t, n) => {
|
|
1038
|
+
const r = await this.read();
|
|
1037
1039
|
let o = null;
|
|
1038
|
-
for (let a = 0; !o &&
|
|
1040
|
+
for (let a = 0; !o && r && a < r.length; a++) r[a].types.includes(S.plain) && (o = await r[a].getType(S.plain));
|
|
1039
1041
|
if (!o) return void t("");
|
|
1040
1042
|
const i = new FileReader();
|
|
1041
1043
|
i.onload = () => {
|
|
1042
1044
|
t(i.result);
|
|
1043
1045
|
}, i.readAsText(o), i.onerror = (a) => {
|
|
1044
|
-
|
|
1046
|
+
n(a);
|
|
1045
1047
|
};
|
|
1046
1048
|
});
|
|
1047
1049
|
}
|
|
1048
1050
|
async writeText(t) {
|
|
1049
|
-
const
|
|
1050
|
-
return this._write({ uuid: de(), items:
|
|
1051
|
+
const n = [new ClipboardItem({ [S.plain]: new Blob([t], { type: S.plain }) })];
|
|
1052
|
+
return this._write({ uuid: de(), items: n, ref: null });
|
|
1051
1053
|
}
|
|
1052
|
-
addEventListener(t,
|
|
1053
|
-
const o =
|
|
1054
|
+
addEventListener(t, n, r = {}) {
|
|
1055
|
+
const o = r?.capture ? this._listenersCapture : this._listeners;
|
|
1054
1056
|
let i = o.get(t);
|
|
1055
|
-
i || (i = /* @__PURE__ */ new Map(), o.set(t, i)), i.set(
|
|
1057
|
+
i || (i = /* @__PURE__ */ new Map(), o.set(t, i)), i.set(n, typeof r == "boolean" ? {} : r);
|
|
1056
1058
|
}
|
|
1057
1059
|
dispatchEvent(t) {
|
|
1058
1060
|
if (!t) return;
|
|
1059
|
-
const
|
|
1060
|
-
const o =
|
|
1061
|
+
const n = (r) => {
|
|
1062
|
+
const o = r.get(t.type);
|
|
1061
1063
|
o && o.forEach((i, a) => {
|
|
1062
1064
|
try {
|
|
1063
1065
|
typeof a == "function" ? a(t) : a.handleEvent && a.handleEvent(t), i.once && o.delete(a);
|
|
@@ -1066,11 +1068,11 @@ class Qe {
|
|
|
1066
1068
|
}
|
|
1067
1069
|
});
|
|
1068
1070
|
};
|
|
1069
|
-
return
|
|
1071
|
+
return n(this._listenersCapture), n(this._listeners), !0;
|
|
1070
1072
|
}
|
|
1071
|
-
removeEventListener(t,
|
|
1072
|
-
const o =
|
|
1073
|
-
i && (i.delete(
|
|
1073
|
+
removeEventListener(t, n, r) {
|
|
1074
|
+
const o = r?.capture ? this._listenersCapture : this._listeners, i = o.get(t);
|
|
1075
|
+
i && (i.delete(n), i.size === 0 && o.delete(t));
|
|
1074
1076
|
}
|
|
1075
1077
|
close() {
|
|
1076
1078
|
globalThis.removeEventListener?.("focus", this._onFocus), globalThis.removeEventListener?.("blur", this._onBlur);
|
|
@@ -1089,16 +1091,16 @@ async function Vt() {
|
|
|
1089
1091
|
return ee;
|
|
1090
1092
|
}
|
|
1091
1093
|
let e, t;
|
|
1092
|
-
le = new Promise((
|
|
1093
|
-
e =
|
|
1094
|
+
le = new Promise((n, r) => {
|
|
1095
|
+
e = n, t = r;
|
|
1094
1096
|
});
|
|
1095
1097
|
try {
|
|
1096
|
-
const { initialize:
|
|
1097
|
-
return
|
|
1098
|
+
const { initialize: n } = await Promise.resolve().then(function() {
|
|
1099
|
+
return nn;
|
|
1098
1100
|
});
|
|
1099
|
-
return ee = await
|
|
1100
|
-
} catch (
|
|
1101
|
-
throw console.error("Failed to import or initialize esbuild:",
|
|
1101
|
+
return ee = await n(), e(), ee;
|
|
1102
|
+
} catch (n) {
|
|
1103
|
+
throw console.error("Failed to import or initialize esbuild:", n), le = null, t(n), n;
|
|
1102
1104
|
}
|
|
1103
1105
|
}
|
|
1104
1106
|
const qt = {
|
|
@@ -1107,21 +1109,21 @@ const qt = {
|
|
|
1107
1109
|
target: "esnext"
|
|
1108
1110
|
}
|
|
1109
1111
|
};
|
|
1110
|
-
async function Gt(e, t,
|
|
1112
|
+
async function Gt(e, t, n = "/script.js", r = Kt) {
|
|
1111
1113
|
try {
|
|
1112
1114
|
const o = await Vt(), i = "@sheetxl/primitives", a = \`
|
|
1113
|
-
export const FormulaContext = globalThis.\${
|
|
1114
|
-
export const ScalarType = globalThis.\${
|
|
1115
|
-
export const Observable = globalThis.\${
|
|
1116
|
-
export const IRange = globalThis.\${
|
|
1117
|
-
export const FormulaError = globalThis.\${
|
|
1115
|
+
export const FormulaContext = globalThis.\${r}?.FormulaContext;
|
|
1116
|
+
export const ScalarType = globalThis.\${r}?.ScalarType;
|
|
1117
|
+
export const Observable = globalThis.\${r}?.Observable;
|
|
1118
|
+
export const IRange = globalThis.\${r}?.IRange;
|
|
1119
|
+
export const FormulaError = globalThis.\${r}?.FormulaError;
|
|
1118
1120
|
// Add more exports as needed
|
|
1119
1121
|
\`, l = {
|
|
1120
1122
|
// ESBuild.Plugin = {
|
|
1121
1123
|
name: "sheetxl-esbuild-in-memory",
|
|
1122
1124
|
setup(f) {
|
|
1123
1125
|
const h = "sheetxl-" + (/* @__PURE__ */ new Date()).getTime();
|
|
1124
|
-
f.onResolve({ filter: new RegExp(\`^(\${
|
|
1126
|
+
f.onResolve({ filter: new RegExp(\`^(\${n.replace("/", "\\\\/")}|\${i})$\`) }, (g) => ({
|
|
1125
1127
|
path: g.path,
|
|
1126
1128
|
namespace: h
|
|
1127
1129
|
})), f.onResolve({ filter: /.*/ }, (g) => {
|
|
@@ -1129,7 +1131,7 @@ async function Gt(e, t, r = "/script.js", n = Kt) {
|
|
|
1129
1131
|
return console.warn(\`esbuild: Treating import "\${g.path}" as external.\`), { path: g.path, external: !0 };
|
|
1130
1132
|
}), f.onLoad({ filter: /.*/, namespace: h }, (g) => {
|
|
1131
1133
|
let p;
|
|
1132
|
-
if (g.path ===
|
|
1134
|
+
if (g.path === n)
|
|
1133
1135
|
p = t;
|
|
1134
1136
|
else if (g.path === i)
|
|
1135
1137
|
p = a;
|
|
@@ -1145,7 +1147,7 @@ async function Gt(e, t, r = "/script.js", n = Kt) {
|
|
|
1145
1147
|
});
|
|
1146
1148
|
}
|
|
1147
1149
|
}, u = await o.build({
|
|
1148
|
-
entryPoints: [
|
|
1150
|
+
entryPoints: [n],
|
|
1149
1151
|
// Use the virtual entry point
|
|
1150
1152
|
bundle: !0,
|
|
1151
1153
|
// IMPORTANT: Enable bundling
|
|
@@ -1202,9 +1204,9 @@ interface Promise<T> {
|
|
|
1202
1204
|
["ICellRange", "range"],
|
|
1203
1205
|
["IFormulaContext", "context"]
|
|
1204
1206
|
]), _e = (e, t) => {
|
|
1205
|
-
Array.from(t.keys()).forEach((
|
|
1206
|
-
const o = t.get(
|
|
1207
|
-
t.set(\`\${e}.\${
|
|
1207
|
+
Array.from(t.keys()).forEach((r) => {
|
|
1208
|
+
const o = t.get(r);
|
|
1209
|
+
t.set(\`\${e}.\${r}\`, o);
|
|
1208
1210
|
});
|
|
1209
1211
|
}, Ht = /* @__PURE__ */ new Map([
|
|
1210
1212
|
["Scalar", "*"],
|
|
@@ -1230,7 +1232,7 @@ async function Qt() {
|
|
|
1230
1232
|
return se;
|
|
1231
1233
|
try {
|
|
1232
1234
|
return await (await Promise.resolve().then(function() {
|
|
1233
|
-
return
|
|
1235
|
+
return on;
|
|
1234
1236
|
})).initialize();
|
|
1235
1237
|
} catch (e) {
|
|
1236
1238
|
throw se = null, e;
|
|
@@ -1238,14 +1240,14 @@ async function Qt() {
|
|
|
1238
1240
|
se = null;
|
|
1239
1241
|
}
|
|
1240
1242
|
}
|
|
1241
|
-
async function
|
|
1243
|
+
async function en(e) {
|
|
1242
1244
|
const t = e?.source ?? null;
|
|
1243
1245
|
if (!t) return null;
|
|
1244
|
-
const
|
|
1246
|
+
const n = (e.disableBundle || e.declarationsOnly) ?? !1, r = [
|
|
1245
1247
|
Jt(),
|
|
1246
1248
|
//import('typescript'), // when bundled, but node check causes issues. We could bundle replace isNode but felt hacky
|
|
1247
1249
|
Qt()
|
|
1248
|
-
], o = await Promise.all(
|
|
1250
|
+
], o = await Promise.all(r), i = o[0], a = o[1];
|
|
1249
1251
|
let l = "", u = null;
|
|
1250
1252
|
const f = [], h = {
|
|
1251
1253
|
allowJs: !0,
|
|
@@ -1469,7 +1471,7 @@ async function er(e) {
|
|
|
1469
1471
|
throw new Error("No exported functions.");
|
|
1470
1472
|
const yt = \`\${Ut.uuidV4()}-script\`;
|
|
1471
1473
|
try {
|
|
1472
|
-
!
|
|
1474
|
+
!n && B.length === 0 && (l = await Gt(a, l, g));
|
|
1473
1475
|
} catch {
|
|
1474
1476
|
console.warn("Error bundling script");
|
|
1475
1477
|
}
|
|
@@ -1485,30 +1487,30 @@ async function er(e) {
|
|
|
1485
1487
|
return u && (Ie.autoRun = u), Ie;
|
|
1486
1488
|
}
|
|
1487
1489
|
self.addEventListener("message", async (e) => {
|
|
1488
|
-
const { id: t, params:
|
|
1490
|
+
const { id: t, params: n } = e.data;
|
|
1489
1491
|
try {
|
|
1490
|
-
const
|
|
1491
|
-
self.postMessage({ id: t, result:
|
|
1492
|
-
} catch (
|
|
1492
|
+
const r = await en(n);
|
|
1493
|
+
self.postMessage({ id: t, result: r, error: null });
|
|
1494
|
+
} catch (r) {
|
|
1493
1495
|
self.postMessage({
|
|
1494
1496
|
id: t,
|
|
1495
1497
|
result: null,
|
|
1496
1498
|
error: {
|
|
1497
|
-
message:
|
|
1498
|
-
stack:
|
|
1499
|
-
cause:
|
|
1499
|
+
message: r.message,
|
|
1500
|
+
stack: r.stack,
|
|
1501
|
+
cause: r.cause
|
|
1500
1502
|
}
|
|
1501
1503
|
});
|
|
1502
1504
|
}
|
|
1503
1505
|
});
|
|
1504
1506
|
let ce = null;
|
|
1505
|
-
async function
|
|
1507
|
+
async function tn() {
|
|
1506
1508
|
return ce || (ce = new Promise(async (e, t) => {
|
|
1507
1509
|
try {
|
|
1508
|
-
const
|
|
1510
|
+
const n = "0.20.2", r = \`https://esm.sh/esbuild-wasm@\${n}\`, o = \`https://esm.sh/esbuild-wasm@\${n}/esbuild.wasm\`, a = (await import(
|
|
1509
1511
|
/* webpackIgnore: true */
|
|
1510
1512
|
/* @vite-ignore */
|
|
1511
|
-
|
|
1513
|
+
r
|
|
1512
1514
|
)).default;
|
|
1513
1515
|
await a.initialize({
|
|
1514
1516
|
wasmURL: o,
|
|
@@ -1516,30 +1518,30 @@ async function tr() {
|
|
|
1516
1518
|
worker: !1
|
|
1517
1519
|
// Keep processing on the current thread
|
|
1518
1520
|
}), e(a);
|
|
1519
|
-
} catch (
|
|
1520
|
-
console.error("Error initializing esbuild:",
|
|
1521
|
+
} catch (n) {
|
|
1522
|
+
console.error("Error initializing esbuild:", n), t(n);
|
|
1521
1523
|
}
|
|
1522
1524
|
}), ce);
|
|
1523
1525
|
}
|
|
1524
|
-
var
|
|
1526
|
+
var nn = /* @__PURE__ */ Object.freeze({
|
|
1525
1527
|
__proto__: null,
|
|
1526
|
-
initialize:
|
|
1528
|
+
initialize: tn
|
|
1527
1529
|
});
|
|
1528
1530
|
let ue = null;
|
|
1529
|
-
async function
|
|
1531
|
+
async function rn() {
|
|
1530
1532
|
return ue || (ue = new Promise(async (e, t) => {
|
|
1531
|
-
let
|
|
1533
|
+
let n = null;
|
|
1532
1534
|
try {
|
|
1533
|
-
|
|
1534
|
-
} catch (
|
|
1535
|
-
console.error("Error initializing Browser TypeScript module:",
|
|
1535
|
+
n = await import("https://esm.sh/typescript@5.7.2");
|
|
1536
|
+
} catch (r) {
|
|
1537
|
+
console.error("Error initializing Browser TypeScript module:", r);
|
|
1536
1538
|
}
|
|
1537
|
-
|
|
1539
|
+
n || console.log("use script fallback"), e(n);
|
|
1538
1540
|
}), ue);
|
|
1539
1541
|
}
|
|
1540
|
-
var
|
|
1542
|
+
var on = /* @__PURE__ */ Object.freeze({
|
|
1541
1543
|
__proto__: null,
|
|
1542
|
-
initialize:
|
|
1544
|
+
initialize: rn
|
|
1543
1545
|
});
|
|
1544
1546
|
`, a = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", s], { type: "text/javascript;charset=utf-8" });
|
|
1545
1547
|
function d(e) {
|
|
@@ -1568,7 +1570,7 @@ async function p() {
|
|
|
1568
1570
|
return await l();
|
|
1569
1571
|
}
|
|
1570
1572
|
const l = async () => {
|
|
1571
|
-
const { compileModule: e } = await import("./
|
|
1573
|
+
const { compileModule: e } = await import("./CoWXpBDGlVMCdmL6.mjs"), n = new u((t) => e(t));
|
|
1572
1574
|
return await n.start(), n;
|
|
1573
1575
|
};
|
|
1574
1576
|
export {
|