@sheetxl/sdk 0.4.19 → 0.4.21

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.
Files changed (105) hide show
  1. package/browser/cjs/{CBHpVFiJCCNa32Qd.cjs → 2Ek3ERw3_Bykd8fw.cjs} +2 -2
  2. package/browser/cjs/{D6QgMx0WUlWgYoae.cjs → 6TI34Ha4FA7iPlUF.cjs} +1 -1
  3. package/browser/cjs/{DaYyPfJx_pc2iDDm.cjs → BCHaDG_rDvnn8ZBd.cjs} +1 -1
  4. package/browser/cjs/{BWO4PWgRzvVsWDJA.cjs → Bahkk8039gRyN9Mo.cjs} +1 -1
  5. package/browser/cjs/{CAyn-VHwt044Jaid.cjs → BngbTy19wpFaenhY.cjs} +1 -1
  6. package/browser/cjs/{BnloHxo3XPFlt9gf.cjs → Bp7N_nyopyZKjRRL.cjs} +1 -1
  7. package/browser/cjs/{BmLK2Q7ZKH-MpZf2.cjs → BtV6fyILcBfpVmM0.cjs} +1 -1
  8. package/browser/cjs/{BPzvAcSjBOPCLRae.cjs → Bv8Q9Woak_tt-5Pm.cjs} +1 -1
  9. package/browser/cjs/{hW1yREos32gpIHsR.cjs → CBMFkyyTw0XlFLRH.cjs} +1 -1
  10. package/browser/cjs/{DoPx_0PJzz8WOjE-.cjs → CEebzMIuXLwwzsFT.cjs} +1 -1
  11. package/browser/cjs/{hReZyLibRX_QhdqA.cjs → CM1U1IRvnVgZaUwu.cjs} +1 -1
  12. package/browser/cjs/{V_uwtlknwPnP2Un_.cjs → CvJBfy0UeKfDQ8dm.cjs} +1 -1
  13. package/browser/cjs/CvXi1eD_vGRkx_Qg.cjs +124 -0
  14. package/browser/cjs/Cw2bnqP6ZrrZ2Bbq.cjs +7 -0
  15. package/browser/cjs/{C9nSUDDtDNZklTgo.cjs → D-JnQCqB1E48ybn1.cjs} +1 -1
  16. package/browser/cjs/{DoXjUhbXYEMYEj6w.cjs → D30MUnA7XeRC7nKA.cjs} +1 -1
  17. package/browser/cjs/{eL4wAPO18NOtxRmW.cjs → D6U-YLLOpX5BzDpj.cjs} +1 -1
  18. package/browser/cjs/{-XdpUGDwGmHHx1Rt.cjs → DBYUO1gBwFZ9YzXu.cjs} +1 -1
  19. package/browser/cjs/DBgdjlLJAvbKQ6m1.cjs +53 -0
  20. package/browser/cjs/{D8kiw7ChCC7ethCe.cjs → DMM_7MUTtUyTxUte.cjs} +1 -1
  21. package/browser/cjs/{CrfDFjK9RNj481-9.cjs → DP5RAH-JZmys2_Ez.cjs} +1 -1
  22. package/browser/cjs/{C0dfikqxNZtNj-22.cjs → DV6ZkCTUWQA6p4rK.cjs} +1 -1
  23. package/browser/cjs/{Doku1UVzxfUkKjsU.cjs → DnCv1ao4SJJC07Rk.cjs} +1 -1
  24. package/browser/cjs/{Bg5cGAcyMKhc1LVR.cjs → Du14zhQYf2mcjgP8.cjs} +1 -1
  25. package/browser/cjs/index.cjs +2 -2
  26. package/browser/cjs/{qjfxOoVcFF4_7fg8.cjs → j7VVtACDr_Df6VoV.cjs} +1 -1
  27. package/browser/cjs/{B9v3u3hwmPue1Crf.cjs → mCTmXzm3-Nr4hMMh.cjs} +1 -1
  28. package/browser/cjs/{DPc0gEusAoUYAI0O.cjs → z7NeiDHMwAIvmXQM.cjs} +1 -1
  29. package/browser/esm/{5v6eKDgISAObg5Sk.mjs → 8ZQRIB2EsDWE9tsR.mjs} +7787 -9081
  30. package/browser/esm/{DnRa0ZQVLa2Fqzju.mjs → AZWItMZ40w7pXzM3.mjs} +6 -4
  31. package/{node/esm/DIiCZ8EuWYWD1G4X.mjs → browser/esm/B1NCmSNzMv8wue5X.mjs} +1 -1
  32. package/browser/esm/{DW6X_ih_Ttv8w6c2.mjs → B4TD60vusDQB28Y6.mjs} +1 -1
  33. package/browser/esm/{D36yXHRPCJFPE2Cn.mjs → BGt455yLuaSCtS3B.mjs} +1 -1
  34. package/{node/esm/BefBv4Sji_c90mMN.mjs → browser/esm/BH6V9bxFT7tKt3JY.mjs} +1 -1
  35. package/browser/esm/{BYu-X1qYzm9tZ3jy.mjs → C08q_YT1-6oRRKn7.mjs} +1 -1
  36. package/browser/esm/{CyZcmz9fV3_Zu57s.mjs → C3lBcMoGYfLhgMfA.mjs} +1 -1
  37. package/browser/esm/{C0HNcnUg1sYe6vKJ.mjs → C3ppHQZRcF8ZsuOM.mjs} +1 -1
  38. package/browser/esm/{B6zlCMitM169AEV5.mjs → C3xhjguoFh_LLdE0.mjs} +1 -1
  39. package/browser/esm/{CxdfUZ_whNEdCrBM.mjs → C86MlawsKJdD9LF8.mjs} +1 -1
  40. package/browser/esm/{C_hMM356eOyIGEgy.mjs → CWaBHMvzzTzqW2aW.mjs} +1 -1
  41. package/browser/esm/{CZ6VZ3NtZyMBJLvF.mjs → C_UDq7u8kN8EM5VM.mjs} +1 -1
  42. package/browser/esm/{aR99Cx5S9piceH0j.mjs → CiHNaJRMjs_J-E64.mjs} +1 -1
  43. package/{node/esm/JP2SydGPgN2PrEam.mjs → browser/esm/DP2FYMLsdP_WcDYS.mjs} +1 -1
  44. package/{node/esm/DLn3G10hRwsZCSWB.mjs → browser/esm/DQpvGf222ccOGfjU.mjs} +1 -1
  45. package/browser/esm/{D9GMsV9S5kpEpaQ3.mjs → DU9crFdCyt80pRza.mjs} +2 -2
  46. package/{node/esm/Cy781c813953r7bq.mjs → browser/esm/Dbm37kRSyl_8FJoJ.mjs} +1 -1
  47. package/{node/esm/BgePMvIc6yA6_ebp.mjs → browser/esm/DkpEl_DXRacSkWrt.mjs} +1 -1
  48. package/browser/esm/{CV8kpqwdAKIIEJia.mjs → DmY32GhkYpEm8mSs.mjs} +1 -1
  49. package/browser/esm/{XrA8fo2R4AS3HzFz.mjs → XiCMvT7sjmvl0gUN.mjs} +1 -1
  50. package/browser/esm/{N5WXqNpZDnhetIYG.mjs → YC7mlG3gvQikwmLc.mjs} +1 -1
  51. package/{node/esm/BrAfC_Hz1HZiZjNh.mjs → browser/esm/bhTV2Kuwe5GAobt1.mjs} +1 -1
  52. package/{node/esm/CrBwUqwLJqFG3U4m.mjs → browser/esm/graF5_D09QCDSoHN.mjs} +1 -1
  53. package/browser/esm/index.mjs +54 -82
  54. package/browser/esm/{1v0wWt1fqPRDORx-.mjs → tkRDOxVCj9OmVmBR.mjs} +1 -1
  55. package/browser/esm/{OBWvICzxYhna2IxF.mjs → zGGld_iCASteK8iy.mjs} +1 -1
  56. package/browser/esm/{Dnypbs7l46y-W1pE.mjs → zJQ-f_DFW5-NL9Jy.mjs} +46 -44
  57. package/licenses/dependencies.txt +0 -66
  58. package/node/esm/{BNu3V1ap_WR3jqdX.mjs → 4kTocRYniLajS_hb.mjs} +1 -1
  59. package/{browser/esm/DIiCZ8EuWYWD1G4X.mjs → node/esm/B1NCmSNzMv8wue5X.mjs} +1 -1
  60. package/node/esm/{D36yXHRPCJFPE2Cn.mjs → BGt455yLuaSCtS3B.mjs} +1 -1
  61. package/{browser/esm/BefBv4Sji_c90mMN.mjs → node/esm/BH6V9bxFT7tKt3JY.mjs} +1 -1
  62. package/node/esm/{BhJMGJ-z8AHuc4PL.mjs → BTi4XED3s0teHiBt.mjs} +1 -1
  63. package/node/esm/{CteSWuaSiS_quyBE.mjs → BXBNHBvt9nYiWgUU.mjs} +1 -1
  64. package/node/esm/{CjPySw20pNmqGeem.mjs → BmmN529Wnsai7InC.mjs} +1 -1
  65. package/node/esm/{kQVOc3F7_ib5L98K.mjs → Bmv6hV4ffBD80ICq.mjs} +253 -251
  66. package/node/esm/{CyZcmz9fV3_Zu57s.mjs → C3lBcMoGYfLhgMfA.mjs} +1 -1
  67. package/node/esm/{C0HNcnUg1sYe6vKJ.mjs → C3ppHQZRcF8ZsuOM.mjs} +1 -1
  68. package/node/esm/{B6zlCMitM169AEV5.mjs → C3xhjguoFh_LLdE0.mjs} +1 -1
  69. package/node/esm/{CxdfUZ_whNEdCrBM.mjs → C86MlawsKJdD9LF8.mjs} +1 -1
  70. package/node/esm/{BvdYpC2TrqFNZ1dz.mjs → CrCDm1JQ6LgVBdtF.mjs} +1 -1
  71. package/{browser/esm/JP2SydGPgN2PrEam.mjs → node/esm/DP2FYMLsdP_WcDYS.mjs} +1 -1
  72. package/{browser/esm/DLn3G10hRwsZCSWB.mjs → node/esm/DQpvGf222ccOGfjU.mjs} +1 -1
  73. package/{browser/esm/Cy781c813953r7bq.mjs → node/esm/Dbm37kRSyl_8FJoJ.mjs} +1 -1
  74. package/{browser/esm/BgePMvIc6yA6_ebp.mjs → node/esm/DkpEl_DXRacSkWrt.mjs} +1 -1
  75. package/node/esm/{CV8kpqwdAKIIEJia.mjs → DmY32GhkYpEm8mSs.mjs} +1 -1
  76. package/node/esm/{DbXESzawTrm7E2Do.mjs → DrT-57di5SkkFmk2.mjs} +1 -1
  77. package/node/esm/{BSbOEM-6aEtAEUn2.mjs → DyijBggm1X4Ksin0.mjs} +362 -360
  78. package/node/esm/{CHeQiTLK58a6NVsG.mjs → PynWQEh5r-eYdDWa.mjs} +1 -1
  79. package/node/esm/{N5WXqNpZDnhetIYG.mjs → YC7mlG3gvQikwmLc.mjs} +1 -1
  80. package/{browser/esm/BrAfC_Hz1HZiZjNh.mjs → node/esm/bhTV2Kuwe5GAobt1.mjs} +1 -1
  81. package/{browser/esm/CrBwUqwLJqFG3U4m.mjs → node/esm/graF5_D09QCDSoHN.mjs} +1 -1
  82. package/node/esm/index.mjs +12263 -13563
  83. package/node/esm/{OBWvICzxYhna2IxF.mjs → zGGld_iCASteK8iy.mjs} +1 -1
  84. package/package.json +5 -5
  85. package/browser/cjs/BSWe1zW77SdisEXi.cjs +0 -1501
  86. package/browser/cjs/C501EF7RGelm6o3R.cjs +0 -7
  87. package/browser/cjs/CJx8P3pZaRnS6Kny.cjs +0 -13
  88. package/browser/cjs/CxV1-OXj1ZO7MZQF.cjs +0 -60
  89. package/browser/cjs/DWPbAMkxOt6Cb9cp.cjs +0 -6
  90. package/browser/cjs/DWRcbn9JzkP-rey4.cjs +0 -32
  91. package/browser/cjs/DaEr2QpQ5d613oTn.cjs +0 -6
  92. package/browser/cjs/mN18HSNpekubzWOx.cjs +0 -6
  93. package/browser/cjs/oROZhcugo511lwYD.cjs +0 -124
  94. package/browser/esm/BaqE8hRXzTNVxA7s.mjs +0 -820
  95. package/browser/esm/Bf7DBXkGk1UG9hJQ.mjs +0 -21
  96. package/browser/esm/Br2kerMrZq0pplwK.mjs +0 -24
  97. package/browser/esm/BwotCxIgIVf7Syhx.mjs +0 -1575
  98. package/browser/esm/C94a-TJowUoPL9Fp.mjs +0 -29
  99. package/browser/esm/dRf_0yDP86DLaRrp.mjs +0 -472
  100. package/node/esm/07j0n4N6h6oBOk_2.mjs +0 -29
  101. package/node/esm/BSLIxDVCng1Ep_kU.mjs +0 -14
  102. package/node/esm/Bx9qRsBq80w6DZmQ.mjs +0 -454
  103. package/node/esm/BxOnww5rEBN0LYwd.mjs +0 -80
  104. package/node/esm/DK54CIvklXVGAymn.mjs +0 -813
  105. package/node/esm/DjenIXryJ8ccxNad.mjs +0 -16
@@ -1,813 +0,0 @@
1
- /**
2
- * @license @sheetxl/sdk - SDK - A high-performance, embeddable spreadsheet engine. - v0.4.19
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 t = "text/html", e = "text/plain", r = "image/png", n = Object.freeze({ left: 0, top: 0 }), o = Object.freeze({ left: 0, top: 0, bottom: 0, right: 0 }), a = Object.freeze({ x: 0, y: 0, width: 0, height: 0 });
8
- Object.freeze(Object.defineProperty({ __proto__: null, EmptyBounds: a, EmptyRect: o, EmptyTopLeft: n }, Symbol.toStringTag, { value: "Module" }));
9
- const i = "column", l = "row", s = Object.freeze({ colIndex: 0, rowIndex: 0 }), c = Object.freeze({ colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 }), u = (t5, e2) => t5.colStart === e2.colStart ? t5.rowStart - e2.rowStart : t5.colStart - e2.colStart, d = (t5, e2) => t5.rowStart === e2.rowStart ? t5.colStart - e2.colStart : t5.rowStart - e2.rowStart, f = (t5, e2) => t5.rowEnd === e2.rowEnd ? e2.colEnd - t5.colEnd : e2.rowEnd - t5.rowEnd, p = (t5, e2) => t5.colEnd === e2.colEnd ? e2.rowEnd - t5.rowEnd : e2.colEnd - t5.colEnd, w = (t5, e2) => t5.colIndex === e2.colIndex ? t5.rowIndex - e2.rowIndex : t5.colIndex - e2.colIndex, h = (t5, e2) => t5.rowIndex === e2.rowIndex ? t5.colIndex - e2.colIndex : t5.rowIndex - e2.rowIndex, y = (t5 = l, e2 = false) => e2 ? t5 !== i ? f : p : t5 !== i ? d : u, g = (t5, e2) => t5 === e2 || !(!t5 || !e2) && t5.rowIndex === e2.rowIndex && t5.colIndex === e2.colIndex, b = (t5, e2) => t5 === e2 || !(!t5 || !e2) && t5.rowStart === e2.rowStart && t5.rowEnd === e2.rowEnd && t5.colStart === e2.colStart && t5.colEnd === e2.colEnd, m = (t5, e2) => !(!t5 || !e2 || t5.colStart > e2.colEnd || e2.colStart > t5.colEnd || t5.rowStart > e2.rowEnd || e2.rowStart > t5.rowEnd), E = (t5, e2) => {
10
- if (t5 === e2) return true;
11
- if (!t5 || !e2 || t5.length !== e2.length) return false;
12
- for (let r2 = 0; r2 < t5.length; r2++) if (!b(t5[r2], e2[r2])) return false;
13
- return true;
14
- }, S = (t5, e2, r2) => {
15
- if (!t5 && !e2) return null;
16
- if (!t5) return r2 ? e2 : { ...e2 };
17
- if (!e2) return r2 ? t5 : { ...t5 };
18
- const n2 = Math.min(t5.colStart, e2.colStart), o2 = Math.min(t5.rowStart, e2.rowStart), a2 = Math.max(t5.colEnd, e2.colEnd), i2 = Math.max(t5.rowEnd, e2.rowEnd);
19
- let l2 = r2;
20
- return l2 ? (l2.colStart = n2, l2.rowStart = o2, l2.colEnd = a2, l2.rowEnd = i2) : l2 = { colStart: n2, rowStart: o2, colEnd: a2, rowEnd: i2 }, l2;
21
- }, v = (t5, e2) => {
22
- if (!e2 || 0 === e2.length) return t5;
23
- const r2 = { ...t5 };
24
- for (let t6 = 0; t6 < e2.length; t6++) {
25
- const n2 = e2[t6];
26
- m(r2, n2) && (r2.rowStart = Math.min(r2.rowStart, n2.rowStart), r2.colStart = Math.min(r2.colStart, n2.colStart), r2.rowEnd = Math.max(r2.rowEnd, n2.rowEnd), r2.colEnd = Math.max(r2.colEnd, n2.colEnd));
27
- }
28
- return r2;
29
- }, x = [null, null], O = (t5, e2, r2) => {
30
- if (t5[0].value === t5[1].value) return e2;
31
- };
32
- function _(t5, e2 = 2, r2, n2 = l, o2) {
33
- let a2 = [...t5];
34
- if (e2 <= 0 || t5.length <= 1) return a2;
35
- let s2 = n2 === i, c2 = 0, u2 = false;
36
- do {
37
- const t6 = a2.sort(y(s2 ? l : i));
38
- a2 = [], a2.push(t6[0]);
39
- const e3 = t6.length;
40
- let d2 = 0, f2 = t6[0], p2 = f2.colStart, w2 = f2.rowStart, h2 = f2.colEnd, g2 = f2.rowEnd;
41
- for (let i2 = 1; i2 < e3; i2++) {
42
- const e4 = t6[i2];
43
- let l2 = false;
44
- if (l2 = s2 ? f2 && w2 === e4.rowStart && g2 === e4.rowEnd && h2 + 1 === e4.colStart : f2 && p2 === e4.colStart && h2 === e4.colEnd && g2 + 1 === e4.rowStart, l2) {
45
- let t7 = { colStart: p2, rowStart: w2, colEnd: s2 ? e4.colEnd : h2, rowEnd: s2 ? g2 : e4.rowEnd };
46
- if (void 0 !== f2.value && (t7.value = f2.value), r2) {
47
- const a3 = o2 ?? [null, null];
48
- a3[0] = f2, a3[1] = e4, t7 = r2(a3, t7, n2);
49
- }
50
- if (t7) {
51
- a2[d2] = t7, u2 = true, f2 = t7, p2 = f2.colStart, w2 = f2.rowStart, h2 = f2.colEnd, g2 = f2.rowEnd;
52
- continue;
53
- }
54
- }
55
- a2[++d2] = e4, f2 = e4, p2 = f2.colStart, w2 = f2.rowStart, h2 = f2.colEnd, g2 = f2.rowEnd;
56
- }
57
- c2++, s2 = !s2, 1 === c2 && (u2 = true);
58
- } while (c2 < e2 && u2 && a2.length > 1);
59
- return a2;
60
- }
61
- Object.freeze(Object.defineProperty({ __proto__: null, EmptyCell: s, EmptyRange: c, cellToRange: (t5, e2) => {
62
- if (!t5) return null;
63
- let r2 = e2;
64
- return r2 || (r2 = { ...t5 }, delete r2.colIndex, delete r2.rowIndex), r2.colStart = t5.colIndex ?? 0, r2.rowStart = t5.rowIndex ?? 0, r2.colEnd = t5.colIndex ?? 0, r2.rowEnd = t5.rowIndex ?? 0, r2;
65
- }, columnFirstCellComparator: w, columnFirstRangeComparator: u, createCellComparator: (t5 = l, e2 = false) => e2 ? t5 !== i ? (t6, e3) => t6.rowIndex === e3.rowIndex ? e3.colIndex - t6.colIndex : e3.rowIndex - t6.rowIndex : (t6, e3) => t6.colIndex === e3.colIndex ? e3.rowIndex - t6.rowIndex : e3.colIndex - t6.colIndex : t5 !== i ? h : w, createConflatingRanges: (t5, e2 = false) => {
66
- const r2 = [];
67
- let n2, o2, a2 = Number.MIN_SAFE_INTEGER, s2 = Number.MIN_SAFE_INTEGER;
68
- return { append: (i2, l2, c2) => {
69
- let u2 = true;
70
- const d2 = void 0 !== c2;
71
- if (d2) {
72
- const r3 = t5 ? t5(o2, c2, e2) : o2 === c2 ? c2 : void 0;
73
- void 0 === r3 ? u2 = false : c2 = r3;
74
- }
75
- if (u2 && l2 === s2 + 1 && i2 === a2) return e2 ? n2.rowEnd = l2 : n2.colEnd = l2, s2 = l2, void (o2 = c2);
76
- n2 && r2.push(n2);
77
- const f2 = e2 ? i2 : l2, p2 = e2 ? l2 : i2;
78
- n2 = { colStart: f2, rowStart: p2, colEnd: f2, rowEnd: p2 }, d2 && (n2.value = c2), a2 = i2, s2 = l2, o2 = c2;
79
- }, done: (t6) => (n2 && (r2.push(n2), n2 = null), t6 ? _(r2, 3, true === t6 ? O : t6, e2 ? i : l, x) : r2) };
80
- }, createRangeComparator: y, defaultRange: (t5, e2, r2) => t5 ? r2 ? (r2.colStart = t5.colStart ?? e2.colStart, r2.rowStart = t5.rowStart ?? e2.rowStart, r2.colEnd = t5.colEnd ?? e2.colEnd, r2.rowEnd = t5.rowEnd ?? e2.rowEnd, r2) : { colStart: t5.colStart ?? e2.colStart, rowStart: t5.rowStart ?? e2.rowStart, colEnd: t5.colEnd ?? e2.colEnd, rowEnd: t5.rowEnd ?? e2.rowEnd } : e2, extendRangeToIntersectingRanges: v, extendRangeToUnionRanges: (t5, e2) => {
81
- if (!e2 || 0 === e2.length) return t5;
82
- let r2 = t5, n2 = null;
83
- for (; !b(r2, n2); ) n2 = r2, r2 = v(n2, e2);
84
- return r2;
85
- }, indexOfCoords: (t5, e2) => {
86
- const r2 = { colStart: t5.colIndex, rowStart: t5.rowIndex, colEnd: t5.colIndex, rowEnd: t5.rowIndex };
87
- for (let t6 = e2.length - 1; t6 >= 0; t6--) if (m(r2, e2[t6])) return t6;
88
- return -1;
89
- }, intersectRanges: (t5, e2, r2) => {
90
- if (!t5) return r2 ? e2 : { ...e2 };
91
- if (!e2) return r2 ? t5 : { ...t5 };
92
- if (!t5 && !e2 || t5.rowStart > e2.rowEnd || t5.rowEnd < e2.rowStart || t5.colStart > e2.colEnd || t5.colEnd < e2.colStart) return null;
93
- const n2 = Math.max(t5.colStart, e2.colStart), o2 = Math.max(t5.rowStart, e2.rowStart), a2 = Math.min(t5.colEnd, e2.colEnd), i2 = Math.min(t5.rowEnd, e2.rowEnd);
94
- let l2 = r2;
95
- return l2 ? (l2.colStart = n2, l2.rowStart = o2, l2.colEnd = a2, l2.rowEnd = i2) : l2 = { colStart: n2, rowStart: o2, colEnd: a2, rowEnd: i2 }, l2;
96
- }, isCellWithinRange: (t5, e2) => !(!t5 || !e2 || t5.rowIndex < e2.rowStart || t5.rowIndex > e2.rowEnd || t5.colIndex < e2.colStart || t5.colIndex > e2.colEnd), isEqualCells: g, isEqualRanges: b, isEqualRangesArrays: E, isEqualSelectionCoords: (t5, e2) => t5 === e2 || !(!t5 || !e2) && t5.rangeIndex === e2.rangeIndex && !!g(t5.cell, e2.cell) && E(t5.ranges, e2.ranges), isRangeWithinRange: (t5, e2) => !(t5.rowStart < e2.rowStart || t5.rowEnd > e2.rowEnd || t5.colStart < e2.colStart || t5.colEnd > e2.colEnd), isRangesIntersect: m, isSingleCell: (t5) => !!t5 && t5.rowEnd === t5.rowStart && t5.colStart === t5.colEnd, isValidRange: (t5) => !(!t5 || "number" != typeof t5.colStart || t5.colStart < 0 || "number" != typeof t5.colEnd || t5.colEnd < t5.colStart || "number" != typeof t5.rowStart || t5.rowStart < 0 || "number" != typeof t5.rowEnd || t5.rowEnd < t5.rowStart), mergeRangedValues: _, rowFirstCellComparator: h, rowFirstRangeComparator: d, sanitizeRange: (t5) => t5 ? { colStart: t5.colIndex ?? t5.colStart ?? 0, rowStart: t5.rowIndex ?? t5.rowStart ?? 0, colEnd: t5.colIndex ?? t5.colEnd ?? 0, rowEnd: t5.rowIndex ?? t5.rowEnd ?? 0 } : null, translateRange: (t5, e2 = -t5.rowStart, r2 = -t5.colStart, n2) => n2 ? (n2.colStart = t5.colStart + r2, n2.rowStart = t5.rowStart + e2, n2.colEnd = t5.colEnd + r2, n2.rowEnd = t5.rowEnd + e2, n2) : { colStart: t5.colStart + r2, rowStart: t5.rowStart + e2, colEnd: t5.colEnd + r2, rowEnd: t5.rowEnd + e2 }, unionRanges: S, unionRangesArrays: (t5, e2, r2) => {
97
- if (!t5 || 0 === t5.length) return null;
98
- if (1 === t5.length && !e2) return t5[0];
99
- let n2 = t5[0];
100
- for (let e3 = 1; e3 < t5.length; e3++) n2 = S(n2, t5[e3], r2);
101
- return e2 && (n2 = S(n2, e2, r2)), n2;
102
- } }, Symbol.toStringTag, { value: "Module" }));
103
- const I = "function" == typeof Symbol && Symbol.for ? Symbol.for("react.element") : 60103;
104
- function j(t5) {
105
- return /* @__PURE__ */ function(t6) {
106
- return !!t6 && "object" == typeof t6;
107
- }(t5) && !function(t6) {
108
- const e2 = Object.prototype.toString.call(t6);
109
- return "[object RegExp]" === e2 || "[object Date]" === e2 || t6.$$typeof === I;
110
- }(t5);
111
- }
112
- function T(t5, e2) {
113
- return false !== e2.clone && e2.isMergeableObject(t5) ? A((r2 = t5, Array.isArray(r2) ? [] : {}), t5, e2) : t5;
114
- var r2;
115
- }
116
- function C(t5, e2, r2) {
117
- return t5.concat(e2).map(function(t6) {
118
- return T(t6, r2);
119
- });
120
- }
121
- function M(t5) {
122
- return Object.keys(t5).concat((e2 = t5, Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e2).filter(function(t6) {
123
- return Object.propertyIsEnumerable.call(e2, t6);
124
- }) : []));
125
- var e2;
126
- }
127
- function R(t5, e2) {
128
- try {
129
- return e2 in t5;
130
- } catch {
131
- return false;
132
- }
133
- }
134
- function A(t5, e2, r2) {
135
- (r2 = r2 || {}).arrayMerge = r2.arrayMerge || C, r2.isMergeableObject = r2.isMergeableObject || j, r2.cloneUnlessOtherwiseSpecified = T;
136
- const n2 = Array.isArray(e2);
137
- return n2 === Array.isArray(t5) ? n2 ? r2.arrayMerge(t5, e2, r2) : function(t6, e3, r3) {
138
- const n3 = {};
139
- return r3.isMergeableObject(t6) && M(t6).forEach(function(e4) {
140
- n3[e4] = T(t6[e4], r3);
141
- }), M(e3).forEach(function(o2) {
142
- var a2, i2;
143
- R(a2 = t6, i2 = o2) && (!Object.hasOwnProperty.call(a2, i2) || !Object.propertyIsEnumerable.call(a2, i2)) || (R(t6, o2) && r3.isMergeableObject(e3[o2]) ? n3[o2] = function(t7, e4) {
144
- if (!e4.customMerge) return A;
145
- const r4 = e4.customMerge(t7);
146
- return "function" == typeof r4 ? r4 : A;
147
- }(o2, r3)(t6[o2], e3[o2], r3) : n3[o2] = T(e3[o2], r3));
148
- }), n3;
149
- }(t5, e2, r2) : T(e2, r2);
150
- }
151
- A.all = function(t5, e2) {
152
- if (!Array.isArray(t5)) throw new Error("first argument should be an array");
153
- return t5.reduce(function(t6, r2) {
154
- return A(t6, r2, e2);
155
- }, {});
156
- };
157
- const F = Object.freeze([]), L = Object.freeze({}), U = (t5) => t5, P = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(t5) {
158
- let e2 = 16 * Math.random() | 0;
159
- return ("x" === t5 ? e2 : 3 & e2 | 8).toString(16);
160
- }), k = (t5, e2) => t5 === e2 || !(!Array.isArray(t5) || !Array.isArray(e2) || t5.length !== e2.length) && t5.every((t6, r2) => t6 === e2[r2]), N = (t5) => "object" == typeof t5 && !Array.isArray(t5) && null !== t5, B = (t5) => "object" != typeof t5 || Array.isArray(t5) || null === t5 ? t5 : (Object.keys(t5).forEach(function(e2) {
161
- t5[e2] && "object" == typeof t5[e2] ? B(t5[e2]) : null !== t5[e2] && void 0 !== t5[e2] || delete t5[e2], "object" == typeof t5[e2] && 0 === Object.keys(t5[e2]).length && delete t5[e2];
162
- }), 0 === Object.keys(t5).length ? null : t5), z = (t5, e2) => !(t5 !== e2 && !k(t5, e2) && !t5.isEqual?.(e2)), q = (t5, e2, r2 = z) => {
163
- if (null == t5 || t5 === e2) return null;
164
- if (!t5 || "object" != typeof t5 || Array.isArray(t5) || t5.isImmutable?.()) return r2(t5, e2) ? null : t5;
165
- const n2 = Object.keys(t5);
166
- if (0 === n2.length) return null;
167
- let o2 = false;
168
- for (let a2 = 0; a2 < n2.length; a2++) {
169
- const i2 = n2[a2];
170
- null === q(t5[i2], e2?.[i2], r2) && (o2 = true, delete t5[i2]);
171
- }
172
- return o2 && 0 === Object.keys(t5).length ? null : void 0;
173
- }, D = "object" == typeof performance && "function" == typeof performance.now ? () => performance.now() : () => Date.now(), $ = (t5) => null == t5, W = (t5, e2) => !(e2.left > t5.right || e2.right < t5.left || e2.top > t5.bottom || e2.bottom < t5.top), V = !(typeof window > "u" || !window.document || !window.document.createElement), G = { Windows: "windows", MacOS: "macos", IOS: "ios", Linux: "linux", Android: "android", Safari: "safari", Firefox: "firefox", Node: "node", Unknown: "unknown" }, J = () => {
174
- if (H()) return G.Node;
175
- const t5 = void 0 !== globalThis.navigator && globalThis.navigator.userAgent ? globalThis.navigator.userAgent.toLowerCase() : "";
176
- return t5 ? /(win32|win64|windows|wince)/i.test(t5) ? G.Windows : /(macintosh|macintel|macppc|mac68k|macos)/i.test(t5) ? G.MacOS : /(iphone|ipad|ipod)/i.test(t5) ? G.IOS : /android/.test(t5) ? G.Android : /linux/.test(t5) ? G.Linux : /^((?!chrome|android|).)*safari/i.test(t5) ? G.Safari : /^((?!chrome|android|Seamonkey).)*firefox/i.test(t5) ? G.Firefox : G.Unknown : G.Unknown;
177
- };
178
- function H() {
179
- return typeof process < "u" && "node" === process.release?.name || (typeof process < "u" && process.browser, false);
180
- }
181
- const K = (t5, e2 = false) => (document.hasFocus() || e2) && (t5 === document.activeElement || t5?.contains(document.activeElement)), Y = Object.freeze(Object.defineProperty({ __proto__: null, EmptyArray: F, EmptyObject: L, OSType: G, arrayMove: function(t5, e2, r2) {
182
- const n2 = t5.slice();
183
- return n2.splice(r2 < 0 ? n2.length + r2 : r2, 0, n2.splice(e2, 1)[0]), n2;
184
- }, asNumber: (t5) => {
185
- const e2 = 1 * t5;
186
- return Number.isFinite(e2) ? e2 : 0;
187
- }, camelToPrettyCase: (t5) => 1 === t5.length ? t5.toUpperCase() : t5.replace(/([A-Z])/g, " $1").replace(/^./, function(t6) {
188
- return t6.toUpperCase();
189
- }).trim(), canUseDOM: V, cancelTimeout: (t5) => {
190
- cancelAnimationFrame(t5.id);
191
- }, castToString: (t5) => null == t5 || void 0 === t5 ? "" : "string" != typeof t5 ? "" + t5 : t5, cloneObject: (t5) => $(t5) ? t5 : JSON.parse(JSON.stringify(t5)), consoleWithNoSource: (...t5) => new Promise((e2) => {
192
- setTimeout(() => {
193
- Function("console.log.apply(console, arguments)").apply(null, t5), e2();
194
- });
195
- }), debounce: function(t5, e2 = 300, r2 = false) {
196
- let n2, o2, a2, i2, l2 = 0;
197
- function s2() {
198
- let c3 = Date.now() - l2;
199
- c3 < e2 && c3 >= 0 ? n2 = setTimeout(s2, e2 - c3) : (n2 = null, r2 || (i2 = t5.apply(a2, o2), a2 = o2 = null));
200
- }
201
- null == e2 && (e2 = 100);
202
- const c2 = function() {
203
- a2 = globalThis, o2 = arguments, l2 = Date.now();
204
- var c3 = r2 && !n2;
205
- return n2 || (n2 = setTimeout(s2, e2)), c3 && (i2 = t5.apply(a2, o2), a2 = o2 = null), i2;
206
- };
207
- return c2.clear = function() {
208
- n2 && (clearTimeout(n2), n2 = null);
209
- }, c2.flush = function() {
210
- n2 && (i2 = t5.apply(a2, o2), a2 = o2 = null, clearTimeout(n2), n2 = null);
211
- }, c2;
212
- }, deepEqual: function t2(e2, r2) {
213
- if (e2 === r2) return true;
214
- if (e2 && r2 && "object" == typeof e2 && "object" == typeof r2) {
215
- if (e2.constructor !== r2.constructor) return false;
216
- let n2, o2, a2;
217
- if (Array.isArray(e2)) {
218
- if (n2 = e2.length, n2 != r2.length) return false;
219
- for (o2 = n2; 0 !== o2--; ) if (!t2(e2[o2], r2[o2])) return false;
220
- return true;
221
- }
222
- if (e2 instanceof Map && r2 instanceof Map) {
223
- if (e2.size !== r2.size) return false;
224
- for (o2 of e2.entries()) if (!r2.has(o2[0])) return false;
225
- for (o2 of e2.entries()) if (!t2(o2[1], r2.get(o2[0]))) return false;
226
- return true;
227
- }
228
- if (e2 instanceof Set && r2 instanceof Set) {
229
- if (e2.size !== r2.size) return false;
230
- for (o2 of e2.entries()) if (!r2.has(o2[0])) return false;
231
- return true;
232
- }
233
- if (ArrayBuffer.isView(e2) && ArrayBuffer.isView(r2)) {
234
- if (n2 = e2.length, n2 != r2.length) return false;
235
- for (o2 = n2; 0 !== o2--; ) if (e2[o2] !== r2[o2]) return false;
236
- return true;
237
- }
238
- if (e2.constructor === RegExp) return e2.source === r2.source && e2.flags === r2.flags;
239
- if (e2.valueOf !== Object.prototype.valueOf) return e2.valueOf() === r2.valueOf();
240
- if (e2.toString !== Object.prototype.toString) return e2.toString() === r2.toString();
241
- if (a2 = Object.keys(e2), n2 = a2.length, n2 !== Object.keys(r2).length) return false;
242
- for (o2 = n2; 0 !== o2--; ) if (!Object.prototype.hasOwnProperty.call(r2, a2[o2])) return false;
243
- for (o2 = n2; 0 !== o2--; ) {
244
- let n3 = a2[o2];
245
- if (!("_owner" === n3 && e2.$$typeof || t2(e2[n3], r2[n3]))) return false;
246
- }
247
- return true;
248
- }
249
- return e2 != e2 && r2 != r2;
250
- }, deepFreeze: function t3(e2) {
251
- return Object.freeze(e2), Object.keys(e2).forEach((r2) => {
252
- "object" != typeof e2[r2] || null === e2[r2] || Object.isFrozen(e2[r2]) || t3(e2[r2]);
253
- }), e2;
254
- }, deepMerge: A, diffValues: (t5, e2) => {
255
- const r2 = {}, n2 = Object.keys(e2), o2 = n2.length;
256
- for (let a2 = 0; a2 < o2; a2++) {
257
- const o3 = n2[a2];
258
- t5[o3] !== e2[o3] && (void 0 === t5[o3] ? r2[o3] = e2[o3] : r2[o3] = t5[o3]);
259
- }
260
- return 0 === Object.keys(r2).length ? null : r2;
261
- }, findEqualOrGreater: function(t5, e2, r2 = U) {
262
- let n2 = 0, o2 = t5.length - 1;
263
- for (; n2 <= o2; ) {
264
- let a2 = Math.floor((n2 + o2) / 2), i2 = r2(t5[a2]);
265
- if (i2 === e2) return a2;
266
- i2 < e2 ? n2 = a2 + 1 : o2 = a2 - 1;
267
- }
268
- return n2;
269
- }, findEqualOrLesser: function(t5, e2, r2 = U) {
270
- let n2 = t5.length - 1, o2 = 0;
271
- for (; n2 >= o2; ) {
272
- let a2 = Math.floor((n2 + o2) / 2), i2 = r2(t5[a2]);
273
- if (i2 === e2) return a2;
274
- i2 > e2 ? n2 = a2 - 1 : o2 = a2 + 1;
275
- }
276
- return n2;
277
- }, findNextStep: (t5, e2 = true, r2 = 15, n2 = 10, o2 = 400) => {
278
- const a2 = Math.max(t5 - n2, 0) + (e2 ? 1 : -1);
279
- return Math.min(o2, Math[e2 ? "ceil" : "floor"](a2 / r2) * r2 + n2);
280
- }, getDPI: () => {
281
- let t5 = 1;
282
- return "object" == typeof window && (t5 = window.devicePixelRatio || 1), t5;
283
- }, getFromPath: (t5, e2) => {
284
- const r2 = e2.split(".");
285
- let n2 = t5;
286
- for (let t6 = 0; t6 < r2.length; t6++) {
287
- const e3 = r2[t6];
288
- if (!n2) return null;
289
- let o2 = n2[e3];
290
- if ("function" == typeof o2 && (o2 = o2.bind(n2)()), !o2 || !N(o2)) return o2;
291
- n2 = o2;
292
- }
293
- return n2 ?? null;
294
- }, getOS: J, hasFocus: K, isDefined: (t5) => null != t5, isEmpty: (t5) => null == t5 || "" === t5, isEqualArrays: k, isEqualBounds: (t5, e2) => t5 === e2 || !(t5 && !e2 || e2 && !t5) && t5.x === e2.x && t5.y === e2.y && t5.width === e2.width && t5.height === e2.height, isEqualObjectKeys: (t5, e2) => {
295
- if (t5 === e2) return true;
296
- if (t5 && !e2 || e2 && !t5) return false;
297
- const r2 = Object.keys(t5);
298
- if (r2.length !== Object.keys(e2).length) return false;
299
- for (let n2 = 0; n2 < r2.length; n2++) if (t5[r2[n2]] !== e2[r2[n2]]) return false;
300
- return true;
301
- }, isNode: H, isNullOrUndefined: $, isNumeric: (t5) => {
302
- const e2 = 1 * t5;
303
- return Number.isFinite(e2) && "number" == typeof e2;
304
- }, isObject: N, isPromiseLike: (t5) => !!t5 && "function" == typeof t5.then, isRectInsideRect: (t5, e2) => t5.top >= e2.top && t5.bottom <= e2.bottom && t5.left >= e2.left && t5.right <= e2.right, isRectIntersect: W, mergeContentful: (...t5) => {
305
- const e2 = t5.length;
306
- if (e2 > 0 && void 0 !== t5[e2 - 1] && !N(t5[e2 - 1])) return t5[e2 - 1];
307
- let r2 = t5[0] || {};
308
- for (let n2 = 1; n2 < e2; n2++) r2 = A(r2, t5[n2] || {}, { arrayMerge: (t6, e3) => [...e3] });
309
- return r2;
310
- }, nextTick: (t5) => {
311
- typeof window < "u" && "function" == typeof window.requestAnimationFrame ? window.requestAnimationFrame(() => {
312
- t5();
313
- }) : ("function" == typeof setImmediate ? setImmediate : setTimeout)(() => {
314
- t5();
315
- });
316
- }, openFileDialog: (t5 = "*.*") => new Promise((e2, r2) => {
317
- if (!V) return void r2("Unable to open dialog with no dom.");
318
- const n2 = document.createElement("input");
319
- n2.type = "file", n2.accept = t5;
320
- let o2 = null, a2 = false;
321
- globalThis.addEventListener?.("focus", () => {
322
- setTimeout(() => {
323
- o2 || a2 || (a2 = true, e2(null));
324
- }, 1e3);
325
- }, { once: true, passive: true }), n2.onchange = () => {
326
- if (o2 = n2.files[0], o2) {
327
- if (a2) return void console.warn("File open detected after faux cancel.", o2);
328
- e2(o2);
329
- }
330
- }, n2.autofocus = true, n2.click();
331
- }), rafThrottle: (t5) => {
332
- let e2, r2 = false, n2 = function() {
333
- r2 = false, t5(e2);
334
- };
335
- return function(t6) {
336
- e2 = t6, e2 && e2.persist && e2.persist(), r2 || (r2 = true, requestAnimationFrame(n2));
337
- };
338
- }, removeEmptyProperties: B, removeEqualValues: q, removeListenerAll: (t5) => {
339
- if (!t5) return [];
340
- for (let e2 = 0; e2 < t5.length; e2++) t5[e2] && t5[e2]();
341
- return [];
342
- }, requestTimeout: (t5, e2) => {
343
- const r2 = D(), n2 = { id: requestAnimationFrame(function o2() {
344
- D() - r2 >= e2 ? t5.call(null) : n2.id = requestAnimationFrame(o2);
345
- }) };
346
- return n2;
347
- }, roundAccurately: (t5, e2 = 0) => {
348
- if (null == t5 || !isFinite(t5)) return null;
349
- const r2 = 10 ** e2;
350
- return Number(Math.round(t5 * r2) / r2);
351
- }, setToPath: (t5, e2, r2) => {
352
- const n2 = e2.split(".");
353
- let o2 = t5;
354
- if (!o2) throw new Error("Can not set path to a null path.");
355
- for (let t6 = 0; o2 && t6 < n2.length - 1; t6++) {
356
- const e3 = n2[t6];
357
- let r3 = o2[e3];
358
- if (null == r3 && (r3 = {}, o2[e3] = r3), !N(r3)) throw new Error("Can not set path to a non object path.");
359
- o2 = r3;
360
- }
361
- if ("number" != typeof r2 && "boolean" != typeof r2 && "string" != typeof r2 && !N(r2)) throw new Error(`Can not set path to ${r2} that is not a a supported primitive.`);
362
- return o2[n2[n2.length - 1]] = r2, t5;
363
- }, splitNumber: (t5) => {
364
- let e2 = Math.abs(t5);
365
- if (isNaN(e2) || !isFinite(t5)) return null;
366
- let r2 = 0 | e2, n2 = e2 - r2, o2 = 0, a2 = 0, i2 = 1;
367
- if (n2 > 5e-8) for (; a2 < 8 && Math.abs(o2 / i2 - n2) > 5e-8; ) a2++, i2 *= 10, o2 = Math.round(n2 * i2);
368
- return { ip: Math.trunc(t5), fp: o2, ipLength: Math.ceil(Math.log10(r2 + 1)), fpLength: a2 };
369
- }, subtractRect: (t5, e2, r2 = false) => {
370
- if (!e2) return [t5];
371
- if (!W(t5, e2)) return [];
372
- const n2 = [];
373
- let o2 = t5;
374
- const a2 = () => {
375
- e2.top > o2.top && e2.top < o2.bottom && (n2.push({ ...o2, bottom: e2.top }), o2 = { ...o2, top: e2.top });
376
- }, i2 = () => {
377
- e2.bottom > o2.top && e2.bottom < o2.bottom && (n2.push({ ...o2, top: e2.bottom }), o2 = { ...o2, bottom: e2.bottom });
378
- }, l2 = () => {
379
- e2.right > o2.left && e2.right < o2.right && (n2.push({ ...o2, left: e2.right }), o2 = { ...o2, right: e2.right });
380
- }, s2 = () => {
381
- e2.left > o2.left && e2.left < o2.right && (n2.push({ ...o2, right: e2.left }), o2 = { ...o2, left: e2.left });
382
- };
383
- return r2 ? (s2(), l2(), a2(), i2()) : (a2(), i2(), l2(), s2()), n2;
384
- }, textToKey: (t5) => t5.replace(/[^a-zA-Z0-9]/g, "").toLowerCase(), throttle: function(t5, e2) {
385
- let r2 = null;
386
- return (...n2) => {
387
- const o2 = Date.now();
388
- (!r2 || o2 - r2 >= e2) && (r2 = o2, t5(...n2));
389
- };
390
- }, toSafeJSON: function t4(e2) {
391
- if (null === e2 || "object" != typeof e2) return e2;
392
- if ("function" == typeof e2.toJSON) return e2.toJSON();
393
- if (Array.isArray(e2)) return e2.map((e3) => t4(e3));
394
- if ("function" == typeof e2.toString && e2.toString !== Object.prototype.toString) return e2.toString();
395
- const r2 = {};
396
- for (const n2 in e2) e2.hasOwnProperty(n2) && (r2[n2] = t4(e2[n2]));
397
- return r2;
398
- }, transpose: (t5) => {
399
- if (!t5) return t5;
400
- const e2 = t5.length, r2 = t5[0].length, n2 = [];
401
- for (let t6 = 0; t6 < r2; t6++) n2[t6] = Array(e2);
402
- for (let o2 = 0; o2 < e2; o2++) for (let e3 = 0; e3 < r2; e3++) n2[e3][o2] = t5[o2][e3];
403
- return n2;
404
- }, uuidV4: P, validEnumValue: (t5, e2) => {
405
- if (!Object.values(t5).includes(e2)) throw new Error(`Invalid type: ${e2 ?? "null"}. Must be one of: ${Object.values(e2).join(", ")}.`);
406
- }, whenFocus: async (t5, e2 = false) => new Promise((r2) => {
407
- K(t5, e2) ? r2(true) : t5.addEventListener("focusin", () => {
408
- r2(true);
409
- }, { once: true }), t5.focus();
410
- }) }, Symbol.toStringTag, { value: "Module" }));
411
- Object.freeze(Object.defineProperty({ __proto__: null, MESSAGE_ERROR_INVALID_ARG: (t5) => `Invalid argument: '${t5}'.` }, Symbol.toStringTag, { value: "Module" }));
412
- const Z = (t5) => {
413
- const e2 = new Uint8Array(t5), r2 = e2.byteLength;
414
- let n2 = "";
415
- for (let t6 = 0; t6 < r2; t6++) n2 += String.fromCharCode(e2[t6]);
416
- if (typeof window < "u" && "function" == typeof globalThis.btoa) return globalThis.btoa(n2);
417
- if (typeof Buffer < "u") return Buffer.from(n2, "binary").toString("base64");
418
- throw new Error("Unsupported environment");
419
- }, X = (t5) => new Promise((e2, r2) => {
420
- if (t5) if (typeof FileReader < "u") {
421
- const n2 = new FileReader();
422
- n2.onload = () => {
423
- e2(n2.result);
424
- }, n2.onerror = () => {
425
- r2(n2.error);
426
- }, n2.readAsText(t5);
427
- } else if (typeof Buffer < "u") {
428
- const n2 = (t6) => Buffer.from(t6).toString("utf-8");
429
- t5.arrayBuffer().then((t6) => {
430
- e2(n2(t6));
431
- }).catch((t6) => {
432
- r2(t6);
433
- });
434
- } else r2(new Error("Unsupported environment"));
435
- else e2("");
436
- });
437
- Object.freeze(Object.defineProperty({ __proto__: null, DEFAULT_MIME_TYPE: "*/*", arrayBufferToBase64: Z, base64ToArrayBuffer: (t5) => {
438
- const e2 = typeof window < "u" && "function" == typeof globalThis.atob ? globalThis.atob(t5) : Buffer.from(t5, "base64").toString("binary"), r2 = e2.length, n2 = new Uint8Array(r2);
439
- for (let t6 = 0; t6 < r2; t6++) n2[t6] = e2.charCodeAt(t6);
440
- return n2.buffer;
441
- }, blobToString: X }, Symbol.toStringTag, { value: "Module" }));
442
- const Q = "data:image/png;base64,", tt = "Unable to resolve image.", et = (t5) => new Promise(async (e2, r2) => {
443
- let n2 = null;
444
- try {
445
- n2 = new Image(), n2.src = t5, n2.addEventListener("load", function() {
446
- e2({ width: n2.naturalWidth, height: n2.naturalHeight });
447
- }, { once: true }), n2.addEventListener("error", function() {
448
- URL.revokeObjectURL(t5), r2("Invalid Image");
449
- }, { once: true }), await n2.decode("sync");
450
- } catch {
451
- n2?.src && URL.revokeObjectURL(n2.src);
452
- }
453
- n2 || r2(tt);
454
- }), rt = "image/svg+xml";
455
- var nt, ot;
456
- Object.freeze(Object.defineProperty({ __proto__: null, DATA_URL_PNG_PREFIX: Q, getImageDataUrl: (t5, e2 = 1) => new Promise(async (r2, n2) => {
457
- let o2 = null;
458
- try {
459
- o2 = new Image(), o2.src = t5, o2.addEventListener("load", function() {
460
- try {
461
- const t6 = document.createElement("canvas");
462
- t6.width = o2.naturalWidth, t6.height = o2.naturalHeight, t6.getContext("2d").drawImage(o2, 0, 0);
463
- const n3 = t6.toDataURL("image/png", e2);
464
- r2({ elemImg: o2, dataUrl: n3 });
465
- } catch (e3) {
466
- URL.revokeObjectURL(t5), n2(e3);
467
- }
468
- }, { once: true }), o2.addEventListener("error", function() {
469
- URL.revokeObjectURL(t5), n2("Invalid Image");
470
- }, { once: true }), await o2.decode("sync");
471
- } catch {
472
- o2?.src && URL.revokeObjectURL(o2.src);
473
- }
474
- o2 || n2(tt);
475
- }), loadImageDetails: async (t5, e2 = null) => {
476
- let r2 = null;
477
- const n2 = async () => {
478
- try {
479
- const n3 = e2 ?? "image/*", o3 = URL.createObjectURL(new Blob([t5], { type: n3 })), a2 = await et(o3);
480
- r2 = { mimeType: n3, naturalDimensions: a2, asUrl: o3 };
481
- } catch {
482
- }
483
- }, o2 = async () => {
484
- try {
485
- const n3 = new TextDecoder().decode(t5), o3 = URL.createObjectURL(new Blob([n3], { type: rt })), a2 = await et(o3);
486
- r2 = { mimeType: e2 ?? rt, naturalDimensions: a2, asUrl: o3, asSVGText: n3 };
487
- } catch {
488
- }
489
- };
490
- if (e2 === rt ? await o2() : e2.startsWith("image/") ? await n2() : (await n2(), r2 || await o2()), !r2) throw new Error("Failed to load image");
491
- return r2;
492
- } }, Symbol.toStringTag, { value: "Module" })), (ot = nt || (nt = {})).resolveTypedUpdates = (t5, e2, r2, n2) => {
493
- if (null === t5) return t5;
494
- if (void 0 === t5) return n2;
495
- let o2 = t5;
496
- if (e2?.shorthand) {
497
- const n3 = e2?.shorthand(t5, r2);
498
- void 0 !== n3 && (o2 = n3);
499
- }
500
- if (null !== o2 && e2?.getSubType) {
501
- const t6 = e2.getSubType(o2);
502
- t6 && (e2 = t6);
503
- }
504
- const a2 = e2?.properties, i2 = e2?.arrayType ?? false;
505
- let l2 = o2;
506
- if (e2 && e2.merge && l2 && n2) l2 = e2.merge(l2, n2, r2);
507
- else if (!i2 && a2) {
508
- const t6 = Object.keys({ ...o2, ...n2 });
509
- l2 = null;
510
- for (let e3 = 0; e3 < t6.length; e3++) {
511
- const i3 = t6[e3];
512
- let s2, c2 = o2[i3];
513
- if (void 0 !== c2) {
514
- const t7 = a2[i3];
515
- s2 = t7 ? (0, ot.resolveTypedUpdates)(c2, t7, r2, n2?.[i3]) : c2;
516
- } else s2 = n2?.[i3];
517
- null != s2 && (l2 = l2 ?? {}, l2[i3] = s2);
518
- }
519
- }
520
- return l2;
521
- };
522
- const at = "The Safari browser does not support advanced copy and paste.\nCopy and paste will be limited to within the browser tab.\n\nPlease use Chrome or Edge if external copy and paste is required.", it = "You do not have permissions to access the clipboard.\nAll copy and paste operations will be limited to the browser tab.", lt = { Safari: "The Safari browser does not support advanced copy and paste.\nCopy and paste will be limited to within the browser tab.\n\nPlease use Chrome or Edge if external copy and paste is required.", Perms: it, PermsWrite: J() === G.Safari ? at : it, PermsRead: J() === G.Safari ? at : it }, st = async () => new Promise((t5) => {
523
- document.hasFocus() ? t5() : globalThis.addEventListener?.("focus", () => {
524
- t5();
525
- }, { once: true }), document.activeElement.focus?.();
526
- }), ct = async (t5, e2, r2) => {
527
- if (J() === G.Safari) return await r2(new Error(lt.Safari));
528
- try {
529
- const n2 = async (t6) => {
530
- try {
531
- return await t6();
532
- } catch (t7) {
533
- if (t7.message?.includes("Document is not focused")) return false;
534
- throw t7;
535
- }
536
- }, o2 = await globalThis?.navigator?.permissions?.query({ name: t5, allowWithoutGesture: true, allowWithoutSanitization: true });
537
- let a2 = false;
538
- if ("prompt" === o2.state && (a2 = await n2(e2)), a2 || "granted" !== o2.state || (a2 = await e2()), !a2) return await r2(new Error(o2.state));
539
- } catch (t6) {
540
- return "No valid data on clipboard" === t6.message || "DataError" === t6.name ? void 0 : await r2(t6);
541
- }
542
- }, ut = async (e2) => {
543
- try {
544
- return await e2.read({ unsanitized: [t] });
545
- } catch {
546
- }
547
- return await e2.read();
548
- };
549
- if (!globalThis.ClipboardItem) {
550
- const t5 = (t6, e3) => new Blob([e3], { type: t6 });
551
- class e2 {
552
- constructor(e3, r2) {
553
- this._items = {}, this._types = Object.keys(e3);
554
- const n2 = {}, o2 = Object.keys(e3);
555
- for (let r3 = 0; r3 < o2.length; r3++) {
556
- const a2 = o2[r3];
557
- let i2 = e3[a2];
558
- n2[a2] = "string" == typeof i2 ? t5(a2, i2) : i2;
559
- }
560
- this._items = n2, this._presentationStyle = r2?.presentationStyle ?? "unspecified";
561
- }
562
- get types() {
563
- return this._types;
564
- }
565
- getType(t6) {
566
- return Promise.resolve(this._items[t6]);
567
- }
568
- supports(t6) {
569
- return true;
570
- }
571
- }
572
- globalThis.ClipboardItem = e2;
573
- }
574
- const dt = async (e2, r2 = t) => new Promise(async (t5, n2) => {
575
- try {
576
- const n3 = await (async (t6, e3) => {
577
- if (!t6) return null;
578
- const r3 = await ut(t6);
579
- let n4 = false;
580
- for (let t7 = 0; !n4 && r3 && t7 < r3.length; t7++) if (n4 = r3[t7].types.includes(e3), n4) return await r3[t7].getType(e3);
581
- return n4 ? void 0 : null;
582
- })(e2, r2);
583
- if (n3) {
584
- const e3 = new FileReader();
585
- e3.onload = () => {
586
- t5(e3.result);
587
- }, e3.onerror = () => {
588
- t5("");
589
- }, e3.readAsText(n3);
590
- } else t5("");
591
- } catch (t6) {
592
- n2(t6);
593
- }
594
- }), ft = async (e2, r2 = t) => {
595
- const n2 = await dt(e2, r2);
596
- if (!n2) return null;
597
- let o2 = null;
598
- try {
599
- o2 = new DOMParser().parseFromString(n2, t);
600
- } catch {
601
- console.warn("Can't parse html from clipboard.");
602
- }
603
- return o2;
604
- }, pt = "clipboard-uuid", wt = "web text/uuid", ht = (t5) => `<div style="display:none" ${pt}="${t5}"/>`, yt = (e2, r2) => {
605
- let n2 = null;
606
- try {
607
- const o2 = new DOMParser().parseFromString(r2, t);
608
- o2.body.firstElementChild.setAttribute(pt, e2), n2 = o2.getElementsByTagName("body")[0].innerHTML;
609
- } catch (t5) {
610
- console.warn("Can't embed uuid.", t5);
611
- }
612
- return n2;
613
- }, gt = (t5, e2) => {
614
- if (!e2 || !t5) return false;
615
- try {
616
- const r2 = e2.querySelectorAll(`[${pt}="${t5}"]`);
617
- if (r2 && 1 === r2.length) return true;
618
- if (e2.querySelector("parsererror")) throw new Error("We are unable to parse node");
619
- return false;
620
- } catch {
621
- return false;
622
- }
623
- };
624
- class bt {
625
- constructor(t5) {
626
- if (void 0 === t5?.nativeClipboard || true === t5?.nativeClipboard) try {
627
- this._nativeClipboard = globalThis?.navigator.clipboard;
628
- } catch {
629
- true === t5?.nativeClipboard && console.warn("NativeClipboard option set to true but no native clipboard available.");
630
- }
631
- else this._nativeClipboard = false === t5?.nativeClipboard ? null : t5?.nativeClipboard;
632
- this._disableCheckOnFocus = t5?.disableCheckOnFocus ?? false, this._init();
633
- }
634
- async _checkForChanges() {
635
- this._nativeClipboard && this._state && !this._disableCheckOnFocus && await ct("clipboard-read", async () => {
636
- await st();
637
- const e2 = await dt(this._nativeClipboard, wt);
638
- if (!this._state || e2 && e2 === this._state.uuid) return true;
639
- const r2 = await ft(this._nativeClipboard, t);
640
- return !this._state || (gt(this._state.uuid, r2) || this.clear(), true);
641
- }, async (t5) => {
642
- "denied" === t5?.message || t5.message?.includes("Document is not focused") || J() === G.Safari || console.warn("Unable to detect clipboard changes: ", t5);
643
- });
644
- }
645
- _init() {
646
- const t5 = this;
647
- this._listeners = /* @__PURE__ */ new Map(), this._listenersCapture = /* @__PURE__ */ new Map(), this._state = null, this._nativeClipboard && (this._onFocus = () => {
648
- t5._checkForChanges();
649
- }, this._onBlur = () => {
650
- globalThis.addEventListener?.("focus", t5._onFocus, { once: true });
651
- }, globalThis.addEventListener?.("blur", this._onBlur), this._nativeClipboard.addEventListener("clipboardchange", (e2) => {
652
- t5._checkForChanges();
653
- }));
654
- }
655
- async read() {
656
- if (!this._nativeClipboard) return this._state?.items ?? null;
657
- const e2 = this;
658
- return await ct("clipboard-read", async () => {
659
- if (await st(), this._state?.uuid) {
660
- const r2 = await dt(this._nativeClipboard, wt);
661
- if (r2 && r2 === e2._state.uuid) return true;
662
- const n2 = await ft(this._nativeClipboard, t);
663
- if (gt(e2._state?.uuid, n2)) return true;
664
- }
665
- return e2._state = { items: await ut(this._nativeClipboard), uuid: null, ref: null }, this.dispatchEvent(new Event("clipboardread")), true;
666
- }, async (t5) => {
667
- this.dispatchEvent(new Event("clipboarderrorread"));
668
- }), this._state?.items ?? [];
669
- }
670
- async write(t5) {
671
- return this._write({ uuid: P(), items: t5, ref: null });
672
- }
673
- async _write(n2) {
674
- if (!this._nativeClipboard) return this._state = n2, this.dispatchEvent(new Event("clipboardwrite")), this.dispatchEvent(new Event("clipboardchange")), null;
675
- const o2 = this, a2 = [], i2 = n2.uuid;
676
- let l2 = n2.items ?? [];
677
- const s2 = () => {
678
- o2._state = { uuid: i2, ref: n2.ref, items: a2 }, o2.dispatchEvent(new Event("clipboardwrite")), o2.dispatchEvent(new Event("clipboardchange"));
679
- };
680
- await ct("clipboard-write", async () => {
681
- await st(), i2 && 0 === l2.length && (l2.push(new ClipboardItem({ [wt]: new Blob([i2], { type: wt }) })), l2.push(new ClipboardItem({ [t]: new Blob([ht(i2)], { type: t }) })));
682
- for (let n3 = 0; n3 < Math.min(1, l2.length); n3++) {
683
- const o3 = l2[n3];
684
- let s3 = o3.types.indexOf(t), c2 = null;
685
- if (-1 !== s3) {
686
- const e2 = await o3.getType(t);
687
- c2 = await X(e2), c2 && (c2 = yt(i2, c2));
688
- }
689
- if (!c2 && o3.types.includes(e)) {
690
- const t5 = await o3.getType(e);
691
- if (t5) {
692
- let e2 = null;
693
- "string" == typeof t5 ? (console.warn("text as string", t5), e2 = t5) : e2 = await X(t5), e2 && (c2 = `<div ${pt}="${i2}">${e2}</div>`);
694
- }
695
- }
696
- if (!c2 && o3.types.includes(r)) {
697
- const t5 = await o3.getType(r), e2 = Z(await t5.arrayBuffer());
698
- c2 = `<div ${pt}="${i2}"><img src="${Q + e2}"/></div>`;
699
- }
700
- !c2 && i2 && (c2 = ht(i2));
701
- const u2 = new Blob([c2 ?? ""], { type: t }), d2 = {};
702
- for (let t5 = 0; t5 < o3.types.length; t5++) {
703
- const e2 = o3.types[t5];
704
- d2[e2] = t5 === s3 ? u2 : o3.getType(e2);
705
- }
706
- c2 && -1 === s3 && (d2[t] = u2), i2 && (d2[wt] = new Blob([i2], { type: wt })), a2.push(new ClipboardItem(d2));
707
- }
708
- try {
709
- a2 && 0 !== a2.length ? await this._nativeClipboard.write(a2) : await (async (t5) => {
710
- t5 && await t5.writeText("");
711
- })(this._nativeClipboard);
712
- } catch (t5) {
713
- t5.message?.includes("Document is not focused") || console.warn("Unable to write to native clipboard: ", t5);
714
- }
715
- return s2(), true;
716
- }, async (t5) => {
717
- this.dispatchEvent(new Event("clipboarderrorwrite")), s2();
718
- });
719
- }
720
- async writeReference(n2) {
721
- if (!n2) return void this.clear();
722
- let o2 = null;
723
- const a2 = {};
724
- try {
725
- const t5 = await n2.toText?.() ?? null;
726
- t5 && (a2[e] = new Blob([t5 ?? ""], { type: e }));
727
- } catch (t5) {
728
- o2 = t5;
729
- }
730
- try {
731
- const e2 = await n2.toHtml?.() ?? null;
732
- e2 && (a2[t] = new Blob([e2], { type: t }));
733
- } catch (t5) {
734
- o2 = t5, console.warn("export to html", t5);
735
- }
736
- try {
737
- const t5 = await n2.toImage?.() ?? null;
738
- t5 && (a2[r] = t5);
739
- } catch (t5) {
740
- o2 = t5, console.warn("export to png", t5);
741
- }
742
- const i2 = this._write({ uuid: P(), ref: n2, items: Object.keys(a2).length > 0 ? [new ClipboardItem(a2)] : null });
743
- if (o2) throw o2;
744
- return i2;
745
- }
746
- clear(t5 = false) {
747
- this._state && (this._state = null, t5 && this._write({ uuid: null, ref: null, items: null }), this.dispatchEvent(new Event("clipboardwrite")), this.dispatchEvent(new Event("clipboardchange")));
748
- }
749
- async readReference() {
750
- return await this.read(), this._state?.ref ?? null;
751
- }
752
- readText() {
753
- return new Promise(async (t5, r2) => {
754
- const n2 = await this.read();
755
- let o2 = null;
756
- for (let t6 = 0; !o2 && n2 && t6 < n2.length; t6++) n2[t6].types.includes(e) && (o2 = await n2[t6].getType(e));
757
- if (!o2) return void t5("");
758
- const a2 = new FileReader();
759
- a2.onload = () => {
760
- t5(a2.result);
761
- }, a2.readAsText(o2), a2.onerror = (t6) => {
762
- r2(t6);
763
- };
764
- });
765
- }
766
- async writeText(t5) {
767
- const r2 = [new ClipboardItem({ [e]: new Blob([t5], { type: e }) })];
768
- return this._write({ uuid: P(), items: r2, ref: null });
769
- }
770
- addEventListener(t5, e2, r2 = {}) {
771
- const n2 = r2?.capture ? this._listenersCapture : this._listeners;
772
- let o2 = n2.get(t5);
773
- o2 || (o2 = /* @__PURE__ */ new Map(), n2.set(t5, o2)), o2.set(e2, "boolean" == typeof r2 ? {} : r2);
774
- }
775
- dispatchEvent(t5) {
776
- if (!t5) return;
777
- const e2 = (e3) => {
778
- const r2 = e3.get(t5.type);
779
- r2 && r2.forEach((e4, n2) => {
780
- try {
781
- "function" == typeof n2 ? n2(t5) : n2.handleEvent && n2.handleEvent(t5), e4.once && r2.delete(n2);
782
- } catch (t6) {
783
- console.warn(t6);
784
- }
785
- });
786
- };
787
- return e2(this._listenersCapture), e2(this._listeners), true;
788
- }
789
- removeEventListener(t5, e2, r2) {
790
- const n2 = r2?.capture ? this._listenersCapture : this._listeners, o2 = n2.get(t5);
791
- o2 && (o2.delete(e2), 0 === o2.size && n2.delete(t5));
792
- }
793
- close() {
794
- globalThis.removeEventListener?.("focus", this._onFocus), globalThis.removeEventListener?.("blur", this._onBlur);
795
- }
796
- }
797
- var mt;
798
- (mt = bt || (bt = {})).ErrorMessages = lt, mt.Global = new mt();
799
- let Et = null, St = null, vt = null;
800
- const xt = Object.freeze({ compileTypescript: async function(t5) {
801
- if (!t5?.source) return null;
802
- if (St && Y.deepEqual(St, t5)) return Et;
803
- const e2 = await async function() {
804
- if (vt) return vt;
805
- const { TypeScriptCompiler: t6 } = await import("./07j0n4N6h6oBOk_2.mjs");
806
- return vt = new t6(), vt;
807
- }(), r2 = await e2.compileModule(t5);
808
- return Et = r2, St = t5, r2;
809
- } });
810
- export {
811
- xt as ScriptingUtils,
812
- Y as e
813
- };