@oardi/ts-utils 0.0.35 → 0.0.37

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