@sheetxl/scripting 0.4.9 → 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/README.md +2 -2
- package/browser/cjs/{DxnlQCphjFWF7ovA.cjs → 0e_ieEwRgvHNzBct.cjs} +387 -385
- package/browser/cjs/{e_TTj2c4WMRl9lHk.cjs → Bpcm__gmXmCT_9GX.cjs} +1 -1
- package/browser/cjs/{BuR4RLqPu71M9_Cf.cjs → BuB0aUcbgtZttT_w.cjs} +5 -5
- package/browser/cjs/CiJlgV1IXEmXJpsD.cjs +13 -0
- package/browser/cjs/{C5ecEckAPpK6oEaG.cjs → DHftuK8qPwcJe7Zj.cjs} +2 -2
- package/browser/cjs/index.cjs +2 -2
- package/browser/cjs/{D7K1fpAVaBqApV-z.cjs → svT_bjMJTvfjJKLz.cjs} +1 -1
- package/browser/esm/{DwdfS-VZT-YBEscp.mjs → B1ySwHm9YBwNYmJx.mjs} +387 -385
- package/browser/esm/{CdbBClckeDaUBqkt.mjs → BCebrtm_TvBRuVB_.mjs} +58 -52
- package/browser/esm/{DwgUht4IRklW_Nct.mjs → CKXcZ5awOabLTBIS.mjs} +1 -1
- package/browser/esm/{WvPstNkxau7BNoC4.mjs → CoWXpBDGlVMCdmL6.mjs} +20 -20
- package/browser/esm/{DjxQZZfZL99ToZ6a.mjs → DVU8CuXcV7gxTc_P.mjs} +1 -1
- package/browser/esm/{QW8B6F2xZjk_Q9_0.mjs → T3-nyuSCbau9JYmi.mjs} +2 -2
- package/browser/esm/index.mjs +2 -2
- package/licenses/dependencies.txt +2 -2
- package/node/esm/{BG08gnkSpTiIjml6.mjs → BIvKOd32LAmxQo9T.mjs} +1 -1
- package/node/esm/{kv1wJOkSGuXKOhJJ.mjs → DJicGDnUI-FD-BZk.mjs} +1 -1
- package/node/esm/{G-t8KVrZ5J7wtk56.mjs → KKXOq6IO5VJGFx3U.mjs} +3 -3
- package/node/esm/{CJiWYHUcDoKbATwE.mjs → bYDfL7gXUKKr8g9_.mjs} +2 -2
- package/node/esm/{CSQbJOJGVUA67Do6.mjs → dFmhuJa_KcpGexrv.mjs} +387 -385
- package/node/esm/index.mjs +2 -2
- package/package.json +3 -3
- package/browser/cjs/DzsULR9qlkBHEyrc.cjs +0 -13
|
@@ -1,10 +1,10 @@
|
|
|
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.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.
|
|
6
6
|
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let c=class{constructor(e){this._worker=null,this._nextId=1,this._pendingRequests=new Map,this._workerFactory=e}start(){if(typeof Worker>"u")throw new Error("Web Workers are not supported in this environment.");return this._worker||(this._worker=this._workerFactory(),this._worker.onmessage=e=>{const{id:n,result:t,error:r}=e.data,o=this._pendingRequests.get(n);if(o)if(this._pendingRequests.delete(n),r){const i=new Error(r.message);i.stack=r.stack,r.cause&&(i.cause=r.cause),o.reject(i)}else o.resolve(t)},this._worker.onerror=e=>{console.error("Worker error:",e),this._pendingRequests.forEach(n=>{n.reject(new Error(`Worker failed: ${e.message}`))}),this._pendingRequests.clear(),this._worker=null}),Promise.resolve()}execute(e){if(!this._worker)throw new Error("Worker is not initialized. Call start() first.");const n=this._nextId++;return new Promise((t,r)=>{this._pendingRequests.set(n,{resolve:t,reject:r}),this._worker.postMessage({id:n,params:e})})}terminate(){this._worker&&(this._worker.terminate(),this._worker=null)}};class u{constructor(n){this._onExecute=n}execute(n){return this._onExecute(n)}start(){return Promise.resolve()}terminate(){}}const s=`/**
|
|
7
|
-
* @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.4.
|
|
7
|
+
* @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.4.11
|
|
8
8
|
*
|
|
9
9
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
10
10
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -40,7 +40,7 @@ var Re, ae, d;
|
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
e.Known = t;
|
|
43
|
-
class
|
|
43
|
+
class n extends t {
|
|
44
44
|
constructor(c, m) {
|
|
45
45
|
super(e.Code.Parse, e.Label.Parse, c, m);
|
|
46
46
|
}
|
|
@@ -52,8 +52,8 @@ var Re, ae, d;
|
|
|
52
52
|
return { line: c?.line ?? 1, column: c?.column ?? 1, offset: c?.offset ?? 0, length: c?.length ?? 0 };
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
e.Parse =
|
|
56
|
-
class
|
|
55
|
+
e.Parse = n;
|
|
56
|
+
class r extends t {
|
|
57
57
|
constructor(c, m) {
|
|
58
58
|
super(e.Code.Null, e.Label.Null, c, m);
|
|
59
59
|
}
|
|
@@ -61,7 +61,7 @@ var Re, ae, d;
|
|
|
61
61
|
this.code = e.Code.Null;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
e.Null =
|
|
64
|
+
e.Null = r;
|
|
65
65
|
class o extends t {
|
|
66
66
|
constructor(c, m) {
|
|
67
67
|
super(e.Code.Div0, e.Label.Div0, c, m);
|
|
@@ -209,54 +209,54 @@ var Re, ae, d;
|
|
|
209
209
|
})(d || (d = {}));
|
|
210
210
|
const _ = {};
|
|
211
211
|
_[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;
|
|
212
|
-
const et = /* @__PURE__ */ new Map(), Te = /* @__PURE__ */ new Map(), tt = /* @__PURE__ */ new Map(),
|
|
212
|
+
const et = /* @__PURE__ */ new Map(), Te = /* @__PURE__ */ new Map(), tt = /* @__PURE__ */ new Map(), nt = /* @__PURE__ */ new Map(), ke = Object.keys(_);
|
|
213
213
|
for (let e = 0; e < ke.length; e++) {
|
|
214
|
-
const t = ke[e],
|
|
215
|
-
tt.set(d.Label[t],
|
|
216
|
-
const
|
|
217
|
-
et.set(
|
|
214
|
+
const t = ke[e], n = _[t];
|
|
215
|
+
tt.set(d.Label[t], n), nt.set(d.Code[t], n);
|
|
216
|
+
const r = new n();
|
|
217
|
+
et.set(r.getLabel(), r), Te.set(r.getCode(), r);
|
|
218
218
|
}
|
|
219
219
|
const Et = Te.get(d.Code.Unknown);
|
|
220
220
|
var v;
|
|
221
|
-
(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,
|
|
222
|
-
let
|
|
223
|
-
return
|
|
221
|
+
(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) => {
|
|
222
|
+
let r;
|
|
223
|
+
return r = typeof e == "string" ? tt.get(e) : nt.get(e), r || (r = v.Unknown), new r(t, n);
|
|
224
224
|
}, v.getBuiltInById = (e) => Te.get(e) || Et;
|
|
225
225
|
/**
|
|
226
|
-
* @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.4.
|
|
226
|
+
* @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.4.11
|
|
227
227
|
*
|
|
228
228
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
229
229
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
230
230
|
*/
|
|
231
231
|
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 });
|
|
232
232
|
Object.freeze(Object.defineProperty({ __proto__: null, EmptyBounds: Ct, EmptyRect: xt, EmptyTopLeft: St }, Symbol.toStringTag, { value: "Module" }));
|
|
233
|
-
const j = { Column: "column", Row: "row" }, vt = Object.freeze({ colIndex: 0, rowIndex: 0 }), Tt = Object.freeze({ colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 }),
|
|
233
|
+
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) => {
|
|
234
234
|
if (e === t) return !0;
|
|
235
235
|
if (!e || !t || e.length !== t.length) return !1;
|
|
236
|
-
for (let
|
|
236
|
+
for (let n = 0; n < e.length; n++) if (!Se(e[n], t[n])) return !1;
|
|
237
237
|
return !0;
|
|
238
|
-
}, he = (e, t,
|
|
238
|
+
}, he = (e, t, n) => {
|
|
239
239
|
if (!e && !t) return null;
|
|
240
|
-
if (!e) return
|
|
241
|
-
if (!t) return
|
|
242
|
-
const
|
|
243
|
-
let l =
|
|
244
|
-
return l ? (l.colStart =
|
|
240
|
+
if (!e) return n ? t : { ...t };
|
|
241
|
+
if (!t) return n ? e : { ...e };
|
|
242
|
+
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);
|
|
243
|
+
let l = n;
|
|
244
|
+
return l ? (l.colStart = r, l.rowStart = o, l.colEnd = i, l.rowEnd = a) : l = { colStart: r, rowStart: o, colEnd: i, rowEnd: a }, l;
|
|
245
245
|
}, Pe = (e, t) => {
|
|
246
246
|
if (!t || t.length === 0) return e;
|
|
247
|
-
const
|
|
248
|
-
for (let
|
|
249
|
-
const o = t[
|
|
250
|
-
xe(
|
|
247
|
+
const n = { ...e };
|
|
248
|
+
for (let r = 0; r < t.length; r++) {
|
|
249
|
+
const o = t[r];
|
|
250
|
+
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));
|
|
251
251
|
}
|
|
252
|
-
return
|
|
253
|
-
}, It = [null, null], Nt = (e, t,
|
|
252
|
+
return n;
|
|
253
|
+
}, It = [null, null], Nt = (e, t, n) => {
|
|
254
254
|
if (e[0].value === e[1].value) return t;
|
|
255
255
|
};
|
|
256
|
-
function Fe(e, t = 2,
|
|
256
|
+
function Fe(e, t = 2, n, r = j.Row, o) {
|
|
257
257
|
let i = [...e];
|
|
258
258
|
if (t <= 0 || e.length <= 1) return i;
|
|
259
|
-
let a =
|
|
259
|
+
let a = r === j.Column, l = 0, u = !1;
|
|
260
260
|
do {
|
|
261
261
|
const f = i.sort(it(a ? j.Row : j.Column));
|
|
262
262
|
i = [], i.push(f[0]);
|
|
@@ -267,9 +267,9 @@ function Fe(e, t = 2, r, n = j.Row, o) {
|
|
|
267
267
|
let J = !1;
|
|
268
268
|
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) {
|
|
269
269
|
let E = { colStart: y, rowStart: T, colEnd: a ? I.colEnd : A, rowEnd: a ? D : I.rowEnd };
|
|
270
|
-
if (p.value !== void 0 && (E.value = p.value),
|
|
270
|
+
if (p.value !== void 0 && (E.value = p.value), n) {
|
|
271
271
|
const c = o ?? [null, null];
|
|
272
|
-
c[0] = p, c[1] = I, E =
|
|
272
|
+
c[0] = p, c[1] = I, E = n(c, E, r);
|
|
273
273
|
}
|
|
274
274
|
if (E) {
|
|
275
275
|
i[g] = E, u = !0, p = E, y = p.colStart, T = p.rowStart, A = p.colEnd, D = p.rowEnd;
|
|
@@ -284,11 +284,11 @@ function Fe(e, t = 2, r, n = j.Row, o) {
|
|
|
284
284
|
}
|
|
285
285
|
Object.freeze(Object.defineProperty({ __proto__: null, EmptyCell: vt, EmptyRange: Tt, cellToRange: (e, t) => {
|
|
286
286
|
if (!e) return null;
|
|
287
|
-
let
|
|
288
|
-
return
|
|
289
|
-
}, columnFirstCellComparator: Le, columnFirstRangeComparator:
|
|
290
|
-
const
|
|
291
|
-
let
|
|
287
|
+
let n = t;
|
|
288
|
+
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;
|
|
289
|
+
}, 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) => {
|
|
290
|
+
const n = [];
|
|
291
|
+
let r, o, i = Number.MIN_SAFE_INTEGER, a = Number.MIN_SAFE_INTEGER;
|
|
292
292
|
return { append: (l, u, f) => {
|
|
293
293
|
let h = !0;
|
|
294
294
|
const g = f !== void 0;
|
|
@@ -296,38 +296,38 @@ Object.freeze(Object.defineProperty({ __proto__: null, EmptyCell: vt, EmptyRange
|
|
|
296
296
|
const T = e ? e(o, f, t) : o === f ? f : void 0;
|
|
297
297
|
T === void 0 ? h = !1 : f = T;
|
|
298
298
|
}
|
|
299
|
-
if (h && u === a + 1 && l === i) return t ?
|
|
300
|
-
|
|
299
|
+
if (h && u === a + 1 && l === i) return t ? r.rowEnd = u : r.colEnd = u, a = u, void (o = f);
|
|
300
|
+
r && n.push(r);
|
|
301
301
|
const p = t ? l : u, y = t ? u : l;
|
|
302
|
-
|
|
303
|
-
}, done: (l) => (
|
|
304
|
-
}, createRangeComparator: it, defaultRange: (e, t,
|
|
302
|
+
r = { colStart: p, rowStart: y, colEnd: p, rowEnd: y }, g && (r.value = f), i = l, a = u, o = f;
|
|
303
|
+
}, done: (l) => (r && (n.push(r), r = null), l ? Fe(n, 3, l === !0 ? Nt : l, t ? j.Column : j.Row, It) : n) };
|
|
304
|
+
}, 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) => {
|
|
305
305
|
if (!t || t.length === 0) return e;
|
|
306
|
-
let
|
|
307
|
-
for (; !Se(
|
|
308
|
-
return
|
|
306
|
+
let n = e, r = null;
|
|
307
|
+
for (; !Se(n, r); ) r = n, n = Pe(r, t);
|
|
308
|
+
return n;
|
|
309
309
|
}, indexOfCoords: (e, t) => {
|
|
310
|
-
const
|
|
311
|
-
for (let
|
|
310
|
+
const n = { colStart: e.colIndex, rowStart: e.rowIndex, colEnd: e.colIndex, rowEnd: e.rowIndex };
|
|
311
|
+
for (let r = t.length - 1; r >= 0; r--) if (xe(n, t[r])) return r;
|
|
312
312
|
return -1;
|
|
313
|
-
}, intersectRanges: (e, t,
|
|
314
|
-
if (!e) return
|
|
315
|
-
if (!t) return
|
|
313
|
+
}, intersectRanges: (e, t, n) => {
|
|
314
|
+
if (!e) return n ? t : { ...t };
|
|
315
|
+
if (!t) return n ? e : { ...e };
|
|
316
316
|
if (!e && !t || e.rowStart > t.rowEnd || e.rowEnd < t.rowStart || e.colStart > t.colEnd || e.colEnd < t.colStart) return null;
|
|
317
|
-
const
|
|
318
|
-
let l =
|
|
319
|
-
return l ? (l.colStart =
|
|
320
|
-
}, 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,
|
|
317
|
+
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);
|
|
318
|
+
let l = n;
|
|
319
|
+
return l ? (l.colStart = r, l.rowStart = o, l.colEnd = i, l.rowEnd = a) : l = { colStart: r, rowStart: o, colEnd: i, rowEnd: a }, l;
|
|
320
|
+
}, 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) => {
|
|
321
321
|
if (!e || e.length === 0) return null;
|
|
322
322
|
if (e.length === 1 && !t) return e[0];
|
|
323
|
-
let
|
|
324
|
-
for (let o = 1; o < e.length; o++)
|
|
325
|
-
return t && (
|
|
323
|
+
let r = e[0];
|
|
324
|
+
for (let o = 1; o < e.length; o++) r = he(r, e[o], n);
|
|
325
|
+
return t && (r = he(r, t, n)), r;
|
|
326
326
|
} }, Symbol.toStringTag, { value: "Module" }));
|
|
327
327
|
function Rt(e) {
|
|
328
328
|
const t = Object.prototype.toString.call(e);
|
|
329
|
-
return t === "[object RegExp]" || t === "[object Date]" || function(
|
|
330
|
-
return
|
|
329
|
+
return t === "[object RegExp]" || t === "[object Date]" || function(n) {
|
|
330
|
+
return n.$$typeof === kt;
|
|
331
331
|
}(e);
|
|
332
332
|
}
|
|
333
333
|
const kt = typeof Symbol == "function" && Symbol.for ? Symbol.for("react.element") : 60103;
|
|
@@ -336,19 +336,19 @@ function Lt(e) {
|
|
|
336
336
|
return !!t && typeof t == "object";
|
|
337
337
|
}(e) && !Rt(e);
|
|
338
338
|
}
|
|
339
|
-
function
|
|
340
|
-
return t.clone !== !1 && t.isMergeableObject(e) ? Y((
|
|
341
|
-
var
|
|
339
|
+
function re(e, t) {
|
|
340
|
+
return t.clone !== !1 && t.isMergeableObject(e) ? Y((n = e, Array.isArray(n) ? [] : {}), e, t) : e;
|
|
341
|
+
var n;
|
|
342
342
|
}
|
|
343
|
-
function At(e, t,
|
|
344
|
-
return e.concat(t).map(function(
|
|
345
|
-
return
|
|
343
|
+
function At(e, t, n) {
|
|
344
|
+
return e.concat(t).map(function(r) {
|
|
345
|
+
return re(r, n);
|
|
346
346
|
});
|
|
347
347
|
}
|
|
348
348
|
function De(e) {
|
|
349
349
|
return Object.keys(e).concat(function(t) {
|
|
350
|
-
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(t).filter(function(
|
|
351
|
-
return Object.propertyIsEnumerable.call(t,
|
|
350
|
+
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(t).filter(function(n) {
|
|
351
|
+
return Object.propertyIsEnumerable.call(t, n);
|
|
352
352
|
}) : [];
|
|
353
353
|
}(e));
|
|
354
354
|
}
|
|
@@ -359,45 +359,45 @@ function Ue(e, t) {
|
|
|
359
359
|
return !1;
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
|
-
function Mt(e, t,
|
|
363
|
-
const
|
|
364
|
-
return
|
|
365
|
-
|
|
362
|
+
function Mt(e, t, n) {
|
|
363
|
+
const r = {};
|
|
364
|
+
return n.isMergeableObject(e) && De(e).forEach(function(o) {
|
|
365
|
+
r[o] = re(e[o], n);
|
|
366
366
|
}), De(t).forEach(function(o) {
|
|
367
367
|
(function(i, a) {
|
|
368
368
|
return Ue(i, a) && !(Object.hasOwnProperty.call(i, a) && Object.propertyIsEnumerable.call(i, a));
|
|
369
|
-
})(e, o) || (Ue(e, o) &&
|
|
369
|
+
})(e, o) || (Ue(e, o) && n.isMergeableObject(t[o]) ? r[o] = function(i, a) {
|
|
370
370
|
if (!a.customMerge) return Y;
|
|
371
371
|
const l = a.customMerge(i);
|
|
372
372
|
return typeof l == "function" ? l : Y;
|
|
373
|
-
}(o,
|
|
374
|
-
}),
|
|
373
|
+
}(o, n)(e[o], t[o], n) : r[o] = re(t[o], n));
|
|
374
|
+
}), r;
|
|
375
375
|
}
|
|
376
|
-
function Y(e, t,
|
|
377
|
-
(
|
|
378
|
-
const
|
|
379
|
-
return
|
|
376
|
+
function Y(e, t, n) {
|
|
377
|
+
(n = n || {}).arrayMerge = n.arrayMerge || At, n.isMergeableObject = n.isMergeableObject || Lt, n.cloneUnlessOtherwiseSpecified = re;
|
|
378
|
+
const r = Array.isArray(t);
|
|
379
|
+
return r === Array.isArray(e) ? r ? n.arrayMerge(e, t, n) : Mt(e, t, n) : re(t, n);
|
|
380
380
|
}
|
|
381
381
|
Y.all = function(e, t) {
|
|
382
382
|
if (!Array.isArray(e)) throw new Error("first argument should be an array");
|
|
383
|
-
return e.reduce(function(
|
|
384
|
-
return Y(
|
|
383
|
+
return e.reduce(function(n, r) {
|
|
384
|
+
return Y(n, r, t);
|
|
385
385
|
}, {});
|
|
386
386
|
};
|
|
387
387
|
const jt = Object.freeze([]), Pt = Object.freeze({}), Be = (e) => e, de = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
388
388
|
let t = 16 * Math.random() | 0;
|
|
389
389
|
return (e === "x" ? t : 3 & t | 8).toString(16);
|
|
390
|
-
}), Ft = (e) => 1 * e, at = (e, t) => e === t || !(!Array.isArray(e) || !Array.isArray(t) || e.length !== t.length) && e.every((
|
|
390
|
+
}), 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) {
|
|
391
391
|
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];
|
|
392
|
-
}), Object.keys(e).length === 0 ? null : e), Dt = (e, t) => !(e !== t && !at(e, t)) || !!e.isEqual?.(t), st = (e, t,
|
|
392
|
+
}), Object.keys(e).length === 0 ? null : e), Dt = (e, t) => !(e !== t && !at(e, t)) || !!e.isEqual?.(t), st = (e, t, n = Dt) => {
|
|
393
393
|
if (e == null || e === t) return null;
|
|
394
|
-
if (!e || typeof e != "object" || Array.isArray(e) || e.isImmutable?.()) return
|
|
395
|
-
const
|
|
396
|
-
if (
|
|
394
|
+
if (!e || typeof e != "object" || Array.isArray(e) || e.isImmutable?.()) return n(e, t) ? null : e;
|
|
395
|
+
const r = Object.keys(e);
|
|
396
|
+
if (r.length === 0) return null;
|
|
397
397
|
let o = !1;
|
|
398
|
-
for (let i = 0; i <
|
|
399
|
-
const a =
|
|
400
|
-
st(e[a], t?.[a],
|
|
398
|
+
for (let i = 0; i < r.length; i++) {
|
|
399
|
+
const a = r[i];
|
|
400
|
+
st(e[a], t?.[a], n) === null && (o = !0, delete e[a]);
|
|
401
401
|
}
|
|
402
402
|
return o && Object.keys(e).length === 0 ? null : void 0;
|
|
403
403
|
}, $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 = () => {
|
|
@@ -408,9 +408,9 @@ const jt = Object.freeze([]), Pt = Object.freeze({}), Be = (e) => e, de = () =>
|
|
|
408
408
|
function ct() {
|
|
409
409
|
return typeof process < "u" && process.release?.name === "node" || (typeof process < "u" && process.browser, !1);
|
|
410
410
|
}
|
|
411
|
-
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,
|
|
412
|
-
const
|
|
413
|
-
return
|
|
411
|
+
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) {
|
|
412
|
+
const r = e.slice();
|
|
413
|
+
return r.splice(n < 0 ? r.length + n : n, 0, r.splice(t, 1)[0]), r;
|
|
414
414
|
}, asNumber: (e) => {
|
|
415
415
|
const t = Ft(e);
|
|
416
416
|
return Number.isFinite(t) ? t : 0;
|
|
@@ -422,267 +422,267 @@ const qe = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeEl
|
|
|
422
422
|
setTimeout(() => {
|
|
423
423
|
Function("console.log.apply(console, arguments)").apply(null, e), t();
|
|
424
424
|
});
|
|
425
|
-
}), debounce: function(e, t = 300,
|
|
426
|
-
let
|
|
425
|
+
}), debounce: function(e, t = 300, n = !1) {
|
|
426
|
+
let r, o, i, a, l = 0;
|
|
427
427
|
function u() {
|
|
428
428
|
let h = Date.now() - l;
|
|
429
|
-
h < t && h >= 0 ?
|
|
429
|
+
h < t && h >= 0 ? r = setTimeout(u, t - h) : (r = null, n || (a = e.apply(i, o), i = o = null));
|
|
430
430
|
}
|
|
431
431
|
t == null && (t = 100);
|
|
432
432
|
const f = function() {
|
|
433
433
|
i = globalThis, o = arguments, l = Date.now();
|
|
434
|
-
var h =
|
|
435
|
-
return
|
|
434
|
+
var h = n && !r;
|
|
435
|
+
return r || (r = setTimeout(u, t)), h && (a = e.apply(i, o), i = o = null), a;
|
|
436
436
|
};
|
|
437
437
|
return f.clear = function() {
|
|
438
|
-
|
|
438
|
+
r && (clearTimeout(r), r = null);
|
|
439
439
|
}, f.flush = function() {
|
|
440
|
-
|
|
440
|
+
r && (a = e.apply(i, o), i = o = null, clearTimeout(r), r = null);
|
|
441
441
|
}, f;
|
|
442
|
-
}, deepEqual: function e(t,
|
|
443
|
-
if (t ===
|
|
444
|
-
if (t &&
|
|
445
|
-
if (t.constructor !==
|
|
446
|
-
let
|
|
442
|
+
}, deepEqual: function e(t, n) {
|
|
443
|
+
if (t === n) return !0;
|
|
444
|
+
if (t && n && typeof t == "object" && typeof n == "object") {
|
|
445
|
+
if (t.constructor !== n.constructor) return !1;
|
|
446
|
+
let r, o, i;
|
|
447
447
|
if (Array.isArray(t)) {
|
|
448
|
-
if (
|
|
449
|
-
for (o =
|
|
448
|
+
if (r = t.length, r != n.length) return !1;
|
|
449
|
+
for (o = r; o-- !== 0; ) if (!e(t[o], n[o])) return !1;
|
|
450
450
|
return !0;
|
|
451
451
|
}
|
|
452
|
-
if (t instanceof Map &&
|
|
453
|
-
if (t.size !==
|
|
454
|
-
for (o of t.entries()) if (!
|
|
455
|
-
for (o of t.entries()) if (!e(o[1],
|
|
452
|
+
if (t instanceof Map && n instanceof Map) {
|
|
453
|
+
if (t.size !== n.size) return !1;
|
|
454
|
+
for (o of t.entries()) if (!n.has(o[0])) return !1;
|
|
455
|
+
for (o of t.entries()) if (!e(o[1], n.get(o[0]))) return !1;
|
|
456
456
|
return !0;
|
|
457
457
|
}
|
|
458
|
-
if (t instanceof Set &&
|
|
459
|
-
if (t.size !==
|
|
460
|
-
for (o of t.entries()) if (!
|
|
458
|
+
if (t instanceof Set && n instanceof Set) {
|
|
459
|
+
if (t.size !== n.size) return !1;
|
|
460
|
+
for (o of t.entries()) if (!n.has(o[0])) return !1;
|
|
461
461
|
return !0;
|
|
462
462
|
}
|
|
463
|
-
if (ArrayBuffer.isView(t) && ArrayBuffer.isView(
|
|
464
|
-
if (
|
|
465
|
-
for (o =
|
|
463
|
+
if (ArrayBuffer.isView(t) && ArrayBuffer.isView(n)) {
|
|
464
|
+
if (r = t.length, r != n.length) return !1;
|
|
465
|
+
for (o = r; o-- !== 0; ) if (t[o] !== n[o]) return !1;
|
|
466
466
|
return !0;
|
|
467
467
|
}
|
|
468
|
-
if (t.constructor === RegExp) return t.source ===
|
|
469
|
-
if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() ===
|
|
470
|
-
if (t.toString !== Object.prototype.toString) return t.toString() ===
|
|
471
|
-
if (i = Object.keys(t),
|
|
472
|
-
for (o =
|
|
473
|
-
for (o =
|
|
468
|
+
if (t.constructor === RegExp) return t.source === n.source && t.flags === n.flags;
|
|
469
|
+
if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === n.valueOf();
|
|
470
|
+
if (t.toString !== Object.prototype.toString) return t.toString() === n.toString();
|
|
471
|
+
if (i = Object.keys(t), r = i.length, r !== Object.keys(n).length) return !1;
|
|
472
|
+
for (o = r; o-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(n, i[o])) return !1;
|
|
473
|
+
for (o = r; o-- !== 0; ) {
|
|
474
474
|
let a = i[o];
|
|
475
|
-
if ((a !== "_owner" || !t.$$typeof) && !e(t[a],
|
|
475
|
+
if ((a !== "_owner" || !t.$$typeof) && !e(t[a], n[a])) return !1;
|
|
476
476
|
}
|
|
477
477
|
return !0;
|
|
478
478
|
}
|
|
479
|
-
return t != t &&
|
|
479
|
+
return t != t && n != n;
|
|
480
480
|
}, deepFreeze: function e(t) {
|
|
481
|
-
return Object.freeze(t), Object.keys(t).forEach((
|
|
482
|
-
typeof t[
|
|
481
|
+
return Object.freeze(t), Object.keys(t).forEach((n) => {
|
|
482
|
+
typeof t[n] != "object" || t[n] === null || Object.isFrozen(t[n]) || e(t[n]);
|
|
483
483
|
}), t;
|
|
484
484
|
}, deepMerge: Y, diffValues: (e, t) => {
|
|
485
|
-
const
|
|
485
|
+
const n = {}, r = Object.keys(t), o = r.length;
|
|
486
486
|
for (let i = 0; i < o; i++) {
|
|
487
|
-
const a =
|
|
488
|
-
e[a] !== t[a] && (e[a] === void 0 ?
|
|
489
|
-
}
|
|
490
|
-
return Object.keys(
|
|
491
|
-
}, findEqualOrGreater: function(e, t,
|
|
492
|
-
let
|
|
493
|
-
for (;
|
|
494
|
-
let i = Math.floor((
|
|
487
|
+
const a = r[i];
|
|
488
|
+
e[a] !== t[a] && (e[a] === void 0 ? n[a] = t[a] : n[a] = e[a]);
|
|
489
|
+
}
|
|
490
|
+
return Object.keys(n).length === 0 ? null : n;
|
|
491
|
+
}, findEqualOrGreater: function(e, t, n = Be) {
|
|
492
|
+
let r = 0, o = e.length - 1;
|
|
493
|
+
for (; r <= o; ) {
|
|
494
|
+
let i = Math.floor((r + o) / 2), a = n(e[i]);
|
|
495
495
|
if (a === t) return i;
|
|
496
|
-
a < t ?
|
|
496
|
+
a < t ? r = i + 1 : o = i - 1;
|
|
497
497
|
}
|
|
498
|
-
return
|
|
499
|
-
}, findEqualOrLesser: function(e, t,
|
|
500
|
-
let
|
|
501
|
-
for (;
|
|
502
|
-
let i = Math.floor((
|
|
498
|
+
return r;
|
|
499
|
+
}, findEqualOrLesser: function(e, t, n = Be) {
|
|
500
|
+
let r = e.length - 1, o = 0;
|
|
501
|
+
for (; r >= o; ) {
|
|
502
|
+
let i = Math.floor((r + o) / 2), a = n(e[i]);
|
|
503
503
|
if (a === t) return i;
|
|
504
|
-
a > t ?
|
|
504
|
+
a > t ? r = i - 1 : o = i + 1;
|
|
505
505
|
}
|
|
506
|
-
return
|
|
507
|
-
}, findNextStep: (e, t = !0,
|
|
508
|
-
const i = Math.max(e -
|
|
509
|
-
return Math.min(o, Math[t ? "ceil" : "floor"](i /
|
|
506
|
+
return r;
|
|
507
|
+
}, findNextStep: (e, t = !0, n = 15, r = 10, o = 400) => {
|
|
508
|
+
const i = Math.max(e - r, 0) + (t ? 1 : -1);
|
|
509
|
+
return Math.min(o, Math[t ? "ceil" : "floor"](i / n) * n + r);
|
|
510
510
|
}, getDPI: () => {
|
|
511
511
|
let e = 1;
|
|
512
512
|
return typeof window == "object" && (e = window.devicePixelRatio || 1), e;
|
|
513
513
|
}, getFromPath: (e, t) => {
|
|
514
|
-
const
|
|
515
|
-
let
|
|
516
|
-
for (let o = 0; o <
|
|
517
|
-
const i =
|
|
518
|
-
if (!
|
|
519
|
-
let a =
|
|
520
|
-
if (typeof a == "function" && (a = a.bind(
|
|
521
|
-
|
|
522
|
-
}
|
|
523
|
-
return
|
|
514
|
+
const n = t.split(".");
|
|
515
|
+
let r = e;
|
|
516
|
+
for (let o = 0; o < n.length; o++) {
|
|
517
|
+
const i = n[o];
|
|
518
|
+
if (!r) return null;
|
|
519
|
+
let a = r[i];
|
|
520
|
+
if (typeof a == "function" && (a = a.bind(r)()), !a || !ne(a)) return a;
|
|
521
|
+
r = a;
|
|
522
|
+
}
|
|
523
|
+
return r ?? null;
|
|
524
524
|
}, 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) => {
|
|
525
525
|
if (e === t) return !0;
|
|
526
526
|
if (e && !t || t && !e) return !1;
|
|
527
|
-
const
|
|
528
|
-
if (
|
|
529
|
-
for (let
|
|
527
|
+
const n = Object.keys(e);
|
|
528
|
+
if (n.length !== Object.keys(t).length) return !1;
|
|
529
|
+
for (let r = 0; r < n.length; r++) if (e[n[r]] !== t[n[r]]) return !1;
|
|
530
530
|
return !0;
|
|
531
531
|
}, isNode: ct, isNullOrUndefined: ze, isNumeric: (e) => {
|
|
532
532
|
const t = 1 * e;
|
|
533
533
|
return Number.isFinite(t) && typeof t == "number";
|
|
534
|
-
}, isObject:
|
|
534
|
+
}, 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) => {
|
|
535
535
|
const t = e.length;
|
|
536
|
-
if (t > 0 && e[t - 1] !== void 0 && !
|
|
537
|
-
let
|
|
538
|
-
for (let
|
|
539
|
-
return
|
|
536
|
+
if (t > 0 && e[t - 1] !== void 0 && !ne(e[t - 1])) return e[t - 1];
|
|
537
|
+
let n = e[0] || {};
|
|
538
|
+
for (let r = 1; r < t; r++) n = Y(n, e[r] || {}, { arrayMerge: (o, i) => [...i] });
|
|
539
|
+
return n;
|
|
540
540
|
}, nextTick: (e) => {
|
|
541
541
|
typeof window < "u" && typeof window.requestAnimationFrame == "function" ? window.requestAnimationFrame(() => {
|
|
542
542
|
e();
|
|
543
543
|
}) : (typeof setImmediate == "function" ? setImmediate : setTimeout)(() => {
|
|
544
544
|
e();
|
|
545
545
|
});
|
|
546
|
-
}, openFileDialog: (e = "*.*") => new Promise((t,
|
|
547
|
-
if (!Ve) return void
|
|
548
|
-
const
|
|
549
|
-
|
|
546
|
+
}, openFileDialog: (e = "*.*") => new Promise((t, n) => {
|
|
547
|
+
if (!Ve) return void n("Unable to open dialog with no dom.");
|
|
548
|
+
const r = document.createElement("input");
|
|
549
|
+
r.type = "file", r.accept = e;
|
|
550
550
|
let o = null, i = !1;
|
|
551
551
|
globalThis.addEventListener?.("focus", () => {
|
|
552
552
|
setTimeout(() => {
|
|
553
553
|
o || i || (i = !0, t(null));
|
|
554
554
|
}, 1e3);
|
|
555
|
-
}, { once: !0, passive: !0 }),
|
|
556
|
-
if (o =
|
|
555
|
+
}, { once: !0, passive: !0 }), r.onchange = () => {
|
|
556
|
+
if (o = r.files[0], o) {
|
|
557
557
|
if (i) return void console.warn("File open detected after faux cancel.", o);
|
|
558
558
|
t(o);
|
|
559
559
|
}
|
|
560
|
-
},
|
|
560
|
+
}, r.autofocus = !0, r.click();
|
|
561
561
|
}), rafThrottle: (e) => {
|
|
562
|
-
let t,
|
|
563
|
-
|
|
562
|
+
let t, n = !1, r = function() {
|
|
563
|
+
n = !1, e(t);
|
|
564
564
|
};
|
|
565
565
|
return function(o) {
|
|
566
|
-
t = o, t && t.persist && t.persist(),
|
|
566
|
+
t = o, t && t.persist && t.persist(), n || (n = !0, requestAnimationFrame(r));
|
|
567
567
|
};
|
|
568
568
|
}, removeEmptyProperties: lt, removeEqualValues: st, removeListenerAll: (e) => {
|
|
569
569
|
if (!e) return [];
|
|
570
570
|
for (let t = 0; t < e.length; t++) e[t] && e[t]();
|
|
571
571
|
return [];
|
|
572
572
|
}, requestTimeout: (e, t) => {
|
|
573
|
-
const
|
|
574
|
-
$e() -
|
|
573
|
+
const n = $e(), r = { id: requestAnimationFrame(function o() {
|
|
574
|
+
$e() - n >= t ? e.call(null) : r.id = requestAnimationFrame(o);
|
|
575
575
|
}) };
|
|
576
|
-
return
|
|
576
|
+
return r;
|
|
577
577
|
}, roundAccurately: (e, t = 0) => {
|
|
578
578
|
if (e == null || !isFinite(e)) return null;
|
|
579
|
-
const
|
|
580
|
-
return Number(Math.round(e *
|
|
581
|
-
}, setToPath: (e, t,
|
|
582
|
-
const
|
|
579
|
+
const n = 10 ** t;
|
|
580
|
+
return Number(Math.round(e * n) / n);
|
|
581
|
+
}, setToPath: (e, t, n) => {
|
|
582
|
+
const r = t.split(".");
|
|
583
583
|
let o = e;
|
|
584
584
|
if (!o) throw new Error("Can not set path to a null path.");
|
|
585
|
-
for (let i = 0; o && i <
|
|
586
|
-
const a =
|
|
585
|
+
for (let i = 0; o && i < r.length - 1; i++) {
|
|
586
|
+
const a = r[i];
|
|
587
587
|
let l = o[a];
|
|
588
|
-
if (l == null && (l = {}, o[a] = l), !
|
|
588
|
+
if (l == null && (l = {}, o[a] = l), !ne(l)) throw new Error("Can not set path to a non object path.");
|
|
589
589
|
o = l;
|
|
590
590
|
}
|
|
591
|
-
if (typeof
|
|
592
|
-
return o[
|
|
591
|
+
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.\`);
|
|
592
|
+
return o[r[r.length - 1]] = n, e;
|
|
593
593
|
}, splitNumber: (e) => {
|
|
594
594
|
let t = Math.abs(e);
|
|
595
595
|
if (isNaN(t) || !isFinite(e)) return null;
|
|
596
|
-
let
|
|
597
|
-
if (
|
|
598
|
-
return { ip: Math.trunc(e), fp: o, ipLength: Math.ceil(Math.log10(
|
|
599
|
-
}, subtractRect: (e, t,
|
|
596
|
+
let n = 0 | t, r = t - n, o = 0, i = 0, a = 1;
|
|
597
|
+
if (r > 5e-8) for (; i < 8 && Math.abs(o / a - r) > 5e-8; ) i++, a *= 10, o = Math.round(r * a);
|
|
598
|
+
return { ip: Math.trunc(e), fp: o, ipLength: Math.ceil(Math.log10(n + 1)), fpLength: i };
|
|
599
|
+
}, subtractRect: (e, t, n = !1) => {
|
|
600
600
|
if (!t) return [e];
|
|
601
601
|
if (!Ke(e, t)) return [];
|
|
602
|
-
const
|
|
602
|
+
const r = [];
|
|
603
603
|
let o = e;
|
|
604
604
|
const i = () => {
|
|
605
|
-
t.top > o.top && t.top < o.bottom && (
|
|
605
|
+
t.top > o.top && t.top < o.bottom && (r.push({ ...o, bottom: t.top }), o = { ...o, top: t.top });
|
|
606
606
|
}, a = () => {
|
|
607
|
-
t.bottom > o.top && t.bottom < o.bottom && (
|
|
607
|
+
t.bottom > o.top && t.bottom < o.bottom && (r.push({ ...o, top: t.bottom }), o = { ...o, bottom: t.bottom });
|
|
608
608
|
}, l = () => {
|
|
609
|
-
t.right > o.left && t.right < o.right && (
|
|
609
|
+
t.right > o.left && t.right < o.right && (r.push({ ...o, left: t.right }), o = { ...o, right: t.right });
|
|
610
610
|
}, u = () => {
|
|
611
|
-
t.left > o.left && t.left < o.right && (
|
|
611
|
+
t.left > o.left && t.left < o.right && (r.push({ ...o, right: t.left }), o = { ...o, left: t.left });
|
|
612
612
|
};
|
|
613
|
-
return
|
|
613
|
+
return n ? (u(), l(), i(), a()) : (i(), a(), l(), u()), r;
|
|
614
614
|
}, textToKey: (e) => e.replace(/[^a-zA-Z0-9]/g, "").toLowerCase(), throttle: function(e, t) {
|
|
615
|
-
let
|
|
616
|
-
return (...
|
|
615
|
+
let n = null;
|
|
616
|
+
return (...r) => {
|
|
617
617
|
const o = Date.now();
|
|
618
|
-
(!
|
|
618
|
+
(!n || o - n >= t) && (n = o, e(...r));
|
|
619
619
|
};
|
|
620
620
|
}, toSafeJSON: function e(t) {
|
|
621
621
|
if (t === null || typeof t != "object") return t;
|
|
622
622
|
if (typeof t.toJSON == "function") return t.toJSON();
|
|
623
|
-
if (Array.isArray(t)) return t.map((
|
|
623
|
+
if (Array.isArray(t)) return t.map((r) => e(r));
|
|
624
624
|
if (typeof t.toString == "function" && t.toString !== Object.prototype.toString) return t.toString();
|
|
625
|
-
const
|
|
626
|
-
for (const
|
|
627
|
-
return
|
|
625
|
+
const n = {};
|
|
626
|
+
for (const r in t) t.hasOwnProperty(r) && (n[r] = e(t[r]));
|
|
627
|
+
return n;
|
|
628
628
|
}, transpose: (e) => {
|
|
629
629
|
if (!e) return e;
|
|
630
|
-
const t = e.length,
|
|
631
|
-
for (let o = 0; o <
|
|
632
|
-
for (let o = 0; o < t; o++) for (let i = 0; i <
|
|
633
|
-
return
|
|
630
|
+
const t = e.length, n = e[0].length, r = [];
|
|
631
|
+
for (let o = 0; o < n; o++) r[o] = Array(t);
|
|
632
|
+
for (let o = 0; o < t; o++) for (let i = 0; i < n; i++) r[i][o] = e[o][i];
|
|
633
|
+
return r;
|
|
634
634
|
}, uuidV4: de, validEnumValue: (e, t) => {
|
|
635
635
|
if (!Object.values(e).includes(t)) throw new Error(\`Invalid type: \${t ?? "null"}. Must be one of: \${Object.values(t).join(", ")}.\`);
|
|
636
|
-
}, whenFocus: async (e, t = !1) => new Promise((
|
|
637
|
-
qe(e, t) ?
|
|
638
|
-
|
|
636
|
+
}, whenFocus: async (e, t = !1) => new Promise((n) => {
|
|
637
|
+
qe(e, t) ? n(!0) : e.addEventListener("focusin", () => {
|
|
638
|
+
n(!0);
|
|
639
639
|
}, { once: !0 }), e.focus();
|
|
640
640
|
}) }, Symbol.toStringTag, { value: "Module" }));
|
|
641
641
|
Object.freeze(Object.defineProperty({ __proto__: null, MESSAGE_ERROR_INVALID_ARG: (e) => \`Invalid argument: '\${e}'.\` }, Symbol.toStringTag, { value: "Module" }));
|
|
642
642
|
const ut = (e) => {
|
|
643
|
-
const t = new Uint8Array(e),
|
|
644
|
-
let
|
|
645
|
-
for (let o = 0; o <
|
|
646
|
-
if (typeof window < "u" && typeof globalThis.btoa == "function") return globalThis.btoa(
|
|
647
|
-
if (typeof Buffer < "u") return Buffer.from(
|
|
643
|
+
const t = new Uint8Array(e), n = t.byteLength;
|
|
644
|
+
let r = "";
|
|
645
|
+
for (let o = 0; o < n; o++) r += String.fromCharCode(t[o]);
|
|
646
|
+
if (typeof window < "u" && typeof globalThis.btoa == "function") return globalThis.btoa(r);
|
|
647
|
+
if (typeof Buffer < "u") return Buffer.from(r, "binary").toString("base64");
|
|
648
648
|
throw new Error("Unsupported environment");
|
|
649
|
-
}, Ce = (e) => new Promise((t,
|
|
649
|
+
}, Ce = (e) => new Promise((t, n) => {
|
|
650
650
|
if (e) if (typeof FileReader < "u") {
|
|
651
|
-
const
|
|
652
|
-
|
|
653
|
-
t(
|
|
654
|
-
},
|
|
655
|
-
r
|
|
656
|
-
},
|
|
651
|
+
const r = new FileReader();
|
|
652
|
+
r.onload = () => {
|
|
653
|
+
t(r.result);
|
|
654
|
+
}, r.onerror = () => {
|
|
655
|
+
n(r.error);
|
|
656
|
+
}, r.readAsText(e);
|
|
657
657
|
} else if (typeof Buffer < "u") {
|
|
658
|
-
const
|
|
658
|
+
const r = (o) => Buffer.from(o).toString("utf-8");
|
|
659
659
|
e.arrayBuffer().then((o) => {
|
|
660
|
-
t(
|
|
660
|
+
t(r(o));
|
|
661
661
|
}).catch((o) => {
|
|
662
|
-
|
|
662
|
+
n(o);
|
|
663
663
|
});
|
|
664
|
-
} else
|
|
664
|
+
} else n(new Error("Unsupported environment"));
|
|
665
665
|
else t("");
|
|
666
666
|
});
|
|
667
667
|
Object.freeze(Object.defineProperty({ __proto__: null, DEFAULT_MIME_TYPE: "*/*", arrayBufferToBase64: ut, base64ToArrayBuffer: (e) => {
|
|
668
|
-
const t = typeof window < "u" && typeof globalThis.atob == "function" ? globalThis.atob(e) : Buffer.from(e, "base64").toString("binary"),
|
|
669
|
-
for (let o = 0; o <
|
|
670
|
-
return
|
|
668
|
+
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);
|
|
669
|
+
for (let o = 0; o < n; o++) r[o] = t.charCodeAt(o);
|
|
670
|
+
return r.buffer;
|
|
671
671
|
}, blobToString: Ce }, Symbol.toStringTag, { value: "Module" }));
|
|
672
|
-
const dt = "data:image/png;base64,", ft = "Unable to resolve image.", Ge = (e) => new Promise(async (t,
|
|
673
|
-
let
|
|
672
|
+
const dt = "data:image/png;base64,", ft = "Unable to resolve image.", Ge = (e) => new Promise(async (t, n) => {
|
|
673
|
+
let r = null;
|
|
674
674
|
try {
|
|
675
|
-
|
|
676
|
-
t({ width:
|
|
677
|
-
}, { once: !0 }),
|
|
678
|
-
URL.revokeObjectURL(e),
|
|
679
|
-
}, { once: !0 }), await
|
|
675
|
+
r = new Image(), r.src = e, r.addEventListener("load", function() {
|
|
676
|
+
t({ width: r.naturalWidth, height: r.naturalHeight });
|
|
677
|
+
}, { once: !0 }), r.addEventListener("error", function() {
|
|
678
|
+
URL.revokeObjectURL(e), n("Invalid Image");
|
|
679
|
+
}, { once: !0 }), await r.decode("sync");
|
|
680
680
|
} catch {
|
|
681
|
-
|
|
681
|
+
r?.src && URL.revokeObjectURL(r.src);
|
|
682
682
|
}
|
|
683
|
-
|
|
683
|
+
r || n(ft);
|
|
684
684
|
}), we = "image/svg+xml";
|
|
685
|
-
Object.freeze(Object.defineProperty({ __proto__: null, DATA_URL_PNG_PREFIX: dt, getImageDataUrl: (e, t = 1) => new Promise(async (
|
|
685
|
+
Object.freeze(Object.defineProperty({ __proto__: null, DATA_URL_PNG_PREFIX: dt, getImageDataUrl: (e, t = 1) => new Promise(async (n, r) => {
|
|
686
686
|
let o = null;
|
|
687
687
|
try {
|
|
688
688
|
o = new Image(), o.src = e, o.addEventListener("load", function() {
|
|
@@ -690,42 +690,42 @@ Object.freeze(Object.defineProperty({ __proto__: null, DATA_URL_PNG_PREFIX: dt,
|
|
|
690
690
|
const i = document.createElement("canvas");
|
|
691
691
|
i.width = o.naturalWidth, i.height = o.naturalHeight, i.getContext("2d").drawImage(o, 0, 0);
|
|
692
692
|
const a = i.toDataURL("image/png", t);
|
|
693
|
-
|
|
693
|
+
n({ elemImg: o, dataUrl: a });
|
|
694
694
|
} catch (i) {
|
|
695
|
-
URL.revokeObjectURL(e),
|
|
695
|
+
URL.revokeObjectURL(e), r(i);
|
|
696
696
|
}
|
|
697
697
|
}, { once: !0 }), o.addEventListener("error", function() {
|
|
698
|
-
URL.revokeObjectURL(e),
|
|
698
|
+
URL.revokeObjectURL(e), r("Invalid Image");
|
|
699
699
|
}, { once: !0 }), await o.decode("sync");
|
|
700
700
|
} catch {
|
|
701
701
|
o?.src && URL.revokeObjectURL(o.src);
|
|
702
702
|
}
|
|
703
|
-
o ||
|
|
703
|
+
o || r(ft);
|
|
704
704
|
}), loadImageDetails: async (e, t = null) => {
|
|
705
|
-
let
|
|
706
|
-
const
|
|
705
|
+
let n = null;
|
|
706
|
+
const r = async () => {
|
|
707
707
|
try {
|
|
708
708
|
const i = t ?? "image/*", a = URL.createObjectURL(new Blob([e], { type: i })), l = await Ge(a);
|
|
709
|
-
|
|
709
|
+
n = { mimeType: i, naturalDimensions: l, asUrl: a };
|
|
710
710
|
} catch {
|
|
711
711
|
}
|
|
712
712
|
}, o = async () => {
|
|
713
713
|
try {
|
|
714
714
|
const i = new TextDecoder().decode(e), a = URL.createObjectURL(new Blob([i], { type: we })), l = await Ge(a);
|
|
715
|
-
|
|
715
|
+
n = { mimeType: t ?? we, naturalDimensions: l, asUrl: a, asSVGText: i };
|
|
716
716
|
} catch {
|
|
717
717
|
}
|
|
718
718
|
};
|
|
719
|
-
if (t === we ? await o() : t.startsWith("image/") ? await
|
|
720
|
-
return
|
|
719
|
+
if (t === we ? await o() : t.startsWith("image/") ? await r() : (await r(), n || await o()), !n) throw new Error("Failed to load image");
|
|
720
|
+
return n;
|
|
721
721
|
} }, Symbol.toStringTag, { value: "Module" }));
|
|
722
722
|
var We, Ye;
|
|
723
|
-
(Ye = We || (We = {})).resolveTypedUpdates = (e, t,
|
|
723
|
+
(Ye = We || (We = {})).resolveTypedUpdates = (e, t, n, r) => {
|
|
724
724
|
if (e === null) return e;
|
|
725
|
-
if (e === void 0) return
|
|
725
|
+
if (e === void 0) return r;
|
|
726
726
|
let o = e;
|
|
727
727
|
if (t?.shorthand) {
|
|
728
|
-
const u = t?.shorthand(e,
|
|
728
|
+
const u = t?.shorthand(e, n);
|
|
729
729
|
u !== void 0 && (o = u);
|
|
730
730
|
}
|
|
731
731
|
if (o !== null && t?.getSubType) {
|
|
@@ -734,18 +734,20 @@ var We, Ye;
|
|
|
734
734
|
}
|
|
735
735
|
const i = t?.properties, a = t?.arrayType ?? !1;
|
|
736
736
|
let l = o;
|
|
737
|
-
if (t && t.merge && l &&
|
|
738
|
-
else if (!a
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
737
|
+
if (t && t.merge && l && r) l = t.merge(l, r, n);
|
|
738
|
+
else if (!a) {
|
|
739
|
+
if (i) {
|
|
740
|
+
const u = Object.keys({ ...o, ...r });
|
|
741
|
+
l = null;
|
|
742
|
+
for (let f = 0; f < u.length; f++) {
|
|
743
|
+
const h = u[f];
|
|
744
|
+
let g, p = o[h];
|
|
745
|
+
if (p !== void 0) {
|
|
746
|
+
const y = i[h];
|
|
747
|
+
g = y ? (0, Ye.resolveTypedUpdates)(p, y, n, r?.[h]) : p;
|
|
748
|
+
} else g = r?.[h];
|
|
749
|
+
g != null && (l = l ?? {}, l[h] = g);
|
|
750
|
+
}
|
|
749
751
|
}
|
|
750
752
|
}
|
|
751
753
|
return l;
|
|
@@ -761,10 +763,10 @@ Please use Chrome or Edge if external copy and paste is required.\`, Perms: ye,
|
|
|
761
763
|
document.hasFocus() ? e() : globalThis.addEventListener?.("focus", () => {
|
|
762
764
|
e();
|
|
763
765
|
}, { once: !0 }), document.activeElement.focus?.();
|
|
764
|
-
}), be = async (e, t,
|
|
765
|
-
if (oe() === k.Safari) return await
|
|
766
|
+
}), be = async (e, t, n) => {
|
|
767
|
+
if (oe() === k.Safari) return await n(new Error(pt.Safari));
|
|
766
768
|
try {
|
|
767
|
-
const
|
|
769
|
+
const r = async (a) => {
|
|
768
770
|
try {
|
|
769
771
|
return await a();
|
|
770
772
|
} catch (l) {
|
|
@@ -773,9 +775,9 @@ Please use Chrome or Edge if external copy and paste is required.\`, Perms: ye,
|
|
|
773
775
|
}
|
|
774
776
|
}, o = await globalThis?.navigator?.permissions?.query({ name: e, allowWithoutGesture: !0, allowWithoutSanitization: !0 });
|
|
775
777
|
let i = !1;
|
|
776
|
-
if (o.state === "prompt" && (i = await
|
|
777
|
-
} catch (
|
|
778
|
-
return
|
|
778
|
+
if (o.state === "prompt" && (i = await r(t)), i || o.state !== "granted" || (i = await t()), !i) return await n(new Error(o.state));
|
|
779
|
+
} catch (r) {
|
|
780
|
+
return r.message === "No valid data on clipboard" || r.name === "DataError" ? void 0 : await n(r);
|
|
779
781
|
}
|
|
780
782
|
}, mt = async (e) => {
|
|
781
783
|
try {
|
|
@@ -785,21 +787,21 @@ Please use Chrome or Edge if external copy and paste is required.\`, Perms: ye,
|
|
|
785
787
|
return await e.read();
|
|
786
788
|
}, Bt = async (e, t) => {
|
|
787
789
|
if (!e) return null;
|
|
788
|
-
const
|
|
789
|
-
let
|
|
790
|
-
for (let o = 0; !
|
|
791
|
-
return await
|
|
792
|
-
return
|
|
790
|
+
const n = await mt(e);
|
|
791
|
+
let r = !1;
|
|
792
|
+
for (let o = 0; !r && n && o < n.length; o++) if (r = n[o].types.includes(t), r)
|
|
793
|
+
return await n[o].getType(t);
|
|
794
|
+
return r ? void 0 : null;
|
|
793
795
|
};
|
|
794
796
|
if (!globalThis.ClipboardItem) {
|
|
795
|
-
const e = (
|
|
797
|
+
const e = (n, r) => new Blob([r], { type: n });
|
|
796
798
|
class t {
|
|
797
|
-
constructor(
|
|
798
|
-
this._items = {}, this._types = Object.keys(
|
|
799
|
-
const i = {}, a = Object.keys(
|
|
799
|
+
constructor(r, o) {
|
|
800
|
+
this._items = {}, this._types = Object.keys(r);
|
|
801
|
+
const i = {}, a = Object.keys(r);
|
|
800
802
|
for (let l = 0; l < a.length; l++) {
|
|
801
803
|
const u = a[l];
|
|
802
|
-
let f =
|
|
804
|
+
let f = r[u];
|
|
803
805
|
i[u] = typeof f == "string" ? e(u, f) : f;
|
|
804
806
|
}
|
|
805
807
|
this._items = i, this._presentationStyle = o?.presentationStyle ?? "unspecified";
|
|
@@ -807,55 +809,55 @@ if (!globalThis.ClipboardItem) {
|
|
|
807
809
|
get types() {
|
|
808
810
|
return this._types;
|
|
809
811
|
}
|
|
810
|
-
getType(
|
|
811
|
-
return Promise.resolve(this._items[
|
|
812
|
+
getType(r) {
|
|
813
|
+
return Promise.resolve(this._items[r]);
|
|
812
814
|
}
|
|
813
|
-
supports(
|
|
815
|
+
supports(r) {
|
|
814
816
|
return !0;
|
|
815
817
|
}
|
|
816
818
|
}
|
|
817
819
|
globalThis.ClipboardItem = t;
|
|
818
820
|
}
|
|
819
|
-
const ve = async (e, t = S.html) => new Promise(async (
|
|
821
|
+
const ve = async (e, t = S.html) => new Promise(async (n, r) => {
|
|
820
822
|
try {
|
|
821
823
|
const o = await Bt(e, t);
|
|
822
824
|
if (o) {
|
|
823
825
|
const i = new FileReader();
|
|
824
826
|
i.onload = () => {
|
|
825
|
-
|
|
827
|
+
n(i.result);
|
|
826
828
|
}, i.onerror = () => {
|
|
827
|
-
|
|
829
|
+
n("");
|
|
828
830
|
}, i.readAsText(o);
|
|
829
|
-
} else
|
|
831
|
+
} else n("");
|
|
830
832
|
} catch (o) {
|
|
831
|
-
|
|
833
|
+
r(o);
|
|
832
834
|
}
|
|
833
835
|
}), He = async (e, t = S.html) => {
|
|
834
|
-
const
|
|
835
|
-
if (!
|
|
836
|
-
let
|
|
836
|
+
const n = await ve(e, t);
|
|
837
|
+
if (!n) return null;
|
|
838
|
+
let r = null;
|
|
837
839
|
try {
|
|
838
|
-
|
|
840
|
+
r = new DOMParser().parseFromString(n, S.html);
|
|
839
841
|
} catch {
|
|
840
842
|
console.warn("Can't parse html from clipboard.");
|
|
841
843
|
}
|
|
842
|
-
return
|
|
844
|
+
return r;
|
|
843
845
|
}, $t = async (e) => {
|
|
844
846
|
e && await e.writeText("");
|
|
845
847
|
}, ie = "clipboard-uuid", Q = "web text/uuid", Xe = (e) => \`<div style="display:none" \${ie}="\${e}"/>\`, zt = (e, t) => {
|
|
846
|
-
let
|
|
848
|
+
let n = null;
|
|
847
849
|
try {
|
|
848
|
-
const
|
|
849
|
-
|
|
850
|
-
} catch (
|
|
851
|
-
console.warn("Can't embed uuid.",
|
|
850
|
+
const r = new DOMParser().parseFromString(t, S.html);
|
|
851
|
+
r.body.firstElementChild.setAttribute(ie, e), n = r.getElementsByTagName("body")[0].innerHTML;
|
|
852
|
+
} catch (r) {
|
|
853
|
+
console.warn("Can't embed uuid.", r);
|
|
852
854
|
}
|
|
853
|
-
return
|
|
855
|
+
return n;
|
|
854
856
|
}, Ze = (e, t) => {
|
|
855
857
|
if (!t || !e) return !1;
|
|
856
858
|
try {
|
|
857
|
-
const
|
|
858
|
-
if (
|
|
859
|
+
const n = t.querySelectorAll(\`[\${ie}="\${e}"]\`);
|
|
860
|
+
if (n && n.length === 1) return !0;
|
|
859
861
|
if (t.querySelector("parsererror")) throw new Error("We are unable to parse node");
|
|
860
862
|
return !1;
|
|
861
863
|
} catch {
|
|
@@ -877,8 +879,8 @@ class Qe {
|
|
|
877
879
|
await ge();
|
|
878
880
|
const t = await ve(this._nativeClipboard, Q);
|
|
879
881
|
if (!this._state || t && t === this._state.uuid) return !0;
|
|
880
|
-
const
|
|
881
|
-
return !this._state || (Ze(this._state.uuid,
|
|
882
|
+
const n = await He(this._nativeClipboard, S.html);
|
|
883
|
+
return !this._state || (Ze(this._state.uuid, n) || this.clear(), !0);
|
|
882
884
|
}, async (t) => {
|
|
883
885
|
t?.message === "denied" || t.message?.includes("Document is not focused") || oe() === k.Safari || console.warn("Unable to detect clipboard changes: ", t);
|
|
884
886
|
});
|
|
@@ -889,7 +891,7 @@ class Qe {
|
|
|
889
891
|
t._checkForChanges();
|
|
890
892
|
}, this._onBlur = () => {
|
|
891
893
|
globalThis.addEventListener?.("focus", t._onFocus, { once: !0 });
|
|
892
|
-
}, globalThis.addEventListener?.("blur", this._onBlur), this._nativeClipboard.addEventListener("clipboardchange", (
|
|
894
|
+
}, globalThis.addEventListener?.("blur", this._onBlur), this._nativeClipboard.addEventListener("clipboardchange", (n) => {
|
|
893
895
|
t._checkForChanges();
|
|
894
896
|
}));
|
|
895
897
|
}
|
|
@@ -898,13 +900,13 @@ class Qe {
|
|
|
898
900
|
const t = this;
|
|
899
901
|
return await be("clipboard-read", async () => {
|
|
900
902
|
if (await ge(), this._state?.uuid) {
|
|
901
|
-
const
|
|
902
|
-
if (
|
|
903
|
-
const
|
|
904
|
-
if (Ze(t._state?.uuid,
|
|
903
|
+
const n = await ve(this._nativeClipboard, Q);
|
|
904
|
+
if (n && n === t._state.uuid) return !0;
|
|
905
|
+
const r = await He(this._nativeClipboard, S.html);
|
|
906
|
+
if (Ze(t._state?.uuid, r)) return !0;
|
|
905
907
|
}
|
|
906
908
|
return t._state = { items: await mt(this._nativeClipboard), uuid: null, ref: null }, this.dispatchEvent(new Event("clipboardread")), !0;
|
|
907
|
-
}, async (
|
|
909
|
+
}, async (n) => {
|
|
908
910
|
this.dispatchEvent(new Event("clipboarderrorread"));
|
|
909
911
|
}), this._state?.items ?? [];
|
|
910
912
|
}
|
|
@@ -913,10 +915,10 @@ class Qe {
|
|
|
913
915
|
}
|
|
914
916
|
async _write(t) {
|
|
915
917
|
if (!this._nativeClipboard) return this._state = t, this.dispatchEvent(new Event("clipboardwrite")), this.dispatchEvent(new Event("clipboardchange")), null;
|
|
916
|
-
const
|
|
918
|
+
const n = this, r = [], o = t.uuid;
|
|
917
919
|
let i = t.items ?? [];
|
|
918
920
|
const a = () => {
|
|
919
|
-
|
|
921
|
+
n._state = { uuid: o, ref: t.ref, items: r }, n.dispatchEvent(new Event("clipboardwrite")), n.dispatchEvent(new Event("clipboardchange"));
|
|
920
922
|
};
|
|
921
923
|
await be("clipboard-write", async () => {
|
|
922
924
|
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 }) })));
|
|
@@ -944,10 +946,10 @@ class Qe {
|
|
|
944
946
|
const T = u.types[y];
|
|
945
947
|
p[T] = y === f ? g : u.getType(T);
|
|
946
948
|
}
|
|
947
|
-
h && f === -1 && (p[S.html] = g), o && (p[Q] = new Blob([o], { type: Q })),
|
|
949
|
+
h && f === -1 && (p[S.html] = g), o && (p[Q] = new Blob([o], { type: Q })), r.push(new ClipboardItem(p));
|
|
948
950
|
}
|
|
949
951
|
try {
|
|
950
|
-
|
|
952
|
+
r && r.length !== 0 ? await this._nativeClipboard.write(r) : await $t(this._nativeClipboard);
|
|
951
953
|
} catch (l) {
|
|
952
954
|
l.message?.includes("Document is not focused") || console.warn("Unable to write to native clipboard: ", l);
|
|
953
955
|
}
|
|
@@ -958,28 +960,28 @@ class Qe {
|
|
|
958
960
|
}
|
|
959
961
|
async writeReference(t) {
|
|
960
962
|
if (!t) return void this.clear();
|
|
961
|
-
let
|
|
962
|
-
const
|
|
963
|
+
let n = null;
|
|
964
|
+
const r = {};
|
|
963
965
|
try {
|
|
964
966
|
const i = await t.toText?.() ?? null;
|
|
965
|
-
i && (
|
|
967
|
+
i && (r[S.plain] = new Blob([i ?? ""], { type: S.plain }));
|
|
966
968
|
} catch (i) {
|
|
967
|
-
|
|
969
|
+
n = i;
|
|
968
970
|
}
|
|
969
971
|
try {
|
|
970
972
|
const i = await t.toHtml?.() ?? null;
|
|
971
|
-
i && (
|
|
973
|
+
i && (r[S.html] = new Blob([i], { type: S.html }));
|
|
972
974
|
} catch (i) {
|
|
973
|
-
|
|
975
|
+
n = i, console.warn("export to html", i);
|
|
974
976
|
}
|
|
975
977
|
try {
|
|
976
978
|
const i = await t.toImage?.() ?? null;
|
|
977
|
-
i && (
|
|
979
|
+
i && (r[S.png] = i);
|
|
978
980
|
} catch (i) {
|
|
979
|
-
|
|
981
|
+
n = i, console.warn("export to png", i);
|
|
980
982
|
}
|
|
981
|
-
const o = this._write({ uuid: de(), ref: t, items: Object.keys(
|
|
982
|
-
if (
|
|
983
|
+
const o = this._write({ uuid: de(), ref: t, items: Object.keys(r).length > 0 ? [new ClipboardItem(r)] : null });
|
|
984
|
+
if (n) throw n;
|
|
983
985
|
return o;
|
|
984
986
|
}
|
|
985
987
|
clear(t = !1) {
|
|
@@ -989,32 +991,32 @@ class Qe {
|
|
|
989
991
|
return await this.read(), this._state?.ref ?? null;
|
|
990
992
|
}
|
|
991
993
|
readText() {
|
|
992
|
-
return new Promise(async (t,
|
|
993
|
-
const
|
|
994
|
+
return new Promise(async (t, n) => {
|
|
995
|
+
const r = await this.read();
|
|
994
996
|
let o = null;
|
|
995
|
-
for (let a = 0; !o &&
|
|
997
|
+
for (let a = 0; !o && r && a < r.length; a++) r[a].types.includes(S.plain) && (o = await r[a].getType(S.plain));
|
|
996
998
|
if (!o) return void t("");
|
|
997
999
|
const i = new FileReader();
|
|
998
1000
|
i.onload = () => {
|
|
999
1001
|
t(i.result);
|
|
1000
1002
|
}, i.readAsText(o), i.onerror = (a) => {
|
|
1001
|
-
|
|
1003
|
+
n(a);
|
|
1002
1004
|
};
|
|
1003
1005
|
});
|
|
1004
1006
|
}
|
|
1005
1007
|
async writeText(t) {
|
|
1006
|
-
const
|
|
1007
|
-
return this._write({ uuid: de(), items:
|
|
1008
|
+
const n = [new ClipboardItem({ [S.plain]: new Blob([t], { type: S.plain }) })];
|
|
1009
|
+
return this._write({ uuid: de(), items: n, ref: null });
|
|
1008
1010
|
}
|
|
1009
|
-
addEventListener(t,
|
|
1010
|
-
const o =
|
|
1011
|
+
addEventListener(t, n, r = {}) {
|
|
1012
|
+
const o = r?.capture ? this._listenersCapture : this._listeners;
|
|
1011
1013
|
let i = o.get(t);
|
|
1012
|
-
i || (i = /* @__PURE__ */ new Map(), o.set(t, i)), i.set(
|
|
1014
|
+
i || (i = /* @__PURE__ */ new Map(), o.set(t, i)), i.set(n, typeof r == "boolean" ? {} : r);
|
|
1013
1015
|
}
|
|
1014
1016
|
dispatchEvent(t) {
|
|
1015
1017
|
if (!t) return;
|
|
1016
|
-
const
|
|
1017
|
-
const o =
|
|
1018
|
+
const n = (r) => {
|
|
1019
|
+
const o = r.get(t.type);
|
|
1018
1020
|
o && o.forEach((i, a) => {
|
|
1019
1021
|
try {
|
|
1020
1022
|
typeof a == "function" ? a(t) : a.handleEvent && a.handleEvent(t), i.once && o.delete(a);
|
|
@@ -1023,11 +1025,11 @@ class Qe {
|
|
|
1023
1025
|
}
|
|
1024
1026
|
});
|
|
1025
1027
|
};
|
|
1026
|
-
return
|
|
1028
|
+
return n(this._listenersCapture), n(this._listeners), !0;
|
|
1027
1029
|
}
|
|
1028
|
-
removeEventListener(t,
|
|
1029
|
-
const o =
|
|
1030
|
-
i && (i.delete(
|
|
1030
|
+
removeEventListener(t, n, r) {
|
|
1031
|
+
const o = r?.capture ? this._listenersCapture : this._listeners, i = o.get(t);
|
|
1032
|
+
i && (i.delete(n), i.size === 0 && o.delete(t));
|
|
1031
1033
|
}
|
|
1032
1034
|
close() {
|
|
1033
1035
|
globalThis.removeEventListener?.("focus", this._onFocus), globalThis.removeEventListener?.("blur", this._onBlur);
|
|
@@ -1046,16 +1048,16 @@ async function Vt() {
|
|
|
1046
1048
|
return ee;
|
|
1047
1049
|
}
|
|
1048
1050
|
let e, t;
|
|
1049
|
-
le = new Promise((
|
|
1050
|
-
e =
|
|
1051
|
+
le = new Promise((n, r) => {
|
|
1052
|
+
e = n, t = r;
|
|
1051
1053
|
});
|
|
1052
1054
|
try {
|
|
1053
|
-
const { initialize:
|
|
1054
|
-
return
|
|
1055
|
+
const { initialize: n } = await Promise.resolve().then(function() {
|
|
1056
|
+
return nn;
|
|
1055
1057
|
});
|
|
1056
|
-
return ee = await
|
|
1057
|
-
} catch (
|
|
1058
|
-
throw console.error("Failed to import or initialize esbuild:",
|
|
1058
|
+
return ee = await n(), e(), ee;
|
|
1059
|
+
} catch (n) {
|
|
1060
|
+
throw console.error("Failed to import or initialize esbuild:", n), le = null, t(n), n;
|
|
1059
1061
|
}
|
|
1060
1062
|
}
|
|
1061
1063
|
const qt = {
|
|
@@ -1064,21 +1066,21 @@ const qt = {
|
|
|
1064
1066
|
target: "esnext"
|
|
1065
1067
|
}
|
|
1066
1068
|
};
|
|
1067
|
-
async function Gt(e, t,
|
|
1069
|
+
async function Gt(e, t, n = "/script.js", r = Kt) {
|
|
1068
1070
|
try {
|
|
1069
1071
|
const o = await Vt(), i = "@sheetxl/primitives", a = \`
|
|
1070
|
-
export const FormulaContext = globalThis.\${
|
|
1071
|
-
export const ScalarType = globalThis.\${
|
|
1072
|
-
export const Observable = globalThis.\${
|
|
1073
|
-
export const IRange = globalThis.\${
|
|
1074
|
-
export const FormulaError = globalThis.\${
|
|
1072
|
+
export const FormulaContext = globalThis.\${r}?.FormulaContext;
|
|
1073
|
+
export const ScalarType = globalThis.\${r}?.ScalarType;
|
|
1074
|
+
export const Observable = globalThis.\${r}?.Observable;
|
|
1075
|
+
export const IRange = globalThis.\${r}?.IRange;
|
|
1076
|
+
export const FormulaError = globalThis.\${r}?.FormulaError;
|
|
1075
1077
|
// Add more exports as needed
|
|
1076
1078
|
\`, l = {
|
|
1077
1079
|
// ESBuild.Plugin = {
|
|
1078
1080
|
name: "sheetxl-esbuild-in-memory",
|
|
1079
1081
|
setup(f) {
|
|
1080
1082
|
const h = "sheetxl-" + (/* @__PURE__ */ new Date()).getTime();
|
|
1081
|
-
f.onResolve({ filter: new RegExp(\`^(\${
|
|
1083
|
+
f.onResolve({ filter: new RegExp(\`^(\${n.replace("/", "\\\\/")}|\${i})$\`) }, (g) => ({
|
|
1082
1084
|
path: g.path,
|
|
1083
1085
|
namespace: h
|
|
1084
1086
|
})), f.onResolve({ filter: /.*/ }, (g) => {
|
|
@@ -1086,7 +1088,7 @@ async function Gt(e, t, r = "/script.js", n = Kt) {
|
|
|
1086
1088
|
return console.warn(\`esbuild: Treating import "\${g.path}" as external.\`), { path: g.path, external: !0 };
|
|
1087
1089
|
}), f.onLoad({ filter: /.*/, namespace: h }, (g) => {
|
|
1088
1090
|
let p;
|
|
1089
|
-
if (g.path ===
|
|
1091
|
+
if (g.path === n)
|
|
1090
1092
|
p = t;
|
|
1091
1093
|
else if (g.path === i)
|
|
1092
1094
|
p = a;
|
|
@@ -1102,7 +1104,7 @@ async function Gt(e, t, r = "/script.js", n = Kt) {
|
|
|
1102
1104
|
});
|
|
1103
1105
|
}
|
|
1104
1106
|
}, u = await o.build({
|
|
1105
|
-
entryPoints: [
|
|
1107
|
+
entryPoints: [n],
|
|
1106
1108
|
// Use the virtual entry point
|
|
1107
1109
|
bundle: !0,
|
|
1108
1110
|
// IMPORTANT: Enable bundling
|
|
@@ -1159,9 +1161,9 @@ interface Promise<T> {
|
|
|
1159
1161
|
["ICellRange", "range"],
|
|
1160
1162
|
["IFormulaContext", "context"]
|
|
1161
1163
|
]), _e = (e, t) => {
|
|
1162
|
-
Array.from(t.keys()).forEach((
|
|
1163
|
-
const o = t.get(
|
|
1164
|
-
t.set(\`\${e}.\${
|
|
1164
|
+
Array.from(t.keys()).forEach((r) => {
|
|
1165
|
+
const o = t.get(r);
|
|
1166
|
+
t.set(\`\${e}.\${r}\`, o);
|
|
1165
1167
|
});
|
|
1166
1168
|
}, Ht = /* @__PURE__ */ new Map([
|
|
1167
1169
|
["Scalar", "*"],
|
|
@@ -1187,7 +1189,7 @@ async function Qt() {
|
|
|
1187
1189
|
return se;
|
|
1188
1190
|
try {
|
|
1189
1191
|
return await (await Promise.resolve().then(function() {
|
|
1190
|
-
return
|
|
1192
|
+
return on;
|
|
1191
1193
|
})).initialize();
|
|
1192
1194
|
} catch (e) {
|
|
1193
1195
|
throw se = null, e;
|
|
@@ -1195,14 +1197,14 @@ async function Qt() {
|
|
|
1195
1197
|
se = null;
|
|
1196
1198
|
}
|
|
1197
1199
|
}
|
|
1198
|
-
async function
|
|
1200
|
+
async function en(e) {
|
|
1199
1201
|
const t = e?.source ?? null;
|
|
1200
1202
|
if (!t) return null;
|
|
1201
|
-
const
|
|
1203
|
+
const n = (e.disableBundle || e.declarationsOnly) ?? !1, r = [
|
|
1202
1204
|
Jt(),
|
|
1203
1205
|
//import('typescript'), // when bundled, but node check causes issues. We could bundle replace isNode but felt hacky
|
|
1204
1206
|
Qt()
|
|
1205
|
-
], o = await Promise.all(
|
|
1207
|
+
], o = await Promise.all(r), i = o[0], a = o[1];
|
|
1206
1208
|
let l = "", u = null;
|
|
1207
1209
|
const f = [], h = {
|
|
1208
1210
|
allowJs: !0,
|
|
@@ -1426,7 +1428,7 @@ async function er(e) {
|
|
|
1426
1428
|
throw new Error("No exported functions.");
|
|
1427
1429
|
const yt = \`\${Ut.uuidV4()}-script\`;
|
|
1428
1430
|
try {
|
|
1429
|
-
!
|
|
1431
|
+
!n && B.length === 0 && (l = await Gt(a, l, g));
|
|
1430
1432
|
} catch {
|
|
1431
1433
|
console.warn("Error bundling script");
|
|
1432
1434
|
}
|
|
@@ -1442,30 +1444,30 @@ async function er(e) {
|
|
|
1442
1444
|
return u && (Ie.autoRun = u), Ie;
|
|
1443
1445
|
}
|
|
1444
1446
|
self.addEventListener("message", async (e) => {
|
|
1445
|
-
const { id: t, params:
|
|
1447
|
+
const { id: t, params: n } = e.data;
|
|
1446
1448
|
try {
|
|
1447
|
-
const
|
|
1448
|
-
self.postMessage({ id: t, result:
|
|
1449
|
-
} catch (
|
|
1449
|
+
const r = await en(n);
|
|
1450
|
+
self.postMessage({ id: t, result: r, error: null });
|
|
1451
|
+
} catch (r) {
|
|
1450
1452
|
self.postMessage({
|
|
1451
1453
|
id: t,
|
|
1452
1454
|
result: null,
|
|
1453
1455
|
error: {
|
|
1454
|
-
message:
|
|
1455
|
-
stack:
|
|
1456
|
-
cause:
|
|
1456
|
+
message: r.message,
|
|
1457
|
+
stack: r.stack,
|
|
1458
|
+
cause: r.cause
|
|
1457
1459
|
}
|
|
1458
1460
|
});
|
|
1459
1461
|
}
|
|
1460
1462
|
});
|
|
1461
1463
|
let ce = null;
|
|
1462
|
-
async function
|
|
1464
|
+
async function tn() {
|
|
1463
1465
|
return ce || (ce = new Promise(async (e, t) => {
|
|
1464
1466
|
try {
|
|
1465
|
-
const
|
|
1467
|
+
const n = "0.20.2", r = \`https://esm.sh/esbuild-wasm@\${n}\`, o = \`https://esm.sh/esbuild-wasm@\${n}/esbuild.wasm\`, a = (await import(
|
|
1466
1468
|
/* webpackIgnore: true */
|
|
1467
1469
|
/* @vite-ignore */
|
|
1468
|
-
|
|
1470
|
+
r
|
|
1469
1471
|
)).default;
|
|
1470
1472
|
await a.initialize({
|
|
1471
1473
|
wasmURL: o,
|
|
@@ -1473,29 +1475,29 @@ async function tr() {
|
|
|
1473
1475
|
worker: !1
|
|
1474
1476
|
// Keep processing on the current thread
|
|
1475
1477
|
}), e(a);
|
|
1476
|
-
} catch (
|
|
1477
|
-
console.error("Error initializing esbuild:",
|
|
1478
|
+
} catch (n) {
|
|
1479
|
+
console.error("Error initializing esbuild:", n), t(n);
|
|
1478
1480
|
}
|
|
1479
1481
|
}), ce);
|
|
1480
1482
|
}
|
|
1481
|
-
var
|
|
1483
|
+
var nn = /* @__PURE__ */ Object.freeze({
|
|
1482
1484
|
__proto__: null,
|
|
1483
|
-
initialize:
|
|
1485
|
+
initialize: tn
|
|
1484
1486
|
});
|
|
1485
1487
|
let ue = null;
|
|
1486
|
-
async function
|
|
1488
|
+
async function rn() {
|
|
1487
1489
|
return ue || (ue = new Promise(async (e, t) => {
|
|
1488
|
-
let
|
|
1490
|
+
let n = null;
|
|
1489
1491
|
try {
|
|
1490
|
-
|
|
1491
|
-
} catch (
|
|
1492
|
-
console.error("Error initializing Browser TypeScript module:",
|
|
1492
|
+
n = await import("https://esm.sh/typescript@5.7.2");
|
|
1493
|
+
} catch (r) {
|
|
1494
|
+
console.error("Error initializing Browser TypeScript module:", r);
|
|
1493
1495
|
}
|
|
1494
|
-
|
|
1496
|
+
n || console.log("use script fallback"), e(n);
|
|
1495
1497
|
}), ue);
|
|
1496
1498
|
}
|
|
1497
|
-
var
|
|
1499
|
+
var on = /* @__PURE__ */ Object.freeze({
|
|
1498
1500
|
__proto__: null,
|
|
1499
|
-
initialize:
|
|
1501
|
+
initialize: rn
|
|
1500
1502
|
});
|
|
1501
|
-
`,a=typeof self<"u"&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",s],{type:"text/javascript;charset=utf-8"});function d(e){let n;try{if(n=a&&(self.URL||self.webkitURL).createObjectURL(a),!n)throw"";const t=new Worker(n,{type:"module",name:e?.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(n)}),t}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(s),{type:"module",name:e?.name})}}const l=async()=>{const{compileModule:e}=await Promise.resolve().then(()=>require("./
|
|
1503
|
+
`,a=typeof self<"u"&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",s],{type:"text/javascript;charset=utf-8"});function d(e){let n;try{if(n=a&&(self.URL||self.webkitURL).createObjectURL(a),!n)throw"";const t=new Worker(n,{type:"module",name:e?.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(n)}),t}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(s),{type:"module",name:e?.name})}}const l=async()=>{const{compileModule:e}=await Promise.resolve().then(()=>require("./BuB0aUcbgtZttT_w.cjs")),n=new u(t=>e(t));return await n.start(),n};exports.createCompilerWorker=async function(){if(typeof process<"u"&&process.versions?.node&&typeof Worker>"u")return await l();if(typeof Worker<"u"){const e=new c(()=>new d);try{return await e.start(),e}catch(n){console.error("Failed to start TypescriptCompiler worker reverting to fallback:",n)}}return await l()};
|