buzzcasting-storage 2.12.3 → 2.12.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/dist/buzzcasting-storage.d.ts +3 -1
- package/dist/buzzcasting-storage.esm.js +1106 -1071
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Ei = Object.defineProperty;
|
|
2
2
|
var Oi = (p, i, u) => i in p ? Ei(p, i, { enumerable: !0, configurable: !0, writable: !0, value: u }) : p[i] = u;
|
|
3
3
|
var P = (p, i, u) => (Oi(p, typeof i != "symbol" ? i + "" : i, u), u);
|
|
4
|
-
const xi = "2.12.
|
|
4
|
+
const xi = "2.12.3";
|
|
5
5
|
class ki {
|
|
6
6
|
constructor(i) {
|
|
7
7
|
P(this, "options");
|
|
@@ -19,19 +19,19 @@ class ki {
|
|
|
19
19
|
this.options = i, this.url = `https://${i.app}.buzzcasting.net`;
|
|
20
20
|
}
|
|
21
21
|
async get(i) {
|
|
22
|
-
const { version: u } = this.options,
|
|
23
|
-
delete
|
|
24
|
-
const
|
|
22
|
+
const { version: u } = this.options, f = this.headers(), k = Object.assign({}, i);
|
|
23
|
+
delete k.slide, delete k.type, delete k.hash;
|
|
24
|
+
const C = Object.keys(k).length > 0 ? `?${new URLSearchParams(k).toString()}` : "";
|
|
25
25
|
return console.debug(
|
|
26
26
|
"%capi%c %cget",
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
E.API,
|
|
28
|
+
E.NONE,
|
|
29
|
+
E.GET_DATA,
|
|
30
30
|
i.slide,
|
|
31
31
|
i.widget
|
|
32
32
|
), await fetch(
|
|
33
|
-
[this.url, "api", u, i.type].join("/") +
|
|
34
|
-
{ ...
|
|
33
|
+
[this.url, "api", u, i.type].join("/") + C,
|
|
34
|
+
{ ...f, method: "get" }
|
|
35
35
|
).then(async (K) => {
|
|
36
36
|
if (!K.ok)
|
|
37
37
|
throw new Error(`${K.status}`);
|
|
@@ -39,53 +39,53 @@ class ki {
|
|
|
39
39
|
}).then((K) => K.json()).then((K) => (K.query = i, K)).catch((K) => ({ success: !1, message: `${K}`, data: null }));
|
|
40
40
|
}
|
|
41
41
|
async hideMessage(i) {
|
|
42
|
-
const { version: u } = this.options,
|
|
42
|
+
const { version: u } = this.options, f = this.headers(), k = "?action=visible";
|
|
43
43
|
return console.info(
|
|
44
44
|
"%capi%c %cput",
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
E.API,
|
|
46
|
+
E.NONE,
|
|
47
|
+
E.GET_DATA,
|
|
48
48
|
se.HIDE_MESSAGE,
|
|
49
49
|
i.widget,
|
|
50
50
|
i.id
|
|
51
51
|
), await fetch(
|
|
52
|
-
[this.url, "api", u, i.type, i.id].join("/") +
|
|
53
|
-
{ ...
|
|
54
|
-
).then((
|
|
55
|
-
if (!
|
|
56
|
-
throw new Error(
|
|
57
|
-
return
|
|
58
|
-
}).then((
|
|
52
|
+
[this.url, "api", u, i.type, i.id].join("/") + k,
|
|
53
|
+
{ ...f, method: "put" }
|
|
54
|
+
).then((C) => {
|
|
55
|
+
if (!C.ok)
|
|
56
|
+
throw new Error(C.statusText);
|
|
57
|
+
return C;
|
|
58
|
+
}).then((C) => C.json()).catch((C) => ({ succes: !1, message: C, data: [] }));
|
|
59
59
|
}
|
|
60
60
|
async hideLabels(i) {
|
|
61
|
-
const { version: u } = this.options,
|
|
61
|
+
const { version: u } = this.options, f = this.headers(), k = JSON.stringify(i.labels);
|
|
62
62
|
return console.info(
|
|
63
63
|
"%capi%c %cput",
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
E.API,
|
|
65
|
+
E.NONE,
|
|
66
|
+
E.GET_DATA,
|
|
67
67
|
se.HIDE_LABELS,
|
|
68
68
|
i.widget,
|
|
69
|
-
|
|
69
|
+
k
|
|
70
70
|
), await fetch(
|
|
71
71
|
[this.url, "api", u, i.type, i.widget].join("/"),
|
|
72
|
-
{ ...
|
|
73
|
-
).then((
|
|
74
|
-
if (!
|
|
75
|
-
throw new Error(
|
|
76
|
-
return
|
|
77
|
-
}).then((
|
|
72
|
+
{ ...f, body: k, method: "put" }
|
|
73
|
+
).then((C) => {
|
|
74
|
+
if (!C.ok)
|
|
75
|
+
throw new Error(C.statusText);
|
|
76
|
+
return C;
|
|
77
|
+
}).then((C) => C.json()).catch((C) => ({ succes: !1, message: C, data: [] }));
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
var
|
|
80
|
+
var Ir = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
81
81
|
function Ai(p) {
|
|
82
82
|
return p && p.__esModule && Object.prototype.hasOwnProperty.call(p, "default") ? p.default : p;
|
|
83
83
|
}
|
|
84
84
|
var Rr = { exports: {} };
|
|
85
85
|
(function(p, i) {
|
|
86
|
-
(function(u,
|
|
87
|
-
p.exports =
|
|
88
|
-
})(
|
|
86
|
+
(function(u, f) {
|
|
87
|
+
p.exports = f();
|
|
88
|
+
})(Ir, function() {
|
|
89
89
|
var u = function(e, t) {
|
|
90
90
|
return (u = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) {
|
|
91
91
|
n.__proto__ = r;
|
|
@@ -93,27 +93,27 @@ var Rr = { exports: {} };
|
|
|
93
93
|
for (var o in r)
|
|
94
94
|
Object.prototype.hasOwnProperty.call(r, o) && (n[o] = r[o]);
|
|
95
95
|
})(e, t);
|
|
96
|
-
},
|
|
97
|
-
return (
|
|
96
|
+
}, f = function() {
|
|
97
|
+
return (f = Object.assign || function(e) {
|
|
98
98
|
for (var t, n = 1, r = arguments.length; n < r; n++)
|
|
99
99
|
for (var o in t = arguments[n])
|
|
100
100
|
Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
|
|
101
101
|
return e;
|
|
102
102
|
}).apply(this, arguments);
|
|
103
103
|
};
|
|
104
|
-
function
|
|
104
|
+
function k(e, t, n) {
|
|
105
105
|
if (n || arguments.length === 2)
|
|
106
106
|
for (var r, o = 0, a = t.length; o < a; o++)
|
|
107
107
|
!r && o in t || ((r = r || Array.prototype.slice.call(t, 0, o))[o] = t[o]);
|
|
108
108
|
return e.concat(r || Array.prototype.slice.call(t));
|
|
109
109
|
}
|
|
110
|
-
var
|
|
110
|
+
var C = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Ir, K = Object.keys, B = Array.isArray;
|
|
111
111
|
function Z(e, t) {
|
|
112
112
|
return typeof t != "object" || K(t).forEach(function(n) {
|
|
113
113
|
e[n] = t[n];
|
|
114
114
|
}), e;
|
|
115
115
|
}
|
|
116
|
-
typeof Promise > "u" ||
|
|
116
|
+
typeof Promise > "u" || C.Promise || (C.Promise = Promise);
|
|
117
117
|
var te = Object.getPrototypeOf, be = {}.hasOwnProperty;
|
|
118
118
|
function ie(e, t) {
|
|
119
119
|
return be.call(e, t);
|
|
@@ -132,19 +132,19 @@ var Rr = { exports: {} };
|
|
|
132
132
|
return e.prototype = Object.create(t.prototype), ke(e.prototype, "constructor", e), { extend: xe.bind(null, e.prototype) };
|
|
133
133
|
} };
|
|
134
134
|
}
|
|
135
|
-
var
|
|
135
|
+
var Lr = Object.getOwnPropertyDescriptor, Fr = [].slice;
|
|
136
136
|
function wt(e, t, n) {
|
|
137
137
|
return Fr.call(e, t, n);
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function Hn(e, t) {
|
|
140
140
|
return t(e);
|
|
141
141
|
}
|
|
142
142
|
function rt(e) {
|
|
143
143
|
if (!e)
|
|
144
144
|
throw new Error("Assertion Failed");
|
|
145
145
|
}
|
|
146
|
-
function
|
|
147
|
-
|
|
146
|
+
function Yn(e) {
|
|
147
|
+
C.setImmediate ? setImmediate(e) : setTimeout(e, 0);
|
|
148
148
|
}
|
|
149
149
|
function ve(e, t) {
|
|
150
150
|
if (typeof t == "string" && ie(e, t))
|
|
@@ -172,7 +172,7 @@ var Rr = { exports: {} };
|
|
|
172
172
|
fe(e, t[r], n[r]);
|
|
173
173
|
} else {
|
|
174
174
|
var a, s, c = t.indexOf(".");
|
|
175
|
-
c !== -1 ? (a = t.substr(0, c), (s = t.substr(c + 1)) === "" ? n === void 0 ?
|
|
175
|
+
c !== -1 ? (a = t.substr(0, c), (s = t.substr(c + 1)) === "" ? n === void 0 ? B(e) && !isNaN(parseInt(a)) ? e.splice(a, 1) : delete e[a] : e[a] = n : fe(c = !(c = e[a]) || !ie(e, a) ? e[a] = {} : c, s, n)) : n === void 0 ? B(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = n;
|
|
176
176
|
}
|
|
177
177
|
}
|
|
178
178
|
function Qn(e) {
|
|
@@ -190,9 +190,9 @@ var Rr = { exports: {} };
|
|
|
190
190
|
return t + e + "Array";
|
|
191
191
|
});
|
|
192
192
|
}))).filter(function(e) {
|
|
193
|
-
return
|
|
193
|
+
return C[e];
|
|
194
194
|
}), Vn = new Set(ge.map(function(e) {
|
|
195
|
-
return
|
|
195
|
+
return C[e];
|
|
196
196
|
})), it = null;
|
|
197
197
|
function Ae(e) {
|
|
198
198
|
return it = /* @__PURE__ */ new WeakMap(), e = function t(n) {
|
|
@@ -201,7 +201,7 @@ var Rr = { exports: {} };
|
|
|
201
201
|
var r = it.get(n);
|
|
202
202
|
if (r)
|
|
203
203
|
return r;
|
|
204
|
-
if (
|
|
204
|
+
if (B(n)) {
|
|
205
205
|
r = [], it.set(n, r);
|
|
206
206
|
for (var o = 0, a = n.length; o < a; ++o)
|
|
207
207
|
r.push(t(n[o]));
|
|
@@ -228,13 +228,13 @@ var Rr = { exports: {} };
|
|
|
228
228
|
function je(e, t) {
|
|
229
229
|
return t = e.indexOf(t), 0 <= t && e.splice(t, 1), 0 <= t;
|
|
230
230
|
}
|
|
231
|
-
var
|
|
231
|
+
var He = {};
|
|
232
232
|
function we(e) {
|
|
233
233
|
var t, n, r, o;
|
|
234
234
|
if (arguments.length === 1) {
|
|
235
|
-
if (
|
|
235
|
+
if (B(e))
|
|
236
236
|
return e.slice();
|
|
237
|
-
if (this ===
|
|
237
|
+
if (this === He && typeof e == "string")
|
|
238
238
|
return [e];
|
|
239
239
|
if (o = Wr(e)) {
|
|
240
240
|
for (n = []; !(r = o.next()).done; )
|
|
@@ -258,7 +258,7 @@ var Rr = { exports: {} };
|
|
|
258
258
|
} : function() {
|
|
259
259
|
return !1;
|
|
260
260
|
}, st = ["Unknown", "Constraint", "Data", "TransactionInactive", "ReadOnly", "Version", "NotFound", "InvalidState", "InvalidAccess", "Abort", "Timeout", "QuotaExceeded", "Syntax", "DataClone"], de = ["Modify", "Bulk", "OpenFailed", "VersionChange", "Schema", "Upgrade", "InvalidTable", "MissingAPI", "NoSuchDatabase", "InvalidArgument", "SubTransaction", "Unsupported", "Internal", "DatabaseClosed", "PrematureCommit", "ForeignAwait"].concat(st), zr = { VersionChanged: "Database version changed by other database connection", DatabaseClosed: "Database has been closed", Abort: "Transaction aborted", TransactionInactive: "Transaction has already completed or failed", MissingAPI: "IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb" };
|
|
261
|
-
function
|
|
261
|
+
function Ye(e, t) {
|
|
262
262
|
this.name = e, this.message = t;
|
|
263
263
|
}
|
|
264
264
|
function Jn(e, t) {
|
|
@@ -277,31 +277,31 @@ var Rr = { exports: {} };
|
|
|
277
277
|
return t[n];
|
|
278
278
|
}), this.failuresByPos = t, this.message = Jn(e, this.failures);
|
|
279
279
|
}
|
|
280
|
-
ze(
|
|
280
|
+
ze(Ye).from(Error).extend({ toString: function() {
|
|
281
281
|
return this.name + ": " + this.message;
|
|
282
|
-
} }), ze(_t).from(
|
|
282
|
+
} }), ze(_t).from(Ye), ze(Qe).from(Ye);
|
|
283
283
|
var en = de.reduce(function(e, t) {
|
|
284
284
|
return e[t] = t + "Error", e;
|
|
285
|
-
}, {}),
|
|
285
|
+
}, {}), Hr = Ye, L = de.reduce(function(e, t) {
|
|
286
286
|
var n = t + "Error";
|
|
287
287
|
function r(o, a) {
|
|
288
288
|
this.name = n, o ? typeof o == "string" ? (this.message = "".concat(o).concat(a ? `
|
|
289
289
|
` + a : ""), this.inner = a || null) : typeof o == "object" && (this.message = "".concat(o.name, " ").concat(o.message), this.inner = o) : (this.message = zr[t] || n, this.inner = null);
|
|
290
290
|
}
|
|
291
|
-
return ze(r).from(
|
|
291
|
+
return ze(r).from(Hr), e[t] = r, e;
|
|
292
292
|
}, {});
|
|
293
|
-
|
|
293
|
+
L.Syntax = SyntaxError, L.Type = TypeError, L.Range = RangeError;
|
|
294
294
|
var Zn = st.reduce(function(e, t) {
|
|
295
|
-
return e[t + "Error"] =
|
|
295
|
+
return e[t + "Error"] = L[t], e;
|
|
296
296
|
}, {}), St = de.reduce(function(e, t) {
|
|
297
|
-
return ["Syntax", "Type", "Range"].indexOf(t) === -1 && (e[t + "Error"] =
|
|
297
|
+
return ["Syntax", "Type", "Range"].indexOf(t) === -1 && (e[t + "Error"] = L[t]), e;
|
|
298
298
|
}, {});
|
|
299
|
-
function
|
|
299
|
+
function Y() {
|
|
300
300
|
}
|
|
301
301
|
function ot(e) {
|
|
302
302
|
return e;
|
|
303
303
|
}
|
|
304
|
-
function
|
|
304
|
+
function Yr(e, t) {
|
|
305
305
|
return e == null || e === ot ? t : function(n) {
|
|
306
306
|
return t(e(n));
|
|
307
307
|
};
|
|
@@ -312,7 +312,7 @@ var Rr = { exports: {} };
|
|
|
312
312
|
};
|
|
313
313
|
}
|
|
314
314
|
function Qr(e, t) {
|
|
315
|
-
return e ===
|
|
315
|
+
return e === Y ? t : function() {
|
|
316
316
|
var n = e.apply(this, arguments);
|
|
317
317
|
n !== void 0 && (arguments[0] = n);
|
|
318
318
|
var r = this.onsuccess, o = this.onerror;
|
|
@@ -322,14 +322,14 @@ var Rr = { exports: {} };
|
|
|
322
322
|
};
|
|
323
323
|
}
|
|
324
324
|
function Xr(e, t) {
|
|
325
|
-
return e ===
|
|
325
|
+
return e === Y ? t : function() {
|
|
326
326
|
e.apply(this, arguments);
|
|
327
327
|
var n = this.onsuccess, r = this.onerror;
|
|
328
328
|
this.onsuccess = this.onerror = null, t.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? Ke(n, this.onsuccess) : n), r && (this.onerror = this.onerror ? Ke(r, this.onerror) : r);
|
|
329
329
|
};
|
|
330
330
|
}
|
|
331
331
|
function Vr(e, t) {
|
|
332
|
-
return e ===
|
|
332
|
+
return e === Y ? t : function(n) {
|
|
333
333
|
var r = e.apply(this, arguments);
|
|
334
334
|
Z(n, r);
|
|
335
335
|
var o = this.onsuccess, a = this.onerror;
|
|
@@ -337,12 +337,12 @@ var Rr = { exports: {} };
|
|
|
337
337
|
};
|
|
338
338
|
}
|
|
339
339
|
function Jr(e, t) {
|
|
340
|
-
return e ===
|
|
340
|
+
return e === Y ? t : function() {
|
|
341
341
|
return t.apply(this, arguments) !== !1 && e.apply(this, arguments);
|
|
342
342
|
};
|
|
343
343
|
}
|
|
344
344
|
function tn(e, t) {
|
|
345
|
-
return e ===
|
|
345
|
+
return e === Y ? t : function() {
|
|
346
346
|
var n = e.apply(this, arguments);
|
|
347
347
|
if (n && typeof n.then == "function") {
|
|
348
348
|
for (var r = this, o = arguments.length, a = new Array(o); o--; )
|
|
@@ -354,7 +354,7 @@ var Rr = { exports: {} };
|
|
|
354
354
|
return t.apply(this, arguments);
|
|
355
355
|
};
|
|
356
356
|
}
|
|
357
|
-
St.ModifyError = _t, St.DexieError =
|
|
357
|
+
St.ModifyError = _t, St.DexieError = Ye, St.BulkError = Qe;
|
|
358
358
|
var pe = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
|
|
359
359
|
function qn(e) {
|
|
360
360
|
pe = e;
|
|
@@ -367,12 +367,12 @@ var Rr = { exports: {} };
|
|
|
367
367
|
return [t, te(t), e];
|
|
368
368
|
}(), st = ge[0], de = ge[1], ge = ge[2], de = de && de.then, ut = st && st.constructor, nn = !!ge, ct = function(e, t) {
|
|
369
369
|
lt.push([e, t]), Et && (queueMicrotask(qr), Et = !1);
|
|
370
|
-
}, rn = !0, Et = !0,
|
|
370
|
+
}, rn = !0, Et = !0, Ne = [], Ot = [], on = ot, De = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: Y, pgp: !1, env: {}, finalize: Y }, N = De, lt = [], Be = 0, xt = [];
|
|
371
371
|
function M(e) {
|
|
372
372
|
if (typeof this != "object")
|
|
373
373
|
throw new TypeError("Promises must be constructed via new");
|
|
374
374
|
this._listeners = [], this._lib = !1;
|
|
375
|
-
var t = this._PSD =
|
|
375
|
+
var t = this._PSD = N;
|
|
376
376
|
if (typeof e != "function") {
|
|
377
377
|
if (e !== at)
|
|
378
378
|
throw new TypeError("Not a function");
|
|
@@ -396,10 +396,10 @@ var Rr = { exports: {} };
|
|
|
396
396
|
}(this, e);
|
|
397
397
|
}
|
|
398
398
|
var an = { get: function() {
|
|
399
|
-
var e =
|
|
399
|
+
var e = N, t = Pt;
|
|
400
400
|
function n(r, o) {
|
|
401
|
-
var a = this, s = !e.global && (e !==
|
|
402
|
-
un(a, new tr(ir(r, e, s, c), ir(o, e, s, c),
|
|
401
|
+
var a = this, s = !e.global && (e !== N || t !== Pt), c = s && !Ie(), g = new M(function(d, v) {
|
|
402
|
+
un(a, new tr(ir(r, e, s, c), ir(o, e, s, c), d, v, e));
|
|
403
403
|
});
|
|
404
404
|
return this._consoleTask && (g._consoleTask = this._consoleTask), g;
|
|
405
405
|
}
|
|
@@ -414,9 +414,9 @@ var Rr = { exports: {} };
|
|
|
414
414
|
}
|
|
415
415
|
function sn(e, t) {
|
|
416
416
|
var n, r;
|
|
417
|
-
Ot.push(t), e._state === null && (n = e._lib && Xe(), t = on(t), e._state = !1, e._value = t, r = e,
|
|
417
|
+
Ot.push(t), e._state === null && (n = e._lib && Xe(), t = on(t), e._state = !1, e._value = t, r = e, Ne.some(function(o) {
|
|
418
418
|
return o._value === r._value;
|
|
419
|
-
}) ||
|
|
419
|
+
}) || Ne.push(r), nr(e), n && Ve());
|
|
420
420
|
}
|
|
421
421
|
function nr(e) {
|
|
422
422
|
var t = e._listeners;
|
|
@@ -424,8 +424,8 @@ var Rr = { exports: {} };
|
|
|
424
424
|
for (var n = 0, r = t.length; n < r; ++n)
|
|
425
425
|
un(e, t[n]);
|
|
426
426
|
var o = e._PSD;
|
|
427
|
-
--o.ref || o.finalize(),
|
|
428
|
-
--
|
|
427
|
+
--o.ref || o.finalize(), Be === 0 && (++Be, ct(function() {
|
|
428
|
+
--Be == 0 && cn();
|
|
429
429
|
}, []));
|
|
430
430
|
}
|
|
431
431
|
function un(e, t) {
|
|
@@ -433,7 +433,7 @@ var Rr = { exports: {} };
|
|
|
433
433
|
var n = e._state ? t.onFulfilled : t.onRejected;
|
|
434
434
|
if (n === null)
|
|
435
435
|
return (e._state ? t.resolve : t.reject)(e._value);
|
|
436
|
-
++t.psd.ref, ++
|
|
436
|
+
++t.psd.ref, ++Be, ct(Zr, [n, e, t]);
|
|
437
437
|
} else
|
|
438
438
|
e._listeners.push(t);
|
|
439
439
|
}
|
|
@@ -443,18 +443,18 @@ var Rr = { exports: {} };
|
|
|
443
443
|
!t._state && Ot.length && (Ot = []), r = pe && t._consoleTask ? t._consoleTask.run(function() {
|
|
444
444
|
return e(o);
|
|
445
445
|
}) : e(o), t._state || Ot.indexOf(o) !== -1 || function(a) {
|
|
446
|
-
for (var s =
|
|
447
|
-
if (
|
|
448
|
-
return
|
|
446
|
+
for (var s = Ne.length; s; )
|
|
447
|
+
if (Ne[--s]._value === a._value)
|
|
448
|
+
return Ne.splice(s, 1);
|
|
449
449
|
}(t), n.resolve(r);
|
|
450
450
|
} catch (a) {
|
|
451
451
|
n.reject(a);
|
|
452
452
|
} finally {
|
|
453
|
-
--
|
|
453
|
+
--Be == 0 && cn(), --n.psd.ref || n.psd.finalize();
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
456
|
function qr() {
|
|
457
|
-
|
|
457
|
+
Ge(De, function() {
|
|
458
458
|
Xe() && Ve();
|
|
459
459
|
});
|
|
460
460
|
}
|
|
@@ -474,8 +474,8 @@ var Rr = { exports: {} };
|
|
|
474
474
|
Et = rn = !0;
|
|
475
475
|
}
|
|
476
476
|
function cn() {
|
|
477
|
-
var e =
|
|
478
|
-
|
|
477
|
+
var e = Ne;
|
|
478
|
+
Ne = [], e.forEach(function(r) {
|
|
479
479
|
r._PSD.onunhandled.call(null, r._value, r);
|
|
480
480
|
});
|
|
481
481
|
for (var t = xt.slice(0), n = t.length; n; )
|
|
@@ -485,20 +485,20 @@ var Rr = { exports: {} };
|
|
|
485
485
|
return new M(at, !1, e);
|
|
486
486
|
}
|
|
487
487
|
function J(e, t) {
|
|
488
|
-
var n =
|
|
488
|
+
var n = N;
|
|
489
489
|
return function() {
|
|
490
|
-
var r = Xe(), o =
|
|
490
|
+
var r = Xe(), o = N;
|
|
491
491
|
try {
|
|
492
|
-
return
|
|
492
|
+
return Ce(n, !0), e.apply(this, arguments);
|
|
493
493
|
} catch (a) {
|
|
494
494
|
t && t(a);
|
|
495
495
|
} finally {
|
|
496
|
-
|
|
496
|
+
Ce(o, !1), r && Ve();
|
|
497
497
|
}
|
|
498
498
|
};
|
|
499
499
|
}
|
|
500
500
|
xe(M.prototype, { then: an, _then: function(e, t) {
|
|
501
|
-
un(this, new tr(null, null, e, t,
|
|
501
|
+
un(this, new tr(null, null, e, t, N));
|
|
502
502
|
}, catch: function(e) {
|
|
503
503
|
if (arguments.length === 1)
|
|
504
504
|
return this.then(null, e);
|
|
@@ -522,12 +522,12 @@ var Rr = { exports: {} };
|
|
|
522
522
|
var n = this;
|
|
523
523
|
return e < 1 / 0 ? new M(function(r, o) {
|
|
524
524
|
var a = setTimeout(function() {
|
|
525
|
-
return o(new
|
|
525
|
+
return o(new L.Timeout(t));
|
|
526
526
|
}, e);
|
|
527
527
|
n.then(r, o).finally(clearTimeout.bind(null, a));
|
|
528
528
|
}) : this;
|
|
529
529
|
} }), typeof Symbol < "u" && Symbol.toStringTag && ke(M.prototype, Symbol.toStringTag, "Dexie.Promise"), De.env = rr(), xe(M, { all: function() {
|
|
530
|
-
var e = we.apply(null, arguments).map(
|
|
530
|
+
var e = we.apply(null, arguments).map(It);
|
|
531
531
|
return new M(function(t, n) {
|
|
532
532
|
e.length === 0 && t([]);
|
|
533
533
|
var r = e.length;
|
|
@@ -542,19 +542,19 @@ var Rr = { exports: {} };
|
|
|
542
542
|
e.then(t, n);
|
|
543
543
|
}) : new M(at, !0, e);
|
|
544
544
|
}, reject: kt, race: function() {
|
|
545
|
-
var e = we.apply(null, arguments).map(
|
|
545
|
+
var e = we.apply(null, arguments).map(It);
|
|
546
546
|
return new M(function(t, n) {
|
|
547
547
|
e.map(function(r) {
|
|
548
548
|
return M.resolve(r).then(t, n);
|
|
549
549
|
});
|
|
550
550
|
});
|
|
551
551
|
}, PSD: { get: function() {
|
|
552
|
-
return
|
|
552
|
+
return N;
|
|
553
553
|
}, set: function(e) {
|
|
554
|
-
return
|
|
554
|
+
return N = e;
|
|
555
555
|
} }, totalEchoes: { get: function() {
|
|
556
556
|
return Pt;
|
|
557
|
-
} }, newPSD: Pe, usePSD:
|
|
557
|
+
} }, newPSD: Pe, usePSD: Ge, scheduler: { get: function() {
|
|
558
558
|
return ct;
|
|
559
559
|
}, set: function(e) {
|
|
560
560
|
ct = e;
|
|
@@ -565,21 +565,21 @@ var Rr = { exports: {} };
|
|
|
565
565
|
} }, follow: function(e, t) {
|
|
566
566
|
return new M(function(n, r) {
|
|
567
567
|
return Pe(function(o, a) {
|
|
568
|
-
var s =
|
|
568
|
+
var s = N;
|
|
569
569
|
s.unhandleds = [], s.onunhandled = a, s.finalize = Ke(function() {
|
|
570
570
|
var c, g = this;
|
|
571
571
|
c = function() {
|
|
572
572
|
g.unhandleds.length === 0 ? o() : a(g.unhandleds[0]);
|
|
573
|
-
}, xt.push(function
|
|
574
|
-
c(), xt.splice(xt.indexOf(
|
|
575
|
-
}), ++
|
|
576
|
-
--
|
|
573
|
+
}, xt.push(function d() {
|
|
574
|
+
c(), xt.splice(xt.indexOf(d), 1);
|
|
575
|
+
}), ++Be, ct(function() {
|
|
576
|
+
--Be == 0 && cn();
|
|
577
577
|
}, []);
|
|
578
578
|
}, s.finalize), e();
|
|
579
579
|
}, t, n, r);
|
|
580
580
|
});
|
|
581
581
|
} }), ut && (ut.allSettled && ke(M, "allSettled", function() {
|
|
582
|
-
var e = we.apply(null, arguments).map(
|
|
582
|
+
var e = we.apply(null, arguments).map(It);
|
|
583
583
|
return new M(function(t) {
|
|
584
584
|
e.length === 0 && t([]);
|
|
585
585
|
var n = e.length, r = new Array(n);
|
|
@@ -594,7 +594,7 @@ var Rr = { exports: {} };
|
|
|
594
594
|
});
|
|
595
595
|
});
|
|
596
596
|
}), ut.any && typeof AggregateError < "u" && ke(M, "any", function() {
|
|
597
|
-
var e = we.apply(null, arguments).map(
|
|
597
|
+
var e = we.apply(null, arguments).map(It);
|
|
598
598
|
return new M(function(t, n) {
|
|
599
599
|
e.length === 0 && n(new AggregateError([]));
|
|
600
600
|
var r = e.length, o = new Array(r);
|
|
@@ -609,62 +609,62 @@ var Rr = { exports: {} };
|
|
|
609
609
|
}));
|
|
610
610
|
var ne = { awaits: 0, echoes: 0, id: 0 }, ei = 0, At = [], Dt = 0, Pt = 0, ti = 0;
|
|
611
611
|
function Pe(e, t, n, r) {
|
|
612
|
-
var o =
|
|
612
|
+
var o = N, a = Object.create(o);
|
|
613
613
|
return a.parent = o, a.ref = 0, a.global = !1, a.id = ++ti, De.env, a.env = nn ? { Promise: M, PromiseProp: { value: M, configurable: !0, writable: !0 }, all: M.all, race: M.race, allSettled: M.allSettled, any: M.any, resolve: M.resolve, reject: M.reject } : {}, t && Z(a, t), ++o.ref, a.finalize = function() {
|
|
614
614
|
--this.parent.ref || this.parent.finalize();
|
|
615
|
-
}, r =
|
|
615
|
+
}, r = Ge(a, e, n, r), a.ref === 0 && a.finalize(), r;
|
|
616
616
|
}
|
|
617
617
|
function Je() {
|
|
618
618
|
return ne.id || (ne.id = ++ei), ++ne.awaits, ne.echoes += er, ne.id;
|
|
619
619
|
}
|
|
620
|
-
function
|
|
620
|
+
function Ie() {
|
|
621
621
|
return !!ne.awaits && (--ne.awaits == 0 && (ne.id = 0), ne.echoes = ne.awaits * er, !0);
|
|
622
622
|
}
|
|
623
|
-
function
|
|
623
|
+
function It(e) {
|
|
624
624
|
return ne.echoes && e && e.constructor === ut ? (Je(), e.then(function(t) {
|
|
625
|
-
return
|
|
625
|
+
return Ie(), t;
|
|
626
626
|
}, function(t) {
|
|
627
|
-
return
|
|
627
|
+
return Ie(), q(t);
|
|
628
628
|
})) : e;
|
|
629
629
|
}
|
|
630
630
|
function ni() {
|
|
631
631
|
var e = At[At.length - 1];
|
|
632
|
-
At.pop(),
|
|
632
|
+
At.pop(), Ce(e, !1);
|
|
633
633
|
}
|
|
634
|
-
function
|
|
635
|
-
var n, r =
|
|
636
|
-
(t ? !ne.echoes || Dt++ && e ===
|
|
637
|
-
++Pt, ne.echoes && --ne.echoes != 0 || (ne.echoes = ne.awaits = ne.id = 0), At.push(
|
|
638
|
-
}).bind(null, e) : ni), e !==
|
|
634
|
+
function Ce(e, t) {
|
|
635
|
+
var n, r = N;
|
|
636
|
+
(t ? !ne.echoes || Dt++ && e === N : !Dt || --Dt && e === N) || queueMicrotask(t ? (function(o) {
|
|
637
|
+
++Pt, ne.echoes && --ne.echoes != 0 || (ne.echoes = ne.awaits = ne.id = 0), At.push(N), Ce(o, !0);
|
|
638
|
+
}).bind(null, e) : ni), e !== N && (N = e, r === De && (De.env = rr()), nn && (n = De.env.Promise, t = e.env, (r.global || e.global) && (Object.defineProperty(C, "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))));
|
|
639
639
|
}
|
|
640
640
|
function rr() {
|
|
641
|
-
var e =
|
|
642
|
-
return nn ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(
|
|
641
|
+
var e = C.Promise;
|
|
642
|
+
return nn ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(C, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
|
|
643
643
|
}
|
|
644
|
-
function
|
|
645
|
-
var a =
|
|
644
|
+
function Ge(e, t, n, r, o) {
|
|
645
|
+
var a = N;
|
|
646
646
|
try {
|
|
647
|
-
return
|
|
647
|
+
return Ce(e, !0), t(n, r, o);
|
|
648
648
|
} finally {
|
|
649
|
-
|
|
649
|
+
Ce(a, !1);
|
|
650
650
|
}
|
|
651
651
|
}
|
|
652
652
|
function ir(e, t, n, r) {
|
|
653
653
|
return typeof e != "function" ? e : function() {
|
|
654
|
-
var o =
|
|
655
|
-
n && Je(),
|
|
654
|
+
var o = N;
|
|
655
|
+
n && Je(), Ce(t, !0);
|
|
656
656
|
try {
|
|
657
657
|
return e.apply(this, arguments);
|
|
658
658
|
} finally {
|
|
659
|
-
|
|
659
|
+
Ce(o, !1), r && queueMicrotask(Ie);
|
|
660
660
|
}
|
|
661
661
|
};
|
|
662
662
|
}
|
|
663
663
|
function ln(e) {
|
|
664
664
|
Promise === ut && ne.echoes === 0 ? Dt === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
665
665
|
}
|
|
666
|
-
("" + de).indexOf("[native code]") === -1 && (Je =
|
|
667
|
-
var q = M.reject, ge = "4.0.1-beta.10",
|
|
666
|
+
("" + de).indexOf("[native code]") === -1 && (Je = Ie = Y);
|
|
667
|
+
var q = M.reject, ge = "4.0.1-beta.10", Le = "", _e = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", or = "String expected.", Ze = [], Ct = "__dbnames", fn = "readonly", dn = "readwrite";
|
|
668
668
|
function Fe(e, t) {
|
|
669
669
|
return e ? t ? function() {
|
|
670
670
|
return e.apply(this, arguments) && t.apply(this, arguments);
|
|
@@ -679,7 +679,7 @@ var Rr = { exports: {} };
|
|
|
679
679
|
};
|
|
680
680
|
}
|
|
681
681
|
function sr() {
|
|
682
|
-
throw
|
|
682
|
+
throw L.Type();
|
|
683
683
|
}
|
|
684
684
|
function z(e, t) {
|
|
685
685
|
try {
|
|
@@ -693,15 +693,15 @@ var Rr = { exports: {} };
|
|
|
693
693
|
return t < e ? 1 : e < t ? -1 : 0;
|
|
694
694
|
case "binary":
|
|
695
695
|
return function(o, a) {
|
|
696
|
-
for (var s = o.length, c = a.length, g = s < c ? s : c,
|
|
697
|
-
if (o[
|
|
698
|
-
return o[
|
|
696
|
+
for (var s = o.length, c = a.length, g = s < c ? s : c, d = 0; d < g; ++d)
|
|
697
|
+
if (o[d] !== a[d])
|
|
698
|
+
return o[d] < a[d] ? -1 : 1;
|
|
699
699
|
return s === c ? 0 : s < c ? -1 : 1;
|
|
700
700
|
}(cr(e), cr(t));
|
|
701
701
|
case "Array":
|
|
702
702
|
return function(o, a) {
|
|
703
|
-
for (var s = o.length, c = a.length, g = s < c ? s : c,
|
|
704
|
-
var v = z(o[
|
|
703
|
+
for (var s = o.length, c = a.length, g = s < c ? s : c, d = 0; d < g; ++d) {
|
|
704
|
+
var v = z(o[d], a[d]);
|
|
705
705
|
if (v !== 0)
|
|
706
706
|
return v;
|
|
707
707
|
}
|
|
@@ -720,29 +720,29 @@ var Rr = { exports: {} };
|
|
|
720
720
|
return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
|
|
721
721
|
}
|
|
722
722
|
var lr = (X.prototype._trans = function(e, t, n) {
|
|
723
|
-
var r = this._tx ||
|
|
724
|
-
function s(
|
|
723
|
+
var r = this._tx || N.trans, o = this.name, a = pe && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
724
|
+
function s(d, v, l) {
|
|
725
725
|
if (!l.schema[o])
|
|
726
|
-
throw new
|
|
726
|
+
throw new L.NotFound("Table " + o + " not part of transaction");
|
|
727
727
|
return t(l.idbtrans, l);
|
|
728
728
|
}
|
|
729
729
|
var c = Xe();
|
|
730
730
|
try {
|
|
731
|
-
var g = r && r.db._novip === this.db._novip ? r ===
|
|
731
|
+
var g = r && r.db._novip === this.db._novip ? r === N.trans ? r._promise(e, s, n) : Pe(function() {
|
|
732
732
|
return r._promise(e, s, n);
|
|
733
|
-
}, { trans: r, transless:
|
|
734
|
-
if (v.idbdb && (v._state.openComplete ||
|
|
735
|
-
var b = v._createTransaction(l,
|
|
733
|
+
}, { trans: r, transless: N.transless || N }) : function d(v, l, h, y) {
|
|
734
|
+
if (v.idbdb && (v._state.openComplete || N.letThrough || v._vip)) {
|
|
735
|
+
var b = v._createTransaction(l, h, v._dbSchema);
|
|
736
736
|
try {
|
|
737
737
|
b.create(), v._state.PR1398_maxLoop = 3;
|
|
738
738
|
} catch (w) {
|
|
739
739
|
return w.name === en.InvalidState && v.isOpen() && 0 < --v._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), v.close({ disableAutoOpen: !1 }), v.open().then(function() {
|
|
740
|
-
return
|
|
740
|
+
return d(v, l, h, y);
|
|
741
741
|
})) : q(w);
|
|
742
742
|
}
|
|
743
743
|
return b._promise(l, function(w, m) {
|
|
744
744
|
return Pe(function() {
|
|
745
|
-
return
|
|
745
|
+
return N.trans = b, y(w, m, b);
|
|
746
746
|
});
|
|
747
747
|
}).then(function(w) {
|
|
748
748
|
if (l === "readwrite")
|
|
@@ -756,25 +756,25 @@ var Rr = { exports: {} };
|
|
|
756
756
|
});
|
|
757
757
|
}
|
|
758
758
|
if (v._state.openComplete)
|
|
759
|
-
return q(new
|
|
759
|
+
return q(new L.DatabaseClosed(v._state.dbOpenError));
|
|
760
760
|
if (!v._state.isBeingOpened) {
|
|
761
761
|
if (!v._state.autoOpen)
|
|
762
|
-
return q(new
|
|
763
|
-
v.open().catch(
|
|
762
|
+
return q(new L.DatabaseClosed());
|
|
763
|
+
v.open().catch(Y);
|
|
764
764
|
}
|
|
765
765
|
return v._state.dbReadyPromise.then(function() {
|
|
766
|
-
return
|
|
766
|
+
return d(v, l, h, y);
|
|
767
767
|
});
|
|
768
768
|
}(this.db, e, [this.name], s);
|
|
769
|
-
return a && (g._consoleTask = a, g = g.catch(function(
|
|
770
|
-
return console.trace(
|
|
769
|
+
return a && (g._consoleTask = a, g = g.catch(function(d) {
|
|
770
|
+
return console.trace(d), q(d);
|
|
771
771
|
})), g;
|
|
772
772
|
} finally {
|
|
773
773
|
c && Ve();
|
|
774
774
|
}
|
|
775
775
|
}, X.prototype.get = function(e, t) {
|
|
776
776
|
var n = this;
|
|
777
|
-
return e && e.constructor === Object ? this.where(e).first(t) : e == null ? q(new
|
|
777
|
+
return e && e.constructor === Object ? this.where(e).first(t) : e == null ? q(new L.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(r) {
|
|
778
778
|
return n.core.get({ trans: r, key: e }).then(function(o) {
|
|
779
779
|
return n.hook.reading.fire(o);
|
|
780
780
|
});
|
|
@@ -782,7 +782,7 @@ var Rr = { exports: {} };
|
|
|
782
782
|
}, X.prototype.where = function(e) {
|
|
783
783
|
if (typeof e == "string")
|
|
784
784
|
return new this.db.WhereClause(this, e);
|
|
785
|
-
if (
|
|
785
|
+
if (B(e))
|
|
786
786
|
return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
|
|
787
787
|
var t = K(e);
|
|
788
788
|
if (t.length === 1)
|
|
@@ -791,34 +791,34 @@ var Rr = { exports: {} };
|
|
|
791
791
|
if (g.compound && t.every(function(v) {
|
|
792
792
|
return 0 <= g.keyPath.indexOf(v);
|
|
793
793
|
})) {
|
|
794
|
-
for (var
|
|
795
|
-
if (t.indexOf(g.keyPath[
|
|
794
|
+
for (var d = 0; d < t.length; ++d)
|
|
795
|
+
if (t.indexOf(g.keyPath[d]) === -1)
|
|
796
796
|
return !1;
|
|
797
797
|
return !0;
|
|
798
798
|
}
|
|
799
799
|
return !1;
|
|
800
|
-
}).sort(function(g,
|
|
801
|
-
return g.keyPath.length -
|
|
800
|
+
}).sort(function(g, d) {
|
|
801
|
+
return g.keyPath.length - d.keyPath.length;
|
|
802
802
|
})[0];
|
|
803
|
-
if (n && this.db._maxKey !==
|
|
803
|
+
if (n && this.db._maxKey !== Le) {
|
|
804
804
|
var s = n.keyPath.slice(0, t.length);
|
|
805
|
-
return this.where(s).equals(s.map(function(
|
|
806
|
-
return e[
|
|
805
|
+
return this.where(s).equals(s.map(function(d) {
|
|
806
|
+
return e[d];
|
|
807
807
|
}));
|
|
808
808
|
}
|
|
809
809
|
!n && pe && console.warn("The query ".concat(JSON.stringify(e), " on ").concat(this.name, " would benefit from a ") + "compound index [".concat(t.join("+"), "]"));
|
|
810
810
|
var r = this.schema.idxByName, o = this.db._deps.indexedDB;
|
|
811
|
-
function a(g,
|
|
812
|
-
return o.cmp(g,
|
|
811
|
+
function a(g, d) {
|
|
812
|
+
return o.cmp(g, d) === 0;
|
|
813
813
|
}
|
|
814
|
-
var c = t.reduce(function(
|
|
815
|
-
var v =
|
|
816
|
-
return [v ||
|
|
817
|
-
return b = ve(b,
|
|
814
|
+
var c = t.reduce(function(h, d) {
|
|
815
|
+
var v = h[0], l = h[1], h = r[d], y = e[d];
|
|
816
|
+
return [v || h, v || !h ? Fe(l, h && h.multi ? function(b) {
|
|
817
|
+
return b = ve(b, d), B(b) && b.some(function(w) {
|
|
818
818
|
return a(y, w);
|
|
819
819
|
});
|
|
820
820
|
} : function(b) {
|
|
821
|
-
return a(y, ve(b,
|
|
821
|
+
return a(y, ve(b, d));
|
|
822
822
|
}) : l];
|
|
823
823
|
}, [null, null]), s = c[0], c = c[1];
|
|
824
824
|
return s ? this.where(s.name).equals(e[s.keyPath]).filter(c) : n ? this.filter(c) : this.where(t).equals("");
|
|
@@ -837,7 +837,7 @@ var Rr = { exports: {} };
|
|
|
837
837
|
}, X.prototype.toCollection = function() {
|
|
838
838
|
return new this.db.Collection(new this.db.WhereClause(this));
|
|
839
839
|
}, X.prototype.orderBy = function(e) {
|
|
840
|
-
return new this.db.Collection(new this.db.WhereClause(this,
|
|
840
|
+
return new this.db.Collection(new this.db.WhereClause(this, B(e) ? "[".concat(e.join("+"), "]") : e));
|
|
841
841
|
}, X.prototype.reverse = function() {
|
|
842
842
|
return this.toCollection().reverse();
|
|
843
843
|
}, X.prototype.mapToClass = function(e) {
|
|
@@ -845,13 +845,13 @@ var Rr = { exports: {} };
|
|
|
845
845
|
function o() {
|
|
846
846
|
return t !== null && t.apply(this, arguments) || this;
|
|
847
847
|
}
|
|
848
|
-
(this.schema.mappedClass = e).prototype instanceof sr && (function(g,
|
|
849
|
-
if (typeof
|
|
850
|
-
throw new TypeError("Class extends value " + String(
|
|
848
|
+
(this.schema.mappedClass = e).prototype instanceof sr && (function(g, d) {
|
|
849
|
+
if (typeof d != "function" && d !== null)
|
|
850
|
+
throw new TypeError("Class extends value " + String(d) + " is not a constructor or null");
|
|
851
851
|
function v() {
|
|
852
852
|
this.constructor = g;
|
|
853
853
|
}
|
|
854
|
-
u(g,
|
|
854
|
+
u(g, d), g.prototype = d === null ? Object.create(d) : (v.prototype = d.prototype, new v());
|
|
855
855
|
}(o, t = e), Object.defineProperty(o.prototype, "db", { get: function() {
|
|
856
856
|
return n;
|
|
857
857
|
}, enumerable: !1, configurable: !0 }), o.prototype.table = function() {
|
|
@@ -864,11 +864,11 @@ var Rr = { exports: {} };
|
|
|
864
864
|
function c(g) {
|
|
865
865
|
if (!g)
|
|
866
866
|
return g;
|
|
867
|
-
var
|
|
868
|
-
for (
|
|
869
|
-
if (!a.has(
|
|
867
|
+
var d, v = Object.create(e.prototype);
|
|
868
|
+
for (d in g)
|
|
869
|
+
if (!a.has(d))
|
|
870
870
|
try {
|
|
871
|
-
v[
|
|
871
|
+
v[d] = g[d];
|
|
872
872
|
} catch {
|
|
873
873
|
}
|
|
874
874
|
return v;
|
|
@@ -893,7 +893,7 @@ var Rr = { exports: {} };
|
|
|
893
893
|
return c;
|
|
894
894
|
});
|
|
895
895
|
}, X.prototype.update = function(e, t) {
|
|
896
|
-
return typeof e != "object" ||
|
|
896
|
+
return typeof e != "object" || B(e) ? this.where(":id").equals(e).modify(t) : (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(t));
|
|
897
897
|
}, X.prototype.put = function(e, t) {
|
|
898
898
|
var n = this, r = this.schema.primKey, o = r.auto, a = r.keyPath, s = e;
|
|
899
899
|
return a && o && (s = Rt(a)(e)), this._trans("readwrite", function(c) {
|
|
@@ -934,32 +934,32 @@ var Rr = { exports: {} };
|
|
|
934
934
|
}, X.prototype.bulkAdd = function(e, t, n) {
|
|
935
935
|
var r = this, o = Array.isArray(t) ? t : void 0, a = (n = n || (o ? void 0 : t)) ? n.allKeys : void 0;
|
|
936
936
|
return this._trans("readwrite", function(s) {
|
|
937
|
-
var
|
|
938
|
-
if (
|
|
939
|
-
throw new
|
|
937
|
+
var d = r.schema.primKey, c = d.auto, d = d.keyPath;
|
|
938
|
+
if (d && o)
|
|
939
|
+
throw new L.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
940
940
|
if (o && o.length !== e.length)
|
|
941
|
-
throw new
|
|
942
|
-
var g = e.length,
|
|
943
|
-
return r.core.mutate({ trans: s, type: "add", keys: o, values:
|
|
944
|
-
var l = b.numFailures,
|
|
941
|
+
throw new L.InvalidArgument("Arguments objects and keys must have the same length");
|
|
942
|
+
var g = e.length, d = d && c ? e.map(Rt(d)) : e;
|
|
943
|
+
return r.core.mutate({ trans: s, type: "add", keys: o, values: d, wantResults: a }).then(function(b) {
|
|
944
|
+
var l = b.numFailures, h = b.results, y = b.lastResult, b = b.failures;
|
|
945
945
|
if (l === 0)
|
|
946
|
-
return a ?
|
|
946
|
+
return a ? h : y;
|
|
947
947
|
throw new Qe("".concat(r.name, ".bulkAdd(): ").concat(l, " of ").concat(g, " operations failed"), b);
|
|
948
948
|
});
|
|
949
949
|
});
|
|
950
950
|
}, X.prototype.bulkPut = function(e, t, n) {
|
|
951
951
|
var r = this, o = Array.isArray(t) ? t : void 0, a = (n = n || (o ? void 0 : t)) ? n.allKeys : void 0;
|
|
952
952
|
return this._trans("readwrite", function(s) {
|
|
953
|
-
var
|
|
954
|
-
if (
|
|
955
|
-
throw new
|
|
953
|
+
var d = r.schema.primKey, c = d.auto, d = d.keyPath;
|
|
954
|
+
if (d && o)
|
|
955
|
+
throw new L.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
956
956
|
if (o && o.length !== e.length)
|
|
957
|
-
throw new
|
|
958
|
-
var g = e.length,
|
|
959
|
-
return r.core.mutate({ trans: s, type: "put", keys: o, values:
|
|
960
|
-
var l = b.numFailures,
|
|
957
|
+
throw new L.InvalidArgument("Arguments objects and keys must have the same length");
|
|
958
|
+
var g = e.length, d = d && c ? e.map(Rt(d)) : e;
|
|
959
|
+
return r.core.mutate({ trans: s, type: "put", keys: o, values: d, wantResults: a }).then(function(b) {
|
|
960
|
+
var l = b.numFailures, h = b.results, y = b.lastResult, b = b.failures;
|
|
961
961
|
if (l === 0)
|
|
962
|
-
return a ?
|
|
962
|
+
return a ? h : y;
|
|
963
963
|
throw new Qe("".concat(r.name, ".bulkPut(): ").concat(l, " of ").concat(g, " operations failed"), b);
|
|
964
964
|
});
|
|
965
965
|
});
|
|
@@ -971,31 +971,31 @@ var Rr = { exports: {} };
|
|
|
971
971
|
}), a = [];
|
|
972
972
|
return this._trans("readwrite", function(s) {
|
|
973
973
|
return n.getMany({ trans: s, keys: r, cache: "clone" }).then(function(c) {
|
|
974
|
-
var g = [],
|
|
975
|
-
e.forEach(function(l,
|
|
976
|
-
var y = l.key, b = l.changes, w = c[
|
|
974
|
+
var g = [], d = [];
|
|
975
|
+
e.forEach(function(l, h) {
|
|
976
|
+
var y = l.key, b = l.changes, w = c[h];
|
|
977
977
|
if (w) {
|
|
978
978
|
for (var m = 0, _ = Object.keys(b); m < _.length; m++) {
|
|
979
|
-
var S = _[m],
|
|
979
|
+
var S = _[m], O = b[S];
|
|
980
980
|
if (S === t.schema.primKey.keyPath) {
|
|
981
|
-
if (z(
|
|
982
|
-
throw new
|
|
981
|
+
if (z(O, y) !== 0)
|
|
982
|
+
throw new L.Constraint("Cannot update primary key in bulkUpdate()");
|
|
983
983
|
} else
|
|
984
|
-
fe(w, S,
|
|
984
|
+
fe(w, S, O);
|
|
985
985
|
}
|
|
986
|
-
a.push(
|
|
986
|
+
a.push(h), g.push(y), d.push(w);
|
|
987
987
|
}
|
|
988
988
|
});
|
|
989
989
|
var v = g.length;
|
|
990
|
-
return n.mutate({ trans: s, type: "put", keys: g, values:
|
|
991
|
-
var
|
|
992
|
-
if (
|
|
990
|
+
return n.mutate({ trans: s, type: "put", keys: g, values: d, updates: { keys: r, changeSpecs: o } }).then(function(l) {
|
|
991
|
+
var h = l.numFailures, y = l.failures;
|
|
992
|
+
if (h === 0)
|
|
993
993
|
return v;
|
|
994
994
|
for (var b = 0, w = Object.keys(y); b < w.length; b++) {
|
|
995
995
|
var m, _ = w[b], S = a[Number(_)];
|
|
996
996
|
S != null && (m = y[_], delete y[_], y[S] = m);
|
|
997
997
|
}
|
|
998
|
-
throw new Qe("".concat(t.name, ".bulkUpdate(): ").concat(
|
|
998
|
+
throw new Qe("".concat(t.name, ".bulkUpdate(): ").concat(h, " of ").concat(v, " operations failed"), y);
|
|
999
999
|
});
|
|
1000
1000
|
});
|
|
1001
1001
|
});
|
|
@@ -1015,9 +1015,9 @@ var Rr = { exports: {} };
|
|
|
1015
1015
|
function ft(e) {
|
|
1016
1016
|
function t(s, c) {
|
|
1017
1017
|
if (c) {
|
|
1018
|
-
for (var g = arguments.length,
|
|
1019
|
-
|
|
1020
|
-
return n[s].subscribe.apply(null,
|
|
1018
|
+
for (var g = arguments.length, d = new Array(g - 1); --g; )
|
|
1019
|
+
d[g - 1] = arguments[g];
|
|
1020
|
+
return n[s].subscribe.apply(null, d), e;
|
|
1021
1021
|
}
|
|
1022
1022
|
if (typeof s == "string")
|
|
1023
1023
|
return n[s];
|
|
@@ -1029,29 +1029,29 @@ var Rr = { exports: {} };
|
|
|
1029
1029
|
return t;
|
|
1030
1030
|
function a(s, c, g) {
|
|
1031
1031
|
if (typeof s != "object") {
|
|
1032
|
-
var
|
|
1032
|
+
var d;
|
|
1033
1033
|
c = c || Jr;
|
|
1034
|
-
var v = { subscribers: [], fire: g = g ||
|
|
1034
|
+
var v = { subscribers: [], fire: g = g || Y, subscribe: function(l) {
|
|
1035
1035
|
v.subscribers.indexOf(l) === -1 && (v.subscribers.push(l), v.fire = c(v.fire, l));
|
|
1036
1036
|
}, unsubscribe: function(l) {
|
|
1037
|
-
v.subscribers = v.subscribers.filter(function(
|
|
1038
|
-
return
|
|
1037
|
+
v.subscribers = v.subscribers.filter(function(h) {
|
|
1038
|
+
return h !== l;
|
|
1039
1039
|
}), v.fire = v.subscribers.reduce(c, g);
|
|
1040
1040
|
} };
|
|
1041
1041
|
return n[s] = t[s] = v;
|
|
1042
1042
|
}
|
|
1043
|
-
K(
|
|
1044
|
-
var
|
|
1045
|
-
if (
|
|
1046
|
-
a(l,
|
|
1043
|
+
K(d = s).forEach(function(l) {
|
|
1044
|
+
var h = d[l];
|
|
1045
|
+
if (B(h))
|
|
1046
|
+
a(l, d[l][0], d[l][1]);
|
|
1047
1047
|
else {
|
|
1048
|
-
if (
|
|
1049
|
-
throw new
|
|
1048
|
+
if (h !== "asap")
|
|
1049
|
+
throw new L.InvalidArgument("Invalid event config");
|
|
1050
1050
|
var y = a(l, ot, function() {
|
|
1051
1051
|
for (var b = arguments.length, w = new Array(b); b--; )
|
|
1052
1052
|
w[b] = arguments[b];
|
|
1053
1053
|
y.subscribers.forEach(function(m) {
|
|
1054
|
-
|
|
1054
|
+
Yn(function() {
|
|
1055
1055
|
m.apply(null, w);
|
|
1056
1056
|
});
|
|
1057
1057
|
});
|
|
@@ -1080,7 +1080,7 @@ var Rr = { exports: {} };
|
|
|
1080
1080
|
return t.primaryKey;
|
|
1081
1081
|
var n = t.getIndexByKeyPath(e.index);
|
|
1082
1082
|
if (!n)
|
|
1083
|
-
throw new
|
|
1083
|
+
throw new L.Schema("KeyPath " + e.index + " on object store " + t.name + " is not indexed");
|
|
1084
1084
|
return n;
|
|
1085
1085
|
}
|
|
1086
1086
|
function fr(e, t, n) {
|
|
@@ -1090,13 +1090,13 @@ var Rr = { exports: {} };
|
|
|
1090
1090
|
function Mt(e, t, n, r) {
|
|
1091
1091
|
var o = e.replayFilter ? Fe(e.filter, e.replayFilter()) : e.filter;
|
|
1092
1092
|
if (e.or) {
|
|
1093
|
-
var a = {}, s = function(c, g,
|
|
1093
|
+
var a = {}, s = function(c, g, d) {
|
|
1094
1094
|
var v, l;
|
|
1095
|
-
o && !o(g,
|
|
1096
|
-
return g.stop(
|
|
1097
|
-
}, function(
|
|
1098
|
-
return g.fail(
|
|
1099
|
-
}) || ((l = "" + (v = g.primaryKey)) == "[object ArrayBuffer]" && (l = "" + new Uint8Array(v)), ie(a, l) || (a[l] = !0, t(c, g,
|
|
1095
|
+
o && !o(g, d, function(h) {
|
|
1096
|
+
return g.stop(h);
|
|
1097
|
+
}, function(h) {
|
|
1098
|
+
return g.fail(h);
|
|
1099
|
+
}) || ((l = "" + (v = g.primaryKey)) == "[object ArrayBuffer]" && (l = "" + new Uint8Array(v)), ie(a, l) || (a[l] = !0, t(c, g, d)));
|
|
1100
1100
|
};
|
|
1101
1101
|
return Promise.all([e.or._iterate(s, n), dr(fr(e, r, n), e.algorithm, s, !e.keysOnly && e.valueMapper)]);
|
|
1102
1102
|
}
|
|
@@ -1115,9 +1115,9 @@ var Rr = { exports: {} };
|
|
|
1115
1115
|
t && !t(a, function(c) {
|
|
1116
1116
|
return s = c;
|
|
1117
1117
|
}, function(c) {
|
|
1118
|
-
a.stop(c), s =
|
|
1118
|
+
a.stop(c), s = Y;
|
|
1119
1119
|
}, function(c) {
|
|
1120
|
-
a.fail(c), s =
|
|
1120
|
+
a.fail(c), s = Y;
|
|
1121
1121
|
}) || o(a.value, a, function(c) {
|
|
1122
1122
|
return s = c;
|
|
1123
1123
|
}), s();
|
|
@@ -1162,12 +1162,12 @@ var Rr = { exports: {} };
|
|
|
1162
1162
|
}).then(e);
|
|
1163
1163
|
}, W.prototype.sortBy = function(e, t) {
|
|
1164
1164
|
var n = e.split(".").reverse(), r = n[0], o = n.length - 1;
|
|
1165
|
-
function a(g,
|
|
1166
|
-
return
|
|
1165
|
+
function a(g, d) {
|
|
1166
|
+
return d ? a(g[n[d]], d - 1) : g[r];
|
|
1167
1167
|
}
|
|
1168
1168
|
var s = this._ctx.dir === "next" ? 1 : -1;
|
|
1169
|
-
function c(g,
|
|
1170
|
-
return g = a(g, o),
|
|
1169
|
+
function c(g, d) {
|
|
1170
|
+
return g = a(g, o), d = a(d, o), g < d ? -s : d < g ? s : 0;
|
|
1171
1171
|
}
|
|
1172
1172
|
return this.toArray(function(g) {
|
|
1173
1173
|
return g.sort(c);
|
|
@@ -1294,43 +1294,43 @@ var Rr = { exports: {} };
|
|
|
1294
1294
|
var o, a, s;
|
|
1295
1295
|
s = typeof e == "function" ? e : (o = K(e), a = o.length, function(m) {
|
|
1296
1296
|
for (var _ = !1, S = 0; S < a; ++S) {
|
|
1297
|
-
var
|
|
1298
|
-
ve(m,
|
|
1297
|
+
var O = o[S], x = e[O];
|
|
1298
|
+
ve(m, O) !== x && (fe(m, O, x), _ = !0);
|
|
1299
1299
|
}
|
|
1300
1300
|
return _;
|
|
1301
1301
|
});
|
|
1302
|
-
function c(m,
|
|
1303
|
-
var S =
|
|
1304
|
-
b += m -
|
|
1305
|
-
for (var
|
|
1306
|
-
var
|
|
1307
|
-
y.push(S[
|
|
1302
|
+
function c(m, O) {
|
|
1303
|
+
var S = O.failures, O = O.numFailures;
|
|
1304
|
+
b += m - O;
|
|
1305
|
+
for (var x = 0, A = K(S); x < A.length; x++) {
|
|
1306
|
+
var R = A[x];
|
|
1307
|
+
y.push(S[R]);
|
|
1308
1308
|
}
|
|
1309
1309
|
}
|
|
1310
|
-
var g = n.table.core,
|
|
1310
|
+
var g = n.table.core, d = g.schema.primaryKey, v = d.outbound, l = d.extractKey, h = t.db._options.modifyChunkSize || 200, y = [], b = 0, w = [];
|
|
1311
1311
|
return t.clone().primaryKeys().then(function(m) {
|
|
1312
1312
|
function _(S) {
|
|
1313
|
-
var
|
|
1314
|
-
return g.getMany({ trans: r, keys: m.slice(S, S +
|
|
1315
|
-
for (var
|
|
1316
|
-
var
|
|
1317
|
-
s.call(F, F.value, F) !== !1 && (F.value == null ? T.push(m[S +
|
|
1313
|
+
var O = Math.min(h, m.length - S);
|
|
1314
|
+
return g.getMany({ trans: r, keys: m.slice(S, S + O), cache: "immutable" }).then(function(x) {
|
|
1315
|
+
for (var A = [], R = [], D = v ? [] : null, T = [], I = 0; I < O; ++I) {
|
|
1316
|
+
var G = x[I], F = { value: Ae(G), primKey: m[S + I] };
|
|
1317
|
+
s.call(F, F.value, F) !== !1 && (F.value == null ? T.push(m[S + I]) : v || z(l(G), l(F.value)) === 0 ? (R.push(F.value), v && D.push(m[S + I])) : (T.push(m[S + I]), A.push(F.value)));
|
|
1318
1318
|
}
|
|
1319
|
-
var
|
|
1320
|
-
return Promise.resolve(0 <
|
|
1319
|
+
var H = qe(n) && n.limit === 1 / 0 && (typeof e != "function" || e === gn) && { index: n.index, range: n.range };
|
|
1320
|
+
return Promise.resolve(0 < A.length && g.mutate({ trans: r, type: "add", values: A }).then(function(U) {
|
|
1321
1321
|
for (var Q in U.failures)
|
|
1322
1322
|
T.splice(parseInt(Q), 1);
|
|
1323
|
-
c(
|
|
1323
|
+
c(A.length, U);
|
|
1324
1324
|
})).then(function() {
|
|
1325
|
-
return (0 <
|
|
1326
|
-
return c(
|
|
1325
|
+
return (0 < R.length || H && typeof e == "object") && g.mutate({ trans: r, type: "put", keys: D, values: R, criteria: H, changeSpec: typeof e != "function" && e }).then(function(U) {
|
|
1326
|
+
return c(R.length, U);
|
|
1327
1327
|
});
|
|
1328
1328
|
}).then(function() {
|
|
1329
|
-
return (0 < T.length ||
|
|
1329
|
+
return (0 < T.length || H && e === gn) && g.mutate({ trans: r, type: "delete", keys: T, criteria: H }).then(function(U) {
|
|
1330
1330
|
return c(T.length, U);
|
|
1331
1331
|
});
|
|
1332
1332
|
}).then(function() {
|
|
1333
|
-
return m.length > S +
|
|
1333
|
+
return m.length > S + O && _(S + h);
|
|
1334
1334
|
});
|
|
1335
1335
|
});
|
|
1336
1336
|
}
|
|
@@ -1377,12 +1377,12 @@ var Rr = { exports: {} };
|
|
|
1377
1377
|
}).limit(0);
|
|
1378
1378
|
}
|
|
1379
1379
|
function jt(e, t, n, r) {
|
|
1380
|
-
var o, a, s, c, g,
|
|
1380
|
+
var o, a, s, c, g, d, v, l = n.length;
|
|
1381
1381
|
if (!n.every(function(b) {
|
|
1382
1382
|
return typeof b == "string";
|
|
1383
1383
|
}))
|
|
1384
1384
|
return ce(e, or);
|
|
1385
|
-
function
|
|
1385
|
+
function h(b) {
|
|
1386
1386
|
o = b === "next" ? function(m) {
|
|
1387
1387
|
return m.toUpperCase();
|
|
1388
1388
|
} : function(m) {
|
|
@@ -1401,12 +1401,12 @@ var Rr = { exports: {} };
|
|
|
1401
1401
|
return m.upper;
|
|
1402
1402
|
}), g = w.map(function(m) {
|
|
1403
1403
|
return m.lower;
|
|
1404
|
-
}), v = (
|
|
1404
|
+
}), v = (d = b) === "next" ? "" : r;
|
|
1405
1405
|
}
|
|
1406
|
-
|
|
1406
|
+
h("next"), e = new e.Collection(e, function() {
|
|
1407
1407
|
return Re(c[0], g[l - 1] + r);
|
|
1408
1408
|
}), e._ondirectionchange = function(b) {
|
|
1409
|
-
|
|
1409
|
+
h(b);
|
|
1410
1410
|
};
|
|
1411
1411
|
var y = 0;
|
|
1412
1412
|
return e._addAlgorithm(function(b, w, m) {
|
|
@@ -1416,20 +1416,20 @@ var Rr = { exports: {} };
|
|
|
1416
1416
|
var S = a(_);
|
|
1417
1417
|
if (t(S, g, y))
|
|
1418
1418
|
return !0;
|
|
1419
|
-
for (var
|
|
1420
|
-
var
|
|
1421
|
-
for (var
|
|
1419
|
+
for (var O = null, x = y; x < l; ++x) {
|
|
1420
|
+
var A = function(R, D, T, I, G, F) {
|
|
1421
|
+
for (var H = Math.min(R.length, I.length), U = -1, Q = 0; Q < H; ++Q) {
|
|
1422
1422
|
var le = D[Q];
|
|
1423
|
-
if (le !==
|
|
1424
|
-
return
|
|
1425
|
-
|
|
1423
|
+
if (le !== I[Q])
|
|
1424
|
+
return G(R[Q], T[Q]) < 0 ? R.substr(0, Q) + T[Q] + T.substr(Q + 1) : G(R[Q], I[Q]) < 0 ? R.substr(0, Q) + I[Q] + T.substr(Q + 1) : 0 <= U ? R.substr(0, U) + D[U] + T.substr(U + 1) : null;
|
|
1425
|
+
G(R[Q], le) < 0 && (U = Q);
|
|
1426
1426
|
}
|
|
1427
|
-
return
|
|
1428
|
-
}(_, S, c[
|
|
1429
|
-
|
|
1427
|
+
return H < I.length && F === "next" ? R + T.substr(R.length) : H < R.length && F === "prev" ? R.substr(0, T.length) : U < 0 ? null : R.substr(0, U) + I[U] + T.substr(U + 1);
|
|
1428
|
+
}(_, S, c[x], g[x], s, d);
|
|
1429
|
+
A === null && O === null ? y = x + 1 : (O === null || 0 < s(O, A)) && (O = A);
|
|
1430
1430
|
}
|
|
1431
|
-
return w(
|
|
1432
|
-
b.continue(
|
|
1431
|
+
return w(O !== null ? function() {
|
|
1432
|
+
b.continue(O + v);
|
|
1433
1433
|
} : m), !1;
|
|
1434
1434
|
}), e;
|
|
1435
1435
|
}
|
|
@@ -1471,29 +1471,29 @@ var Rr = { exports: {} };
|
|
|
1471
1471
|
return Re(void 0, e);
|
|
1472
1472
|
});
|
|
1473
1473
|
}, re.prototype.startsWith = function(e) {
|
|
1474
|
-
return typeof e != "string" ? ce(this, or) : this.between(e, e +
|
|
1474
|
+
return typeof e != "string" ? ce(this, or) : this.between(e, e + Le, !0, !0);
|
|
1475
1475
|
}, re.prototype.startsWithIgnoreCase = function(e) {
|
|
1476
1476
|
return e === "" ? this.startsWith(e) : jt(this, function(t, n) {
|
|
1477
1477
|
return t.indexOf(n[0]) === 0;
|
|
1478
|
-
}, [e],
|
|
1478
|
+
}, [e], Le);
|
|
1479
1479
|
}, re.prototype.equalsIgnoreCase = function(e) {
|
|
1480
1480
|
return jt(this, function(t, n) {
|
|
1481
1481
|
return t === n[0];
|
|
1482
1482
|
}, [e], "");
|
|
1483
1483
|
}, re.prototype.anyOfIgnoreCase = function() {
|
|
1484
|
-
var e = we.apply(
|
|
1484
|
+
var e = we.apply(He, arguments);
|
|
1485
1485
|
return e.length === 0 ? et(this) : jt(this, function(t, n) {
|
|
1486
1486
|
return n.indexOf(t) !== -1;
|
|
1487
1487
|
}, e, "");
|
|
1488
1488
|
}, re.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
1489
|
-
var e = we.apply(
|
|
1489
|
+
var e = we.apply(He, arguments);
|
|
1490
1490
|
return e.length === 0 ? et(this) : jt(this, function(t, n) {
|
|
1491
1491
|
return n.some(function(r) {
|
|
1492
1492
|
return t.indexOf(r) === 0;
|
|
1493
1493
|
});
|
|
1494
|
-
}, e,
|
|
1494
|
+
}, e, Le);
|
|
1495
1495
|
}, re.prototype.anyOf = function() {
|
|
1496
|
-
var e = this, t = we.apply(
|
|
1496
|
+
var e = this, t = we.apply(He, arguments), n = this._cmp;
|
|
1497
1497
|
try {
|
|
1498
1498
|
t.sort(n);
|
|
1499
1499
|
} catch {
|
|
@@ -1519,7 +1519,7 @@ var Rr = { exports: {} };
|
|
|
1519
1519
|
}, re.prototype.notEqual = function(e) {
|
|
1520
1520
|
return this.inAnyRange([[-1 / 0, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
|
|
1521
1521
|
}, re.prototype.noneOf = function() {
|
|
1522
|
-
var e = we.apply(
|
|
1522
|
+
var e = we.apply(He, arguments);
|
|
1523
1523
|
if (e.length === 0)
|
|
1524
1524
|
return new this.Collection(this);
|
|
1525
1525
|
try {
|
|
@@ -1538,26 +1538,26 @@ var Rr = { exports: {} };
|
|
|
1538
1538
|
if (!_.every(function(S) {
|
|
1539
1539
|
return S[0] !== void 0 && S[1] !== void 0 && o(S[0], S[1]) <= 0;
|
|
1540
1540
|
}))
|
|
1541
|
-
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",
|
|
1542
|
-
var g = !t || t.includeLowers !== !1,
|
|
1543
|
-
function
|
|
1544
|
-
return l(S[0],
|
|
1541
|
+
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", L.InvalidArgument);
|
|
1542
|
+
var g = !t || t.includeLowers !== !1, d = t && t.includeUppers === !0, v, l = o;
|
|
1543
|
+
function h(S, O) {
|
|
1544
|
+
return l(S[0], O[0]);
|
|
1545
1545
|
}
|
|
1546
1546
|
try {
|
|
1547
|
-
(v = _.reduce(function(S,
|
|
1548
|
-
for (var
|
|
1549
|
-
var
|
|
1550
|
-
if (r(
|
|
1551
|
-
|
|
1547
|
+
(v = _.reduce(function(S, O) {
|
|
1548
|
+
for (var x = 0, A = S.length; x < A; ++x) {
|
|
1549
|
+
var R = S[x];
|
|
1550
|
+
if (r(O[0], R[1]) < 0 && 0 < r(O[1], R[0])) {
|
|
1551
|
+
R[0] = s(R[0], O[0]), R[1] = c(R[1], O[1]);
|
|
1552
1552
|
break;
|
|
1553
1553
|
}
|
|
1554
1554
|
}
|
|
1555
|
-
return
|
|
1556
|
-
}, [])).sort(
|
|
1555
|
+
return x === A && S.push(O), S;
|
|
1556
|
+
}, [])).sort(h);
|
|
1557
1557
|
} catch {
|
|
1558
1558
|
return ce(this, _e);
|
|
1559
1559
|
}
|
|
1560
|
-
var y = 0, b =
|
|
1560
|
+
var y = 0, b = d ? function(S) {
|
|
1561
1561
|
return 0 < o(S, v[y][1]);
|
|
1562
1562
|
} : function(S) {
|
|
1563
1563
|
return 0 <= o(S, v[y][1]);
|
|
@@ -1566,24 +1566,24 @@ var Rr = { exports: {} };
|
|
|
1566
1566
|
} : function(S) {
|
|
1567
1567
|
return 0 <= a(S, v[y][0]);
|
|
1568
1568
|
}, m = b, _ = new this.Collection(this, function() {
|
|
1569
|
-
return Re(v[0][0], v[v.length - 1][1], !g, !
|
|
1569
|
+
return Re(v[0][0], v[v.length - 1][1], !g, !d);
|
|
1570
1570
|
});
|
|
1571
1571
|
return _._ondirectionchange = function(S) {
|
|
1572
|
-
l = S === "next" ? (m = b, o) : (m = w, a), v.sort(
|
|
1573
|
-
}, _._addAlgorithm(function(S,
|
|
1574
|
-
for (var
|
|
1572
|
+
l = S === "next" ? (m = b, o) : (m = w, a), v.sort(h);
|
|
1573
|
+
}, _._addAlgorithm(function(S, O, x) {
|
|
1574
|
+
for (var A, R = S.key; m(R); )
|
|
1575
1575
|
if (++y === v.length)
|
|
1576
|
-
return
|
|
1577
|
-
return !b(
|
|
1576
|
+
return O(x), !1;
|
|
1577
|
+
return !b(A = R) && !w(A) || (n._cmp(R, v[y][1]) === 0 || n._cmp(R, v[y][0]) === 0 || O(function() {
|
|
1578
1578
|
l === o ? S.continue(v[y][0]) : S.continue(v[y][1]);
|
|
1579
1579
|
}), !1);
|
|
1580
1580
|
}), _;
|
|
1581
1581
|
}, re.prototype.startsWithAnyOf = function() {
|
|
1582
|
-
var e = we.apply(
|
|
1582
|
+
var e = we.apply(He, arguments);
|
|
1583
1583
|
return e.every(function(t) {
|
|
1584
1584
|
return typeof t == "string";
|
|
1585
1585
|
}) ? e.length === 0 ? et(this) : this.inAnyRange(e.map(function(t) {
|
|
1586
|
-
return [t, t +
|
|
1586
|
+
return [t, t + Le];
|
|
1587
1587
|
})) : ce(this, "startsWithAnyOf() only works with strings");
|
|
1588
1588
|
}, re);
|
|
1589
1589
|
function re() {
|
|
@@ -1597,19 +1597,19 @@ var Rr = { exports: {} };
|
|
|
1597
1597
|
e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
|
|
1598
1598
|
}
|
|
1599
1599
|
var pt = "storagemutated", yn = "x-storagemutated-1", Te = ft(null, pt), ai = (me.prototype._lock = function() {
|
|
1600
|
-
return rt(!
|
|
1600
|
+
return rt(!N.global), ++this._reculock, this._reculock !== 1 || N.global || (N.lockOwnerFor = this), this;
|
|
1601
1601
|
}, me.prototype._unlock = function() {
|
|
1602
|
-
if (rt(!
|
|
1603
|
-
for (
|
|
1602
|
+
if (rt(!N.global), --this._reculock == 0)
|
|
1603
|
+
for (N.global || (N.lockOwnerFor = null); 0 < this._blockedFuncs.length && !this._locked(); ) {
|
|
1604
1604
|
var e = this._blockedFuncs.shift();
|
|
1605
1605
|
try {
|
|
1606
|
-
|
|
1606
|
+
Ge(e[1], e[0]);
|
|
1607
1607
|
} catch {
|
|
1608
1608
|
}
|
|
1609
1609
|
}
|
|
1610
1610
|
return this;
|
|
1611
1611
|
}, me.prototype._locked = function() {
|
|
1612
|
-
return this._reculock &&
|
|
1612
|
+
return this._reculock && N.lockOwnerFor !== this;
|
|
1613
1613
|
}, me.prototype.create = function(e) {
|
|
1614
1614
|
var t = this;
|
|
1615
1615
|
if (!this.mode)
|
|
@@ -1618,32 +1618,32 @@ var Rr = { exports: {} };
|
|
|
1618
1618
|
if (rt(!this.idbtrans), !e && !n)
|
|
1619
1619
|
switch (r && r.name) {
|
|
1620
1620
|
case "DatabaseClosedError":
|
|
1621
|
-
throw new
|
|
1621
|
+
throw new L.DatabaseClosed(r);
|
|
1622
1622
|
case "MissingAPIError":
|
|
1623
|
-
throw new
|
|
1623
|
+
throw new L.MissingAPI(r.message, r);
|
|
1624
1624
|
default:
|
|
1625
|
-
throw new
|
|
1625
|
+
throw new L.OpenFailed(r);
|
|
1626
1626
|
}
|
|
1627
1627
|
if (!this.active)
|
|
1628
|
-
throw new
|
|
1628
|
+
throw new L.TransactionInactive();
|
|
1629
1629
|
return rt(this._completion._state === null), (e = this.idbtrans = e || (this.db.core || n).transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability })).onerror = J(function(o) {
|
|
1630
1630
|
ht(o), t._reject(e.error);
|
|
1631
1631
|
}), e.onabort = J(function(o) {
|
|
1632
|
-
ht(o), t.active && t._reject(new
|
|
1632
|
+
ht(o), t.active && t._reject(new L.Abort(e.error)), t.active = !1, t.on("abort").fire(o);
|
|
1633
1633
|
}), e.oncomplete = J(function() {
|
|
1634
1634
|
t.active = !1, t._resolve(), "mutatedParts" in e && Te.storagemutated.fire(e.mutatedParts);
|
|
1635
1635
|
}), this;
|
|
1636
1636
|
}, me.prototype._promise = function(e, t, n) {
|
|
1637
1637
|
var r = this;
|
|
1638
1638
|
if (e === "readwrite" && this.mode !== "readwrite")
|
|
1639
|
-
return q(new
|
|
1639
|
+
return q(new L.ReadOnly("Transaction is readonly"));
|
|
1640
1640
|
if (!this.active)
|
|
1641
|
-
return q(new
|
|
1641
|
+
return q(new L.TransactionInactive());
|
|
1642
1642
|
if (this._locked())
|
|
1643
1643
|
return new M(function(a, s) {
|
|
1644
1644
|
r._blockedFuncs.push([function() {
|
|
1645
1645
|
r._promise(e, t, n).then(a, s);
|
|
1646
|
-
},
|
|
1646
|
+
}, N]);
|
|
1647
1647
|
});
|
|
1648
1648
|
if (n)
|
|
1649
1649
|
return Pe(function() {
|
|
@@ -1683,14 +1683,14 @@ var Rr = { exports: {} };
|
|
|
1683
1683
|
});
|
|
1684
1684
|
});
|
|
1685
1685
|
}, me.prototype.abort = function() {
|
|
1686
|
-
this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new
|
|
1686
|
+
this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new L.Abort()));
|
|
1687
1687
|
}, me.prototype.table = function(e) {
|
|
1688
1688
|
var t = this._memoizedTables || (this._memoizedTables = {});
|
|
1689
1689
|
if (ie(t, e))
|
|
1690
1690
|
return t[e];
|
|
1691
1691
|
var n = this.schema[e];
|
|
1692
1692
|
if (!n)
|
|
1693
|
-
throw new
|
|
1693
|
+
throw new L.NotFound("Table " + e + " not part of transaction");
|
|
1694
1694
|
return n = new this.db.Table(e, n, this), n.core = this.db.core.table(e), t[e] = n;
|
|
1695
1695
|
}, me);
|
|
1696
1696
|
function me() {
|
|
@@ -1716,8 +1716,8 @@ var Rr = { exports: {} };
|
|
|
1716
1716
|
}, [[]];
|
|
1717
1717
|
} catch {
|
|
1718
1718
|
return gt = function() {
|
|
1719
|
-
return
|
|
1720
|
-
},
|
|
1719
|
+
return Le;
|
|
1720
|
+
}, Le;
|
|
1721
1721
|
}
|
|
1722
1722
|
};
|
|
1723
1723
|
function vn(e) {
|
|
@@ -1747,92 +1747,92 @@ var Rr = { exports: {} };
|
|
|
1747
1747
|
var y = m.lower, b = m.upper, w = m.lowerOpen, m = m.upperOpen;
|
|
1748
1748
|
return y === void 0 ? b === void 0 ? null : t.upperBound(b, !!m) : b === void 0 ? t.lowerBound(y, !!w) : t.bound(y, b, !!w, !!m);
|
|
1749
1749
|
}
|
|
1750
|
-
function o(
|
|
1751
|
-
var y, b =
|
|
1752
|
-
return { name: b, schema:
|
|
1753
|
-
var m = w.trans, _ = w.type, S = w.keys,
|
|
1754
|
-
return new Promise(function(
|
|
1755
|
-
|
|
1756
|
-
var D = m.objectStore(b), T = D.keyPath == null,
|
|
1757
|
-
if (!
|
|
1750
|
+
function o(h) {
|
|
1751
|
+
var y, b = h.name;
|
|
1752
|
+
return { name: b, schema: h, mutate: function(w) {
|
|
1753
|
+
var m = w.trans, _ = w.type, S = w.keys, O = w.values, x = w.range;
|
|
1754
|
+
return new Promise(function(A, R) {
|
|
1755
|
+
A = J(A);
|
|
1756
|
+
var D = m.objectStore(b), T = D.keyPath == null, I = _ === "put" || _ === "add";
|
|
1757
|
+
if (!I && _ !== "delete" && _ !== "deleteRange")
|
|
1758
1758
|
throw new Error("Invalid operation type: " + _);
|
|
1759
|
-
var
|
|
1760
|
-
if (S &&
|
|
1759
|
+
var G, F = (S || O || { length: 1 }).length;
|
|
1760
|
+
if (S && O && S.length !== O.length)
|
|
1761
1761
|
throw new Error("Given keys array must have same length as given values array.");
|
|
1762
1762
|
if (F === 0)
|
|
1763
|
-
return
|
|
1764
|
-
function
|
|
1763
|
+
return A({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
1764
|
+
function H(ue) {
|
|
1765
1765
|
++le, ht(ue);
|
|
1766
1766
|
}
|
|
1767
1767
|
var U = [], Q = [], le = 0;
|
|
1768
1768
|
if (_ === "deleteRange") {
|
|
1769
|
-
if (
|
|
1770
|
-
return
|
|
1771
|
-
|
|
1769
|
+
if (x.type === 4)
|
|
1770
|
+
return A({ numFailures: le, failures: Q, results: [], lastResult: void 0 });
|
|
1771
|
+
x.type === 3 ? U.push(G = D.clear()) : U.push(G = D.delete(r(x)));
|
|
1772
1772
|
} else {
|
|
1773
|
-
var T =
|
|
1774
|
-
if (
|
|
1773
|
+
var T = I ? T ? [O, S] : [O, null] : [S, null], $ = T[0], Ee = T[1];
|
|
1774
|
+
if (I)
|
|
1775
1775
|
for (var ae = 0; ae < F; ++ae)
|
|
1776
|
-
U.push(
|
|
1776
|
+
U.push(G = Ee && Ee[ae] !== void 0 ? D[_]($[ae], Ee[ae]) : D[_]($[ae])), G.onerror = H;
|
|
1777
1777
|
else
|
|
1778
1778
|
for (ae = 0; ae < F; ++ae)
|
|
1779
|
-
U.push(
|
|
1779
|
+
U.push(G = D[_]($[ae])), G.onerror = H;
|
|
1780
1780
|
}
|
|
1781
1781
|
function Qt(ue) {
|
|
1782
|
-
ue = ue.target.result, U.forEach(function(We,
|
|
1783
|
-
return We.error != null && (Q[
|
|
1784
|
-
}),
|
|
1782
|
+
ue = ue.target.result, U.forEach(function(We, Bn) {
|
|
1783
|
+
return We.error != null && (Q[Bn] = We.error);
|
|
1784
|
+
}), A({ numFailures: le, failures: Q, results: _ === "delete" ? S : U.map(function(We) {
|
|
1785
1785
|
return We.result;
|
|
1786
1786
|
}), lastResult: ue });
|
|
1787
1787
|
}
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
},
|
|
1788
|
+
G.onerror = function(ue) {
|
|
1789
|
+
H(ue), Qt(ue);
|
|
1790
|
+
}, G.onsuccess = Qt;
|
|
1791
1791
|
});
|
|
1792
1792
|
}, getMany: function(w) {
|
|
1793
1793
|
var m = w.trans, _ = w.keys;
|
|
1794
|
-
return new Promise(function(S,
|
|
1794
|
+
return new Promise(function(S, O) {
|
|
1795
1795
|
S = J(S);
|
|
1796
|
-
for (var
|
|
1797
|
-
U = U.target, D[U._pos] = U.result, ++
|
|
1798
|
-
}, F = ye(
|
|
1799
|
-
_[
|
|
1796
|
+
for (var x, A = m.objectStore(b), R = _.length, D = new Array(R), T = 0, I = 0, G = function(U) {
|
|
1797
|
+
U = U.target, D[U._pos] = U.result, ++I === T && S(D);
|
|
1798
|
+
}, F = ye(O), H = 0; H < R; ++H)
|
|
1799
|
+
_[H] != null && ((x = A.get(_[H]))._pos = H, x.onsuccess = G, x.onerror = F, ++T);
|
|
1800
1800
|
T === 0 && S(D);
|
|
1801
1801
|
});
|
|
1802
1802
|
}, get: function(w) {
|
|
1803
1803
|
var m = w.trans, _ = w.key;
|
|
1804
|
-
return new Promise(function(S,
|
|
1804
|
+
return new Promise(function(S, O) {
|
|
1805
1805
|
S = J(S);
|
|
1806
|
-
var
|
|
1807
|
-
|
|
1808
|
-
return S(
|
|
1809
|
-
},
|
|
1806
|
+
var x = m.objectStore(b).get(_);
|
|
1807
|
+
x.onsuccess = function(A) {
|
|
1808
|
+
return S(A.target.result);
|
|
1809
|
+
}, x.onerror = ye(O);
|
|
1810
1810
|
});
|
|
1811
|
-
}, query: (y =
|
|
1811
|
+
}, query: (y = d, function(w) {
|
|
1812
1812
|
return new Promise(function(m, _) {
|
|
1813
1813
|
m = J(m);
|
|
1814
|
-
var S,
|
|
1815
|
-
if (
|
|
1814
|
+
var S, O, x, T = w.trans, A = w.values, R = w.limit, G = w.query, D = R === 1 / 0 ? void 0 : R, I = G.index, G = G.range, T = T.objectStore(b), I = I.isPrimaryKey ? T : T.index(I.name), G = r(G);
|
|
1815
|
+
if (R === 0)
|
|
1816
1816
|
return m({ result: [] });
|
|
1817
|
-
y ? ((D =
|
|
1817
|
+
y ? ((D = A ? I.getAll(G, D) : I.getAllKeys(G, D)).onsuccess = function(F) {
|
|
1818
1818
|
return m({ result: F.target.result });
|
|
1819
|
-
}, D.onerror = ye(_)) : (S = 0,
|
|
1820
|
-
var
|
|
1821
|
-
return
|
|
1822
|
-
},
|
|
1819
|
+
}, D.onerror = ye(_)) : (S = 0, O = !A && "openKeyCursor" in I ? I.openKeyCursor(G) : I.openCursor(G), x = [], O.onsuccess = function(F) {
|
|
1820
|
+
var H = O.result;
|
|
1821
|
+
return H ? (x.push(A ? H.value : H.primaryKey), ++S === R ? m({ result: x }) : void H.continue()) : m({ result: x });
|
|
1822
|
+
}, O.onerror = ye(_));
|
|
1823
1823
|
});
|
|
1824
1824
|
}), openCursor: function(w) {
|
|
1825
|
-
var m = w.trans, _ = w.values, S = w.query,
|
|
1826
|
-
return new Promise(function(
|
|
1827
|
-
|
|
1828
|
-
var
|
|
1829
|
-
|
|
1830
|
-
var
|
|
1831
|
-
$ ? ($.___id = ++si, $.done = !1,
|
|
1825
|
+
var m = w.trans, _ = w.values, S = w.query, O = w.reverse, x = w.unique;
|
|
1826
|
+
return new Promise(function(A, R) {
|
|
1827
|
+
A = J(A);
|
|
1828
|
+
var I = S.index, D = S.range, T = m.objectStore(b), T = I.isPrimaryKey ? T : T.index(I.name), I = O ? x ? "prevunique" : "prev" : x ? "nextunique" : "next", G = !_ && "openKeyCursor" in T ? T.openKeyCursor(r(D), I) : T.openCursor(r(D), I);
|
|
1829
|
+
G.onerror = ye(R), G.onsuccess = J(function(F) {
|
|
1830
|
+
var H, U, Q, le, $ = G.result;
|
|
1831
|
+
$ ? ($.___id = ++si, $.done = !1, H = $.continue.bind($), U = (U = $.continuePrimaryKey) && U.bind($), Q = $.advance.bind($), le = function() {
|
|
1832
1832
|
throw new Error("Cursor not stopped");
|
|
1833
1833
|
}, $.trans = m, $.stop = $.continue = $.continuePrimaryKey = $.advance = function() {
|
|
1834
1834
|
throw new Error("Cursor not started");
|
|
1835
|
-
}, $.fail = J(
|
|
1835
|
+
}, $.fail = J(R), $.next = function() {
|
|
1836
1836
|
var Ee = this, ae = 1;
|
|
1837
1837
|
return this.start(function() {
|
|
1838
1838
|
return ae-- ? Ee.continue() : Ee.stop();
|
|
@@ -1841,7 +1841,7 @@ var Rr = { exports: {} };
|
|
|
1841
1841
|
});
|
|
1842
1842
|
}, $.start = function(Ee) {
|
|
1843
1843
|
function ae() {
|
|
1844
|
-
if (
|
|
1844
|
+
if (G.result)
|
|
1845
1845
|
try {
|
|
1846
1846
|
Ee();
|
|
1847
1847
|
} catch (ue) {
|
|
@@ -1853,51 +1853,51 @@ var Rr = { exports: {} };
|
|
|
1853
1853
|
}, $.stop();
|
|
1854
1854
|
}
|
|
1855
1855
|
var Qt = new Promise(function(ue, We) {
|
|
1856
|
-
ue = J(ue),
|
|
1857
|
-
$.stop = $.continue = $.continuePrimaryKey = $.advance = le, ue(
|
|
1856
|
+
ue = J(ue), G.onerror = ye(We), $.fail = We, $.stop = function(Bn) {
|
|
1857
|
+
$.stop = $.continue = $.continuePrimaryKey = $.advance = le, ue(Bn);
|
|
1858
1858
|
};
|
|
1859
1859
|
});
|
|
1860
|
-
return
|
|
1861
|
-
|
|
1862
|
-
}), $.continue =
|
|
1863
|
-
},
|
|
1864
|
-
},
|
|
1860
|
+
return G.onsuccess = J(function(ue) {
|
|
1861
|
+
G.onsuccess = ae, ae();
|
|
1862
|
+
}), $.continue = H, $.continuePrimaryKey = U, $.advance = Q, ae(), Qt;
|
|
1863
|
+
}, A($)) : A(null);
|
|
1864
|
+
}, R);
|
|
1865
1865
|
});
|
|
1866
1866
|
}, count: function(w) {
|
|
1867
|
-
var m = w.query, _ = w.trans, S = m.index,
|
|
1868
|
-
return new Promise(function(
|
|
1869
|
-
var
|
|
1867
|
+
var m = w.query, _ = w.trans, S = m.index, O = m.range;
|
|
1868
|
+
return new Promise(function(x, A) {
|
|
1869
|
+
var R = _.objectStore(b), D = S.isPrimaryKey ? R : R.index(S.name), R = r(O), D = R ? D.count(R) : D.count();
|
|
1870
1870
|
D.onsuccess = J(function(T) {
|
|
1871
|
-
return
|
|
1872
|
-
}), D.onerror = ye(
|
|
1871
|
+
return x(T.target.result);
|
|
1872
|
+
}), D.onerror = ye(A);
|
|
1873
1873
|
});
|
|
1874
1874
|
} };
|
|
1875
1875
|
}
|
|
1876
|
-
var a, s, c, v = (s = g, c = yr((a = e).objectStoreNames), { schema: { name: a.name, tables: c.map(function(
|
|
1877
|
-
return s.objectStore(
|
|
1878
|
-
}).map(function(
|
|
1879
|
-
var y =
|
|
1880
|
-
return
|
|
1881
|
-
}).map(function(
|
|
1882
|
-
var S =
|
|
1883
|
-
return w[yt(
|
|
1876
|
+
var a, s, c, v = (s = g, c = yr((a = e).objectStoreNames), { schema: { name: a.name, tables: c.map(function(h) {
|
|
1877
|
+
return s.objectStore(h);
|
|
1878
|
+
}).map(function(h) {
|
|
1879
|
+
var y = h.keyPath, m = h.autoIncrement, b = B(y), w = {}, m = { name: h.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: y == null, compound: b, keyPath: y, autoIncrement: m, unique: !0, extractKey: vn(y) }, indexes: yr(h.indexNames).map(function(_) {
|
|
1880
|
+
return h.index(_);
|
|
1881
|
+
}).map(function(x) {
|
|
1882
|
+
var S = x.name, O = x.unique, A = x.multiEntry, x = x.keyPath, A = { name: S, compound: B(x), keyPath: x, unique: O, multiEntry: A, extractKey: vn(x) };
|
|
1883
|
+
return w[yt(x)] = A;
|
|
1884
1884
|
}), getIndexByKeyPath: function(_) {
|
|
1885
1885
|
return w[yt(_)];
|
|
1886
1886
|
} };
|
|
1887
1887
|
return w[":id"] = m.primaryKey, y != null && (w[yt(y)] = m.primaryKey), m;
|
|
1888
|
-
}) }, hasGetAll: 0 < c.length && "getAll" in s.objectStore(c[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), g = v.schema,
|
|
1889
|
-
return v.forEach(function(
|
|
1890
|
-
return l[
|
|
1891
|
-
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(
|
|
1892
|
-
if (!l[
|
|
1893
|
-
throw new Error("Table '".concat(
|
|
1894
|
-
return l[
|
|
1888
|
+
}) }, hasGetAll: 0 < c.length && "getAll" in s.objectStore(c[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), g = v.schema, d = v.hasGetAll, v = g.tables.map(o), l = {};
|
|
1889
|
+
return v.forEach(function(h) {
|
|
1890
|
+
return l[h.name] = h;
|
|
1891
|
+
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(h) {
|
|
1892
|
+
if (!l[h])
|
|
1893
|
+
throw new Error("Table '".concat(h, "' not found"));
|
|
1894
|
+
return l[h];
|
|
1895
1895
|
}, MIN_KEY: -1 / 0, MAX_KEY: gt(t), schema: g };
|
|
1896
1896
|
}
|
|
1897
1897
|
function ci(e, t, n, r) {
|
|
1898
1898
|
var o = n.IDBKeyRange;
|
|
1899
1899
|
return n.indexedDB, { dbcore: (r = ui(t, o, r), e.dbcore.reduce(function(a, s) {
|
|
1900
|
-
return s = s.create,
|
|
1900
|
+
return s = s.create, f(f({}, a), s(a));
|
|
1901
1901
|
}, r)) };
|
|
1902
1902
|
}
|
|
1903
1903
|
function Kt(e, r) {
|
|
@@ -1909,12 +1909,12 @@ var Rr = { exports: {} };
|
|
|
1909
1909
|
}) && (o.core = e.core.table(a), e[a] instanceof e.Table && (e[a].core = o.core));
|
|
1910
1910
|
});
|
|
1911
1911
|
}
|
|
1912
|
-
function
|
|
1912
|
+
function Nt(e, t, n, r) {
|
|
1913
1913
|
n.forEach(function(o) {
|
|
1914
1914
|
var a = r[o];
|
|
1915
1915
|
t.forEach(function(s) {
|
|
1916
|
-
var c = function g(
|
|
1917
|
-
return
|
|
1916
|
+
var c = function g(d, v) {
|
|
1917
|
+
return Lr(d, v) || (d = te(d)) && g(d, v);
|
|
1918
1918
|
}(s, o);
|
|
1919
1919
|
(!c || "value" in c && c.value === void 0) && (s === e.Transaction.prototype || s instanceof e.Transaction ? ke(s, o, { get: function() {
|
|
1920
1920
|
return this.table(o);
|
|
@@ -1938,55 +1938,55 @@ var Rr = { exports: {} };
|
|
|
1938
1938
|
n.objectStoreNames.contains("$meta") && !o.$meta && (o.$meta = bn("$meta", br("")[0], []), e._storeNames.push("$meta"));
|
|
1939
1939
|
var a = e._createTransaction("readwrite", e._storeNames, o);
|
|
1940
1940
|
a.create(n), a._completion.catch(r);
|
|
1941
|
-
var s = a._reject.bind(a), c =
|
|
1941
|
+
var s = a._reject.bind(a), c = N.transless || N;
|
|
1942
1942
|
Pe(function() {
|
|
1943
|
-
return
|
|
1944
|
-
return v ??
|
|
1945
|
-
}) : M.resolve(
|
|
1946
|
-
return
|
|
1947
|
-
return _._cfg.version >=
|
|
1943
|
+
return N.trans = a, N.transless = c, t !== 0 ? (Kt(e, n), d = t, ((g = a).storeNames.includes("$meta") ? g.table("$meta").get("version").then(function(v) {
|
|
1944
|
+
return v ?? d;
|
|
1945
|
+
}) : M.resolve(d)).then(function(v) {
|
|
1946
|
+
return h = v, y = a, b = n, w = [], v = (l = e)._versions, m = l._dbSchema = Gt(0, l.idbdb, b), (v = v.filter(function(_) {
|
|
1947
|
+
return _._cfg.version >= h;
|
|
1948
1948
|
})).length !== 0 ? (v.forEach(function(_) {
|
|
1949
1949
|
w.push(function() {
|
|
1950
|
-
var S = m,
|
|
1951
|
-
|
|
1952
|
-
var
|
|
1953
|
-
|
|
1954
|
-
Sn(b,
|
|
1955
|
-
}),
|
|
1956
|
-
if (
|
|
1957
|
-
throw new
|
|
1958
|
-
var
|
|
1959
|
-
|
|
1960
|
-
return
|
|
1961
|
-
}),
|
|
1962
|
-
|
|
1963
|
-
}),
|
|
1964
|
-
return
|
|
1950
|
+
var S = m, O = _._cfg.dbschema;
|
|
1951
|
+
Lt(l, S, b), Lt(l, O, b), m = l._dbSchema = O;
|
|
1952
|
+
var x = _n(S, O);
|
|
1953
|
+
x.add.forEach(function(I) {
|
|
1954
|
+
Sn(b, I[0], I[1].primKey, I[1].indexes);
|
|
1955
|
+
}), x.change.forEach(function(I) {
|
|
1956
|
+
if (I.recreate)
|
|
1957
|
+
throw new L.Upgrade("Not yet support for changing primary key");
|
|
1958
|
+
var G = b.objectStore(I.name);
|
|
1959
|
+
I.add.forEach(function(F) {
|
|
1960
|
+
return Bt(G, F);
|
|
1961
|
+
}), I.change.forEach(function(F) {
|
|
1962
|
+
G.deleteIndex(F.name), Bt(G, F);
|
|
1963
|
+
}), I.del.forEach(function(F) {
|
|
1964
|
+
return G.deleteIndex(F);
|
|
1965
1965
|
});
|
|
1966
1966
|
});
|
|
1967
|
-
var
|
|
1968
|
-
if (
|
|
1967
|
+
var A = _._cfg.contentUpgrade;
|
|
1968
|
+
if (A && _._cfg.version > h) {
|
|
1969
1969
|
Kt(l, b), y._memoizedTables = {};
|
|
1970
|
-
var
|
|
1971
|
-
|
|
1972
|
-
I
|
|
1973
|
-
}), wn(l, [l.Transaction.prototype]),
|
|
1974
|
-
var D, T = qt(
|
|
1975
|
-
return T && Je(),
|
|
1976
|
-
var
|
|
1977
|
-
(D =
|
|
1978
|
-
}), D && typeof D.then == "function" ? M.resolve(D) :
|
|
1970
|
+
var R = Qn(O);
|
|
1971
|
+
x.del.forEach(function(I) {
|
|
1972
|
+
R[I] = S[I];
|
|
1973
|
+
}), wn(l, [l.Transaction.prototype]), Nt(l, [l.Transaction.prototype], K(R), R), y.schema = R;
|
|
1974
|
+
var D, T = qt(A);
|
|
1975
|
+
return T && Je(), x = M.follow(function() {
|
|
1976
|
+
var I;
|
|
1977
|
+
(D = A(y)) && T && (I = Ie.bind(null, null), D.then(I, I));
|
|
1978
|
+
}), D && typeof D.then == "function" ? M.resolve(D) : x.then(function() {
|
|
1979
1979
|
return D;
|
|
1980
1980
|
});
|
|
1981
1981
|
}
|
|
1982
1982
|
}), w.push(function(S) {
|
|
1983
|
-
var
|
|
1984
|
-
|
|
1985
|
-
return
|
|
1986
|
-
}), wn(l, [l.Transaction.prototype]),
|
|
1983
|
+
var O, x, A = _._cfg.dbschema;
|
|
1984
|
+
O = A, x = S, [].slice.call(x.db.objectStoreNames).forEach(function(R) {
|
|
1985
|
+
return O[R] == null && x.db.deleteObjectStore(R);
|
|
1986
|
+
}), wn(l, [l.Transaction.prototype]), Nt(l, [l.Transaction.prototype], l._storeNames, l._dbSchema), y.schema = l._dbSchema;
|
|
1987
1987
|
}), w.push(function(S) {
|
|
1988
|
-
l.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(l.idbdb.version / 10) === _._cfg.version ? (l.idbdb.deleteObjectStore("$meta"), delete l._dbSchema.$meta, l._storeNames = l._storeNames.filter(function(
|
|
1989
|
-
return
|
|
1988
|
+
l.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(l.idbdb.version / 10) === _._cfg.version ? (l.idbdb.deleteObjectStore("$meta"), delete l._dbSchema.$meta, l._storeNames = l._storeNames.filter(function(O) {
|
|
1989
|
+
return O !== "$meta";
|
|
1990
1990
|
})) : S.objectStore("$meta").put(_._cfg.version, "version"));
|
|
1991
1991
|
});
|
|
1992
1992
|
}), function _() {
|
|
@@ -1994,26 +1994,26 @@ var Rr = { exports: {} };
|
|
|
1994
1994
|
}().then(function() {
|
|
1995
1995
|
mr(m, b);
|
|
1996
1996
|
})) : M.resolve();
|
|
1997
|
-
var l,
|
|
1997
|
+
var l, h, y, b, w, m;
|
|
1998
1998
|
}).catch(s)) : (K(o).forEach(function(v) {
|
|
1999
1999
|
Sn(n, v, o[v].primKey, o[v].indexes);
|
|
2000
2000
|
}), Kt(e, n), void M.follow(function() {
|
|
2001
2001
|
return e.on.populate.fire(a);
|
|
2002
2002
|
}).catch(s));
|
|
2003
|
-
var g,
|
|
2003
|
+
var g, d;
|
|
2004
2004
|
});
|
|
2005
2005
|
}
|
|
2006
2006
|
function di(e, t) {
|
|
2007
2007
|
mr(e._dbSchema, t), t.db.version % 10 != 0 || t.objectStoreNames.contains("$meta") || t.db.createObjectStore("$meta").add(Math.ceil(t.db.version / 10 - 1), "version");
|
|
2008
|
-
var n =
|
|
2009
|
-
|
|
2008
|
+
var n = Gt(0, e.idbdb, t);
|
|
2009
|
+
Lt(e, e._dbSchema, t);
|
|
2010
2010
|
for (var r = 0, o = _n(n, e._dbSchema).change; r < o.length; r++) {
|
|
2011
2011
|
var a = function(s) {
|
|
2012
2012
|
if (s.change.length || s.recreate)
|
|
2013
2013
|
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 };
|
|
2014
2014
|
var c = t.objectStore(s.name);
|
|
2015
2015
|
s.add.forEach(function(g) {
|
|
2016
|
-
pe && console.debug("Dexie upgrade patch: Creating missing index ".concat(s.name, ".").concat(g.src)),
|
|
2016
|
+
pe && console.debug("Dexie upgrade patch: Creating missing index ".concat(s.name, ".").concat(g.src)), Bt(c, g);
|
|
2017
2017
|
});
|
|
2018
2018
|
}(o[r]);
|
|
2019
2019
|
if (typeof a == "object")
|
|
@@ -2031,11 +2031,11 @@ var Rr = { exports: {} };
|
|
|
2031
2031
|
if ("" + (o.primKey.keyPath || "") != "" + (a.primKey.keyPath || "") || o.primKey.auto !== a.primKey.auto)
|
|
2032
2032
|
s.recreate = !0, r.change.push(s);
|
|
2033
2033
|
else {
|
|
2034
|
-
var c = o.idxByName, g = a.idxByName,
|
|
2035
|
-
for (
|
|
2036
|
-
g[
|
|
2037
|
-
for (
|
|
2038
|
-
var v = c[
|
|
2034
|
+
var c = o.idxByName, g = a.idxByName, d = void 0;
|
|
2035
|
+
for (d in c)
|
|
2036
|
+
g[d] || s.del.push(d);
|
|
2037
|
+
for (d in g) {
|
|
2038
|
+
var v = c[d], l = g[d];
|
|
2039
2039
|
v ? v.src !== l.src && s.change.push(l) : s.add.push(l);
|
|
2040
2040
|
}
|
|
2041
2041
|
(0 < s.del.length || 0 < s.add.length || 0 < s.change.length) && r.change.push(s);
|
|
@@ -2048,7 +2048,7 @@ var Rr = { exports: {} };
|
|
|
2048
2048
|
function Sn(e, t, n, r) {
|
|
2049
2049
|
var o = e.db.createObjectStore(t, n.keyPath ? { keyPath: n.keyPath, autoIncrement: n.auto } : { autoIncrement: n.auto });
|
|
2050
2050
|
return r.forEach(function(a) {
|
|
2051
|
-
return
|
|
2051
|
+
return Bt(o, a);
|
|
2052
2052
|
}), o;
|
|
2053
2053
|
}
|
|
2054
2054
|
function mr(e, t) {
|
|
@@ -2056,34 +2056,34 @@ var Rr = { exports: {} };
|
|
|
2056
2056
|
t.db.objectStoreNames.contains(n) || (pe && console.debug("Dexie: Creating missing table", n), Sn(t, n, e[n].primKey, e[n].indexes));
|
|
2057
2057
|
});
|
|
2058
2058
|
}
|
|
2059
|
-
function
|
|
2059
|
+
function Bt(e, t) {
|
|
2060
2060
|
e.createIndex(t.name, t.keyPath, { unique: t.unique, multiEntry: t.multi });
|
|
2061
2061
|
}
|
|
2062
|
-
function
|
|
2062
|
+
function Gt(e, t, n) {
|
|
2063
2063
|
var r = {};
|
|
2064
2064
|
return wt(t.objectStoreNames, 0).forEach(function(o) {
|
|
2065
|
-
for (var a = n.objectStore(o), s = mn(gr(
|
|
2066
|
-
var v = a.index(a.indexNames[g]),
|
|
2065
|
+
for (var a = n.objectStore(o), s = mn(gr(d = a.keyPath), d || "", !0, !1, !!a.autoIncrement, d && typeof d != "string", !0), c = [], g = 0; g < a.indexNames.length; ++g) {
|
|
2066
|
+
var v = a.index(a.indexNames[g]), d = v.keyPath, v = mn(v.name, d, !!v.unique, !!v.multiEntry, !1, d && typeof d != "string", !1);
|
|
2067
2067
|
c.push(v);
|
|
2068
2068
|
}
|
|
2069
2069
|
r[o] = bn(o, s, c);
|
|
2070
2070
|
}), r;
|
|
2071
2071
|
}
|
|
2072
|
-
function
|
|
2072
|
+
function Lt(e, t, n) {
|
|
2073
2073
|
for (var r = n.db.objectStoreNames, o = 0; o < r.length; ++o) {
|
|
2074
2074
|
var a = r[o], s = n.objectStore(a);
|
|
2075
2075
|
e._hasGetAll = "getAll" in s;
|
|
2076
2076
|
for (var c = 0; c < s.indexNames.length; ++c) {
|
|
2077
|
-
var g = s.indexNames[c],
|
|
2078
|
-
!t[a] || (
|
|
2077
|
+
var g = s.indexNames[c], d = s.index(g).keyPath, v = typeof d == "string" ? d : "[" + wt(d).join("+") + "]";
|
|
2078
|
+
!t[a] || (d = t[a].idxByName[v]) && (d.name = g, delete t[a].idxByName[v], t[a].idxByName[g] = d);
|
|
2079
2079
|
}
|
|
2080
2080
|
}
|
|
2081
|
-
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) &&
|
|
2081
|
+
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && C.WorkerGlobalScope && C instanceof C.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e._hasGetAll = !1);
|
|
2082
2082
|
}
|
|
2083
2083
|
function br(e) {
|
|
2084
2084
|
return e.split(",").map(function(t, n) {
|
|
2085
2085
|
var r = (t = t.trim()).replace(/([&*]|\+\+)/g, ""), o = /^\[/.test(r) ? r.match(/^\[(.*)\]$/)[1].split("+") : r;
|
|
2086
|
-
return mn(r, o || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t),
|
|
2086
|
+
return mn(r, o || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t), B(o), n === 0);
|
|
2087
2087
|
});
|
|
2088
2088
|
}
|
|
2089
2089
|
var hi = (Ft.prototype._parseStoresSpec = function(e, t) {
|
|
@@ -2091,12 +2091,12 @@ var Rr = { exports: {} };
|
|
|
2091
2091
|
if (e[n] !== null) {
|
|
2092
2092
|
var r = br(e[n]), o = r.shift();
|
|
2093
2093
|
if (o.unique = !0, o.multi)
|
|
2094
|
-
throw new
|
|
2094
|
+
throw new L.Schema("Primary key cannot be multi-valued");
|
|
2095
2095
|
r.forEach(function(a) {
|
|
2096
2096
|
if (a.auto)
|
|
2097
|
-
throw new
|
|
2097
|
+
throw new L.Schema("Only primary key can be marked as autoIncrement (++)");
|
|
2098
2098
|
if (!a.keyPath)
|
|
2099
|
-
throw new
|
|
2099
|
+
throw new L.Schema("Index must have a name and cannot be an empty string");
|
|
2100
2100
|
}), t[n] = bn(n, o, r);
|
|
2101
2101
|
}
|
|
2102
2102
|
});
|
|
@@ -2106,22 +2106,22 @@ var Rr = { exports: {} };
|
|
|
2106
2106
|
var n = t._versions, r = {}, o = {};
|
|
2107
2107
|
return n.forEach(function(a) {
|
|
2108
2108
|
Z(r, a._cfg.storesSource), o = a._cfg.dbschema = {}, a._parseStoresSpec(r, o);
|
|
2109
|
-
}), t._dbSchema = o, wn(t, [t._allTables, t, t.Transaction.prototype]),
|
|
2109
|
+
}), t._dbSchema = o, wn(t, [t._allTables, t, t.Transaction.prototype]), Nt(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables], K(o), o), t._storeNames = K(o), this;
|
|
2110
2110
|
}, Ft.prototype.upgrade = function(e) {
|
|
2111
|
-
return this._cfg.contentUpgrade = tn(this._cfg.contentUpgrade ||
|
|
2111
|
+
return this._cfg.contentUpgrade = tn(this._cfg.contentUpgrade || Y, e), this;
|
|
2112
2112
|
}, Ft);
|
|
2113
2113
|
function Ft() {
|
|
2114
2114
|
}
|
|
2115
2115
|
function En(e, t) {
|
|
2116
2116
|
var n = e._dbNamesDB;
|
|
2117
|
-
return n || (n = e._dbNamesDB = new Se(
|
|
2117
|
+
return n || (n = e._dbNamesDB = new Se(Ct, { addons: [], indexedDB: e, IDBKeyRange: t })).version(1).stores({ dbnames: "name" }), n.table("dbnames");
|
|
2118
2118
|
}
|
|
2119
2119
|
function On(e) {
|
|
2120
2120
|
return e && typeof e.databases == "function";
|
|
2121
2121
|
}
|
|
2122
2122
|
function xn(e) {
|
|
2123
2123
|
return Pe(function() {
|
|
2124
|
-
return
|
|
2124
|
+
return N.letThrough = !0, e();
|
|
2125
2125
|
});
|
|
2126
2126
|
}
|
|
2127
2127
|
function kn(e) {
|
|
@@ -2194,7 +2194,7 @@ var Rr = { exports: {} };
|
|
|
2194
2194
|
}
|
|
2195
2195
|
function vr(e) {
|
|
2196
2196
|
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), o = 1 < r ? "r" : r < -1 ? "l" : "";
|
|
2197
|
-
o && (t = o == "r" ? "l" : "r", n =
|
|
2197
|
+
o && (t = o == "r" ? "l" : "r", n = f({}, e), r = e[o], e.from = r.from, e.to = r.to, e[o] = r[o], n[o] = r[t], (e[t] = n).d = wr(n)), e.d = wr(e);
|
|
2198
2198
|
}
|
|
2199
2199
|
function wr(n) {
|
|
2200
2200
|
var t = n.r, n = n.l;
|
|
@@ -2227,13 +2227,13 @@ var Rr = { exports: {} };
|
|
|
2227
2227
|
} })[Zt] = function() {
|
|
2228
2228
|
return An(this);
|
|
2229
2229
|
}, de));
|
|
2230
|
-
var $e = {}, Pn = {},
|
|
2230
|
+
var $e = {}, Pn = {}, In = !1;
|
|
2231
2231
|
function Wt(e) {
|
|
2232
|
-
Ut(Pn, e),
|
|
2233
|
-
|
|
2232
|
+
Ut(Pn, e), In || (In = !0, setTimeout(function() {
|
|
2233
|
+
In = !1, Cn(Pn, !(Pn = {}));
|
|
2234
2234
|
}, 0));
|
|
2235
2235
|
}
|
|
2236
|
-
function
|
|
2236
|
+
function Cn(e, t) {
|
|
2237
2237
|
t === void 0 && (t = !1);
|
|
2238
2238
|
var n = /* @__PURE__ */ new Set();
|
|
2239
2239
|
if (e.all)
|
|
@@ -2250,18 +2250,18 @@ var Rr = { exports: {} };
|
|
|
2250
2250
|
}
|
|
2251
2251
|
function _r(e, t, n, r) {
|
|
2252
2252
|
for (var o = [], a = 0, s = Object.entries(e.queries.query); a < s.length; a++) {
|
|
2253
|
-
for (var c = s[a], g = c[0],
|
|
2254
|
-
var
|
|
2255
|
-
Dn(t,
|
|
2253
|
+
for (var c = s[a], g = c[0], d = [], v = 0, l = c[1]; v < l.length; v++) {
|
|
2254
|
+
var h = l[v];
|
|
2255
|
+
Dn(t, h.obsSet) ? h.subscribers.forEach(function(m) {
|
|
2256
2256
|
return n.add(m);
|
|
2257
|
-
}) : r &&
|
|
2257
|
+
}) : r && d.push(h);
|
|
2258
2258
|
}
|
|
2259
|
-
r && o.push([g,
|
|
2259
|
+
r && o.push([g, d]);
|
|
2260
2260
|
}
|
|
2261
2261
|
if (r)
|
|
2262
2262
|
for (var y = 0, b = o; y < b.length; y++) {
|
|
2263
|
-
var w = b[y], g = w[0],
|
|
2264
|
-
e.queries.query[g] =
|
|
2263
|
+
var w = b[y], g = w[0], d = w[1];
|
|
2264
|
+
e.queries.query[g] = d;
|
|
2265
2265
|
}
|
|
2266
2266
|
}
|
|
2267
2267
|
function pi(e) {
|
|
@@ -2274,43 +2274,43 @@ var Rr = { exports: {} };
|
|
|
2274
2274
|
var r = t.openCanceller, o = Math.round(10 * e.verno), a = !1;
|
|
2275
2275
|
function s() {
|
|
2276
2276
|
if (t.openCanceller !== r)
|
|
2277
|
-
throw new
|
|
2277
|
+
throw new L.DatabaseClosed("db.open() was cancelled");
|
|
2278
2278
|
}
|
|
2279
2279
|
function c() {
|
|
2280
|
-
return new M(function(
|
|
2280
|
+
return new M(function(h, y) {
|
|
2281
2281
|
if (s(), !n)
|
|
2282
|
-
throw new
|
|
2282
|
+
throw new L.MissingAPI();
|
|
2283
2283
|
var b = e.name, w = t.autoSchema || !o ? n.open(b) : n.open(b, o);
|
|
2284
2284
|
if (!w)
|
|
2285
|
-
throw new
|
|
2285
|
+
throw new L.MissingAPI();
|
|
2286
2286
|
w.onerror = ye(y), w.onblocked = J(e._fireOnBlocked), w.onupgradeneeded = J(function(m) {
|
|
2287
2287
|
var _;
|
|
2288
2288
|
v = w.transaction, t.autoSchema && !e._options.allowEmptyDB ? (w.onerror = ht, v.abort(), w.result.close(), (_ = n.deleteDatabase(b)).onsuccess = _.onerror = J(function() {
|
|
2289
|
-
y(new
|
|
2289
|
+
y(new L.NoSuchDatabase("Database ".concat(b, " doesnt exist")));
|
|
2290
2290
|
})) : (v.onerror = ye(y), m = m.oldVersion > Math.pow(2, 62) ? 0 : m.oldVersion, l = m < 1, e.idbdb = w.result, a && di(e, v), fi(e, m / 10, v, y));
|
|
2291
2291
|
}, y), w.onsuccess = J(function() {
|
|
2292
2292
|
v = null;
|
|
2293
|
-
var m, _, S,
|
|
2294
|
-
if (0 <
|
|
2293
|
+
var m, _, S, O, x, A = e.idbdb = w.result, R = wt(A.objectStoreNames);
|
|
2294
|
+
if (0 < R.length)
|
|
2295
2295
|
try {
|
|
2296
|
-
var D =
|
|
2296
|
+
var D = A.transaction((O = R).length === 1 ? O[0] : O, "readonly");
|
|
2297
2297
|
if (t.autoSchema)
|
|
2298
|
-
_ =
|
|
2299
|
-
else if (
|
|
2298
|
+
_ = A, S = D, (m = e).verno = _.version / 10, S = m._dbSchema = Gt(0, _, S), m._storeNames = wt(_.objectStoreNames, 0), Nt(m, [m._allTables], K(S), S);
|
|
2299
|
+
else if (Lt(e, e._dbSchema, D), ((x = _n(Gt(0, (x = e).idbdb, D), x._dbSchema)).add.length || x.change.some(function(T) {
|
|
2300
2300
|
return T.add.length || T.change.length;
|
|
2301
2301
|
})) && !a)
|
|
2302
|
-
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."),
|
|
2302
|
+
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."), A.close(), o = A.version + 1, a = !0, h(c());
|
|
2303
2303
|
Kt(e, D);
|
|
2304
2304
|
} catch {
|
|
2305
2305
|
}
|
|
2306
|
-
Ze.push(e),
|
|
2306
|
+
Ze.push(e), A.onversionchange = J(function(T) {
|
|
2307
2307
|
t.vcFired = !0, e.on("versionchange").fire(T);
|
|
2308
|
-
}),
|
|
2308
|
+
}), A.onclose = J(function(T) {
|
|
2309
2309
|
e.on("close").fire(T);
|
|
2310
|
-
}), l && (
|
|
2310
|
+
}), l && (x = e._deps, D = b, A = x.indexedDB, x = x.IDBKeyRange, On(A) || D === Ct || En(A, x).put({ name: D }).catch(Y)), h();
|
|
2311
2311
|
}, y);
|
|
2312
|
-
}).catch(function(
|
|
2313
|
-
switch (
|
|
2312
|
+
}).catch(function(h) {
|
|
2313
|
+
switch (h == null ? void 0 : h.name) {
|
|
2314
2314
|
case "UnknownError":
|
|
2315
2315
|
if (0 < t.PR1398_maxLoop)
|
|
2316
2316
|
return t.PR1398_maxLoop--, console.warn("Dexie: Workaround for Chrome UnknownError on open()"), c();
|
|
@@ -2319,13 +2319,13 @@ var Rr = { exports: {} };
|
|
|
2319
2319
|
if (0 < o)
|
|
2320
2320
|
return o = 0, c();
|
|
2321
2321
|
}
|
|
2322
|
-
return M.reject(
|
|
2322
|
+
return M.reject(h);
|
|
2323
2323
|
});
|
|
2324
2324
|
}
|
|
2325
|
-
var g,
|
|
2326
|
-
return M.race([r, (typeof navigator > "u" ? M.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(
|
|
2325
|
+
var g, d = t.dbReadyResolve, v = null, l = !1;
|
|
2326
|
+
return M.race([r, (typeof navigator > "u" ? M.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(h) {
|
|
2327
2327
|
function y() {
|
|
2328
|
-
return indexedDB.databases().finally(
|
|
2328
|
+
return indexedDB.databases().finally(h);
|
|
2329
2329
|
}
|
|
2330
2330
|
g = setInterval(y, 100), y();
|
|
2331
2331
|
}).finally(function() {
|
|
@@ -2333,32 +2333,32 @@ var Rr = { exports: {} };
|
|
|
2333
2333
|
}) : Promise.resolve()).then(c)]).then(function() {
|
|
2334
2334
|
return s(), t.onReadyBeingFired = [], M.resolve(xn(function() {
|
|
2335
2335
|
return e.on.ready.fire(e.vip);
|
|
2336
|
-
})).then(function
|
|
2336
|
+
})).then(function h() {
|
|
2337
2337
|
if (0 < t.onReadyBeingFired.length) {
|
|
2338
|
-
var y = t.onReadyBeingFired.reduce(tn,
|
|
2338
|
+
var y = t.onReadyBeingFired.reduce(tn, Y);
|
|
2339
2339
|
return t.onReadyBeingFired = [], M.resolve(xn(function() {
|
|
2340
2340
|
return y(e.vip);
|
|
2341
|
-
})).then(
|
|
2341
|
+
})).then(h);
|
|
2342
2342
|
}
|
|
2343
2343
|
});
|
|
2344
2344
|
}).finally(function() {
|
|
2345
2345
|
t.openCanceller === r && (t.onReadyBeingFired = null, t.isBeingOpened = !1);
|
|
2346
|
-
}).catch(function(
|
|
2347
|
-
t.dbOpenError =
|
|
2346
|
+
}).catch(function(h) {
|
|
2347
|
+
t.dbOpenError = h;
|
|
2348
2348
|
try {
|
|
2349
2349
|
v && v.abort();
|
|
2350
2350
|
} catch {
|
|
2351
2351
|
}
|
|
2352
|
-
return r === t.openCanceller && e._close(), q(
|
|
2352
|
+
return r === t.openCanceller && e._close(), q(h);
|
|
2353
2353
|
}).finally(function() {
|
|
2354
|
-
t.openComplete = !0,
|
|
2354
|
+
t.openComplete = !0, d();
|
|
2355
2355
|
}).then(function() {
|
|
2356
|
-
var
|
|
2357
|
-
return l && (
|
|
2356
|
+
var h;
|
|
2357
|
+
return l && (h = {}, e.tables.forEach(function(y) {
|
|
2358
2358
|
y.schema.indexes.forEach(function(b) {
|
|
2359
|
-
b.name && (
|
|
2360
|
-
}),
|
|
2361
|
-
}), Te(pt).fire(
|
|
2359
|
+
b.name && (h["idb://".concat(e.name, "/").concat(y.name, "/").concat(b.name)] = new oe(-1 / 0, [[[]]]));
|
|
2360
|
+
}), h["idb://".concat(e.name, "/").concat(y.name, "/")] = h["idb://".concat(e.name, "/").concat(y.name, "/:dels")] = new oe(-1 / 0, [[[]]]);
|
|
2361
|
+
}), Te(pt).fire(h), Cn(h, !0)), e;
|
|
2362
2362
|
});
|
|
2363
2363
|
}
|
|
2364
2364
|
function Rn(e) {
|
|
@@ -2371,50 +2371,50 @@ var Rr = { exports: {} };
|
|
|
2371
2371
|
function o(a) {
|
|
2372
2372
|
return function(g) {
|
|
2373
2373
|
var c = a(g), g = c.value;
|
|
2374
|
-
return c.done ? g : g && typeof g.then == "function" ? g.then(n, r) :
|
|
2374
|
+
return c.done ? g : g && typeof g.then == "function" ? g.then(n, r) : B(g) ? Promise.all(g).then(n, r) : n(g);
|
|
2375
2375
|
};
|
|
2376
2376
|
}
|
|
2377
2377
|
return o(t)();
|
|
2378
2378
|
}
|
|
2379
2379
|
function zt(e, t, n) {
|
|
2380
|
-
for (var r =
|
|
2380
|
+
for (var r = B(e) ? e.slice() : [e], o = 0; o < n; ++o)
|
|
2381
2381
|
r.push(t);
|
|
2382
2382
|
return r;
|
|
2383
2383
|
}
|
|
2384
2384
|
var gi = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2385
|
-
return
|
|
2385
|
+
return f(f({}, e), { table: function(t) {
|
|
2386
2386
|
var n = e.table(t), r = n.schema, o = {}, a = [];
|
|
2387
|
-
function s(l,
|
|
2388
|
-
var b = yt(l), w = o[b] = o[b] || [], m = l == null ? 0 : typeof l == "string" ? 1 : l.length, _ = 0 <
|
|
2389
|
-
return w.push(_), _.isPrimaryKey || a.push(_), 1 < m && s(m === 2 ? l[0] : l.slice(0, m - 1),
|
|
2390
|
-
return S.keyTail -
|
|
2387
|
+
function s(l, h, y) {
|
|
2388
|
+
var b = yt(l), w = o[b] = o[b] || [], m = l == null ? 0 : typeof l == "string" ? 1 : l.length, _ = 0 < h, _ = f(f({}, y), { name: _ ? "".concat(b, "(virtual-from:").concat(y.name, ")") : y.name, lowLevelIndex: y, isVirtual: _, keyTail: h, keyLength: m, extractKey: vn(l), unique: !_ && y.unique });
|
|
2389
|
+
return w.push(_), _.isPrimaryKey || a.push(_), 1 < m && s(m === 2 ? l[0] : l.slice(0, m - 1), h + 1, y), w.sort(function(S, O) {
|
|
2390
|
+
return S.keyTail - O.keyTail;
|
|
2391
2391
|
}), _;
|
|
2392
2392
|
}
|
|
2393
2393
|
t = s(r.primaryKey.keyPath, 0, r.primaryKey), o[":id"] = [t];
|
|
2394
2394
|
for (var c = 0, g = r.indexes; c < g.length; c++) {
|
|
2395
|
-
var
|
|
2396
|
-
s(
|
|
2395
|
+
var d = g[c];
|
|
2396
|
+
s(d.keyPath, 0, d);
|
|
2397
2397
|
}
|
|
2398
2398
|
function v(l) {
|
|
2399
|
-
var
|
|
2400
|
-
return y.isVirtual ?
|
|
2399
|
+
var h, y = l.query.index;
|
|
2400
|
+
return y.isVirtual ? f(f({}, l), { query: { index: y.lowLevelIndex, range: (h = l.query.range, y = y.keyTail, { type: h.type === 1 ? 2 : h.type, lower: zt(h.lower, h.lowerOpen ? e.MAX_KEY : e.MIN_KEY, y), lowerOpen: !0, upper: zt(h.upper, h.upperOpen ? e.MIN_KEY : e.MAX_KEY, y), upperOpen: !0 }) } }) : l;
|
|
2401
2401
|
}
|
|
2402
|
-
return
|
|
2402
|
+
return f(f({}, n), { schema: f(f({}, r), { primaryKey: t, indexes: a, getIndexByKeyPath: function(l) {
|
|
2403
2403
|
return (l = o[yt(l)]) && l[0];
|
|
2404
2404
|
} }), count: function(l) {
|
|
2405
2405
|
return n.count(v(l));
|
|
2406
2406
|
}, query: function(l) {
|
|
2407
2407
|
return n.query(v(l));
|
|
2408
2408
|
}, openCursor: function(l) {
|
|
2409
|
-
var
|
|
2409
|
+
var h = l.query.index, y = h.keyTail, b = h.isVirtual, w = h.keyLength;
|
|
2410
2410
|
return b ? n.openCursor(v(l)).then(function(_) {
|
|
2411
2411
|
return _ && m(_);
|
|
2412
2412
|
}) : n.openCursor(l);
|
|
2413
2413
|
function m(_) {
|
|
2414
2414
|
return Object.create(_, { continue: { value: function(S) {
|
|
2415
2415
|
S != null ? _.continue(zt(S, l.reverse ? e.MAX_KEY : e.MIN_KEY, y)) : l.unique ? _.continue(_.key.slice(0, w).concat(l.reverse ? e.MIN_KEY : e.MAX_KEY, y)) : _.continue();
|
|
2416
|
-
} }, continuePrimaryKey: { value: function(S,
|
|
2417
|
-
_.continuePrimaryKey(zt(S, e.MAX_KEY, y),
|
|
2416
|
+
} }, continuePrimaryKey: { value: function(S, O) {
|
|
2417
|
+
_.continuePrimaryKey(zt(S, e.MAX_KEY, y), O);
|
|
2418
2418
|
} }, primaryKey: { get: function() {
|
|
2419
2419
|
return _.primaryKey;
|
|
2420
2420
|
} }, key: { get: function() {
|
|
@@ -2439,38 +2439,38 @@ var Rr = { exports: {} };
|
|
|
2439
2439
|
return t.type === "delete" ? t.keys : t.keys || t.values.map(e.extractKey);
|
|
2440
2440
|
}
|
|
2441
2441
|
var yi = { stack: "dbcore", name: "HooksMiddleware", level: 2, create: function(e) {
|
|
2442
|
-
return
|
|
2442
|
+
return f(f({}, e), { table: function(t) {
|
|
2443
2443
|
var n = e.table(t), r = n.schema.primaryKey;
|
|
2444
|
-
return
|
|
2445
|
-
var a =
|
|
2444
|
+
return f(f({}, n), { mutate: function(o) {
|
|
2445
|
+
var a = N.trans, s = a.table(t).hook, c = s.deleting, g = s.creating, d = s.updating;
|
|
2446
2446
|
switch (o.type) {
|
|
2447
2447
|
case "add":
|
|
2448
|
-
if (g.fire ===
|
|
2448
|
+
if (g.fire === Y)
|
|
2449
2449
|
break;
|
|
2450
2450
|
return a._promise("readwrite", function() {
|
|
2451
2451
|
return v(o);
|
|
2452
2452
|
}, !0);
|
|
2453
2453
|
case "put":
|
|
2454
|
-
if (g.fire ===
|
|
2454
|
+
if (g.fire === Y && d.fire === Y)
|
|
2455
2455
|
break;
|
|
2456
2456
|
return a._promise("readwrite", function() {
|
|
2457
2457
|
return v(o);
|
|
2458
2458
|
}, !0);
|
|
2459
2459
|
case "delete":
|
|
2460
|
-
if (c.fire ===
|
|
2460
|
+
if (c.fire === Y)
|
|
2461
2461
|
break;
|
|
2462
2462
|
return a._promise("readwrite", function() {
|
|
2463
2463
|
return v(o);
|
|
2464
2464
|
}, !0);
|
|
2465
2465
|
case "deleteRange":
|
|
2466
|
-
if (c.fire ===
|
|
2466
|
+
if (c.fire === Y)
|
|
2467
2467
|
break;
|
|
2468
2468
|
return a._promise("readwrite", function() {
|
|
2469
|
-
return function l(
|
|
2470
|
-
return n.query({ trans:
|
|
2469
|
+
return function l(h, y, b) {
|
|
2470
|
+
return n.query({ trans: h, values: !1, query: { index: r, range: y }, limit: b }).then(function(w) {
|
|
2471
2471
|
var m = w.result;
|
|
2472
|
-
return v({ type: "delete", keys: m, trans:
|
|
2473
|
-
return 0 < _.numFailures ? Promise.reject(_.failures[0]) : m.length < b ? { failures: [], numFailures: 0, lastResult: void 0 } : l(
|
|
2472
|
+
return v({ type: "delete", keys: m, trans: h }).then(function(_) {
|
|
2473
|
+
return 0 < _.numFailures ? Promise.reject(_.failures[0]) : m.length < b ? { failures: [], numFailures: 0, lastResult: void 0 } : l(h, f(f({}, y), { lower: m[m.length - 1], lowerOpen: !0 }), b);
|
|
2474
2474
|
});
|
|
2475
2475
|
});
|
|
2476
2476
|
}(o.trans, o.range, 1e4);
|
|
@@ -2478,26 +2478,26 @@ var Rr = { exports: {} };
|
|
|
2478
2478
|
}
|
|
2479
2479
|
return n.mutate(o);
|
|
2480
2480
|
function v(l) {
|
|
2481
|
-
var
|
|
2481
|
+
var h, y, b, w = N.trans, m = l.keys || Mn(r, l);
|
|
2482
2482
|
if (!m)
|
|
2483
2483
|
throw new Error("Keys missing");
|
|
2484
|
-
return (l = l.type === "add" || l.type === "put" ?
|
|
2485
|
-
var S = m.map(function(
|
|
2486
|
-
var
|
|
2487
|
-
return l.type === "delete" ? c.fire.call(
|
|
2488
|
-
ie(D,
|
|
2489
|
-
}))),
|
|
2484
|
+
return (l = l.type === "add" || l.type === "put" ? f(f({}, l), { keys: m }) : f({}, l)).type !== "delete" && (l.values = k([], l.values, !0)), l.keys && (l.keys = k([], l.keys, !0)), h = n, b = m, ((y = l).type === "add" ? Promise.resolve([]) : h.getMany({ trans: y.trans, keys: b, cache: "immutable" })).then(function(_) {
|
|
2485
|
+
var S = m.map(function(O, x) {
|
|
2486
|
+
var A, R, D, T = _[x], I = { onerror: null, onsuccess: null };
|
|
2487
|
+
return l.type === "delete" ? c.fire.call(I, O, T, w) : l.type === "add" || T === void 0 ? (A = g.fire.call(I, O, l.values[x], w), O == null && A != null && (l.keys[x] = O = A, r.outbound || fe(l.values[x], r.keyPath, O))) : (A = Tn(T, l.values[x]), (R = d.fire.call(I, A, O, T, w)) && (D = l.values[x], Object.keys(R).forEach(function(G) {
|
|
2488
|
+
ie(D, G) ? D[G] = R[G] : fe(D, G, R[G]);
|
|
2489
|
+
}))), I;
|
|
2490
2490
|
});
|
|
2491
|
-
return n.mutate(l).then(function(
|
|
2492
|
-
for (var
|
|
2493
|
-
var T = (
|
|
2494
|
-
T == null ?
|
|
2491
|
+
return n.mutate(l).then(function(O) {
|
|
2492
|
+
for (var x = O.failures, A = O.results, R = O.numFailures, O = O.lastResult, D = 0; D < m.length; ++D) {
|
|
2493
|
+
var T = (A || m)[D], I = S[D];
|
|
2494
|
+
T == null ? I.onerror && I.onerror(x[D]) : I.onsuccess && I.onsuccess(l.type === "put" && _[D] ? l.values[D] : T);
|
|
2495
2495
|
}
|
|
2496
|
-
return { failures:
|
|
2497
|
-
}).catch(function(
|
|
2498
|
-
return S.forEach(function(
|
|
2499
|
-
return
|
|
2500
|
-
}), Promise.reject(
|
|
2496
|
+
return { failures: x, results: A, numFailures: R, lastResult: O };
|
|
2497
|
+
}).catch(function(O) {
|
|
2498
|
+
return S.forEach(function(x) {
|
|
2499
|
+
return x.onerror && x.onerror(O);
|
|
2500
|
+
}), Promise.reject(O);
|
|
2501
2501
|
});
|
|
2502
2502
|
});
|
|
2503
2503
|
}
|
|
@@ -2518,7 +2518,7 @@ var Rr = { exports: {} };
|
|
|
2518
2518
|
var mi = { stack: "dbcore", level: -1, create: function(e) {
|
|
2519
2519
|
return { table: function(t) {
|
|
2520
2520
|
var n = e.table(t);
|
|
2521
|
-
return
|
|
2521
|
+
return f(f({}, n), { getMany: function(r) {
|
|
2522
2522
|
if (!r.cache)
|
|
2523
2523
|
return n.getMany(r);
|
|
2524
2524
|
var o = Sr(r.keys, r.trans._cache, r.cache === "clone");
|
|
@@ -2546,82 +2546,82 @@ var Rr = { exports: {} };
|
|
|
2546
2546
|
}
|
|
2547
2547
|
var bi = { stack: "dbcore", level: 0, name: "Observability", create: function(e) {
|
|
2548
2548
|
var t = e.schema.name, n = new oe(e.MIN_KEY, e.MAX_KEY);
|
|
2549
|
-
return
|
|
2550
|
-
if (
|
|
2551
|
-
throw new
|
|
2549
|
+
return f(f({}, e), { transaction: function(r, o, a) {
|
|
2550
|
+
if (N.subscr && o !== "readonly")
|
|
2551
|
+
throw new L.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(N.querier));
|
|
2552
2552
|
return e.transaction(r, o, a);
|
|
2553
2553
|
}, table: function(r) {
|
|
2554
2554
|
function o(y) {
|
|
2555
2555
|
var y = (b = y.query).index, b = b.range;
|
|
2556
2556
|
return [y, new oe((y = b.lower) !== null && y !== void 0 ? y : e.MIN_KEY, (b = b.upper) !== null && b !== void 0 ? b : e.MAX_KEY)];
|
|
2557
2557
|
}
|
|
2558
|
-
var a = e.table(r), s = a.schema, c = s.primaryKey, g = c.extractKey,
|
|
2559
|
-
function y(
|
|
2560
|
-
return
|
|
2558
|
+
var a = e.table(r), s = a.schema, c = s.primaryKey, g = c.extractKey, d = c.outbound, v = f(f({}, a), { mutate: function(h) {
|
|
2559
|
+
function y(I) {
|
|
2560
|
+
return I = "idb://".concat(t, "/").concat(r, "/").concat(I), S[I] || (S[I] = new oe());
|
|
2561
2561
|
}
|
|
2562
|
-
var b, w, m, _ =
|
|
2563
|
-
return
|
|
2564
|
-
}),
|
|
2565
|
-
return
|
|
2566
|
-
var
|
|
2562
|
+
var b, w, m, _ = h.trans, S = h.mutatedParts || (h.mutatedParts = {}), O = y(""), x = y(":dels"), A = h.type, T = h.type === "deleteRange" ? [h.range] : h.type === "delete" ? [h.keys] : h.values.length < 50 ? [Mn(c, h).filter(function(I) {
|
|
2563
|
+
return I;
|
|
2564
|
+
}), h.values] : [], R = T[0], D = T[1], T = h.trans._cache;
|
|
2565
|
+
return B(R) ? (O.addKeys(R), (T = A === "delete" || R.length === D.length ? Sr(R, T) : null) || x.addKeys(R), (T || D) && (b = y, w = T, m = D, s.indexes.forEach(function(I) {
|
|
2566
|
+
var G = b(I.name || "");
|
|
2567
2567
|
function F(U) {
|
|
2568
|
-
return U != null ?
|
|
2568
|
+
return U != null ? I.extractKey(U) : null;
|
|
2569
2569
|
}
|
|
2570
|
-
function
|
|
2571
|
-
return
|
|
2572
|
-
return
|
|
2573
|
-
}) :
|
|
2570
|
+
function H(U) {
|
|
2571
|
+
return I.multiEntry && B(U) ? U.forEach(function(Q) {
|
|
2572
|
+
return G.addKey(Q);
|
|
2573
|
+
}) : G.addKey(U);
|
|
2574
2574
|
}
|
|
2575
2575
|
(w || m).forEach(function(U, $) {
|
|
2576
2576
|
var le = w && F(w[$]), $ = m && F(m[$]);
|
|
2577
|
-
z(le, $) !== 0 && (le != null &&
|
|
2577
|
+
z(le, $) !== 0 && (le != null && H(le), $ != null && H($));
|
|
2578
2578
|
});
|
|
2579
|
-
}))) :
|
|
2580
|
-
return y(
|
|
2581
|
-
})), a.mutate(
|
|
2582
|
-
return !
|
|
2579
|
+
}))) : R ? (D = { from: R.lower, to: R.upper }, x.add(D), O.add(D)) : (O.add(n), x.add(n), s.indexes.forEach(function(I) {
|
|
2580
|
+
return y(I.name).add(n);
|
|
2581
|
+
})), a.mutate(h).then(function(I) {
|
|
2582
|
+
return !R || h.type !== "add" && h.type !== "put" || O.addKeys(I.results), _.mutatedParts = Ut(_.mutatedParts || {}, S), I;
|
|
2583
2583
|
});
|
|
2584
|
-
} }), l = { get: function(
|
|
2585
|
-
return [c, new oe(
|
|
2586
|
-
}, getMany: function(
|
|
2587
|
-
return [c, new oe().addKeys(
|
|
2584
|
+
} }), l = { get: function(h) {
|
|
2585
|
+
return [c, new oe(h.key)];
|
|
2586
|
+
}, getMany: function(h) {
|
|
2587
|
+
return [c, new oe().addKeys(h.keys)];
|
|
2588
2588
|
}, count: o, query: o, openCursor: o };
|
|
2589
|
-
return K(l).forEach(function(
|
|
2590
|
-
v[
|
|
2591
|
-
var b =
|
|
2589
|
+
return K(l).forEach(function(h) {
|
|
2590
|
+
v[h] = function(y) {
|
|
2591
|
+
var b = N.subscr, w = !!b, m = Er(N, a) && Or(h, y) ? y.obsSet = {} : b;
|
|
2592
2592
|
if (w) {
|
|
2593
2593
|
var _ = function(D) {
|
|
2594
2594
|
return D = "idb://".concat(t, "/").concat(r, "/").concat(D), m[D] || (m[D] = new oe());
|
|
2595
|
-
}, S = _(""),
|
|
2596
|
-
if ((
|
|
2597
|
-
if (
|
|
2598
|
-
var
|
|
2599
|
-
return a[
|
|
2600
|
-
if (
|
|
2601
|
-
if (
|
|
2602
|
-
return
|
|
2595
|
+
}, S = _(""), O = _(":dels"), b = l[h](y), w = b[0], b = b[1];
|
|
2596
|
+
if ((h === "query" && w.isPrimaryKey && !y.values ? O : _(w.name || "")).add(b), !w.isPrimaryKey) {
|
|
2597
|
+
if (h !== "count") {
|
|
2598
|
+
var x = h === "query" && d && y.values && a.query(f(f({}, y), { values: !1 }));
|
|
2599
|
+
return a[h].apply(this, arguments).then(function(D) {
|
|
2600
|
+
if (h === "query") {
|
|
2601
|
+
if (d && y.values)
|
|
2602
|
+
return x.then(function(F) {
|
|
2603
2603
|
return F = F.result, S.addKeys(F), D;
|
|
2604
2604
|
});
|
|
2605
2605
|
var T = y.values ? D.result.map(g) : D.result;
|
|
2606
|
-
(y.values ? S :
|
|
2607
|
-
} else if (
|
|
2608
|
-
var
|
|
2609
|
-
return
|
|
2610
|
-
return
|
|
2606
|
+
(y.values ? S : O).addKeys(T);
|
|
2607
|
+
} else if (h === "openCursor") {
|
|
2608
|
+
var I = D, G = y.values;
|
|
2609
|
+
return I && Object.create(I, { key: { get: function() {
|
|
2610
|
+
return O.addKey(I.primaryKey), I.key;
|
|
2611
2611
|
} }, primaryKey: { get: function() {
|
|
2612
|
-
var F =
|
|
2613
|
-
return
|
|
2612
|
+
var F = I.primaryKey;
|
|
2613
|
+
return O.addKey(F), F;
|
|
2614
2614
|
} }, value: { get: function() {
|
|
2615
|
-
return
|
|
2615
|
+
return G && S.addKey(I.primaryKey), I.value;
|
|
2616
2616
|
} } });
|
|
2617
2617
|
}
|
|
2618
2618
|
return D;
|
|
2619
2619
|
});
|
|
2620
2620
|
}
|
|
2621
|
-
|
|
2621
|
+
O.add(n);
|
|
2622
2622
|
}
|
|
2623
2623
|
}
|
|
2624
|
-
return a[
|
|
2624
|
+
return a[h].apply(this, arguments);
|
|
2625
2625
|
};
|
|
2626
2626
|
}), v;
|
|
2627
2627
|
} });
|
|
@@ -2632,9 +2632,9 @@ var Rr = { exports: {} };
|
|
|
2632
2632
|
if (t.type === "deleteRange")
|
|
2633
2633
|
return null;
|
|
2634
2634
|
var r = t.keys ? t.keys.length : "values" in t && t.values ? t.values.length : 1;
|
|
2635
|
-
return n.numFailures === r ? null : (t =
|
|
2635
|
+
return n.numFailures === r ? null : (t = f({}, t), B(t.keys) && (t.keys = t.keys.filter(function(o, a) {
|
|
2636
2636
|
return !(a in n.failures);
|
|
2637
|
-
})), "values" in t &&
|
|
2637
|
+
})), "values" in t && B(t.values) && (t.values = t.values.filter(function(o, a) {
|
|
2638
2638
|
return !(a in n.failures);
|
|
2639
2639
|
})), t);
|
|
2640
2640
|
}
|
|
@@ -2642,49 +2642,49 @@ var Rr = { exports: {} };
|
|
|
2642
2642
|
return n = e, ((r = t).lower === void 0 || (r.lowerOpen ? 0 < z(n, r.lower) : 0 <= z(n, r.lower))) && (e = e, (t = t).upper === void 0 || (t.upperOpen ? z(e, t.upper) < 0 : z(e, t.upper) <= 0));
|
|
2643
2643
|
var n, r;
|
|
2644
2644
|
}
|
|
2645
|
-
function kr(e, t,
|
|
2646
|
-
if (!
|
|
2645
|
+
function kr(e, t, h, r, o, a) {
|
|
2646
|
+
if (!h || h.length === 0)
|
|
2647
2647
|
return e;
|
|
2648
|
-
var s = t.query.index, c = s.multiEntry, g = t.query.range,
|
|
2649
|
-
var w = y, m = b.type === "add" || b.type === "put" ? b.values.filter(function(
|
|
2650
|
-
return
|
|
2651
|
-
return jn(
|
|
2652
|
-
}) : jn(
|
|
2653
|
-
}).map(function(
|
|
2654
|
-
return
|
|
2648
|
+
var s = t.query.index, c = s.multiEntry, g = t.query.range, d = r.schema.primaryKey.extractKey, v = s.extractKey, l = (s.lowLevelIndex || s).extractKey, h = h.reduce(function(y, b) {
|
|
2649
|
+
var w = y, m = b.type === "add" || b.type === "put" ? b.values.filter(function(x) {
|
|
2650
|
+
return x = v(x), c && B(x) ? x.some(function(A) {
|
|
2651
|
+
return jn(A, g);
|
|
2652
|
+
}) : jn(x, g);
|
|
2653
|
+
}).map(function(x) {
|
|
2654
|
+
return x = Ae(x), a && Object.freeze(x), x;
|
|
2655
2655
|
}) : [];
|
|
2656
2656
|
switch (b.type) {
|
|
2657
2657
|
case "add":
|
|
2658
|
-
w = y.concat(t.values ? m : m.map(function(
|
|
2659
|
-
return
|
|
2658
|
+
w = y.concat(t.values ? m : m.map(function(A) {
|
|
2659
|
+
return d(A);
|
|
2660
2660
|
}));
|
|
2661
2661
|
break;
|
|
2662
2662
|
case "put":
|
|
2663
|
-
var _ = new oe().addKeys(b.values.map(function(
|
|
2664
|
-
return
|
|
2665
|
-
})), w = y.filter(function(
|
|
2666
|
-
return
|
|
2667
|
-
}).concat(t.values ? m : m.map(function(
|
|
2668
|
-
return
|
|
2663
|
+
var _ = new oe().addKeys(b.values.map(function(A) {
|
|
2664
|
+
return d(A);
|
|
2665
|
+
})), w = y.filter(function(A) {
|
|
2666
|
+
return A = t.values ? d(A) : A, !$t(new oe(A), _);
|
|
2667
|
+
}).concat(t.values ? m : m.map(function(A) {
|
|
2668
|
+
return d(A);
|
|
2669
2669
|
}));
|
|
2670
2670
|
break;
|
|
2671
2671
|
case "delete":
|
|
2672
2672
|
var S = new oe().addKeys(b.keys);
|
|
2673
|
-
w = y.filter(function(
|
|
2674
|
-
return
|
|
2673
|
+
w = y.filter(function(A) {
|
|
2674
|
+
return A = t.values ? d(A) : A, !$t(new oe(A), S);
|
|
2675
2675
|
});
|
|
2676
2676
|
break;
|
|
2677
2677
|
case "deleteRange":
|
|
2678
|
-
var
|
|
2679
|
-
w = y.filter(function(
|
|
2680
|
-
return !jn(
|
|
2678
|
+
var O = b.range;
|
|
2679
|
+
w = y.filter(function(A) {
|
|
2680
|
+
return !jn(d(A), O);
|
|
2681
2681
|
});
|
|
2682
2682
|
}
|
|
2683
2683
|
return w;
|
|
2684
2684
|
}, e);
|
|
2685
|
-
return
|
|
2686
|
-
return z(l(y), l(b)) || z(
|
|
2687
|
-
}), t.limit && t.limit < 1 / 0 && (
|
|
2685
|
+
return h === e ? e : (h.sort(function(y, b) {
|
|
2686
|
+
return z(l(y), l(b)) || z(d(y), d(b));
|
|
2687
|
+
}), t.limit && t.limit < 1 / 0 && (h.length > t.limit ? h.length = t.limit : e.length === t.limit && h.length < t.limit && (o.dirty = !0)), a ? Object.freeze(h) : h);
|
|
2688
2688
|
}
|
|
2689
2689
|
function Ar(e, t) {
|
|
2690
2690
|
return z(e.lower, t.lower) === 0 && z(e.upper, t.upper) === 0 && !!e.lowerOpen == !!t.lowerOpen && !!e.upperOpen == !!t.upperOpen;
|
|
@@ -2730,38 +2730,38 @@ var Rr = { exports: {} };
|
|
|
2730
2730
|
}
|
|
2731
2731
|
var _i = { stack: "dbcore", level: 0, name: "Cache", create: function(e) {
|
|
2732
2732
|
var t = e.schema.name;
|
|
2733
|
-
return
|
|
2733
|
+
return f(f({}, e), { transaction: function(n, r, o) {
|
|
2734
2734
|
var a, s, c = e.transaction(n, r, o);
|
|
2735
2735
|
return r === "readwrite" && (s = (a = new AbortController()).signal, o = function(g) {
|
|
2736
2736
|
return function() {
|
|
2737
2737
|
if (a.abort(), r === "readwrite") {
|
|
2738
|
-
for (var
|
|
2739
|
-
var
|
|
2738
|
+
for (var d = /* @__PURE__ */ new Set(), v = 0, l = n; v < l.length; v++) {
|
|
2739
|
+
var h = l[v], y = $e["idb://".concat(t, "/").concat(h)];
|
|
2740
2740
|
if (y) {
|
|
2741
|
-
var b = e.table(
|
|
2741
|
+
var b = e.table(h), w = y.optimisticOps.filter(function(F) {
|
|
2742
2742
|
return F.trans === c;
|
|
2743
2743
|
});
|
|
2744
2744
|
if (c._explicit && g && c.mutatedParts)
|
|
2745
2745
|
for (var m = 0, _ = Object.values(y.queries.query); m < _.length; m++)
|
|
2746
|
-
for (var S = 0,
|
|
2747
|
-
Dn((D =
|
|
2748
|
-
return
|
|
2746
|
+
for (var S = 0, O = (R = _[m]).slice(); S < O.length; S++)
|
|
2747
|
+
Dn((D = O[S]).obsSet, c.mutatedParts) && (je(R, D), D.subscribers.forEach(function(F) {
|
|
2748
|
+
return d.add(F);
|
|
2749
2749
|
}));
|
|
2750
2750
|
else if (0 < w.length) {
|
|
2751
2751
|
y.optimisticOps = y.optimisticOps.filter(function(F) {
|
|
2752
2752
|
return F.trans !== c;
|
|
2753
2753
|
});
|
|
2754
|
-
for (var
|
|
2755
|
-
for (var
|
|
2756
|
-
(D =
|
|
2757
|
-
return
|
|
2758
|
-
})) : T !== D.res && (D.res = T, D.promise = M.resolve({ result: T }))) : (D.dirty && je(
|
|
2759
|
-
return
|
|
2754
|
+
for (var x = 0, A = Object.values(y.queries.query); x < A.length; x++)
|
|
2755
|
+
for (var R, D, T, I = 0, G = (R = A[x]).slice(); I < G.length; I++)
|
|
2756
|
+
(D = G[I]).res != null && c.mutatedParts && (g && !D.dirty ? (T = Object.isFrozen(D.res), T = kr(D.res, D.req, w, b, D, T), D.dirty ? (je(R, D), D.subscribers.forEach(function(F) {
|
|
2757
|
+
return d.add(F);
|
|
2758
|
+
})) : T !== D.res && (D.res = T, D.promise = M.resolve({ result: T }))) : (D.dirty && je(R, D), D.subscribers.forEach(function(F) {
|
|
2759
|
+
return d.add(F);
|
|
2760
2760
|
})));
|
|
2761
2761
|
}
|
|
2762
2762
|
}
|
|
2763
2763
|
}
|
|
2764
|
-
|
|
2764
|
+
d.forEach(function(F) {
|
|
2765
2765
|
return F();
|
|
2766
2766
|
});
|
|
2767
2767
|
}
|
|
@@ -2769,8 +2769,8 @@ var Rr = { exports: {} };
|
|
|
2769
2769
|
}, c.addEventListener("abort", o(!1), { signal: s }), c.addEventListener("error", o(!1), { signal: s }), c.addEventListener("complete", o(!0), { signal: s })), c;
|
|
2770
2770
|
}, table: function(n) {
|
|
2771
2771
|
var r = e.table(n), o = r.schema.primaryKey;
|
|
2772
|
-
return
|
|
2773
|
-
var s =
|
|
2772
|
+
return f(f({}, r), { mutate: function(a) {
|
|
2773
|
+
var s = N.trans;
|
|
2774
2774
|
if (o.outbound || s.db._options.cache === "disabled" || s.explicit)
|
|
2775
2775
|
return r.mutate(a);
|
|
2776
2776
|
var c = $e["idb://".concat(t, "/").concat(n)];
|
|
@@ -2781,40 +2781,40 @@ var Rr = { exports: {} };
|
|
|
2781
2781
|
}), s.catch(function() {
|
|
2782
2782
|
je(c.optimisticOps, a), a.mutatedParts && Wt(a.mutatedParts);
|
|
2783
2783
|
})) : s.then(function(g) {
|
|
2784
|
-
var
|
|
2785
|
-
var
|
|
2784
|
+
var d = xr(0, f(f({}, a), { values: a.values.map(function(y, l) {
|
|
2785
|
+
var h, y = (h = o.keyPath) !== null && h !== void 0 && h.includes(".") ? Ae(y) : f({}, y);
|
|
2786
2786
|
return fe(y, o.keyPath, g.results[l]), y;
|
|
2787
2787
|
}) }), g);
|
|
2788
|
-
c.optimisticOps.push(
|
|
2788
|
+
c.optimisticOps.push(d), queueMicrotask(function() {
|
|
2789
2789
|
return a.mutatedParts && Wt(a.mutatedParts);
|
|
2790
2790
|
});
|
|
2791
2791
|
}), s) : r.mutate(a);
|
|
2792
2792
|
}, query: function(a) {
|
|
2793
|
-
if (!Er(
|
|
2793
|
+
if (!Er(N, r) || !Or("query", a))
|
|
2794
2794
|
return r.query(a);
|
|
2795
|
-
var s = ((
|
|
2795
|
+
var s = ((d = N.trans) === null || d === void 0 ? void 0 : d.db._options.cache) === "immutable", l = N, c = l.requery, g = l.signal, d = function(b, w, m, _) {
|
|
2796
2796
|
var S = $e["idb://".concat(b, "/").concat(w)];
|
|
2797
2797
|
if (!S)
|
|
2798
2798
|
return [];
|
|
2799
2799
|
if (!(w = S.queries[m]))
|
|
2800
2800
|
return [null, !1, S, null];
|
|
2801
|
-
var
|
|
2802
|
-
if (!
|
|
2801
|
+
var O = w[(_.query ? _.query.index.name : null) || ""];
|
|
2802
|
+
if (!O)
|
|
2803
2803
|
return [null, !1, S, null];
|
|
2804
2804
|
switch (m) {
|
|
2805
2805
|
case "query":
|
|
2806
|
-
var
|
|
2807
|
-
return
|
|
2806
|
+
var x = O.find(function(A) {
|
|
2807
|
+
return A.req.limit === _.limit && A.req.values === _.values && Ar(A.req.query.range, _.query.range);
|
|
2808
2808
|
});
|
|
2809
|
-
return
|
|
2810
|
-
return ("limit" in
|
|
2811
|
-
}), !1, S,
|
|
2809
|
+
return x ? [x, !0, S, O] : [O.find(function(A) {
|
|
2810
|
+
return ("limit" in A.req ? A.req.limit : 1 / 0) >= _.limit && (!_.values || A.req.values) && vi(A.req.query.range, _.query.range);
|
|
2811
|
+
}), !1, S, O];
|
|
2812
2812
|
case "count":
|
|
2813
|
-
return
|
|
2814
|
-
return Ar(
|
|
2815
|
-
}), [
|
|
2813
|
+
return x = O.find(function(A) {
|
|
2814
|
+
return Ar(A.req.query.range, _.query.range);
|
|
2815
|
+
}), [x, !!x, S, O];
|
|
2816
2816
|
}
|
|
2817
|
-
}(t, n, "query", a), v =
|
|
2817
|
+
}(t, n, "query", a), v = d[0], l = d[1], h = d[2], y = d[3];
|
|
2818
2818
|
return v && l ? v.obsSet = a.obsSet : (l = r.query(a).then(function(b) {
|
|
2819
2819
|
var w = b.result;
|
|
2820
2820
|
if (v && (v.res = w), s) {
|
|
@@ -2826,22 +2826,22 @@ var Rr = { exports: {} };
|
|
|
2826
2826
|
return b;
|
|
2827
2827
|
}).catch(function(b) {
|
|
2828
2828
|
return y && v && je(y, v), Promise.reject(b);
|
|
2829
|
-
}), v = { obsSet: a.obsSet, promise: l, subscribers: /* @__PURE__ */ new Set(), type: "query", req: a, dirty: !1 }, y ? y.push(v) : (y = [v], (
|
|
2830
|
-
return { result: kr(b.result, a,
|
|
2829
|
+
}), v = { obsSet: a.obsSet, promise: l, subscribers: /* @__PURE__ */ new Set(), type: "query", req: a, dirty: !1 }, y ? y.push(v) : (y = [v], (h = h || ($e["idb://".concat(t, "/").concat(n)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[a.query.index.name || ""] = y)), wi(v, y, c, g), v.promise.then(function(b) {
|
|
2830
|
+
return { result: kr(b.result, a, h == null ? void 0 : h.optimisticOps, r, v, s) };
|
|
2831
2831
|
});
|
|
2832
2832
|
} });
|
|
2833
2833
|
} });
|
|
2834
2834
|
} };
|
|
2835
|
-
function
|
|
2835
|
+
function Ht(e, t) {
|
|
2836
2836
|
return new Proxy(e, { get: function(n, r, o) {
|
|
2837
2837
|
return r === "db" ? t : Reflect.get(n, r, o);
|
|
2838
2838
|
} });
|
|
2839
2839
|
}
|
|
2840
2840
|
var Se = (ee.prototype.version = function(e) {
|
|
2841
2841
|
if (isNaN(e) || e < 0.1)
|
|
2842
|
-
throw new
|
|
2842
|
+
throw new L.Type("Given version is not a positive number");
|
|
2843
2843
|
if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened)
|
|
2844
|
-
throw new
|
|
2844
|
+
throw new L.Schema("Cannot add version when database is open");
|
|
2845
2845
|
this.verno = Math.max(this.verno, e);
|
|
2846
2846
|
var t = this._versions, n = t.filter(function(r) {
|
|
2847
2847
|
return r._cfg.version === e;
|
|
@@ -2849,13 +2849,13 @@ var Rr = { exports: {} };
|
|
|
2849
2849
|
return n || (n = new this.Version(e), t.push(n), t.sort(li), n.stores({}), this._state.autoSchema = !1, n);
|
|
2850
2850
|
}, ee.prototype._whenReady = function(e) {
|
|
2851
2851
|
var t = this;
|
|
2852
|
-
return this.idbdb && (this._state.openComplete ||
|
|
2852
|
+
return this.idbdb && (this._state.openComplete || N.letThrough || this._vip) ? e() : new M(function(n, r) {
|
|
2853
2853
|
if (t._state.openComplete)
|
|
2854
|
-
return r(new
|
|
2854
|
+
return r(new L.DatabaseClosed(t._state.dbOpenError));
|
|
2855
2855
|
if (!t._state.isBeingOpened) {
|
|
2856
2856
|
if (!t._state.autoOpen)
|
|
2857
|
-
return void r(new
|
|
2858
|
-
t.open().catch(
|
|
2857
|
+
return void r(new L.DatabaseClosed());
|
|
2858
|
+
t.open().catch(Y);
|
|
2859
2859
|
}
|
|
2860
2860
|
t._state.dbReadyPromise.then(n, r);
|
|
2861
2861
|
}).then(e);
|
|
@@ -2871,7 +2871,7 @@ var Rr = { exports: {} };
|
|
|
2871
2871
|
})), this;
|
|
2872
2872
|
}, ee.prototype.open = function() {
|
|
2873
2873
|
var e = this;
|
|
2874
|
-
return
|
|
2874
|
+
return Ge(De, function() {
|
|
2875
2875
|
return pi(e);
|
|
2876
2876
|
});
|
|
2877
2877
|
}, ee.prototype._close = function() {
|
|
@@ -2890,7 +2890,7 @@ var Rr = { exports: {} };
|
|
|
2890
2890
|
}));
|
|
2891
2891
|
}, ee.prototype.close = function(n) {
|
|
2892
2892
|
var t = (n === void 0 ? { disableAutoOpen: !0 } : n).disableAutoOpen, n = this._state;
|
|
2893
|
-
t ? (n.isBeingOpened && n.cancelOpen(new
|
|
2893
|
+
t ? (n.isBeingOpened && n.cancelOpen(new L.DatabaseClosed()), this._close(), n.autoOpen = !1, n.dbOpenError = new L.DatabaseClosed()) : (this._close(), n.autoOpen = this._options.autoOpen || n.isBeingOpened, n.openComplete = !1, n.dbOpenError = null);
|
|
2894
2894
|
}, ee.prototype.delete = function(e) {
|
|
2895
2895
|
var t = this;
|
|
2896
2896
|
e === void 0 && (e = { disableAutoOpen: !0 });
|
|
@@ -2900,12 +2900,12 @@ var Rr = { exports: {} };
|
|
|
2900
2900
|
t.close(e);
|
|
2901
2901
|
var c = t._deps.indexedDB.deleteDatabase(t.name);
|
|
2902
2902
|
c.onsuccess = J(function() {
|
|
2903
|
-
var g,
|
|
2904
|
-
g = t._deps,
|
|
2903
|
+
var g, d, v;
|
|
2904
|
+
g = t._deps, d = t.name, v = g.indexedDB, g = g.IDBKeyRange, On(v) || d === Ct || En(v, g).delete(d).catch(Y), o();
|
|
2905
2905
|
}), c.onerror = ye(a), c.onblocked = t._fireOnBlocked;
|
|
2906
2906
|
}
|
|
2907
2907
|
if (n)
|
|
2908
|
-
throw new
|
|
2908
|
+
throw new L.InvalidArgument("Arguments not allowed in db.delete()");
|
|
2909
2909
|
r.isBeingOpened ? r.dbReadyPromise.then(s) : s();
|
|
2910
2910
|
});
|
|
2911
2911
|
}, ee.prototype.backendDB = function() {
|
|
@@ -2928,102 +2928,102 @@ var Rr = { exports: {} };
|
|
|
2928
2928
|
var e = (function(t, n, r) {
|
|
2929
2929
|
var o = arguments.length;
|
|
2930
2930
|
if (o < 2)
|
|
2931
|
-
throw new
|
|
2931
|
+
throw new L.InvalidArgument("Too few arguments");
|
|
2932
2932
|
for (var a = new Array(o - 1); --o; )
|
|
2933
2933
|
a[o - 1] = arguments[o];
|
|
2934
2934
|
return r = a.pop(), [t, Xn(a), r];
|
|
2935
2935
|
}).apply(this, arguments);
|
|
2936
2936
|
return this._transaction.apply(this, e);
|
|
2937
2937
|
}, ee.prototype._transaction = function(e, t, n) {
|
|
2938
|
-
var r = this, o =
|
|
2938
|
+
var r = this, o = N.trans;
|
|
2939
2939
|
o && o.db === this && e.indexOf("!") === -1 || (o = null);
|
|
2940
2940
|
var a, s, c = e.indexOf("?") !== -1;
|
|
2941
2941
|
e = e.replace("!", "").replace("?", "");
|
|
2942
2942
|
try {
|
|
2943
|
-
if (s = t.map(function(
|
|
2944
|
-
if (
|
|
2943
|
+
if (s = t.map(function(d) {
|
|
2944
|
+
if (d = d instanceof r.Table ? d.name : d, typeof d != "string")
|
|
2945
2945
|
throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");
|
|
2946
|
-
return
|
|
2946
|
+
return d;
|
|
2947
2947
|
}), e == "r" || e === fn)
|
|
2948
2948
|
a = fn;
|
|
2949
2949
|
else {
|
|
2950
2950
|
if (e != "rw" && e != dn)
|
|
2951
|
-
throw new
|
|
2951
|
+
throw new L.InvalidArgument("Invalid transaction mode: " + e);
|
|
2952
2952
|
a = dn;
|
|
2953
2953
|
}
|
|
2954
2954
|
if (o) {
|
|
2955
2955
|
if (o.mode === fn && a === dn) {
|
|
2956
2956
|
if (!c)
|
|
2957
|
-
throw new
|
|
2957
|
+
throw new L.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
2958
2958
|
o = null;
|
|
2959
2959
|
}
|
|
2960
|
-
o && s.forEach(function(
|
|
2961
|
-
if (o && o.storeNames.indexOf(
|
|
2960
|
+
o && s.forEach(function(d) {
|
|
2961
|
+
if (o && o.storeNames.indexOf(d) === -1) {
|
|
2962
2962
|
if (!c)
|
|
2963
|
-
throw new
|
|
2963
|
+
throw new L.SubTransaction("Table " + d + " not included in parent transaction.");
|
|
2964
2964
|
o = null;
|
|
2965
2965
|
}
|
|
2966
2966
|
}), c && o && !o.active && (o = null);
|
|
2967
2967
|
}
|
|
2968
|
-
} catch (
|
|
2968
|
+
} catch (d) {
|
|
2969
2969
|
return o ? o._promise(null, function(v, l) {
|
|
2970
|
-
l(
|
|
2971
|
-
}) : q(
|
|
2970
|
+
l(d);
|
|
2971
|
+
}) : q(d);
|
|
2972
2972
|
}
|
|
2973
|
-
var g = (function
|
|
2973
|
+
var g = (function d(v, l, h, y, b) {
|
|
2974
2974
|
return M.resolve().then(function() {
|
|
2975
|
-
var w =
|
|
2975
|
+
var w = N.transless || N, m = v._createTransaction(l, h, v._dbSchema, y);
|
|
2976
2976
|
if (m.explicit = !0, w = { trans: m, transless: w }, y)
|
|
2977
2977
|
m.idbtrans = y.idbtrans;
|
|
2978
2978
|
else
|
|
2979
2979
|
try {
|
|
2980
2980
|
m.create(), m.idbtrans._explicit = !0, v._state.PR1398_maxLoop = 3;
|
|
2981
|
-
} catch (
|
|
2982
|
-
return
|
|
2983
|
-
return
|
|
2984
|
-
})) : q(
|
|
2981
|
+
} catch (O) {
|
|
2982
|
+
return O.name === en.InvalidState && v.isOpen() && 0 < --v._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), v.close({ disableAutoOpen: !1 }), v.open().then(function() {
|
|
2983
|
+
return d(v, l, h, null, b);
|
|
2984
|
+
})) : q(O);
|
|
2985
2985
|
}
|
|
2986
2986
|
var _, S = qt(b);
|
|
2987
2987
|
return S && Je(), w = M.follow(function() {
|
|
2988
|
-
var
|
|
2989
|
-
(_ = b.call(m, m)) && (S ? (
|
|
2990
|
-
}, w), (_ && typeof _.then == "function" ? M.resolve(_).then(function(
|
|
2991
|
-
return m.active ?
|
|
2988
|
+
var O;
|
|
2989
|
+
(_ = b.call(m, m)) && (S ? (O = Ie.bind(null, null), _.then(O, O)) : typeof _.next == "function" && typeof _.throw == "function" && (_ = Rn(_)));
|
|
2990
|
+
}, w), (_ && typeof _.then == "function" ? M.resolve(_).then(function(O) {
|
|
2991
|
+
return m.active ? O : q(new L.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
2992
2992
|
}) : w.then(function() {
|
|
2993
2993
|
return _;
|
|
2994
|
-
})).then(function(
|
|
2994
|
+
})).then(function(O) {
|
|
2995
2995
|
return y && m._resolve(), m._completion.then(function() {
|
|
2996
|
-
return
|
|
2996
|
+
return O;
|
|
2997
2997
|
});
|
|
2998
|
-
}).catch(function(
|
|
2999
|
-
return m._reject(
|
|
2998
|
+
}).catch(function(O) {
|
|
2999
|
+
return m._reject(O), q(O);
|
|
3000
3000
|
});
|
|
3001
3001
|
});
|
|
3002
3002
|
}).bind(null, this, a, s, o, n);
|
|
3003
|
-
return o ? o._promise(a, g, "lock") :
|
|
3003
|
+
return o ? o._promise(a, g, "lock") : N.trans ? Ge(N.transless, function() {
|
|
3004
3004
|
return r._whenReady(g);
|
|
3005
3005
|
}) : this._whenReady(g);
|
|
3006
3006
|
}, ee.prototype.table = function(e) {
|
|
3007
3007
|
if (!ie(this._allTables, e))
|
|
3008
|
-
throw new
|
|
3008
|
+
throw new L.InvalidTable("Table ".concat(e, " does not exist"));
|
|
3009
3009
|
return this._allTables[e];
|
|
3010
3010
|
}, ee);
|
|
3011
3011
|
function ee(e, t) {
|
|
3012
3012
|
var n = this;
|
|
3013
3013
|
this._middlewares = {}, this.verno = 0;
|
|
3014
3014
|
var r = ee.dependencies;
|
|
3015
|
-
this._options = t =
|
|
3016
|
-
var o, a, s, c, g,
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
}),
|
|
3020
|
-
|
|
3021
|
-
}), this._state =
|
|
3022
|
-
return function(
|
|
3015
|
+
this._options = t = f({ 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;
|
|
3016
|
+
var o, a, s, c, g, d = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: Y, dbReadyPromise: null, cancelOpen: Y, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
|
|
3017
|
+
d.dbReadyPromise = new M(function(l) {
|
|
3018
|
+
d.dbReadyResolve = l;
|
|
3019
|
+
}), d.openCanceller = new M(function(l, h) {
|
|
3020
|
+
d.cancelOpen = h;
|
|
3021
|
+
}), this._state = d, this.name = e, this.on = ft(this, "populate", "blocked", "versionchange", "close", { ready: [tn, Y] }), this.on.ready.subscribe = Hn(this.on.ready.subscribe, function(l) {
|
|
3022
|
+
return function(h, y) {
|
|
3023
3023
|
ee.vip(function() {
|
|
3024
3024
|
var b, w = n._state;
|
|
3025
|
-
w.openComplete ? (w.dbOpenError || M.resolve().then(
|
|
3026
|
-
b.on.ready.unsubscribe(
|
|
3025
|
+
w.openComplete ? (w.dbOpenError || M.resolve().then(h), y && l(h)) : w.onReadyBeingFired ? (w.onReadyBeingFired.push(h), y && l(h)) : (l(h), b = n, y || l(function m() {
|
|
3026
|
+
b.on.ready.unsubscribe(h), b.on.ready.unsubscribe(m);
|
|
3027
3027
|
}));
|
|
3028
3028
|
});
|
|
3029
3029
|
};
|
|
@@ -3038,11 +3038,11 @@ var Rr = { exports: {} };
|
|
|
3038
3038
|
}
|
|
3039
3039
|
var w = _._ctx, m = w.table, _ = m.hook.reading.fire;
|
|
3040
3040
|
this._ctx = { table: m, index: w.index, isPrimKey: !w.index || m.schema.primKey.keyPath && w.index === m.schema.primKey.name, range: y, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: b, or: w.or, valueMapper: _ !== ot ? _ : null };
|
|
3041
|
-
})), this.Table = (a = this, dt(lr.prototype, function(l,
|
|
3042
|
-
this.db = a, this._tx = y, this.name = l, this.schema =
|
|
3043
|
-
})), this.Transaction = (s = this, dt(ai.prototype, function(l,
|
|
3041
|
+
})), this.Table = (a = this, dt(lr.prototype, function(l, h, y) {
|
|
3042
|
+
this.db = a, this._tx = y, this.name = l, this.schema = h, this.hook = a._allTables[l] ? a._allTables[l].hook : ft(null, { creating: [Qr, Y], reading: [Yr, ot], updating: [Vr, Y], deleting: [Xr, Y] });
|
|
3043
|
+
})), this.Transaction = (s = this, dt(ai.prototype, function(l, h, y, b, w) {
|
|
3044
3044
|
var m = this;
|
|
3045
|
-
this.db = s, this.mode = l, this.storeNames =
|
|
3045
|
+
this.db = s, this.mode = l, this.storeNames = h, this.schema = y, this.chromeTransactionDurability = b, this.idbtrans = null, this.on = ft(this, "complete", "error", "abort"), this.parent = w || 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 M(function(_, S) {
|
|
3046
3046
|
m._resolve = _, m._reject = S;
|
|
3047
3047
|
}), this._completion.then(function() {
|
|
3048
3048
|
m.active = !1, m.on.complete.fire();
|
|
@@ -3052,47 +3052,47 @@ var Rr = { exports: {} };
|
|
|
3052
3052
|
});
|
|
3053
3053
|
})), this.Version = (c = this, dt(hi.prototype, function(l) {
|
|
3054
3054
|
this.db = c, this._cfg = { version: l, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
3055
|
-
})), this.WhereClause = (g = this, dt(pr.prototype, function(l,
|
|
3056
|
-
if (this.db = g, this._ctx = { table: l, index:
|
|
3055
|
+
})), this.WhereClause = (g = this, dt(pr.prototype, function(l, h, y) {
|
|
3056
|
+
if (this.db = g, this._ctx = { table: l, index: h === ":id" ? null : h, or: y }, this._cmp = this._ascending = z, this._descending = function(b, w) {
|
|
3057
3057
|
return z(w, b);
|
|
3058
3058
|
}, this._max = function(b, w) {
|
|
3059
3059
|
return 0 < z(b, w) ? b : w;
|
|
3060
3060
|
}, this._min = function(b, w) {
|
|
3061
3061
|
return z(b, w) < 0 ? b : w;
|
|
3062
3062
|
}, this._IDBKeyRange = g._deps.IDBKeyRange, !this._IDBKeyRange)
|
|
3063
|
-
throw new
|
|
3063
|
+
throw new L.MissingAPI();
|
|
3064
3064
|
})), this.on("versionchange", function(l) {
|
|
3065
3065
|
0 < l.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 });
|
|
3066
3066
|
}), this.on("blocked", function(l) {
|
|
3067
3067
|
!l.newVersion || l.newVersion < l.oldVersion ? console.warn("Dexie.delete('".concat(n.name, "') was blocked")) : console.warn("Upgrade '".concat(n.name, "' blocked by other connection holding version ").concat(l.oldVersion / 10));
|
|
3068
|
-
}), this._maxKey = gt(t.IDBKeyRange), this._createTransaction = function(l,
|
|
3069
|
-
return new n.Transaction(l,
|
|
3068
|
+
}), this._maxKey = gt(t.IDBKeyRange), this._createTransaction = function(l, h, y, b) {
|
|
3069
|
+
return new n.Transaction(l, h, y, n._options.chromeTransactionDurability, b);
|
|
3070
3070
|
}, this._fireOnBlocked = function(l) {
|
|
3071
|
-
n.on("blocked").fire(l), Ze.filter(function(
|
|
3072
|
-
return
|
|
3073
|
-
}).map(function(
|
|
3074
|
-
return
|
|
3071
|
+
n.on("blocked").fire(l), Ze.filter(function(h) {
|
|
3072
|
+
return h.name === n.name && h !== n && !h._state.vcFired;
|
|
3073
|
+
}).map(function(h) {
|
|
3074
|
+
return h.on("versionchange").fire(l);
|
|
3075
3075
|
});
|
|
3076
3076
|
}, this.use(mi), this.use(_i), this.use(bi), this.use(gi), this.use(yi);
|
|
3077
|
-
var v = new Proxy(this, { get: function(l,
|
|
3078
|
-
if (
|
|
3077
|
+
var v = new Proxy(this, { get: function(l, h, y) {
|
|
3078
|
+
if (h === "_vip")
|
|
3079
3079
|
return !0;
|
|
3080
|
-
if (
|
|
3080
|
+
if (h === "table")
|
|
3081
3081
|
return function(w) {
|
|
3082
|
-
return
|
|
3082
|
+
return Ht(n.table(w), v);
|
|
3083
3083
|
};
|
|
3084
|
-
var b = Reflect.get(l,
|
|
3085
|
-
return b instanceof lr ?
|
|
3086
|
-
return
|
|
3087
|
-
}) :
|
|
3088
|
-
return
|
|
3084
|
+
var b = Reflect.get(l, h, y);
|
|
3085
|
+
return b instanceof lr ? Ht(b, v) : h === "tables" ? b.map(function(w) {
|
|
3086
|
+
return Ht(w, v);
|
|
3087
|
+
}) : h === "_createTransaction" ? function() {
|
|
3088
|
+
return Ht(b.apply(this, arguments), v);
|
|
3089
3089
|
} : b;
|
|
3090
3090
|
} });
|
|
3091
3091
|
this.vip = v, r.forEach(function(l) {
|
|
3092
3092
|
return l(n);
|
|
3093
3093
|
});
|
|
3094
3094
|
}
|
|
3095
|
-
var
|
|
3095
|
+
var Yt, de = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable", Si = (Kn.prototype.subscribe = function(e, t, n) {
|
|
3096
3096
|
return this._subscribe(e && typeof e != "function" ? e : { next: e, error: t, complete: n });
|
|
3097
3097
|
}, Kn.prototype[de] = function() {
|
|
3098
3098
|
return this;
|
|
@@ -3101,40 +3101,40 @@ var Rr = { exports: {} };
|
|
|
3101
3101
|
this._subscribe = e;
|
|
3102
3102
|
}
|
|
3103
3103
|
try {
|
|
3104
|
-
|
|
3104
|
+
Yt = { indexedDB: C.indexedDB || C.mozIndexedDB || C.webkitIndexedDB || C.msIndexedDB, IDBKeyRange: C.IDBKeyRange || C.webkitIDBKeyRange };
|
|
3105
3105
|
} catch {
|
|
3106
|
-
|
|
3106
|
+
Yt = { indexedDB: null, IDBKeyRange: null };
|
|
3107
3107
|
}
|
|
3108
3108
|
function Dr(e) {
|
|
3109
3109
|
var t, n = !1, r = new Si(function(o) {
|
|
3110
|
-
var a = qt(e), s, c = !1, g = {},
|
|
3110
|
+
var a = qt(e), s, c = !1, g = {}, d = {}, v = { get closed() {
|
|
3111
3111
|
return c;
|
|
3112
3112
|
}, unsubscribe: function() {
|
|
3113
3113
|
c || (c = !0, s && s.abort(), l && Te.storagemutated.unsubscribe(y));
|
|
3114
3114
|
} };
|
|
3115
3115
|
o.start && o.start(v);
|
|
3116
|
-
var l = !1,
|
|
3116
|
+
var l = !1, h = function() {
|
|
3117
3117
|
return ln(b);
|
|
3118
3118
|
}, y = function(w) {
|
|
3119
|
-
Ut(g, w), Dn(
|
|
3119
|
+
Ut(g, w), Dn(d, g) && h();
|
|
3120
3120
|
}, b = function() {
|
|
3121
3121
|
var w, m, _;
|
|
3122
|
-
!c &&
|
|
3123
|
-
var
|
|
3122
|
+
!c && Yt.indexedDB && (g = {}, w = {}, s && s.abort(), s = new AbortController(), _ = function(S) {
|
|
3123
|
+
var O = Xe();
|
|
3124
3124
|
try {
|
|
3125
3125
|
a && Je();
|
|
3126
|
-
var
|
|
3127
|
-
return
|
|
3126
|
+
var x = Pe(e, S);
|
|
3127
|
+
return x = a ? x.finally(Ie) : x;
|
|
3128
3128
|
} finally {
|
|
3129
|
-
|
|
3129
|
+
O && Ve();
|
|
3130
3130
|
}
|
|
3131
|
-
}(m = { subscr: w, signal: s.signal, requery:
|
|
3132
|
-
n = !0, t = S, c || m.signal.aborted || (g = {}, function(
|
|
3133
|
-
for (var
|
|
3134
|
-
if (ie(
|
|
3131
|
+
}(m = { subscr: w, signal: s.signal, requery: h, querier: e, trans: null }), Promise.resolve(_).then(function(S) {
|
|
3132
|
+
n = !0, t = S, c || m.signal.aborted || (g = {}, function(O) {
|
|
3133
|
+
for (var x in O)
|
|
3134
|
+
if (ie(O, x))
|
|
3135
3135
|
return;
|
|
3136
3136
|
return 1;
|
|
3137
|
-
}(
|
|
3137
|
+
}(d = w) || l || (Te(pt, y), l = !0), ln(function() {
|
|
3138
3138
|
return !c && o.next && o.next(S);
|
|
3139
3139
|
}));
|
|
3140
3140
|
}, function(S) {
|
|
@@ -3143,7 +3143,7 @@ var Rr = { exports: {} };
|
|
|
3143
3143
|
});
|
|
3144
3144
|
}));
|
|
3145
3145
|
};
|
|
3146
|
-
return setTimeout(
|
|
3146
|
+
return setTimeout(h, 0), v;
|
|
3147
3147
|
});
|
|
3148
3148
|
return r.hasValue = function() {
|
|
3149
3149
|
return n;
|
|
@@ -3152,15 +3152,15 @@ var Rr = { exports: {} };
|
|
|
3152
3152
|
}, r;
|
|
3153
3153
|
}
|
|
3154
3154
|
var Ue = Se;
|
|
3155
|
-
function
|
|
3155
|
+
function Nn(e) {
|
|
3156
3156
|
var t = Me;
|
|
3157
3157
|
try {
|
|
3158
|
-
Me = !0, Te.storagemutated.fire(e),
|
|
3158
|
+
Me = !0, Te.storagemutated.fire(e), Cn(e, !0);
|
|
3159
3159
|
} finally {
|
|
3160
3160
|
Me = t;
|
|
3161
3161
|
}
|
|
3162
3162
|
}
|
|
3163
|
-
xe(Ue,
|
|
3163
|
+
xe(Ue, f(f({}, St), { delete: function(e) {
|
|
3164
3164
|
return new Ue(e, { addons: [] }).delete();
|
|
3165
3165
|
}, exists: function(e) {
|
|
3166
3166
|
return new Ue(e, { addons: [] }).open().then(function(t) {
|
|
@@ -3174,11 +3174,11 @@ var Rr = { exports: {} };
|
|
|
3174
3174
|
return r.map(function(o) {
|
|
3175
3175
|
return o.name;
|
|
3176
3176
|
}).filter(function(o) {
|
|
3177
|
-
return o !==
|
|
3177
|
+
return o !== Ct;
|
|
3178
3178
|
});
|
|
3179
3179
|
}) : En(n, t).toCollection().primaryKeys()).then(e);
|
|
3180
3180
|
} catch {
|
|
3181
|
-
return q(new
|
|
3181
|
+
return q(new L.MissingAPI());
|
|
3182
3182
|
}
|
|
3183
3183
|
var t, n;
|
|
3184
3184
|
}, defineClass: function() {
|
|
@@ -3186,7 +3186,7 @@ var Rr = { exports: {} };
|
|
|
3186
3186
|
Z(this, e);
|
|
3187
3187
|
};
|
|
3188
3188
|
}, ignoreTransaction: function(e) {
|
|
3189
|
-
return
|
|
3189
|
+
return N.trans ? Ge(N.transless, e) : e();
|
|
3190
3190
|
}, vip: xn, async: function(e) {
|
|
3191
3191
|
return function() {
|
|
3192
3192
|
try {
|
|
@@ -3204,31 +3204,31 @@ var Rr = { exports: {} };
|
|
|
3204
3204
|
return q(o);
|
|
3205
3205
|
}
|
|
3206
3206
|
}, currentTransaction: { get: function() {
|
|
3207
|
-
return
|
|
3207
|
+
return N.trans || null;
|
|
3208
3208
|
} }, waitFor: function(e, t) {
|
|
3209
|
-
return t = M.resolve(typeof e == "function" ? Ue.ignoreTransaction(e) : e).timeout(t || 6e4),
|
|
3209
|
+
return t = M.resolve(typeof e == "function" ? Ue.ignoreTransaction(e) : e).timeout(t || 6e4), N.trans ? N.trans.waitFor(t) : t;
|
|
3210
3210
|
}, Promise: M, debug: { get: function() {
|
|
3211
3211
|
return pe;
|
|
3212
3212
|
}, set: function(e) {
|
|
3213
3213
|
qn(e);
|
|
3214
|
-
} }, derive: ze, extend: Z, props: xe, override:
|
|
3214
|
+
} }, derive: ze, extend: Z, props: xe, override: Hn, Events: ft, on: Te, liveQuery: Dr, extendObservabilitySet: Ut, getByKeyPath: ve, setByKeyPath: fe, delByKeyPath: function(e, t) {
|
|
3215
3215
|
typeof t == "string" ? fe(e, t, void 0) : "length" in t && [].map.call(t, function(n) {
|
|
3216
3216
|
fe(e, n, void 0);
|
|
3217
3217
|
});
|
|
3218
|
-
}, shallowClone: Qn, deepClone: Ae, getObjectDiff: Tn, cmp: z, asap:
|
|
3218
|
+
}, shallowClone: Qn, deepClone: Ae, getObjectDiff: Tn, cmp: z, asap: Yn, minKey: -1 / 0, addons: [], connections: Ze, errnames: en, dependencies: Yt, cache: $e, semVer: ge, version: ge.split(".").map(function(e) {
|
|
3219
3219
|
return parseInt(e);
|
|
3220
3220
|
}).reduce(function(e, t, n) {
|
|
3221
3221
|
return e + t / Math.pow(10, 2 * n);
|
|
3222
3222
|
}) })), Ue.maxKey = gt(Ue.dependencies.IDBKeyRange), typeof dispatchEvent < "u" && typeof addEventListener < "u" && (Te(pt, function(e) {
|
|
3223
3223
|
Me || (e = new CustomEvent(yn, { detail: e }), Me = !0, dispatchEvent(e), Me = !1);
|
|
3224
3224
|
}), addEventListener(yn, function(e) {
|
|
3225
|
-
e = e.detail, Me ||
|
|
3225
|
+
e = e.detail, Me || Nn(e);
|
|
3226
3226
|
}));
|
|
3227
3227
|
var tt, Me = !1, Pr = function() {
|
|
3228
3228
|
};
|
|
3229
3229
|
return typeof BroadcastChannel < "u" && ((Pr = function() {
|
|
3230
3230
|
(tt = new BroadcastChannel(yn)).onmessage = function(e) {
|
|
3231
|
-
return e.data &&
|
|
3231
|
+
return e.data && Nn(e.data);
|
|
3232
3232
|
};
|
|
3233
3233
|
})(), typeof tt.unref == "function" && tt.unref(), Te(pt, function(e) {
|
|
3234
3234
|
Me || tt.postMessage(e);
|
|
@@ -3239,19 +3239,19 @@ var Rr = { exports: {} };
|
|
|
3239
3239
|
n[t].close({ disableAutoOpen: !1 });
|
|
3240
3240
|
}
|
|
3241
3241
|
}), addEventListener("pageshow", function(e) {
|
|
3242
|
-
!Se.disableBfCache && e.persisted && (pe && console.debug("Dexie: handling persisted pageshow"), Pr(),
|
|
3242
|
+
!Se.disableBfCache && e.persisted && (pe && console.debug("Dexie: handling persisted pageshow"), Pr(), Nn({ all: new oe(-1 / 0, [[]]) }));
|
|
3243
3243
|
})), M.rejectionMapper = function(e, t) {
|
|
3244
|
-
return !e || e instanceof
|
|
3244
|
+
return !e || e instanceof Ye || 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() {
|
|
3245
3245
|
return this.inner.stack;
|
|
3246
3246
|
} }), t);
|
|
3247
|
-
}, qn(pe),
|
|
3247
|
+
}, qn(pe), f(Se, Object.freeze({ __proto__: null, Dexie: Se, liveQuery: Dr, Entity: sr, cmp: z, default: Se, RangeSet: oe, mergeRanges: bt, rangesOverlap: $t }), { default: Se }), Se;
|
|
3248
3248
|
});
|
|
3249
3249
|
})(Rr);
|
|
3250
3250
|
var Di = Rr.exports;
|
|
3251
|
-
const $n = /* @__PURE__ */ Ai(Di),
|
|
3251
|
+
const $n = /* @__PURE__ */ Ai(Di), Cr = Symbol.for("Dexie"), Un = globalThis[Cr] || (globalThis[Cr] = $n);
|
|
3252
3252
|
if ($n.semVer !== Un.semVer)
|
|
3253
3253
|
throw new Error(`Two different versions of Dexie loaded in the same app: ${$n.semVer} and ${Un.semVer}`);
|
|
3254
|
-
var j = /* @__PURE__ */ ((p) => (p.MESSAGES = "messages", p.CLOUD = "cloud", p.SERIES = "series", p.TOPICS = "topics", p.WIDGET = "widget", p.WIDGETS = "widgets", p))(j || {}),
|
|
3254
|
+
var j = /* @__PURE__ */ ((p) => (p.MESSAGES = "messages", p.CLOUD = "cloud", p.SERIES = "series", p.TOPICS = "topics", p.WIDGET = "widget", p.WIDGETS = "widgets", p))(j || {}), E = /* @__PURE__ */ ((p) => (p.API = "color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;", p.APP = "color:white;background-color:navy;padding:0 4px 0 4px;border-radius:5px;", p.BROADCAST = "color:white;background-color:orange;padding:0 4px 0 4px;border-radius:5px;", p.DATA = "color:grey;background-color:lightskyblue;padding:0 4px 0 4px;border-radius:5px;", p.CLOUD = "color:grey;background-color:mistyrose;padding:0 4px 0 4px;border-radius:5px;", p.GET_DATA = "color:black;background-color:lime;padding:0 4px 0 4px;border-radius:5px;", p.HIDE = "color:white;background-color:red;padding:0 4px 0 4px;border-radius:5px;", p.MESSAGES = "color:grey;background-color:tan;padding:0 4px 0 4px;border-radius:5px;", p.NO_UPDATES = "color:grey;border:1px solid grey;padding:0 4px 0 4px;border-radius:5px;", p.NONE = "color:transparent;background-color:transparent;", p.PRESENTATION = "color:white;background-color:darkred;padding:0 4px 0 4px;border-radius:5px;", p.SERIES = "color:grey;background-color:thistle;padding:0 4px 0 4px;border-radius:5px;", p.SLIDE = "color:black;background-color:yellow;padding:0 4px 0 4px;border-radius:5px;", p.STORAGE = "color:black;background-color:cyan;padding:0 4px 0 4px;border-radius:5px;", p.SUBSCRIBE = "color:white;background-color:dodgerblue;padding:0 4px 0 4px;border-radius:5px;", p.WIDGET = "color:gret;background-color:lemonchiffon;padding:0 4px 0 4px;border-radius:5px;", p.WS = "color:white;background-color:green;padding:0 4px 0 4px;border-radius:5px;", p))(E || {}), se = /* @__PURE__ */ ((p) => (p.ADD_SLIDE = "addSlide", p.APP_READY = "appReady", p.API_UPDATE = "apiUpdate", p.APPROVE_MESSAGE = "approveMessage", p.CHANNEL = "channel", p.CLOSE_MODAL = "closeModal", p.ERROR = "error", p.GOTO_SLIDE = "gotoSlide", p.HIDE_MESSAGE = "hideMessage", p.HIDE_LABELS = "hideLabels", p.NEXT_SLIDE = "nextSlide", p.PAUSE_PRESENTATION = "pausePresentation", p.PRESENTATION_READY = "presentationReady", p.PREV_SLIDE = "prevSlide", p.RELOAD_PRESENTATION = "reloadPresentation", p.SHOW_MODAL = "showModal", p.STAR_MESSAGE = "starMessage", p.SLIDE_DID_LOAD = "slideDidLoad", p.SLIDE_GOTO = "slideGoto", p.SLIDE_READY = "slideReady", p.SLIDE_TRANSITIONER = "slideTransitioner", p.START_TRANSITIONER = "startTransitioner", p.STORAGE_INIT = "stroageInit", p.SUBSCRIBE = "subscribe", p.REMOVE_CLOUD = "removeCloud", p.UPDATE = "update", p.VERSION = "version", p.WIDGET_UPDATE = "widgetUpdate", p))(se || {}), Vt = /* @__PURE__ */ ((p) => (p.APPROVED = "approved", p.BEFORE = "before", p.DELAYED = "delayed", p.NONE = "none", p.REALTIME = "realtime", p))(Vt || {}), he = /* @__PURE__ */ ((p) => (p.KEYVAL = "keyval", p.LOCAL = "local", p.SESSION = "session", p.DEXIE = "dexie", p.WINDOW = "window", p))(he || {});
|
|
3255
3255
|
function V(p) {
|
|
3256
3256
|
let i = `${p.type}.${p.topics}`;
|
|
3257
3257
|
return p.order && (i += `.${p.order}`), p.period && (i += `.${p.period}`), i;
|
|
@@ -3265,11 +3265,11 @@ function nt(p) {
|
|
|
3265
3265
|
return p.topics === void 0 && (p.topics = `${p.dashboard}-${p.widget}`), p;
|
|
3266
3266
|
}
|
|
3267
3267
|
function vt(p, i) {
|
|
3268
|
-
var
|
|
3269
|
-
let u,
|
|
3268
|
+
var B;
|
|
3269
|
+
let u, f, k, C, K;
|
|
3270
3270
|
switch (p.moderation) {
|
|
3271
3271
|
case Vt.BEFORE:
|
|
3272
|
-
u = /* @__PURE__ */ new Date(),
|
|
3272
|
+
u = /* @__PURE__ */ new Date(), f = (B = p.beforeTime) == null ? void 0 : B.split(":"), k = Number.parseInt(f ? f[0] : "00"), C = Number.parseInt(f ? f[1] : "00"), K = Number.parseInt(f ? f[2] : "00"), i.before = u.setHours(k, C, K, 0) / 1e3, i.period || (i.period = u.getDay() === 1 ? 72 : 24);
|
|
3273
3273
|
break;
|
|
3274
3274
|
case Vt.DELAYED:
|
|
3275
3275
|
p.delay && p.delay > 0 && (i.delay = `${p.delay}`);
|
|
@@ -3296,9 +3296,9 @@ class Tr {
|
|
|
3296
3296
|
const u = await this.db.table(j.CLOUD).where({ id: i.widget }).last().catch(() => {
|
|
3297
3297
|
console.warn(
|
|
3298
3298
|
"%capi%C %ccloud",
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3299
|
+
E.API,
|
|
3300
|
+
E.NONE,
|
|
3301
|
+
E.CLOUD,
|
|
3302
3302
|
i.slide,
|
|
3303
3303
|
i.widget
|
|
3304
3304
|
);
|
|
@@ -3314,9 +3314,9 @@ class Tr {
|
|
|
3314
3314
|
const u = await this.db.table(j.SERIES).where({ id: i.widget }).last().catch(() => {
|
|
3315
3315
|
console.warn(
|
|
3316
3316
|
"%capi%c %cseries",
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3317
|
+
E.API,
|
|
3318
|
+
E.NONE,
|
|
3319
|
+
E.SERIES,
|
|
3320
3320
|
i.slide,
|
|
3321
3321
|
i.widget
|
|
3322
3322
|
);
|
|
@@ -3329,23 +3329,23 @@ class Tr {
|
|
|
3329
3329
|
* @returns IResponse
|
|
3330
3330
|
*/
|
|
3331
3331
|
P(this, "getMessages", async (i) => {
|
|
3332
|
-
const u = (
|
|
3332
|
+
const u = (C) => C.widget_id === i.widget, f = (C) => C.utc > ((i == null ? void 0 : i.since) || 0), k = (C) => (C == null ? void 0 : C.visible) !== 0;
|
|
3333
3333
|
try {
|
|
3334
|
-
const
|
|
3334
|
+
const C = await this.db.table(j.TOPICS).orderBy("utc").reverse().filter(u).filter(f).filter(k).limit((i == null ? void 0 : i.limit) ?? 25).toArray().catch(() => {
|
|
3335
3335
|
console.warn(
|
|
3336
3336
|
"%capi%c %cmessages",
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3337
|
+
E.API,
|
|
3338
|
+
E.NONE,
|
|
3339
|
+
E.MESSAGES,
|
|
3340
3340
|
i.slide,
|
|
3341
3341
|
i.widget
|
|
3342
3342
|
);
|
|
3343
3343
|
});
|
|
3344
|
-
if (
|
|
3344
|
+
if (C.length === 0)
|
|
3345
3345
|
return { data: null, message: "No Messages error", success: !1 };
|
|
3346
|
-
const K =
|
|
3346
|
+
const K = C[0] ? C[0].title : "No title", B = C.map(
|
|
3347
3347
|
(be) => be.message_id
|
|
3348
|
-
), te = (await this.db.table(j.MESSAGES).where("id").anyOf(
|
|
3348
|
+
), te = (await this.db.table(j.MESSAGES).where("id").anyOf(B).toArray().then((be) => be.sort((ie, xe) => xe.utc - ie.utc))).map(
|
|
3349
3349
|
(be) => be.data
|
|
3350
3350
|
);
|
|
3351
3351
|
return {
|
|
@@ -3374,7 +3374,7 @@ class Tr {
|
|
|
3374
3374
|
id: i.widget,
|
|
3375
3375
|
dashboard_id: i.dashboard,
|
|
3376
3376
|
data: u.data
|
|
3377
|
-
}).then(() => 201).catch((
|
|
3377
|
+
}).then(() => 201).catch((f) => (console.error("%cstorage", E.STORAGE, "set", i, f), 400)) : 400);
|
|
3378
3378
|
/**
|
|
3379
3379
|
* Update Series
|
|
3380
3380
|
* @param query IQuery
|
|
@@ -3385,7 +3385,7 @@ class Tr {
|
|
|
3385
3385
|
id: i.widget,
|
|
3386
3386
|
dashboard_id: i.dashboard,
|
|
3387
3387
|
data: u.data
|
|
3388
|
-
}).then(() => 201).catch((
|
|
3388
|
+
}).then(() => 201).catch((f) => (console.error("%cstorage", E.STORAGE, "set", i, f), 400)) : 400);
|
|
3389
3389
|
/**
|
|
3390
3390
|
* Update Messages
|
|
3391
3391
|
* @param query IQuery
|
|
@@ -3398,24 +3398,24 @@ class Tr {
|
|
|
3398
3398
|
P(this, "setMessages", async (i, u) => {
|
|
3399
3399
|
if (i.type !== j.MESSAGES)
|
|
3400
3400
|
return 400;
|
|
3401
|
-
const
|
|
3401
|
+
const f = u.title;
|
|
3402
3402
|
try {
|
|
3403
|
-
return u.data.messages.forEach(async (
|
|
3404
|
-
var
|
|
3405
|
-
await this.db.table(j.MESSAGES).put({ id:
|
|
3403
|
+
return u.data.messages.forEach(async (k) => {
|
|
3404
|
+
var C, K, B;
|
|
3405
|
+
await this.db.table(j.MESSAGES).put({ id: k.id, utc: k.utc, data: k }), await this.db.table(j.TOPICS).put({
|
|
3406
3406
|
widget_id: i.widget,
|
|
3407
|
-
message_id:
|
|
3407
|
+
message_id: k.id,
|
|
3408
3408
|
dashboard_id: i.dashboard,
|
|
3409
|
-
title:
|
|
3410
|
-
engagement: (
|
|
3411
|
-
impressions: (K =
|
|
3412
|
-
reach: (
|
|
3413
|
-
sentiment:
|
|
3414
|
-
utc:
|
|
3409
|
+
title: f,
|
|
3410
|
+
engagement: (C = k.dynamics) == null ? void 0 : C.engagement,
|
|
3411
|
+
impressions: (K = k.dynamics) == null ? void 0 : K.semrush_visits,
|
|
3412
|
+
reach: (B = k.dynamics) == null ? void 0 : B.potential_reach,
|
|
3413
|
+
sentiment: k.topics[0].sentiment,
|
|
3414
|
+
utc: k.utc
|
|
3415
3415
|
});
|
|
3416
3416
|
}), 201;
|
|
3417
|
-
} catch (
|
|
3418
|
-
return console.error("%cstorage",
|
|
3417
|
+
} catch (k) {
|
|
3418
|
+
return console.error("%cstorage", E.STORAGE, "set", i, k), 400;
|
|
3419
3419
|
}
|
|
3420
3420
|
});
|
|
3421
3421
|
/**
|
|
@@ -3423,15 +3423,33 @@ class Tr {
|
|
|
3423
3423
|
* @param retentionDuration
|
|
3424
3424
|
*/
|
|
3425
3425
|
P(this, "cleanMessages", async (i) => {
|
|
3426
|
-
const u = Date.now() / 1e3,
|
|
3427
|
-
await this.db.table(j.TOPICS).orderBy("utc").filter(
|
|
3426
|
+
const u = Date.now() / 1e3, f = (C) => C.utc < u - i, k = (C) => C.utc < u - i;
|
|
3427
|
+
return await this.db.table(j.TOPICS).orderBy("utc").filter(f).modify((C, K) => {
|
|
3428
3428
|
delete K.value;
|
|
3429
|
-
})
|
|
3429
|
+
}).catch((C) => (console.error(
|
|
3430
|
+
"%cstorage%c %clean",
|
|
3431
|
+
E.STORAGE,
|
|
3432
|
+
E.NONE,
|
|
3433
|
+
E.MESSAGES,
|
|
3434
|
+
C
|
|
3435
|
+
), 0)), await this.db.table(j.MESSAGES).orderBy("utc").filter(k).modify((C, K) => {
|
|
3430
3436
|
delete K.value;
|
|
3431
|
-
})
|
|
3437
|
+
}).catch((C) => (console.error(
|
|
3438
|
+
"%cstorage%c %clean",
|
|
3439
|
+
E.STORAGE,
|
|
3440
|
+
E.NONE,
|
|
3441
|
+
E.MESSAGES,
|
|
3442
|
+
C
|
|
3443
|
+
), 0));
|
|
3432
3444
|
});
|
|
3433
3445
|
P(this, "hideMessage", async (i, u) => {
|
|
3434
|
-
await this.db.table(j.TOPICS).where("message_id").equals(i).modify({ visible: u })
|
|
3446
|
+
await this.db.table(j.TOPICS).where("message_id").equals(i).modify({ visible: u }).catch((f) => (console.error(
|
|
3447
|
+
"%cstorage%c %chide",
|
|
3448
|
+
E.STORAGE,
|
|
3449
|
+
E.NONE,
|
|
3450
|
+
E.HIDE,
|
|
3451
|
+
f
|
|
3452
|
+
), 0));
|
|
3435
3453
|
});
|
|
3436
3454
|
/**
|
|
3437
3455
|
* Update Cloud
|
|
@@ -3442,19 +3460,19 @@ class Tr {
|
|
|
3442
3460
|
id: i.widget,
|
|
3443
3461
|
dashboard_id: i.dashboard,
|
|
3444
3462
|
type: i.type
|
|
3445
|
-
}).then(() => 201).catch((u) => (console.error("%cstorage",
|
|
3463
|
+
}).then(() => 201).catch((u) => (console.error("%cstorage", E.STORAGE, j.WIDGET, i, u), 400)));
|
|
3446
3464
|
/**
|
|
3447
3465
|
* Add component subscriber
|
|
3448
3466
|
* @param query IQuery
|
|
3449
3467
|
* @returns null
|
|
3450
3468
|
*/
|
|
3451
3469
|
P(this, "subscribe", (i) => (i = nt(i), this.subscribers.filter(
|
|
3452
|
-
(
|
|
3470
|
+
(f) => f.widget === i.widget
|
|
3453
3471
|
).length > 0 || (i.type === j.MESSAGES && (i = vt(this.options, i)), console.debug(
|
|
3454
3472
|
"%cstorage%c %csubscribe",
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
|
|
3473
|
+
E.STORAGE,
|
|
3474
|
+
E.NONE,
|
|
3475
|
+
E.SUBSCRIBE,
|
|
3458
3476
|
i.slide,
|
|
3459
3477
|
i.widget
|
|
3460
3478
|
), this.subscribers.push(i)), null));
|
|
@@ -3485,18 +3503,18 @@ function Wn(p) {
|
|
|
3485
3503
|
function Pi(p, i) {
|
|
3486
3504
|
const u = indexedDB.open(p);
|
|
3487
3505
|
u.onupgradeneeded = () => u.result.createObjectStore(i);
|
|
3488
|
-
const
|
|
3489
|
-
return (
|
|
3506
|
+
const f = Wn(u);
|
|
3507
|
+
return (k, C) => f.then((K) => C(K.transaction(i, k).objectStore(i)));
|
|
3490
3508
|
}
|
|
3491
|
-
let
|
|
3509
|
+
let Gn;
|
|
3492
3510
|
function Mr() {
|
|
3493
|
-
return
|
|
3511
|
+
return Gn || (Gn = Pi("keyval-store", "keyval")), Gn;
|
|
3494
3512
|
}
|
|
3495
|
-
function
|
|
3513
|
+
function Ln(p, i = Mr()) {
|
|
3496
3514
|
return i("readonly", (u) => Wn(u.get(p)));
|
|
3497
3515
|
}
|
|
3498
3516
|
function Xt(p, i, u = Mr()) {
|
|
3499
|
-
return u("readwrite", (
|
|
3517
|
+
return u("readwrite", (f) => (f.put(i, p), Wn(f.transaction)));
|
|
3500
3518
|
}
|
|
3501
3519
|
class jr {
|
|
3502
3520
|
constructor(i) {
|
|
@@ -3504,15 +3522,15 @@ class jr {
|
|
|
3504
3522
|
P(this, "options");
|
|
3505
3523
|
P(this, "getCloud", async (i) => {
|
|
3506
3524
|
const u = V(i);
|
|
3507
|
-
return await
|
|
3525
|
+
return await Ln(u).then((f) => f).catch(() => (console.warn("%capi", E.API, j.CLOUD, i.slide, i.widget), { data: null, message: "Cloud Data error", success: !1 }));
|
|
3508
3526
|
});
|
|
3509
3527
|
P(this, "getSeries", async (i) => {
|
|
3510
3528
|
const u = V(i);
|
|
3511
|
-
return await
|
|
3529
|
+
return await Ln(u).then((f) => f).catch(() => (console.warn("%capi", E.API, j.SERIES, i.slide, i.widget), { data: null, message: "Series Data error", success: !1 }));
|
|
3512
3530
|
});
|
|
3513
3531
|
P(this, "getMessages", async (i) => {
|
|
3514
3532
|
const u = V(i);
|
|
3515
|
-
return await
|
|
3533
|
+
return await Ln(u).then((f) => f).catch(() => (console.warn("%capi", E.API, j.MESSAGES, i.slide, i.widget), { data: null, message: "Messages Data error", success: !1 }));
|
|
3516
3534
|
});
|
|
3517
3535
|
/**
|
|
3518
3536
|
* Update Cloud
|
|
@@ -3523,8 +3541,8 @@ class jr {
|
|
|
3523
3541
|
P(this, "setCloud", async (i, u) => {
|
|
3524
3542
|
if (!u.success)
|
|
3525
3543
|
return 400;
|
|
3526
|
-
const
|
|
3527
|
-
return delete u.success, delete u.message, await Xt(
|
|
3544
|
+
const f = V(i);
|
|
3545
|
+
return delete u.success, delete u.message, await Xt(f, u).then(() => 201).catch((k) => (console.error("%cstorage", E.STORAGE, j.CLOUD, i, k), 400));
|
|
3528
3546
|
});
|
|
3529
3547
|
/**
|
|
3530
3548
|
* Update Series
|
|
@@ -3535,8 +3553,8 @@ class jr {
|
|
|
3535
3553
|
P(this, "setSeries", async (i, u) => {
|
|
3536
3554
|
if (!u.success)
|
|
3537
3555
|
return 400;
|
|
3538
|
-
const
|
|
3539
|
-
return delete u.success, delete u.message, await Xt(
|
|
3556
|
+
const f = V(i);
|
|
3557
|
+
return delete u.success, delete u.message, await Xt(f, u).then(() => 201).catch((k) => (console.error("%cstorage", E.STORAGE, j.SERIES, i, k), 400));
|
|
3540
3558
|
});
|
|
3541
3559
|
/**
|
|
3542
3560
|
* Update Messages
|
|
@@ -3547,10 +3565,10 @@ class jr {
|
|
|
3547
3565
|
P(this, "setMessages", async (i, u) => {
|
|
3548
3566
|
if (!u.success)
|
|
3549
3567
|
return 400;
|
|
3550
|
-
const
|
|
3551
|
-
return delete u.success, delete u.message, await Xt(
|
|
3568
|
+
const f = V(i);
|
|
3569
|
+
return delete u.success, delete u.message, await Xt(f, u).then(() => 201).catch((k) => (console.error("%cstorage", E.STORAGE, j.MESSAGES, i, k), 400));
|
|
3552
3570
|
});
|
|
3553
|
-
P(this, "cleanMessages", async (i) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((u) => u())));
|
|
3571
|
+
P(this, "cleanMessages", async (i) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((u) => u(0))));
|
|
3554
3572
|
P(this, "hideMessage", async (i, u) => {
|
|
3555
3573
|
console.debug(`hideMessage ${i} ${u} not implemented for ${this.options.storage}`);
|
|
3556
3574
|
});
|
|
@@ -3560,12 +3578,12 @@ class jr {
|
|
|
3560
3578
|
* @returns number
|
|
3561
3579
|
*/
|
|
3562
3580
|
P(this, "setWidget", async (i) => {
|
|
3563
|
-
const u = V(i),
|
|
3581
|
+
const u = V(i), f = {
|
|
3564
3582
|
id: i.widget,
|
|
3565
3583
|
dashboard_id: i.dashboard,
|
|
3566
3584
|
type: i.type
|
|
3567
3585
|
};
|
|
3568
|
-
return await Xt(u,
|
|
3586
|
+
return await Xt(u, f).then(() => 201).catch((k) => (console.error("%cstorage", E.STORAGE, j.WIDGET, i, k), 400));
|
|
3569
3587
|
});
|
|
3570
3588
|
/**
|
|
3571
3589
|
* Add component subscriber
|
|
@@ -3573,12 +3591,12 @@ class jr {
|
|
|
3573
3591
|
* @returns null
|
|
3574
3592
|
*/
|
|
3575
3593
|
P(this, "subscribe", (i) => (i = nt(i), i.type === j.MESSAGES && (i = vt(this.options, i)), this.subscribers.filter(
|
|
3576
|
-
(
|
|
3594
|
+
(f) => f.widget === i.widget
|
|
3577
3595
|
).length > 0 || (console.debug(
|
|
3578
3596
|
"%cstorage%c %csubscribe",
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3597
|
+
E.STORAGE,
|
|
3598
|
+
E.NONE,
|
|
3599
|
+
E.SUBSCRIBE,
|
|
3582
3600
|
i.slide,
|
|
3583
3601
|
i.widget
|
|
3584
3602
|
), this.subscribers.push(i)), null));
|
|
@@ -3599,7 +3617,7 @@ class Kr {
|
|
|
3599
3617
|
try {
|
|
3600
3618
|
return localStorage.getObject(u);
|
|
3601
3619
|
} catch {
|
|
3602
|
-
return console.warn("%capi",
|
|
3620
|
+
return console.warn("%capi", E.API, j.CLOUD, i.slide, i.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3603
3621
|
}
|
|
3604
3622
|
});
|
|
3605
3623
|
P(this, "getSeries", async (i) => {
|
|
@@ -3607,7 +3625,7 @@ class Kr {
|
|
|
3607
3625
|
try {
|
|
3608
3626
|
return localStorage.getObject(u);
|
|
3609
3627
|
} catch {
|
|
3610
|
-
return console.warn("%capi",
|
|
3628
|
+
return console.warn("%capi", E.API, j.SERIES, i.slide, i.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3611
3629
|
}
|
|
3612
3630
|
});
|
|
3613
3631
|
P(this, "getMessages", async (i) => {
|
|
@@ -3615,7 +3633,7 @@ class Kr {
|
|
|
3615
3633
|
try {
|
|
3616
3634
|
return localStorage.getObject(u);
|
|
3617
3635
|
} catch {
|
|
3618
|
-
return console.warn("%capi",
|
|
3636
|
+
return console.warn("%capi", E.API, j.MESSAGES, i.slide, i.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3619
3637
|
}
|
|
3620
3638
|
});
|
|
3621
3639
|
/**
|
|
@@ -3625,11 +3643,11 @@ class Kr {
|
|
|
3625
3643
|
* @returns number
|
|
3626
3644
|
*/
|
|
3627
3645
|
P(this, "setCloud", async (i, u) => {
|
|
3628
|
-
const
|
|
3646
|
+
const f = V(i);
|
|
3629
3647
|
try {
|
|
3630
|
-
return localStorage.setObject(
|
|
3631
|
-
} catch (
|
|
3632
|
-
return console.error("%cstorage",
|
|
3648
|
+
return localStorage.setObject(f, u), 201;
|
|
3649
|
+
} catch (k) {
|
|
3650
|
+
return console.error("%cstorage", E.STORAGE, j.CLOUD, i, k), 400;
|
|
3633
3651
|
}
|
|
3634
3652
|
});
|
|
3635
3653
|
/**
|
|
@@ -3639,11 +3657,11 @@ class Kr {
|
|
|
3639
3657
|
* @returns number
|
|
3640
3658
|
*/
|
|
3641
3659
|
P(this, "setSeries", async (i, u) => {
|
|
3642
|
-
const
|
|
3660
|
+
const f = V(i);
|
|
3643
3661
|
try {
|
|
3644
|
-
return localStorage.setObject(
|
|
3645
|
-
} catch (
|
|
3646
|
-
return console.error("%cstorage",
|
|
3662
|
+
return localStorage.setObject(f, u), 201;
|
|
3663
|
+
} catch (k) {
|
|
3664
|
+
return console.error("%cstorage", E.STORAGE, j.SERIES, i, k), 400;
|
|
3647
3665
|
}
|
|
3648
3666
|
});
|
|
3649
3667
|
/**
|
|
@@ -3653,16 +3671,14 @@ class Kr {
|
|
|
3653
3671
|
* @returns number
|
|
3654
3672
|
*/
|
|
3655
3673
|
P(this, "setMessages", async (i, u) => {
|
|
3656
|
-
const
|
|
3674
|
+
const f = V(i);
|
|
3657
3675
|
try {
|
|
3658
|
-
return localStorage.setObject(
|
|
3659
|
-
} catch (
|
|
3660
|
-
return console.error("%cstorage",
|
|
3676
|
+
return localStorage.setObject(f, u), 200;
|
|
3677
|
+
} catch (k) {
|
|
3678
|
+
return console.error("%cstorage", E.STORAGE, j.MESSAGES, i, k), 400;
|
|
3661
3679
|
}
|
|
3662
3680
|
});
|
|
3663
|
-
P(this, "cleanMessages", async (i) =>
|
|
3664
|
-
console.log("cleanMessages not implemented for ", this.options.storage);
|
|
3665
|
-
});
|
|
3681
|
+
P(this, "cleanMessages", async (i) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((u) => u(0))));
|
|
3666
3682
|
P(this, "hideMessage", async (i, u) => {
|
|
3667
3683
|
console.debug(`hideMessage ${i} ${u} not implemented for ${this.options.storage}`);
|
|
3668
3684
|
});
|
|
@@ -3670,8 +3686,8 @@ class Kr {
|
|
|
3670
3686
|
const u = `widget.${i.widget}`;
|
|
3671
3687
|
try {
|
|
3672
3688
|
return localStorage.setObject(u, i), 201;
|
|
3673
|
-
} catch (
|
|
3674
|
-
return console.error("%cstorage",
|
|
3689
|
+
} catch (f) {
|
|
3690
|
+
return console.error("%cstorage", E.STORAGE, j.WIDGET, i, f), 400;
|
|
3675
3691
|
}
|
|
3676
3692
|
});
|
|
3677
3693
|
/**
|
|
@@ -3680,12 +3696,12 @@ class Kr {
|
|
|
3680
3696
|
* @returns null
|
|
3681
3697
|
*/
|
|
3682
3698
|
P(this, "subscribe", (i) => (i = nt(i), i.type === j.MESSAGES && (i = vt(this.options, i)), this.subscribers.filter(
|
|
3683
|
-
(
|
|
3699
|
+
(f) => f.widget === i.widget
|
|
3684
3700
|
).length || (console.debug(
|
|
3685
3701
|
"%cstorage%c %csubscribe",
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3702
|
+
E.STORAGE,
|
|
3703
|
+
E.NONE,
|
|
3704
|
+
E.SUBSCRIBE,
|
|
3689
3705
|
i.slide,
|
|
3690
3706
|
i.widget
|
|
3691
3707
|
), this.subscribers.push(i)), null));
|
|
@@ -3694,15 +3710,15 @@ class Kr {
|
|
|
3694
3710
|
* @returns IQuery[]
|
|
3695
3711
|
*/
|
|
3696
3712
|
P(this, "getSubscribers", async () => await new Promise((i) => i(this.subscribers)));
|
|
3697
|
-
this.options = i, Storage.prototype.setObject = function(u,
|
|
3698
|
-
this.setObject(u, JSON.stringify(
|
|
3713
|
+
this.options = i, Storage.prototype.setObject = function(u, f) {
|
|
3714
|
+
this.setObject(u, JSON.stringify(f));
|
|
3699
3715
|
}, Storage.prototype.getObject = function(u) {
|
|
3700
|
-
const
|
|
3701
|
-
return
|
|
3716
|
+
const f = this.getObject(u);
|
|
3717
|
+
return f && JSON.parse(f);
|
|
3702
3718
|
};
|
|
3703
3719
|
}
|
|
3704
3720
|
}
|
|
3705
|
-
class
|
|
3721
|
+
class Nr {
|
|
3706
3722
|
constructor(i) {
|
|
3707
3723
|
P(this, "subscribers", []);
|
|
3708
3724
|
P(this, "options");
|
|
@@ -3711,7 +3727,7 @@ class Br {
|
|
|
3711
3727
|
try {
|
|
3712
3728
|
return sessionStorage.getObject(u);
|
|
3713
3729
|
} catch {
|
|
3714
|
-
return console.warn("%capi",
|
|
3730
|
+
return console.warn("%capi", E.API, j.CLOUD, i.slide, i.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3715
3731
|
}
|
|
3716
3732
|
});
|
|
3717
3733
|
P(this, "getSeries", async (i) => {
|
|
@@ -3719,7 +3735,7 @@ class Br {
|
|
|
3719
3735
|
try {
|
|
3720
3736
|
return sessionStorage.getObject(u);
|
|
3721
3737
|
} catch {
|
|
3722
|
-
return console.warn("%capi",
|
|
3738
|
+
return console.warn("%capi", E.API, j.SERIES, i.slide, i.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3723
3739
|
}
|
|
3724
3740
|
});
|
|
3725
3741
|
P(this, "getMessages", async (i) => {
|
|
@@ -3727,7 +3743,7 @@ class Br {
|
|
|
3727
3743
|
try {
|
|
3728
3744
|
return sessionStorage.getObject(u);
|
|
3729
3745
|
} catch {
|
|
3730
|
-
return console.warn("%capi",
|
|
3746
|
+
return console.warn("%capi", E.API, j.MESSAGES, i.slide, i.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3731
3747
|
}
|
|
3732
3748
|
});
|
|
3733
3749
|
/**
|
|
@@ -3737,11 +3753,11 @@ class Br {
|
|
|
3737
3753
|
* @returns number
|
|
3738
3754
|
*/
|
|
3739
3755
|
P(this, "setCloud", async (i, u) => {
|
|
3740
|
-
const
|
|
3756
|
+
const f = V(i);
|
|
3741
3757
|
try {
|
|
3742
|
-
return sessionStorage.setObject(
|
|
3743
|
-
} catch (
|
|
3744
|
-
return console.error("%cstorage",
|
|
3758
|
+
return sessionStorage.setObject(f, u), 201;
|
|
3759
|
+
} catch (k) {
|
|
3760
|
+
return console.error("%cstorage", E.STORAGE, j.CLOUD, i, k), 400;
|
|
3745
3761
|
}
|
|
3746
3762
|
});
|
|
3747
3763
|
/**
|
|
@@ -3751,11 +3767,11 @@ class Br {
|
|
|
3751
3767
|
* @returns number
|
|
3752
3768
|
*/
|
|
3753
3769
|
P(this, "setSeries", async (i, u) => {
|
|
3754
|
-
const
|
|
3770
|
+
const f = V(i);
|
|
3755
3771
|
try {
|
|
3756
|
-
return sessionStorage.setObject(
|
|
3757
|
-
} catch (
|
|
3758
|
-
return console.error("%cstorage",
|
|
3772
|
+
return sessionStorage.setObject(f, u), 201;
|
|
3773
|
+
} catch (k) {
|
|
3774
|
+
return console.error("%cstorage", E.STORAGE, j.SERIES, i, k), 400;
|
|
3759
3775
|
}
|
|
3760
3776
|
});
|
|
3761
3777
|
/**
|
|
@@ -3765,16 +3781,14 @@ class Br {
|
|
|
3765
3781
|
* @returns number
|
|
3766
3782
|
*/
|
|
3767
3783
|
P(this, "setMessages", async (i, u) => {
|
|
3768
|
-
const
|
|
3784
|
+
const f = V(i);
|
|
3769
3785
|
try {
|
|
3770
|
-
return sessionStorage.setObject(
|
|
3771
|
-
} catch (
|
|
3772
|
-
return console.error("%cstorage",
|
|
3786
|
+
return sessionStorage.setObject(f, u), 200;
|
|
3787
|
+
} catch (k) {
|
|
3788
|
+
return console.error("%cstorage", E.STORAGE, j.MESSAGES, i, k), 400;
|
|
3773
3789
|
}
|
|
3774
3790
|
});
|
|
3775
|
-
P(this, "cleanMessages", async (i) =>
|
|
3776
|
-
console.log("cleanMessages not implemented for ", this.options.storage);
|
|
3777
|
-
});
|
|
3791
|
+
P(this, "cleanMessages", async (i) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((u) => u(0))));
|
|
3778
3792
|
P(this, "hideMessage", async (i, u) => {
|
|
3779
3793
|
console.debug(`hideMessage ${i} ${u} not implemented for ${this.options.storage}`);
|
|
3780
3794
|
});
|
|
@@ -3782,8 +3796,8 @@ class Br {
|
|
|
3782
3796
|
const u = `widget.${i.widget}`;
|
|
3783
3797
|
try {
|
|
3784
3798
|
return sessionStorage.setObject(u, i), 201;
|
|
3785
|
-
} catch (
|
|
3786
|
-
return console.error("%cstorage",
|
|
3799
|
+
} catch (f) {
|
|
3800
|
+
return console.error("%cstorage", E.STORAGE, j.WIDGET, i, f), 400;
|
|
3787
3801
|
}
|
|
3788
3802
|
});
|
|
3789
3803
|
/**
|
|
@@ -3792,12 +3806,12 @@ class Br {
|
|
|
3792
3806
|
* @returns null
|
|
3793
3807
|
*/
|
|
3794
3808
|
P(this, "subscribe", (i) => (i = nt(i), i.type === j.MESSAGES && (i = vt(this.options, i)), this.subscribers.filter(
|
|
3795
|
-
(
|
|
3809
|
+
(f) => f.widget === i.widget
|
|
3796
3810
|
).length || (console.debug(
|
|
3797
3811
|
"%cstorage%c %csubscribe",
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3812
|
+
E.STORAGE,
|
|
3813
|
+
E.NONE,
|
|
3814
|
+
E.SUBSCRIBE,
|
|
3801
3815
|
i.slide,
|
|
3802
3816
|
i.widget
|
|
3803
3817
|
), this.subscribers.push(i)), null));
|
|
@@ -3806,15 +3820,15 @@ class Br {
|
|
|
3806
3820
|
* @returns IQuery[]
|
|
3807
3821
|
*/
|
|
3808
3822
|
P(this, "getSubscribers", async () => await new Promise((i) => i(this.subscribers)));
|
|
3809
|
-
this.options = i, Storage.prototype.setObject = function(u,
|
|
3810
|
-
this.setItem(u, JSON.stringify(
|
|
3823
|
+
this.options = i, Storage.prototype.setObject = function(u, f) {
|
|
3824
|
+
this.setItem(u, JSON.stringify(f));
|
|
3811
3825
|
}, Storage.prototype.getObject = function(u) {
|
|
3812
|
-
const
|
|
3813
|
-
return
|
|
3826
|
+
const f = this.getItem(u);
|
|
3827
|
+
return f && JSON.parse(f);
|
|
3814
3828
|
};
|
|
3815
3829
|
}
|
|
3816
3830
|
}
|
|
3817
|
-
class
|
|
3831
|
+
class Br {
|
|
3818
3832
|
constructor(i) {
|
|
3819
3833
|
P(this, "subscribers", []);
|
|
3820
3834
|
P(this, "options");
|
|
@@ -3823,7 +3837,7 @@ class Nr {
|
|
|
3823
3837
|
try {
|
|
3824
3838
|
return window.BuzzCasting.WidgetData[u];
|
|
3825
3839
|
} catch {
|
|
3826
|
-
return console.warn("%capi",
|
|
3840
|
+
return console.warn("%capi", E.API, j.CLOUD, i.slide, i.widget), { data: null, message: "Cloud Data error", success: !1 };
|
|
3827
3841
|
}
|
|
3828
3842
|
});
|
|
3829
3843
|
P(this, "getSeries", async (i) => {
|
|
@@ -3831,7 +3845,7 @@ class Nr {
|
|
|
3831
3845
|
try {
|
|
3832
3846
|
return window.BuzzCasting.WidgetData[u];
|
|
3833
3847
|
} catch {
|
|
3834
|
-
return console.warn("%capi",
|
|
3848
|
+
return console.warn("%capi", E.API, j.SERIES, i.slide, i.widget), { data: null, message: "Series Data error", success: !1 };
|
|
3835
3849
|
}
|
|
3836
3850
|
});
|
|
3837
3851
|
P(this, "getMessages", async (i) => {
|
|
@@ -3839,7 +3853,7 @@ class Nr {
|
|
|
3839
3853
|
try {
|
|
3840
3854
|
return window.BuzzCasting.WidgetData[u];
|
|
3841
3855
|
} catch {
|
|
3842
|
-
return console.warn("%capi",
|
|
3856
|
+
return console.warn("%capi", E.API, j.MESSAGES, i.slide, i.widget), { data: null, message: "Messages Data error", success: !1 };
|
|
3843
3857
|
}
|
|
3844
3858
|
});
|
|
3845
3859
|
/**
|
|
@@ -3849,11 +3863,11 @@ class Nr {
|
|
|
3849
3863
|
* @returns number
|
|
3850
3864
|
*/
|
|
3851
3865
|
P(this, "setCloud", async (i, u) => {
|
|
3852
|
-
const
|
|
3866
|
+
const f = V(i);
|
|
3853
3867
|
try {
|
|
3854
|
-
return window.BuzzCasting.WidgetData[
|
|
3855
|
-
} catch (
|
|
3856
|
-
return console.error("%cstorage",
|
|
3868
|
+
return window.BuzzCasting.WidgetData[f] = u, 201;
|
|
3869
|
+
} catch (k) {
|
|
3870
|
+
return console.error("%cstorage", E.STORAGE, "set", i, k), 400;
|
|
3857
3871
|
}
|
|
3858
3872
|
});
|
|
3859
3873
|
/**
|
|
@@ -3863,11 +3877,11 @@ class Nr {
|
|
|
3863
3877
|
* @returns number
|
|
3864
3878
|
*/
|
|
3865
3879
|
P(this, "setSeries", async (i, u) => {
|
|
3866
|
-
const
|
|
3880
|
+
const f = V(i);
|
|
3867
3881
|
try {
|
|
3868
|
-
return window.BuzzCasting.WidgetData[
|
|
3869
|
-
} catch (
|
|
3870
|
-
return console.error("%cstorage",
|
|
3882
|
+
return window.BuzzCasting.WidgetData[f] = u, 201;
|
|
3883
|
+
} catch (k) {
|
|
3884
|
+
return console.error("%cstorage", E.STORAGE, "set", i, k), 400;
|
|
3871
3885
|
}
|
|
3872
3886
|
});
|
|
3873
3887
|
/**
|
|
@@ -3877,16 +3891,14 @@ class Nr {
|
|
|
3877
3891
|
* @returns number
|
|
3878
3892
|
*/
|
|
3879
3893
|
P(this, "setMessages", async (i, u) => {
|
|
3880
|
-
const
|
|
3894
|
+
const f = V(i);
|
|
3881
3895
|
try {
|
|
3882
|
-
return window.BuzzCasting.WidgetData[
|
|
3883
|
-
} catch (
|
|
3884
|
-
return console.error("%cstorage",
|
|
3896
|
+
return window.BuzzCasting.WidgetData[f] = u, 201;
|
|
3897
|
+
} catch (k) {
|
|
3898
|
+
return console.error("%cstorage", E.STORAGE, "set", i, k), 400;
|
|
3885
3899
|
}
|
|
3886
3900
|
});
|
|
3887
|
-
P(this, "cleanMessages", async (i) =>
|
|
3888
|
-
console.log("cleanMessages not implemented for ", this.options.storage);
|
|
3889
|
-
});
|
|
3901
|
+
P(this, "cleanMessages", async (i) => (console.log("cleanMessages not implemented for ", this.options.storage), await new Promise((u) => u(0))));
|
|
3890
3902
|
P(this, "hideMessage", async (i, u) => {
|
|
3891
3903
|
console.debug(`hideMessage ${i} ${u} not implemented for ${this.options.storage}`);
|
|
3892
3904
|
});
|
|
@@ -3894,8 +3906,8 @@ class Nr {
|
|
|
3894
3906
|
const u = `widget.${i.widget}`;
|
|
3895
3907
|
try {
|
|
3896
3908
|
return window.BuzzCasting.WidgetData[u] = i, 201;
|
|
3897
|
-
} catch (
|
|
3898
|
-
return console.error("%cstorage",
|
|
3909
|
+
} catch (f) {
|
|
3910
|
+
return console.error("%cstorage", E.STORAGE, j.WIDGET, i, f), 400;
|
|
3899
3911
|
}
|
|
3900
3912
|
});
|
|
3901
3913
|
/**
|
|
@@ -3904,12 +3916,12 @@ class Nr {
|
|
|
3904
3916
|
* @returns null
|
|
3905
3917
|
*/
|
|
3906
3918
|
P(this, "subscribe", (i) => (i = nt(i), i.type === j.MESSAGES && (i = vt(this.options, i)), this.subscribers.filter(
|
|
3907
|
-
(
|
|
3919
|
+
(f) => f.widget === i.widget
|
|
3908
3920
|
).length || (console.debug(
|
|
3909
3921
|
"%cstorage%c %csubscribe",
|
|
3910
|
-
|
|
3911
|
-
|
|
3912
|
-
|
|
3922
|
+
E.STORAGE,
|
|
3923
|
+
E.NONE,
|
|
3924
|
+
E.SUBSCRIBE,
|
|
3913
3925
|
i.slide,
|
|
3914
3926
|
i.widget
|
|
3915
3927
|
), this.subscribers.push(i)), null));
|
|
@@ -3921,43 +3933,43 @@ class Nr {
|
|
|
3921
3933
|
this.options = i, window.BuzzCasting.WidgetData = /* @__PURE__ */ new Set();
|
|
3922
3934
|
}
|
|
3923
3935
|
}
|
|
3924
|
-
function
|
|
3936
|
+
function Ni(p) {
|
|
3925
3937
|
const i = p.toUpperCase().split(/[\s_-]+/);
|
|
3926
|
-
return i.length > 0 ? (i.forEach((u,
|
|
3927
|
-
i[
|
|
3938
|
+
return i.length > 0 ? (i.forEach((u, f) => {
|
|
3939
|
+
i[f] = `${u.charAt(0)}.`;
|
|
3928
3940
|
}), i.join(" ")) : "";
|
|
3929
3941
|
}
|
|
3930
|
-
function
|
|
3931
|
-
let i = "", u = "",
|
|
3942
|
+
function Bi(p) {
|
|
3943
|
+
let i = "", u = "", f = {
|
|
3932
3944
|
backgroundImage: ""
|
|
3933
3945
|
};
|
|
3934
|
-
return typeof p.media < "u" && p.media && p.media.forEach((
|
|
3935
|
-
(
|
|
3936
|
-
backgroundImage: `url(${
|
|
3937
|
-
}, u =
|
|
3946
|
+
return typeof p.media < "u" && p.media && p.media.forEach((k) => {
|
|
3947
|
+
(k.type === "photo" || k.type === "image") && (f = {
|
|
3948
|
+
backgroundImage: `url(${k.url})`
|
|
3949
|
+
}, u = k.url), k.type === "video" && (i = k.url);
|
|
3938
3950
|
}), {
|
|
3939
3951
|
image: u,
|
|
3940
|
-
background:
|
|
3952
|
+
background: f || null,
|
|
3941
3953
|
video: i
|
|
3942
3954
|
};
|
|
3943
3955
|
}
|
|
3944
|
-
function
|
|
3956
|
+
function Ii(p) {
|
|
3945
3957
|
const i = {};
|
|
3946
3958
|
for (let u = 0; u < p.length; u++) {
|
|
3947
|
-
const
|
|
3948
|
-
|
|
3959
|
+
const f = p.item(u);
|
|
3960
|
+
f != null && f.name && (i[f.name] = f.value);
|
|
3949
3961
|
}
|
|
3950
3962
|
return i;
|
|
3951
3963
|
}
|
|
3952
|
-
function
|
|
3964
|
+
function Gi(p) {
|
|
3953
3965
|
const i = {};
|
|
3954
3966
|
for (let u = 0; u < p.length; u++) {
|
|
3955
|
-
const
|
|
3956
|
-
|
|
3967
|
+
const f = p[u];
|
|
3968
|
+
f.name !== "class" && !f.name.includes("data") && (i[f.name] = f.value);
|
|
3957
3969
|
}
|
|
3958
3970
|
return i;
|
|
3959
3971
|
}
|
|
3960
|
-
function
|
|
3972
|
+
function Li(p, i) {
|
|
3961
3973
|
switch (p) {
|
|
3962
3974
|
case "bl":
|
|
3963
3975
|
return `text-blue fa-solid fa-rss fa-${i}`;
|
|
@@ -4005,7 +4017,7 @@ function Fi(p) {
|
|
|
4005
4017
|
function $i(p) {
|
|
4006
4018
|
return p.toLowerCase().split("-").reduce((i, u) => i + (u.charAt(0).toUpperCase() + u.slice(1)));
|
|
4007
4019
|
}
|
|
4008
|
-
function
|
|
4020
|
+
function Ci(p) {
|
|
4009
4021
|
const i = document.createRange();
|
|
4010
4022
|
i.selectNodeContents(p), i.deleteContents();
|
|
4011
4023
|
}
|
|
@@ -4019,45 +4031,45 @@ function Ri(p, i) {
|
|
|
4019
4031
|
return p;
|
|
4020
4032
|
}
|
|
4021
4033
|
function Oe(p, i) {
|
|
4022
|
-
let u,
|
|
4034
|
+
let u, f, k;
|
|
4023
4035
|
if (i.length === 0)
|
|
4024
4036
|
return p;
|
|
4025
|
-
for (u = 0,
|
|
4026
|
-
|
|
4037
|
+
for (u = 0, k = i.length; u < k; u++)
|
|
4038
|
+
f = i.charCodeAt(u), p = (p << 5) - p + f, p |= 0;
|
|
4027
4039
|
return p < 0 ? p * -2 : p;
|
|
4028
4040
|
}
|
|
4029
4041
|
function Ti(p, i, u) {
|
|
4030
|
-
return Object.keys(i).sort().reduce(
|
|
4031
|
-
function
|
|
4032
|
-
return
|
|
4042
|
+
return Object.keys(i).sort().reduce(f, p);
|
|
4043
|
+
function f(k, C) {
|
|
4044
|
+
return Gr(k, i[C], C, u);
|
|
4033
4045
|
}
|
|
4034
4046
|
}
|
|
4035
|
-
function
|
|
4036
|
-
const
|
|
4047
|
+
function Gr(p, i, u, f) {
|
|
4048
|
+
const k = Oe(Oe(Oe(p, u), Mi(i)), typeof i);
|
|
4037
4049
|
if (i === null)
|
|
4038
|
-
return Oe(
|
|
4050
|
+
return Oe(k, "null");
|
|
4039
4051
|
if (i === void 0)
|
|
4040
|
-
return Oe(
|
|
4052
|
+
return Oe(k, "undefined");
|
|
4041
4053
|
if (typeof i == "object" || typeof i == "function") {
|
|
4042
|
-
if (
|
|
4043
|
-
return Oe(
|
|
4044
|
-
|
|
4045
|
-
const
|
|
4054
|
+
if (f.includes(i))
|
|
4055
|
+
return Oe(k, `[Circular]${u}`);
|
|
4056
|
+
f.push(i);
|
|
4057
|
+
const C = Ti(k, i, f);
|
|
4046
4058
|
if (!("valueOf" in i) || typeof i.valueOf != "function")
|
|
4047
|
-
return
|
|
4059
|
+
return C;
|
|
4048
4060
|
try {
|
|
4049
|
-
return Oe(
|
|
4061
|
+
return Oe(C, String(i.valueOf()));
|
|
4050
4062
|
} catch (K) {
|
|
4051
|
-
return Oe(
|
|
4063
|
+
return Oe(C, `[valueOf exception]${K.stack || K.message}`);
|
|
4052
4064
|
}
|
|
4053
4065
|
}
|
|
4054
|
-
return Oe(
|
|
4066
|
+
return Oe(k, i.toString());
|
|
4055
4067
|
}
|
|
4056
4068
|
function Mi(p) {
|
|
4057
4069
|
return Object.prototype.toString.call(p);
|
|
4058
4070
|
}
|
|
4059
4071
|
function Fn(p) {
|
|
4060
|
-
return Ri(
|
|
4072
|
+
return Ri(Gr(0, p, "", []).toString(16), 8);
|
|
4061
4073
|
}
|
|
4062
4074
|
function Wi(p, i) {
|
|
4063
4075
|
if (p = p.toString().replace(/[^0-9.]/g, ""), p < 1e3)
|
|
@@ -4070,10 +4082,10 @@ function Wi(p, i) {
|
|
|
4070
4082
|
{ v: 1e15, s: "P" },
|
|
4071
4083
|
{ v: 1e18, s: "E" }
|
|
4072
4084
|
];
|
|
4073
|
-
let
|
|
4074
|
-
for (
|
|
4085
|
+
let f;
|
|
4086
|
+
for (f = u.length - 1; f > 0 && !(p >= u[f].v); f--)
|
|
4075
4087
|
;
|
|
4076
|
-
return (p / u[
|
|
4088
|
+
return (p / u[f].v).toFixed(i).replace(/\.0+$|(\.[0-9]*[1-9])0+$/, "$1") + u[f].s;
|
|
4077
4089
|
}
|
|
4078
4090
|
function zi(p, i) {
|
|
4079
4091
|
const u = [
|
|
@@ -4084,13 +4096,13 @@ function zi(p, i) {
|
|
|
4084
4096
|
{ value: 1e12, symbol: "T" },
|
|
4085
4097
|
{ value: 1e15, symbol: "P" },
|
|
4086
4098
|
{ value: 1e18, symbol: "E" }
|
|
4087
|
-
],
|
|
4088
|
-
let
|
|
4089
|
-
for (
|
|
4099
|
+
], f = /\.0+$|(\.[0-9]*[1-9])0+$/;
|
|
4100
|
+
let k;
|
|
4101
|
+
for (k = u.length - 1; k > 0 && !(p >= u[k].value); k--)
|
|
4090
4102
|
;
|
|
4091
|
-
return (p / u[
|
|
4103
|
+
return (p / u[k].value).toFixed(i).replace(f, "$1") + u[k].symbol;
|
|
4092
4104
|
}
|
|
4093
|
-
function
|
|
4105
|
+
function Hi(p) {
|
|
4094
4106
|
switch (p.language) {
|
|
4095
4107
|
case "ar":
|
|
4096
4108
|
return {
|
|
@@ -4101,15 +4113,24 @@ function Yi(p) {
|
|
|
4101
4113
|
return {};
|
|
4102
4114
|
}
|
|
4103
4115
|
}
|
|
4104
|
-
function
|
|
4116
|
+
function Yi(p) {
|
|
4117
|
+
return p.forEach((i) => {
|
|
4118
|
+
var u, f, k;
|
|
4119
|
+
if (i.content = i.content.replace(/(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)((\?.*)?)/g, ""), i.sender !== null ? (((u = i.sender) == null ? void 0 : u.title) === "Unknown author" && (i.sender.title = ""), ((f = i.sender) == null ? void 0 : f.name) !== "" && i.sender.title === "" && (i.sender.title = i.sender.name), ((k = i.sender) == null ? void 0 : k.name) !== "" && i.channel === "tw" && (i.sender.name = `@${i.sender.name}`)) : i.sender = { title: "", name: "", id: "", avatar: "default", bio: "", location: "", following: 0, verified: 0, listed: 0, followers: 0, favourites: 0, messages: 0, influence: 0 }, i.sender.title === "" && i.link !== "") {
|
|
4120
|
+
const C = new URL(i.link);
|
|
4121
|
+
i.sender.title = C.hostname.replace("www.", "");
|
|
4122
|
+
}
|
|
4123
|
+
}), p;
|
|
4124
|
+
}
|
|
4125
|
+
function Qi(p) {
|
|
4105
4126
|
const i = [...p];
|
|
4106
4127
|
for (let u = i.length - 1; u > 0; u--) {
|
|
4107
|
-
const
|
|
4108
|
-
[i[u], i[
|
|
4128
|
+
const f = Math.floor(Math.random() * (u + 1));
|
|
4129
|
+
[i[u], i[f]] = [i[f], i[u]];
|
|
4109
4130
|
}
|
|
4110
4131
|
return i;
|
|
4111
4132
|
}
|
|
4112
|
-
class
|
|
4133
|
+
class Xi {
|
|
4113
4134
|
constructor(i) {
|
|
4114
4135
|
P(this, "sm");
|
|
4115
4136
|
P(this, "api");
|
|
@@ -4121,65 +4142,65 @@ class Qi {
|
|
|
4121
4142
|
const u = await this.sm.getSubscribers();
|
|
4122
4143
|
if (u.length === 0)
|
|
4123
4144
|
return;
|
|
4124
|
-
const
|
|
4125
|
-
i ?
|
|
4126
|
-
|
|
4127
|
-
}), await Promise.allSettled(
|
|
4128
|
-
(
|
|
4145
|
+
const f = [];
|
|
4146
|
+
i ? f.push(this.api.get(i)) : u == null || u.forEach((k) => {
|
|
4147
|
+
f.push(this.api.get(k));
|
|
4148
|
+
}), await Promise.allSettled(f).then(
|
|
4149
|
+
(k) => k.forEach(async (C) => {
|
|
4129
4150
|
let K = 400;
|
|
4130
|
-
if (
|
|
4131
|
-
const
|
|
4151
|
+
if (C.status === "fulfilled") {
|
|
4152
|
+
const B = C.value;
|
|
4132
4153
|
if (this.sm === null)
|
|
4133
4154
|
return 400;
|
|
4134
|
-
if (
|
|
4155
|
+
if (B.success === !0) {
|
|
4135
4156
|
const Z = this.sm.subscribers.filter(
|
|
4136
|
-
(be) => be.widget ===
|
|
4157
|
+
(be) => be.widget === B.query.widget
|
|
4137
4158
|
)[0];
|
|
4138
4159
|
let te = "";
|
|
4139
|
-
switch (
|
|
4160
|
+
switch (B.query.type) {
|
|
4140
4161
|
case j.MESSAGES:
|
|
4141
|
-
if (te = Fn(
|
|
4162
|
+
if (te = Fn(B.data.messages), Z.hash === te)
|
|
4142
4163
|
return console.debug(
|
|
4143
4164
|
"%capi%c %cno updates",
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4165
|
+
E.API,
|
|
4166
|
+
E.NONE,
|
|
4167
|
+
E.NO_UPDATES,
|
|
4147
4168
|
j.MESSAGES,
|
|
4148
|
-
|
|
4149
|
-
|
|
4169
|
+
B.query.slide,
|
|
4170
|
+
B.query.widget
|
|
4150
4171
|
), 204;
|
|
4151
|
-
Z.hash = te, K = await this.sm.setMessages(
|
|
4172
|
+
Z.hash = te, K = await this.sm.setMessages(B.query, B);
|
|
4152
4173
|
break;
|
|
4153
4174
|
case j.CLOUD:
|
|
4154
|
-
te = Fn(
|
|
4175
|
+
te = Fn(B.data), Z.hash === te ? (console.debug(
|
|
4155
4176
|
"%capi%c %cno updates",
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4177
|
+
E.API,
|
|
4178
|
+
E.NONE,
|
|
4179
|
+
E.NO_UPDATES,
|
|
4159
4180
|
j.CLOUD,
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
), K = 204) : (Z.hash = te, K = await this.sm.setCloud(
|
|
4181
|
+
B.query.slide,
|
|
4182
|
+
B.query.widget
|
|
4183
|
+
), K = 204) : (Z.hash = te, K = await this.sm.setCloud(B.query, B));
|
|
4163
4184
|
break;
|
|
4164
4185
|
case j.SERIES:
|
|
4165
|
-
te = Fn(
|
|
4186
|
+
te = Fn(B.data), Z.hash === te ? (console.debug(
|
|
4166
4187
|
"%capi%c %cno updates",
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4188
|
+
E.API,
|
|
4189
|
+
E.NONE,
|
|
4190
|
+
E.NO_UPDATES,
|
|
4170
4191
|
j.SERIES,
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
), K = 204) : (Z.hash = te, K = await this.sm.setSeries(
|
|
4192
|
+
B.query.slide,
|
|
4193
|
+
B.query.widget
|
|
4194
|
+
), K = 204) : (Z.hash = te, K = await this.sm.setSeries(B.query, B));
|
|
4174
4195
|
break;
|
|
4175
4196
|
default:
|
|
4176
4197
|
console.warn(
|
|
4177
4198
|
"%capi%c %cstorage",
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4199
|
+
E.API,
|
|
4200
|
+
E.NONE,
|
|
4201
|
+
E.STORAGE,
|
|
4181
4202
|
"error",
|
|
4182
|
-
`data type ${
|
|
4203
|
+
`data type ${B.query.type} unknown`
|
|
4183
4204
|
);
|
|
4184
4205
|
}
|
|
4185
4206
|
} else
|
|
@@ -4188,21 +4209,21 @@ class Qi {
|
|
|
4188
4209
|
case 201:
|
|
4189
4210
|
console.info(
|
|
4190
4211
|
"%capp%c %cbroadcast",
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
), this.bc.postMessage({ event: se.WIDGET_UPDATE, data:
|
|
4212
|
+
E.API,
|
|
4213
|
+
E.NONE,
|
|
4214
|
+
E.BROADCAST,
|
|
4215
|
+
B.query.slide,
|
|
4216
|
+
B.data.title ?? B.query.widget
|
|
4217
|
+
), this.bc.postMessage({ event: se.WIDGET_UPDATE, data: B });
|
|
4197
4218
|
break;
|
|
4198
4219
|
case 400:
|
|
4199
4220
|
console.warn(
|
|
4200
4221
|
"%capp%c %cbroadcast",
|
|
4201
|
-
|
|
4202
|
-
|
|
4203
|
-
|
|
4204
|
-
|
|
4205
|
-
|
|
4222
|
+
E.API,
|
|
4223
|
+
E.NONE,
|
|
4224
|
+
E.BROADCAST,
|
|
4225
|
+
B.query.slide,
|
|
4226
|
+
B.data.title ?? B.query.widget
|
|
4206
4227
|
);
|
|
4207
4228
|
break;
|
|
4208
4229
|
}
|
|
@@ -4210,9 +4231,9 @@ class Qi {
|
|
|
4210
4231
|
} else
|
|
4211
4232
|
return console.warn(
|
|
4212
4233
|
"%capi%c %cstorage",
|
|
4213
|
-
|
|
4214
|
-
|
|
4215
|
-
|
|
4234
|
+
E.API,
|
|
4235
|
+
E.NONE,
|
|
4236
|
+
E.STORAGE,
|
|
4216
4237
|
se.ERROR
|
|
4217
4238
|
), 400;
|
|
4218
4239
|
})
|
|
@@ -4230,9 +4251,9 @@ class Qi {
|
|
|
4230
4251
|
case se.UPDATE:
|
|
4231
4252
|
console.debug(
|
|
4232
4253
|
"%capi%c %cstorage",
|
|
4233
|
-
|
|
4234
|
-
|
|
4235
|
-
|
|
4254
|
+
E.API,
|
|
4255
|
+
E.NONE,
|
|
4256
|
+
E.STORAGE,
|
|
4236
4257
|
se.UPDATE,
|
|
4237
4258
|
i.data
|
|
4238
4259
|
), await this.update();
|
|
@@ -4240,13 +4261,26 @@ class Qi {
|
|
|
4240
4261
|
}
|
|
4241
4262
|
});
|
|
4242
4263
|
P(this, "cleanMessages", async () => {
|
|
4243
|
-
var
|
|
4244
|
-
const i = ((
|
|
4245
|
-
|
|
4264
|
+
var f, k;
|
|
4265
|
+
const i = ((f = this.options) == null ? void 0 : f.retention) || 345600, u = await ((k = this.sm) == null ? void 0 : k.cleanMessages(i));
|
|
4266
|
+
console.info(
|
|
4267
|
+
"%cstorage%c %clean",
|
|
4268
|
+
E.STORAGE,
|
|
4269
|
+
E.NONE,
|
|
4270
|
+
E.MESSAGES,
|
|
4271
|
+
`${u} messages deleted`
|
|
4272
|
+
);
|
|
4246
4273
|
});
|
|
4247
4274
|
P(this, "hideMessage", async (i) => {
|
|
4248
|
-
var
|
|
4249
|
-
|
|
4275
|
+
var f;
|
|
4276
|
+
const u = await ((f = this.sm) == null ? void 0 : f.hideMessage(i.id, 0));
|
|
4277
|
+
return console.info(
|
|
4278
|
+
"%cstorage%c %hide",
|
|
4279
|
+
E.STORAGE,
|
|
4280
|
+
E.NONE,
|
|
4281
|
+
E.HIDE,
|
|
4282
|
+
`${u} messages deleted`
|
|
4283
|
+
), await this.api.hideMessage(i);
|
|
4250
4284
|
});
|
|
4251
4285
|
P(this, "hideLabels", async (i) => await this.api.hideLabels(i));
|
|
4252
4286
|
P(this, "getSubscribers", async () => {
|
|
@@ -4255,9 +4289,9 @@ class Qi {
|
|
|
4255
4289
|
});
|
|
4256
4290
|
console.info(
|
|
4257
4291
|
"%cstorage%c %cslide",
|
|
4258
|
-
|
|
4259
|
-
|
|
4260
|
-
|
|
4292
|
+
E.STORAGE,
|
|
4293
|
+
E.NONE,
|
|
4294
|
+
E.SLIDE,
|
|
4261
4295
|
i.slide,
|
|
4262
4296
|
se.VERSION,
|
|
4263
4297
|
xi
|
|
@@ -4265,19 +4299,19 @@ class Qi {
|
|
|
4265
4299
|
const u = (i == null ? void 0 : i.slide) || i.app;
|
|
4266
4300
|
switch (this.bc = new BroadcastChannel(u), console.info(
|
|
4267
4301
|
"%capi%c %cbroadcast",
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4302
|
+
E.API,
|
|
4303
|
+
E.NONE,
|
|
4304
|
+
E.BROADCAST,
|
|
4271
4305
|
se.CHANNEL,
|
|
4272
4306
|
u
|
|
4273
|
-
), this.bc.onmessage = (
|
|
4274
|
-
this.actions(
|
|
4307
|
+
), this.bc.onmessage = (f) => {
|
|
4308
|
+
this.actions(f);
|
|
4275
4309
|
}, this.bc.postMessage({ event: se.STORAGE_INIT, data: {} }), this.api = new ki(i), i.storage) {
|
|
4276
4310
|
case he.DEXIE:
|
|
4277
4311
|
this.sm = new Tr(i);
|
|
4278
4312
|
break;
|
|
4279
4313
|
case he.LOCAL:
|
|
4280
|
-
this.sm = new
|
|
4314
|
+
this.sm = new Nr(i);
|
|
4281
4315
|
break;
|
|
4282
4316
|
case he.SESSION:
|
|
4283
4317
|
this.sm = new Kr(i);
|
|
@@ -4286,7 +4320,7 @@ class Qi {
|
|
|
4286
4320
|
this.sm = new jr(i);
|
|
4287
4321
|
break;
|
|
4288
4322
|
case he.WINDOW:
|
|
4289
|
-
this.sm = new
|
|
4323
|
+
this.sm = new Br(i);
|
|
4290
4324
|
break;
|
|
4291
4325
|
}
|
|
4292
4326
|
}
|
|
@@ -4303,9 +4337,9 @@ class ji {
|
|
|
4303
4337
|
var u;
|
|
4304
4338
|
return i.type !== j.CLOUD ? (console.warn(
|
|
4305
4339
|
"%capp%c %get",
|
|
4306
|
-
|
|
4307
|
-
|
|
4308
|
-
|
|
4340
|
+
E.APP,
|
|
4341
|
+
E.NONE,
|
|
4342
|
+
E.GET_DATA,
|
|
4309
4343
|
i.widget,
|
|
4310
4344
|
"wrong method call for getMessages, type used is",
|
|
4311
4345
|
i.type
|
|
@@ -4324,9 +4358,9 @@ class ji {
|
|
|
4324
4358
|
var u;
|
|
4325
4359
|
return i.type !== j.MESSAGES ? (console.warn(
|
|
4326
4360
|
"%capp%c %get",
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
|
|
4361
|
+
E.APP,
|
|
4362
|
+
E.NONE,
|
|
4363
|
+
E.GET_DATA,
|
|
4330
4364
|
i.widget,
|
|
4331
4365
|
"wrong method call for getMessages, type used is",
|
|
4332
4366
|
i.type
|
|
@@ -4345,9 +4379,9 @@ class ji {
|
|
|
4345
4379
|
var u;
|
|
4346
4380
|
return i.type !== j.SERIES ? (console.warn(
|
|
4347
4381
|
"%capp%c %get",
|
|
4348
|
-
|
|
4349
|
-
|
|
4350
|
-
|
|
4382
|
+
E.APP,
|
|
4383
|
+
E.NONE,
|
|
4384
|
+
E.GET_DATA,
|
|
4351
4385
|
i.widget,
|
|
4352
4386
|
"wrong method call for getMessages, type used is",
|
|
4353
4387
|
i.type
|
|
@@ -4362,7 +4396,7 @@ class ji {
|
|
|
4362
4396
|
this.sm = new Tr(i);
|
|
4363
4397
|
break;
|
|
4364
4398
|
case he.LOCAL:
|
|
4365
|
-
this.sm = new
|
|
4399
|
+
this.sm = new Nr(i);
|
|
4366
4400
|
break;
|
|
4367
4401
|
case he.SESSION:
|
|
4368
4402
|
this.sm = new Kr(i);
|
|
@@ -4371,12 +4405,12 @@ class ji {
|
|
|
4371
4405
|
this.sm = new jr(i);
|
|
4372
4406
|
break;
|
|
4373
4407
|
case he.WINDOW:
|
|
4374
|
-
this.sm = new
|
|
4408
|
+
this.sm = new Br(i);
|
|
4375
4409
|
break;
|
|
4376
4410
|
}
|
|
4377
4411
|
}
|
|
4378
4412
|
}
|
|
4379
|
-
class
|
|
4413
|
+
class Vi {
|
|
4380
4414
|
/**
|
|
4381
4415
|
* Main container for managing widgets and data updates
|
|
4382
4416
|
*
|
|
@@ -4384,7 +4418,7 @@ class Xi {
|
|
|
4384
4418
|
* @param callbacks functions in the widget that will receive the update
|
|
4385
4419
|
* @param selector container for the element - by default buzzcasting-slide (optional)
|
|
4386
4420
|
*/
|
|
4387
|
-
constructor(i, u,
|
|
4421
|
+
constructor(i, u, f) {
|
|
4388
4422
|
P(this, "storageReader");
|
|
4389
4423
|
P(this, "broadcastChannel");
|
|
4390
4424
|
P(this, "element");
|
|
@@ -4417,9 +4451,9 @@ class Xi {
|
|
|
4417
4451
|
*/
|
|
4418
4452
|
P(this, "getCloud", async () => this.query.type !== j.CLOUD ? (console.warn(
|
|
4419
4453
|
"%cstorage%c %cwidget",
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4454
|
+
E.STORAGE,
|
|
4455
|
+
E.NONE,
|
|
4456
|
+
E.WIDGET,
|
|
4423
4457
|
this.query.widget,
|
|
4424
4458
|
"Wrong method call for getCloud, expected type is",
|
|
4425
4459
|
this.query.type
|
|
@@ -4435,9 +4469,9 @@ class Xi {
|
|
|
4435
4469
|
*/
|
|
4436
4470
|
P(this, "getMessages", async () => this.query.type !== j.MESSAGES ? (console.warn(
|
|
4437
4471
|
"%cstorage%c %cwidget",
|
|
4438
|
-
|
|
4439
|
-
|
|
4440
|
-
|
|
4472
|
+
E.STORAGE,
|
|
4473
|
+
E.NONE,
|
|
4474
|
+
E.WIDGET,
|
|
4441
4475
|
this.query.widget,
|
|
4442
4476
|
"Wrong method call for getMessages, expected type is",
|
|
4443
4477
|
this.query.type
|
|
@@ -4453,9 +4487,9 @@ class Xi {
|
|
|
4453
4487
|
*/
|
|
4454
4488
|
P(this, "getSeries", async () => this.query.type !== j.SERIES ? (console.warn(
|
|
4455
4489
|
"%cstorage%c %cwidget",
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4490
|
+
E.STORAGE,
|
|
4491
|
+
E.NONE,
|
|
4492
|
+
E.WIDGET,
|
|
4459
4493
|
this.query.widget,
|
|
4460
4494
|
"Wrong method call for getSeries, expected type is",
|
|
4461
4495
|
this.query.type
|
|
@@ -4471,38 +4505,38 @@ class Xi {
|
|
|
4471
4505
|
* @param modal IModal
|
|
4472
4506
|
*/
|
|
4473
4507
|
P(this, "showModal", (i) => {
|
|
4474
|
-
const u =
|
|
4508
|
+
const u = Ii(this.element.attributes);
|
|
4475
4509
|
if (Object.prototype.hasOwnProperty.call(u, "data-topics")) {
|
|
4476
|
-
const
|
|
4477
|
-
|
|
4510
|
+
const C = u["data-topics"].split("-");
|
|
4511
|
+
C.length > 1 ? (u["data-widget"] = C[1], u["data-dashboard"] = C[0]) : (u["data-widget"] = C[0], u["data-dashboard"] = this.query.slide);
|
|
4478
4512
|
}
|
|
4479
|
-
const
|
|
4513
|
+
const f = { ...i.props, ...u };
|
|
4480
4514
|
console.debug(
|
|
4481
4515
|
"%cwidget",
|
|
4482
|
-
|
|
4516
|
+
E.WIDGET,
|
|
4483
4517
|
se.SHOW_MODAL,
|
|
4484
4518
|
i.showComponent,
|
|
4485
4519
|
// @ts-expect-error cannot get string type out of IFilteredAttributes props
|
|
4486
4520
|
u["data-widget"]
|
|
4487
4521
|
);
|
|
4488
|
-
const
|
|
4522
|
+
const k = new CustomEvent(se.SHOW_MODAL, {
|
|
4489
4523
|
detail: {
|
|
4490
4524
|
component: i.showComponent,
|
|
4491
|
-
props:
|
|
4525
|
+
props: f,
|
|
4492
4526
|
timeout: i == null ? void 0 : i.timeout
|
|
4493
4527
|
},
|
|
4494
4528
|
bubbles: !0,
|
|
4495
4529
|
cancelable: !0,
|
|
4496
4530
|
composed: !0
|
|
4497
4531
|
});
|
|
4498
|
-
window.dispatchEvent(
|
|
4532
|
+
window.dispatchEvent(k);
|
|
4499
4533
|
});
|
|
4500
4534
|
var K;
|
|
4501
|
-
this.element = i, this.listeners = u,
|
|
4502
|
-
let
|
|
4503
|
-
|
|
4504
|
-
const
|
|
4505
|
-
this.storageReader = new ji(
|
|
4535
|
+
this.element = i, this.listeners = u, f = typeof f < "u" ? f : "buzzcasting-slide";
|
|
4536
|
+
let k;
|
|
4537
|
+
k = { ...i.dataset }, delete k.hmr, k.slide = ((K = i.closest(f.toUpperCase())) == null ? void 0 : K.id) ?? `${f} not found`, k = nt(k), this.query = k, Ci(i);
|
|
4538
|
+
const C = window.BuzzCasting.getOptions();
|
|
4539
|
+
this.storageReader = new ji(C), this.broadcastChannel = new BroadcastChannel(k.slide), this.startListener();
|
|
4506
4540
|
}
|
|
4507
4541
|
addListener(i) {
|
|
4508
4542
|
this.listeners.push(i);
|
|
@@ -4513,11 +4547,11 @@ class Xi {
|
|
|
4513
4547
|
startListener() {
|
|
4514
4548
|
const i = this.query;
|
|
4515
4549
|
this.broadcastChannel.onmessage = async (u) => {
|
|
4516
|
-
const
|
|
4550
|
+
const f = u.data.data;
|
|
4517
4551
|
switch (u.data.event) {
|
|
4518
4552
|
case se.WIDGET_UPDATE:
|
|
4519
|
-
|
|
4520
|
-
|
|
4553
|
+
f.query.slide === i.slide && f.query.widget === i.widget && this.listeners.forEach((k) => {
|
|
4554
|
+
k(u.data.data);
|
|
4521
4555
|
});
|
|
4522
4556
|
break;
|
|
4523
4557
|
case se.SLIDE_READY:
|
|
@@ -4533,9 +4567,9 @@ class Xi {
|
|
|
4533
4567
|
subscribe() {
|
|
4534
4568
|
console.debug(
|
|
4535
4569
|
"%cwidget%c %csubscribe",
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4570
|
+
E.WIDGET,
|
|
4571
|
+
E.NONE,
|
|
4572
|
+
E.SUBSCRIBE,
|
|
4539
4573
|
this.query.slide,
|
|
4540
4574
|
this.query.widget
|
|
4541
4575
|
), this.broadcastChannel.postMessage({
|
|
@@ -4549,25 +4583,26 @@ class Xi {
|
|
|
4549
4583
|
}
|
|
4550
4584
|
export {
|
|
4551
4585
|
j as API,
|
|
4552
|
-
|
|
4586
|
+
Xi as BuzzcastingStorageManager,
|
|
4553
4587
|
ji as BuzzcastingStorageReader,
|
|
4554
|
-
|
|
4588
|
+
E as CSS,
|
|
4555
4589
|
se as EVENTS,
|
|
4556
4590
|
Vt as MODERATION,
|
|
4557
4591
|
he as STORAGE,
|
|
4558
|
-
|
|
4559
|
-
|
|
4560
|
-
|
|
4561
|
-
|
|
4562
|
-
|
|
4592
|
+
Vi as Widget,
|
|
4593
|
+
Ni as anonymize,
|
|
4594
|
+
Bi as attachedMedia,
|
|
4595
|
+
Ii as attrs,
|
|
4596
|
+
Li as brandLogo,
|
|
4563
4597
|
$i as camelCase,
|
|
4564
4598
|
Fi as camelize,
|
|
4565
|
-
|
|
4566
|
-
|
|
4599
|
+
Ci as clearContents,
|
|
4600
|
+
Gi as filterAttributes,
|
|
4567
4601
|
Ui as formatContent,
|
|
4568
4602
|
Wi as intToString,
|
|
4569
4603
|
zi as numberFormatter,
|
|
4570
|
-
|
|
4571
|
-
|
|
4604
|
+
Hi as rtl,
|
|
4605
|
+
Yi as sanitize,
|
|
4606
|
+
Qi as shuffleMessages,
|
|
4572
4607
|
nt as widgetParams
|
|
4573
4608
|
};
|