@sheetxl/sdk 0.4.12 → 0.4.14
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/8JuguQ-v_wjzRAJQ.cjs +6 -0
- package/browser/cjs/B06_i0NVsMlV7sL3.cjs +15 -0
- package/browser/cjs/BMzm6e19THp5R5SS.cjs +6 -0
- package/browser/cjs/{Dg4inQb_qTGcwKWj.cjs → BSQ6GwaDgEhp4-Jm.cjs} +3 -4
- package/browser/cjs/BSaEFx_1qH-bqkxA.cjs +32 -0
- package/browser/cjs/BeFLdMQtixEQOMIf.cjs +6 -0
- package/browser/cjs/Bypbx3PA2wZ-MxR7.cjs +1501 -0
- package/browser/cjs/C4rkyi5ne70h0eUM.cjs +13 -0
- package/browser/cjs/CK7GKaY19eDwb72K.cjs +6 -0
- package/browser/cjs/CQtudwvjokdRI8w7.cjs +6 -0
- package/browser/cjs/CZpCJ_mGf8uvTyHs.cjs +6 -0
- package/browser/cjs/CeW7HtHiebPU1ZrI.cjs +6 -0
- package/browser/cjs/CpD5wln4iVlrPfkY.cjs +6 -0
- package/browser/cjs/CxNcIlUbtVSt64Tm.cjs +6 -0
- package/browser/cjs/D0KawW_CBCzUbAwf.cjs +6 -0
- package/browser/cjs/D1hmSqsrlX7CR2o_.cjs +6 -0
- package/browser/cjs/D4c1Sr1XvF3nMs-j.cjs +6 -0
- package/browser/cjs/D6h0MMq-X27_iD6g.cjs +6 -0
- package/browser/cjs/DE3tCi_X6QIZF8tS.cjs +6 -0
- package/browser/cjs/DNRSQjR0UdY_4fl9.cjs +6 -0
- package/browser/cjs/DSUl7vRzR8mV1Myf.cjs +6 -0
- package/browser/cjs/DTAOALsCBhuSuEiG.cjs +6 -0
- package/browser/cjs/DaV0-3D2kIZdcEfA.cjs +6 -0
- package/browser/cjs/DejSF-jvG3xB_8YE.cjs +60 -0
- package/browser/cjs/Depd1YehybNaiyCe.cjs +6 -0
- package/browser/cjs/Dq9JXD1VUC_eXNv8.cjs +7 -0
- package/browser/cjs/DveSU-1M1dKih8ss.cjs +6 -0
- package/browser/cjs/QgxQTHhUBOvKb5Sp.cjs +6 -0
- package/browser/cjs/index.cjs +3 -4
- package/browser/cjs/is67OzV6HSQv8hND.cjs +6 -0
- package/browser/cjs/mD326DVwUY2qz53z.cjs +6 -0
- package/browser/cjs/p9-P5tsRY2aEac88.cjs +124 -0
- package/browser/cjs/rdaInA-ytvORY7dI.cjs +6 -0
- package/browser/cjs/v59Hlj7XX2HjAklI.cjs +6 -0
- package/{node/esm/Ru2U-PXJ-wtFJVIi.mjs → browser/esm/0y8470lJoPLFzYRG.mjs} +1 -1
- package/{node/esm/Cb2A-sSxQbrq7_st.mjs → browser/esm/6ofNyUJ2bff5hQAb.mjs} +1 -1
- package/browser/esm/8jrILMSMxtRYp4Ml.mjs +10 -0
- package/browser/esm/{9jeiH8SVL_ZJYLxo.mjs → B1U-ZkWRkC7EsWhJ.mjs} +7 -2
- package/browser/esm/BaQ-kJ0S48-mIDOB.mjs +10 -0
- package/browser/esm/Bg1s7CT60pr7m6Wv.mjs +24266 -0
- package/browser/esm/BjMYkedmgsLBSeIL.mjs +24 -0
- package/{node/esm/Cl6j-EVdzk8MvmYu.mjs → browser/esm/BwAtcwzMrBFQsJrt.mjs} +1 -1
- package/browser/esm/CA81BqhGVQdWnnU-.mjs +3974 -0
- package/browser/esm/CASK_saDBb0E8-gc.mjs +5651 -0
- package/browser/esm/CEPVn5ObLgMnhFuG.mjs +10 -0
- package/{node/esm/RjYTditNvvkkhvec.mjs → browser/esm/CJSlOHcd-GRplhJb.mjs} +1 -1
- package/browser/esm/CXCFBAK8GNqcf4NZ.mjs +426 -0
- package/browser/esm/CZH9NjmkPt5qOZvo.mjs +10 -0
- package/{node/esm/DqzaLjnlgJ73P6fj.mjs → browser/esm/Co_XNsi04fa0kXfc.mjs} +1 -1
- package/browser/esm/D2d6F8a0L2i5KG9B.mjs +1575 -0
- package/{node/esm/CEBBIejO4nn_eoLE.mjs → browser/esm/D5MCJciGCVt9S3_d.mjs} +1 -1
- package/{node/esm/D-7D30G3TPv5yZHW.mjs → browser/esm/D5m4uOGT4rzpeawH.mjs} +1 -1
- package/browser/esm/D799n_-syMIKHsZB.mjs +21 -0
- package/browser/esm/D7vGd1TA1pYs2r8i.mjs +10 -0
- package/{node/esm/_50UNzbNjsJJ5JeA.mjs → browser/esm/DDcxalm5bxkWR6yr.mjs} +1 -1
- package/{node/esm/Bkj8joA7ej1p4iQv.mjs → browser/esm/DGSd15RAMHKU4TTh.mjs} +1 -1
- package/browser/esm/DML06qJVWAeMmTeF.mjs +29 -0
- package/{node/esm/CEBaRGnJ6Pau61Z3.mjs → browser/esm/Dq1c2fRK8fy1wIZ0.mjs} +1 -1
- package/{node/esm/BJvhZja9zXr81ch6.mjs → browser/esm/Ds3gLJ0AViDNAZBb.mjs} +1 -1
- package/{node/esm/KTvP9pq_hIePsIcs.mjs → browser/esm/Dv-eMLsSU3GgM0IG.mjs} +1 -1
- package/{node/esm/CfSD4cLmkg0FqnhQ.mjs → browser/esm/IF7Bu3bAljYlYAhG.mjs} +1 -1
- package/browser/esm/Ijz2AYZo5041p_E0.mjs +820 -0
- package/{node/esm/DdQQdRO6WRU-o7fW.mjs → browser/esm/_9LudTdmURafvtbM.mjs} +1 -1
- package/{node/esm/DaA9EfLaa4eAL5v5.mjs → browser/esm/c0yMyZrKHAQcuk34.mjs} +1 -1
- package/browser/esm/c8TPaGQuorNwRY5P.mjs +472 -0
- package/browser/esm/flS4x_DXemCnqZYx.mjs +10 -0
- package/browser/esm/index.mjs +84 -2
- package/{node/esm/R6sbyZ3F8U46a2pT.mjs → browser/esm/utnJnW2cCjLr_J5j.mjs} +1 -1
- package/licenses/dependencies.txt +3 -3
- package/node/esm/0y8470lJoPLFzYRG.mjs +10 -0
- package/node/esm/6ofNyUJ2bff5hQAb.mjs +10 -0
- package/node/esm/{C2nQBB-2yJ1qfKsG.mjs → BAJg2qwLifwsMs48.mjs} +1 -1
- package/node/esm/{wYdBXNtyuqNnNqw7.mjs → BVwiUEUE8Kq6Q-Md.mjs} +2 -2
- package/node/esm/{ChgW0mo5gCgLQ4qn.mjs → Be8IGMeEVQrqyIbz.mjs} +1 -1
- package/node/esm/{BQb_TIMVKb4ap8qn.mjs → BkSSbBdHw5fSDT9u.mjs} +1 -1
- package/node/esm/{CSr4e1I9DtTv2w79.mjs → BlMT23s2F34fCyyF.mjs} +1 -1
- package/node/esm/BwAtcwzMrBFQsJrt.mjs +10 -0
- package/node/esm/CJSlOHcd-GRplhJb.mjs +10 -0
- package/node/esm/{BPhIhbwKpbuhJ5n5.mjs → Cg0Rg6HBC4czGxnY.mjs} +1 -1
- package/node/esm/{BnQS3_N8ZEyMLfgn.mjs → Ciz3vgy9vMXs8dGv.mjs} +1 -1
- package/node/esm/{BK_7sJa3fTDIKVsK.mjs → CmZcNpOTEY__HcNE.mjs} +2 -2
- package/node/esm/Co_XNsi04fa0kXfc.mjs +10 -0
- package/node/esm/{Bs1vmYEblngyWvkW.mjs → D-ebNw7-IJtP0UVf.mjs} +1 -1
- package/node/esm/{DPWAK-dKa7BGHzhV.mjs → D1IiK4HwSFrtL98j.mjs} +1 -1
- package/node/esm/D5MCJciGCVt9S3_d.mjs +10 -0
- package/node/esm/D5m4uOGT4rzpeawH.mjs +10 -0
- package/node/esm/DDcxalm5bxkWR6yr.mjs +10 -0
- package/{browser/esm/B-xoX7KIAUytU1_U.mjs → node/esm/DGSd15RAMHKU4TTh.mjs} +5 -2
- package/node/esm/Dbv1kS3xRdworJhn.mjs +80 -0
- package/node/esm/{BW1-l-HQdvRTQ7Bm.mjs → DmYC6rfHbxzRi-xv.mjs} +4 -4
- package/node/esm/Dq1c2fRK8fy1wIZ0.mjs +10 -0
- package/node/esm/Ds3gLJ0AViDNAZBb.mjs +10 -0
- package/node/esm/Dv-eMLsSU3GgM0IG.mjs +10 -0
- package/node/esm/{ebMdiumtVWrujqaH.mjs → Dw228_AFFTiN-qSG.mjs} +1 -1
- package/node/esm/{BtDgmaUXSuZwZauR.mjs → HHRD6y1sXoRYiRM-.mjs} +2 -2
- package/node/esm/IF7Bu3bAljYlYAhG.mjs +10 -0
- package/node/esm/_9LudTdmURafvtbM.mjs +10 -0
- package/node/esm/c0yMyZrKHAQcuk34.mjs +10 -0
- package/node/esm/{Cvzp8bwJnKvjvZSp.mjs → igBKvoiyyirwpnsa.mjs} +1 -1
- package/node/esm/index.mjs +3449 -3202
- package/node/esm/utnJnW2cCjLr_J5j.mjs +10 -0
- package/package.json +4 -4
- package/browser/cjs/39ybckEYrSwofEL8.cjs +0 -7
- package/browser/cjs/7F9Y23ZviM83MrLB.cjs +0 -7
- package/browser/cjs/9OWmR6t6tmtR3HKs.cjs +0 -7
- package/browser/cjs/AoftwE84s7sGV4YJ.cjs +0 -7
- package/browser/cjs/BJZM9I81r8nRPehZ.cjs +0 -7
- package/browser/cjs/BLHJddfDq44WHNs6.cjs +0 -7
- package/browser/cjs/BdbcopQNFs0VAYoZ.cjs +0 -7
- package/browser/cjs/C2McR1ZSNpfPMaI1.cjs +0 -7
- package/browser/cjs/CAC1euA3bA1IpMhZ.cjs +0 -7
- package/browser/cjs/CDwPpmyZAYF_aBaX.cjs +0 -7
- package/browser/cjs/CP2yuwDM2Fzm2bQy.cjs +0 -7
- package/browser/cjs/CSn-hMrEUwFcYpBT.cjs +0 -13
- package/browser/cjs/CeuXJMoeKjSnby5j.cjs +0 -7
- package/browser/cjs/Ch5W6IQIqcVy3CUV.cjs +0 -10
- package/browser/cjs/CtaH9jllSQmzD2AZ.cjs +0 -7
- package/browser/cjs/Ctw9E_2VE0l2P6Yk.cjs +0 -7
- package/browser/cjs/Czl-z-_3jRiufzFq.cjs +0 -7
- package/browser/cjs/D-HLMUqMDuHV5fFD.cjs +0 -7
- package/browser/cjs/D5pK8FbUHJmgHMVR.cjs +0 -7
- package/browser/cjs/DA7BmT8kgTnFcBps.cjs +0 -7
- package/browser/cjs/DBBaD9qGTCHmDZzt.cjs +0 -7
- package/browser/cjs/DD24B_zQQtT3iqLe.cjs +0 -7
- package/browser/cjs/DKwnqzohEhfP9-D8.cjs +0 -7
- package/browser/cjs/DO-igV-beWuURc9q.cjs +0 -7
- package/browser/cjs/DR2yNdWmKOx4XEn_.cjs +0 -7
- package/browser/cjs/D_PNelhiuhC_pYQe.cjs +0 -7
- package/browser/cjs/KlMBkdsOI1TbINZi.cjs +0 -7
- package/browser/cjs/Me1cXPMFZnMqu9Ni.cjs +0 -10
- package/browser/cjs/P1V-5yUNwU9r5yLw.cjs +0 -7
- package/browser/cjs/Vkjfeba56sx1eWi0.cjs +0 -7
- package/browser/cjs/dwUVhGNDSgZfRm3P.cjs +0 -7
- package/browser/cjs/txLIAZHRWIU9kf0I.cjs +0 -7
- package/browser/esm/30SRICLt1PAxlGS8.mjs +0 -7
- package/browser/esm/B_bzVKesE_JRp6EW.mjs +0 -7
- package/browser/esm/BbO1W_XgpJnqTSty.mjs +0 -7
- package/browser/esm/BngRU84kl6oeKeYG.mjs +0 -7
- package/browser/esm/BuJVzVii6s-ETLFo.mjs +0 -7
- package/browser/esm/ByHA0yF73W3Lubv1.mjs +0 -13
- package/browser/esm/C9XmeyBj3CidGuuQ.mjs +0 -7
- package/browser/esm/CGlSMtRCaIAn2kcK.mjs +0 -7
- package/browser/esm/CNZEHpuUipSLJnir.mjs +0 -7
- package/browser/esm/CUDgLpRqpHPjfaCi.mjs +0 -7
- package/browser/esm/ChB6ZgoNr49oUuh9.mjs +0 -7
- package/browser/esm/D0HYMuygnYvY7Atx.mjs +0 -7
- package/browser/esm/D1PWaFTHEZfGGXTb.mjs +0 -7
- package/browser/esm/D2zmZcBdOoyixeUA.mjs +0 -7
- package/browser/esm/D525g_2eyexUf3Zf.mjs +0 -7
- package/browser/esm/DMJw8DmfeX6u2glN.mjs +0 -7
- package/browser/esm/DfHQEyIlLlv5P49Q.mjs +0 -7
- package/browser/esm/Dhvtq8jHg8BxOR0C.mjs +0 -7
- package/browser/esm/DkPPc6PpShDjAHJV.mjs +0 -7
- package/browser/esm/DqEqprkW8poZvfjh.mjs +0 -7
- package/browser/esm/DtSj65a0yyYL8HUw.mjs +0 -7
- package/browser/esm/Dw0Okzcg5hIcHUcc.mjs +0 -7
- package/browser/esm/Dzo7yK5H2NRkocTa.mjs +0 -7
- package/browser/esm/G_2bOLOa20d7iobX.mjs +0 -7
- package/browser/esm/MRXgg6FvbB08Ze4M.mjs +0 -7
- package/browser/esm/SePiM6uWrcY09dym.mjs +0 -7
- package/browser/esm/eCZnrKI7SxPgdErZ.mjs +0 -7
- package/browser/esm/nE8H93zlwoi3F8Ii.mjs +0 -10
- package/browser/esm/ui3SG2ZyuCKIR0An.mjs +0 -7
- package/browser/esm/vk7TdrD0zPqtT8_n.mjs +0 -7
- package/browser/esm/yM_d2jrPPN_EupI0.mjs +0 -10
- package/node/esm/CWUmgm7_b5VypIPN.mjs +0 -80
|
@@ -0,0 +1,820 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.14
|
|
3
|
+
*
|
|
4
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/
|
|
7
|
+
const h = "text/html", b = "text/plain", L = "image/png", Tt = Object.freeze({ left: 0, top: 0 }), Ct = Object.freeze({ left: 0, top: 0, bottom: 0, right: 0 }), Mt = Object.freeze({ x: 0, y: 0, width: 0, height: 0 });
|
|
8
|
+
Object.freeze(Object.defineProperty({ __proto__: null, EmptyBounds: Mt, EmptyRect: Ct, EmptyTopLeft: Tt }, Symbol.toStringTag, { value: "Module" }));
|
|
9
|
+
const m = "column", j = "row", Rt = Object.freeze({ colIndex: 0, rowIndex: 0 }), At = Object.freeze({ colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 }), yt = (e, t) => e.colStart === t.colStart ? e.rowStart - t.rowStart : e.colStart - t.colStart, gt = (e, t) => e.rowStart === t.rowStart ? e.colStart - t.colStart : e.rowStart - t.rowStart, Ft = (e, t) => e.rowEnd === t.rowEnd ? t.colEnd - e.colEnd : t.rowEnd - e.rowEnd, Lt = (e, t) => e.colEnd === t.colEnd ? t.rowEnd - e.rowEnd : t.colEnd - e.colEnd, J = (e, t) => e.colIndex === t.colIndex ? e.rowIndex - t.rowIndex : e.colIndex - t.colIndex, H = (e, t) => e.rowIndex === t.rowIndex ? e.colIndex - t.colIndex : e.rowIndex - t.rowIndex, bt = (e = j, t = !1) => t ? e !== m ? Ft : Lt : e !== m ? gt : yt, K = (e, t) => e === t || !(!e || !t) && e.rowIndex === t.rowIndex && e.colIndex === t.colIndex, D = (e, t) => e === t || !(!e || !t) && e.rowStart === t.rowStart && e.rowEnd === t.rowEnd && e.colStart === t.colStart && e.colEnd === t.colEnd, $ = (e, t) => !(!e || !t || e.colStart > t.colEnd || t.colStart > e.colEnd || e.rowStart > t.rowEnd || t.rowStart > e.rowEnd), Y = (e, t) => {
|
|
10
|
+
if (e === t) return !0;
|
|
11
|
+
if (!e || !t || e.length !== t.length) return !1;
|
|
12
|
+
for (let r = 0; r < e.length; r++) if (!D(e[r], t[r])) return !1;
|
|
13
|
+
return !0;
|
|
14
|
+
}, U = (e, t, r) => {
|
|
15
|
+
if (!e && !t) return null;
|
|
16
|
+
if (!e) return r ? t : { ...t };
|
|
17
|
+
if (!t) return r ? e : { ...e };
|
|
18
|
+
const n = Math.min(e.colStart, t.colStart), o = Math.min(e.rowStart, t.rowStart), a = Math.max(e.colEnd, t.colEnd), i = Math.max(e.rowEnd, t.rowEnd);
|
|
19
|
+
let l = r;
|
|
20
|
+
return l ? (l.colStart = n, l.rowStart = o, l.colEnd = a, l.rowEnd = i) : l = { colStart: n, rowStart: o, colEnd: a, rowEnd: i }, l;
|
|
21
|
+
}, Z = (e, t) => {
|
|
22
|
+
if (!t || t.length === 0) return e;
|
|
23
|
+
const r = { ...e };
|
|
24
|
+
for (let n = 0; n < t.length; n++) {
|
|
25
|
+
const o = t[n];
|
|
26
|
+
$(r, o) && (r.rowStart = Math.min(r.rowStart, o.rowStart), r.colStart = Math.min(r.colStart, o.colStart), r.rowEnd = Math.max(r.rowEnd, o.rowEnd), r.colEnd = Math.max(r.colEnd, o.colEnd));
|
|
27
|
+
}
|
|
28
|
+
return r;
|
|
29
|
+
}, Ut = [null, null], Pt = (e, t, r) => {
|
|
30
|
+
if (e[0].value === e[1].value) return t;
|
|
31
|
+
};
|
|
32
|
+
function X(e, t = 2, r, n = j, o) {
|
|
33
|
+
let a = [...e];
|
|
34
|
+
if (t <= 0 || e.length <= 1) return a;
|
|
35
|
+
let i = n === m, l = 0, s = !1;
|
|
36
|
+
do {
|
|
37
|
+
const c = a.sort(bt(i ? j : m));
|
|
38
|
+
a = [], a.push(c[0]);
|
|
39
|
+
const d = c.length;
|
|
40
|
+
let w = 0, u = c[0], f = u.colStart, p = u.rowStart, x = u.colEnd, _ = u.rowEnd;
|
|
41
|
+
for (let A = 1; A < d; A++) {
|
|
42
|
+
const g = c[A];
|
|
43
|
+
let G = !1;
|
|
44
|
+
if (G = i ? u && p === g.rowStart && _ === g.rowEnd && x + 1 === g.colStart : u && f === g.colStart && x === g.colEnd && _ + 1 === g.rowStart, G) {
|
|
45
|
+
let S = { colStart: f, rowStart: p, colEnd: i ? g.colEnd : x, rowEnd: i ? _ : g.rowEnd };
|
|
46
|
+
if (u.value !== void 0 && (S.value = u.value), r) {
|
|
47
|
+
const F = o ?? [null, null];
|
|
48
|
+
F[0] = u, F[1] = g, S = r(F, S, n);
|
|
49
|
+
}
|
|
50
|
+
if (S) {
|
|
51
|
+
a[w] = S, s = !0, u = S, f = u.colStart, p = u.rowStart, x = u.colEnd, _ = u.rowEnd;
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
a[++w] = g, u = g, f = u.colStart, p = u.rowStart, x = u.colEnd, _ = u.rowEnd;
|
|
56
|
+
}
|
|
57
|
+
l++, i = !i, l === 1 && (s = !0);
|
|
58
|
+
} while (l < t && s && a.length > 1);
|
|
59
|
+
return a;
|
|
60
|
+
}
|
|
61
|
+
Object.freeze(Object.defineProperty({ __proto__: null, EmptyCell: Rt, EmptyRange: At, cellToRange: (e, t) => {
|
|
62
|
+
if (!e) return null;
|
|
63
|
+
let r = t;
|
|
64
|
+
return r || (r = { ...e }, delete r.colIndex, delete r.rowIndex), r.colStart = e.colIndex ?? 0, r.rowStart = e.rowIndex ?? 0, r.colEnd = e.colIndex ?? 0, r.rowEnd = e.rowIndex ?? 0, r;
|
|
65
|
+
}, columnFirstCellComparator: J, columnFirstRangeComparator: yt, createCellComparator: (e = j, t = !1) => t ? e !== m ? (r, n) => r.rowIndex === n.rowIndex ? n.colIndex - r.colIndex : n.rowIndex - r.rowIndex : (r, n) => r.colIndex === n.colIndex ? n.rowIndex - r.rowIndex : n.colIndex - r.colIndex : e !== m ? H : J, createConflatingRanges: (e, t = !1) => {
|
|
66
|
+
const r = [];
|
|
67
|
+
let n, o, a = Number.MIN_SAFE_INTEGER, i = Number.MIN_SAFE_INTEGER;
|
|
68
|
+
return { append: (l, s, c) => {
|
|
69
|
+
let d = !0;
|
|
70
|
+
const w = c !== void 0;
|
|
71
|
+
if (w) {
|
|
72
|
+
const p = e ? e(o, c, t) : o === c ? c : void 0;
|
|
73
|
+
p === void 0 ? d = !1 : c = p;
|
|
74
|
+
}
|
|
75
|
+
if (d && s === i + 1 && l === a) return t ? n.rowEnd = s : n.colEnd = s, i = s, void (o = c);
|
|
76
|
+
n && r.push(n);
|
|
77
|
+
const u = t ? l : s, f = t ? s : l;
|
|
78
|
+
n = { colStart: u, rowStart: f, colEnd: u, rowEnd: f }, w && (n.value = c), a = l, i = s, o = c;
|
|
79
|
+
}, done: (l) => (n && (r.push(n), n = null), l ? X(r, 3, l === !0 ? Pt : l, t ? m : j, Ut) : r) };
|
|
80
|
+
}, createRangeComparator: bt, defaultRange: (e, t, r) => e ? r ? (r.colStart = e.colStart ?? t.colStart, r.rowStart = e.rowStart ?? t.rowStart, r.colEnd = e.colEnd ?? t.colEnd, r.rowEnd = e.rowEnd ?? t.rowEnd, r) : { colStart: e.colStart ?? t.colStart, rowStart: e.rowStart ?? t.rowStart, colEnd: e.colEnd ?? t.colEnd, rowEnd: e.rowEnd ?? t.rowEnd } : t, extendRangeToIntersectingRanges: Z, extendRangeToUnionRanges: (e, t) => {
|
|
81
|
+
if (!t || t.length === 0) return e;
|
|
82
|
+
let r = e, n = null;
|
|
83
|
+
for (; !D(r, n); ) n = r, r = Z(n, t);
|
|
84
|
+
return r;
|
|
85
|
+
}, indexOfCoords: (e, t) => {
|
|
86
|
+
const r = { colStart: e.colIndex, rowStart: e.rowIndex, colEnd: e.colIndex, rowEnd: e.rowIndex };
|
|
87
|
+
for (let n = t.length - 1; n >= 0; n--) if ($(r, t[n])) return n;
|
|
88
|
+
return -1;
|
|
89
|
+
}, intersectRanges: (e, t, r) => {
|
|
90
|
+
if (!e) return r ? t : { ...t };
|
|
91
|
+
if (!t) return r ? e : { ...e };
|
|
92
|
+
if (!e && !t || e.rowStart > t.rowEnd || e.rowEnd < t.rowStart || e.colStart > t.colEnd || e.colEnd < t.colStart) return null;
|
|
93
|
+
const n = Math.max(e.colStart, t.colStart), o = Math.max(e.rowStart, t.rowStart), a = Math.min(e.colEnd, t.colEnd), i = Math.min(e.rowEnd, t.rowEnd);
|
|
94
|
+
let l = r;
|
|
95
|
+
return l ? (l.colStart = n, l.rowStart = o, l.colEnd = a, l.rowEnd = i) : l = { colStart: n, rowStart: o, colEnd: a, rowEnd: i }, l;
|
|
96
|
+
}, isCellWithinRange: (e, t) => !(!e || !t || e.rowIndex < t.rowStart || e.rowIndex > t.rowEnd || e.colIndex < t.colStart || e.colIndex > t.colEnd), isEqualCells: K, isEqualRanges: D, isEqualRangesArrays: Y, isEqualSelectionCoords: (e, t) => e === t || !(!e || !t) && e.rangeIndex === t.rangeIndex && !!K(e.cell, t.cell) && Y(e.ranges, t.ranges), isRangeWithinRange: (e, t) => !(e.rowStart < t.rowStart || e.rowEnd > t.rowEnd || e.colStart < t.colStart || e.colEnd > t.colEnd), isRangesIntersect: $, isSingleCell: (e) => !!e && e.rowEnd === e.rowStart && e.colStart === e.colEnd, isValidRange: (e) => !(!e || typeof e.colStart != "number" || e.colStart < 0 || typeof e.colEnd != "number" || e.colEnd < e.colStart || typeof e.rowStart != "number" || e.rowStart < 0 || typeof e.rowEnd != "number" || e.rowEnd < e.rowStart), mergeRangedValues: X, rowFirstCellComparator: H, rowFirstRangeComparator: gt, sanitizeRange: (e) => e ? { colStart: e.colIndex ?? e.colStart ?? 0, rowStart: e.rowIndex ?? e.rowStart ?? 0, colEnd: e.colIndex ?? e.colEnd ?? 0, rowEnd: e.rowIndex ?? e.rowEnd ?? 0 } : null, translateRange: (e, t = -e.rowStart, r = -e.colStart, n) => n ? (n.colStart = e.colStart + r, n.rowStart = e.rowStart + t, n.colEnd = e.colEnd + r, n.rowEnd = e.rowEnd + t, n) : { colStart: e.colStart + r, rowStart: e.rowStart + t, colEnd: e.colEnd + r, rowEnd: e.rowEnd + t }, unionRanges: U, unionRangesArrays: (e, t, r) => {
|
|
97
|
+
if (!e || e.length === 0) return null;
|
|
98
|
+
if (e.length === 1 && !t) return e[0];
|
|
99
|
+
let n = e[0];
|
|
100
|
+
for (let o = 1; o < e.length; o++) n = U(n, e[o], r);
|
|
101
|
+
return t && (n = U(n, t, r)), n;
|
|
102
|
+
} }, Symbol.toStringTag, { value: "Module" }));
|
|
103
|
+
const kt = typeof Symbol == "function" && Symbol.for ? Symbol.for("react.element") : 60103;
|
|
104
|
+
function Nt(e) {
|
|
105
|
+
return /* @__PURE__ */ function(t) {
|
|
106
|
+
return !!t && typeof t == "object";
|
|
107
|
+
}(e) && !function(t) {
|
|
108
|
+
const r = Object.prototype.toString.call(t);
|
|
109
|
+
return r === "[object RegExp]" || r === "[object Date]" || t.$$typeof === kt;
|
|
110
|
+
}(e);
|
|
111
|
+
}
|
|
112
|
+
function I(e, t) {
|
|
113
|
+
return t.clone !== !1 && t.isMergeableObject(e) ? E((r = e, Array.isArray(r) ? [] : {}), e, t) : e;
|
|
114
|
+
var r;
|
|
115
|
+
}
|
|
116
|
+
function Bt(e, t, r) {
|
|
117
|
+
return e.concat(t).map(function(n) {
|
|
118
|
+
return I(n, r);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function Q(e) {
|
|
122
|
+
return Object.keys(e).concat((t = e, Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(t).filter(function(r) {
|
|
123
|
+
return Object.propertyIsEnumerable.call(t, r);
|
|
124
|
+
}) : []));
|
|
125
|
+
var t;
|
|
126
|
+
}
|
|
127
|
+
function tt(e, t) {
|
|
128
|
+
try {
|
|
129
|
+
return t in e;
|
|
130
|
+
} catch {
|
|
131
|
+
return !1;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
function E(e, t, r) {
|
|
135
|
+
(r = r || {}).arrayMerge = r.arrayMerge || Bt, r.isMergeableObject = r.isMergeableObject || Nt, r.cloneUnlessOtherwiseSpecified = I;
|
|
136
|
+
const n = Array.isArray(t);
|
|
137
|
+
return n === Array.isArray(e) ? n ? r.arrayMerge(e, t, r) : function(o, a, i) {
|
|
138
|
+
const l = {};
|
|
139
|
+
return i.isMergeableObject(o) && Q(o).forEach(function(s) {
|
|
140
|
+
l[s] = I(o[s], i);
|
|
141
|
+
}), Q(a).forEach(function(s) {
|
|
142
|
+
var c, d;
|
|
143
|
+
tt(c = o, d = s) && (!Object.hasOwnProperty.call(c, d) || !Object.propertyIsEnumerable.call(c, d)) || (tt(o, s) && i.isMergeableObject(a[s]) ? l[s] = function(w, u) {
|
|
144
|
+
if (!u.customMerge) return E;
|
|
145
|
+
const f = u.customMerge(w);
|
|
146
|
+
return typeof f == "function" ? f : E;
|
|
147
|
+
}(s, i)(o[s], a[s], i) : l[s] = I(a[s], i));
|
|
148
|
+
}), l;
|
|
149
|
+
}(e, t, r) : I(t, r);
|
|
150
|
+
}
|
|
151
|
+
E.all = function(e, t) {
|
|
152
|
+
if (!Array.isArray(e)) throw new Error("first argument should be an array");
|
|
153
|
+
return e.reduce(function(r, n) {
|
|
154
|
+
return E(r, n, t);
|
|
155
|
+
}, {});
|
|
156
|
+
};
|
|
157
|
+
const zt = Object.freeze([]), qt = Object.freeze({}), et = (e) => e, R = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
158
|
+
let t = 16 * Math.random() | 0;
|
|
159
|
+
return (e === "x" ? t : 3 & t | 8).toString(16);
|
|
160
|
+
}), mt = (e, t) => e === t || !(!Array.isArray(e) || !Array.isArray(t) || e.length !== t.length) && e.every((r, n) => r === t[n]), O = (e) => typeof e == "object" && !Array.isArray(e) && e !== null, Et = (e) => typeof e != "object" || Array.isArray(e) || e === null ? e : (Object.keys(e).forEach(function(t) {
|
|
161
|
+
e[t] && typeof e[t] == "object" ? Et(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];
|
|
162
|
+
}), Object.keys(e).length === 0 ? null : e), Dt = (e, t) => !(e !== t && !mt(e, t) && !e.isEqual?.(t)), St = (e, t, r = Dt) => {
|
|
163
|
+
if (e == null || e === t) return null;
|
|
164
|
+
if (!e || typeof e != "object" || Array.isArray(e) || e.isImmutable?.()) return r(e, t) ? null : e;
|
|
165
|
+
const n = Object.keys(e);
|
|
166
|
+
if (n.length === 0) return null;
|
|
167
|
+
let o = !1;
|
|
168
|
+
for (let a = 0; a < n.length; a++) {
|
|
169
|
+
const i = n[a];
|
|
170
|
+
St(e[i], t?.[i], r) === null && (o = !0, delete e[i]);
|
|
171
|
+
}
|
|
172
|
+
return o && Object.keys(e).length === 0 ? null : void 0;
|
|
173
|
+
}, rt = typeof performance == "object" && typeof performance.now == "function" ? () => performance.now() : () => Date.now(), nt = (e) => e == null, ot = (e, t) => !(t.left > e.right || t.right < e.left || t.top > e.bottom || t.bottom < e.top), at = !(typeof window > "u" || !window.document || !window.document.createElement), y = { Windows: "windows", MacOS: "macos", IOS: "ios", Linux: "linux", Android: "android", Safari: "safari", Firefox: "firefox", Node: "node", Unknown: "unknown" }, T = () => {
|
|
174
|
+
if (vt()) return y.Node;
|
|
175
|
+
const e = globalThis.navigator !== void 0 && globalThis.navigator.userAgent ? globalThis.navigator.userAgent.toLowerCase() : "";
|
|
176
|
+
return e ? /(win32|win64|windows|wince)/i.test(e) ? y.Windows : /(macintosh|macintel|macppc|mac68k|macos)/i.test(e) ? y.MacOS : /(iphone|ipad|ipod)/i.test(e) ? y.IOS : /android/.test(e) ? y.Android : /linux/.test(e) ? y.Linux : /^((?!chrome|android|).)*safari/i.test(e) ? y.Safari : /^((?!chrome|android|Seamonkey).)*firefox/i.test(e) ? y.Firefox : y.Unknown : y.Unknown;
|
|
177
|
+
};
|
|
178
|
+
function vt() {
|
|
179
|
+
return typeof process < "u" && process.release?.name === "node" || (typeof process < "u" && process.browser, !1);
|
|
180
|
+
}
|
|
181
|
+
const it = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeElement || e?.contains(document.activeElement)), $t = Object.freeze(Object.defineProperty({ __proto__: null, EmptyArray: zt, EmptyObject: qt, OSType: y, arrayMove: function(e, t, r) {
|
|
182
|
+
const n = e.slice();
|
|
183
|
+
return n.splice(r < 0 ? n.length + r : r, 0, n.splice(t, 1)[0]), n;
|
|
184
|
+
}, asNumber: (e) => {
|
|
185
|
+
const t = 1 * e;
|
|
186
|
+
return Number.isFinite(t) ? t : 0;
|
|
187
|
+
}, camelToPrettyCase: (e) => e.length === 1 ? e.toUpperCase() : e.replace(/([A-Z])/g, " $1").replace(/^./, function(t) {
|
|
188
|
+
return t.toUpperCase();
|
|
189
|
+
}).trim(), canUseDOM: at, cancelTimeout: (e) => {
|
|
190
|
+
cancelAnimationFrame(e.id);
|
|
191
|
+
}, castToString: (e) => e == null || e === void 0 ? "" : typeof e != "string" ? "" + e : e, cloneObject: (e) => nt(e) ? e : JSON.parse(JSON.stringify(e)), consoleWithNoSource: (...e) => new Promise((t) => {
|
|
192
|
+
setTimeout(() => {
|
|
193
|
+
Function("console.log.apply(console, arguments)").apply(null, e), t();
|
|
194
|
+
});
|
|
195
|
+
}), debounce: function(e, t = 300, r = !1) {
|
|
196
|
+
let n, o, a, i, l = 0;
|
|
197
|
+
function s() {
|
|
198
|
+
let d = Date.now() - l;
|
|
199
|
+
d < t && d >= 0 ? n = setTimeout(s, t - d) : (n = null, r || (i = e.apply(a, o), a = o = null));
|
|
200
|
+
}
|
|
201
|
+
t == null && (t = 100);
|
|
202
|
+
const c = function() {
|
|
203
|
+
a = globalThis, o = arguments, l = Date.now();
|
|
204
|
+
var d = r && !n;
|
|
205
|
+
return n || (n = setTimeout(s, t)), d && (i = e.apply(a, o), a = o = null), i;
|
|
206
|
+
};
|
|
207
|
+
return c.clear = function() {
|
|
208
|
+
n && (clearTimeout(n), n = null);
|
|
209
|
+
}, c.flush = function() {
|
|
210
|
+
n && (i = e.apply(a, o), a = o = null, clearTimeout(n), n = null);
|
|
211
|
+
}, c;
|
|
212
|
+
}, deepEqual: function e(t, r) {
|
|
213
|
+
if (t === r) return !0;
|
|
214
|
+
if (t && r && typeof t == "object" && typeof r == "object") {
|
|
215
|
+
if (t.constructor !== r.constructor) return !1;
|
|
216
|
+
let n, o, a;
|
|
217
|
+
if (Array.isArray(t)) {
|
|
218
|
+
if (n = t.length, n != r.length) return !1;
|
|
219
|
+
for (o = n; o-- !== 0; ) if (!e(t[o], r[o])) return !1;
|
|
220
|
+
return !0;
|
|
221
|
+
}
|
|
222
|
+
if (t instanceof Map && r instanceof Map) {
|
|
223
|
+
if (t.size !== r.size) return !1;
|
|
224
|
+
for (o of t.entries()) if (!r.has(o[0])) return !1;
|
|
225
|
+
for (o of t.entries()) if (!e(o[1], r.get(o[0]))) return !1;
|
|
226
|
+
return !0;
|
|
227
|
+
}
|
|
228
|
+
if (t instanceof Set && r instanceof Set) {
|
|
229
|
+
if (t.size !== r.size) return !1;
|
|
230
|
+
for (o of t.entries()) if (!r.has(o[0])) return !1;
|
|
231
|
+
return !0;
|
|
232
|
+
}
|
|
233
|
+
if (ArrayBuffer.isView(t) && ArrayBuffer.isView(r)) {
|
|
234
|
+
if (n = t.length, n != r.length) return !1;
|
|
235
|
+
for (o = n; o-- !== 0; ) if (t[o] !== r[o]) return !1;
|
|
236
|
+
return !0;
|
|
237
|
+
}
|
|
238
|
+
if (t.constructor === RegExp) return t.source === r.source && t.flags === r.flags;
|
|
239
|
+
if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === r.valueOf();
|
|
240
|
+
if (t.toString !== Object.prototype.toString) return t.toString() === r.toString();
|
|
241
|
+
if (a = Object.keys(t), n = a.length, n !== Object.keys(r).length) return !1;
|
|
242
|
+
for (o = n; o-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(r, a[o])) return !1;
|
|
243
|
+
for (o = n; o-- !== 0; ) {
|
|
244
|
+
let i = a[o];
|
|
245
|
+
if (!(i === "_owner" && t.$$typeof || e(t[i], r[i]))) return !1;
|
|
246
|
+
}
|
|
247
|
+
return !0;
|
|
248
|
+
}
|
|
249
|
+
return t != t && r != r;
|
|
250
|
+
}, deepFreeze: function e(t) {
|
|
251
|
+
return Object.freeze(t), Object.keys(t).forEach((r) => {
|
|
252
|
+
typeof t[r] != "object" || t[r] === null || Object.isFrozen(t[r]) || e(t[r]);
|
|
253
|
+
}), t;
|
|
254
|
+
}, deepMerge: E, diffValues: (e, t) => {
|
|
255
|
+
const r = {}, n = Object.keys(t), o = n.length;
|
|
256
|
+
for (let a = 0; a < o; a++) {
|
|
257
|
+
const i = n[a];
|
|
258
|
+
e[i] !== t[i] && (e[i] === void 0 ? r[i] = t[i] : r[i] = e[i]);
|
|
259
|
+
}
|
|
260
|
+
return Object.keys(r).length === 0 ? null : r;
|
|
261
|
+
}, findEqualOrGreater: function(e, t, r = et) {
|
|
262
|
+
let n = 0, o = e.length - 1;
|
|
263
|
+
for (; n <= o; ) {
|
|
264
|
+
let a = Math.floor((n + o) / 2), i = r(e[a]);
|
|
265
|
+
if (i === t) return a;
|
|
266
|
+
i < t ? n = a + 1 : o = a - 1;
|
|
267
|
+
}
|
|
268
|
+
return n;
|
|
269
|
+
}, findEqualOrLesser: function(e, t, r = et) {
|
|
270
|
+
let n = e.length - 1, o = 0;
|
|
271
|
+
for (; n >= o; ) {
|
|
272
|
+
let a = Math.floor((n + o) / 2), i = r(e[a]);
|
|
273
|
+
if (i === t) return a;
|
|
274
|
+
i > t ? n = a - 1 : o = a + 1;
|
|
275
|
+
}
|
|
276
|
+
return n;
|
|
277
|
+
}, findNextStep: (e, t = !0, r = 15, n = 10, o = 400) => {
|
|
278
|
+
const a = Math.max(e - n, 0) + (t ? 1 : -1);
|
|
279
|
+
return Math.min(o, Math[t ? "ceil" : "floor"](a / r) * r + n);
|
|
280
|
+
}, getDPI: () => {
|
|
281
|
+
let e = 1;
|
|
282
|
+
return typeof window == "object" && (e = window.devicePixelRatio || 1), e;
|
|
283
|
+
}, getFromPath: (e, t) => {
|
|
284
|
+
const r = t.split(".");
|
|
285
|
+
let n = e;
|
|
286
|
+
for (let o = 0; o < r.length; o++) {
|
|
287
|
+
const a = r[o];
|
|
288
|
+
if (!n) return null;
|
|
289
|
+
let i = n[a];
|
|
290
|
+
if (typeof i == "function" && (i = i.bind(n)()), !i || !O(i)) return i;
|
|
291
|
+
n = i;
|
|
292
|
+
}
|
|
293
|
+
return n ?? null;
|
|
294
|
+
}, getOS: T, hasFocus: it, isDefined: (e) => e != null, isEmpty: (e) => e == null || e === "", isEqualArrays: mt, 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) => {
|
|
295
|
+
if (e === t) return !0;
|
|
296
|
+
if (e && !t || t && !e) return !1;
|
|
297
|
+
const r = Object.keys(e);
|
|
298
|
+
if (r.length !== Object.keys(t).length) return !1;
|
|
299
|
+
for (let n = 0; n < r.length; n++) if (e[r[n]] !== t[r[n]]) return !1;
|
|
300
|
+
return !0;
|
|
301
|
+
}, isNode: vt, isNullOrUndefined: nt, isNumeric: (e) => {
|
|
302
|
+
const t = 1 * e;
|
|
303
|
+
return Number.isFinite(t) && typeof t == "number";
|
|
304
|
+
}, isObject: O, 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: ot, mergeContentful: (...e) => {
|
|
305
|
+
const t = e.length;
|
|
306
|
+
if (t > 0 && e[t - 1] !== void 0 && !O(e[t - 1])) return e[t - 1];
|
|
307
|
+
let r = e[0] || {};
|
|
308
|
+
for (let n = 1; n < t; n++) r = E(r, e[n] || {}, { arrayMerge: (o, a) => [...a] });
|
|
309
|
+
return r;
|
|
310
|
+
}, nextTick: (e) => {
|
|
311
|
+
typeof window < "u" && typeof window.requestAnimationFrame == "function" ? window.requestAnimationFrame(() => {
|
|
312
|
+
e();
|
|
313
|
+
}) : (typeof setImmediate == "function" ? setImmediate : setTimeout)(() => {
|
|
314
|
+
e();
|
|
315
|
+
});
|
|
316
|
+
}, openFileDialog: (e = "*.*") => new Promise((t, r) => {
|
|
317
|
+
if (!at) return void r("Unable to open dialog with no dom.");
|
|
318
|
+
const n = document.createElement("input");
|
|
319
|
+
n.type = "file", n.accept = e;
|
|
320
|
+
let o = null, a = !1;
|
|
321
|
+
globalThis.addEventListener?.("focus", () => {
|
|
322
|
+
setTimeout(() => {
|
|
323
|
+
o || a || (a = !0, t(null));
|
|
324
|
+
}, 1e3);
|
|
325
|
+
}, { once: !0, passive: !0 }), n.onchange = () => {
|
|
326
|
+
if (o = n.files[0], o) {
|
|
327
|
+
if (a) return void console.warn("File open detected after faux cancel.", o);
|
|
328
|
+
t(o);
|
|
329
|
+
}
|
|
330
|
+
}, n.autofocus = !0, n.click();
|
|
331
|
+
}), rafThrottle: (e) => {
|
|
332
|
+
let t, r = !1, n = function() {
|
|
333
|
+
r = !1, e(t);
|
|
334
|
+
};
|
|
335
|
+
return function(o) {
|
|
336
|
+
t = o, t && t.persist && t.persist(), r || (r = !0, requestAnimationFrame(n));
|
|
337
|
+
};
|
|
338
|
+
}, removeEmptyProperties: Et, removeEqualValues: St, removeListenerAll: (e) => {
|
|
339
|
+
if (!e) return [];
|
|
340
|
+
for (let t = 0; t < e.length; t++) e[t] && e[t]();
|
|
341
|
+
return [];
|
|
342
|
+
}, requestTimeout: (e, t) => {
|
|
343
|
+
const r = rt(), n = { id: requestAnimationFrame(function o() {
|
|
344
|
+
rt() - r >= t ? e.call(null) : n.id = requestAnimationFrame(o);
|
|
345
|
+
}) };
|
|
346
|
+
return n;
|
|
347
|
+
}, roundAccurately: (e, t = 0) => {
|
|
348
|
+
if (e == null || !isFinite(e)) return null;
|
|
349
|
+
const r = 10 ** t;
|
|
350
|
+
return Number(Math.round(e * r) / r);
|
|
351
|
+
}, setToPath: (e, t, r) => {
|
|
352
|
+
const n = t.split(".");
|
|
353
|
+
let o = e;
|
|
354
|
+
if (!o) throw new Error("Can not set path to a null path.");
|
|
355
|
+
for (let a = 0; o && a < n.length - 1; a++) {
|
|
356
|
+
const i = n[a];
|
|
357
|
+
let l = o[i];
|
|
358
|
+
if (l == null && (l = {}, o[i] = l), !O(l)) throw new Error("Can not set path to a non object path.");
|
|
359
|
+
o = l;
|
|
360
|
+
}
|
|
361
|
+
if (typeof r != "number" && typeof r != "boolean" && typeof r != "string" && !O(r)) throw new Error(`Can not set path to ${r} that is not a a supported primitive.`);
|
|
362
|
+
return o[n[n.length - 1]] = r, e;
|
|
363
|
+
}, splitNumber: (e) => {
|
|
364
|
+
let t = Math.abs(e);
|
|
365
|
+
if (isNaN(t) || !isFinite(e)) return null;
|
|
366
|
+
let r = 0 | t, n = t - r, o = 0, a = 0, i = 1;
|
|
367
|
+
if (n > 5e-8) for (; a < 8 && Math.abs(o / i - n) > 5e-8; ) a++, i *= 10, o = Math.round(n * i);
|
|
368
|
+
return { ip: Math.trunc(e), fp: o, ipLength: Math.ceil(Math.log10(r + 1)), fpLength: a };
|
|
369
|
+
}, subtractRect: (e, t, r = !1) => {
|
|
370
|
+
if (!t) return [e];
|
|
371
|
+
if (!ot(e, t)) return [];
|
|
372
|
+
const n = [];
|
|
373
|
+
let o = e;
|
|
374
|
+
const a = () => {
|
|
375
|
+
t.top > o.top && t.top < o.bottom && (n.push({ ...o, bottom: t.top }), o = { ...o, top: t.top });
|
|
376
|
+
}, i = () => {
|
|
377
|
+
t.bottom > o.top && t.bottom < o.bottom && (n.push({ ...o, top: t.bottom }), o = { ...o, bottom: t.bottom });
|
|
378
|
+
}, l = () => {
|
|
379
|
+
t.right > o.left && t.right < o.right && (n.push({ ...o, left: t.right }), o = { ...o, right: t.right });
|
|
380
|
+
}, s = () => {
|
|
381
|
+
t.left > o.left && t.left < o.right && (n.push({ ...o, right: t.left }), o = { ...o, left: t.left });
|
|
382
|
+
};
|
|
383
|
+
return r ? (s(), l(), a(), i()) : (a(), i(), l(), s()), n;
|
|
384
|
+
}, textToKey: (e) => e.replace(/[^a-zA-Z0-9]/g, "").toLowerCase(), throttle: function(e, t) {
|
|
385
|
+
let r = null;
|
|
386
|
+
return (...n) => {
|
|
387
|
+
const o = Date.now();
|
|
388
|
+
(!r || o - r >= t) && (r = o, e(...n));
|
|
389
|
+
};
|
|
390
|
+
}, toSafeJSON: function e(t) {
|
|
391
|
+
if (t === null || typeof t != "object") return t;
|
|
392
|
+
if (typeof t.toJSON == "function") return t.toJSON();
|
|
393
|
+
if (Array.isArray(t)) return t.map((n) => e(n));
|
|
394
|
+
if (typeof t.toString == "function" && t.toString !== Object.prototype.toString) return t.toString();
|
|
395
|
+
const r = {};
|
|
396
|
+
for (const n in t) t.hasOwnProperty(n) && (r[n] = e(t[n]));
|
|
397
|
+
return r;
|
|
398
|
+
}, transpose: (e) => {
|
|
399
|
+
if (!e) return e;
|
|
400
|
+
const t = e.length, r = e[0].length, n = [];
|
|
401
|
+
for (let o = 0; o < r; o++) n[o] = Array(t);
|
|
402
|
+
for (let o = 0; o < t; o++) for (let a = 0; a < r; a++) n[a][o] = e[o][a];
|
|
403
|
+
return n;
|
|
404
|
+
}, uuidV4: R, validEnumValue: (e, t) => {
|
|
405
|
+
if (!Object.values(e).includes(t)) throw new Error(`Invalid type: ${t ?? "null"}. Must be one of: ${Object.values(t).join(", ")}.`);
|
|
406
|
+
}, whenFocus: async (e, t = !1) => new Promise((r) => {
|
|
407
|
+
it(e, t) ? r(!0) : e.addEventListener("focusin", () => {
|
|
408
|
+
r(!0);
|
|
409
|
+
}, { once: !0 }), e.focus();
|
|
410
|
+
}) }, Symbol.toStringTag, { value: "Module" }));
|
|
411
|
+
Object.freeze(Object.defineProperty({ __proto__: null, MESSAGE_ERROR_INVALID_ARG: (e) => `Invalid argument: '${e}'.` }, Symbol.toStringTag, { value: "Module" }));
|
|
412
|
+
const xt = (e) => {
|
|
413
|
+
const t = new Uint8Array(e), r = t.byteLength;
|
|
414
|
+
let n = "";
|
|
415
|
+
for (let o = 0; o < r; o++) n += String.fromCharCode(t[o]);
|
|
416
|
+
if (typeof window < "u" && typeof globalThis.btoa == "function") return globalThis.btoa(n);
|
|
417
|
+
if (typeof Buffer < "u") return Buffer.from(n, "binary").toString("base64");
|
|
418
|
+
throw new Error("Unsupported environment");
|
|
419
|
+
}, W = (e) => new Promise((t, r) => {
|
|
420
|
+
if (e) if (typeof FileReader < "u") {
|
|
421
|
+
const n = new FileReader();
|
|
422
|
+
n.onload = () => {
|
|
423
|
+
t(n.result);
|
|
424
|
+
}, n.onerror = () => {
|
|
425
|
+
r(n.error);
|
|
426
|
+
}, n.readAsText(e);
|
|
427
|
+
} else if (typeof Buffer < "u") {
|
|
428
|
+
const n = (o) => Buffer.from(o).toString("utf-8");
|
|
429
|
+
e.arrayBuffer().then((o) => {
|
|
430
|
+
t(n(o));
|
|
431
|
+
}).catch((o) => {
|
|
432
|
+
r(o);
|
|
433
|
+
});
|
|
434
|
+
} else r(new Error("Unsupported environment"));
|
|
435
|
+
else t("");
|
|
436
|
+
});
|
|
437
|
+
Object.freeze(Object.defineProperty({ __proto__: null, DEFAULT_MIME_TYPE: "*/*", arrayBufferToBase64: xt, base64ToArrayBuffer: (e) => {
|
|
438
|
+
const t = typeof window < "u" && typeof globalThis.atob == "function" ? globalThis.atob(e) : Buffer.from(e, "base64").toString("binary"), r = t.length, n = new Uint8Array(r);
|
|
439
|
+
for (let o = 0; o < r; o++) n[o] = t.charCodeAt(o);
|
|
440
|
+
return n.buffer;
|
|
441
|
+
}, blobToString: W }, Symbol.toStringTag, { value: "Module" }));
|
|
442
|
+
const _t = "data:image/png;base64,", Ot = "Unable to resolve image.", lt = (e) => new Promise(async (t, r) => {
|
|
443
|
+
let n = null;
|
|
444
|
+
try {
|
|
445
|
+
n = new Image(), n.src = e, n.addEventListener("load", function() {
|
|
446
|
+
t({ width: n.naturalWidth, height: n.naturalHeight });
|
|
447
|
+
}, { once: !0 }), n.addEventListener("error", function() {
|
|
448
|
+
URL.revokeObjectURL(e), r("Invalid Image");
|
|
449
|
+
}, { once: !0 }), await n.decode("sync");
|
|
450
|
+
} catch {
|
|
451
|
+
n?.src && URL.revokeObjectURL(n.src);
|
|
452
|
+
}
|
|
453
|
+
n || r(Ot);
|
|
454
|
+
}), P = "image/svg+xml";
|
|
455
|
+
var st, ct;
|
|
456
|
+
Object.freeze(Object.defineProperty({ __proto__: null, DATA_URL_PNG_PREFIX: _t, getImageDataUrl: (e, t = 1) => new Promise(async (r, n) => {
|
|
457
|
+
let o = null;
|
|
458
|
+
try {
|
|
459
|
+
o = new Image(), o.src = e, o.addEventListener("load", function() {
|
|
460
|
+
try {
|
|
461
|
+
const a = document.createElement("canvas");
|
|
462
|
+
a.width = o.naturalWidth, a.height = o.naturalHeight, a.getContext("2d").drawImage(o, 0, 0);
|
|
463
|
+
const i = a.toDataURL("image/png", t);
|
|
464
|
+
r({ elemImg: o, dataUrl: i });
|
|
465
|
+
} catch (a) {
|
|
466
|
+
URL.revokeObjectURL(e), n(a);
|
|
467
|
+
}
|
|
468
|
+
}, { once: !0 }), o.addEventListener("error", function() {
|
|
469
|
+
URL.revokeObjectURL(e), n("Invalid Image");
|
|
470
|
+
}, { once: !0 }), await o.decode("sync");
|
|
471
|
+
} catch {
|
|
472
|
+
o?.src && URL.revokeObjectURL(o.src);
|
|
473
|
+
}
|
|
474
|
+
o || n(Ot);
|
|
475
|
+
}), loadImageDetails: async (e, t = null) => {
|
|
476
|
+
let r = null;
|
|
477
|
+
const n = async () => {
|
|
478
|
+
try {
|
|
479
|
+
const a = t ?? "image/*", i = URL.createObjectURL(new Blob([e], { type: a })), l = await lt(i);
|
|
480
|
+
r = { mimeType: a, naturalDimensions: l, asUrl: i };
|
|
481
|
+
} catch {
|
|
482
|
+
}
|
|
483
|
+
}, o = async () => {
|
|
484
|
+
try {
|
|
485
|
+
const a = new TextDecoder().decode(e), i = URL.createObjectURL(new Blob([a], { type: P })), l = await lt(i);
|
|
486
|
+
r = { mimeType: t ?? P, naturalDimensions: l, asUrl: i, asSVGText: a };
|
|
487
|
+
} catch {
|
|
488
|
+
}
|
|
489
|
+
};
|
|
490
|
+
if (t === P ? await o() : t.startsWith("image/") ? await n() : (await n(), r || await o()), !r) throw new Error("Failed to load image");
|
|
491
|
+
return r;
|
|
492
|
+
} }, Symbol.toStringTag, { value: "Module" })), (ct = st || (st = {})).resolveTypedUpdates = (e, t, r, n) => {
|
|
493
|
+
if (e === null) return e;
|
|
494
|
+
if (e === void 0) return n;
|
|
495
|
+
let o = e;
|
|
496
|
+
if (t?.shorthand) {
|
|
497
|
+
const s = t?.shorthand(e, r);
|
|
498
|
+
s !== void 0 && (o = s);
|
|
499
|
+
}
|
|
500
|
+
if (o !== null && t?.getSubType) {
|
|
501
|
+
const s = t.getSubType(o);
|
|
502
|
+
s && (t = s);
|
|
503
|
+
}
|
|
504
|
+
const a = t?.properties, i = t?.arrayType ?? !1;
|
|
505
|
+
let l = o;
|
|
506
|
+
if (t && t.merge && l && n) l = t.merge(l, n, r);
|
|
507
|
+
else if (!i && a) {
|
|
508
|
+
const s = Object.keys({ ...o, ...n });
|
|
509
|
+
l = null;
|
|
510
|
+
for (let c = 0; c < s.length; c++) {
|
|
511
|
+
const d = s[c];
|
|
512
|
+
let w, u = o[d];
|
|
513
|
+
if (u !== void 0) {
|
|
514
|
+
const f = a[d];
|
|
515
|
+
w = f ? (0, ct.resolveTypedUpdates)(u, f, r, n?.[d]) : u;
|
|
516
|
+
} else w = n?.[d];
|
|
517
|
+
w != null && (l = l ?? {}, l[d] = w);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
return l;
|
|
521
|
+
};
|
|
522
|
+
const ut = `The Safari browser does not support advanced copy and paste.
|
|
523
|
+
Copy and paste will be limited to within the browser tab.
|
|
524
|
+
|
|
525
|
+
Please use Chrome or Edge if external copy and paste is required.`, k = `You do not have permissions to access the clipboard.
|
|
526
|
+
All copy and paste operations will be limited to the browser tab.`, It = { Safari: `The Safari browser does not support advanced copy and paste.
|
|
527
|
+
Copy and paste will be limited to within the browser tab.
|
|
528
|
+
|
|
529
|
+
Please use Chrome or Edge if external copy and paste is required.`, Perms: k, PermsWrite: T() === y.Safari ? ut : k, PermsRead: T() === y.Safari ? ut : k }, N = async () => new Promise((e) => {
|
|
530
|
+
document.hasFocus() ? e() : globalThis.addEventListener?.("focus", () => {
|
|
531
|
+
e();
|
|
532
|
+
}, { once: !0 }), document.activeElement.focus?.();
|
|
533
|
+
}), B = async (e, t, r) => {
|
|
534
|
+
if (T() === y.Safari) return await r(new Error(It.Safari));
|
|
535
|
+
try {
|
|
536
|
+
const n = async (i) => {
|
|
537
|
+
try {
|
|
538
|
+
return await i();
|
|
539
|
+
} catch (l) {
|
|
540
|
+
if (l.message?.includes("Document is not focused")) return !1;
|
|
541
|
+
throw l;
|
|
542
|
+
}
|
|
543
|
+
}, o = await globalThis?.navigator?.permissions?.query({ name: e, allowWithoutGesture: !0, allowWithoutSanitization: !0 });
|
|
544
|
+
let a = !1;
|
|
545
|
+
if (o.state === "prompt" && (a = await n(t)), a || o.state !== "granted" || (a = await t()), !a) return await r(new Error(o.state));
|
|
546
|
+
} catch (n) {
|
|
547
|
+
return n.message === "No valid data on clipboard" || n.name === "DataError" ? void 0 : await r(n);
|
|
548
|
+
}
|
|
549
|
+
}, jt = async (e) => {
|
|
550
|
+
try {
|
|
551
|
+
return await e.read({ unsanitized: [h] });
|
|
552
|
+
} catch {
|
|
553
|
+
}
|
|
554
|
+
return await e.read();
|
|
555
|
+
};
|
|
556
|
+
if (!globalThis.ClipboardItem) {
|
|
557
|
+
const e = (r, n) => new Blob([n], { type: r });
|
|
558
|
+
class t {
|
|
559
|
+
constructor(n, o) {
|
|
560
|
+
this._items = {}, this._types = Object.keys(n);
|
|
561
|
+
const a = {}, i = Object.keys(n);
|
|
562
|
+
for (let l = 0; l < i.length; l++) {
|
|
563
|
+
const s = i[l];
|
|
564
|
+
let c = n[s];
|
|
565
|
+
a[s] = typeof c == "string" ? e(s, c) : c;
|
|
566
|
+
}
|
|
567
|
+
this._items = a, this._presentationStyle = o?.presentationStyle ?? "unspecified";
|
|
568
|
+
}
|
|
569
|
+
get types() {
|
|
570
|
+
return this._types;
|
|
571
|
+
}
|
|
572
|
+
getType(n) {
|
|
573
|
+
return Promise.resolve(this._items[n]);
|
|
574
|
+
}
|
|
575
|
+
supports(n) {
|
|
576
|
+
return !0;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
globalThis.ClipboardItem = t;
|
|
580
|
+
}
|
|
581
|
+
const V = async (e, t = h) => new Promise(async (r, n) => {
|
|
582
|
+
try {
|
|
583
|
+
const o = await (async (a, i) => {
|
|
584
|
+
if (!a) return null;
|
|
585
|
+
const l = await jt(a);
|
|
586
|
+
let s = !1;
|
|
587
|
+
for (let c = 0; !s && l && c < l.length; c++) if (s = l[c].types.includes(i), s) return await l[c].getType(i);
|
|
588
|
+
return s ? void 0 : null;
|
|
589
|
+
})(e, t);
|
|
590
|
+
if (o) {
|
|
591
|
+
const a = new FileReader();
|
|
592
|
+
a.onload = () => {
|
|
593
|
+
r(a.result);
|
|
594
|
+
}, a.onerror = () => {
|
|
595
|
+
r("");
|
|
596
|
+
}, a.readAsText(o);
|
|
597
|
+
} else r("");
|
|
598
|
+
} catch (o) {
|
|
599
|
+
n(o);
|
|
600
|
+
}
|
|
601
|
+
}), dt = async (e, t = h) => {
|
|
602
|
+
const r = await V(e, t);
|
|
603
|
+
if (!r) return null;
|
|
604
|
+
let n = null;
|
|
605
|
+
try {
|
|
606
|
+
n = new DOMParser().parseFromString(r, h);
|
|
607
|
+
} catch {
|
|
608
|
+
console.warn("Can't parse html from clipboard.");
|
|
609
|
+
}
|
|
610
|
+
return n;
|
|
611
|
+
}, C = "clipboard-uuid", v = "web text/uuid", ft = (e) => `<div style="display:none" ${C}="${e}"/>`, Wt = (e, t) => {
|
|
612
|
+
let r = null;
|
|
613
|
+
try {
|
|
614
|
+
const n = new DOMParser().parseFromString(t, h);
|
|
615
|
+
n.body.firstElementChild.setAttribute(C, e), r = n.getElementsByTagName("body")[0].innerHTML;
|
|
616
|
+
} catch (n) {
|
|
617
|
+
console.warn("Can't embed uuid.", n);
|
|
618
|
+
}
|
|
619
|
+
return r;
|
|
620
|
+
}, pt = (e, t) => {
|
|
621
|
+
if (!t || !e) return !1;
|
|
622
|
+
try {
|
|
623
|
+
const r = t.querySelectorAll(`[${C}="${e}"]`);
|
|
624
|
+
if (r && r.length === 1) return !0;
|
|
625
|
+
if (t.querySelector("parsererror")) throw new Error("We are unable to parse node");
|
|
626
|
+
return !1;
|
|
627
|
+
} catch {
|
|
628
|
+
return !1;
|
|
629
|
+
}
|
|
630
|
+
};
|
|
631
|
+
class wt {
|
|
632
|
+
constructor(t) {
|
|
633
|
+
if (t?.nativeClipboard === void 0 || t?.nativeClipboard === !0) try {
|
|
634
|
+
this._nativeClipboard = globalThis?.navigator.clipboard;
|
|
635
|
+
} catch {
|
|
636
|
+
t?.nativeClipboard === !0 && console.warn("NativeClipboard option set to true but no native clipboard available.");
|
|
637
|
+
}
|
|
638
|
+
else this._nativeClipboard = t?.nativeClipboard === !1 ? null : t?.nativeClipboard;
|
|
639
|
+
this._disableCheckOnFocus = t?.disableCheckOnFocus ?? !1, this._init();
|
|
640
|
+
}
|
|
641
|
+
async _checkForChanges() {
|
|
642
|
+
this._nativeClipboard && this._state && !this._disableCheckOnFocus && await B("clipboard-read", async () => {
|
|
643
|
+
await N();
|
|
644
|
+
const t = await V(this._nativeClipboard, v);
|
|
645
|
+
if (!this._state || t && t === this._state.uuid) return !0;
|
|
646
|
+
const r = await dt(this._nativeClipboard, h);
|
|
647
|
+
return !this._state || (pt(this._state.uuid, r) || this.clear(), !0);
|
|
648
|
+
}, async (t) => {
|
|
649
|
+
t?.message === "denied" || t.message?.includes("Document is not focused") || T() === y.Safari || console.warn("Unable to detect clipboard changes: ", t);
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
_init() {
|
|
653
|
+
const t = this;
|
|
654
|
+
this._listeners = /* @__PURE__ */ new Map(), this._listenersCapture = /* @__PURE__ */ new Map(), this._state = null, this._nativeClipboard && (this._onFocus = () => {
|
|
655
|
+
t._checkForChanges();
|
|
656
|
+
}, this._onBlur = () => {
|
|
657
|
+
globalThis.addEventListener?.("focus", t._onFocus, { once: !0 });
|
|
658
|
+
}, globalThis.addEventListener?.("blur", this._onBlur), this._nativeClipboard.addEventListener("clipboardchange", (r) => {
|
|
659
|
+
t._checkForChanges();
|
|
660
|
+
}));
|
|
661
|
+
}
|
|
662
|
+
async read() {
|
|
663
|
+
if (!this._nativeClipboard) return this._state?.items ?? null;
|
|
664
|
+
const t = this;
|
|
665
|
+
return await B("clipboard-read", async () => {
|
|
666
|
+
if (await N(), this._state?.uuid) {
|
|
667
|
+
const r = await V(this._nativeClipboard, v);
|
|
668
|
+
if (r && r === t._state.uuid) return !0;
|
|
669
|
+
const n = await dt(this._nativeClipboard, h);
|
|
670
|
+
if (pt(t._state?.uuid, n)) return !0;
|
|
671
|
+
}
|
|
672
|
+
return t._state = { items: await jt(this._nativeClipboard), uuid: null, ref: null }, this.dispatchEvent(new Event("clipboardread")), !0;
|
|
673
|
+
}, async (r) => {
|
|
674
|
+
this.dispatchEvent(new Event("clipboarderrorread"));
|
|
675
|
+
}), this._state?.items ?? [];
|
|
676
|
+
}
|
|
677
|
+
async write(t) {
|
|
678
|
+
return this._write({ uuid: R(), items: t, ref: null });
|
|
679
|
+
}
|
|
680
|
+
async _write(t) {
|
|
681
|
+
if (!this._nativeClipboard) return this._state = t, this.dispatchEvent(new Event("clipboardwrite")), this.dispatchEvent(new Event("clipboardchange")), null;
|
|
682
|
+
const r = this, n = [], o = t.uuid;
|
|
683
|
+
let a = t.items ?? [];
|
|
684
|
+
const i = () => {
|
|
685
|
+
r._state = { uuid: o, ref: t.ref, items: n }, r.dispatchEvent(new Event("clipboardwrite")), r.dispatchEvent(new Event("clipboardchange"));
|
|
686
|
+
};
|
|
687
|
+
await B("clipboard-write", async () => {
|
|
688
|
+
await N(), o && a.length === 0 && (a.push(new ClipboardItem({ [v]: new Blob([o], { type: v }) })), a.push(new ClipboardItem({ [h]: new Blob([ft(o)], { type: h }) })));
|
|
689
|
+
for (let l = 0; l < Math.min(1, a.length); l++) {
|
|
690
|
+
const s = a[l];
|
|
691
|
+
let c = s.types.indexOf(h), d = null;
|
|
692
|
+
if (c !== -1) {
|
|
693
|
+
const f = await s.getType(h);
|
|
694
|
+
d = await W(f), d && (d = Wt(o, d));
|
|
695
|
+
}
|
|
696
|
+
if (!d && s.types.includes(b)) {
|
|
697
|
+
const f = await s.getType(b);
|
|
698
|
+
if (f) {
|
|
699
|
+
let p = null;
|
|
700
|
+
typeof f == "string" ? (console.warn("text as string", f), p = f) : p = await W(f), p && (d = `<div ${C}="${o}">${p}</div>`);
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
if (!d && s.types.includes(L)) {
|
|
704
|
+
const f = await s.getType(L), p = xt(await f.arrayBuffer());
|
|
705
|
+
d = `<div ${C}="${o}"><img src="${_t + p}"/></div>`;
|
|
706
|
+
}
|
|
707
|
+
!d && o && (d = ft(o));
|
|
708
|
+
const w = new Blob([d ?? ""], { type: h }), u = {};
|
|
709
|
+
for (let f = 0; f < s.types.length; f++) {
|
|
710
|
+
const p = s.types[f];
|
|
711
|
+
u[p] = f === c ? w : s.getType(p);
|
|
712
|
+
}
|
|
713
|
+
d && c === -1 && (u[h] = w), o && (u[v] = new Blob([o], { type: v })), n.push(new ClipboardItem(u));
|
|
714
|
+
}
|
|
715
|
+
try {
|
|
716
|
+
n && n.length !== 0 ? await this._nativeClipboard.write(n) : await (async (l) => {
|
|
717
|
+
l && await l.writeText("");
|
|
718
|
+
})(this._nativeClipboard);
|
|
719
|
+
} catch (l) {
|
|
720
|
+
l.message?.includes("Document is not focused") || console.warn("Unable to write to native clipboard: ", l);
|
|
721
|
+
}
|
|
722
|
+
return i(), !0;
|
|
723
|
+
}, async (l) => {
|
|
724
|
+
this.dispatchEvent(new Event("clipboarderrorwrite")), i();
|
|
725
|
+
});
|
|
726
|
+
}
|
|
727
|
+
async writeReference(t) {
|
|
728
|
+
if (!t) return void this.clear();
|
|
729
|
+
let r = null;
|
|
730
|
+
const n = {};
|
|
731
|
+
try {
|
|
732
|
+
const a = await t.toText?.() ?? null;
|
|
733
|
+
a && (n[b] = new Blob([a ?? ""], { type: b }));
|
|
734
|
+
} catch (a) {
|
|
735
|
+
r = a;
|
|
736
|
+
}
|
|
737
|
+
try {
|
|
738
|
+
const a = await t.toHtml?.() ?? null;
|
|
739
|
+
a && (n[h] = new Blob([a], { type: h }));
|
|
740
|
+
} catch (a) {
|
|
741
|
+
r = a, console.warn("export to html", a);
|
|
742
|
+
}
|
|
743
|
+
try {
|
|
744
|
+
const a = await t.toImage?.() ?? null;
|
|
745
|
+
a && (n[L] = a);
|
|
746
|
+
} catch (a) {
|
|
747
|
+
r = a, console.warn("export to png", a);
|
|
748
|
+
}
|
|
749
|
+
const o = this._write({ uuid: R(), ref: t, items: Object.keys(n).length > 0 ? [new ClipboardItem(n)] : null });
|
|
750
|
+
if (r) throw r;
|
|
751
|
+
return o;
|
|
752
|
+
}
|
|
753
|
+
clear(t = !1) {
|
|
754
|
+
this._state && (this._state = null, t && this._write({ uuid: null, ref: null, items: null }), this.dispatchEvent(new Event("clipboardwrite")), this.dispatchEvent(new Event("clipboardchange")));
|
|
755
|
+
}
|
|
756
|
+
async readReference() {
|
|
757
|
+
return await this.read(), this._state?.ref ?? null;
|
|
758
|
+
}
|
|
759
|
+
readText() {
|
|
760
|
+
return new Promise(async (t, r) => {
|
|
761
|
+
const n = await this.read();
|
|
762
|
+
let o = null;
|
|
763
|
+
for (let i = 0; !o && n && i < n.length; i++) n[i].types.includes(b) && (o = await n[i].getType(b));
|
|
764
|
+
if (!o) return void t("");
|
|
765
|
+
const a = new FileReader();
|
|
766
|
+
a.onload = () => {
|
|
767
|
+
t(a.result);
|
|
768
|
+
}, a.readAsText(o), a.onerror = (i) => {
|
|
769
|
+
r(i);
|
|
770
|
+
};
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
async writeText(t) {
|
|
774
|
+
const r = [new ClipboardItem({ [b]: new Blob([t], { type: b }) })];
|
|
775
|
+
return this._write({ uuid: R(), items: r, ref: null });
|
|
776
|
+
}
|
|
777
|
+
addEventListener(t, r, n = {}) {
|
|
778
|
+
const o = n?.capture ? this._listenersCapture : this._listeners;
|
|
779
|
+
let a = o.get(t);
|
|
780
|
+
a || (a = /* @__PURE__ */ new Map(), o.set(t, a)), a.set(r, typeof n == "boolean" ? {} : n);
|
|
781
|
+
}
|
|
782
|
+
dispatchEvent(t) {
|
|
783
|
+
if (!t) return;
|
|
784
|
+
const r = (n) => {
|
|
785
|
+
const o = n.get(t.type);
|
|
786
|
+
o && o.forEach((a, i) => {
|
|
787
|
+
try {
|
|
788
|
+
typeof i == "function" ? i(t) : i.handleEvent && i.handleEvent(t), a.once && o.delete(i);
|
|
789
|
+
} catch (l) {
|
|
790
|
+
console.warn(l);
|
|
791
|
+
}
|
|
792
|
+
});
|
|
793
|
+
};
|
|
794
|
+
return r(this._listenersCapture), r(this._listeners), !0;
|
|
795
|
+
}
|
|
796
|
+
removeEventListener(t, r, n) {
|
|
797
|
+
const o = n?.capture ? this._listenersCapture : this._listeners, a = o.get(t);
|
|
798
|
+
a && (a.delete(r), a.size === 0 && o.delete(t));
|
|
799
|
+
}
|
|
800
|
+
close() {
|
|
801
|
+
globalThis.removeEventListener?.("focus", this._onFocus), globalThis.removeEventListener?.("blur", this._onBlur);
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
var z;
|
|
805
|
+
(z = wt || (wt = {})).ErrorMessages = It, z.Global = new z();
|
|
806
|
+
let ht = null, q = null, M = null;
|
|
807
|
+
const Vt = Object.freeze({ compileTypescript: async function(e) {
|
|
808
|
+
if (!e?.source) return null;
|
|
809
|
+
if (q && $t.deepEqual(q, e)) return ht;
|
|
810
|
+
const t = await async function() {
|
|
811
|
+
if (M) return M;
|
|
812
|
+
const { TypeScriptCompiler: n } = await import("./DML06qJVWAeMmTeF.mjs");
|
|
813
|
+
return M = new n(), M;
|
|
814
|
+
}(), r = await t.compileModule(e);
|
|
815
|
+
return ht = r, q = e, r;
|
|
816
|
+
} }), Gt = Object.freeze(Object.defineProperty({ __proto__: null, ScriptingUtils: Vt }, Symbol.toStringTag, { value: "Module" }));
|
|
817
|
+
export {
|
|
818
|
+
$t as $,
|
|
819
|
+
Gt as i
|
|
820
|
+
};
|