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