buzzcasting-storage 2.7.2 → 2.9.0
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/buzzcasting-storage.d.ts +17 -3
- package/dist/buzzcasting-storage.esm.js +864 -839
- package/package.json +1 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var Ei = Object.defineProperty;
|
|
2
|
-
var Oi = (w, o,
|
|
3
|
-
var
|
|
4
|
-
const xi = "2.
|
|
2
|
+
var Oi = (w, o, d) => o in w ? Ei(w, o, { enumerable: !0, configurable: !0, writable: !0, value: d }) : w[o] = d;
|
|
3
|
+
var I = (w, o, d) => (Oi(w, typeof o != "symbol" ? o + "" : o, d), d);
|
|
4
|
+
const xi = "2.8.0";
|
|
5
5
|
class ki {
|
|
6
6
|
constructor(o) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
I(this, "options");
|
|
8
|
+
I(this, "url");
|
|
9
|
+
I(this, "headers", () => {
|
|
10
10
|
const o = `Bearer ${this.options.bearer}`;
|
|
11
11
|
return {
|
|
12
12
|
headers: new Headers({
|
|
@@ -19,9 +19,9 @@ class ki {
|
|
|
19
19
|
this.options = o, this.url = `https://${o.app}.buzzcasting.net`;
|
|
20
20
|
}
|
|
21
21
|
async get(o) {
|
|
22
|
-
const { version:
|
|
23
|
-
delete
|
|
24
|
-
const
|
|
22
|
+
const { version: d } = this.options, m = this.headers(), A = Object.assign({}, o);
|
|
23
|
+
delete A.slide, delete A.type, delete A.hash;
|
|
24
|
+
const K = Object.keys(A).length > 0 ? `?${new URLSearchParams(A).toString()}` : "";
|
|
25
25
|
return console.debug(
|
|
26
26
|
"%capi%c %cget",
|
|
27
27
|
x.API,
|
|
@@ -30,32 +30,32 @@ class ki {
|
|
|
30
30
|
o.slide,
|
|
31
31
|
o.widget
|
|
32
32
|
), await fetch(
|
|
33
|
-
[this.url, "api",
|
|
34
|
-
{ ...
|
|
35
|
-
).then(async (
|
|
36
|
-
if (!
|
|
37
|
-
throw new Error(`${
|
|
38
|
-
return
|
|
39
|
-
}).then((
|
|
33
|
+
[this.url, "api", d, o.type].join("/") + K,
|
|
34
|
+
{ ...m, method: "get" }
|
|
35
|
+
).then(async (j) => {
|
|
36
|
+
if (!j.ok)
|
|
37
|
+
throw new Error(`${j.status}`);
|
|
38
|
+
return j;
|
|
39
|
+
}).then((j) => j.json()).then((j) => (j.query = o, j)).catch((j) => ({ success: !1, message: `${j}`, data: null }));
|
|
40
40
|
}
|
|
41
41
|
async hideMessage(o) {
|
|
42
|
-
const { app:
|
|
42
|
+
const { app: d, version: m } = this.options, A = this.headers(), K = "?action=visible";
|
|
43
43
|
return console.info(
|
|
44
44
|
"%capi%c %cpost",
|
|
45
45
|
x.API,
|
|
46
46
|
x.NONE,
|
|
47
47
|
x.GET_DATA,
|
|
48
|
-
|
|
49
|
-
[
|
|
50
|
-
{ ...
|
|
48
|
+
ue.HIDE_MESSAGE,
|
|
49
|
+
[d, "api", m, o.type, o.id].join("/") + K,
|
|
50
|
+
{ ...A, method: "put" }
|
|
51
51
|
), await fetch(
|
|
52
|
-
[
|
|
53
|
-
{ ...
|
|
54
|
-
).then((
|
|
55
|
-
if (!
|
|
56
|
-
throw new Error(
|
|
57
|
-
return
|
|
58
|
-
}).then((
|
|
52
|
+
[d, "api", m, o.type, o.id].join("/") + K,
|
|
53
|
+
{ ...A, method: "put" }
|
|
54
|
+
).then((j) => {
|
|
55
|
+
if (!j.ok)
|
|
56
|
+
throw new Error(j.statusText);
|
|
57
|
+
return j;
|
|
58
|
+
}).then((j) => j.json()).catch((j) => ({ succes: !1, message: j, data: [] }));
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
var Ir = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
@@ -64,43 +64,43 @@ function Ai(w) {
|
|
|
64
64
|
}
|
|
65
65
|
var Rr = { exports: {} };
|
|
66
66
|
(function(w, o) {
|
|
67
|
-
(function(
|
|
68
|
-
w.exports =
|
|
67
|
+
(function(d, m) {
|
|
68
|
+
w.exports = m();
|
|
69
69
|
})(Ir, function() {
|
|
70
|
-
var
|
|
71
|
-
return (
|
|
70
|
+
var d = function(e, t) {
|
|
71
|
+
return (d = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) {
|
|
72
72
|
n.__proto__ = r;
|
|
73
73
|
} || function(n, r) {
|
|
74
74
|
for (var i in r)
|
|
75
75
|
Object.prototype.hasOwnProperty.call(r, i) && (n[i] = r[i]);
|
|
76
76
|
})(e, t);
|
|
77
|
-
},
|
|
78
|
-
return (
|
|
77
|
+
}, m = function() {
|
|
78
|
+
return (m = Object.assign || function(e) {
|
|
79
79
|
for (var t, n = 1, r = arguments.length; n < r; n++)
|
|
80
80
|
for (var i in t = arguments[n])
|
|
81
81
|
Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
82
82
|
return e;
|
|
83
83
|
}).apply(this, arguments);
|
|
84
84
|
};
|
|
85
|
-
function
|
|
85
|
+
function A(e, t, n) {
|
|
86
86
|
if (n || arguments.length === 2)
|
|
87
87
|
for (var r, i = 0, a = t.length; i < a; i++)
|
|
88
88
|
!r && i in t || ((r = r || Array.prototype.slice.call(t, 0, i))[i] = t[i]);
|
|
89
89
|
return e.concat(r || Array.prototype.slice.call(t));
|
|
90
90
|
}
|
|
91
|
-
var
|
|
91
|
+
var K = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Ir, j = Object.keys, N = Array.isArray;
|
|
92
92
|
function Z(e, t) {
|
|
93
|
-
return typeof t != "object" ||
|
|
93
|
+
return typeof t != "object" || j(t).forEach(function(n) {
|
|
94
94
|
e[n] = t[n];
|
|
95
95
|
}), e;
|
|
96
96
|
}
|
|
97
|
-
typeof Promise > "u" ||
|
|
97
|
+
typeof Promise > "u" || K.Promise || (K.Promise = Promise);
|
|
98
98
|
var te = Object.getPrototypeOf, be = {}.hasOwnProperty;
|
|
99
99
|
function ie(e, t) {
|
|
100
100
|
return be.call(e, t);
|
|
101
101
|
}
|
|
102
102
|
function xe(e, t) {
|
|
103
|
-
typeof t == "function" && (t = t(te(e))), (typeof Reflect > "u" ?
|
|
103
|
+
typeof t == "function" && (t = t(te(e))), (typeof Reflect > "u" ? j : Reflect.ownKeys)(t).forEach(function(n) {
|
|
104
104
|
ke(e, n, t[n]);
|
|
105
105
|
});
|
|
106
106
|
}
|
|
@@ -125,7 +125,7 @@ var Rr = { exports: {} };
|
|
|
125
125
|
throw new Error("Assertion Failed");
|
|
126
126
|
}
|
|
127
127
|
function Hn(e) {
|
|
128
|
-
|
|
128
|
+
K.setImmediate ? setImmediate(e) : setTimeout(e, 0);
|
|
129
129
|
}
|
|
130
130
|
function ve(e, t) {
|
|
131
131
|
if (typeof t == "string" && ie(e, t))
|
|
@@ -171,9 +171,9 @@ var Rr = { exports: {} };
|
|
|
171
171
|
return t + e + "Array";
|
|
172
172
|
});
|
|
173
173
|
}))).filter(function(e) {
|
|
174
|
-
return
|
|
174
|
+
return K[e];
|
|
175
175
|
}), Xn = new Set(ge.map(function(e) {
|
|
176
|
-
return
|
|
176
|
+
return K[e];
|
|
177
177
|
})), it = null;
|
|
178
178
|
function Ae(e) {
|
|
179
179
|
return it = /* @__PURE__ */ new WeakMap(), e = function t(n) {
|
|
@@ -366,8 +366,8 @@ var Rr = { exports: {} };
|
|
|
366
366
|
if (a === r)
|
|
367
367
|
throw new TypeError("A promise cannot be resolved with itself.");
|
|
368
368
|
var s = r._lib && Qe();
|
|
369
|
-
a && typeof a.then == "function" ? n(r, function(u,
|
|
370
|
-
a instanceof T ? a._then(u,
|
|
369
|
+
a && typeof a.then == "function" ? n(r, function(u, h) {
|
|
370
|
+
a instanceof T ? a._then(u, h) : a.then(u, h);
|
|
371
371
|
}) : (r._state = !0, r._value = a, nr(r)), s && Xe();
|
|
372
372
|
}
|
|
373
373
|
}, sn.bind(null, r));
|
|
@@ -379,10 +379,10 @@ var Rr = { exports: {} };
|
|
|
379
379
|
var an = { get: function() {
|
|
380
380
|
var e = M, t = Pt;
|
|
381
381
|
function n(r, i) {
|
|
382
|
-
var a = this, s = !e.global && (e !== M || t !== Pt), u = s && !Ie(),
|
|
383
|
-
un(a, new tr(ir(r, e, s, u), ir(i, e, s, u), l,
|
|
382
|
+
var a = this, s = !e.global && (e !== M || t !== Pt), u = s && !Ie(), h = new T(function(l, b) {
|
|
383
|
+
un(a, new tr(ir(r, e, s, u), ir(i, e, s, u), l, b, e));
|
|
384
384
|
});
|
|
385
|
-
return this._consoleTask && (
|
|
385
|
+
return this._consoleTask && (h._consoleTask = this._consoleTask), h;
|
|
386
386
|
}
|
|
387
387
|
return n.prototype = at, n;
|
|
388
388
|
}, set: function(e) {
|
|
@@ -548,9 +548,9 @@ var Rr = { exports: {} };
|
|
|
548
548
|
return Pe(function(i, a) {
|
|
549
549
|
var s = M;
|
|
550
550
|
s.unhandleds = [], s.onunhandled = a, s.finalize = Me(function() {
|
|
551
|
-
var u,
|
|
551
|
+
var u, h = this;
|
|
552
552
|
u = function() {
|
|
553
|
-
|
|
553
|
+
h.unhandleds.length === 0 ? i() : a(h.unhandleds[0]);
|
|
554
554
|
}, xt.push(function l() {
|
|
555
555
|
u(), xt.splice(xt.indexOf(l), 1);
|
|
556
556
|
}), ++Ne, ct(function() {
|
|
@@ -616,11 +616,11 @@ var Rr = { exports: {} };
|
|
|
616
616
|
var n, r = M;
|
|
617
617
|
(t ? !ne.echoes || Dt++ && e === M : !Dt || --Dt && e === M) || queueMicrotask(t ? (function(i) {
|
|
618
618
|
++Pt, ne.echoes && --ne.echoes != 0 || (ne.echoes = ne.awaits = ne.id = 0), At.push(M), Ce(i, !0);
|
|
619
|
-
}).bind(null, e) : ni), e !== M && (M = e, r === De && (De.env = rr()), nn && (n = De.env.Promise, t = e.env, (r.global || e.global) && (Object.defineProperty(
|
|
619
|
+
}).bind(null, e) : ni), e !== M && (M = e, r === De && (De.env = rr()), nn && (n = De.env.Promise, t = e.env, (r.global || e.global) && (Object.defineProperty(K, "Promise", t.PromiseProp), n.all = t.all, n.race = t.race, n.resolve = t.resolve, n.reject = t.reject, t.allSettled && (n.allSettled = t.allSettled), t.any && (n.any = t.any))));
|
|
620
620
|
}
|
|
621
621
|
function rr() {
|
|
622
|
-
var e =
|
|
623
|
-
return nn ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(
|
|
622
|
+
var e = K.Promise;
|
|
623
|
+
return nn ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(K, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
|
|
624
624
|
}
|
|
625
625
|
function Ge(e, t, n, r, i) {
|
|
626
626
|
var a = M;
|
|
@@ -674,17 +674,17 @@ var Rr = { exports: {} };
|
|
|
674
674
|
return t < e ? 1 : e < t ? -1 : 0;
|
|
675
675
|
case "binary":
|
|
676
676
|
return function(i, a) {
|
|
677
|
-
for (var s = i.length, u = a.length,
|
|
677
|
+
for (var s = i.length, u = a.length, h = s < u ? s : u, l = 0; l < h; ++l)
|
|
678
678
|
if (i[l] !== a[l])
|
|
679
679
|
return i[l] < a[l] ? -1 : 1;
|
|
680
680
|
return s === u ? 0 : s < u ? -1 : 1;
|
|
681
681
|
}(cr(e), cr(t));
|
|
682
682
|
case "Array":
|
|
683
683
|
return function(i, a) {
|
|
684
|
-
for (var s = i.length, u = a.length,
|
|
685
|
-
var
|
|
686
|
-
if (
|
|
687
|
-
return
|
|
684
|
+
for (var s = i.length, u = a.length, h = s < u ? s : u, l = 0; l < h; ++l) {
|
|
685
|
+
var b = $(i[l], a[l]);
|
|
686
|
+
if (b !== 0)
|
|
687
|
+
return b;
|
|
688
688
|
}
|
|
689
689
|
return s === u ? 0 : s < u ? -1 : 1;
|
|
690
690
|
}(e, t);
|
|
@@ -702,54 +702,54 @@ var Rr = { exports: {} };
|
|
|
702
702
|
}
|
|
703
703
|
var lr = (Q.prototype._trans = function(e, t, n) {
|
|
704
704
|
var r = this._tx || M.trans, i = this.name, a = pe && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
705
|
-
function s(l,
|
|
705
|
+
function s(l, b, c) {
|
|
706
706
|
if (!c.schema[i])
|
|
707
707
|
throw new F.NotFound("Table " + i + " not part of transaction");
|
|
708
708
|
return t(c.idbtrans, c);
|
|
709
709
|
}
|
|
710
710
|
var u = Qe();
|
|
711
711
|
try {
|
|
712
|
-
var
|
|
712
|
+
var h = r && r.db._novip === this.db._novip ? r === M.trans ? r._promise(e, s, n) : Pe(function() {
|
|
713
713
|
return r._promise(e, s, n);
|
|
714
|
-
}, { trans: r, transless: M.transless || M }) : function l(
|
|
715
|
-
if (
|
|
716
|
-
var y =
|
|
714
|
+
}, { trans: r, transless: M.transless || M }) : function l(b, c, f, p) {
|
|
715
|
+
if (b.idbdb && (b._state.openComplete || M.letThrough || b._vip)) {
|
|
716
|
+
var y = b._createTransaction(c, f, b._dbSchema);
|
|
717
717
|
try {
|
|
718
|
-
y.create(),
|
|
719
|
-
} catch (
|
|
720
|
-
return
|
|
721
|
-
return l(
|
|
722
|
-
})) : q(
|
|
718
|
+
y.create(), b._state.PR1398_maxLoop = 3;
|
|
719
|
+
} catch (v) {
|
|
720
|
+
return v.name === en.InvalidState && b.isOpen() && 0 < --b._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), b.close({ disableAutoOpen: !1 }), b.open().then(function() {
|
|
721
|
+
return l(b, c, f, p);
|
|
722
|
+
})) : q(v);
|
|
723
723
|
}
|
|
724
|
-
return y._promise(c, function(
|
|
724
|
+
return y._promise(c, function(v, g) {
|
|
725
725
|
return Pe(function() {
|
|
726
|
-
return M.trans = y, p(
|
|
726
|
+
return M.trans = y, p(v, g, y);
|
|
727
727
|
});
|
|
728
|
-
}).then(function(
|
|
728
|
+
}).then(function(v) {
|
|
729
729
|
if (c === "readwrite")
|
|
730
730
|
try {
|
|
731
731
|
y.idbtrans.commit();
|
|
732
732
|
} catch {
|
|
733
733
|
}
|
|
734
|
-
return c === "readonly" ?
|
|
735
|
-
return
|
|
734
|
+
return c === "readonly" ? v : y._completion.then(function() {
|
|
735
|
+
return v;
|
|
736
736
|
});
|
|
737
737
|
});
|
|
738
738
|
}
|
|
739
|
-
if (
|
|
740
|
-
return q(new F.DatabaseClosed(
|
|
741
|
-
if (!
|
|
742
|
-
if (!
|
|
739
|
+
if (b._state.openComplete)
|
|
740
|
+
return q(new F.DatabaseClosed(b._state.dbOpenError));
|
|
741
|
+
if (!b._state.isBeingOpened) {
|
|
742
|
+
if (!b._state.autoOpen)
|
|
743
743
|
return q(new F.DatabaseClosed());
|
|
744
|
-
|
|
744
|
+
b.open().catch(H);
|
|
745
745
|
}
|
|
746
|
-
return
|
|
747
|
-
return l(
|
|
746
|
+
return b._state.dbReadyPromise.then(function() {
|
|
747
|
+
return l(b, c, f, p);
|
|
748
748
|
});
|
|
749
749
|
}(this.db, e, [this.name], s);
|
|
750
|
-
return a && (
|
|
750
|
+
return a && (h._consoleTask = a, h = h.catch(function(l) {
|
|
751
751
|
return console.trace(l), q(l);
|
|
752
|
-
})),
|
|
752
|
+
})), h;
|
|
753
753
|
} finally {
|
|
754
754
|
u && Xe();
|
|
755
755
|
}
|
|
@@ -765,21 +765,21 @@ var Rr = { exports: {} };
|
|
|
765
765
|
return new this.db.WhereClause(this, e);
|
|
766
766
|
if (N(e))
|
|
767
767
|
return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
|
|
768
|
-
var t =
|
|
768
|
+
var t = j(e);
|
|
769
769
|
if (t.length === 1)
|
|
770
770
|
return this.where(t[0]).equals(e[t[0]]);
|
|
771
|
-
var n = this.schema.indexes.concat(this.schema.primKey).filter(function(
|
|
772
|
-
if (
|
|
773
|
-
return 0 <=
|
|
771
|
+
var n = this.schema.indexes.concat(this.schema.primKey).filter(function(h) {
|
|
772
|
+
if (h.compound && t.every(function(b) {
|
|
773
|
+
return 0 <= h.keyPath.indexOf(b);
|
|
774
774
|
})) {
|
|
775
775
|
for (var l = 0; l < t.length; ++l)
|
|
776
|
-
if (t.indexOf(
|
|
776
|
+
if (t.indexOf(h.keyPath[l]) === -1)
|
|
777
777
|
return !1;
|
|
778
778
|
return !0;
|
|
779
779
|
}
|
|
780
780
|
return !1;
|
|
781
|
-
}).sort(function(
|
|
782
|
-
return
|
|
781
|
+
}).sort(function(h, l) {
|
|
782
|
+
return h.keyPath.length - l.keyPath.length;
|
|
783
783
|
})[0];
|
|
784
784
|
if (n && this.db._maxKey !== Fe) {
|
|
785
785
|
var s = n.keyPath.slice(0, t.length);
|
|
@@ -789,14 +789,14 @@ var Rr = { exports: {} };
|
|
|
789
789
|
}
|
|
790
790
|
!n && pe && console.warn("The query ".concat(JSON.stringify(e), " on ").concat(this.name, " would benefit from a ") + "compound index [".concat(t.join("+"), "]"));
|
|
791
791
|
var r = this.schema.idxByName, i = this.db._deps.indexedDB;
|
|
792
|
-
function a(
|
|
793
|
-
return i.cmp(
|
|
792
|
+
function a(h, l) {
|
|
793
|
+
return i.cmp(h, l) === 0;
|
|
794
794
|
}
|
|
795
795
|
var u = t.reduce(function(f, l) {
|
|
796
|
-
var
|
|
797
|
-
return [
|
|
798
|
-
return y = ve(y, l), N(y) && y.some(function(
|
|
799
|
-
return a(p,
|
|
796
|
+
var b = f[0], c = f[1], f = r[l], p = e[l];
|
|
797
|
+
return [b || f, b || !f ? Le(c, f && f.multi ? function(y) {
|
|
798
|
+
return y = ve(y, l), N(y) && y.some(function(v) {
|
|
799
|
+
return a(p, v);
|
|
800
800
|
});
|
|
801
801
|
} : function(y) {
|
|
802
802
|
return a(p, ve(y, l));
|
|
@@ -826,33 +826,33 @@ var Rr = { exports: {} };
|
|
|
826
826
|
function i() {
|
|
827
827
|
return t !== null && t.apply(this, arguments) || this;
|
|
828
828
|
}
|
|
829
|
-
(this.schema.mappedClass = e).prototype instanceof sr && (function(
|
|
829
|
+
(this.schema.mappedClass = e).prototype instanceof sr && (function(h, l) {
|
|
830
830
|
if (typeof l != "function" && l !== null)
|
|
831
831
|
throw new TypeError("Class extends value " + String(l) + " is not a constructor or null");
|
|
832
|
-
function
|
|
833
|
-
this.constructor =
|
|
832
|
+
function b() {
|
|
833
|
+
this.constructor = h;
|
|
834
834
|
}
|
|
835
|
-
h
|
|
835
|
+
d(h, l), h.prototype = l === null ? Object.create(l) : (b.prototype = l.prototype, new b());
|
|
836
836
|
}(i, t = e), Object.defineProperty(i.prototype, "db", { get: function() {
|
|
837
837
|
return n;
|
|
838
838
|
}, enumerable: !1, configurable: !0 }), i.prototype.table = function() {
|
|
839
839
|
return r;
|
|
840
840
|
}, e = i);
|
|
841
841
|
for (var a = /* @__PURE__ */ new Set(), s = e.prototype; s; s = te(s))
|
|
842
|
-
Object.getOwnPropertyNames(s).forEach(function(
|
|
843
|
-
return a.add(
|
|
842
|
+
Object.getOwnPropertyNames(s).forEach(function(h) {
|
|
843
|
+
return a.add(h);
|
|
844
844
|
});
|
|
845
|
-
function u(
|
|
846
|
-
if (!
|
|
847
|
-
return
|
|
848
|
-
var l,
|
|
849
|
-
for (l in
|
|
845
|
+
function u(h) {
|
|
846
|
+
if (!h)
|
|
847
|
+
return h;
|
|
848
|
+
var l, b = Object.create(e.prototype);
|
|
849
|
+
for (l in h)
|
|
850
850
|
if (!a.has(l))
|
|
851
851
|
try {
|
|
852
|
-
|
|
852
|
+
b[l] = h[l];
|
|
853
853
|
} catch {
|
|
854
854
|
}
|
|
855
|
-
return
|
|
855
|
+
return b;
|
|
856
856
|
}
|
|
857
857
|
return this.schema.readHook && this.hook.reading.unsubscribe(this.schema.readHook), this.schema.readHook = u, this.hook("reading", u), e;
|
|
858
858
|
}, Q.prototype.defineClass = function() {
|
|
@@ -920,12 +920,12 @@ var Rr = { exports: {} };
|
|
|
920
920
|
throw new F.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
921
921
|
if (i && i.length !== e.length)
|
|
922
922
|
throw new F.InvalidArgument("Arguments objects and keys must have the same length");
|
|
923
|
-
var
|
|
923
|
+
var h = e.length, l = l && u ? e.map(Rt(l)) : e;
|
|
924
924
|
return r.core.mutate({ trans: s, type: "add", keys: i, values: l, wantResults: a }).then(function(y) {
|
|
925
925
|
var c = y.numFailures, f = y.results, p = y.lastResult, y = y.failures;
|
|
926
926
|
if (c === 0)
|
|
927
927
|
return a ? f : p;
|
|
928
|
-
throw new Ve("".concat(r.name, ".bulkAdd(): ").concat(c, " of ").concat(
|
|
928
|
+
throw new Ve("".concat(r.name, ".bulkAdd(): ").concat(c, " of ").concat(h, " operations failed"), y);
|
|
929
929
|
});
|
|
930
930
|
});
|
|
931
931
|
}, Q.prototype.bulkPut = function(e, t, n) {
|
|
@@ -936,12 +936,12 @@ var Rr = { exports: {} };
|
|
|
936
936
|
throw new F.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
937
937
|
if (i && i.length !== e.length)
|
|
938
938
|
throw new F.InvalidArgument("Arguments objects and keys must have the same length");
|
|
939
|
-
var
|
|
939
|
+
var h = e.length, l = l && u ? e.map(Rt(l)) : e;
|
|
940
940
|
return r.core.mutate({ trans: s, type: "put", keys: i, values: l, wantResults: a }).then(function(y) {
|
|
941
941
|
var c = y.numFailures, f = y.results, p = y.lastResult, y = y.failures;
|
|
942
942
|
if (c === 0)
|
|
943
943
|
return a ? f : p;
|
|
944
|
-
throw new Ve("".concat(r.name, ".bulkPut(): ").concat(c, " of ").concat(
|
|
944
|
+
throw new Ve("".concat(r.name, ".bulkPut(): ").concat(c, " of ").concat(h, " operations failed"), y);
|
|
945
945
|
});
|
|
946
946
|
});
|
|
947
947
|
}, Q.prototype.bulkUpdate = function(e) {
|
|
@@ -952,31 +952,31 @@ var Rr = { exports: {} };
|
|
|
952
952
|
}), a = [];
|
|
953
953
|
return this._trans("readwrite", function(s) {
|
|
954
954
|
return n.getMany({ trans: s, keys: r, cache: "clone" }).then(function(u) {
|
|
955
|
-
var
|
|
955
|
+
var h = [], l = [];
|
|
956
956
|
e.forEach(function(c, f) {
|
|
957
|
-
var p = c.key, y = c.changes,
|
|
958
|
-
if (
|
|
957
|
+
var p = c.key, y = c.changes, v = u[f];
|
|
958
|
+
if (v) {
|
|
959
959
|
for (var g = 0, _ = Object.keys(y); g < _.length; g++) {
|
|
960
960
|
var S = _[g], E = y[S];
|
|
961
961
|
if (S === t.schema.primKey.keyPath) {
|
|
962
962
|
if ($(E, p) !== 0)
|
|
963
963
|
throw new F.Constraint("Cannot update primary key in bulkUpdate()");
|
|
964
964
|
} else
|
|
965
|
-
fe(
|
|
965
|
+
fe(v, S, E);
|
|
966
966
|
}
|
|
967
|
-
a.push(f),
|
|
967
|
+
a.push(f), h.push(p), l.push(v);
|
|
968
968
|
}
|
|
969
969
|
});
|
|
970
|
-
var
|
|
971
|
-
return n.mutate({ trans: s, type: "put", keys:
|
|
970
|
+
var b = h.length;
|
|
971
|
+
return n.mutate({ trans: s, type: "put", keys: h, values: l, updates: { keys: r, changeSpecs: i } }).then(function(c) {
|
|
972
972
|
var f = c.numFailures, p = c.failures;
|
|
973
973
|
if (f === 0)
|
|
974
|
-
return
|
|
975
|
-
for (var y = 0,
|
|
976
|
-
var g, _ =
|
|
974
|
+
return b;
|
|
975
|
+
for (var y = 0, v = Object.keys(p); y < v.length; y++) {
|
|
976
|
+
var g, _ = v[y], S = a[Number(_)];
|
|
977
977
|
S != null && (g = p[_], delete p[_], p[S] = g);
|
|
978
978
|
}
|
|
979
|
-
throw new Ve("".concat(t.name, ".bulkUpdate(): ").concat(f, " of ").concat(
|
|
979
|
+
throw new Ve("".concat(t.name, ".bulkUpdate(): ").concat(f, " of ").concat(b, " operations failed"), p);
|
|
980
980
|
});
|
|
981
981
|
});
|
|
982
982
|
});
|
|
@@ -996,8 +996,8 @@ var Rr = { exports: {} };
|
|
|
996
996
|
function ft(e) {
|
|
997
997
|
function t(s, u) {
|
|
998
998
|
if (u) {
|
|
999
|
-
for (var
|
|
1000
|
-
l[
|
|
999
|
+
for (var h = arguments.length, l = new Array(h - 1); --h; )
|
|
1000
|
+
l[h - 1] = arguments[h];
|
|
1001
1001
|
return n[s].subscribe.apply(null, l), e;
|
|
1002
1002
|
}
|
|
1003
1003
|
if (typeof s == "string")
|
|
@@ -1008,20 +1008,20 @@ var Rr = { exports: {} };
|
|
|
1008
1008
|
for (var r = 1, i = arguments.length; r < i; ++r)
|
|
1009
1009
|
a(arguments[r]);
|
|
1010
1010
|
return t;
|
|
1011
|
-
function a(s, u,
|
|
1011
|
+
function a(s, u, h) {
|
|
1012
1012
|
if (typeof s != "object") {
|
|
1013
1013
|
var l;
|
|
1014
1014
|
u = u || Jr;
|
|
1015
|
-
var
|
|
1016
|
-
|
|
1015
|
+
var b = { subscribers: [], fire: h = h || H, subscribe: function(c) {
|
|
1016
|
+
b.subscribers.indexOf(c) === -1 && (b.subscribers.push(c), b.fire = u(b.fire, c));
|
|
1017
1017
|
}, unsubscribe: function(c) {
|
|
1018
|
-
|
|
1018
|
+
b.subscribers = b.subscribers.filter(function(f) {
|
|
1019
1019
|
return f !== c;
|
|
1020
|
-
}),
|
|
1020
|
+
}), b.fire = b.subscribers.reduce(u, h);
|
|
1021
1021
|
} };
|
|
1022
|
-
return n[s] = t[s] =
|
|
1022
|
+
return n[s] = t[s] = b;
|
|
1023
1023
|
}
|
|
1024
|
-
|
|
1024
|
+
j(l = s).forEach(function(c) {
|
|
1025
1025
|
var f = l[c];
|
|
1026
1026
|
if (N(f))
|
|
1027
1027
|
a(c, l[c][0], l[c][1]);
|
|
@@ -1029,11 +1029,11 @@ var Rr = { exports: {} };
|
|
|
1029
1029
|
if (f !== "asap")
|
|
1030
1030
|
throw new F.InvalidArgument("Invalid event config");
|
|
1031
1031
|
var p = a(c, ot, function() {
|
|
1032
|
-
for (var y = arguments.length,
|
|
1033
|
-
|
|
1032
|
+
for (var y = arguments.length, v = new Array(y); y--; )
|
|
1033
|
+
v[y] = arguments[y];
|
|
1034
1034
|
p.subscribers.forEach(function(g) {
|
|
1035
1035
|
Hn(function() {
|
|
1036
|
-
g.apply(null,
|
|
1036
|
+
g.apply(null, v);
|
|
1037
1037
|
});
|
|
1038
1038
|
});
|
|
1039
1039
|
});
|
|
@@ -1071,13 +1071,13 @@ var Rr = { exports: {} };
|
|
|
1071
1071
|
function jt(e, t, n, r) {
|
|
1072
1072
|
var i = e.replayFilter ? Le(e.filter, e.replayFilter()) : e.filter;
|
|
1073
1073
|
if (e.or) {
|
|
1074
|
-
var a = {}, s = function(u,
|
|
1075
|
-
var
|
|
1076
|
-
i && !i(
|
|
1077
|
-
return
|
|
1074
|
+
var a = {}, s = function(u, h, l) {
|
|
1075
|
+
var b, c;
|
|
1076
|
+
i && !i(h, l, function(f) {
|
|
1077
|
+
return h.stop(f);
|
|
1078
1078
|
}, function(f) {
|
|
1079
|
-
return
|
|
1080
|
-
}) || ((c = "" + (
|
|
1079
|
+
return h.fail(f);
|
|
1080
|
+
}) || ((c = "" + (b = h.primaryKey)) == "[object ArrayBuffer]" && (c = "" + new Uint8Array(b)), ie(a, c) || (a[c] = !0, t(u, h, l)));
|
|
1081
1081
|
};
|
|
1082
1082
|
return Promise.all([e.or._iterate(s, n), dr(fr(e, r, n), e.algorithm, s, !e.keysOnly && e.valueMapper)]);
|
|
1083
1083
|
}
|
|
@@ -1143,15 +1143,15 @@ var Rr = { exports: {} };
|
|
|
1143
1143
|
}).then(e);
|
|
1144
1144
|
}, z.prototype.sortBy = function(e, t) {
|
|
1145
1145
|
var n = e.split(".").reverse(), r = n[0], i = n.length - 1;
|
|
1146
|
-
function a(
|
|
1147
|
-
return l ? a(
|
|
1146
|
+
function a(h, l) {
|
|
1147
|
+
return l ? a(h[n[l]], l - 1) : h[r];
|
|
1148
1148
|
}
|
|
1149
1149
|
var s = this._ctx.dir === "next" ? 1 : -1;
|
|
1150
|
-
function u(
|
|
1151
|
-
return
|
|
1150
|
+
function u(h, l) {
|
|
1151
|
+
return h = a(h, i), l = a(l, i), h < l ? -s : l < h ? s : 0;
|
|
1152
1152
|
}
|
|
1153
|
-
return this.toArray(function(
|
|
1154
|
-
return
|
|
1153
|
+
return this.toArray(function(h) {
|
|
1154
|
+
return h.sort(u);
|
|
1155
1155
|
}).then(t);
|
|
1156
1156
|
}, z.prototype.toArray = function(e) {
|
|
1157
1157
|
var t = this;
|
|
@@ -1273,7 +1273,7 @@ var Rr = { exports: {} };
|
|
|
1273
1273
|
var t = this, n = this._ctx;
|
|
1274
1274
|
return this._write(function(r) {
|
|
1275
1275
|
var i, a, s;
|
|
1276
|
-
s = typeof e == "function" ? e : (i =
|
|
1276
|
+
s = typeof e == "function" ? e : (i = j(e), a = i.length, function(g) {
|
|
1277
1277
|
for (var _ = !1, S = 0; S < a; ++S) {
|
|
1278
1278
|
var E = i[S], O = e[E];
|
|
1279
1279
|
ve(g, E) !== O && (fe(g, E, O), _ = !0);
|
|
@@ -1283,31 +1283,31 @@ var Rr = { exports: {} };
|
|
|
1283
1283
|
function u(g, E) {
|
|
1284
1284
|
var S = E.failures, E = E.numFailures;
|
|
1285
1285
|
y += g - E;
|
|
1286
|
-
for (var O = 0, k =
|
|
1287
|
-
var
|
|
1288
|
-
p.push(S[
|
|
1286
|
+
for (var O = 0, k = j(S); O < k.length; O++) {
|
|
1287
|
+
var C = k[O];
|
|
1288
|
+
p.push(S[C]);
|
|
1289
1289
|
}
|
|
1290
1290
|
}
|
|
1291
|
-
var
|
|
1291
|
+
var h = n.table.core, l = h.schema.primaryKey, b = l.outbound, c = l.extractKey, f = t.db._options.modifyChunkSize || 200, p = [], y = 0, v = [];
|
|
1292
1292
|
return t.clone().primaryKeys().then(function(g) {
|
|
1293
1293
|
function _(S) {
|
|
1294
1294
|
var E = Math.min(f, g.length - S);
|
|
1295
|
-
return
|
|
1296
|
-
for (var k = [],
|
|
1297
|
-
var G = O[
|
|
1298
|
-
s.call(L, L.value, L) !== !1 && (L.value == null ? R.push(g[S +
|
|
1295
|
+
return h.getMany({ trans: r, keys: g.slice(S, S + E), cache: "immutable" }).then(function(O) {
|
|
1296
|
+
for (var k = [], C = [], D = b ? [] : null, R = [], P = 0; P < E; ++P) {
|
|
1297
|
+
var G = O[P], L = { value: Ae(G), primKey: g[S + P] };
|
|
1298
|
+
s.call(L, L.value, L) !== !1 && (L.value == null ? R.push(g[S + P]) : b || $(c(G), c(L.value)) === 0 ? (C.push(L.value), b && D.push(g[S + P])) : (R.push(g[S + P]), k.push(L.value)));
|
|
1299
1299
|
}
|
|
1300
1300
|
var Y = qe(n) && n.limit === 1 / 0 && (typeof e != "function" || e === gn) && { index: n.index, range: n.range };
|
|
1301
|
-
return Promise.resolve(0 < k.length &&
|
|
1301
|
+
return Promise.resolve(0 < k.length && h.mutate({ trans: r, type: "add", values: k }).then(function(W) {
|
|
1302
1302
|
for (var V in W.failures)
|
|
1303
1303
|
R.splice(parseInt(V), 1);
|
|
1304
1304
|
u(k.length, W);
|
|
1305
1305
|
})).then(function() {
|
|
1306
|
-
return (0 <
|
|
1307
|
-
return u(
|
|
1306
|
+
return (0 < C.length || Y && typeof e == "object") && h.mutate({ trans: r, type: "put", keys: D, values: C, criteria: Y, changeSpec: typeof e != "function" && e }).then(function(W) {
|
|
1307
|
+
return u(C.length, W);
|
|
1308
1308
|
});
|
|
1309
1309
|
}).then(function() {
|
|
1310
|
-
return (0 < R.length || Y && e === gn) &&
|
|
1310
|
+
return (0 < R.length || Y && e === gn) && h.mutate({ trans: r, type: "delete", keys: R, criteria: Y }).then(function(W) {
|
|
1311
1311
|
return u(R.length, W);
|
|
1312
1312
|
});
|
|
1313
1313
|
}).then(function() {
|
|
@@ -1317,7 +1317,7 @@ var Rr = { exports: {} };
|
|
|
1317
1317
|
}
|
|
1318
1318
|
return _(0).then(function() {
|
|
1319
1319
|
if (0 < p.length)
|
|
1320
|
-
throw new _t("Error modifying one or more objects", p, y,
|
|
1320
|
+
throw new _t("Error modifying one or more objects", p, y, v);
|
|
1321
1321
|
return g.length;
|
|
1322
1322
|
});
|
|
1323
1323
|
});
|
|
@@ -1330,8 +1330,8 @@ var Rr = { exports: {} };
|
|
|
1330
1330
|
return e.table.core.mutate({ trans: n, type: "deleteRange", range: i }).then(function(s) {
|
|
1331
1331
|
var u = s.failures;
|
|
1332
1332
|
if (s.lastResult, s.results, s = s.numFailures, s)
|
|
1333
|
-
throw new _t("Could not delete some values", Object.keys(u).map(function(
|
|
1334
|
-
return u[
|
|
1333
|
+
throw new _t("Could not delete some values", Object.keys(u).map(function(h) {
|
|
1334
|
+
return u[h];
|
|
1335
1335
|
}), a - s);
|
|
1336
1336
|
return a - s;
|
|
1337
1337
|
});
|
|
@@ -1349,7 +1349,7 @@ var Rr = { exports: {} };
|
|
|
1349
1349
|
function oi(e, t) {
|
|
1350
1350
|
return t < e ? -1 : e === t ? 0 : 1;
|
|
1351
1351
|
}
|
|
1352
|
-
function
|
|
1352
|
+
function ce(e, t, n) {
|
|
1353
1353
|
return e = e instanceof pr ? new e.Collection(e) : e, e._ctx.error = new (n || TypeError)(t), e;
|
|
1354
1354
|
}
|
|
1355
1355
|
function et(e) {
|
|
@@ -1358,11 +1358,11 @@ var Rr = { exports: {} };
|
|
|
1358
1358
|
}).limit(0);
|
|
1359
1359
|
}
|
|
1360
1360
|
function Kt(e, t, n, r) {
|
|
1361
|
-
var i, a, s, u,
|
|
1361
|
+
var i, a, s, u, h, l, b, c = n.length;
|
|
1362
1362
|
if (!n.every(function(y) {
|
|
1363
1363
|
return typeof y == "string";
|
|
1364
1364
|
}))
|
|
1365
|
-
return
|
|
1365
|
+
return ce(e, or);
|
|
1366
1366
|
function f(y) {
|
|
1367
1367
|
i = y === "next" ? function(g) {
|
|
1368
1368
|
return g.toUpperCase();
|
|
@@ -1373,44 +1373,44 @@ var Rr = { exports: {} };
|
|
|
1373
1373
|
} : function(g) {
|
|
1374
1374
|
return g.toUpperCase();
|
|
1375
1375
|
}, s = y === "next" ? ii : oi;
|
|
1376
|
-
var
|
|
1376
|
+
var v = n.map(function(g) {
|
|
1377
1377
|
return { lower: a(g), upper: i(g) };
|
|
1378
1378
|
}).sort(function(g, _) {
|
|
1379
1379
|
return s(g.lower, _.lower);
|
|
1380
1380
|
});
|
|
1381
|
-
u =
|
|
1381
|
+
u = v.map(function(g) {
|
|
1382
1382
|
return g.upper;
|
|
1383
|
-
}),
|
|
1383
|
+
}), h = v.map(function(g) {
|
|
1384
1384
|
return g.lower;
|
|
1385
|
-
}),
|
|
1385
|
+
}), b = (l = y) === "next" ? "" : r;
|
|
1386
1386
|
}
|
|
1387
1387
|
f("next"), e = new e.Collection(e, function() {
|
|
1388
|
-
return Re(u[0],
|
|
1388
|
+
return Re(u[0], h[c - 1] + r);
|
|
1389
1389
|
}), e._ondirectionchange = function(y) {
|
|
1390
1390
|
f(y);
|
|
1391
1391
|
};
|
|
1392
1392
|
var p = 0;
|
|
1393
|
-
return e._addAlgorithm(function(y,
|
|
1393
|
+
return e._addAlgorithm(function(y, v, g) {
|
|
1394
1394
|
var _ = y.key;
|
|
1395
1395
|
if (typeof _ != "string")
|
|
1396
1396
|
return !1;
|
|
1397
1397
|
var S = a(_);
|
|
1398
|
-
if (t(S,
|
|
1398
|
+
if (t(S, h, p))
|
|
1399
1399
|
return !0;
|
|
1400
1400
|
for (var E = null, O = p; O < c; ++O) {
|
|
1401
|
-
var k = function(
|
|
1402
|
-
for (var Y = Math.min(
|
|
1403
|
-
var
|
|
1404
|
-
if (
|
|
1405
|
-
return G(
|
|
1406
|
-
G(
|
|
1401
|
+
var k = function(C, D, R, P, G, L) {
|
|
1402
|
+
for (var Y = Math.min(C.length, P.length), W = -1, V = 0; V < Y; ++V) {
|
|
1403
|
+
var le = D[V];
|
|
1404
|
+
if (le !== P[V])
|
|
1405
|
+
return G(C[V], R[V]) < 0 ? C.substr(0, V) + R[V] + R.substr(V + 1) : G(C[V], P[V]) < 0 ? C.substr(0, V) + P[V] + R.substr(V + 1) : 0 <= W ? C.substr(0, W) + D[W] + R.substr(W + 1) : null;
|
|
1406
|
+
G(C[V], le) < 0 && (W = V);
|
|
1407
1407
|
}
|
|
1408
|
-
return Y <
|
|
1409
|
-
}(_, S, u[O],
|
|
1408
|
+
return Y < P.length && L === "next" ? C + R.substr(C.length) : Y < C.length && L === "prev" ? C.substr(0, R.length) : W < 0 ? null : C.substr(0, W) + P[W] + R.substr(W + 1);
|
|
1409
|
+
}(_, S, u[O], h[O], s, l);
|
|
1410
1410
|
k === null && E === null ? p = O + 1 : (E === null || 0 < s(E, k)) && (E = k);
|
|
1411
1411
|
}
|
|
1412
|
-
return
|
|
1413
|
-
y.continue(E +
|
|
1412
|
+
return v(E !== null ? function() {
|
|
1413
|
+
y.continue(E + b);
|
|
1414
1414
|
} : g), !1;
|
|
1415
1415
|
}), e;
|
|
1416
1416
|
}
|
|
@@ -1429,30 +1429,30 @@ var Rr = { exports: {} };
|
|
|
1429
1429
|
return Re(e, t, !n, !r);
|
|
1430
1430
|
});
|
|
1431
1431
|
} catch {
|
|
1432
|
-
return
|
|
1432
|
+
return ce(this, _e);
|
|
1433
1433
|
}
|
|
1434
1434
|
}, re.prototype.equals = function(e) {
|
|
1435
|
-
return e == null ?
|
|
1435
|
+
return e == null ? ce(this, _e) : new this.Collection(this, function() {
|
|
1436
1436
|
return hr(e);
|
|
1437
1437
|
});
|
|
1438
1438
|
}, re.prototype.above = function(e) {
|
|
1439
|
-
return e == null ?
|
|
1439
|
+
return e == null ? ce(this, _e) : new this.Collection(this, function() {
|
|
1440
1440
|
return Re(e, void 0, !0);
|
|
1441
1441
|
});
|
|
1442
1442
|
}, re.prototype.aboveOrEqual = function(e) {
|
|
1443
|
-
return e == null ?
|
|
1443
|
+
return e == null ? ce(this, _e) : new this.Collection(this, function() {
|
|
1444
1444
|
return Re(e, void 0, !1);
|
|
1445
1445
|
});
|
|
1446
1446
|
}, re.prototype.below = function(e) {
|
|
1447
|
-
return e == null ?
|
|
1447
|
+
return e == null ? ce(this, _e) : new this.Collection(this, function() {
|
|
1448
1448
|
return Re(void 0, e, !1, !0);
|
|
1449
1449
|
});
|
|
1450
1450
|
}, re.prototype.belowOrEqual = function(e) {
|
|
1451
|
-
return e == null ?
|
|
1451
|
+
return e == null ? ce(this, _e) : new this.Collection(this, function() {
|
|
1452
1452
|
return Re(void 0, e);
|
|
1453
1453
|
});
|
|
1454
1454
|
}, re.prototype.startsWith = function(e) {
|
|
1455
|
-
return typeof e != "string" ?
|
|
1455
|
+
return typeof e != "string" ? ce(this, or) : this.between(e, e + Fe, !0, !0);
|
|
1456
1456
|
}, re.prototype.startsWithIgnoreCase = function(e) {
|
|
1457
1457
|
return e === "" ? this.startsWith(e) : Kt(this, function(t, n) {
|
|
1458
1458
|
return t.indexOf(n[0]) === 0;
|
|
@@ -1478,7 +1478,7 @@ var Rr = { exports: {} };
|
|
|
1478
1478
|
try {
|
|
1479
1479
|
t.sort(n);
|
|
1480
1480
|
} catch {
|
|
1481
|
-
return
|
|
1481
|
+
return ce(this, _e);
|
|
1482
1482
|
}
|
|
1483
1483
|
if (t.length === 0)
|
|
1484
1484
|
return et(this);
|
|
@@ -1490,10 +1490,10 @@ var Rr = { exports: {} };
|
|
|
1490
1490
|
};
|
|
1491
1491
|
var i = 0;
|
|
1492
1492
|
return r._addAlgorithm(function(a, s, u) {
|
|
1493
|
-
for (var
|
|
1493
|
+
for (var h = a.key; 0 < n(h, t[i]); )
|
|
1494
1494
|
if (++i === t.length)
|
|
1495
1495
|
return s(u), !1;
|
|
1496
|
-
return n(
|
|
1496
|
+
return n(h, t[i]) === 0 || (s(function() {
|
|
1497
1497
|
a.continue(t[i]);
|
|
1498
1498
|
}), !1);
|
|
1499
1499
|
}), r;
|
|
@@ -1506,7 +1506,7 @@ var Rr = { exports: {} };
|
|
|
1506
1506
|
try {
|
|
1507
1507
|
e.sort(this._ascending);
|
|
1508
1508
|
} catch {
|
|
1509
|
-
return
|
|
1509
|
+
return ce(this, _e);
|
|
1510
1510
|
}
|
|
1511
1511
|
var t = e.reduce(function(n, r) {
|
|
1512
1512
|
return n ? n.concat([[n[n.length - 1][1], r]]) : [[-1 / 0, r]];
|
|
@@ -1519,44 +1519,44 @@ var Rr = { exports: {} };
|
|
|
1519
1519
|
if (!_.every(function(S) {
|
|
1520
1520
|
return S[0] !== void 0 && S[1] !== void 0 && i(S[0], S[1]) <= 0;
|
|
1521
1521
|
}))
|
|
1522
|
-
return
|
|
1523
|
-
var
|
|
1522
|
+
return ce(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", F.InvalidArgument);
|
|
1523
|
+
var h = !t || t.includeLowers !== !1, l = t && t.includeUppers === !0, b, c = i;
|
|
1524
1524
|
function f(S, E) {
|
|
1525
1525
|
return c(S[0], E[0]);
|
|
1526
1526
|
}
|
|
1527
1527
|
try {
|
|
1528
|
-
(
|
|
1528
|
+
(b = _.reduce(function(S, E) {
|
|
1529
1529
|
for (var O = 0, k = S.length; O < k; ++O) {
|
|
1530
|
-
var
|
|
1531
|
-
if (r(E[0],
|
|
1532
|
-
|
|
1530
|
+
var C = S[O];
|
|
1531
|
+
if (r(E[0], C[1]) < 0 && 0 < r(E[1], C[0])) {
|
|
1532
|
+
C[0] = s(C[0], E[0]), C[1] = u(C[1], E[1]);
|
|
1533
1533
|
break;
|
|
1534
1534
|
}
|
|
1535
1535
|
}
|
|
1536
1536
|
return O === k && S.push(E), S;
|
|
1537
1537
|
}, [])).sort(f);
|
|
1538
1538
|
} catch {
|
|
1539
|
-
return
|
|
1539
|
+
return ce(this, _e);
|
|
1540
1540
|
}
|
|
1541
1541
|
var p = 0, y = l ? function(S) {
|
|
1542
|
-
return 0 < i(S,
|
|
1542
|
+
return 0 < i(S, b[p][1]);
|
|
1543
1543
|
} : function(S) {
|
|
1544
|
-
return 0 <= i(S,
|
|
1545
|
-
},
|
|
1546
|
-
return 0 < a(S,
|
|
1544
|
+
return 0 <= i(S, b[p][1]);
|
|
1545
|
+
}, v = h ? function(S) {
|
|
1546
|
+
return 0 < a(S, b[p][0]);
|
|
1547
1547
|
} : function(S) {
|
|
1548
|
-
return 0 <= a(S,
|
|
1548
|
+
return 0 <= a(S, b[p][0]);
|
|
1549
1549
|
}, g = y, _ = new this.Collection(this, function() {
|
|
1550
|
-
return Re(
|
|
1550
|
+
return Re(b[0][0], b[b.length - 1][1], !h, !l);
|
|
1551
1551
|
});
|
|
1552
1552
|
return _._ondirectionchange = function(S) {
|
|
1553
|
-
c = S === "next" ? (g = y, i) : (g =
|
|
1553
|
+
c = S === "next" ? (g = y, i) : (g = v, a), b.sort(f);
|
|
1554
1554
|
}, _._addAlgorithm(function(S, E, O) {
|
|
1555
|
-
for (var k,
|
|
1556
|
-
if (++p ===
|
|
1555
|
+
for (var k, C = S.key; g(C); )
|
|
1556
|
+
if (++p === b.length)
|
|
1557
1557
|
return E(O), !1;
|
|
1558
|
-
return !y(k =
|
|
1559
|
-
c === i ? S.continue(
|
|
1558
|
+
return !y(k = C) && !v(k) || (n._cmp(C, b[p][1]) === 0 || n._cmp(C, b[p][0]) === 0 || E(function() {
|
|
1559
|
+
c === i ? S.continue(b[p][0]) : S.continue(b[p][1]);
|
|
1560
1560
|
}), !1);
|
|
1561
1561
|
}), _;
|
|
1562
1562
|
}, re.prototype.startsWithAnyOf = function() {
|
|
@@ -1565,7 +1565,7 @@ var Rr = { exports: {} };
|
|
|
1565
1565
|
return typeof t == "string";
|
|
1566
1566
|
}) ? e.length === 0 ? et(this) : this.inAnyRange(e.map(function(t) {
|
|
1567
1567
|
return [t, t + Fe];
|
|
1568
|
-
})) :
|
|
1568
|
+
})) : ce(this, "startsWithAnyOf() only works with strings");
|
|
1569
1569
|
}, re);
|
|
1570
1570
|
function re() {
|
|
1571
1571
|
}
|
|
@@ -1630,8 +1630,8 @@ var Rr = { exports: {} };
|
|
|
1630
1630
|
return Pe(function() {
|
|
1631
1631
|
var a = new T(function(s, u) {
|
|
1632
1632
|
r._lock();
|
|
1633
|
-
var
|
|
1634
|
-
|
|
1633
|
+
var h = t(s, u, r);
|
|
1634
|
+
h && h.then && h.then(s, u);
|
|
1635
1635
|
});
|
|
1636
1636
|
return a.finally(function() {
|
|
1637
1637
|
return r._unlock();
|
|
@@ -1719,23 +1719,23 @@ var Rr = { exports: {} };
|
|
|
1719
1719
|
function yt(e) {
|
|
1720
1720
|
return e == null ? ":id" : typeof e == "string" ? e : "[".concat(e.join("+"), "]");
|
|
1721
1721
|
}
|
|
1722
|
-
function ui(e, t,
|
|
1722
|
+
function ui(e, t, h) {
|
|
1723
1723
|
function r(g) {
|
|
1724
1724
|
if (g.type === 3)
|
|
1725
1725
|
return null;
|
|
1726
1726
|
if (g.type === 4)
|
|
1727
1727
|
throw new Error("Cannot convert never type to IDBKeyRange");
|
|
1728
|
-
var p = g.lower, y = g.upper,
|
|
1729
|
-
return p === void 0 ? y === void 0 ? null : t.upperBound(y, !!g) : y === void 0 ? t.lowerBound(p, !!
|
|
1728
|
+
var p = g.lower, y = g.upper, v = g.lowerOpen, g = g.upperOpen;
|
|
1729
|
+
return p === void 0 ? y === void 0 ? null : t.upperBound(y, !!g) : y === void 0 ? t.lowerBound(p, !!v) : t.bound(p, y, !!v, !!g);
|
|
1730
1730
|
}
|
|
1731
1731
|
function i(f) {
|
|
1732
1732
|
var p, y = f.name;
|
|
1733
|
-
return { name: y, schema: f, mutate: function(
|
|
1734
|
-
var g =
|
|
1735
|
-
return new Promise(function(k,
|
|
1733
|
+
return { name: y, schema: f, mutate: function(v) {
|
|
1734
|
+
var g = v.trans, _ = v.type, S = v.keys, E = v.values, O = v.range;
|
|
1735
|
+
return new Promise(function(k, C) {
|
|
1736
1736
|
k = J(k);
|
|
1737
|
-
var
|
|
1738
|
-
if (!
|
|
1737
|
+
var D = g.objectStore(y), R = D.keyPath == null, P = _ === "put" || _ === "add";
|
|
1738
|
+
if (!P && _ !== "delete" && _ !== "deleteRange")
|
|
1739
1739
|
throw new Error("Invalid operation type: " + _);
|
|
1740
1740
|
var G, L = (S || E || { length: 1 }).length;
|
|
1741
1741
|
if (S && E && S.length !== E.length)
|
|
@@ -1743,26 +1743,26 @@ var Rr = { exports: {} };
|
|
|
1743
1743
|
if (L === 0)
|
|
1744
1744
|
return k({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
1745
1745
|
function Y(se) {
|
|
1746
|
-
++
|
|
1746
|
+
++le, ht(se);
|
|
1747
1747
|
}
|
|
1748
|
-
var W = [], V = [],
|
|
1748
|
+
var W = [], V = [], le = 0;
|
|
1749
1749
|
if (_ === "deleteRange") {
|
|
1750
1750
|
if (O.type === 4)
|
|
1751
|
-
return k({ numFailures:
|
|
1752
|
-
O.type === 3 ? W.push(G =
|
|
1751
|
+
return k({ numFailures: le, failures: V, results: [], lastResult: void 0 });
|
|
1752
|
+
O.type === 3 ? W.push(G = D.clear()) : W.push(G = D.delete(r(O)));
|
|
1753
1753
|
} else {
|
|
1754
|
-
var R =
|
|
1755
|
-
if (
|
|
1754
|
+
var R = P ? R ? [E, S] : [E, null] : [S, null], U = R[0], Ee = R[1];
|
|
1755
|
+
if (P)
|
|
1756
1756
|
for (var ae = 0; ae < L; ++ae)
|
|
1757
|
-
W.push(G = Ee && Ee[ae] !== void 0 ?
|
|
1757
|
+
W.push(G = Ee && Ee[ae] !== void 0 ? D[_](U[ae], Ee[ae]) : D[_](U[ae])), G.onerror = Y;
|
|
1758
1758
|
else
|
|
1759
1759
|
for (ae = 0; ae < L; ++ae)
|
|
1760
|
-
W.push(G =
|
|
1760
|
+
W.push(G = D[_](U[ae])), G.onerror = Y;
|
|
1761
1761
|
}
|
|
1762
1762
|
function Vt(se) {
|
|
1763
1763
|
se = se.target.result, W.forEach(function(ze, Nn) {
|
|
1764
1764
|
return ze.error != null && (V[Nn] = ze.error);
|
|
1765
|
-
}), k({ numFailures:
|
|
1765
|
+
}), k({ numFailures: le, failures: V, results: _ === "delete" ? S : W.map(function(ze) {
|
|
1766
1766
|
return ze.result;
|
|
1767
1767
|
}), lastResult: se });
|
|
1768
1768
|
}
|
|
@@ -1770,18 +1770,18 @@ var Rr = { exports: {} };
|
|
|
1770
1770
|
Y(se), Vt(se);
|
|
1771
1771
|
}, G.onsuccess = Vt;
|
|
1772
1772
|
});
|
|
1773
|
-
}, getMany: function(
|
|
1774
|
-
var g =
|
|
1773
|
+
}, getMany: function(v) {
|
|
1774
|
+
var g = v.trans, _ = v.keys;
|
|
1775
1775
|
return new Promise(function(S, E) {
|
|
1776
1776
|
S = J(S);
|
|
1777
|
-
for (var O, k = g.objectStore(y),
|
|
1778
|
-
W = W.target,
|
|
1779
|
-
}, L = ye(E), Y = 0; Y <
|
|
1777
|
+
for (var O, k = g.objectStore(y), C = _.length, D = new Array(C), R = 0, P = 0, G = function(W) {
|
|
1778
|
+
W = W.target, D[W._pos] = W.result, ++P === R && S(D);
|
|
1779
|
+
}, L = ye(E), Y = 0; Y < C; ++Y)
|
|
1780
1780
|
_[Y] != null && ((O = k.get(_[Y]))._pos = Y, O.onsuccess = G, O.onerror = L, ++R);
|
|
1781
|
-
R === 0 && S(
|
|
1781
|
+
R === 0 && S(D);
|
|
1782
1782
|
});
|
|
1783
|
-
}, get: function(
|
|
1784
|
-
var g =
|
|
1783
|
+
}, get: function(v) {
|
|
1784
|
+
var g = v.trans, _ = v.key;
|
|
1785
1785
|
return new Promise(function(S, E) {
|
|
1786
1786
|
S = J(S);
|
|
1787
1787
|
var O = g.objectStore(y).get(_);
|
|
@@ -1789,31 +1789,31 @@ var Rr = { exports: {} };
|
|
|
1789
1789
|
return S(k.target.result);
|
|
1790
1790
|
}, O.onerror = ye(E);
|
|
1791
1791
|
});
|
|
1792
|
-
}, query: (p = l, function(
|
|
1792
|
+
}, query: (p = l, function(v) {
|
|
1793
1793
|
return new Promise(function(g, _) {
|
|
1794
1794
|
g = J(g);
|
|
1795
|
-
var S, E, O, R =
|
|
1796
|
-
if (
|
|
1795
|
+
var S, E, O, R = v.trans, k = v.values, C = v.limit, G = v.query, D = C === 1 / 0 ? void 0 : C, P = G.index, G = G.range, R = R.objectStore(y), P = P.isPrimaryKey ? R : R.index(P.name), G = r(G);
|
|
1796
|
+
if (C === 0)
|
|
1797
1797
|
return g({ result: [] });
|
|
1798
|
-
p ? ((
|
|
1798
|
+
p ? ((D = k ? P.getAll(G, D) : P.getAllKeys(G, D)).onsuccess = function(L) {
|
|
1799
1799
|
return g({ result: L.target.result });
|
|
1800
|
-
},
|
|
1800
|
+
}, D.onerror = ye(_)) : (S = 0, E = !k && "openKeyCursor" in P ? P.openKeyCursor(G) : P.openCursor(G), O = [], E.onsuccess = function(L) {
|
|
1801
1801
|
var Y = E.result;
|
|
1802
|
-
return Y ? (O.push(k ? Y.value : Y.primaryKey), ++S ===
|
|
1802
|
+
return Y ? (O.push(k ? Y.value : Y.primaryKey), ++S === C ? g({ result: O }) : void Y.continue()) : g({ result: O });
|
|
1803
1803
|
}, E.onerror = ye(_));
|
|
1804
1804
|
});
|
|
1805
|
-
}), openCursor: function(
|
|
1806
|
-
var g =
|
|
1807
|
-
return new Promise(function(k,
|
|
1805
|
+
}), openCursor: function(v) {
|
|
1806
|
+
var g = v.trans, _ = v.values, S = v.query, E = v.reverse, O = v.unique;
|
|
1807
|
+
return new Promise(function(k, C) {
|
|
1808
1808
|
k = J(k);
|
|
1809
|
-
var
|
|
1810
|
-
G.onerror = ye(
|
|
1811
|
-
var Y, W, V,
|
|
1812
|
-
U ? (U.___id = ++si, U.done = !1, Y = U.continue.bind(U), W = (W = U.continuePrimaryKey) && W.bind(U), V = U.advance.bind(U),
|
|
1809
|
+
var P = S.index, D = S.range, R = g.objectStore(y), R = P.isPrimaryKey ? R : R.index(P.name), P = E ? O ? "prevunique" : "prev" : O ? "nextunique" : "next", G = !_ && "openKeyCursor" in R ? R.openKeyCursor(r(D), P) : R.openCursor(r(D), P);
|
|
1810
|
+
G.onerror = ye(C), G.onsuccess = J(function(L) {
|
|
1811
|
+
var Y, W, V, le, U = G.result;
|
|
1812
|
+
U ? (U.___id = ++si, U.done = !1, Y = U.continue.bind(U), W = (W = U.continuePrimaryKey) && W.bind(U), V = U.advance.bind(U), le = function() {
|
|
1813
1813
|
throw new Error("Cursor not stopped");
|
|
1814
1814
|
}, U.trans = g, U.stop = U.continue = U.continuePrimaryKey = U.advance = function() {
|
|
1815
1815
|
throw new Error("Cursor not started");
|
|
1816
|
-
}, U.fail = J(
|
|
1816
|
+
}, U.fail = J(C), U.next = function() {
|
|
1817
1817
|
var Ee = this, ae = 1;
|
|
1818
1818
|
return this.start(function() {
|
|
1819
1819
|
return ae-- ? Ee.continue() : Ee.stop();
|
|
@@ -1835,50 +1835,50 @@ var Rr = { exports: {} };
|
|
|
1835
1835
|
}
|
|
1836
1836
|
var Vt = new Promise(function(se, ze) {
|
|
1837
1837
|
se = J(se), G.onerror = ye(ze), U.fail = ze, U.stop = function(Nn) {
|
|
1838
|
-
U.stop = U.continue = U.continuePrimaryKey = U.advance =
|
|
1838
|
+
U.stop = U.continue = U.continuePrimaryKey = U.advance = le, se(Nn);
|
|
1839
1839
|
};
|
|
1840
1840
|
});
|
|
1841
1841
|
return G.onsuccess = J(function(se) {
|
|
1842
1842
|
G.onsuccess = ae, ae();
|
|
1843
1843
|
}), U.continue = Y, U.continuePrimaryKey = W, U.advance = V, ae(), Vt;
|
|
1844
1844
|
}, k(U)) : k(null);
|
|
1845
|
-
},
|
|
1845
|
+
}, C);
|
|
1846
1846
|
});
|
|
1847
|
-
}, count: function(
|
|
1848
|
-
var g =
|
|
1847
|
+
}, count: function(v) {
|
|
1848
|
+
var g = v.query, _ = v.trans, S = g.index, E = g.range;
|
|
1849
1849
|
return new Promise(function(O, k) {
|
|
1850
|
-
var
|
|
1851
|
-
|
|
1850
|
+
var C = _.objectStore(y), D = S.isPrimaryKey ? C : C.index(S.name), C = r(E), D = C ? D.count(C) : D.count();
|
|
1851
|
+
D.onsuccess = J(function(R) {
|
|
1852
1852
|
return O(R.target.result);
|
|
1853
|
-
}),
|
|
1853
|
+
}), D.onerror = ye(k);
|
|
1854
1854
|
});
|
|
1855
1855
|
} };
|
|
1856
1856
|
}
|
|
1857
|
-
var a, s, u,
|
|
1857
|
+
var a, s, u, b = (s = h, u = yr((a = e).objectStoreNames), { schema: { name: a.name, tables: u.map(function(f) {
|
|
1858
1858
|
return s.objectStore(f);
|
|
1859
1859
|
}).map(function(f) {
|
|
1860
|
-
var p = f.keyPath, g = f.autoIncrement, y = N(p),
|
|
1860
|
+
var p = f.keyPath, g = f.autoIncrement, y = N(p), v = {}, g = { name: f.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: p == null, compound: y, keyPath: p, autoIncrement: g, unique: !0, extractKey: vn(p) }, indexes: yr(f.indexNames).map(function(_) {
|
|
1861
1861
|
return f.index(_);
|
|
1862
1862
|
}).map(function(O) {
|
|
1863
1863
|
var S = O.name, E = O.unique, k = O.multiEntry, O = O.keyPath, k = { name: S, compound: N(O), keyPath: O, unique: E, multiEntry: k, extractKey: vn(O) };
|
|
1864
|
-
return
|
|
1864
|
+
return v[yt(O)] = k;
|
|
1865
1865
|
}), getIndexByKeyPath: function(_) {
|
|
1866
|
-
return
|
|
1866
|
+
return v[yt(_)];
|
|
1867
1867
|
} };
|
|
1868
|
-
return
|
|
1869
|
-
}) }, hasGetAll: 0 < u.length && "getAll" in s.objectStore(u[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }),
|
|
1870
|
-
return
|
|
1868
|
+
return v[":id"] = g.primaryKey, p != null && (v[yt(p)] = g.primaryKey), g;
|
|
1869
|
+
}) }, hasGetAll: 0 < u.length && "getAll" in s.objectStore(u[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), h = b.schema, l = b.hasGetAll, b = h.tables.map(i), c = {};
|
|
1870
|
+
return b.forEach(function(f) {
|
|
1871
1871
|
return c[f.name] = f;
|
|
1872
1872
|
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(f) {
|
|
1873
1873
|
if (!c[f])
|
|
1874
1874
|
throw new Error("Table '".concat(f, "' not found"));
|
|
1875
1875
|
return c[f];
|
|
1876
|
-
}, MIN_KEY: -1 / 0, MAX_KEY: gt(t), schema:
|
|
1876
|
+
}, MIN_KEY: -1 / 0, MAX_KEY: gt(t), schema: h };
|
|
1877
1877
|
}
|
|
1878
1878
|
function ci(e, t, n, r) {
|
|
1879
1879
|
var i = n.IDBKeyRange;
|
|
1880
1880
|
return n.indexedDB, { dbcore: (r = ui(t, i, r), e.dbcore.reduce(function(a, s) {
|
|
1881
|
-
return s = s.create,
|
|
1881
|
+
return s = s.create, m(m({}, a), s(a));
|
|
1882
1882
|
}, r)) };
|
|
1883
1883
|
}
|
|
1884
1884
|
function Mt(e, r) {
|
|
@@ -1894,13 +1894,13 @@ var Rr = { exports: {} };
|
|
|
1894
1894
|
n.forEach(function(i) {
|
|
1895
1895
|
var a = r[i];
|
|
1896
1896
|
t.forEach(function(s) {
|
|
1897
|
-
var u = function
|
|
1898
|
-
return Fr(l,
|
|
1897
|
+
var u = function h(l, b) {
|
|
1898
|
+
return Fr(l, b) || (l = te(l)) && h(l, b);
|
|
1899
1899
|
}(s, i);
|
|
1900
1900
|
(!u || "value" in u && u.value === void 0) && (s === e.Transaction.prototype || s instanceof e.Transaction ? ke(s, i, { get: function() {
|
|
1901
1901
|
return this.table(i);
|
|
1902
|
-
}, set: function(
|
|
1903
|
-
$n(this, i, { value:
|
|
1902
|
+
}, set: function(h) {
|
|
1903
|
+
$n(this, i, { value: h, writable: !0, configurable: !0, enumerable: !0 });
|
|
1904
1904
|
} }) : s[i] = new e.Table(i, a));
|
|
1905
1905
|
});
|
|
1906
1906
|
});
|
|
@@ -1921,67 +1921,67 @@ var Rr = { exports: {} };
|
|
|
1921
1921
|
a.create(n), a._completion.catch(r);
|
|
1922
1922
|
var s = a._reject.bind(a), u = M.transless || M;
|
|
1923
1923
|
Pe(function() {
|
|
1924
|
-
return M.trans = a, M.transless = u, t !== 0 ? (Mt(e, n), l = t, ((
|
|
1925
|
-
return
|
|
1926
|
-
}) : T.resolve(l)).then(function(
|
|
1927
|
-
return f =
|
|
1924
|
+
return M.trans = a, M.transless = u, t !== 0 ? (Mt(e, n), l = t, ((h = a).storeNames.includes("$meta") ? h.table("$meta").get("version").then(function(b) {
|
|
1925
|
+
return b ?? l;
|
|
1926
|
+
}) : T.resolve(l)).then(function(b) {
|
|
1927
|
+
return f = b, p = a, y = n, v = [], b = (c = e)._versions, g = c._dbSchema = Gt(0, c.idbdb, y), (b = b.filter(function(_) {
|
|
1928
1928
|
return _._cfg.version >= f;
|
|
1929
|
-
})).length !== 0 ? (
|
|
1930
|
-
|
|
1929
|
+
})).length !== 0 ? (b.forEach(function(_) {
|
|
1930
|
+
v.push(function() {
|
|
1931
1931
|
var S = g, E = _._cfg.dbschema;
|
|
1932
1932
|
Ft(c, S, y), Ft(c, E, y), g = c._dbSchema = E;
|
|
1933
1933
|
var O = _n(S, E);
|
|
1934
|
-
O.add.forEach(function(
|
|
1935
|
-
Sn(y,
|
|
1936
|
-
}), O.change.forEach(function(
|
|
1937
|
-
if (
|
|
1934
|
+
O.add.forEach(function(P) {
|
|
1935
|
+
Sn(y, P[0], P[1].primKey, P[1].indexes);
|
|
1936
|
+
}), O.change.forEach(function(P) {
|
|
1937
|
+
if (P.recreate)
|
|
1938
1938
|
throw new F.Upgrade("Not yet support for changing primary key");
|
|
1939
|
-
var G = y.objectStore(
|
|
1940
|
-
|
|
1939
|
+
var G = y.objectStore(P.name);
|
|
1940
|
+
P.add.forEach(function(L) {
|
|
1941
1941
|
return Nt(G, L);
|
|
1942
|
-
}),
|
|
1942
|
+
}), P.change.forEach(function(L) {
|
|
1943
1943
|
G.deleteIndex(L.name), Nt(G, L);
|
|
1944
|
-
}),
|
|
1944
|
+
}), P.del.forEach(function(L) {
|
|
1945
1945
|
return G.deleteIndex(L);
|
|
1946
1946
|
});
|
|
1947
1947
|
});
|
|
1948
1948
|
var k = _._cfg.contentUpgrade;
|
|
1949
1949
|
if (k && _._cfg.version > f) {
|
|
1950
1950
|
Mt(c, y), p._memoizedTables = {};
|
|
1951
|
-
var
|
|
1952
|
-
O.del.forEach(function(
|
|
1953
|
-
|
|
1954
|
-
}), wn(c, [c.Transaction.prototype]), Bt(c, [c.Transaction.prototype],
|
|
1955
|
-
var
|
|
1951
|
+
var C = Vn(E);
|
|
1952
|
+
O.del.forEach(function(P) {
|
|
1953
|
+
C[P] = S[P];
|
|
1954
|
+
}), wn(c, [c.Transaction.prototype]), Bt(c, [c.Transaction.prototype], j(C), C), p.schema = C;
|
|
1955
|
+
var D, R = qt(k);
|
|
1956
1956
|
return R && Je(), O = T.follow(function() {
|
|
1957
|
-
var
|
|
1958
|
-
(
|
|
1959
|
-
}),
|
|
1960
|
-
return
|
|
1957
|
+
var P;
|
|
1958
|
+
(D = k(p)) && R && (P = Ie.bind(null, null), D.then(P, P));
|
|
1959
|
+
}), D && typeof D.then == "function" ? T.resolve(D) : O.then(function() {
|
|
1960
|
+
return D;
|
|
1961
1961
|
});
|
|
1962
1962
|
}
|
|
1963
|
-
}),
|
|
1963
|
+
}), v.push(function(S) {
|
|
1964
1964
|
var E, O, k = _._cfg.dbschema;
|
|
1965
|
-
E = k, O = S, [].slice.call(O.db.objectStoreNames).forEach(function(
|
|
1966
|
-
return E[
|
|
1965
|
+
E = k, O = S, [].slice.call(O.db.objectStoreNames).forEach(function(C) {
|
|
1966
|
+
return E[C] == null && O.db.deleteObjectStore(C);
|
|
1967
1967
|
}), wn(c, [c.Transaction.prototype]), Bt(c, [c.Transaction.prototype], c._storeNames, c._dbSchema), p.schema = c._dbSchema;
|
|
1968
|
-
}),
|
|
1968
|
+
}), v.push(function(S) {
|
|
1969
1969
|
c.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(c.idbdb.version / 10) === _._cfg.version ? (c.idbdb.deleteObjectStore("$meta"), delete c._dbSchema.$meta, c._storeNames = c._storeNames.filter(function(E) {
|
|
1970
1970
|
return E !== "$meta";
|
|
1971
1971
|
})) : S.objectStore("$meta").put(_._cfg.version, "version"));
|
|
1972
1972
|
});
|
|
1973
1973
|
}), function _() {
|
|
1974
|
-
return
|
|
1974
|
+
return v.length ? T.resolve(v.shift()(p.idbtrans)).then(_) : T.resolve();
|
|
1975
1975
|
}().then(function() {
|
|
1976
1976
|
mr(g, y);
|
|
1977
1977
|
})) : T.resolve();
|
|
1978
|
-
var c, f, p, y,
|
|
1979
|
-
}).catch(s)) : (
|
|
1980
|
-
Sn(n,
|
|
1978
|
+
var c, f, p, y, v, g;
|
|
1979
|
+
}).catch(s)) : (j(i).forEach(function(b) {
|
|
1980
|
+
Sn(n, b, i[b].primKey, i[b].indexes);
|
|
1981
1981
|
}), Mt(e, n), void T.follow(function() {
|
|
1982
1982
|
return e.on.populate.fire(a);
|
|
1983
1983
|
}).catch(s));
|
|
1984
|
-
var
|
|
1984
|
+
var h, l;
|
|
1985
1985
|
});
|
|
1986
1986
|
}
|
|
1987
1987
|
function di(e, t) {
|
|
@@ -1993,8 +1993,8 @@ var Rr = { exports: {} };
|
|
|
1993
1993
|
if (s.change.length || s.recreate)
|
|
1994
1994
|
return console.warn("Unable to patch indexes of table ".concat(s.name, " because it has changes on the type of index or primary key.")), { value: void 0 };
|
|
1995
1995
|
var u = t.objectStore(s.name);
|
|
1996
|
-
s.add.forEach(function(
|
|
1997
|
-
pe && console.debug("Dexie upgrade patch: Creating missing index ".concat(s.name, ".").concat(
|
|
1996
|
+
s.add.forEach(function(h) {
|
|
1997
|
+
pe && console.debug("Dexie upgrade patch: Creating missing index ".concat(s.name, ".").concat(h.src)), Nt(u, h);
|
|
1998
1998
|
});
|
|
1999
1999
|
}(i[r]);
|
|
2000
2000
|
if (typeof a == "object")
|
|
@@ -2012,12 +2012,12 @@ var Rr = { exports: {} };
|
|
|
2012
2012
|
if ("" + (i.primKey.keyPath || "") != "" + (a.primKey.keyPath || "") || i.primKey.auto !== a.primKey.auto)
|
|
2013
2013
|
s.recreate = !0, r.change.push(s);
|
|
2014
2014
|
else {
|
|
2015
|
-
var u = i.idxByName,
|
|
2015
|
+
var u = i.idxByName, h = a.idxByName, l = void 0;
|
|
2016
2016
|
for (l in u)
|
|
2017
|
-
|
|
2018
|
-
for (l in
|
|
2019
|
-
var
|
|
2020
|
-
|
|
2017
|
+
h[l] || s.del.push(l);
|
|
2018
|
+
for (l in h) {
|
|
2019
|
+
var b = u[l], c = h[l];
|
|
2020
|
+
b ? b.src !== c.src && s.change.push(c) : s.add.push(c);
|
|
2021
2021
|
}
|
|
2022
2022
|
(0 < s.del.length || 0 < s.add.length || 0 < s.change.length) && r.change.push(s);
|
|
2023
2023
|
}
|
|
@@ -2033,7 +2033,7 @@ var Rr = { exports: {} };
|
|
|
2033
2033
|
}), i;
|
|
2034
2034
|
}
|
|
2035
2035
|
function mr(e, t) {
|
|
2036
|
-
|
|
2036
|
+
j(e).forEach(function(n) {
|
|
2037
2037
|
t.db.objectStoreNames.contains(n) || (pe && console.debug("Dexie: Creating missing table", n), Sn(t, n, e[n].primKey, e[n].indexes));
|
|
2038
2038
|
});
|
|
2039
2039
|
}
|
|
@@ -2043,9 +2043,9 @@ var Rr = { exports: {} };
|
|
|
2043
2043
|
function Gt(e, t, n) {
|
|
2044
2044
|
var r = {};
|
|
2045
2045
|
return wt(t.objectStoreNames, 0).forEach(function(i) {
|
|
2046
|
-
for (var a = n.objectStore(i), s = mn(gr(l = a.keyPath), l || "", !0, !1, !!a.autoIncrement, l && typeof l != "string", !0), u = [],
|
|
2047
|
-
var
|
|
2048
|
-
u.push(
|
|
2046
|
+
for (var a = n.objectStore(i), s = mn(gr(l = a.keyPath), l || "", !0, !1, !!a.autoIncrement, l && typeof l != "string", !0), u = [], h = 0; h < a.indexNames.length; ++h) {
|
|
2047
|
+
var b = a.index(a.indexNames[h]), l = b.keyPath, b = mn(b.name, l, !!b.unique, !!b.multiEntry, !1, l && typeof l != "string", !1);
|
|
2048
|
+
u.push(b);
|
|
2049
2049
|
}
|
|
2050
2050
|
r[i] = bn(i, s, u);
|
|
2051
2051
|
}), r;
|
|
@@ -2055,11 +2055,11 @@ var Rr = { exports: {} };
|
|
|
2055
2055
|
var a = r[i], s = n.objectStore(a);
|
|
2056
2056
|
e._hasGetAll = "getAll" in s;
|
|
2057
2057
|
for (var u = 0; u < s.indexNames.length; ++u) {
|
|
2058
|
-
var
|
|
2059
|
-
!t[a] || (l = t[a].idxByName[
|
|
2058
|
+
var h = s.indexNames[u], l = s.index(h).keyPath, b = typeof l == "string" ? l : "[" + wt(l).join("+") + "]";
|
|
2059
|
+
!t[a] || (l = t[a].idxByName[b]) && (l.name = h, delete t[a].idxByName[b], t[a].idxByName[h] = l);
|
|
2060
2060
|
}
|
|
2061
2061
|
}
|
|
2062
|
-
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) &&
|
|
2062
|
+
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && K.WorkerGlobalScope && K instanceof K.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e._hasGetAll = !1);
|
|
2063
2063
|
}
|
|
2064
2064
|
function br(e) {
|
|
2065
2065
|
return e.split(",").map(function(t, n) {
|
|
@@ -2068,7 +2068,7 @@ var Rr = { exports: {} };
|
|
|
2068
2068
|
});
|
|
2069
2069
|
}
|
|
2070
2070
|
var hi = (Lt.prototype._parseStoresSpec = function(e, t) {
|
|
2071
|
-
|
|
2071
|
+
j(e).forEach(function(n) {
|
|
2072
2072
|
if (e[n] !== null) {
|
|
2073
2073
|
var r = br(e[n]), i = r.shift();
|
|
2074
2074
|
if (i.unique = !0, i.multi)
|
|
@@ -2087,7 +2087,7 @@ var Rr = { exports: {} };
|
|
|
2087
2087
|
var n = t._versions, r = {}, i = {};
|
|
2088
2088
|
return n.forEach(function(a) {
|
|
2089
2089
|
Z(r, a._cfg.storesSource), i = a._cfg.dbschema = {}, a._parseStoresSpec(r, i);
|
|
2090
|
-
}), t._dbSchema = i, wn(t, [t._allTables, t, t.Transaction.prototype]), Bt(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables],
|
|
2090
|
+
}), t._dbSchema = i, wn(t, [t._allTables, t, t.Transaction.prototype]), Bt(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables], j(i), i), t._storeNames = j(i), this;
|
|
2091
2091
|
}, Lt.prototype.upgrade = function(e) {
|
|
2092
2092
|
return this._cfg.contentUpgrade = tn(this._cfg.contentUpgrade || H, e), this;
|
|
2093
2093
|
}, Lt);
|
|
@@ -2131,9 +2131,9 @@ var Rr = { exports: {} };
|
|
|
2131
2131
|
}
|
|
2132
2132
|
}
|
|
2133
2133
|
function bt(e, t) {
|
|
2134
|
-
kn(t) || function n(r,
|
|
2135
|
-
var a =
|
|
2136
|
-
mt(r, a, s), u && n(r, u),
|
|
2134
|
+
kn(t) || function n(r, h) {
|
|
2135
|
+
var a = h.from, s = h.to, u = h.l, h = h.r;
|
|
2136
|
+
mt(r, a, s), u && n(r, u), h && n(r, h);
|
|
2137
2137
|
}(e, t);
|
|
2138
2138
|
}
|
|
2139
2139
|
function Ut(e, t) {
|
|
@@ -2175,14 +2175,14 @@ var Rr = { exports: {} };
|
|
|
2175
2175
|
}
|
|
2176
2176
|
function vr(e) {
|
|
2177
2177
|
var t, n, r = (((t = e.r) === null || t === void 0 ? void 0 : t.d) || 0) - (((n = e.l) === null || n === void 0 ? void 0 : n.d) || 0), i = 1 < r ? "r" : r < -1 ? "l" : "";
|
|
2178
|
-
i && (t = i == "r" ? "l" : "r", n =
|
|
2178
|
+
i && (t = i == "r" ? "l" : "r", n = m({}, e), r = e[i], e.from = r.from, e.to = r.to, e[i] = r[i], n[i] = r[t], (e[t] = n).d = wr(n)), e.d = wr(e);
|
|
2179
2179
|
}
|
|
2180
2180
|
function wr(n) {
|
|
2181
2181
|
var t = n.r, n = n.l;
|
|
2182
2182
|
return (t ? n ? Math.max(t.d, n.d) : t.d : n ? n.d : 0) + 1;
|
|
2183
2183
|
}
|
|
2184
2184
|
function Wt(e, t) {
|
|
2185
|
-
return
|
|
2185
|
+
return j(t).forEach(function(n) {
|
|
2186
2186
|
e[n] ? bt(e[n], t[n]) : e[n] = function r(i) {
|
|
2187
2187
|
var a, s, u = {};
|
|
2188
2188
|
for (a in i)
|
|
@@ -2225,24 +2225,24 @@ var Rr = { exports: {} };
|
|
|
2225
2225
|
var s, u = /^idb\:\/\/(.*)\/(.*)\//.exec(a);
|
|
2226
2226
|
u && (a = u[1], u = u[2], (s = Ue["idb://".concat(a, "/").concat(u)]) && _r(s, e, n, t));
|
|
2227
2227
|
}
|
|
2228
|
-
n.forEach(function(
|
|
2229
|
-
return
|
|
2228
|
+
n.forEach(function(h) {
|
|
2229
|
+
return h();
|
|
2230
2230
|
});
|
|
2231
2231
|
}
|
|
2232
2232
|
function _r(e, t, n, r) {
|
|
2233
2233
|
for (var i = [], a = 0, s = Object.entries(e.queries.query); a < s.length; a++) {
|
|
2234
|
-
for (var u = s[a],
|
|
2235
|
-
var f = c[
|
|
2234
|
+
for (var u = s[a], h = u[0], l = [], b = 0, c = u[1]; b < c.length; b++) {
|
|
2235
|
+
var f = c[b];
|
|
2236
2236
|
Dn(t, f.obsSet) ? f.subscribers.forEach(function(g) {
|
|
2237
2237
|
return n.add(g);
|
|
2238
2238
|
}) : r && l.push(f);
|
|
2239
2239
|
}
|
|
2240
|
-
r && i.push([
|
|
2240
|
+
r && i.push([h, l]);
|
|
2241
2241
|
}
|
|
2242
2242
|
if (r)
|
|
2243
2243
|
for (var p = 0, y = i; p < y.length; p++) {
|
|
2244
|
-
var
|
|
2245
|
-
e.queries.query[
|
|
2244
|
+
var v = y[p], h = v[0], l = v[1];
|
|
2245
|
+
e.queries.query[h] = l;
|
|
2246
2246
|
}
|
|
2247
2247
|
}
|
|
2248
2248
|
function pi(e) {
|
|
@@ -2261,34 +2261,34 @@ var Rr = { exports: {} };
|
|
|
2261
2261
|
return new T(function(f, p) {
|
|
2262
2262
|
if (s(), !n)
|
|
2263
2263
|
throw new F.MissingAPI();
|
|
2264
|
-
var y = e.name,
|
|
2265
|
-
if (!
|
|
2264
|
+
var y = e.name, v = t.autoSchema || !i ? n.open(y) : n.open(y, i);
|
|
2265
|
+
if (!v)
|
|
2266
2266
|
throw new F.MissingAPI();
|
|
2267
|
-
|
|
2267
|
+
v.onerror = ye(p), v.onblocked = J(e._fireOnBlocked), v.onupgradeneeded = J(function(g) {
|
|
2268
2268
|
var _;
|
|
2269
|
-
|
|
2269
|
+
b = v.transaction, t.autoSchema && !e._options.allowEmptyDB ? (v.onerror = ht, b.abort(), v.result.close(), (_ = n.deleteDatabase(y)).onsuccess = _.onerror = J(function() {
|
|
2270
2270
|
p(new F.NoSuchDatabase("Database ".concat(y, " doesnt exist")));
|
|
2271
|
-
})) : (
|
|
2272
|
-
}, p),
|
|
2273
|
-
|
|
2274
|
-
var g, _, S, E, O, k = e.idbdb =
|
|
2275
|
-
if (0 <
|
|
2271
|
+
})) : (b.onerror = ye(p), g = g.oldVersion > Math.pow(2, 62) ? 0 : g.oldVersion, c = g < 1, e.idbdb = v.result, a && di(e, b), fi(e, g / 10, b, p));
|
|
2272
|
+
}, p), v.onsuccess = J(function() {
|
|
2273
|
+
b = null;
|
|
2274
|
+
var g, _, S, E, O, k = e.idbdb = v.result, C = wt(k.objectStoreNames);
|
|
2275
|
+
if (0 < C.length)
|
|
2276
2276
|
try {
|
|
2277
|
-
var
|
|
2277
|
+
var D = k.transaction((E = C).length === 1 ? E[0] : E, "readonly");
|
|
2278
2278
|
if (t.autoSchema)
|
|
2279
|
-
_ = k, S =
|
|
2280
|
-
else if (Ft(e, e._dbSchema,
|
|
2279
|
+
_ = k, S = D, (g = e).verno = _.version / 10, S = g._dbSchema = Gt(0, _, S), g._storeNames = wt(_.objectStoreNames, 0), Bt(g, [g._allTables], j(S), S);
|
|
2280
|
+
else if (Ft(e, e._dbSchema, D), ((O = _n(Gt(0, (O = e).idbdb, D), O._dbSchema)).add.length || O.change.some(function(R) {
|
|
2281
2281
|
return R.add.length || R.change.length;
|
|
2282
2282
|
})) && !a)
|
|
2283
2283
|
return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), k.close(), i = k.version + 1, a = !0, f(u());
|
|
2284
|
-
Mt(e,
|
|
2284
|
+
Mt(e, D);
|
|
2285
2285
|
} catch {
|
|
2286
2286
|
}
|
|
2287
2287
|
Ze.push(e), k.onversionchange = J(function(R) {
|
|
2288
2288
|
t.vcFired = !0, e.on("versionchange").fire(R);
|
|
2289
2289
|
}), k.onclose = J(function(R) {
|
|
2290
2290
|
e.on("close").fire(R);
|
|
2291
|
-
}), c && (O = e._deps,
|
|
2291
|
+
}), c && (O = e._deps, D = y, k = O.indexedDB, O = O.IDBKeyRange, On(k) || D === Ct || En(k, O).put({ name: D }).catch(H)), f();
|
|
2292
2292
|
}, p);
|
|
2293
2293
|
}).catch(function(f) {
|
|
2294
2294
|
switch (f == null ? void 0 : f.name) {
|
|
@@ -2303,14 +2303,14 @@ var Rr = { exports: {} };
|
|
|
2303
2303
|
return T.reject(f);
|
|
2304
2304
|
});
|
|
2305
2305
|
}
|
|
2306
|
-
var
|
|
2306
|
+
var h, l = t.dbReadyResolve, b = null, c = !1;
|
|
2307
2307
|
return T.race([r, (typeof navigator > "u" ? T.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(f) {
|
|
2308
2308
|
function p() {
|
|
2309
2309
|
return indexedDB.databases().finally(f);
|
|
2310
2310
|
}
|
|
2311
|
-
|
|
2311
|
+
h = setInterval(p, 100), p();
|
|
2312
2312
|
}).finally(function() {
|
|
2313
|
-
return clearInterval(
|
|
2313
|
+
return clearInterval(h);
|
|
2314
2314
|
}) : Promise.resolve()).then(u)]).then(function() {
|
|
2315
2315
|
return s(), t.onReadyBeingFired = [], T.resolve(xn(function() {
|
|
2316
2316
|
return e.on.ready.fire(e.vip);
|
|
@@ -2327,7 +2327,7 @@ var Rr = { exports: {} };
|
|
|
2327
2327
|
}).catch(function(f) {
|
|
2328
2328
|
t.dbOpenError = f;
|
|
2329
2329
|
try {
|
|
2330
|
-
|
|
2330
|
+
b && b.abort();
|
|
2331
2331
|
} catch {
|
|
2332
2332
|
}
|
|
2333
2333
|
return r === t.openCanceller && e._close(), q(f);
|
|
@@ -2350,9 +2350,9 @@ var Rr = { exports: {} };
|
|
|
2350
2350
|
return e.throw(a);
|
|
2351
2351
|
});
|
|
2352
2352
|
function i(a) {
|
|
2353
|
-
return function(
|
|
2354
|
-
var u = a(
|
|
2355
|
-
return u.done ?
|
|
2353
|
+
return function(h) {
|
|
2354
|
+
var u = a(h), h = u.value;
|
|
2355
|
+
return u.done ? h : h && typeof h.then == "function" ? h.then(n, r) : N(h) ? Promise.all(h).then(n, r) : n(h);
|
|
2356
2356
|
};
|
|
2357
2357
|
}
|
|
2358
2358
|
return i(t)();
|
|
@@ -2363,44 +2363,44 @@ var Rr = { exports: {} };
|
|
|
2363
2363
|
return r;
|
|
2364
2364
|
}
|
|
2365
2365
|
var gi = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2366
|
-
return
|
|
2366
|
+
return m(m({}, e), { table: function(t) {
|
|
2367
2367
|
var n = e.table(t), r = n.schema, i = {}, a = [];
|
|
2368
2368
|
function s(c, f, p) {
|
|
2369
|
-
var y = yt(c),
|
|
2370
|
-
return
|
|
2369
|
+
var y = yt(c), v = i[y] = i[y] || [], g = c == null ? 0 : typeof c == "string" ? 1 : c.length, _ = 0 < f, _ = m(m({}, p), { name: _ ? "".concat(y, "(virtual-from:").concat(p.name, ")") : p.name, lowLevelIndex: p, isVirtual: _, keyTail: f, keyLength: g, extractKey: vn(c), unique: !_ && p.unique });
|
|
2370
|
+
return v.push(_), _.isPrimaryKey || a.push(_), 1 < g && s(g === 2 ? c[0] : c.slice(0, g - 1), f + 1, p), v.sort(function(S, E) {
|
|
2371
2371
|
return S.keyTail - E.keyTail;
|
|
2372
2372
|
}), _;
|
|
2373
2373
|
}
|
|
2374
2374
|
t = s(r.primaryKey.keyPath, 0, r.primaryKey), i[":id"] = [t];
|
|
2375
|
-
for (var u = 0,
|
|
2376
|
-
var l =
|
|
2375
|
+
for (var u = 0, h = r.indexes; u < h.length; u++) {
|
|
2376
|
+
var l = h[u];
|
|
2377
2377
|
s(l.keyPath, 0, l);
|
|
2378
2378
|
}
|
|
2379
|
-
function
|
|
2379
|
+
function b(c) {
|
|
2380
2380
|
var f, p = c.query.index;
|
|
2381
|
-
return p.isVirtual ?
|
|
2381
|
+
return p.isVirtual ? m(m({}, c), { query: { index: p.lowLevelIndex, range: (f = c.query.range, p = p.keyTail, { type: f.type === 1 ? 2 : f.type, lower: $t(f.lower, f.lowerOpen ? e.MAX_KEY : e.MIN_KEY, p), lowerOpen: !0, upper: $t(f.upper, f.upperOpen ? e.MIN_KEY : e.MAX_KEY, p), upperOpen: !0 }) } }) : c;
|
|
2382
2382
|
}
|
|
2383
|
-
return
|
|
2383
|
+
return m(m({}, n), { schema: m(m({}, r), { primaryKey: t, indexes: a, getIndexByKeyPath: function(c) {
|
|
2384
2384
|
return (c = i[yt(c)]) && c[0];
|
|
2385
2385
|
} }), count: function(c) {
|
|
2386
|
-
return n.count(
|
|
2386
|
+
return n.count(b(c));
|
|
2387
2387
|
}, query: function(c) {
|
|
2388
|
-
return n.query(
|
|
2388
|
+
return n.query(b(c));
|
|
2389
2389
|
}, openCursor: function(c) {
|
|
2390
|
-
var f = c.query.index, p = f.keyTail, y = f.isVirtual,
|
|
2391
|
-
return y ? n.openCursor(
|
|
2390
|
+
var f = c.query.index, p = f.keyTail, y = f.isVirtual, v = f.keyLength;
|
|
2391
|
+
return y ? n.openCursor(b(c)).then(function(_) {
|
|
2392
2392
|
return _ && g(_);
|
|
2393
2393
|
}) : n.openCursor(c);
|
|
2394
2394
|
function g(_) {
|
|
2395
2395
|
return Object.create(_, { continue: { value: function(S) {
|
|
2396
|
-
S != null ? _.continue($t(S, c.reverse ? e.MAX_KEY : e.MIN_KEY, p)) : c.unique ? _.continue(_.key.slice(0,
|
|
2396
|
+
S != null ? _.continue($t(S, c.reverse ? e.MAX_KEY : e.MIN_KEY, p)) : c.unique ? _.continue(_.key.slice(0, v).concat(c.reverse ? e.MIN_KEY : e.MAX_KEY, p)) : _.continue();
|
|
2397
2397
|
} }, continuePrimaryKey: { value: function(S, E) {
|
|
2398
2398
|
_.continuePrimaryKey($t(S, e.MAX_KEY, p), E);
|
|
2399
2399
|
} }, primaryKey: { get: function() {
|
|
2400
2400
|
return _.primaryKey;
|
|
2401
2401
|
} }, key: { get: function() {
|
|
2402
2402
|
var S = _.key;
|
|
2403
|
-
return
|
|
2403
|
+
return v === 1 ? S[0] : S.slice(0, v);
|
|
2404
2404
|
} }, value: { get: function() {
|
|
2405
2405
|
return _.value;
|
|
2406
2406
|
} } });
|
|
@@ -2409,10 +2409,10 @@ var Rr = { exports: {} };
|
|
|
2409
2409
|
} });
|
|
2410
2410
|
} };
|
|
2411
2411
|
function Tn(e, t, n, r) {
|
|
2412
|
-
return n = n || {}, r = r || "",
|
|
2412
|
+
return n = n || {}, r = r || "", j(e).forEach(function(i) {
|
|
2413
2413
|
var a, s, u;
|
|
2414
2414
|
ie(t, i) ? (a = e[i], s = t[i], typeof a == "object" && typeof s == "object" && a && s ? (u = Jt(a)) !== Jt(s) ? n[r + i] = t[i] : u === "Object" ? Tn(a, s, n, r + i + ".") : a !== s && (n[r + i] = t[i]) : a !== s && (n[r + i] = t[i])) : n[r + i] = void 0;
|
|
2415
|
-
}),
|
|
2415
|
+
}), j(t).forEach(function(i) {
|
|
2416
2416
|
ie(e, i) || (n[r + i] = t[i]);
|
|
2417
2417
|
}), n;
|
|
2418
2418
|
}
|
|
@@ -2420,61 +2420,61 @@ var Rr = { exports: {} };
|
|
|
2420
2420
|
return t.type === "delete" ? t.keys : t.keys || t.values.map(e.extractKey);
|
|
2421
2421
|
}
|
|
2422
2422
|
var yi = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
|
|
2423
|
-
return
|
|
2423
|
+
return m(m({}, e), { table: function(t) {
|
|
2424
2424
|
var n = e.table(t), r = n.schema.primaryKey;
|
|
2425
|
-
return
|
|
2426
|
-
var a = M.trans, s = a.table(t).hook, u = s.deleting,
|
|
2425
|
+
return m(m({}, n), { mutate: function(i) {
|
|
2426
|
+
var a = M.trans, s = a.table(t).hook, u = s.deleting, h = s.creating, l = s.updating;
|
|
2427
2427
|
switch (i.type) {
|
|
2428
2428
|
case "add":
|
|
2429
|
-
if (
|
|
2429
|
+
if (h.fire === H)
|
|
2430
2430
|
break;
|
|
2431
2431
|
return a._promise("readwrite", function() {
|
|
2432
|
-
return
|
|
2432
|
+
return b(i);
|
|
2433
2433
|
}, !0);
|
|
2434
2434
|
case "put":
|
|
2435
|
-
if (
|
|
2435
|
+
if (h.fire === H && l.fire === H)
|
|
2436
2436
|
break;
|
|
2437
2437
|
return a._promise("readwrite", function() {
|
|
2438
|
-
return
|
|
2438
|
+
return b(i);
|
|
2439
2439
|
}, !0);
|
|
2440
2440
|
case "delete":
|
|
2441
2441
|
if (u.fire === H)
|
|
2442
2442
|
break;
|
|
2443
2443
|
return a._promise("readwrite", function() {
|
|
2444
|
-
return
|
|
2444
|
+
return b(i);
|
|
2445
2445
|
}, !0);
|
|
2446
2446
|
case "deleteRange":
|
|
2447
2447
|
if (u.fire === H)
|
|
2448
2448
|
break;
|
|
2449
2449
|
return a._promise("readwrite", function() {
|
|
2450
2450
|
return function c(f, p, y) {
|
|
2451
|
-
return n.query({ trans: f, values: !1, query: { index: r, range: p }, limit: y }).then(function(
|
|
2452
|
-
var g =
|
|
2453
|
-
return
|
|
2454
|
-
return 0 < _.numFailures ? Promise.reject(_.failures[0]) : g.length < y ? { failures: [], numFailures: 0, lastResult: void 0 } : c(f,
|
|
2451
|
+
return n.query({ trans: f, values: !1, query: { index: r, range: p }, limit: y }).then(function(v) {
|
|
2452
|
+
var g = v.result;
|
|
2453
|
+
return b({ type: "delete", keys: g, trans: f }).then(function(_) {
|
|
2454
|
+
return 0 < _.numFailures ? Promise.reject(_.failures[0]) : g.length < y ? { failures: [], numFailures: 0, lastResult: void 0 } : c(f, m(m({}, p), { lower: g[g.length - 1], lowerOpen: !0 }), y);
|
|
2455
2455
|
});
|
|
2456
2456
|
});
|
|
2457
2457
|
}(i.trans, i.range, 1e4);
|
|
2458
2458
|
}, !0);
|
|
2459
2459
|
}
|
|
2460
2460
|
return n.mutate(i);
|
|
2461
|
-
function
|
|
2462
|
-
var f, p, y,
|
|
2461
|
+
function b(c) {
|
|
2462
|
+
var f, p, y, v = M.trans, g = c.keys || jn(r, c);
|
|
2463
2463
|
if (!g)
|
|
2464
2464
|
throw new Error("Keys missing");
|
|
2465
|
-
return (c = c.type === "add" || c.type === "put" ?
|
|
2465
|
+
return (c = c.type === "add" || c.type === "put" ? m(m({}, c), { keys: g }) : m({}, c)).type !== "delete" && (c.values = A([], c.values, !0)), c.keys && (c.keys = A([], c.keys, !0)), f = n, y = g, ((p = c).type === "add" ? Promise.resolve([]) : f.getMany({ trans: p.trans, keys: y, cache: "immutable" })).then(function(_) {
|
|
2466
2466
|
var S = g.map(function(E, O) {
|
|
2467
|
-
var k,
|
|
2468
|
-
return c.type === "delete" ? u.fire.call(
|
|
2469
|
-
ie(
|
|
2470
|
-
}))),
|
|
2467
|
+
var k, C, D, R = _[O], P = { onerror: null, onsuccess: null };
|
|
2468
|
+
return c.type === "delete" ? u.fire.call(P, E, R, v) : c.type === "add" || R === void 0 ? (k = h.fire.call(P, E, c.values[O], v), E == null && k != null && (c.keys[O] = E = k, r.outbound || fe(c.values[O], r.keyPath, E))) : (k = Tn(R, c.values[O]), (C = l.fire.call(P, k, E, R, v)) && (D = c.values[O], Object.keys(C).forEach(function(G) {
|
|
2469
|
+
ie(D, G) ? D[G] = C[G] : fe(D, G, C[G]);
|
|
2470
|
+
}))), P;
|
|
2471
2471
|
});
|
|
2472
2472
|
return n.mutate(c).then(function(E) {
|
|
2473
|
-
for (var O = E.failures, k = E.results,
|
|
2474
|
-
var R = (k || g)[
|
|
2475
|
-
R == null ?
|
|
2473
|
+
for (var O = E.failures, k = E.results, C = E.numFailures, E = E.lastResult, D = 0; D < g.length; ++D) {
|
|
2474
|
+
var R = (k || g)[D], P = S[D];
|
|
2475
|
+
R == null ? P.onerror && P.onerror(O[D]) : P.onsuccess && P.onsuccess(c.type === "put" && _[D] ? c.values[D] : R);
|
|
2476
2476
|
}
|
|
2477
|
-
return { failures: O, results: k, numFailures:
|
|
2477
|
+
return { failures: O, results: k, numFailures: C, lastResult: E };
|
|
2478
2478
|
}).catch(function(E) {
|
|
2479
2479
|
return S.forEach(function(O) {
|
|
2480
2480
|
return O.onerror && O.onerror(E);
|
|
@@ -2499,7 +2499,7 @@ var Rr = { exports: {} };
|
|
|
2499
2499
|
var mi = { stack: "dbcore", level: -1, create: function(e) {
|
|
2500
2500
|
return { table: function(t) {
|
|
2501
2501
|
var n = e.table(t);
|
|
2502
|
-
return
|
|
2502
|
+
return m(m({}, n), { getMany: function(r) {
|
|
2503
2503
|
if (!r.cache)
|
|
2504
2504
|
return n.getMany(r);
|
|
2505
2505
|
var i = Sr(r.keys, r.trans._cache, r.cache === "clone");
|
|
@@ -2527,7 +2527,7 @@ var Rr = { exports: {} };
|
|
|
2527
2527
|
}
|
|
2528
2528
|
var bi = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
2529
2529
|
var t = e.schema.name, n = new oe(e.MIN_KEY, e.MAX_KEY);
|
|
2530
|
-
return
|
|
2530
|
+
return m(m({}, e), { transaction: function(r, i, a) {
|
|
2531
2531
|
if (M.subscr && i !== "readonly")
|
|
2532
2532
|
throw new F.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(M.querier));
|
|
2533
2533
|
return e.transaction(r, i, a);
|
|
@@ -2536,67 +2536,67 @@ var Rr = { exports: {} };
|
|
|
2536
2536
|
var p = (y = p.query).index, y = y.range;
|
|
2537
2537
|
return [p, new oe((p = y.lower) !== null && p !== void 0 ? p : e.MIN_KEY, (y = y.upper) !== null && y !== void 0 ? y : e.MAX_KEY)];
|
|
2538
2538
|
}
|
|
2539
|
-
var a = e.table(r), s = a.schema, u = s.primaryKey,
|
|
2540
|
-
function p(
|
|
2541
|
-
return
|
|
2539
|
+
var a = e.table(r), s = a.schema, u = s.primaryKey, h = u.extractKey, l = u.outbound, b = m(m({}, a), { mutate: function(f) {
|
|
2540
|
+
function p(P) {
|
|
2541
|
+
return P = "idb://".concat(t, "/").concat(r, "/").concat(P), S[P] || (S[P] = new oe());
|
|
2542
2542
|
}
|
|
2543
|
-
var y,
|
|
2544
|
-
return
|
|
2545
|
-
}), f.values] : [],
|
|
2546
|
-
return N(
|
|
2547
|
-
var G = y(
|
|
2543
|
+
var y, v, g, _ = f.trans, S = f.mutatedParts || (f.mutatedParts = {}), E = p(""), O = p(":dels"), k = f.type, R = f.type === "deleteRange" ? [f.range] : f.type === "delete" ? [f.keys] : f.values.length < 50 ? [jn(u, f).filter(function(P) {
|
|
2544
|
+
return P;
|
|
2545
|
+
}), f.values] : [], C = R[0], D = R[1], R = f.trans._cache;
|
|
2546
|
+
return N(C) ? (E.addKeys(C), (R = k === "delete" || C.length === D.length ? Sr(C, R) : null) || O.addKeys(C), (R || D) && (y = p, v = R, g = D, s.indexes.forEach(function(P) {
|
|
2547
|
+
var G = y(P.name || "");
|
|
2548
2548
|
function L(W) {
|
|
2549
|
-
return W != null ?
|
|
2549
|
+
return W != null ? P.extractKey(W) : null;
|
|
2550
2550
|
}
|
|
2551
2551
|
function Y(W) {
|
|
2552
|
-
return
|
|
2552
|
+
return P.multiEntry && N(W) ? W.forEach(function(V) {
|
|
2553
2553
|
return G.addKey(V);
|
|
2554
2554
|
}) : G.addKey(W);
|
|
2555
2555
|
}
|
|
2556
|
-
(
|
|
2557
|
-
var
|
|
2558
|
-
$(
|
|
2556
|
+
(v || g).forEach(function(W, U) {
|
|
2557
|
+
var le = v && L(v[U]), U = g && L(g[U]);
|
|
2558
|
+
$(le, U) !== 0 && (le != null && Y(le), U != null && Y(U));
|
|
2559
2559
|
});
|
|
2560
|
-
}))) :
|
|
2561
|
-
return p(
|
|
2562
|
-
})), a.mutate(f).then(function(
|
|
2563
|
-
return !
|
|
2560
|
+
}))) : C ? (D = { from: C.lower, to: C.upper }, O.add(D), E.add(D)) : (E.add(n), O.add(n), s.indexes.forEach(function(P) {
|
|
2561
|
+
return p(P.name).add(n);
|
|
2562
|
+
})), a.mutate(f).then(function(P) {
|
|
2563
|
+
return !C || f.type !== "add" && f.type !== "put" || E.addKeys(P.results), _.mutatedParts = Wt(_.mutatedParts || {}, S), P;
|
|
2564
2564
|
});
|
|
2565
2565
|
} }), c = { get: function(f) {
|
|
2566
2566
|
return [u, new oe(f.key)];
|
|
2567
2567
|
}, getMany: function(f) {
|
|
2568
2568
|
return [u, new oe().addKeys(f.keys)];
|
|
2569
2569
|
}, count: i, query: i, openCursor: i };
|
|
2570
|
-
return
|
|
2571
|
-
|
|
2572
|
-
var y = M.subscr,
|
|
2573
|
-
if (
|
|
2574
|
-
var _ = function(
|
|
2575
|
-
return
|
|
2576
|
-
}, S = _(""), E = _(":dels"), y = c[f](p),
|
|
2577
|
-
if ((f === "query" &&
|
|
2570
|
+
return j(c).forEach(function(f) {
|
|
2571
|
+
b[f] = function(p) {
|
|
2572
|
+
var y = M.subscr, v = !!y, g = Er(M, a) && Or(f, p) ? p.obsSet = {} : y;
|
|
2573
|
+
if (v) {
|
|
2574
|
+
var _ = function(D) {
|
|
2575
|
+
return D = "idb://".concat(t, "/").concat(r, "/").concat(D), g[D] || (g[D] = new oe());
|
|
2576
|
+
}, S = _(""), E = _(":dels"), y = c[f](p), v = y[0], y = y[1];
|
|
2577
|
+
if ((f === "query" && v.isPrimaryKey && !p.values ? E : _(v.name || "")).add(y), !v.isPrimaryKey) {
|
|
2578
2578
|
if (f !== "count") {
|
|
2579
|
-
var O = f === "query" && l && p.values && a.query(
|
|
2580
|
-
return a[f].apply(this, arguments).then(function(
|
|
2579
|
+
var O = f === "query" && l && p.values && a.query(m(m({}, p), { values: !1 }));
|
|
2580
|
+
return a[f].apply(this, arguments).then(function(D) {
|
|
2581
2581
|
if (f === "query") {
|
|
2582
2582
|
if (l && p.values)
|
|
2583
2583
|
return O.then(function(L) {
|
|
2584
|
-
return L = L.result, S.addKeys(L),
|
|
2584
|
+
return L = L.result, S.addKeys(L), D;
|
|
2585
2585
|
});
|
|
2586
|
-
var R = p.values ?
|
|
2586
|
+
var R = p.values ? D.result.map(h) : D.result;
|
|
2587
2587
|
(p.values ? S : E).addKeys(R);
|
|
2588
2588
|
} else if (f === "openCursor") {
|
|
2589
|
-
var
|
|
2590
|
-
return
|
|
2591
|
-
return E.addKey(
|
|
2589
|
+
var P = D, G = p.values;
|
|
2590
|
+
return P && Object.create(P, { key: { get: function() {
|
|
2591
|
+
return E.addKey(P.primaryKey), P.key;
|
|
2592
2592
|
} }, primaryKey: { get: function() {
|
|
2593
|
-
var L =
|
|
2593
|
+
var L = P.primaryKey;
|
|
2594
2594
|
return E.addKey(L), L;
|
|
2595
2595
|
} }, value: { get: function() {
|
|
2596
|
-
return G && S.addKey(
|
|
2596
|
+
return G && S.addKey(P.primaryKey), P.value;
|
|
2597
2597
|
} } });
|
|
2598
2598
|
}
|
|
2599
|
-
return
|
|
2599
|
+
return D;
|
|
2600
2600
|
});
|
|
2601
2601
|
}
|
|
2602
2602
|
E.add(n);
|
|
@@ -2604,7 +2604,7 @@ var Rr = { exports: {} };
|
|
|
2604
2604
|
}
|
|
2605
2605
|
return a[f].apply(this, arguments);
|
|
2606
2606
|
};
|
|
2607
|
-
}),
|
|
2607
|
+
}), b;
|
|
2608
2608
|
} });
|
|
2609
2609
|
} };
|
|
2610
2610
|
function xr(e, t, n) {
|
|
@@ -2613,7 +2613,7 @@ var Rr = { exports: {} };
|
|
|
2613
2613
|
if (t.type === "deleteRange")
|
|
2614
2614
|
return null;
|
|
2615
2615
|
var r = t.keys ? t.keys.length : "values" in t && t.values ? t.values.length : 1;
|
|
2616
|
-
return n.numFailures === r ? null : (t =
|
|
2616
|
+
return n.numFailures === r ? null : (t = m({}, t), N(t.keys) && (t.keys = t.keys.filter(function(i, a) {
|
|
2617
2617
|
return !(a in n.failures);
|
|
2618
2618
|
})), "values" in t && N(t.values) && (t.values = t.values.filter(function(i, a) {
|
|
2619
2619
|
return !(a in n.failures);
|
|
@@ -2626,24 +2626,24 @@ var Rr = { exports: {} };
|
|
|
2626
2626
|
function kr(e, t, f, r, i, a) {
|
|
2627
2627
|
if (!f || f.length === 0)
|
|
2628
2628
|
return e;
|
|
2629
|
-
var s = t.query.index, u = s.multiEntry,
|
|
2630
|
-
var
|
|
2631
|
-
return O =
|
|
2632
|
-
return Kn(k,
|
|
2633
|
-
}) : Kn(O,
|
|
2629
|
+
var s = t.query.index, u = s.multiEntry, h = t.query.range, l = r.schema.primaryKey.extractKey, b = s.extractKey, c = (s.lowLevelIndex || s).extractKey, f = f.reduce(function(p, y) {
|
|
2630
|
+
var v = p, g = y.type === "add" || y.type === "put" ? y.values.filter(function(O) {
|
|
2631
|
+
return O = b(O), u && N(O) ? O.some(function(k) {
|
|
2632
|
+
return Kn(k, h);
|
|
2633
|
+
}) : Kn(O, h);
|
|
2634
2634
|
}).map(function(O) {
|
|
2635
2635
|
return O = Ae(O), a && Object.freeze(O), O;
|
|
2636
2636
|
}) : [];
|
|
2637
2637
|
switch (y.type) {
|
|
2638
2638
|
case "add":
|
|
2639
|
-
|
|
2639
|
+
v = p.concat(t.values ? g : g.map(function(k) {
|
|
2640
2640
|
return l(k);
|
|
2641
2641
|
}));
|
|
2642
2642
|
break;
|
|
2643
2643
|
case "put":
|
|
2644
2644
|
var _ = new oe().addKeys(y.values.map(function(k) {
|
|
2645
2645
|
return l(k);
|
|
2646
|
-
})),
|
|
2646
|
+
})), v = p.filter(function(k) {
|
|
2647
2647
|
return k = t.values ? l(k) : k, !Ut(new oe(k), _);
|
|
2648
2648
|
}).concat(t.values ? g : g.map(function(k) {
|
|
2649
2649
|
return l(k);
|
|
@@ -2651,17 +2651,17 @@ var Rr = { exports: {} };
|
|
|
2651
2651
|
break;
|
|
2652
2652
|
case "delete":
|
|
2653
2653
|
var S = new oe().addKeys(y.keys);
|
|
2654
|
-
|
|
2654
|
+
v = p.filter(function(k) {
|
|
2655
2655
|
return k = t.values ? l(k) : k, !Ut(new oe(k), S);
|
|
2656
2656
|
});
|
|
2657
2657
|
break;
|
|
2658
2658
|
case "deleteRange":
|
|
2659
2659
|
var E = y.range;
|
|
2660
|
-
|
|
2660
|
+
v = p.filter(function(k) {
|
|
2661
2661
|
return !Kn(l(k), E);
|
|
2662
2662
|
});
|
|
2663
2663
|
}
|
|
2664
|
-
return
|
|
2664
|
+
return v;
|
|
2665
2665
|
}, e);
|
|
2666
2666
|
return f === e ? e : (f.sort(function(p, y) {
|
|
2667
2667
|
return $(c(p), c(y)) || $(l(p), l(y));
|
|
@@ -2711,32 +2711,32 @@ var Rr = { exports: {} };
|
|
|
2711
2711
|
}
|
|
2712
2712
|
var _i = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
|
|
2713
2713
|
var t = e.schema.name;
|
|
2714
|
-
return
|
|
2714
|
+
return m(m({}, e), { transaction: function(n, r, i) {
|
|
2715
2715
|
var a, s, u = e.transaction(n, r, i);
|
|
2716
|
-
return r === "readwrite" && (s = (a = new AbortController()).signal, i = function(
|
|
2716
|
+
return r === "readwrite" && (s = (a = new AbortController()).signal, i = function(h) {
|
|
2717
2717
|
return function() {
|
|
2718
2718
|
if (a.abort(), r === "readwrite") {
|
|
2719
|
-
for (var l = /* @__PURE__ */ new Set(),
|
|
2720
|
-
var f = c[
|
|
2719
|
+
for (var l = /* @__PURE__ */ new Set(), b = 0, c = n; b < c.length; b++) {
|
|
2720
|
+
var f = c[b], p = Ue["idb://".concat(t, "/").concat(f)];
|
|
2721
2721
|
if (p) {
|
|
2722
|
-
var y = e.table(f),
|
|
2722
|
+
var y = e.table(f), v = p.optimisticOps.filter(function(L) {
|
|
2723
2723
|
return L.trans === u;
|
|
2724
2724
|
});
|
|
2725
|
-
if (u._explicit &&
|
|
2725
|
+
if (u._explicit && h && u.mutatedParts)
|
|
2726
2726
|
for (var g = 0, _ = Object.values(p.queries.query); g < _.length; g++)
|
|
2727
|
-
for (var S = 0, E = (
|
|
2728
|
-
Dn((
|
|
2727
|
+
for (var S = 0, E = (C = _[g]).slice(); S < E.length; S++)
|
|
2728
|
+
Dn((D = E[S]).obsSet, u.mutatedParts) && (Ke(C, D), D.subscribers.forEach(function(L) {
|
|
2729
2729
|
return l.add(L);
|
|
2730
2730
|
}));
|
|
2731
|
-
else if (0 <
|
|
2731
|
+
else if (0 < v.length) {
|
|
2732
2732
|
p.optimisticOps = p.optimisticOps.filter(function(L) {
|
|
2733
2733
|
return L.trans !== u;
|
|
2734
2734
|
});
|
|
2735
2735
|
for (var O = 0, k = Object.values(p.queries.query); O < k.length; O++)
|
|
2736
|
-
for (var
|
|
2737
|
-
(
|
|
2736
|
+
for (var C, D, R, P = 0, G = (C = k[O]).slice(); P < G.length; P++)
|
|
2737
|
+
(D = G[P]).res != null && u.mutatedParts && (h && !D.dirty ? (R = Object.isFrozen(D.res), R = kr(D.res, D.req, v, y, D, R), D.dirty ? (Ke(C, D), D.subscribers.forEach(function(L) {
|
|
2738
2738
|
return l.add(L);
|
|
2739
|
-
})) : R !==
|
|
2739
|
+
})) : R !== D.res && (D.res = R, D.promise = T.resolve({ result: R }))) : (D.dirty && Ke(C, D), D.subscribers.forEach(function(L) {
|
|
2740
2740
|
return l.add(L);
|
|
2741
2741
|
})));
|
|
2742
2742
|
}
|
|
@@ -2750,22 +2750,22 @@ var Rr = { exports: {} };
|
|
|
2750
2750
|
}, u.addEventListener("abort", i(!1), { signal: s }), u.addEventListener("error", i(!1), { signal: s }), u.addEventListener("complete", i(!0), { signal: s })), u;
|
|
2751
2751
|
}, table: function(n) {
|
|
2752
2752
|
var r = e.table(n), i = r.schema.primaryKey;
|
|
2753
|
-
return
|
|
2753
|
+
return m(m({}, r), { mutate: function(a) {
|
|
2754
2754
|
var s = M.trans;
|
|
2755
2755
|
if (i.outbound || s.db._options.cache === "disabled" || s.explicit)
|
|
2756
2756
|
return r.mutate(a);
|
|
2757
2757
|
var u = Ue["idb://".concat(t, "/").concat(n)];
|
|
2758
|
-
return u ? (s = r.mutate(a), a.type !== "add" && a.type !== "put" || !(50 <= a.values.length || jn(i, a).some(function(
|
|
2759
|
-
return
|
|
2760
|
-
})) ? (u.optimisticOps.push(a), a.mutatedParts && zt(a.mutatedParts), s.then(function(
|
|
2761
|
-
0 <
|
|
2758
|
+
return u ? (s = r.mutate(a), a.type !== "add" && a.type !== "put" || !(50 <= a.values.length || jn(i, a).some(function(h) {
|
|
2759
|
+
return h == null;
|
|
2760
|
+
})) ? (u.optimisticOps.push(a), a.mutatedParts && zt(a.mutatedParts), s.then(function(h) {
|
|
2761
|
+
0 < h.numFailures && (Ke(u.optimisticOps, a), (h = xr(0, a, h)) && u.optimisticOps.push(h), a.mutatedParts && zt(a.mutatedParts));
|
|
2762
2762
|
}), s.catch(function() {
|
|
2763
2763
|
Ke(u.optimisticOps, a), a.mutatedParts && zt(a.mutatedParts);
|
|
2764
|
-
})) : s.then(function(
|
|
2765
|
-
var l = xr(0,
|
|
2766
|
-
var f, p = (f = i.keyPath) !== null && f !== void 0 && f.includes(".") ? Ae(p) :
|
|
2767
|
-
return fe(p, i.keyPath,
|
|
2768
|
-
}) }),
|
|
2764
|
+
})) : s.then(function(h) {
|
|
2765
|
+
var l = xr(0, m(m({}, a), { values: a.values.map(function(p, c) {
|
|
2766
|
+
var f, p = (f = i.keyPath) !== null && f !== void 0 && f.includes(".") ? Ae(p) : m({}, p);
|
|
2767
|
+
return fe(p, i.keyPath, h.results[c]), p;
|
|
2768
|
+
}) }), h);
|
|
2769
2769
|
u.optimisticOps.push(l), queueMicrotask(function() {
|
|
2770
2770
|
return a.mutatedParts && zt(a.mutatedParts);
|
|
2771
2771
|
});
|
|
@@ -2773,13 +2773,13 @@ var Rr = { exports: {} };
|
|
|
2773
2773
|
}, query: function(a) {
|
|
2774
2774
|
if (!Er(M, r) || !Or("query", a))
|
|
2775
2775
|
return r.query(a);
|
|
2776
|
-
var s = ((l = M.trans) === null || l === void 0 ? void 0 : l.db._options.cache) === "immutable", c = M, u = c.requery,
|
|
2777
|
-
var S = Ue["idb://".concat(y, "/").concat(
|
|
2776
|
+
var s = ((l = M.trans) === null || l === void 0 ? void 0 : l.db._options.cache) === "immutable", c = M, u = c.requery, h = c.signal, l = function(y, v, g, _) {
|
|
2777
|
+
var S = Ue["idb://".concat(y, "/").concat(v)];
|
|
2778
2778
|
if (!S)
|
|
2779
2779
|
return [];
|
|
2780
|
-
if (!(
|
|
2780
|
+
if (!(v = S.queries[g]))
|
|
2781
2781
|
return [null, !1, S, null];
|
|
2782
|
-
var E =
|
|
2782
|
+
var E = v[(_.query ? _.query.index.name : null) || ""];
|
|
2783
2783
|
if (!E)
|
|
2784
2784
|
return [null, !1, S, null];
|
|
2785
2785
|
switch (g) {
|
|
@@ -2795,20 +2795,20 @@ var Rr = { exports: {} };
|
|
|
2795
2795
|
return Ar(k.req.query.range, _.query.range);
|
|
2796
2796
|
}), [O, !!O, S, E];
|
|
2797
2797
|
}
|
|
2798
|
-
}(t, n, "query", a),
|
|
2799
|
-
return
|
|
2800
|
-
var
|
|
2801
|
-
if (
|
|
2802
|
-
for (var g = 0, _ =
|
|
2803
|
-
Object.freeze(
|
|
2804
|
-
Object.freeze(
|
|
2798
|
+
}(t, n, "query", a), b = l[0], c = l[1], f = l[2], p = l[3];
|
|
2799
|
+
return b && c ? b.obsSet = a.obsSet : (c = r.query(a).then(function(y) {
|
|
2800
|
+
var v = y.result;
|
|
2801
|
+
if (b && (b.res = v), s) {
|
|
2802
|
+
for (var g = 0, _ = v.length; g < _; ++g)
|
|
2803
|
+
Object.freeze(v[g]);
|
|
2804
|
+
Object.freeze(v);
|
|
2805
2805
|
} else
|
|
2806
|
-
y.result = Ae(
|
|
2806
|
+
y.result = Ae(v);
|
|
2807
2807
|
return y;
|
|
2808
2808
|
}).catch(function(y) {
|
|
2809
|
-
return p &&
|
|
2810
|
-
}),
|
|
2811
|
-
return { result: kr(y.result, a, f == null ? void 0 : f.optimisticOps, r,
|
|
2809
|
+
return p && b && Ke(p, b), Promise.reject(y);
|
|
2810
|
+
}), b = { obsSet: a.obsSet, promise: c, subscribers: /* @__PURE__ */ new Set(), type: "query", req: a, dirty: !1 }, p ? p.push(b) : (p = [b], (f = f || (Ue["idb://".concat(t, "/").concat(n)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[a.query.index.name || ""] = p)), wi(b, p, u, h), b.promise.then(function(y) {
|
|
2811
|
+
return { result: kr(y.result, a, f == null ? void 0 : f.optimisticOps, r, b, s) };
|
|
2812
2812
|
});
|
|
2813
2813
|
} });
|
|
2814
2814
|
} });
|
|
@@ -2881,8 +2881,8 @@ var Rr = { exports: {} };
|
|
|
2881
2881
|
t.close(e);
|
|
2882
2882
|
var u = t._deps.indexedDB.deleteDatabase(t.name);
|
|
2883
2883
|
u.onsuccess = J(function() {
|
|
2884
|
-
var
|
|
2885
|
-
|
|
2884
|
+
var h, l, b;
|
|
2885
|
+
h = t._deps, l = t.name, b = h.indexedDB, h = h.IDBKeyRange, On(b) || l === Ct || En(b, h).delete(l).catch(H), i();
|
|
2886
2886
|
}), u.onerror = ye(a), u.onblocked = t._fireOnBlocked;
|
|
2887
2887
|
}
|
|
2888
2888
|
if (n)
|
|
@@ -2902,7 +2902,7 @@ var Rr = { exports: {} };
|
|
|
2902
2902
|
return this._state.autoSchema;
|
|
2903
2903
|
}, Object.defineProperty(ee.prototype, "tables", { get: function() {
|
|
2904
2904
|
var e = this;
|
|
2905
|
-
return
|
|
2905
|
+
return j(this._allTables).map(function(t) {
|
|
2906
2906
|
return e._allTables[t];
|
|
2907
2907
|
});
|
|
2908
2908
|
}, enumerable: !1, configurable: !0 }), ee.prototype.transaction = function() {
|
|
@@ -2947,30 +2947,30 @@ var Rr = { exports: {} };
|
|
|
2947
2947
|
}), u && i && !i.active && (i = null);
|
|
2948
2948
|
}
|
|
2949
2949
|
} catch (l) {
|
|
2950
|
-
return i ? i._promise(null, function(
|
|
2950
|
+
return i ? i._promise(null, function(b, c) {
|
|
2951
2951
|
c(l);
|
|
2952
2952
|
}) : q(l);
|
|
2953
2953
|
}
|
|
2954
|
-
var
|
|
2954
|
+
var h = (function l(b, c, f, p, y) {
|
|
2955
2955
|
return T.resolve().then(function() {
|
|
2956
|
-
var
|
|
2957
|
-
if (g.explicit = !0,
|
|
2956
|
+
var v = M.transless || M, g = b._createTransaction(c, f, b._dbSchema, p);
|
|
2957
|
+
if (g.explicit = !0, v = { trans: g, transless: v }, p)
|
|
2958
2958
|
g.idbtrans = p.idbtrans;
|
|
2959
2959
|
else
|
|
2960
2960
|
try {
|
|
2961
|
-
g.create(), g.idbtrans._explicit = !0,
|
|
2961
|
+
g.create(), g.idbtrans._explicit = !0, b._state.PR1398_maxLoop = 3;
|
|
2962
2962
|
} catch (E) {
|
|
2963
|
-
return E.name === en.InvalidState &&
|
|
2964
|
-
return l(
|
|
2963
|
+
return E.name === en.InvalidState && b.isOpen() && 0 < --b._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), b.close({ disableAutoOpen: !1 }), b.open().then(function() {
|
|
2964
|
+
return l(b, c, f, null, y);
|
|
2965
2965
|
})) : q(E);
|
|
2966
2966
|
}
|
|
2967
2967
|
var _, S = qt(y);
|
|
2968
|
-
return S && Je(),
|
|
2968
|
+
return S && Je(), v = T.follow(function() {
|
|
2969
2969
|
var E;
|
|
2970
2970
|
(_ = y.call(g, g)) && (S ? (E = Ie.bind(null, null), _.then(E, E)) : typeof _.next == "function" && typeof _.throw == "function" && (_ = Rn(_)));
|
|
2971
|
-
},
|
|
2971
|
+
}, v), (_ && typeof _.then == "function" ? T.resolve(_).then(function(E) {
|
|
2972
2972
|
return g.active ? E : q(new F.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
2973
|
-
}) :
|
|
2973
|
+
}) : v.then(function() {
|
|
2974
2974
|
return _;
|
|
2975
2975
|
})).then(function(E) {
|
|
2976
2976
|
return p && g._resolve(), g._completion.then(function() {
|
|
@@ -2981,9 +2981,9 @@ var Rr = { exports: {} };
|
|
|
2981
2981
|
});
|
|
2982
2982
|
});
|
|
2983
2983
|
}).bind(null, this, a, s, i, n);
|
|
2984
|
-
return i ? i._promise(a,
|
|
2985
|
-
return r._whenReady(
|
|
2986
|
-
}) : this._whenReady(
|
|
2984
|
+
return i ? i._promise(a, h, "lock") : M.trans ? Ge(M.transless, function() {
|
|
2985
|
+
return r._whenReady(h);
|
|
2986
|
+
}) : this._whenReady(h);
|
|
2987
2987
|
}, ee.prototype.table = function(e) {
|
|
2988
2988
|
if (!ie(this._allTables, e))
|
|
2989
2989
|
throw new F.InvalidTable("Table ".concat(e, " does not exist"));
|
|
@@ -2993,8 +2993,8 @@ var Rr = { exports: {} };
|
|
|
2993
2993
|
var n = this;
|
|
2994
2994
|
this._middlewares = {}, this.verno = 0;
|
|
2995
2995
|
var r = ee.dependencies;
|
|
2996
|
-
this._options = t =
|
|
2997
|
-
var i, a, s, u,
|
|
2996
|
+
this._options = t = m({ addons: ee.addons, autoOpen: !0, indexedDB: r.indexedDB, IDBKeyRange: r.IDBKeyRange, cache: "cloned" }, t), this._deps = { indexedDB: t.indexedDB, IDBKeyRange: t.IDBKeyRange }, r = t.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
2997
|
+
var i, a, s, u, h, l = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: H, dbReadyPromise: null, cancelOpen: H, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
|
|
2998
2998
|
l.dbReadyPromise = new T(function(c) {
|
|
2999
2999
|
l.dbReadyResolve = c;
|
|
3000
3000
|
}), l.openCanceller = new T(function(c, f) {
|
|
@@ -3002,8 +3002,8 @@ var Rr = { exports: {} };
|
|
|
3002
3002
|
}), this._state = l, this.name = e, this.on = ft(this, "populate", "blocked", "versionchange", "close", { ready: [tn, H] }), this.on.ready.subscribe = Yn(this.on.ready.subscribe, function(c) {
|
|
3003
3003
|
return function(f, p) {
|
|
3004
3004
|
ee.vip(function() {
|
|
3005
|
-
var y,
|
|
3006
|
-
|
|
3005
|
+
var y, v = n._state;
|
|
3006
|
+
v.openComplete ? (v.dbOpenError || T.resolve().then(f), p && c(f)) : v.onReadyBeingFired ? (v.onReadyBeingFired.push(f), p && c(f)) : (c(f), y = n, p || c(function g() {
|
|
3007
3007
|
y.on.ready.unsubscribe(f), y.on.ready.unsubscribe(g);
|
|
3008
3008
|
}));
|
|
3009
3009
|
});
|
|
@@ -3017,13 +3017,13 @@ var Rr = { exports: {} };
|
|
|
3017
3017
|
} catch (S) {
|
|
3018
3018
|
y = S;
|
|
3019
3019
|
}
|
|
3020
|
-
var
|
|
3021
|
-
this._ctx = { table: g, index:
|
|
3020
|
+
var v = _._ctx, g = v.table, _ = g.hook.reading.fire;
|
|
3021
|
+
this._ctx = { table: g, index: v.index, isPrimKey: !v.index || g.schema.primKey.keyPath && v.index === g.schema.primKey.name, range: p, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: y, or: v.or, valueMapper: _ !== ot ? _ : null };
|
|
3022
3022
|
})), this.Table = (a = this, dt(lr.prototype, function(c, f, p) {
|
|
3023
3023
|
this.db = a, this._tx = p, this.name = c, this.schema = f, this.hook = a._allTables[c] ? a._allTables[c].hook : ft(null, { creating: [Vr, H], reading: [Hr, ot], updating: [Xr, H], deleting: [Qr, H] });
|
|
3024
|
-
})), this.Transaction = (s = this, dt(ai.prototype, function(c, f, p, y,
|
|
3024
|
+
})), this.Transaction = (s = this, dt(ai.prototype, function(c, f, p, y, v) {
|
|
3025
3025
|
var g = this;
|
|
3026
|
-
this.db = s, this.mode = c, this.storeNames = f, this.schema = p, this.chromeTransactionDurability = y, this.idbtrans = null, this.on = ft(this, "complete", "error", "abort"), this.parent =
|
|
3026
|
+
this.db = s, this.mode = c, this.storeNames = f, this.schema = p, this.chromeTransactionDurability = y, this.idbtrans = null, this.on = ft(this, "complete", "error", "abort"), this.parent = v || 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 T(function(_, S) {
|
|
3027
3027
|
g._resolve = _, g._reject = S;
|
|
3028
3028
|
}), this._completion.then(function() {
|
|
3029
3029
|
g.active = !1, g.on.complete.fire();
|
|
@@ -3033,14 +3033,14 @@ var Rr = { exports: {} };
|
|
|
3033
3033
|
});
|
|
3034
3034
|
})), this.Version = (u = this, dt(hi.prototype, function(c) {
|
|
3035
3035
|
this.db = u, this._cfg = { version: c, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
3036
|
-
})), this.WhereClause = (
|
|
3037
|
-
if (this.db =
|
|
3038
|
-
return $(
|
|
3039
|
-
}, this._max = function(y,
|
|
3040
|
-
return 0 < $(y,
|
|
3041
|
-
}, this._min = function(y,
|
|
3042
|
-
return $(y,
|
|
3043
|
-
}, this._IDBKeyRange =
|
|
3036
|
+
})), this.WhereClause = (h = this, dt(pr.prototype, function(c, f, p) {
|
|
3037
|
+
if (this.db = h, this._ctx = { table: c, index: f === ":id" ? null : f, or: p }, this._cmp = this._ascending = $, this._descending = function(y, v) {
|
|
3038
|
+
return $(v, y);
|
|
3039
|
+
}, this._max = function(y, v) {
|
|
3040
|
+
return 0 < $(y, v) ? y : v;
|
|
3041
|
+
}, this._min = function(y, v) {
|
|
3042
|
+
return $(y, v) < 0 ? y : v;
|
|
3043
|
+
}, this._IDBKeyRange = h._deps.IDBKeyRange, !this._IDBKeyRange)
|
|
3044
3044
|
throw new F.MissingAPI();
|
|
3045
3045
|
})), this.on("versionchange", function(c) {
|
|
3046
3046
|
0 < c.newVersion ? console.warn("Another connection wants to upgrade database '".concat(n.name, "'. Closing db now to resume the upgrade.")) : console.warn("Another connection wants to delete database '".concat(n.name, "'. Closing db now to resume the delete request.")), n.close({ disableAutoOpen: !1 });
|
|
@@ -3055,21 +3055,21 @@ var Rr = { exports: {} };
|
|
|
3055
3055
|
return f.on("versionchange").fire(c);
|
|
3056
3056
|
});
|
|
3057
3057
|
}, this.use(mi), this.use(_i), this.use(bi), this.use(gi), this.use(yi);
|
|
3058
|
-
var
|
|
3058
|
+
var b = new Proxy(this, { get: function(c, f, p) {
|
|
3059
3059
|
if (f === "_vip")
|
|
3060
3060
|
return !0;
|
|
3061
3061
|
if (f === "table")
|
|
3062
|
-
return function(
|
|
3063
|
-
return Yt(n.table(
|
|
3062
|
+
return function(v) {
|
|
3063
|
+
return Yt(n.table(v), b);
|
|
3064
3064
|
};
|
|
3065
3065
|
var y = Reflect.get(c, f, p);
|
|
3066
|
-
return y instanceof lr ? Yt(y,
|
|
3067
|
-
return Yt(
|
|
3066
|
+
return y instanceof lr ? Yt(y, b) : f === "tables" ? y.map(function(v) {
|
|
3067
|
+
return Yt(v, b);
|
|
3068
3068
|
}) : f === "_createTransaction" ? function() {
|
|
3069
|
-
return Yt(y.apply(this, arguments),
|
|
3069
|
+
return Yt(y.apply(this, arguments), b);
|
|
3070
3070
|
} : y;
|
|
3071
3071
|
} });
|
|
3072
|
-
this.vip =
|
|
3072
|
+
this.vip = b, r.forEach(function(c) {
|
|
3073
3073
|
return c(n);
|
|
3074
3074
|
});
|
|
3075
3075
|
}
|
|
@@ -3082,25 +3082,25 @@ var Rr = { exports: {} };
|
|
|
3082
3082
|
this._subscribe = e;
|
|
3083
3083
|
}
|
|
3084
3084
|
try {
|
|
3085
|
-
Ht = { indexedDB:
|
|
3085
|
+
Ht = { indexedDB: K.indexedDB || K.mozIndexedDB || K.webkitIndexedDB || K.msIndexedDB, IDBKeyRange: K.IDBKeyRange || K.webkitIDBKeyRange };
|
|
3086
3086
|
} catch {
|
|
3087
3087
|
Ht = { indexedDB: null, IDBKeyRange: null };
|
|
3088
3088
|
}
|
|
3089
3089
|
function Dr(e) {
|
|
3090
3090
|
var t, n = !1, r = new Si(function(i) {
|
|
3091
|
-
var a = qt(e), s, u = !1,
|
|
3091
|
+
var a = qt(e), s, u = !1, h = {}, l = {}, b = { get closed() {
|
|
3092
3092
|
return u;
|
|
3093
3093
|
}, unsubscribe: function() {
|
|
3094
3094
|
u || (u = !0, s && s.abort(), c && Te.storagemutated.unsubscribe(p));
|
|
3095
3095
|
} };
|
|
3096
|
-
i.start && i.start(
|
|
3096
|
+
i.start && i.start(b);
|
|
3097
3097
|
var c = !1, f = function() {
|
|
3098
3098
|
return ln(y);
|
|
3099
|
-
}, p = function(
|
|
3100
|
-
Wt(
|
|
3099
|
+
}, p = function(v) {
|
|
3100
|
+
Wt(h, v), Dn(l, h) && f();
|
|
3101
3101
|
}, y = function() {
|
|
3102
|
-
var
|
|
3103
|
-
!u && Ht.indexedDB && (
|
|
3102
|
+
var v, g, _;
|
|
3103
|
+
!u && Ht.indexedDB && (h = {}, v = {}, s && s.abort(), s = new AbortController(), _ = function(S) {
|
|
3104
3104
|
var E = Qe();
|
|
3105
3105
|
try {
|
|
3106
3106
|
a && Je();
|
|
@@ -3109,13 +3109,13 @@ var Rr = { exports: {} };
|
|
|
3109
3109
|
} finally {
|
|
3110
3110
|
E && Xe();
|
|
3111
3111
|
}
|
|
3112
|
-
}(g = { subscr:
|
|
3113
|
-
n = !0, t = S, u || g.signal.aborted || (
|
|
3112
|
+
}(g = { subscr: v, signal: s.signal, requery: f, querier: e, trans: null }), Promise.resolve(_).then(function(S) {
|
|
3113
|
+
n = !0, t = S, u || g.signal.aborted || (h = {}, function(E) {
|
|
3114
3114
|
for (var O in E)
|
|
3115
3115
|
if (ie(E, O))
|
|
3116
3116
|
return;
|
|
3117
3117
|
return 1;
|
|
3118
|
-
}(l =
|
|
3118
|
+
}(l = v) || c || (Te(pt, p), c = !0), ln(function() {
|
|
3119
3119
|
return !u && i.next && i.next(S);
|
|
3120
3120
|
}));
|
|
3121
3121
|
}, function(S) {
|
|
@@ -3124,7 +3124,7 @@ var Rr = { exports: {} };
|
|
|
3124
3124
|
});
|
|
3125
3125
|
}));
|
|
3126
3126
|
};
|
|
3127
|
-
return setTimeout(f, 0),
|
|
3127
|
+
return setTimeout(f, 0), b;
|
|
3128
3128
|
});
|
|
3129
3129
|
return r.hasValue = function() {
|
|
3130
3130
|
return n;
|
|
@@ -3141,7 +3141,7 @@ var Rr = { exports: {} };
|
|
|
3141
3141
|
je = t;
|
|
3142
3142
|
}
|
|
3143
3143
|
}
|
|
3144
|
-
xe(We,
|
|
3144
|
+
xe(We, m(m({}, St), { delete: function(e) {
|
|
3145
3145
|
return new We(e, { addons: [] }).delete();
|
|
3146
3146
|
}, exists: function(e) {
|
|
3147
3147
|
return new We(e, { addons: [] }).open().then(function(t) {
|
|
@@ -3225,7 +3225,7 @@ var Rr = { exports: {} };
|
|
|
3225
3225
|
return !e || e instanceof He || e instanceof TypeError || e instanceof SyntaxError || !e.name || !Zn[e.name] ? e : (t = new Zn[e.name](t || e.message, e), "stack" in e && ke(t, "stack", { get: function() {
|
|
3226
3226
|
return this.inner.stack;
|
|
3227
3227
|
} }), t);
|
|
3228
|
-
}, qn(pe),
|
|
3228
|
+
}, qn(pe), m(Se, Object.freeze({ __proto__: null, Dexie: Se, liveQuery: Dr, Entity: sr, cmp: $, default: Se, RangeSet: oe, mergeRanges: bt, rangesOverlap: Ut }), { default: Se }), Se;
|
|
3229
3229
|
});
|
|
3230
3230
|
})(Rr);
|
|
3231
3231
|
var Di = Rr.exports;
|
|
@@ -3239,17 +3239,17 @@ function X(w) {
|
|
|
3239
3239
|
function nt(w) {
|
|
3240
3240
|
var o;
|
|
3241
3241
|
if (w.widget === void 0) {
|
|
3242
|
-
const
|
|
3243
|
-
|
|
3242
|
+
const d = (o = w.topics) == null ? void 0 : o.split("-");
|
|
3243
|
+
d && d.length > 1 ? (w.dashboard = d ? d[0] : "", w.widget = d ? d[1] : "") : (w.widget = w.topics, w.dashboard = w.slide);
|
|
3244
3244
|
}
|
|
3245
3245
|
return w.topics === void 0 && (w.topics = `${w.dashboard}-${w.widget}`), w;
|
|
3246
3246
|
}
|
|
3247
3247
|
function vt(w, o) {
|
|
3248
3248
|
var N;
|
|
3249
|
-
let
|
|
3249
|
+
let d, m, A, K, j;
|
|
3250
3250
|
switch (w.moderation) {
|
|
3251
3251
|
case Xt.BEFORE:
|
|
3252
|
-
|
|
3252
|
+
d = /* @__PURE__ */ new Date(), m = (N = w.beforeTime) == null ? void 0 : N.split(":"), A = Number.parseInt(m ? m[0] : "00"), K = Number.parseInt(m ? m[1] : "00"), j = Number.parseInt(m ? m[2] : "00"), o.before = d.setHours(A, K, j, 0) / 1e3, o.period || (o.period = d.getDay() === 1 ? 72 : 24);
|
|
3253
3253
|
break;
|
|
3254
3254
|
case Xt.DELAYED:
|
|
3255
3255
|
w.delay && w.delay > 0 && (o.delay = `${w.delay}`);
|
|
@@ -3264,16 +3264,16 @@ function vt(w, o) {
|
|
|
3264
3264
|
}
|
|
3265
3265
|
class Tr {
|
|
3266
3266
|
constructor(o) {
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3267
|
+
I(this, "db");
|
|
3268
|
+
I(this, "subscribers", []);
|
|
3269
|
+
I(this, "options");
|
|
3270
3270
|
/**
|
|
3271
3271
|
* Retrieve Cloud Data
|
|
3272
3272
|
* @param query IQuery
|
|
3273
3273
|
* @returns IResponse
|
|
3274
3274
|
*/
|
|
3275
|
-
|
|
3276
|
-
const
|
|
3275
|
+
I(this, "getCloud", async (o) => {
|
|
3276
|
+
const d = await this.db.table(B.CLOUD).where({ id: o.widget }).last().catch(() => (console.warn(
|
|
3277
3277
|
"%capi%C %ccloud",
|
|
3278
3278
|
x.API,
|
|
3279
3279
|
x.NONE,
|
|
@@ -3281,15 +3281,15 @@ class Tr {
|
|
|
3281
3281
|
o.slide,
|
|
3282
3282
|
o.widget
|
|
3283
3283
|
), { data: null, message: "Series Data error", success: !1 }));
|
|
3284
|
-
return
|
|
3284
|
+
return d.data.presentation = (o == null ? void 0 : o.presentation) || "not set", d.data.slide = (o == null ? void 0 : o.slide) || "not set", d.message = "Messages retrieved successfully", d.success = !0, d;
|
|
3285
3285
|
});
|
|
3286
3286
|
/**
|
|
3287
3287
|
* Retrieve Cloud Data
|
|
3288
3288
|
* @param query IQuery
|
|
3289
3289
|
* @returns IResponse
|
|
3290
3290
|
*/
|
|
3291
|
-
|
|
3292
|
-
const
|
|
3291
|
+
I(this, "getSeries", async (o) => {
|
|
3292
|
+
const d = await this.db.table(B.SERIES).where({ id: o.widget }).last().catch(() => (console.warn(
|
|
3293
3293
|
"%capi%c %cseries",
|
|
3294
3294
|
x.API,
|
|
3295
3295
|
x.NONE,
|
|
@@ -3297,24 +3297,24 @@ class Tr {
|
|
|
3297
3297
|
o.slide,
|
|
3298
3298
|
o.widget
|
|
3299
3299
|
), { data: null, message: "Series Data error", success: !1 }));
|
|
3300
|
-
return
|
|
3300
|
+
return d.data.presentation = (o == null ? void 0 : o.presentation) || "not set", d.data.slide = (o == null ? void 0 : o.slide) || "not set", d.message = "Messages retrieved successfully", d.success = !0, d;
|
|
3301
3301
|
});
|
|
3302
3302
|
/**
|
|
3303
3303
|
* Retrieve Cloud Data
|
|
3304
3304
|
* @param query IQuery
|
|
3305
3305
|
* @returns IResponse
|
|
3306
3306
|
*/
|
|
3307
|
-
|
|
3308
|
-
const
|
|
3307
|
+
I(this, "getMessages", async (o) => {
|
|
3308
|
+
const d = (K) => K.widget_id === o.widget, m = (K) => K.utc > ((o == null ? void 0 : o.since) || 0), A = (K) => (K == null ? void 0 : K.visible) !== 0;
|
|
3309
3309
|
try {
|
|
3310
|
-
const
|
|
3310
|
+
const K = await this.db.table(B.TOPICS).orderBy("utc").reverse().filter(d).filter(m).filter(A).limit((o == null ? void 0 : o.limit) ?? 25).toArray().catch(() => (console.warn(
|
|
3311
3311
|
"%capi%c %cmessages",
|
|
3312
3312
|
x.API,
|
|
3313
3313
|
x.NONE,
|
|
3314
3314
|
x.MESSAGES,
|
|
3315
3315
|
o.slide,
|
|
3316
3316
|
o.widget
|
|
3317
|
-
), { data: null, message: "Messages Data error", success: !1 })),
|
|
3317
|
+
), { data: null, message: "Messages Data error", success: !1 })), j = K[0] ? K[0].title : "No title", N = K.map(
|
|
3318
3318
|
(be) => be.message_id
|
|
3319
3319
|
), te = (await this.db.table(B.MESSAGES).where("id").anyOf(N).toArray().then((be) => be.sort((ie, xe) => xe.utc - ie.utc))).map(
|
|
3320
3320
|
(be) => be.data
|
|
@@ -3324,7 +3324,7 @@ class Tr {
|
|
|
3324
3324
|
presentation: (o == null ? void 0 : o.presentation) || "not set",
|
|
3325
3325
|
slide: (o == null ? void 0 : o.slide) || "not set",
|
|
3326
3326
|
messages: te,
|
|
3327
|
-
title:
|
|
3327
|
+
title: j,
|
|
3328
3328
|
topics: [o.dashboard, o.widget].join("-"),
|
|
3329
3329
|
query: o
|
|
3330
3330
|
},
|
|
@@ -3341,22 +3341,22 @@ class Tr {
|
|
|
3341
3341
|
* @param data
|
|
3342
3342
|
* @returns number
|
|
3343
3343
|
*/
|
|
3344
|
-
|
|
3344
|
+
I(this, "setCloud", async (o, d) => o.type === B.CLOUD && d !== "" ? await this.db.table(B.CLOUD).put({
|
|
3345
3345
|
id: o.widget,
|
|
3346
3346
|
dashboard_id: o.dashboard,
|
|
3347
|
-
data:
|
|
3348
|
-
}).then(() => 201).catch((
|
|
3347
|
+
data: d.data
|
|
3348
|
+
}).then(() => 201).catch((m) => (console.error("%cstorage", x.STORAGE, "set", o, m), 400)) : 400);
|
|
3349
3349
|
/**
|
|
3350
3350
|
* Update Series
|
|
3351
3351
|
* @param query IQuery
|
|
3352
3352
|
* @param data
|
|
3353
3353
|
* @returns number
|
|
3354
3354
|
*/
|
|
3355
|
-
|
|
3355
|
+
I(this, "setSeries", async (o, d) => o.type === B.SERIES && d !== "" ? await this.db.table(B.SERIES).put({
|
|
3356
3356
|
id: o.widget,
|
|
3357
3357
|
dashboard_id: o.dashboard,
|
|
3358
|
-
data:
|
|
3359
|
-
}).then(() => 201).catch((
|
|
3358
|
+
data: d.data
|
|
3359
|
+
}).then(() => 201).catch((m) => (console.error("%cstorage", x.STORAGE, "set", o, m), 400)) : 400);
|
|
3360
3360
|
/**
|
|
3361
3361
|
* Update Messages
|
|
3362
3362
|
* @param query IQuery
|
|
@@ -3366,37 +3366,37 @@ class Tr {
|
|
|
3366
3366
|
* @param data.data.messages IMessages
|
|
3367
3367
|
* @returns number
|
|
3368
3368
|
*/
|
|
3369
|
-
|
|
3369
|
+
I(this, "setMessages", async (o, d) => {
|
|
3370
3370
|
if (o.type !== B.MESSAGES)
|
|
3371
3371
|
return 400;
|
|
3372
|
-
const
|
|
3372
|
+
const m = d.title;
|
|
3373
3373
|
try {
|
|
3374
|
-
return
|
|
3375
|
-
var
|
|
3376
|
-
await this.db.table(B.MESSAGES).put({ id:
|
|
3374
|
+
return d.data.messages.forEach(async (A) => {
|
|
3375
|
+
var K, j, N;
|
|
3376
|
+
await this.db.table(B.MESSAGES).put({ id: A.id, utc: A.utc, data: A }), await this.db.table(B.TOPICS).put({
|
|
3377
3377
|
widget_id: o.widget,
|
|
3378
|
-
message_id:
|
|
3378
|
+
message_id: A.id,
|
|
3379
3379
|
dashboard_id: o.dashboard,
|
|
3380
|
-
title:
|
|
3381
|
-
engagement: (
|
|
3382
|
-
impressions: (
|
|
3383
|
-
reach: (N =
|
|
3384
|
-
sentiment:
|
|
3385
|
-
utc:
|
|
3380
|
+
title: m,
|
|
3381
|
+
engagement: (K = A.dynamics) == null ? void 0 : K.engagement,
|
|
3382
|
+
impressions: (j = A.dynamics) == null ? void 0 : j.semrush_visits,
|
|
3383
|
+
reach: (N = A.dynamics) == null ? void 0 : N.potential_reach,
|
|
3384
|
+
sentiment: A.topics[0].sentiment,
|
|
3385
|
+
utc: A.utc
|
|
3386
3386
|
});
|
|
3387
3387
|
}), 201;
|
|
3388
|
-
} catch (
|
|
3389
|
-
return console.error("%cstorage", x.STORAGE, "set", o,
|
|
3388
|
+
} catch (A) {
|
|
3389
|
+
return console.error("%cstorage", x.STORAGE, "set", o, A), 400;
|
|
3390
3390
|
}
|
|
3391
3391
|
});
|
|
3392
3392
|
/**
|
|
3393
3393
|
* Wipe Message data after number of seconds
|
|
3394
3394
|
* @param retentionDuration
|
|
3395
3395
|
*/
|
|
3396
|
-
|
|
3397
|
-
const
|
|
3398
|
-
await this.db.table("topics").orderBy("utc").filter(
|
|
3399
|
-
delete
|
|
3396
|
+
I(this, "cleanMessages", async (o) => {
|
|
3397
|
+
const d = Date.now() / 1e3, m = (A) => A.utc < o - d;
|
|
3398
|
+
await this.db.table("topics").orderBy("utc").filter(m).modify((A, K) => {
|
|
3399
|
+
delete K.value;
|
|
3400
3400
|
});
|
|
3401
3401
|
});
|
|
3402
3402
|
/**
|
|
@@ -3404,18 +3404,18 @@ class Tr {
|
|
|
3404
3404
|
* @param query IQuery
|
|
3405
3405
|
* @returns number
|
|
3406
3406
|
*/
|
|
3407
|
-
|
|
3407
|
+
I(this, "setWidget", async (o) => await this.db.table(B.WIDGETS).put({
|
|
3408
3408
|
id: o.widget,
|
|
3409
3409
|
dashboard_id: o.dashboard,
|
|
3410
3410
|
type: o.type
|
|
3411
|
-
}).then(() => 201).catch((
|
|
3411
|
+
}).then(() => 201).catch((d) => (console.error("%cstorage", x.STORAGE, B.WIDGET, o, d), 400)));
|
|
3412
3412
|
/**
|
|
3413
3413
|
* Add component subscriber
|
|
3414
3414
|
* @param query IQuery
|
|
3415
3415
|
* @returns null
|
|
3416
3416
|
*/
|
|
3417
|
-
|
|
3418
|
-
(
|
|
3417
|
+
I(this, "subscribe", (o) => (o = nt(o), this.subscribers.filter(
|
|
3418
|
+
(m) => m.widget === o.widget
|
|
3419
3419
|
).length > 0 || (o.type === B.MESSAGES && (o = vt(this.options, o)), console.debug(
|
|
3420
3420
|
"%cstorage%c %csubscribe",
|
|
3421
3421
|
x.STORAGE,
|
|
@@ -3428,7 +3428,7 @@ class Tr {
|
|
|
3428
3428
|
* Get current subscribers
|
|
3429
3429
|
* @returns IQuery[]
|
|
3430
3430
|
*/
|
|
3431
|
-
|
|
3431
|
+
I(this, "getSubscribers", async () => await new Promise((o) => o(this.subscribers)));
|
|
3432
3432
|
this.options = o, this.db = new Wn(o.app), this.db.version(2).stores({
|
|
3433
3433
|
player: "id,title,name,location",
|
|
3434
3434
|
monitor: "id,player_id,cols,rows,order,width,height,physicalwidth,physicalheight,devicePixelRatio,screenLeft,screenTop,orientation,monitor",
|
|
@@ -3444,41 +3444,41 @@ class Tr {
|
|
|
3444
3444
|
}
|
|
3445
3445
|
}
|
|
3446
3446
|
function zn(w) {
|
|
3447
|
-
return new Promise((o,
|
|
3448
|
-
w.oncomplete = w.onsuccess = () => o(w.result), w.onabort = w.onerror = () =>
|
|
3447
|
+
return new Promise((o, d) => {
|
|
3448
|
+
w.oncomplete = w.onsuccess = () => o(w.result), w.onabort = w.onerror = () => d(w.error);
|
|
3449
3449
|
});
|
|
3450
3450
|
}
|
|
3451
3451
|
function Pi(w, o) {
|
|
3452
|
-
const
|
|
3453
|
-
|
|
3454
|
-
const
|
|
3455
|
-
return (
|
|
3452
|
+
const d = indexedDB.open(w);
|
|
3453
|
+
d.onupgradeneeded = () => d.result.createObjectStore(o);
|
|
3454
|
+
const m = zn(d);
|
|
3455
|
+
return (A, K) => m.then((j) => K(j.transaction(o, A).objectStore(o)));
|
|
3456
3456
|
}
|
|
3457
3457
|
let Gn;
|
|
3458
3458
|
function jr() {
|
|
3459
3459
|
return Gn || (Gn = Pi("keyval-store", "keyval")), Gn;
|
|
3460
3460
|
}
|
|
3461
3461
|
function Fn(w, o = jr()) {
|
|
3462
|
-
return o("readonly", (
|
|
3462
|
+
return o("readonly", (d) => zn(d.get(w)));
|
|
3463
3463
|
}
|
|
3464
|
-
function Qt(w, o,
|
|
3465
|
-
return
|
|
3464
|
+
function Qt(w, o, d = jr()) {
|
|
3465
|
+
return d("readwrite", (m) => (m.put(o, w), zn(m.transaction)));
|
|
3466
3466
|
}
|
|
3467
3467
|
class Kr {
|
|
3468
3468
|
constructor(o) {
|
|
3469
|
-
|
|
3470
|
-
|
|
3471
|
-
|
|
3472
|
-
const
|
|
3473
|
-
return await Fn(
|
|
3469
|
+
I(this, "subscribers", []);
|
|
3470
|
+
I(this, "options");
|
|
3471
|
+
I(this, "getCloud", async (o) => {
|
|
3472
|
+
const d = X(o);
|
|
3473
|
+
return await Fn(d).then((m) => m).catch(() => (console.warn("%capi", x.API, B.CLOUD, o.slide, o.widget), { data: null, message: "Cloud Data error", success: !1 }));
|
|
3474
3474
|
});
|
|
3475
|
-
|
|
3476
|
-
const
|
|
3477
|
-
return await Fn(
|
|
3475
|
+
I(this, "getSeries", async (o) => {
|
|
3476
|
+
const d = X(o);
|
|
3477
|
+
return await Fn(d).then((m) => m).catch(() => (console.warn("%capi", x.API, B.SERIES, o.slide, o.widget), { data: null, message: "Series Data error", success: !1 }));
|
|
3478
3478
|
});
|
|
3479
|
-
|
|
3480
|
-
const
|
|
3481
|
-
return await Fn(
|
|
3479
|
+
I(this, "getMessages", async (o) => {
|
|
3480
|
+
const d = X(o);
|
|
3481
|
+
return await Fn(d).then((m) => m).catch(() => (console.warn("%capi", x.API, B.MESSAGES, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 }));
|
|
3482
3482
|
});
|
|
3483
3483
|
/**
|
|
3484
3484
|
* Update Cloud
|
|
@@ -3486,11 +3486,11 @@ class Kr {
|
|
|
3486
3486
|
* @param data
|
|
3487
3487
|
* @returns number
|
|
3488
3488
|
*/
|
|
3489
|
-
|
|
3490
|
-
if (!
|
|
3489
|
+
I(this, "setCloud", async (o, d) => {
|
|
3490
|
+
if (!d.success)
|
|
3491
3491
|
return 400;
|
|
3492
|
-
const
|
|
3493
|
-
return delete
|
|
3492
|
+
const m = X(o);
|
|
3493
|
+
return delete d.success, delete d.message, await Qt(m, d).then(() => 201).catch((A) => (console.error("%cstorage", x.STORAGE, B.CLOUD, o, A), 400));
|
|
3494
3494
|
});
|
|
3495
3495
|
/**
|
|
3496
3496
|
* Update Series
|
|
@@ -3498,11 +3498,11 @@ class Kr {
|
|
|
3498
3498
|
* @param data
|
|
3499
3499
|
* @returns bumber
|
|
3500
3500
|
*/
|
|
3501
|
-
|
|
3502
|
-
if (!
|
|
3501
|
+
I(this, "setSeries", async (o, d) => {
|
|
3502
|
+
if (!d.success)
|
|
3503
3503
|
return 400;
|
|
3504
|
-
const
|
|
3505
|
-
return delete
|
|
3504
|
+
const m = X(o);
|
|
3505
|
+
return delete d.success, delete d.message, await Qt(m, d).then(() => 201).catch((A) => (console.error("%cstorage", x.STORAGE, B.SERIES, o, A), 400));
|
|
3506
3506
|
});
|
|
3507
3507
|
/**
|
|
3508
3508
|
* Update Messages
|
|
@@ -3510,33 +3510,33 @@ class Kr {
|
|
|
3510
3510
|
* @param data
|
|
3511
3511
|
* @returns number
|
|
3512
3512
|
*/
|
|
3513
|
-
|
|
3514
|
-
if (!
|
|
3513
|
+
I(this, "setMessages", async (o, d) => {
|
|
3514
|
+
if (!d.success)
|
|
3515
3515
|
return 400;
|
|
3516
|
-
const
|
|
3517
|
-
return delete
|
|
3516
|
+
const m = X(o);
|
|
3517
|
+
return delete d.success, delete d.message, await Qt(m, d).then(() => 201).catch((A) => (console.error("%cstorage", x.STORAGE, B.MESSAGES, o, A), 400));
|
|
3518
3518
|
});
|
|
3519
|
-
|
|
3519
|
+
I(this, "cleanMessages", async (o) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((d) => d())));
|
|
3520
3520
|
/**
|
|
3521
3521
|
* Update Cloud
|
|
3522
3522
|
* @param query IQuery
|
|
3523
3523
|
* @returns number
|
|
3524
3524
|
*/
|
|
3525
|
-
|
|
3526
|
-
const
|
|
3525
|
+
I(this, "setWidget", async (o) => {
|
|
3526
|
+
const d = X(o), m = {
|
|
3527
3527
|
id: o.widget,
|
|
3528
3528
|
dashboard_id: o.dashboard,
|
|
3529
3529
|
type: o.type
|
|
3530
3530
|
};
|
|
3531
|
-
return await Qt(
|
|
3531
|
+
return await Qt(d, m).then(() => 201).catch((A) => (console.error("%cstorage", x.STORAGE, B.WIDGET, o, A), 400));
|
|
3532
3532
|
});
|
|
3533
3533
|
/**
|
|
3534
3534
|
* Add component subscriber
|
|
3535
3535
|
* @param query IQuery
|
|
3536
3536
|
* @returns null
|
|
3537
3537
|
*/
|
|
3538
|
-
|
|
3539
|
-
(
|
|
3538
|
+
I(this, "subscribe", (o) => (o = nt(o), o.type === B.MESSAGES && (o = vt(this.options, o)), this.subscribers.filter(
|
|
3539
|
+
(m) => m.widget === o.widget
|
|
3540
3540
|
).length > 0 || (console.debug(
|
|
3541
3541
|
"%cstorage%c %csubscribe",
|
|
3542
3542
|
x.STORAGE,
|
|
@@ -3549,34 +3549,34 @@ class Kr {
|
|
|
3549
3549
|
* Get current subscribers
|
|
3550
3550
|
* @returns IQuery[]
|
|
3551
3551
|
*/
|
|
3552
|
-
|
|
3552
|
+
I(this, "getSubscribers", async () => await new Promise((o) => o(this.subscribers)));
|
|
3553
3553
|
this.options = o;
|
|
3554
3554
|
}
|
|
3555
3555
|
}
|
|
3556
3556
|
class Mr {
|
|
3557
3557
|
constructor(o) {
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
const
|
|
3558
|
+
I(this, "subscribers", []);
|
|
3559
|
+
I(this, "options");
|
|
3560
|
+
I(this, "getCloud", async (o) => {
|
|
3561
|
+
const d = X(o);
|
|
3562
3562
|
try {
|
|
3563
|
-
return localStorage.getObject(
|
|
3563
|
+
return localStorage.getObject(d);
|
|
3564
3564
|
} catch {
|
|
3565
3565
|
return console.warn("%capi", x.API, B.CLOUD, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3566
3566
|
}
|
|
3567
3567
|
});
|
|
3568
|
-
|
|
3569
|
-
const
|
|
3568
|
+
I(this, "getSeries", async (o) => {
|
|
3569
|
+
const d = X(o);
|
|
3570
3570
|
try {
|
|
3571
|
-
return localStorage.getObject(
|
|
3571
|
+
return localStorage.getObject(d);
|
|
3572
3572
|
} catch {
|
|
3573
3573
|
return console.warn("%capi", x.API, B.SERIES, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3574
3574
|
}
|
|
3575
3575
|
});
|
|
3576
|
-
|
|
3577
|
-
const
|
|
3576
|
+
I(this, "getMessages", async (o) => {
|
|
3577
|
+
const d = X(o);
|
|
3578
3578
|
try {
|
|
3579
|
-
return localStorage.getObject(
|
|
3579
|
+
return localStorage.getObject(d);
|
|
3580
3580
|
} catch {
|
|
3581
3581
|
return console.warn("%capi", x.API, B.MESSAGES, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3582
3582
|
}
|
|
@@ -3587,12 +3587,12 @@ class Mr {
|
|
|
3587
3587
|
* @param data
|
|
3588
3588
|
* @returns number
|
|
3589
3589
|
*/
|
|
3590
|
-
|
|
3591
|
-
const
|
|
3590
|
+
I(this, "setCloud", async (o, d) => {
|
|
3591
|
+
const m = X(o);
|
|
3592
3592
|
try {
|
|
3593
|
-
return localStorage.setObject(
|
|
3594
|
-
} catch (
|
|
3595
|
-
return console.error("%cstorage", x.STORAGE, B.CLOUD, o,
|
|
3593
|
+
return localStorage.setObject(m, d), 201;
|
|
3594
|
+
} catch (A) {
|
|
3595
|
+
return console.error("%cstorage", x.STORAGE, B.CLOUD, o, A), 400;
|
|
3596
3596
|
}
|
|
3597
3597
|
});
|
|
3598
3598
|
/**
|
|
@@ -3601,12 +3601,12 @@ class Mr {
|
|
|
3601
3601
|
* @param data
|
|
3602
3602
|
* @returns number
|
|
3603
3603
|
*/
|
|
3604
|
-
|
|
3605
|
-
const
|
|
3604
|
+
I(this, "setSeries", async (o, d) => {
|
|
3605
|
+
const m = X(o);
|
|
3606
3606
|
try {
|
|
3607
|
-
return localStorage.setObject(
|
|
3608
|
-
} catch (
|
|
3609
|
-
return console.error("%cstorage", x.STORAGE, B.SERIES, o,
|
|
3607
|
+
return localStorage.setObject(m, d), 201;
|
|
3608
|
+
} catch (A) {
|
|
3609
|
+
return console.error("%cstorage", x.STORAGE, B.SERIES, o, A), 400;
|
|
3610
3610
|
}
|
|
3611
3611
|
});
|
|
3612
3612
|
/**
|
|
@@ -3615,23 +3615,23 @@ class Mr {
|
|
|
3615
3615
|
* @param data
|
|
3616
3616
|
* @returns number
|
|
3617
3617
|
*/
|
|
3618
|
-
|
|
3619
|
-
const
|
|
3618
|
+
I(this, "setMessages", async (o, d) => {
|
|
3619
|
+
const m = X(o);
|
|
3620
3620
|
try {
|
|
3621
|
-
return localStorage.setObject(
|
|
3622
|
-
} catch (
|
|
3623
|
-
return console.error("%cstorage", x.STORAGE, B.MESSAGES, o,
|
|
3621
|
+
return localStorage.setObject(m, d), 200;
|
|
3622
|
+
} catch (A) {
|
|
3623
|
+
return console.error("%cstorage", x.STORAGE, B.MESSAGES, o, A), 400;
|
|
3624
3624
|
}
|
|
3625
3625
|
});
|
|
3626
|
-
|
|
3626
|
+
I(this, "cleanMessages", async (o) => {
|
|
3627
3627
|
console.log("cleanMessages not implemented for ", this.options.storage);
|
|
3628
3628
|
});
|
|
3629
|
-
|
|
3630
|
-
const
|
|
3629
|
+
I(this, "setWidget", async (o) => {
|
|
3630
|
+
const d = `widget.${o.widget}`;
|
|
3631
3631
|
try {
|
|
3632
|
-
return localStorage.setObject(
|
|
3633
|
-
} catch (
|
|
3634
|
-
return console.error("%cstorage", x.STORAGE, B.WIDGET, o,
|
|
3632
|
+
return localStorage.setObject(d, o), 201;
|
|
3633
|
+
} catch (m) {
|
|
3634
|
+
return console.error("%cstorage", x.STORAGE, B.WIDGET, o, m), 400;
|
|
3635
3635
|
}
|
|
3636
3636
|
});
|
|
3637
3637
|
/**
|
|
@@ -3639,8 +3639,8 @@ class Mr {
|
|
|
3639
3639
|
* @param query IQuery
|
|
3640
3640
|
* @returns null
|
|
3641
3641
|
*/
|
|
3642
|
-
|
|
3643
|
-
(
|
|
3642
|
+
I(this, "subscribe", (o) => (o = nt(o), o.type === B.MESSAGES && (o = vt(this.options, o)), this.subscribers.filter(
|
|
3643
|
+
(m) => m.widget === o.widget
|
|
3644
3644
|
).length || (console.debug(
|
|
3645
3645
|
"%cstorage%c %csubscribe",
|
|
3646
3646
|
x.STORAGE,
|
|
@@ -3653,39 +3653,39 @@ class Mr {
|
|
|
3653
3653
|
* Get current subscribers
|
|
3654
3654
|
* @returns IQuery[]
|
|
3655
3655
|
*/
|
|
3656
|
-
|
|
3657
|
-
this.options = o, Storage.prototype.setObject = function(
|
|
3658
|
-
this.setObject(
|
|
3659
|
-
}, Storage.prototype.getObject = function(
|
|
3660
|
-
const
|
|
3661
|
-
return
|
|
3656
|
+
I(this, "getSubscribers", async () => await new Promise((o) => o(this.subscribers)));
|
|
3657
|
+
this.options = o, Storage.prototype.setObject = function(d, m) {
|
|
3658
|
+
this.setObject(d, JSON.stringify(m));
|
|
3659
|
+
}, Storage.prototype.getObject = function(d) {
|
|
3660
|
+
const m = this.getObject(d);
|
|
3661
|
+
return m && JSON.parse(m);
|
|
3662
3662
|
};
|
|
3663
3663
|
}
|
|
3664
3664
|
}
|
|
3665
3665
|
class Br {
|
|
3666
3666
|
constructor(o) {
|
|
3667
|
-
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
const
|
|
3667
|
+
I(this, "subscribers", []);
|
|
3668
|
+
I(this, "options");
|
|
3669
|
+
I(this, "getCloud", async (o) => {
|
|
3670
|
+
const d = X(o);
|
|
3671
3671
|
try {
|
|
3672
|
-
return sessionStorage.getObject(
|
|
3672
|
+
return sessionStorage.getObject(d);
|
|
3673
3673
|
} catch {
|
|
3674
3674
|
return console.warn("%capi", x.API, B.CLOUD, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3675
3675
|
}
|
|
3676
3676
|
});
|
|
3677
|
-
|
|
3678
|
-
const
|
|
3677
|
+
I(this, "getSeries", async (o) => {
|
|
3678
|
+
const d = X(o);
|
|
3679
3679
|
try {
|
|
3680
|
-
return sessionStorage.getObject(
|
|
3680
|
+
return sessionStorage.getObject(d);
|
|
3681
3681
|
} catch {
|
|
3682
3682
|
return console.warn("%capi", x.API, B.SERIES, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3683
3683
|
}
|
|
3684
3684
|
});
|
|
3685
|
-
|
|
3686
|
-
const
|
|
3685
|
+
I(this, "getMessages", async (o) => {
|
|
3686
|
+
const d = X(o);
|
|
3687
3687
|
try {
|
|
3688
|
-
return sessionStorage.getObject(
|
|
3688
|
+
return sessionStorage.getObject(d);
|
|
3689
3689
|
} catch {
|
|
3690
3690
|
return console.warn("%capi", x.API, B.MESSAGES, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3691
3691
|
}
|
|
@@ -3696,12 +3696,12 @@ class Br {
|
|
|
3696
3696
|
* @param data
|
|
3697
3697
|
* @returns number
|
|
3698
3698
|
*/
|
|
3699
|
-
|
|
3700
|
-
const
|
|
3699
|
+
I(this, "setCloud", async (o, d) => {
|
|
3700
|
+
const m = X(o);
|
|
3701
3701
|
try {
|
|
3702
|
-
return sessionStorage.setObject(
|
|
3703
|
-
} catch (
|
|
3704
|
-
return console.error("%cstorage", x.STORAGE, B.CLOUD, o,
|
|
3702
|
+
return sessionStorage.setObject(m, d), 201;
|
|
3703
|
+
} catch (A) {
|
|
3704
|
+
return console.error("%cstorage", x.STORAGE, B.CLOUD, o, A), 400;
|
|
3705
3705
|
}
|
|
3706
3706
|
});
|
|
3707
3707
|
/**
|
|
@@ -3710,12 +3710,12 @@ class Br {
|
|
|
3710
3710
|
* @param data
|
|
3711
3711
|
* @returns number
|
|
3712
3712
|
*/
|
|
3713
|
-
|
|
3714
|
-
const
|
|
3713
|
+
I(this, "setSeries", async (o, d) => {
|
|
3714
|
+
const m = X(o);
|
|
3715
3715
|
try {
|
|
3716
|
-
return sessionStorage.setObject(
|
|
3717
|
-
} catch (
|
|
3718
|
-
return console.error("%cstorage", x.STORAGE, B.SERIES, o,
|
|
3716
|
+
return sessionStorage.setObject(m, d), 201;
|
|
3717
|
+
} catch (A) {
|
|
3718
|
+
return console.error("%cstorage", x.STORAGE, B.SERIES, o, A), 400;
|
|
3719
3719
|
}
|
|
3720
3720
|
});
|
|
3721
3721
|
/**
|
|
@@ -3724,23 +3724,23 @@ class Br {
|
|
|
3724
3724
|
* @param data
|
|
3725
3725
|
* @returns number
|
|
3726
3726
|
*/
|
|
3727
|
-
|
|
3728
|
-
const
|
|
3727
|
+
I(this, "setMessages", async (o, d) => {
|
|
3728
|
+
const m = X(o);
|
|
3729
3729
|
try {
|
|
3730
|
-
return sessionStorage.setObject(
|
|
3731
|
-
} catch (
|
|
3732
|
-
return console.error("%cstorage", x.STORAGE, B.MESSAGES, o,
|
|
3730
|
+
return sessionStorage.setObject(m, d), 200;
|
|
3731
|
+
} catch (A) {
|
|
3732
|
+
return console.error("%cstorage", x.STORAGE, B.MESSAGES, o, A), 400;
|
|
3733
3733
|
}
|
|
3734
3734
|
});
|
|
3735
|
-
|
|
3735
|
+
I(this, "cleanMessages", async (o) => {
|
|
3736
3736
|
console.log("cleanMessages not implemented for ", this.options.storage);
|
|
3737
3737
|
});
|
|
3738
|
-
|
|
3739
|
-
const
|
|
3738
|
+
I(this, "setWidget", async (o) => {
|
|
3739
|
+
const d = `widget.${o.widget}`;
|
|
3740
3740
|
try {
|
|
3741
|
-
return sessionStorage.setObject(
|
|
3742
|
-
} catch (
|
|
3743
|
-
return console.error("%cstorage", x.STORAGE, B.WIDGET, o,
|
|
3741
|
+
return sessionStorage.setObject(d, o), 201;
|
|
3742
|
+
} catch (m) {
|
|
3743
|
+
return console.error("%cstorage", x.STORAGE, B.WIDGET, o, m), 400;
|
|
3744
3744
|
}
|
|
3745
3745
|
});
|
|
3746
3746
|
/**
|
|
@@ -3748,8 +3748,8 @@ class Br {
|
|
|
3748
3748
|
* @param query IQuery
|
|
3749
3749
|
* @returns null
|
|
3750
3750
|
*/
|
|
3751
|
-
|
|
3752
|
-
(
|
|
3751
|
+
I(this, "subscribe", (o) => (o = nt(o), o.type === B.MESSAGES && (o = vt(this.options, o)), this.subscribers.filter(
|
|
3752
|
+
(m) => m.widget === o.widget
|
|
3753
3753
|
).length || (console.debug(
|
|
3754
3754
|
"%cstorage%c %csubscribe",
|
|
3755
3755
|
x.STORAGE,
|
|
@@ -3762,39 +3762,39 @@ class Br {
|
|
|
3762
3762
|
* Get current subscribers
|
|
3763
3763
|
* @returns IQuery[]
|
|
3764
3764
|
*/
|
|
3765
|
-
|
|
3766
|
-
this.options = o, Storage.prototype.setObject = function(
|
|
3767
|
-
this.setItem(
|
|
3768
|
-
}, Storage.prototype.getObject = function(
|
|
3769
|
-
const
|
|
3770
|
-
return
|
|
3765
|
+
I(this, "getSubscribers", async () => await new Promise((o) => o(this.subscribers)));
|
|
3766
|
+
this.options = o, Storage.prototype.setObject = function(d, m) {
|
|
3767
|
+
this.setItem(d, JSON.stringify(m));
|
|
3768
|
+
}, Storage.prototype.getObject = function(d) {
|
|
3769
|
+
const m = this.getItem(d);
|
|
3770
|
+
return m && JSON.parse(m);
|
|
3771
3771
|
};
|
|
3772
3772
|
}
|
|
3773
3773
|
}
|
|
3774
3774
|
class Nr {
|
|
3775
3775
|
constructor(o) {
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
const
|
|
3776
|
+
I(this, "subscribers", []);
|
|
3777
|
+
I(this, "options");
|
|
3778
|
+
I(this, "getCloud", async (o) => {
|
|
3779
|
+
const d = X(o);
|
|
3780
3780
|
try {
|
|
3781
|
-
return window.BuzzCasting.WidgetData[
|
|
3781
|
+
return window.BuzzCasting.WidgetData[d];
|
|
3782
3782
|
} catch {
|
|
3783
3783
|
return console.warn("%capi", x.API, B.CLOUD, o.slide, o.widget), { data: null, message: "Cloud Data error", success: !1 };
|
|
3784
3784
|
}
|
|
3785
3785
|
});
|
|
3786
|
-
|
|
3787
|
-
const
|
|
3786
|
+
I(this, "getSeries", async (o) => {
|
|
3787
|
+
const d = X(o);
|
|
3788
3788
|
try {
|
|
3789
|
-
return window.BuzzCasting.WidgetData[
|
|
3789
|
+
return window.BuzzCasting.WidgetData[d];
|
|
3790
3790
|
} catch {
|
|
3791
3791
|
return console.warn("%capi", x.API, B.SERIES, o.slide, o.widget), { data: null, message: "Series Data error", success: !1 };
|
|
3792
3792
|
}
|
|
3793
3793
|
});
|
|
3794
|
-
|
|
3795
|
-
const
|
|
3794
|
+
I(this, "getMessages", async (o) => {
|
|
3795
|
+
const d = X(o);
|
|
3796
3796
|
try {
|
|
3797
|
-
return window.BuzzCasting.WidgetData[
|
|
3797
|
+
return window.BuzzCasting.WidgetData[d];
|
|
3798
3798
|
} catch {
|
|
3799
3799
|
return console.warn("%capi", x.API, B.MESSAGES, o.slide, o.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3800
3800
|
}
|
|
@@ -3805,12 +3805,12 @@ class Nr {
|
|
|
3805
3805
|
* @param data
|
|
3806
3806
|
* @returns number
|
|
3807
3807
|
*/
|
|
3808
|
-
|
|
3809
|
-
const
|
|
3808
|
+
I(this, "setCloud", async (o, d) => {
|
|
3809
|
+
const m = X(o);
|
|
3810
3810
|
try {
|
|
3811
|
-
return window.BuzzCasting.WidgetData[
|
|
3812
|
-
} catch (
|
|
3813
|
-
return console.error("%cstorage", x.STORAGE, "set", o,
|
|
3811
|
+
return window.BuzzCasting.WidgetData[m] = d, 201;
|
|
3812
|
+
} catch (A) {
|
|
3813
|
+
return console.error("%cstorage", x.STORAGE, "set", o, A), 400;
|
|
3814
3814
|
}
|
|
3815
3815
|
});
|
|
3816
3816
|
/**
|
|
@@ -3819,12 +3819,12 @@ class Nr {
|
|
|
3819
3819
|
* @param data
|
|
3820
3820
|
* @returns number
|
|
3821
3821
|
*/
|
|
3822
|
-
|
|
3823
|
-
const
|
|
3822
|
+
I(this, "setSeries", async (o, d) => {
|
|
3823
|
+
const m = X(o);
|
|
3824
3824
|
try {
|
|
3825
|
-
return window.BuzzCasting.WidgetData[
|
|
3826
|
-
} catch (
|
|
3827
|
-
return console.error("%cstorage", x.STORAGE, "set", o,
|
|
3825
|
+
return window.BuzzCasting.WidgetData[m] = d, 201;
|
|
3826
|
+
} catch (A) {
|
|
3827
|
+
return console.error("%cstorage", x.STORAGE, "set", o, A), 400;
|
|
3828
3828
|
}
|
|
3829
3829
|
});
|
|
3830
3830
|
/**
|
|
@@ -3833,23 +3833,23 @@ class Nr {
|
|
|
3833
3833
|
* @param data
|
|
3834
3834
|
* @returns number
|
|
3835
3835
|
*/
|
|
3836
|
-
|
|
3837
|
-
const
|
|
3836
|
+
I(this, "setMessages", async (o, d) => {
|
|
3837
|
+
const m = X(o);
|
|
3838
3838
|
try {
|
|
3839
|
-
return window.BuzzCasting.WidgetData[
|
|
3840
|
-
} catch (
|
|
3841
|
-
return console.error("%cstorage", x.STORAGE, "set", o,
|
|
3839
|
+
return window.BuzzCasting.WidgetData[m] = d, 201;
|
|
3840
|
+
} catch (A) {
|
|
3841
|
+
return console.error("%cstorage", x.STORAGE, "set", o, A), 400;
|
|
3842
3842
|
}
|
|
3843
3843
|
});
|
|
3844
|
-
|
|
3844
|
+
I(this, "cleanMessages", async (o) => {
|
|
3845
3845
|
console.log("cleanMessages not implemented for ", this.options.storage);
|
|
3846
3846
|
});
|
|
3847
|
-
|
|
3848
|
-
const
|
|
3847
|
+
I(this, "setWidget", async (o) => {
|
|
3848
|
+
const d = `widget.${o.widget}`;
|
|
3849
3849
|
try {
|
|
3850
|
-
return window.BuzzCasting.WidgetData[
|
|
3851
|
-
} catch (
|
|
3852
|
-
return console.error("%cstorage", x.STORAGE, B.WIDGET, o,
|
|
3850
|
+
return window.BuzzCasting.WidgetData[d] = o, 201;
|
|
3851
|
+
} catch (m) {
|
|
3852
|
+
return console.error("%cstorage", x.STORAGE, B.WIDGET, o, m), 400;
|
|
3853
3853
|
}
|
|
3854
3854
|
});
|
|
3855
3855
|
/**
|
|
@@ -3857,8 +3857,8 @@ class Nr {
|
|
|
3857
3857
|
* @param query IQuery
|
|
3858
3858
|
* @returns null
|
|
3859
3859
|
*/
|
|
3860
|
-
|
|
3861
|
-
(
|
|
3860
|
+
I(this, "subscribe", (o) => (o = nt(o), o.type === B.MESSAGES && (o = vt(this.options, o)), this.subscribers.filter(
|
|
3861
|
+
(m) => m.widget === o.widget
|
|
3862
3862
|
).length || (console.debug(
|
|
3863
3863
|
"%cstorage%c %csubscribe",
|
|
3864
3864
|
x.STORAGE,
|
|
@@ -3871,7 +3871,7 @@ class Nr {
|
|
|
3871
3871
|
* Get current subscribers
|
|
3872
3872
|
* @returns IQuery[]
|
|
3873
3873
|
*/
|
|
3874
|
-
|
|
3874
|
+
I(this, "getSubscribers", async () => await new Promise((o) => o(this.subscribers)));
|
|
3875
3875
|
this.options = o, window.BuzzCasting.WidgetData = /* @__PURE__ */ new Set();
|
|
3876
3876
|
}
|
|
3877
3877
|
}
|
|
@@ -3881,39 +3881,39 @@ function Ii(w, o) {
|
|
|
3881
3881
|
return w;
|
|
3882
3882
|
}
|
|
3883
3883
|
function Oe(w, o) {
|
|
3884
|
-
let
|
|
3884
|
+
let d, m, A;
|
|
3885
3885
|
if (o.length === 0)
|
|
3886
3886
|
return w;
|
|
3887
|
-
for (
|
|
3888
|
-
|
|
3887
|
+
for (d = 0, A = o.length; d < A; d++)
|
|
3888
|
+
m = o.charCodeAt(d), w = (w << 5) - w + m, w |= 0;
|
|
3889
3889
|
return w < 0 ? w * -2 : w;
|
|
3890
3890
|
}
|
|
3891
|
-
function Ci(w, o,
|
|
3892
|
-
return Object.keys(o).sort().reduce(
|
|
3893
|
-
function
|
|
3894
|
-
return Gr(
|
|
3891
|
+
function Ci(w, o, d) {
|
|
3892
|
+
return Object.keys(o).sort().reduce(m, w);
|
|
3893
|
+
function m(A, K) {
|
|
3894
|
+
return Gr(A, o[K], K, d);
|
|
3895
3895
|
}
|
|
3896
3896
|
}
|
|
3897
|
-
function Gr(w, o,
|
|
3898
|
-
const
|
|
3897
|
+
function Gr(w, o, d, m) {
|
|
3898
|
+
const A = Oe(Oe(Oe(w, d), Ri(o)), typeof o);
|
|
3899
3899
|
if (o === null)
|
|
3900
|
-
return Oe(
|
|
3900
|
+
return Oe(A, "null");
|
|
3901
3901
|
if (o === void 0)
|
|
3902
|
-
return Oe(
|
|
3902
|
+
return Oe(A, "undefined");
|
|
3903
3903
|
if (typeof o == "object" || typeof o == "function") {
|
|
3904
|
-
if (
|
|
3905
|
-
return Oe(
|
|
3906
|
-
|
|
3907
|
-
const
|
|
3904
|
+
if (m.includes(o))
|
|
3905
|
+
return Oe(A, `[Circular]${d}`);
|
|
3906
|
+
m.push(o);
|
|
3907
|
+
const K = Ci(A, o, m);
|
|
3908
3908
|
if (!("valueOf" in o) || typeof o.valueOf != "function")
|
|
3909
|
-
return
|
|
3909
|
+
return K;
|
|
3910
3910
|
try {
|
|
3911
|
-
return Oe(
|
|
3912
|
-
} catch (
|
|
3913
|
-
return Oe(
|
|
3911
|
+
return Oe(K, String(o.valueOf()));
|
|
3912
|
+
} catch (j) {
|
|
3913
|
+
return Oe(K, `[valueOf exception]${j.stack || j.message}`);
|
|
3914
3914
|
}
|
|
3915
3915
|
}
|
|
3916
|
-
return Oe(
|
|
3916
|
+
return Oe(A, o.toString());
|
|
3917
3917
|
}
|
|
3918
3918
|
function Ri(w) {
|
|
3919
3919
|
return Object.prototype.toString.call(w);
|
|
@@ -3921,26 +3921,26 @@ function Ri(w) {
|
|
|
3921
3921
|
function Ln(w) {
|
|
3922
3922
|
return Ii(Gr(0, w, "", []).toString(16), 8);
|
|
3923
3923
|
}
|
|
3924
|
-
class
|
|
3924
|
+
class Mi {
|
|
3925
3925
|
constructor(o) {
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3926
|
+
I(this, "sm");
|
|
3927
|
+
I(this, "api");
|
|
3928
|
+
I(this, "bc");
|
|
3929
|
+
I(this, "options");
|
|
3930
|
+
I(this, "update", async (o) => {
|
|
3931
3931
|
if (this.sm === null)
|
|
3932
3932
|
return;
|
|
3933
|
-
const
|
|
3934
|
-
if (
|
|
3933
|
+
const d = await this.sm.getSubscribers();
|
|
3934
|
+
if (d.length === 0)
|
|
3935
3935
|
return;
|
|
3936
|
-
const
|
|
3937
|
-
o ?
|
|
3938
|
-
|
|
3939
|
-
}), await Promise.allSettled(
|
|
3940
|
-
(
|
|
3941
|
-
let
|
|
3942
|
-
if (
|
|
3943
|
-
const N =
|
|
3936
|
+
const m = [];
|
|
3937
|
+
o ? m.push(this.api.get(o)) : d == null || d.forEach((A) => {
|
|
3938
|
+
m.push(this.api.get(A));
|
|
3939
|
+
}), await Promise.allSettled(m).then(
|
|
3940
|
+
(A) => A.forEach(async (K) => {
|
|
3941
|
+
let j = 400;
|
|
3942
|
+
if (K.status === "fulfilled") {
|
|
3943
|
+
const N = K.value;
|
|
3944
3944
|
if (this.sm === null)
|
|
3945
3945
|
return 400;
|
|
3946
3946
|
if (N.success === !0) {
|
|
@@ -3960,7 +3960,7 @@ class Ki {
|
|
|
3960
3960
|
N.query.slide,
|
|
3961
3961
|
N.query.widget
|
|
3962
3962
|
), 204;
|
|
3963
|
-
Z.hash = te,
|
|
3963
|
+
Z.hash = te, j = await this.sm.setMessages(N.query, N);
|
|
3964
3964
|
break;
|
|
3965
3965
|
case B.CLOUD:
|
|
3966
3966
|
te = Ln(N.data), Z.hash === te ? (console.debug(
|
|
@@ -3971,7 +3971,7 @@ class Ki {
|
|
|
3971
3971
|
B.CLOUD,
|
|
3972
3972
|
N.query.slide,
|
|
3973
3973
|
N.query.widget
|
|
3974
|
-
),
|
|
3974
|
+
), j = 204) : (Z.hash = te, j = await this.sm.setCloud(N.query, N));
|
|
3975
3975
|
break;
|
|
3976
3976
|
case B.SERIES:
|
|
3977
3977
|
te = Ln(N.data), Z.hash === te ? (console.debug(
|
|
@@ -3982,7 +3982,7 @@ class Ki {
|
|
|
3982
3982
|
B.SERIES,
|
|
3983
3983
|
N.query.slide,
|
|
3984
3984
|
N.query.widget
|
|
3985
|
-
),
|
|
3985
|
+
), j = 204) : (Z.hash = te, j = await this.sm.setSeries(N.query, N));
|
|
3986
3986
|
break;
|
|
3987
3987
|
default:
|
|
3988
3988
|
console.warn(
|
|
@@ -3995,8 +3995,8 @@ class Ki {
|
|
|
3995
3995
|
);
|
|
3996
3996
|
}
|
|
3997
3997
|
} else
|
|
3998
|
-
|
|
3999
|
-
switch (
|
|
3998
|
+
j = 401;
|
|
3999
|
+
switch (j) {
|
|
4000
4000
|
case 201:
|
|
4001
4001
|
console.info(
|
|
4002
4002
|
"%capp%c %cbroadcast",
|
|
@@ -4005,7 +4005,7 @@ class Ki {
|
|
|
4005
4005
|
x.BROADCAST,
|
|
4006
4006
|
N.query.slide,
|
|
4007
4007
|
N.data.title ?? N.query.widget
|
|
4008
|
-
), this.bc.postMessage({ event:
|
|
4008
|
+
), this.bc.postMessage({ event: ue.WIDGET_UPDATE, data: N });
|
|
4009
4009
|
break;
|
|
4010
4010
|
case 400:
|
|
4011
4011
|
console.warn(
|
|
@@ -4018,48 +4018,48 @@ class Ki {
|
|
|
4018
4018
|
);
|
|
4019
4019
|
break;
|
|
4020
4020
|
}
|
|
4021
|
-
return
|
|
4021
|
+
return j;
|
|
4022
4022
|
} else
|
|
4023
4023
|
return console.warn(
|
|
4024
4024
|
"%capi%c %cstorage",
|
|
4025
4025
|
x.API,
|
|
4026
4026
|
x.NONE,
|
|
4027
4027
|
x.STORAGE,
|
|
4028
|
-
|
|
4028
|
+
ue.ERROR
|
|
4029
4029
|
), 400;
|
|
4030
4030
|
})
|
|
4031
4031
|
);
|
|
4032
4032
|
});
|
|
4033
|
-
|
|
4033
|
+
I(this, "hide", (o) => {
|
|
4034
4034
|
this.api.hideMessage(o);
|
|
4035
4035
|
});
|
|
4036
|
-
|
|
4037
|
-
var
|
|
4036
|
+
I(this, "actions", async (o) => {
|
|
4037
|
+
var d;
|
|
4038
4038
|
switch (o.data.event) {
|
|
4039
|
-
case
|
|
4040
|
-
(
|
|
4039
|
+
case ue.SUBSCRIBE:
|
|
4040
|
+
(d = this.sm) == null || d.subscribe(o.data.data);
|
|
4041
4041
|
break;
|
|
4042
|
-
case
|
|
4042
|
+
case ue.UPDATE:
|
|
4043
4043
|
console.debug(
|
|
4044
4044
|
"%capi%c %cstorage",
|
|
4045
4045
|
x.API,
|
|
4046
4046
|
x.NONE,
|
|
4047
4047
|
x.STORAGE,
|
|
4048
|
-
|
|
4048
|
+
ue.UPDATE,
|
|
4049
4049
|
o.data
|
|
4050
4050
|
), await this.update();
|
|
4051
4051
|
break;
|
|
4052
4052
|
}
|
|
4053
4053
|
});
|
|
4054
|
-
|
|
4055
|
-
var
|
|
4056
|
-
const o = ((
|
|
4057
|
-
return await ((
|
|
4054
|
+
I(this, "cleanMessages", async () => {
|
|
4055
|
+
var d, m;
|
|
4056
|
+
const o = ((d = this.options) == null ? void 0 : d.retention) || 345600;
|
|
4057
|
+
return await ((m = this.sm) == null ? void 0 : m.cleanMessages(o));
|
|
4058
4058
|
});
|
|
4059
4059
|
// TODO: add checksum to avoid broadcasting update
|
|
4060
4060
|
// private setHash(widget: string) {
|
|
4061
4061
|
// }
|
|
4062
|
-
|
|
4062
|
+
I(this, "getSubscribers", async () => {
|
|
4063
4063
|
var o;
|
|
4064
4064
|
return await ((o = this.sm) == null ? void 0 : o.getSubscribers());
|
|
4065
4065
|
});
|
|
@@ -4069,20 +4069,20 @@ class Ki {
|
|
|
4069
4069
|
x.NONE,
|
|
4070
4070
|
x.SLIDE,
|
|
4071
4071
|
o.slide,
|
|
4072
|
-
|
|
4072
|
+
ue.VERSION,
|
|
4073
4073
|
xi
|
|
4074
4074
|
), this.options = o, this.sm = null;
|
|
4075
|
-
const
|
|
4076
|
-
switch (this.bc = new BroadcastChannel(
|
|
4075
|
+
const d = (o == null ? void 0 : o.slide) || o.app;
|
|
4076
|
+
switch (this.bc = new BroadcastChannel(d), console.info(
|
|
4077
4077
|
"%capi%c %cbroadcast",
|
|
4078
4078
|
x.API,
|
|
4079
4079
|
x.NONE,
|
|
4080
4080
|
x.BROADCAST,
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
), this.bc.onmessage = (
|
|
4084
|
-
this.actions(
|
|
4085
|
-
}, this.bc.postMessage({ event:
|
|
4081
|
+
ue.CHANNEL,
|
|
4082
|
+
d
|
|
4083
|
+
), this.bc.onmessage = (m) => {
|
|
4084
|
+
this.actions(m);
|
|
4085
|
+
}, this.bc.postMessage({ event: ue.STORAGE_INIT, data: {} }), this.api = new ki(o), o.storage) {
|
|
4086
4086
|
case he.DEXIE:
|
|
4087
4087
|
this.sm = new Tr(o);
|
|
4088
4088
|
break;
|
|
@@ -4103,14 +4103,14 @@ class Ki {
|
|
|
4103
4103
|
}
|
|
4104
4104
|
class Ti {
|
|
4105
4105
|
constructor(o) {
|
|
4106
|
-
|
|
4106
|
+
I(this, "sm");
|
|
4107
4107
|
/**
|
|
4108
4108
|
* Retieve Cloud Data
|
|
4109
4109
|
* @param query Widgets parameters, type "cloud"
|
|
4110
4110
|
* @returns IResponse
|
|
4111
4111
|
*/
|
|
4112
|
-
|
|
4113
|
-
var
|
|
4112
|
+
I(this, "getCloud", async (o) => {
|
|
4113
|
+
var d;
|
|
4114
4114
|
return o.type !== B.CLOUD ? (console.warn(
|
|
4115
4115
|
"%capp%c %get",
|
|
4116
4116
|
x.APP,
|
|
@@ -4123,15 +4123,15 @@ class Ti {
|
|
|
4123
4123
|
data: null,
|
|
4124
4124
|
message: `'wrong method call for getMessages, type used is ${o.type}`,
|
|
4125
4125
|
success: !1
|
|
4126
|
-
}) : await ((
|
|
4126
|
+
}) : await ((d = this.sm) == null ? void 0 : d.getCloud(o));
|
|
4127
4127
|
});
|
|
4128
4128
|
/**
|
|
4129
4129
|
* Retieve Message Data
|
|
4130
4130
|
* @param query Widgets parameters, type "messages"
|
|
4131
4131
|
* @returns IResponse
|
|
4132
4132
|
*/
|
|
4133
|
-
|
|
4134
|
-
var
|
|
4133
|
+
I(this, "getMessages", async (o) => {
|
|
4134
|
+
var d;
|
|
4135
4135
|
return o.type !== B.MESSAGES ? (console.warn(
|
|
4136
4136
|
"%capp%c %get",
|
|
4137
4137
|
x.APP,
|
|
@@ -4144,15 +4144,15 @@ class Ti {
|
|
|
4144
4144
|
data: null,
|
|
4145
4145
|
message: `'wrong method call for getMessages, type used is ${o.type}`,
|
|
4146
4146
|
success: !1
|
|
4147
|
-
}) : await ((
|
|
4147
|
+
}) : await ((d = this.sm) == null ? void 0 : d.getMessages(o));
|
|
4148
4148
|
});
|
|
4149
4149
|
/**
|
|
4150
4150
|
* Retrieve Series Data
|
|
4151
4151
|
* @param query Widgets parameters, type "series"
|
|
4152
4152
|
* @returns IResponse
|
|
4153
4153
|
*/
|
|
4154
|
-
|
|
4155
|
-
var
|
|
4154
|
+
I(this, "getSeries", async (o) => {
|
|
4155
|
+
var d;
|
|
4156
4156
|
return o.type !== B.SERIES ? (console.warn(
|
|
4157
4157
|
"%capp%c %get",
|
|
4158
4158
|
x.APP,
|
|
@@ -4165,7 +4165,7 @@ class Ti {
|
|
|
4165
4165
|
data: null,
|
|
4166
4166
|
message: `'wrong method call for getSeries, type used is ${o.type}`,
|
|
4167
4167
|
success: !1
|
|
4168
|
-
}) : await ((
|
|
4168
|
+
}) : await ((d = this.sm) == null ? void 0 : d.getSeries(o));
|
|
4169
4169
|
});
|
|
4170
4170
|
switch (this.sm = null, o.storage) {
|
|
4171
4171
|
case he.DEXIE:
|
|
@@ -4186,19 +4186,20 @@ class Ti {
|
|
|
4186
4186
|
}
|
|
4187
4187
|
}
|
|
4188
4188
|
}
|
|
4189
|
-
var B = /* @__PURE__ */ ((w) => (w.MESSAGES = "messages", w.CLOUD = "cloud", w.SERIES = "series", w.TOPICS = "topics", w.WIDGET = "widget", w.WIDGETS = "widgets", w))(B || {}), x = /* @__PURE__ */ ((w) => (w.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", w.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", w.BROADCAST = "color:white;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", w.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", w.CLOUD = "color:grey;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", w.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", w.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", w.MESSAGES = "color:grey;background-color:tan;padding:0 4px 0 4px;border-radius:5px;", w.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", w.NONE = "color:transparent;background-color:transparent;", w.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", w.SERIES = "color:grey;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", w.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", w.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", w.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", w.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", w.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", w))(x || {}),
|
|
4190
|
-
class
|
|
4189
|
+
var B = /* @__PURE__ */ ((w) => (w.MESSAGES = "messages", w.CLOUD = "cloud", w.SERIES = "series", w.TOPICS = "topics", w.WIDGET = "widget", w.WIDGETS = "widgets", w))(B || {}), x = /* @__PURE__ */ ((w) => (w.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", w.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", w.BROADCAST = "color:white;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", w.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", w.CLOUD = "color:grey;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", w.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", w.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", w.MESSAGES = "color:grey;background-color:tan;padding:0 4px 0 4px;border-radius:5px;", w.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", w.NONE = "color:transparent;background-color:transparent;", w.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", w.SERIES = "color:grey;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", w.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", w.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", w.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", w.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", w.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", w))(x || {}), ue = /* @__PURE__ */ ((w) => (w.ADD_SLIDE = "addSlide", w.APP_READY = "appReady", w.API_UPDATE = "apiUpdate", w.CHANNEL = "channel", w.ERROR = "error", w.GOTO_SLIDE = "gotoSlide", w.HIDE_MESSAGE = "hideMessage", w.NEXT_SLIDE = "nextSlide", w.PAUSE_PRESENTATION = "pausePresentation", w.PRESENTATION_READY = "presentationReady", w.PREV_SLIDE = "prevSlide", w.RELOAD_PRESENTATION = "reloadPresentation", w.SHOW_MODAL = "showModal", w.SLIDE_DID_LOAD = "slideDidLoad", w.SLIDE_GOTO = "slideGoto", w.SLIDE_READY = "slideReady", w.SLIDE_TRANSITIONER = "slideTransitioner", w.START_TRANSITIONER = "startTransitioner", w.STORAGE_INIT = "stroageInit", w.SUBSCRIBE = "subscribe", w.UPDATE = "update", w.VERSION = "version", w.WIDGET_UPDATE = "widgetUpdate", w))(ue || {}), Xt = /* @__PURE__ */ ((w) => (w.APPROVED = "approved", w.BEFORE = "before", w.DELAYED = "delayed", w.NONE = "none", w.REALTIME = "realtime", w))(Xt || {}), he = /* @__PURE__ */ ((w) => (w.KEYVAL = "keyval", w.LOCAL = "local", w.SESSION = "session", w.DEXIE = "dexie", w.WINDOW = "window", w))(he || {});
|
|
4190
|
+
class Bi {
|
|
4191
4191
|
/**
|
|
4192
4192
|
*
|
|
4193
4193
|
* @param callbacks functions in the widget that will receive the update
|
|
4194
4194
|
* @param query
|
|
4195
4195
|
*/
|
|
4196
|
-
constructor(o,
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4196
|
+
constructor(o, d, m) {
|
|
4197
|
+
I(this, "storageReader");
|
|
4198
|
+
I(this, "broadcastChannel");
|
|
4199
|
+
I(this, "query");
|
|
4200
|
+
I(this, "attributes");
|
|
4201
|
+
I(this, "listeners");
|
|
4202
|
+
I(this, "getCloud", async () => this.query.type !== B.CLOUD ? (console.warn(
|
|
4202
4203
|
"%cstorage%c %cwidget",
|
|
4203
4204
|
x.STORAGE,
|
|
4204
4205
|
x.NONE,
|
|
@@ -4211,7 +4212,7 @@ class Mi {
|
|
|
4211
4212
|
message: `wrong method call for getCloud, expected type is ${this.query.type}`,
|
|
4212
4213
|
success: !1
|
|
4213
4214
|
}) : await this.storageReader.getCloud(this.query));
|
|
4214
|
-
|
|
4215
|
+
I(this, "getMessages", async () => this.query.type !== B.MESSAGES ? (console.warn(
|
|
4215
4216
|
"%cstorage%c %cwidget",
|
|
4216
4217
|
x.STORAGE,
|
|
4217
4218
|
x.NONE,
|
|
@@ -4224,7 +4225,7 @@ class Mi {
|
|
|
4224
4225
|
message: `wrong method call for getMessages, expected type is ${this.query.type}`,
|
|
4225
4226
|
success: !1
|
|
4226
4227
|
}) : await this.storageReader.getMessages(this.query));
|
|
4227
|
-
|
|
4228
|
+
I(this, "getSeries", async () => this.query.type !== B.SERIES ? (console.warn(
|
|
4228
4229
|
"%cstorage%c %cwidget",
|
|
4229
4230
|
x.STORAGE,
|
|
4230
4231
|
x.NONE,
|
|
@@ -4237,26 +4238,25 @@ class Mi {
|
|
|
4237
4238
|
message: `wrong method call for getSeries, expected type is ${this.query.type}`,
|
|
4238
4239
|
success: !1
|
|
4239
4240
|
}) : await this.storageReader.getSeries(this.query));
|
|
4240
|
-
|
|
4241
|
-
const
|
|
4241
|
+
I(this, "showModal", (o) => {
|
|
4242
|
+
const d = new CustomEvent(ue.SHOW_MODAL, {
|
|
4242
4243
|
detail: {
|
|
4243
|
-
component: o,
|
|
4244
|
-
attributes: this.
|
|
4244
|
+
component: o.showComponent,
|
|
4245
|
+
attributes: { ...o.attributes, ...this.attributes },
|
|
4246
|
+
dataset: { ...o.dataset, ...this.query }
|
|
4245
4247
|
},
|
|
4246
4248
|
bubbles: !0,
|
|
4247
4249
|
cancelable: !0,
|
|
4248
4250
|
composed: !0
|
|
4249
4251
|
});
|
|
4250
|
-
window.dispatchEvent(
|
|
4252
|
+
window.dispatchEvent(d);
|
|
4251
4253
|
});
|
|
4252
|
-
var
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
this.
|
|
4258
|
-
const v = window.BuzzCasting.getOptions();
|
|
4259
|
-
this.storageReader = new Ti(v), this.broadcastChannel = new BroadcastChannel(h.slide), this.startListener();
|
|
4254
|
+
var j;
|
|
4255
|
+
m = typeof m < "u" ? m : "buzzcasting-slide", this.listeners = d;
|
|
4256
|
+
let A;
|
|
4257
|
+
A = { ...o.dataset }, delete A.hmr, A.slide = ((j = o.closest(m.toUpperCase())) == null ? void 0 : j.id) ?? `${m} not found`, A = nt(A), this.query = A, this.attributes = ji(o.attributes);
|
|
4258
|
+
const K = window.BuzzCasting.getOptions();
|
|
4259
|
+
this.storageReader = new Ti(K), this.broadcastChannel = new BroadcastChannel(A.slide), this.startListener();
|
|
4260
4260
|
}
|
|
4261
4261
|
addListener(o) {
|
|
4262
4262
|
this.listeners.push(o);
|
|
@@ -4266,15 +4266,15 @@ class Mi {
|
|
|
4266
4266
|
*/
|
|
4267
4267
|
startListener() {
|
|
4268
4268
|
const o = this.query;
|
|
4269
|
-
this.broadcastChannel.onmessage = async (
|
|
4270
|
-
const
|
|
4271
|
-
switch (
|
|
4272
|
-
case
|
|
4273
|
-
|
|
4274
|
-
|
|
4269
|
+
this.broadcastChannel.onmessage = async (d) => {
|
|
4270
|
+
const m = d.data.data;
|
|
4271
|
+
switch (d.data.event) {
|
|
4272
|
+
case ue.WIDGET_UPDATE:
|
|
4273
|
+
m.query.slide === o.slide && m.query.widget === o.widget && this.listeners.forEach((A) => {
|
|
4274
|
+
A(d.data.data);
|
|
4275
4275
|
});
|
|
4276
4276
|
break;
|
|
4277
|
-
case
|
|
4277
|
+
case ue.SLIDE_READY:
|
|
4278
4278
|
this.subscribe();
|
|
4279
4279
|
break;
|
|
4280
4280
|
}
|
|
@@ -4288,20 +4288,45 @@ class Mi {
|
|
|
4288
4288
|
x.SUBSCRIBE,
|
|
4289
4289
|
this.query.slide,
|
|
4290
4290
|
this.query.widget
|
|
4291
|
-
), this.broadcastChannel.postMessage({
|
|
4291
|
+
), this.broadcastChannel.postMessage({
|
|
4292
|
+
event: ue.SUBSCRIBE,
|
|
4293
|
+
data: this.query
|
|
4294
|
+
});
|
|
4292
4295
|
}
|
|
4293
4296
|
destroy() {
|
|
4294
4297
|
this.broadcastChannel.close();
|
|
4295
4298
|
}
|
|
4296
4299
|
}
|
|
4300
|
+
function ji(w) {
|
|
4301
|
+
const o = {};
|
|
4302
|
+
for (let d = 0; d < w.length; d++) {
|
|
4303
|
+
const m = w[d];
|
|
4304
|
+
m.name !== "class" && !m.name.includes("data") && (o[m.name] = m.value);
|
|
4305
|
+
}
|
|
4306
|
+
return o;
|
|
4307
|
+
}
|
|
4308
|
+
function Ni(w, o) {
|
|
4309
|
+
var j;
|
|
4310
|
+
w.stopPropagation();
|
|
4311
|
+
let d = w.target;
|
|
4312
|
+
if (d == null)
|
|
4313
|
+
return;
|
|
4314
|
+
o = typeof o < "u" ? o : "animate-children";
|
|
4315
|
+
let m = !1, A, K = "";
|
|
4316
|
+
for (; !m; )
|
|
4317
|
+
A = d == null ? void 0 : d.parentElement, A != null && A.tagName.includes("-") && (j = A == null ? void 0 : A.dataset) != null && j.message && (K = A.dataset.message), (A == null ? void 0 : A.tagName) === (o == null ? void 0 : o.toUpperCase()) && (m = !0), d = A;
|
|
4318
|
+
return K;
|
|
4319
|
+
}
|
|
4297
4320
|
export {
|
|
4298
4321
|
B as API,
|
|
4299
|
-
|
|
4322
|
+
Mi as BuzzcastingStorageManager,
|
|
4300
4323
|
Ti as BuzzcastingStorageReader,
|
|
4301
4324
|
x as CSS,
|
|
4302
|
-
|
|
4325
|
+
ue as EVENTS,
|
|
4303
4326
|
Xt as MODERATION,
|
|
4304
4327
|
he as STORAGE,
|
|
4305
|
-
|
|
4328
|
+
Bi as Widget,
|
|
4329
|
+
ji as filterAttributes,
|
|
4330
|
+
Ni as messageId,
|
|
4306
4331
|
nt as widgetParams
|
|
4307
4332
|
};
|