@oardi/ts-utils 0.0.56 → 0.0.58

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