@oardi/ts-utils 0.0.57 → 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/helpers/image.helper.d.ts +2 -0
- package/index.cjs +6 -6
- package/index.mjs +204 -196
- package/index.umd.js +6 -6
- package/package.json +1 -1
package/index.mjs
CHANGED
|
@@ -48,8 +48,8 @@ class H {
|
|
|
48
48
|
}
|
|
49
49
|
static isSafari(t = ft) {
|
|
50
50
|
if (!this.isBrowserEnv()) return !1;
|
|
51
|
-
const n = navigator.vendor && navigator.vendor.includes("Apple"), s = t.includes("safari"),
|
|
52
|
-
return n && s &&
|
|
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
54
|
static isIOS(t = ft) {
|
|
55
55
|
if (!this.isBrowserEnv()) return !1;
|
|
@@ -67,8 +67,8 @@ class H {
|
|
|
67
67
|
}
|
|
68
68
|
static isChrome(t = ft) {
|
|
69
69
|
if (!this.isBrowserEnv()) return !1;
|
|
70
|
-
const n = navigator.vendor && navigator.vendor.includes("Google"), s = t.includes("chrome") || t.includes("crios"),
|
|
71
|
-
return n && s &&
|
|
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
73
|
static isElectron(t = ft) {
|
|
74
74
|
return typeof process < "u" && process.versions?.electron ? !0 : t.includes("electron");
|
|
@@ -101,14 +101,14 @@ class H {
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
class ue {
|
|
104
|
-
static toBlob(t, n, s = !1,
|
|
105
|
-
return new Promise((
|
|
104
|
+
static toBlob(t, n, s = !1, m) {
|
|
105
|
+
return new Promise((_, U) => {
|
|
106
106
|
t.toBlob(
|
|
107
107
|
(I) => {
|
|
108
|
-
I ?
|
|
108
|
+
I ? _(I) : U(new Error("canvas.toBlob returned null"));
|
|
109
109
|
},
|
|
110
110
|
n,
|
|
111
|
-
s ?
|
|
111
|
+
s ? m : void 0
|
|
112
112
|
);
|
|
113
113
|
});
|
|
114
114
|
}
|
|
@@ -126,7 +126,7 @@ function Yt() {
|
|
|
126
126
|
((n, s) => {
|
|
127
127
|
a.exports = s();
|
|
128
128
|
})(jt, function n() {
|
|
129
|
-
var s = typeof self < "u" ? self : typeof window < "u" ? window : s !== void 0 ? s : {},
|
|
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
130
|
function A(e) {
|
|
131
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) {
|
|
132
132
|
var i = ct(r);
|
|
@@ -135,17 +135,17 @@ function Yt() {
|
|
|
135
135
|
var u = parseInt(this._config.skipFirstNLines) || 0;
|
|
136
136
|
if (this.isFirstChunk && 0 < u) {
|
|
137
137
|
let E = this._config.newline;
|
|
138
|
-
E || (
|
|
138
|
+
E || (y = this._config.quoteChar || '"', E = this._handle.guessLineEndings(r, y)), r = [...r.split(E).slice(u)].join(E);
|
|
139
139
|
}
|
|
140
|
-
this.isFirstChunk && R(this._config.beforeFirstChunk) && (
|
|
141
|
-
var u = this._partialLine + r,
|
|
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));
|
|
142
142
|
if (!this._handle.paused() && !this._handle.aborted()) {
|
|
143
|
-
if (r =
|
|
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 });
|
|
144
144
|
else if (R(this._config.chunk) && !i) {
|
|
145
|
-
if (this._config.chunk(
|
|
146
|
-
this._completeResults =
|
|
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;
|
|
147
147
|
}
|
|
148
|
-
return this._config.step || this._config.chunk || (this._completeResults.data = this._completeResults.data.concat(
|
|
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;
|
|
149
149
|
}
|
|
150
150
|
this._halted = !0;
|
|
151
151
|
}, this._sendError = function(r) {
|
|
@@ -154,7 +154,7 @@ function Yt() {
|
|
|
154
154
|
}
|
|
155
155
|
function j(e) {
|
|
156
156
|
var r;
|
|
157
|
-
(e = e || {}).chunkSize || (e.chunkSize = h.RemoteChunkSize), A.call(this, e), this._nextChunk =
|
|
157
|
+
(e = e || {}).chunkSize || (e.chunkSize = h.RemoteChunkSize), A.call(this, e), this._nextChunk = _ ? function() {
|
|
158
158
|
this._readChunk(), this._chunkLoaded();
|
|
159
159
|
} : function() {
|
|
160
160
|
this._readChunk();
|
|
@@ -163,18 +163,18 @@ function Yt() {
|
|
|
163
163
|
}, this._readChunk = function() {
|
|
164
164
|
if (this._finished) this._chunkLoaded();
|
|
165
165
|
else {
|
|
166
|
-
if (r = new XMLHttpRequest(), this._config.withCredentials && (r.withCredentials = this._config.withCredentials),
|
|
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) {
|
|
167
167
|
var i, u = this._config.downloadRequestHeaders;
|
|
168
168
|
for (i in u) r.setRequestHeader(i, u[i]);
|
|
169
169
|
}
|
|
170
|
-
var
|
|
171
|
-
this._config.chunkSize && (
|
|
170
|
+
var y;
|
|
171
|
+
this._config.chunkSize && (y = this._start + this._config.chunkSize - 1, r.setRequestHeader("Range", "bytes=" + this._start + "-" + y));
|
|
172
172
|
try {
|
|
173
173
|
r.send(this._config.downloadRequestBody);
|
|
174
174
|
} catch (E) {
|
|
175
175
|
this._chunkError(E.message);
|
|
176
176
|
}
|
|
177
|
-
|
|
177
|
+
_ && r.status === 0 && this._chunkError();
|
|
178
178
|
}
|
|
179
179
|
}, this._chunkLoaded = function() {
|
|
180
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)));
|
|
@@ -185,15 +185,15 @@ function Yt() {
|
|
|
185
185
|
function Q(e) {
|
|
186
186
|
(e = e || {}).chunkSize || (e.chunkSize = h.LocalChunkSize), A.call(this, e);
|
|
187
187
|
var r, i, u = typeof FileReader < "u";
|
|
188
|
-
this.stream = function(
|
|
189
|
-
this._input =
|
|
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();
|
|
190
190
|
}, this._nextChunk = function() {
|
|
191
191
|
this._finished || this._config.preview && !(this._rowCount < this._config.preview) || this._readChunk();
|
|
192
192
|
}, this._readChunk = function() {
|
|
193
|
-
var
|
|
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
194
|
u || this._chunkLoaded({ target: { result: E } });
|
|
195
|
-
}, this._chunkLoaded = function(
|
|
196
|
-
this._start += this._config.chunkSize, this._finished = !this._config.chunkSize || this._start >= this._input.size, this.parseChunk(
|
|
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);
|
|
197
197
|
}, this._chunkError = function() {
|
|
198
198
|
this._sendError(r.error);
|
|
199
199
|
};
|
|
@@ -214,20 +214,20 @@ function Yt() {
|
|
|
214
214
|
A.prototype.pause.apply(this, arguments), this._input.pause();
|
|
215
215
|
}, this.resume = function() {
|
|
216
216
|
A.prototype.resume.apply(this, arguments), this._input.resume();
|
|
217
|
-
}, this.stream = function(
|
|
218
|
-
this._input =
|
|
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);
|
|
219
219
|
}, this._checkIsFinished = function() {
|
|
220
220
|
u && r.length === 1 && (this._finished = !0);
|
|
221
221
|
}, this._nextChunk = function() {
|
|
222
222
|
this._checkIsFinished(), r.length ? this.parseChunk(r.shift()) : i = !0;
|
|
223
|
-
}, this._streamData = V(function(
|
|
223
|
+
}, this._streamData = V(function(y) {
|
|
224
224
|
try {
|
|
225
|
-
r.push(typeof
|
|
225
|
+
r.push(typeof y == "string" ? y : y.toString(this._config.encoding)), i && (i = !1, this._checkIsFinished(), this.parseChunk(r.shift()));
|
|
226
226
|
} catch (E) {
|
|
227
227
|
this._streamError(E);
|
|
228
228
|
}
|
|
229
|
-
}, this), this._streamError = V(function(
|
|
230
|
-
this._streamCleanUp(), this._sendError(
|
|
229
|
+
}, this), this._streamError = V(function(y) {
|
|
230
|
+
this._streamCleanUp(), this._sendError(y);
|
|
231
231
|
}, this), this._streamEnd = V(function() {
|
|
232
232
|
this._streamCleanUp(), u = !0, this._streamData("");
|
|
233
233
|
}, this), this._streamCleanUp = V(function() {
|
|
@@ -235,25 +235,25 @@ function Yt() {
|
|
|
235
235
|
}, this);
|
|
236
236
|
}
|
|
237
237
|
function nt(e) {
|
|
238
|
-
var r, i, u,
|
|
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
239
|
function M(S) {
|
|
240
240
|
return e.skipEmptyLines === "greedy" ? S.join("").trim() === "" : S.length === 1 && S[0].length === 0;
|
|
241
241
|
}
|
|
242
242
|
function C() {
|
|
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(
|
|
244
|
-
return !M(
|
|
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
245
|
})), Y()) {
|
|
246
|
-
let
|
|
246
|
+
let b = function(T, B) {
|
|
247
247
|
R(e.transformHeader) && (T = e.transformHeader(T, B)), k.push(T);
|
|
248
248
|
};
|
|
249
249
|
if (p) if (Array.isArray(p.data[0])) {
|
|
250
|
-
for (var S = 0; Y() && S < p.data.length; S++) p.data[S].forEach(
|
|
250
|
+
for (var S = 0; Y() && S < p.data.length; S++) p.data[S].forEach(b);
|
|
251
251
|
p.data.splice(0, 1);
|
|
252
|
-
} else p.data.forEach(
|
|
252
|
+
} else p.data.forEach(b);
|
|
253
253
|
}
|
|
254
|
-
function D(
|
|
255
|
-
for (var B = e.header ? {} : [], L = 0; L <
|
|
256
|
-
var F = L, $ =
|
|
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
257
|
if (d.test(N) && (N = parseFloat(N), v < N && N < E))
|
|
258
258
|
return 1;
|
|
259
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) : $);
|
|
@@ -267,13 +267,13 @@ function Yt() {
|
|
|
267
267
|
function Y() {
|
|
268
268
|
return e.header && k.length === 0;
|
|
269
269
|
}
|
|
270
|
-
function W(S, D, O,
|
|
271
|
-
S = { type: S, code: D, message: O },
|
|
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);
|
|
272
272
|
}
|
|
273
|
-
R(e.step) && (
|
|
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],
|
|
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
275
|
}), this.parse = function(S, D, O) {
|
|
276
|
-
var
|
|
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
277
|
var it, x, N, ht;
|
|
278
278
|
$ = $ || [",", " ", "|", ";", h.RECORD_SEP, h.UNIT_SEP];
|
|
279
279
|
for (var gt = 0; gt < $.length; gt++) {
|
|
@@ -281,8 +281,8 @@ function Yt() {
|
|
|
281
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);
|
|
282
282
|
}
|
|
283
283
|
return { successful: !!(e.delimiter = it), bestDelimiter: it };
|
|
284
|
-
})(S, e.newline, e.skipEmptyLines, e.comments, e.delimitersToGuess)).successful ? e.delimiter =
|
|
285
|
-
return e.preview && e.header &&
|
|
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 } };
|
|
286
286
|
}, this.paused = function() {
|
|
287
287
|
return w;
|
|
288
288
|
}, this.pause = function() {
|
|
@@ -290,13 +290,13 @@ function Yt() {
|
|
|
290
290
|
}, this.resume = function() {
|
|
291
291
|
o.streamer._halted ? (w = !1, o.streamer.parseChunk(r, !0)) : setTimeout(o.resume, 3);
|
|
292
292
|
}, this.aborted = function() {
|
|
293
|
-
return
|
|
293
|
+
return g;
|
|
294
294
|
}, this.abort = function() {
|
|
295
|
-
|
|
296
|
-
}, this.guessLineEndings = function(T,
|
|
295
|
+
g = !0, i.abort(), p.meta.aborted = !0, R(e.complete) && e.complete(p), r = "";
|
|
296
|
+
}, this.guessLineEndings = function(T, b) {
|
|
297
297
|
T = T.substring(0, 1048576);
|
|
298
|
-
var
|
|
299
|
-
`), T = 1 <
|
|
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
300
|
if (O.length === 1 || T) return `
|
|
301
301
|
`;
|
|
302
302
|
for (var B = 0, L = 0; L < O.length; L++) O[L][0] === `
|
|
@@ -309,56 +309,56 @@ function Yt() {
|
|
|
309
309
|
return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
310
310
|
}
|
|
311
311
|
function mt(e) {
|
|
312
|
-
var r = (e = e || {}).delimiter, i = e.newline, u = e.comments,
|
|
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
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
314
|
u === !0 ? u = "#" : (typeof u != "string" || -1 < h.BAD_DELIMITERS.indexOf(u)) && (u = !1), i !== `
|
|
315
315
|
` && i !== "\r" && i !== `\r
|
|
316
316
|
` && (i = `
|
|
317
317
|
`);
|
|
318
318
|
var l = 0, w = !1;
|
|
319
|
-
this.parse = function(
|
|
320
|
-
if (typeof
|
|
321
|
-
var M =
|
|
322
|
-
if (!
|
|
323
|
-
if (v || v !== !1 &&
|
|
324
|
-
for (var B =
|
|
325
|
-
if (
|
|
319
|
+
this.parse = function(g, k, p) {
|
|
320
|
+
if (typeof g != "string") throw new Error("Input must be a string");
|
|
321
|
+
var M = g.length, C = r.length, Y = i.length, W = u.length, S = R(y), D = [], O = [], b = [], T = l = 0;
|
|
322
|
+
if (!g) return Z();
|
|
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
326
|
else if (p) return Z();
|
|
327
|
-
if (!u ||
|
|
327
|
+
if (!u || b.substring(0, W) !== u) {
|
|
328
328
|
if (S) {
|
|
329
|
-
if (D = [], ht(
|
|
330
|
-
} else ht(
|
|
329
|
+
if (D = [], ht(b.split(r)), at(), w) return Z();
|
|
330
|
+
} else ht(b.split(r));
|
|
331
331
|
if (E && E <= L) return D = D.slice(0, E), Z(!0);
|
|
332
332
|
}
|
|
333
333
|
}
|
|
334
334
|
return Z();
|
|
335
335
|
}
|
|
336
|
-
for (var F =
|
|
337
|
-
if ((x =
|
|
338
|
-
if (x === M - 1) return st(
|
|
339
|
-
if (o === c &&
|
|
340
|
-
else if (o === c || x === 0 ||
|
|
341
|
-
F !== -1 && F < x + 1 && (F =
|
|
342
|
-
var N = gt(($ = $ !== -1 && $ < x + 1 ?
|
|
343
|
-
if (
|
|
344
|
-
|
|
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);
|
|
345
345
|
break;
|
|
346
346
|
}
|
|
347
|
-
if (N = gt($),
|
|
348
|
-
if (
|
|
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
349
|
if (E && D.length >= E) return Z(!0);
|
|
350
350
|
break;
|
|
351
351
|
}
|
|
352
352
|
O.push({ type: "Quotes", code: "InvalidQuotes", message: "Trailing quote on quoted field is malformed", row: D.length, index: l }), x++;
|
|
353
353
|
}
|
|
354
354
|
}
|
|
355
|
-
else if (u &&
|
|
355
|
+
else if (u && b.length === 0 && g.substring(l, l + W) === u) {
|
|
356
356
|
if ($ === -1) return Z();
|
|
357
|
-
l = $ + Y, $ =
|
|
358
|
-
} else if (F !== -1 && (F < $ || $ === -1))
|
|
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);
|
|
359
359
|
else {
|
|
360
360
|
if ($ === -1) break;
|
|
361
|
-
if (
|
|
361
|
+
if (b.push(g.substring(l, $)), kt($ + Y), S && (at(), w)) return Z();
|
|
362
362
|
if (E && D.length >= E) return Z(!0);
|
|
363
363
|
}
|
|
364
364
|
return st();
|
|
@@ -367,13 +367,13 @@ function Yt() {
|
|
|
367
367
|
}
|
|
368
368
|
function gt(J) {
|
|
369
369
|
var et = 0;
|
|
370
|
-
return et = J !== -1 && (J =
|
|
370
|
+
return et = J !== -1 && (J = g.substring(x + 1, J)) && J.trim() === "" ? J.length : et;
|
|
371
371
|
}
|
|
372
372
|
function st(J) {
|
|
373
|
-
return p || (J === void 0 && (J =
|
|
373
|
+
return p || (J === void 0 && (J = g.substring(l)), b.push(J), l = M, ht(b), S && at()), Z();
|
|
374
374
|
}
|
|
375
375
|
function kt(J) {
|
|
376
|
-
l = J, ht(
|
|
376
|
+
l = J, ht(b), b = [], $ = g.indexOf(i, l);
|
|
377
377
|
}
|
|
378
378
|
function Z(J) {
|
|
379
379
|
if (e.header && !k && D.length && !f) {
|
|
@@ -393,7 +393,7 @@ function Yt() {
|
|
|
393
393
|
return { data: D, errors: O, meta: { delimiter: r, linebreak: i, aborted: w, truncated: !!J, cursor: T + (k || 0), renamedHeaders: d } };
|
|
394
394
|
}
|
|
395
395
|
function at() {
|
|
396
|
-
|
|
396
|
+
y(Z()), D = [], O = [];
|
|
397
397
|
}
|
|
398
398
|
}, this.abort = function() {
|
|
399
399
|
w = !0;
|
|
@@ -405,13 +405,13 @@ function Yt() {
|
|
|
405
405
|
var r = e.data, i = I[r.workerId], u = !1;
|
|
406
406
|
if (r.error) i.userError(r.error, r.file);
|
|
407
407
|
else if (r.results && r.results.data) {
|
|
408
|
-
var
|
|
408
|
+
var y = { abort: function() {
|
|
409
409
|
u = !0, dt(r.workerId, { data: [], errors: [], meta: { aborted: !0 } });
|
|
410
410
|
}, pause: bt, resume: bt };
|
|
411
411
|
if (R(i.userStep)) {
|
|
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 },
|
|
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++) ;
|
|
413
413
|
delete r.results;
|
|
414
|
-
} else R(i.userChunk) && (i.userChunk(r.results,
|
|
414
|
+
} else R(i.userChunk) && (i.userChunk(r.results, y, r.file), delete r.results);
|
|
415
415
|
}
|
|
416
416
|
r.finished && !u && dt(r.workerId, r.results);
|
|
417
417
|
}
|
|
@@ -442,17 +442,17 @@ function Yt() {
|
|
|
442
442
|
(i = (() => {
|
|
443
443
|
var u;
|
|
444
444
|
return !!h.WORKERS_SUPPORTED && (u = (() => {
|
|
445
|
-
var
|
|
446
|
-
return h.BLOB_URL || (h.BLOB_URL =
|
|
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
447
|
})(), (u = new s.Worker(u)).onmessage = wt, u.id = K++, I[u.id] = u);
|
|
448
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 });
|
|
449
449
|
}, h.unparse = function(e, r) {
|
|
450
|
-
var i = !1, u = !0,
|
|
450
|
+
var i = !1, u = !0, y = ",", E = `\r
|
|
451
451
|
`, v = '"', d = v + v, f = !1, o = null, c = !1, l = ((() => {
|
|
452
452
|
if (typeof r == "object") {
|
|
453
453
|
if (typeof r.delimiter != "string" || h.BAD_DELIMITERS.filter(function(k) {
|
|
454
454
|
return r.delimiter.indexOf(k) !== -1;
|
|
455
|
-
}).length || (
|
|
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)) {
|
|
456
456
|
if (r.columns.length === 0) throw new Error("Option columns is empty");
|
|
457
457
|
o = r.columns;
|
|
458
458
|
}
|
|
@@ -467,42 +467,42 @@ function Yt() {
|
|
|
467
467
|
function w(k, p, M) {
|
|
468
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
469
|
if (Y && u) {
|
|
470
|
-
for (var S = 0; S < k.length; S++) 0 < S && (C +=
|
|
470
|
+
for (var S = 0; S < k.length; S++) 0 < S && (C += y), C += g(k[S], S);
|
|
471
471
|
0 < p.length && (C += E);
|
|
472
472
|
}
|
|
473
473
|
for (var D = 0; D < p.length; D++) {
|
|
474
|
-
var O = (Y ? k : p[D]).length,
|
|
475
|
-
if (M && !Y && (
|
|
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
476
|
for (var B = [], L = 0; L < O; L++) {
|
|
477
477
|
var F = W ? k[L] : L;
|
|
478
478
|
B.push(p[D][F]);
|
|
479
479
|
}
|
|
480
|
-
|
|
480
|
+
b = B.join("").trim() === "";
|
|
481
481
|
}
|
|
482
|
-
if (!
|
|
482
|
+
if (!b) {
|
|
483
483
|
for (var $ = 0; $ < O; $++) {
|
|
484
|
-
0 < $ && !T && (C +=
|
|
484
|
+
0 < $ && !T && (C += y);
|
|
485
485
|
var it = Y && W ? k[$] : $;
|
|
486
|
-
C +=
|
|
486
|
+
C += g(p[D][it], $);
|
|
487
487
|
}
|
|
488
488
|
D < p.length - 1 && (!M || 0 < O && !T) && (C += E);
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
491
|
return C;
|
|
492
492
|
}
|
|
493
|
-
function
|
|
493
|
+
function g(k, p) {
|
|
494
494
|
var M, C;
|
|
495
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
496
|
for (var S = 0; S < W.length; S++) if (-1 < Y.indexOf(W[S])) return !0;
|
|
497
497
|
return !1;
|
|
498
|
-
})(M, h.BAD_DELIMITERS) || -1 < M.indexOf(
|
|
498
|
+
})(M, h.BAD_DELIMITERS) || -1 < M.indexOf(y) || M.charAt(0) === " " || M.charAt(M.length - 1) === " ") ? v + M + v : M);
|
|
499
499
|
}
|
|
500
500
|
}, h.RECORD_SEP = "", h.UNIT_SEP = "", h.BYTE_ORDER_MARK = "\uFEFF", h.BAD_DELIMITERS = ["\r", `
|
|
501
|
-
`, '"', h.BYTE_ORDER_MARK], h.WORKERS_SUPPORTED = !
|
|
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) {
|
|
502
502
|
var r = e.config || {}, i = [];
|
|
503
503
|
return this.each(function(E) {
|
|
504
|
-
if (!(
|
|
505
|
-
for (var v = 0; v < this.files.length; v++) i.push({ file: this.files[v], inputElem: this, instanceConfig:
|
|
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) });
|
|
506
506
|
}), u(), this;
|
|
507
507
|
function u() {
|
|
508
508
|
if (i.length === 0) R(e.complete) && e.complete();
|
|
@@ -512,17 +512,17 @@ function Yt() {
|
|
|
512
512
|
var c = e.before(o.file, o.inputElem);
|
|
513
513
|
if (typeof c == "object") {
|
|
514
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
|
|
516
|
-
typeof c.config == "object" && (o.instanceConfig =
|
|
517
|
-
} else if (c === "skip") return void
|
|
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();
|
|
518
518
|
}
|
|
519
519
|
var l = o.instanceConfig.complete;
|
|
520
520
|
o.instanceConfig.complete = function(w) {
|
|
521
|
-
R(l) && l(w, o.file, o.inputElem),
|
|
521
|
+
R(l) && l(w, o.file, o.inputElem), y();
|
|
522
522
|
}, h.parse(o.file, o.instanceConfig);
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function y() {
|
|
526
526
|
i.splice(0, 1), u();
|
|
527
527
|
}
|
|
528
528
|
}), U && (s.onmessage = function(e) {
|
|
@@ -541,8 +541,8 @@ class le {
|
|
|
541
541
|
return new Promise((n, s) => {
|
|
542
542
|
Pt(t, {
|
|
543
543
|
header: !0,
|
|
544
|
-
complete: (
|
|
545
|
-
error: (
|
|
544
|
+
complete: (m) => n(m),
|
|
545
|
+
error: (m) => s(m)
|
|
546
546
|
});
|
|
547
547
|
});
|
|
548
548
|
}
|
|
@@ -558,8 +558,8 @@ class qt {
|
|
|
558
558
|
*/
|
|
559
559
|
static saveAs(t, n, s = {}) {
|
|
560
560
|
this.assertBrowserEnvironment();
|
|
561
|
-
const
|
|
562
|
-
this.downloadBlob(
|
|
561
|
+
const m = s.autoBom ? this.addUtf8Bom(t) : t;
|
|
562
|
+
this.downloadBlob(m, n);
|
|
563
563
|
}
|
|
564
564
|
static addUtf8Bom(t) {
|
|
565
565
|
return this.utf8BomMimeType.test(t.type) ? new Blob(["\uFEFF", t], { type: t.type }) : t;
|
|
@@ -589,14 +589,14 @@ class qt {
|
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
591
|
static clickDownloadLink(t, n, s = !0) {
|
|
592
|
-
const
|
|
593
|
-
if (!
|
|
592
|
+
const m = document.body ?? document.documentElement;
|
|
593
|
+
if (!m)
|
|
594
594
|
throw new Error("DownloadHelper.saveAs requires an initialized document.");
|
|
595
|
-
const
|
|
595
|
+
const _ = document.createElement("a");
|
|
596
596
|
try {
|
|
597
|
-
|
|
597
|
+
_.download = n, _.href = t, s && (_.target = "_blank", _.rel = "noopener noreferrer"), _.style.display = "none", m.appendChild(_), _.click();
|
|
598
598
|
} finally {
|
|
599
|
-
|
|
599
|
+
_.remove();
|
|
600
600
|
}
|
|
601
601
|
}
|
|
602
602
|
}
|
|
@@ -624,32 +624,32 @@ class de {
|
|
|
624
624
|
*/
|
|
625
625
|
static readAsText(t) {
|
|
626
626
|
const n = new FileReader();
|
|
627
|
-
return new Promise((s,
|
|
627
|
+
return new Promise((s, m) => {
|
|
628
628
|
n.onload = () => {
|
|
629
|
-
n.onload = null, n.onerror = null, typeof n.result == "string" ? s(n.result) :
|
|
629
|
+
n.onload = null, n.onerror = null, typeof n.result == "string" ? s(n.result) : m(new Error("Unexpected result type"));
|
|
630
630
|
}, n.onerror = () => {
|
|
631
|
-
const
|
|
632
|
-
n.onload = null, n.onerror = null,
|
|
631
|
+
const _ = n.error ?? new Error("FileReader error");
|
|
632
|
+
n.onload = null, n.onerror = null, m(_);
|
|
633
633
|
}, n.readAsText(t);
|
|
634
634
|
});
|
|
635
635
|
}
|
|
636
636
|
static readAsArrayBuffer(t) {
|
|
637
637
|
const n = new FileReader();
|
|
638
|
-
return new Promise((s,
|
|
638
|
+
return new Promise((s, m) => {
|
|
639
639
|
n.onload = () => {
|
|
640
|
-
n.onload = null, n.onerror = null, n.result instanceof ArrayBuffer ? s(n.result) :
|
|
640
|
+
n.onload = null, n.onerror = null, n.result instanceof ArrayBuffer ? s(n.result) : m(new Error("Unexpected result type"));
|
|
641
641
|
}, n.onerror = () => {
|
|
642
|
-
const
|
|
643
|
-
n.onload = null, n.onerror = null,
|
|
642
|
+
const _ = n.error ?? new Error("FileReader error");
|
|
643
|
+
n.onload = null, n.onerror = null, m(_);
|
|
644
644
|
}, n.readAsArrayBuffer(t);
|
|
645
645
|
});
|
|
646
646
|
}
|
|
647
647
|
static readAsDataUrl(t) {
|
|
648
648
|
const n = new FileReader();
|
|
649
|
-
return new Promise((s,
|
|
650
|
-
n.onload = (
|
|
651
|
-
s(
|
|
652
|
-
}, n.onerror = (
|
|
649
|
+
return new Promise((s, m) => {
|
|
650
|
+
n.onload = (_) => {
|
|
651
|
+
s(_);
|
|
652
|
+
}, n.onerror = (_) => m(_), n.readAsDataURL(t);
|
|
653
653
|
});
|
|
654
654
|
}
|
|
655
655
|
/** usage:
|
|
@@ -659,32 +659,40 @@ class de {
|
|
|
659
659
|
static formatFileSize(t, n = 2, s) {
|
|
660
660
|
if (t === 0)
|
|
661
661
|
return "0 Bytes";
|
|
662
|
-
const
|
|
663
|
-
let U = Math.floor(Math.log(t) / Math.log(
|
|
664
|
-
s &&
|
|
665
|
-
const I = t / Math.pow(
|
|
666
|
-
return `${parseFloat(I.toFixed(n))} ${
|
|
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
667
|
}
|
|
668
668
|
static save(t, n, s) {
|
|
669
|
-
const
|
|
670
|
-
qt.saveAs(
|
|
669
|
+
const m = new Blob([t], { type: s });
|
|
670
|
+
qt.saveAs(m, n);
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
673
|
class he {
|
|
674
674
|
static load(t) {
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
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);
|
|
679
681
|
}
|
|
680
682
|
static resize(t, n, s) {
|
|
681
|
-
let { width:
|
|
682
|
-
const U = n /
|
|
683
|
-
|
|
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);
|
|
684
686
|
const h = document.createElement("canvas");
|
|
685
|
-
h.width =
|
|
687
|
+
h.width = m, h.height = _;
|
|
686
688
|
const A = h.getContext("2d");
|
|
687
|
-
return A.clearRect(0, 0,
|
|
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
|
+
});
|
|
688
696
|
}
|
|
689
697
|
}
|
|
690
698
|
class Ct {
|
|
@@ -739,9 +747,9 @@ class X {
|
|
|
739
747
|
args: n,
|
|
740
748
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
741
749
|
};
|
|
742
|
-
for (const
|
|
750
|
+
for (const m of X.listeners)
|
|
743
751
|
try {
|
|
744
|
-
if (
|
|
752
|
+
if (m(s) === !1)
|
|
745
753
|
return;
|
|
746
754
|
} catch {
|
|
747
755
|
}
|
|
@@ -749,9 +757,9 @@ class X {
|
|
|
749
757
|
}
|
|
750
758
|
static onLog(t, n = !1) {
|
|
751
759
|
if (n) {
|
|
752
|
-
const s = (
|
|
760
|
+
const s = (m) => {
|
|
753
761
|
try {
|
|
754
|
-
return t(
|
|
762
|
+
return t(m);
|
|
755
763
|
} finally {
|
|
756
764
|
X.listeners.delete(s);
|
|
757
765
|
}
|
|
@@ -762,8 +770,8 @@ class X {
|
|
|
762
770
|
}
|
|
763
771
|
}
|
|
764
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) => {
|
|
765
|
-
const
|
|
766
|
-
return Vt(
|
|
773
|
+
const m = n(a), _ = n(t);
|
|
774
|
+
return Vt(m, _, s);
|
|
767
775
|
};
|
|
768
776
|
class pe {
|
|
769
777
|
static get(t) {
|
|
@@ -816,8 +824,8 @@ function P(a, t, n) {
|
|
|
816
824
|
function me() {
|
|
817
825
|
P(Array.prototype, "distinct", function(a) {
|
|
818
826
|
return a ? this.filter(
|
|
819
|
-
(n, s,
|
|
820
|
-
) : this.filter((n, s,
|
|
827
|
+
(n, s, m) => m.findIndex((_) => a(_, n)) === s
|
|
828
|
+
) : this.filter((n, s, m) => m.indexOf(n) === s);
|
|
821
829
|
}), P(Array.prototype, "filterBy", function(a) {
|
|
822
830
|
return this.filter((t) => a(t));
|
|
823
831
|
}), P(Array.prototype, "first", function() {
|
|
@@ -839,7 +847,7 @@ function Xt() {
|
|
|
839
847
|
(function(n, s) {
|
|
840
848
|
a.exports = s();
|
|
841
849
|
})(Gt, (function() {
|
|
842
|
-
var n = 1e3, s = 6e4,
|
|
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) {
|
|
843
851
|
var d = ["th", "st", "nd", "rd"], f = v % 100;
|
|
844
852
|
return "[" + v + (d[(f - 20) % 10] || d[f] || d[0]) + "]";
|
|
845
853
|
} }, dt = function(v, d, f) {
|
|
@@ -855,13 +863,13 @@ function Xt() {
|
|
|
855
863
|
}, a: function(v) {
|
|
856
864
|
return v < 0 ? Math.ceil(v) || 0 : Math.floor(v);
|
|
857
865
|
}, p: function(v) {
|
|
858
|
-
return { M: j, y: q, w: A, d: h, D: G, h: K, m: I, s: U, ms:
|
|
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$/, "");
|
|
859
867
|
}, u: function(v) {
|
|
860
868
|
return v === void 0;
|
|
861
869
|
} }, ct = "en", V = {};
|
|
862
870
|
V[ct] = wt;
|
|
863
871
|
var R = "$isDayjsObject", e = function(v) {
|
|
864
|
-
return v instanceof
|
|
872
|
+
return v instanceof y || !(!v || !v[R]);
|
|
865
873
|
}, r = function v(d, f, o) {
|
|
866
874
|
var c;
|
|
867
875
|
if (!d) return ct;
|
|
@@ -871,19 +879,19 @@ function Xt() {
|
|
|
871
879
|
var w = d.split("-");
|
|
872
880
|
if (!c && w.length > 1) return v(w[0]);
|
|
873
881
|
} else {
|
|
874
|
-
var
|
|
875
|
-
V[
|
|
882
|
+
var g = d.name;
|
|
883
|
+
V[g] = d, c = g;
|
|
876
884
|
}
|
|
877
885
|
return !o && c && (ct = c), c || !o && ct;
|
|
878
886
|
}, i = function(v, d) {
|
|
879
887
|
if (e(v)) return v.clone();
|
|
880
888
|
var f = typeof d == "object" ? d : {};
|
|
881
|
-
return f.date = v, f.args = arguments, new
|
|
889
|
+
return f.date = v, f.args = arguments, new y(f);
|
|
882
890
|
}, u = bt;
|
|
883
891
|
u.l = r, u.i = e, u.w = function(v, d) {
|
|
884
892
|
return i(v, { locale: d.$L, utc: d.$u, x: d.$x, $offset: d.$offset });
|
|
885
893
|
};
|
|
886
|
-
var
|
|
894
|
+
var y = (function() {
|
|
887
895
|
function v(f) {
|
|
888
896
|
this.$L = r(f.locale, null, !0), this.parse(f), this.$x = this.$x || f.x || {}, this[R] = !0;
|
|
889
897
|
}
|
|
@@ -897,8 +905,8 @@ function Xt() {
|
|
|
897
905
|
if (typeof c == "string" && !/Z$/i.test(c)) {
|
|
898
906
|
var w = c.match(ut);
|
|
899
907
|
if (w) {
|
|
900
|
-
var
|
|
901
|
-
return l ? new Date(Date.UTC(w[1],
|
|
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);
|
|
902
910
|
}
|
|
903
911
|
}
|
|
904
912
|
return new Date(c);
|
|
@@ -924,20 +932,20 @@ function Xt() {
|
|
|
924
932
|
}, d.valueOf = function() {
|
|
925
933
|
return this.$d.getTime();
|
|
926
934
|
}, d.startOf = function(f, o) {
|
|
927
|
-
var c = this, l = !!u.u(o) || o, w = u.p(f),
|
|
928
|
-
var
|
|
929
|
-
return l ?
|
|
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);
|
|
930
938
|
}, k = function(D, O) {
|
|
931
939
|
return u.w(c.toDate()[D].apply(c.toDate("s"), (l ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(O)), c);
|
|
932
940
|
}, p = this.$W, M = this.$M, C = this.$D, Y = "set" + (this.$u ? "UTC" : "");
|
|
933
941
|
switch (w) {
|
|
934
942
|
case q:
|
|
935
|
-
return l ?
|
|
943
|
+
return l ? g(1, 0) : g(31, 11);
|
|
936
944
|
case j:
|
|
937
|
-
return l ?
|
|
945
|
+
return l ? g(1, M) : g(0, M + 1);
|
|
938
946
|
case A:
|
|
939
947
|
var W = this.$locale().weekStart || 0, S = (p < W ? p + 7 : p) - W;
|
|
940
|
-
return
|
|
948
|
+
return g(l ? C - S : C + (6 - S), M);
|
|
941
949
|
case h:
|
|
942
950
|
case G:
|
|
943
951
|
return k(Y + "Hours", 0);
|
|
@@ -953,11 +961,11 @@ function Xt() {
|
|
|
953
961
|
}, d.endOf = function(f) {
|
|
954
962
|
return this.startOf(f, !1);
|
|
955
963
|
}, d.$set = function(f, o) {
|
|
956
|
-
var c, l = u.p(f), w = "set" + (this.$u ? "UTC" : ""),
|
|
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;
|
|
957
965
|
if (l === j || l === q) {
|
|
958
966
|
var p = this.clone().set(G, 1);
|
|
959
|
-
p.$d[
|
|
960
|
-
} else
|
|
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);
|
|
961
969
|
return this.init(), this;
|
|
962
970
|
}, d.set = function(f, o) {
|
|
963
971
|
return this.clone().$set(f, o);
|
|
@@ -966,31 +974,31 @@ function Xt() {
|
|
|
966
974
|
}, d.add = function(f, o) {
|
|
967
975
|
var c, l = this;
|
|
968
976
|
f = Number(f);
|
|
969
|
-
var w = u.p(o),
|
|
977
|
+
var w = u.p(o), g = function(M) {
|
|
970
978
|
var C = i(l);
|
|
971
979
|
return u.w(C.date(C.date() + Math.round(M * f)), l);
|
|
972
980
|
};
|
|
973
981
|
if (w === j) return this.set(j, this.$M + f);
|
|
974
982
|
if (w === q) return this.set(q, this.$y + f);
|
|
975
|
-
if (w === h) return
|
|
976
|
-
if (w === A) return
|
|
977
|
-
var k = (c = {}, c[I] = s, c[K] =
|
|
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;
|
|
978
986
|
return u.w(p, this);
|
|
979
987
|
}, d.subtract = function(f, o) {
|
|
980
988
|
return this.add(-1 * f, o);
|
|
981
989
|
}, d.format = function(f) {
|
|
982
990
|
var o = this, c = this.$locale();
|
|
983
991
|
if (!this.isValid()) return c.invalidDate || nt;
|
|
984
|
-
var l = f || "YYYY-MM-DDTHH:mm:ssZ", w = u.z(this),
|
|
985
|
-
return O && (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);
|
|
986
994
|
}, S = function(O) {
|
|
987
|
-
return u.s(
|
|
988
|
-
}, D = Y || function(O,
|
|
995
|
+
return u.s(g % 12 || 12, O, "0");
|
|
996
|
+
}, D = Y || function(O, b, T) {
|
|
989
997
|
var B = O < 12 ? "AM" : "PM";
|
|
990
998
|
return T ? B.toLowerCase() : B;
|
|
991
999
|
};
|
|
992
|
-
return l.replace(mt, (function(O,
|
|
993
|
-
return
|
|
1000
|
+
return l.replace(mt, (function(O, b) {
|
|
1001
|
+
return b || (function(T) {
|
|
994
1002
|
switch (T) {
|
|
995
1003
|
case "YY":
|
|
996
1004
|
return String(o.$y).slice(-2);
|
|
@@ -1017,17 +1025,17 @@ function Xt() {
|
|
|
1017
1025
|
case "dddd":
|
|
1018
1026
|
return M[o.$W];
|
|
1019
1027
|
case "H":
|
|
1020
|
-
return String(
|
|
1028
|
+
return String(g);
|
|
1021
1029
|
case "HH":
|
|
1022
|
-
return u.s(
|
|
1030
|
+
return u.s(g, 2, "0");
|
|
1023
1031
|
case "h":
|
|
1024
1032
|
return S(1);
|
|
1025
1033
|
case "hh":
|
|
1026
1034
|
return S(2);
|
|
1027
1035
|
case "a":
|
|
1028
|
-
return D(
|
|
1036
|
+
return D(g, k, !0);
|
|
1029
1037
|
case "A":
|
|
1030
|
-
return D(
|
|
1038
|
+
return D(g, k, !1);
|
|
1031
1039
|
case "m":
|
|
1032
1040
|
return String(k);
|
|
1033
1041
|
case "mm":
|
|
@@ -1047,10 +1055,10 @@ function Xt() {
|
|
|
1047
1055
|
}, d.utcOffset = function() {
|
|
1048
1056
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
1049
1057
|
}, d.diff = function(f, o, c) {
|
|
1050
|
-
var l, w = this,
|
|
1058
|
+
var l, w = this, g = u.p(o), k = i(f), p = (k.utcOffset() - this.utcOffset()) * s, M = this - k, C = function() {
|
|
1051
1059
|
return u.m(w, k);
|
|
1052
1060
|
};
|
|
1053
|
-
switch (
|
|
1061
|
+
switch (g) {
|
|
1054
1062
|
case q:
|
|
1055
1063
|
l = C() / 12;
|
|
1056
1064
|
break;
|
|
@@ -1067,7 +1075,7 @@ function Xt() {
|
|
|
1067
1075
|
l = (M - p) / 864e5;
|
|
1068
1076
|
break;
|
|
1069
1077
|
case K:
|
|
1070
|
-
l = M /
|
|
1078
|
+
l = M / m;
|
|
1071
1079
|
break;
|
|
1072
1080
|
case I:
|
|
1073
1081
|
l = M / s;
|
|
@@ -1098,13 +1106,13 @@ function Xt() {
|
|
|
1098
1106
|
}, d.toString = function() {
|
|
1099
1107
|
return this.$d.toUTCString();
|
|
1100
1108
|
}, v;
|
|
1101
|
-
})(), E =
|
|
1102
|
-
return i.prototype = E, [["$ms",
|
|
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) {
|
|
1103
1111
|
E[v[1]] = function(d) {
|
|
1104
1112
|
return this.$g(d, v[0], v[1]);
|
|
1105
1113
|
};
|
|
1106
1114
|
})), i.extend = function(v, d) {
|
|
1107
|
-
return v.$i || (v(d,
|
|
1115
|
+
return v.$i || (v(d, y, i), v.$i = !0), i;
|
|
1108
1116
|
}, i.locale = r, i.isDayjs = e, i.unix = function(v) {
|
|
1109
1117
|
return i(1e3 * v);
|
|
1110
1118
|
}, i.en = V[ct], i.Ls = V, i.p = {}, i;
|
|
@@ -1120,15 +1128,15 @@ function ee() {
|
|
|
1120
1128
|
a.exports = s();
|
|
1121
1129
|
})(te, (function() {
|
|
1122
1130
|
var n = "day";
|
|
1123
|
-
return function(s,
|
|
1131
|
+
return function(s, m, _) {
|
|
1124
1132
|
var U = function(h) {
|
|
1125
1133
|
return h.add(4 - h.isoWeekday(), n);
|
|
1126
|
-
}, I =
|
|
1134
|
+
}, I = m.prototype;
|
|
1127
1135
|
I.isoWeekYear = function() {
|
|
1128
1136
|
return U(this).year();
|
|
1129
1137
|
}, I.isoWeek = function(h) {
|
|
1130
1138
|
if (!this.$utils().u(h)) return this.add(7 * (h - this.isoWeek()), n);
|
|
1131
|
-
var A, j, Q, q, G = U(this), nt = (A = this.isoWeekYear(), j = this.$u, Q = (j ?
|
|
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));
|
|
1132
1140
|
return G.diff(nt, "week") + 1;
|
|
1133
1141
|
}, I.isoWeekday = function(h) {
|
|
1134
1142
|
return this.$utils().u(h) ? this.day() || 7 : this.day(this.day() % 7 ? h : h - 7);
|
|
@@ -1151,9 +1159,9 @@ function se() {
|
|
|
1151
1159
|
a.exports = s();
|
|
1152
1160
|
})(ie, (function() {
|
|
1153
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" };
|
|
1154
|
-
return function(s,
|
|
1155
|
-
var U =
|
|
1156
|
-
|
|
1162
|
+
return function(s, m, _) {
|
|
1163
|
+
var U = m.prototype, I = U.format;
|
|
1164
|
+
_.en.formats = n, U.format = function(K) {
|
|
1157
1165
|
K === void 0 && (K = "YYYY-MM-DDTHH:mm:ssZ");
|
|
1158
1166
|
var h = this.$locale().formats, A = (function(j, Q) {
|
|
1159
1167
|
return j.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g, (function(q, G, nt) {
|