@sheetxl/scripting 0.2.6 → 0.3.1

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 (28) hide show
  1. package/LICENSE.md +11 -11
  2. package/README.md +309 -309
  3. package/browser/cjs/{hk-vy-g6CmJU9xqy.cjs → B7r9o0J98FeOpECG.cjs} +2 -2
  4. package/browser/cjs/{BARuVA3rLqhjAFo5.cjs → BpsMQL8WKA-7RfCC.cjs} +8 -13
  5. package/browser/cjs/DBkloFDekvQ92YXS.cjs +6 -0
  6. package/browser/cjs/{BMqIRQxRw4K8e0-c.cjs → DD5u0jJgnIfl_LRp.cjs} +3 -8
  7. package/browser/cjs/{liqm9acA3-nrAs3b.cjs → DwQSeolUdto6tnne.cjs} +3 -8
  8. package/browser/cjs/UDMd4iRmsiNDeVh4.cjs +6 -0
  9. package/browser/cjs/index.cjs +2 -2
  10. package/browser/esm/{BcvpIfnTmlQXt7_9.mjs → BB9Q-lDQb6Cd-_mI.mjs} +2 -2
  11. package/browser/esm/CbSvIMzV_OzOFidG.mjs +24 -0
  12. package/browser/esm/{RT1buZA9VR5ysUX8.mjs → CeyaVAZTjD2qkAHf.mjs} +9 -10
  13. package/browser/esm/{CqiaK1eCvblBDvvQ.mjs → CnhwtcVoqbW4lNsP.mjs} +8 -13
  14. package/browser/esm/{CouN61iEakKgCrZH.mjs → D1tRW1SWMJsVGesD.mjs} +309 -315
  15. package/browser/esm/{Qa4fAmu0jTRgpzKj.mjs → DQ3J4uNfIXgPKYoJ.mjs} +4 -10
  16. package/browser/esm/index.mjs +2 -2
  17. package/licenses/dependencies.txt +22 -22
  18. package/node/esm/{BnvW-oTnTTprwy5T.mjs → 4mi4tR_Wnw5gjYEb.mjs} +8 -13
  19. package/node/esm/BtNokzpAfQ4NDORx.mjs +14 -0
  20. package/node/esm/{DSBZsQA_mN68UsIn.mjs → CHn5nxfVUD9z6idt.mjs} +3 -9
  21. package/node/esm/{e681qu1_caFk4Ymu.mjs → D5AQfRIkPzleF5Ud.mjs} +1 -1
  22. package/node/esm/{k-nUdU0HR7EeOebA.mjs → DOzXoj7qdg53TENL.mjs} +2 -2
  23. package/node/esm/index.mjs +3 -9
  24. package/package.json +3 -3
  25. package/browser/cjs/DLR0X2oZPyo6cLlK.cjs +0 -6
  26. package/browser/cjs/ggqiJ7AVMR5OEJnW.cjs +0 -6
  27. package/browser/esm/DoJyfH8ar0VgQF35.mjs +0 -24
  28. package/node/esm/DZtDpK66kCXuqSiq.mjs +0 -14
@@ -1,11 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.2.6
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
- /**
8
- * @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.2.6
2
+ * @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.3.1
9
3
  *
10
4
  * (C) 2025-present SheetXL Inc. & Michael T. Ford
11
5
  * License: The license can be found at https://www.sheetxl.com/license.
@@ -15,30 +9,30 @@ Object.freeze(Object.defineProperty({ __proto__: null, EmptyBounds: Mt, EmptyRec
15
9
  const m = "column", j = "row", Rt = Object.freeze({ colIndex: 0, rowIndex: 0 }), At = Object.freeze({ colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 }), yt = (e, t) => e.colStart === t.colStart ? e.rowStart - t.rowStart : e.colStart - t.colStart, gt = (e, t) => e.rowStart === t.rowStart ? e.colStart - t.colStart : e.rowStart - t.rowStart, Ft = (e, t) => e.rowEnd === t.rowEnd ? t.colEnd - e.colEnd : t.rowEnd - e.rowEnd, Lt = (e, t) => e.colEnd === t.colEnd ? t.rowEnd - e.rowEnd : t.colEnd - e.colEnd, J = (e, t) => e.colIndex === t.colIndex ? e.rowIndex - t.rowIndex : e.colIndex - t.colIndex, H = (e, t) => e.rowIndex === t.rowIndex ? e.colIndex - t.colIndex : e.rowIndex - t.rowIndex, bt = (e = j, t = !1) => t ? e !== m ? Ft : Lt : e !== m ? gt : yt, Y = (e, t) => e === t || !(!e || !t) && e.rowIndex === t.rowIndex && e.colIndex === t.colIndex, D = (e, t) => e === t || !(!e || !t) && e.rowStart === t.rowStart && e.rowEnd === t.rowEnd && e.colStart === t.colStart && e.colEnd === t.colEnd, $ = (e, t) => !(!e || !t || e.colStart > t.colEnd || t.colStart > e.colEnd || e.rowStart > t.rowEnd || t.rowStart > e.rowEnd), K = (e, t) => {
16
10
  if (e === t) return !0;
17
11
  if (!e || !t || e.length !== t.length) return !1;
18
- for (let r = 0; r < e.length; r++) if (!D(e[r], t[r])) return !1;
12
+ for (let n = 0; n < e.length; n++) if (!D(e[n], t[n])) return !1;
19
13
  return !0;
20
- }, U = (e, t, r) => {
14
+ }, U = (e, t, n) => {
21
15
  if (!e && !t) return null;
22
- if (!e) return r ? t : { ...t };
23
- if (!t) return r ? e : { ...e };
24
- 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);
25
- let l = r;
26
- return l ? (l.colStart = n, l.rowStart = o, l.colEnd = a, l.rowEnd = i) : l = { colStart: n, rowStart: o, colEnd: a, rowEnd: i }, l;
16
+ if (!e) return n ? t : { ...t };
17
+ if (!t) return n ? e : { ...e };
18
+ const r = 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 = n;
20
+ return l ? (l.colStart = r, l.rowStart = o, l.colEnd = a, l.rowEnd = i) : l = { colStart: r, rowStart: o, colEnd: a, rowEnd: i }, l;
27
21
  }, Z = (e, t) => {
28
22
  if (!t || t.length === 0) return e;
29
- const r = { ...e };
30
- for (let n = 0; n < t.length; n++) {
31
- const o = t[n];
32
- $(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));
23
+ const n = { ...e };
24
+ for (let r = 0; r < t.length; r++) {
25
+ const o = t[r];
26
+ $(n, o) && (n.rowStart = Math.min(n.rowStart, o.rowStart), n.colStart = Math.min(n.colStart, o.colStart), n.rowEnd = Math.max(n.rowEnd, o.rowEnd), n.colEnd = Math.max(n.colEnd, o.colEnd));
33
27
  }
34
- return r;
35
- }, Ut = [null, null], Pt = (e, t, r) => {
28
+ return n;
29
+ }, Ut = [null, null], Pt = (e, t, n) => {
36
30
  if (e[0].value === e[1].value) return t;
37
31
  };
38
- function X(e, t = 2, r, n = j, o) {
32
+ function X(e, t = 2, n, r = j, o) {
39
33
  let a = [...e];
40
34
  if (t <= 0 || e.length <= 1) return a;
41
- let i = n === m, l = 0, s = !1;
35
+ let i = r === m, l = 0, s = !1;
42
36
  do {
43
37
  const c = a.sort(bt(i ? j : m));
44
38
  a = [], a.push(c[0]);
@@ -49,9 +43,9 @@ function X(e, t = 2, r, n = j, o) {
49
43
  let G = !1;
50
44
  if (G = i ? u && p === g.rowStart && O === g.rowEnd && x + 1 === g.colStart : u && f === g.colStart && x === g.colEnd && O + 1 === g.rowStart, G) {
51
45
  let S = { colStart: f, rowStart: p, colEnd: i ? g.colEnd : x, rowEnd: i ? O : g.rowEnd };
52
- if (u.value !== void 0 && (S.value = u.value), r) {
46
+ if (u.value !== void 0 && (S.value = u.value), n) {
53
47
  const F = o ?? [null, null];
54
- F[0] = u, F[1] = g, S = r(F, S, n);
48
+ F[0] = u, F[1] = g, S = n(F, S, r);
55
49
  }
56
50
  if (S) {
57
51
  a[w] = S, s = !0, u = S, f = u.colStart, p = u.rowStart, x = u.colEnd, O = u.rowEnd;
@@ -66,11 +60,11 @@ function X(e, t = 2, r, n = j, o) {
66
60
  }
67
61
  Object.freeze(Object.defineProperty({ __proto__: null, EmptyCell: Rt, EmptyRange: At, cellToRange: (e, t) => {
68
62
  if (!e) return null;
69
- let r = t;
70
- 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;
71
- }, 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) => {
72
- const r = [];
73
- let n, o, a = Number.MIN_SAFE_INTEGER, i = Number.MIN_SAFE_INTEGER;
63
+ let n = t;
64
+ return n || (n = { ...e }, delete n.colIndex, delete n.rowIndex), n.colStart = e.colIndex ?? 0, n.rowStart = e.rowIndex ?? 0, n.colEnd = e.colIndex ?? 0, n.rowEnd = e.rowIndex ?? 0, n;
65
+ }, columnFirstCellComparator: J, columnFirstRangeComparator: yt, createCellComparator: (e = j, t = !1) => t ? e !== m ? (n, r) => n.rowIndex === r.rowIndex ? r.colIndex - n.colIndex : r.rowIndex - n.rowIndex : (n, r) => n.colIndex === r.colIndex ? r.rowIndex - n.rowIndex : r.colIndex - n.colIndex : e !== m ? H : J, createConflatingRanges: (e, t = !1) => {
66
+ const n = [];
67
+ let r, o, a = Number.MIN_SAFE_INTEGER, i = Number.MIN_SAFE_INTEGER;
74
68
  return { append: (l, s, c) => {
75
69
  let d = !0;
76
70
  const w = c !== void 0;
@@ -78,55 +72,55 @@ Object.freeze(Object.defineProperty({ __proto__: null, EmptyCell: Rt, EmptyRange
78
72
  const p = e ? e(o, c, t) : o === c ? c : void 0;
79
73
  p === void 0 ? d = !1 : c = p;
80
74
  }
81
- if (d && s === i + 1 && l === a) return t ? n.rowEnd = s : n.colEnd = s, i = s, void (o = c);
82
- n && r.push(n);
75
+ if (d && s === i + 1 && l === a) return t ? r.rowEnd = s : r.colEnd = s, i = s, void (o = c);
76
+ r && n.push(r);
83
77
  const u = t ? l : s, f = t ? s : l;
84
- n = { colStart: u, rowStart: f, colEnd: u, rowEnd: f }, w && (n.value = c), a = l, i = s, o = c;
85
- }, done: (l) => (n && (r.push(n), n = null), l ? X(r, 3, l === !0 ? Pt : l, t ? m : j, Ut) : r) };
86
- }, 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) => {
78
+ r = { colStart: u, rowStart: f, colEnd: u, rowEnd: f }, w && (r.value = c), a = l, i = s, o = c;
79
+ }, done: (l) => (r && (n.push(r), r = null), l ? X(n, 3, l === !0 ? Pt : l, t ? m : j, Ut) : n) };
80
+ }, createRangeComparator: bt, defaultRange: (e, t, n) => e ? n ? (n.colStart = e.colStart ?? t.colStart, n.rowStart = e.rowStart ?? t.rowStart, n.colEnd = e.colEnd ?? t.colEnd, n.rowEnd = e.rowEnd ?? t.rowEnd, n) : { colStart: e.colStart ?? t.colStart, rowStart: e.rowStart ?? t.rowStart, colEnd: e.colEnd ?? t.colEnd, rowEnd: e.rowEnd ?? t.rowEnd } : t, extendRangeToIntersectingRanges: Z, extendRangeToUnionRanges: (e, t) => {
87
81
  if (!t || t.length === 0) return e;
88
- let r = e, n = null;
89
- for (; !D(r, n); ) n = r, r = Z(n, t);
90
- return r;
82
+ let n = e, r = null;
83
+ for (; !D(n, r); ) r = n, n = Z(r, t);
84
+ return n;
91
85
  }, indexOfCoords: (e, t) => {
92
- const r = { colStart: e.colIndex, rowStart: e.rowIndex, colEnd: e.colIndex, rowEnd: e.rowIndex };
93
- for (let n = t.length - 1; n >= 0; n--) if ($(r, t[n])) return n;
86
+ const n = { colStart: e.colIndex, rowStart: e.rowIndex, colEnd: e.colIndex, rowEnd: e.rowIndex };
87
+ for (let r = t.length - 1; r >= 0; r--) if ($(n, t[r])) return r;
94
88
  return -1;
95
- }, intersectRanges: (e, t, r) => {
96
- if (!e) return r ? t : { ...t };
97
- if (!t) return r ? e : { ...e };
89
+ }, intersectRanges: (e, t, n) => {
90
+ if (!e) return n ? t : { ...t };
91
+ if (!t) return n ? e : { ...e };
98
92
  if (!e && !t || e.rowStart > t.rowEnd || e.rowEnd < t.rowStart || e.colStart > t.colEnd || e.colEnd < t.colStart) return null;
99
- 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);
100
- let l = r;
101
- return l ? (l.colStart = n, l.rowStart = o, l.colEnd = a, l.rowEnd = i) : l = { colStart: n, rowStart: o, colEnd: a, rowEnd: i }, l;
102
- }, isCellWithinRange: (e, t) => !(!e || !t || e.rowIndex < t.rowStart || e.rowIndex > t.rowEnd || e.colIndex < t.colStart || e.colIndex > t.colEnd), isEqualCells: Y, isEqualRanges: D, isEqualRangesArrays: K, isEqualSelectionCoords: (e, t) => e === t || !(!e || !t) && e.rangeIndex === t.rangeIndex && !!Y(e.cell, t.cell) && K(e.ranges, t.ranges), isRangeWithinRange: (e, t) => !(e.rowStart < t.rowStart || e.rowEnd > t.rowEnd || e.colStart < t.colStart || e.colEnd > t.colEnd), isRangesIntersect: $, isSingleCell: (e) => !!e && e.rowEnd === e.rowStart && e.colStart === e.colEnd, isValidRange: (e) => !(!e || typeof e.colStart != "number" || e.colStart < 0 || typeof e.colEnd != "number" || e.colEnd < e.colStart || typeof e.rowStart != "number" || e.rowStart < 0 || typeof e.rowEnd != "number" || e.rowEnd < e.rowStart), mergeRangedValues: X, rowFirstCellComparator: H, rowFirstRangeComparator: gt, sanitizeRange: (e) => e ? { colStart: e.colIndex ?? e.colStart ?? 0, rowStart: e.rowIndex ?? e.rowStart ?? 0, colEnd: e.colIndex ?? e.colEnd ?? 0, rowEnd: e.rowIndex ?? e.rowEnd ?? 0 } : null, translateRange: (e, t = -e.rowStart, 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) => {
93
+ const r = Math.max(e.colStart, t.colStart), o = Math.max(e.rowStart, t.rowStart), a = Math.min(e.colEnd, t.colEnd), i = Math.min(e.rowEnd, t.rowEnd);
94
+ let l = n;
95
+ return l ? (l.colStart = r, l.rowStart = o, l.colEnd = a, l.rowEnd = i) : l = { colStart: r, rowStart: o, colEnd: a, rowEnd: i }, l;
96
+ }, isCellWithinRange: (e, t) => !(!e || !t || e.rowIndex < t.rowStart || e.rowIndex > t.rowEnd || e.colIndex < t.colStart || e.colIndex > t.colEnd), isEqualCells: Y, isEqualRanges: D, isEqualRangesArrays: K, isEqualSelectionCoords: (e, t) => e === t || !(!e || !t) && e.rangeIndex === t.rangeIndex && !!Y(e.cell, t.cell) && K(e.ranges, t.ranges), isRangeWithinRange: (e, t) => !(e.rowStart < t.rowStart || e.rowEnd > t.rowEnd || e.colStart < t.colStart || e.colEnd > t.colEnd), isRangesIntersect: $, isSingleCell: (e) => !!e && e.rowEnd === e.rowStart && e.colStart === e.colEnd, isValidRange: (e) => !(!e || typeof e.colStart != "number" || e.colStart < 0 || typeof e.colEnd != "number" || e.colEnd < e.colStart || typeof e.rowStart != "number" || e.rowStart < 0 || typeof e.rowEnd != "number" || e.rowEnd < e.rowStart), mergeRangedValues: X, rowFirstCellComparator: H, rowFirstRangeComparator: gt, sanitizeRange: (e) => e ? { colStart: e.colIndex ?? e.colStart ?? 0, rowStart: e.rowIndex ?? e.rowStart ?? 0, colEnd: e.colIndex ?? e.colEnd ?? 0, rowEnd: e.rowIndex ?? e.rowEnd ?? 0 } : null, translateRange: (e, t = -e.rowStart, n = -e.colStart, r) => r ? (r.colStart = e.colStart + n, r.rowStart = e.rowStart + t, r.colEnd = e.colEnd + n, r.rowEnd = e.rowEnd + t, r) : { colStart: e.colStart + n, rowStart: e.rowStart + t, colEnd: e.colEnd + n, rowEnd: e.rowEnd + t }, unionRanges: U, unionRangesArrays: (e, t, n) => {
103
97
  if (!e || e.length === 0) return null;
104
98
  if (e.length === 1 && !t) return e[0];
105
- let n = e[0];
106
- for (let o = 1; o < e.length; o++) n = U(n, e[o], r);
107
- return t && (n = U(n, t, r)), n;
99
+ let r = e[0];
100
+ for (let o = 1; o < e.length; o++) r = U(r, e[o], n);
101
+ return t && (r = U(r, t, n)), r;
108
102
  } }, Symbol.toStringTag, { value: "Module" }));
109
103
  const kt = typeof Symbol == "function" && Symbol.for ? Symbol.for("react.element") : 60103;
110
104
  function Nt(e) {
111
105
  return /* @__PURE__ */ function(t) {
112
106
  return !!t && typeof t == "object";
113
107
  }(e) && !function(t) {
114
- const r = Object.prototype.toString.call(t);
115
- return r === "[object RegExp]" || r === "[object Date]" || t.$$typeof === kt;
108
+ const n = Object.prototype.toString.call(t);
109
+ return n === "[object RegExp]" || n === "[object Date]" || t.$$typeof === kt;
116
110
  }(e);
117
111
  }
118
112
  function I(e, t) {
119
- return t.clone !== !1 && t.isMergeableObject(e) ? E((r = e, Array.isArray(r) ? [] : {}), e, t) : e;
120
- var r;
113
+ return t.clone !== !1 && t.isMergeableObject(e) ? E((n = e, Array.isArray(n) ? [] : {}), e, t) : e;
114
+ var n;
121
115
  }
122
- function Bt(e, t, r) {
123
- return e.concat(t).map(function(n) {
124
- return I(n, r);
116
+ function Bt(e, t, n) {
117
+ return e.concat(t).map(function(r) {
118
+ return I(r, n);
125
119
  });
126
120
  }
127
121
  function Q(e) {
128
- return Object.keys(e).concat((t = e, Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(t).filter(function(r) {
129
- return Object.propertyIsEnumerable.call(t, r);
122
+ return Object.keys(e).concat((t = e, Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(t).filter(function(n) {
123
+ return Object.propertyIsEnumerable.call(t, n);
130
124
  }) : []));
131
125
  var t;
132
126
  }
@@ -137,10 +131,10 @@ function tt(e, t) {
137
131
  return !1;
138
132
  }
139
133
  }
140
- function E(e, t, r) {
141
- (r = r || {}).arrayMerge = r.arrayMerge || Bt, r.isMergeableObject = r.isMergeableObject || Nt, r.cloneUnlessOtherwiseSpecified = I;
142
- const n = Array.isArray(t);
143
- return n === Array.isArray(e) ? n ? r.arrayMerge(e, t, r) : function(o, a, i) {
134
+ function E(e, t, n) {
135
+ (n = n || {}).arrayMerge = n.arrayMerge || Bt, n.isMergeableObject = n.isMergeableObject || Nt, n.cloneUnlessOtherwiseSpecified = I;
136
+ const r = Array.isArray(t);
137
+ return r === Array.isArray(e) ? r ? n.arrayMerge(e, t, n) : function(o, a, i) {
144
138
  const l = {};
145
139
  return i.isMergeableObject(o) && Q(o).forEach(function(s) {
146
140
  l[s] = I(o[s], i);
@@ -152,31 +146,31 @@ function E(e, t, r) {
152
146
  return typeof f == "function" ? f : E;
153
147
  }(s, i)(o[s], a[s], i) : l[s] = I(a[s], i));
154
148
  }), l;
155
- }(e, t, r) : I(t, r);
149
+ }(e, t, n) : I(t, n);
156
150
  }
157
151
  E.all = function(e, t) {
158
152
  if (!Array.isArray(e)) throw new Error("first argument should be an array");
159
- return e.reduce(function(r, n) {
160
- return E(r, n, t);
153
+ return e.reduce(function(n, r) {
154
+ return E(n, r, t);
161
155
  }, {});
162
156
  };
163
157
  const zt = Object.freeze([]), qt = Object.freeze({}), et = (e) => e, R = () => "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
164
158
  let t = 16 * Math.random() | 0;
165
159
  return (e === "x" ? t : 3 & t | 8).toString(16);
166
- }), mt = (e, t) => e === t || !(!Array.isArray(e) || !Array.isArray(t) || e.length !== t.length) && e.every((r, n) => r === t[n]), _ = (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) {
160
+ }), mt = (e, t) => e === t || !(!Array.isArray(e) || !Array.isArray(t) || e.length !== t.length) && e.every((n, r) => n === t[r]), _ = (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) {
167
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];
168
- }), Object.keys(e).length === 0 ? null : e), Dt = (e, t) => !(e !== t && !mt(e, t) && !e.isEqual?.(t)), St = (e, t, r = Dt) => {
162
+ }), Object.keys(e).length === 0 ? null : e), Dt = (e, t) => !(e !== t && !mt(e, t) && !e.isEqual?.(t)), St = (e, t, n = Dt) => {
169
163
  if (e == null || e === t) return null;
170
- if (!e || typeof e != "object" || Array.isArray(e) || e.isImmutable?.()) return r(e, t) ? null : e;
171
- const n = Object.keys(e);
172
- if (n.length === 0) return null;
164
+ if (!e || typeof e != "object" || Array.isArray(e) || e.isImmutable?.()) return n(e, t) ? null : e;
165
+ const r = Object.keys(e);
166
+ if (r.length === 0) return null;
173
167
  let o = !1;
174
- for (let a = 0; a < n.length; a++) {
175
- const i = n[a];
176
- St(e[i], t?.[i], r) === null && (o = !0, delete e[i]);
168
+ for (let a = 0; a < r.length; a++) {
169
+ const i = r[a];
170
+ St(e[i], t?.[i], n) === null && (o = !0, delete e[i]);
177
171
  }
178
172
  return o && Object.keys(e).length === 0 ? null : void 0;
179
- }, 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 = () => {
173
+ }, nt = typeof performance == "object" && typeof performance.now == "function" ? () => performance.now() : () => Date.now(), rt = (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 = () => {
180
174
  if (vt()) return y.Node;
181
175
  const e = globalThis.navigator !== void 0 && globalThis.navigator.userAgent ? globalThis.navigator.userAgent.toLowerCase() : "";
182
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;
@@ -184,282 +178,282 @@ const zt = Object.freeze([]), qt = Object.freeze({}), et = (e) => e, R = () => "
184
178
  function vt() {
185
179
  return typeof process < "u" && process.release?.name === "node" || (typeof process < "u" && process.browser, !1);
186
180
  }
187
- 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) {
188
- const n = e.slice();
189
- return n.splice(r < 0 ? n.length + r : r, 0, n.splice(t, 1)[0]), n;
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, n) {
182
+ const r = e.slice();
183
+ return r.splice(n < 0 ? r.length + n : n, 0, r.splice(t, 1)[0]), r;
190
184
  }, asNumber: (e) => {
191
- const t = ((r) => 1 * r)(e);
185
+ const t = ((n) => 1 * n)(e);
192
186
  return Number.isFinite(t) ? t : 0;
193
187
  }, camelToPrettyCase: (e) => e.length === 1 ? e.toUpperCase() : e.replace(/([A-Z])/g, " $1").replace(/^./, function(t) {
194
188
  return t.toUpperCase();
195
189
  }).trim(), canUseDOM: at, cancelTimeout: (e) => {
196
190
  cancelAnimationFrame(e.id);
197
- }, 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) => {
191
+ }, castToString: (e) => e == null || e === void 0 ? "" : typeof e != "string" ? "" + e : e, cloneObject: (e) => rt(e) ? e : JSON.parse(JSON.stringify(e)), consoleWithNoSource: (...e) => new Promise((t) => {
198
192
  setTimeout(() => {
199
193
  Function("console.log.apply(console, arguments)").apply(null, e), t();
200
194
  });
201
- }), debounce: function(e, t = 300, r = !1) {
202
- let n, o, a, i, l = 0;
195
+ }), debounce: function(e, t = 300, n = !1) {
196
+ let r, o, a, i, l = 0;
203
197
  function s() {
204
198
  let d = Date.now() - l;
205
- d < t && d >= 0 ? n = setTimeout(s, t - d) : (n = null, r || (i = e.apply(a, o), a = o = null));
199
+ d < t && d >= 0 ? r = setTimeout(s, t - d) : (r = null, n || (i = e.apply(a, o), a = o = null));
206
200
  }
207
201
  t == null && (t = 100);
208
202
  const c = function() {
209
203
  a = globalThis, o = arguments, l = Date.now();
210
- var d = r && !n;
211
- return n || (n = setTimeout(s, t)), d && (i = e.apply(a, o), a = o = null), i;
204
+ var d = n && !r;
205
+ return r || (r = setTimeout(s, t)), d && (i = e.apply(a, o), a = o = null), i;
212
206
  };
213
207
  return c.clear = function() {
214
- n && (clearTimeout(n), n = null);
208
+ r && (clearTimeout(r), r = null);
215
209
  }, c.flush = function() {
216
- n && (i = e.apply(a, o), a = o = null, clearTimeout(n), n = null);
210
+ r && (i = e.apply(a, o), a = o = null, clearTimeout(r), r = null);
217
211
  }, c;
218
- }, deepEqual: function e(t, r) {
219
- if (t === r) return !0;
220
- if (t && r && typeof t == "object" && typeof r == "object") {
221
- if (t.constructor !== r.constructor) return !1;
222
- let n, o, a;
212
+ }, deepEqual: function e(t, n) {
213
+ if (t === n) return !0;
214
+ if (t && n && typeof t == "object" && typeof n == "object") {
215
+ if (t.constructor !== n.constructor) return !1;
216
+ let r, o, a;
223
217
  if (Array.isArray(t)) {
224
- if (n = t.length, n != r.length) return !1;
225
- for (o = n; o-- !== 0; ) if (!e(t[o], r[o])) return !1;
218
+ if (r = t.length, r != n.length) return !1;
219
+ for (o = r; o-- !== 0; ) if (!e(t[o], n[o])) return !1;
226
220
  return !0;
227
221
  }
228
- if (t instanceof Map && r instanceof Map) {
229
- if (t.size !== r.size) return !1;
230
- for (o of t.entries()) if (!r.has(o[0])) return !1;
231
- for (o of t.entries()) if (!e(o[1], r.get(o[0]))) return !1;
222
+ if (t instanceof Map && n instanceof Map) {
223
+ if (t.size !== n.size) return !1;
224
+ for (o of t.entries()) if (!n.has(o[0])) return !1;
225
+ for (o of t.entries()) if (!e(o[1], n.get(o[0]))) return !1;
232
226
  return !0;
233
227
  }
234
- if (t instanceof Set && r instanceof Set) {
235
- if (t.size !== r.size) return !1;
236
- for (o of t.entries()) if (!r.has(o[0])) return !1;
228
+ if (t instanceof Set && n instanceof Set) {
229
+ if (t.size !== n.size) return !1;
230
+ for (o of t.entries()) if (!n.has(o[0])) return !1;
237
231
  return !0;
238
232
  }
239
- if (ArrayBuffer.isView(t) && ArrayBuffer.isView(r)) {
240
- if (n = t.length, n != r.length) return !1;
241
- for (o = n; o-- !== 0; ) if (t[o] !== r[o]) return !1;
233
+ if (ArrayBuffer.isView(t) && ArrayBuffer.isView(n)) {
234
+ if (r = t.length, r != n.length) return !1;
235
+ for (o = r; o-- !== 0; ) if (t[o] !== n[o]) return !1;
242
236
  return !0;
243
237
  }
244
- if (t.constructor === RegExp) return t.source === r.source && t.flags === r.flags;
245
- if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === r.valueOf();
246
- if (t.toString !== Object.prototype.toString) return t.toString() === r.toString();
247
- if (a = Object.keys(t), n = a.length, n !== Object.keys(r).length) return !1;
248
- for (o = n; o-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(r, a[o])) return !1;
249
- for (o = n; o-- !== 0; ) {
238
+ if (t.constructor === RegExp) return t.source === n.source && t.flags === n.flags;
239
+ if (t.valueOf !== Object.prototype.valueOf) return t.valueOf() === n.valueOf();
240
+ if (t.toString !== Object.prototype.toString) return t.toString() === n.toString();
241
+ if (a = Object.keys(t), r = a.length, r !== Object.keys(n).length) return !1;
242
+ for (o = r; o-- !== 0; ) if (!Object.prototype.hasOwnProperty.call(n, a[o])) return !1;
243
+ for (o = r; o-- !== 0; ) {
250
244
  let i = a[o];
251
- if (!(i === "_owner" && t.$$typeof || e(t[i], r[i]))) return !1;
245
+ if (!(i === "_owner" && t.$$typeof || e(t[i], n[i]))) return !1;
252
246
  }
253
247
  return !0;
254
248
  }
255
- return t != t && r != r;
249
+ return t != t && n != n;
256
250
  }, deepFreeze: function e(t) {
257
- return Object.freeze(t), Object.keys(t).forEach((r) => {
258
- typeof t[r] != "object" || t[r] === null || Object.isFrozen(t[r]) || e(t[r]);
251
+ return Object.freeze(t), Object.keys(t).forEach((n) => {
252
+ typeof t[n] != "object" || t[n] === null || Object.isFrozen(t[n]) || e(t[n]);
259
253
  }), t;
260
254
  }, deepMerge: E, diffValues: (e, t) => {
261
- const r = {}, n = Object.keys(t), o = n.length;
255
+ const n = {}, r = Object.keys(t), o = r.length;
262
256
  for (let a = 0; a < o; a++) {
263
- const i = n[a];
264
- e[i] !== t[i] && (e[i] === void 0 ? r[i] = t[i] : r[i] = e[i]);
265
- }
266
- return Object.keys(r).length === 0 ? null : r;
267
- }, findEqualOrGreater: function(e, t, r = et) {
268
- let n = 0, o = e.length - 1;
269
- for (; n <= o; ) {
270
- let a = Math.floor((n + o) / 2), i = r(e[a]);
257
+ const i = r[a];
258
+ e[i] !== t[i] && (e[i] === void 0 ? n[i] = t[i] : n[i] = e[i]);
259
+ }
260
+ return Object.keys(n).length === 0 ? null : n;
261
+ }, findEqualOrGreater: function(e, t, n = et) {
262
+ let r = 0, o = e.length - 1;
263
+ for (; r <= o; ) {
264
+ let a = Math.floor((r + o) / 2), i = n(e[a]);
271
265
  if (i === t) return a;
272
- i < t ? n = a + 1 : o = a - 1;
266
+ i < t ? r = a + 1 : o = a - 1;
273
267
  }
274
- return n;
275
- }, findEqualOrLesser: function(e, t, r = et) {
276
- let n = e.length - 1, o = 0;
277
- for (; n >= o; ) {
278
- let a = Math.floor((n + o) / 2), i = r(e[a]);
268
+ return r;
269
+ }, findEqualOrLesser: function(e, t, n = et) {
270
+ let r = e.length - 1, o = 0;
271
+ for (; r >= o; ) {
272
+ let a = Math.floor((r + o) / 2), i = n(e[a]);
279
273
  if (i === t) return a;
280
- i > t ? n = a - 1 : o = a + 1;
274
+ i > t ? r = a - 1 : o = a + 1;
281
275
  }
282
- return n;
283
- }, findNextStep: (e, t = !0, r = 15, n = 10, o = 400) => {
284
- const a = Math.max(e - n, 0) + (t ? 1 : -1);
285
- return Math.min(o, Math[t ? "ceil" : "floor"](a / r) * r + n);
286
- }, getBuildEnv: () => "browser2-build", getDPI: () => {
276
+ return r;
277
+ }, findNextStep: (e, t = !0, n = 15, r = 10, o = 400) => {
278
+ const a = Math.max(e - r, 0) + (t ? 1 : -1);
279
+ return Math.min(o, Math[t ? "ceil" : "floor"](a / n) * n + r);
280
+ }, getDPI: () => {
287
281
  let e = 1;
288
282
  return typeof window == "object" && (e = window.devicePixelRatio || 1), e;
289
283
  }, getFromPath: (e, t) => {
290
- const r = t.split(".");
291
- let n = e;
292
- for (let o = 0; o < r.length; o++) {
293
- const a = r[o];
294
- if (!n) return null;
295
- let i = n[a];
296
- if (typeof i == "function" && (i = i.bind(n)()), !i || !_(i)) return i;
297
- n = i;
298
- }
299
- return n ?? null;
284
+ const n = t.split(".");
285
+ let r = e;
286
+ for (let o = 0; o < n.length; o++) {
287
+ const a = n[o];
288
+ if (!r) return null;
289
+ let i = r[a];
290
+ if (typeof i == "function" && (i = i.bind(r)()), !i || !_(i)) return i;
291
+ r = i;
292
+ }
293
+ return r ?? null;
300
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) => {
301
295
  if (e === t) return !0;
302
296
  if (e && !t || t && !e) return !1;
303
- const r = Object.keys(e);
304
- if (r.length !== Object.keys(t).length) return !1;
305
- for (let n = 0; n < r.length; n++) if (e[r[n]] !== t[r[n]]) return !1;
297
+ const n = Object.keys(e);
298
+ if (n.length !== Object.keys(t).length) return !1;
299
+ for (let r = 0; r < n.length; r++) if (e[n[r]] !== t[n[r]]) return !1;
306
300
  return !0;
307
- }, isNode: vt, isNullOrUndefined: nt, isNumeric: (e) => {
301
+ }, isNode: vt, isNullOrUndefined: rt, isNumeric: (e) => {
308
302
  const t = 1 * e;
309
303
  return Number.isFinite(t) && typeof t == "number";
310
304
  }, isObject: _, 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) => {
311
305
  const t = e.length;
312
306
  if (t > 0 && e[t - 1] !== void 0 && !_(e[t - 1])) return e[t - 1];
313
- let r = e[0] || {};
314
- for (let n = 1; n < t; n++) r = E(r, e[n] || {}, { arrayMerge: (o, a) => [...a] });
315
- return r;
307
+ let n = e[0] || {};
308
+ for (let r = 1; r < t; r++) n = E(n, e[r] || {}, { arrayMerge: (o, a) => [...a] });
309
+ return n;
316
310
  }, nextTick: (e) => {
317
311
  typeof window < "u" && typeof window.requestAnimationFrame == "function" ? window.requestAnimationFrame(() => {
318
312
  e();
319
313
  }) : (typeof setImmediate == "function" ? setImmediate : setTimeout)(() => {
320
314
  e();
321
315
  });
322
- }, openFileDialog: (e = "*.*") => new Promise((t, r) => {
323
- if (!at) return void r("Unable to open dialog with no dom.");
324
- const n = document.createElement("input");
325
- n.type = "file", n.accept = e;
316
+ }, openFileDialog: (e = "*.*") => new Promise((t, n) => {
317
+ if (!at) return void n("Unable to open dialog with no dom.");
318
+ const r = document.createElement("input");
319
+ r.type = "file", r.accept = e;
326
320
  let o = null, a = !1;
327
321
  globalThis.addEventListener?.("focus", () => {
328
322
  setTimeout(() => {
329
323
  o || a || (a = !0, t(null));
330
324
  }, 1e3);
331
- }, { once: !0, passive: !0 }), n.onchange = () => {
332
- if (o = n.files[0], o) {
325
+ }, { once: !0, passive: !0 }), r.onchange = () => {
326
+ if (o = r.files[0], o) {
333
327
  if (a) return void console.warn("File open detected after faux cancel.", o);
334
328
  t(o);
335
329
  }
336
- }, n.autofocus = !0, n.click();
330
+ }, r.autofocus = !0, r.click();
337
331
  }), rafThrottle: (e) => {
338
- let t, r = !1, n = function() {
339
- r = !1, e(t);
332
+ let t, n = !1, r = function() {
333
+ n = !1, e(t);
340
334
  };
341
335
  return function(o) {
342
- t = o, t && t.persist && t.persist(), r || (r = !0, requestAnimationFrame(n));
336
+ t = o, t && t.persist && t.persist(), n || (n = !0, requestAnimationFrame(r));
343
337
  };
344
338
  }, removeEmptyProperties: Et, removeEqualValues: St, removeListenerAll: (e) => {
345
339
  if (!e) return [];
346
340
  for (let t = 0; t < e.length; t++) e[t] && e[t]();
347
341
  return [];
348
342
  }, requestTimeout: (e, t) => {
349
- const r = rt(), n = { id: requestAnimationFrame(function o() {
350
- rt() - r >= t ? e.call(null) : n.id = requestAnimationFrame(o);
343
+ const n = nt(), r = { id: requestAnimationFrame(function o() {
344
+ nt() - n >= t ? e.call(null) : r.id = requestAnimationFrame(o);
351
345
  }) };
352
- return n;
346
+ return r;
353
347
  }, roundAccurately: (e, t = 0) => {
354
348
  if (e == null || !isFinite(e)) return null;
355
- const r = 10 ** t;
356
- return Number(Math.round(e * r) / r);
357
- }, setToPath: (e, t, r) => {
358
- const n = t.split(".");
349
+ const n = 10 ** t;
350
+ return Number(Math.round(e * n) / n);
351
+ }, setToPath: (e, t, n) => {
352
+ const r = t.split(".");
359
353
  let o = e;
360
354
  if (!o) throw new Error("Can not set path to a null path.");
361
- for (let a = 0; o && a < n.length - 1; a++) {
362
- const i = n[a];
355
+ for (let a = 0; o && a < r.length - 1; a++) {
356
+ const i = r[a];
363
357
  let l = o[i];
364
358
  if (l == null && (l = {}, o[i] = l), !_(l)) throw new Error("Can not set path to a non object path.");
365
359
  o = l;
366
360
  }
367
- if (typeof r != "number" && typeof r != "boolean" && typeof r != "string" && !_(r)) throw new Error(`Can not set path to ${r} that is not a a supported primitive.`);
368
- return o[n[n.length - 1]] = r, e;
361
+ if (typeof n != "number" && typeof n != "boolean" && typeof n != "string" && !_(n)) throw new Error(`Can not set path to ${n} that is not a a supported primitive.`);
362
+ return o[r[r.length - 1]] = n, e;
369
363
  }, splitNumber: (e) => {
370
364
  let t = Math.abs(e);
371
365
  if (isNaN(t) || !isFinite(e)) return null;
372
- let r = 0 | t, n = t - r, o = 0, a = 0, i = 1;
373
- if (n > 5e-8) for (; a < 8 && Math.abs(o / i - n) > 5e-8; ) a++, i *= 10, o = Math.round(n * i);
374
- return { ip: Math.trunc(e), fp: o, ipLength: Math.ceil(Math.log10(r + 1)), fpLength: a };
375
- }, subtractRect: (e, t, r = !1) => {
366
+ let n = 0 | t, r = t - n, o = 0, a = 0, i = 1;
367
+ if (r > 5e-8) for (; a < 8 && Math.abs(o / i - r) > 5e-8; ) a++, i *= 10, o = Math.round(r * i);
368
+ return { ip: Math.trunc(e), fp: o, ipLength: Math.ceil(Math.log10(n + 1)), fpLength: a };
369
+ }, subtractRect: (e, t, n = !1) => {
376
370
  if (!t) return [e];
377
371
  if (!ot(e, t)) return [];
378
- const n = [];
372
+ const r = [];
379
373
  let o = e;
380
374
  const a = () => {
381
- t.top > o.top && t.top < o.bottom && (n.push({ ...o, bottom: t.top }), o = { ...o, top: t.top });
375
+ t.top > o.top && t.top < o.bottom && (r.push({ ...o, bottom: t.top }), o = { ...o, top: t.top });
382
376
  }, i = () => {
383
- t.bottom > o.top && t.bottom < o.bottom && (n.push({ ...o, top: t.bottom }), o = { ...o, bottom: t.bottom });
377
+ t.bottom > o.top && t.bottom < o.bottom && (r.push({ ...o, top: t.bottom }), o = { ...o, bottom: t.bottom });
384
378
  }, l = () => {
385
- t.right > o.left && t.right < o.right && (n.push({ ...o, left: t.right }), o = { ...o, right: t.right });
379
+ t.right > o.left && t.right < o.right && (r.push({ ...o, left: t.right }), o = { ...o, right: t.right });
386
380
  }, s = () => {
387
- t.left > o.left && t.left < o.right && (n.push({ ...o, right: t.left }), o = { ...o, left: t.left });
381
+ t.left > o.left && t.left < o.right && (r.push({ ...o, right: t.left }), o = { ...o, left: t.left });
388
382
  };
389
- return r ? (s(), l(), a(), i()) : (a(), i(), l(), s()), n;
383
+ return n ? (s(), l(), a(), i()) : (a(), i(), l(), s()), r;
390
384
  }, textToKey: (e) => e.replace(/[^a-zA-Z0-9]/g, "").toLowerCase(), throttle: function(e, t) {
391
- let r = null;
392
- return (...n) => {
385
+ let n = null;
386
+ return (...r) => {
393
387
  const o = Date.now();
394
- (!r || o - r >= t) && (r = o, e(...n));
388
+ (!n || o - n >= t) && (n = o, e(...r));
395
389
  };
396
390
  }, toSafeJSON: function e(t) {
397
391
  if (t === null || typeof t != "object") return t;
398
392
  if (typeof t.toJSON == "function") return t.toJSON();
399
- if (Array.isArray(t)) return t.map((n) => e(n));
393
+ if (Array.isArray(t)) return t.map((r) => e(r));
400
394
  if (typeof t.toString == "function" && t.toString !== Object.prototype.toString) return t.toString();
401
- const r = {};
402
- for (const n in t) t.hasOwnProperty(n) && (r[n] = e(t[n]));
403
- return r;
395
+ const n = {};
396
+ for (const r in t) t.hasOwnProperty(r) && (n[r] = e(t[r]));
397
+ return n;
404
398
  }, transpose: (e) => {
405
399
  if (!e) return e;
406
- const t = e.length, r = e[0].length, n = [];
407
- for (let o = 0; o < r; o++) n[o] = Array(t);
408
- for (let o = 0; o < t; o++) for (let a = 0; a < r; a++) n[a][o] = e[o][a];
409
- return n;
400
+ const t = e.length, n = e[0].length, r = [];
401
+ for (let o = 0; o < n; o++) r[o] = Array(t);
402
+ for (let o = 0; o < t; o++) for (let a = 0; a < n; a++) r[a][o] = e[o][a];
403
+ return r;
410
404
  }, uuidV4: R, validEnumValue: (e, t) => {
411
405
  if (!Object.values(e).includes(t)) throw new Error(`Invalid type: ${t ?? "null"}. Must be one of: ${Object.values(t).join(", ")}.`);
412
- }, whenFocus: async (e, t = !1) => new Promise((r) => {
413
- it(e, t) ? r(!0) : e.addEventListener("focusin", () => {
414
- r(!0);
406
+ }, whenFocus: async (e, t = !1) => new Promise((n) => {
407
+ it(e, t) ? n(!0) : e.addEventListener("focusin", () => {
408
+ n(!0);
415
409
  }, { once: !0 }), e.focus();
416
410
  }) }, Symbol.toStringTag, { value: "Module" }));
417
411
  Object.freeze(Object.defineProperty({ __proto__: null, MESSAGE_ERROR_INVALID_ARG: (e) => `Invalid argument: '${e}'.` }, Symbol.toStringTag, { value: "Module" }));
418
412
  const xt = (e) => {
419
- const t = new Uint8Array(e), r = t.byteLength;
420
- let n = "";
421
- for (let o = 0; o < r; o++) n += String.fromCharCode(t[o]);
422
- if (typeof window < "u" && typeof globalThis.btoa == "function") return globalThis.btoa(n);
423
- if (typeof Buffer < "u") return Buffer.from(n, "binary").toString("base64");
413
+ const t = new Uint8Array(e), n = t.byteLength;
414
+ let r = "";
415
+ for (let o = 0; o < n; o++) r += String.fromCharCode(t[o]);
416
+ if (typeof window < "u" && typeof globalThis.btoa == "function") return globalThis.btoa(r);
417
+ if (typeof Buffer < "u") return Buffer.from(r, "binary").toString("base64");
424
418
  throw new Error("Unsupported environment");
425
- }, W = (e) => new Promise((t, r) => {
419
+ }, W = (e) => new Promise((t, n) => {
426
420
  if (e) if (typeof FileReader < "u") {
427
- const n = new FileReader();
428
- n.onload = () => {
429
- t(n.result);
430
- }, n.onerror = () => {
431
- r(n.error);
432
- }, n.readAsText(e);
421
+ const r = new FileReader();
422
+ r.onload = () => {
423
+ t(r.result);
424
+ }, r.onerror = () => {
425
+ n(r.error);
426
+ }, r.readAsText(e);
433
427
  } else if (typeof Buffer < "u") {
434
- const n = (o) => Buffer.from(o).toString("utf-8");
428
+ const r = (o) => Buffer.from(o).toString("utf-8");
435
429
  e.arrayBuffer().then((o) => {
436
- t(n(o));
430
+ t(r(o));
437
431
  }).catch((o) => {
438
- r(o);
432
+ n(o);
439
433
  });
440
- } else r(new Error("Unsupported environment"));
434
+ } else n(new Error("Unsupported environment"));
441
435
  else t("");
442
436
  });
443
437
  Object.freeze(Object.defineProperty({ __proto__: null, DEFAULT_MIME_TYPE: "*/*", arrayBufferToBase64: xt, base64ToArrayBuffer: (e) => {
444
- 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);
445
- for (let o = 0; o < r; o++) n[o] = t.charCodeAt(o);
446
- return n.buffer;
438
+ const t = typeof window < "u" && typeof globalThis.atob == "function" ? globalThis.atob(e) : Buffer.from(e, "base64").toString("binary"), n = t.length, r = new Uint8Array(n);
439
+ for (let o = 0; o < n; o++) r[o] = t.charCodeAt(o);
440
+ return r.buffer;
447
441
  }, blobToString: W }, Symbol.toStringTag, { value: "Module" }));
448
- const Ot = "data:image/png;base64,", _t = "Unable to resolve image.", lt = (e) => new Promise(async (t, r) => {
449
- let n = null;
442
+ const Ot = "data:image/png;base64,", _t = "Unable to resolve image.", lt = (e) => new Promise(async (t, n) => {
443
+ let r = null;
450
444
  try {
451
- n = new Image(), n.src = e, n.addEventListener("load", function() {
452
- t({ width: n.naturalWidth, height: n.naturalHeight });
453
- }, { once: !0 }), n.addEventListener("error", function() {
454
- URL.revokeObjectURL(e), r("Invalid Image");
455
- }, { once: !0 }), await n.decode("sync");
445
+ r = new Image(), r.src = e, r.addEventListener("load", function() {
446
+ t({ width: r.naturalWidth, height: r.naturalHeight });
447
+ }, { once: !0 }), r.addEventListener("error", function() {
448
+ URL.revokeObjectURL(e), n("Invalid Image");
449
+ }, { once: !0 }), await r.decode("sync");
456
450
  } catch {
457
- n?.src && URL.revokeObjectURL(n.src);
451
+ r?.src && URL.revokeObjectURL(r.src);
458
452
  }
459
- n || r(_t);
453
+ r || n(_t);
460
454
  }), P = "image/svg+xml";
461
455
  var st, ct;
462
- Object.freeze(Object.defineProperty({ __proto__: null, DATA_URL_PNG_PREFIX: Ot, getImageDataUrl: (e, t = 1) => new Promise(async (r, n) => {
456
+ Object.freeze(Object.defineProperty({ __proto__: null, DATA_URL_PNG_PREFIX: Ot, getImageDataUrl: (e, t = 1) => new Promise(async (n, r) => {
463
457
  let o = null;
464
458
  try {
465
459
  o = new Image(), o.src = e, o.addEventListener("load", function() {
@@ -467,40 +461,40 @@ Object.freeze(Object.defineProperty({ __proto__: null, DATA_URL_PNG_PREFIX: Ot,
467
461
  const a = document.createElement("canvas");
468
462
  a.width = o.naturalWidth, a.height = o.naturalHeight, a.getContext("2d").drawImage(o, 0, 0);
469
463
  const i = a.toDataURL("image/png", t);
470
- r({ elemImg: o, dataUrl: i });
464
+ n({ elemImg: o, dataUrl: i });
471
465
  } catch (a) {
472
- URL.revokeObjectURL(e), n(a);
466
+ URL.revokeObjectURL(e), r(a);
473
467
  }
474
468
  }, { once: !0 }), o.addEventListener("error", function() {
475
- URL.revokeObjectURL(e), n("Invalid Image");
469
+ URL.revokeObjectURL(e), r("Invalid Image");
476
470
  }, { once: !0 }), await o.decode("sync");
477
471
  } catch {
478
472
  o?.src && URL.revokeObjectURL(o.src);
479
473
  }
480
- o || n(_t);
474
+ o || r(_t);
481
475
  }), loadImageDetails: async (e, t = null) => {
482
- let r = null;
483
- const n = async () => {
476
+ let n = null;
477
+ const r = async () => {
484
478
  try {
485
479
  const a = t ?? "image/*", i = URL.createObjectURL(new Blob([e], { type: a })), l = await lt(i);
486
- r = { mimeType: a, naturalDimensions: l, asUrl: i };
480
+ n = { mimeType: a, naturalDimensions: l, asUrl: i };
487
481
  } catch {
488
482
  }
489
483
  }, o = async () => {
490
484
  try {
491
485
  const a = new TextDecoder().decode(e), i = URL.createObjectURL(new Blob([a], { type: P })), l = await lt(i);
492
- r = { mimeType: t ?? P, naturalDimensions: l, asUrl: i, asSVGText: a };
486
+ n = { mimeType: t ?? P, naturalDimensions: l, asUrl: i, asSVGText: a };
493
487
  } catch {
494
488
  }
495
489
  };
496
- if (t === P ? await o() : t.startsWith("image/") ? await n() : (await n(), r || await o()), !r) throw new Error("Failed to load image");
497
- return r;
498
- } }, Symbol.toStringTag, { value: "Module" })), (ct = st || (st = {})).resolveTypedUpdates = (e, t, r, n) => {
490
+ if (t === P ? await o() : t.startsWith("image/") ? await r() : (await r(), n || await o()), !n) throw new Error("Failed to load image");
491
+ return n;
492
+ } }, Symbol.toStringTag, { value: "Module" })), (ct = st || (st = {})).resolveTypedUpdates = (e, t, n, r) => {
499
493
  if (e === null) return e;
500
- if (e === void 0) return n;
494
+ if (e === void 0) return r;
501
495
  let o = e;
502
496
  if (t?.shorthand) {
503
- const s = t?.shorthand(e, r);
497
+ const s = t?.shorthand(e, n);
504
498
  s !== void 0 && (o = s);
505
499
  }
506
500
  if (o !== null && t?.getSubType) {
@@ -509,17 +503,17 @@ Object.freeze(Object.defineProperty({ __proto__: null, DATA_URL_PNG_PREFIX: Ot,
509
503
  }
510
504
  const a = t?.properties, i = t?.arrayType ?? !1;
511
505
  let l = o;
512
- if (t && t.merge && l && n) l = t.merge(l, n, r);
506
+ if (t && t.merge && l && r) l = t.merge(l, r, n);
513
507
  else if (!i && a) {
514
- const s = Object.keys({ ...o, ...n });
508
+ const s = Object.keys({ ...o, ...r });
515
509
  l = null;
516
510
  for (let c = 0; c < s.length; c++) {
517
511
  const d = s[c];
518
512
  let w, u = o[d];
519
513
  if (u !== void 0) {
520
514
  const f = a[d];
521
- w = f ? (0, ct.resolveTypedUpdates)(u, f, r, n?.[d]) : u;
522
- } else w = n?.[d];
515
+ w = f ? (0, ct.resolveTypedUpdates)(u, f, n, r?.[d]) : u;
516
+ } else w = r?.[d];
523
517
  w != null && (l = l ?? {}, l[d] = w);
524
518
  }
525
519
  }
@@ -536,10 +530,10 @@ Please use Chrome or Edge if external copy and paste is required.`, Perms: k, Pe
536
530
  document.hasFocus() ? e() : globalThis.addEventListener?.("focus", () => {
537
531
  e();
538
532
  }, { once: !0 }), document.activeElement.focus?.();
539
- }), B = async (e, t, r) => {
540
- if (T() === y.Safari) return await r(new Error(It.Safari));
533
+ }), B = async (e, t, n) => {
534
+ if (T() === y.Safari) return await n(new Error(It.Safari));
541
535
  try {
542
- const n = async (i) => {
536
+ const r = async (i) => {
543
537
  try {
544
538
  return await i();
545
539
  } catch (l) {
@@ -548,9 +542,9 @@ Please use Chrome or Edge if external copy and paste is required.`, Perms: k, Pe
548
542
  }
549
543
  }, o = await globalThis?.navigator?.permissions?.query({ name: e, allowWithoutGesture: !0, allowWithoutSanitization: !0 });
550
544
  let a = !1;
551
- if (o.state === "prompt" && (a = await n(t)), a || o.state !== "granted" || (a = await t()), !a) return await r(new Error(o.state));
552
- } catch (n) {
553
- return n.message === "No valid data on clipboard" || n.name === "DataError" ? void 0 : await r(n);
545
+ if (o.state === "prompt" && (a = await r(t)), a || o.state !== "granted" || (a = await t()), !a) return await n(new Error(o.state));
546
+ } catch (r) {
547
+ return r.message === "No valid data on clipboard" || r.name === "DataError" ? void 0 : await n(r);
554
548
  }
555
549
  }, jt = async (e) => {
556
550
  try {
@@ -560,14 +554,14 @@ Please use Chrome or Edge if external copy and paste is required.`, Perms: k, Pe
560
554
  return await e.read();
561
555
  };
562
556
  if (!globalThis.ClipboardItem) {
563
- const e = (r, n) => new Blob([n], { type: r });
557
+ const e = (n, r) => new Blob([r], { type: n });
564
558
  class t {
565
- constructor(n, o) {
566
- this._items = {}, this._types = Object.keys(n);
567
- const a = {}, i = Object.keys(n);
559
+ constructor(r, o) {
560
+ this._items = {}, this._types = Object.keys(r);
561
+ const a = {}, i = Object.keys(r);
568
562
  for (let l = 0; l < i.length; l++) {
569
563
  const s = i[l];
570
- let c = n[s];
564
+ let c = r[s];
571
565
  a[s] = typeof c == "string" ? e(s, c) : c;
572
566
  }
573
567
  this._items = a, this._presentationStyle = o?.presentationStyle ?? "unspecified";
@@ -575,16 +569,16 @@ if (!globalThis.ClipboardItem) {
575
569
  get types() {
576
570
  return this._types;
577
571
  }
578
- getType(n) {
579
- return Promise.resolve(this._items[n]);
572
+ getType(r) {
573
+ return Promise.resolve(this._items[r]);
580
574
  }
581
- supports(n) {
575
+ supports(r) {
582
576
  return !0;
583
577
  }
584
578
  }
585
579
  globalThis.ClipboardItem = t;
586
580
  }
587
- const V = async (e, t = h) => new Promise(async (r, n) => {
581
+ const V = async (e, t = h) => new Promise(async (n, r) => {
588
582
  try {
589
583
  const o = await (async (a, i) => {
590
584
  if (!a) return null;
@@ -596,38 +590,38 @@ const V = async (e, t = h) => new Promise(async (r, n) => {
596
590
  if (o) {
597
591
  const a = new FileReader();
598
592
  a.onload = () => {
599
- r(a.result);
593
+ n(a.result);
600
594
  }, a.onerror = () => {
601
- r("");
595
+ n("");
602
596
  }, a.readAsText(o);
603
- } else r("");
597
+ } else n("");
604
598
  } catch (o) {
605
- n(o);
599
+ r(o);
606
600
  }
607
601
  }), dt = async (e, t = h) => {
608
- const r = await V(e, t);
609
- if (!r) return null;
610
- let n = null;
602
+ const n = await V(e, t);
603
+ if (!n) return null;
604
+ let r = null;
611
605
  try {
612
- n = new DOMParser().parseFromString(r, h);
606
+ r = new DOMParser().parseFromString(n, h);
613
607
  } catch {
614
608
  console.warn("Can't parse html from clipboard.");
615
609
  }
616
- return n;
610
+ return r;
617
611
  }, C = "clipboard-uuid", v = "web text/uuid", ft = (e) => `<div style="display:none" ${C}="${e}"/>`, Wt = (e, t) => {
618
- let r = null;
612
+ let n = null;
619
613
  try {
620
- const n = new DOMParser().parseFromString(t, h);
621
- n.body.firstElementChild.setAttribute(C, e), r = n.getElementsByTagName("body")[0].innerHTML;
622
- } catch (n) {
623
- console.warn("Can't embed uuid.", n);
614
+ const r = new DOMParser().parseFromString(t, h);
615
+ r.body.firstElementChild.setAttribute(C, e), n = r.getElementsByTagName("body")[0].innerHTML;
616
+ } catch (r) {
617
+ console.warn("Can't embed uuid.", r);
624
618
  }
625
- return r;
619
+ return n;
626
620
  }, pt = (e, t) => {
627
621
  if (!t || !e) return !1;
628
622
  try {
629
- const r = t.querySelectorAll(`[${C}="${e}"]`);
630
- if (r && r.length === 1) return !0;
623
+ const n = t.querySelectorAll(`[${C}="${e}"]`);
624
+ if (n && n.length === 1) return !0;
631
625
  if (t.querySelector("parsererror")) throw new Error("We are unable to parse node");
632
626
  return !1;
633
627
  } catch {
@@ -649,8 +643,8 @@ class wt {
649
643
  await N();
650
644
  const t = await V(this._nativeClipboard, v);
651
645
  if (!this._state || t && t === this._state.uuid) return !0;
652
- const r = await dt(this._nativeClipboard, h);
653
- return !this._state || (pt(this._state.uuid, r) || this.clear(), !0);
646
+ const n = await dt(this._nativeClipboard, h);
647
+ return !this._state || (pt(this._state.uuid, n) || this.clear(), !0);
654
648
  }, async (t) => {
655
649
  t?.message === "denied" || t.message?.includes("Document is not focused") || T() === y.Safari || console.warn("Unable to detect clipboard changes: ", t);
656
650
  });
@@ -661,7 +655,7 @@ class wt {
661
655
  t._checkForChanges();
662
656
  }, this._onBlur = () => {
663
657
  globalThis.addEventListener?.("focus", t._onFocus, { once: !0 });
664
- }, globalThis.addEventListener?.("blur", this._onBlur), this._nativeClipboard.addEventListener("clipboardchange", (r) => {
658
+ }, globalThis.addEventListener?.("blur", this._onBlur), this._nativeClipboard.addEventListener("clipboardchange", (n) => {
665
659
  t._checkForChanges();
666
660
  }));
667
661
  }
@@ -670,13 +664,13 @@ class wt {
670
664
  const t = this;
671
665
  return await B("clipboard-read", async () => {
672
666
  if (await N(), this._state?.uuid) {
673
- const r = await V(this._nativeClipboard, v);
674
- if (r && r === t._state.uuid) return !0;
675
- const n = await dt(this._nativeClipboard, h);
676
- if (pt(t._state?.uuid, n)) return !0;
667
+ const n = await V(this._nativeClipboard, v);
668
+ if (n && n === t._state.uuid) return !0;
669
+ const r = await dt(this._nativeClipboard, h);
670
+ if (pt(t._state?.uuid, r)) return !0;
677
671
  }
678
672
  return t._state = { items: await jt(this._nativeClipboard), uuid: null, ref: null }, this.dispatchEvent(new Event("clipboardread")), !0;
679
- }, async (r) => {
673
+ }, async (n) => {
680
674
  this.dispatchEvent(new Event("clipboarderrorread"));
681
675
  }), this._state?.items ?? [];
682
676
  }
@@ -685,10 +679,10 @@ class wt {
685
679
  }
686
680
  async _write(t) {
687
681
  if (!this._nativeClipboard) return this._state = t, this.dispatchEvent(new Event("clipboardwrite")), this.dispatchEvent(new Event("clipboardchange")), null;
688
- const r = this, n = [], o = t.uuid;
682
+ const n = this, r = [], o = t.uuid;
689
683
  let a = t.items ?? [];
690
684
  const i = () => {
691
- r._state = { uuid: o, ref: t.ref, items: n }, r.dispatchEvent(new Event("clipboardwrite")), r.dispatchEvent(new Event("clipboardchange"));
685
+ n._state = { uuid: o, ref: t.ref, items: r }, n.dispatchEvent(new Event("clipboardwrite")), n.dispatchEvent(new Event("clipboardchange"));
692
686
  };
693
687
  await B("clipboard-write", async () => {
694
688
  await N(), o && a.length === 0 && (a.push(new ClipboardItem({ [v]: new Blob([o], { type: v }) })), a.push(new ClipboardItem({ [h]: new Blob([ft(o)], { type: h }) })));
@@ -716,10 +710,10 @@ class wt {
716
710
  const p = s.types[f];
717
711
  u[p] = f === c ? w : s.getType(p);
718
712
  }
719
- d && c === -1 && (u[h] = w), o && (u[v] = new Blob([o], { type: v })), n.push(new ClipboardItem(u));
713
+ d && c === -1 && (u[h] = w), o && (u[v] = new Blob([o], { type: v })), r.push(new ClipboardItem(u));
720
714
  }
721
715
  try {
722
- n && n.length !== 0 ? await this._nativeClipboard.write(n) : await (async (l) => {
716
+ r && r.length !== 0 ? await this._nativeClipboard.write(r) : await (async (l) => {
723
717
  l && await l.writeText("");
724
718
  })(this._nativeClipboard);
725
719
  } catch (l) {
@@ -732,28 +726,28 @@ class wt {
732
726
  }
733
727
  async writeReference(t) {
734
728
  if (!t) return void this.clear();
735
- let r = null;
736
- const n = {};
729
+ let n = null;
730
+ const r = {};
737
731
  try {
738
732
  const a = await t.toText?.() ?? null;
739
- a && (n[b] = new Blob([a ?? ""], { type: b }));
733
+ a && (r[b] = new Blob([a ?? ""], { type: b }));
740
734
  } catch (a) {
741
- r = a;
735
+ n = a;
742
736
  }
743
737
  try {
744
738
  const a = await t.toHtml?.() ?? null;
745
- a && (n[h] = new Blob([a], { type: h }));
739
+ a && (r[h] = new Blob([a], { type: h }));
746
740
  } catch (a) {
747
- r = a, console.warn("export to html", a);
741
+ n = a, console.warn("export to html", a);
748
742
  }
749
743
  try {
750
744
  const a = await t.toImage?.() ?? null;
751
- a && (n[L] = a);
745
+ a && (r[L] = a);
752
746
  } catch (a) {
753
- r = a, console.warn("export to png", a);
747
+ n = a, console.warn("export to png", a);
754
748
  }
755
- const o = this._write({ uuid: R(), ref: t, items: Object.keys(n).length > 0 ? [new ClipboardItem(n)] : null });
756
- if (r) throw r;
749
+ const o = this._write({ uuid: R(), ref: t, items: Object.keys(r).length > 0 ? [new ClipboardItem(r)] : null });
750
+ if (n) throw n;
757
751
  return o;
758
752
  }
759
753
  clear(t = !1) {
@@ -763,32 +757,32 @@ class wt {
763
757
  return await this.read(), this._state?.ref ?? null;
764
758
  }
765
759
  readText() {
766
- return new Promise(async (t, r) => {
767
- const n = await this.read();
760
+ return new Promise(async (t, n) => {
761
+ const r = await this.read();
768
762
  let o = null;
769
- for (let i = 0; !o && n && i < n.length; i++) n[i].types.includes(b) && (o = await n[i].getType(b));
763
+ for (let i = 0; !o && r && i < r.length; i++) r[i].types.includes(b) && (o = await r[i].getType(b));
770
764
  if (!o) return void t("");
771
765
  const a = new FileReader();
772
766
  a.onload = () => {
773
767
  t(a.result);
774
768
  }, a.readAsText(o), a.onerror = (i) => {
775
- r(i);
769
+ n(i);
776
770
  };
777
771
  });
778
772
  }
779
773
  async writeText(t) {
780
- const r = [new ClipboardItem({ [b]: new Blob([t], { type: b }) })];
781
- return this._write({ uuid: R(), items: r, ref: null });
774
+ const n = [new ClipboardItem({ [b]: new Blob([t], { type: b }) })];
775
+ return this._write({ uuid: R(), items: n, ref: null });
782
776
  }
783
- addEventListener(t, r, n = {}) {
784
- const o = n?.capture ? this._listenersCapture : this._listeners;
777
+ addEventListener(t, n, r = {}) {
778
+ const o = r?.capture ? this._listenersCapture : this._listeners;
785
779
  let a = o.get(t);
786
- a || (a = /* @__PURE__ */ new Map(), o.set(t, a)), a.set(r, typeof n == "boolean" ? {} : n);
780
+ a || (a = /* @__PURE__ */ new Map(), o.set(t, a)), a.set(n, typeof r == "boolean" ? {} : r);
787
781
  }
788
782
  dispatchEvent(t) {
789
783
  if (!t) return;
790
- const r = (n) => {
791
- const o = n.get(t.type);
784
+ const n = (r) => {
785
+ const o = r.get(t.type);
792
786
  o && o.forEach((a, i) => {
793
787
  try {
794
788
  typeof i == "function" ? i(t) : i.handleEvent && i.handleEvent(t), a.once && o.delete(i);
@@ -797,11 +791,11 @@ class wt {
797
791
  }
798
792
  });
799
793
  };
800
- return r(this._listenersCapture), r(this._listeners), !0;
794
+ return n(this._listenersCapture), n(this._listeners), !0;
801
795
  }
802
- removeEventListener(t, r, n) {
803
- const o = n?.capture ? this._listenersCapture : this._listeners, a = o.get(t);
804
- a && (a.delete(r), a.size === 0 && o.delete(t));
796
+ removeEventListener(t, n, r) {
797
+ const o = r?.capture ? this._listenersCapture : this._listeners, a = o.get(t);
798
+ a && (a.delete(n), a.size === 0 && o.delete(t));
805
799
  }
806
800
  close() {
807
801
  globalThis.removeEventListener?.("focus", this._onFocus), globalThis.removeEventListener?.("blur", this._onBlur);
@@ -815,10 +809,10 @@ const Vt = Object.freeze({ compileTypescript: async function(e) {
815
809
  if (q && $t.deepEqual(q, e)) return ht;
816
810
  const t = await async function() {
817
811
  if (M) return M;
818
- const { TypeScriptCompiler: n } = await import("./BcvpIfnTmlQXt7_9.mjs");
819
- return M = new n(), M;
820
- }(), r = await t.compileModule(e);
821
- return ht = r, q = e, r;
812
+ const { TypeScriptCompiler: r } = await import("./BB9Q-lDQb6Cd-_mI.mjs");
813
+ return M = new r(), M;
814
+ }(), n = await t.compileModule(e);
815
+ return ht = n, q = e, n;
822
816
  } });
823
817
  export {
824
818
  Vt as S,