l-min-components 1.8.474 → 1.8.475
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/dist/utils.js +329 -326
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/src/hooks/utils/axiosConfig.js +16 -5
- package/src/utils/axiosConfig.js +16 -5
- package/src/utils/getAxiosInstance.js +20 -0
package/dist/utils.js
CHANGED
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
import { a as ba } from "./chunks/formatDuration.-bee1154e.js";
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as Ga, b as Va, f as Wa, g as $a, r as Ya, u as Ha } from "./chunks/formatDuration.-bee1154e.js";
|
|
3
3
|
import { A as Vn, c as Or, g as Pr } from "./chunks/axios-7e873420.js";
|
|
4
4
|
import "react";
|
|
5
5
|
if (typeof ga > "u")
|
|
6
6
|
var ga = window;
|
|
7
|
-
const Wn = /* @__PURE__ */ new Map(),
|
|
8
|
-
|
|
7
|
+
const Wn = /* @__PURE__ */ new Map(), wa = () => {
|
|
8
|
+
const K = window.location.hostname, C = K.includes("staging"), D = K.includes("localhost"), A = C || D ? "https://dev-117782726-api.learngual.com" : "https://api.learngual.com";
|
|
9
|
+
return console.log("[l-min-components] Axios baseURL:", A, { hostname: K, isStaging: C, isLocalhost: D }), A;
|
|
10
|
+
}, Dt = Vn.create({
|
|
11
|
+
baseURL: wa()
|
|
9
12
|
});
|
|
10
13
|
Dt.interceptors.request.use(
|
|
11
|
-
async (
|
|
12
|
-
const
|
|
13
|
-
if (Wn.has(
|
|
14
|
-
return console.log("preventing::",
|
|
15
|
-
const
|
|
16
|
-
Wn.set(
|
|
14
|
+
async (K) => {
|
|
15
|
+
const C = K.url;
|
|
16
|
+
if (Wn.has(C))
|
|
17
|
+
return console.log("preventing::", C), Promise.reject(new Vn.Cancel("Duplicate request"));
|
|
18
|
+
const D = Vn.CancelToken.source();
|
|
19
|
+
Wn.set(C, D), K.cancelToken = D.token;
|
|
17
20
|
const Y = document.cookie.split(";");
|
|
18
21
|
let U, M;
|
|
19
|
-
for (let
|
|
20
|
-
const W = Y[
|
|
22
|
+
for (let q = 0; q < Y.length; q++) {
|
|
23
|
+
const W = Y[q].trim();
|
|
21
24
|
if (W.startsWith("access=")) {
|
|
22
25
|
U = W.substring(7, W.length);
|
|
23
26
|
break;
|
|
24
27
|
}
|
|
25
28
|
}
|
|
26
|
-
for (let
|
|
27
|
-
const W = Y[
|
|
29
|
+
for (let q = 0; q < Y.length; q++) {
|
|
30
|
+
const W = Y[q].trim();
|
|
28
31
|
if (W.startsWith("defaultAccountID=")) {
|
|
29
32
|
M = W.substring(
|
|
30
33
|
17,
|
|
@@ -34,44 +37,44 @@ Dt.interceptors.request.use(
|
|
|
34
37
|
}
|
|
35
38
|
}
|
|
36
39
|
if (U) {
|
|
37
|
-
|
|
38
|
-
const
|
|
40
|
+
K.headers.Authorization = `Bearer ${U}`;
|
|
41
|
+
const q = {
|
|
39
42
|
// ...config.params,
|
|
40
43
|
// // _tz: date.getTimezoneOffset() / 60,
|
|
41
44
|
// _account: defaultAccountID,
|
|
42
45
|
// //
|
|
43
46
|
_account: M,
|
|
44
|
-
...
|
|
47
|
+
...K.params
|
|
45
48
|
};
|
|
46
|
-
|
|
49
|
+
K.params = q;
|
|
47
50
|
}
|
|
48
|
-
return
|
|
51
|
+
return K;
|
|
49
52
|
},
|
|
50
|
-
(
|
|
53
|
+
(K) => Promise.reject(K)
|
|
51
54
|
);
|
|
52
55
|
Dt.interceptors.response.use(
|
|
53
|
-
(
|
|
54
|
-
(
|
|
55
|
-
var
|
|
56
|
-
if (
|
|
57
|
-
return
|
|
56
|
+
(K) => (Wn.delete(K.config.url), console.log("deleting", K.config.url), K.status === 207 && !window.location.host.includes("staging") && !window.location.host.includes("local") && (window.location.href = "/auth/account-type"), K),
|
|
57
|
+
(K) => {
|
|
58
|
+
var C;
|
|
59
|
+
if (K)
|
|
60
|
+
return K.config && Wn.delete(K.config.url), Vn.isCancel(K) ? {} : ((C = K.response) == null || C.status, K);
|
|
58
61
|
}
|
|
59
62
|
);
|
|
60
|
-
const
|
|
63
|
+
const _a = Dt;
|
|
61
64
|
var Er = { exports: {} };
|
|
62
|
-
(function(
|
|
63
|
-
(function(
|
|
64
|
-
|
|
65
|
+
(function(K, C) {
|
|
66
|
+
(function(D, A) {
|
|
67
|
+
K.exports = A();
|
|
65
68
|
})(Or, function() {
|
|
66
|
-
var
|
|
67
|
-
return (
|
|
69
|
+
var D = function(e, n) {
|
|
70
|
+
return (D = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(t, r) {
|
|
68
71
|
t.__proto__ = r;
|
|
69
72
|
} || function(t, r) {
|
|
70
73
|
for (var a in r)
|
|
71
74
|
Object.prototype.hasOwnProperty.call(r, a) && (t[a] = r[a]);
|
|
72
75
|
})(e, n);
|
|
73
|
-
},
|
|
74
|
-
return (
|
|
76
|
+
}, A = function() {
|
|
77
|
+
return (A = Object.assign || function(e) {
|
|
75
78
|
for (var n, t = 1, r = arguments.length; t < r; t++)
|
|
76
79
|
for (var a in n = arguments[t])
|
|
77
80
|
Object.prototype.hasOwnProperty.call(n, a) && (e[a] = n[a]);
|
|
@@ -84,7 +87,7 @@ var Er = { exports: {} };
|
|
|
84
87
|
!r && a in n || ((r = r || Array.prototype.slice.call(n, 0, a))[a] = n[a]);
|
|
85
88
|
return e.concat(r || Array.prototype.slice.call(n));
|
|
86
89
|
}
|
|
87
|
-
var U = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Or, M = Object.keys,
|
|
90
|
+
var U = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Or, M = Object.keys, q = Array.isArray;
|
|
88
91
|
function W(e, n) {
|
|
89
92
|
return typeof n != "object" || M(n).forEach(function(t) {
|
|
90
93
|
e[t] = n[t];
|
|
@@ -149,7 +152,7 @@ var Er = { exports: {} };
|
|
|
149
152
|
ae(e, n[r], t[r]);
|
|
150
153
|
} else {
|
|
151
154
|
var i, o, u = n.indexOf(".");
|
|
152
|
-
u !== -1 ? (i = n.substr(0, u), (o = n.substr(u + 1)) === "" ? t === void 0 ?
|
|
155
|
+
u !== -1 ? (i = n.substr(0, u), (o = n.substr(u + 1)) === "" ? t === void 0 ? q(e) && !isNaN(parseInt(i)) ? e.splice(i, 1) : delete e[i] : e[i] = t : ae(u = !(u = e[i]) || !re(e, i) ? e[i] = {} : u, o, t)) : t === void 0 ? q(e) && !isNaN(parseInt(n)) ? e.splice(n, 1) : delete e[n] : e[n] = t;
|
|
153
156
|
}
|
|
154
157
|
}
|
|
155
158
|
function Ft(e) {
|
|
@@ -178,7 +181,7 @@ var Er = { exports: {} };
|
|
|
178
181
|
var r = Xe.get(t);
|
|
179
182
|
if (r)
|
|
180
183
|
return r;
|
|
181
|
-
if (
|
|
184
|
+
if (q(t)) {
|
|
182
185
|
r = [], Xe.set(t, r);
|
|
183
186
|
for (var a = 0, i = t.length; a < i; ++a)
|
|
184
187
|
r.push(n(t[a]));
|
|
@@ -209,7 +212,7 @@ var Er = { exports: {} };
|
|
|
209
212
|
function de(e) {
|
|
210
213
|
var n, t, r, a;
|
|
211
214
|
if (arguments.length === 1) {
|
|
212
|
-
if (
|
|
215
|
+
if (q(e))
|
|
213
216
|
return e.slice();
|
|
214
217
|
if (this === Fe && typeof e == "string")
|
|
215
218
|
return [e];
|
|
@@ -344,12 +347,12 @@ var Er = { exports: {} };
|
|
|
344
347
|
return [n, fe(n), e];
|
|
345
348
|
}(), en = Ae[0], ue = Ae[1], Ae = Ae[2], ue = ue && ue.then, Pe = en && en.constructor, Zn = !!Ae, nn = function(e, n) {
|
|
346
349
|
tn.push([e, n]), gn && (queueMicrotask(Yr), gn = !1);
|
|
347
|
-
}, et = !0, gn = !0, Ee = [], bn = [], nt = Je, ye = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: G, pgp: !1, env: {}, finalize: G },
|
|
348
|
-
function
|
|
350
|
+
}, et = !0, gn = !0, Ee = [], bn = [], nt = Je, ye = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: G, pgp: !1, env: {}, finalize: G }, j = ye, tn = [], Ke = 0, wn = [];
|
|
351
|
+
function P(e) {
|
|
349
352
|
if (typeof this != "object")
|
|
350
353
|
throw new TypeError("Promises must be constructed via new");
|
|
351
354
|
this._listeners = [], this._lib = !1;
|
|
352
|
-
var n = this._PSD =
|
|
355
|
+
var n = this._PSD = j;
|
|
353
356
|
if (typeof e != "function") {
|
|
354
357
|
if (e !== Ze)
|
|
355
358
|
throw new TypeError("Not a function");
|
|
@@ -363,7 +366,7 @@ var Er = { exports: {} };
|
|
|
363
366
|
throw new TypeError("A promise cannot be resolved with itself.");
|
|
364
367
|
var o = r._lib && Ue();
|
|
365
368
|
i && typeof i.then == "function" ? t(r, function(u, c) {
|
|
366
|
-
i instanceof
|
|
369
|
+
i instanceof P ? i._then(u, c) : i.then(u, c);
|
|
367
370
|
}) : (r._state = !0, r._value = i, $t(r)), o && ze();
|
|
368
371
|
}
|
|
369
372
|
}, rt.bind(null, r));
|
|
@@ -373,9 +376,9 @@ var Er = { exports: {} };
|
|
|
373
376
|
}(this, e);
|
|
374
377
|
}
|
|
375
378
|
var tt = { get: function() {
|
|
376
|
-
var e =
|
|
379
|
+
var e = j, n = xn;
|
|
377
380
|
function t(r, a) {
|
|
378
|
-
var i = this, o = !e.global && (e !==
|
|
381
|
+
var i = this, o = !e.global && (e !== j || n !== xn), u = o && !be(), c = new P(function(l, m) {
|
|
379
382
|
at(i, new Wt(Ht(r, e, o, u), Ht(a, e, o, u), l, m, e));
|
|
380
383
|
});
|
|
381
384
|
return this._consoleTask && (c._consoleTask = this._consoleTask), c;
|
|
@@ -459,12 +462,12 @@ var Er = { exports: {} };
|
|
|
459
462
|
n[--t]();
|
|
460
463
|
}
|
|
461
464
|
function _n(e) {
|
|
462
|
-
return new
|
|
465
|
+
return new P(Ze, !1, e);
|
|
463
466
|
}
|
|
464
467
|
function $(e, n) {
|
|
465
|
-
var t =
|
|
468
|
+
var t = j;
|
|
466
469
|
return function() {
|
|
467
|
-
var r = Ue(), a =
|
|
470
|
+
var r = Ue(), a = j;
|
|
468
471
|
try {
|
|
469
472
|
return we(t, !0), e.apply(this, arguments);
|
|
470
473
|
} catch (i) {
|
|
@@ -474,8 +477,8 @@ var Er = { exports: {} };
|
|
|
474
477
|
}
|
|
475
478
|
};
|
|
476
479
|
}
|
|
477
|
-
Be(
|
|
478
|
-
at(this, new Wt(null, null, e, n,
|
|
480
|
+
Be(P.prototype, { then: tt, _then: function(e, n) {
|
|
481
|
+
at(this, new Wt(null, null, e, n, j));
|
|
479
482
|
}, catch: function(e) {
|
|
480
483
|
if (arguments.length === 1)
|
|
481
484
|
return this.then(null, e);
|
|
@@ -487,48 +490,48 @@ var Er = { exports: {} };
|
|
|
487
490
|
});
|
|
488
491
|
}, finally: function(e) {
|
|
489
492
|
return this.then(function(n) {
|
|
490
|
-
return
|
|
493
|
+
return P.resolve(e()).then(function() {
|
|
491
494
|
return n;
|
|
492
495
|
});
|
|
493
496
|
}, function(n) {
|
|
494
|
-
return
|
|
497
|
+
return P.resolve(e()).then(function() {
|
|
495
498
|
return _n(n);
|
|
496
499
|
});
|
|
497
500
|
});
|
|
498
501
|
}, timeout: function(e, n) {
|
|
499
502
|
var t = this;
|
|
500
|
-
return e < 1 / 0 ? new
|
|
503
|
+
return e < 1 / 0 ? new P(function(r, a) {
|
|
501
504
|
var i = setTimeout(function() {
|
|
502
505
|
return a(new T.Timeout(n));
|
|
503
506
|
}, e);
|
|
504
507
|
t.then(r, a).finally(clearTimeout.bind(null, i));
|
|
505
508
|
}) : this;
|
|
506
|
-
} }), typeof Symbol < "u" && Symbol.toStringTag && ve(
|
|
509
|
+
} }), typeof Symbol < "u" && Symbol.toStringTag && ve(P.prototype, Symbol.toStringTag, "Dexie.Promise"), ye.env = Yt(), Be(P, { all: function() {
|
|
507
510
|
var e = de.apply(null, arguments).map(On);
|
|
508
|
-
return new
|
|
511
|
+
return new P(function(n, t) {
|
|
509
512
|
e.length === 0 && n([]);
|
|
510
513
|
var r = e.length;
|
|
511
514
|
e.forEach(function(a, i) {
|
|
512
|
-
return
|
|
515
|
+
return P.resolve(a).then(function(o) {
|
|
513
516
|
e[i] = o, --r || n(e);
|
|
514
517
|
}, t);
|
|
515
518
|
});
|
|
516
519
|
});
|
|
517
520
|
}, resolve: function(e) {
|
|
518
|
-
return e instanceof
|
|
521
|
+
return e instanceof P ? e : e && typeof e.then == "function" ? new P(function(n, t) {
|
|
519
522
|
e.then(n, t);
|
|
520
|
-
}) : new
|
|
523
|
+
}) : new P(Ze, !0, e);
|
|
521
524
|
}, reject: _n, race: function() {
|
|
522
525
|
var e = de.apply(null, arguments).map(On);
|
|
523
|
-
return new
|
|
526
|
+
return new P(function(n, t) {
|
|
524
527
|
e.map(function(r) {
|
|
525
|
-
return
|
|
528
|
+
return P.resolve(r).then(n, t);
|
|
526
529
|
});
|
|
527
530
|
});
|
|
528
531
|
}, PSD: { get: function() {
|
|
529
|
-
return
|
|
532
|
+
return j;
|
|
530
533
|
}, set: function(e) {
|
|
531
|
-
return
|
|
534
|
+
return j = e;
|
|
532
535
|
} }, totalEchoes: { get: function() {
|
|
533
536
|
return xn;
|
|
534
537
|
} }, newPSD: ge, usePSD: Ce, scheduler: { get: function() {
|
|
@@ -540,9 +543,9 @@ var Er = { exports: {} };
|
|
|
540
543
|
}, set: function(e) {
|
|
541
544
|
nt = e;
|
|
542
545
|
} }, follow: function(e, n) {
|
|
543
|
-
return new
|
|
546
|
+
return new P(function(t, r) {
|
|
544
547
|
return ge(function(a, i) {
|
|
545
|
-
var o =
|
|
548
|
+
var o = j;
|
|
546
549
|
o.unhandleds = [], o.onunhandled = i, o.finalize = Se(function() {
|
|
547
550
|
var u, c = this;
|
|
548
551
|
u = function() {
|
|
@@ -555,13 +558,13 @@ var Er = { exports: {} };
|
|
|
555
558
|
}, o.finalize), e();
|
|
556
559
|
}, n, t, r);
|
|
557
560
|
});
|
|
558
|
-
} }), Pe && (Pe.allSettled && ve(
|
|
561
|
+
} }), Pe && (Pe.allSettled && ve(P, "allSettled", function() {
|
|
559
562
|
var e = de.apply(null, arguments).map(On);
|
|
560
|
-
return new
|
|
563
|
+
return new P(function(n) {
|
|
561
564
|
e.length === 0 && n([]);
|
|
562
565
|
var t = e.length, r = new Array(t);
|
|
563
566
|
e.forEach(function(a, i) {
|
|
564
|
-
return
|
|
567
|
+
return P.resolve(a).then(function(o) {
|
|
565
568
|
return r[i] = { status: "fulfilled", value: o };
|
|
566
569
|
}, function(o) {
|
|
567
570
|
return r[i] = { status: "rejected", reason: o };
|
|
@@ -570,24 +573,24 @@ var Er = { exports: {} };
|
|
|
570
573
|
});
|
|
571
574
|
});
|
|
572
575
|
});
|
|
573
|
-
}), Pe.any && typeof AggregateError < "u" && ve(
|
|
576
|
+
}), Pe.any && typeof AggregateError < "u" && ve(P, "any", function() {
|
|
574
577
|
var e = de.apply(null, arguments).map(On);
|
|
575
|
-
return new
|
|
578
|
+
return new P(function(n, t) {
|
|
576
579
|
e.length === 0 && t(new AggregateError([]));
|
|
577
580
|
var r = e.length, a = new Array(r);
|
|
578
581
|
e.forEach(function(i, o) {
|
|
579
|
-
return
|
|
582
|
+
return P.resolve(i).then(function(u) {
|
|
580
583
|
return n(u);
|
|
581
584
|
}, function(u) {
|
|
582
585
|
a[o] = u, --r || t(new AggregateError(a));
|
|
583
586
|
});
|
|
584
587
|
});
|
|
585
588
|
});
|
|
586
|
-
}), Pe.withResolvers && (
|
|
589
|
+
}), Pe.withResolvers && (P.withResolvers = Pe.withResolvers));
|
|
587
590
|
var X = { awaits: 0, echoes: 0, id: 0 }, Hr = 0, kn = [], Nn = 0, xn = 0, Qr = 0;
|
|
588
591
|
function ge(e, n, t, r) {
|
|
589
|
-
var a =
|
|
590
|
-
return i.parent = a, i.ref = 0, i.global = !1, i.id = ++Qr, ye.env, i.env = Zn ? { Promise:
|
|
592
|
+
var a = j, i = Object.create(a);
|
|
593
|
+
return i.parent = a, i.ref = 0, i.global = !1, i.id = ++Qr, ye.env, i.env = Zn ? { Promise: P, PromiseProp: { value: P, configurable: !0, writable: !0 }, all: P.all, race: P.race, allSettled: P.allSettled, any: P.any, resolve: P.resolve, reject: P.reject } : {}, n && W(i, n), ++a.ref, i.finalize = function() {
|
|
591
594
|
--this.parent.ref || this.parent.finalize();
|
|
592
595
|
}, r = Ce(i, e, t, r), i.ref === 0 && i.finalize(), r;
|
|
593
596
|
}
|
|
@@ -609,17 +612,17 @@ var Er = { exports: {} };
|
|
|
609
612
|
kn.pop(), we(e, !1);
|
|
610
613
|
}
|
|
611
614
|
function we(e, n) {
|
|
612
|
-
var t, r =
|
|
613
|
-
(n ? !X.echoes || Nn++ && e ===
|
|
614
|
-
++xn, X.echoes && --X.echoes != 0 || (X.echoes = X.awaits = X.id = 0), kn.push(
|
|
615
|
-
}).bind(null, e) : Xr), e !==
|
|
615
|
+
var t, r = j;
|
|
616
|
+
(n ? !X.echoes || Nn++ && e === j : !Nn || --Nn && e === j) || queueMicrotask(n ? (function(a) {
|
|
617
|
+
++xn, X.echoes && --X.echoes != 0 || (X.echoes = X.awaits = X.id = 0), kn.push(j), we(a, !0);
|
|
618
|
+
}).bind(null, e) : Xr), e !== j && (j = e, r === ye && (ye.env = Yt()), Zn && (t = ye.env.Promise, n = e.env, (r.global || e.global) && (Object.defineProperty(U, "Promise", n.PromiseProp), t.all = n.all, t.race = n.race, t.resolve = n.resolve, t.reject = n.reject, n.allSettled && (t.allSettled = n.allSettled), n.any && (t.any = n.any))));
|
|
616
619
|
}
|
|
617
620
|
function Yt() {
|
|
618
621
|
var e = U.Promise;
|
|
619
622
|
return Zn ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(U, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
|
|
620
623
|
}
|
|
621
624
|
function Ce(e, n, t, r, a) {
|
|
622
|
-
var i =
|
|
625
|
+
var i = j;
|
|
623
626
|
try {
|
|
624
627
|
return we(e, !0), n(t, r, a);
|
|
625
628
|
} finally {
|
|
@@ -628,7 +631,7 @@ var Er = { exports: {} };
|
|
|
628
631
|
}
|
|
629
632
|
function Ht(e, n, t, r) {
|
|
630
633
|
return typeof e != "function" ? e : function() {
|
|
631
|
-
var a =
|
|
634
|
+
var a = j;
|
|
632
635
|
t && Ge(), we(n, !0);
|
|
633
636
|
try {
|
|
634
637
|
return e.apply(this, arguments);
|
|
@@ -641,7 +644,7 @@ var Er = { exports: {} };
|
|
|
641
644
|
Promise === Pe && X.echoes === 0 ? Nn === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
642
645
|
}
|
|
643
646
|
("" + ue).indexOf("[native code]") === -1 && (Ge = be = G);
|
|
644
|
-
var H =
|
|
647
|
+
var H = P.reject, je = String.fromCharCode(65535), me = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", Qt = "String expected.", Ve = [], Sn = "__dbnames", ut = "readonly", st = "readwrite";
|
|
645
648
|
function Te(e, n) {
|
|
646
649
|
return e ? n ? function() {
|
|
647
650
|
return e.apply(this, arguments) && n.apply(this, arguments);
|
|
@@ -710,8 +713,8 @@ var Er = { exports: {} };
|
|
|
710
713
|
var n = this["@@propmod"];
|
|
711
714
|
if (n.add !== void 0) {
|
|
712
715
|
var t = n.add;
|
|
713
|
-
if (
|
|
714
|
-
return Y(Y([],
|
|
716
|
+
if (q(t))
|
|
717
|
+
return Y(Y([], q(e) ? e : [], !0), t, !0).sort();
|
|
715
718
|
if (typeof t == "number")
|
|
716
719
|
return (Number(e) || 0) + t;
|
|
717
720
|
if (typeof t == "bigint")
|
|
@@ -724,8 +727,8 @@ var Er = { exports: {} };
|
|
|
724
727
|
}
|
|
725
728
|
if (n.remove !== void 0) {
|
|
726
729
|
var r = n.remove;
|
|
727
|
-
if (
|
|
728
|
-
return
|
|
730
|
+
if (q(r))
|
|
731
|
+
return q(e) ? e.filter(function(a) {
|
|
729
732
|
return !r.includes(a);
|
|
730
733
|
}).sort() : [];
|
|
731
734
|
if (typeof r == "number")
|
|
@@ -751,7 +754,7 @@ var Er = { exports: {} };
|
|
|
751
754
|
return a;
|
|
752
755
|
}
|
|
753
756
|
var rr = (V.prototype._trans = function(e, n, t) {
|
|
754
|
-
var r = this._tx ||
|
|
757
|
+
var r = this._tx || j.trans, a = this.name, i = se && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
755
758
|
function o(l, m, s) {
|
|
756
759
|
if (!s.schema[a])
|
|
757
760
|
throw new T.NotFound("Table " + a + " not part of transaction");
|
|
@@ -759,10 +762,10 @@ var Er = { exports: {} };
|
|
|
759
762
|
}
|
|
760
763
|
var u = Ue();
|
|
761
764
|
try {
|
|
762
|
-
var c = r && r.db._novip === this.db._novip ? r ===
|
|
765
|
+
var c = r && r.db._novip === this.db._novip ? r === j.trans ? r._promise(e, o, t) : ge(function() {
|
|
763
766
|
return r._promise(e, o, t);
|
|
764
|
-
}, { trans: r, transless:
|
|
765
|
-
if (m.idbdb && (m._state.openComplete ||
|
|
767
|
+
}, { trans: r, transless: j.transless || j }) : function l(m, s, v, f) {
|
|
768
|
+
if (m.idbdb && (m._state.openComplete || j.letThrough || m._vip)) {
|
|
766
769
|
var h = m._createTransaction(s, v, m._dbSchema);
|
|
767
770
|
try {
|
|
768
771
|
h.create(), m._state.PR1398_maxLoop = 3;
|
|
@@ -773,7 +776,7 @@ var Er = { exports: {} };
|
|
|
773
776
|
}
|
|
774
777
|
return h._promise(s, function(d, p) {
|
|
775
778
|
return ge(function() {
|
|
776
|
-
return
|
|
779
|
+
return j.trans = h, f(d, p, h);
|
|
777
780
|
});
|
|
778
781
|
}).then(function(d) {
|
|
779
782
|
if (s === "readwrite")
|
|
@@ -813,7 +816,7 @@ var Er = { exports: {} };
|
|
|
813
816
|
}, V.prototype.where = function(e) {
|
|
814
817
|
if (typeof e == "string")
|
|
815
818
|
return new this.db.WhereClause(this, e);
|
|
816
|
-
if (
|
|
819
|
+
if (q(e))
|
|
817
820
|
return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
|
|
818
821
|
var n = M(e);
|
|
819
822
|
if (n.length === 1)
|
|
@@ -845,7 +848,7 @@ var Er = { exports: {} };
|
|
|
845
848
|
var o = n.reduce(function(s, c) {
|
|
846
849
|
var l = s[0], m = s[1], s = r[c], v = e[c];
|
|
847
850
|
return [l || s, l || !s ? Te(m, s && s.multi ? function(f) {
|
|
848
|
-
return f = he(f, c),
|
|
851
|
+
return f = he(f, c), q(f) && f.some(function(h) {
|
|
849
852
|
return a(v, h);
|
|
850
853
|
});
|
|
851
854
|
} : function(f) {
|
|
@@ -868,7 +871,7 @@ var Er = { exports: {} };
|
|
|
868
871
|
}, V.prototype.toCollection = function() {
|
|
869
872
|
return new this.db.Collection(new this.db.WhereClause(this));
|
|
870
873
|
}, V.prototype.orderBy = function(e) {
|
|
871
|
-
return new this.db.Collection(new this.db.WhereClause(this,
|
|
874
|
+
return new this.db.Collection(new this.db.WhereClause(this, q(e) ? "[".concat(e.join("+"), "]") : e));
|
|
872
875
|
}, V.prototype.reverse = function() {
|
|
873
876
|
return this.toCollection().reverse();
|
|
874
877
|
}, V.prototype.mapToClass = function(e) {
|
|
@@ -882,7 +885,7 @@ var Er = { exports: {} };
|
|
|
882
885
|
function m() {
|
|
883
886
|
this.constructor = c;
|
|
884
887
|
}
|
|
885
|
-
|
|
888
|
+
D(c, l), c.prototype = l === null ? Object.create(l) : (m.prototype = l.prototype, new m());
|
|
886
889
|
}(a, n = e), Object.defineProperty(a.prototype, "db", { get: function() {
|
|
887
890
|
return t;
|
|
888
891
|
}, enumerable: !1, configurable: !0 }), a.prototype.table = function() {
|
|
@@ -914,7 +917,7 @@ var Er = { exports: {} };
|
|
|
914
917
|
return i && a && (o = An(i)(e)), this._trans("readwrite", function(u) {
|
|
915
918
|
return t.core.mutate({ trans: u, type: "add", keys: n != null ? [n] : null, values: [o] });
|
|
916
919
|
}).then(function(u) {
|
|
917
|
-
return u.numFailures ?
|
|
920
|
+
return u.numFailures ? P.reject(u.failures[0]) : u.lastResult;
|
|
918
921
|
}).then(function(u) {
|
|
919
922
|
if (i)
|
|
920
923
|
try {
|
|
@@ -929,18 +932,18 @@ var Er = { exports: {} };
|
|
|
929
932
|
return t.core.get({ trans: a, key: e }).then(function(i) {
|
|
930
933
|
var o = i ?? {};
|
|
931
934
|
return tr(o, n), r && ae(o, r, e), t.core.mutate({ trans: a, type: "put", values: [o], keys: [e], upsert: !0, updates: { keys: [e], changeSpecs: [n] } }).then(function(u) {
|
|
932
|
-
return u.numFailures ?
|
|
935
|
+
return u.numFailures ? P.reject(u.failures[0]) : !!i;
|
|
933
936
|
});
|
|
934
937
|
});
|
|
935
938
|
});
|
|
936
939
|
}, V.prototype.update = function(e, n) {
|
|
937
|
-
return typeof e != "object" ||
|
|
940
|
+
return typeof e != "object" || q(e) ? this.where(":id").equals(e).modify(n) : (e = he(e, this.schema.primKey.keyPath), e === void 0 ? H(new T.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(n));
|
|
938
941
|
}, V.prototype.put = function(e, n) {
|
|
939
942
|
var t = this, r = this.schema.primKey, a = r.auto, i = r.keyPath, o = e;
|
|
940
943
|
return i && a && (o = An(i)(e)), this._trans("readwrite", function(u) {
|
|
941
944
|
return t.core.mutate({ trans: u, type: "put", values: [o], keys: n != null ? [n] : null });
|
|
942
945
|
}).then(function(u) {
|
|
943
|
-
return u.numFailures ?
|
|
946
|
+
return u.numFailures ? P.reject(u.failures[0]) : u.lastResult;
|
|
944
947
|
}).then(function(u) {
|
|
945
948
|
if (i)
|
|
946
949
|
try {
|
|
@@ -955,7 +958,7 @@ var Er = { exports: {} };
|
|
|
955
958
|
return n.core.mutate({ trans: t, type: "delete", keys: [e] }).then(function(r) {
|
|
956
959
|
return Pn(n, [e], r);
|
|
957
960
|
}).then(function(r) {
|
|
958
|
-
return r.numFailures ?
|
|
961
|
+
return r.numFailures ? P.reject(r.failures[0]) : void 0;
|
|
959
962
|
});
|
|
960
963
|
});
|
|
961
964
|
}, V.prototype.clear = function() {
|
|
@@ -965,7 +968,7 @@ var Er = { exports: {} };
|
|
|
965
968
|
return Pn(e, null, t);
|
|
966
969
|
});
|
|
967
970
|
}).then(function(n) {
|
|
968
|
-
return n.numFailures ?
|
|
971
|
+
return n.numFailures ? P.reject(n.failures[0]) : void 0;
|
|
969
972
|
});
|
|
970
973
|
}, V.prototype.bulkGet = function(e) {
|
|
971
974
|
var n = this;
|
|
@@ -1089,7 +1092,7 @@ var Er = { exports: {} };
|
|
|
1089
1092
|
}
|
|
1090
1093
|
M(l = o).forEach(function(s) {
|
|
1091
1094
|
var v = l[s];
|
|
1092
|
-
if (
|
|
1095
|
+
if (q(v))
|
|
1093
1096
|
i(s, l[s][0], l[s][1]);
|
|
1094
1097
|
else {
|
|
1095
1098
|
if (v !== "asap")
|
|
@@ -1358,22 +1361,22 @@ var Er = { exports: {} };
|
|
|
1358
1361
|
var O = [], _ = [], N = o ? [] : null, S = h ? w : [];
|
|
1359
1362
|
if (!h)
|
|
1360
1363
|
for (var x = 0; x < b; ++x) {
|
|
1361
|
-
var E = k[x],
|
|
1362
|
-
a.call(
|
|
1364
|
+
var E = k[x], B = { value: xe(E), primKey: d[g + x] };
|
|
1365
|
+
a.call(B, B.value, B) !== !1 && (B.value == null ? S.push(d[g + x]) : o || L(u(E), u(B.value)) === 0 ? (_.push(B.value), o && N.push(d[g + x])) : (S.push(d[g + x]), O.push(B.value)));
|
|
1363
1366
|
}
|
|
1364
|
-
return Promise.resolve(0 < O.length && i.mutate({ trans: r, type: "add", values: O }).then(function(
|
|
1365
|
-
for (var F in
|
|
1367
|
+
return Promise.resolve(0 < O.length && i.mutate({ trans: r, type: "add", values: O }).then(function(R) {
|
|
1368
|
+
for (var F in R.failures)
|
|
1366
1369
|
S.splice(parseInt(F), 1);
|
|
1367
|
-
m(O.length,
|
|
1370
|
+
m(O.length, R);
|
|
1368
1371
|
})).then(function() {
|
|
1369
|
-
return (0 < _.length || y && typeof e == "object") && i.mutate({ trans: r, type: "put", keys: N, values: _, criteria: y, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < g }).then(function(
|
|
1370
|
-
return m(_.length,
|
|
1372
|
+
return (0 < _.length || y && typeof e == "object") && i.mutate({ trans: r, type: "put", keys: N, values: _, criteria: y, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < g }).then(function(R) {
|
|
1373
|
+
return m(_.length, R);
|
|
1371
1374
|
});
|
|
1372
1375
|
}).then(function() {
|
|
1373
|
-
return (0 < S.length || y && h) && i.mutate({ trans: r, type: "delete", keys: S, criteria: y, isAdditionalChunk: 0 < g }).then(function(
|
|
1374
|
-
return Pn(t.table, S,
|
|
1375
|
-
}).then(function(
|
|
1376
|
-
return m(S.length,
|
|
1376
|
+
return (0 < S.length || y && h) && i.mutate({ trans: r, type: "delete", keys: S, criteria: y, isAdditionalChunk: 0 < g }).then(function(R) {
|
|
1377
|
+
return Pn(t.table, S, R);
|
|
1378
|
+
}).then(function(R) {
|
|
1379
|
+
return m(S.length, R);
|
|
1377
1380
|
});
|
|
1378
1381
|
}).then(function() {
|
|
1379
1382
|
return d.length > g + b && p(g + c);
|
|
@@ -1465,13 +1468,13 @@ var Er = { exports: {} };
|
|
|
1465
1468
|
return !0;
|
|
1466
1469
|
for (var b = null, w = f; w < s; ++w) {
|
|
1467
1470
|
var k = function(O, _, N, S, x, E) {
|
|
1468
|
-
for (var
|
|
1471
|
+
for (var B = Math.min(O.length, S.length), R = -1, F = 0; F < B; ++F) {
|
|
1469
1472
|
var oe = _[F];
|
|
1470
1473
|
if (oe !== S[F])
|
|
1471
|
-
return x(O[F], N[F]) < 0 ? O.substr(0, F) + N[F] + N.substr(F + 1) : x(O[F], S[F]) < 0 ? O.substr(0, F) + S[F] + N.substr(F + 1) : 0 <=
|
|
1472
|
-
x(O[F], oe) < 0 && (
|
|
1474
|
+
return x(O[F], N[F]) < 0 ? O.substr(0, F) + N[F] + N.substr(F + 1) : x(O[F], S[F]) < 0 ? O.substr(0, F) + S[F] + N.substr(F + 1) : 0 <= R ? O.substr(0, R) + _[R] + N.substr(R + 1) : null;
|
|
1475
|
+
x(O[F], oe) < 0 && (R = F);
|
|
1473
1476
|
}
|
|
1474
|
-
return
|
|
1477
|
+
return B < S.length && E === "next" ? O + N.substr(O.length) : B < O.length && E === "prev" ? O.substr(0, N.length) : R < 0 ? null : O.substr(0, R) + S[R] + N.substr(R + 1);
|
|
1475
1478
|
}(y, g, u[w], c[w], o, l);
|
|
1476
1479
|
k === null && b === null ? f = w + 1 : (b === null || 0 < o(b, k)) && (b = k);
|
|
1477
1480
|
}
|
|
@@ -1644,10 +1647,10 @@ var Er = { exports: {} };
|
|
|
1644
1647
|
e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
|
|
1645
1648
|
}
|
|
1646
1649
|
var sn = "storagemutated", ft = "x-storagemutated-1", ke = an(null, sn), na = (le.prototype._lock = function() {
|
|
1647
|
-
return Qe(!
|
|
1650
|
+
return Qe(!j.global), ++this._reculock, this._reculock !== 1 || j.global || (j.lockOwnerFor = this), this;
|
|
1648
1651
|
}, le.prototype._unlock = function() {
|
|
1649
|
-
if (Qe(!
|
|
1650
|
-
for (
|
|
1652
|
+
if (Qe(!j.global), --this._reculock == 0)
|
|
1653
|
+
for (j.global || (j.lockOwnerFor = null); 0 < this._blockedFuncs.length && !this._locked(); ) {
|
|
1651
1654
|
var e = this._blockedFuncs.shift();
|
|
1652
1655
|
try {
|
|
1653
1656
|
Ce(e[1], e[0]);
|
|
@@ -1656,7 +1659,7 @@ var Er = { exports: {} };
|
|
|
1656
1659
|
}
|
|
1657
1660
|
return this;
|
|
1658
1661
|
}, le.prototype._locked = function() {
|
|
1659
|
-
return this._reculock &&
|
|
1662
|
+
return this._reculock && j.lockOwnerFor !== this;
|
|
1660
1663
|
}, le.prototype.create = function(e) {
|
|
1661
1664
|
var n = this;
|
|
1662
1665
|
if (!this.mode)
|
|
@@ -1687,14 +1690,14 @@ var Er = { exports: {} };
|
|
|
1687
1690
|
if (!this.active)
|
|
1688
1691
|
return H(new T.TransactionInactive());
|
|
1689
1692
|
if (this._locked())
|
|
1690
|
-
return new
|
|
1693
|
+
return new P(function(i, o) {
|
|
1691
1694
|
r._blockedFuncs.push([function() {
|
|
1692
1695
|
r._promise(e, n, t).then(i, o);
|
|
1693
|
-
},
|
|
1696
|
+
}, j]);
|
|
1694
1697
|
});
|
|
1695
1698
|
if (t)
|
|
1696
1699
|
return ge(function() {
|
|
1697
|
-
var i = new
|
|
1700
|
+
var i = new P(function(o, u) {
|
|
1698
1701
|
r._lock();
|
|
1699
1702
|
var c = n(o, u, r);
|
|
1700
1703
|
c && c.then && c.then(o, u);
|
|
@@ -1703,7 +1706,7 @@ var Er = { exports: {} };
|
|
|
1703
1706
|
return r._unlock();
|
|
1704
1707
|
}), i._lib = !0, i;
|
|
1705
1708
|
});
|
|
1706
|
-
var a = new
|
|
1709
|
+
var a = new P(function(i, o) {
|
|
1707
1710
|
var u = n(i, o, r);
|
|
1708
1711
|
u && u.then && u.then(i, o);
|
|
1709
1712
|
});
|
|
@@ -1711,7 +1714,7 @@ var Er = { exports: {} };
|
|
|
1711
1714
|
}, le.prototype._root = function() {
|
|
1712
1715
|
return this.parent ? this.parent._root() : this;
|
|
1713
1716
|
}, le.prototype.waitFor = function(e) {
|
|
1714
|
-
var n, t = this._root(), r =
|
|
1717
|
+
var n, t = this._root(), r = P.resolve(e);
|
|
1715
1718
|
t._waitingFor ? t._waitingFor = t._waitingFor.then(function() {
|
|
1716
1719
|
return r;
|
|
1717
1720
|
}) : (t._waitingFor = r, t._waitingQueue = [], n = t.idbtrans.objectStore(t.storeNames[0]), function i() {
|
|
@@ -1720,7 +1723,7 @@ var Er = { exports: {} };
|
|
|
1720
1723
|
t._waitingFor && (n.get(-1 / 0).onsuccess = i);
|
|
1721
1724
|
}());
|
|
1722
1725
|
var a = t._waitingFor;
|
|
1723
|
-
return new
|
|
1726
|
+
return new P(function(i, o) {
|
|
1724
1727
|
r.then(function(u) {
|
|
1725
1728
|
return t._waitingQueue.push($(i.bind(null, u)));
|
|
1726
1729
|
}, function(u) {
|
|
@@ -1808,42 +1811,42 @@ var Er = { exports: {} };
|
|
|
1808
1811
|
throw new Error("Given keys array must have same length as given values array.");
|
|
1809
1812
|
if (E === 0)
|
|
1810
1813
|
return k({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
1811
|
-
function
|
|
1814
|
+
function B(te) {
|
|
1812
1815
|
++oe, un(te);
|
|
1813
1816
|
}
|
|
1814
|
-
var
|
|
1817
|
+
var R = [], F = [], oe = 0;
|
|
1815
1818
|
if (y === "deleteRange") {
|
|
1816
1819
|
if (w.type === 4)
|
|
1817
1820
|
return k({ numFailures: oe, failures: F, results: [], lastResult: void 0 });
|
|
1818
|
-
w.type === 3 ?
|
|
1821
|
+
w.type === 3 ? R.push(x = _.clear()) : R.push(x = _.delete(r(w)));
|
|
1819
1822
|
} else {
|
|
1820
1823
|
var N = S ? N ? [b, g] : [b, null] : [g, null], I = N[0], ee = N[1];
|
|
1821
1824
|
if (S)
|
|
1822
1825
|
for (var ne = 0; ne < E; ++ne)
|
|
1823
|
-
|
|
1826
|
+
R.push(x = ee && ee[ne] !== void 0 ? _[y](I[ne], ee[ne]) : _[y](I[ne])), x.onerror = B;
|
|
1824
1827
|
else
|
|
1825
1828
|
for (ne = 0; ne < E; ++ne)
|
|
1826
|
-
|
|
1829
|
+
R.push(x = _[y](I[ne])), x.onerror = B;
|
|
1827
1830
|
}
|
|
1828
1831
|
function zn(te) {
|
|
1829
|
-
te = te.target.result,
|
|
1832
|
+
te = te.target.result, R.forEach(function(qe, jt) {
|
|
1830
1833
|
return qe.error != null && (F[jt] = qe.error);
|
|
1831
|
-
}), k({ numFailures: oe, failures: F, results: y === "delete" ? g :
|
|
1834
|
+
}), k({ numFailures: oe, failures: F, results: y === "delete" ? g : R.map(function(qe) {
|
|
1832
1835
|
return qe.result;
|
|
1833
1836
|
}), lastResult: te });
|
|
1834
1837
|
}
|
|
1835
1838
|
x.onerror = function(te) {
|
|
1836
|
-
|
|
1839
|
+
B(te), zn(te);
|
|
1837
1840
|
}, x.onsuccess = zn;
|
|
1838
1841
|
});
|
|
1839
1842
|
}, getMany: function(d) {
|
|
1840
1843
|
var p = d.trans, y = d.keys;
|
|
1841
1844
|
return new Promise(function(g, b) {
|
|
1842
1845
|
g = $(g);
|
|
1843
|
-
for (var w, k = p.objectStore(h), O = y.length, _ = new Array(O), N = 0, S = 0, x = function(
|
|
1844
|
-
|
|
1845
|
-
}, E = ce(b),
|
|
1846
|
-
y[
|
|
1846
|
+
for (var w, k = p.objectStore(h), O = y.length, _ = new Array(O), N = 0, S = 0, x = function(R) {
|
|
1847
|
+
R = R.target, _[R._pos] = R.result, ++S === N && g(_);
|
|
1848
|
+
}, E = ce(b), B = 0; B < O; ++B)
|
|
1849
|
+
y[B] != null && ((w = k.get(y[B]))._pos = B, w.onsuccess = x, w.onerror = E, ++N);
|
|
1847
1850
|
N === 0 && g(_);
|
|
1848
1851
|
});
|
|
1849
1852
|
}, get: function(d) {
|
|
@@ -1864,8 +1867,8 @@ var Er = { exports: {} };
|
|
|
1864
1867
|
f ? ((_ = k ? S.getAll(x, _) : S.getAllKeys(x, _)).onsuccess = function(E) {
|
|
1865
1868
|
return p({ result: E.target.result });
|
|
1866
1869
|
}, _.onerror = ce(y)) : (g = 0, b = !k && "openKeyCursor" in S ? S.openKeyCursor(x) : S.openCursor(x), w = [], b.onsuccess = function(E) {
|
|
1867
|
-
var
|
|
1868
|
-
return
|
|
1870
|
+
var B = b.result;
|
|
1871
|
+
return B ? (w.push(k ? B.value : B.primaryKey), ++g === O ? p({ result: w }) : void B.continue()) : p({ result: w });
|
|
1869
1872
|
}, b.onerror = ce(y));
|
|
1870
1873
|
});
|
|
1871
1874
|
}), openCursor: function(d) {
|
|
@@ -1874,8 +1877,8 @@ var Er = { exports: {} };
|
|
|
1874
1877
|
k = $(k);
|
|
1875
1878
|
var S = g.index, _ = g.range, N = p.objectStore(h), N = S.isPrimaryKey ? N : N.index(S.name), S = b ? w ? "prevunique" : "prev" : w ? "nextunique" : "next", x = !y && "openKeyCursor" in N ? N.openKeyCursor(r(_), S) : N.openCursor(r(_), S);
|
|
1876
1879
|
x.onerror = ce(O), x.onsuccess = $(function(E) {
|
|
1877
|
-
var
|
|
1878
|
-
I ? (I.___id = ++ta, I.done = !1,
|
|
1880
|
+
var B, R, F, oe, I = x.result;
|
|
1881
|
+
I ? (I.___id = ++ta, I.done = !1, B = I.continue.bind(I), R = (R = I.continuePrimaryKey) && R.bind(I), F = I.advance.bind(I), oe = function() {
|
|
1879
1882
|
throw new Error("Cursor not stopped");
|
|
1880
1883
|
}, I.trans = p, I.stop = I.continue = I.continuePrimaryKey = I.advance = function() {
|
|
1881
1884
|
throw new Error("Cursor not started");
|
|
@@ -1906,7 +1909,7 @@ var Er = { exports: {} };
|
|
|
1906
1909
|
});
|
|
1907
1910
|
return x.onsuccess = $(function(te) {
|
|
1908
1911
|
x.onsuccess = ne, ne();
|
|
1909
|
-
}), I.continue =
|
|
1912
|
+
}), I.continue = B, I.continuePrimaryKey = R, I.advance = F, ne(), zn;
|
|
1910
1913
|
}, k(I)) : k(null);
|
|
1911
1914
|
}, O);
|
|
1912
1915
|
});
|
|
@@ -1923,10 +1926,10 @@ var Er = { exports: {} };
|
|
|
1923
1926
|
var i, o, u, m = (o = c, u = lr((i = e).objectStoreNames), { schema: { name: i.name, tables: u.map(function(v) {
|
|
1924
1927
|
return o.objectStore(v);
|
|
1925
1928
|
}).map(function(v) {
|
|
1926
|
-
var f = v.keyPath, p = v.autoIncrement, h =
|
|
1929
|
+
var f = v.keyPath, p = v.autoIncrement, h = q(f), d = {}, p = { name: v.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: f == null, compound: h, keyPath: f, autoIncrement: p, unique: !0, extractKey: mt(f) }, indexes: lr(v.indexNames).map(function(y) {
|
|
1927
1930
|
return v.index(y);
|
|
1928
1931
|
}).map(function(w) {
|
|
1929
|
-
var g = w.name, b = w.unique, k = w.multiEntry, w = w.keyPath, k = { name: g, compound:
|
|
1932
|
+
var g = w.name, b = w.unique, k = w.multiEntry, w = w.keyPath, k = { name: g, compound: q(w), keyPath: w, unique: b, multiEntry: k, extractKey: mt(w) };
|
|
1930
1933
|
return d[ln(w)] = k;
|
|
1931
1934
|
}), getIndexByKeyPath: function(y) {
|
|
1932
1935
|
return d[ln(y)];
|
|
@@ -1944,7 +1947,7 @@ var Er = { exports: {} };
|
|
|
1944
1947
|
function aa(e, n, t, r) {
|
|
1945
1948
|
var a = t.IDBKeyRange;
|
|
1946
1949
|
return t.indexedDB, { dbcore: (r = ra(n, a, r), e.dbcore.reduce(function(i, o) {
|
|
1947
|
-
return o = o.create,
|
|
1950
|
+
return o = o.create, A(A({}, i), o(i));
|
|
1948
1951
|
}, r)) };
|
|
1949
1952
|
}
|
|
1950
1953
|
function jn(e, r) {
|
|
@@ -1985,11 +1988,11 @@ var Er = { exports: {} };
|
|
|
1985
1988
|
t.objectStoreNames.contains("$meta") && !a.$meta && (a.$meta = dt("$meta", hr("")[0], []), e._storeNames.push("$meta"));
|
|
1986
1989
|
var i = e._createTransaction("readwrite", e._storeNames, a);
|
|
1987
1990
|
i.create(t), i._completion.catch(r);
|
|
1988
|
-
var o = i._reject.bind(i), u =
|
|
1991
|
+
var o = i._reject.bind(i), u = j.transless || j;
|
|
1989
1992
|
ge(function() {
|
|
1990
|
-
return
|
|
1993
|
+
return j.trans = i, j.transless = u, n !== 0 ? (jn(e, t), l = n, ((c = i).storeNames.includes("$meta") ? c.table("$meta").get("version").then(function(m) {
|
|
1991
1994
|
return m ?? l;
|
|
1992
|
-
}) :
|
|
1995
|
+
}) : P.resolve(l)).then(function(m) {
|
|
1993
1996
|
return v = m, f = i, h = t, d = [], m = (s = e)._versions, p = s._dbSchema = Dn(0, s.idbdb, h), (m = m.filter(function(y) {
|
|
1994
1997
|
return y._cfg.version >= v;
|
|
1995
1998
|
})).length !== 0 ? (m.forEach(function(y) {
|
|
@@ -2019,10 +2022,10 @@ var Er = { exports: {} };
|
|
|
2019
2022
|
O[S] = g[S];
|
|
2020
2023
|
}), pt(s, [s.Transaction.prototype]), Tn(s, [s.Transaction.prototype], M(O), O), f.schema = O;
|
|
2021
2024
|
var _, N = Qn(k);
|
|
2022
|
-
return N && Ge(), w =
|
|
2025
|
+
return N && Ge(), w = P.follow(function() {
|
|
2023
2026
|
var S;
|
|
2024
2027
|
(_ = k(f)) && N && (S = be.bind(null, null), _.then(S, S));
|
|
2025
|
-
}), _ && typeof _.then == "function" ?
|
|
2028
|
+
}), _ && typeof _.then == "function" ? P.resolve(_) : w.then(function() {
|
|
2026
2029
|
return _;
|
|
2027
2030
|
});
|
|
2028
2031
|
}
|
|
@@ -2037,14 +2040,14 @@ var Er = { exports: {} };
|
|
|
2037
2040
|
})) : g.objectStore("$meta").put(y._cfg.version, "version"));
|
|
2038
2041
|
});
|
|
2039
2042
|
}), function y() {
|
|
2040
|
-
return d.length ?
|
|
2043
|
+
return d.length ? P.resolve(d.shift()(f.idbtrans)).then(y) : P.resolve();
|
|
2041
2044
|
}().then(function() {
|
|
2042
2045
|
fr(p, h);
|
|
2043
|
-
})) :
|
|
2046
|
+
})) : P.resolve();
|
|
2044
2047
|
var s, v, f, h, d, p;
|
|
2045
2048
|
}).catch(o)) : (M(a).forEach(function(m) {
|
|
2046
2049
|
yt(t, m, a[m].primKey, a[m].indexes);
|
|
2047
|
-
}), jn(e, t), void
|
|
2050
|
+
}), jn(e, t), void P.follow(function() {
|
|
2048
2051
|
return e.on.populate.fire(i);
|
|
2049
2052
|
}).catch(o));
|
|
2050
2053
|
var c, l;
|
|
@@ -2130,7 +2133,7 @@ var Er = { exports: {} };
|
|
|
2130
2133
|
function hr(e) {
|
|
2131
2134
|
return e.split(",").map(function(n, t) {
|
|
2132
2135
|
var i = n.split(":"), r = (a = i[1]) === null || a === void 0 ? void 0 : a.trim(), a = (n = i[0].trim()).replace(/([&*]|\+\+)/g, ""), i = /^\[/.test(a) ? a.match(/^\[(.*)\]$/)[1].split("+") : a;
|
|
2133
|
-
return ht(a, i || null, /\&/.test(n), /\*/.test(n), /\+\+/.test(n),
|
|
2136
|
+
return ht(a, i || null, /\&/.test(n), /\*/.test(n), /\+\+/.test(n), q(i), t === 0, r);
|
|
2134
2137
|
});
|
|
2135
2138
|
}
|
|
2136
2139
|
var sa = (Ye.prototype._createTableSchema = dt, Ye.prototype._parseIndexSyntax = hr, Ye.prototype._parseStoresSpec = function(e, n) {
|
|
@@ -2171,7 +2174,7 @@ var Er = { exports: {} };
|
|
|
2171
2174
|
}
|
|
2172
2175
|
function wt(e) {
|
|
2173
2176
|
return ge(function() {
|
|
2174
|
-
return
|
|
2177
|
+
return j.letThrough = !0, e();
|
|
2175
2178
|
});
|
|
2176
2179
|
}
|
|
2177
2180
|
function _t(e) {
|
|
@@ -2244,7 +2247,7 @@ var Er = { exports: {} };
|
|
|
2244
2247
|
}
|
|
2245
2248
|
function mr(e) {
|
|
2246
2249
|
var n, t, r = (((n = e.r) === null || n === void 0 ? void 0 : n.d) || 0) - (((t = e.l) === null || t === void 0 ? void 0 : t.d) || 0), a = 1 < r ? "r" : r < -1 ? "l" : "";
|
|
2247
|
-
a && (n = a == "r" ? "l" : "r", t =
|
|
2250
|
+
a && (n = a == "r" ? "l" : "r", t = A({}, e), r = e[a], e.from = r.from, e.to = r.to, e[a] = r[a], t[a] = r[n], (e[n] = t).d = pr(t)), e.d = pr(e);
|
|
2248
2251
|
}
|
|
2249
2252
|
function pr(t) {
|
|
2250
2253
|
var n = t.r, t = t.l;
|
|
@@ -2330,7 +2333,7 @@ var Er = { exports: {} };
|
|
|
2330
2333
|
throw new T.DatabaseClosed("db.open() was cancelled");
|
|
2331
2334
|
}
|
|
2332
2335
|
function u() {
|
|
2333
|
-
return new
|
|
2336
|
+
return new P(function(v, f) {
|
|
2334
2337
|
if (o(), !t)
|
|
2335
2338
|
throw new T.MissingAPI();
|
|
2336
2339
|
var h = e.name, d = n.autoSchema || !a ? t.open(h) : t.open(h, a);
|
|
@@ -2372,11 +2375,11 @@ var Er = { exports: {} };
|
|
|
2372
2375
|
if (0 < a)
|
|
2373
2376
|
return a = 0, u();
|
|
2374
2377
|
}
|
|
2375
|
-
return
|
|
2378
|
+
return P.reject(v);
|
|
2376
2379
|
});
|
|
2377
2380
|
}
|
|
2378
2381
|
var c, l = n.dbReadyResolve, m = null, s = !1;
|
|
2379
|
-
return
|
|
2382
|
+
return P.race([r, (typeof navigator > "u" ? P.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(v) {
|
|
2380
2383
|
function f() {
|
|
2381
2384
|
return indexedDB.databases().finally(v);
|
|
2382
2385
|
}
|
|
@@ -2384,12 +2387,12 @@ var Er = { exports: {} };
|
|
|
2384
2387
|
}).finally(function() {
|
|
2385
2388
|
return clearInterval(c);
|
|
2386
2389
|
}) : Promise.resolve()).then(u)]).then(function() {
|
|
2387
|
-
return o(), n.onReadyBeingFired = [],
|
|
2390
|
+
return o(), n.onReadyBeingFired = [], P.resolve(wt(function() {
|
|
2388
2391
|
return e.on.ready.fire(e.vip);
|
|
2389
2392
|
})).then(function v() {
|
|
2390
2393
|
if (0 < n.onReadyBeingFired.length) {
|
|
2391
2394
|
var f = n.onReadyBeingFired.reduce(Jn, G);
|
|
2392
|
-
return n.onReadyBeingFired = [],
|
|
2395
|
+
return n.onReadyBeingFired = [], P.resolve(wt(function() {
|
|
2393
2396
|
return f(e.vip);
|
|
2394
2397
|
})).then(v);
|
|
2395
2398
|
}
|
|
@@ -2424,21 +2427,21 @@ var Er = { exports: {} };
|
|
|
2424
2427
|
function a(i) {
|
|
2425
2428
|
return function(c) {
|
|
2426
2429
|
var u = i(c), c = u.value;
|
|
2427
|
-
return u.done ? c : c && typeof c.then == "function" ? c.then(t, r) :
|
|
2430
|
+
return u.done ? c : c && typeof c.then == "function" ? c.then(t, r) : q(c) ? Promise.all(c).then(t, r) : t(c);
|
|
2428
2431
|
};
|
|
2429
2432
|
}
|
|
2430
2433
|
return a(n)();
|
|
2431
2434
|
}
|
|
2432
2435
|
function Mn(e, n, t) {
|
|
2433
|
-
for (var r =
|
|
2436
|
+
for (var r = q(e) ? e.slice() : [e], a = 0; a < t; ++a)
|
|
2434
2437
|
r.push(n);
|
|
2435
2438
|
return r;
|
|
2436
2439
|
}
|
|
2437
2440
|
var la = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2438
|
-
return
|
|
2441
|
+
return A(A({}, e), { table: function(n) {
|
|
2439
2442
|
var t = e.table(n), r = t.schema, a = {}, i = [];
|
|
2440
2443
|
function o(s, v, f) {
|
|
2441
|
-
var h = ln(s), d = a[h] = a[h] || [], p = s == null ? 0 : typeof s == "string" ? 1 : s.length, y = 0 < v, y =
|
|
2444
|
+
var h = ln(s), d = a[h] = a[h] || [], p = s == null ? 0 : typeof s == "string" ? 1 : s.length, y = 0 < v, y = A(A({}, f), { name: y ? "".concat(h, "(virtual-from:").concat(f.name, ")") : f.name, lowLevelIndex: f, isVirtual: y, keyTail: v, keyLength: p, extractKey: mt(s), unique: !y && f.unique });
|
|
2442
2445
|
return d.push(y), y.isPrimaryKey || i.push(y), 1 < p && o(p === 2 ? s[0] : s.slice(0, p - 1), v + 1, f), d.sort(function(g, b) {
|
|
2443
2446
|
return g.keyTail - b.keyTail;
|
|
2444
2447
|
}), y;
|
|
@@ -2450,9 +2453,9 @@ var Er = { exports: {} };
|
|
|
2450
2453
|
}
|
|
2451
2454
|
function m(s) {
|
|
2452
2455
|
var v, f = s.query.index;
|
|
2453
|
-
return f.isVirtual ?
|
|
2456
|
+
return f.isVirtual ? A(A({}, s), { query: { index: f.lowLevelIndex, range: (v = s.query.range, f = f.keyTail, { type: v.type === 1 ? 2 : v.type, lower: Mn(v.lower, v.lowerOpen ? e.MAX_KEY : e.MIN_KEY, f), lowerOpen: !0, upper: Mn(v.upper, v.upperOpen ? e.MIN_KEY : e.MAX_KEY, f), upperOpen: !0 }) } }) : s;
|
|
2454
2457
|
}
|
|
2455
|
-
return
|
|
2458
|
+
return A(A({}, t), { schema: A(A({}, r), { primaryKey: n, indexes: i, getIndexByKeyPath: function(s) {
|
|
2456
2459
|
return (s = a[ln(s)]) && s[0];
|
|
2457
2460
|
} }), count: function(s) {
|
|
2458
2461
|
return t.count(m(s));
|
|
@@ -2492,10 +2495,10 @@ var Er = { exports: {} };
|
|
|
2492
2495
|
return n.type === "delete" ? n.keys : n.keys || n.values.map(e.extractKey);
|
|
2493
2496
|
}
|
|
2494
2497
|
var fa = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
|
|
2495
|
-
return
|
|
2498
|
+
return A(A({}, e), { table: function(n) {
|
|
2496
2499
|
var t = e.table(n), r = t.schema.primaryKey;
|
|
2497
|
-
return
|
|
2498
|
-
var i =
|
|
2500
|
+
return A(A({}, t), { mutate: function(a) {
|
|
2501
|
+
var i = j.trans, o = i.table(n).hook, u = o.deleting, c = o.creating, l = o.updating;
|
|
2499
2502
|
switch (a.type) {
|
|
2500
2503
|
case "add":
|
|
2501
2504
|
if (c.fire === G)
|
|
@@ -2523,7 +2526,7 @@ var Er = { exports: {} };
|
|
|
2523
2526
|
return t.query({ trans: v, values: !1, query: { index: r, range: f }, limit: h }).then(function(d) {
|
|
2524
2527
|
var p = d.result;
|
|
2525
2528
|
return m({ type: "delete", keys: p, trans: v }).then(function(y) {
|
|
2526
|
-
return 0 < y.numFailures ? Promise.reject(y.failures[0]) : p.length < h ? { failures: [], numFailures: 0, lastResult: void 0 } : s(v,
|
|
2529
|
+
return 0 < y.numFailures ? Promise.reject(y.failures[0]) : p.length < h ? { failures: [], numFailures: 0, lastResult: void 0 } : s(v, A(A({}, f), { lower: p[p.length - 1], lowerOpen: !0 }), h);
|
|
2527
2530
|
});
|
|
2528
2531
|
});
|
|
2529
2532
|
}(a.trans, a.range, 1e4);
|
|
@@ -2531,10 +2534,10 @@ var Er = { exports: {} };
|
|
|
2531
2534
|
}
|
|
2532
2535
|
return t.mutate(a);
|
|
2533
2536
|
function m(s) {
|
|
2534
|
-
var v, f, h, d =
|
|
2537
|
+
var v, f, h, d = j.trans, p = s.keys || Pt(r, s);
|
|
2535
2538
|
if (!p)
|
|
2536
2539
|
throw new Error("Keys missing");
|
|
2537
|
-
return (s = s.type === "add" || s.type === "put" ?
|
|
2540
|
+
return (s = s.type === "add" || s.type === "put" ? A(A({}, s), { keys: p }) : A({}, s)).type !== "delete" && (s.values = Y([], s.values, !0)), s.keys && (s.keys = Y([], s.keys, !0)), v = t, h = p, ((f = s).type === "add" ? Promise.resolve([]) : v.getMany({ trans: f.trans, keys: h, cache: "immutable" })).then(function(y) {
|
|
2538
2541
|
var g = p.map(function(b, w) {
|
|
2539
2542
|
var k, O, _, N = y[w], S = { onerror: null, onsuccess: null };
|
|
2540
2543
|
return s.type === "delete" ? u.fire.call(S, b, N, d) : s.type === "add" || N === void 0 ? (k = c.fire.call(S, b, s.values[w], d), b == null && k != null && (s.keys[w] = b = k, r.outbound || ae(s.values[w], r.keyPath, b))) : (k = At(N, s.values[w]), (O = l.fire.call(S, k, b, N, d)) && (_ = s.values[w], Object.keys(O).forEach(function(x) {
|
|
@@ -2571,11 +2574,11 @@ var Er = { exports: {} };
|
|
|
2571
2574
|
var ha = { stack: "dbcore", level: -1, create: function(e) {
|
|
2572
2575
|
return { table: function(n) {
|
|
2573
2576
|
var t = e.table(n);
|
|
2574
|
-
return
|
|
2577
|
+
return A(A({}, t), { getMany: function(r) {
|
|
2575
2578
|
if (!r.cache)
|
|
2576
2579
|
return t.getMany(r);
|
|
2577
2580
|
var a = yr(r.keys, r.trans._cache, r.cache === "clone");
|
|
2578
|
-
return a ?
|
|
2581
|
+
return a ? P.resolve(a) : t.getMany(r).then(function(i) {
|
|
2579
2582
|
return r.trans._cache = { keys: r.keys, values: r.cache === "clone" ? xe(i) : i }, i;
|
|
2580
2583
|
});
|
|
2581
2584
|
}, mutate: function(r) {
|
|
@@ -2599,45 +2602,45 @@ var Er = { exports: {} };
|
|
|
2599
2602
|
}
|
|
2600
2603
|
var da = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
2601
2604
|
var n = e.schema.name, t = new Z(e.MIN_KEY, e.MAX_KEY);
|
|
2602
|
-
return
|
|
2603
|
-
if (
|
|
2604
|
-
throw new T.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(
|
|
2605
|
+
return A(A({}, e), { transaction: function(r, a, i) {
|
|
2606
|
+
if (j.subscr && a !== "readonly")
|
|
2607
|
+
throw new T.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(j.querier));
|
|
2605
2608
|
return e.transaction(r, a, i);
|
|
2606
2609
|
}, table: function(r) {
|
|
2607
2610
|
var a = e.table(r), i = a.schema, o = i.primaryKey, s = i.indexes, u = o.extractKey, c = o.outbound, l = o.autoIncrement && s.filter(function(f) {
|
|
2608
2611
|
return f.compound && f.keyPath.includes(o.keyPath);
|
|
2609
|
-
}), m =
|
|
2612
|
+
}), m = A(A({}, a), { mutate: function(f) {
|
|
2610
2613
|
function h(x) {
|
|
2611
2614
|
return x = "idb://".concat(n, "/").concat(r, "/").concat(x), b[x] || (b[x] = new Z());
|
|
2612
2615
|
}
|
|
2613
2616
|
var d, p, y, g = f.trans, b = f.mutatedParts || (f.mutatedParts = {}), w = h(""), k = h(":dels"), O = f.type, S = f.type === "deleteRange" ? [f.range] : f.type === "delete" ? [f.keys] : f.values.length < 50 ? [Pt(o, f).filter(function(x) {
|
|
2614
2617
|
return x;
|
|
2615
2618
|
}), f.values] : [], _ = S[0], N = S[1], S = f.trans._cache;
|
|
2616
|
-
return
|
|
2619
|
+
return q(_) ? (w.addKeys(_), (S = O === "delete" || _.length === N.length ? yr(_, S) : null) || k.addKeys(_), (S || N) && (d = h, p = S, y = N, i.indexes.forEach(function(x) {
|
|
2617
2620
|
var E = d(x.name || "");
|
|
2618
|
-
function
|
|
2621
|
+
function B(F) {
|
|
2619
2622
|
return F != null ? x.extractKey(F) : null;
|
|
2620
2623
|
}
|
|
2621
|
-
function
|
|
2622
|
-
return x.multiEntry &&
|
|
2624
|
+
function R(F) {
|
|
2625
|
+
return x.multiEntry && q(F) ? F.forEach(function(oe) {
|
|
2623
2626
|
return E.addKey(oe);
|
|
2624
2627
|
}) : E.addKey(F);
|
|
2625
2628
|
}
|
|
2626
2629
|
(p || y).forEach(function(F, ee) {
|
|
2627
|
-
var I = p &&
|
|
2628
|
-
L(I, ee) !== 0 && (I != null &&
|
|
2630
|
+
var I = p && B(p[ee]), ee = y && B(y[ee]);
|
|
2631
|
+
L(I, ee) !== 0 && (I != null && R(I), ee != null && R(ee));
|
|
2629
2632
|
});
|
|
2630
2633
|
}))) : _ ? (N = { from: (N = _.lower) !== null && N !== void 0 ? N : e.MIN_KEY, to: (N = _.upper) !== null && N !== void 0 ? N : e.MAX_KEY }, k.add(N), w.add(N)) : (w.add(t), k.add(t), i.indexes.forEach(function(x) {
|
|
2631
2634
|
return h(x.name).add(t);
|
|
2632
2635
|
})), a.mutate(f).then(function(x) {
|
|
2633
2636
|
return !_ || f.type !== "add" && f.type !== "put" || (w.addKeys(x.results), l && l.forEach(function(E) {
|
|
2634
|
-
for (var
|
|
2637
|
+
for (var B = f.values.map(function(I) {
|
|
2635
2638
|
return E.extractKey(I);
|
|
2636
|
-
}),
|
|
2639
|
+
}), R = E.keyPath.findIndex(function(I) {
|
|
2637
2640
|
return I === o.keyPath;
|
|
2638
2641
|
}), F = 0, oe = x.results.length; F < oe; ++F)
|
|
2639
|
-
|
|
2640
|
-
h(E.name).addKeys(
|
|
2642
|
+
B[F][R] = x.results[F];
|
|
2643
|
+
h(E.name).addKeys(B);
|
|
2641
2644
|
})), g.mutatedParts = Rn(g.mutatedParts || {}, b), x;
|
|
2642
2645
|
});
|
|
2643
2646
|
} }), s = function(h) {
|
|
@@ -2650,19 +2653,19 @@ var Er = { exports: {} };
|
|
|
2650
2653
|
}, count: s, query: s, openCursor: s };
|
|
2651
2654
|
return M(v).forEach(function(f) {
|
|
2652
2655
|
m[f] = function(h) {
|
|
2653
|
-
var d =
|
|
2656
|
+
var d = j.subscr, p = !!d, y = gr(j, a) && br(f, h) ? h.obsSet = {} : d;
|
|
2654
2657
|
if (p) {
|
|
2655
2658
|
var g = function(N) {
|
|
2656
2659
|
return N = "idb://".concat(n, "/").concat(r, "/").concat(N), y[N] || (y[N] = new Z());
|
|
2657
2660
|
}, b = g(""), w = g(":dels"), d = v[f](h), p = d[0], d = d[1];
|
|
2658
2661
|
if ((f === "query" && p.isPrimaryKey && !h.values ? w : g(p.name || "")).add(d), !p.isPrimaryKey) {
|
|
2659
2662
|
if (f !== "count") {
|
|
2660
|
-
var k = f === "query" && c && h.values && a.query(
|
|
2663
|
+
var k = f === "query" && c && h.values && a.query(A(A({}, h), { values: !1 }));
|
|
2661
2664
|
return a[f].apply(this, arguments).then(function(N) {
|
|
2662
2665
|
if (f === "query") {
|
|
2663
2666
|
if (c && h.values)
|
|
2664
|
-
return k.then(function(
|
|
2665
|
-
return
|
|
2667
|
+
return k.then(function(B) {
|
|
2668
|
+
return B = B.result, b.addKeys(B), N;
|
|
2666
2669
|
});
|
|
2667
2670
|
var S = h.values ? N.result.map(u) : N.result;
|
|
2668
2671
|
(h.values ? b : w).addKeys(S);
|
|
@@ -2671,8 +2674,8 @@ var Er = { exports: {} };
|
|
|
2671
2674
|
return x && Object.create(x, { key: { get: function() {
|
|
2672
2675
|
return w.addKey(x.primaryKey), x.key;
|
|
2673
2676
|
} }, primaryKey: { get: function() {
|
|
2674
|
-
var
|
|
2675
|
-
return w.addKey(
|
|
2677
|
+
var B = x.primaryKey;
|
|
2678
|
+
return w.addKey(B), B;
|
|
2676
2679
|
} }, value: { get: function() {
|
|
2677
2680
|
return E && b.addKey(x.primaryKey), x.value;
|
|
2678
2681
|
} } });
|
|
@@ -2694,9 +2697,9 @@ var Er = { exports: {} };
|
|
|
2694
2697
|
if (n.type === "deleteRange")
|
|
2695
2698
|
return null;
|
|
2696
2699
|
var r = n.keys ? n.keys.length : "values" in n && n.values ? n.values.length : 1;
|
|
2697
|
-
return t.numFailures === r ? null : (n =
|
|
2700
|
+
return t.numFailures === r ? null : (n = A({}, n), q(n.keys) && (n.keys = n.keys.filter(function(a, i) {
|
|
2698
2701
|
return !(i in t.failures);
|
|
2699
|
-
})), "values" in n &&
|
|
2702
|
+
})), "values" in n && q(n.values) && (n.values = n.values.filter(function(a, i) {
|
|
2700
2703
|
return !(i in t.failures);
|
|
2701
2704
|
})), n);
|
|
2702
2705
|
}
|
|
@@ -2712,7 +2715,7 @@ var Er = { exports: {} };
|
|
|
2712
2715
|
if (h.type === "add" || h.type === "put")
|
|
2713
2716
|
for (var y = new Z(), g = h.values.length - 1; 0 <= g; --g) {
|
|
2714
2717
|
var b, w = h.values[g], k = l(w);
|
|
2715
|
-
y.hasKey(k) || (b = m(w), (u &&
|
|
2718
|
+
y.hasKey(k) || (b = m(w), (u && q(b) ? b.some(function(x) {
|
|
2716
2719
|
return Et(x, c);
|
|
2717
2720
|
}) : Et(b, c)) && (y.addKey(k), p.push(w)));
|
|
2718
2721
|
}
|
|
@@ -2800,7 +2803,7 @@ var Er = { exports: {} };
|
|
|
2800
2803
|
}
|
|
2801
2804
|
var va = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
|
|
2802
2805
|
var n = e.schema.name;
|
|
2803
|
-
return
|
|
2806
|
+
return A(A({}, e), { transaction: function(t, r, a) {
|
|
2804
2807
|
var i, o, u = e.transaction(t, r, a);
|
|
2805
2808
|
return r === "readwrite" && (o = (i = new AbortController()).signal, a = function(c) {
|
|
2806
2809
|
return function() {
|
|
@@ -2825,7 +2828,7 @@ var Er = { exports: {} };
|
|
|
2825
2828
|
for (var O, _, N, S = 0, x = (O = k[w]).slice(); S < x.length; S++)
|
|
2826
2829
|
(_ = x[S]).res != null && u.mutatedParts && (c && !_.dirty ? (N = Object.isFrozen(_.res), N = _r(_.res, _.req, d, h, _, N), _.dirty ? (Oe(O, _), _.subscribers.forEach(function(E) {
|
|
2827
2830
|
return l.add(E);
|
|
2828
|
-
})) : N !== _.res && (_.res = N, _.promise =
|
|
2831
|
+
})) : N !== _.res && (_.res = N, _.promise = P.resolve({ result: N }))) : (_.dirty && Oe(O, _), _.subscribers.forEach(function(E) {
|
|
2829
2832
|
return l.add(E);
|
|
2830
2833
|
})));
|
|
2831
2834
|
}
|
|
@@ -2839,8 +2842,8 @@ var Er = { exports: {} };
|
|
|
2839
2842
|
}, u.addEventListener("abort", a(!1), { signal: o }), u.addEventListener("error", a(!1), { signal: o }), u.addEventListener("complete", a(!0), { signal: o })), u;
|
|
2840
2843
|
}, table: function(t) {
|
|
2841
2844
|
var r = e.table(t), a = r.schema.primaryKey;
|
|
2842
|
-
return
|
|
2843
|
-
var o =
|
|
2845
|
+
return A(A({}, r), { mutate: function(i) {
|
|
2846
|
+
var o = j.trans;
|
|
2844
2847
|
if (a.outbound || o.db._options.cache === "disabled" || o.explicit || o.idbtrans.mode !== "readwrite")
|
|
2845
2848
|
return r.mutate(i);
|
|
2846
2849
|
var u = Ie["idb://".concat(n, "/").concat(t)];
|
|
@@ -2851,18 +2854,18 @@ var Er = { exports: {} };
|
|
|
2851
2854
|
}), o.catch(function() {
|
|
2852
2855
|
Oe(u.optimisticOps, i), i.mutatedParts && Fn(i.mutatedParts);
|
|
2853
2856
|
})) : o.then(function(c) {
|
|
2854
|
-
var l = wr(0,
|
|
2857
|
+
var l = wr(0, A(A({}, i), { values: i.values.map(function(m, s) {
|
|
2855
2858
|
var v;
|
|
2856
|
-
return c.failures[s] ? m : (m = (v = a.keyPath) !== null && v !== void 0 && v.includes(".") ? xe(m) :
|
|
2859
|
+
return c.failures[s] ? m : (m = (v = a.keyPath) !== null && v !== void 0 && v.includes(".") ? xe(m) : A({}, m), ae(m, a.keyPath, c.results[s]), m);
|
|
2857
2860
|
}) }), c);
|
|
2858
2861
|
u.optimisticOps.push(l), queueMicrotask(function() {
|
|
2859
2862
|
return i.mutatedParts && Fn(i.mutatedParts);
|
|
2860
2863
|
});
|
|
2861
2864
|
}), o) : r.mutate(i);
|
|
2862
2865
|
}, query: function(i) {
|
|
2863
|
-
if (!gr(
|
|
2866
|
+
if (!gr(j, r) || !br("query", i))
|
|
2864
2867
|
return r.query(i);
|
|
2865
|
-
var o = ((l =
|
|
2868
|
+
var o = ((l = j.trans) === null || l === void 0 ? void 0 : l.db._options.cache) === "immutable", s = j, u = s.requery, c = s.signal, l = function(h, d, p, y) {
|
|
2866
2869
|
var g = Ie["idb://".concat(h, "/").concat(d)];
|
|
2867
2870
|
if (!g)
|
|
2868
2871
|
return [];
|
|
@@ -2919,7 +2922,7 @@ var Er = { exports: {} };
|
|
|
2919
2922
|
return t || (t = new this.Version(e), n.push(t), n.sort(ia), t.stores({}), this._state.autoSchema = !1, t);
|
|
2920
2923
|
}, Q.prototype._whenReady = function(e) {
|
|
2921
2924
|
var n = this;
|
|
2922
|
-
return this.idbdb && (this._state.openComplete ||
|
|
2925
|
+
return this.idbdb && (this._state.openComplete || j.letThrough || this._vip) ? e() : new P(function(t, r) {
|
|
2923
2926
|
if (n._state.openComplete)
|
|
2924
2927
|
return r(new T.DatabaseClosed(n._state.dbOpenError));
|
|
2925
2928
|
if (!n._state.isBeingOpened) {
|
|
@@ -2954,9 +2957,9 @@ var Er = { exports: {} };
|
|
|
2954
2957
|
}
|
|
2955
2958
|
this.idbdb = null;
|
|
2956
2959
|
}
|
|
2957
|
-
e.isBeingOpened || (e.dbReadyPromise = new
|
|
2960
|
+
e.isBeingOpened || (e.dbReadyPromise = new P(function(t) {
|
|
2958
2961
|
e.dbReadyResolve = t;
|
|
2959
|
-
}), e.openCanceller = new
|
|
2962
|
+
}), e.openCanceller = new P(function(t, r) {
|
|
2960
2963
|
e.cancelOpen = r;
|
|
2961
2964
|
}));
|
|
2962
2965
|
}, Q.prototype.close = function(t) {
|
|
@@ -2966,7 +2969,7 @@ var Er = { exports: {} };
|
|
|
2966
2969
|
var n = this;
|
|
2967
2970
|
e === void 0 && (e = { disableAutoOpen: !0 });
|
|
2968
2971
|
var t = 0 < arguments.length && typeof arguments[0] != "object", r = this._state;
|
|
2969
|
-
return new
|
|
2972
|
+
return new P(function(a, i) {
|
|
2970
2973
|
function o() {
|
|
2971
2974
|
n.close(e);
|
|
2972
2975
|
var u = n._deps.indexedDB.deleteDatabase(n.name);
|
|
@@ -3006,7 +3009,7 @@ var Er = { exports: {} };
|
|
|
3006
3009
|
}).apply(this, arguments);
|
|
3007
3010
|
return this._transaction.apply(this, e);
|
|
3008
3011
|
}, Q.prototype._transaction = function(e, n, t) {
|
|
3009
|
-
var r = this, a =
|
|
3012
|
+
var r = this, a = j.trans;
|
|
3010
3013
|
a && a.db === this && e.indexOf("!") === -1 || (a = null);
|
|
3011
3014
|
var i, o, u = e.indexOf("?") !== -1;
|
|
3012
3015
|
e = e.replace("!", "").replace("?", "");
|
|
@@ -3042,8 +3045,8 @@ var Er = { exports: {} };
|
|
|
3042
3045
|
}) : H(l);
|
|
3043
3046
|
}
|
|
3044
3047
|
var c = (function l(m, s, v, f, h) {
|
|
3045
|
-
return
|
|
3046
|
-
var d =
|
|
3048
|
+
return P.resolve().then(function() {
|
|
3049
|
+
var d = j.transless || j, p = m._createTransaction(s, v, m._dbSchema, f);
|
|
3047
3050
|
if (p.explicit = !0, d = { trans: p, transless: d }, f)
|
|
3048
3051
|
p.idbtrans = f.idbtrans;
|
|
3049
3052
|
else
|
|
@@ -3055,10 +3058,10 @@ var Er = { exports: {} };
|
|
|
3055
3058
|
})) : H(b);
|
|
3056
3059
|
}
|
|
3057
3060
|
var y, g = Qn(h);
|
|
3058
|
-
return g && Ge(), d =
|
|
3061
|
+
return g && Ge(), d = P.follow(function() {
|
|
3059
3062
|
var b;
|
|
3060
3063
|
(y = h.call(p, p)) && (g ? (b = be.bind(null, null), y.then(b, b)) : typeof y.next == "function" && typeof y.throw == "function" && (y = St(y)));
|
|
3061
|
-
}, d), (y && typeof y.then == "function" ?
|
|
3064
|
+
}, d), (y && typeof y.then == "function" ? P.resolve(y).then(function(b) {
|
|
3062
3065
|
return p.active ? b : H(new T.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
3063
3066
|
}) : d.then(function() {
|
|
3064
3067
|
return y;
|
|
@@ -3071,7 +3074,7 @@ var Er = { exports: {} };
|
|
|
3071
3074
|
});
|
|
3072
3075
|
});
|
|
3073
3076
|
}).bind(null, this, i, o, a, t);
|
|
3074
|
-
return a ? a._promise(i, c, "lock") :
|
|
3077
|
+
return a ? a._promise(i, c, "lock") : j.trans ? Ce(j.transless, function() {
|
|
3075
3078
|
return r._whenReady(c);
|
|
3076
3079
|
}) : this._whenReady(c);
|
|
3077
3080
|
}, Q.prototype.table = function(e) {
|
|
@@ -3083,11 +3086,11 @@ var Er = { exports: {} };
|
|
|
3083
3086
|
var t = this;
|
|
3084
3087
|
this._middlewares = {}, this.verno = 0;
|
|
3085
3088
|
var r = Q.dependencies;
|
|
3086
|
-
this._options = n =
|
|
3089
|
+
this._options = n = A({ addons: Q.addons, autoOpen: !0, indexedDB: r.indexedDB, IDBKeyRange: r.IDBKeyRange, cache: "cloned" }, n), this._deps = { indexedDB: n.indexedDB, IDBKeyRange: n.IDBKeyRange }, r = n.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
3087
3090
|
var a, i, o, u, c, l = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: G, dbReadyPromise: null, cancelOpen: G, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: n.autoOpen };
|
|
3088
|
-
l.dbReadyPromise = new
|
|
3091
|
+
l.dbReadyPromise = new P(function(s) {
|
|
3089
3092
|
l.dbReadyResolve = s;
|
|
3090
|
-
}), l.openCanceller = new
|
|
3093
|
+
}), l.openCanceller = new P(function(s, v) {
|
|
3091
3094
|
l.cancelOpen = v;
|
|
3092
3095
|
}), this._state = l, this.name = e, this.on = an(this, "populate", "blocked", "versionchange", "close", { ready: [Jn, G] }), this.once = function(s, v) {
|
|
3093
3096
|
var f = function() {
|
|
@@ -3100,7 +3103,7 @@ var Er = { exports: {} };
|
|
|
3100
3103
|
return function(v, f) {
|
|
3101
3104
|
Q.vip(function() {
|
|
3102
3105
|
var h, d = t._state;
|
|
3103
|
-
d.openComplete ? (d.dbOpenError ||
|
|
3106
|
+
d.openComplete ? (d.dbOpenError || P.resolve().then(v), f && s(v)) : d.onReadyBeingFired ? (d.onReadyBeingFired.push(v), f && s(v)) : (s(v), h = t, f || s(function p() {
|
|
3104
3107
|
h.on.ready.unsubscribe(v), h.on.ready.unsubscribe(p);
|
|
3105
3108
|
}));
|
|
3106
3109
|
});
|
|
@@ -3124,7 +3127,7 @@ var Er = { exports: {} };
|
|
|
3124
3127
|
y = (y = f[y]) === null || y === void 0 ? void 0 : y.yProps, y && (v = v.concat(y.map(function(g) {
|
|
3125
3128
|
return g.updatesTable;
|
|
3126
3129
|
})));
|
|
3127
|
-
}), this.db = o, this.mode = s, this.storeNames = v, this.schema = f, this.chromeTransactionDurability = h, this.idbtrans = null, this.on = an(this, "complete", "error", "abort"), this.parent = d || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new
|
|
3130
|
+
}), this.db = o, this.mode = s, this.storeNames = v, this.schema = f, this.chromeTransactionDurability = h, this.idbtrans = null, this.on = an(this, "complete", "error", "abort"), this.parent = d || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new P(function(y, g) {
|
|
3128
3131
|
p._resolve = y, p._reject = g;
|
|
3129
3132
|
}), this._completion.then(function() {
|
|
3130
3133
|
p.active = !1, p.on.complete.fire();
|
|
@@ -3242,7 +3245,7 @@ var Er = { exports: {} };
|
|
|
3242
3245
|
Ne = n;
|
|
3243
3246
|
}
|
|
3244
3247
|
}
|
|
3245
|
-
Be(De,
|
|
3248
|
+
Be(De, A(A({}, yn), { delete: function(e) {
|
|
3246
3249
|
return new De(e, { addons: [] }).delete();
|
|
3247
3250
|
}, exists: function(e) {
|
|
3248
3251
|
return new De(e, { addons: [] }).open().then(function(n) {
|
|
@@ -3268,12 +3271,12 @@ var Er = { exports: {} };
|
|
|
3268
3271
|
W(this, e);
|
|
3269
3272
|
};
|
|
3270
3273
|
}, ignoreTransaction: function(e) {
|
|
3271
|
-
return
|
|
3274
|
+
return j.trans ? Ce(j.transless, e) : e();
|
|
3272
3275
|
}, vip: wt, async: function(e) {
|
|
3273
3276
|
return function() {
|
|
3274
3277
|
try {
|
|
3275
3278
|
var n = St(e.apply(this, arguments));
|
|
3276
|
-
return n && typeof n.then == "function" ? n :
|
|
3279
|
+
return n && typeof n.then == "function" ? n : P.resolve(n);
|
|
3277
3280
|
} catch (t) {
|
|
3278
3281
|
return H(t);
|
|
3279
3282
|
}
|
|
@@ -3281,15 +3284,15 @@ var Er = { exports: {} };
|
|
|
3281
3284
|
}, spawn: function(e, n, t) {
|
|
3282
3285
|
try {
|
|
3283
3286
|
var r = St(e.apply(t, n || []));
|
|
3284
|
-
return r && typeof r.then == "function" ? r :
|
|
3287
|
+
return r && typeof r.then == "function" ? r : P.resolve(r);
|
|
3285
3288
|
} catch (a) {
|
|
3286
3289
|
return H(a);
|
|
3287
3290
|
}
|
|
3288
3291
|
}, currentTransaction: { get: function() {
|
|
3289
|
-
return
|
|
3292
|
+
return j.trans || null;
|
|
3290
3293
|
} }, waitFor: function(e, n) {
|
|
3291
|
-
return n =
|
|
3292
|
-
}, Promise:
|
|
3294
|
+
return n = P.resolve(typeof e == "function" ? De.ignoreTransaction(e) : e).timeout(n || 6e4), j.trans ? j.trans.waitFor(n) : n;
|
|
3295
|
+
}, Promise: P, debug: { get: function() {
|
|
3293
3296
|
return se;
|
|
3294
3297
|
}, set: function(e) {
|
|
3295
3298
|
Gt(e);
|
|
@@ -3322,11 +3325,11 @@ var Er = { exports: {} };
|
|
|
3322
3325
|
}
|
|
3323
3326
|
}), addEventListener("pageshow", function(e) {
|
|
3324
3327
|
!pe.disableBfCache && e.persisted && (se && console.debug("Dexie: handling persisted pageshow"), xr(), Ct({ all: new Z(-1 / 0, [[]]) }));
|
|
3325
|
-
})),
|
|
3328
|
+
})), P.rejectionMapper = function(e, n) {
|
|
3326
3329
|
return !e || e instanceof Me || e instanceof TypeError || e instanceof SyntaxError || !e.name || !zt[e.name] ? e : (n = new zt[e.name](n || e.message, e), "stack" in e && ve(n, "stack", { get: function() {
|
|
3327
3330
|
return this.inner.stack;
|
|
3328
3331
|
} }), n);
|
|
3329
|
-
}, Gt(se),
|
|
3332
|
+
}, Gt(se), A(pe, Object.freeze({ __proto__: null, Dexie: pe, liveQuery: Nr, Entity: Jt, cmp: L, PropModification: rn, replacePrefix: function(e, n) {
|
|
3330
3333
|
return new rn({ replacePrefix: [e, n] });
|
|
3331
3334
|
}, add: function(e) {
|
|
3332
3335
|
return new rn({ add: e });
|
|
@@ -3335,11 +3338,11 @@ var Er = { exports: {} };
|
|
|
3335
3338
|
}, default: pe, RangeSet: Z, mergeRanges: hn, rangesOverlap: dr }), { default: pe }), pe;
|
|
3336
3339
|
});
|
|
3337
3340
|
})(Er);
|
|
3338
|
-
var
|
|
3339
|
-
const Tt = /* @__PURE__ */ Pr(
|
|
3341
|
+
var ka = Er.exports;
|
|
3342
|
+
const Tt = /* @__PURE__ */ Pr(ka), Sr = Symbol.for("Dexie"), It = globalThis[Sr] || (globalThis[Sr] = Tt);
|
|
3340
3343
|
if (Tt.semVer !== It.semVer)
|
|
3341
3344
|
throw new Error(`Two different versions of Dexie loaded in the same app: ${Tt.semVer} and ${It.semVer}`);
|
|
3342
|
-
const
|
|
3345
|
+
const Na = {
|
|
3343
3346
|
aa: {
|
|
3344
3347
|
name: "Afar",
|
|
3345
3348
|
nativeName: "Afaraf"
|
|
@@ -4073,177 +4076,177 @@ const ka = {
|
|
|
4073
4076
|
nativeName: "isiZulu"
|
|
4074
4077
|
}
|
|
4075
4078
|
};
|
|
4076
|
-
var
|
|
4077
|
-
const dn =
|
|
4078
|
-
for (const
|
|
4079
|
-
const { name:
|
|
4080
|
-
Kr[
|
|
4079
|
+
var xa = Na;
|
|
4080
|
+
const dn = xa, Kr = {}, $n = {}, Cr = [], jr = [], Tr = [];
|
|
4081
|
+
for (const K in dn) {
|
|
4082
|
+
const { name: C, nativeName: D } = dn[K];
|
|
4083
|
+
Kr[K] = $n[C.toLowerCase()] = $n[D.toLowerCase()] = { code: K, name: C, nativeName: D }, Cr.push(K), jr.push(C), Tr.push(D);
|
|
4081
4084
|
}
|
|
4082
|
-
var
|
|
4083
|
-
static getLanguages(
|
|
4084
|
-
return
|
|
4085
|
-
(
|
|
4085
|
+
var Oa = class Gn {
|
|
4086
|
+
static getLanguages(C = []) {
|
|
4087
|
+
return C.map(
|
|
4088
|
+
(D) => Gn.validate(D) ? Object.assign({}, Kr[D]) : { code: D, name: "", nativeName: "" }
|
|
4086
4089
|
);
|
|
4087
4090
|
}
|
|
4088
|
-
static getName(
|
|
4089
|
-
return Gn.validate(
|
|
4091
|
+
static getName(C) {
|
|
4092
|
+
return Gn.validate(C) ? dn[C].name : "";
|
|
4090
4093
|
}
|
|
4091
4094
|
static getAllNames() {
|
|
4092
4095
|
return jr.slice();
|
|
4093
4096
|
}
|
|
4094
|
-
static getNativeName(
|
|
4095
|
-
return Gn.validate(
|
|
4097
|
+
static getNativeName(C) {
|
|
4098
|
+
return Gn.validate(C) ? dn[C].nativeName : "";
|
|
4096
4099
|
}
|
|
4097
4100
|
static getAllNativeNames() {
|
|
4098
4101
|
return Tr.slice();
|
|
4099
4102
|
}
|
|
4100
|
-
static getCode(
|
|
4101
|
-
return
|
|
4103
|
+
static getCode(C) {
|
|
4104
|
+
return C = C.toLowerCase(), $n.hasOwnProperty(C) ? $n[C].code : "";
|
|
4102
4105
|
}
|
|
4103
4106
|
static getAllCodes() {
|
|
4104
4107
|
return Cr.slice();
|
|
4105
4108
|
}
|
|
4106
|
-
static validate(
|
|
4107
|
-
return dn.hasOwnProperty(
|
|
4109
|
+
static validate(C) {
|
|
4110
|
+
return dn.hasOwnProperty(C);
|
|
4108
4111
|
}
|
|
4109
4112
|
};
|
|
4110
|
-
const
|
|
4113
|
+
const Sa = /* @__PURE__ */ Pr(Oa), mn = new It("translations"), Aa = Sa.getAllCodes();
|
|
4111
4114
|
mn.version(2).stores({
|
|
4112
4115
|
kwarg: "&key, value, screenId",
|
|
4113
|
-
...
|
|
4114
|
-
(
|
|
4116
|
+
...Aa.reduce(
|
|
4117
|
+
(K, C) => ({ ...K, [C]: "&key, value, screenId, updatedAt" }),
|
|
4115
4118
|
{}
|
|
4116
4119
|
),
|
|
4117
4120
|
words: "&text, screenId, updatedAt"
|
|
4118
4121
|
});
|
|
4119
|
-
const Ar = (
|
|
4120
|
-
ba.remove(
|
|
4121
|
-
},
|
|
4122
|
-
const
|
|
4123
|
-
|
|
4124
|
-
const { host:
|
|
4125
|
-
|
|
4122
|
+
const Ar = (K, C) => {
|
|
4123
|
+
ba.remove(K, C);
|
|
4124
|
+
}, Pa = (K) => {
|
|
4125
|
+
const C = Array.isArray(K) ? K : [K], D = /* @__PURE__ */ new Date();
|
|
4126
|
+
D.setHours(D.getHours() - 1);
|
|
4127
|
+
const { host: A } = window.location, Y = A.includes("localhost") ? "local" : A.includes("test") || A.includes("staging") ? "staging" : "production";
|
|
4128
|
+
C.forEach((U) => {
|
|
4126
4129
|
var M;
|
|
4127
4130
|
Y === "local" ? Ar(U, {
|
|
4128
4131
|
domain: "localhost",
|
|
4129
|
-
expires:
|
|
4132
|
+
expires: D,
|
|
4130
4133
|
path: "/"
|
|
4131
4134
|
}) : Ar(U, {
|
|
4132
4135
|
domain: window.location.href.includes("localhost") ? "localhost" : (M = window.location.hostname) != null && M.includes("ca") ? ".learngual.ca" : ".learngual.com",
|
|
4133
|
-
expires:
|
|
4136
|
+
expires: D,
|
|
4134
4137
|
path: "/"
|
|
4135
4138
|
});
|
|
4136
4139
|
});
|
|
4137
|
-
},
|
|
4140
|
+
}, Fa = Pa;
|
|
4138
4141
|
window.translationCache || (window.translationCache = {});
|
|
4139
|
-
const
|
|
4140
|
-
async function
|
|
4142
|
+
const Ea = 60 * 60 * 1e3, Ka = "https://learngual-bucket.sfo3.digitaloceanspaces.com/media/media/";
|
|
4143
|
+
async function Ca(K, C, D) {
|
|
4141
4144
|
try {
|
|
4142
|
-
|
|
4145
|
+
_a({
|
|
4143
4146
|
url: "/iam/v1/utils/translate/",
|
|
4144
4147
|
method: "POST",
|
|
4145
4148
|
data: {
|
|
4146
|
-
language:
|
|
4147
|
-
sentences:
|
|
4148
|
-
kwargs:
|
|
4149
|
+
language: D,
|
|
4150
|
+
sentences: K,
|
|
4151
|
+
kwargs: C
|
|
4149
4152
|
},
|
|
4150
4153
|
params: {
|
|
4151
4154
|
_account: ""
|
|
4152
4155
|
},
|
|
4153
4156
|
authRequired: !1
|
|
4154
4157
|
});
|
|
4155
|
-
} catch (
|
|
4156
|
-
console.warn("Translation request failed:",
|
|
4158
|
+
} catch (A) {
|
|
4159
|
+
console.warn("Translation request failed:", A);
|
|
4157
4160
|
}
|
|
4158
4161
|
}
|
|
4159
|
-
async function
|
|
4160
|
-
const
|
|
4161
|
-
if (
|
|
4162
|
-
return
|
|
4162
|
+
async function ja() {
|
|
4163
|
+
const K = Date.now(), C = window.translationCache.master;
|
|
4164
|
+
if (C && C.data && C.expires > K)
|
|
4165
|
+
return C.data;
|
|
4163
4166
|
try {
|
|
4164
|
-
const
|
|
4165
|
-
`${
|
|
4167
|
+
const D = await fetch(
|
|
4168
|
+
`${Ka}qFpINMa05DrgUgzO0PEboReejximpq2r3VL2AmFZAwIq6fTN3A.json`
|
|
4166
4169
|
);
|
|
4167
|
-
if (!
|
|
4168
|
-
throw new Error(`Failed to fetch translations: ${
|
|
4169
|
-
const
|
|
4170
|
+
if (!D.ok)
|
|
4171
|
+
throw new Error(`Failed to fetch translations: ${D.status}`);
|
|
4172
|
+
const A = await D.json();
|
|
4170
4173
|
return window.translationCache.master = {
|
|
4171
|
-
data:
|
|
4172
|
-
timestamp:
|
|
4173
|
-
expires:
|
|
4174
|
-
}, console.log(
|
|
4175
|
-
} catch (
|
|
4176
|
-
if (console.error("Failed to fetch master translations:",
|
|
4177
|
-
return
|
|
4178
|
-
throw
|
|
4174
|
+
data: A,
|
|
4175
|
+
timestamp: K,
|
|
4176
|
+
expires: K + Ea
|
|
4177
|
+
}, console.log(A, "master"), A;
|
|
4178
|
+
} catch (D) {
|
|
4179
|
+
if (console.error("Failed to fetch master translations:", D), C && C.data)
|
|
4180
|
+
return C.data;
|
|
4181
|
+
throw D;
|
|
4179
4182
|
}
|
|
4180
4183
|
}
|
|
4181
|
-
function
|
|
4182
|
-
const
|
|
4183
|
-
return
|
|
4184
|
-
if (
|
|
4185
|
-
const M =
|
|
4186
|
-
|
|
4184
|
+
function Ta(K, C, D) {
|
|
4185
|
+
const A = {}, Y = D.toUpperCase();
|
|
4186
|
+
return C.forEach((U) => {
|
|
4187
|
+
if (K[U] && K[U][Y]) {
|
|
4188
|
+
const M = K[U][Y];
|
|
4189
|
+
A[U] = M.trim() || U;
|
|
4187
4190
|
} else
|
|
4188
|
-
|
|
4189
|
-
}),
|
|
4191
|
+
A[U] = U;
|
|
4192
|
+
}), A;
|
|
4190
4193
|
}
|
|
4191
|
-
async function
|
|
4194
|
+
async function Ia(K, C, D) {
|
|
4192
4195
|
try {
|
|
4193
|
-
const
|
|
4196
|
+
const A = Object.keys(K).map((Y) => ({
|
|
4194
4197
|
key: Y,
|
|
4195
|
-
value:
|
|
4196
|
-
screenId:
|
|
4198
|
+
value: K[Y],
|
|
4199
|
+
screenId: C,
|
|
4197
4200
|
updatedAt: (/* @__PURE__ */ new Date()).toDateString()
|
|
4198
4201
|
}));
|
|
4199
|
-
await mn[
|
|
4200
|
-
} catch (
|
|
4201
|
-
console.error("Failed to cache translations:",
|
|
4202
|
+
await mn[D].bulkPut(A);
|
|
4203
|
+
} catch (A) {
|
|
4204
|
+
console.error("Failed to cache translations:", A);
|
|
4202
4205
|
}
|
|
4203
4206
|
}
|
|
4204
|
-
async function
|
|
4207
|
+
async function Da(K, C) {
|
|
4205
4208
|
try {
|
|
4206
|
-
return (await mn[
|
|
4207
|
-
} catch (
|
|
4208
|
-
return console.error("Failed to get cached translations:",
|
|
4209
|
+
return (await mn[C].where({ screenId: K }).toArray()).reduce((A, Y) => (A[Y.key] = Y.value, A), {});
|
|
4210
|
+
} catch (D) {
|
|
4211
|
+
return console.error("Failed to get cached translations:", D), {};
|
|
4209
4212
|
}
|
|
4210
4213
|
}
|
|
4211
|
-
async function
|
|
4214
|
+
async function Ma(K = "ko") {
|
|
4212
4215
|
await new Promise((M) => {
|
|
4213
4216
|
if (document.readyState === "complete")
|
|
4214
4217
|
return M();
|
|
4215
4218
|
window.addEventListener("load", M);
|
|
4216
4219
|
});
|
|
4217
|
-
const
|
|
4218
|
-
|
|
4220
|
+
const C = btoa(window.location.href), A = (await mn.words.where({ screenId: C }).toArray()).map((M) => M.text), U = (await mn.kwarg.where({ screenId: C }).toArray()).reduce((M, q) => ({ ...M, [q.key]: q.value }), {});
|
|
4221
|
+
Ca(A, U, K);
|
|
4219
4222
|
try {
|
|
4220
|
-
const M = await
|
|
4223
|
+
const M = await ja(), q = Ta(
|
|
4221
4224
|
M,
|
|
4222
|
-
|
|
4223
|
-
|
|
4225
|
+
A,
|
|
4226
|
+
K
|
|
4224
4227
|
);
|
|
4225
|
-
return await
|
|
4228
|
+
return await Ia(q, C, K), q;
|
|
4226
4229
|
} catch (M) {
|
|
4227
4230
|
console.error("Failed to load translations:", M);
|
|
4228
|
-
const
|
|
4229
|
-
return Object.keys(
|
|
4231
|
+
const q = await Da(C, K);
|
|
4232
|
+
return Object.keys(q).length > 0 ? q : A.reduce((W, fe) => (W[fe] = fe, W), {});
|
|
4230
4233
|
}
|
|
4231
4234
|
}
|
|
4232
|
-
function
|
|
4233
|
-
const
|
|
4234
|
-
return
|
|
4235
|
+
function La(K) {
|
|
4236
|
+
const C = /\{([^}]+)\}/g, D = K.match(C);
|
|
4237
|
+
return D ? D.map((A) => A.slice(1, -1)) : [];
|
|
4235
4238
|
}
|
|
4236
4239
|
export {
|
|
4237
|
-
|
|
4238
|
-
|
|
4240
|
+
_a as axiosConfig,
|
|
4241
|
+
Ga as convertBlobToWav,
|
|
4239
4242
|
mn as db,
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4243
|
+
Fa as deleteCookies,
|
|
4244
|
+
La as extractBracedText,
|
|
4245
|
+
Va as formatDuration,
|
|
4246
|
+
Wa as formatScore,
|
|
4247
|
+
$a as getCookie,
|
|
4248
|
+
Ma as loadTranslations,
|
|
4249
|
+
Ya as redirectURL,
|
|
4250
|
+
Ha as useAiUtils
|
|
4248
4251
|
};
|
|
4249
4252
|
//# sourceMappingURL=utils.js.map
|