buzzcasting-storage 3.14.3 → 3.14.4
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/README.md +6 -2
- package/dist/buzzcasting-storage.d.ts +3 -2
- package/dist/buzzcasting-storage.esm.js +293 -294
- package/package.json +8 -7
|
@@ -45,8 +45,8 @@ function jn(h, t, o, l) {
|
|
|
45
45
|
return y;
|
|
46
46
|
try {
|
|
47
47
|
return Oe(y, String(t.valueOf()));
|
|
48
|
-
} catch (
|
|
49
|
-
return Oe(y, `[valueOf exception]${
|
|
48
|
+
} catch (N) {
|
|
49
|
+
return Oe(y, `[valueOf exception]${N.stack || N.message}`);
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
return Oe(p, t.toString());
|
|
@@ -115,10 +115,10 @@ function Ra(h) {
|
|
|
115
115
|
return h;
|
|
116
116
|
}
|
|
117
117
|
function St(h, t) {
|
|
118
|
-
let o, l, p, y,
|
|
118
|
+
let o, l, p, y, N;
|
|
119
119
|
switch (h.moderation) {
|
|
120
120
|
case qt.BEFORE:
|
|
121
|
-
o = /* @__PURE__ */ new Date(), l = h.beforeTime?.split(":"), p = Number.parseInt(l ? l[0] : "00"), y = Number.parseInt(l ? l[1] : "00"),
|
|
121
|
+
o = /* @__PURE__ */ new Date(), l = h.beforeTime?.split(":"), p = Number.parseInt(l ? l[0] : "00"), y = Number.parseInt(l ? l[1] : "00"), N = Number.parseInt(l ? l[2] : "00"), t.before = o.setHours(p, y, N, 0) / 1e3, t.period || (t.period = o.getDay() === 1 ? 72 : 24);
|
|
122
122
|
break;
|
|
123
123
|
case qt.DELAYED:
|
|
124
124
|
h.delay && h.delay > 0 && (t.delay = `${h.delay}`);
|
|
@@ -131,7 +131,7 @@ function St(h, t) {
|
|
|
131
131
|
}
|
|
132
132
|
return t;
|
|
133
133
|
}
|
|
134
|
-
const xa = "3.14.
|
|
134
|
+
const xa = "3.14.3";
|
|
135
135
|
class ka {
|
|
136
136
|
options;
|
|
137
137
|
url;
|
|
@@ -172,16 +172,16 @@ class ka {
|
|
|
172
172
|
const { version: o } = this.options, l = this.headers(), p = Object.assign({}, t);
|
|
173
173
|
delete p.type, delete p.hash, delete p.order, p.topics = `${p.dashboard}-${p.widget}`, delete p.presentation;
|
|
174
174
|
const y = Object.keys(p).length > 0 ? `?${new URLSearchParams(p).toString()}` : "";
|
|
175
|
-
let
|
|
175
|
+
let N = "";
|
|
176
176
|
switch (t.type) {
|
|
177
177
|
case _.MESSAGES:
|
|
178
|
-
|
|
178
|
+
N = i.MESSAGES;
|
|
179
179
|
break;
|
|
180
180
|
case _.SERIES:
|
|
181
|
-
|
|
181
|
+
N = i.SERIES;
|
|
182
182
|
break;
|
|
183
183
|
case _.CLOUD:
|
|
184
|
-
|
|
184
|
+
N = i.CLOUD;
|
|
185
185
|
break;
|
|
186
186
|
}
|
|
187
187
|
return K(3, [
|
|
@@ -190,16 +190,16 @@ class ka {
|
|
|
190
190
|
i.NONE,
|
|
191
191
|
i.API,
|
|
192
192
|
i.NONE,
|
|
193
|
-
|
|
193
|
+
N,
|
|
194
194
|
t.widget
|
|
195
195
|
]), K(4, [t.type, p]), await fetch(
|
|
196
196
|
[this.url, "api", o, t.type].join("/") + y,
|
|
197
197
|
{ ...l, method: "get" }
|
|
198
|
-
).then(async (
|
|
199
|
-
if (
|
|
200
|
-
throw new Error(`${
|
|
201
|
-
return
|
|
202
|
-
}).then((
|
|
198
|
+
).then(async (M) => {
|
|
199
|
+
if (!M.ok)
|
|
200
|
+
throw new Error(`${M.status}`);
|
|
201
|
+
return M;
|
|
202
|
+
}).then((M) => M.json()).then((M) => (M.query = t, M)).catch((M) => ({ success: !1, message: `${M}`, data: null, query: t }));
|
|
203
203
|
}
|
|
204
204
|
async hideMessage(t) {
|
|
205
205
|
const { version: o } = this.options, l = this.headers(), p = "?action=visible";
|
|
@@ -222,8 +222,8 @@ class ka {
|
|
|
222
222
|
}
|
|
223
223
|
async hideLabels(t) {
|
|
224
224
|
const { version: o } = this.options, l = this.formHeaders(), p = new URLSearchParams(), y = t.labels || [];
|
|
225
|
-
for (const [
|
|
226
|
-
p.append(`custom_filters[${
|
|
225
|
+
for (const [N, M] of y.entries())
|
|
226
|
+
p.append(`custom_filters[${N}]`, M);
|
|
227
227
|
return console.info(
|
|
228
228
|
"%capi%c %cput",
|
|
229
229
|
i.API,
|
|
@@ -235,16 +235,16 @@ class ka {
|
|
|
235
235
|
), await fetch(
|
|
236
236
|
[this.url, "api", o, t.type, t.widget].join("/"),
|
|
237
237
|
{ ...l, body: p, method: "put" }
|
|
238
|
-
).then((
|
|
239
|
-
if (!
|
|
240
|
-
throw new Error(
|
|
241
|
-
return
|
|
242
|
-
}).then((
|
|
238
|
+
).then((N) => {
|
|
239
|
+
if (!N.ok)
|
|
240
|
+
throw new Error(N.statusText);
|
|
241
|
+
return N;
|
|
242
|
+
}).then((N) => N.json()).catch((N) => ({ succes: !1, message: N, data: [] }));
|
|
243
243
|
}
|
|
244
244
|
async loadSlide(t) {
|
|
245
245
|
const { version: o } = this.options, l = this.headers(), p = Object.assign({}, t);
|
|
246
246
|
return delete p.type, delete p.hash, K(3, [
|
|
247
|
-
"%cload%c %capi%c %
|
|
247
|
+
"%cload%c %capi%c %cslide",
|
|
248
248
|
i.OK,
|
|
249
249
|
i.NONE,
|
|
250
250
|
i.API,
|
|
@@ -259,10 +259,10 @@ class ka {
|
|
|
259
259
|
throw new Error(`${y.status}`);
|
|
260
260
|
return y;
|
|
261
261
|
}).then((y) => y.json()).then((y) => {
|
|
262
|
-
let
|
|
263
|
-
return t.type = "slides", y.query = t, y?.data && (Array.isArray(y.data) ? (
|
|
264
|
-
typeof
|
|
265
|
-
})) : (
|
|
262
|
+
let N;
|
|
263
|
+
return t.type = "slides", y.query = t, y?.data && (Array.isArray(y.data) ? (N = structuredClone(y.data), N.forEach((M) => {
|
|
264
|
+
typeof M.json == "string" && (M.json = JSON.parse(M.json));
|
|
265
|
+
})) : (N = structuredClone(y.data), N.json = JSON.parse(N.json)), y.data = N), y;
|
|
266
266
|
}).catch((y) => ({ success: !1, message: `${y}`, data: null }));
|
|
267
267
|
}
|
|
268
268
|
/**
|
|
@@ -488,9 +488,9 @@ function Ma() {
|
|
|
488
488
|
for (var a, s = 0, c = r.length; s < c; s++) !a && s in r || ((a = a || Array.prototype.slice.call(r, 0, s))[s] = r[s]);
|
|
489
489
|
return e.concat(a || Array.prototype.slice.call(r));
|
|
490
490
|
}
|
|
491
|
-
var y = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Ca,
|
|
491
|
+
var y = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Ca, N = Object.keys, M = Array.isArray;
|
|
492
492
|
function te(e, r) {
|
|
493
|
-
return typeof r != "object" ||
|
|
493
|
+
return typeof r != "object" || N(r).forEach(function(n) {
|
|
494
494
|
e[n] = r[n];
|
|
495
495
|
}), e;
|
|
496
496
|
}
|
|
@@ -500,7 +500,7 @@ function Ma() {
|
|
|
500
500
|
return Ot.call(e, r);
|
|
501
501
|
}
|
|
502
502
|
function pe(e, r) {
|
|
503
|
-
typeof r == "function" && (r = r(se(e))), (typeof Reflect > "u" ?
|
|
503
|
+
typeof r == "function" && (r = r(se(e))), (typeof Reflect > "u" ? N : Reflect.ownKeys)(r).forEach(function(n) {
|
|
504
504
|
Ae(e, n, r[n]);
|
|
505
505
|
});
|
|
506
506
|
}
|
|
@@ -548,7 +548,7 @@ function Ma() {
|
|
|
548
548
|
for (var a = 0, s = r.length; a < s; ++a) le(e, r[a], n[a]);
|
|
549
549
|
} else {
|
|
550
550
|
var c, u, d = r.indexOf(".");
|
|
551
|
-
d !== -1 ? (c = r.substr(0, d), (u = r.substr(d + 1)) === "" ? n === void 0 ?
|
|
551
|
+
d !== -1 ? (c = r.substr(0, d), (u = r.substr(d + 1)) === "" ? n === void 0 ? M(e) && !isNaN(parseInt(c)) ? e.splice(c, 1) : delete e[c] : e[c] = n : le(d = !(d = e[c]) || !re(e, c) ? e[c] = {} : d, u, n)) : n === void 0 ? M(e) && !isNaN(parseInt(r)) ? e.splice(r, 1) : delete e[r] : e[r] = n;
|
|
552
552
|
}
|
|
553
553
|
}
|
|
554
554
|
function Yr(e) {
|
|
@@ -574,7 +574,7 @@ function Ma() {
|
|
|
574
574
|
if (!n || typeof n != "object") return n;
|
|
575
575
|
var a = ot.get(n);
|
|
576
576
|
if (a) return a;
|
|
577
|
-
if (
|
|
577
|
+
if (M(n)) {
|
|
578
578
|
a = [], ot.set(n, a);
|
|
579
579
|
for (var s = 0, c = n.length; s < c; ++s) a.push(r(n[s]));
|
|
580
580
|
} else if (Xr.has(n.constructor)) a = n;
|
|
@@ -602,7 +602,7 @@ function Ma() {
|
|
|
602
602
|
function Ee(e) {
|
|
603
603
|
var r, n, a, s;
|
|
604
604
|
if (arguments.length === 1) {
|
|
605
|
-
if (
|
|
605
|
+
if (M(e)) return e.slice();
|
|
606
606
|
if (this === Ye && typeof e == "string") return [e];
|
|
607
607
|
if (s = Vn(e)) {
|
|
608
608
|
for (n = []; !(a = s.next()).done; ) n.push(a.value);
|
|
@@ -729,7 +729,7 @@ function Ma() {
|
|
|
729
729
|
}(), ut = Me[0], he = Me[1], Me = Me[2], he = he && he.then, Ge = ut && ut.constructor, or = !!Me, lt = function(e, r) {
|
|
730
730
|
dt.push([e, r]), Dt && (queueMicrotask(ra), Dt = !1);
|
|
731
731
|
}, ir = !0, Dt = !0, Ke = [], It = [], cr = it, Pe = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: Q, pgp: !1, env: {}, finalize: Q }, B = Pe, dt = [], Be = 0, Nt = [];
|
|
732
|
-
function
|
|
732
|
+
function j(e) {
|
|
733
733
|
if (typeof this != "object") throw new TypeError("Promises must be constructed via new");
|
|
734
734
|
this._listeners = [], this._lib = !1;
|
|
735
735
|
var r = this._PSD = B;
|
|
@@ -744,7 +744,7 @@ function Ma() {
|
|
|
744
744
|
if (c === a) throw new TypeError("A promise cannot be resolved with itself.");
|
|
745
745
|
var u = a._lib && Je();
|
|
746
746
|
c && typeof c.then == "function" ? n(a, function(d, g) {
|
|
747
|
-
c instanceof
|
|
747
|
+
c instanceof j ? c._then(d, g) : c.then(d, g);
|
|
748
748
|
}) : (a._state = !0, a._value = c, rn(a)), u && Ze();
|
|
749
749
|
}
|
|
750
750
|
}, lr.bind(null, a));
|
|
@@ -756,7 +756,7 @@ function Ma() {
|
|
|
756
756
|
var ur = { get: function() {
|
|
757
757
|
var e = B, r = kt;
|
|
758
758
|
function n(a, s) {
|
|
759
|
-
var c = this, u = !e.global && (e !== B || r !== kt), d = u && !Ie(), g = new
|
|
759
|
+
var c = this, u = !e.global && (e !== B || r !== kt), d = u && !Ie(), g = new j(function(b, w) {
|
|
760
760
|
dr(c, new tn(an(a, e, u, d), an(s, e, u, d), b, w, e));
|
|
761
761
|
});
|
|
762
762
|
return this._consoleTask && (g._consoleTask = this._consoleTask), g;
|
|
@@ -833,7 +833,7 @@ function Ma() {
|
|
|
833
833
|
for (var r = Nt.slice(0), n = r.length; n; ) r[--n]();
|
|
834
834
|
}
|
|
835
835
|
function Tt(e) {
|
|
836
|
-
return new
|
|
836
|
+
return new j(ct, !1, e);
|
|
837
837
|
}
|
|
838
838
|
function Z(e, r) {
|
|
839
839
|
var n = B;
|
|
@@ -848,7 +848,7 @@ function Ma() {
|
|
|
848
848
|
}
|
|
849
849
|
};
|
|
850
850
|
}
|
|
851
|
-
pe(
|
|
851
|
+
pe(j.prototype, { then: ur, _then: function(e, r) {
|
|
852
852
|
dr(this, new tn(null, null, e, r, B));
|
|
853
853
|
}, catch: function(e) {
|
|
854
854
|
if (arguments.length === 1) return this.then(null, e);
|
|
@@ -860,42 +860,42 @@ function Ma() {
|
|
|
860
860
|
});
|
|
861
861
|
}, finally: function(e) {
|
|
862
862
|
return this.then(function(r) {
|
|
863
|
-
return
|
|
863
|
+
return j.resolve(e()).then(function() {
|
|
864
864
|
return r;
|
|
865
865
|
});
|
|
866
866
|
}, function(r) {
|
|
867
|
-
return
|
|
867
|
+
return j.resolve(e()).then(function() {
|
|
868
868
|
return Tt(r);
|
|
869
869
|
});
|
|
870
870
|
});
|
|
871
871
|
}, timeout: function(e, r) {
|
|
872
872
|
var n = this;
|
|
873
|
-
return e < 1 / 0 ? new
|
|
873
|
+
return e < 1 / 0 ? new j(function(a, s) {
|
|
874
874
|
var c = setTimeout(function() {
|
|
875
875
|
return s(new L.Timeout(r));
|
|
876
876
|
}, e);
|
|
877
877
|
n.then(a, s).finally(clearTimeout.bind(null, c));
|
|
878
878
|
}) : this;
|
|
879
|
-
} }), typeof Symbol < "u" && Symbol.toStringTag && Ae(
|
|
879
|
+
} }), typeof Symbol < "u" && Symbol.toStringTag && Ae(j.prototype, Symbol.toStringTag, "Dexie.Promise"), Pe.env = nn(), pe(j, { all: function() {
|
|
880
880
|
var e = Ee.apply(null, arguments).map(Ct);
|
|
881
|
-
return new
|
|
881
|
+
return new j(function(r, n) {
|
|
882
882
|
e.length === 0 && r([]);
|
|
883
883
|
var a = e.length;
|
|
884
884
|
e.forEach(function(s, c) {
|
|
885
|
-
return
|
|
885
|
+
return j.resolve(s).then(function(u) {
|
|
886
886
|
e[c] = u, --a || r(e);
|
|
887
887
|
}, n);
|
|
888
888
|
});
|
|
889
889
|
});
|
|
890
890
|
}, resolve: function(e) {
|
|
891
|
-
return e instanceof
|
|
891
|
+
return e instanceof j ? e : e && typeof e.then == "function" ? new j(function(r, n) {
|
|
892
892
|
e.then(r, n);
|
|
893
|
-
}) : new
|
|
893
|
+
}) : new j(ct, !0, e);
|
|
894
894
|
}, reject: Tt, race: function() {
|
|
895
895
|
var e = Ee.apply(null, arguments).map(Ct);
|
|
896
|
-
return new
|
|
896
|
+
return new j(function(r, n) {
|
|
897
897
|
e.map(function(a) {
|
|
898
|
-
return
|
|
898
|
+
return j.resolve(a).then(r, n);
|
|
899
899
|
});
|
|
900
900
|
});
|
|
901
901
|
}, PSD: { get: function() {
|
|
@@ -913,7 +913,7 @@ function Ma() {
|
|
|
913
913
|
}, set: function(e) {
|
|
914
914
|
cr = e;
|
|
915
915
|
} }, follow: function(e, r) {
|
|
916
|
-
return new
|
|
916
|
+
return new j(function(n, a) {
|
|
917
917
|
return De(function(s, c) {
|
|
918
918
|
var u = B;
|
|
919
919
|
u.unhandleds = [], u.onunhandled = c, u.finalize = je(function() {
|
|
@@ -928,13 +928,13 @@ function Ma() {
|
|
|
928
928
|
}, u.finalize), e();
|
|
929
929
|
}, r, n, a);
|
|
930
930
|
});
|
|
931
|
-
} }), Ge && (Ge.allSettled && Ae(
|
|
931
|
+
} }), Ge && (Ge.allSettled && Ae(j, "allSettled", function() {
|
|
932
932
|
var e = Ee.apply(null, arguments).map(Ct);
|
|
933
|
-
return new
|
|
933
|
+
return new j(function(r) {
|
|
934
934
|
e.length === 0 && r([]);
|
|
935
935
|
var n = e.length, a = new Array(n);
|
|
936
936
|
e.forEach(function(s, c) {
|
|
937
|
-
return
|
|
937
|
+
return j.resolve(s).then(function(u) {
|
|
938
938
|
return a[c] = { status: "fulfilled", value: u };
|
|
939
939
|
}, function(u) {
|
|
940
940
|
return a[c] = { status: "rejected", reason: u };
|
|
@@ -943,24 +943,24 @@ function Ma() {
|
|
|
943
943
|
});
|
|
944
944
|
});
|
|
945
945
|
});
|
|
946
|
-
}), Ge.any && typeof AggregateError < "u" && Ae(
|
|
946
|
+
}), Ge.any && typeof AggregateError < "u" && Ae(j, "any", function() {
|
|
947
947
|
var e = Ee.apply(null, arguments).map(Ct);
|
|
948
|
-
return new
|
|
948
|
+
return new j(function(r, n) {
|
|
949
949
|
e.length === 0 && n(new AggregateError([]));
|
|
950
950
|
var a = e.length, s = new Array(a);
|
|
951
951
|
e.forEach(function(c, u) {
|
|
952
|
-
return
|
|
952
|
+
return j.resolve(c).then(function(d) {
|
|
953
953
|
return r(d);
|
|
954
954
|
}, function(d) {
|
|
955
955
|
s[u] = d, --a || n(new AggregateError(s));
|
|
956
956
|
});
|
|
957
957
|
});
|
|
958
958
|
});
|
|
959
|
-
}), Ge.withResolvers && (
|
|
959
|
+
}), Ge.withResolvers && (j.withResolvers = Ge.withResolvers));
|
|
960
960
|
var ne = { awaits: 0, echoes: 0, id: 0 }, na = 0, Rt = [], xt = 0, kt = 0, aa = 0;
|
|
961
961
|
function De(e, r, n, a) {
|
|
962
962
|
var s = B, c = Object.create(s);
|
|
963
|
-
return c.parent = s, c.ref = 0, c.global = !1, c.id = ++aa, Pe.env, c.env = or ? { Promise:
|
|
963
|
+
return c.parent = s, c.ref = 0, c.global = !1, c.id = ++aa, Pe.env, c.env = or ? { Promise: j, PromiseProp: { value: j, configurable: !0, writable: !0 }, all: j.all, race: j.race, allSettled: j.allSettled, any: j.any, resolve: j.resolve, reject: j.reject } : {}, r && te(c, r), ++s.ref, c.finalize = function() {
|
|
964
964
|
--this.parent.ref || this.parent.finalize();
|
|
965
965
|
}, a = Le(c, e, n, a), c.ref === 0 && c.finalize(), a;
|
|
966
966
|
}
|
|
@@ -1014,7 +1014,7 @@ function Ma() {
|
|
|
1014
1014
|
Promise === Ge && ne.echoes === 0 ? xt === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
1015
1015
|
}
|
|
1016
1016
|
("" + he).indexOf("[native code]") === -1 && (qe = Ie = Q);
|
|
1017
|
-
var q =
|
|
1017
|
+
var q = j.reject, We = "", we = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", sn = "String expected.", et = [], $t = "__dbnames", gr = "readonly", pr = "readwrite";
|
|
1018
1018
|
function Fe(e, r) {
|
|
1019
1019
|
return e ? r ? function() {
|
|
1020
1020
|
return e.apply(this, arguments) && r.apply(this, arguments);
|
|
@@ -1123,8 +1123,8 @@ function Ma() {
|
|
|
1123
1123
|
}).then(r);
|
|
1124
1124
|
}, J.prototype.where = function(e) {
|
|
1125
1125
|
if (typeof e == "string") return new this.db.WhereClause(this, e);
|
|
1126
|
-
if (
|
|
1127
|
-
var r =
|
|
1126
|
+
if (M(e)) return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
|
|
1127
|
+
var r = N(e);
|
|
1128
1128
|
if (r.length === 1) return this.where(r[0]).equals(e[r[0]]);
|
|
1129
1129
|
var n = this.schema.indexes.concat(this.schema.primKey).filter(function(d) {
|
|
1130
1130
|
if (d.compound && r.every(function(b) {
|
|
@@ -1151,7 +1151,7 @@ function Ma() {
|
|
|
1151
1151
|
var u = r.reduce(function(f, g) {
|
|
1152
1152
|
var b = f[0], w = f[1], f = a[g], O = e[g];
|
|
1153
1153
|
return [b || f, b || !f ? Fe(w, f && f.multi ? function(m) {
|
|
1154
|
-
return m = ve(m, g),
|
|
1154
|
+
return m = ve(m, g), M(m) && m.some(function(E) {
|
|
1155
1155
|
return s(O, E);
|
|
1156
1156
|
});
|
|
1157
1157
|
} : function(m) {
|
|
@@ -1174,7 +1174,7 @@ function Ma() {
|
|
|
1174
1174
|
}, J.prototype.toCollection = function() {
|
|
1175
1175
|
return new this.db.Collection(new this.db.WhereClause(this));
|
|
1176
1176
|
}, J.prototype.orderBy = function(e) {
|
|
1177
|
-
return new this.db.Collection(new this.db.WhereClause(this,
|
|
1177
|
+
return new this.db.Collection(new this.db.WhereClause(this, M(e) ? "[".concat(e.join("+"), "]") : e));
|
|
1178
1178
|
}, J.prototype.reverse = function() {
|
|
1179
1179
|
return this.toCollection().reverse();
|
|
1180
1180
|
}, J.prototype.mapToClass = function(e) {
|
|
@@ -1215,7 +1215,7 @@ function Ma() {
|
|
|
1215
1215
|
return c && s && (u = jt(c)(e)), this._trans("readwrite", function(d) {
|
|
1216
1216
|
return n.core.mutate({ trans: d, type: "add", keys: r != null ? [r] : null, values: [u] });
|
|
1217
1217
|
}).then(function(d) {
|
|
1218
|
-
return d.numFailures ?
|
|
1218
|
+
return d.numFailures ? j.reject(d.failures[0]) : d.lastResult;
|
|
1219
1219
|
}).then(function(d) {
|
|
1220
1220
|
if (c) try {
|
|
1221
1221
|
le(e, c, d);
|
|
@@ -1224,13 +1224,13 @@ function Ma() {
|
|
|
1224
1224
|
return d;
|
|
1225
1225
|
});
|
|
1226
1226
|
}, J.prototype.update = function(e, r) {
|
|
1227
|
-
return typeof e != "object" ||
|
|
1227
|
+
return typeof e != "object" || M(e) ? this.where(":id").equals(e).modify(r) : (e = ve(e, this.schema.primKey.keyPath), e === void 0 ? q(new L.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(r));
|
|
1228
1228
|
}, J.prototype.put = function(e, r) {
|
|
1229
1229
|
var n = this, a = this.schema.primKey, s = a.auto, c = a.keyPath, u = e;
|
|
1230
1230
|
return c && s && (u = jt(c)(e)), this._trans("readwrite", function(d) {
|
|
1231
1231
|
return n.core.mutate({ trans: d, type: "put", values: [u], keys: r != null ? [r] : null });
|
|
1232
1232
|
}).then(function(d) {
|
|
1233
|
-
return d.numFailures ?
|
|
1233
|
+
return d.numFailures ? j.reject(d.failures[0]) : d.lastResult;
|
|
1234
1234
|
}).then(function(d) {
|
|
1235
1235
|
if (c) try {
|
|
1236
1236
|
le(e, c, d);
|
|
@@ -1243,14 +1243,14 @@ function Ma() {
|
|
|
1243
1243
|
return this._trans("readwrite", function(n) {
|
|
1244
1244
|
return r.core.mutate({ trans: n, type: "delete", keys: [e] });
|
|
1245
1245
|
}).then(function(n) {
|
|
1246
|
-
return n.numFailures ?
|
|
1246
|
+
return n.numFailures ? j.reject(n.failures[0]) : void 0;
|
|
1247
1247
|
});
|
|
1248
1248
|
}, J.prototype.clear = function() {
|
|
1249
1249
|
var e = this;
|
|
1250
1250
|
return this._trans("readwrite", function(r) {
|
|
1251
1251
|
return e.core.mutate({ trans: r, type: "deleteRange", range: on });
|
|
1252
1252
|
}).then(function(r) {
|
|
1253
|
-
return r.numFailures ?
|
|
1253
|
+
return r.numFailures ? j.reject(r.failures[0]) : void 0;
|
|
1254
1254
|
});
|
|
1255
1255
|
}, J.prototype.bulkGet = function(e) {
|
|
1256
1256
|
var r = this;
|
|
@@ -1357,9 +1357,9 @@ function Ma() {
|
|
|
1357
1357
|
} };
|
|
1358
1358
|
return n[u] = r[u] = w;
|
|
1359
1359
|
}
|
|
1360
|
-
|
|
1360
|
+
N(b = u).forEach(function(f) {
|
|
1361
1361
|
var O = b[f];
|
|
1362
|
-
if (
|
|
1362
|
+
if (M(O)) c(f, b[f][0], b[f][1]);
|
|
1363
1363
|
else {
|
|
1364
1364
|
if (O !== "asap") throw new L.InvalidArgument("Invalid event config");
|
|
1365
1365
|
var m = c(f, it, function() {
|
|
@@ -1439,7 +1439,7 @@ function Ma() {
|
|
|
1439
1439
|
var r = this["@@propmod"];
|
|
1440
1440
|
if (r.add !== void 0) {
|
|
1441
1441
|
var n = r.add;
|
|
1442
|
-
if (
|
|
1442
|
+
if (M(n)) return p(p([], M(e) ? e : [], !0), n).sort();
|
|
1443
1443
|
if (typeof n == "number") return (Number(e) || 0) + n;
|
|
1444
1444
|
if (typeof n == "bigint") try {
|
|
1445
1445
|
return BigInt(e) + n;
|
|
@@ -1450,7 +1450,7 @@ function Ma() {
|
|
|
1450
1450
|
}
|
|
1451
1451
|
if (r.remove !== void 0) {
|
|
1452
1452
|
var a = r.remove;
|
|
1453
|
-
if (
|
|
1453
|
+
if (M(a)) return M(e) ? e.filter(function(s) {
|
|
1454
1454
|
return !a.includes(s);
|
|
1455
1455
|
}).sort() : [];
|
|
1456
1456
|
if (typeof a == "number") return Number(e) - a;
|
|
@@ -1631,10 +1631,10 @@ function Ma() {
|
|
|
1631
1631
|
var r = this, n = this._ctx;
|
|
1632
1632
|
return this._write(function(a) {
|
|
1633
1633
|
var s, c, u;
|
|
1634
|
-
u = typeof e == "function" ? e : (s =
|
|
1634
|
+
u = typeof e == "function" ? e : (s = N(e), c = s.length, function(v) {
|
|
1635
1635
|
for (var A = !1, P = 0; P < c; ++P) {
|
|
1636
|
-
var D = s[P], I = e[D],
|
|
1637
|
-
I instanceof gt ? (le(v, D, I.execute(
|
|
1636
|
+
var D = s[P], I = e[D], T = ve(v, D);
|
|
1637
|
+
I instanceof gt ? (le(v, D, I.execute(T)), A = !0) : T !== I && (le(v, D, I), A = !0);
|
|
1638
1638
|
}
|
|
1639
1639
|
return A;
|
|
1640
1640
|
});
|
|
@@ -1643,8 +1643,8 @@ function Ma() {
|
|
|
1643
1643
|
function O(v, D) {
|
|
1644
1644
|
var P = D.failures, D = D.numFailures;
|
|
1645
1645
|
E += v - D;
|
|
1646
|
-
for (var I = 0,
|
|
1647
|
-
var C =
|
|
1646
|
+
for (var I = 0, T = N(P); I < T.length; I++) {
|
|
1647
|
+
var C = T[I];
|
|
1648
1648
|
m.push(P[C]);
|
|
1649
1649
|
}
|
|
1650
1650
|
}
|
|
@@ -1652,21 +1652,21 @@ function Ma() {
|
|
|
1652
1652
|
return r.clone().primaryKeys().then(function(v) {
|
|
1653
1653
|
function A(D) {
|
|
1654
1654
|
var I = Math.min(w, v.length - D);
|
|
1655
|
-
return d.getMany({ trans: a, keys: v.slice(D, D + I), cache: "immutable" }).then(function(
|
|
1656
|
-
for (var C = [],
|
|
1657
|
-
var G =
|
|
1658
|
-
u.call(F, F.value, F) !== !1 && (F.value == null ?
|
|
1655
|
+
return d.getMany({ trans: a, keys: v.slice(D, D + I), cache: "immutable" }).then(function(T) {
|
|
1656
|
+
for (var C = [], R = [], x = g ? [] : null, $ = [], k = 0; k < I; ++k) {
|
|
1657
|
+
var G = T[k], F = { value: Ce(G), primKey: v[D + k] };
|
|
1658
|
+
u.call(F, F.value, F) !== !1 && (F.value == null ? $.push(v[D + k]) : g || H(b(G), b(F.value)) === 0 ? (R.push(F.value), g && x.push(v[D + k])) : ($.push(v[D + k]), C.push(F.value)));
|
|
1659
1659
|
}
|
|
1660
1660
|
return Promise.resolve(0 < C.length && d.mutate({ trans: a, type: "add", values: C }).then(function(U) {
|
|
1661
|
-
for (var z in U.failures)
|
|
1661
|
+
for (var z in U.failures) $.splice(parseInt(z), 1);
|
|
1662
1662
|
O(C.length, U);
|
|
1663
1663
|
})).then(function() {
|
|
1664
|
-
return (0 <
|
|
1665
|
-
return O(
|
|
1664
|
+
return (0 < R.length || P && typeof e == "object") && d.mutate({ trans: a, type: "put", keys: x, values: R, criteria: P, changeSpec: typeof e != "function" && e, isAdditionalChunk: 0 < D }).then(function(U) {
|
|
1665
|
+
return O(R.length, U);
|
|
1666
1666
|
});
|
|
1667
1667
|
}).then(function() {
|
|
1668
|
-
return (0 <
|
|
1669
|
-
return O(
|
|
1668
|
+
return (0 < $.length || P && e === br) && d.mutate({ trans: a, type: "delete", keys: $, criteria: P, isAdditionalChunk: 0 < D }).then(function(U) {
|
|
1669
|
+
return O($.length, U);
|
|
1670
1670
|
});
|
|
1671
1671
|
}).then(function() {
|
|
1672
1672
|
return v.length > D + I && A(D + w);
|
|
@@ -1752,15 +1752,15 @@ function Ma() {
|
|
|
1752
1752
|
var P = c(A);
|
|
1753
1753
|
if (r(P, g, m)) return !0;
|
|
1754
1754
|
for (var D = null, I = m; I < f; ++I) {
|
|
1755
|
-
var
|
|
1756
|
-
for (var F = Math.min(C.length,
|
|
1757
|
-
var fe =
|
|
1758
|
-
if (fe !==
|
|
1755
|
+
var T = function(C, R, x, $, k, G) {
|
|
1756
|
+
for (var F = Math.min(C.length, $.length), U = -1, z = 0; z < F; ++z) {
|
|
1757
|
+
var fe = R[z];
|
|
1758
|
+
if (fe !== $[z]) return k(C[z], x[z]) < 0 ? C.substr(0, z) + x[z] + x.substr(z + 1) : k(C[z], $[z]) < 0 ? C.substr(0, z) + $[z] + x.substr(z + 1) : 0 <= U ? C.substr(0, U) + R[U] + x.substr(U + 1) : null;
|
|
1759
1759
|
k(C[z], fe) < 0 && (U = z);
|
|
1760
1760
|
}
|
|
1761
|
-
return F <
|
|
1761
|
+
return F < $.length && G === "next" ? C + x.substr(C.length) : F < C.length && G === "prev" ? C.substr(0, x.length) : U < 0 ? null : C.substr(0, U) + $[U] + x.substr(U + 1);
|
|
1762
1762
|
}(A, P, d[I], g[I], u, b);
|
|
1763
|
-
|
|
1763
|
+
T === null && D === null ? m = I + 1 : (D === null || 0 < u(D, T)) && (D = T);
|
|
1764
1764
|
}
|
|
1765
1765
|
return S(D !== null ? function() {
|
|
1766
1766
|
E.continue(D + w);
|
|
@@ -1873,14 +1873,14 @@ function Ma() {
|
|
|
1873
1873
|
}
|
|
1874
1874
|
try {
|
|
1875
1875
|
(w = A.reduce(function(P, D) {
|
|
1876
|
-
for (var I = 0,
|
|
1876
|
+
for (var I = 0, T = P.length; I < T; ++I) {
|
|
1877
1877
|
var C = P[I];
|
|
1878
1878
|
if (a(D[0], C[1]) < 0 && 0 < a(D[1], C[0])) {
|
|
1879
1879
|
C[0] = u(C[0], D[0]), C[1] = d(C[1], D[1]);
|
|
1880
1880
|
break;
|
|
1881
1881
|
}
|
|
1882
1882
|
}
|
|
1883
|
-
return I ===
|
|
1883
|
+
return I === T && P.push(D), P;
|
|
1884
1884
|
}, [])).sort(O);
|
|
1885
1885
|
} catch {
|
|
1886
1886
|
return de(this, we);
|
|
@@ -1899,8 +1899,8 @@ function Ma() {
|
|
|
1899
1899
|
return A._ondirectionchange = function(P) {
|
|
1900
1900
|
f = P === "next" ? (v = E, s) : (v = S, c), w.sort(O);
|
|
1901
1901
|
}, A._addAlgorithm(function(P, D, I) {
|
|
1902
|
-
for (var
|
|
1903
|
-
return !E(
|
|
1902
|
+
for (var T, C = P.key; v(C); ) if (++m === w.length) return D(I), !1;
|
|
1903
|
+
return !E(T = C) && !S(T) || (n._cmp(C, w[m][1]) === 0 || n._cmp(C, w[m][0]) === 0 || D(function() {
|
|
1904
1904
|
f === s ? P.continue(w[m][0]) : P.continue(w[m][1]);
|
|
1905
1905
|
}), !1);
|
|
1906
1906
|
}), A;
|
|
@@ -1959,13 +1959,13 @@ function Ma() {
|
|
|
1959
1959
|
var a = this;
|
|
1960
1960
|
if (e === "readwrite" && this.mode !== "readwrite") return q(new L.ReadOnly("Transaction is readonly"));
|
|
1961
1961
|
if (!this.active) return q(new L.TransactionInactive());
|
|
1962
|
-
if (this._locked()) return new
|
|
1962
|
+
if (this._locked()) return new j(function(c, u) {
|
|
1963
1963
|
a._blockedFuncs.push([function() {
|
|
1964
1964
|
a._promise(e, r, n).then(c, u);
|
|
1965
1965
|
}, B]);
|
|
1966
1966
|
});
|
|
1967
1967
|
if (n) return De(function() {
|
|
1968
|
-
var c = new
|
|
1968
|
+
var c = new j(function(u, d) {
|
|
1969
1969
|
a._lock();
|
|
1970
1970
|
var g = r(u, d, a);
|
|
1971
1971
|
g && g.then && g.then(u, d);
|
|
@@ -1974,7 +1974,7 @@ function Ma() {
|
|
|
1974
1974
|
return a._unlock();
|
|
1975
1975
|
}), c._lib = !0, c;
|
|
1976
1976
|
});
|
|
1977
|
-
var s = new
|
|
1977
|
+
var s = new j(function(c, u) {
|
|
1978
1978
|
var d = r(c, u, a);
|
|
1979
1979
|
d && d.then && d.then(c, u);
|
|
1980
1980
|
});
|
|
@@ -1982,7 +1982,7 @@ function Ma() {
|
|
|
1982
1982
|
}, be.prototype._root = function() {
|
|
1983
1983
|
return this.parent ? this.parent._root() : this;
|
|
1984
1984
|
}, be.prototype.waitFor = function(e) {
|
|
1985
|
-
var r, n = this._root(), a =
|
|
1985
|
+
var r, n = this._root(), a = j.resolve(e);
|
|
1986
1986
|
n._waitingFor ? n._waitingFor = n._waitingFor.then(function() {
|
|
1987
1987
|
return a;
|
|
1988
1988
|
}) : (n._waitingFor = a, n._waitingQueue = [], r = n.idbtrans.objectStore(n.storeNames[0]), function c() {
|
|
@@ -1990,7 +1990,7 @@ function Ma() {
|
|
|
1990
1990
|
n._waitingFor && (r.get(-1 / 0).onsuccess = c);
|
|
1991
1991
|
}());
|
|
1992
1992
|
var s = n._waitingFor;
|
|
1993
|
-
return new
|
|
1993
|
+
return new j(function(c, u) {
|
|
1994
1994
|
a.then(function(d) {
|
|
1995
1995
|
return n._waitingQueue.push(Z(c.bind(null, d)));
|
|
1996
1996
|
}, function(d) {
|
|
@@ -2064,29 +2064,29 @@ function Ma() {
|
|
|
2064
2064
|
var m, E = O.name;
|
|
2065
2065
|
return { name: E, schema: O, mutate: function(S) {
|
|
2066
2066
|
var v = S.trans, A = S.type, P = S.keys, D = S.values, I = S.range;
|
|
2067
|
-
return new Promise(function(
|
|
2068
|
-
|
|
2069
|
-
var
|
|
2070
|
-
if (
|
|
2067
|
+
return new Promise(function(T, C) {
|
|
2068
|
+
T = Z(T);
|
|
2069
|
+
var R = v.objectStore(E), x = R.keyPath == null, $ = A === "put" || A === "add";
|
|
2070
|
+
if (!$ && A !== "delete" && A !== "deleteRange") throw new Error("Invalid operation type: " + A);
|
|
2071
2071
|
var k, G = (P || D || { length: 1 }).length;
|
|
2072
2072
|
if (P && D && P.length !== D.length) throw new Error("Given keys array must have same length as given values array.");
|
|
2073
|
-
if (G === 0) return
|
|
2073
|
+
if (G === 0) return T({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
2074
2074
|
function F(ue) {
|
|
2075
2075
|
++fe, pt(ue);
|
|
2076
2076
|
}
|
|
2077
2077
|
var U = [], z = [], fe = 0;
|
|
2078
2078
|
if (A === "deleteRange") {
|
|
2079
|
-
if (I.type === 4) return
|
|
2080
|
-
I.type === 3 ? U.push(k =
|
|
2079
|
+
if (I.type === 4) return T({ numFailures: fe, failures: z, results: [], lastResult: void 0 });
|
|
2080
|
+
I.type === 3 ? U.push(k = R.clear()) : U.push(k = R.delete(a(I)));
|
|
2081
2081
|
} else {
|
|
2082
|
-
var x =
|
|
2083
|
-
if (
|
|
2084
|
-
else for (ce = 0; ce < G; ++ce) U.push(k =
|
|
2082
|
+
var x = $ ? x ? [D, P] : [D, null] : [P, null], W = x[0], ie = x[1];
|
|
2083
|
+
if ($) for (var ce = 0; ce < G; ++ce) U.push(k = ie && ie[ce] !== void 0 ? R[A](W[ce], ie[ce]) : R[A](W[ce])), k.onerror = F;
|
|
2084
|
+
else for (ce = 0; ce < G; ++ce) U.push(k = R[A](W[ce])), k.onerror = F;
|
|
2085
2085
|
}
|
|
2086
2086
|
function Zt(ue) {
|
|
2087
2087
|
ue = ue.target.result, U.forEach(function(He, Br) {
|
|
2088
2088
|
return He.error != null && (z[Br] = He.error);
|
|
2089
|
-
}),
|
|
2089
|
+
}), T({ numFailures: fe, failures: z, results: A === "delete" ? P : U.map(function(He) {
|
|
2090
2090
|
return He.result;
|
|
2091
2091
|
}), lastResult: ue });
|
|
2092
2092
|
}
|
|
@@ -2098,37 +2098,37 @@ function Ma() {
|
|
|
2098
2098
|
var v = S.trans, A = S.keys;
|
|
2099
2099
|
return new Promise(function(P, D) {
|
|
2100
2100
|
P = Z(P);
|
|
2101
|
-
for (var I,
|
|
2102
|
-
U = U.target,
|
|
2103
|
-
}, G = ye(D), F = 0; F < C; ++F) A[F] != null && ((I =
|
|
2104
|
-
x === 0 && P(
|
|
2101
|
+
for (var I, T = v.objectStore(E), C = A.length, R = new Array(C), x = 0, $ = 0, k = function(U) {
|
|
2102
|
+
U = U.target, R[U._pos] = U.result, ++$ === x && P(R);
|
|
2103
|
+
}, G = ye(D), F = 0; F < C; ++F) A[F] != null && ((I = T.get(A[F]))._pos = F, I.onsuccess = k, I.onerror = G, ++x);
|
|
2104
|
+
x === 0 && P(R);
|
|
2105
2105
|
});
|
|
2106
2106
|
}, get: function(S) {
|
|
2107
2107
|
var v = S.trans, A = S.key;
|
|
2108
2108
|
return new Promise(function(P, D) {
|
|
2109
2109
|
P = Z(P);
|
|
2110
2110
|
var I = v.objectStore(E).get(A);
|
|
2111
|
-
I.onsuccess = function(
|
|
2112
|
-
return P(
|
|
2111
|
+
I.onsuccess = function(T) {
|
|
2112
|
+
return P(T.target.result);
|
|
2113
2113
|
}, I.onerror = ye(D);
|
|
2114
2114
|
});
|
|
2115
2115
|
}, query: (m = b, function(S) {
|
|
2116
2116
|
return new Promise(function(v, A) {
|
|
2117
2117
|
v = Z(v);
|
|
2118
|
-
var P, D, I, x = S.trans,
|
|
2118
|
+
var P, D, I, x = S.trans, T = S.values, C = S.limit, k = S.query, R = C === 1 / 0 ? void 0 : C, $ = k.index, k = k.range, x = x.objectStore(E), $ = $.isPrimaryKey ? x : x.index($.name), k = a(k);
|
|
2119
2119
|
if (C === 0) return v({ result: [] });
|
|
2120
|
-
m ? ((
|
|
2120
|
+
m ? ((R = T ? $.getAll(k, R) : $.getAllKeys(k, R)).onsuccess = function(G) {
|
|
2121
2121
|
return v({ result: G.target.result });
|
|
2122
|
-
},
|
|
2122
|
+
}, R.onerror = ye(A)) : (P = 0, D = !T && "openKeyCursor" in $ ? $.openKeyCursor(k) : $.openCursor(k), I = [], D.onsuccess = function(G) {
|
|
2123
2123
|
var F = D.result;
|
|
2124
|
-
return F ? (I.push(
|
|
2124
|
+
return F ? (I.push(T ? F.value : F.primaryKey), ++P === C ? v({ result: I }) : void F.continue()) : v({ result: I });
|
|
2125
2125
|
}, D.onerror = ye(A));
|
|
2126
2126
|
});
|
|
2127
2127
|
}), openCursor: function(S) {
|
|
2128
2128
|
var v = S.trans, A = S.values, P = S.query, D = S.reverse, I = S.unique;
|
|
2129
|
-
return new Promise(function(
|
|
2130
|
-
|
|
2131
|
-
var
|
|
2129
|
+
return new Promise(function(T, C) {
|
|
2130
|
+
T = Z(T);
|
|
2131
|
+
var $ = P.index, R = P.range, x = v.objectStore(E), x = $.isPrimaryKey ? x : x.index($.name), $ = D ? I ? "prevunique" : "prev" : I ? "nextunique" : "next", k = !A && "openKeyCursor" in x ? x.openKeyCursor(a(R), $) : x.openCursor(a(R), $);
|
|
2132
2132
|
k.onerror = ye(C), k.onsuccess = Z(function(G) {
|
|
2133
2133
|
var F, U, z, fe, W = k.result;
|
|
2134
2134
|
W ? (W.___id = ++la, W.done = !1, F = W.continue.bind(W), U = (U = W.continuePrimaryKey) && U.bind(W), z = W.advance.bind(W), fe = function() {
|
|
@@ -2161,27 +2161,27 @@ function Ma() {
|
|
|
2161
2161
|
return k.onsuccess = Z(function(ue) {
|
|
2162
2162
|
k.onsuccess = ce, ce();
|
|
2163
2163
|
}), W.continue = F, W.continuePrimaryKey = U, W.advance = z, ce(), Zt;
|
|
2164
|
-
},
|
|
2164
|
+
}, T(W)) : T(null);
|
|
2165
2165
|
}, C);
|
|
2166
2166
|
});
|
|
2167
2167
|
}, count: function(S) {
|
|
2168
2168
|
var v = S.query, A = S.trans, P = v.index, D = v.range;
|
|
2169
|
-
return new Promise(function(I,
|
|
2170
|
-
var C = A.objectStore(E),
|
|
2171
|
-
|
|
2169
|
+
return new Promise(function(I, T) {
|
|
2170
|
+
var C = A.objectStore(E), R = P.isPrimaryKey ? C : C.index(P.name), C = a(D), R = C ? R.count(C) : R.count();
|
|
2171
|
+
R.onsuccess = Z(function(x) {
|
|
2172
2172
|
return I(x.target.result);
|
|
2173
|
-
}),
|
|
2173
|
+
}), R.onerror = ye(T);
|
|
2174
2174
|
});
|
|
2175
2175
|
} };
|
|
2176
2176
|
}
|
|
2177
2177
|
var c, u, d, w = (u = g, d = bn((c = e).objectStoreNames), { schema: { name: c.name, tables: d.map(function(O) {
|
|
2178
2178
|
return u.objectStore(O);
|
|
2179
2179
|
}).map(function(O) {
|
|
2180
|
-
var m = O.keyPath, v = O.autoIncrement, E =
|
|
2180
|
+
var m = O.keyPath, v = O.autoIncrement, E = M(m), S = {}, v = { name: O.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: m == null, compound: E, keyPath: m, autoIncrement: v, unique: !0, extractKey: Sr(m) }, indexes: bn(O.indexNames).map(function(A) {
|
|
2181
2181
|
return O.index(A);
|
|
2182
2182
|
}).map(function(I) {
|
|
2183
|
-
var P = I.name, D = I.unique,
|
|
2184
|
-
return S[bt(I)] =
|
|
2183
|
+
var P = I.name, D = I.unique, T = I.multiEntry, I = I.keyPath, T = { name: P, compound: M(I), keyPath: I, unique: D, multiEntry: T, extractKey: Sr(I) };
|
|
2184
|
+
return S[bt(I)] = T;
|
|
2185
2185
|
}), getIndexByKeyPath: function(A) {
|
|
2186
2186
|
return S[bt(A)];
|
|
2187
2187
|
} };
|
|
@@ -2241,7 +2241,7 @@ function Ma() {
|
|
|
2241
2241
|
De(function() {
|
|
2242
2242
|
return B.trans = c, B.transless = d, r !== 0 ? (Bt(e, n), b = r, ((g = c).storeNames.includes("$meta") ? g.table("$meta").get("version").then(function(w) {
|
|
2243
2243
|
return w ?? b;
|
|
2244
|
-
}) :
|
|
2244
|
+
}) : j.resolve(b)).then(function(w) {
|
|
2245
2245
|
return O = w, m = c, E = n, S = [], w = (f = e)._versions, v = f._dbSchema = Ft(0, f.idbdb, E), (w = w.filter(function(A) {
|
|
2246
2246
|
return A._cfg.version >= O;
|
|
2247
2247
|
})).length !== 0 ? (w.forEach(function(A) {
|
|
@@ -2249,37 +2249,37 @@ function Ma() {
|
|
|
2249
2249
|
var P = v, D = A._cfg.dbschema;
|
|
2250
2250
|
Ut(f, P, E), Ut(f, D, E), v = f._dbSchema = D;
|
|
2251
2251
|
var I = _r(P, D);
|
|
2252
|
-
I.add.forEach(function(
|
|
2253
|
-
Ar(E,
|
|
2254
|
-
}), I.change.forEach(function(
|
|
2255
|
-
if (
|
|
2256
|
-
var k = E.objectStore(
|
|
2257
|
-
|
|
2252
|
+
I.add.forEach(function($) {
|
|
2253
|
+
Ar(E, $[0], $[1].primKey, $[1].indexes);
|
|
2254
|
+
}), I.change.forEach(function($) {
|
|
2255
|
+
if ($.recreate) throw new L.Upgrade("Not yet support for changing primary key");
|
|
2256
|
+
var k = E.objectStore($.name);
|
|
2257
|
+
$.add.forEach(function(G) {
|
|
2258
2258
|
return Wt(k, G);
|
|
2259
|
-
}),
|
|
2259
|
+
}), $.change.forEach(function(G) {
|
|
2260
2260
|
k.deleteIndex(G.name), Wt(k, G);
|
|
2261
|
-
}),
|
|
2261
|
+
}), $.del.forEach(function(G) {
|
|
2262
2262
|
return k.deleteIndex(G);
|
|
2263
2263
|
});
|
|
2264
2264
|
});
|
|
2265
|
-
var
|
|
2266
|
-
if (
|
|
2265
|
+
var T = A._cfg.contentUpgrade;
|
|
2266
|
+
if (T && A._cfg.version > O) {
|
|
2267
2267
|
Bt(f, E), m._memoizedTables = {};
|
|
2268
2268
|
var C = Yr(D);
|
|
2269
|
-
I.del.forEach(function(
|
|
2270
|
-
C[
|
|
2271
|
-
}), Or(f, [f.Transaction.prototype]), Lt(f, [f.Transaction.prototype],
|
|
2272
|
-
var
|
|
2273
|
-
return x && qe(), I =
|
|
2274
|
-
var
|
|
2275
|
-
(
|
|
2276
|
-
}),
|
|
2277
|
-
return
|
|
2269
|
+
I.del.forEach(function($) {
|
|
2270
|
+
C[$] = P[$];
|
|
2271
|
+
}), Or(f, [f.Transaction.prototype]), Lt(f, [f.Transaction.prototype], N(C), C), m.schema = C;
|
|
2272
|
+
var R, x = nr(T);
|
|
2273
|
+
return x && qe(), I = j.follow(function() {
|
|
2274
|
+
var $;
|
|
2275
|
+
(R = T(m)) && x && ($ = Ie.bind(null, null), R.then($, $));
|
|
2276
|
+
}), R && typeof R.then == "function" ? j.resolve(R) : I.then(function() {
|
|
2277
|
+
return R;
|
|
2278
2278
|
});
|
|
2279
2279
|
}
|
|
2280
2280
|
}), S.push(function(P) {
|
|
2281
|
-
var D, I,
|
|
2282
|
-
D =
|
|
2281
|
+
var D, I, T = A._cfg.dbschema;
|
|
2282
|
+
D = T, I = P, [].slice.call(I.db.objectStoreNames).forEach(function(C) {
|
|
2283
2283
|
return D[C] == null && I.db.deleteObjectStore(C);
|
|
2284
2284
|
}), Or(f, [f.Transaction.prototype]), Lt(f, [f.Transaction.prototype], f._storeNames, f._dbSchema), m.schema = f._dbSchema;
|
|
2285
2285
|
}), S.push(function(P) {
|
|
@@ -2288,14 +2288,14 @@ function Ma() {
|
|
|
2288
2288
|
})) : P.objectStore("$meta").put(A._cfg.version, "version"));
|
|
2289
2289
|
});
|
|
2290
2290
|
}), function A() {
|
|
2291
|
-
return S.length ?
|
|
2291
|
+
return S.length ? j.resolve(S.shift()(m.idbtrans)).then(A) : j.resolve();
|
|
2292
2292
|
}().then(function() {
|
|
2293
2293
|
vn(v, E);
|
|
2294
|
-
})) :
|
|
2294
|
+
})) : j.resolve();
|
|
2295
2295
|
var f, O, m, E, S, v;
|
|
2296
|
-
}).catch(u)) : (
|
|
2296
|
+
}).catch(u)) : (N(s).forEach(function(w) {
|
|
2297
2297
|
Ar(n, w, s[w].primKey, s[w].indexes);
|
|
2298
|
-
}), Bt(e, n), void
|
|
2298
|
+
}), Bt(e, n), void j.follow(function() {
|
|
2299
2299
|
return e.on.populate.fire(c);
|
|
2300
2300
|
}).catch(u));
|
|
2301
2301
|
var g, b;
|
|
@@ -2344,7 +2344,7 @@ function Ma() {
|
|
|
2344
2344
|
}), s;
|
|
2345
2345
|
}
|
|
2346
2346
|
function vn(e, r) {
|
|
2347
|
-
|
|
2347
|
+
N(e).forEach(function(n) {
|
|
2348
2348
|
r.db.objectStoreNames.contains(n) || (me && console.debug("Dexie: Creating missing table", n), Ar(r, n, e[n].primKey, e[n].indexes));
|
|
2349
2349
|
});
|
|
2350
2350
|
}
|
|
@@ -2375,11 +2375,11 @@ function Ma() {
|
|
|
2375
2375
|
function En(e) {
|
|
2376
2376
|
return e.split(",").map(function(r, n) {
|
|
2377
2377
|
var a = (r = r.trim()).replace(/([&*]|\+\+)/g, ""), s = /^\[/.test(a) ? a.match(/^\[(.*)\]$/)[1].split("+") : a;
|
|
2378
|
-
return Er(a, s || null, /\&/.test(r), /\*/.test(r), /\+\+/.test(r),
|
|
2378
|
+
return Er(a, s || null, /\&/.test(r), /\*/.test(r), /\+\+/.test(r), M(s), n === 0);
|
|
2379
2379
|
});
|
|
2380
2380
|
}
|
|
2381
2381
|
var ma = (zt.prototype._parseStoresSpec = function(e, r) {
|
|
2382
|
-
|
|
2382
|
+
N(e).forEach(function(n) {
|
|
2383
2383
|
if (e[n] !== null) {
|
|
2384
2384
|
var a = En(e[n]), s = a.shift();
|
|
2385
2385
|
if (s.unique = !0, s.multi) throw new L.Schema("Primary key cannot be multi-valued");
|
|
@@ -2395,7 +2395,7 @@ function Ma() {
|
|
|
2395
2395
|
var n = r._versions, a = {}, s = {};
|
|
2396
2396
|
return n.forEach(function(c) {
|
|
2397
2397
|
te(a, c._cfg.storesSource), s = c._cfg.dbschema = {}, c._parseStoresSpec(a, s);
|
|
2398
|
-
}), r._dbSchema = s, Or(r, [r._allTables, r, r.Transaction.prototype]), Lt(r, [r._allTables, r, r.Transaction.prototype, this._cfg.tables],
|
|
2398
|
+
}), r._dbSchema = s, Or(r, [r._allTables, r, r.Transaction.prototype]), Lt(r, [r._allTables, r, r.Transaction.prototype, this._cfg.tables], N(s), s), r._storeNames = N(s), this;
|
|
2399
2399
|
}, zt.prototype.upgrade = function(e) {
|
|
2400
2400
|
return this._cfg.contentUpgrade = sr(this._cfg.contentUpgrade || Q, e), this;
|
|
2401
2401
|
}, zt);
|
|
@@ -2478,7 +2478,7 @@ function Ma() {
|
|
|
2478
2478
|
return (r ? n ? Math.max(r.d, n.d) : r.d : n ? n.d : 0) + 1;
|
|
2479
2479
|
}
|
|
2480
2480
|
function Vt(e, r) {
|
|
2481
|
-
return
|
|
2481
|
+
return N(r).forEach(function(n) {
|
|
2482
2482
|
e[n] ? Et(e[n], r[n]) : e[n] = function a(s) {
|
|
2483
2483
|
var c, u, d = {};
|
|
2484
2484
|
for (c in s) re(s, c) && (u = s[c], d[c] = !u || typeof u != "object" || Xr.has(u.constructor) ? u : a(u));
|
|
@@ -2550,7 +2550,7 @@ function Ma() {
|
|
|
2550
2550
|
if (r.openCanceller !== a) throw new L.DatabaseClosed("db.open() was cancelled");
|
|
2551
2551
|
}
|
|
2552
2552
|
function d() {
|
|
2553
|
-
return new
|
|
2553
|
+
return new j(function(O, m) {
|
|
2554
2554
|
if (u(), !n) throw new L.MissingAPI();
|
|
2555
2555
|
var E = e.name, S = r.autoSchema || !s ? n.open(E) : n.open(E, s);
|
|
2556
2556
|
if (!S) throw new L.MissingAPI();
|
|
@@ -2561,21 +2561,21 @@ function Ma() {
|
|
|
2561
2561
|
})) : (w.onerror = ye(m), v = v.oldVersion > Math.pow(2, 62) ? 0 : v.oldVersion, f = v < 1, e.idbdb = S.result, c && pa(e, w), ga(e, v / 10, w, m));
|
|
2562
2562
|
}, m), S.onsuccess = Z(function() {
|
|
2563
2563
|
w = null;
|
|
2564
|
-
var v, A, P, D, I,
|
|
2564
|
+
var v, A, P, D, I, T = e.idbdb = S.result, C = _t(T.objectStoreNames);
|
|
2565
2565
|
if (0 < C.length) try {
|
|
2566
|
-
var
|
|
2567
|
-
if (r.autoSchema) A =
|
|
2568
|
-
else if (Ut(e, e._dbSchema,
|
|
2566
|
+
var R = T.transaction((D = C).length === 1 ? D[0] : D, "readonly");
|
|
2567
|
+
if (r.autoSchema) A = T, P = R, (v = e).verno = A.version / 10, P = v._dbSchema = Ft(0, A, P), v._storeNames = _t(A.objectStoreNames, 0), Lt(v, [v._allTables], N(P), P);
|
|
2568
|
+
else if (Ut(e, e._dbSchema, R), ((I = _r(Ft(0, (I = e).idbdb, R), I._dbSchema)).add.length || I.change.some(function(x) {
|
|
2569
2569
|
return x.add.length || x.change.length;
|
|
2570
|
-
})) && !c) 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."),
|
|
2571
|
-
Bt(e,
|
|
2570
|
+
})) && !c) 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."), T.close(), s = T.version + 1, c = !0, O(d());
|
|
2571
|
+
Bt(e, R);
|
|
2572
2572
|
} catch {
|
|
2573
2573
|
}
|
|
2574
|
-
et.push(e),
|
|
2574
|
+
et.push(e), T.onversionchange = Z(function(x) {
|
|
2575
2575
|
r.vcFired = !0, e.on("versionchange").fire(x);
|
|
2576
|
-
}),
|
|
2576
|
+
}), T.onclose = Z(function(x) {
|
|
2577
2577
|
e.on("close").fire(x);
|
|
2578
|
-
}), f && (I = e._deps,
|
|
2578
|
+
}), f && (I = e._deps, R = E, T = I.indexedDB, I = I.IDBKeyRange, Dr(T) || R === $t || Pr(T, I).put({ name: R }).catch(Q)), O();
|
|
2579
2579
|
}, m);
|
|
2580
2580
|
}).catch(function(O) {
|
|
2581
2581
|
switch (O?.name) {
|
|
@@ -2585,11 +2585,11 @@ function Ma() {
|
|
|
2585
2585
|
case "VersionError":
|
|
2586
2586
|
if (0 < s) return s = 0, d();
|
|
2587
2587
|
}
|
|
2588
|
-
return
|
|
2588
|
+
return j.reject(O);
|
|
2589
2589
|
});
|
|
2590
2590
|
}
|
|
2591
2591
|
var g, b = r.dbReadyResolve, w = null, f = !1;
|
|
2592
|
-
return
|
|
2592
|
+
return j.race([a, (typeof navigator > "u" ? j.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(O) {
|
|
2593
2593
|
function m() {
|
|
2594
2594
|
return indexedDB.databases().finally(O);
|
|
2595
2595
|
}
|
|
@@ -2597,12 +2597,12 @@ function Ma() {
|
|
|
2597
2597
|
}).finally(function() {
|
|
2598
2598
|
return clearInterval(g);
|
|
2599
2599
|
}) : Promise.resolve()).then(d)]).then(function() {
|
|
2600
|
-
return u(), r.onReadyBeingFired = [],
|
|
2600
|
+
return u(), r.onReadyBeingFired = [], j.resolve(Ir(function() {
|
|
2601
2601
|
return e.on.ready.fire(e.vip);
|
|
2602
2602
|
})).then(function O() {
|
|
2603
2603
|
if (0 < r.onReadyBeingFired.length) {
|
|
2604
2604
|
var m = r.onReadyBeingFired.reduce(sr, Q);
|
|
2605
|
-
return r.onReadyBeingFired = [],
|
|
2605
|
+
return r.onReadyBeingFired = [], j.resolve(Ir(function() {
|
|
2606
2606
|
return m(e.vip);
|
|
2607
2607
|
})).then(O);
|
|
2608
2608
|
}
|
|
@@ -2637,13 +2637,13 @@ function Ma() {
|
|
|
2637
2637
|
function s(c) {
|
|
2638
2638
|
return function(g) {
|
|
2639
2639
|
var d = c(g), g = d.value;
|
|
2640
|
-
return d.done ? g : g && typeof g.then == "function" ? g.then(n, a) :
|
|
2640
|
+
return d.done ? g : g && typeof g.then == "function" ? g.then(n, a) : M(g) ? Promise.all(g).then(n, a) : n(g);
|
|
2641
2641
|
};
|
|
2642
2642
|
}
|
|
2643
2643
|
return s(r)();
|
|
2644
2644
|
}
|
|
2645
2645
|
function Qt(e, r, n) {
|
|
2646
|
-
for (var a =
|
|
2646
|
+
for (var a = M(e) ? e.slice() : [e], s = 0; s < n; ++s) a.push(r);
|
|
2647
2647
|
return a;
|
|
2648
2648
|
}
|
|
2649
2649
|
var ba = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
@@ -2693,10 +2693,10 @@ function Ma() {
|
|
|
2693
2693
|
} });
|
|
2694
2694
|
} };
|
|
2695
2695
|
function $r(e, r, n, a) {
|
|
2696
|
-
return n = n || {}, a = a || "",
|
|
2696
|
+
return n = n || {}, a = a || "", N(e).forEach(function(s) {
|
|
2697
2697
|
var c, u, d;
|
|
2698
2698
|
re(r, s) ? (c = e[s], u = r[s], typeof c == "object" && typeof u == "object" && c && u ? (d = tr(c)) !== tr(u) ? n[a + s] = r[s] : d === "Object" ? $r(c, u, n, a + s + ".") : c !== u && (n[a + s] = r[s]) : c !== u && (n[a + s] = r[s])) : n[a + s] = void 0;
|
|
2699
|
-
}),
|
|
2699
|
+
}), N(r).forEach(function(s) {
|
|
2700
2700
|
re(e, s) || (n[a + s] = r[s]);
|
|
2701
2701
|
}), n;
|
|
2702
2702
|
}
|
|
@@ -2743,17 +2743,17 @@ function Ma() {
|
|
|
2743
2743
|
if (!v) throw new Error("Keys missing");
|
|
2744
2744
|
return (f = f.type === "add" || f.type === "put" ? l(l({}, f), { keys: v }) : l({}, f)).type !== "delete" && (f.values = p([], f.values)), f.keys && (f.keys = p([], f.keys)), O = n, E = v, ((m = f).type === "add" ? Promise.resolve([]) : O.getMany({ trans: m.trans, keys: E, cache: "immutable" })).then(function(A) {
|
|
2745
2745
|
var P = v.map(function(D, I) {
|
|
2746
|
-
var
|
|
2747
|
-
return f.type === "delete" ? d.fire.call(
|
|
2748
|
-
re(
|
|
2749
|
-
}))),
|
|
2746
|
+
var T, C, R, x = A[I], $ = { onerror: null, onsuccess: null };
|
|
2747
|
+
return f.type === "delete" ? d.fire.call($, D, x, S) : f.type === "add" || x === void 0 ? (T = g.fire.call($, D, f.values[I], S), D == null && T != null && (f.keys[I] = D = T, a.outbound || le(f.values[I], a.keyPath, D))) : (T = $r(x, f.values[I]), (C = b.fire.call($, T, D, x, S)) && (R = f.values[I], Object.keys(C).forEach(function(k) {
|
|
2748
|
+
re(R, k) ? R[k] = C[k] : le(R, k, C[k]);
|
|
2749
|
+
}))), $;
|
|
2750
2750
|
});
|
|
2751
2751
|
return n.mutate(f).then(function(D) {
|
|
2752
|
-
for (var I = D.failures,
|
|
2753
|
-
var x = (
|
|
2754
|
-
x == null ?
|
|
2752
|
+
for (var I = D.failures, T = D.results, C = D.numFailures, D = D.lastResult, R = 0; R < v.length; ++R) {
|
|
2753
|
+
var x = (T || v)[R], $ = P[R];
|
|
2754
|
+
x == null ? $.onerror && $.onerror(I[R]) : $.onsuccess && $.onsuccess(f.type === "put" && A[R] ? f.values[R] : x);
|
|
2755
2755
|
}
|
|
2756
|
-
return { failures: I, results:
|
|
2756
|
+
return { failures: I, results: T, numFailures: C, lastResult: D };
|
|
2757
2757
|
}).catch(function(D) {
|
|
2758
2758
|
return P.forEach(function(I) {
|
|
2759
2759
|
return I.onerror && I.onerror(D);
|
|
@@ -2779,7 +2779,7 @@ function Ma() {
|
|
|
2779
2779
|
return l(l({}, n), { getMany: function(a) {
|
|
2780
2780
|
if (!a.cache) return n.getMany(a);
|
|
2781
2781
|
var s = An(a.keys, a.trans._cache, a.cache === "clone");
|
|
2782
|
-
return s ?
|
|
2782
|
+
return s ? j.resolve(s) : n.getMany(a).then(function(c) {
|
|
2783
2783
|
return a.trans._cache = { keys: a.keys, values: a.cache === "clone" ? Ce(c) : c }, c;
|
|
2784
2784
|
});
|
|
2785
2785
|
}, mutate: function(a) {
|
|
@@ -2813,16 +2813,16 @@ function Ma() {
|
|
|
2813
2813
|
function E(k) {
|
|
2814
2814
|
return k = "idb://".concat(r, "/").concat(a, "/").concat(k), D[k] || (D[k] = new oe());
|
|
2815
2815
|
}
|
|
2816
|
-
var S, v, A, P = m.trans, D = m.mutatedParts || (m.mutatedParts = {}), I = E(""),
|
|
2816
|
+
var S, v, A, P = m.trans, D = m.mutatedParts || (m.mutatedParts = {}), I = E(""), T = E(":dels"), C = m.type, $ = m.type === "deleteRange" ? [m.range] : m.type === "delete" ? [m.keys] : m.values.length < 50 ? [jr(u, m).filter(function(k) {
|
|
2817
2817
|
return k;
|
|
2818
|
-
}), m.values] : [],
|
|
2819
|
-
return
|
|
2818
|
+
}), m.values] : [], R = $[0], x = $[1], $ = m.trans._cache;
|
|
2819
|
+
return M(R) ? (I.addKeys(R), ($ = C === "delete" || R.length === x.length ? An(R, $) : null) || T.addKeys(R), ($ || x) && (S = E, v = $, A = x, c.indexes.forEach(function(k) {
|
|
2820
2820
|
var G = S(k.name || "");
|
|
2821
2821
|
function F(z) {
|
|
2822
2822
|
return z != null ? k.extractKey(z) : null;
|
|
2823
2823
|
}
|
|
2824
2824
|
function U(z) {
|
|
2825
|
-
return k.multiEntry &&
|
|
2825
|
+
return k.multiEntry && M(z) ? z.forEach(function(fe) {
|
|
2826
2826
|
return G.addKey(fe);
|
|
2827
2827
|
}) : G.addKey(z);
|
|
2828
2828
|
}
|
|
@@ -2830,10 +2830,10 @@ function Ma() {
|
|
|
2830
2830
|
var W = v && F(v[ie]), ie = A && F(A[ie]);
|
|
2831
2831
|
H(W, ie) !== 0 && (W != null && U(W), ie != null && U(ie));
|
|
2832
2832
|
});
|
|
2833
|
-
}))) :
|
|
2833
|
+
}))) : R ? (x = { from: (x = R.lower) !== null && x !== void 0 ? x : e.MIN_KEY, to: (x = R.upper) !== null && x !== void 0 ? x : e.MAX_KEY }, T.add(x), I.add(x)) : (I.add(n), T.add(n), c.indexes.forEach(function(k) {
|
|
2834
2834
|
return E(k.name).add(n);
|
|
2835
2835
|
})), s.mutate(m).then(function(k) {
|
|
2836
|
-
return !
|
|
2836
|
+
return !R || m.type !== "add" && m.type !== "put" || (I.addKeys(k.results), b && b.forEach(function(G) {
|
|
2837
2837
|
for (var F = m.values.map(function(W) {
|
|
2838
2838
|
return G.extractKey(W);
|
|
2839
2839
|
}), U = G.keyPath.findIndex(function(W) {
|
|
@@ -2850,7 +2850,7 @@ function Ma() {
|
|
|
2850
2850
|
}, getMany: function(m) {
|
|
2851
2851
|
return [u, new oe().addKeys(m.keys)];
|
|
2852
2852
|
}, count: f, query: f, openCursor: f };
|
|
2853
|
-
return
|
|
2853
|
+
return N(O).forEach(function(m) {
|
|
2854
2854
|
w[m] = function(E) {
|
|
2855
2855
|
var S = B.subscr, v = !!S, A = Pn(B, s) && Dn(m, E) ? E.obsSet = {} : S;
|
|
2856
2856
|
if (v) {
|
|
@@ -2859,14 +2859,14 @@ function Ma() {
|
|
|
2859
2859
|
}, D = P(""), I = P(":dels"), S = O[m](E), v = S[0], S = S[1];
|
|
2860
2860
|
if ((m === "query" && v.isPrimaryKey && !E.values ? I : P(v.name || "")).add(S), !v.isPrimaryKey) {
|
|
2861
2861
|
if (m !== "count") {
|
|
2862
|
-
var
|
|
2862
|
+
var T = m === "query" && g && E.values && s.query(l(l({}, E), { values: !1 }));
|
|
2863
2863
|
return s[m].apply(this, arguments).then(function(x) {
|
|
2864
2864
|
if (m === "query") {
|
|
2865
|
-
if (g && E.values) return
|
|
2865
|
+
if (g && E.values) return T.then(function(F) {
|
|
2866
2866
|
return F = F.result, D.addKeys(F), x;
|
|
2867
2867
|
});
|
|
2868
|
-
var
|
|
2869
|
-
(E.values ? D : I).addKeys(
|
|
2868
|
+
var $ = E.values ? x.result.map(d) : x.result;
|
|
2869
|
+
(E.values ? D : I).addKeys($);
|
|
2870
2870
|
} else if (m === "openCursor") {
|
|
2871
2871
|
var k = x, G = E.values;
|
|
2872
2872
|
return k && Object.create(k, { key: { get: function() {
|
|
@@ -2893,9 +2893,9 @@ function Ma() {
|
|
|
2893
2893
|
if (n.numFailures === 0) return r;
|
|
2894
2894
|
if (r.type === "deleteRange") return null;
|
|
2895
2895
|
var a = r.keys ? r.keys.length : "values" in r && r.values ? r.values.length : 1;
|
|
2896
|
-
return n.numFailures === a ? null : (r = l({}, r),
|
|
2896
|
+
return n.numFailures === a ? null : (r = l({}, r), M(r.keys) && (r.keys = r.keys.filter(function(s, c) {
|
|
2897
2897
|
return !(c in n.failures);
|
|
2898
|
-
})), "values" in r &&
|
|
2898
|
+
})), "values" in r && M(r.values) && (r.values = r.values.filter(function(s, c) {
|
|
2899
2899
|
return !(c in n.failures);
|
|
2900
2900
|
})), r);
|
|
2901
2901
|
}
|
|
@@ -2908,10 +2908,10 @@ function Ma() {
|
|
|
2908
2908
|
var u = r.query.index, d = u.multiEntry, g = r.query.range, b = a.schema.primaryKey.extractKey, w = u.extractKey, f = (u.lowLevelIndex || u).extractKey, O = O.reduce(function(m, E) {
|
|
2909
2909
|
var S = m, v = [];
|
|
2910
2910
|
if (E.type === "add" || E.type === "put") for (var A = new oe(), P = E.values.length - 1; 0 <= P; --P) {
|
|
2911
|
-
var D, I = E.values[P],
|
|
2912
|
-
A.hasKey(
|
|
2911
|
+
var D, I = E.values[P], T = b(I);
|
|
2912
|
+
A.hasKey(T) || (D = w(I), (d && M(D) ? D.some(function(k) {
|
|
2913
2913
|
return Mr(k, g);
|
|
2914
|
-
}) : Mr(D, g)) && (A.addKey(
|
|
2914
|
+
}) : Mr(D, g)) && (A.addKey(T), v.push(I)));
|
|
2915
2915
|
}
|
|
2916
2916
|
switch (E.type) {
|
|
2917
2917
|
case "add":
|
|
@@ -2926,11 +2926,11 @@ function Ma() {
|
|
|
2926
2926
|
}));
|
|
2927
2927
|
break;
|
|
2928
2928
|
case "put":
|
|
2929
|
-
var
|
|
2929
|
+
var R = new oe().addKeys(E.values.map(function(G) {
|
|
2930
2930
|
return b(G);
|
|
2931
2931
|
}));
|
|
2932
2932
|
S = m.filter(function(G) {
|
|
2933
|
-
return !
|
|
2933
|
+
return !R.hasKey(r.values ? b(G) : G);
|
|
2934
2934
|
}).concat(r.values ? v : v.map(function(G) {
|
|
2935
2935
|
return b(G);
|
|
2936
2936
|
}));
|
|
@@ -2942,9 +2942,9 @@ function Ma() {
|
|
|
2942
2942
|
});
|
|
2943
2943
|
break;
|
|
2944
2944
|
case "deleteRange":
|
|
2945
|
-
var
|
|
2945
|
+
var $ = E.range;
|
|
2946
2946
|
S = m.filter(function(G) {
|
|
2947
|
-
return !Mr(b(G),
|
|
2947
|
+
return !Mr(b(G), $);
|
|
2948
2948
|
});
|
|
2949
2949
|
}
|
|
2950
2950
|
return S;
|
|
@@ -2998,16 +2998,16 @@ function Ma() {
|
|
|
2998
2998
|
var E = e.table(O), S = m.optimisticOps.filter(function(G) {
|
|
2999
2999
|
return G.trans === d;
|
|
3000
3000
|
});
|
|
3001
|
-
if (d._explicit && g && d.mutatedParts) for (var v = 0, A = Object.values(m.queries.query); v < A.length; v++) for (var P = 0, D = (C = A[v]).slice(); P < D.length; P++) Tr((
|
|
3001
|
+
if (d._explicit && g && d.mutatedParts) for (var v = 0, A = Object.values(m.queries.query); v < A.length; v++) for (var P = 0, D = (C = A[v]).slice(); P < D.length; P++) Tr((R = D[P]).obsSet, d.mutatedParts) && ($e(C, R), R.subscribers.forEach(function(G) {
|
|
3002
3002
|
return b.add(G);
|
|
3003
3003
|
}));
|
|
3004
3004
|
else if (0 < S.length) {
|
|
3005
3005
|
m.optimisticOps = m.optimisticOps.filter(function(G) {
|
|
3006
3006
|
return G.trans !== d;
|
|
3007
3007
|
});
|
|
3008
|
-
for (var I = 0,
|
|
3008
|
+
for (var I = 0, T = Object.values(m.queries.query); I < T.length; I++) for (var C, R, x, $ = 0, k = (C = T[I]).slice(); $ < k.length; $++) (R = k[$]).res != null && d.mutatedParts && (g && !R.dirty ? (x = Object.isFrozen(R.res), x = Nn(R.res, R.req, S, E, R, x), R.dirty ? ($e(C, R), R.subscribers.forEach(function(G) {
|
|
3009
3009
|
return b.add(G);
|
|
3010
|
-
})) : x !==
|
|
3010
|
+
})) : x !== R.res && (R.res = x, R.promise = j.resolve({ result: x }))) : (R.dirty && $e(C, R), R.subscribers.forEach(function(G) {
|
|
3011
3011
|
return b.add(G);
|
|
3012
3012
|
})));
|
|
3013
3013
|
}
|
|
@@ -3050,15 +3050,15 @@ function Ma() {
|
|
|
3050
3050
|
if (!D) return [null, !1, P, null];
|
|
3051
3051
|
switch (v) {
|
|
3052
3052
|
case "query":
|
|
3053
|
-
var I = D.find(function(
|
|
3054
|
-
return
|
|
3053
|
+
var I = D.find(function(T) {
|
|
3054
|
+
return T.req.limit === A.limit && T.req.values === A.values && Tn(T.req.query.range, A.query.range);
|
|
3055
3055
|
});
|
|
3056
|
-
return I ? [I, !0, P, D] : [D.find(function(
|
|
3057
|
-
return ("limit" in
|
|
3056
|
+
return I ? [I, !0, P, D] : [D.find(function(T) {
|
|
3057
|
+
return ("limit" in T.req ? T.req.limit : 1 / 0) >= A.limit && (!A.values || T.req.values) && Sa(T.req.query.range, A.query.range);
|
|
3058
3058
|
}), !1, P, D];
|
|
3059
3059
|
case "count":
|
|
3060
|
-
return I = D.find(function(
|
|
3061
|
-
return Tn(
|
|
3060
|
+
return I = D.find(function(T) {
|
|
3061
|
+
return Tn(T.req.query.range, A.query.range);
|
|
3062
3062
|
}), [I, !!I, P, D];
|
|
3063
3063
|
}
|
|
3064
3064
|
}(r, n, "query", c), w = b[0], f = b[1], O = b[2], m = b[3];
|
|
@@ -3092,7 +3092,7 @@ function Ma() {
|
|
|
3092
3092
|
return n || (n = new this.Version(e), r.push(n), r.sort(ha), n.stores({}), this._state.autoSchema = !1, n);
|
|
3093
3093
|
}, ee.prototype._whenReady = function(e) {
|
|
3094
3094
|
var r = this;
|
|
3095
|
-
return this.idbdb && (this._state.openComplete || B.letThrough || this._vip) ? e() : new
|
|
3095
|
+
return this.idbdb && (this._state.openComplete || B.letThrough || this._vip) ? e() : new j(function(n, a) {
|
|
3096
3096
|
if (r._state.openComplete) return a(new L.DatabaseClosed(r._state.dbOpenError));
|
|
3097
3097
|
if (!r._state.isBeingOpened) {
|
|
3098
3098
|
if (!r._state.autoOpen) return void a(new L.DatabaseClosed());
|
|
@@ -3124,9 +3124,9 @@ function Ma() {
|
|
|
3124
3124
|
}
|
|
3125
3125
|
this.idbdb = null;
|
|
3126
3126
|
}
|
|
3127
|
-
e.isBeingOpened || (e.dbReadyPromise = new
|
|
3127
|
+
e.isBeingOpened || (e.dbReadyPromise = new j(function(n) {
|
|
3128
3128
|
e.dbReadyResolve = n;
|
|
3129
|
-
}), e.openCanceller = new
|
|
3129
|
+
}), e.openCanceller = new j(function(n, a) {
|
|
3130
3130
|
e.cancelOpen = a;
|
|
3131
3131
|
}));
|
|
3132
3132
|
}, ee.prototype.close = function(n) {
|
|
@@ -3136,7 +3136,7 @@ function Ma() {
|
|
|
3136
3136
|
var r = this;
|
|
3137
3137
|
e === void 0 && (e = { disableAutoOpen: !0 });
|
|
3138
3138
|
var n = 0 < arguments.length && typeof arguments[0] != "object", a = this._state;
|
|
3139
|
-
return new
|
|
3139
|
+
return new j(function(s, c) {
|
|
3140
3140
|
function u() {
|
|
3141
3141
|
r.close(e);
|
|
3142
3142
|
var d = r._deps.indexedDB.deleteDatabase(r.name);
|
|
@@ -3161,7 +3161,7 @@ function Ma() {
|
|
|
3161
3161
|
return this._state.autoSchema;
|
|
3162
3162
|
}, Object.defineProperty(ee.prototype, "tables", { get: function() {
|
|
3163
3163
|
var e = this;
|
|
3164
|
-
return
|
|
3164
|
+
return N(this._allTables).map(function(r) {
|
|
3165
3165
|
return e._allTables[r];
|
|
3166
3166
|
});
|
|
3167
3167
|
}, enumerable: !1, configurable: !0 }), ee.prototype.transaction = function() {
|
|
@@ -3204,7 +3204,7 @@ function Ma() {
|
|
|
3204
3204
|
}) : q(b);
|
|
3205
3205
|
}
|
|
3206
3206
|
var g = function b(w, f, O, m, E) {
|
|
3207
|
-
return
|
|
3207
|
+
return j.resolve().then(function() {
|
|
3208
3208
|
var S = B.transless || B, v = w._createTransaction(f, O, w._dbSchema, m);
|
|
3209
3209
|
if (v.explicit = !0, S = { trans: v, transless: S }, m) v.idbtrans = m.idbtrans;
|
|
3210
3210
|
else try {
|
|
@@ -3215,10 +3215,10 @@ function Ma() {
|
|
|
3215
3215
|
})) : q(D);
|
|
3216
3216
|
}
|
|
3217
3217
|
var A, P = nr(E);
|
|
3218
|
-
return P && qe(), S =
|
|
3218
|
+
return P && qe(), S = j.follow(function() {
|
|
3219
3219
|
var D;
|
|
3220
3220
|
(A = E.call(v, v)) && (P ? (D = Ie.bind(null, null), A.then(D, D)) : typeof A.next == "function" && typeof A.throw == "function" && (A = Cr(A)));
|
|
3221
|
-
}, S), (A && typeof A.then == "function" ?
|
|
3221
|
+
}, S), (A && typeof A.then == "function" ? j.resolve(A).then(function(D) {
|
|
3222
3222
|
return v.active ? D : q(new L.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
3223
3223
|
}) : S.then(function() {
|
|
3224
3224
|
return A;
|
|
@@ -3244,15 +3244,15 @@ function Ma() {
|
|
|
3244
3244
|
var a = ee.dependencies;
|
|
3245
3245
|
this._options = r = l({ addons: ee.addons, autoOpen: !0, indexedDB: a.indexedDB, IDBKeyRange: a.IDBKeyRange, cache: "cloned" }, r), this._deps = { indexedDB: r.indexedDB, IDBKeyRange: r.IDBKeyRange }, a = r.addons, this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
3246
3246
|
var s, c, u, d, g, b = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: Q, dbReadyPromise: null, cancelOpen: Q, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: r.autoOpen };
|
|
3247
|
-
b.dbReadyPromise = new
|
|
3247
|
+
b.dbReadyPromise = new j(function(f) {
|
|
3248
3248
|
b.dbReadyResolve = f;
|
|
3249
|
-
}), b.openCanceller = new
|
|
3249
|
+
}), b.openCanceller = new j(function(f, O) {
|
|
3250
3250
|
b.cancelOpen = O;
|
|
3251
3251
|
}), this._state = b, this.name = e, this.on = ft(this, "populate", "blocked", "versionchange", "close", { ready: [sr, Q] }), this.on.ready.subscribe = Hr(this.on.ready.subscribe, function(f) {
|
|
3252
3252
|
return function(O, m) {
|
|
3253
3253
|
ee.vip(function() {
|
|
3254
3254
|
var E, S = n._state;
|
|
3255
|
-
S.openComplete ? (S.dbOpenError ||
|
|
3255
|
+
S.openComplete ? (S.dbOpenError || j.resolve().then(O), m && f(O)) : S.onReadyBeingFired ? (S.onReadyBeingFired.push(O), m && f(O)) : (f(O), E = n, m || f(function v() {
|
|
3256
3256
|
E.on.ready.unsubscribe(O), E.on.ready.unsubscribe(v);
|
|
3257
3257
|
}));
|
|
3258
3258
|
});
|
|
@@ -3271,7 +3271,7 @@ function Ma() {
|
|
|
3271
3271
|
this.db = c, this._tx = m, this.name = f, this.schema = O, this.hook = c._allTables[f] ? c._allTables[f].hook : ft(null, { creating: [Jn, Q], reading: [Xn, it], updating: [qn, Q], deleting: [Zn, Q] });
|
|
3272
3272
|
})), this.Transaction = (u = this, ht(ua.prototype, function(f, O, m, E, S) {
|
|
3273
3273
|
var v = this;
|
|
3274
|
-
this.db = u, this.mode = f, this.storeNames = O, this.schema = m, this.chromeTransactionDurability = E, this.idbtrans = null, this.on = ft(this, "complete", "error", "abort"), this.parent = S || 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
|
|
3274
|
+
this.db = u, this.mode = f, this.storeNames = O, this.schema = m, this.chromeTransactionDurability = E, this.idbtrans = null, this.on = ft(this, "complete", "error", "abort"), this.parent = S || 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 j(function(A, P) {
|
|
3275
3275
|
v._resolve = A, v._reject = P;
|
|
3276
3276
|
}), this._completion.then(function() {
|
|
3277
3277
|
v.active = !1, v.on.complete.fire();
|
|
@@ -3415,7 +3415,7 @@ function Ma() {
|
|
|
3415
3415
|
return function() {
|
|
3416
3416
|
try {
|
|
3417
3417
|
var r = Cr(e.apply(this, arguments));
|
|
3418
|
-
return r && typeof r.then == "function" ? r :
|
|
3418
|
+
return r && typeof r.then == "function" ? r : j.resolve(r);
|
|
3419
3419
|
} catch (n) {
|
|
3420
3420
|
return q(n);
|
|
3421
3421
|
}
|
|
@@ -3423,15 +3423,15 @@ function Ma() {
|
|
|
3423
3423
|
}, spawn: function(e, r, n) {
|
|
3424
3424
|
try {
|
|
3425
3425
|
var a = Cr(e.apply(n, r || []));
|
|
3426
|
-
return a && typeof a.then == "function" ? a :
|
|
3426
|
+
return a && typeof a.then == "function" ? a : j.resolve(a);
|
|
3427
3427
|
} catch (s) {
|
|
3428
3428
|
return q(s);
|
|
3429
3429
|
}
|
|
3430
3430
|
}, currentTransaction: { get: function() {
|
|
3431
3431
|
return B.trans || null;
|
|
3432
3432
|
} }, waitFor: function(e, r) {
|
|
3433
|
-
return r =
|
|
3434
|
-
}, Promise:
|
|
3433
|
+
return r = j.resolve(typeof e == "function" ? ze.ignoreTransaction(e) : e).timeout(r || 6e4), B.trans ? B.trans.waitFor(r) : r;
|
|
3434
|
+
}, Promise: j, debug: { get: function() {
|
|
3435
3435
|
return me;
|
|
3436
3436
|
}, set: function(e) {
|
|
3437
3437
|
qr(e);
|
|
@@ -3463,7 +3463,7 @@ function Ma() {
|
|
|
3463
3463
|
}
|
|
3464
3464
|
}), addEventListener("pageshow", function(e) {
|
|
3465
3465
|
!Se.disableBfCache && e.persisted && (me && console.debug("Dexie: handling persisted pageshow"), xn(), Kr({ all: new oe(-1 / 0, [[]]) }));
|
|
3466
|
-
})),
|
|
3466
|
+
})), j.rejectionMapper = function(e, r) {
|
|
3467
3467
|
return !e || e instanceof Qe || e instanceof TypeError || e instanceof SyntaxError || !e.name || !Zr[e.name] ? e : (r = new Zr[e.name](r || e.message, e), "stack" in e && Ae(r, "stack", { get: function() {
|
|
3468
3468
|
return this.inner.stack;
|
|
3469
3469
|
} }), r);
|
|
@@ -3599,7 +3599,6 @@ class Mn {
|
|
|
3599
3599
|
i.WIDGET,
|
|
3600
3600
|
t
|
|
3601
3601
|
]), {
|
|
3602
|
-
// @ts-ignore
|
|
3603
3602
|
data: p !== void 0 ? { dashboards: p, query: t } : null,
|
|
3604
3603
|
message: p !== void 0 ? "Dashboards loaded from storage" : "Dashboards load error",
|
|
3605
3604
|
success: p !== void 0
|
|
@@ -3670,20 +3669,20 @@ class Mn {
|
|
|
3670
3669
|
query: t
|
|
3671
3670
|
};
|
|
3672
3671
|
const o = t?.order ?? "utc", l = Math.floor(Date.now() / 1e3);
|
|
3673
|
-
o !== "utc" && (t.since = l - 60 * 60 * 24 * 30), this.options.delay
|
|
3674
|
-
const p = (
|
|
3672
|
+
o !== "utc" && (t.since = l - 60 * 60 * 24 * 30), this.options.delay !== 0 ? t.before = l - (this.options.delay || 0) : t.before = l;
|
|
3673
|
+
const p = (N) => N.utc > (t?.since || 0), y = (N) => N.utc < (t?.before || l);
|
|
3675
3674
|
try {
|
|
3676
|
-
const
|
|
3677
|
-
t?.approved === "true" ?
|
|
3678
|
-
const
|
|
3679
|
-
if (
|
|
3675
|
+
const N = this.db.table(_.TOPICS).where("widget_id").equals(t.widget).filter(p).filter(y);
|
|
3676
|
+
t?.approved === "true" ? N.and((se) => se.approved === 1) : N.and((se) => se.visible === 1), N.reverse();
|
|
3677
|
+
const M = await N.limit(t?.limit ?? 25).sortBy(o);
|
|
3678
|
+
if (M.length === 0)
|
|
3680
3679
|
return {
|
|
3681
3680
|
data: null,
|
|
3682
3681
|
message: "No Messages error",
|
|
3683
3682
|
success: !1,
|
|
3684
3683
|
query: t
|
|
3685
3684
|
};
|
|
3686
|
-
const te =
|
|
3685
|
+
const te = M.map((se) => this.db.table(_.MESSAGES).get({ id: se.message_id }));
|
|
3687
3686
|
return wt.Promise.all(te).then(async (se) => {
|
|
3688
3687
|
const re = {
|
|
3689
3688
|
data: {
|
|
@@ -3703,7 +3702,7 @@ class Mn {
|
|
|
3703
3702
|
re
|
|
3704
3703
|
]), re;
|
|
3705
3704
|
});
|
|
3706
|
-
} catch (
|
|
3705
|
+
} catch (N) {
|
|
3707
3706
|
return K(2, [
|
|
3708
3707
|
"%cget%c %cstorage%c %cmessages",
|
|
3709
3708
|
i.OK,
|
|
@@ -3712,7 +3711,7 @@ class Mn {
|
|
|
3712
3711
|
i.NONE,
|
|
3713
3712
|
i.NO_UPDATES,
|
|
3714
3713
|
t,
|
|
3715
|
-
|
|
3714
|
+
N.message
|
|
3716
3715
|
]), { data: null, message: "Messages Data error", success: !1 };
|
|
3717
3716
|
}
|
|
3718
3717
|
};
|
|
@@ -3746,14 +3745,14 @@ class Mn {
|
|
|
3746
3745
|
impressions: y.topics[0]?.impressions || y.dynamics?.semrush_visits || 0,
|
|
3747
3746
|
reach: y.topics[0]?.reach || y.dynamics?.potential_reach || 0,
|
|
3748
3747
|
sentiment: y.topics[0]?.sentiment || 0,
|
|
3749
|
-
|
|
3748
|
+
// @ts-ignore
|
|
3750
3749
|
approved: y.topics[0]?.approved ? 1 : 0
|
|
3751
3750
|
}, await this.db.table(_.MESSAGES).put({
|
|
3752
3751
|
id: y.id,
|
|
3753
3752
|
utc: y.utc,
|
|
3754
3753
|
data: y,
|
|
3755
3754
|
expires: y.expires
|
|
3756
|
-
}).catch((
|
|
3755
|
+
}).catch((M) => {
|
|
3757
3756
|
p++, K(4, [
|
|
3758
3757
|
"%cset%c %cstorage",
|
|
3759
3758
|
i.KO,
|
|
@@ -3762,10 +3761,10 @@ class Mn {
|
|
|
3762
3761
|
"set message",
|
|
3763
3762
|
`title: ${l}`,
|
|
3764
3763
|
y,
|
|
3765
|
-
|
|
3764
|
+
M.message
|
|
3766
3765
|
]);
|
|
3767
3766
|
});
|
|
3768
|
-
const
|
|
3767
|
+
const N = {
|
|
3769
3768
|
title: l,
|
|
3770
3769
|
widget_id: t.widget,
|
|
3771
3770
|
visible: y.topics[0]?.visible || 1,
|
|
@@ -3780,7 +3779,7 @@ class Mn {
|
|
|
3780
3779
|
utc: y.utc,
|
|
3781
3780
|
expires: y.expires
|
|
3782
3781
|
};
|
|
3783
|
-
await this.db.table(_.TOPICS).put(
|
|
3782
|
+
await this.db.table(_.TOPICS).put(N).catch((M) => {
|
|
3784
3783
|
p++, K(4, [
|
|
3785
3784
|
"%cset%c %cstorage",
|
|
3786
3785
|
i.KO,
|
|
@@ -3789,10 +3788,10 @@ class Mn {
|
|
|
3789
3788
|
"set topic",
|
|
3790
3789
|
`title: ${l}`,
|
|
3791
3790
|
y,
|
|
3792
|
-
|
|
3791
|
+
M.message
|
|
3793
3792
|
]);
|
|
3794
|
-
}), await o.data.topics.forEach(async (
|
|
3795
|
-
const te =
|
|
3793
|
+
}), await o.data.topics.forEach(async (M) => {
|
|
3794
|
+
const te = M.message_id, se = M.visible ? 1 : 0, Ot = M.approve ? 1 : 0, re = M.title;
|
|
3796
3795
|
await this.db.table(_.TOPICS).where("message_id").equals(te).modify({ visible: se, approve: Ot }).catch((pe) => {
|
|
3797
3796
|
p++, K(4, [
|
|
3798
3797
|
"%cset%c %cstorage",
|
|
@@ -3801,7 +3800,7 @@ class Mn {
|
|
|
3801
3800
|
i.STORAGE,
|
|
3802
3801
|
"update message visibility",
|
|
3803
3802
|
`title: ${re}`,
|
|
3804
|
-
`widget: ${
|
|
3803
|
+
`widget: ${M.widget_id}`,
|
|
3805
3804
|
pe.message
|
|
3806
3805
|
]);
|
|
3807
3806
|
});
|
|
@@ -3913,7 +3912,7 @@ class Mn {
|
|
|
3913
3912
|
* @returns IResponse
|
|
3914
3913
|
*/
|
|
3915
3914
|
getWidgets = async (t) => {
|
|
3916
|
-
const o = (
|
|
3915
|
+
const o = (N) => t?.dashboard === N.dashboard_id, l = (N) => t?.type === N.type, p = (N) => t?.name ? N.name.includes(t?.name) : !1, y = await this.db.table(_.WIDGET).toArray().then((N) => t?.dashboard ? N.filter(o) : N).then((N) => t?.type ? N.filter(l) : N).then((N) => t?.name ? N.filter(p) : N).catch(() => {
|
|
3917
3916
|
K(2, ["%cstorage", i.STORAGE, X.WIDGET_LOAD, t]);
|
|
3918
3917
|
});
|
|
3919
3918
|
return y !== void 0 && K(3, [
|
|
@@ -4003,14 +4002,14 @@ class Mn {
|
|
|
4003
4002
|
* @returns IResponse
|
|
4004
4003
|
*/
|
|
4005
4004
|
getSlides = async (t) => {
|
|
4006
|
-
const o = (
|
|
4007
|
-
return
|
|
4005
|
+
const o = (M) => t?.id ? M.id === t.id : !1, l = (M) => t?.name ? M.name.includes(t?.name) : !1, p = (M) => t?.presentation_id ? M.presentation_id === t.presentation_id : !1, N = await this.db.table(_.SLIDE).toArray().then((M) => t?.presentation_id ? M.filter(p) : M).then((M) => t?.id ? M.filter(o) : M).then((M) => t?.name ? M.filter(l) : M);
|
|
4006
|
+
return N && N.sort((M, te) => M.order_index - te.order_index), N !== void 0 && K(3, ["%cstorage%c %cslides", i.STORAGE, i.NONE, i.SLIDE, t]), {
|
|
4008
4007
|
// @ts-ignore
|
|
4009
|
-
data:
|
|
4008
|
+
data: N,
|
|
4010
4009
|
query: t,
|
|
4011
|
-
|
|
4012
|
-
message:
|
|
4013
|
-
success:
|
|
4010
|
+
// : data !== undefined ? { data, query } : null,
|
|
4011
|
+
message: N !== void 0 ? "Slides loaded from storage" : "Slides load error",
|
|
4012
|
+
success: N !== void 0
|
|
4014
4013
|
};
|
|
4015
4014
|
};
|
|
4016
4015
|
/**
|
|
@@ -4075,7 +4074,6 @@ class Mn {
|
|
|
4075
4074
|
i.PRESENTATION,
|
|
4076
4075
|
t
|
|
4077
4076
|
]), {
|
|
4078
|
-
// @ts-ignore
|
|
4079
4077
|
data: p,
|
|
4080
4078
|
query: t,
|
|
4081
4079
|
message: p !== void 0 ? "Presentations loaded from storage" : "Presentations load error",
|
|
@@ -4147,7 +4145,7 @@ class Mn {
|
|
|
4147
4145
|
t
|
|
4148
4146
|
]), {
|
|
4149
4147
|
// @ts-ignore
|
|
4150
|
-
data: p !== void 0 ? {
|
|
4148
|
+
data: p !== void 0 ? { preferences: p, query: t } : null,
|
|
4151
4149
|
message: p !== void 0 ? "Preferences loaded from storage" : "Preferences load error",
|
|
4152
4150
|
success: p !== void 0
|
|
4153
4151
|
};
|
|
@@ -4190,7 +4188,7 @@ class Mn {
|
|
|
4190
4188
|
i.PRESENTATION,
|
|
4191
4189
|
t
|
|
4192
4190
|
]), {
|
|
4193
|
-
// @ts-
|
|
4191
|
+
// @ts-expect-error query.widget is obligatory but not always
|
|
4194
4192
|
data: p !== void 0 ? { images: p, query: t } : null,
|
|
4195
4193
|
message: p !== void 0 ? "Images loaded from storage" : "Images load error",
|
|
4196
4194
|
success: p !== void 0
|
|
@@ -4240,7 +4238,7 @@ function Ka(h, t) {
|
|
|
4240
4238
|
}, () => {
|
|
4241
4239
|
}), o;
|
|
4242
4240
|
};
|
|
4243
|
-
return (p, y) => l().then((
|
|
4241
|
+
return (p, y) => l().then((N) => y(N.transaction(t, p).objectStore(t)));
|
|
4244
4242
|
}
|
|
4245
4243
|
let Wr;
|
|
4246
4244
|
function Gn() {
|
|
@@ -5562,17 +5560,13 @@ class Ja {
|
|
|
5562
5560
|
subscribers = [];
|
|
5563
5561
|
// private temp: {[x:string]:any} = []
|
|
5564
5562
|
constructor(t) {
|
|
5565
|
-
K(3, [
|
|
5563
|
+
switch (K(3, [
|
|
5566
5564
|
"%cpresentation",
|
|
5567
5565
|
i.PRESENTATION,
|
|
5568
5566
|
t.presentation,
|
|
5569
5567
|
X.VERSION,
|
|
5570
5568
|
xa
|
|
5571
|
-
]), this.options = t, this.sm = null
|
|
5572
|
-
const o = t.presentation;
|
|
5573
|
-
switch (this.bc = new BroadcastChannel(o), K(3, ["%cchannel%c %capi", i.BROADCAST, i.NONE, i.API, o]), this.bc.onmessage = (l) => {
|
|
5574
|
-
this.actions(l);
|
|
5575
|
-
}, this.bc.postMessage({ event: X.STORAGE_INIT, data: {} }), this.api = new ka(t), t.storage) {
|
|
5569
|
+
]), this.options = t, this.sm = null, this.bc = null, this.api = new ka(t), t.storage) {
|
|
5576
5570
|
case ge.DEXIE:
|
|
5577
5571
|
this.sm = new Mn(t);
|
|
5578
5572
|
break;
|
|
@@ -5597,7 +5591,13 @@ class Ja {
|
|
|
5597
5591
|
delete this.subscribers[t.widget];
|
|
5598
5592
|
}
|
|
5599
5593
|
update = async (t) => {
|
|
5600
|
-
if (
|
|
5594
|
+
if (K(3, [
|
|
5595
|
+
"%clupdate%c %cdata",
|
|
5596
|
+
i.NO_UPDATES,
|
|
5597
|
+
i.NONE,
|
|
5598
|
+
i.MESSAGES,
|
|
5599
|
+
t
|
|
5600
|
+
]), this.sm === null || Object.keys(this.subscribers).length === 0)
|
|
5601
5601
|
return;
|
|
5602
5602
|
const o = [];
|
|
5603
5603
|
Object.values(this.subscribers).forEach((l) => {
|
|
@@ -5615,16 +5615,15 @@ class Ja {
|
|
|
5615
5615
|
let y = "";
|
|
5616
5616
|
switch (t.query.type) {
|
|
5617
5617
|
case _.MESSAGES:
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
5622
|
-
"%cload%c %cleanMessages",
|
|
5618
|
+
t.data.messages = t.data.messages.filter(
|
|
5619
|
+
(N) => N.id !== null
|
|
5620
|
+
), y = t.data.messages.length > 0 ? Lr(t.data.messages[0].utc) : "none", p?.hash && p.hash === y ? (K(3, [
|
|
5621
|
+
"%cload%c %ccleanMessages",
|
|
5623
5622
|
i.NO_UPDATES,
|
|
5624
5623
|
i.NONE,
|
|
5625
5624
|
i.MESSAGES,
|
|
5626
5625
|
t.query.widget
|
|
5627
|
-
]), K(4, ["%cmessages", i.MESSAGES, t]), l = 204) : (o = t, p.hash = y, l = await this.sm?.setMessages(t.query, t).then(async (
|
|
5626
|
+
]), K(4, ["%cmessages", i.MESSAGES, t]), l = 204) : (o = t, p.hash = y, l = await this.sm?.setMessages(t.query, t).then(async (N) => (N = 201, this.broadcastUpdate(N, t))));
|
|
5628
5627
|
break;
|
|
5629
5628
|
case _.CLOUD:
|
|
5630
5629
|
y = Lr(t.data.cloud), p?.hash && p.hash === y ? (K(3, [
|
|
@@ -5642,7 +5641,7 @@ class Ja {
|
|
|
5642
5641
|
message: t.message,
|
|
5643
5642
|
success: t.success,
|
|
5644
5643
|
query: t.query
|
|
5645
|
-
}, l = await this.sm?.setCloud(t.query, o.data).then((
|
|
5644
|
+
}, l = await this.sm?.setCloud(t.query, o.data).then((N) => this.broadcastUpdate(N, t)));
|
|
5646
5645
|
break;
|
|
5647
5646
|
case _.SERIES:
|
|
5648
5647
|
y = Lr(t.data.series), p?.hash && p.hash === y ? (K(3, [
|
|
@@ -5657,7 +5656,7 @@ class Ja {
|
|
|
5657
5656
|
message: t.message,
|
|
5658
5657
|
success: t.success,
|
|
5659
5658
|
query: t.query
|
|
5660
|
-
}, l = await this.sm?.setSeries(t.query, t.data).then((
|
|
5659
|
+
}, l = await this.sm?.setSeries(t.query, t.data).then((N) => this.broadcastUpdate(N, t)));
|
|
5661
5660
|
break;
|
|
5662
5661
|
default:
|
|
5663
5662
|
return K(4, [
|
|
@@ -5693,6 +5692,12 @@ class Ja {
|
|
|
5693
5692
|
}
|
|
5694
5693
|
return l;
|
|
5695
5694
|
};
|
|
5695
|
+
startBroadcastListener = () => {
|
|
5696
|
+
const t = this.options.presentation;
|
|
5697
|
+
this.bc = new BroadcastChannel(t), K(3, ["%cchannel%c %capi", i.BROADCAST, i.NONE, i.API, t]), this.bc.onmessage = (o) => {
|
|
5698
|
+
this.actions(o);
|
|
5699
|
+
}, this.bc.postMessage({ event: X.STORAGE_INIT, data: {} });
|
|
5700
|
+
};
|
|
5696
5701
|
broadcastUpdate = (t, o) => {
|
|
5697
5702
|
switch (t) {
|
|
5698
5703
|
case 201:
|
|
@@ -5703,14 +5708,9 @@ class Ja {
|
|
|
5703
5708
|
i.WIDGET,
|
|
5704
5709
|
i.NONE,
|
|
5705
5710
|
kn(o.query),
|
|
5706
|
-
// @ts-
|
|
5711
|
+
// @ts-expect-error query.widget is obligatory but not always
|
|
5707
5712
|
`${o.data?.title ?? ""} ${o.query.widget}`
|
|
5708
|
-
]), K(4, [
|
|
5709
|
-
"%cevent",
|
|
5710
|
-
i.BROADCAST,
|
|
5711
|
-
// @ts-ignore
|
|
5712
|
-
o
|
|
5713
|
-
]), this.bc.postMessage({
|
|
5713
|
+
]), K(4, ["%cevent", i.BROADCAST, o]), this.bc?.postMessage({
|
|
5714
5714
|
event: X.WIDGET_UPDATE,
|
|
5715
5715
|
data: o.query
|
|
5716
5716
|
});
|
|
@@ -5817,7 +5817,7 @@ class Ja {
|
|
|
5817
5817
|
setWidget = async (t) => await this.sm?.setWidget(t);
|
|
5818
5818
|
loadDashboards = async (t) => await this.api.loadDashboards(t);
|
|
5819
5819
|
getDashboard = async (t) => await this.sm?.getDashboard(t);
|
|
5820
|
-
getDashboards = async (
|
|
5820
|
+
getDashboards = async () => await this.sm?.getDashboards();
|
|
5821
5821
|
setDashboard = async (t) => await this.sm?.setDashboard(t);
|
|
5822
5822
|
loadImages = async (t) => await this.api.loadImages(t);
|
|
5823
5823
|
storeImage = async (t) => await this.api.storeImage(t);
|
|
@@ -5922,8 +5922,8 @@ class Za {
|
|
|
5922
5922
|
*/
|
|
5923
5923
|
constructor(t, o, l) {
|
|
5924
5924
|
this.element = t, this.callbacks = o, l = typeof l < "u" ? l : "buzzcasting-app";
|
|
5925
|
-
|
|
5926
|
-
|
|
5925
|
+
const p = { ...t.dataset };
|
|
5926
|
+
delete p.hmr, p.presentation = window.BuzzCasting.getOptions()?.presentation ?? `${l} not found`, this.query = p, Da(t);
|
|
5927
5927
|
const y = window.BuzzCasting.getOptions();
|
|
5928
5928
|
this.storageReader = new Ba(y), this.broadcastChannel = new BroadcastChannel(p.presentation), this.broadcastListener();
|
|
5929
5929
|
}
|
|
@@ -5955,8 +5955,8 @@ class Za {
|
|
|
5955
5955
|
y(p);
|
|
5956
5956
|
}));
|
|
5957
5957
|
}
|
|
5958
|
-
} catch {
|
|
5959
|
-
K(4, [X.WIDGET_UPDATE, l]);
|
|
5958
|
+
} catch (p) {
|
|
5959
|
+
K(4, [X.WIDGET_UPDATE, l, p.message]);
|
|
5960
5960
|
}
|
|
5961
5961
|
break;
|
|
5962
5962
|
case X.APP_READY:
|
|
@@ -6077,7 +6077,6 @@ class Za {
|
|
|
6077
6077
|
i.WIDGET,
|
|
6078
6078
|
X.SHOW_MODAL,
|
|
6079
6079
|
t.showComponent,
|
|
6080
|
-
// @ts-ignore
|
|
6081
6080
|
Pa(this.element.attributes)
|
|
6082
6081
|
// props['data-widget'],
|
|
6083
6082
|
]);
|