buzzcasting-storage 2.0.2 → 2.0.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.esm.js +913 -844
- package/package.json +1 -1
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var A = (M, s, v) => (
|
|
1
|
+
var di = Object.defineProperty;
|
|
2
|
+
var hi = (M, s, v) => s in M ? di(M, s, { enumerable: !0, configurable: !0, writable: !0, value: v }) : M[s] = v;
|
|
3
|
+
var A = (M, s, v) => (hi(M, typeof s != "symbol" ? s + "" : s, v), v);
|
|
4
4
|
class pi {
|
|
5
5
|
constructor(s) {
|
|
6
6
|
A(this, "options");
|
|
7
7
|
A(this, "url");
|
|
8
|
-
A(this, "
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
8
|
+
A(this, "headers", () => {
|
|
9
|
+
const s = `Bearer ${this.options.bearer}`;
|
|
10
|
+
return {
|
|
11
|
+
headers: new Headers({
|
|
12
|
+
Authorization: s,
|
|
13
|
+
Accept: "application/json"
|
|
14
|
+
// 'X-Session-Key': localStorage.getItem('guid') || 'invalid',
|
|
15
|
+
})
|
|
16
|
+
};
|
|
16
17
|
});
|
|
17
18
|
this.options = s, this.url = `https://${s.app}.buzzcasting.net`;
|
|
18
19
|
}
|
|
@@ -34,31 +35,39 @@ class pi {
|
|
|
34
35
|
};
|
|
35
36
|
}
|
|
36
37
|
async get(s) {
|
|
37
|
-
const v = this.
|
|
38
|
-
delete
|
|
39
|
-
const F = Object.keys(
|
|
40
|
-
return
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
38
|
+
const { version: v } = this.options, _ = this.headers(), j = Object.assign({}, s);
|
|
39
|
+
delete j.slide, delete j.type;
|
|
40
|
+
const F = Object.keys(j).length > 0 ? `?${new URLSearchParams(j).toString()}` : "";
|
|
41
|
+
return console.debug(
|
|
42
|
+
"%capi",
|
|
43
|
+
"color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;",
|
|
44
|
+
"call",
|
|
45
|
+
s
|
|
46
|
+
), await fetch(
|
|
47
|
+
[this.url, "api", v, s.type].join("/") + F,
|
|
48
|
+
{ ..._, method: "get" }
|
|
49
|
+
).then(async (T) => {
|
|
50
|
+
if (!T.ok)
|
|
51
|
+
throw new Error(`${T.status}`);
|
|
52
|
+
return T;
|
|
53
|
+
}).then((T) => T.json()).then((T) => (T.query = s, T)).catch((T) => ({ succes: !1, status: parseInt(T), data: [] }));
|
|
48
54
|
}
|
|
49
55
|
async hideMessage(s) {
|
|
50
|
-
const { app: v, version: _ } = this.options, j = this.auth(),
|
|
51
|
-
return console.
|
|
52
|
-
|
|
56
|
+
const { app: v, version: _ } = this.options, j = this.auth(), F = "?action=visible";
|
|
57
|
+
return console.info(
|
|
58
|
+
"%capi",
|
|
59
|
+
"color:white;background-color:grey;padding:0 4px 0 4px;border-radius:5px;",
|
|
60
|
+
"hide",
|
|
61
|
+
[v, "api", _, s.type, s.id].join("/") + F,
|
|
53
62
|
{ ...j, method: "put" }
|
|
54
63
|
), await fetch(
|
|
55
|
-
[v, "api", _, s.type, s.id].join("/") +
|
|
64
|
+
[v, "api", _, s.type, s.id].join("/") + F,
|
|
56
65
|
{ ...j, method: "put" }
|
|
57
|
-
).then((
|
|
58
|
-
if (!
|
|
59
|
-
throw new Error(
|
|
60
|
-
return
|
|
61
|
-
}).then((
|
|
66
|
+
).then((T) => {
|
|
67
|
+
if (!T.ok)
|
|
68
|
+
throw new Error(T.statusText);
|
|
69
|
+
return T;
|
|
70
|
+
}).then((T) => T.json()).catch((T) => ({ succes: !1, message: T, data: [] }));
|
|
62
71
|
}
|
|
63
72
|
}
|
|
64
73
|
var Or = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
@@ -91,19 +100,19 @@ var Er = { exports: {} };
|
|
|
91
100
|
!r && i in t || ((r = r || Array.prototype.slice.call(t, 0, i))[i] = t[i]);
|
|
92
101
|
return e.concat(r || Array.prototype.slice.call(t));
|
|
93
102
|
}
|
|
94
|
-
var
|
|
103
|
+
var F = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : Or, T = Object.keys, W = Array.isArray;
|
|
95
104
|
function q(e, t) {
|
|
96
|
-
return typeof t != "object" ||
|
|
105
|
+
return typeof t != "object" || T(t).forEach(function(n) {
|
|
97
106
|
e[n] = t[n];
|
|
98
107
|
}), e;
|
|
99
108
|
}
|
|
100
|
-
typeof Promise > "u" ||
|
|
109
|
+
typeof Promise > "u" || F.Promise || (F.Promise = Promise);
|
|
101
110
|
var oe = Object.getPrototypeOf, Z = {}.hasOwnProperty;
|
|
102
111
|
function ne(e, t) {
|
|
103
112
|
return Z.call(e, t);
|
|
104
113
|
}
|
|
105
114
|
function ze(e, t) {
|
|
106
|
-
typeof t == "function" && (t = t(oe(e))), (typeof Reflect > "u" ?
|
|
115
|
+
typeof t == "function" && (t = t(oe(e))), (typeof Reflect > "u" ? T : Reflect.ownKeys)(t).forEach(function(n) {
|
|
107
116
|
we(e, n, t[n]);
|
|
108
117
|
});
|
|
109
118
|
}
|
|
@@ -128,7 +137,7 @@ var Er = { exports: {} };
|
|
|
128
137
|
throw new Error("Assertion Failed");
|
|
129
138
|
}
|
|
130
139
|
function Ln(e) {
|
|
131
|
-
|
|
140
|
+
F.setImmediate ? setImmediate(e) : setTimeout(e, 0);
|
|
132
141
|
}
|
|
133
142
|
function ye(e, t) {
|
|
134
143
|
if (typeof t == "string" && ne(e, t))
|
|
@@ -156,7 +165,7 @@ var Er = { exports: {} };
|
|
|
156
165
|
ce(e, t[r], n[r]);
|
|
157
166
|
} else {
|
|
158
167
|
var o, a, u = t.indexOf(".");
|
|
159
|
-
u !== -1 ? (o = t.substr(0, u), (a = t.substr(u + 1)) === "" ? n === void 0 ?
|
|
168
|
+
u !== -1 ? (o = t.substr(0, u), (a = t.substr(u + 1)) === "" ? n === void 0 ? W(e) && !isNaN(parseInt(o)) ? e.splice(o, 1) : delete e[o] : e[o] = n : ce(u = !(u = e[o]) || !ne(e, o) ? e[o] = {} : u, a, n)) : n === void 0 ? W(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = n;
|
|
160
169
|
}
|
|
161
170
|
}
|
|
162
171
|
function Un(e) {
|
|
@@ -169,14 +178,14 @@ var Er = { exports: {} };
|
|
|
169
178
|
function Wn(e) {
|
|
170
179
|
return Ar.apply([], e);
|
|
171
180
|
}
|
|
172
|
-
var
|
|
181
|
+
var de = "BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Wn([8, 16, 32, 64].map(function(e) {
|
|
173
182
|
return ["Int", "Uint", "Float"].map(function(t) {
|
|
174
183
|
return t + e + "Array";
|
|
175
184
|
});
|
|
176
185
|
}))).filter(function(e) {
|
|
177
|
-
return
|
|
178
|
-
}), $n = new Set(
|
|
179
|
-
return
|
|
186
|
+
return F[e];
|
|
187
|
+
}), $n = new Set(de.map(function(e) {
|
|
188
|
+
return F[e];
|
|
180
189
|
})), qe = null;
|
|
181
190
|
function _e(e) {
|
|
182
191
|
return qe = /* @__PURE__ */ new WeakMap(), e = function t(n) {
|
|
@@ -185,7 +194,7 @@ var Er = { exports: {} };
|
|
|
185
194
|
var r = qe.get(n);
|
|
186
195
|
if (r)
|
|
187
196
|
return r;
|
|
188
|
-
if (
|
|
197
|
+
if (W(n)) {
|
|
189
198
|
r = [], qe.set(n, r);
|
|
190
199
|
for (var i = 0, o = n.length; i < o; ++i)
|
|
191
200
|
r.push(t(n[i]));
|
|
@@ -213,10 +222,10 @@ var Er = { exports: {} };
|
|
|
213
222
|
return t = e.indexOf(t), 0 <= t && e.splice(t, 1), 0 <= t;
|
|
214
223
|
}
|
|
215
224
|
var Ue = {};
|
|
216
|
-
function
|
|
225
|
+
function ge(e) {
|
|
217
226
|
var t, n, r, i;
|
|
218
227
|
if (arguments.length === 1) {
|
|
219
|
-
if (
|
|
228
|
+
if (W(e))
|
|
220
229
|
return e.slice();
|
|
221
230
|
if (this === Ue && typeof e == "string")
|
|
222
231
|
return [e];
|
|
@@ -253,7 +262,7 @@ var Er = { exports: {} };
|
|
|
253
262
|
}).join(`
|
|
254
263
|
`);
|
|
255
264
|
}
|
|
256
|
-
function
|
|
265
|
+
function gt(e, t, n, r) {
|
|
257
266
|
this.failures = t, this.failedKeys = r, this.successCount = n, this.message = Vn(e, t);
|
|
258
267
|
}
|
|
259
268
|
function $e(e, t) {
|
|
@@ -263,10 +272,10 @@ var Er = { exports: {} };
|
|
|
263
272
|
}
|
|
264
273
|
Le(We).from(Error).extend({ toString: function() {
|
|
265
274
|
return this.name + ": " + this.message;
|
|
266
|
-
} }), Le(
|
|
275
|
+
} }), Le(gt).from(We), Le($e).from(We);
|
|
267
276
|
var Yt = le.reduce(function(e, t) {
|
|
268
277
|
return e[t] = t + "Error", e;
|
|
269
|
-
}, {}), Ir = We,
|
|
278
|
+
}, {}), Ir = We, I = le.reduce(function(e, t) {
|
|
270
279
|
var n = t + "Error";
|
|
271
280
|
function r(i, o) {
|
|
272
281
|
this.name = n, i ? typeof i == "string" ? (this.message = "".concat(i).concat(o ? `
|
|
@@ -274,11 +283,11 @@ var Er = { exports: {} };
|
|
|
274
283
|
}
|
|
275
284
|
return Le(r).from(Ir), e[t] = r, e;
|
|
276
285
|
}, {});
|
|
277
|
-
|
|
286
|
+
I.Syntax = SyntaxError, I.Type = TypeError, I.Range = RangeError;
|
|
278
287
|
var Gn = nt.reduce(function(e, t) {
|
|
279
|
-
return e[t + "Error"] =
|
|
280
|
-
}, {}),
|
|
281
|
-
return ["Syntax", "Type", "Range"].indexOf(t) === -1 && (e[t + "Error"] =
|
|
288
|
+
return e[t + "Error"] = I[t], e;
|
|
289
|
+
}, {}), mt = le.reduce(function(e, t) {
|
|
290
|
+
return ["Syntax", "Type", "Range"].indexOf(t) === -1 && (e[t + "Error"] = I[t]), e;
|
|
282
291
|
}, {});
|
|
283
292
|
function V() {
|
|
284
293
|
}
|
|
@@ -338,20 +347,20 @@ var Er = { exports: {} };
|
|
|
338
347
|
return t.apply(this, arguments);
|
|
339
348
|
};
|
|
340
349
|
}
|
|
341
|
-
|
|
350
|
+
mt.ModifyError = gt, mt.DexieError = We, mt.BulkError = $e;
|
|
342
351
|
var fe = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
|
|
343
352
|
function Yn(e) {
|
|
344
353
|
fe = e;
|
|
345
354
|
}
|
|
346
|
-
var tt = {}, Hn = 100,
|
|
355
|
+
var tt = {}, Hn = 100, de = typeof Promise > "u" ? [] : function() {
|
|
347
356
|
var e = Promise.resolve();
|
|
348
357
|
if (typeof crypto > "u" || !crypto.subtle)
|
|
349
358
|
return [e, oe(e), e];
|
|
350
359
|
var t = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
351
360
|
return [t, oe(t), e];
|
|
352
|
-
}(), nt =
|
|
361
|
+
}(), nt = de[0], le = de[1], de = de[2], le = le && le.then, rt = nt && nt.constructor, Qt = !!de, it = function(e, t) {
|
|
353
362
|
ot.push([e, t]), vt && (queueMicrotask(Ur), vt = !1);
|
|
354
|
-
}, Xt = !0, vt = !0, Ae = [], bt = [], Jt = et,
|
|
363
|
+
}, Xt = !0, vt = !0, Ae = [], bt = [], Jt = et, xe = { id: "global", global: !0, ref: 0, unhandleds: [], onunhandled: V, pgp: !1, env: {}, finalize: V }, D = xe, ot = [], De = 0, wt = [];
|
|
355
364
|
function K(e) {
|
|
356
365
|
if (typeof this != "object")
|
|
357
366
|
throw new TypeError("Promises must be constructed via new");
|
|
@@ -369,8 +378,8 @@ var Er = { exports: {} };
|
|
|
369
378
|
if (o === r)
|
|
370
379
|
throw new TypeError("A promise cannot be resolved with itself.");
|
|
371
380
|
var a = r._lib && Ve();
|
|
372
|
-
o && typeof o.then == "function" ? n(r, function(u,
|
|
373
|
-
o instanceof K ? o._then(u,
|
|
381
|
+
o && typeof o.then == "function" ? n(r, function(u, d) {
|
|
382
|
+
o instanceof K ? o._then(u, d) : o.then(u, d);
|
|
374
383
|
}) : (r._state = !0, r._value = o, Xn(r)), a && Ge();
|
|
375
384
|
}
|
|
376
385
|
}, qt.bind(null, r));
|
|
@@ -382,10 +391,10 @@ var Er = { exports: {} };
|
|
|
382
391
|
var Zt = { get: function() {
|
|
383
392
|
var e = D, t = Ot;
|
|
384
393
|
function n(r, i) {
|
|
385
|
-
var o = this, a = !e.global && (e !== D || t !== Ot), u = a && !Oe(),
|
|
386
|
-
en(o, new Qn(Zn(r, e, a, u), Zn(i, e, a, u), l,
|
|
394
|
+
var o = this, a = !e.global && (e !== D || t !== Ot), u = a && !Oe(), d = new K(function(l, g) {
|
|
395
|
+
en(o, new Qn(Zn(r, e, a, u), Zn(i, e, a, u), l, g, e));
|
|
387
396
|
});
|
|
388
|
-
return this._consoleTask && (
|
|
397
|
+
return this._consoleTask && (d._consoleTask = this._consoleTask), d;
|
|
389
398
|
}
|
|
390
399
|
return n.prototype = tt, n;
|
|
391
400
|
}, set: function(e) {
|
|
@@ -438,7 +447,7 @@ var Er = { exports: {} };
|
|
|
438
447
|
}
|
|
439
448
|
}
|
|
440
449
|
function Ur() {
|
|
441
|
-
Te(
|
|
450
|
+
Te(xe, function() {
|
|
442
451
|
Ve() && Ge();
|
|
443
452
|
});
|
|
444
453
|
}
|
|
@@ -506,12 +515,12 @@ var Er = { exports: {} };
|
|
|
506
515
|
var n = this;
|
|
507
516
|
return e < 1 / 0 ? new K(function(r, i) {
|
|
508
517
|
var o = setTimeout(function() {
|
|
509
|
-
return i(new
|
|
518
|
+
return i(new I.Timeout(t));
|
|
510
519
|
}, e);
|
|
511
520
|
n.then(r, i).finally(clearTimeout.bind(null, o));
|
|
512
521
|
}) : this;
|
|
513
|
-
} }), typeof Symbol < "u" && Symbol.toStringTag && we(K.prototype, Symbol.toStringTag, "Dexie.Promise"),
|
|
514
|
-
var e =
|
|
522
|
+
} }), typeof Symbol < "u" && Symbol.toStringTag && we(K.prototype, Symbol.toStringTag, "Dexie.Promise"), xe.env = Jn(), ze(K, { all: function() {
|
|
523
|
+
var e = ge.apply(null, arguments).map(St);
|
|
515
524
|
return new K(function(t, n) {
|
|
516
525
|
e.length === 0 && t([]);
|
|
517
526
|
var r = e.length;
|
|
@@ -526,7 +535,7 @@ var Er = { exports: {} };
|
|
|
526
535
|
e.then(t, n);
|
|
527
536
|
}) : new K(tt, !0, e);
|
|
528
537
|
}, reject: _t, race: function() {
|
|
529
|
-
var e =
|
|
538
|
+
var e = ge.apply(null, arguments).map(St);
|
|
530
539
|
return new K(function(t, n) {
|
|
531
540
|
e.map(function(r) {
|
|
532
541
|
return K.resolve(r).then(t, n);
|
|
@@ -538,7 +547,7 @@ var Er = { exports: {} };
|
|
|
538
547
|
return D = e;
|
|
539
548
|
} }, totalEchoes: { get: function() {
|
|
540
549
|
return Ot;
|
|
541
|
-
} }, newPSD:
|
|
550
|
+
} }, newPSD: ke, usePSD: Te, scheduler: { get: function() {
|
|
542
551
|
return it;
|
|
543
552
|
}, set: function(e) {
|
|
544
553
|
it = e;
|
|
@@ -548,12 +557,12 @@ var Er = { exports: {} };
|
|
|
548
557
|
Jt = e;
|
|
549
558
|
} }, follow: function(e, t) {
|
|
550
559
|
return new K(function(n, r) {
|
|
551
|
-
return
|
|
560
|
+
return ke(function(i, o) {
|
|
552
561
|
var a = D;
|
|
553
562
|
a.unhandleds = [], a.onunhandled = o, a.finalize = Ke(function() {
|
|
554
|
-
var u,
|
|
563
|
+
var u, d = this;
|
|
555
564
|
u = function() {
|
|
556
|
-
|
|
565
|
+
d.unhandleds.length === 0 ? i() : o(d.unhandleds[0]);
|
|
557
566
|
}, wt.push(function l() {
|
|
558
567
|
u(), wt.splice(wt.indexOf(l), 1);
|
|
559
568
|
}), ++De, it(function() {
|
|
@@ -563,7 +572,7 @@ var Er = { exports: {} };
|
|
|
563
572
|
}, t, n, r);
|
|
564
573
|
});
|
|
565
574
|
} }), rt && (rt.allSettled && we(K, "allSettled", function() {
|
|
566
|
-
var e =
|
|
575
|
+
var e = ge.apply(null, arguments).map(St);
|
|
567
576
|
return new K(function(t) {
|
|
568
577
|
e.length === 0 && t([]);
|
|
569
578
|
var n = e.length, r = new Array(n);
|
|
@@ -578,7 +587,7 @@ var Er = { exports: {} };
|
|
|
578
587
|
});
|
|
579
588
|
});
|
|
580
589
|
}), rt.any && typeof AggregateError < "u" && we(K, "any", function() {
|
|
581
|
-
var e =
|
|
590
|
+
var e = ge.apply(null, arguments).map(St);
|
|
582
591
|
return new K(function(t, n) {
|
|
583
592
|
e.length === 0 && n(new AggregateError([]));
|
|
584
593
|
var r = e.length, i = new Array(r);
|
|
@@ -591,10 +600,10 @@ var Er = { exports: {} };
|
|
|
591
600
|
});
|
|
592
601
|
});
|
|
593
602
|
}));
|
|
594
|
-
var ee = { awaits: 0, echoes: 0, id: 0 }, Wr = 0,
|
|
595
|
-
function
|
|
603
|
+
var ee = { awaits: 0, echoes: 0, id: 0 }, Wr = 0, xt = [], kt = 0, Ot = 0, $r = 0;
|
|
604
|
+
function ke(e, t, n, r) {
|
|
596
605
|
var i = D, o = Object.create(i);
|
|
597
|
-
return o.parent = i, o.ref = 0, o.global = !1, o.id = ++$r,
|
|
606
|
+
return o.parent = i, o.ref = 0, o.global = !1, o.id = ++$r, xe.env, o.env = Qt ? { Promise: K, PromiseProp: { value: K, configurable: !0, writable: !0 }, all: K.all, race: K.race, allSettled: K.allSettled, any: K.any, resolve: K.resolve, reject: K.reject } : {}, t && q(o, t), ++i.ref, o.finalize = function() {
|
|
598
607
|
--this.parent.ref || this.parent.finalize();
|
|
599
608
|
}, r = Te(o, e, n, r), o.ref === 0 && o.finalize(), r;
|
|
600
609
|
}
|
|
@@ -612,18 +621,18 @@ var Er = { exports: {} };
|
|
|
612
621
|
})) : e;
|
|
613
622
|
}
|
|
614
623
|
function Vr() {
|
|
615
|
-
var e =
|
|
616
|
-
|
|
624
|
+
var e = xt[xt.length - 1];
|
|
625
|
+
xt.pop(), Se(e, !1);
|
|
617
626
|
}
|
|
618
627
|
function Se(e, t) {
|
|
619
628
|
var n, r = D;
|
|
620
|
-
(t ? !ee.echoes ||
|
|
621
|
-
++Ot, ee.echoes && --ee.echoes != 0 || (ee.echoes = ee.awaits = ee.id = 0),
|
|
622
|
-
}).bind(null, e) : Vr), e !== D && (D = e, r ===
|
|
629
|
+
(t ? !ee.echoes || kt++ && e === D : !kt || --kt && e === D) || queueMicrotask(t ? (function(i) {
|
|
630
|
+
++Ot, ee.echoes && --ee.echoes != 0 || (ee.echoes = ee.awaits = ee.id = 0), xt.push(D), Se(i, !0);
|
|
631
|
+
}).bind(null, e) : Vr), e !== D && (D = e, r === xe && (xe.env = Jn()), Qt && (n = xe.env.Promise, t = e.env, (r.global || e.global) && (Object.defineProperty(F, "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))));
|
|
623
632
|
}
|
|
624
633
|
function Jn() {
|
|
625
|
-
var e =
|
|
626
|
-
return Qt ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(
|
|
634
|
+
var e = F.Promise;
|
|
635
|
+
return Qt ? { Promise: e, PromiseProp: Object.getOwnPropertyDescriptor(F, "Promise"), all: e.all, race: e.race, allSettled: e.allSettled, any: e.any, resolve: e.resolve, reject: e.reject } : {};
|
|
627
636
|
}
|
|
628
637
|
function Te(e, t, n, r, i) {
|
|
629
638
|
var o = D;
|
|
@@ -645,10 +654,10 @@ var Er = { exports: {} };
|
|
|
645
654
|
};
|
|
646
655
|
}
|
|
647
656
|
function nn(e) {
|
|
648
|
-
Promise === rt && ee.echoes === 0 ?
|
|
657
|
+
Promise === rt && ee.echoes === 0 ? kt === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
649
658
|
}
|
|
650
659
|
("" + le).indexOf("[native code]") === -1 && (Ye = Oe = V);
|
|
651
|
-
var X = K.reject,
|
|
660
|
+
var X = K.reject, de = "4.0.1-beta.10", Be = "", me = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", qn = "String expected.", He = [], Et = "__dbnames", rn = "readonly", on = "readwrite";
|
|
652
661
|
function Ie(e, t) {
|
|
653
662
|
return e ? t ? function() {
|
|
654
663
|
return e.apply(this, arguments) && t.apply(this, arguments);
|
|
@@ -663,9 +672,9 @@ var Er = { exports: {} };
|
|
|
663
672
|
};
|
|
664
673
|
}
|
|
665
674
|
function tr() {
|
|
666
|
-
throw
|
|
675
|
+
throw I.Type();
|
|
667
676
|
}
|
|
668
|
-
function
|
|
677
|
+
function U(e, t) {
|
|
669
678
|
try {
|
|
670
679
|
var n = nr(e), r = nr(t);
|
|
671
680
|
if (n !== r)
|
|
@@ -677,17 +686,17 @@ var Er = { exports: {} };
|
|
|
677
686
|
return t < e ? 1 : e < t ? -1 : 0;
|
|
678
687
|
case "binary":
|
|
679
688
|
return function(i, o) {
|
|
680
|
-
for (var a = i.length, u = o.length,
|
|
689
|
+
for (var a = i.length, u = o.length, d = a < u ? a : u, l = 0; l < d; ++l)
|
|
681
690
|
if (i[l] !== o[l])
|
|
682
691
|
return i[l] < o[l] ? -1 : 1;
|
|
683
692
|
return a === u ? 0 : a < u ? -1 : 1;
|
|
684
693
|
}(rr(e), rr(t));
|
|
685
694
|
case "Array":
|
|
686
695
|
return function(i, o) {
|
|
687
|
-
for (var a = i.length, u = o.length,
|
|
688
|
-
var
|
|
689
|
-
if (
|
|
690
|
-
return
|
|
696
|
+
for (var a = i.length, u = o.length, d = a < u ? a : u, l = 0; l < d; ++l) {
|
|
697
|
+
var g = U(i[l], o[l]);
|
|
698
|
+
if (g !== 0)
|
|
699
|
+
return g;
|
|
691
700
|
}
|
|
692
701
|
return a === u ? 0 : a < u ? -1 : 1;
|
|
693
702
|
}(e, t);
|
|
@@ -705,60 +714,60 @@ var Er = { exports: {} };
|
|
|
705
714
|
}
|
|
706
715
|
var ir = (Y.prototype._trans = function(e, t, n) {
|
|
707
716
|
var r = this._tx || D.trans, i = this.name, o = fe && typeof console < "u" && console.createTask && console.createTask("Dexie: ".concat(e === "readonly" ? "read" : "write", " ").concat(this.name));
|
|
708
|
-
function a(l,
|
|
717
|
+
function a(l, g, c) {
|
|
709
718
|
if (!c.schema[i])
|
|
710
|
-
throw new
|
|
719
|
+
throw new I.NotFound("Table " + i + " not part of transaction");
|
|
711
720
|
return t(c.idbtrans, c);
|
|
712
721
|
}
|
|
713
722
|
var u = Ve();
|
|
714
723
|
try {
|
|
715
|
-
var
|
|
724
|
+
var d = r && r.db._novip === this.db._novip ? r === D.trans ? r._promise(e, a, n) : ke(function() {
|
|
716
725
|
return r._promise(e, a, n);
|
|
717
|
-
}, { trans: r, transless: D.transless || D }) : function l(
|
|
718
|
-
if (
|
|
719
|
-
var y =
|
|
726
|
+
}, { trans: r, transless: D.transless || D }) : function l(g, c, f, h) {
|
|
727
|
+
if (g.idbdb && (g._state.openComplete || D.letThrough || g._vip)) {
|
|
728
|
+
var y = g._createTransaction(c, f, g._dbSchema);
|
|
720
729
|
try {
|
|
721
|
-
y.create(),
|
|
722
|
-
} catch (
|
|
723
|
-
return
|
|
724
|
-
return l(
|
|
725
|
-
})) : X(
|
|
730
|
+
y.create(), g._state.PR1398_maxLoop = 3;
|
|
731
|
+
} catch (m) {
|
|
732
|
+
return m.name === Yt.InvalidState && g.isOpen() && 0 < --g._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), g.close({ disableAutoOpen: !1 }), g.open().then(function() {
|
|
733
|
+
return l(g, c, f, h);
|
|
734
|
+
})) : X(m);
|
|
726
735
|
}
|
|
727
|
-
return y._promise(c, function(
|
|
728
|
-
return
|
|
729
|
-
return D.trans = y,
|
|
736
|
+
return y._promise(c, function(m, p) {
|
|
737
|
+
return ke(function() {
|
|
738
|
+
return D.trans = y, h(m, p, y);
|
|
730
739
|
});
|
|
731
|
-
}).then(function(
|
|
740
|
+
}).then(function(m) {
|
|
732
741
|
if (c === "readwrite")
|
|
733
742
|
try {
|
|
734
743
|
y.idbtrans.commit();
|
|
735
744
|
} catch {
|
|
736
745
|
}
|
|
737
|
-
return c === "readonly" ?
|
|
738
|
-
return
|
|
746
|
+
return c === "readonly" ? m : y._completion.then(function() {
|
|
747
|
+
return m;
|
|
739
748
|
});
|
|
740
749
|
});
|
|
741
750
|
}
|
|
742
|
-
if (
|
|
743
|
-
return X(new
|
|
744
|
-
if (!
|
|
745
|
-
if (!
|
|
746
|
-
return X(new
|
|
747
|
-
|
|
751
|
+
if (g._state.openComplete)
|
|
752
|
+
return X(new I.DatabaseClosed(g._state.dbOpenError));
|
|
753
|
+
if (!g._state.isBeingOpened) {
|
|
754
|
+
if (!g._state.autoOpen)
|
|
755
|
+
return X(new I.DatabaseClosed());
|
|
756
|
+
g.open().catch(V);
|
|
748
757
|
}
|
|
749
|
-
return
|
|
750
|
-
return l(
|
|
758
|
+
return g._state.dbReadyPromise.then(function() {
|
|
759
|
+
return l(g, c, f, h);
|
|
751
760
|
});
|
|
752
761
|
}(this.db, e, [this.name], a);
|
|
753
|
-
return o && (
|
|
762
|
+
return o && (d._consoleTask = o, d = d.catch(function(l) {
|
|
754
763
|
return console.trace(l), X(l);
|
|
755
|
-
})),
|
|
764
|
+
})), d;
|
|
756
765
|
} finally {
|
|
757
766
|
u && Ge();
|
|
758
767
|
}
|
|
759
768
|
}, Y.prototype.get = function(e, t) {
|
|
760
769
|
var n = this;
|
|
761
|
-
return e && e.constructor === Object ? this.where(e).first(t) : e == null ? X(new
|
|
770
|
+
return e && e.constructor === Object ? this.where(e).first(t) : e == null ? X(new I.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(r) {
|
|
762
771
|
return n.core.get({ trans: r, key: e }).then(function(i) {
|
|
763
772
|
return n.hook.reading.fire(i);
|
|
764
773
|
});
|
|
@@ -766,23 +775,23 @@ var Er = { exports: {} };
|
|
|
766
775
|
}, Y.prototype.where = function(e) {
|
|
767
776
|
if (typeof e == "string")
|
|
768
777
|
return new this.db.WhereClause(this, e);
|
|
769
|
-
if (
|
|
778
|
+
if (W(e))
|
|
770
779
|
return new this.db.WhereClause(this, "[".concat(e.join("+"), "]"));
|
|
771
|
-
var t =
|
|
780
|
+
var t = T(e);
|
|
772
781
|
if (t.length === 1)
|
|
773
782
|
return this.where(t[0]).equals(e[t[0]]);
|
|
774
|
-
var n = this.schema.indexes.concat(this.schema.primKey).filter(function(
|
|
775
|
-
if (
|
|
776
|
-
return 0 <=
|
|
783
|
+
var n = this.schema.indexes.concat(this.schema.primKey).filter(function(d) {
|
|
784
|
+
if (d.compound && t.every(function(g) {
|
|
785
|
+
return 0 <= d.keyPath.indexOf(g);
|
|
777
786
|
})) {
|
|
778
787
|
for (var l = 0; l < t.length; ++l)
|
|
779
|
-
if (t.indexOf(
|
|
788
|
+
if (t.indexOf(d.keyPath[l]) === -1)
|
|
780
789
|
return !1;
|
|
781
790
|
return !0;
|
|
782
791
|
}
|
|
783
792
|
return !1;
|
|
784
|
-
}).sort(function(
|
|
785
|
-
return
|
|
793
|
+
}).sort(function(d, l) {
|
|
794
|
+
return d.keyPath.length - l.keyPath.length;
|
|
786
795
|
})[0];
|
|
787
796
|
if (n && this.db._maxKey !== Be) {
|
|
788
797
|
var a = n.keyPath.slice(0, t.length);
|
|
@@ -792,17 +801,17 @@ var Er = { exports: {} };
|
|
|
792
801
|
}
|
|
793
802
|
!n && fe && console.warn("The query ".concat(JSON.stringify(e), " on ").concat(this.name, " would benefit from a ") + "compound index [".concat(t.join("+"), "]"));
|
|
794
803
|
var r = this.schema.idxByName, i = this.db._deps.indexedDB;
|
|
795
|
-
function o(
|
|
796
|
-
return i.cmp(
|
|
804
|
+
function o(d, l) {
|
|
805
|
+
return i.cmp(d, l) === 0;
|
|
797
806
|
}
|
|
798
807
|
var u = t.reduce(function(f, l) {
|
|
799
|
-
var
|
|
800
|
-
return [
|
|
801
|
-
return y = ye(y, l),
|
|
802
|
-
return o(
|
|
808
|
+
var g = f[0], c = f[1], f = r[l], h = e[l];
|
|
809
|
+
return [g || f, g || !f ? Ie(c, f && f.multi ? function(y) {
|
|
810
|
+
return y = ye(y, l), W(y) && y.some(function(m) {
|
|
811
|
+
return o(h, m);
|
|
803
812
|
});
|
|
804
813
|
} : function(y) {
|
|
805
|
-
return o(
|
|
814
|
+
return o(h, ye(y, l));
|
|
806
815
|
}) : c];
|
|
807
816
|
}, [null, null]), a = u[0], u = u[1];
|
|
808
817
|
return a ? this.where(a.name).equals(e[a.keyPath]).filter(u) : n ? this.filter(u) : this.where(t).equals("");
|
|
@@ -821,7 +830,7 @@ var Er = { exports: {} };
|
|
|
821
830
|
}, Y.prototype.toCollection = function() {
|
|
822
831
|
return new this.db.Collection(new this.db.WhereClause(this));
|
|
823
832
|
}, Y.prototype.orderBy = function(e) {
|
|
824
|
-
return new this.db.Collection(new this.db.WhereClause(this,
|
|
833
|
+
return new this.db.Collection(new this.db.WhereClause(this, W(e) ? "[".concat(e.join("+"), "]") : e));
|
|
825
834
|
}, Y.prototype.reverse = function() {
|
|
826
835
|
return this.toCollection().reverse();
|
|
827
836
|
}, Y.prototype.mapToClass = function(e) {
|
|
@@ -829,33 +838,33 @@ var Er = { exports: {} };
|
|
|
829
838
|
function i() {
|
|
830
839
|
return t !== null && t.apply(this, arguments) || this;
|
|
831
840
|
}
|
|
832
|
-
(this.schema.mappedClass = e).prototype instanceof tr && (function(
|
|
841
|
+
(this.schema.mappedClass = e).prototype instanceof tr && (function(d, l) {
|
|
833
842
|
if (typeof l != "function" && l !== null)
|
|
834
843
|
throw new TypeError("Class extends value " + String(l) + " is not a constructor or null");
|
|
835
|
-
function
|
|
836
|
-
this.constructor =
|
|
844
|
+
function g() {
|
|
845
|
+
this.constructor = d;
|
|
837
846
|
}
|
|
838
|
-
v(
|
|
847
|
+
v(d, l), d.prototype = l === null ? Object.create(l) : (g.prototype = l.prototype, new g());
|
|
839
848
|
}(i, t = e), Object.defineProperty(i.prototype, "db", { get: function() {
|
|
840
849
|
return n;
|
|
841
850
|
}, enumerable: !1, configurable: !0 }), i.prototype.table = function() {
|
|
842
851
|
return r;
|
|
843
852
|
}, e = i);
|
|
844
853
|
for (var o = /* @__PURE__ */ new Set(), a = e.prototype; a; a = oe(a))
|
|
845
|
-
Object.getOwnPropertyNames(a).forEach(function(
|
|
846
|
-
return o.add(
|
|
854
|
+
Object.getOwnPropertyNames(a).forEach(function(d) {
|
|
855
|
+
return o.add(d);
|
|
847
856
|
});
|
|
848
|
-
function u(
|
|
849
|
-
if (!
|
|
850
|
-
return
|
|
851
|
-
var l,
|
|
852
|
-
for (l in
|
|
857
|
+
function u(d) {
|
|
858
|
+
if (!d)
|
|
859
|
+
return d;
|
|
860
|
+
var l, g = Object.create(e.prototype);
|
|
861
|
+
for (l in d)
|
|
853
862
|
if (!o.has(l))
|
|
854
863
|
try {
|
|
855
|
-
|
|
864
|
+
g[l] = d[l];
|
|
856
865
|
} catch {
|
|
857
866
|
}
|
|
858
|
-
return
|
|
867
|
+
return g;
|
|
859
868
|
}
|
|
860
869
|
return this.schema.readHook && this.hook.reading.unsubscribe(this.schema.readHook), this.schema.readHook = u, this.hook("reading", u), e;
|
|
861
870
|
}, Y.prototype.defineClass = function() {
|
|
@@ -877,7 +886,7 @@ var Er = { exports: {} };
|
|
|
877
886
|
return u;
|
|
878
887
|
});
|
|
879
888
|
}, Y.prototype.update = function(e, t) {
|
|
880
|
-
return typeof e != "object" ||
|
|
889
|
+
return typeof e != "object" || W(e) ? this.where(":id").equals(e).modify(t) : (e = ye(e, this.schema.primKey.keyPath), e === void 0 ? X(new I.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(e).modify(t));
|
|
881
890
|
}, Y.prototype.put = function(e, t) {
|
|
882
891
|
var n = this, r = this.schema.primKey, i = r.auto, o = r.keyPath, a = e;
|
|
883
892
|
return o && i && (a = Pt(o)(e)), this._trans("readwrite", function(u) {
|
|
@@ -920,15 +929,15 @@ var Er = { exports: {} };
|
|
|
920
929
|
return this._trans("readwrite", function(a) {
|
|
921
930
|
var l = r.schema.primKey, u = l.auto, l = l.keyPath;
|
|
922
931
|
if (l && i)
|
|
923
|
-
throw new
|
|
932
|
+
throw new I.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
924
933
|
if (i && i.length !== e.length)
|
|
925
|
-
throw new
|
|
926
|
-
var
|
|
934
|
+
throw new I.InvalidArgument("Arguments objects and keys must have the same length");
|
|
935
|
+
var d = e.length, l = l && u ? e.map(Pt(l)) : e;
|
|
927
936
|
return r.core.mutate({ trans: a, type: "add", keys: i, values: l, wantResults: o }).then(function(y) {
|
|
928
|
-
var c = y.numFailures, f = y.results,
|
|
937
|
+
var c = y.numFailures, f = y.results, h = y.lastResult, y = y.failures;
|
|
929
938
|
if (c === 0)
|
|
930
|
-
return o ? f :
|
|
931
|
-
throw new $e("".concat(r.name, ".bulkAdd(): ").concat(c, " of ").concat(
|
|
939
|
+
return o ? f : h;
|
|
940
|
+
throw new $e("".concat(r.name, ".bulkAdd(): ").concat(c, " of ").concat(d, " operations failed"), y);
|
|
932
941
|
});
|
|
933
942
|
});
|
|
934
943
|
}, Y.prototype.bulkPut = function(e, t, n) {
|
|
@@ -936,15 +945,15 @@ var Er = { exports: {} };
|
|
|
936
945
|
return this._trans("readwrite", function(a) {
|
|
937
946
|
var l = r.schema.primKey, u = l.auto, l = l.keyPath;
|
|
938
947
|
if (l && i)
|
|
939
|
-
throw new
|
|
948
|
+
throw new I.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
940
949
|
if (i && i.length !== e.length)
|
|
941
|
-
throw new
|
|
942
|
-
var
|
|
950
|
+
throw new I.InvalidArgument("Arguments objects and keys must have the same length");
|
|
951
|
+
var d = e.length, l = l && u ? e.map(Pt(l)) : e;
|
|
943
952
|
return r.core.mutate({ trans: a, type: "put", keys: i, values: l, wantResults: o }).then(function(y) {
|
|
944
|
-
var c = y.numFailures, f = y.results,
|
|
953
|
+
var c = y.numFailures, f = y.results, h = y.lastResult, y = y.failures;
|
|
945
954
|
if (c === 0)
|
|
946
|
-
return o ? f :
|
|
947
|
-
throw new $e("".concat(r.name, ".bulkPut(): ").concat(c, " of ").concat(
|
|
955
|
+
return o ? f : h;
|
|
956
|
+
throw new $e("".concat(r.name, ".bulkPut(): ").concat(c, " of ").concat(d, " operations failed"), y);
|
|
948
957
|
});
|
|
949
958
|
});
|
|
950
959
|
}, Y.prototype.bulkUpdate = function(e) {
|
|
@@ -955,31 +964,31 @@ var Er = { exports: {} };
|
|
|
955
964
|
}), o = [];
|
|
956
965
|
return this._trans("readwrite", function(a) {
|
|
957
966
|
return n.getMany({ trans: a, keys: r, cache: "clone" }).then(function(u) {
|
|
958
|
-
var
|
|
967
|
+
var d = [], l = [];
|
|
959
968
|
e.forEach(function(c, f) {
|
|
960
|
-
var
|
|
961
|
-
if (
|
|
969
|
+
var h = c.key, y = c.changes, m = u[f];
|
|
970
|
+
if (m) {
|
|
962
971
|
for (var p = 0, b = Object.keys(y); p < b.length; p++) {
|
|
963
|
-
var w = b[p],
|
|
972
|
+
var w = b[p], x = y[w];
|
|
964
973
|
if (w === t.schema.primKey.keyPath) {
|
|
965
|
-
if (
|
|
966
|
-
throw new
|
|
974
|
+
if (U(x, h) !== 0)
|
|
975
|
+
throw new I.Constraint("Cannot update primary key in bulkUpdate()");
|
|
967
976
|
} else
|
|
968
|
-
ce(
|
|
977
|
+
ce(m, w, x);
|
|
969
978
|
}
|
|
970
|
-
o.push(f),
|
|
979
|
+
o.push(f), d.push(h), l.push(m);
|
|
971
980
|
}
|
|
972
981
|
});
|
|
973
|
-
var
|
|
974
|
-
return n.mutate({ trans: a, type: "put", keys:
|
|
975
|
-
var f = c.numFailures,
|
|
982
|
+
var g = d.length;
|
|
983
|
+
return n.mutate({ trans: a, type: "put", keys: d, values: l, updates: { keys: r, changeSpecs: i } }).then(function(c) {
|
|
984
|
+
var f = c.numFailures, h = c.failures;
|
|
976
985
|
if (f === 0)
|
|
977
|
-
return
|
|
978
|
-
for (var y = 0,
|
|
979
|
-
var p, b =
|
|
980
|
-
w != null && (p =
|
|
986
|
+
return g;
|
|
987
|
+
for (var y = 0, m = Object.keys(h); y < m.length; y++) {
|
|
988
|
+
var p, b = m[y], w = o[Number(b)];
|
|
989
|
+
w != null && (p = h[b], delete h[b], h[w] = p);
|
|
981
990
|
}
|
|
982
|
-
throw new $e("".concat(t.name, ".bulkUpdate(): ").concat(f, " of ").concat(
|
|
991
|
+
throw new $e("".concat(t.name, ".bulkUpdate(): ").concat(f, " of ").concat(g, " operations failed"), h);
|
|
983
992
|
});
|
|
984
993
|
});
|
|
985
994
|
});
|
|
@@ -999,8 +1008,8 @@ var Er = { exports: {} };
|
|
|
999
1008
|
function at(e) {
|
|
1000
1009
|
function t(a, u) {
|
|
1001
1010
|
if (u) {
|
|
1002
|
-
for (var
|
|
1003
|
-
l[
|
|
1011
|
+
for (var d = arguments.length, l = new Array(d - 1); --d; )
|
|
1012
|
+
l[d - 1] = arguments[d];
|
|
1004
1013
|
return n[a].subscribe.apply(null, l), e;
|
|
1005
1014
|
}
|
|
1006
1015
|
if (typeof a == "string")
|
|
@@ -1011,32 +1020,32 @@ var Er = { exports: {} };
|
|
|
1011
1020
|
for (var r = 1, i = arguments.length; r < i; ++r)
|
|
1012
1021
|
o(arguments[r]);
|
|
1013
1022
|
return t;
|
|
1014
|
-
function o(a, u,
|
|
1023
|
+
function o(a, u, d) {
|
|
1015
1024
|
if (typeof a != "object") {
|
|
1016
1025
|
var l;
|
|
1017
1026
|
u = u || zr;
|
|
1018
|
-
var
|
|
1019
|
-
|
|
1027
|
+
var g = { subscribers: [], fire: d = d || V, subscribe: function(c) {
|
|
1028
|
+
g.subscribers.indexOf(c) === -1 && (g.subscribers.push(c), g.fire = u(g.fire, c));
|
|
1020
1029
|
}, unsubscribe: function(c) {
|
|
1021
|
-
|
|
1030
|
+
g.subscribers = g.subscribers.filter(function(f) {
|
|
1022
1031
|
return f !== c;
|
|
1023
|
-
}),
|
|
1032
|
+
}), g.fire = g.subscribers.reduce(u, d);
|
|
1024
1033
|
} };
|
|
1025
|
-
return n[a] = t[a] =
|
|
1034
|
+
return n[a] = t[a] = g;
|
|
1026
1035
|
}
|
|
1027
|
-
|
|
1036
|
+
T(l = a).forEach(function(c) {
|
|
1028
1037
|
var f = l[c];
|
|
1029
|
-
if (
|
|
1038
|
+
if (W(f))
|
|
1030
1039
|
o(c, l[c][0], l[c][1]);
|
|
1031
1040
|
else {
|
|
1032
1041
|
if (f !== "asap")
|
|
1033
|
-
throw new
|
|
1034
|
-
var
|
|
1035
|
-
for (var y = arguments.length,
|
|
1036
|
-
|
|
1037
|
-
|
|
1042
|
+
throw new I.InvalidArgument("Invalid event config");
|
|
1043
|
+
var h = o(c, et, function() {
|
|
1044
|
+
for (var y = arguments.length, m = new Array(y); y--; )
|
|
1045
|
+
m[y] = arguments[y];
|
|
1046
|
+
h.subscribers.forEach(function(p) {
|
|
1038
1047
|
Ln(function() {
|
|
1039
|
-
p.apply(null,
|
|
1048
|
+
p.apply(null, m);
|
|
1040
1049
|
});
|
|
1041
1050
|
});
|
|
1042
1051
|
});
|
|
@@ -1064,7 +1073,7 @@ var Er = { exports: {} };
|
|
|
1064
1073
|
return t.primaryKey;
|
|
1065
1074
|
var n = t.getIndexByKeyPath(e.index);
|
|
1066
1075
|
if (!n)
|
|
1067
|
-
throw new
|
|
1076
|
+
throw new I.Schema("KeyPath " + e.index + " on object store " + t.name + " is not indexed");
|
|
1068
1077
|
return n;
|
|
1069
1078
|
}
|
|
1070
1079
|
function or(e, t, n) {
|
|
@@ -1074,13 +1083,13 @@ var Er = { exports: {} };
|
|
|
1074
1083
|
function Ct(e, t, n, r) {
|
|
1075
1084
|
var i = e.replayFilter ? Ie(e.filter, e.replayFilter()) : e.filter;
|
|
1076
1085
|
if (e.or) {
|
|
1077
|
-
var o = {}, a = function(u,
|
|
1078
|
-
var
|
|
1079
|
-
i && !i(
|
|
1080
|
-
return
|
|
1086
|
+
var o = {}, a = function(u, d, l) {
|
|
1087
|
+
var g, c;
|
|
1088
|
+
i && !i(d, l, function(f) {
|
|
1089
|
+
return d.stop(f);
|
|
1081
1090
|
}, function(f) {
|
|
1082
|
-
return
|
|
1083
|
-
}) || ((c = "" + (
|
|
1091
|
+
return d.fail(f);
|
|
1092
|
+
}) || ((c = "" + (g = d.primaryKey)) == "[object ArrayBuffer]" && (c = "" + new Uint8Array(g)), ne(o, c) || (o[c] = !0, t(u, d, l)));
|
|
1084
1093
|
};
|
|
1085
1094
|
return Promise.all([e.or._iterate(a, n), ar(or(e, r, n), e.algorithm, a, !e.keysOnly && e.valueMapper)]);
|
|
1086
1095
|
}
|
|
@@ -1108,28 +1117,28 @@ var Er = { exports: {} };
|
|
|
1108
1117
|
});
|
|
1109
1118
|
});
|
|
1110
1119
|
}
|
|
1111
|
-
var Gr = (
|
|
1120
|
+
var Gr = (L.prototype._read = function(e, t) {
|
|
1112
1121
|
var n = this._ctx;
|
|
1113
1122
|
return n.error ? n.table._trans(null, X.bind(null, n.error)) : n.table._trans("readonly", e).then(t);
|
|
1114
|
-
},
|
|
1123
|
+
}, L.prototype._write = function(e) {
|
|
1115
1124
|
var t = this._ctx;
|
|
1116
1125
|
return t.error ? t.table._trans(null, X.bind(null, t.error)) : t.table._trans("readwrite", e, "locked");
|
|
1117
|
-
},
|
|
1126
|
+
}, L.prototype._addAlgorithm = function(e) {
|
|
1118
1127
|
var t = this._ctx;
|
|
1119
1128
|
t.algorithm = Ie(t.algorithm, e);
|
|
1120
|
-
},
|
|
1129
|
+
}, L.prototype._iterate = function(e, t) {
|
|
1121
1130
|
return Ct(this._ctx, e, t, this._ctx.table.core);
|
|
1122
|
-
},
|
|
1131
|
+
}, L.prototype.clone = function(e) {
|
|
1123
1132
|
var t = Object.create(this.constructor.prototype), n = Object.create(this._ctx);
|
|
1124
1133
|
return e && q(n, e), t._ctx = n, t;
|
|
1125
|
-
},
|
|
1134
|
+
}, L.prototype.raw = function() {
|
|
1126
1135
|
return this._ctx.valueMapper = null, this;
|
|
1127
|
-
},
|
|
1136
|
+
}, L.prototype.each = function(e) {
|
|
1128
1137
|
var t = this._ctx;
|
|
1129
1138
|
return this._read(function(n) {
|
|
1130
1139
|
return Ct(t, e, n, t.table.core);
|
|
1131
1140
|
});
|
|
1132
|
-
},
|
|
1141
|
+
}, L.prototype.count = function(e) {
|
|
1133
1142
|
var t = this;
|
|
1134
1143
|
return this._read(function(n) {
|
|
1135
1144
|
var r = t._ctx, i = r.table.core;
|
|
@@ -1144,19 +1153,19 @@ var Er = { exports: {} };
|
|
|
1144
1153
|
return o;
|
|
1145
1154
|
});
|
|
1146
1155
|
}).then(e);
|
|
1147
|
-
},
|
|
1156
|
+
}, L.prototype.sortBy = function(e, t) {
|
|
1148
1157
|
var n = e.split(".").reverse(), r = n[0], i = n.length - 1;
|
|
1149
|
-
function o(
|
|
1150
|
-
return l ? o(
|
|
1158
|
+
function o(d, l) {
|
|
1159
|
+
return l ? o(d[n[l]], l - 1) : d[r];
|
|
1151
1160
|
}
|
|
1152
1161
|
var a = this._ctx.dir === "next" ? 1 : -1;
|
|
1153
|
-
function u(
|
|
1154
|
-
return
|
|
1162
|
+
function u(d, l) {
|
|
1163
|
+
return d = o(d, i), l = o(l, i), d < l ? -a : l < d ? a : 0;
|
|
1155
1164
|
}
|
|
1156
|
-
return this.toArray(function(
|
|
1157
|
-
return
|
|
1165
|
+
return this.toArray(function(d) {
|
|
1166
|
+
return d.sort(u);
|
|
1158
1167
|
}).then(t);
|
|
1159
|
-
},
|
|
1168
|
+
}, L.prototype.toArray = function(e) {
|
|
1160
1169
|
var t = this;
|
|
1161
1170
|
return this._read(function(n) {
|
|
1162
1171
|
var r = t._ctx;
|
|
@@ -1173,7 +1182,7 @@ var Er = { exports: {} };
|
|
|
1173
1182
|
return a;
|
|
1174
1183
|
});
|
|
1175
1184
|
}, e);
|
|
1176
|
-
},
|
|
1185
|
+
}, L.prototype.offset = function(e) {
|
|
1177
1186
|
var t = this._ctx;
|
|
1178
1187
|
return e <= 0 || (t.offset += e, Qe(t) ? sn(t, function() {
|
|
1179
1188
|
var n = e;
|
|
@@ -1188,49 +1197,49 @@ var Er = { exports: {} };
|
|
|
1188
1197
|
return --n < 0;
|
|
1189
1198
|
};
|
|
1190
1199
|
})), this;
|
|
1191
|
-
},
|
|
1200
|
+
}, L.prototype.limit = function(e) {
|
|
1192
1201
|
return this._ctx.limit = Math.min(this._ctx.limit, e), sn(this._ctx, function() {
|
|
1193
1202
|
var t = e;
|
|
1194
1203
|
return function(n, r, i) {
|
|
1195
1204
|
return --t <= 0 && r(i), 0 <= t;
|
|
1196
1205
|
};
|
|
1197
1206
|
}, !0), this;
|
|
1198
|
-
},
|
|
1207
|
+
}, L.prototype.until = function(e, t) {
|
|
1199
1208
|
return an(this._ctx, function(n, r, i) {
|
|
1200
1209
|
return !e(n.value) || (r(i), t);
|
|
1201
1210
|
}), this;
|
|
1202
|
-
},
|
|
1211
|
+
}, L.prototype.first = function(e) {
|
|
1203
1212
|
return this.limit(1).toArray(function(t) {
|
|
1204
1213
|
return t[0];
|
|
1205
1214
|
}).then(e);
|
|
1206
|
-
},
|
|
1215
|
+
}, L.prototype.last = function(e) {
|
|
1207
1216
|
return this.reverse().first(e);
|
|
1208
|
-
},
|
|
1217
|
+
}, L.prototype.filter = function(e) {
|
|
1209
1218
|
var t;
|
|
1210
1219
|
return an(this._ctx, function(n) {
|
|
1211
1220
|
return e(n.value);
|
|
1212
1221
|
}), (t = this._ctx).isMatch = Ie(t.isMatch, e), this;
|
|
1213
|
-
},
|
|
1222
|
+
}, L.prototype.and = function(e) {
|
|
1214
1223
|
return this.filter(e);
|
|
1215
|
-
},
|
|
1224
|
+
}, L.prototype.or = function(e) {
|
|
1216
1225
|
return new this.db.WhereClause(this._ctx.table, e, this);
|
|
1217
|
-
},
|
|
1226
|
+
}, L.prototype.reverse = function() {
|
|
1218
1227
|
return this._ctx.dir = this._ctx.dir === "prev" ? "next" : "prev", this._ondirectionchange && this._ondirectionchange(this._ctx.dir), this;
|
|
1219
|
-
},
|
|
1228
|
+
}, L.prototype.desc = function() {
|
|
1220
1229
|
return this.reverse();
|
|
1221
|
-
},
|
|
1230
|
+
}, L.prototype.eachKey = function(e) {
|
|
1222
1231
|
var t = this._ctx;
|
|
1223
1232
|
return t.keysOnly = !t.isMatch, this.each(function(n, r) {
|
|
1224
1233
|
e(r.key, r);
|
|
1225
1234
|
});
|
|
1226
|
-
},
|
|
1235
|
+
}, L.prototype.eachUniqueKey = function(e) {
|
|
1227
1236
|
return this._ctx.unique = "unique", this.eachKey(e);
|
|
1228
|
-
},
|
|
1237
|
+
}, L.prototype.eachPrimaryKey = function(e) {
|
|
1229
1238
|
var t = this._ctx;
|
|
1230
1239
|
return t.keysOnly = !t.isMatch, this.each(function(n, r) {
|
|
1231
1240
|
e(r.primaryKey, r);
|
|
1232
1241
|
});
|
|
1233
|
-
},
|
|
1242
|
+
}, L.prototype.keys = function(e) {
|
|
1234
1243
|
var t = this._ctx;
|
|
1235
1244
|
t.keysOnly = !t.isMatch;
|
|
1236
1245
|
var n = [];
|
|
@@ -1239,7 +1248,7 @@ var Er = { exports: {} };
|
|
|
1239
1248
|
}).then(function() {
|
|
1240
1249
|
return n;
|
|
1241
1250
|
}).then(e);
|
|
1242
|
-
},
|
|
1251
|
+
}, L.prototype.primaryKeys = function(e) {
|
|
1243
1252
|
var t = this._ctx;
|
|
1244
1253
|
if (t.dir === "next" && Qe(t, !0) && 0 < t.limit)
|
|
1245
1254
|
return this._read(function(r) {
|
|
@@ -1255,15 +1264,15 @@ var Er = { exports: {} };
|
|
|
1255
1264
|
}).then(function() {
|
|
1256
1265
|
return n;
|
|
1257
1266
|
}).then(e);
|
|
1258
|
-
},
|
|
1267
|
+
}, L.prototype.uniqueKeys = function(e) {
|
|
1259
1268
|
return this._ctx.unique = "unique", this.keys(e);
|
|
1260
|
-
},
|
|
1269
|
+
}, L.prototype.firstKey = function(e) {
|
|
1261
1270
|
return this.limit(1).keys(function(t) {
|
|
1262
1271
|
return t[0];
|
|
1263
1272
|
}).then(e);
|
|
1264
|
-
},
|
|
1273
|
+
}, L.prototype.lastKey = function(e) {
|
|
1265
1274
|
return this.reverse().firstKey(e);
|
|
1266
|
-
},
|
|
1275
|
+
}, L.prototype.distinct = function() {
|
|
1267
1276
|
var e = this._ctx, e = e.index && e.table.schema.idxByName[e.index];
|
|
1268
1277
|
if (!e || !e.multi)
|
|
1269
1278
|
return this;
|
|
@@ -1272,60 +1281,60 @@ var Er = { exports: {} };
|
|
|
1272
1281
|
var r = i.primaryKey.toString(), i = ne(t, r);
|
|
1273
1282
|
return t[r] = !0, !i;
|
|
1274
1283
|
}), this;
|
|
1275
|
-
},
|
|
1284
|
+
}, L.prototype.modify = function(e) {
|
|
1276
1285
|
var t = this, n = this._ctx;
|
|
1277
1286
|
return this._write(function(r) {
|
|
1278
1287
|
var i, o, a;
|
|
1279
|
-
a = typeof e == "function" ? e : (i =
|
|
1288
|
+
a = typeof e == "function" ? e : (i = T(e), o = i.length, function(p) {
|
|
1280
1289
|
for (var b = !1, w = 0; w < o; ++w) {
|
|
1281
|
-
var
|
|
1282
|
-
ye(p,
|
|
1290
|
+
var x = i[w], k = e[x];
|
|
1291
|
+
ye(p, x) !== k && (ce(p, x, k), b = !0);
|
|
1283
1292
|
}
|
|
1284
1293
|
return b;
|
|
1285
1294
|
});
|
|
1286
|
-
function u(p,
|
|
1287
|
-
var w =
|
|
1288
|
-
y += p -
|
|
1289
|
-
for (var
|
|
1290
|
-
var P = O[
|
|
1291
|
-
|
|
1295
|
+
function u(p, x) {
|
|
1296
|
+
var w = x.failures, x = x.numFailures;
|
|
1297
|
+
y += p - x;
|
|
1298
|
+
for (var k = 0, O = T(w); k < O.length; k++) {
|
|
1299
|
+
var P = O[k];
|
|
1300
|
+
h.push(w[P]);
|
|
1292
1301
|
}
|
|
1293
1302
|
}
|
|
1294
|
-
var
|
|
1303
|
+
var d = n.table.core, l = d.schema.primaryKey, g = l.outbound, c = l.extractKey, f = t.db._options.modifyChunkSize || 200, h = [], y = 0, m = [];
|
|
1295
1304
|
return t.clone().primaryKeys().then(function(p) {
|
|
1296
1305
|
function b(w) {
|
|
1297
|
-
var
|
|
1298
|
-
return
|
|
1299
|
-
for (var O = [], P = [], S =
|
|
1300
|
-
var
|
|
1301
|
-
a.call(R, R.value, R) !== !1 && (R.value == null ? C.push(p[w + E]) :
|
|
1306
|
+
var x = Math.min(f, p.length - w);
|
|
1307
|
+
return d.getMany({ trans: r, keys: p.slice(w, w + x), cache: "immutable" }).then(function(k) {
|
|
1308
|
+
for (var O = [], P = [], S = g ? [] : null, C = [], E = 0; E < x; ++E) {
|
|
1309
|
+
var B = k[E], R = { value: _e(B), primKey: p[w + E] };
|
|
1310
|
+
a.call(R, R.value, R) !== !1 && (R.value == null ? C.push(p[w + E]) : g || U(c(B), c(R.value)) === 0 ? (P.push(R.value), g && S.push(p[w + E])) : (C.push(p[w + E]), O.push(R.value)));
|
|
1302
1311
|
}
|
|
1303
1312
|
var $ = Qe(n) && n.limit === 1 / 0 && (typeof e != "function" || e === un) && { index: n.index, range: n.range };
|
|
1304
|
-
return Promise.resolve(0 < O.length &&
|
|
1305
|
-
for (var G in
|
|
1313
|
+
return Promise.resolve(0 < O.length && d.mutate({ trans: r, type: "add", values: O }).then(function(z) {
|
|
1314
|
+
for (var G in z.failures)
|
|
1306
1315
|
C.splice(parseInt(G), 1);
|
|
1307
|
-
u(O.length,
|
|
1316
|
+
u(O.length, z);
|
|
1308
1317
|
})).then(function() {
|
|
1309
|
-
return (0 < P.length || $ && typeof e == "object") &&
|
|
1310
|
-
return u(P.length,
|
|
1318
|
+
return (0 < P.length || $ && typeof e == "object") && d.mutate({ trans: r, type: "put", keys: S, values: P, criteria: $, changeSpec: typeof e != "function" && e }).then(function(z) {
|
|
1319
|
+
return u(P.length, z);
|
|
1311
1320
|
});
|
|
1312
1321
|
}).then(function() {
|
|
1313
|
-
return (0 < C.length || $ && e === un) &&
|
|
1314
|
-
return u(C.length,
|
|
1322
|
+
return (0 < C.length || $ && e === un) && d.mutate({ trans: r, type: "delete", keys: C, criteria: $ }).then(function(z) {
|
|
1323
|
+
return u(C.length, z);
|
|
1315
1324
|
});
|
|
1316
1325
|
}).then(function() {
|
|
1317
|
-
return p.length > w +
|
|
1326
|
+
return p.length > w + x && b(w + f);
|
|
1318
1327
|
});
|
|
1319
1328
|
});
|
|
1320
1329
|
}
|
|
1321
1330
|
return b(0).then(function() {
|
|
1322
|
-
if (0 <
|
|
1323
|
-
throw new
|
|
1331
|
+
if (0 < h.length)
|
|
1332
|
+
throw new gt("Error modifying one or more objects", h, y, m);
|
|
1324
1333
|
return p.length;
|
|
1325
1334
|
});
|
|
1326
1335
|
});
|
|
1327
1336
|
});
|
|
1328
|
-
},
|
|
1337
|
+
}, L.prototype.delete = function() {
|
|
1329
1338
|
var e = this._ctx, t = e.range;
|
|
1330
1339
|
return Qe(e) && (e.isPrimKey || t.type === 3) ? this._write(function(n) {
|
|
1331
1340
|
var r = e.table.core.schema.primaryKey, i = t;
|
|
@@ -1333,15 +1342,15 @@ var Er = { exports: {} };
|
|
|
1333
1342
|
return e.table.core.mutate({ trans: n, type: "deleteRange", range: i }).then(function(a) {
|
|
1334
1343
|
var u = a.failures;
|
|
1335
1344
|
if (a.lastResult, a.results, a = a.numFailures, a)
|
|
1336
|
-
throw new
|
|
1337
|
-
return u[
|
|
1345
|
+
throw new gt("Could not delete some values", Object.keys(u).map(function(d) {
|
|
1346
|
+
return u[d];
|
|
1338
1347
|
}), o - a);
|
|
1339
1348
|
return o - a;
|
|
1340
1349
|
});
|
|
1341
1350
|
});
|
|
1342
1351
|
}) : this.modify(un);
|
|
1343
|
-
},
|
|
1344
|
-
function
|
|
1352
|
+
}, L);
|
|
1353
|
+
function L() {
|
|
1345
1354
|
}
|
|
1346
1355
|
var un = function(e, t) {
|
|
1347
1356
|
return t.value = null;
|
|
@@ -1361,7 +1370,7 @@ var Er = { exports: {} };
|
|
|
1361
1370
|
}).limit(0);
|
|
1362
1371
|
}
|
|
1363
1372
|
function Kt(e, t, n, r) {
|
|
1364
|
-
var i, o, a, u,
|
|
1373
|
+
var i, o, a, u, d, l, g, c = n.length;
|
|
1365
1374
|
if (!n.every(function(y) {
|
|
1366
1375
|
return typeof y == "string";
|
|
1367
1376
|
}))
|
|
@@ -1376,44 +1385,44 @@ var Er = { exports: {} };
|
|
|
1376
1385
|
} : function(p) {
|
|
1377
1386
|
return p.toUpperCase();
|
|
1378
1387
|
}, a = y === "next" ? Yr : Hr;
|
|
1379
|
-
var
|
|
1388
|
+
var m = n.map(function(p) {
|
|
1380
1389
|
return { lower: o(p), upper: i(p) };
|
|
1381
1390
|
}).sort(function(p, b) {
|
|
1382
1391
|
return a(p.lower, b.lower);
|
|
1383
1392
|
});
|
|
1384
|
-
u =
|
|
1393
|
+
u = m.map(function(p) {
|
|
1385
1394
|
return p.upper;
|
|
1386
|
-
}),
|
|
1395
|
+
}), d = m.map(function(p) {
|
|
1387
1396
|
return p.lower;
|
|
1388
|
-
}),
|
|
1397
|
+
}), g = (l = y) === "next" ? "" : r;
|
|
1389
1398
|
}
|
|
1390
1399
|
f("next"), e = new e.Collection(e, function() {
|
|
1391
|
-
return Ee(u[0],
|
|
1400
|
+
return Ee(u[0], d[c - 1] + r);
|
|
1392
1401
|
}), e._ondirectionchange = function(y) {
|
|
1393
1402
|
f(y);
|
|
1394
1403
|
};
|
|
1395
|
-
var
|
|
1396
|
-
return e._addAlgorithm(function(y,
|
|
1404
|
+
var h = 0;
|
|
1405
|
+
return e._addAlgorithm(function(y, m, p) {
|
|
1397
1406
|
var b = y.key;
|
|
1398
1407
|
if (typeof b != "string")
|
|
1399
1408
|
return !1;
|
|
1400
1409
|
var w = o(b);
|
|
1401
|
-
if (t(w,
|
|
1410
|
+
if (t(w, d, h))
|
|
1402
1411
|
return !0;
|
|
1403
|
-
for (var
|
|
1404
|
-
var O = function(P, S, C, E,
|
|
1405
|
-
for (var $ = Math.min(P.length, E.length),
|
|
1412
|
+
for (var x = null, k = h; k < c; ++k) {
|
|
1413
|
+
var O = function(P, S, C, E, B, R) {
|
|
1414
|
+
for (var $ = Math.min(P.length, E.length), z = -1, G = 0; G < $; ++G) {
|
|
1406
1415
|
var ue = S[G];
|
|
1407
1416
|
if (ue !== E[G])
|
|
1408
|
-
return
|
|
1409
|
-
|
|
1417
|
+
return B(P[G], C[G]) < 0 ? P.substr(0, G) + C[G] + C.substr(G + 1) : B(P[G], E[G]) < 0 ? P.substr(0, G) + E[G] + C.substr(G + 1) : 0 <= z ? P.substr(0, z) + S[z] + C.substr(z + 1) : null;
|
|
1418
|
+
B(P[G], ue) < 0 && (z = G);
|
|
1410
1419
|
}
|
|
1411
|
-
return $ < E.length && R === "next" ? P + C.substr(P.length) : $ < P.length && R === "prev" ? P.substr(0, C.length) :
|
|
1412
|
-
}(b, w, u[
|
|
1413
|
-
O === null &&
|
|
1420
|
+
return $ < E.length && R === "next" ? P + C.substr(P.length) : $ < P.length && R === "prev" ? P.substr(0, C.length) : z < 0 ? null : P.substr(0, z) + E[z] + C.substr(z + 1);
|
|
1421
|
+
}(b, w, u[k], d[k], a, l);
|
|
1422
|
+
O === null && x === null ? h = k + 1 : (x === null || 0 < a(x, O)) && (x = O);
|
|
1414
1423
|
}
|
|
1415
|
-
return
|
|
1416
|
-
y.continue(
|
|
1424
|
+
return m(x !== null ? function() {
|
|
1425
|
+
y.continue(x + g);
|
|
1417
1426
|
} : p), !1;
|
|
1418
1427
|
}), e;
|
|
1419
1428
|
}
|
|
@@ -1432,26 +1441,26 @@ var Er = { exports: {} };
|
|
|
1432
1441
|
return Ee(e, t, !n, !r);
|
|
1433
1442
|
});
|
|
1434
1443
|
} catch {
|
|
1435
|
-
return se(this,
|
|
1444
|
+
return se(this, me);
|
|
1436
1445
|
}
|
|
1437
1446
|
}, te.prototype.equals = function(e) {
|
|
1438
|
-
return e == null ? se(this,
|
|
1447
|
+
return e == null ? se(this, me) : new this.Collection(this, function() {
|
|
1439
1448
|
return sr(e);
|
|
1440
1449
|
});
|
|
1441
1450
|
}, te.prototype.above = function(e) {
|
|
1442
|
-
return e == null ? se(this,
|
|
1451
|
+
return e == null ? se(this, me) : new this.Collection(this, function() {
|
|
1443
1452
|
return Ee(e, void 0, !0);
|
|
1444
1453
|
});
|
|
1445
1454
|
}, te.prototype.aboveOrEqual = function(e) {
|
|
1446
|
-
return e == null ? se(this,
|
|
1455
|
+
return e == null ? se(this, me) : new this.Collection(this, function() {
|
|
1447
1456
|
return Ee(e, void 0, !1);
|
|
1448
1457
|
});
|
|
1449
1458
|
}, te.prototype.below = function(e) {
|
|
1450
|
-
return e == null ? se(this,
|
|
1459
|
+
return e == null ? se(this, me) : new this.Collection(this, function() {
|
|
1451
1460
|
return Ee(void 0, e, !1, !0);
|
|
1452
1461
|
});
|
|
1453
1462
|
}, te.prototype.belowOrEqual = function(e) {
|
|
1454
|
-
return e == null ? se(this,
|
|
1463
|
+
return e == null ? se(this, me) : new this.Collection(this, function() {
|
|
1455
1464
|
return Ee(void 0, e);
|
|
1456
1465
|
});
|
|
1457
1466
|
}, te.prototype.startsWith = function(e) {
|
|
@@ -1465,23 +1474,23 @@ var Er = { exports: {} };
|
|
|
1465
1474
|
return t === n[0];
|
|
1466
1475
|
}, [e], "");
|
|
1467
1476
|
}, te.prototype.anyOfIgnoreCase = function() {
|
|
1468
|
-
var e =
|
|
1477
|
+
var e = ge.apply(Ue, arguments);
|
|
1469
1478
|
return e.length === 0 ? Xe(this) : Kt(this, function(t, n) {
|
|
1470
1479
|
return n.indexOf(t) !== -1;
|
|
1471
1480
|
}, e, "");
|
|
1472
1481
|
}, te.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
1473
|
-
var e =
|
|
1482
|
+
var e = ge.apply(Ue, arguments);
|
|
1474
1483
|
return e.length === 0 ? Xe(this) : Kt(this, function(t, n) {
|
|
1475
1484
|
return n.some(function(r) {
|
|
1476
1485
|
return t.indexOf(r) === 0;
|
|
1477
1486
|
});
|
|
1478
1487
|
}, e, Be);
|
|
1479
1488
|
}, te.prototype.anyOf = function() {
|
|
1480
|
-
var e = this, t =
|
|
1489
|
+
var e = this, t = ge.apply(Ue, arguments), n = this._cmp;
|
|
1481
1490
|
try {
|
|
1482
1491
|
t.sort(n);
|
|
1483
1492
|
} catch {
|
|
1484
|
-
return se(this,
|
|
1493
|
+
return se(this, me);
|
|
1485
1494
|
}
|
|
1486
1495
|
if (t.length === 0)
|
|
1487
1496
|
return Xe(this);
|
|
@@ -1493,23 +1502,23 @@ var Er = { exports: {} };
|
|
|
1493
1502
|
};
|
|
1494
1503
|
var i = 0;
|
|
1495
1504
|
return r._addAlgorithm(function(o, a, u) {
|
|
1496
|
-
for (var
|
|
1505
|
+
for (var d = o.key; 0 < n(d, t[i]); )
|
|
1497
1506
|
if (++i === t.length)
|
|
1498
1507
|
return a(u), !1;
|
|
1499
|
-
return n(
|
|
1508
|
+
return n(d, t[i]) === 0 || (a(function() {
|
|
1500
1509
|
o.continue(t[i]);
|
|
1501
1510
|
}), !1);
|
|
1502
1511
|
}), r;
|
|
1503
1512
|
}, te.prototype.notEqual = function(e) {
|
|
1504
1513
|
return this.inAnyRange([[-1 / 0, e], [e, this.db._maxKey]], { includeLowers: !1, includeUppers: !1 });
|
|
1505
1514
|
}, te.prototype.noneOf = function() {
|
|
1506
|
-
var e =
|
|
1515
|
+
var e = ge.apply(Ue, arguments);
|
|
1507
1516
|
if (e.length === 0)
|
|
1508
1517
|
return new this.Collection(this);
|
|
1509
1518
|
try {
|
|
1510
1519
|
e.sort(this._ascending);
|
|
1511
1520
|
} catch {
|
|
1512
|
-
return se(this,
|
|
1521
|
+
return se(this, me);
|
|
1513
1522
|
}
|
|
1514
1523
|
var t = e.reduce(function(n, r) {
|
|
1515
1524
|
return n ? n.concat([[n[n.length - 1][1], r]]) : [[-1 / 0, r]];
|
|
@@ -1522,48 +1531,48 @@ var Er = { exports: {} };
|
|
|
1522
1531
|
if (!b.every(function(w) {
|
|
1523
1532
|
return w[0] !== void 0 && w[1] !== void 0 && i(w[0], w[1]) <= 0;
|
|
1524
1533
|
}))
|
|
1525
|
-
return se(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",
|
|
1526
|
-
var
|
|
1527
|
-
function f(w,
|
|
1528
|
-
return c(w[0],
|
|
1534
|
+
return se(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", I.InvalidArgument);
|
|
1535
|
+
var d = !t || t.includeLowers !== !1, l = t && t.includeUppers === !0, g, c = i;
|
|
1536
|
+
function f(w, x) {
|
|
1537
|
+
return c(w[0], x[0]);
|
|
1529
1538
|
}
|
|
1530
1539
|
try {
|
|
1531
|
-
(
|
|
1532
|
-
for (var
|
|
1533
|
-
var P = w[
|
|
1534
|
-
if (r(
|
|
1535
|
-
P[0] = a(P[0],
|
|
1540
|
+
(g = b.reduce(function(w, x) {
|
|
1541
|
+
for (var k = 0, O = w.length; k < O; ++k) {
|
|
1542
|
+
var P = w[k];
|
|
1543
|
+
if (r(x[0], P[1]) < 0 && 0 < r(x[1], P[0])) {
|
|
1544
|
+
P[0] = a(P[0], x[0]), P[1] = u(P[1], x[1]);
|
|
1536
1545
|
break;
|
|
1537
1546
|
}
|
|
1538
1547
|
}
|
|
1539
|
-
return
|
|
1548
|
+
return k === O && w.push(x), w;
|
|
1540
1549
|
}, [])).sort(f);
|
|
1541
1550
|
} catch {
|
|
1542
|
-
return se(this,
|
|
1551
|
+
return se(this, me);
|
|
1543
1552
|
}
|
|
1544
|
-
var
|
|
1545
|
-
return 0 < i(w,
|
|
1553
|
+
var h = 0, y = l ? function(w) {
|
|
1554
|
+
return 0 < i(w, g[h][1]);
|
|
1546
1555
|
} : function(w) {
|
|
1547
|
-
return 0 <= i(w,
|
|
1548
|
-
},
|
|
1549
|
-
return 0 < o(w,
|
|
1556
|
+
return 0 <= i(w, g[h][1]);
|
|
1557
|
+
}, m = d ? function(w) {
|
|
1558
|
+
return 0 < o(w, g[h][0]);
|
|
1550
1559
|
} : function(w) {
|
|
1551
|
-
return 0 <= o(w,
|
|
1560
|
+
return 0 <= o(w, g[h][0]);
|
|
1552
1561
|
}, p = y, b = new this.Collection(this, function() {
|
|
1553
|
-
return Ee(
|
|
1562
|
+
return Ee(g[0][0], g[g.length - 1][1], !d, !l);
|
|
1554
1563
|
});
|
|
1555
1564
|
return b._ondirectionchange = function(w) {
|
|
1556
|
-
c = w === "next" ? (p = y, i) : (p =
|
|
1557
|
-
}, b._addAlgorithm(function(w,
|
|
1565
|
+
c = w === "next" ? (p = y, i) : (p = m, o), g.sort(f);
|
|
1566
|
+
}, b._addAlgorithm(function(w, x, k) {
|
|
1558
1567
|
for (var O, P = w.key; p(P); )
|
|
1559
|
-
if (++
|
|
1560
|
-
return k
|
|
1561
|
-
return !y(O = P) && !
|
|
1562
|
-
c === i ? w.continue(
|
|
1568
|
+
if (++h === g.length)
|
|
1569
|
+
return x(k), !1;
|
|
1570
|
+
return !y(O = P) && !m(O) || (n._cmp(P, g[h][1]) === 0 || n._cmp(P, g[h][0]) === 0 || x(function() {
|
|
1571
|
+
c === i ? w.continue(g[h][0]) : w.continue(g[h][1]);
|
|
1563
1572
|
}), !1);
|
|
1564
1573
|
}), b;
|
|
1565
1574
|
}, te.prototype.startsWithAnyOf = function() {
|
|
1566
|
-
var e =
|
|
1575
|
+
var e = ge.apply(Ue, arguments);
|
|
1567
1576
|
return e.every(function(t) {
|
|
1568
1577
|
return typeof t == "string";
|
|
1569
1578
|
}) ? e.length === 0 ? Xe(this) : this.inAnyRange(e.map(function(t) {
|
|
@@ -1572,7 +1581,7 @@ var Er = { exports: {} };
|
|
|
1572
1581
|
}, te);
|
|
1573
1582
|
function te() {
|
|
1574
1583
|
}
|
|
1575
|
-
function
|
|
1584
|
+
function he(e) {
|
|
1576
1585
|
return H(function(t) {
|
|
1577
1586
|
return ut(t), e(t.target.error), !1;
|
|
1578
1587
|
});
|
|
@@ -1602,27 +1611,27 @@ var Er = { exports: {} };
|
|
|
1602
1611
|
if (Ze(!this.idbtrans), !e && !n)
|
|
1603
1612
|
switch (r && r.name) {
|
|
1604
1613
|
case "DatabaseClosedError":
|
|
1605
|
-
throw new
|
|
1614
|
+
throw new I.DatabaseClosed(r);
|
|
1606
1615
|
case "MissingAPIError":
|
|
1607
|
-
throw new
|
|
1616
|
+
throw new I.MissingAPI(r.message, r);
|
|
1608
1617
|
default:
|
|
1609
|
-
throw new
|
|
1618
|
+
throw new I.OpenFailed(r);
|
|
1610
1619
|
}
|
|
1611
1620
|
if (!this.active)
|
|
1612
|
-
throw new
|
|
1621
|
+
throw new I.TransactionInactive();
|
|
1613
1622
|
return Ze(this._completion._state === null), (e = this.idbtrans = e || (this.db.core || n).transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability })).onerror = H(function(i) {
|
|
1614
1623
|
ut(i), t._reject(e.error);
|
|
1615
1624
|
}), e.onabort = H(function(i) {
|
|
1616
|
-
ut(i), t.active && t._reject(new
|
|
1625
|
+
ut(i), t.active && t._reject(new I.Abort(e.error)), t.active = !1, t.on("abort").fire(i);
|
|
1617
1626
|
}), e.oncomplete = H(function() {
|
|
1618
1627
|
t.active = !1, t._resolve(), "mutatedParts" in e && Pe.storagemutated.fire(e.mutatedParts);
|
|
1619
1628
|
}), this;
|
|
1620
1629
|
}, pe.prototype._promise = function(e, t, n) {
|
|
1621
1630
|
var r = this;
|
|
1622
1631
|
if (e === "readwrite" && this.mode !== "readwrite")
|
|
1623
|
-
return X(new
|
|
1632
|
+
return X(new I.ReadOnly("Transaction is readonly"));
|
|
1624
1633
|
if (!this.active)
|
|
1625
|
-
return X(new
|
|
1634
|
+
return X(new I.TransactionInactive());
|
|
1626
1635
|
if (this._locked())
|
|
1627
1636
|
return new K(function(o, a) {
|
|
1628
1637
|
r._blockedFuncs.push([function() {
|
|
@@ -1630,11 +1639,11 @@ var Er = { exports: {} };
|
|
|
1630
1639
|
}, D]);
|
|
1631
1640
|
});
|
|
1632
1641
|
if (n)
|
|
1633
|
-
return
|
|
1642
|
+
return ke(function() {
|
|
1634
1643
|
var o = new K(function(a, u) {
|
|
1635
1644
|
r._lock();
|
|
1636
|
-
var
|
|
1637
|
-
|
|
1645
|
+
var d = t(a, u, r);
|
|
1646
|
+
d && d.then && d.then(a, u);
|
|
1638
1647
|
});
|
|
1639
1648
|
return o.finally(function() {
|
|
1640
1649
|
return r._unlock();
|
|
@@ -1667,14 +1676,14 @@ var Er = { exports: {} };
|
|
|
1667
1676
|
});
|
|
1668
1677
|
});
|
|
1669
1678
|
}, pe.prototype.abort = function() {
|
|
1670
|
-
this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new
|
|
1679
|
+
this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new I.Abort()));
|
|
1671
1680
|
}, pe.prototype.table = function(e) {
|
|
1672
1681
|
var t = this._memoizedTables || (this._memoizedTables = {});
|
|
1673
1682
|
if (ne(t, e))
|
|
1674
1683
|
return t[e];
|
|
1675
1684
|
var n = this.schema[e];
|
|
1676
1685
|
if (!n)
|
|
1677
|
-
throw new
|
|
1686
|
+
throw new I.NotFound("Table " + e + " not part of transaction");
|
|
1678
1687
|
return n = new this.db.Table(e, n, this), n.core = this.db.core.table(e), t[e] = n;
|
|
1679
1688
|
}, pe);
|
|
1680
1689
|
function pe() {
|
|
@@ -1704,7 +1713,7 @@ var Er = { exports: {} };
|
|
|
1704
1713
|
}, Be;
|
|
1705
1714
|
}
|
|
1706
1715
|
};
|
|
1707
|
-
function
|
|
1716
|
+
function dn(e) {
|
|
1708
1717
|
return e == null ? function() {
|
|
1709
1718
|
} : typeof e == "string" ? (t = e).split(".").length === 1 ? function(n) {
|
|
1710
1719
|
return n[t];
|
|
@@ -1722,97 +1731,97 @@ var Er = { exports: {} };
|
|
|
1722
1731
|
function ft(e) {
|
|
1723
1732
|
return e == null ? ":id" : typeof e == "string" ? e : "[".concat(e.join("+"), "]");
|
|
1724
1733
|
}
|
|
1725
|
-
function Jr(e, t,
|
|
1734
|
+
function Jr(e, t, d) {
|
|
1726
1735
|
function r(p) {
|
|
1727
1736
|
if (p.type === 3)
|
|
1728
1737
|
return null;
|
|
1729
1738
|
if (p.type === 4)
|
|
1730
1739
|
throw new Error("Cannot convert never type to IDBKeyRange");
|
|
1731
|
-
var
|
|
1732
|
-
return
|
|
1740
|
+
var h = p.lower, y = p.upper, m = p.lowerOpen, p = p.upperOpen;
|
|
1741
|
+
return h === void 0 ? y === void 0 ? null : t.upperBound(y, !!p) : y === void 0 ? t.lowerBound(h, !!m) : t.bound(h, y, !!m, !!p);
|
|
1733
1742
|
}
|
|
1734
1743
|
function i(f) {
|
|
1735
|
-
var
|
|
1736
|
-
return { name: y, schema: f, mutate: function(
|
|
1737
|
-
var p =
|
|
1744
|
+
var h, y = f.name;
|
|
1745
|
+
return { name: y, schema: f, mutate: function(m) {
|
|
1746
|
+
var p = m.trans, b = m.type, w = m.keys, x = m.values, k = m.range;
|
|
1738
1747
|
return new Promise(function(O, P) {
|
|
1739
1748
|
O = H(O);
|
|
1740
1749
|
var S = p.objectStore(y), C = S.keyPath == null, E = b === "put" || b === "add";
|
|
1741
1750
|
if (!E && b !== "delete" && b !== "deleteRange")
|
|
1742
1751
|
throw new Error("Invalid operation type: " + b);
|
|
1743
|
-
var
|
|
1744
|
-
if (w &&
|
|
1752
|
+
var B, R = (w || x || { length: 1 }).length;
|
|
1753
|
+
if (w && x && w.length !== x.length)
|
|
1745
1754
|
throw new Error("Given keys array must have same length as given values array.");
|
|
1746
1755
|
if (R === 0)
|
|
1747
1756
|
return O({ numFailures: 0, failures: {}, results: [], lastResult: void 0 });
|
|
1748
1757
|
function $(ae) {
|
|
1749
1758
|
++ue, ut(ae);
|
|
1750
1759
|
}
|
|
1751
|
-
var
|
|
1760
|
+
var z = [], G = [], ue = 0;
|
|
1752
1761
|
if (b === "deleteRange") {
|
|
1753
|
-
if (
|
|
1762
|
+
if (k.type === 4)
|
|
1754
1763
|
return O({ numFailures: ue, failures: G, results: [], lastResult: void 0 });
|
|
1755
|
-
|
|
1764
|
+
k.type === 3 ? z.push(B = S.clear()) : z.push(B = S.delete(r(k)));
|
|
1756
1765
|
} else {
|
|
1757
|
-
var C = E ? C ? [
|
|
1766
|
+
var C = E ? C ? [x, w] : [x, null] : [w, null], N = C[0], be = C[1];
|
|
1758
1767
|
if (E)
|
|
1759
1768
|
for (var ie = 0; ie < R; ++ie)
|
|
1760
|
-
|
|
1769
|
+
z.push(B = be && be[ie] !== void 0 ? S[b](N[ie], be[ie]) : S[b](N[ie])), B.onerror = $;
|
|
1761
1770
|
else
|
|
1762
1771
|
for (ie = 0; ie < R; ++ie)
|
|
1763
|
-
|
|
1772
|
+
z.push(B = S[b](N[ie])), B.onerror = $;
|
|
1764
1773
|
}
|
|
1765
1774
|
function Wt(ae) {
|
|
1766
|
-
ae = ae.target.result,
|
|
1775
|
+
ae = ae.target.result, z.forEach(function(Fe, An) {
|
|
1767
1776
|
return Fe.error != null && (G[An] = Fe.error);
|
|
1768
|
-
}), O({ numFailures: ue, failures: G, results: b === "delete" ? w :
|
|
1777
|
+
}), O({ numFailures: ue, failures: G, results: b === "delete" ? w : z.map(function(Fe) {
|
|
1769
1778
|
return Fe.result;
|
|
1770
1779
|
}), lastResult: ae });
|
|
1771
1780
|
}
|
|
1772
|
-
|
|
1781
|
+
B.onerror = function(ae) {
|
|
1773
1782
|
$(ae), Wt(ae);
|
|
1774
|
-
},
|
|
1783
|
+
}, B.onsuccess = Wt;
|
|
1775
1784
|
});
|
|
1776
|
-
}, getMany: function(
|
|
1777
|
-
var p =
|
|
1778
|
-
return new Promise(function(w,
|
|
1785
|
+
}, getMany: function(m) {
|
|
1786
|
+
var p = m.trans, b = m.keys;
|
|
1787
|
+
return new Promise(function(w, x) {
|
|
1779
1788
|
w = H(w);
|
|
1780
|
-
for (var
|
|
1781
|
-
|
|
1782
|
-
}, R =
|
|
1783
|
-
b[$] != null && ((
|
|
1789
|
+
for (var k, O = p.objectStore(y), P = b.length, S = new Array(P), C = 0, E = 0, B = function(z) {
|
|
1790
|
+
z = z.target, S[z._pos] = z.result, ++E === C && w(S);
|
|
1791
|
+
}, R = he(x), $ = 0; $ < P; ++$)
|
|
1792
|
+
b[$] != null && ((k = O.get(b[$]))._pos = $, k.onsuccess = B, k.onerror = R, ++C);
|
|
1784
1793
|
C === 0 && w(S);
|
|
1785
1794
|
});
|
|
1786
|
-
}, get: function(
|
|
1787
|
-
var p =
|
|
1788
|
-
return new Promise(function(w,
|
|
1795
|
+
}, get: function(m) {
|
|
1796
|
+
var p = m.trans, b = m.key;
|
|
1797
|
+
return new Promise(function(w, x) {
|
|
1789
1798
|
w = H(w);
|
|
1790
|
-
var
|
|
1791
|
-
|
|
1799
|
+
var k = p.objectStore(y).get(b);
|
|
1800
|
+
k.onsuccess = function(O) {
|
|
1792
1801
|
return w(O.target.result);
|
|
1793
|
-
},
|
|
1802
|
+
}, k.onerror = he(x);
|
|
1794
1803
|
});
|
|
1795
|
-
}, query: (
|
|
1804
|
+
}, query: (h = l, function(m) {
|
|
1796
1805
|
return new Promise(function(p, b) {
|
|
1797
1806
|
p = H(p);
|
|
1798
|
-
var w,
|
|
1807
|
+
var w, x, k, C = m.trans, O = m.values, P = m.limit, B = m.query, S = P === 1 / 0 ? void 0 : P, E = B.index, B = B.range, C = C.objectStore(y), E = E.isPrimaryKey ? C : C.index(E.name), B = r(B);
|
|
1799
1808
|
if (P === 0)
|
|
1800
1809
|
return p({ result: [] });
|
|
1801
|
-
|
|
1810
|
+
h ? ((S = O ? E.getAll(B, S) : E.getAllKeys(B, S)).onsuccess = function(R) {
|
|
1802
1811
|
return p({ result: R.target.result });
|
|
1803
|
-
}, S.onerror =
|
|
1804
|
-
var $ =
|
|
1805
|
-
return $ ? (
|
|
1806
|
-
},
|
|
1812
|
+
}, S.onerror = he(b)) : (w = 0, x = !O && "openKeyCursor" in E ? E.openKeyCursor(B) : E.openCursor(B), k = [], x.onsuccess = function(R) {
|
|
1813
|
+
var $ = x.result;
|
|
1814
|
+
return $ ? (k.push(O ? $.value : $.primaryKey), ++w === P ? p({ result: k }) : void $.continue()) : p({ result: k });
|
|
1815
|
+
}, x.onerror = he(b));
|
|
1807
1816
|
});
|
|
1808
|
-
}), openCursor: function(
|
|
1809
|
-
var p =
|
|
1817
|
+
}), openCursor: function(m) {
|
|
1818
|
+
var p = m.trans, b = m.values, w = m.query, x = m.reverse, k = m.unique;
|
|
1810
1819
|
return new Promise(function(O, P) {
|
|
1811
1820
|
O = H(O);
|
|
1812
|
-
var E = w.index, S = w.range, C = p.objectStore(y), C = E.isPrimaryKey ? C : C.index(E.name), E =
|
|
1813
|
-
|
|
1814
|
-
var $,
|
|
1815
|
-
N ? (N.___id = ++Xr, N.done = !1, $ = N.continue.bind(N),
|
|
1821
|
+
var E = w.index, S = w.range, C = p.objectStore(y), C = E.isPrimaryKey ? C : C.index(E.name), E = x ? k ? "prevunique" : "prev" : k ? "nextunique" : "next", B = !b && "openKeyCursor" in C ? C.openKeyCursor(r(S), E) : C.openCursor(r(S), E);
|
|
1822
|
+
B.onerror = he(P), B.onsuccess = H(function(R) {
|
|
1823
|
+
var $, z, G, ue, N = B.result;
|
|
1824
|
+
N ? (N.___id = ++Xr, N.done = !1, $ = N.continue.bind(N), z = (z = N.continuePrimaryKey) && z.bind(N), G = N.advance.bind(N), ue = function() {
|
|
1816
1825
|
throw new Error("Cursor not stopped");
|
|
1817
1826
|
}, N.trans = p, N.stop = N.continue = N.continuePrimaryKey = N.advance = function() {
|
|
1818
1827
|
throw new Error("Cursor not started");
|
|
@@ -1825,7 +1834,7 @@ var Er = { exports: {} };
|
|
|
1825
1834
|
});
|
|
1826
1835
|
}, N.start = function(be) {
|
|
1827
1836
|
function ie() {
|
|
1828
|
-
if (
|
|
1837
|
+
if (B.result)
|
|
1829
1838
|
try {
|
|
1830
1839
|
be();
|
|
1831
1840
|
} catch (ae) {
|
|
@@ -1837,46 +1846,46 @@ var Er = { exports: {} };
|
|
|
1837
1846
|
}, N.stop();
|
|
1838
1847
|
}
|
|
1839
1848
|
var Wt = new Promise(function(ae, Fe) {
|
|
1840
|
-
ae = H(ae),
|
|
1849
|
+
ae = H(ae), B.onerror = he(Fe), N.fail = Fe, N.stop = function(An) {
|
|
1841
1850
|
N.stop = N.continue = N.continuePrimaryKey = N.advance = ue, ae(An);
|
|
1842
1851
|
};
|
|
1843
1852
|
});
|
|
1844
|
-
return
|
|
1845
|
-
|
|
1846
|
-
}), N.continue = $, N.continuePrimaryKey =
|
|
1853
|
+
return B.onsuccess = H(function(ae) {
|
|
1854
|
+
B.onsuccess = ie, ie();
|
|
1855
|
+
}), N.continue = $, N.continuePrimaryKey = z, N.advance = G, ie(), Wt;
|
|
1847
1856
|
}, O(N)) : O(null);
|
|
1848
1857
|
}, P);
|
|
1849
1858
|
});
|
|
1850
|
-
}, count: function(
|
|
1851
|
-
var p =
|
|
1852
|
-
return new Promise(function(
|
|
1853
|
-
var P = b.objectStore(y), S = w.isPrimaryKey ? P : P.index(w.name), P = r(
|
|
1859
|
+
}, count: function(m) {
|
|
1860
|
+
var p = m.query, b = m.trans, w = p.index, x = p.range;
|
|
1861
|
+
return new Promise(function(k, O) {
|
|
1862
|
+
var P = b.objectStore(y), S = w.isPrimaryKey ? P : P.index(w.name), P = r(x), S = P ? S.count(P) : S.count();
|
|
1854
1863
|
S.onsuccess = H(function(C) {
|
|
1855
|
-
return
|
|
1856
|
-
}), S.onerror =
|
|
1864
|
+
return k(C.target.result);
|
|
1865
|
+
}), S.onerror = he(O);
|
|
1857
1866
|
});
|
|
1858
1867
|
} };
|
|
1859
1868
|
}
|
|
1860
|
-
var o, a, u,
|
|
1869
|
+
var o, a, u, g = (a = d, u = lr((o = e).objectStoreNames), { schema: { name: o.name, tables: u.map(function(f) {
|
|
1861
1870
|
return a.objectStore(f);
|
|
1862
1871
|
}).map(function(f) {
|
|
1863
|
-
var
|
|
1872
|
+
var h = f.keyPath, p = f.autoIncrement, y = W(h), m = {}, p = { name: f.name, primaryKey: { name: null, isPrimaryKey: !0, outbound: h == null, compound: y, keyPath: h, autoIncrement: p, unique: !0, extractKey: dn(h) }, indexes: lr(f.indexNames).map(function(b) {
|
|
1864
1873
|
return f.index(b);
|
|
1865
|
-
}).map(function(
|
|
1866
|
-
var w =
|
|
1867
|
-
return
|
|
1874
|
+
}).map(function(k) {
|
|
1875
|
+
var w = k.name, x = k.unique, O = k.multiEntry, k = k.keyPath, O = { name: w, compound: W(k), keyPath: k, unique: x, multiEntry: O, extractKey: dn(k) };
|
|
1876
|
+
return m[ft(k)] = O;
|
|
1868
1877
|
}), getIndexByKeyPath: function(b) {
|
|
1869
|
-
return
|
|
1878
|
+
return m[ft(b)];
|
|
1870
1879
|
} };
|
|
1871
|
-
return
|
|
1872
|
-
}) }, hasGetAll: 0 < u.length && "getAll" in a.objectStore(u[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }),
|
|
1873
|
-
return
|
|
1880
|
+
return m[":id"] = p.primaryKey, h != null && (m[ft(h)] = p.primaryKey), p;
|
|
1881
|
+
}) }, hasGetAll: 0 < u.length && "getAll" in a.objectStore(u[0]) && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604) }), d = g.schema, l = g.hasGetAll, g = d.tables.map(i), c = {};
|
|
1882
|
+
return g.forEach(function(f) {
|
|
1874
1883
|
return c[f.name] = f;
|
|
1875
1884
|
}), { stack: "dbcore", transaction: e.transaction.bind(e), table: function(f) {
|
|
1876
1885
|
if (!c[f])
|
|
1877
1886
|
throw new Error("Table '".concat(f, "' not found"));
|
|
1878
1887
|
return c[f];
|
|
1879
|
-
}, MIN_KEY: -1 / 0, MAX_KEY: lt(t), schema:
|
|
1888
|
+
}, MIN_KEY: -1 / 0, MAX_KEY: lt(t), schema: d };
|
|
1880
1889
|
}
|
|
1881
1890
|
function Zr(e, t, n, r) {
|
|
1882
1891
|
var i = n.IDBKeyRange;
|
|
@@ -1897,18 +1906,18 @@ var Er = { exports: {} };
|
|
|
1897
1906
|
n.forEach(function(i) {
|
|
1898
1907
|
var o = r[i];
|
|
1899
1908
|
t.forEach(function(a) {
|
|
1900
|
-
var u = function
|
|
1901
|
-
return Cr(l,
|
|
1909
|
+
var u = function d(l, g) {
|
|
1910
|
+
return Cr(l, g) || (l = oe(l)) && d(l, g);
|
|
1902
1911
|
}(a, i);
|
|
1903
1912
|
(!u || "value" in u && u.value === void 0) && (a === e.Transaction.prototype || a instanceof e.Transaction ? we(a, i, { get: function() {
|
|
1904
1913
|
return this.table(i);
|
|
1905
|
-
}, set: function(
|
|
1906
|
-
Nn(this, i, { value:
|
|
1914
|
+
}, set: function(d) {
|
|
1915
|
+
Nn(this, i, { value: d, writable: !0, configurable: !0, enumerable: !0 });
|
|
1907
1916
|
} }) : a[i] = new e.Table(i, o));
|
|
1908
1917
|
});
|
|
1909
1918
|
});
|
|
1910
1919
|
}
|
|
1911
|
-
function
|
|
1920
|
+
function hn(e, t) {
|
|
1912
1921
|
t.forEach(function(n) {
|
|
1913
1922
|
for (var r in n)
|
|
1914
1923
|
n[r] instanceof e.Table && delete n[r];
|
|
@@ -1919,72 +1928,72 @@ var Er = { exports: {} };
|
|
|
1919
1928
|
}
|
|
1920
1929
|
function ei(e, t, n, r) {
|
|
1921
1930
|
var i = e._dbSchema;
|
|
1922
|
-
n.objectStoreNames.contains("$meta") && !i.$meta && (i.$meta = fn("$meta",
|
|
1931
|
+
n.objectStoreNames.contains("$meta") && !i.$meta && (i.$meta = fn("$meta", dr("")[0], []), e._storeNames.push("$meta"));
|
|
1923
1932
|
var o = e._createTransaction("readwrite", e._storeNames, i);
|
|
1924
1933
|
o.create(n), o._completion.catch(r);
|
|
1925
1934
|
var a = o._reject.bind(o), u = D.transless || D;
|
|
1926
|
-
|
|
1927
|
-
return D.trans = o, D.transless = u, t !== 0 ? (At(e, n), l = t, ((
|
|
1928
|
-
return
|
|
1929
|
-
}) : K.resolve(l)).then(function(
|
|
1930
|
-
return f =
|
|
1935
|
+
ke(function() {
|
|
1936
|
+
return D.trans = o, D.transless = u, t !== 0 ? (At(e, n), l = t, ((d = o).storeNames.includes("$meta") ? d.table("$meta").get("version").then(function(g) {
|
|
1937
|
+
return g ?? l;
|
|
1938
|
+
}) : K.resolve(l)).then(function(g) {
|
|
1939
|
+
return f = g, h = o, y = n, m = [], g = (c = e)._versions, p = c._dbSchema = Bt(0, c.idbdb, y), (g = g.filter(function(b) {
|
|
1931
1940
|
return b._cfg.version >= f;
|
|
1932
|
-
})).length !== 0 ? (
|
|
1933
|
-
|
|
1934
|
-
var w = p,
|
|
1935
|
-
It(c, w, y), It(c,
|
|
1936
|
-
var
|
|
1937
|
-
|
|
1941
|
+
})).length !== 0 ? (g.forEach(function(b) {
|
|
1942
|
+
m.push(function() {
|
|
1943
|
+
var w = p, x = b._cfg.dbschema;
|
|
1944
|
+
It(c, w, y), It(c, x, y), p = c._dbSchema = x;
|
|
1945
|
+
var k = pn(w, x);
|
|
1946
|
+
k.add.forEach(function(E) {
|
|
1938
1947
|
yn(y, E[0], E[1].primKey, E[1].indexes);
|
|
1939
|
-
}),
|
|
1948
|
+
}), k.change.forEach(function(E) {
|
|
1940
1949
|
if (E.recreate)
|
|
1941
|
-
throw new
|
|
1942
|
-
var
|
|
1950
|
+
throw new I.Upgrade("Not yet support for changing primary key");
|
|
1951
|
+
var B = y.objectStore(E.name);
|
|
1943
1952
|
E.add.forEach(function(R) {
|
|
1944
|
-
return Tt(
|
|
1953
|
+
return Tt(B, R);
|
|
1945
1954
|
}), E.change.forEach(function(R) {
|
|
1946
|
-
|
|
1955
|
+
B.deleteIndex(R.name), Tt(B, R);
|
|
1947
1956
|
}), E.del.forEach(function(R) {
|
|
1948
|
-
return
|
|
1957
|
+
return B.deleteIndex(R);
|
|
1949
1958
|
});
|
|
1950
1959
|
});
|
|
1951
1960
|
var O = b._cfg.contentUpgrade;
|
|
1952
1961
|
if (O && b._cfg.version > f) {
|
|
1953
|
-
At(c, y),
|
|
1954
|
-
var P = Un(
|
|
1955
|
-
|
|
1962
|
+
At(c, y), h._memoizedTables = {};
|
|
1963
|
+
var P = Un(x);
|
|
1964
|
+
k.del.forEach(function(E) {
|
|
1956
1965
|
P[E] = w[E];
|
|
1957
|
-
}),
|
|
1966
|
+
}), hn(c, [c.Transaction.prototype]), Dt(c, [c.Transaction.prototype], T(P), P), h.schema = P;
|
|
1958
1967
|
var S, C = Gt(O);
|
|
1959
|
-
return C && Ye(),
|
|
1968
|
+
return C && Ye(), k = K.follow(function() {
|
|
1960
1969
|
var E;
|
|
1961
|
-
(S = O(
|
|
1962
|
-
}), S && typeof S.then == "function" ? K.resolve(S) :
|
|
1970
|
+
(S = O(h)) && C && (E = Oe.bind(null, null), S.then(E, E));
|
|
1971
|
+
}), S && typeof S.then == "function" ? K.resolve(S) : k.then(function() {
|
|
1963
1972
|
return S;
|
|
1964
1973
|
});
|
|
1965
1974
|
}
|
|
1966
|
-
}),
|
|
1967
|
-
var
|
|
1968
|
-
|
|
1969
|
-
return
|
|
1970
|
-
}),
|
|
1971
|
-
}),
|
|
1972
|
-
c.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(c.idbdb.version / 10) === b._cfg.version ? (c.idbdb.deleteObjectStore("$meta"), delete c._dbSchema.$meta, c._storeNames = c._storeNames.filter(function(
|
|
1973
|
-
return
|
|
1975
|
+
}), m.push(function(w) {
|
|
1976
|
+
var x, k, O = b._cfg.dbschema;
|
|
1977
|
+
x = O, k = w, [].slice.call(k.db.objectStoreNames).forEach(function(P) {
|
|
1978
|
+
return x[P] == null && k.db.deleteObjectStore(P);
|
|
1979
|
+
}), hn(c, [c.Transaction.prototype]), Dt(c, [c.Transaction.prototype], c._storeNames, c._dbSchema), h.schema = c._dbSchema;
|
|
1980
|
+
}), m.push(function(w) {
|
|
1981
|
+
c.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(c.idbdb.version / 10) === b._cfg.version ? (c.idbdb.deleteObjectStore("$meta"), delete c._dbSchema.$meta, c._storeNames = c._storeNames.filter(function(x) {
|
|
1982
|
+
return x !== "$meta";
|
|
1974
1983
|
})) : w.objectStore("$meta").put(b._cfg.version, "version"));
|
|
1975
1984
|
});
|
|
1976
1985
|
}), function b() {
|
|
1977
|
-
return
|
|
1986
|
+
return m.length ? K.resolve(m.shift()(h.idbtrans)).then(b) : K.resolve();
|
|
1978
1987
|
}().then(function() {
|
|
1979
1988
|
fr(p, y);
|
|
1980
1989
|
})) : K.resolve();
|
|
1981
|
-
var c, f,
|
|
1982
|
-
}).catch(a)) : (
|
|
1983
|
-
yn(n,
|
|
1990
|
+
var c, f, h, y, m, p;
|
|
1991
|
+
}).catch(a)) : (T(i).forEach(function(g) {
|
|
1992
|
+
yn(n, g, i[g].primKey, i[g].indexes);
|
|
1984
1993
|
}), At(e, n), void K.follow(function() {
|
|
1985
1994
|
return e.on.populate.fire(o);
|
|
1986
1995
|
}).catch(a));
|
|
1987
|
-
var
|
|
1996
|
+
var d, l;
|
|
1988
1997
|
});
|
|
1989
1998
|
}
|
|
1990
1999
|
function ti(e, t) {
|
|
@@ -1996,8 +2005,8 @@ var Er = { exports: {} };
|
|
|
1996
2005
|
if (a.change.length || a.recreate)
|
|
1997
2006
|
return console.warn("Unable to patch indexes of table ".concat(a.name, " because it has changes on the type of index or primary key.")), { value: void 0 };
|
|
1998
2007
|
var u = t.objectStore(a.name);
|
|
1999
|
-
a.add.forEach(function(
|
|
2000
|
-
fe && console.debug("Dexie upgrade patch: Creating missing index ".concat(a.name, ".").concat(
|
|
2008
|
+
a.add.forEach(function(d) {
|
|
2009
|
+
fe && console.debug("Dexie upgrade patch: Creating missing index ".concat(a.name, ".").concat(d.src)), Tt(u, d);
|
|
2001
2010
|
});
|
|
2002
2011
|
}(i[r]);
|
|
2003
2012
|
if (typeof o == "object")
|
|
@@ -2015,12 +2024,12 @@ var Er = { exports: {} };
|
|
|
2015
2024
|
if ("" + (i.primKey.keyPath || "") != "" + (o.primKey.keyPath || "") || i.primKey.auto !== o.primKey.auto)
|
|
2016
2025
|
a.recreate = !0, r.change.push(a);
|
|
2017
2026
|
else {
|
|
2018
|
-
var u = i.idxByName,
|
|
2027
|
+
var u = i.idxByName, d = o.idxByName, l = void 0;
|
|
2019
2028
|
for (l in u)
|
|
2020
|
-
|
|
2021
|
-
for (l in
|
|
2022
|
-
var
|
|
2023
|
-
|
|
2029
|
+
d[l] || a.del.push(l);
|
|
2030
|
+
for (l in d) {
|
|
2031
|
+
var g = u[l], c = d[l];
|
|
2032
|
+
g ? g.src !== c.src && a.change.push(c) : a.add.push(c);
|
|
2024
2033
|
}
|
|
2025
2034
|
(0 < a.del.length || 0 < a.add.length || 0 < a.change.length) && r.change.push(a);
|
|
2026
2035
|
}
|
|
@@ -2036,7 +2045,7 @@ var Er = { exports: {} };
|
|
|
2036
2045
|
}), i;
|
|
2037
2046
|
}
|
|
2038
2047
|
function fr(e, t) {
|
|
2039
|
-
|
|
2048
|
+
T(e).forEach(function(n) {
|
|
2040
2049
|
t.db.objectStoreNames.contains(n) || (fe && console.debug("Dexie: Creating missing table", n), yn(t, n, e[n].primKey, e[n].indexes));
|
|
2041
2050
|
});
|
|
2042
2051
|
}
|
|
@@ -2046,9 +2055,9 @@ var Er = { exports: {} };
|
|
|
2046
2055
|
function Bt(e, t, n) {
|
|
2047
2056
|
var r = {};
|
|
2048
2057
|
return yt(t.objectStoreNames, 0).forEach(function(i) {
|
|
2049
|
-
for (var o = n.objectStore(i), a = ln(cr(l = o.keyPath), l || "", !0, !1, !!o.autoIncrement, l && typeof l != "string", !0), u = [],
|
|
2050
|
-
var
|
|
2051
|
-
u.push(
|
|
2058
|
+
for (var o = n.objectStore(i), a = ln(cr(l = o.keyPath), l || "", !0, !1, !!o.autoIncrement, l && typeof l != "string", !0), u = [], d = 0; d < o.indexNames.length; ++d) {
|
|
2059
|
+
var g = o.index(o.indexNames[d]), l = g.keyPath, g = ln(g.name, l, !!g.unique, !!g.multiEntry, !1, l && typeof l != "string", !1);
|
|
2060
|
+
u.push(g);
|
|
2052
2061
|
}
|
|
2053
2062
|
r[i] = fn(i, a, u);
|
|
2054
2063
|
}), r;
|
|
@@ -2058,29 +2067,29 @@ var Er = { exports: {} };
|
|
|
2058
2067
|
var o = r[i], a = n.objectStore(o);
|
|
2059
2068
|
e._hasGetAll = "getAll" in a;
|
|
2060
2069
|
for (var u = 0; u < a.indexNames.length; ++u) {
|
|
2061
|
-
var
|
|
2062
|
-
!t[o] || (l = t[o].idxByName[
|
|
2070
|
+
var d = a.indexNames[u], l = a.index(d).keyPath, g = typeof l == "string" ? l : "[" + yt(l).join("+") + "]";
|
|
2071
|
+
!t[o] || (l = t[o].idxByName[g]) && (l.name = d, delete t[o].idxByName[g], t[o].idxByName[d] = l);
|
|
2063
2072
|
}
|
|
2064
2073
|
}
|
|
2065
|
-
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) &&
|
|
2074
|
+
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && F.WorkerGlobalScope && F instanceof F.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e._hasGetAll = !1);
|
|
2066
2075
|
}
|
|
2067
|
-
function
|
|
2076
|
+
function dr(e) {
|
|
2068
2077
|
return e.split(",").map(function(t, n) {
|
|
2069
2078
|
var r = (t = t.trim()).replace(/([&*]|\+\+)/g, ""), i = /^\[/.test(r) ? r.match(/^\[(.*)\]$/)[1].split("+") : r;
|
|
2070
|
-
return ln(r, i || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t),
|
|
2079
|
+
return ln(r, i || null, /\&/.test(t), /\*/.test(t), /\+\+/.test(t), W(i), n === 0);
|
|
2071
2080
|
});
|
|
2072
2081
|
}
|
|
2073
2082
|
var ni = (Rt.prototype._parseStoresSpec = function(e, t) {
|
|
2074
|
-
|
|
2083
|
+
T(e).forEach(function(n) {
|
|
2075
2084
|
if (e[n] !== null) {
|
|
2076
|
-
var r =
|
|
2085
|
+
var r = dr(e[n]), i = r.shift();
|
|
2077
2086
|
if (i.unique = !0, i.multi)
|
|
2078
|
-
throw new
|
|
2087
|
+
throw new I.Schema("Primary key cannot be multi-valued");
|
|
2079
2088
|
r.forEach(function(o) {
|
|
2080
2089
|
if (o.auto)
|
|
2081
|
-
throw new
|
|
2090
|
+
throw new I.Schema("Only primary key can be marked as autoIncrement (++)");
|
|
2082
2091
|
if (!o.keyPath)
|
|
2083
|
-
throw new
|
|
2092
|
+
throw new I.Schema("Index must have a name and cannot be an empty string");
|
|
2084
2093
|
}), t[n] = fn(n, i, r);
|
|
2085
2094
|
}
|
|
2086
2095
|
});
|
|
@@ -2090,21 +2099,21 @@ var Er = { exports: {} };
|
|
|
2090
2099
|
var n = t._versions, r = {}, i = {};
|
|
2091
2100
|
return n.forEach(function(o) {
|
|
2092
2101
|
q(r, o._cfg.storesSource), i = o._cfg.dbschema = {}, o._parseStoresSpec(r, i);
|
|
2093
|
-
}), t._dbSchema = i,
|
|
2102
|
+
}), t._dbSchema = i, hn(t, [t._allTables, t, t.Transaction.prototype]), Dt(t, [t._allTables, t, t.Transaction.prototype, this._cfg.tables], T(i), i), t._storeNames = T(i), this;
|
|
2094
2103
|
}, Rt.prototype.upgrade = function(e) {
|
|
2095
2104
|
return this._cfg.contentUpgrade = Ht(this._cfg.contentUpgrade || V, e), this;
|
|
2096
2105
|
}, Rt);
|
|
2097
2106
|
function Rt() {
|
|
2098
2107
|
}
|
|
2099
|
-
function
|
|
2108
|
+
function gn(e, t) {
|
|
2100
2109
|
var n = e._dbNamesDB;
|
|
2101
2110
|
return n || (n = e._dbNamesDB = new ve(Et, { addons: [], indexedDB: e, IDBKeyRange: t })).version(1).stores({ dbnames: "name" }), n.table("dbnames");
|
|
2102
2111
|
}
|
|
2103
|
-
function
|
|
2112
|
+
function mn(e) {
|
|
2104
2113
|
return e && typeof e.databases == "function";
|
|
2105
2114
|
}
|
|
2106
2115
|
function vn(e) {
|
|
2107
|
-
return
|
|
2116
|
+
return ke(function() {
|
|
2108
2117
|
return D.letThrough = !0, e();
|
|
2109
2118
|
});
|
|
2110
2119
|
}
|
|
@@ -2118,25 +2127,25 @@ var Er = { exports: {} };
|
|
|
2118
2127
|
}
|
|
2119
2128
|
q(this, arguments.length ? { d: 1, from: e, to: 1 < arguments.length ? t : e } : { d: 0 });
|
|
2120
2129
|
};
|
|
2121
|
-
function
|
|
2122
|
-
var r =
|
|
2130
|
+
function dt(e, t, n) {
|
|
2131
|
+
var r = U(t, n);
|
|
2123
2132
|
if (!isNaN(r)) {
|
|
2124
2133
|
if (0 < r)
|
|
2125
2134
|
throw RangeError();
|
|
2126
2135
|
if (bn(e))
|
|
2127
2136
|
return q(e, { from: t, to: n, d: 1 });
|
|
2128
2137
|
var i = e.l, r = e.r;
|
|
2129
|
-
if (
|
|
2130
|
-
return i ?
|
|
2131
|
-
if (0 <
|
|
2132
|
-
return r ?
|
|
2133
|
-
|
|
2138
|
+
if (U(n, e.from) < 0)
|
|
2139
|
+
return i ? dt(i, t, n) : e.l = { from: t, to: n, d: 1, l: null, r: null }, hr(e);
|
|
2140
|
+
if (0 < U(t, e.to))
|
|
2141
|
+
return r ? dt(r, t, n) : e.r = { from: t, to: n, d: 1, l: null, r: null }, hr(e);
|
|
2142
|
+
U(t, e.from) < 0 && (e.from = t, e.l = null, e.d = r ? r.d + 1 : 1), 0 < U(n, e.to) && (e.to = n, e.r = null, e.d = e.l ? e.l.d + 1 : 1), n = !e.r, i && !e.l && ht(e, i), r && n && ht(e, r);
|
|
2134
2143
|
}
|
|
2135
2144
|
}
|
|
2136
|
-
function
|
|
2137
|
-
bn(t) || function n(r,
|
|
2138
|
-
var o =
|
|
2139
|
-
|
|
2145
|
+
function ht(e, t) {
|
|
2146
|
+
bn(t) || function n(r, d) {
|
|
2147
|
+
var o = d.from, a = d.to, u = d.l, d = d.r;
|
|
2148
|
+
dt(r, o, a), u && n(r, u), d && n(r, d);
|
|
2140
2149
|
}(e, t);
|
|
2141
2150
|
}
|
|
2142
2151
|
function Mt(e, t) {
|
|
@@ -2144,9 +2153,9 @@ var Er = { exports: {} };
|
|
|
2144
2153
|
if (r.done)
|
|
2145
2154
|
return !1;
|
|
2146
2155
|
for (var i = r.value, o = wn(e), a = o.next(i.from), u = a.value; !r.done && !a.done; ) {
|
|
2147
|
-
if (
|
|
2156
|
+
if (U(u.from, i.to) <= 0 && 0 <= U(u.to, i.from))
|
|
2148
2157
|
return !0;
|
|
2149
|
-
|
|
2158
|
+
U(i.from, u.from) < 0 ? i = (r = n.next(u.from)).value : u = (a = o.next(i.from)).value;
|
|
2150
2159
|
}
|
|
2151
2160
|
return !1;
|
|
2152
2161
|
}
|
|
@@ -2157,13 +2166,13 @@ var Er = { exports: {} };
|
|
|
2157
2166
|
switch (t.s) {
|
|
2158
2167
|
case 0:
|
|
2159
2168
|
if (t.s = 1, r)
|
|
2160
|
-
for (; t.n.l &&
|
|
2169
|
+
for (; t.n.l && U(n, t.n.from) < 0; )
|
|
2161
2170
|
t = { up: t, n: t.n.l, s: 1 };
|
|
2162
2171
|
else
|
|
2163
2172
|
for (; t.n.l; )
|
|
2164
2173
|
t = { up: t, n: t.n.l, s: 1 };
|
|
2165
2174
|
case 1:
|
|
2166
|
-
if (t.s = 2, !r ||
|
|
2175
|
+
if (t.s = 2, !r || U(n, t.n.to) <= 0)
|
|
2167
2176
|
return { value: t.n, done: !1 };
|
|
2168
2177
|
case 2:
|
|
2169
2178
|
if (t.n.r) {
|
|
@@ -2176,7 +2185,7 @@ var Er = { exports: {} };
|
|
|
2176
2185
|
return { done: !0 };
|
|
2177
2186
|
} };
|
|
2178
2187
|
}
|
|
2179
|
-
function
|
|
2188
|
+
function hr(e) {
|
|
2180
2189
|
var t, n, r = (((t = e.r) === null || t === void 0 ? void 0 : t.d) || 0) - (((n = e.l) === null || n === void 0 ? void 0 : n.d) || 0), i = 1 < r ? "r" : r < -1 ? "l" : "";
|
|
2181
2190
|
i && (t = i == "r" ? "l" : "r", n = _({}, e), r = e[i], e.from = r.from, e.to = r.to, e[i] = r[i], n[i] = r[t], (e[t] = n).d = pr(n)), e.d = pr(e);
|
|
2182
2191
|
}
|
|
@@ -2185,8 +2194,8 @@ var Er = { exports: {} };
|
|
|
2185
2194
|
return (t ? n ? Math.max(t.d, n.d) : t.d : n ? n.d : 0) + 1;
|
|
2186
2195
|
}
|
|
2187
2196
|
function Ft(e, t) {
|
|
2188
|
-
return
|
|
2189
|
-
e[n] ?
|
|
2197
|
+
return T(t).forEach(function(n) {
|
|
2198
|
+
e[n] ? ht(e[n], t[n]) : e[n] = function r(i) {
|
|
2190
2199
|
var o, a, u = {};
|
|
2191
2200
|
for (o in i)
|
|
2192
2201
|
ne(i, o) && (a = i[o], u[o] = !a || typeof a != "object" || $n.has(a.constructor) ? a : r(a));
|
|
@@ -2200,21 +2209,21 @@ var Er = { exports: {} };
|
|
|
2200
2209
|
});
|
|
2201
2210
|
}
|
|
2202
2211
|
ze(re.prototype, ((le = { add: function(e) {
|
|
2203
|
-
return
|
|
2212
|
+
return ht(this, e), this;
|
|
2204
2213
|
}, addKey: function(e) {
|
|
2205
|
-
return
|
|
2214
|
+
return dt(this, e, e), this;
|
|
2206
2215
|
}, addKeys: function(e) {
|
|
2207
2216
|
var t = this;
|
|
2208
2217
|
return e.forEach(function(n) {
|
|
2209
|
-
return
|
|
2218
|
+
return dt(t, n, n);
|
|
2210
2219
|
}), this;
|
|
2211
2220
|
} })[Vt] = function() {
|
|
2212
2221
|
return wn(this);
|
|
2213
2222
|
}, le));
|
|
2214
|
-
var Re = {},
|
|
2223
|
+
var Re = {}, xn = {}, kn = !1;
|
|
2215
2224
|
function Nt(e) {
|
|
2216
|
-
Ft(
|
|
2217
|
-
|
|
2225
|
+
Ft(xn, e), kn || (kn = !0, setTimeout(function() {
|
|
2226
|
+
kn = !1, On(xn, !(xn = {}));
|
|
2218
2227
|
}, 0));
|
|
2219
2228
|
}
|
|
2220
2229
|
function On(e, t) {
|
|
@@ -2228,24 +2237,24 @@ var Er = { exports: {} };
|
|
|
2228
2237
|
var a, u = /^idb\:\/\/(.*)\/(.*)\//.exec(o);
|
|
2229
2238
|
u && (o = u[1], u = u[2], (a = Re["idb://".concat(o, "/").concat(u)]) && yr(a, e, n, t));
|
|
2230
2239
|
}
|
|
2231
|
-
n.forEach(function(
|
|
2232
|
-
return
|
|
2240
|
+
n.forEach(function(d) {
|
|
2241
|
+
return d();
|
|
2233
2242
|
});
|
|
2234
2243
|
}
|
|
2235
2244
|
function yr(e, t, n, r) {
|
|
2236
2245
|
for (var i = [], o = 0, a = Object.entries(e.queries.query); o < a.length; o++) {
|
|
2237
|
-
for (var u = a[o],
|
|
2238
|
-
var f = c[
|
|
2246
|
+
for (var u = a[o], d = u[0], l = [], g = 0, c = u[1]; g < c.length; g++) {
|
|
2247
|
+
var f = c[g];
|
|
2239
2248
|
_n(t, f.obsSet) ? f.subscribers.forEach(function(p) {
|
|
2240
2249
|
return n.add(p);
|
|
2241
2250
|
}) : r && l.push(f);
|
|
2242
2251
|
}
|
|
2243
|
-
r && i.push([
|
|
2252
|
+
r && i.push([d, l]);
|
|
2244
2253
|
}
|
|
2245
2254
|
if (r)
|
|
2246
|
-
for (var
|
|
2247
|
-
var
|
|
2248
|
-
e.queries.query[
|
|
2255
|
+
for (var h = 0, y = i; h < y.length; h++) {
|
|
2256
|
+
var m = y[h], d = m[0], l = m[1];
|
|
2257
|
+
e.queries.query[d] = l;
|
|
2249
2258
|
}
|
|
2250
2259
|
}
|
|
2251
2260
|
function ri(e) {
|
|
@@ -2258,29 +2267,29 @@ var Er = { exports: {} };
|
|
|
2258
2267
|
var r = t.openCanceller, i = Math.round(10 * e.verno), o = !1;
|
|
2259
2268
|
function a() {
|
|
2260
2269
|
if (t.openCanceller !== r)
|
|
2261
|
-
throw new
|
|
2270
|
+
throw new I.DatabaseClosed("db.open() was cancelled");
|
|
2262
2271
|
}
|
|
2263
2272
|
function u() {
|
|
2264
|
-
return new K(function(f,
|
|
2273
|
+
return new K(function(f, h) {
|
|
2265
2274
|
if (a(), !n)
|
|
2266
|
-
throw new
|
|
2267
|
-
var y = e.name,
|
|
2268
|
-
if (!
|
|
2269
|
-
throw new
|
|
2270
|
-
|
|
2275
|
+
throw new I.MissingAPI();
|
|
2276
|
+
var y = e.name, m = t.autoSchema || !i ? n.open(y) : n.open(y, i);
|
|
2277
|
+
if (!m)
|
|
2278
|
+
throw new I.MissingAPI();
|
|
2279
|
+
m.onerror = he(h), m.onblocked = H(e._fireOnBlocked), m.onupgradeneeded = H(function(p) {
|
|
2271
2280
|
var b;
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
})) : (
|
|
2275
|
-
},
|
|
2276
|
-
|
|
2277
|
-
var p, b, w,
|
|
2281
|
+
g = m.transaction, t.autoSchema && !e._options.allowEmptyDB ? (m.onerror = ut, g.abort(), m.result.close(), (b = n.deleteDatabase(y)).onsuccess = b.onerror = H(function() {
|
|
2282
|
+
h(new I.NoSuchDatabase("Database ".concat(y, " doesnt exist")));
|
|
2283
|
+
})) : (g.onerror = he(h), p = p.oldVersion > Math.pow(2, 62) ? 0 : p.oldVersion, c = p < 1, e.idbdb = m.result, o && ti(e, g), ei(e, p / 10, g, h));
|
|
2284
|
+
}, h), m.onsuccess = H(function() {
|
|
2285
|
+
g = null;
|
|
2286
|
+
var p, b, w, x, k, O = e.idbdb = m.result, P = yt(O.objectStoreNames);
|
|
2278
2287
|
if (0 < P.length)
|
|
2279
2288
|
try {
|
|
2280
|
-
var S = O.transaction((
|
|
2289
|
+
var S = O.transaction((x = P).length === 1 ? x[0] : x, "readonly");
|
|
2281
2290
|
if (t.autoSchema)
|
|
2282
|
-
b = O, w = S, (p = e).verno = b.version / 10, w = p._dbSchema = Bt(0, b, w), p._storeNames = yt(b.objectStoreNames, 0), Dt(p, [p._allTables],
|
|
2283
|
-
else if (It(e, e._dbSchema, S), ((
|
|
2291
|
+
b = O, w = S, (p = e).verno = b.version / 10, w = p._dbSchema = Bt(0, b, w), p._storeNames = yt(b.objectStoreNames, 0), Dt(p, [p._allTables], T(w), w);
|
|
2292
|
+
else if (It(e, e._dbSchema, S), ((k = pn(Bt(0, (k = e).idbdb, S), k._dbSchema)).add.length || k.change.some(function(C) {
|
|
2284
2293
|
return C.add.length || C.change.length;
|
|
2285
2294
|
})) && !o)
|
|
2286
2295
|
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."), O.close(), i = O.version + 1, o = !0, f(u());
|
|
@@ -2291,8 +2300,8 @@ var Er = { exports: {} };
|
|
|
2291
2300
|
t.vcFired = !0, e.on("versionchange").fire(C);
|
|
2292
2301
|
}), O.onclose = H(function(C) {
|
|
2293
2302
|
e.on("close").fire(C);
|
|
2294
|
-
}), c && (
|
|
2295
|
-
},
|
|
2303
|
+
}), c && (k = e._deps, S = y, O = k.indexedDB, k = k.IDBKeyRange, mn(O) || S === Et || gn(O, k).put({ name: S }).catch(V)), f();
|
|
2304
|
+
}, h);
|
|
2296
2305
|
}).catch(function(f) {
|
|
2297
2306
|
switch (f == null ? void 0 : f.name) {
|
|
2298
2307
|
case "UnknownError":
|
|
@@ -2306,22 +2315,22 @@ var Er = { exports: {} };
|
|
|
2306
2315
|
return K.reject(f);
|
|
2307
2316
|
});
|
|
2308
2317
|
}
|
|
2309
|
-
var
|
|
2318
|
+
var d, l = t.dbReadyResolve, g = null, c = !1;
|
|
2310
2319
|
return K.race([r, (typeof navigator > "u" ? K.resolve() : !navigator.userAgentData && /Safari\//.test(navigator.userAgent) && !/Chrom(e|ium)\//.test(navigator.userAgent) && indexedDB.databases ? new Promise(function(f) {
|
|
2311
|
-
function
|
|
2320
|
+
function h() {
|
|
2312
2321
|
return indexedDB.databases().finally(f);
|
|
2313
2322
|
}
|
|
2314
|
-
|
|
2323
|
+
d = setInterval(h, 100), h();
|
|
2315
2324
|
}).finally(function() {
|
|
2316
|
-
return clearInterval(
|
|
2325
|
+
return clearInterval(d);
|
|
2317
2326
|
}) : Promise.resolve()).then(u)]).then(function() {
|
|
2318
2327
|
return a(), t.onReadyBeingFired = [], K.resolve(vn(function() {
|
|
2319
2328
|
return e.on.ready.fire(e.vip);
|
|
2320
2329
|
})).then(function f() {
|
|
2321
2330
|
if (0 < t.onReadyBeingFired.length) {
|
|
2322
|
-
var
|
|
2331
|
+
var h = t.onReadyBeingFired.reduce(Ht, V);
|
|
2323
2332
|
return t.onReadyBeingFired = [], K.resolve(vn(function() {
|
|
2324
|
-
return
|
|
2333
|
+
return h(e.vip);
|
|
2325
2334
|
})).then(f);
|
|
2326
2335
|
}
|
|
2327
2336
|
});
|
|
@@ -2330,7 +2339,7 @@ var Er = { exports: {} };
|
|
|
2330
2339
|
}).catch(function(f) {
|
|
2331
2340
|
t.dbOpenError = f;
|
|
2332
2341
|
try {
|
|
2333
|
-
|
|
2342
|
+
g && g.abort();
|
|
2334
2343
|
} catch {
|
|
2335
2344
|
}
|
|
2336
2345
|
return r === t.openCanceller && e._close(), X(f);
|
|
@@ -2338,10 +2347,10 @@ var Er = { exports: {} };
|
|
|
2338
2347
|
t.openComplete = !0, l();
|
|
2339
2348
|
}).then(function() {
|
|
2340
2349
|
var f;
|
|
2341
|
-
return c && (f = {}, e.tables.forEach(function(
|
|
2342
|
-
|
|
2343
|
-
y.name && (f["idb://".concat(e.name, "/").concat(
|
|
2344
|
-
}), f["idb://".concat(e.name, "/").concat(
|
|
2350
|
+
return c && (f = {}, e.tables.forEach(function(h) {
|
|
2351
|
+
h.schema.indexes.forEach(function(y) {
|
|
2352
|
+
y.name && (f["idb://".concat(e.name, "/").concat(h.name, "/").concat(y.name)] = new re(-1 / 0, [[[]]]));
|
|
2353
|
+
}), f["idb://".concat(e.name, "/").concat(h.name, "/")] = f["idb://".concat(e.name, "/").concat(h.name, "/:dels")] = new re(-1 / 0, [[[]]]);
|
|
2345
2354
|
}), Pe(ct).fire(f), On(f, !0)), e;
|
|
2346
2355
|
});
|
|
2347
2356
|
}
|
|
@@ -2353,57 +2362,57 @@ var Er = { exports: {} };
|
|
|
2353
2362
|
return e.throw(o);
|
|
2354
2363
|
});
|
|
2355
2364
|
function i(o) {
|
|
2356
|
-
return function(
|
|
2357
|
-
var u = o(
|
|
2358
|
-
return u.done ?
|
|
2365
|
+
return function(d) {
|
|
2366
|
+
var u = o(d), d = u.value;
|
|
2367
|
+
return u.done ? d : d && typeof d.then == "function" ? d.then(n, r) : W(d) ? Promise.all(d).then(n, r) : n(d);
|
|
2359
2368
|
};
|
|
2360
2369
|
}
|
|
2361
2370
|
return i(t)();
|
|
2362
2371
|
}
|
|
2363
2372
|
function zt(e, t, n) {
|
|
2364
|
-
for (var r =
|
|
2373
|
+
for (var r = W(e) ? e.slice() : [e], i = 0; i < n; ++i)
|
|
2365
2374
|
r.push(t);
|
|
2366
2375
|
return r;
|
|
2367
2376
|
}
|
|
2368
2377
|
var ii = { stack: "dbcore", name: "VirtualIndexMiddleware", level: 1, create: function(e) {
|
|
2369
2378
|
return _(_({}, e), { table: function(t) {
|
|
2370
2379
|
var n = e.table(t), r = n.schema, i = {}, o = [];
|
|
2371
|
-
function a(c, f,
|
|
2372
|
-
var y = ft(c),
|
|
2373
|
-
return
|
|
2374
|
-
return w.keyTail -
|
|
2380
|
+
function a(c, f, h) {
|
|
2381
|
+
var y = ft(c), m = i[y] = i[y] || [], p = c == null ? 0 : typeof c == "string" ? 1 : c.length, b = 0 < f, b = _(_({}, h), { name: b ? "".concat(y, "(virtual-from:").concat(h.name, ")") : h.name, lowLevelIndex: h, isVirtual: b, keyTail: f, keyLength: p, extractKey: dn(c), unique: !b && h.unique });
|
|
2382
|
+
return m.push(b), b.isPrimaryKey || o.push(b), 1 < p && a(p === 2 ? c[0] : c.slice(0, p - 1), f + 1, h), m.sort(function(w, x) {
|
|
2383
|
+
return w.keyTail - x.keyTail;
|
|
2375
2384
|
}), b;
|
|
2376
2385
|
}
|
|
2377
2386
|
t = a(r.primaryKey.keyPath, 0, r.primaryKey), i[":id"] = [t];
|
|
2378
|
-
for (var u = 0,
|
|
2379
|
-
var l =
|
|
2387
|
+
for (var u = 0, d = r.indexes; u < d.length; u++) {
|
|
2388
|
+
var l = d[u];
|
|
2380
2389
|
a(l.keyPath, 0, l);
|
|
2381
2390
|
}
|
|
2382
|
-
function
|
|
2383
|
-
var f,
|
|
2384
|
-
return
|
|
2391
|
+
function g(c) {
|
|
2392
|
+
var f, h = c.query.index;
|
|
2393
|
+
return h.isVirtual ? _(_({}, c), { query: { index: h.lowLevelIndex, range: (f = c.query.range, h = h.keyTail, { type: f.type === 1 ? 2 : f.type, lower: zt(f.lower, f.lowerOpen ? e.MAX_KEY : e.MIN_KEY, h), lowerOpen: !0, upper: zt(f.upper, f.upperOpen ? e.MIN_KEY : e.MAX_KEY, h), upperOpen: !0 }) } }) : c;
|
|
2385
2394
|
}
|
|
2386
2395
|
return _(_({}, n), { schema: _(_({}, r), { primaryKey: t, indexes: o, getIndexByKeyPath: function(c) {
|
|
2387
2396
|
return (c = i[ft(c)]) && c[0];
|
|
2388
2397
|
} }), count: function(c) {
|
|
2389
|
-
return n.count(
|
|
2398
|
+
return n.count(g(c));
|
|
2390
2399
|
}, query: function(c) {
|
|
2391
|
-
return n.query(
|
|
2400
|
+
return n.query(g(c));
|
|
2392
2401
|
}, openCursor: function(c) {
|
|
2393
|
-
var f = c.query.index,
|
|
2394
|
-
return y ? n.openCursor(
|
|
2402
|
+
var f = c.query.index, h = f.keyTail, y = f.isVirtual, m = f.keyLength;
|
|
2403
|
+
return y ? n.openCursor(g(c)).then(function(b) {
|
|
2395
2404
|
return b && p(b);
|
|
2396
2405
|
}) : n.openCursor(c);
|
|
2397
2406
|
function p(b) {
|
|
2398
2407
|
return Object.create(b, { continue: { value: function(w) {
|
|
2399
|
-
w != null ? b.continue(zt(w, c.reverse ? e.MAX_KEY : e.MIN_KEY,
|
|
2400
|
-
} }, continuePrimaryKey: { value: function(w,
|
|
2401
|
-
b.continuePrimaryKey(zt(w, e.MAX_KEY,
|
|
2408
|
+
w != null ? b.continue(zt(w, c.reverse ? e.MAX_KEY : e.MIN_KEY, h)) : c.unique ? b.continue(b.key.slice(0, m).concat(c.reverse ? e.MIN_KEY : e.MAX_KEY, h)) : b.continue();
|
|
2409
|
+
} }, continuePrimaryKey: { value: function(w, x) {
|
|
2410
|
+
b.continuePrimaryKey(zt(w, e.MAX_KEY, h), x);
|
|
2402
2411
|
} }, primaryKey: { get: function() {
|
|
2403
2412
|
return b.primaryKey;
|
|
2404
2413
|
} }, key: { get: function() {
|
|
2405
2414
|
var w = b.key;
|
|
2406
|
-
return
|
|
2415
|
+
return m === 1 ? w[0] : w.slice(0, m);
|
|
2407
2416
|
} }, value: { get: function() {
|
|
2408
2417
|
return b.value;
|
|
2409
2418
|
} } });
|
|
@@ -2412,10 +2421,10 @@ var Er = { exports: {} };
|
|
|
2412
2421
|
} });
|
|
2413
2422
|
} };
|
|
2414
2423
|
function En(e, t, n, r) {
|
|
2415
|
-
return n = n || {}, r = r || "",
|
|
2424
|
+
return n = n || {}, r = r || "", T(e).forEach(function(i) {
|
|
2416
2425
|
var o, a, u;
|
|
2417
2426
|
ne(t, i) ? (o = e[i], a = t[i], typeof o == "object" && typeof a == "object" && o && a ? (u = $t(o)) !== $t(a) ? n[r + i] = t[i] : u === "Object" ? En(o, a, n, r + i + ".") : o !== a && (n[r + i] = t[i]) : o !== a && (n[r + i] = t[i])) : n[r + i] = void 0;
|
|
2418
|
-
}),
|
|
2427
|
+
}), T(t).forEach(function(i) {
|
|
2419
2428
|
ne(e, i) || (n[r + i] = t[i]);
|
|
2420
2429
|
}), n;
|
|
2421
2430
|
}
|
|
@@ -2426,74 +2435,74 @@ var Er = { exports: {} };
|
|
|
2426
2435
|
return _(_({}, e), { table: function(t) {
|
|
2427
2436
|
var n = e.table(t), r = n.schema.primaryKey;
|
|
2428
2437
|
return _(_({}, n), { mutate: function(i) {
|
|
2429
|
-
var o = D.trans, a = o.table(t).hook, u = a.deleting,
|
|
2438
|
+
var o = D.trans, a = o.table(t).hook, u = a.deleting, d = a.creating, l = a.updating;
|
|
2430
2439
|
switch (i.type) {
|
|
2431
2440
|
case "add":
|
|
2432
|
-
if (
|
|
2441
|
+
if (d.fire === V)
|
|
2433
2442
|
break;
|
|
2434
2443
|
return o._promise("readwrite", function() {
|
|
2435
|
-
return
|
|
2444
|
+
return g(i);
|
|
2436
2445
|
}, !0);
|
|
2437
2446
|
case "put":
|
|
2438
|
-
if (
|
|
2447
|
+
if (d.fire === V && l.fire === V)
|
|
2439
2448
|
break;
|
|
2440
2449
|
return o._promise("readwrite", function() {
|
|
2441
|
-
return
|
|
2450
|
+
return g(i);
|
|
2442
2451
|
}, !0);
|
|
2443
2452
|
case "delete":
|
|
2444
2453
|
if (u.fire === V)
|
|
2445
2454
|
break;
|
|
2446
2455
|
return o._promise("readwrite", function() {
|
|
2447
|
-
return
|
|
2456
|
+
return g(i);
|
|
2448
2457
|
}, !0);
|
|
2449
2458
|
case "deleteRange":
|
|
2450
2459
|
if (u.fire === V)
|
|
2451
2460
|
break;
|
|
2452
2461
|
return o._promise("readwrite", function() {
|
|
2453
|
-
return function c(f,
|
|
2454
|
-
return n.query({ trans: f, values: !1, query: { index: r, range:
|
|
2455
|
-
var p =
|
|
2456
|
-
return
|
|
2457
|
-
return 0 < b.numFailures ? Promise.reject(b.failures[0]) : p.length < y ? { failures: [], numFailures: 0, lastResult: void 0 } : c(f, _(_({},
|
|
2462
|
+
return function c(f, h, y) {
|
|
2463
|
+
return n.query({ trans: f, values: !1, query: { index: r, range: h }, limit: y }).then(function(m) {
|
|
2464
|
+
var p = m.result;
|
|
2465
|
+
return g({ type: "delete", keys: p, trans: f }).then(function(b) {
|
|
2466
|
+
return 0 < b.numFailures ? Promise.reject(b.failures[0]) : p.length < y ? { failures: [], numFailures: 0, lastResult: void 0 } : c(f, _(_({}, h), { lower: p[p.length - 1], lowerOpen: !0 }), y);
|
|
2458
2467
|
});
|
|
2459
2468
|
});
|
|
2460
2469
|
}(i.trans, i.range, 1e4);
|
|
2461
2470
|
}, !0);
|
|
2462
2471
|
}
|
|
2463
2472
|
return n.mutate(i);
|
|
2464
|
-
function
|
|
2465
|
-
var f,
|
|
2473
|
+
function g(c) {
|
|
2474
|
+
var f, h, y, m = D.trans, p = c.keys || Pn(r, c);
|
|
2466
2475
|
if (!p)
|
|
2467
2476
|
throw new Error("Keys missing");
|
|
2468
|
-
return (c = c.type === "add" || c.type === "put" ? _(_({}, c), { keys: p }) : _({}, c)).type !== "delete" && (c.values = j([], c.values, !0)), c.keys && (c.keys = j([], c.keys, !0)), f = n, y = p, ((
|
|
2469
|
-
var w = p.map(function(
|
|
2470
|
-
var O, P, S, C = b[
|
|
2471
|
-
return c.type === "delete" ? u.fire.call(E,
|
|
2472
|
-
ne(S,
|
|
2477
|
+
return (c = c.type === "add" || c.type === "put" ? _(_({}, c), { keys: p }) : _({}, c)).type !== "delete" && (c.values = j([], c.values, !0)), c.keys && (c.keys = j([], c.keys, !0)), f = n, y = p, ((h = c).type === "add" ? Promise.resolve([]) : f.getMany({ trans: h.trans, keys: y, cache: "immutable" })).then(function(b) {
|
|
2478
|
+
var w = p.map(function(x, k) {
|
|
2479
|
+
var O, P, S, C = b[k], E = { onerror: null, onsuccess: null };
|
|
2480
|
+
return c.type === "delete" ? u.fire.call(E, x, C, m) : c.type === "add" || C === void 0 ? (O = d.fire.call(E, x, c.values[k], m), x == null && O != null && (c.keys[k] = x = O, r.outbound || ce(c.values[k], r.keyPath, x))) : (O = En(C, c.values[k]), (P = l.fire.call(E, O, x, C, m)) && (S = c.values[k], Object.keys(P).forEach(function(B) {
|
|
2481
|
+
ne(S, B) ? S[B] = P[B] : ce(S, B, P[B]);
|
|
2473
2482
|
}))), E;
|
|
2474
2483
|
});
|
|
2475
|
-
return n.mutate(c).then(function(
|
|
2476
|
-
for (var
|
|
2484
|
+
return n.mutate(c).then(function(x) {
|
|
2485
|
+
for (var k = x.failures, O = x.results, P = x.numFailures, x = x.lastResult, S = 0; S < p.length; ++S) {
|
|
2477
2486
|
var C = (O || p)[S], E = w[S];
|
|
2478
|
-
C == null ? E.onerror && E.onerror(
|
|
2487
|
+
C == null ? E.onerror && E.onerror(k[S]) : E.onsuccess && E.onsuccess(c.type === "put" && b[S] ? c.values[S] : C);
|
|
2479
2488
|
}
|
|
2480
|
-
return { failures:
|
|
2481
|
-
}).catch(function(
|
|
2482
|
-
return w.forEach(function(
|
|
2483
|
-
return
|
|
2484
|
-
}), Promise.reject(
|
|
2489
|
+
return { failures: k, results: O, numFailures: P, lastResult: x };
|
|
2490
|
+
}).catch(function(x) {
|
|
2491
|
+
return w.forEach(function(k) {
|
|
2492
|
+
return k.onerror && k.onerror(x);
|
|
2493
|
+
}), Promise.reject(x);
|
|
2485
2494
|
});
|
|
2486
2495
|
});
|
|
2487
2496
|
}
|
|
2488
2497
|
} });
|
|
2489
2498
|
} });
|
|
2490
2499
|
} };
|
|
2491
|
-
function
|
|
2500
|
+
function gr(e, t, n) {
|
|
2492
2501
|
try {
|
|
2493
2502
|
if (!t || t.keys.length < e.length)
|
|
2494
2503
|
return null;
|
|
2495
2504
|
for (var r = [], i = 0, o = 0; i < t.keys.length && o < e.length; ++i)
|
|
2496
|
-
|
|
2505
|
+
U(t.keys[i], e[o]) === 0 && (r.push(n ? _e(t.values[i]) : t.values[i]), ++o);
|
|
2497
2506
|
return r.length === e.length ? r : null;
|
|
2498
2507
|
} catch {
|
|
2499
2508
|
return null;
|
|
@@ -2505,7 +2514,7 @@ var Er = { exports: {} };
|
|
|
2505
2514
|
return _(_({}, n), { getMany: function(r) {
|
|
2506
2515
|
if (!r.cache)
|
|
2507
2516
|
return n.getMany(r);
|
|
2508
|
-
var i =
|
|
2517
|
+
var i = gr(r.keys, r.trans._cache, r.cache === "clone");
|
|
2509
2518
|
return i ? K.resolve(i) : n.getMany(r).then(function(o) {
|
|
2510
2519
|
return r.trans._cache = { keys: r.keys, values: r.cache === "clone" ? _e(o) : o }, o;
|
|
2511
2520
|
});
|
|
@@ -2514,7 +2523,7 @@ var Er = { exports: {} };
|
|
|
2514
2523
|
} });
|
|
2515
2524
|
} };
|
|
2516
2525
|
} };
|
|
2517
|
-
function
|
|
2526
|
+
function mr(e, t) {
|
|
2518
2527
|
return e.trans.mode === "readonly" && !!e.subscr && !e.trans.explicit && e.trans.db._options.cache !== "disabled" && !t.schema.primaryKey.outbound;
|
|
2519
2528
|
}
|
|
2520
2529
|
function vr(e, t) {
|
|
@@ -2532,82 +2541,82 @@ var Er = { exports: {} };
|
|
|
2532
2541
|
var t = e.schema.name, n = new re(e.MIN_KEY, e.MAX_KEY);
|
|
2533
2542
|
return _(_({}, e), { transaction: function(r, i, o) {
|
|
2534
2543
|
if (D.subscr && i !== "readonly")
|
|
2535
|
-
throw new
|
|
2544
|
+
throw new I.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(D.querier));
|
|
2536
2545
|
return e.transaction(r, i, o);
|
|
2537
2546
|
}, table: function(r) {
|
|
2538
|
-
function i(
|
|
2539
|
-
var
|
|
2540
|
-
return [
|
|
2547
|
+
function i(h) {
|
|
2548
|
+
var h = (y = h.query).index, y = y.range;
|
|
2549
|
+
return [h, new re((h = y.lower) !== null && h !== void 0 ? h : e.MIN_KEY, (y = y.upper) !== null && y !== void 0 ? y : e.MAX_KEY)];
|
|
2541
2550
|
}
|
|
2542
|
-
var o = e.table(r), a = o.schema, u = a.primaryKey,
|
|
2543
|
-
function
|
|
2551
|
+
var o = e.table(r), a = o.schema, u = a.primaryKey, d = u.extractKey, l = u.outbound, g = _(_({}, o), { mutate: function(f) {
|
|
2552
|
+
function h(E) {
|
|
2544
2553
|
return E = "idb://".concat(t, "/").concat(r, "/").concat(E), w[E] || (w[E] = new re());
|
|
2545
2554
|
}
|
|
2546
|
-
var y,
|
|
2555
|
+
var y, m, p, b = f.trans, w = f.mutatedParts || (f.mutatedParts = {}), x = h(""), k = h(":dels"), O = f.type, C = f.type === "deleteRange" ? [f.range] : f.type === "delete" ? [f.keys] : f.values.length < 50 ? [Pn(u, f).filter(function(E) {
|
|
2547
2556
|
return E;
|
|
2548
2557
|
}), f.values] : [], P = C[0], S = C[1], C = f.trans._cache;
|
|
2549
|
-
return
|
|
2550
|
-
var
|
|
2551
|
-
function R(
|
|
2552
|
-
return
|
|
2558
|
+
return W(P) ? (x.addKeys(P), (C = O === "delete" || P.length === S.length ? gr(P, C) : null) || k.addKeys(P), (C || S) && (y = h, m = C, p = S, a.indexes.forEach(function(E) {
|
|
2559
|
+
var B = y(E.name || "");
|
|
2560
|
+
function R(z) {
|
|
2561
|
+
return z != null ? E.extractKey(z) : null;
|
|
2553
2562
|
}
|
|
2554
|
-
function $(
|
|
2555
|
-
return E.multiEntry && z
|
|
2556
|
-
return
|
|
2557
|
-
}) :
|
|
2563
|
+
function $(z) {
|
|
2564
|
+
return E.multiEntry && W(z) ? z.forEach(function(G) {
|
|
2565
|
+
return B.addKey(G);
|
|
2566
|
+
}) : B.addKey(z);
|
|
2558
2567
|
}
|
|
2559
|
-
(
|
|
2560
|
-
var ue =
|
|
2561
|
-
|
|
2568
|
+
(m || p).forEach(function(z, N) {
|
|
2569
|
+
var ue = m && R(m[N]), N = p && R(p[N]);
|
|
2570
|
+
U(ue, N) !== 0 && (ue != null && $(ue), N != null && $(N));
|
|
2562
2571
|
});
|
|
2563
|
-
}))) : P ? (S = { from: P.lower, to: P.upper },
|
|
2564
|
-
return
|
|
2572
|
+
}))) : P ? (S = { from: P.lower, to: P.upper }, k.add(S), x.add(S)) : (x.add(n), k.add(n), a.indexes.forEach(function(E) {
|
|
2573
|
+
return h(E.name).add(n);
|
|
2565
2574
|
})), o.mutate(f).then(function(E) {
|
|
2566
|
-
return !P || f.type !== "add" && f.type !== "put" ||
|
|
2575
|
+
return !P || f.type !== "add" && f.type !== "put" || x.addKeys(E.results), b.mutatedParts = Ft(b.mutatedParts || {}, w), E;
|
|
2567
2576
|
});
|
|
2568
2577
|
} }), c = { get: function(f) {
|
|
2569
2578
|
return [u, new re(f.key)];
|
|
2570
2579
|
}, getMany: function(f) {
|
|
2571
2580
|
return [u, new re().addKeys(f.keys)];
|
|
2572
2581
|
}, count: i, query: i, openCursor: i };
|
|
2573
|
-
return
|
|
2574
|
-
|
|
2575
|
-
var y = D.subscr,
|
|
2576
|
-
if (
|
|
2582
|
+
return T(c).forEach(function(f) {
|
|
2583
|
+
g[f] = function(h) {
|
|
2584
|
+
var y = D.subscr, m = !!y, p = mr(D, o) && vr(f, h) ? h.obsSet = {} : y;
|
|
2585
|
+
if (m) {
|
|
2577
2586
|
var b = function(S) {
|
|
2578
2587
|
return S = "idb://".concat(t, "/").concat(r, "/").concat(S), p[S] || (p[S] = new re());
|
|
2579
|
-
}, w = b(""),
|
|
2580
|
-
if ((f === "query" &&
|
|
2588
|
+
}, w = b(""), x = b(":dels"), y = c[f](h), m = y[0], y = y[1];
|
|
2589
|
+
if ((f === "query" && m.isPrimaryKey && !h.values ? x : b(m.name || "")).add(y), !m.isPrimaryKey) {
|
|
2581
2590
|
if (f !== "count") {
|
|
2582
|
-
var
|
|
2591
|
+
var k = f === "query" && l && h.values && o.query(_(_({}, h), { values: !1 }));
|
|
2583
2592
|
return o[f].apply(this, arguments).then(function(S) {
|
|
2584
2593
|
if (f === "query") {
|
|
2585
|
-
if (l &&
|
|
2586
|
-
return
|
|
2594
|
+
if (l && h.values)
|
|
2595
|
+
return k.then(function(R) {
|
|
2587
2596
|
return R = R.result, w.addKeys(R), S;
|
|
2588
2597
|
});
|
|
2589
|
-
var C =
|
|
2590
|
-
(
|
|
2598
|
+
var C = h.values ? S.result.map(d) : S.result;
|
|
2599
|
+
(h.values ? w : x).addKeys(C);
|
|
2591
2600
|
} else if (f === "openCursor") {
|
|
2592
|
-
var E = S,
|
|
2601
|
+
var E = S, B = h.values;
|
|
2593
2602
|
return E && Object.create(E, { key: { get: function() {
|
|
2594
|
-
return
|
|
2603
|
+
return x.addKey(E.primaryKey), E.key;
|
|
2595
2604
|
} }, primaryKey: { get: function() {
|
|
2596
2605
|
var R = E.primaryKey;
|
|
2597
|
-
return
|
|
2606
|
+
return x.addKey(R), R;
|
|
2598
2607
|
} }, value: { get: function() {
|
|
2599
|
-
return
|
|
2608
|
+
return B && w.addKey(E.primaryKey), E.value;
|
|
2600
2609
|
} } });
|
|
2601
2610
|
}
|
|
2602
2611
|
return S;
|
|
2603
2612
|
});
|
|
2604
2613
|
}
|
|
2605
|
-
|
|
2614
|
+
x.add(n);
|
|
2606
2615
|
}
|
|
2607
2616
|
}
|
|
2608
2617
|
return o[f].apply(this, arguments);
|
|
2609
2618
|
};
|
|
2610
|
-
}),
|
|
2619
|
+
}), g;
|
|
2611
2620
|
} });
|
|
2612
2621
|
} };
|
|
2613
2622
|
function br(e, t, n) {
|
|
@@ -2616,37 +2625,37 @@ var Er = { exports: {} };
|
|
|
2616
2625
|
if (t.type === "deleteRange")
|
|
2617
2626
|
return null;
|
|
2618
2627
|
var r = t.keys ? t.keys.length : "values" in t && t.values ? t.values.length : 1;
|
|
2619
|
-
return n.numFailures === r ? null : (t = _({}, t),
|
|
2628
|
+
return n.numFailures === r ? null : (t = _({}, t), W(t.keys) && (t.keys = t.keys.filter(function(i, o) {
|
|
2620
2629
|
return !(o in n.failures);
|
|
2621
|
-
})), "values" in t &&
|
|
2630
|
+
})), "values" in t && W(t.values) && (t.values = t.values.filter(function(i, o) {
|
|
2622
2631
|
return !(o in n.failures);
|
|
2623
2632
|
})), t);
|
|
2624
2633
|
}
|
|
2625
2634
|
function jn(e, t) {
|
|
2626
|
-
return n = e, ((r = t).lower === void 0 || (r.lowerOpen ? 0 <
|
|
2635
|
+
return n = e, ((r = t).lower === void 0 || (r.lowerOpen ? 0 < U(n, r.lower) : 0 <= U(n, r.lower))) && (e = e, (t = t).upper === void 0 || (t.upperOpen ? U(e, t.upper) < 0 : U(e, t.upper) <= 0));
|
|
2627
2636
|
var n, r;
|
|
2628
2637
|
}
|
|
2629
2638
|
function wr(e, t, f, r, i, o) {
|
|
2630
2639
|
if (!f || f.length === 0)
|
|
2631
2640
|
return e;
|
|
2632
|
-
var a = t.query.index, u = a.multiEntry,
|
|
2633
|
-
var
|
|
2634
|
-
return
|
|
2635
|
-
return jn(O,
|
|
2636
|
-
}) : jn(
|
|
2637
|
-
}).map(function(
|
|
2638
|
-
return
|
|
2641
|
+
var a = t.query.index, u = a.multiEntry, d = t.query.range, l = r.schema.primaryKey.extractKey, g = a.extractKey, c = (a.lowLevelIndex || a).extractKey, f = f.reduce(function(h, y) {
|
|
2642
|
+
var m = h, p = y.type === "add" || y.type === "put" ? y.values.filter(function(k) {
|
|
2643
|
+
return k = g(k), u && W(k) ? k.some(function(O) {
|
|
2644
|
+
return jn(O, d);
|
|
2645
|
+
}) : jn(k, d);
|
|
2646
|
+
}).map(function(k) {
|
|
2647
|
+
return k = _e(k), o && Object.freeze(k), k;
|
|
2639
2648
|
}) : [];
|
|
2640
2649
|
switch (y.type) {
|
|
2641
2650
|
case "add":
|
|
2642
|
-
|
|
2651
|
+
m = h.concat(t.values ? p : p.map(function(O) {
|
|
2643
2652
|
return l(O);
|
|
2644
2653
|
}));
|
|
2645
2654
|
break;
|
|
2646
2655
|
case "put":
|
|
2647
2656
|
var b = new re().addKeys(y.values.map(function(O) {
|
|
2648
2657
|
return l(O);
|
|
2649
|
-
})),
|
|
2658
|
+
})), m = h.filter(function(O) {
|
|
2650
2659
|
return O = t.values ? l(O) : O, !Mt(new re(O), b);
|
|
2651
2660
|
}).concat(t.values ? p : p.map(function(O) {
|
|
2652
2661
|
return l(O);
|
|
@@ -2654,24 +2663,24 @@ var Er = { exports: {} };
|
|
|
2654
2663
|
break;
|
|
2655
2664
|
case "delete":
|
|
2656
2665
|
var w = new re().addKeys(y.keys);
|
|
2657
|
-
|
|
2666
|
+
m = h.filter(function(O) {
|
|
2658
2667
|
return O = t.values ? l(O) : O, !Mt(new re(O), w);
|
|
2659
2668
|
});
|
|
2660
2669
|
break;
|
|
2661
2670
|
case "deleteRange":
|
|
2662
|
-
var
|
|
2663
|
-
|
|
2664
|
-
return !jn(l(O),
|
|
2671
|
+
var x = y.range;
|
|
2672
|
+
m = h.filter(function(O) {
|
|
2673
|
+
return !jn(l(O), x);
|
|
2665
2674
|
});
|
|
2666
2675
|
}
|
|
2667
|
-
return
|
|
2676
|
+
return m;
|
|
2668
2677
|
}, e);
|
|
2669
|
-
return f === e ? e : (f.sort(function(
|
|
2670
|
-
return
|
|
2678
|
+
return f === e ? e : (f.sort(function(h, y) {
|
|
2679
|
+
return U(c(h), c(y)) || U(l(h), l(y));
|
|
2671
2680
|
}), t.limit && t.limit < 1 / 0 && (f.length > t.limit ? f.length = t.limit : e.length === t.limit && f.length < t.limit && (i.dirty = !0)), o ? Object.freeze(f) : f);
|
|
2672
2681
|
}
|
|
2673
2682
|
function _r(e, t) {
|
|
2674
|
-
return
|
|
2683
|
+
return U(e.lower, t.lower) === 0 && U(e.upper, t.upper) === 0 && !!e.lowerOpen == !!t.lowerOpen && !!e.upperOpen == !!t.upperOpen;
|
|
2675
2684
|
}
|
|
2676
2685
|
function ui(e, t) {
|
|
2677
2686
|
return function(n, r, i, o) {
|
|
@@ -2679,7 +2688,7 @@ var Er = { exports: {} };
|
|
|
2679
2688
|
return r !== void 0 ? -1 : 0;
|
|
2680
2689
|
if (r === void 0)
|
|
2681
2690
|
return 1;
|
|
2682
|
-
if ((r =
|
|
2691
|
+
if ((r = U(n, r)) === 0) {
|
|
2683
2692
|
if (i && o)
|
|
2684
2693
|
return 0;
|
|
2685
2694
|
if (i)
|
|
@@ -2693,7 +2702,7 @@ var Er = { exports: {} };
|
|
|
2693
2702
|
return r !== void 0 ? 1 : 0;
|
|
2694
2703
|
if (r === void 0)
|
|
2695
2704
|
return -1;
|
|
2696
|
-
if ((r =
|
|
2705
|
+
if ((r = U(n, r)) === 0) {
|
|
2697
2706
|
if (i && o)
|
|
2698
2707
|
return 0;
|
|
2699
2708
|
if (i)
|
|
@@ -2716,28 +2725,28 @@ var Er = { exports: {} };
|
|
|
2716
2725
|
var t = e.schema.name;
|
|
2717
2726
|
return _(_({}, e), { transaction: function(n, r, i) {
|
|
2718
2727
|
var o, a, u = e.transaction(n, r, i);
|
|
2719
|
-
return r === "readwrite" && (a = (o = new AbortController()).signal, i = function(
|
|
2728
|
+
return r === "readwrite" && (a = (o = new AbortController()).signal, i = function(d) {
|
|
2720
2729
|
return function() {
|
|
2721
2730
|
if (o.abort(), r === "readwrite") {
|
|
2722
|
-
for (var l = /* @__PURE__ */ new Set(),
|
|
2723
|
-
var f = c[
|
|
2724
|
-
if (
|
|
2725
|
-
var y = e.table(f),
|
|
2731
|
+
for (var l = /* @__PURE__ */ new Set(), g = 0, c = n; g < c.length; g++) {
|
|
2732
|
+
var f = c[g], h = Re["idb://".concat(t, "/").concat(f)];
|
|
2733
|
+
if (h) {
|
|
2734
|
+
var y = e.table(f), m = h.optimisticOps.filter(function(R) {
|
|
2726
2735
|
return R.trans === u;
|
|
2727
2736
|
});
|
|
2728
|
-
if (u._explicit &&
|
|
2729
|
-
for (var p = 0, b = Object.values(
|
|
2730
|
-
for (var w = 0,
|
|
2731
|
-
_n((S =
|
|
2737
|
+
if (u._explicit && d && u.mutatedParts)
|
|
2738
|
+
for (var p = 0, b = Object.values(h.queries.query); p < b.length; p++)
|
|
2739
|
+
for (var w = 0, x = (P = b[p]).slice(); w < x.length; w++)
|
|
2740
|
+
_n((S = x[w]).obsSet, u.mutatedParts) && (Ce(P, S), S.subscribers.forEach(function(R) {
|
|
2732
2741
|
return l.add(R);
|
|
2733
2742
|
}));
|
|
2734
|
-
else if (0 <
|
|
2735
|
-
|
|
2743
|
+
else if (0 < m.length) {
|
|
2744
|
+
h.optimisticOps = h.optimisticOps.filter(function(R) {
|
|
2736
2745
|
return R.trans !== u;
|
|
2737
2746
|
});
|
|
2738
|
-
for (var
|
|
2739
|
-
for (var P, S, C, E = 0,
|
|
2740
|
-
(S =
|
|
2747
|
+
for (var k = 0, O = Object.values(h.queries.query); k < O.length; k++)
|
|
2748
|
+
for (var P, S, C, E = 0, B = (P = O[k]).slice(); E < B.length; E++)
|
|
2749
|
+
(S = B[E]).res != null && u.mutatedParts && (d && !S.dirty ? (C = Object.isFrozen(S.res), C = wr(S.res, S.req, m, y, S, C), S.dirty ? (Ce(P, S), S.subscribers.forEach(function(R) {
|
|
2741
2750
|
return l.add(R);
|
|
2742
2751
|
})) : C !== S.res && (S.res = C, S.promise = K.resolve({ result: C }))) : (S.dirty && Ce(P, S), S.subscribers.forEach(function(R) {
|
|
2743
2752
|
return l.add(R);
|
|
@@ -2758,60 +2767,60 @@ var Er = { exports: {} };
|
|
|
2758
2767
|
if (i.outbound || a.db._options.cache === "disabled" || a.explicit)
|
|
2759
2768
|
return r.mutate(o);
|
|
2760
2769
|
var u = Re["idb://".concat(t, "/").concat(n)];
|
|
2761
|
-
return u ? (a = r.mutate(o), o.type !== "add" && o.type !== "put" || !(50 <= o.values.length || Pn(i, o).some(function(
|
|
2762
|
-
return
|
|
2763
|
-
})) ? (u.optimisticOps.push(o), o.mutatedParts && Nt(o.mutatedParts), a.then(function(
|
|
2764
|
-
0 <
|
|
2770
|
+
return u ? (a = r.mutate(o), o.type !== "add" && o.type !== "put" || !(50 <= o.values.length || Pn(i, o).some(function(d) {
|
|
2771
|
+
return d == null;
|
|
2772
|
+
})) ? (u.optimisticOps.push(o), o.mutatedParts && Nt(o.mutatedParts), a.then(function(d) {
|
|
2773
|
+
0 < d.numFailures && (Ce(u.optimisticOps, o), (d = br(0, o, d)) && u.optimisticOps.push(d), o.mutatedParts && Nt(o.mutatedParts));
|
|
2765
2774
|
}), a.catch(function() {
|
|
2766
2775
|
Ce(u.optimisticOps, o), o.mutatedParts && Nt(o.mutatedParts);
|
|
2767
|
-
})) : a.then(function(
|
|
2768
|
-
var l = br(0, _(_({}, o), { values: o.values.map(function(
|
|
2769
|
-
var f,
|
|
2770
|
-
return ce(
|
|
2771
|
-
}) }),
|
|
2776
|
+
})) : a.then(function(d) {
|
|
2777
|
+
var l = br(0, _(_({}, o), { values: o.values.map(function(h, c) {
|
|
2778
|
+
var f, h = (f = i.keyPath) !== null && f !== void 0 && f.includes(".") ? _e(h) : _({}, h);
|
|
2779
|
+
return ce(h, i.keyPath, d.results[c]), h;
|
|
2780
|
+
}) }), d);
|
|
2772
2781
|
u.optimisticOps.push(l), queueMicrotask(function() {
|
|
2773
2782
|
return o.mutatedParts && Nt(o.mutatedParts);
|
|
2774
2783
|
});
|
|
2775
2784
|
}), a) : r.mutate(o);
|
|
2776
2785
|
}, query: function(o) {
|
|
2777
|
-
if (!
|
|
2786
|
+
if (!mr(D, r) || !vr("query", o))
|
|
2778
2787
|
return r.query(o);
|
|
2779
|
-
var a = ((l = D.trans) === null || l === void 0 ? void 0 : l.db._options.cache) === "immutable", c = D, u = c.requery,
|
|
2780
|
-
var w = Re["idb://".concat(y, "/").concat(
|
|
2788
|
+
var a = ((l = D.trans) === null || l === void 0 ? void 0 : l.db._options.cache) === "immutable", c = D, u = c.requery, d = c.signal, l = function(y, m, p, b) {
|
|
2789
|
+
var w = Re["idb://".concat(y, "/").concat(m)];
|
|
2781
2790
|
if (!w)
|
|
2782
2791
|
return [];
|
|
2783
|
-
if (!(
|
|
2792
|
+
if (!(m = w.queries[p]))
|
|
2784
2793
|
return [null, !1, w, null];
|
|
2785
|
-
var
|
|
2786
|
-
if (!
|
|
2794
|
+
var x = m[(b.query ? b.query.index.name : null) || ""];
|
|
2795
|
+
if (!x)
|
|
2787
2796
|
return [null, !1, w, null];
|
|
2788
2797
|
switch (p) {
|
|
2789
2798
|
case "query":
|
|
2790
|
-
var
|
|
2799
|
+
var k = x.find(function(O) {
|
|
2791
2800
|
return O.req.limit === b.limit && O.req.values === b.values && _r(O.req.query.range, b.query.range);
|
|
2792
2801
|
});
|
|
2793
|
-
return
|
|
2802
|
+
return k ? [k, !0, w, x] : [x.find(function(O) {
|
|
2794
2803
|
return ("limit" in O.req ? O.req.limit : 1 / 0) >= b.limit && (!b.values || O.req.values) && ui(O.req.query.range, b.query.range);
|
|
2795
|
-
}), !1, w,
|
|
2804
|
+
}), !1, w, x];
|
|
2796
2805
|
case "count":
|
|
2797
|
-
return
|
|
2806
|
+
return k = x.find(function(O) {
|
|
2798
2807
|
return _r(O.req.query.range, b.query.range);
|
|
2799
|
-
}), [
|
|
2808
|
+
}), [k, !!k, w, x];
|
|
2800
2809
|
}
|
|
2801
|
-
}(t, n, "query", o),
|
|
2802
|
-
return
|
|
2803
|
-
var
|
|
2804
|
-
if (
|
|
2805
|
-
for (var p = 0, b =
|
|
2806
|
-
Object.freeze(
|
|
2807
|
-
Object.freeze(
|
|
2810
|
+
}(t, n, "query", o), g = l[0], c = l[1], f = l[2], h = l[3];
|
|
2811
|
+
return g && c ? g.obsSet = o.obsSet : (c = r.query(o).then(function(y) {
|
|
2812
|
+
var m = y.result;
|
|
2813
|
+
if (g && (g.res = m), a) {
|
|
2814
|
+
for (var p = 0, b = m.length; p < b; ++p)
|
|
2815
|
+
Object.freeze(m[p]);
|
|
2816
|
+
Object.freeze(m);
|
|
2808
2817
|
} else
|
|
2809
|
-
y.result = _e(
|
|
2818
|
+
y.result = _e(m);
|
|
2810
2819
|
return y;
|
|
2811
2820
|
}).catch(function(y) {
|
|
2812
|
-
return
|
|
2813
|
-
}),
|
|
2814
|
-
return { result: wr(y.result, o, f == null ? void 0 : f.optimisticOps, r,
|
|
2821
|
+
return h && g && Ce(h, g), Promise.reject(y);
|
|
2822
|
+
}), g = { obsSet: o.obsSet, promise: c, subscribers: /* @__PURE__ */ new Set(), type: "query", req: o, dirty: !1 }, h ? h.push(g) : (h = [g], (f = f || (Re["idb://".concat(t, "/").concat(n)] = { queries: { query: {}, count: {} }, objs: /* @__PURE__ */ new Map(), optimisticOps: [], unsignaledParts: {} })).queries.query[o.query.index.name || ""] = h)), ci(g, h, u, d), g.promise.then(function(y) {
|
|
2823
|
+
return { result: wr(y.result, o, f == null ? void 0 : f.optimisticOps, r, g, a) };
|
|
2815
2824
|
});
|
|
2816
2825
|
} });
|
|
2817
2826
|
} });
|
|
@@ -2823,9 +2832,9 @@ var Er = { exports: {} };
|
|
|
2823
2832
|
}
|
|
2824
2833
|
var ve = (J.prototype.version = function(e) {
|
|
2825
2834
|
if (isNaN(e) || e < 0.1)
|
|
2826
|
-
throw new
|
|
2835
|
+
throw new I.Type("Given version is not a positive number");
|
|
2827
2836
|
if (e = Math.round(10 * e) / 10, this.idbdb || this._state.isBeingOpened)
|
|
2828
|
-
throw new
|
|
2837
|
+
throw new I.Schema("Cannot add version when database is open");
|
|
2829
2838
|
this.verno = Math.max(this.verno, e);
|
|
2830
2839
|
var t = this._versions, n = t.filter(function(r) {
|
|
2831
2840
|
return r._cfg.version === e;
|
|
@@ -2835,10 +2844,10 @@ var Er = { exports: {} };
|
|
|
2835
2844
|
var t = this;
|
|
2836
2845
|
return this.idbdb && (this._state.openComplete || D.letThrough || this._vip) ? e() : new K(function(n, r) {
|
|
2837
2846
|
if (t._state.openComplete)
|
|
2838
|
-
return r(new
|
|
2847
|
+
return r(new I.DatabaseClosed(t._state.dbOpenError));
|
|
2839
2848
|
if (!t._state.isBeingOpened) {
|
|
2840
2849
|
if (!t._state.autoOpen)
|
|
2841
|
-
return void r(new
|
|
2850
|
+
return void r(new I.DatabaseClosed());
|
|
2842
2851
|
t.open().catch(V);
|
|
2843
2852
|
}
|
|
2844
2853
|
t._state.dbReadyPromise.then(n, r);
|
|
@@ -2855,7 +2864,7 @@ var Er = { exports: {} };
|
|
|
2855
2864
|
})), this;
|
|
2856
2865
|
}, J.prototype.open = function() {
|
|
2857
2866
|
var e = this;
|
|
2858
|
-
return Te(
|
|
2867
|
+
return Te(xe, function() {
|
|
2859
2868
|
return ri(e);
|
|
2860
2869
|
});
|
|
2861
2870
|
}, J.prototype._close = function() {
|
|
@@ -2874,7 +2883,7 @@ var Er = { exports: {} };
|
|
|
2874
2883
|
}));
|
|
2875
2884
|
}, J.prototype.close = function(n) {
|
|
2876
2885
|
var t = (n === void 0 ? { disableAutoOpen: !0 } : n).disableAutoOpen, n = this._state;
|
|
2877
|
-
t ? (n.isBeingOpened && n.cancelOpen(new
|
|
2886
|
+
t ? (n.isBeingOpened && n.cancelOpen(new I.DatabaseClosed()), this._close(), n.autoOpen = !1, n.dbOpenError = new I.DatabaseClosed()) : (this._close(), n.autoOpen = this._options.autoOpen || n.isBeingOpened, n.openComplete = !1, n.dbOpenError = null);
|
|
2878
2887
|
}, J.prototype.delete = function(e) {
|
|
2879
2888
|
var t = this;
|
|
2880
2889
|
e === void 0 && (e = { disableAutoOpen: !0 });
|
|
@@ -2884,12 +2893,12 @@ var Er = { exports: {} };
|
|
|
2884
2893
|
t.close(e);
|
|
2885
2894
|
var u = t._deps.indexedDB.deleteDatabase(t.name);
|
|
2886
2895
|
u.onsuccess = H(function() {
|
|
2887
|
-
var
|
|
2888
|
-
|
|
2889
|
-
}), u.onerror =
|
|
2896
|
+
var d, l, g;
|
|
2897
|
+
d = t._deps, l = t.name, g = d.indexedDB, d = d.IDBKeyRange, mn(g) || l === Et || gn(g, d).delete(l).catch(V), i();
|
|
2898
|
+
}), u.onerror = he(o), u.onblocked = t._fireOnBlocked;
|
|
2890
2899
|
}
|
|
2891
2900
|
if (n)
|
|
2892
|
-
throw new
|
|
2901
|
+
throw new I.InvalidArgument("Arguments not allowed in db.delete()");
|
|
2893
2902
|
r.isBeingOpened ? r.dbReadyPromise.then(a) : a();
|
|
2894
2903
|
});
|
|
2895
2904
|
}, J.prototype.backendDB = function() {
|
|
@@ -2905,14 +2914,14 @@ var Er = { exports: {} };
|
|
|
2905
2914
|
return this._state.autoSchema;
|
|
2906
2915
|
}, Object.defineProperty(J.prototype, "tables", { get: function() {
|
|
2907
2916
|
var e = this;
|
|
2908
|
-
return
|
|
2917
|
+
return T(this._allTables).map(function(t) {
|
|
2909
2918
|
return e._allTables[t];
|
|
2910
2919
|
});
|
|
2911
2920
|
}, enumerable: !1, configurable: !0 }), J.prototype.transaction = function() {
|
|
2912
2921
|
var e = (function(t, n, r) {
|
|
2913
2922
|
var i = arguments.length;
|
|
2914
2923
|
if (i < 2)
|
|
2915
|
-
throw new
|
|
2924
|
+
throw new I.InvalidArgument("Too few arguments");
|
|
2916
2925
|
for (var o = new Array(i - 1); --i; )
|
|
2917
2926
|
o[i - 1] = arguments[i];
|
|
2918
2927
|
return r = o.pop(), [t, Wn(o), r];
|
|
@@ -2932,64 +2941,64 @@ var Er = { exports: {} };
|
|
|
2932
2941
|
o = rn;
|
|
2933
2942
|
else {
|
|
2934
2943
|
if (e != "rw" && e != on)
|
|
2935
|
-
throw new
|
|
2944
|
+
throw new I.InvalidArgument("Invalid transaction mode: " + e);
|
|
2936
2945
|
o = on;
|
|
2937
2946
|
}
|
|
2938
2947
|
if (i) {
|
|
2939
2948
|
if (i.mode === rn && o === on) {
|
|
2940
2949
|
if (!u)
|
|
2941
|
-
throw new
|
|
2950
|
+
throw new I.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
2942
2951
|
i = null;
|
|
2943
2952
|
}
|
|
2944
2953
|
i && a.forEach(function(l) {
|
|
2945
2954
|
if (i && i.storeNames.indexOf(l) === -1) {
|
|
2946
2955
|
if (!u)
|
|
2947
|
-
throw new
|
|
2956
|
+
throw new I.SubTransaction("Table " + l + " not included in parent transaction.");
|
|
2948
2957
|
i = null;
|
|
2949
2958
|
}
|
|
2950
2959
|
}), u && i && !i.active && (i = null);
|
|
2951
2960
|
}
|
|
2952
2961
|
} catch (l) {
|
|
2953
|
-
return i ? i._promise(null, function(
|
|
2962
|
+
return i ? i._promise(null, function(g, c) {
|
|
2954
2963
|
c(l);
|
|
2955
2964
|
}) : X(l);
|
|
2956
2965
|
}
|
|
2957
|
-
var
|
|
2966
|
+
var d = (function l(g, c, f, h, y) {
|
|
2958
2967
|
return K.resolve().then(function() {
|
|
2959
|
-
var
|
|
2960
|
-
if (p.explicit = !0,
|
|
2961
|
-
p.idbtrans =
|
|
2968
|
+
var m = D.transless || D, p = g._createTransaction(c, f, g._dbSchema, h);
|
|
2969
|
+
if (p.explicit = !0, m = { trans: p, transless: m }, h)
|
|
2970
|
+
p.idbtrans = h.idbtrans;
|
|
2962
2971
|
else
|
|
2963
2972
|
try {
|
|
2964
|
-
p.create(), p.idbtrans._explicit = !0,
|
|
2965
|
-
} catch (
|
|
2966
|
-
return
|
|
2967
|
-
return l(
|
|
2968
|
-
})) : X(
|
|
2973
|
+
p.create(), p.idbtrans._explicit = !0, g._state.PR1398_maxLoop = 3;
|
|
2974
|
+
} catch (x) {
|
|
2975
|
+
return x.name === Yt.InvalidState && g.isOpen() && 0 < --g._state.PR1398_maxLoop ? (console.warn("Dexie: Need to reopen db"), g.close({ disableAutoOpen: !1 }), g.open().then(function() {
|
|
2976
|
+
return l(g, c, f, null, y);
|
|
2977
|
+
})) : X(x);
|
|
2969
2978
|
}
|
|
2970
2979
|
var b, w = Gt(y);
|
|
2971
|
-
return w && Ye(),
|
|
2972
|
-
var
|
|
2973
|
-
(b = y.call(p, p)) && (w ? (
|
|
2974
|
-
},
|
|
2975
|
-
return p.active ?
|
|
2976
|
-
}) :
|
|
2980
|
+
return w && Ye(), m = K.follow(function() {
|
|
2981
|
+
var x;
|
|
2982
|
+
(b = y.call(p, p)) && (w ? (x = Oe.bind(null, null), b.then(x, x)) : typeof b.next == "function" && typeof b.throw == "function" && (b = Sn(b)));
|
|
2983
|
+
}, m), (b && typeof b.then == "function" ? K.resolve(b).then(function(x) {
|
|
2984
|
+
return p.active ? x : X(new I.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
2985
|
+
}) : m.then(function() {
|
|
2977
2986
|
return b;
|
|
2978
|
-
})).then(function(
|
|
2979
|
-
return
|
|
2980
|
-
return
|
|
2987
|
+
})).then(function(x) {
|
|
2988
|
+
return h && p._resolve(), p._completion.then(function() {
|
|
2989
|
+
return x;
|
|
2981
2990
|
});
|
|
2982
|
-
}).catch(function(
|
|
2983
|
-
return p._reject(
|
|
2991
|
+
}).catch(function(x) {
|
|
2992
|
+
return p._reject(x), X(x);
|
|
2984
2993
|
});
|
|
2985
2994
|
});
|
|
2986
2995
|
}).bind(null, this, o, a, i, n);
|
|
2987
|
-
return i ? i._promise(o,
|
|
2988
|
-
return r._whenReady(
|
|
2989
|
-
}) : this._whenReady(
|
|
2996
|
+
return i ? i._promise(o, d, "lock") : D.trans ? Te(D.transless, function() {
|
|
2997
|
+
return r._whenReady(d);
|
|
2998
|
+
}) : this._whenReady(d);
|
|
2990
2999
|
}, J.prototype.table = function(e) {
|
|
2991
3000
|
if (!ne(this._allTables, e))
|
|
2992
|
-
throw new
|
|
3001
|
+
throw new I.InvalidTable("Table ".concat(e, " does not exist"));
|
|
2993
3002
|
return this._allTables[e];
|
|
2994
3003
|
}, J);
|
|
2995
3004
|
function J(e, t) {
|
|
@@ -2997,36 +3006,36 @@ var Er = { exports: {} };
|
|
|
2997
3006
|
this._middlewares = {}, this.verno = 0;
|
|
2998
3007
|
var r = J.dependencies;
|
|
2999
3008
|
this._options = t = _({ addons: J.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;
|
|
3000
|
-
var i, o, a, u,
|
|
3009
|
+
var i, o, a, u, d, l = { dbOpenError: null, isBeingOpened: !1, onReadyBeingFired: null, openComplete: !1, dbReadyResolve: V, dbReadyPromise: null, cancelOpen: V, openCanceller: null, autoSchema: !0, PR1398_maxLoop: 3, autoOpen: t.autoOpen };
|
|
3001
3010
|
l.dbReadyPromise = new K(function(c) {
|
|
3002
3011
|
l.dbReadyResolve = c;
|
|
3003
3012
|
}), l.openCanceller = new K(function(c, f) {
|
|
3004
3013
|
l.cancelOpen = f;
|
|
3005
3014
|
}), this._state = l, this.name = e, this.on = at(this, "populate", "blocked", "versionchange", "close", { ready: [Ht, V] }), this.on.ready.subscribe = zn(this.on.ready.subscribe, function(c) {
|
|
3006
|
-
return function(f,
|
|
3015
|
+
return function(f, h) {
|
|
3007
3016
|
J.vip(function() {
|
|
3008
|
-
var y,
|
|
3009
|
-
|
|
3017
|
+
var y, m = n._state;
|
|
3018
|
+
m.openComplete ? (m.dbOpenError || K.resolve().then(f), h && c(f)) : m.onReadyBeingFired ? (m.onReadyBeingFired.push(f), h && c(f)) : (c(f), y = n, h || c(function p() {
|
|
3010
3019
|
y.on.ready.unsubscribe(f), y.on.ready.unsubscribe(p);
|
|
3011
3020
|
}));
|
|
3012
3021
|
});
|
|
3013
3022
|
};
|
|
3014
3023
|
}), this.Collection = (i = this, st(Gr.prototype, function(b, p) {
|
|
3015
3024
|
this.db = i;
|
|
3016
|
-
var
|
|
3025
|
+
var h = er, y = null;
|
|
3017
3026
|
if (p)
|
|
3018
3027
|
try {
|
|
3019
|
-
|
|
3028
|
+
h = p();
|
|
3020
3029
|
} catch (w) {
|
|
3021
3030
|
y = w;
|
|
3022
3031
|
}
|
|
3023
|
-
var
|
|
3024
|
-
this._ctx = { table: p, index:
|
|
3025
|
-
})), this.Table = (o = this, st(ir.prototype, function(c, f,
|
|
3026
|
-
this.db = o, this._tx =
|
|
3027
|
-
})), this.Transaction = (a = this, st(Qr.prototype, function(c, f,
|
|
3032
|
+
var m = b._ctx, p = m.table, b = p.hook.reading.fire;
|
|
3033
|
+
this._ctx = { table: p, index: m.index, isPrimKey: !m.index || p.schema.primKey.keyPath && m.index === p.schema.primKey.name, range: h, keysOnly: !1, dir: "next", unique: "", algorithm: null, filter: null, replayFilter: null, justLimit: !0, isMatch: null, offset: 0, limit: 1 / 0, error: y, or: m.or, valueMapper: b !== et ? b : null };
|
|
3034
|
+
})), this.Table = (o = this, st(ir.prototype, function(c, f, h) {
|
|
3035
|
+
this.db = o, this._tx = h, this.name = c, this.schema = f, this.hook = o._allTables[c] ? o._allTables[c].hook : at(null, { creating: [Mr, V], reading: [Rr, et], updating: [Nr, V], deleting: [Fr, V] });
|
|
3036
|
+
})), this.Transaction = (a = this, st(Qr.prototype, function(c, f, h, y, m) {
|
|
3028
3037
|
var p = this;
|
|
3029
|
-
this.db = a, this.mode = c, this.storeNames = f, this.schema =
|
|
3038
|
+
this.db = a, this.mode = c, this.storeNames = f, this.schema = h, this.chromeTransactionDurability = y, this.idbtrans = null, this.on = at(this, "complete", "error", "abort"), this.parent = m || 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 K(function(b, w) {
|
|
3030
3039
|
p._resolve = b, p._reject = w;
|
|
3031
3040
|
}), this._completion.then(function() {
|
|
3032
3041
|
p.active = !1, p.on.complete.fire();
|
|
@@ -3036,21 +3045,21 @@ var Er = { exports: {} };
|
|
|
3036
3045
|
});
|
|
3037
3046
|
})), this.Version = (u = this, st(ni.prototype, function(c) {
|
|
3038
3047
|
this.db = u, this._cfg = { version: c, storesSource: null, dbschema: {}, tables: {}, contentUpgrade: null };
|
|
3039
|
-
})), this.WhereClause = (
|
|
3040
|
-
if (this.db =
|
|
3041
|
-
return
|
|
3042
|
-
}, this._max = function(y,
|
|
3043
|
-
return 0 <
|
|
3044
|
-
}, this._min = function(y,
|
|
3045
|
-
return
|
|
3046
|
-
}, this._IDBKeyRange =
|
|
3047
|
-
throw new
|
|
3048
|
+
})), this.WhereClause = (d = this, st(ur.prototype, function(c, f, h) {
|
|
3049
|
+
if (this.db = d, this._ctx = { table: c, index: f === ":id" ? null : f, or: h }, this._cmp = this._ascending = U, this._descending = function(y, m) {
|
|
3050
|
+
return U(m, y);
|
|
3051
|
+
}, this._max = function(y, m) {
|
|
3052
|
+
return 0 < U(y, m) ? y : m;
|
|
3053
|
+
}, this._min = function(y, m) {
|
|
3054
|
+
return U(y, m) < 0 ? y : m;
|
|
3055
|
+
}, this._IDBKeyRange = d._deps.IDBKeyRange, !this._IDBKeyRange)
|
|
3056
|
+
throw new I.MissingAPI();
|
|
3048
3057
|
})), this.on("versionchange", function(c) {
|
|
3049
3058
|
0 < c.newVersion ? console.warn("Another connection wants to upgrade database '".concat(n.name, "'. Closing db now to resume the upgrade.")) : console.warn("Another connection wants to delete database '".concat(n.name, "'. Closing db now to resume the delete request.")), n.close({ disableAutoOpen: !1 });
|
|
3050
3059
|
}), this.on("blocked", function(c) {
|
|
3051
3060
|
!c.newVersion || c.newVersion < c.oldVersion ? console.warn("Dexie.delete('".concat(n.name, "') was blocked")) : console.warn("Upgrade '".concat(n.name, "' blocked by other connection holding version ").concat(c.oldVersion / 10));
|
|
3052
|
-
}), this._maxKey = lt(t.IDBKeyRange), this._createTransaction = function(c, f,
|
|
3053
|
-
return new n.Transaction(c, f,
|
|
3061
|
+
}), this._maxKey = lt(t.IDBKeyRange), this._createTransaction = function(c, f, h, y) {
|
|
3062
|
+
return new n.Transaction(c, f, h, n._options.chromeTransactionDurability, y);
|
|
3054
3063
|
}, this._fireOnBlocked = function(c) {
|
|
3055
3064
|
n.on("blocked").fire(c), He.filter(function(f) {
|
|
3056
3065
|
return f.name === n.name && f !== n && !f._state.vcFired;
|
|
@@ -3058,21 +3067,21 @@ var Er = { exports: {} };
|
|
|
3058
3067
|
return f.on("versionchange").fire(c);
|
|
3059
3068
|
});
|
|
3060
3069
|
}, this.use(ai), this.use(li), this.use(si), this.use(ii), this.use(oi);
|
|
3061
|
-
var
|
|
3070
|
+
var g = new Proxy(this, { get: function(c, f, h) {
|
|
3062
3071
|
if (f === "_vip")
|
|
3063
3072
|
return !0;
|
|
3064
3073
|
if (f === "table")
|
|
3065
|
-
return function(
|
|
3066
|
-
return Lt(n.table(
|
|
3074
|
+
return function(m) {
|
|
3075
|
+
return Lt(n.table(m), g);
|
|
3067
3076
|
};
|
|
3068
|
-
var y = Reflect.get(c, f,
|
|
3069
|
-
return y instanceof ir ? Lt(y,
|
|
3070
|
-
return Lt(
|
|
3077
|
+
var y = Reflect.get(c, f, h);
|
|
3078
|
+
return y instanceof ir ? Lt(y, g) : f === "tables" ? y.map(function(m) {
|
|
3079
|
+
return Lt(m, g);
|
|
3071
3080
|
}) : f === "_createTransaction" ? function() {
|
|
3072
|
-
return Lt(y.apply(this, arguments),
|
|
3081
|
+
return Lt(y.apply(this, arguments), g);
|
|
3073
3082
|
} : y;
|
|
3074
3083
|
} });
|
|
3075
|
-
this.vip =
|
|
3084
|
+
this.vip = g, r.forEach(function(c) {
|
|
3076
3085
|
return c(n);
|
|
3077
3086
|
});
|
|
3078
3087
|
}
|
|
@@ -3085,40 +3094,40 @@ var Er = { exports: {} };
|
|
|
3085
3094
|
this._subscribe = e;
|
|
3086
3095
|
}
|
|
3087
3096
|
try {
|
|
3088
|
-
Ut = { indexedDB:
|
|
3097
|
+
Ut = { indexedDB: F.indexedDB || F.mozIndexedDB || F.webkitIndexedDB || F.msIndexedDB, IDBKeyRange: F.IDBKeyRange || F.webkitIDBKeyRange };
|
|
3089
3098
|
} catch {
|
|
3090
3099
|
Ut = { indexedDB: null, IDBKeyRange: null };
|
|
3091
3100
|
}
|
|
3092
|
-
function
|
|
3101
|
+
function xr(e) {
|
|
3093
3102
|
var t, n = !1, r = new fi(function(i) {
|
|
3094
|
-
var o = Gt(e), a, u = !1,
|
|
3103
|
+
var o = Gt(e), a, u = !1, d = {}, l = {}, g = { get closed() {
|
|
3095
3104
|
return u;
|
|
3096
3105
|
}, unsubscribe: function() {
|
|
3097
|
-
u || (u = !0, a && a.abort(), c && Pe.storagemutated.unsubscribe(
|
|
3106
|
+
u || (u = !0, a && a.abort(), c && Pe.storagemutated.unsubscribe(h));
|
|
3098
3107
|
} };
|
|
3099
|
-
i.start && i.start(
|
|
3108
|
+
i.start && i.start(g);
|
|
3100
3109
|
var c = !1, f = function() {
|
|
3101
3110
|
return nn(y);
|
|
3102
|
-
},
|
|
3103
|
-
Ft(
|
|
3111
|
+
}, h = function(m) {
|
|
3112
|
+
Ft(d, m), _n(l, d) && f();
|
|
3104
3113
|
}, y = function() {
|
|
3105
|
-
var
|
|
3106
|
-
!u && Ut.indexedDB && (
|
|
3107
|
-
var
|
|
3114
|
+
var m, p, b;
|
|
3115
|
+
!u && Ut.indexedDB && (d = {}, m = {}, a && a.abort(), a = new AbortController(), b = function(w) {
|
|
3116
|
+
var x = Ve();
|
|
3108
3117
|
try {
|
|
3109
3118
|
o && Ye();
|
|
3110
|
-
var
|
|
3111
|
-
return
|
|
3119
|
+
var k = ke(e, w);
|
|
3120
|
+
return k = o ? k.finally(Oe) : k;
|
|
3112
3121
|
} finally {
|
|
3113
|
-
|
|
3122
|
+
x && Ge();
|
|
3114
3123
|
}
|
|
3115
|
-
}(p = { subscr:
|
|
3116
|
-
n = !0, t = w, u || p.signal.aborted || (
|
|
3117
|
-
for (var
|
|
3118
|
-
if (ne(
|
|
3124
|
+
}(p = { subscr: m, signal: a.signal, requery: f, querier: e, trans: null }), Promise.resolve(b).then(function(w) {
|
|
3125
|
+
n = !0, t = w, u || p.signal.aborted || (d = {}, function(x) {
|
|
3126
|
+
for (var k in x)
|
|
3127
|
+
if (ne(x, k))
|
|
3119
3128
|
return;
|
|
3120
3129
|
return 1;
|
|
3121
|
-
}(l =
|
|
3130
|
+
}(l = m) || c || (Pe(ct, h), c = !0), nn(function() {
|
|
3122
3131
|
return !u && i.next && i.next(w);
|
|
3123
3132
|
}));
|
|
3124
3133
|
}, function(w) {
|
|
@@ -3127,7 +3136,7 @@ var Er = { exports: {} };
|
|
|
3127
3136
|
});
|
|
3128
3137
|
}));
|
|
3129
3138
|
};
|
|
3130
|
-
return setTimeout(f, 0),
|
|
3139
|
+
return setTimeout(f, 0), g;
|
|
3131
3140
|
});
|
|
3132
3141
|
return r.hasValue = function() {
|
|
3133
3142
|
return n;
|
|
@@ -3144,7 +3153,7 @@ var Er = { exports: {} };
|
|
|
3144
3153
|
je = t;
|
|
3145
3154
|
}
|
|
3146
3155
|
}
|
|
3147
|
-
ze(Me, _(_({},
|
|
3156
|
+
ze(Me, _(_({}, mt), { delete: function(e) {
|
|
3148
3157
|
return new Me(e, { addons: [] }).delete();
|
|
3149
3158
|
}, exists: function(e) {
|
|
3150
3159
|
return new Me(e, { addons: [] }).open().then(function(t) {
|
|
@@ -3154,15 +3163,15 @@ var Er = { exports: {} };
|
|
|
3154
3163
|
});
|
|
3155
3164
|
}, getDatabaseNames: function(e) {
|
|
3156
3165
|
try {
|
|
3157
|
-
return t = Me.dependencies, n = t.indexedDB, t = t.IDBKeyRange, (
|
|
3166
|
+
return t = Me.dependencies, n = t.indexedDB, t = t.IDBKeyRange, (mn(n) ? Promise.resolve(n.databases()).then(function(r) {
|
|
3158
3167
|
return r.map(function(i) {
|
|
3159
3168
|
return i.name;
|
|
3160
3169
|
}).filter(function(i) {
|
|
3161
3170
|
return i !== Et;
|
|
3162
3171
|
});
|
|
3163
|
-
}) :
|
|
3172
|
+
}) : gn(n, t).toCollection().primaryKeys()).then(e);
|
|
3164
3173
|
} catch {
|
|
3165
|
-
return X(new
|
|
3174
|
+
return X(new I.MissingAPI());
|
|
3166
3175
|
}
|
|
3167
3176
|
var t, n;
|
|
3168
3177
|
}, defineClass: function() {
|
|
@@ -3195,11 +3204,11 @@ var Er = { exports: {} };
|
|
|
3195
3204
|
return fe;
|
|
3196
3205
|
}, set: function(e) {
|
|
3197
3206
|
Yn(e);
|
|
3198
|
-
} }, derive: Le, extend: q, props: ze, override: zn, Events: at, on: Pe, liveQuery:
|
|
3207
|
+
} }, derive: Le, extend: q, props: ze, override: zn, Events: at, on: Pe, liveQuery: xr, extendObservabilitySet: Ft, getByKeyPath: ye, setByKeyPath: ce, delByKeyPath: function(e, t) {
|
|
3199
3208
|
typeof t == "string" ? ce(e, t, void 0) : "length" in t && [].map.call(t, function(n) {
|
|
3200
3209
|
ce(e, n, void 0);
|
|
3201
3210
|
});
|
|
3202
|
-
}, shallowClone: Un, deepClone: _e, getObjectDiff: En, cmp:
|
|
3211
|
+
}, shallowClone: Un, deepClone: _e, getObjectDiff: En, cmp: U, asap: Ln, minKey: -1 / 0, addons: [], connections: He, errnames: Yt, dependencies: Ut, cache: Re, semVer: de, version: de.split(".").map(function(e) {
|
|
3203
3212
|
return parseInt(e);
|
|
3204
3213
|
}).reduce(function(e, t, n) {
|
|
3205
3214
|
return e + t / Math.pow(10, 2 * n);
|
|
@@ -3208,9 +3217,9 @@ var Er = { exports: {} };
|
|
|
3208
3217
|
}), addEventListener(cn, function(e) {
|
|
3209
3218
|
e = e.detail, je || Kn(e);
|
|
3210
3219
|
}));
|
|
3211
|
-
var Je, je = !1,
|
|
3220
|
+
var Je, je = !1, kr = function() {
|
|
3212
3221
|
};
|
|
3213
|
-
return typeof BroadcastChannel < "u" && ((
|
|
3222
|
+
return typeof BroadcastChannel < "u" && ((kr = function() {
|
|
3214
3223
|
(Je = new BroadcastChannel(cn)).onmessage = function(e) {
|
|
3215
3224
|
return e.data && Kn(e.data);
|
|
3216
3225
|
};
|
|
@@ -3223,16 +3232,16 @@ var Er = { exports: {} };
|
|
|
3223
3232
|
n[t].close({ disableAutoOpen: !1 });
|
|
3224
3233
|
}
|
|
3225
3234
|
}), addEventListener("pageshow", function(e) {
|
|
3226
|
-
!ve.disableBfCache && e.persisted && (fe && console.debug("Dexie: handling persisted pageshow"),
|
|
3235
|
+
!ve.disableBfCache && e.persisted && (fe && console.debug("Dexie: handling persisted pageshow"), kr(), Kn({ all: new re(-1 / 0, [[]]) }));
|
|
3227
3236
|
})), K.rejectionMapper = function(e, t) {
|
|
3228
3237
|
return !e || e instanceof We || e instanceof TypeError || e instanceof SyntaxError || !e.name || !Gn[e.name] ? e : (t = new Gn[e.name](t || e.message, e), "stack" in e && we(t, "stack", { get: function() {
|
|
3229
3238
|
return this.inner.stack;
|
|
3230
3239
|
} }), t);
|
|
3231
|
-
}, Yn(fe), _(ve, Object.freeze({ __proto__: null, Dexie: ve, liveQuery:
|
|
3240
|
+
}, Yn(fe), _(ve, Object.freeze({ __proto__: null, Dexie: ve, liveQuery: xr, Entity: tr, cmp: U, default: ve, RangeSet: re, mergeRanges: ht, rangesOverlap: Mt }), { default: ve }), ve;
|
|
3232
3241
|
});
|
|
3233
3242
|
})(Er);
|
|
3234
|
-
var
|
|
3235
|
-
const In = /* @__PURE__ */ yi(
|
|
3243
|
+
var gi = Er.exports;
|
|
3244
|
+
const In = /* @__PURE__ */ yi(gi), Sr = Symbol.for("Dexie"), Rn = globalThis[Sr] || (globalThis[Sr] = In);
|
|
3236
3245
|
if (In.semVer !== Rn.semVer)
|
|
3237
3246
|
throw new Error(`Two different versions of Dexie loaded in the same app: ${In.semVer} and ${Rn.semVer}`);
|
|
3238
3247
|
function Q(M) {
|
|
@@ -3240,11 +3249,11 @@ function Q(M) {
|
|
|
3240
3249
|
return M.order && (s += `.${M.order}`), M.period && (s += `.${M.period}`), s;
|
|
3241
3250
|
}
|
|
3242
3251
|
function pt(M, s) {
|
|
3243
|
-
var
|
|
3244
|
-
let v, _, j,
|
|
3252
|
+
var W;
|
|
3253
|
+
let v, _, j, F, T;
|
|
3245
3254
|
switch (M.moderation) {
|
|
3246
3255
|
case "before":
|
|
3247
|
-
v = /* @__PURE__ */ new Date(), _ = (
|
|
3256
|
+
v = /* @__PURE__ */ new Date(), _ = (W = M.beforeTime) == null ? void 0 : W.split(":"), j = Number.parseInt(_ ? _[0] : "00"), F = Number.parseInt(_ ? _[1] : "00"), T = Number.parseInt(_ ? _[2] : "00"), s.before = v.setHours(j, F, T, 0) / 1e3, s.period || (s.period = v.getDay() === 1 ? 72 : 24);
|
|
3248
3257
|
break;
|
|
3249
3258
|
case "delayed":
|
|
3250
3259
|
M.delay && M.delay > 0 && (s.delay = `${M.delay}`);
|
|
@@ -3257,8 +3266,8 @@ function pt(M, s) {
|
|
|
3257
3266
|
}
|
|
3258
3267
|
return s;
|
|
3259
3268
|
}
|
|
3260
|
-
const Ne = "messages", Pr = "cloud", Mn = "series",
|
|
3261
|
-
class
|
|
3269
|
+
const Ne = "messages", Pr = "cloud", Mn = "series", mi = "topics", vi = "keyval", bi = "local", wi = "session", _i = "dexie", xi = "window";
|
|
3270
|
+
class ki {
|
|
3262
3271
|
constructor(s) {
|
|
3263
3272
|
A(this, "db");
|
|
3264
3273
|
A(this, "subscribers", []);
|
|
@@ -3285,15 +3294,15 @@ class xi {
|
|
|
3285
3294
|
const _ = v.title;
|
|
3286
3295
|
try {
|
|
3287
3296
|
return v.data.messages.forEach(async (j) => {
|
|
3288
|
-
var
|
|
3289
|
-
await this.db.table(Ne).put({ id: j.id, utc: j.utc, data: j }), await this.db.table(
|
|
3297
|
+
var F, T, W;
|
|
3298
|
+
await this.db.table(Ne).put({ id: j.id, utc: j.utc, data: j }), await this.db.table(mi).put({
|
|
3290
3299
|
widget_id: s.widget,
|
|
3291
3300
|
message_id: j.id,
|
|
3292
3301
|
dashboard_id: s.dashboard,
|
|
3293
3302
|
title: _,
|
|
3294
|
-
engagement: (
|
|
3295
|
-
impressions: (
|
|
3296
|
-
reach: (
|
|
3303
|
+
engagement: (F = j.dynamics) == null ? void 0 : F.engagement,
|
|
3304
|
+
impressions: (T = j.dynamics) == null ? void 0 : T.semrush_visits,
|
|
3305
|
+
reach: (W = j.dynamics) == null ? void 0 : W.potential_reach,
|
|
3297
3306
|
sentiment: j.topics[0].sentiment,
|
|
3298
3307
|
utc: j.utc
|
|
3299
3308
|
});
|
|
@@ -3303,17 +3312,17 @@ class xi {
|
|
|
3303
3312
|
}
|
|
3304
3313
|
});
|
|
3305
3314
|
A(this, "getMessages", async (s) => {
|
|
3306
|
-
const v = (
|
|
3315
|
+
const v = (F) => F.widget_id === s.widget, _ = (F) => F.utc > ((s == null ? void 0 : s.since) || 0), j = (F) => (F == null ? void 0 : F.visible) !== 0;
|
|
3307
3316
|
try {
|
|
3308
|
-
const
|
|
3317
|
+
const F = await this.db.table("topics").orderBy("utc").reverse().filter(v).filter(_).filter(j).limit((s == null ? void 0 : s.limit) ?? 25).toArray(), T = F[0] ? F[0].title : "No results", W = F.map(
|
|
3309
3318
|
(oe) => oe.message_id
|
|
3310
|
-
), q = await this.db.table("messages").where("id").anyOf(
|
|
3319
|
+
), q = await this.db.table("messages").where("id").anyOf(W).toArray().then((oe) => oe.sort((Z, ne) => ne.utc - Z.utc));
|
|
3311
3320
|
return {
|
|
3312
3321
|
data: {
|
|
3313
3322
|
presentation: (s == null ? void 0 : s.presentation) || "not set",
|
|
3314
3323
|
slide: (s == null ? void 0 : s.slide) || "not set",
|
|
3315
3324
|
messages: q.map((oe) => oe.data),
|
|
3316
|
-
title:
|
|
3325
|
+
title: T,
|
|
3317
3326
|
topics: [s.dashboard, s.widget].join("-"),
|
|
3318
3327
|
query: s
|
|
3319
3328
|
}
|
|
@@ -3324,8 +3333,8 @@ class xi {
|
|
|
3324
3333
|
});
|
|
3325
3334
|
A(this, "cleanMessages", async (s) => {
|
|
3326
3335
|
const v = Date.now() / 1e3, _ = (j) => j.utc < s - v;
|
|
3327
|
-
await this.db.table("topics").orderBy("utc").filter(_).modify((j,
|
|
3328
|
-
delete
|
|
3336
|
+
await this.db.table("topics").orderBy("utc").filter(_).modify((j, F) => {
|
|
3337
|
+
delete F.value;
|
|
3329
3338
|
});
|
|
3330
3339
|
});
|
|
3331
3340
|
A(this, "subscribe", (s) => {
|
|
@@ -3336,7 +3345,12 @@ class xi {
|
|
|
3336
3345
|
}
|
|
3337
3346
|
this.subscribers.filter(
|
|
3338
3347
|
(j) => j.widget === s.widget
|
|
3339
|
-
).length > 0 || (s.type === Ne && (s = pt(this.options, s)), console.
|
|
3348
|
+
).length > 0 || (s.type === Ne && (s = pt(this.options, s)), console.info(
|
|
3349
|
+
"%cstorage",
|
|
3350
|
+
"color:white;background-color:indigo;padding:0 4px 0 4px;border-radius:5px;",
|
|
3351
|
+
"subscribe",
|
|
3352
|
+
s
|
|
3353
|
+
), this.subscribers.push(s));
|
|
3340
3354
|
});
|
|
3341
3355
|
this.options = s, this.db = new Rn(s.app), this.db.version(2).stores({
|
|
3342
3356
|
player: "id,title,name,location",
|
|
@@ -3364,7 +3378,7 @@ function Oi(M, s) {
|
|
|
3364
3378
|
const v = indexedDB.open(M);
|
|
3365
3379
|
v.onupgradeneeded = () => v.result.createObjectStore(s);
|
|
3366
3380
|
const _ = Fn(v);
|
|
3367
|
-
return (j,
|
|
3381
|
+
return (j, F) => _.then((T) => F(T.transaction(s, j).objectStore(s)));
|
|
3368
3382
|
}
|
|
3369
3383
|
let Dn;
|
|
3370
3384
|
function jr() {
|
|
@@ -3419,7 +3433,12 @@ class Si {
|
|
|
3419
3433
|
}
|
|
3420
3434
|
s.type === Ne && (s = pt(this.options, s)), !(this.subscribers.filter(
|
|
3421
3435
|
(j) => j.widget === s.widget
|
|
3422
|
-
).length > 0) &&
|
|
3436
|
+
).length > 0) && (console.info(
|
|
3437
|
+
"%cstorage",
|
|
3438
|
+
"color:white;background-color:indigo;padding:0 4px 0 4px;border-radius:5px;",
|
|
3439
|
+
"subscribe",
|
|
3440
|
+
s
|
|
3441
|
+
), this.subscribers.push(s));
|
|
3423
3442
|
});
|
|
3424
3443
|
this.options = s;
|
|
3425
3444
|
}
|
|
@@ -3498,7 +3517,12 @@ class Ei {
|
|
|
3498
3517
|
}
|
|
3499
3518
|
s.type === Ne && (s = pt(this.options, s)), !this.subscribers.filter(
|
|
3500
3519
|
(j) => j.widget === s.widget
|
|
3501
|
-
).length &&
|
|
3520
|
+
).length && (console.info(
|
|
3521
|
+
"%cstorage",
|
|
3522
|
+
"color:white;background-color:indigo;padding:0 4px 0 4px;border-radius:5px;",
|
|
3523
|
+
"subscribe",
|
|
3524
|
+
s
|
|
3525
|
+
), this.subscribers.push(s));
|
|
3502
3526
|
});
|
|
3503
3527
|
this.options = s, Storage.prototype.setObject = function(v, _) {
|
|
3504
3528
|
this.setObject(v, JSON.stringify(_));
|
|
@@ -3582,7 +3606,12 @@ class Pi {
|
|
|
3582
3606
|
}
|
|
3583
3607
|
s.type === Ne && (s = pt(this.options, s)), !this.subscribers.filter(
|
|
3584
3608
|
(j) => j.widget === s.widget
|
|
3585
|
-
).length &&
|
|
3609
|
+
).length && (console.info(
|
|
3610
|
+
"%cstorage",
|
|
3611
|
+
"color:white;background-color:indigo;padding:0 4px 0 4px;border-radius:5px;",
|
|
3612
|
+
"subscribe",
|
|
3613
|
+
s
|
|
3614
|
+
), this.subscribers.push(s));
|
|
3586
3615
|
});
|
|
3587
3616
|
this.options = s, Storage.prototype.setObject = function(v, _) {
|
|
3588
3617
|
this.setItem(v, JSON.stringify(_));
|
|
@@ -3666,7 +3695,12 @@ class ji {
|
|
|
3666
3695
|
}
|
|
3667
3696
|
s.type === Ne && (s = pt(this.options, s)), !this.subscribers.filter(
|
|
3668
3697
|
(j) => j.widget === s.widget
|
|
3669
|
-
).length &&
|
|
3698
|
+
).length && (console.info(
|
|
3699
|
+
"%cstorage",
|
|
3700
|
+
"color:white;background-color:indigo;padding:0 4px 0 4px;border-radius:5px;",
|
|
3701
|
+
"subscribe",
|
|
3702
|
+
s
|
|
3703
|
+
), this.subscribers.push(s));
|
|
3670
3704
|
});
|
|
3671
3705
|
this.options = s, window.BuzzCasting.WidgetData = /* @__PURE__ */ new Set();
|
|
3672
3706
|
}
|
|
@@ -3689,35 +3723,60 @@ class Ki {
|
|
|
3689
3723
|
s == null || s.forEach((j) => {
|
|
3690
3724
|
v.push(this.api.get(j));
|
|
3691
3725
|
}), await Promise.allSettled(v).then(
|
|
3692
|
-
(j) => j.forEach(async (
|
|
3693
|
-
var
|
|
3694
|
-
let
|
|
3695
|
-
if (
|
|
3696
|
-
const Z =
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3726
|
+
(j) => j.forEach(async (F) => {
|
|
3727
|
+
var W, q, oe;
|
|
3728
|
+
let T = 400;
|
|
3729
|
+
if (F.status === "fulfilled") {
|
|
3730
|
+
const Z = F.value;
|
|
3731
|
+
if (Z.success === !0)
|
|
3732
|
+
switch (Z.query.type) {
|
|
3733
|
+
case Ne:
|
|
3734
|
+
T = await ((W = this.sm) == null ? void 0 : W.setMessages(Z.query, Z));
|
|
3735
|
+
break;
|
|
3736
|
+
case Pr:
|
|
3737
|
+
T = await ((q = this.sm) == null ? void 0 : q.setCloud(Z.query, Z));
|
|
3738
|
+
break;
|
|
3739
|
+
case Mn:
|
|
3740
|
+
T = await ((oe = this.sm) == null ? void 0 : oe.setSeries(Z.query, Z));
|
|
3741
|
+
break;
|
|
3742
|
+
default:
|
|
3743
|
+
console.warn(
|
|
3744
|
+
"%cstorage",
|
|
3745
|
+
"color:white;background-color:indigo;padding:0 4px 0 4px;border-radius:5px;",
|
|
3746
|
+
"error",
|
|
3747
|
+
`data type ${Z.query.type} unknown`
|
|
3748
|
+
);
|
|
3749
|
+
}
|
|
3750
|
+
else
|
|
3751
|
+
T = 401;
|
|
3752
|
+
switch (T) {
|
|
3753
|
+
case 201:
|
|
3754
|
+
console.info(
|
|
3755
|
+
"%cbroadcast",
|
|
3756
|
+
"color:white;background-color:orange;padding:0 4px 0 4px;border-radius:5px;",
|
|
3757
|
+
"send",
|
|
3758
|
+
Z.data.title ?? Z.query.widget,
|
|
3759
|
+
Z.query,
|
|
3760
|
+
T
|
|
3761
|
+
), this.bc.postMessage({ event: "widget-update", data: Z.query });
|
|
3703
3762
|
break;
|
|
3704
|
-
case
|
|
3705
|
-
|
|
3763
|
+
case 400:
|
|
3764
|
+
console.warn(
|
|
3765
|
+
"%cbroadcast",
|
|
3766
|
+
"color:white;background-color:orange;padding:0 4px 0 4px;border-radius:5px;",
|
|
3767
|
+
"error",
|
|
3768
|
+
Z.data.title ?? Z.query.widget,
|
|
3769
|
+
Z.query,
|
|
3770
|
+
T
|
|
3771
|
+
);
|
|
3706
3772
|
break;
|
|
3707
|
-
default:
|
|
3708
|
-
console.warn(`[storage] data type ${Z.query.type} unknown`);
|
|
3709
3773
|
}
|
|
3710
|
-
F === 201 ? (console.debug(
|
|
3711
|
-
"[broadcast]",
|
|
3712
|
-
Z.data.title ?? Z.query.widget,
|
|
3713
|
-
Z.query
|
|
3714
|
-
), this.bc.postMessage({ event: "widget-update", data: Z.query })) : console.warn(
|
|
3715
|
-
"[broadcast]",
|
|
3716
|
-
Z.data.title ?? Z.query.widget,
|
|
3717
|
-
Z.query
|
|
3718
|
-
);
|
|
3719
3774
|
} else
|
|
3720
|
-
console.warn(
|
|
3775
|
+
console.warn(
|
|
3776
|
+
"%cstorage",
|
|
3777
|
+
"color:white;background-color:indigo;padding:0 4px 0 4px;border-radius:5px;",
|
|
3778
|
+
"error"
|
|
3779
|
+
);
|
|
3721
3780
|
})
|
|
3722
3781
|
);
|
|
3723
3782
|
});
|
|
@@ -3731,7 +3790,12 @@ class Ki {
|
|
|
3731
3790
|
(v = this.sm) == null || v.subscribe(s.data.data);
|
|
3732
3791
|
break;
|
|
3733
3792
|
case "update":
|
|
3734
|
-
console.debug(
|
|
3793
|
+
console.debug(
|
|
3794
|
+
"%cstorage",
|
|
3795
|
+
"color:white;background-color:indigo;padding:0 4px 0 4px;border-radius:5px;",
|
|
3796
|
+
"update",
|
|
3797
|
+
s.data
|
|
3798
|
+
), await this.update();
|
|
3735
3799
|
break;
|
|
3736
3800
|
}
|
|
3737
3801
|
});
|
|
@@ -3758,11 +3822,16 @@ class Ki {
|
|
|
3758
3822
|
});
|
|
3759
3823
|
this.options = s;
|
|
3760
3824
|
const v = (s == null ? void 0 : s.slide) || s.app;
|
|
3761
|
-
switch (this.bc = new BroadcastChannel(v), console.
|
|
3825
|
+
switch (this.bc = new BroadcastChannel(v), console.info(
|
|
3826
|
+
"%cbroadcast",
|
|
3827
|
+
"color:white;background-color:orange;padding:0 4px 0 4px;border-radius:5px;",
|
|
3828
|
+
"channel",
|
|
3829
|
+
v
|
|
3830
|
+
), this.bc.onmessage = (_) => {
|
|
3762
3831
|
this.actions(_);
|
|
3763
3832
|
}, this.bc.postMessage({ event: "sm-init", data: {} }), this.api = new pi(s), s.storage) {
|
|
3764
3833
|
case _i:
|
|
3765
|
-
this.sm = new
|
|
3834
|
+
this.sm = new ki(s);
|
|
3766
3835
|
break;
|
|
3767
3836
|
case bi:
|
|
3768
3837
|
this.sm = new Pi(s);
|
|
@@ -3773,7 +3842,7 @@ class Ki {
|
|
|
3773
3842
|
case vi:
|
|
3774
3843
|
this.sm = new Si(s);
|
|
3775
3844
|
break;
|
|
3776
|
-
case
|
|
3845
|
+
case xi:
|
|
3777
3846
|
this.sm = new ji(s);
|
|
3778
3847
|
break;
|
|
3779
3848
|
default:
|
|
@@ -3789,7 +3858,7 @@ export {
|
|
|
3789
3858
|
vi as STORAGE_KEYVAL,
|
|
3790
3859
|
bi as STORAGE_LOCAL,
|
|
3791
3860
|
wi as STORAGE_SESSION,
|
|
3792
|
-
|
|
3793
|
-
|
|
3861
|
+
xi as STORAGE_WINDOW,
|
|
3862
|
+
mi as TOPICS,
|
|
3794
3863
|
Ki as default
|
|
3795
3864
|
};
|