@oardi/ts-utils 0.0.36 → 0.0.38

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