@oardi/ts-utils 0.0.9 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.es.js CHANGED
@@ -1,465 +1,568 @@
1
- const Ce = (f, r, c) => f.localeCompare(r) * (c ? 1 : -1), Le = (f, r) => f < r ? -1 : f === r ? 0 : 1, Ae = (f, r, c) => Le(f, r) * (c ? 1 : -1), Te = (f, r, c) => {
2
- let d = 0;
3
- return typeof f == "string" && typeof r == "string" ? d = Ce(f, r, c) : d = Ae(f, r, c), d;
4
- }, Ie = (f, r, c, d) => {
5
- const C = c(f), $ = c(r);
6
- return Te(C, $, d);
7
- };
8
- Array.prototype.groupBy = function(f) {
9
- return this.reduce((r, c) => {
10
- const d = f(c);
11
- return (r[d] = r[d] || []).push(c), r;
12
- }, {});
13
- };
14
- Array.prototype.removeBy = function(f, r) {
15
- return this.filter((c) => f(c) !== r);
1
+ async function $e(i, r, s) {
2
+ const l = s?.mimeType ?? Le(r), $ = Re(i, l);
3
+ if ("showSaveFilePicker" in window && s?.showSaveFilePicker)
4
+ try {
5
+ const q = await (await window.showSaveFilePicker({
6
+ suggestedName: r,
7
+ types: [{ description: "Datei", accept: { [l]: [`.${De(r)}`] } }]
8
+ })).createWritable();
9
+ await q.write($), await q.close();
10
+ return;
11
+ } catch {
12
+ }
13
+ const C = URL.createObjectURL($), j = document.createElement("a");
14
+ j.href = C, j.download = r, j.rel = "noopener", j.style.display = "none", document.body.appendChild(j), Ae(j), window.setTimeout(() => {
15
+ document.body.removeChild(j), URL.revokeObjectURL(C);
16
+ }, 0), Ie() && window.open(C, "_blank", "noopener,noreferrer");
17
+ }
18
+ function Re(i, r) {
19
+ if (i instanceof Blob)
20
+ return i.type ? i : new Blob([i], { type: r });
21
+ if (i instanceof ArrayBuffer || i instanceof Uint8Array) {
22
+ const s = i instanceof Uint8Array ? i : new Uint8Array(i);
23
+ return new Blob([s], { type: r });
24
+ }
25
+ return new Blob([i], { type: r || "text/plain;charset=utf-8" });
26
+ }
27
+ function Le(i) {
28
+ switch (De(i).toLowerCase()) {
29
+ case "txt":
30
+ return "text/plain;charset=utf-8";
31
+ case "csv":
32
+ return "text/csv;charset=utf-8";
33
+ case "json":
34
+ return "application/json;charset=utf-8";
35
+ case "pdf":
36
+ return "application/pdf";
37
+ case "png":
38
+ return "image/png";
39
+ case "jpg":
40
+ case "jpeg":
41
+ return "image/jpeg";
42
+ case "svg":
43
+ return "image/svg+xml";
44
+ case "zip":
45
+ return "application/zip";
46
+ default:
47
+ return "application/octet-stream";
48
+ }
49
+ }
50
+ function De(i) {
51
+ const r = i.lastIndexOf(".");
52
+ return r >= 0 && r < i.length - 1 ? i.slice(r + 1) : "";
53
+ }
54
+ function Ae(i) {
55
+ const r = document.createEvent("MouseEvents");
56
+ r.initMouseEvent("click", !0, !0, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), i.dispatchEvent(r);
57
+ }
58
+ function Ie() {
59
+ const i = navigator.userAgent, r = /iPad|iPhone|iPod/.test(i), s = /^((?!chrome|android).)*safari/i.test(i);
60
+ return r || s;
61
+ }
62
+ class Qe {
63
+ static getEnumValue(r, s) {
64
+ if (s in r)
65
+ return r[s];
66
+ throw Error(`${s} not found in ${r}`);
67
+ }
68
+ static getKeyValues(r) {
69
+ return Object.keys(r).filter((s) => !isNaN(Number(s))).map((s) => ({
70
+ key: Number(s),
71
+ value: r[s]
72
+ }));
73
+ }
74
+ }
75
+ const Te = (i, r, s) => i.localeCompare(r) * (s ? 1 : -1), Fe = (i, r) => i < r ? -1 : i === r ? 0 : 1, je = (i, r, s) => Fe(i, r) * (s ? 1 : -1), ze = (i, r, s) => {
76
+ let l = 0;
77
+ return typeof i == "string" && typeof r == "string" ? l = Te(i, r, s) : l = je(i, r, s), l;
78
+ }, Be = (i, r, s, l) => {
79
+ const $ = s(i), C = s(r);
80
+ return ze($, C, l);
16
81
  };
17
- Array.prototype.orderBy = function(f, r = !0) {
18
- return this?.sort((c, d) => Ie(c, d, f, r)), this;
82
+ Array.prototype.distinct = function(i) {
83
+ const r = this;
84
+ return i ? r.filter((l, $, C) => C.findIndex((j) => i(j, l)) === $) : r.filter((l, $, C) => C.indexOf(l) === $);
19
85
  };
20
- Array.prototype.filterBy = function(f) {
86
+ Array.prototype.filterBy = function(i) {
21
87
  return this.filter((r) => {
22
- let c = !1;
23
- return f && r[f] ? c = r[f] === f : c = r === f, c;
88
+ let s = !1;
89
+ return i && r[i] ? s = r[i] === i : s = r === i, s;
24
90
  });
25
91
  };
26
- Array.prototype.distinct = function(f) {
27
- const r = this;
28
- return f ? r.filter((d, C, $) => $.findIndex((z) => f(z, d)) === C) : r.filter((d, C, $) => $.indexOf(d) === C);
92
+ Array.prototype.first = function() {
93
+ return this?.length > 0 ? this[0] : null;
94
+ };
95
+ Array.prototype.groupBy = function(i) {
96
+ return this.reduce((r, s) => {
97
+ const l = i(s);
98
+ return (r[l] = r[l] || []).push(s), r;
99
+ }, {});
100
+ };
101
+ Array.prototype.orderBy = function(i, r = !0) {
102
+ return this?.sort((s, l) => Be(s, l, i, r)), this;
29
103
  };
30
- var ge = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
31
- function Re(f) {
32
- return f && f.__esModule && Object.prototype.hasOwnProperty.call(f, "default") ? f.default : f;
104
+ Array.prototype.removeBy = function(i, r) {
105
+ return this.filter((s) => i(s) !== r);
106
+ };
107
+ function Ce(i) {
108
+ return i && i.__esModule && Object.prototype.hasOwnProperty.call(i, "default") ? i.default : i;
33
109
  }
34
- var me = { exports: {} }, Fe = me.exports, Se;
35
- function je() {
36
- return Se || (Se = 1, function(f, r) {
37
- (function(c, d) {
38
- f.exports = d();
39
- })(Fe, function() {
40
- var c = 1e3, d = 6e4, C = 36e5, $ = "millisecond", z = "second", N = "minute", P = "hour", o = "day", k = "week", A = "month", D = "quarter", T = "year", Q = "date", G = "Invalid Date", X = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, se = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, ae = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(_) {
41
- var l = ["th", "st", "nd", "rd"], h = _ % 100;
42
- return "[" + _ + (l[(h - 20) % 10] || l[h] || l[0]) + "]";
43
- } }, Z = function(_, l, h) {
44
- var i = String(_);
45
- return !i || i.length >= l ? _ : "" + Array(l + 1 - i.length).join(h) + _;
46
- }, pe = { s: Z, z: function(_) {
47
- var l = -_.utcOffset(), h = Math.abs(l), i = Math.floor(h / 60), a = h % 60;
48
- return (l <= 0 ? "+" : "-") + Z(i, 2, "0") + ":" + Z(a, 2, "0");
49
- }, m: function _(l, h) {
50
- if (l.date() < h.date()) return -_(h, l);
51
- var i = 12 * (h.year() - l.year()) + (h.month() - l.month()), a = l.clone().add(i, A), u = h - a < 0, y = l.clone().add(i + (u ? -1 : 1), A);
52
- return +(-(i + (h - a) / (u ? a - y : y - a)) || 0);
53
- }, a: function(_) {
54
- return _ < 0 ? Math.ceil(_) || 0 : Math.floor(_);
55
- }, p: function(_) {
56
- return { M: A, y: T, w: k, d: o, D: Q, h: P, m: N, s: z, ms: $, Q: D }[_] || String(_ || "").toLowerCase().replace(/s$/, "");
57
- }, u: function(_) {
58
- return _ === void 0;
59
- } }, oe = "en", K = {};
60
- K[oe] = ae;
61
- var I = "$isDayjsObject", e = function(_) {
62
- return _ instanceof m || !(!_ || !_[I]);
63
- }, t = function _(l, h, i) {
64
- var a;
65
- if (!l) return oe;
66
- if (typeof l == "string") {
67
- var u = l.toLowerCase();
68
- K[u] && (a = u), h && (K[u] = h, a = u);
69
- var y = l.split("-");
70
- if (!a && y.length > 1) return _(y[0]);
110
+ var ye = { exports: {} }, We = ye.exports, Se;
111
+ function Ue() {
112
+ return Se || (Se = 1, function(i, r) {
113
+ (function(s, l) {
114
+ i.exports = l();
115
+ })(We, function() {
116
+ var s = 1e3, l = 6e4, $ = 36e5, C = "millisecond", j = "second", H = "minute", q = "hour", w = "day", P = "week", W = "month", X = "quarter", K = "year", Q = "date", ee = "Invalid Date", ie = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, he = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, le = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(m) {
117
+ var f = ["th", "st", "nd", "rd"], c = m % 100;
118
+ return "[" + m + (f[(c - 20) % 10] || f[c] || f[0]) + "]";
119
+ } }, oe = function(m, f, c) {
120
+ var a = String(m);
121
+ return !a || a.length >= f ? m : "" + Array(f + 1 - a.length).join(c) + m;
122
+ }, me = { s: oe, z: function(m) {
123
+ var f = -m.utcOffset(), c = Math.abs(f), a = Math.floor(c / 60), u = c % 60;
124
+ return (f <= 0 ? "+" : "-") + oe(a, 2, "0") + ":" + oe(u, 2, "0");
125
+ }, m: function m(f, c) {
126
+ if (f.date() < c.date()) return -m(c, f);
127
+ var a = 12 * (c.year() - f.year()) + (c.month() - f.month()), u = f.clone().add(a, W), h = c - u < 0, y = f.clone().add(a + (h ? -1 : 1), W);
128
+ return +(-(a + (c - u) / (h ? u - y : y - u)) || 0);
129
+ }, a: function(m) {
130
+ return m < 0 ? Math.ceil(m) || 0 : Math.floor(m);
131
+ }, p: function(m) {
132
+ return { M: W, y: K, w: P, d: w, D: Q, h: q, m: H, s: j, ms: C, Q: X }[m] || String(m || "").toLowerCase().replace(/s$/, "");
133
+ }, u: function(m) {
134
+ return m === void 0;
135
+ } }, se = "en", Y = {};
136
+ Y[se] = le;
137
+ var R = "$isDayjsObject", e = function(m) {
138
+ return m instanceof g || !(!m || !m[R]);
139
+ }, t = function m(f, c, a) {
140
+ var u;
141
+ if (!f) return se;
142
+ if (typeof f == "string") {
143
+ var h = f.toLowerCase();
144
+ Y[h] && (u = h), c && (Y[h] = c, u = h);
145
+ var y = f.split("-");
146
+ if (!u && y.length > 1) return m(y[0]);
71
147
  } else {
72
- var g = l.name;
73
- K[g] = l, a = g;
148
+ var p = f.name;
149
+ Y[p] = f, u = p;
74
150
  }
75
- return !i && a && (oe = a), a || !i && oe;
76
- }, n = function(_, l) {
77
- if (e(_)) return _.clone();
78
- var h = typeof l == "object" ? l : {};
79
- return h.date = _, h.args = arguments, new m(h);
80
- }, s = pe;
81
- s.l = t, s.i = e, s.w = function(_, l) {
82
- return n(_, { locale: l.$L, utc: l.$u, x: l.$x, $offset: l.$offset });
151
+ return !a && u && (se = u), u || !a && se;
152
+ }, n = function(m, f) {
153
+ if (e(m)) return m.clone();
154
+ var c = typeof f == "object" ? f : {};
155
+ return c.date = m, c.args = arguments, new g(c);
156
+ }, o = me;
157
+ o.l = t, o.i = e, o.w = function(m, f) {
158
+ return n(m, { locale: f.$L, utc: f.$u, x: f.$x, $offset: f.$offset });
83
159
  };
84
- var m = function() {
85
- function _(h) {
86
- this.$L = t(h.locale, null, !0), this.parse(h), this.$x = this.$x || h.x || {}, this[I] = !0;
160
+ var g = function() {
161
+ function m(c) {
162
+ this.$L = t(c.locale, null, !0), this.parse(c), this.$x = this.$x || c.x || {}, this[R] = !0;
87
163
  }
88
- var l = _.prototype;
89
- return l.parse = function(h) {
90
- this.$d = function(i) {
91
- var a = i.date, u = i.utc;
92
- if (a === null) return /* @__PURE__ */ new Date(NaN);
93
- if (s.u(a)) return /* @__PURE__ */ new Date();
94
- if (a instanceof Date) return new Date(a);
95
- if (typeof a == "string" && !/Z$/i.test(a)) {
96
- var y = a.match(X);
164
+ var f = m.prototype;
165
+ return f.parse = function(c) {
166
+ this.$d = function(a) {
167
+ var u = a.date, h = a.utc;
168
+ if (u === null) return /* @__PURE__ */ new Date(NaN);
169
+ if (o.u(u)) return /* @__PURE__ */ new Date();
170
+ if (u instanceof Date) return new Date(u);
171
+ if (typeof u == "string" && !/Z$/i.test(u)) {
172
+ var y = u.match(ie);
97
173
  if (y) {
98
- var g = y[2] - 1 || 0, v = (y[7] || "0").substring(0, 3);
99
- return u ? new Date(Date.UTC(y[1], g, y[3] || 1, y[4] || 0, y[5] || 0, y[6] || 0, v)) : new Date(y[1], g, y[3] || 1, y[4] || 0, y[5] || 0, y[6] || 0, v);
174
+ var p = y[2] - 1 || 0, _ = (y[7] || "0").substring(0, 3);
175
+ return h ? new Date(Date.UTC(y[1], p, y[3] || 1, y[4] || 0, y[5] || 0, y[6] || 0, _)) : new Date(y[1], p, y[3] || 1, y[4] || 0, y[5] || 0, y[6] || 0, _);
100
176
  }
101
177
  }
102
- return new Date(a);
103
- }(h), this.init();
104
- }, l.init = function() {
105
- var h = this.$d;
106
- this.$y = h.getFullYear(), this.$M = h.getMonth(), this.$D = h.getDate(), this.$W = h.getDay(), this.$H = h.getHours(), this.$m = h.getMinutes(), this.$s = h.getSeconds(), this.$ms = h.getMilliseconds();
107
- }, l.$utils = function() {
108
- return s;
109
- }, l.isValid = function() {
110
- return this.$d.toString() !== G;
111
- }, l.isSame = function(h, i) {
112
- var a = n(h);
113
- return this.startOf(i) <= a && a <= this.endOf(i);
114
- }, l.isAfter = function(h, i) {
115
- return n(h) < this.startOf(i);
116
- }, l.isBefore = function(h, i) {
117
- return this.endOf(i) < n(h);
118
- }, l.$g = function(h, i, a) {
119
- return s.u(h) ? this[i] : this.set(a, h);
120
- }, l.unix = function() {
178
+ return new Date(u);
179
+ }(c), this.init();
180
+ }, f.init = function() {
181
+ var c = this.$d;
182
+ this.$y = c.getFullYear(), this.$M = c.getMonth(), this.$D = c.getDate(), this.$W = c.getDay(), this.$H = c.getHours(), this.$m = c.getMinutes(), this.$s = c.getSeconds(), this.$ms = c.getMilliseconds();
183
+ }, f.$utils = function() {
184
+ return o;
185
+ }, f.isValid = function() {
186
+ return this.$d.toString() !== ee;
187
+ }, f.isSame = function(c, a) {
188
+ var u = n(c);
189
+ return this.startOf(a) <= u && u <= this.endOf(a);
190
+ }, f.isAfter = function(c, a) {
191
+ return n(c) < this.startOf(a);
192
+ }, f.isBefore = function(c, a) {
193
+ return this.endOf(a) < n(c);
194
+ }, f.$g = function(c, a, u) {
195
+ return o.u(c) ? this[a] : this.set(u, c);
196
+ }, f.unix = function() {
121
197
  return Math.floor(this.valueOf() / 1e3);
122
- }, l.valueOf = function() {
198
+ }, f.valueOf = function() {
123
199
  return this.$d.getTime();
124
- }, l.startOf = function(h, i) {
125
- var a = this, u = !!s.u(i) || i, y = s.p(h), g = function(O, x) {
126
- var w = s.w(a.$u ? Date.UTC(a.$y, x, O) : new Date(a.$y, x, O), a);
127
- return u ? w : w.endOf(o);
128
- }, v = function(O, x) {
129
- return s.w(a.toDate()[O].apply(a.toDate("s"), (u ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(x)), a);
130
- }, p = this.$W, M = this.$M, L = this.$D, B = "set" + (this.$u ? "UTC" : "");
200
+ }, f.startOf = function(c, a) {
201
+ var u = this, h = !!o.u(a) || a, y = o.p(c), p = function(E, O) {
202
+ var v = o.w(u.$u ? Date.UTC(u.$y, O, E) : new Date(u.$y, O, E), u);
203
+ return h ? v : v.endOf(w);
204
+ }, _ = function(E, O) {
205
+ return o.w(u.toDate()[E].apply(u.toDate("s"), (h ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(O)), u);
206
+ }, d = this.$W, x = this.$M, M = this.$D, T = "set" + (this.$u ? "UTC" : "");
131
207
  switch (y) {
132
- case T:
133
- return u ? g(1, 0) : g(31, 11);
134
- case A:
135
- return u ? g(1, M) : g(0, M + 1);
136
- case k:
137
- var Y = this.$locale().weekStart || 0, b = (p < Y ? p + 7 : p) - Y;
138
- return g(u ? L - b : L + (6 - b), M);
139
- case o:
140
- case Q:
141
- return v(B + "Hours", 0);
208
+ case K:
209
+ return h ? p(1, 0) : p(31, 11);
210
+ case W:
211
+ return h ? p(1, x) : p(0, x + 1);
142
212
  case P:
143
- return v(B + "Minutes", 1);
144
- case N:
145
- return v(B + "Seconds", 2);
146
- case z:
147
- return v(B + "Milliseconds", 3);
213
+ var B = this.$locale().weekStart || 0, k = (d < B ? d + 7 : d) - B;
214
+ return p(h ? M - k : M + (6 - k), x);
215
+ case w:
216
+ case Q:
217
+ return _(T + "Hours", 0);
218
+ case q:
219
+ return _(T + "Minutes", 1);
220
+ case H:
221
+ return _(T + "Seconds", 2);
222
+ case j:
223
+ return _(T + "Milliseconds", 3);
148
224
  default:
149
225
  return this.clone();
150
226
  }
151
- }, l.endOf = function(h) {
152
- return this.startOf(h, !1);
153
- }, l.$set = function(h, i) {
154
- var a, u = s.p(h), y = "set" + (this.$u ? "UTC" : ""), g = (a = {}, a[o] = y + "Date", a[Q] = y + "Date", a[A] = y + "Month", a[T] = y + "FullYear", a[P] = y + "Hours", a[N] = y + "Minutes", a[z] = y + "Seconds", a[$] = y + "Milliseconds", a)[u], v = u === o ? this.$D + (i - this.$W) : i;
155
- if (u === A || u === T) {
156
- var p = this.clone().set(Q, 1);
157
- p.$d[g](v), p.init(), this.$d = p.set(Q, Math.min(this.$D, p.daysInMonth())).$d;
158
- } else g && this.$d[g](v);
227
+ }, f.endOf = function(c) {
228
+ return this.startOf(c, !1);
229
+ }, f.$set = function(c, a) {
230
+ var u, h = o.p(c), y = "set" + (this.$u ? "UTC" : ""), p = (u = {}, u[w] = y + "Date", u[Q] = y + "Date", u[W] = y + "Month", u[K] = y + "FullYear", u[q] = y + "Hours", u[H] = y + "Minutes", u[j] = y + "Seconds", u[C] = y + "Milliseconds", u)[h], _ = h === w ? this.$D + (a - this.$W) : a;
231
+ if (h === W || h === K) {
232
+ var d = this.clone().set(Q, 1);
233
+ d.$d[p](_), d.init(), this.$d = d.set(Q, Math.min(this.$D, d.daysInMonth())).$d;
234
+ } else p && this.$d[p](_);
159
235
  return this.init(), this;
160
- }, l.set = function(h, i) {
161
- return this.clone().$set(h, i);
162
- }, l.get = function(h) {
163
- return this[s.p(h)]();
164
- }, l.add = function(h, i) {
165
- var a, u = this;
166
- h = Number(h);
167
- var y = s.p(i), g = function(M) {
168
- var L = n(u);
169
- return s.w(L.date(L.date() + Math.round(M * h)), u);
236
+ }, f.set = function(c, a) {
237
+ return this.clone().$set(c, a);
238
+ }, f.get = function(c) {
239
+ return this[o.p(c)]();
240
+ }, f.add = function(c, a) {
241
+ var u, h = this;
242
+ c = Number(c);
243
+ var y = o.p(a), p = function(x) {
244
+ var M = n(h);
245
+ return o.w(M.date(M.date() + Math.round(x * c)), h);
170
246
  };
171
- if (y === A) return this.set(A, this.$M + h);
172
- if (y === T) return this.set(T, this.$y + h);
173
- if (y === o) return g(1);
174
- if (y === k) return g(7);
175
- var v = (a = {}, a[N] = d, a[P] = C, a[z] = c, a)[y] || 1, p = this.$d.getTime() + h * v;
176
- return s.w(p, this);
177
- }, l.subtract = function(h, i) {
178
- return this.add(-1 * h, i);
179
- }, l.format = function(h) {
180
- var i = this, a = this.$locale();
181
- if (!this.isValid()) return a.invalidDate || G;
182
- var u = h || "YYYY-MM-DDTHH:mm:ssZ", y = s.z(this), g = this.$H, v = this.$m, p = this.$M, M = a.weekdays, L = a.months, B = a.meridiem, Y = function(x, w, F, U) {
183
- return x && (x[w] || x(i, u)) || F[w].slice(0, U);
184
- }, b = function(x) {
185
- return s.s(g % 12 || 12, x, "0");
186
- }, O = B || function(x, w, F) {
187
- var U = x < 12 ? "AM" : "PM";
188
- return F ? U.toLowerCase() : U;
247
+ if (y === W) return this.set(W, this.$M + c);
248
+ if (y === K) return this.set(K, this.$y + c);
249
+ if (y === w) return p(1);
250
+ if (y === P) return p(7);
251
+ var _ = (u = {}, u[H] = l, u[q] = $, u[j] = s, u)[y] || 1, d = this.$d.getTime() + c * _;
252
+ return o.w(d, this);
253
+ }, f.subtract = function(c, a) {
254
+ return this.add(-1 * c, a);
255
+ }, f.format = function(c) {
256
+ var a = this, u = this.$locale();
257
+ if (!this.isValid()) return u.invalidDate || ee;
258
+ var h = c || "YYYY-MM-DDTHH:mm:ssZ", y = o.z(this), p = this.$H, _ = this.$m, d = this.$M, x = u.weekdays, M = u.months, T = u.meridiem, B = function(O, v, L, F) {
259
+ return O && (O[v] || O(a, h)) || L[v].slice(0, F);
260
+ }, k = function(O) {
261
+ return o.s(p % 12 || 12, O, "0");
262
+ }, E = T || function(O, v, L) {
263
+ var F = O < 12 ? "AM" : "PM";
264
+ return L ? F.toLowerCase() : F;
189
265
  };
190
- return u.replace(se, function(x, w) {
191
- return w || function(F) {
192
- switch (F) {
266
+ return h.replace(he, function(O, v) {
267
+ return v || function(L) {
268
+ switch (L) {
193
269
  case "YY":
194
- return String(i.$y).slice(-2);
270
+ return String(a.$y).slice(-2);
195
271
  case "YYYY":
196
- return s.s(i.$y, 4, "0");
272
+ return o.s(a.$y, 4, "0");
197
273
  case "M":
198
- return p + 1;
274
+ return d + 1;
199
275
  case "MM":
200
- return s.s(p + 1, 2, "0");
276
+ return o.s(d + 1, 2, "0");
201
277
  case "MMM":
202
- return Y(a.monthsShort, p, L, 3);
278
+ return B(u.monthsShort, d, M, 3);
203
279
  case "MMMM":
204
- return Y(L, p);
280
+ return B(M, d);
205
281
  case "D":
206
- return i.$D;
282
+ return a.$D;
207
283
  case "DD":
208
- return s.s(i.$D, 2, "0");
284
+ return o.s(a.$D, 2, "0");
209
285
  case "d":
210
- return String(i.$W);
286
+ return String(a.$W);
211
287
  case "dd":
212
- return Y(a.weekdaysMin, i.$W, M, 2);
288
+ return B(u.weekdaysMin, a.$W, x, 2);
213
289
  case "ddd":
214
- return Y(a.weekdaysShort, i.$W, M, 3);
290
+ return B(u.weekdaysShort, a.$W, x, 3);
215
291
  case "dddd":
216
- return M[i.$W];
292
+ return x[a.$W];
217
293
  case "H":
218
- return String(g);
294
+ return String(p);
219
295
  case "HH":
220
- return s.s(g, 2, "0");
296
+ return o.s(p, 2, "0");
221
297
  case "h":
222
- return b(1);
298
+ return k(1);
223
299
  case "hh":
224
- return b(2);
300
+ return k(2);
225
301
  case "a":
226
- return O(g, v, !0);
302
+ return E(p, _, !0);
227
303
  case "A":
228
- return O(g, v, !1);
304
+ return E(p, _, !1);
229
305
  case "m":
230
- return String(v);
306
+ return String(_);
231
307
  case "mm":
232
- return s.s(v, 2, "0");
308
+ return o.s(_, 2, "0");
233
309
  case "s":
234
- return String(i.$s);
310
+ return String(a.$s);
235
311
  case "ss":
236
- return s.s(i.$s, 2, "0");
312
+ return o.s(a.$s, 2, "0");
237
313
  case "SSS":
238
- return s.s(i.$ms, 3, "0");
314
+ return o.s(a.$ms, 3, "0");
239
315
  case "Z":
240
316
  return y;
241
317
  }
242
318
  return null;
243
- }(x) || y.replace(":", "");
319
+ }(O) || y.replace(":", "");
244
320
  });
245
- }, l.utcOffset = function() {
321
+ }, f.utcOffset = function() {
246
322
  return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
247
- }, l.diff = function(h, i, a) {
248
- var u, y = this, g = s.p(i), v = n(h), p = (v.utcOffset() - this.utcOffset()) * d, M = this - v, L = function() {
249
- return s.m(y, v);
323
+ }, f.diff = function(c, a, u) {
324
+ var h, y = this, p = o.p(a), _ = n(c), d = (_.utcOffset() - this.utcOffset()) * l, x = this - _, M = function() {
325
+ return o.m(y, _);
250
326
  };
251
- switch (g) {
252
- case T:
253
- u = L() / 12;
327
+ switch (p) {
328
+ case K:
329
+ h = M() / 12;
254
330
  break;
255
- case A:
256
- u = L();
331
+ case W:
332
+ h = M();
257
333
  break;
258
- case D:
259
- u = L() / 3;
334
+ case X:
335
+ h = M() / 3;
260
336
  break;
261
- case k:
262
- u = (M - p) / 6048e5;
337
+ case P:
338
+ h = (x - d) / 6048e5;
263
339
  break;
264
- case o:
265
- u = (M - p) / 864e5;
340
+ case w:
341
+ h = (x - d) / 864e5;
266
342
  break;
267
- case P:
268
- u = M / C;
343
+ case q:
344
+ h = x / $;
269
345
  break;
270
- case N:
271
- u = M / d;
346
+ case H:
347
+ h = x / l;
272
348
  break;
273
- case z:
274
- u = M / c;
349
+ case j:
350
+ h = x / s;
275
351
  break;
276
352
  default:
277
- u = M;
353
+ h = x;
278
354
  }
279
- return a ? u : s.a(u);
280
- }, l.daysInMonth = function() {
281
- return this.endOf(A).$D;
282
- }, l.$locale = function() {
283
- return K[this.$L];
284
- }, l.locale = function(h, i) {
285
- if (!h) return this.$L;
286
- var a = this.clone(), u = t(h, i, !0);
287
- return u && (a.$L = u), a;
288
- }, l.clone = function() {
289
- return s.w(this.$d, this);
290
- }, l.toDate = function() {
355
+ return u ? h : o.a(h);
356
+ }, f.daysInMonth = function() {
357
+ return this.endOf(W).$D;
358
+ }, f.$locale = function() {
359
+ return Y[this.$L];
360
+ }, f.locale = function(c, a) {
361
+ if (!c) return this.$L;
362
+ var u = this.clone(), h = t(c, a, !0);
363
+ return h && (u.$L = h), u;
364
+ }, f.clone = function() {
365
+ return o.w(this.$d, this);
366
+ }, f.toDate = function() {
291
367
  return new Date(this.valueOf());
292
- }, l.toJSON = function() {
368
+ }, f.toJSON = function() {
293
369
  return this.isValid() ? this.toISOString() : null;
294
- }, l.toISOString = function() {
370
+ }, f.toISOString = function() {
295
371
  return this.$d.toISOString();
296
- }, l.toString = function() {
372
+ }, f.toString = function() {
297
373
  return this.$d.toUTCString();
298
- }, _;
299
- }(), S = m.prototype;
300
- return n.prototype = S, [["$ms", $], ["$s", z], ["$m", N], ["$H", P], ["$W", o], ["$M", A], ["$y", T], ["$D", Q]].forEach(function(_) {
301
- S[_[1]] = function(l) {
302
- return this.$g(l, _[0], _[1]);
374
+ }, m;
375
+ }(), b = g.prototype;
376
+ return n.prototype = b, [["$ms", C], ["$s", j], ["$m", H], ["$H", q], ["$W", w], ["$M", W], ["$y", K], ["$D", Q]].forEach(function(m) {
377
+ b[m[1]] = function(f) {
378
+ return this.$g(f, m[0], m[1]);
303
379
  };
304
- }), n.extend = function(_, l) {
305
- return _.$i || (_(l, m, n), _.$i = !0), n;
306
- }, n.locale = t, n.isDayjs = e, n.unix = function(_) {
307
- return n(1e3 * _);
308
- }, n.en = K[oe], n.Ls = K, n.p = {}, n;
380
+ }), n.extend = function(m, f) {
381
+ return m.$i || (m(f, g, n), m.$i = !0), n;
382
+ }, n.locale = t, n.isDayjs = e, n.unix = function(m) {
383
+ return n(1e3 * m);
384
+ }, n.en = Y[se], n.Ls = Y, n.p = {}, n;
309
385
  });
310
- }(me)), me.exports;
386
+ }(ye)), ye.exports;
311
387
  }
312
- var ze = je();
313
- const te = /* @__PURE__ */ Re(ze);
314
- var _e = { exports: {} }, We = _e.exports, Ee;
315
- function Be() {
316
- return Ee || (Ee = 1, function(f, r) {
317
- (function(c, d) {
318
- f.exports = d();
319
- })(We, function() {
320
- var c = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" };
321
- return function(d, C, $) {
322
- var z = C.prototype, N = z.format;
323
- $.en.formats = c, z.format = function(P) {
324
- P === void 0 && (P = "YYYY-MM-DDTHH:mm:ssZ");
325
- var o = this.$locale().formats, k = function(A, D) {
326
- return A.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(T, Q, G) {
327
- var X = G && G.toUpperCase();
328
- return Q || D[G] || c[G] || D[X].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(se, ae, Z) {
329
- return ae || Z.slice(1);
388
+ var Pe = Ue();
389
+ const G = /* @__PURE__ */ Ce(Pe);
390
+ var _e = { exports: {} }, Ye = _e.exports, Ee;
391
+ function Ne() {
392
+ return Ee || (Ee = 1, function(i, r) {
393
+ (function(s, l) {
394
+ i.exports = l();
395
+ })(Ye, function() {
396
+ var s = { LTS: "h:mm:ss A", LT: "h:mm A", L: "MM/DD/YYYY", LL: "MMMM D, YYYY", LLL: "MMMM D, YYYY h:mm A", LLLL: "dddd, MMMM D, YYYY h:mm A" };
397
+ return function(l, $, C) {
398
+ var j = $.prototype, H = j.format;
399
+ C.en.formats = s, j.format = function(q) {
400
+ q === void 0 && (q = "YYYY-MM-DDTHH:mm:ssZ");
401
+ var w = this.$locale().formats, P = function(W, X) {
402
+ return W.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, function(K, Q, ee) {
403
+ var ie = ee && ee.toUpperCase();
404
+ return Q || X[ee] || s[ee] || X[ie].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(he, le, oe) {
405
+ return le || oe.slice(1);
330
406
  });
331
407
  });
332
- }(P, o === void 0 ? {} : o);
333
- return N.call(this, k);
408
+ }(q, w === void 0 ? {} : w);
409
+ return H.call(this, P);
334
410
  };
335
411
  };
336
412
  });
337
413
  }(_e)), _e.exports;
338
414
  }
339
- var Ue = Be();
340
- const He = /* @__PURE__ */ Re(Ue);
341
- te.extend(He);
342
- Date.prototype.isAfter = function(f, r) {
343
- return te(this).isAfter(f, r);
415
+ var He = Ne();
416
+ const qe = /* @__PURE__ */ Ce(He);
417
+ G.extend(qe);
418
+ Date.prototype.isAfter = function(i, r) {
419
+ return G(this).isAfter(i, r);
344
420
  };
345
- Date.prototype.isBefore = function(f, r) {
346
- return te(this).isBefore(f, r);
421
+ Date.prototype.isBefore = function(i, r) {
422
+ return G(this).isBefore(i, r);
347
423
  };
348
- Date.prototype.format = function(f) {
349
- return te(this).format(f);
424
+ Date.prototype.format = function(i) {
425
+ return G(this).format(i);
350
426
  };
351
427
  Date.prototype.isValid = function() {
352
- return te(this).isValid();
428
+ return G(this).isValid();
353
429
  };
354
- Date.prototype.add = function(f, r) {
355
- return te(this).add(f, r).toDate();
430
+ Date.prototype.add = function(i, r) {
431
+ return G(this).add(i, r).toDate();
356
432
  };
357
- Date.prototype.subtract = function(f, r) {
358
- return te(this).subtract(f, r).toDate();
433
+ Date.prototype.subtract = function(i, r) {
434
+ return G(this).subtract(i, r).toDate();
359
435
  };
360
436
  Date.prototype.firstDayOfMonth = function() {
361
- return te(this).startOf("month").toDate();
437
+ return G(this).startOf("month").toDate();
362
438
  };
363
439
  Date.prototype.lastDayOfMonth = function() {
364
- return te(this).endOf("month").toDate();
440
+ return G(this).endOf("month").toDate();
365
441
  };
366
- Date.prototype.set = function(f, r) {
367
- return te(this).set(f, r).toDate();
442
+ Date.prototype.set = function(i, r) {
443
+ return G(this).set(i, r).toDate();
368
444
  };
369
- Date.prototype.diff = function(f, r) {
370
- return te(this).diff(f, r);
445
+ Date.prototype.diff = function(i, r) {
446
+ return G(this).diff(i, r);
371
447
  };
372
448
  String.prototype.capitalize = function() {
373
449
  return this.charAt(0).toUpperCase() + this.slice(1);
374
450
  };
375
- var Ye = /* @__PURE__ */ ((f) => (f.opera = "opera", f.firefox = "firefox", f.safari = "safari", f.ie = "ie", f.edge = "edge", f.edg = "edg", f.electron = "electron", f.chrome = "chrome", f.iOsSafari = "iOsSafari", f.edgiOs = "edgiOs", f.headlessChrome = "headlessChrome", f))(Ye || {});
376
- const Oe = [
377
- { breakpoint: "xs", screenWidth: 0 },
378
- { breakpoint: "sm", screenWidth: 576 },
379
- { breakpoint: "md", screenWidth: 768 },
380
- { breakpoint: "lg", screenWidth: 992 },
381
- { breakpoint: "xl", screenWidth: 1200 },
382
- { breakpoint: "xxl", screenWidth: 1400 },
383
- { breakpoint: "xxxl", screenWidth: 1600 }
384
- ];
385
- class Qe {
451
+ String.prototype.isNumber = function() {
452
+ return !isNaN(Number(this)) && this.trim() !== "";
453
+ };
454
+ String.prototype.isEmpty = function() {
455
+ return this === void 0 || !this || this.length === 0;
456
+ };
457
+ var V = /* @__PURE__ */ ((i) => (i.opera = "opera", i.firefox = "firefox", i.safari = "safari", i.ie = "ie", i.edge = "edge", i.edg = "edg", i.electron = "electron", i.chrome = "chrome", i.iOsSafari = "iOsSafari", i.edgiOs = "edgiOs", i.headlessChrome = "headlessChrome", i))(V || {});
458
+ const de = {
459
+ xs: 0,
460
+ sm: 576,
461
+ md: 768,
462
+ lg: 992,
463
+ xl: 1200,
464
+ xxl: 1400,
465
+ xxxl: 1600
466
+ };
467
+ class Ve {
386
468
  screenWidth = 0;
387
469
  lastBreakpoint;
388
470
  resizeListener;
389
- resizeCallbacks = /* @__PURE__ */ new Set();
471
+ breakpointChangeCallbacks = /* @__PURE__ */ new Set();
472
+ // feuert nur bei Breakpoint-Änderung
473
+ onResizeCallbacks = /* @__PURE__ */ new Set();
474
+ // feuert bei jedem throttled Resize
475
+ rafId = null;
476
+ emitTimeoutId = null;
477
+ // für debounce der onResizeCallbacks
478
+ pendingWidth;
479
+ pendingBreakpoint;
480
+ duplicateThresholdMs = 60;
390
481
  constructor() {
391
- typeof window < "u" && (this.screenWidth = window.innerWidth, this.resizeListener = this.onResize.bind(this), window.addEventListener("resize", this.resizeListener), this.lastBreakpoint = this.getBreakpointBySize(this.screenWidth));
482
+ typeof window < "u" && (this.screenWidth = window.innerWidth, this.resizeListener = this.onResize.bind(this), window.addEventListener("resize", this.resizeListener, { passive: !0 }), this.lastBreakpoint = this.getBreakpointByScreenWidth(this.screenWidth));
392
483
  }
393
484
  destroy() {
394
- typeof window < "u" && window.removeEventListener("resize", this.resizeListener), this.resizeCallbacks.clear();
485
+ typeof window < "u" && window.removeEventListener("resize", this.resizeListener), this.breakpointChangeCallbacks.clear(), this.onResizeCallbacks.clear(), this.rafId !== null && (cancelAnimationFrame(this.rafId), this.rafId = null);
486
+ }
487
+ getCurrentBreakpoint() {
488
+ return this.lastBreakpoint;
489
+ }
490
+ getCurrentScreenWidth() {
491
+ return this.screenWidth;
395
492
  }
396
493
  onBreakpointChange(r) {
397
- this.resizeCallbacks.add(r);
494
+ this.breakpointChangeCallbacks.add(r);
398
495
  }
399
496
  offBreakpointChange(r) {
400
- this.resizeCallbacks.delete(r);
497
+ this.breakpointChangeCallbacks.delete(r);
498
+ }
499
+ onResizeChange(r) {
500
+ this.onResizeCallbacks.add(r);
501
+ }
502
+ offResizeChange(r) {
503
+ this.onResizeCallbacks.delete(r);
401
504
  }
402
505
  getCurrentBrowser() {
403
506
  const r = navigator.userAgent.toLowerCase();
404
- if (this.isOpera()) return "opera";
405
- if (this.isFirefox()) return "firefox";
406
- if (this.isSafari()) return "safari";
407
- if (this.isIE()) return "ie";
408
- if (this.isEdge()) return "edge";
409
- if (this.isEdg()) return "edg";
410
- if (this.isElectron(r)) return "electron";
411
- if (this.isChrome()) return "chrome";
412
- if (this.isIOsSafari(r)) return "iOsSafari";
413
- if (this.isEdgiOs(r)) return "edgiOs";
414
- if (this.isHeadlessChrome(r)) return "headlessChrome";
507
+ if (this.isOpera()) return V.opera;
508
+ if (this.isFirefox()) return V.firefox;
509
+ if (this.isSafari()) return V.safari;
510
+ if (this.isIE()) return V.ie;
511
+ if (this.isEdge()) return V.edge;
512
+ if (this.isEdg()) return V.edg;
513
+ if (this.isElectron(r)) return V.electron;
514
+ if (this.isChrome()) return V.chrome;
515
+ if (this.isIOsSafari(r)) return V.iOsSafari;
516
+ if (this.isEdgiOs(r)) return V.edgiOs;
517
+ if (this.isHeadlessChrome(r)) return V.headlessChrome;
415
518
  throw new Error("Browser could not be detected: " + r);
416
519
  }
417
- getBreakpointBySize(r = this.screenWidth) {
418
- let c;
419
- for (const d of Oe)
420
- d.screenWidth <= r && (c = d);
421
- return c;
520
+ getBreakpointByScreenWidth(r = this.screenWidth) {
521
+ let s = "xs";
522
+ for (const l of Object.keys(de))
523
+ de[l] <= r && (s = l);
524
+ return { breakpoint: s, screenWidth: de[s] };
422
525
  }
423
526
  isScreenGreaterThan(r) {
424
- const c = this.getBreakpoint(r);
425
- return this.screenWidth > (c?.screenWidth ?? 0);
527
+ return this.screenWidth > de[r];
426
528
  }
427
529
  isScreenSmallerThan(r) {
428
- const c = this.getBreakpoint(r);
429
- return this.screenWidth < (c?.screenWidth ?? 0);
530
+ return this.screenWidth < de[r];
430
531
  }
431
532
  getBreakpoint(r) {
432
- return Oe.find((c) => c.breakpoint === r);
533
+ return {
534
+ breakpoint: r,
535
+ screenWidth: de[r]
536
+ };
433
537
  }
434
- // ==== Browser Detection (Private) ====
435
538
  isOpera() {
436
539
  return typeof window < "u" && (!!window.opr && !!window.opr.addons || !!window.opera || navigator.userAgent.includes("OPR/"));
437
540
  }
438
541
  isFirefox() {
439
- return typeof InstallTrigger < "u";
542
+ return typeof globalThis.InstallTrigger < "u";
440
543
  }
441
544
  isSafari() {
442
- return /constructor/i.test(window.HTMLElement) || ((r) => r.toString() === "[object SafariRemoteNotification]")(
545
+ return typeof window > "u" ? !1 : /constructor/i.test(window.HTMLElement) || ((r) => r.toString() === "[object SafariRemoteNotification]")(
443
546
  !window.safari || window.safari && window.safari.pushNotification
444
547
  );
445
548
  }
446
549
  isIE() {
447
- return !!document.documentMode;
550
+ return typeof document > "u" ? !1 : !!document.documentMode;
448
551
  }
449
552
  isEdge() {
450
- return !this.isIE() && !!window.StyleMedia;
553
+ return typeof window > "u" ? !1 : !this.isIE() && !!window.StyleMedia;
451
554
  }
452
555
  isEdg() {
453
- return navigator.userAgent.toLowerCase().includes("edg");
556
+ return typeof navigator > "u" ? !1 : navigator.userAgent.toLowerCase().includes("edg");
454
557
  }
455
558
  isElectron(r) {
456
559
  return r.includes("electron");
457
560
  }
458
561
  isChrome() {
459
- return typeof window < "u" && !!window.chrome && !this.isOpera() && !this.isEdge() && !this.isEdg() && !this.isFirefox() && !this.isSafari() && !this.isIE();
562
+ return typeof window > "u" ? !1 : !!window.chrome && !this.isOpera() && !this.isEdge() && !this.isEdg() && !this.isFirefox() && !this.isSafari() && !this.isIE();
460
563
  }
461
564
  isIOsSafari(r) {
462
- return r.includes("iphone") || r.includes("ipad") || r.includes("macintosh") && "ontouchend" in document && r.includes("safari");
565
+ return r.includes("iphone") || r.includes("ipad") || r.includes("macintosh") && typeof document < "u" && "ontouchend" in document && r.includes("safari");
463
566
  }
464
567
  isEdgiOs(r) {
465
568
  return r.includes("edgios");
@@ -467,132 +570,61 @@ class Qe {
467
570
  isHeadlessChrome(r) {
468
571
  return r.includes("headlesschrome");
469
572
  }
470
- // ==== Resize Handling ====
471
- onResize(r) {
472
- const c = r.target.innerWidth;
473
- this.screenWidth = c;
474
- const d = this.getBreakpointBySize(c);
475
- this.lastBreakpoint?.breakpoint !== d?.breakpoint && (this.lastBreakpoint = d, this.resizeCallbacks.forEach((C) => C(d)));
476
- }
573
+ onResize = () => {
574
+ if (typeof window > "u") return;
575
+ const r = window.innerWidth, s = this.getBreakpointByScreenWidth(r);
576
+ this.lastBreakpoint?.breakpoint !== s?.breakpoint && (this.lastBreakpoint = s, s && this.breakpointChangeCallbacks.forEach((l) => l(s))), this.pendingWidth = r, this.pendingBreakpoint = s, this.emitTimeoutId && clearTimeout(this.emitTimeoutId), this.emitTimeoutId = window.setTimeout(() => {
577
+ this.pendingBreakpoint && this.onResizeCallbacks.forEach((l) => l(this.pendingWidth, this.pendingBreakpoint)), this.pendingWidth = void 0, this.pendingBreakpoint = void 0, this.emitTimeoutId = null;
578
+ }, this.duplicateThresholdMs);
579
+ };
477
580
  }
478
581
  class Ze {
479
582
  copy(r) {
480
583
  return navigator.clipboard.writeText(r);
481
584
  }
482
585
  }
483
- var ye = { exports: {} }, qe = ye.exports, xe;
484
- function Pe() {
485
- return xe || (xe = 1, function(f, r) {
486
- (function(c, d) {
487
- d();
488
- })(qe, function() {
489
- function c(o, k) {
490
- return typeof k > "u" ? k = { autoBom: !1 } : typeof k != "object" && (console.warn("Deprecated: Expected third argument to be a object"), k = { autoBom: !k }), k.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(o.type) ? new Blob(["\uFEFF", o], { type: o.type }) : o;
491
- }
492
- function d(o, k, A) {
493
- var D = new XMLHttpRequest();
494
- D.open("GET", o), D.responseType = "blob", D.onload = function() {
495
- P(D.response, k, A);
496
- }, D.onerror = function() {
497
- console.error("could not download file");
498
- }, D.send();
499
- }
500
- function C(o) {
501
- var k = new XMLHttpRequest();
502
- k.open("HEAD", o, !1);
503
- try {
504
- k.send();
505
- } catch {
506
- }
507
- return 200 <= k.status && 299 >= k.status;
508
- }
509
- function $(o) {
510
- try {
511
- o.dispatchEvent(new MouseEvent("click"));
512
- } catch {
513
- var k = document.createEvent("MouseEvents");
514
- k.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), o.dispatchEvent(k);
515
- }
516
- }
517
- var z = typeof window == "object" && window.window === window ? window : typeof self == "object" && self.self === self ? self : typeof ge == "object" && ge.global === ge ? ge : void 0, N = z.navigator && /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent), P = z.saveAs || (typeof window != "object" || window !== z ? function() {
518
- } : "download" in HTMLAnchorElement.prototype && !N ? function(o, k, A) {
519
- var D = z.URL || z.webkitURL, T = document.createElement("a");
520
- k = k || o.name || "download", T.download = k, T.rel = "noopener", typeof o == "string" ? (T.href = o, T.origin === location.origin ? $(T) : C(T.href) ? d(o, k, A) : $(T, T.target = "_blank")) : (T.href = D.createObjectURL(o), setTimeout(function() {
521
- D.revokeObjectURL(T.href);
522
- }, 4e4), setTimeout(function() {
523
- $(T);
524
- }, 0));
525
- } : "msSaveOrOpenBlob" in navigator ? function(o, k, A) {
526
- if (k = k || o.name || "download", typeof o != "string") navigator.msSaveOrOpenBlob(c(o, A), k);
527
- else if (C(o)) d(o, k, A);
528
- else {
529
- var D = document.createElement("a");
530
- D.href = o, D.target = "_blank", setTimeout(function() {
531
- $(D);
532
- });
533
- }
534
- } : function(o, k, A, D) {
535
- if (D = D || open("", "_blank"), D && (D.document.title = D.document.body.innerText = "downloading..."), typeof o == "string") return d(o, k, A);
536
- var T = o.type === "application/octet-stream", Q = /constructor/i.test(z.HTMLElement) || z.safari, G = /CriOS\/[\d]+/.test(navigator.userAgent);
537
- if ((G || T && Q || N) && typeof FileReader < "u") {
538
- var X = new FileReader();
539
- X.onloadend = function() {
540
- var Z = X.result;
541
- Z = G ? Z : Z.replace(/^data:[^;]*;/, "data:attachment/file;"), D ? D.location.href = Z : location = Z, D = null;
542
- }, X.readAsDataURL(o);
543
- } else {
544
- var se = z.URL || z.webkitURL, ae = se.createObjectURL(o);
545
- D ? D.location = ae : location.href = ae, D = null, setTimeout(function() {
546
- se.revokeObjectURL(ae);
547
- }, 4e4);
548
- }
549
- });
550
- z.saveAs = P.saveAs = P, f.exports = P;
551
- });
552
- }(ye)), ye.exports;
553
- }
554
- var Ne = Pe(), ve = { exports: {} };
586
+ var we = { exports: {} };
555
587
  /* @license
556
588
  Papa Parse
557
589
  v5.5.3
558
590
  https://github.com/mholt/PapaParse
559
591
  License: MIT
560
592
  */
561
- var Ke = ve.exports, De;
593
+ var Ke = we.exports, Oe;
562
594
  function Je() {
563
- return De || (De = 1, function(f, r) {
564
- ((c, d) => {
565
- f.exports = d();
566
- })(Ke, function c() {
567
- var d = typeof self < "u" ? self : typeof window < "u" ? window : d !== void 0 ? d : {}, C, $ = !d.document && !!d.postMessage, z = d.IS_PAPA_WORKER || !1, N = {}, P = 0, o = {};
568
- function k(e) {
595
+ return Oe || (Oe = 1, function(i, r) {
596
+ ((s, l) => {
597
+ i.exports = l();
598
+ })(Ke, function s() {
599
+ var l = typeof self < "u" ? self : typeof window < "u" ? window : l !== void 0 ? l : {}, $, C = !l.document && !!l.postMessage, j = l.IS_PAPA_WORKER || !1, H = {}, q = 0, w = {};
600
+ function P(e) {
569
601
  this._handle = null, this._finished = !1, this._completed = !1, this._halted = !1, this._input = null, this._baseIndex = 0, this._partialLine = "", this._rowCount = 0, this._start = 0, this._nextChunk = null, this.isFirstChunk = !0, this._completeResults = { data: [], errors: [], meta: {} }, (function(t) {
570
- var n = oe(t);
571
- n.chunkSize = parseInt(n.chunkSize), t.step || t.chunk || (n.chunkSize = null), this._handle = new G(n), (this._handle.streamer = this)._config = n;
602
+ var n = se(t);
603
+ n.chunkSize = parseInt(n.chunkSize), t.step || t.chunk || (n.chunkSize = null), this._handle = new ee(n), (this._handle.streamer = this)._config = n;
572
604
  }).call(this, e), this.parseChunk = function(t, n) {
573
- var s = parseInt(this._config.skipFirstNLines) || 0;
574
- if (this.isFirstChunk && 0 < s) {
575
- let S = this._config.newline;
576
- S || (m = this._config.quoteChar || '"', S = this._handle.guessLineEndings(t, m)), t = [...t.split(S).slice(s)].join(S);
605
+ var o = parseInt(this._config.skipFirstNLines) || 0;
606
+ if (this.isFirstChunk && 0 < o) {
607
+ let b = this._config.newline;
608
+ b || (g = this._config.quoteChar || '"', b = this._handle.guessLineEndings(t, g)), t = [...t.split(b).slice(o)].join(b);
577
609
  }
578
- this.isFirstChunk && I(this._config.beforeFirstChunk) && (m = this._config.beforeFirstChunk(t)) !== void 0 && (t = m), this.isFirstChunk = !1, this._halted = !1;
579
- var s = this._partialLine + t, m = (this._partialLine = "", this._handle.parse(s, this._baseIndex, !this._finished));
610
+ this.isFirstChunk && R(this._config.beforeFirstChunk) && (g = this._config.beforeFirstChunk(t)) !== void 0 && (t = g), this.isFirstChunk = !1, this._halted = !1;
611
+ var o = this._partialLine + t, g = (this._partialLine = "", this._handle.parse(o, this._baseIndex, !this._finished));
580
612
  if (!this._handle.paused() && !this._handle.aborted()) {
581
- if (t = m.meta.cursor, s = (this._finished || (this._partialLine = s.substring(t - this._baseIndex), this._baseIndex = t), m && m.data && (this._rowCount += m.data.length), this._finished || this._config.preview && this._rowCount >= this._config.preview), z) d.postMessage({ results: m, workerId: o.WORKER_ID, finished: s });
582
- else if (I(this._config.chunk) && !n) {
583
- if (this._config.chunk(m, this._handle), this._handle.paused() || this._handle.aborted()) return void (this._halted = !0);
584
- this._completeResults = m = void 0;
613
+ if (t = g.meta.cursor, o = (this._finished || (this._partialLine = o.substring(t - this._baseIndex), this._baseIndex = t), g && g.data && (this._rowCount += g.data.length), this._finished || this._config.preview && this._rowCount >= this._config.preview), j) l.postMessage({ results: g, workerId: w.WORKER_ID, finished: o });
614
+ else if (R(this._config.chunk) && !n) {
615
+ if (this._config.chunk(g, this._handle), this._handle.paused() || this._handle.aborted()) return void (this._halted = !0);
616
+ this._completeResults = g = void 0;
585
617
  }
586
- return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(m.data), this._completeResults.errors = this._completeResults.errors.concat(m.errors), this._completeResults.meta = m.meta), this._completed || !s || !I(this._config.complete) || m && m.meta.aborted || (this._config.complete(this._completeResults, this._input), this._completed = !0), s || m && m.meta.paused || this._nextChunk(), m;
618
+ return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(g.data), this._completeResults.errors = this._completeResults.errors.concat(g.errors), this._completeResults.meta = g.meta), this._completed || !o || !R(this._config.complete) || g && g.meta.aborted || (this._config.complete(this._completeResults, this._input), this._completed = !0), o || g && g.meta.paused || this._nextChunk(), g;
587
619
  }
588
620
  this._halted = !0;
589
621
  }, this._sendError = function(t) {
590
- I(this._config.error) ? this._config.error(t) : z && this._config.error && d.postMessage({ workerId: o.WORKER_ID, error: t, finished: !1 });
622
+ R(this._config.error) ? this._config.error(t) : j && this._config.error && l.postMessage({ workerId: w.WORKER_ID, error: t, finished: !1 });
591
623
  };
592
624
  }
593
- function A(e) {
625
+ function W(e) {
594
626
  var t;
595
- (e = e || {}).chunkSize || (e.chunkSize = o.RemoteChunkSize), k.call(this, e), this._nextChunk = $ ? function() {
627
+ (e = e || {}).chunkSize || (e.chunkSize = w.RemoteChunkSize), P.call(this, e), this._nextChunk = C ? function() {
596
628
  this._readChunk(), this._chunkLoaded();
597
629
  } : function() {
598
630
  this._readChunk();
@@ -601,18 +633,18 @@ function Je() {
601
633
  }, this._readChunk = function() {
602
634
  if (this._finished) this._chunkLoaded();
603
635
  else {
604
- if (t = new XMLHttpRequest(), this._config.withCredentials && (t.withCredentials = this._config.withCredentials), $ || (t.onload = K(this._chunkLoaded, this), t.onerror = K(this._chunkError, this)), t.open(this._config.downloadRequestBody ? "POST" : "GET", this._input, !$), this._config.downloadRequestHeaders) {
605
- var n, s = this._config.downloadRequestHeaders;
606
- for (n in s) t.setRequestHeader(n, s[n]);
636
+ if (t = new XMLHttpRequest(), this._config.withCredentials && (t.withCredentials = this._config.withCredentials), C || (t.onload = Y(this._chunkLoaded, this), t.onerror = Y(this._chunkError, this)), t.open(this._config.downloadRequestBody ? "POST" : "GET", this._input, !C), this._config.downloadRequestHeaders) {
637
+ var n, o = this._config.downloadRequestHeaders;
638
+ for (n in o) t.setRequestHeader(n, o[n]);
607
639
  }
608
- var m;
609
- this._config.chunkSize && (m = this._start + this._config.chunkSize - 1, t.setRequestHeader("Range", "bytes=" + this._start + "-" + m));
640
+ var g;
641
+ this._config.chunkSize && (g = this._start + this._config.chunkSize - 1, t.setRequestHeader("Range", "bytes=" + this._start + "-" + g));
610
642
  try {
611
643
  t.send(this._config.downloadRequestBody);
612
- } catch (S) {
613
- this._chunkError(S.message);
644
+ } catch (b) {
645
+ this._chunkError(b.message);
614
646
  }
615
- $ && t.status === 0 && this._chunkError();
647
+ C && t.status === 0 && this._chunkError();
616
648
  }
617
649
  }, this._chunkLoaded = function() {
618
650
  t.readyState === 4 && (t.status < 200 || 400 <= t.status ? this._chunkError() : (this._start += this._config.chunkSize || t.responseText.length, this._finished = !this._config.chunkSize || this._start >= ((n) => (n = n.getResponseHeader("Content-Range")) !== null ? parseInt(n.substring(n.lastIndexOf("/") + 1)) : -1)(t), this.parseChunk(t.responseText)));
@@ -620,429 +652,429 @@ function Je() {
620
652
  n = t.statusText || n, this._sendError(new Error(n));
621
653
  };
622
654
  }
623
- function D(e) {
624
- (e = e || {}).chunkSize || (e.chunkSize = o.LocalChunkSize), k.call(this, e);
625
- var t, n, s = typeof FileReader < "u";
626
- this.stream = function(m) {
627
- this._input = m, n = m.slice || m.webkitSlice || m.mozSlice, s ? ((t = new FileReader()).onload = K(this._chunkLoaded, this), t.onerror = K(this._chunkError, this)) : t = new FileReaderSync(), this._nextChunk();
655
+ function X(e) {
656
+ (e = e || {}).chunkSize || (e.chunkSize = w.LocalChunkSize), P.call(this, e);
657
+ var t, n, o = typeof FileReader < "u";
658
+ this.stream = function(g) {
659
+ this._input = g, n = g.slice || g.webkitSlice || g.mozSlice, o ? ((t = new FileReader()).onload = Y(this._chunkLoaded, this), t.onerror = Y(this._chunkError, this)) : t = new FileReaderSync(), this._nextChunk();
628
660
  }, this._nextChunk = function() {
629
661
  this._finished || this._config.preview && !(this._rowCount < this._config.preview) || this._readChunk();
630
662
  }, this._readChunk = function() {
631
- var m = this._input, S = (this._config.chunkSize && (S = Math.min(this._start + this._config.chunkSize, this._input.size), m = n.call(m, this._start, S)), t.readAsText(m, this._config.encoding));
632
- s || this._chunkLoaded({ target: { result: S } });
633
- }, this._chunkLoaded = function(m) {
634
- this._start += this._config.chunkSize, this._finished = !this._config.chunkSize || this._start >= this._input.size, this.parseChunk(m.target.result);
663
+ var g = this._input, b = (this._config.chunkSize && (b = Math.min(this._start + this._config.chunkSize, this._input.size), g = n.call(g, this._start, b)), t.readAsText(g, this._config.encoding));
664
+ o || this._chunkLoaded({ target: { result: b } });
665
+ }, this._chunkLoaded = function(g) {
666
+ this._start += this._config.chunkSize, this._finished = !this._config.chunkSize || this._start >= this._input.size, this.parseChunk(g.target.result);
635
667
  }, this._chunkError = function() {
636
668
  this._sendError(t.error);
637
669
  };
638
670
  }
639
- function T(e) {
671
+ function K(e) {
640
672
  var t;
641
- k.call(this, e = e || {}), this.stream = function(n) {
673
+ P.call(this, e = e || {}), this.stream = function(n) {
642
674
  return t = n, this._nextChunk();
643
675
  }, this._nextChunk = function() {
644
- var n, s;
645
- if (!this._finished) return n = this._config.chunkSize, t = n ? (s = t.substring(0, n), t.substring(n)) : (s = t, ""), this._finished = !t, this.parseChunk(s);
676
+ var n, o;
677
+ if (!this._finished) return n = this._config.chunkSize, t = n ? (o = t.substring(0, n), t.substring(n)) : (o = t, ""), this._finished = !t, this.parseChunk(o);
646
678
  };
647
679
  }
648
680
  function Q(e) {
649
- k.call(this, e = e || {});
650
- var t = [], n = !0, s = !1;
681
+ P.call(this, e = e || {});
682
+ var t = [], n = !0, o = !1;
651
683
  this.pause = function() {
652
- k.prototype.pause.apply(this, arguments), this._input.pause();
684
+ P.prototype.pause.apply(this, arguments), this._input.pause();
653
685
  }, this.resume = function() {
654
- k.prototype.resume.apply(this, arguments), this._input.resume();
655
- }, this.stream = function(m) {
656
- this._input = m, this._input.on("data", this._streamData), this._input.on("end", this._streamEnd), this._input.on("error", this._streamError);
686
+ P.prototype.resume.apply(this, arguments), this._input.resume();
687
+ }, this.stream = function(g) {
688
+ this._input = g, this._input.on("data", this._streamData), this._input.on("end", this._streamEnd), this._input.on("error", this._streamError);
657
689
  }, this._checkIsFinished = function() {
658
- s && t.length === 1 && (this._finished = !0);
690
+ o && t.length === 1 && (this._finished = !0);
659
691
  }, this._nextChunk = function() {
660
692
  this._checkIsFinished(), t.length ? this.parseChunk(t.shift()) : n = !0;
661
- }, this._streamData = K(function(m) {
693
+ }, this._streamData = Y(function(g) {
662
694
  try {
663
- t.push(typeof m == "string" ? m : m.toString(this._config.encoding)), n && (n = !1, this._checkIsFinished(), this.parseChunk(t.shift()));
664
- } catch (S) {
665
- this._streamError(S);
695
+ t.push(typeof g == "string" ? g : g.toString(this._config.encoding)), n && (n = !1, this._checkIsFinished(), this.parseChunk(t.shift()));
696
+ } catch (b) {
697
+ this._streamError(b);
666
698
  }
667
- }, this), this._streamError = K(function(m) {
668
- this._streamCleanUp(), this._sendError(m);
669
- }, this), this._streamEnd = K(function() {
670
- this._streamCleanUp(), s = !0, this._streamData("");
671
- }, this), this._streamCleanUp = K(function() {
699
+ }, this), this._streamError = Y(function(g) {
700
+ this._streamCleanUp(), this._sendError(g);
701
+ }, this), this._streamEnd = Y(function() {
702
+ this._streamCleanUp(), o = !0, this._streamData("");
703
+ }, this), this._streamCleanUp = Y(function() {
672
704
  this._input.removeListener("data", this._streamData), this._input.removeListener("end", this._streamEnd), this._input.removeListener("error", this._streamError);
673
705
  }, this);
674
706
  }
675
- function G(e) {
676
- var t, n, s, m, S = Math.pow(2, 53), _ = -S, l = /^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/, h = /^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/, i = this, a = 0, u = 0, y = !1, g = !1, v = [], p = { data: [], errors: [], meta: {} };
677
- function M(b) {
678
- return e.skipEmptyLines === "greedy" ? b.join("").trim() === "" : b.length === 1 && b[0].length === 0;
707
+ function ee(e) {
708
+ var t, n, o, g, b = Math.pow(2, 53), m = -b, f = /^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/, c = /^((\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)))$/, a = this, u = 0, h = 0, y = !1, p = !1, _ = [], d = { data: [], errors: [], meta: {} };
709
+ function x(k) {
710
+ return e.skipEmptyLines === "greedy" ? k.join("").trim() === "" : k.length === 1 && k[0].length === 0;
679
711
  }
680
- function L() {
681
- if (p && s && (Y("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" + o.DefaultDelimiter + "'"), s = !1), e.skipEmptyLines && (p.data = p.data.filter(function(w) {
682
- return !M(w);
683
- })), B()) {
684
- let w = function(F, U) {
685
- I(e.transformHeader) && (F = e.transformHeader(F, U)), v.push(F);
712
+ function M() {
713
+ if (d && o && (B("Delimiter", "UndetectableDelimiter", "Unable to auto-detect delimiting character; defaulted to '" + w.DefaultDelimiter + "'"), o = !1), e.skipEmptyLines && (d.data = d.data.filter(function(v) {
714
+ return !x(v);
715
+ })), T()) {
716
+ let v = function(L, F) {
717
+ R(e.transformHeader) && (L = e.transformHeader(L, F)), _.push(L);
686
718
  };
687
- if (p) if (Array.isArray(p.data[0])) {
688
- for (var b = 0; B() && b < p.data.length; b++) p.data[b].forEach(w);
689
- p.data.splice(0, 1);
690
- } else p.data.forEach(w);
719
+ if (d) if (Array.isArray(d.data[0])) {
720
+ for (var k = 0; T() && k < d.data.length; k++) d.data[k].forEach(v);
721
+ d.data.splice(0, 1);
722
+ } else d.data.forEach(v);
691
723
  }
692
- function O(w, F) {
693
- for (var U = e.header ? {} : [], j = 0; j < w.length; j++) {
694
- var W = j, R = w[j], R = ((ee, E) => ((H) => (e.dynamicTypingFunction && e.dynamicTyping[H] === void 0 && (e.dynamicTyping[H] = e.dynamicTypingFunction(H)), (e.dynamicTyping[H] || e.dynamicTyping) === !0))(ee) ? E === "true" || E === "TRUE" || E !== "false" && E !== "FALSE" && (((H) => {
695
- if (l.test(H) && (H = parseFloat(H), _ < H && H < S))
724
+ function E(v, L) {
725
+ for (var F = e.header ? {} : [], A = 0; A < v.length; A++) {
726
+ var I = A, D = v[A], D = ((Z, S) => ((z) => (e.dynamicTypingFunction && e.dynamicTyping[z] === void 0 && (e.dynamicTyping[z] = e.dynamicTypingFunction(z)), (e.dynamicTyping[z] || e.dynamicTyping) === !0))(Z) ? S === "true" || S === "TRUE" || S !== "false" && S !== "FALSE" && (((z) => {
727
+ if (f.test(z) && (z = parseFloat(z), m < z && z < b))
696
728
  return 1;
697
- })(E) ? parseFloat(E) : h.test(E) ? new Date(E) : E === "" ? null : E) : E)(W = e.header ? j >= v.length ? "__parsed_extra" : v[j] : W, R = e.transform ? e.transform(R, W) : R);
698
- W === "__parsed_extra" ? (U[W] = U[W] || [], U[W].push(R)) : U[W] = R;
729
+ })(S) ? parseFloat(S) : c.test(S) ? new Date(S) : S === "" ? null : S) : S)(I = e.header ? A >= _.length ? "__parsed_extra" : _[A] : I, D = e.transform ? e.transform(D, I) : D);
730
+ I === "__parsed_extra" ? (F[I] = F[I] || [], F[I].push(D)) : F[I] = D;
699
731
  }
700
- return e.header && (j > v.length ? Y("FieldMismatch", "TooManyFields", "Too many fields: expected " + v.length + " fields but parsed " + j, u + F) : j < v.length && Y("FieldMismatch", "TooFewFields", "Too few fields: expected " + v.length + " fields but parsed " + j, u + F)), U;
732
+ return e.header && (A > _.length ? B("FieldMismatch", "TooManyFields", "Too many fields: expected " + _.length + " fields but parsed " + A, h + L) : A < _.length && B("FieldMismatch", "TooFewFields", "Too few fields: expected " + _.length + " fields but parsed " + A, h + L)), F;
701
733
  }
702
- var x;
703
- p && (e.header || e.dynamicTyping || e.transform) && (x = 1, !p.data.length || Array.isArray(p.data[0]) ? (p.data = p.data.map(O), x = p.data.length) : p.data = O(p.data, 0), e.header && p.meta && (p.meta.fields = v), u += x);
734
+ var O;
735
+ d && (e.header || e.dynamicTyping || e.transform) && (O = 1, !d.data.length || Array.isArray(d.data[0]) ? (d.data = d.data.map(E), O = d.data.length) : d.data = E(d.data, 0), e.header && d.meta && (d.meta.fields = _), h += O);
704
736
  }
705
- function B() {
706
- return e.header && v.length === 0;
737
+ function T() {
738
+ return e.header && _.length === 0;
707
739
  }
708
- function Y(b, O, x, w) {
709
- b = { type: b, code: O, message: x }, w !== void 0 && (b.row = w), p.errors.push(b);
740
+ function B(k, E, O, v) {
741
+ k = { type: k, code: E, message: O }, v !== void 0 && (k.row = v), d.errors.push(k);
710
742
  }
711
- I(e.step) && (m = e.step, e.step = function(b) {
712
- p = b, B() ? L() : (L(), p.data.length !== 0 && (a += b.data.length, e.preview && a > e.preview ? n.abort() : (p.data = p.data[0], m(p, i))));
713
- }), this.parse = function(b, O, x) {
714
- var w = e.quoteChar || '"', w = (e.newline || (e.newline = this.guessLineEndings(b, w)), s = !1, e.delimiter ? I(e.delimiter) && (e.delimiter = e.delimiter(b), p.meta.delimiter = e.delimiter) : ((w = ((F, U, j, W, R) => {
715
- var ee, E, H, he;
716
- R = R || [",", " ", "|", ";", o.RECORD_SEP, o.UNIT_SEP];
717
- for (var ce = 0; ce < R.length; ce++) {
718
- for (var re, le = R[ce], J = 0, ne = 0, q = 0, V = (H = void 0, new se({ comments: W, delimiter: le, newline: U, preview: 10 }).parse(F)), ue = 0; ue < V.data.length; ue++) j && M(V.data[ue]) ? q++ : (re = V.data[ue].length, ne += re, H === void 0 ? H = re : 0 < re && (J += Math.abs(re - H), H = re));
719
- 0 < V.data.length && (ne /= V.data.length - q), (E === void 0 || J <= E) && (he === void 0 || he < ne) && 1.99 < ne && (E = J, ee = le, he = ne);
743
+ R(e.step) && (g = e.step, e.step = function(k) {
744
+ d = k, T() ? M() : (M(), d.data.length !== 0 && (u += k.data.length, e.preview && u > e.preview ? n.abort() : (d.data = d.data[0], g(d, a))));
745
+ }), this.parse = function(k, E, O) {
746
+ var v = e.quoteChar || '"', v = (e.newline || (e.newline = this.guessLineEndings(k, v)), o = !1, e.delimiter ? R(e.delimiter) && (e.delimiter = e.delimiter(k), d.meta.delimiter = e.delimiter) : ((v = ((L, F, A, I, D) => {
747
+ var Z, S, z, ue;
748
+ D = D || [",", " ", "|", ";", w.RECORD_SEP, w.UNIT_SEP];
749
+ for (var ce = 0; ce < D.length; ce++) {
750
+ for (var te, pe = D[ce], N = 0, re = 0, U = 0, J = (z = void 0, new he({ comments: I, delimiter: pe, newline: F, preview: 10 }).parse(L)), ae = 0; ae < J.data.length; ae++) A && x(J.data[ae]) ? U++ : (te = J.data[ae].length, re += te, z === void 0 ? z = te : 0 < te && (N += Math.abs(te - z), z = te));
751
+ 0 < J.data.length && (re /= J.data.length - U), (S === void 0 || N <= S) && (ue === void 0 || ue < re) && 1.99 < re && (S = N, Z = pe, ue = re);
720
752
  }
721
- return { successful: !!(e.delimiter = ee), bestDelimiter: ee };
722
- })(b, e.newline, e.skipEmptyLines, e.comments, e.delimitersToGuess)).successful ? e.delimiter = w.bestDelimiter : (s = !0, e.delimiter = o.DefaultDelimiter), p.meta.delimiter = e.delimiter), oe(e));
723
- return e.preview && e.header && w.preview++, t = b, n = new se(w), p = n.parse(t, O, x), L(), y ? { meta: { paused: !0 } } : p || { meta: { paused: !1 } };
753
+ return { successful: !!(e.delimiter = Z), bestDelimiter: Z };
754
+ })(k, e.newline, e.skipEmptyLines, e.comments, e.delimitersToGuess)).successful ? e.delimiter = v.bestDelimiter : (o = !0, e.delimiter = w.DefaultDelimiter), d.meta.delimiter = e.delimiter), se(e));
755
+ return e.preview && e.header && v.preview++, t = k, n = new he(v), d = n.parse(t, E, O), M(), y ? { meta: { paused: !0 } } : d || { meta: { paused: !1 } };
724
756
  }, this.paused = function() {
725
757
  return y;
726
758
  }, this.pause = function() {
727
- y = !0, n.abort(), t = I(e.chunk) ? "" : t.substring(n.getCharIndex());
759
+ y = !0, n.abort(), t = R(e.chunk) ? "" : t.substring(n.getCharIndex());
728
760
  }, this.resume = function() {
729
- i.streamer._halted ? (y = !1, i.streamer.parseChunk(t, !0)) : setTimeout(i.resume, 3);
761
+ a.streamer._halted ? (y = !1, a.streamer.parseChunk(t, !0)) : setTimeout(a.resume, 3);
730
762
  }, this.aborted = function() {
731
- return g;
763
+ return p;
732
764
  }, this.abort = function() {
733
- g = !0, n.abort(), p.meta.aborted = !0, I(e.complete) && e.complete(p), t = "";
734
- }, this.guessLineEndings = function(F, w) {
735
- F = F.substring(0, 1048576);
736
- var w = new RegExp(X(w) + "([^]*?)" + X(w), "gm"), x = (F = F.replace(w, "")).split("\r"), w = F.split(`
737
- `), F = 1 < w.length && w[0].length < x[0].length;
738
- if (x.length === 1 || F) return `
765
+ p = !0, n.abort(), d.meta.aborted = !0, R(e.complete) && e.complete(d), t = "";
766
+ }, this.guessLineEndings = function(L, v) {
767
+ L = L.substring(0, 1048576);
768
+ var v = new RegExp(ie(v) + "([^]*?)" + ie(v), "gm"), O = (L = L.replace(v, "")).split("\r"), v = L.split(`
769
+ `), L = 1 < v.length && v[0].length < O[0].length;
770
+ if (O.length === 1 || L) return `
739
771
  `;
740
- for (var U = 0, j = 0; j < x.length; j++) x[j][0] === `
741
- ` && U++;
742
- return U >= x.length / 2 ? `\r
772
+ for (var F = 0, A = 0; A < O.length; A++) O[A][0] === `
773
+ ` && F++;
774
+ return F >= O.length / 2 ? `\r
743
775
  ` : "\r";
744
776
  };
745
777
  }
746
- function X(e) {
778
+ function ie(e) {
747
779
  return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
748
780
  }
749
- function se(e) {
750
- var t = (e = e || {}).delimiter, n = e.newline, s = e.comments, m = e.step, S = e.preview, _ = e.fastMode, l = null, h = !1, i = e.quoteChar == null ? '"' : e.quoteChar, a = i;
751
- if (e.escapeChar !== void 0 && (a = e.escapeChar), (typeof t != "string" || -1 < o.BAD_DELIMITERS.indexOf(t)) && (t = ","), s === t) throw new Error("Comment character same as delimiter");
752
- s === !0 ? s = "#" : (typeof s != "string" || -1 < o.BAD_DELIMITERS.indexOf(s)) && (s = !1), n !== `
781
+ function he(e) {
782
+ var t = (e = e || {}).delimiter, n = e.newline, o = e.comments, g = e.step, b = e.preview, m = e.fastMode, f = null, c = !1, a = e.quoteChar == null ? '"' : e.quoteChar, u = a;
783
+ if (e.escapeChar !== void 0 && (u = e.escapeChar), (typeof t != "string" || -1 < w.BAD_DELIMITERS.indexOf(t)) && (t = ","), o === t) throw new Error("Comment character same as delimiter");
784
+ o === !0 ? o = "#" : (typeof o != "string" || -1 < w.BAD_DELIMITERS.indexOf(o)) && (o = !1), n !== `
753
785
  ` && n !== "\r" && n !== `\r
754
786
  ` && (n = `
755
787
  `);
756
- var u = 0, y = !1;
757
- this.parse = function(g, v, p) {
758
- if (typeof g != "string") throw new Error("Input must be a string");
759
- var M = g.length, L = t.length, B = n.length, Y = s.length, b = I(m), O = [], x = [], w = [], F = u = 0;
760
- if (!g) return J();
761
- if (_ || _ !== !1 && g.indexOf(i) === -1) {
762
- for (var U = g.split(n), j = 0; j < U.length; j++) {
763
- if (w = U[j], u += w.length, j !== U.length - 1) u += n.length;
764
- else if (p) return J();
765
- if (!s || w.substring(0, Y) !== s) {
766
- if (b) {
767
- if (O = [], he(w.split(t)), ne(), y) return J();
768
- } else he(w.split(t));
769
- if (S && S <= j) return O = O.slice(0, S), J(!0);
788
+ var h = 0, y = !1;
789
+ this.parse = function(p, _, d) {
790
+ if (typeof p != "string") throw new Error("Input must be a string");
791
+ var x = p.length, M = t.length, T = n.length, B = o.length, k = R(g), E = [], O = [], v = [], L = h = 0;
792
+ if (!p) return N();
793
+ if (m || m !== !1 && p.indexOf(a) === -1) {
794
+ for (var F = p.split(n), A = 0; A < F.length; A++) {
795
+ if (v = F[A], h += v.length, A !== F.length - 1) h += n.length;
796
+ else if (d) return N();
797
+ if (!o || v.substring(0, B) !== o) {
798
+ if (k) {
799
+ if (E = [], ue(v.split(t)), re(), y) return N();
800
+ } else ue(v.split(t));
801
+ if (b && b <= A) return E = E.slice(0, b), N(!0);
770
802
  }
771
803
  }
772
- return J();
804
+ return N();
773
805
  }
774
- for (var W = g.indexOf(t, u), R = g.indexOf(n, u), ee = new RegExp(X(a) + X(i), "g"), E = g.indexOf(i, u); ; ) if (g[u] === i) for (E = u, u++; ; ) {
775
- if ((E = g.indexOf(i, E + 1)) === -1) return p || x.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: O.length, index: u }), re();
776
- if (E === M - 1) return re(g.substring(u, E).replace(ee, i));
777
- if (i === a && g[E + 1] === a) E++;
778
- else if (i === a || E === 0 || g[E - 1] !== a) {
779
- W !== -1 && W < E + 1 && (W = g.indexOf(t, E + 1));
780
- var H = ce((R = R !== -1 && R < E + 1 ? g.indexOf(n, E + 1) : R) === -1 ? W : Math.min(W, R));
781
- if (g.substr(E + 1 + H, L) === t) {
782
- w.push(g.substring(u, E).replace(ee, i)), g[u = E + 1 + H + L] !== i && (E = g.indexOf(i, u)), W = g.indexOf(t, u), R = g.indexOf(n, u);
806
+ for (var I = p.indexOf(t, h), D = p.indexOf(n, h), Z = new RegExp(ie(u) + ie(a), "g"), S = p.indexOf(a, h); ; ) if (p[h] === a) for (S = h, h++; ; ) {
807
+ if ((S = p.indexOf(a, S + 1)) === -1) return d || O.push({ type: "Quotes", code: "MissingQuotes", message: "Quoted field unterminated", row: E.length, index: h }), te();
808
+ if (S === x - 1) return te(p.substring(h, S).replace(Z, a));
809
+ if (a === u && p[S + 1] === u) S++;
810
+ else if (a === u || S === 0 || p[S - 1] !== u) {
811
+ I !== -1 && I < S + 1 && (I = p.indexOf(t, S + 1));
812
+ var z = ce((D = D !== -1 && D < S + 1 ? p.indexOf(n, S + 1) : D) === -1 ? I : Math.min(I, D));
813
+ if (p.substr(S + 1 + z, M) === t) {
814
+ v.push(p.substring(h, S).replace(Z, a)), p[h = S + 1 + z + M] !== a && (S = p.indexOf(a, h)), I = p.indexOf(t, h), D = p.indexOf(n, h);
783
815
  break;
784
816
  }
785
- if (H = ce(R), g.substring(E + 1 + H, E + 1 + H + B) === n) {
786
- if (w.push(g.substring(u, E).replace(ee, i)), le(E + 1 + H + B), W = g.indexOf(t, u), E = g.indexOf(i, u), b && (ne(), y)) return J();
787
- if (S && O.length >= S) return J(!0);
817
+ if (z = ce(D), p.substring(S + 1 + z, S + 1 + z + T) === n) {
818
+ if (v.push(p.substring(h, S).replace(Z, a)), pe(S + 1 + z + T), I = p.indexOf(t, h), S = p.indexOf(a, h), k && (re(), y)) return N();
819
+ if (b && E.length >= b) return N(!0);
788
820
  break;
789
821
  }
790
- x.push({ type: "Quotes", code: "InvalidQuotes", message: "Trailing quote on quoted field is malformed", row: O.length, index: u }), E++;
822
+ O.push({ type: "Quotes", code: "InvalidQuotes", message: "Trailing quote on quoted field is malformed", row: E.length, index: h }), S++;
791
823
  }
792
824
  }
793
- else if (s && w.length === 0 && g.substring(u, u + Y) === s) {
794
- if (R === -1) return J();
795
- u = R + B, R = g.indexOf(n, u), W = g.indexOf(t, u);
796
- } else if (W !== -1 && (W < R || R === -1)) w.push(g.substring(u, W)), u = W + L, W = g.indexOf(t, u);
825
+ else if (o && v.length === 0 && p.substring(h, h + B) === o) {
826
+ if (D === -1) return N();
827
+ h = D + T, D = p.indexOf(n, h), I = p.indexOf(t, h);
828
+ } else if (I !== -1 && (I < D || D === -1)) v.push(p.substring(h, I)), h = I + M, I = p.indexOf(t, h);
797
829
  else {
798
- if (R === -1) break;
799
- if (w.push(g.substring(u, R)), le(R + B), b && (ne(), y)) return J();
800
- if (S && O.length >= S) return J(!0);
830
+ if (D === -1) break;
831
+ if (v.push(p.substring(h, D)), pe(D + T), k && (re(), y)) return N();
832
+ if (b && E.length >= b) return N(!0);
801
833
  }
802
- return re();
803
- function he(q) {
804
- O.push(q), F = u;
834
+ return te();
835
+ function ue(U) {
836
+ E.push(U), L = h;
805
837
  }
806
- function ce(q) {
807
- var V = 0;
808
- return V = q !== -1 && (q = g.substring(E + 1, q)) && q.trim() === "" ? q.length : V;
838
+ function ce(U) {
839
+ var J = 0;
840
+ return J = U !== -1 && (U = p.substring(S + 1, U)) && U.trim() === "" ? U.length : J;
809
841
  }
810
- function re(q) {
811
- return p || (q === void 0 && (q = g.substring(u)), w.push(q), u = M, he(w), b && ne()), J();
842
+ function te(U) {
843
+ return d || (U === void 0 && (U = p.substring(h)), v.push(U), h = x, ue(v), k && re()), N();
812
844
  }
813
- function le(q) {
814
- u = q, he(w), w = [], R = g.indexOf(n, u);
845
+ function pe(U) {
846
+ h = U, ue(v), v = [], D = p.indexOf(n, h);
815
847
  }
816
- function J(q) {
817
- if (e.header && !v && O.length && !h) {
818
- var V = O[0], ue = /* @__PURE__ */ Object.create(null), we = new Set(V);
848
+ function N(U) {
849
+ if (e.header && !_ && E.length && !c) {
850
+ var J = E[0], ae = /* @__PURE__ */ Object.create(null), ve = new Set(J);
819
851
  let ke = !1;
820
- for (let fe = 0; fe < V.length; fe++) {
821
- let ie = V[fe];
822
- if (ue[ie = I(e.transformHeader) ? e.transformHeader(ie, fe) : ie]) {
823
- let de, be = ue[ie];
824
- for (; de = ie + "_" + be, be++, we.has(de); ) ;
825
- we.add(de), V[fe] = de, ue[ie]++, ke = !0, (l = l === null ? {} : l)[de] = ie;
826
- } else ue[ie] = 1, V[fe] = ie;
827
- we.add(ie);
852
+ for (let fe = 0; fe < J.length; fe++) {
853
+ let ne = J[fe];
854
+ if (ae[ne = R(e.transformHeader) ? e.transformHeader(ne, fe) : ne]) {
855
+ let ge, be = ae[ne];
856
+ for (; ge = ne + "_" + be, be++, ve.has(ge); ) ;
857
+ ve.add(ge), J[fe] = ge, ae[ne]++, ke = !0, (f = f === null ? {} : f)[ge] = ne;
858
+ } else ae[ne] = 1, J[fe] = ne;
859
+ ve.add(ne);
828
860
  }
829
- ke && console.warn("Duplicate headers found and renamed."), h = !0;
861
+ ke && console.warn("Duplicate headers found and renamed."), c = !0;
830
862
  }
831
- return { data: O, errors: x, meta: { delimiter: t, linebreak: n, aborted: y, truncated: !!q, cursor: F + (v || 0), renamedHeaders: l } };
863
+ return { data: E, errors: O, meta: { delimiter: t, linebreak: n, aborted: y, truncated: !!U, cursor: L + (_ || 0), renamedHeaders: f } };
832
864
  }
833
- function ne() {
834
- m(J()), O = [], x = [];
865
+ function re() {
866
+ g(N()), E = [], O = [];
835
867
  }
836
868
  }, this.abort = function() {
837
869
  y = !0;
838
870
  }, this.getCharIndex = function() {
839
- return u;
871
+ return h;
840
872
  };
841
873
  }
842
- function ae(e) {
843
- var t = e.data, n = N[t.workerId], s = !1;
874
+ function le(e) {
875
+ var t = e.data, n = H[t.workerId], o = !1;
844
876
  if (t.error) n.userError(t.error, t.file);
845
877
  else if (t.results && t.results.data) {
846
- var m = { abort: function() {
847
- s = !0, Z(t.workerId, { data: [], errors: [], meta: { aborted: !0 } });
848
- }, pause: pe, resume: pe };
849
- if (I(n.userStep)) {
850
- for (var S = 0; S < t.results.data.length && (n.userStep({ data: t.results.data[S], errors: t.results.errors, meta: t.results.meta }, m), !s); S++) ;
878
+ var g = { abort: function() {
879
+ o = !0, oe(t.workerId, { data: [], errors: [], meta: { aborted: !0 } });
880
+ }, pause: me, resume: me };
881
+ if (R(n.userStep)) {
882
+ for (var b = 0; b < t.results.data.length && (n.userStep({ data: t.results.data[b], errors: t.results.errors, meta: t.results.meta }, g), !o); b++) ;
851
883
  delete t.results;
852
- } else I(n.userChunk) && (n.userChunk(t.results, m, t.file), delete t.results);
884
+ } else R(n.userChunk) && (n.userChunk(t.results, g, t.file), delete t.results);
853
885
  }
854
- t.finished && !s && Z(t.workerId, t.results);
886
+ t.finished && !o && oe(t.workerId, t.results);
855
887
  }
856
- function Z(e, t) {
857
- var n = N[e];
858
- I(n.userComplete) && n.userComplete(t), n.terminate(), delete N[e];
888
+ function oe(e, t) {
889
+ var n = H[e];
890
+ R(n.userComplete) && n.userComplete(t), n.terminate(), delete H[e];
859
891
  }
860
- function pe() {
892
+ function me() {
861
893
  throw new Error("Not implemented.");
862
894
  }
863
- function oe(e) {
895
+ function se(e) {
864
896
  if (typeof e != "object" || e === null) return e;
865
897
  var t, n = Array.isArray(e) ? [] : {};
866
- for (t in e) n[t] = oe(e[t]);
898
+ for (t in e) n[t] = se(e[t]);
867
899
  return n;
868
900
  }
869
- function K(e, t) {
901
+ function Y(e, t) {
870
902
  return function() {
871
903
  e.apply(t, arguments);
872
904
  };
873
905
  }
874
- function I(e) {
906
+ function R(e) {
875
907
  return typeof e == "function";
876
908
  }
877
- return o.parse = function(e, t) {
909
+ return w.parse = function(e, t) {
878
910
  var n = (t = t || {}).dynamicTyping || !1;
879
- if (I(n) && (t.dynamicTypingFunction = n, n = {}), t.dynamicTyping = n, t.transform = !!I(t.transform) && t.transform, !t.worker || !o.WORKERS_SUPPORTED) return n = null, o.NODE_STREAM_INPUT, typeof e == "string" ? (e = ((s) => s.charCodeAt(0) !== 65279 ? s : s.slice(1))(e), n = new (t.download ? A : T)(t)) : e.readable === !0 && I(e.read) && I(e.on) ? n = new Q(t) : (d.File && e instanceof File || e instanceof Object) && (n = new D(t)), n.stream(e);
911
+ if (R(n) && (t.dynamicTypingFunction = n, n = {}), t.dynamicTyping = n, t.transform = !!R(t.transform) && t.transform, !t.worker || !w.WORKERS_SUPPORTED) return n = null, w.NODE_STREAM_INPUT, typeof e == "string" ? (e = ((o) => o.charCodeAt(0) !== 65279 ? o : o.slice(1))(e), n = new (t.download ? W : K)(t)) : e.readable === !0 && R(e.read) && R(e.on) ? n = new Q(t) : (l.File && e instanceof File || e instanceof Object) && (n = new X(t)), n.stream(e);
880
912
  (n = (() => {
881
- var s;
882
- return !!o.WORKERS_SUPPORTED && (s = (() => {
883
- var m = d.URL || d.webkitURL || null, S = c.toString();
884
- return o.BLOB_URL || (o.BLOB_URL = m.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ", "(", S, ")();"], { type: "text/javascript" })));
885
- })(), (s = new d.Worker(s)).onmessage = ae, s.id = P++, N[s.id] = s);
886
- })()).userStep = t.step, n.userChunk = t.chunk, n.userComplete = t.complete, n.userError = t.error, t.step = I(t.step), t.chunk = I(t.chunk), t.complete = I(t.complete), t.error = I(t.error), delete t.worker, n.postMessage({ input: e, config: t, workerId: n.id });
887
- }, o.unparse = function(e, t) {
888
- var n = !1, s = !0, m = ",", S = `\r
889
- `, _ = '"', l = _ + _, h = !1, i = null, a = !1, u = ((() => {
913
+ var o;
914
+ return !!w.WORKERS_SUPPORTED && (o = (() => {
915
+ var g = l.URL || l.webkitURL || null, b = s.toString();
916
+ return w.BLOB_URL || (w.BLOB_URL = g.createObjectURL(new Blob(["var global = (function() { if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof global !== 'undefined') { return global; } return {}; })(); global.IS_PAPA_WORKER=true; ", "(", b, ")();"], { type: "text/javascript" })));
917
+ })(), (o = new l.Worker(o)).onmessage = le, o.id = q++, H[o.id] = o);
918
+ })()).userStep = t.step, n.userChunk = t.chunk, n.userComplete = t.complete, n.userError = t.error, t.step = R(t.step), t.chunk = R(t.chunk), t.complete = R(t.complete), t.error = R(t.error), delete t.worker, n.postMessage({ input: e, config: t, workerId: n.id });
919
+ }, w.unparse = function(e, t) {
920
+ var n = !1, o = !0, g = ",", b = `\r
921
+ `, m = '"', f = m + m, c = !1, a = null, u = !1, h = ((() => {
890
922
  if (typeof t == "object") {
891
- if (typeof t.delimiter != "string" || o.BAD_DELIMITERS.filter(function(v) {
892
- return t.delimiter.indexOf(v) !== -1;
893
- }).length || (m = t.delimiter), typeof t.quotes != "boolean" && typeof t.quotes != "function" && !Array.isArray(t.quotes) || (n = t.quotes), typeof t.skipEmptyLines != "boolean" && typeof t.skipEmptyLines != "string" || (h = t.skipEmptyLines), typeof t.newline == "string" && (S = t.newline), typeof t.quoteChar == "string" && (_ = t.quoteChar), typeof t.header == "boolean" && (s = t.header), Array.isArray(t.columns)) {
923
+ if (typeof t.delimiter != "string" || w.BAD_DELIMITERS.filter(function(_) {
924
+ return t.delimiter.indexOf(_) !== -1;
925
+ }).length || (g = t.delimiter), typeof t.quotes != "boolean" && typeof t.quotes != "function" && !Array.isArray(t.quotes) || (n = t.quotes), typeof t.skipEmptyLines != "boolean" && typeof t.skipEmptyLines != "string" || (c = t.skipEmptyLines), typeof t.newline == "string" && (b = t.newline), typeof t.quoteChar == "string" && (m = t.quoteChar), typeof t.header == "boolean" && (o = t.header), Array.isArray(t.columns)) {
894
926
  if (t.columns.length === 0) throw new Error("Option columns is empty");
895
- i = t.columns;
927
+ a = t.columns;
896
928
  }
897
- t.escapeChar !== void 0 && (l = t.escapeChar + _), t.escapeFormulae instanceof RegExp ? a = t.escapeFormulae : typeof t.escapeFormulae == "boolean" && t.escapeFormulae && (a = /^[=+\-@\t\r].*$/);
929
+ t.escapeChar !== void 0 && (f = t.escapeChar + m), t.escapeFormulae instanceof RegExp ? u = t.escapeFormulae : typeof t.escapeFormulae == "boolean" && t.escapeFormulae && (u = /^[=+\-@\t\r].*$/);
898
930
  }
899
- })(), new RegExp(X(_), "g"));
931
+ })(), new RegExp(ie(m), "g"));
900
932
  if (typeof e == "string" && (e = JSON.parse(e)), Array.isArray(e)) {
901
- if (!e.length || Array.isArray(e[0])) return y(null, e, h);
902
- if (typeof e[0] == "object") return y(i || Object.keys(e[0]), e, h);
903
- } else if (typeof e == "object") return typeof e.data == "string" && (e.data = JSON.parse(e.data)), Array.isArray(e.data) && (e.fields || (e.fields = e.meta && e.meta.fields || i), e.fields || (e.fields = Array.isArray(e.data[0]) ? e.fields : typeof e.data[0] == "object" ? Object.keys(e.data[0]) : []), Array.isArray(e.data[0]) || typeof e.data[0] == "object" || (e.data = [e.data])), y(e.fields || [], e.data || [], h);
933
+ if (!e.length || Array.isArray(e[0])) return y(null, e, c);
934
+ if (typeof e[0] == "object") return y(a || Object.keys(e[0]), e, c);
935
+ } else if (typeof e == "object") return typeof e.data == "string" && (e.data = JSON.parse(e.data)), Array.isArray(e.data) && (e.fields || (e.fields = e.meta && e.meta.fields || a), e.fields || (e.fields = Array.isArray(e.data[0]) ? e.fields : typeof e.data[0] == "object" ? Object.keys(e.data[0]) : []), Array.isArray(e.data[0]) || typeof e.data[0] == "object" || (e.data = [e.data])), y(e.fields || [], e.data || [], c);
904
936
  throw new Error("Unable to serialize unrecognized input");
905
- function y(v, p, M) {
906
- var L = "", B = (typeof v == "string" && (v = JSON.parse(v)), typeof p == "string" && (p = JSON.parse(p)), Array.isArray(v) && 0 < v.length), Y = !Array.isArray(p[0]);
907
- if (B && s) {
908
- for (var b = 0; b < v.length; b++) 0 < b && (L += m), L += g(v[b], b);
909
- 0 < p.length && (L += S);
937
+ function y(_, d, x) {
938
+ var M = "", T = (typeof _ == "string" && (_ = JSON.parse(_)), typeof d == "string" && (d = JSON.parse(d)), Array.isArray(_) && 0 < _.length), B = !Array.isArray(d[0]);
939
+ if (T && o) {
940
+ for (var k = 0; k < _.length; k++) 0 < k && (M += g), M += p(_[k], k);
941
+ 0 < d.length && (M += b);
910
942
  }
911
- for (var O = 0; O < p.length; O++) {
912
- var x = (B ? v : p[O]).length, w = !1, F = B ? Object.keys(p[O]).length === 0 : p[O].length === 0;
913
- if (M && !B && (w = M === "greedy" ? p[O].join("").trim() === "" : p[O].length === 1 && p[O][0].length === 0), M === "greedy" && B) {
914
- for (var U = [], j = 0; j < x; j++) {
915
- var W = Y ? v[j] : j;
916
- U.push(p[O][W]);
943
+ for (var E = 0; E < d.length; E++) {
944
+ var O = (T ? _ : d[E]).length, v = !1, L = T ? Object.keys(d[E]).length === 0 : d[E].length === 0;
945
+ if (x && !T && (v = x === "greedy" ? d[E].join("").trim() === "" : d[E].length === 1 && d[E][0].length === 0), x === "greedy" && T) {
946
+ for (var F = [], A = 0; A < O; A++) {
947
+ var I = B ? _[A] : A;
948
+ F.push(d[E][I]);
917
949
  }
918
- w = U.join("").trim() === "";
950
+ v = F.join("").trim() === "";
919
951
  }
920
- if (!w) {
921
- for (var R = 0; R < x; R++) {
922
- 0 < R && !F && (L += m);
923
- var ee = B && Y ? v[R] : R;
924
- L += g(p[O][ee], R);
952
+ if (!v) {
953
+ for (var D = 0; D < O; D++) {
954
+ 0 < D && !L && (M += g);
955
+ var Z = T && B ? _[D] : D;
956
+ M += p(d[E][Z], D);
925
957
  }
926
- O < p.length - 1 && (!M || 0 < x && !F) && (L += S);
958
+ E < d.length - 1 && (!x || 0 < O && !L) && (M += b);
927
959
  }
928
960
  }
929
- return L;
961
+ return M;
930
962
  }
931
- function g(v, p) {
932
- var M, L;
933
- return v == null ? "" : v.constructor === Date ? JSON.stringify(v).slice(1, 25) : (L = !1, a && typeof v == "string" && a.test(v) && (v = "'" + v, L = !0), M = v.toString().replace(u, l), (L = L || n === !0 || typeof n == "function" && n(v, p) || Array.isArray(n) && n[p] || ((B, Y) => {
934
- for (var b = 0; b < Y.length; b++) if (-1 < B.indexOf(Y[b])) return !0;
963
+ function p(_, d) {
964
+ var x, M;
965
+ return _ == null ? "" : _.constructor === Date ? JSON.stringify(_).slice(1, 25) : (M = !1, u && typeof _ == "string" && u.test(_) && (_ = "'" + _, M = !0), x = _.toString().replace(h, f), (M = M || n === !0 || typeof n == "function" && n(_, d) || Array.isArray(n) && n[d] || ((T, B) => {
966
+ for (var k = 0; k < B.length; k++) if (-1 < T.indexOf(B[k])) return !0;
935
967
  return !1;
936
- })(M, o.BAD_DELIMITERS) || -1 < M.indexOf(m) || M.charAt(0) === " " || M.charAt(M.length - 1) === " ") ? _ + M + _ : M);
968
+ })(x, w.BAD_DELIMITERS) || -1 < x.indexOf(g) || x.charAt(0) === " " || x.charAt(x.length - 1) === " ") ? m + x + m : x);
937
969
  }
938
- }, o.RECORD_SEP = "", o.UNIT_SEP = "", o.BYTE_ORDER_MARK = "\uFEFF", o.BAD_DELIMITERS = ["\r", `
939
- `, '"', o.BYTE_ORDER_MARK], o.WORKERS_SUPPORTED = !$ && !!d.Worker, o.NODE_STREAM_INPUT = 1, o.LocalChunkSize = 10485760, o.RemoteChunkSize = 5242880, o.DefaultDelimiter = ",", o.Parser = se, o.ParserHandle = G, o.NetworkStreamer = A, o.FileStreamer = D, o.StringStreamer = T, o.ReadableStreamStreamer = Q, d.jQuery && ((C = d.jQuery).fn.parse = function(e) {
970
+ }, w.RECORD_SEP = "", w.UNIT_SEP = "", w.BYTE_ORDER_MARK = "\uFEFF", w.BAD_DELIMITERS = ["\r", `
971
+ `, '"', w.BYTE_ORDER_MARK], w.WORKERS_SUPPORTED = !C && !!l.Worker, w.NODE_STREAM_INPUT = 1, w.LocalChunkSize = 10485760, w.RemoteChunkSize = 5242880, w.DefaultDelimiter = ",", w.Parser = he, w.ParserHandle = ee, w.NetworkStreamer = W, w.FileStreamer = X, w.StringStreamer = K, w.ReadableStreamStreamer = Q, l.jQuery && (($ = l.jQuery).fn.parse = function(e) {
940
972
  var t = e.config || {}, n = [];
941
- return this.each(function(S) {
942
- if (!(C(this).prop("tagName").toUpperCase() === "INPUT" && C(this).attr("type").toLowerCase() === "file" && d.FileReader) || !this.files || this.files.length === 0) return !0;
943
- for (var _ = 0; _ < this.files.length; _++) n.push({ file: this.files[_], inputElem: this, instanceConfig: C.extend({}, t) });
944
- }), s(), this;
945
- function s() {
946
- if (n.length === 0) I(e.complete) && e.complete();
973
+ return this.each(function(b) {
974
+ if (!($(this).prop("tagName").toUpperCase() === "INPUT" && $(this).attr("type").toLowerCase() === "file" && l.FileReader) || !this.files || this.files.length === 0) return !0;
975
+ for (var m = 0; m < this.files.length; m++) n.push({ file: this.files[m], inputElem: this, instanceConfig: $.extend({}, t) });
976
+ }), o(), this;
977
+ function o() {
978
+ if (n.length === 0) R(e.complete) && e.complete();
947
979
  else {
948
- var S, _, l, h, i = n[0];
949
- if (I(e.before)) {
950
- var a = e.before(i.file, i.inputElem);
951
- if (typeof a == "object") {
952
- if (a.action === "abort") return S = "AbortError", _ = i.file, l = i.inputElem, h = a.reason, void (I(e.error) && e.error({ name: S }, _, l, h));
953
- if (a.action === "skip") return void m();
954
- typeof a.config == "object" && (i.instanceConfig = C.extend(i.instanceConfig, a.config));
955
- } else if (a === "skip") return void m();
980
+ var b, m, f, c, a = n[0];
981
+ if (R(e.before)) {
982
+ var u = e.before(a.file, a.inputElem);
983
+ if (typeof u == "object") {
984
+ if (u.action === "abort") return b = "AbortError", m = a.file, f = a.inputElem, c = u.reason, void (R(e.error) && e.error({ name: b }, m, f, c));
985
+ if (u.action === "skip") return void g();
986
+ typeof u.config == "object" && (a.instanceConfig = $.extend(a.instanceConfig, u.config));
987
+ } else if (u === "skip") return void g();
956
988
  }
957
- var u = i.instanceConfig.complete;
958
- i.instanceConfig.complete = function(y) {
959
- I(u) && u(y, i.file, i.inputElem), m();
960
- }, o.parse(i.file, i.instanceConfig);
989
+ var h = a.instanceConfig.complete;
990
+ a.instanceConfig.complete = function(y) {
991
+ R(h) && h(y, a.file, a.inputElem), g();
992
+ }, w.parse(a.file, a.instanceConfig);
961
993
  }
962
994
  }
963
- function m() {
964
- n.splice(0, 1), s();
995
+ function g() {
996
+ n.splice(0, 1), o();
965
997
  }
966
- }), z && (d.onmessage = function(e) {
967
- e = e.data, o.WORKER_ID === void 0 && e && (o.WORKER_ID = e.workerId), typeof e.input == "string" ? d.postMessage({ workerId: o.WORKER_ID, results: o.parse(e.input, e.config), finished: !0 }) : (d.File && e.input instanceof File || e.input instanceof Object) && (e = o.parse(e.input, e.config)) && d.postMessage({ workerId: o.WORKER_ID, results: e, finished: !0 });
968
- }), (A.prototype = Object.create(k.prototype)).constructor = A, (D.prototype = Object.create(k.prototype)).constructor = D, (T.prototype = Object.create(T.prototype)).constructor = T, (Q.prototype = Object.create(k.prototype)).constructor = Q, o;
998
+ }), j && (l.onmessage = function(e) {
999
+ e = e.data, w.WORKER_ID === void 0 && e && (w.WORKER_ID = e.workerId), typeof e.input == "string" ? l.postMessage({ workerId: w.WORKER_ID, results: w.parse(e.input, e.config), finished: !0 }) : (l.File && e.input instanceof File || e.input instanceof Object) && (e = w.parse(e.input, e.config)) && l.postMessage({ workerId: w.WORKER_ID, results: e, finished: !0 });
1000
+ }), (W.prototype = Object.create(P.prototype)).constructor = W, (X.prototype = Object.create(P.prototype)).constructor = X, (K.prototype = Object.create(K.prototype)).constructor = K, (Q.prototype = Object.create(P.prototype)).constructor = Q, w;
969
1001
  });
970
- }(ve)), ve.exports;
1002
+ }(we)), we.exports;
971
1003
  }
972
- var Me = Je();
973
- class Ve {
1004
+ var xe = Je();
1005
+ class Ge {
974
1006
  readAsText(r) {
975
- const c = new FileReader();
976
- return new Promise((d, C) => {
977
- c.onload = ($) => {
978
- d($);
979
- }, c.onerror = ($) => {
980
- C($);
981
- }, c.readAsText(r);
1007
+ const s = new FileReader();
1008
+ return new Promise((l, $) => {
1009
+ s.onload = (C) => {
1010
+ l(C);
1011
+ }, s.onerror = (C) => {
1012
+ $(C);
1013
+ }, s.readAsText(r);
982
1014
  });
983
1015
  }
984
1016
  readAsBinaryString(r) {
985
- const c = new FileReader();
986
- return new Promise((d, C) => {
987
- c.onload = ($) => {
988
- d($);
989
- }, c.onerror = ($) => {
990
- C($);
991
- }, c.readAsBinaryString(r);
1017
+ const s = new FileReader();
1018
+ return new Promise((l, $) => {
1019
+ s.onload = (C) => {
1020
+ l(C);
1021
+ }, s.onerror = (C) => {
1022
+ $(C);
1023
+ }, s.readAsBinaryString(r);
992
1024
  });
993
1025
  }
994
1026
  readAsDataUrl(r) {
995
- const c = new FileReader();
996
- return new Promise((d, C) => {
997
- c.onload = ($) => {
998
- d($);
999
- }, c.onerror = ($) => C($), c.readAsDataURL(r);
1027
+ const s = new FileReader();
1028
+ return new Promise((l, $) => {
1029
+ s.onload = (C) => {
1030
+ l(C);
1031
+ }, s.onerror = (C) => $(C), s.readAsDataURL(r);
1000
1032
  });
1001
1033
  }
1002
- unparse(r, c) {
1003
- return Me.unparse(r, c);
1034
+ unparse(r, s) {
1035
+ return xe.unparse(r, s);
1004
1036
  }
1005
1037
  parse(r) {
1006
- return new Promise((c, d) => {
1007
- Me.parse(r, {
1038
+ return new Promise((s, l) => {
1039
+ xe.parse(r, {
1008
1040
  header: !0,
1009
- complete: (C) => c(C),
1010
- error: (C) => d(C)
1041
+ complete: ($) => s($),
1042
+ error: ($) => l($)
1011
1043
  });
1012
1044
  });
1013
1045
  }
1014
1046
  getFileExtension(r) {
1015
- let c = "-";
1016
- return /[.]/.exec(r) && (c = `.${/[^.]+$/.exec(r)?.[0]}`), c;
1047
+ let s = "-";
1048
+ return /[.]/.exec(r) && (s = `.${/[^.]+$/.exec(r)?.[0]}`), s;
1017
1049
  }
1018
- save(r, c, d) {
1019
- const C = new Blob([r], { type: d });
1020
- Ne.saveAs(C, c, { autoBom: !0 });
1050
+ save(r, s, l) {
1051
+ const $ = new Blob([r], { type: l });
1052
+ $e($, s);
1021
1053
  }
1022
1054
  }
1023
- class Ge {
1024
- set(r, c) {
1025
- localStorage.setItem(r, JSON.stringify(c));
1055
+ class Xe {
1056
+ set(r, s) {
1057
+ localStorage.setItem(r, JSON.stringify(s));
1026
1058
  }
1027
1059
  get(r) {
1028
- let c = null;
1029
- const d = localStorage.getItem(r);
1030
- return d && (c = JSON.parse(d)), c;
1060
+ let s = null;
1061
+ const l = localStorage.getItem(r);
1062
+ return l && (s = JSON.parse(l)), s;
1031
1063
  }
1032
1064
  remove(r) {
1033
- let c = !!this.get(r);
1034
- return c && localStorage.removeItem(r), c;
1065
+ let s = !!this.get(r);
1066
+ return s && localStorage.removeItem(r), s;
1035
1067
  }
1036
1068
  removeAll() {
1037
1069
  localStorage.clear();
1038
1070
  }
1039
1071
  getKeysBy(r) {
1040
- return Object.keys(localStorage).filter((c) => c.startsWith(r));
1072
+ return Object.keys(localStorage).filter((s) => s.startsWith(r));
1041
1073
  }
1042
1074
  }
1043
- var $e = /* @__PURE__ */ ((f) => (f.log = "log", f.info = "info", f.warn = "warn", f.debug = "debug", f.error = "error", f))($e || {});
1044
- class Xe {
1045
- logType = $e;
1075
+ var Me = /* @__PURE__ */ ((i) => (i.log = "log", i.info = "info", i.warn = "warn", i.debug = "debug", i.error = "error", i))(Me || {});
1076
+ class et {
1077
+ logType = Me;
1046
1078
  log(...r) {
1047
1079
  this._doLog(this.logType.log, r.join(" "));
1048
1080
  }
@@ -1058,33 +1090,33 @@ class Xe {
1058
1090
  error(...r) {
1059
1091
  this._doLog(this.logType.error, r.join(" "));
1060
1092
  }
1061
- _doLog(r, ...c) {
1062
- console[r].apply(console, c);
1093
+ _doLog(r, ...s) {
1094
+ console[r].apply(console, s);
1063
1095
  }
1064
1096
  }
1065
- class et {
1097
+ class tt {
1066
1098
  constructor(r) {
1067
1099
  this.localService = r;
1068
1100
  }
1069
1101
  get(r) {
1070
1102
  return this.localService.get(r);
1071
1103
  }
1072
- set(r, c) {
1073
- this.localService.set(r, c);
1104
+ set(r, s) {
1105
+ this.localService.set(r, s);
1074
1106
  }
1075
1107
  remove(r) {
1076
1108
  this.localService.remove(r);
1077
1109
  }
1078
1110
  }
1079
1111
  export {
1080
- Qe as BrowserService,
1081
- Ye as BrowserType,
1112
+ Ve as BrowserService,
1082
1113
  Ze as ClipboardService,
1083
- Ve as FileService,
1084
- Ge as LocalService,
1085
- $e as LogType,
1086
- Xe as LoggerService,
1087
- Oe as ScreenBreakpoints,
1088
- et as TokenService,
1089
- Ie as sortHelper
1114
+ Qe as EnumHelper,
1115
+ Ge as FileService,
1116
+ Xe as LocalService,
1117
+ Me as LogType,
1118
+ et as LoggerService,
1119
+ tt as TokenService,
1120
+ $e as saveAs,
1121
+ Be as sortHelper
1090
1122
  };