@oardi/ts-utils 0.0.9 → 0.0.11

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